@enact/spotlight
Advanced tools
Comparing version 3.4.1 to 3.4.2
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -10,3 +8,3 @@ value: true | ||
var _classCallCheck2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/classCallCheck")); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -36,4 +34,5 @@ /** | ||
var frequency = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [3, 3, 3, 2, 2, 2, 1]; | ||
(0, _classCallCheck2["default"])(this, Accelerator); | ||
_classCallCheck(this, Accelerator); | ||
this.processKey = function (event, callback) { | ||
@@ -40,0 +39,0 @@ switch (event.type) { |
@@ -5,2 +5,6 @@ # Change Log | ||
## [3.4.2] - 2020-08-05 | ||
No significant changes. | ||
## [3.4.1] - 2020-08-05 | ||
@@ -7,0 +11,0 @@ |
{ | ||
"name": "@enact/spotlight", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"description": "A focus management library", | ||
@@ -21,3 +21,3 @@ "main": "src/spotlight.js", | ||
"dependencies": { | ||
"@enact/core": "^3.4.1", | ||
"@enact/core": "^3.4.2", | ||
"prop-types": "^15.7.2", | ||
@@ -24,0 +24,0 @@ "ramda": "^0.24.1", |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -13,6 +11,8 @@ value: true | ||
var _classCallCheck2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/classCallCheck")); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _createClass2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createClass")); | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
/** | ||
@@ -101,7 +101,8 @@ * Provides a class which allows consumers to safely pause and resume spotlight without resuming | ||
function Pause(name) { | ||
(0, _classCallCheck2["default"])(this, Pause); | ||
_classCallCheck(this, Pause); | ||
this.name = name; | ||
} | ||
(0, _createClass2["default"])(Pause, [{ | ||
_createClass(Pause, [{ | ||
key: "toString", | ||
@@ -159,2 +160,3 @@ value: function toString() { | ||
}]); | ||
return Pause; | ||
@@ -161,0 +163,0 @@ }(); |
"use strict"; | ||
var _interopRequireWildcard = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireWildcard"); | ||
var _Pause = _interopRequireWildcard(require("../Pause")); | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var PAUSED = 'Paused'; | ||
@@ -8,0 +10,0 @@ var NOT_PAUSED = 'Not Paused'; |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -10,35 +8,46 @@ value: true | ||
var _objectSpread2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/objectSpread2")); | ||
var _handle = require("@enact/core/handle"); | ||
var _classCallCheck2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/classCallCheck")); | ||
var _hoc = _interopRequireDefault(require("@enact/core/hoc")); | ||
var _createClass2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createClass")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _assertThisInitialized2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/assertThisInitialized")); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _inherits2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/inherits")); | ||
var _pointer = require("../src/pointer"); | ||
var _createSuper2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createSuper")); | ||
var _spotlight = _interopRequireDefault(require("../src/spotlight")); | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/objectWithoutProperties")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _handle = require("@enact/core/handle"); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
var _hoc = _interopRequireDefault(require("@enact/core/hoc")); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
var _react = _interopRequireDefault(require("react")); | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _pointer = require("../src/pointer"); | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
var _spotlight = _interopRequireDefault(require("../src/spotlight")); | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
/** | ||
* A component for managing groups of spottable components. | ||
* | ||
* @module spotlight/SpotlightContainerDecorator | ||
* @exports SpotlightContainerDecorator | ||
*/ | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
/** | ||
@@ -163,3 +172,3 @@ * The class name to apply to the default component to focus in a container. | ||
preserveId = config.preserveId, | ||
containerConfig = (0, _objectWithoutProperties2["default"])(config, ["navigableFilter", "preserveId"]); | ||
containerConfig = _objectWithoutProperties(config, ["navigableFilter", "preserveId"]); | ||
@@ -194,5 +203,5 @@ var stateFromProps = function stateFromProps(_ref) { | ||
return _temp = _class = /*#__PURE__*/function (_React$Component) { | ||
(0, _inherits2["default"])(_class, _React$Component); | ||
_inherits(_class, _React$Component); | ||
var _super = (0, _createSuper2["default"])(_class); | ||
var _super = _createSuper(_class); | ||
@@ -202,3 +211,4 @@ function _class(props) { | ||
(0, _classCallCheck2["default"])(this, _class); | ||
_classCallCheck(this, _class); | ||
_this = _super.call(this, props); | ||
@@ -224,7 +234,7 @@ | ||
_this.handle = _handle.handle.bind((0, _assertThisInitialized2["default"])(_this)); | ||
_this.handle = _handle.handle.bind(_assertThisInitialized(_this)); | ||
_this.handleBlur = (0, _handle.oneOf)([function () { | ||
return _this.shouldPreventBlur; | ||
}, _handle.stop], [_handle.returnsTrue, (0, _handle.forward)('onBlurCapture')]).bindAs((0, _assertThisInitialized2["default"])(_this), 'handleBlur'); | ||
_this.handleFocus = (0, _handle.oneOf)([(0, _handle.forProp)('spotlightDisabled', true), (0, _handle.handle)(_handle.stop, (0, _handle.call)('silentBlur'))], [_handle.returnsTrue, (0, _handle.forward)('onFocusCapture')]).bindAs((0, _assertThisInitialized2["default"])(_this), 'handleFocus'); | ||
}, _handle.stop], [_handle.returnsTrue, (0, _handle.forward)('onBlurCapture')]).bindAs(_assertThisInitialized(_this), 'handleBlur'); | ||
_this.handleFocus = (0, _handle.oneOf)([(0, _handle.forProp)('spotlightDisabled', true), (0, _handle.handle)(_handle.stop, (0, _handle.call)('silentBlur'))], [_handle.returnsTrue, (0, _handle.forward)('onFocusCapture')]).bindAs(_assertThisInitialized(_this), 'handleFocus'); | ||
_this.handleMouseEnter = _this.handle((0, _handle.forward)('onMouseEnter'), isNewPointerPosition, function () { | ||
@@ -250,3 +260,4 @@ return _spotlight["default"].setActiveContainer(_this.state.id); | ||
_this.shouldPreventBlur = false; | ||
var cfg = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, containerConfig), {}, { | ||
var cfg = _objectSpread(_objectSpread({}, containerConfig), {}, { | ||
navigableFilter: _this.navigableFilter | ||
@@ -260,3 +271,3 @@ }); | ||
(0, _createClass2["default"])(_class, [{ | ||
_createClass(_class, [{ | ||
key: "componentWillUnmount", | ||
@@ -272,3 +283,4 @@ value: function componentWillUnmount() { | ||
spotlightMuted = _this$props.spotlightMuted, | ||
rest = (0, _objectWithoutProperties2["default"])(_this$props, ["spotlightDisabled", "spotlightMuted"]); | ||
rest = _objectWithoutProperties(_this$props, ["spotlightDisabled", "spotlightMuted"]); | ||
delete rest.containerId; | ||
@@ -310,3 +322,3 @@ delete rest.spotlightId; | ||
if (isIdChanged || spotlightRestrict !== prevSpotlightRestrict) { | ||
return stateFromProps((0, _objectSpread2["default"])({ | ||
return stateFromProps(_objectSpread({ | ||
spotlightId: prevId, | ||
@@ -320,2 +332,3 @@ spotlightRestrict: prevSpotlightRestrict | ||
}]); | ||
return _class; | ||
@@ -322,0 +335,0 @@ }(_react["default"].Component), _class.displayName = 'SpotlightContainerDecorator', _class.propTypes = |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _objectSpread2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/objectSpread2")); | ||
var _enzyme = require("enzyme"); | ||
@@ -19,2 +15,10 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
describe('SpotlightContainerDecorator', function () { | ||
@@ -69,3 +73,3 @@ var hoverPosition = { | ||
innerWrapper.prop('onMouseLeave')((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, unhoverPosition), {}, { | ||
innerWrapper.prop('onMouseLeave')(_objectSpread(_objectSpread({}, unhoverPosition), {}, { | ||
currentTarget: innerNode | ||
@@ -101,3 +105,3 @@ })); | ||
innerWrapper.prop('onMouseLeave')((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, unhoverPosition), {}, { | ||
innerWrapper.prop('onMouseLeave')(_objectSpread(_objectSpread({}, unhoverPosition), {}, { | ||
currentTarget: innerNode | ||
@@ -104,0 +108,0 @@ })); |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -10,10 +8,2 @@ value: true | ||
var _classCallCheck2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/classCallCheck")); | ||
var _createClass2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createClass")); | ||
var _inherits2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/inherits")); | ||
var _createSuper2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createSuper")); | ||
var _hoc = _interopRequireDefault(require("@enact/core/hoc")); | ||
@@ -31,10 +21,24 @@ | ||
/** | ||
* Exports the {@link spotlight/SpotlightRootDecorator.SpotlightRootDecorator} | ||
* higher-order component. | ||
* | ||
* @module spotlight/SpotlightRootDecorator | ||
* @exports SpotlightRootDecorator | ||
*/ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
/** | ||
@@ -81,5 +85,5 @@ * Default configuration for SpotlightRootDecorator | ||
return _temp = _class = /*#__PURE__*/function (_React$Component) { | ||
(0, _inherits2["default"])(_class, _React$Component); | ||
_inherits(_class, _React$Component); | ||
var _super = (0, _createSuper2["default"])(_class); | ||
var _super = _createSuper(_class); | ||
@@ -89,3 +93,4 @@ function _class(props) { | ||
(0, _classCallCheck2["default"])(this, _class); | ||
_classCallCheck(this, _class); | ||
_this = _super.call(this, props); | ||
@@ -114,3 +119,3 @@ | ||
(0, _createClass2["default"])(_class, [{ | ||
_createClass(_class, [{ | ||
key: "componentDidMount", | ||
@@ -133,2 +138,3 @@ value: function componentDidMount() { | ||
}]); | ||
return _class; | ||
@@ -135,0 +141,0 @@ }(_react["default"].Component), _class.displayName = 'SpotlightRootDecorator', _temp; |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -10,14 +8,2 @@ value: true | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/objectWithoutProperties")); | ||
var _classCallCheck2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/classCallCheck")); | ||
var _createClass2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createClass")); | ||
var _assertThisInitialized2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/assertThisInitialized")); | ||
var _inherits2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/inherits")); | ||
var _createSuper2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/createSuper")); | ||
var _handle = require("@enact/core/handle"); | ||
@@ -39,10 +25,28 @@ | ||
/** | ||
* Adds spottability to components. | ||
* | ||
* @module spotlight/Spottable | ||
* @exports Spottable | ||
* @exports spottableClass | ||
*/ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
/** | ||
@@ -121,5 +125,5 @@ * The class name for spottable components. In general, you do not need to directly access this class | ||
return _temp = _class = /*#__PURE__*/function (_React$Component) { | ||
(0, _inherits2["default"])(_class, _React$Component); | ||
_inherits(_class, _React$Component); | ||
var _super = (0, _createSuper2["default"])(_class); | ||
var _super = _createSuper(_class); | ||
@@ -129,3 +133,4 @@ function _class(_props) { | ||
(0, _classCallCheck2["default"])(this, _class); | ||
_classCallCheck(this, _class); | ||
_this = _super.call(this, _props); | ||
@@ -189,7 +194,7 @@ | ||
})) { | ||
if (selectCancelled || lastSelectTarget && lastSelectTarget !== (0, _assertThisInitialized2["default"])(_this)) { | ||
if (selectCancelled || lastSelectTarget && lastSelectTarget !== _assertThisInitialized(_this)) { | ||
return false; | ||
} | ||
lastSelectTarget = (0, _assertThisInitialized2["default"])(_this); | ||
lastSelectTarget = _assertThisInitialized(_this); | ||
} | ||
@@ -217,3 +222,4 @@ | ||
var allow = lastSelectTarget === (0, _assertThisInitialized2["default"])(_this); | ||
var allow = lastSelectTarget === _assertThisInitialized(_this); | ||
selectCancelled = false; | ||
@@ -228,3 +234,3 @@ lastSelectTarget = null; | ||
_this.handle = _handle.handle.bind((0, _assertThisInitialized2["default"])(_this)); | ||
_this.handle = _handle.handle.bind(_assertThisInitialized(_this)); | ||
_this.handleKeyDown = _this.handle((0, _handle.forward)('onKeyDown'), function (ev) { | ||
@@ -295,3 +301,3 @@ return !ev.defaultPrevented; | ||
(0, _createClass2["default"])(_class, [{ | ||
_createClass(_class, [{ | ||
key: "componentDidMount", | ||
@@ -351,3 +357,4 @@ value: function componentDidMount() { | ||
spotlightDisabled = _this$props.spotlightDisabled, | ||
rest = (0, _objectWithoutProperties2["default"])(_this$props, ["disabled", "spotlightId", "spotlightDisabled"]); | ||
rest = _objectWithoutProperties(_this$props, ["disabled", "spotlightId", "spotlightDisabled"]); | ||
this.focusedWhenDisabled = this.isFocused && spotlightDisabled; | ||
@@ -392,2 +399,3 @@ var spottable = this.focusedWhenDisabled || isSpottable(this.props); | ||
}]); | ||
return _class; | ||
@@ -394,0 +402,0 @@ }(_react["default"].Component), _class.displayName = 'Spottable', _class.propTypes = |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _enzyme = require("enzyme"); | ||
@@ -11,2 +9,4 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
describe('Spottable', function () { | ||
@@ -13,0 +13,0 @@ test('should add the spottable class', function () { |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -30,6 +28,2 @@ value: true | ||
var _objectSpread2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/objectSpread2")); | ||
var _toConsumableArray2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/toConsumableArray")); | ||
var _and = _interopRequireDefault(require("ramda/src/and")); | ||
@@ -47,8 +41,22 @@ | ||
/** | ||
* Exports methods and members for creating and maintaining spotlight containers. | ||
* | ||
* @module spotlight/container | ||
* @private | ||
*/ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
var containerAttribute = 'data-spotlight-id'; | ||
@@ -400,3 +408,3 @@ exports.containerAttribute = containerAttribute; | ||
var candidates = querySelector(node, "".concat(spottableSelector, ", ").concat(getContainerSelector(node), " ").concat(containerSelector, ":not([data-spotlight-container-disabled=\"true\"])"), "".concat(subContainerSelector, " ").concat(spottableSelector, ", ").concat(subContainerSelector, " ").concat(containerSelector)); | ||
candidates.push.apply(candidates, (0, _toConsumableArray2["default"])(getOwnedNodes(node, selector))); | ||
candidates.push.apply(candidates, _toConsumableArray(getOwnedNodes(node, selector))); | ||
return candidates.filter(function (n) { | ||
@@ -585,3 +593,3 @@ return navigableFilter(n, containerId); | ||
config = mergeConfig(containerConfigs.get(containerId) || (0, _objectSpread2["default"])({}, GlobalConfig), config); | ||
config = mergeConfig(containerConfigs.get(containerId) || _objectSpread({}, GlobalConfig), config); | ||
containerConfigs.set(containerId, config); | ||
@@ -588,0 +596,0 @@ return containerId; |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -32,2 +30,4 @@ value: true | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
/* | ||
@@ -34,0 +34,0 @@ * A javascript-based implementation of Spatial Navigation. |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -16,6 +14,2 @@ value: true | ||
var _objectSpread2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/objectSpread2")); | ||
var _toConsumableArray2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/toConsumableArray")); | ||
var _clamp = _interopRequireDefault(require("ramda/src/clamp")); | ||
@@ -31,2 +25,22 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function isFocusable(elem) { | ||
@@ -66,3 +80,4 @@ var containers = (0, _container.getContainersForNode)(elem); | ||
addRange((0, _container.getLastContainer)()); | ||
(0, _toConsumableArray2["default"])((0, _container.getAllContainerIds)()).map(addRange); | ||
_toConsumableArray((0, _container.getAllContainerIds)()).map(addRange); | ||
} | ||
@@ -137,5 +152,6 @@ | ||
if (topUpdate || bottomUpdate || leftUpdate || rightUpdate) { | ||
var updated = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, rect), {}, { | ||
center: (0, _objectSpread2["default"])({}, rect.center) | ||
var updated = _objectSpread(_objectSpread({}, rect), {}, { | ||
center: _objectSpread({}, rect.center) | ||
}); | ||
if (topUpdate) updated.top = boundingRect.top; | ||
@@ -142,0 +158,0 @@ if (bottomUpdate) updated.bottom = boundingRect.bottom; |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _defineProperty2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/defineProperty")); | ||
var _container17 = require("../container"); | ||
@@ -13,2 +9,4 @@ | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var nonSpottable = function nonSpottable() { | ||
@@ -26,20 +24,20 @@ return (0, _utils.node)({ | ||
nestedContainers: (0, _utils.container)((0, _utils.container)((0, _utils.container)())), | ||
disabledContainers: (0, _utils.join)((0, _utils.someSpottables)(5), (0, _utils.someContainers)(5), (0, _utils.node)((_node = {}, (0, _defineProperty2["default"])(_node, _container17.containerAttribute, 'disabled-container'), (0, _defineProperty2["default"])(_node, 'data-spotlight-container-disabled', true), _node))), | ||
disabledContainers: (0, _utils.join)((0, _utils.someSpottables)(5), (0, _utils.someContainers)(5), (0, _utils.node)((_node = {}, _defineProperty(_node, _container17.containerAttribute, 'disabled-container'), _defineProperty(_node, 'data-spotlight-container-disabled', true), _node))), | ||
nestedContainersWithSpottables: (0, _utils.join)((0, _utils.someSpottables)(5), (0, _utils.container)({ | ||
children: (0, _utils.someSpottables)(5) | ||
})), | ||
siblingContainers: (0, _utils.join)((0, _utils.container)((_container = {}, (0, _defineProperty2["default"])(_container, _container17.containerAttribute, 'first'), (0, _defineProperty2["default"])(_container, "children", (0, _utils.someSpottables)(5)), _container)), (0, _utils.container)((_container2 = {}, (0, _defineProperty2["default"])(_container2, _container17.containerAttribute, 'second'), (0, _defineProperty2["default"])(_container2, "children", (0, _utils.someSpottables)(5)), _container2))), | ||
mixedOrder: (0, _utils.join)((0, _utils.container)((_container3 = {}, (0, _defineProperty2["default"])(_container3, _container17.containerAttribute, 'first'), (0, _defineProperty2["default"])(_container3, "name", 'c1'), _container3)), (0, _utils.spottable)({ | ||
siblingContainers: (0, _utils.join)((0, _utils.container)((_container = {}, _defineProperty(_container, _container17.containerAttribute, 'first'), _defineProperty(_container, "children", (0, _utils.someSpottables)(5)), _container)), (0, _utils.container)((_container2 = {}, _defineProperty(_container2, _container17.containerAttribute, 'second'), _defineProperty(_container2, "children", (0, _utils.someSpottables)(5)), _container2))), | ||
mixedOrder: (0, _utils.join)((0, _utils.container)((_container3 = {}, _defineProperty(_container3, _container17.containerAttribute, 'first'), _defineProperty(_container3, "name", 'c1'), _container3)), (0, _utils.spottable)({ | ||
name: 's1' | ||
}), (0, _utils.container)((_container4 = {}, (0, _defineProperty2["default"])(_container4, _container17.containerAttribute, 'second'), (0, _defineProperty2["default"])(_container4, "name", 'c2'), _container4)), (0, _utils.spottable)({ | ||
}), (0, _utils.container)((_container4 = {}, _defineProperty(_container4, _container17.containerAttribute, 'second'), _defineProperty(_container4, "name", 'c2'), _container4)), (0, _utils.spottable)({ | ||
name: 's2' | ||
})), | ||
complexTree: (0, _utils.join)((0, _utils.spottable)(nonSpottable()), (0, _utils.container)((_container7 = {}, (0, _defineProperty2["default"])(_container7, _container17.containerAttribute, 'first-container'), (0, _defineProperty2["default"])(_container7, "children", (0, _utils.join)((0, _utils.someSpottables)(2), (0, _utils.container)((_container6 = {}, (0, _defineProperty2["default"])(_container6, _container17.containerAttribute, 'second-container'), (0, _defineProperty2["default"])(_container6, "children", (0, _utils.join)((0, _utils.spottable)({ | ||
complexTree: (0, _utils.join)((0, _utils.spottable)(nonSpottable()), (0, _utils.container)((_container7 = {}, _defineProperty(_container7, _container17.containerAttribute, 'first-container'), _defineProperty(_container7, "children", (0, _utils.join)((0, _utils.someSpottables)(2), (0, _utils.container)((_container6 = {}, _defineProperty(_container6, _container17.containerAttribute, 'second-container'), _defineProperty(_container6, "children", (0, _utils.join)((0, _utils.spottable)({ | ||
id: 'secondContainerFirstSpottable' | ||
}), (0, _utils.someSpottables)(2), (0, _utils.container)((_container5 = {}, (0, _defineProperty2["default"])(_container5, _container17.containerAttribute, 'third-container'), (0, _defineProperty2["default"])(_container5, 'data-spotlight-container-disabled', true), (0, _defineProperty2["default"])(_container5, "children", (0, _utils.join)((0, _utils.someSpottables)(4), (0, _utils.node)({ | ||
}), (0, _utils.someSpottables)(2), (0, _utils.container)((_container5 = {}, _defineProperty(_container5, _container17.containerAttribute, 'third-container'), _defineProperty(_container5, 'data-spotlight-container-disabled', true), _defineProperty(_container5, "children", (0, _utils.join)((0, _utils.someSpottables)(4), (0, _utils.node)({ | ||
id: 'child-of-third' | ||
}))), _container5)))), _container6)))), _container7))), | ||
spottablesInDisabledContainer: (0, _utils.container)((_container8 = {}, (0, _defineProperty2["default"])(_container8, _container17.containerAttribute, 'container'), (0, _defineProperty2["default"])(_container8, 'data-spotlight-container-disabled', true), (0, _defineProperty2["default"])(_container8, "children", (0, _utils.someSpottables)(5)), _container8)), | ||
spottablesInNestedDisabledContainer: (0, _utils.container)((_container10 = {}, (0, _defineProperty2["default"])(_container10, _container17.containerAttribute, 'container'), (0, _defineProperty2["default"])(_container10, 'data-spotlight-container-disabled', true), (0, _defineProperty2["default"])(_container10, "children", (0, _utils.container)((_container9 = {}, (0, _defineProperty2["default"])(_container9, _container17.containerAttribute, 'child'), (0, _defineProperty2["default"])(_container9, "children", (0, _utils.someSpottables)(5)), _container9))), _container10)), | ||
containerWithDefaultAndLastFocused: (0, _utils.container)((_container11 = {}, (0, _defineProperty2["default"])(_container11, _container17.containerAttribute, 'container'), (0, _defineProperty2["default"])(_container11, "children", (0, _utils.join)((0, _utils.spottable)({ | ||
spottablesInDisabledContainer: (0, _utils.container)((_container8 = {}, _defineProperty(_container8, _container17.containerAttribute, 'container'), _defineProperty(_container8, 'data-spotlight-container-disabled', true), _defineProperty(_container8, "children", (0, _utils.someSpottables)(5)), _container8)), | ||
spottablesInNestedDisabledContainer: (0, _utils.container)((_container10 = {}, _defineProperty(_container10, _container17.containerAttribute, 'container'), _defineProperty(_container10, 'data-spotlight-container-disabled', true), _defineProperty(_container10, "children", (0, _utils.container)((_container9 = {}, _defineProperty(_container9, _container17.containerAttribute, 'child'), _defineProperty(_container9, "children", (0, _utils.someSpottables)(5)), _container9))), _container10)), | ||
containerWithDefaultAndLastFocused: (0, _utils.container)((_container11 = {}, _defineProperty(_container11, _container17.containerAttribute, 'container'), _defineProperty(_container11, "children", (0, _utils.join)((0, _utils.spottable)({ | ||
id: 'firstSpottable' | ||
@@ -52,5 +50,5 @@ }), (0, _utils.someSpottables)(5), (0, _utils.node)({ | ||
}))), _container11)), | ||
nestedContainersWithDefaultAndLastFocused: (0, _utils.container)((_container13 = {}, (0, _defineProperty2["default"])(_container13, _container17.containerAttribute, 'container'), (0, _defineProperty2["default"])(_container13, "children", (0, _utils.join)((0, _utils.spottable)({ | ||
nestedContainersWithDefaultAndLastFocused: (0, _utils.container)((_container13 = {}, _defineProperty(_container13, _container17.containerAttribute, 'container'), _defineProperty(_container13, "children", (0, _utils.join)((0, _utils.spottable)({ | ||
id: 'firstSpottable' | ||
}), (0, _utils.someSpottables)(5), (0, _utils.container)((_container12 = {}, (0, _defineProperty2["default"])(_container12, _container17.containerAttribute, 'child'), (0, _defineProperty2["default"])(_container12, "id", 'spottableDefault'), (0, _defineProperty2["default"])(_container12, "className", 'spottable-default'), (0, _defineProperty2["default"])(_container12, "children", (0, _utils.join)((0, _utils.spottable)({ | ||
}), (0, _utils.someSpottables)(5), (0, _utils.container)((_container12 = {}, _defineProperty(_container12, _container17.containerAttribute, 'child'), _defineProperty(_container12, "id", 'spottableDefault'), _defineProperty(_container12, "className", 'spottable-default'), _defineProperty(_container12, "children", (0, _utils.join)((0, _utils.spottable)({ | ||
id: 'firstChildSpottable' | ||
@@ -62,3 +60,3 @@ }), (0, _utils.someSpottables)(5), (0, _utils.spottable)({ | ||
}))), _container13)), | ||
emptySubcontainer: (0, _utils.container)((_container15 = {}, (0, _defineProperty2["default"])(_container15, _container17.containerAttribute, 'container'), (0, _defineProperty2["default"])(_container15, "children", (0, _utils.join)((0, _utils.container)((0, _defineProperty2["default"])({}, _container17.containerAttribute, 'subcontainer')), (0, _utils.spottable)({ | ||
emptySubcontainer: (0, _utils.container)((_container15 = {}, _defineProperty(_container15, _container17.containerAttribute, 'container'), _defineProperty(_container15, "children", (0, _utils.join)((0, _utils.container)(_defineProperty({}, _container17.containerAttribute, 'subcontainer')), (0, _utils.spottable)({ | ||
id: 'afterSubcontainer' | ||
@@ -70,3 +68,3 @@ }))), _container15)), | ||
id: 'n1' | ||
}), (0, _utils.container)((_container16 = {}, (0, _defineProperty2["default"])(_container16, _container17.containerAttribute, 'container'), (0, _defineProperty2["default"])(_container16, 'aria-owns', 's1 n1'), (0, _defineProperty2["default"])(_container16, "children", (0, _utils.spottable)({ | ||
}), (0, _utils.container)((_container16 = {}, _defineProperty(_container16, _container17.containerAttribute, 'container'), _defineProperty(_container16, 'aria-owns', 's1 n1'), _defineProperty(_container16, "children", (0, _utils.spottable)({ | ||
id: 's2' | ||
@@ -73,0 +71,0 @@ })), _container16))) |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _navigate = _interopRequireDefault(require("../navigate")); | ||
var _toConsumableArray2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/toConsumableArray")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _navigate = _interopRequireDefault(require("../navigate")); | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
// loose copy from utils/getRect to fabricate a rect for navigation | ||
@@ -33,3 +43,3 @@ function getRect(top, left, height, width, elem) { | ||
var rects = [[100, 110, 10, 10, 'right'], [100, 90, 10, 10, 'left'], [90, 100, 10, 10, 'above'], [110, 100, 10, 10, 'below']].map(function (args) { | ||
return getRect.apply(void 0, (0, _toConsumableArray2["default"])(args)); | ||
return getRect.apply(void 0, _toConsumableArray(args)); | ||
}); | ||
@@ -43,3 +53,3 @@ var expected = 'above'; | ||
var rects = [[100, 110, 10, 10, 'right'], [100, 90, 10, 10, 'left'], [90, 100, 10, 10, 'above'], [110, 100, 10, 10, 'below']].map(function (args) { | ||
return getRect.apply(void 0, (0, _toConsumableArray2["default"])(args)); | ||
return getRect.apply(void 0, _toConsumableArray(args)); | ||
}); | ||
@@ -53,3 +63,3 @@ var expected = 'left'; | ||
var rects = [[100, 110, 10, 10, 'right'], [100, 90, 10, 10, 'left'], [90, 100, 10, 10, 'above'], [110, 100, 10, 10, 'below']].map(function (args) { | ||
return getRect.apply(void 0, (0, _toConsumableArray2["default"])(args)); | ||
return getRect.apply(void 0, _toConsumableArray(args)); | ||
}); | ||
@@ -63,3 +73,3 @@ var expected = 'below'; | ||
var rects = [[100, 110, 10, 10, 'right'], [100, 90, 10, 10, 'left'], [90, 100, 10, 10, 'above'], [110, 100, 10, 10, 'below']].map(function (args) { | ||
return getRect.apply(void 0, (0, _toConsumableArray2["default"])(args)); | ||
return getRect.apply(void 0, _toConsumableArray(args)); | ||
}); | ||
@@ -74,3 +84,3 @@ var expected = 'right'; | ||
[110, 100, 10, 10, 'below']].map(function (args) { | ||
return getRect.apply(void 0, (0, _toConsumableArray2["default"])(args)); | ||
return getRect.apply(void 0, _toConsumableArray(args)); | ||
}); | ||
@@ -77,0 +87,0 @@ expect((0, _navigate["default"])(targetRect, 'up', rects, {})).toBe('under'); |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _defineProperty2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/defineProperty")); | ||
var _container4 = require("../container"); | ||
@@ -15,2 +11,6 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var nonSpottable = function nonSpottable() { | ||
@@ -25,5 +25,5 @@ return (0, _utils.node)({ | ||
'data-spotlight-id': 's1' | ||
}), (0, _utils.spottable)(nonSpottable()), (0, _utils.container)((_container3 = {}, (0, _defineProperty2["default"])(_container3, _container4.containerAttribute, 'first-container'), (0, _defineProperty2["default"])(_container3, "children", (0, _utils.join)((0, _utils.someSpottables)(2), (0, _utils.container)((_container2 = {}, (0, _defineProperty2["default"])(_container2, _container4.containerAttribute, 'second-container'), (0, _defineProperty2["default"])(_container2, "children", (0, _utils.join)((0, _utils.spottable)({ | ||
}), (0, _utils.spottable)(nonSpottable()), (0, _utils.container)((_container3 = {}, _defineProperty(_container3, _container4.containerAttribute, 'first-container'), _defineProperty(_container3, "children", (0, _utils.join)((0, _utils.someSpottables)(2), (0, _utils.container)((_container2 = {}, _defineProperty(_container2, _container4.containerAttribute, 'second-container'), _defineProperty(_container2, "children", (0, _utils.join)((0, _utils.spottable)({ | ||
id: 'secondContainerFirstSpottable' | ||
}), (0, _utils.someSpottables)(2), (0, _utils.container)((_container = {}, (0, _defineProperty2["default"])(_container, _container4.containerAttribute, 'third-container'), (0, _defineProperty2["default"])(_container, 'data-spotlight-container-disabled', true), (0, _defineProperty2["default"])(_container, "children", (0, _utils.join)((0, _utils.someSpottables)(4), (0, _utils.node)({ | ||
}), (0, _utils.someSpottables)(2), (0, _utils.container)((_container = {}, _defineProperty(_container, _container4.containerAttribute, 'third-container'), _defineProperty(_container, 'data-spotlight-container-disabled', true), _defineProperty(_container, "children", (0, _utils.join)((0, _utils.someSpottables)(4), (0, _utils.node)({ | ||
id: 'child-of-third' | ||
@@ -30,0 +30,0 @@ }))), _container)))), _container2)))), _container3))) |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
var _defineProperty2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/defineProperty")); | ||
var _container12 = require("../container"); | ||
@@ -15,2 +11,4 @@ | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var nonSpottable = function nonSpottable() { | ||
@@ -36,7 +34,7 @@ return (0, _utils.node)({ | ||
return (0, _utils.container)((_container = {}, (0, _defineProperty2["default"])(_container, _container12.containerAttribute, 'grid'), (0, _defineProperty2["default"])(_container, "style", 'position: relative; height: 30px; width: 30px;'), (0, _defineProperty2["default"])(_container, "children", (0, _utils.join)(positionedSpottable('top-left', 0, 0), positionedSpottable('top-center', 0, 10), positionedSpottable('top-right', 0, 20), positionedSpottable('middle-left', 10, 0), positionedSpottable('middle-center', 10, 10), positionedSpottable('middle-right', 10, 20), positionedSpottable('bottom-left', 20, 0), positionedSpottable('bottom-center', 20, 10), positionedSpottable('bottom-right', 20, 20))), _container)); | ||
return (0, _utils.container)((_container = {}, _defineProperty(_container, _container12.containerAttribute, 'grid'), _defineProperty(_container, "style", 'position: relative; height: 30px; width: 30px;'), _defineProperty(_container, "children", (0, _utils.join)(positionedSpottable('top-left', 0, 0), positionedSpottable('top-center', 0, 10), positionedSpottable('top-right', 0, 20), positionedSpottable('middle-left', 10, 0), positionedSpottable('middle-center', 10, 10), positionedSpottable('middle-right', 10, 20), positionedSpottable('bottom-left', 20, 0), positionedSpottable('bottom-center', 20, 10), positionedSpottable('bottom-right', 20, 20))), _container)); | ||
}; | ||
var scenarios = { | ||
complexTree: (0, _utils.join)((0, _utils.spottable)(nonSpottable()), (0, _utils.container)((_container4 = {}, (0, _defineProperty2["default"])(_container4, _container12.containerAttribute, 'first-container'), (0, _defineProperty2["default"])(_container4, "children", (0, _utils.join)((0, _utils.someSpottables)(2), (0, _utils.container)((_container3 = {}, (0, _defineProperty2["default"])(_container3, _container12.containerAttribute, 'second-container'), (0, _defineProperty2["default"])(_container3, "children", (0, _utils.join)((0, _utils.someSpottables)(3), (0, _utils.container)((_container2 = {}, (0, _defineProperty2["default"])(_container2, _container12.containerAttribute, 'third-container'), (0, _defineProperty2["default"])(_container2, 'data-spotlight-container-disabled', true), (0, _defineProperty2["default"])(_container2, "children", (0, _utils.join)((0, _utils.someSpottables)(4), (0, _utils.node)({ | ||
complexTree: (0, _utils.join)((0, _utils.spottable)(nonSpottable()), (0, _utils.container)((_container4 = {}, _defineProperty(_container4, _container12.containerAttribute, 'first-container'), _defineProperty(_container4, "children", (0, _utils.join)((0, _utils.someSpottables)(2), (0, _utils.container)((_container3 = {}, _defineProperty(_container3, _container12.containerAttribute, 'second-container'), _defineProperty(_container3, "children", (0, _utils.join)((0, _utils.someSpottables)(3), (0, _utils.container)((_container2 = {}, _defineProperty(_container2, _container12.containerAttribute, 'third-container'), _defineProperty(_container2, 'data-spotlight-container-disabled', true), _defineProperty(_container2, "children", (0, _utils.join)((0, _utils.someSpottables)(4), (0, _utils.node)({ | ||
id: 'child-of-third' | ||
@@ -46,5 +44,5 @@ }))), _container2)))), _container3)))), _container4))), | ||
id: 'in-root' | ||
}), (0, _utils.container)((_container5 = {}, (0, _defineProperty2["default"])(_container5, _container12.containerAttribute, 'first'), (0, _defineProperty2["default"])(_container5, "children", (0, _utils.join)(nonSpottable(), (0, _utils.spottable)({ | ||
}), (0, _utils.container)((_container5 = {}, _defineProperty(_container5, _container12.containerAttribute, 'first'), _defineProperty(_container5, "children", (0, _utils.join)(nonSpottable(), (0, _utils.spottable)({ | ||
id: 'in-first' | ||
}))), _container5)), (0, _utils.container)((_container6 = {}, (0, _defineProperty2["default"])(_container6, _container12.containerAttribute, 'second'), (0, _defineProperty2["default"])(_container6, "children", (0, _utils.join)(nonSpottable())), _container6))), | ||
}))), _container5)), (0, _utils.container)((_container6 = {}, _defineProperty(_container6, _container12.containerAttribute, 'second'), _defineProperty(_container6, "children", (0, _utils.join)(nonSpottable())), _container6))), | ||
grid: (0, _utils.join)((0, _utils.spottable)({ | ||
@@ -69,3 +67,3 @@ id: 'before-grid', | ||
style: 'height: 100px' | ||
}), (0, _utils.container)((_container7 = {}, (0, _defineProperty2["default"])(_container7, _container12.containerAttribute, 'overflow-container'), (0, _defineProperty2["default"])(_container7, "style", 'position: relative; height: 30px; width: 30px;'), (0, _defineProperty2["default"])(_container7, "children", (0, _utils.join)((0, _utils.spottable)({ | ||
}), (0, _utils.container)((_container7 = {}, _defineProperty(_container7, _container12.containerAttribute, 'overflow-container'), _defineProperty(_container7, "style", 'position: relative; height: 30px; width: 30px;'), _defineProperty(_container7, "children", (0, _utils.join)((0, _utils.spottable)({ | ||
id: 'overflow-above', | ||
@@ -85,3 +83,3 @@ style: 'position: absolute; top: -10px; left: 0px; height: 10px; width: 10px;' | ||
style: 'height: 100px' | ||
}), (0, _utils.container)((_container9 = {}, (0, _defineProperty2["default"])(_container9, _container12.containerAttribute, 'overflow-container'), (0, _defineProperty2["default"])(_container9, "style", 'position: relative; height: 30px; width: 30px;'), (0, _defineProperty2["default"])(_container9, "children", (0, _utils.join)((0, _utils.container)((_container8 = {}, (0, _defineProperty2["default"])(_container8, _container12.containerAttribute, 'inside'), (0, _defineProperty2["default"])(_container8, "style", 'position: absolute; top: -10px; left: 0px; height: 50px; width: 10px;'), (0, _defineProperty2["default"])(_container8, "children", (0, _utils.join)((0, _utils.node)({ | ||
}), (0, _utils.container)((_container9 = {}, _defineProperty(_container9, _container12.containerAttribute, 'overflow-container'), _defineProperty(_container9, "style", 'position: relative; height: 30px; width: 30px;'), _defineProperty(_container9, "children", (0, _utils.join)((0, _utils.container)((_container8 = {}, _defineProperty(_container8, _container12.containerAttribute, 'inside'), _defineProperty(_container8, "style", 'position: absolute; top: -10px; left: 0px; height: 50px; width: 10px;'), _defineProperty(_container8, "children", (0, _utils.join)((0, _utils.node)({ | ||
// allocate space to push following spottable into view | ||
@@ -95,4 +93,4 @@ style: 'height: 10px' | ||
}))), _container9))), | ||
emptyContainer: (0, _utils.join)(positionedSpottable('above', 0, 10), (0, _utils.container)((_container10 = {}, (0, _defineProperty2["default"])(_container10, _container12.containerAttribute, 'empty-container'), (0, _defineProperty2["default"])(_container10, "style", position(10, 10)), _container10)), positionedSpottable('below', 30, 0)), | ||
emptyContainerOverlap: (0, _utils.join)(positionedSpottable('above', 5, 10), (0, _utils.container)((_container11 = {}, (0, _defineProperty2["default"])(_container11, _container12.containerAttribute, 'empty-container'), (0, _defineProperty2["default"])(_container11, "style", position(10, 10)), _container11)), positionedSpottable('below', 30, 0)) | ||
emptyContainer: (0, _utils.join)(positionedSpottable('above', 0, 10), (0, _utils.container)((_container10 = {}, _defineProperty(_container10, _container12.containerAttribute, 'empty-container'), _defineProperty(_container10, "style", position(10, 10)), _container10)), positionedSpottable('below', 30, 0)), | ||
emptyContainerOverlap: (0, _utils.join)(positionedSpottable('above', 5, 10), (0, _utils.container)((_container11 = {}, _defineProperty(_container11, _container12.containerAttribute, 'empty-container'), _defineProperty(_container11, "style", position(10, 10)), _container11)), positionedSpottable('below', 30, 0)) | ||
}; | ||
@@ -99,0 +97,0 @@ |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -10,6 +8,2 @@ value: true | ||
var _defineProperty2 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/defineProperty")); | ||
var _objectSpread3 = _interopRequireDefault(require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/objectSpread2")); | ||
var _ramda = _interopRequireDefault(require("ramda")); | ||
@@ -19,2 +13,10 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var join = _ramda["default"].unapply(_ramda["default"].join('\n')); | ||
@@ -78,3 +80,3 @@ | ||
var spottable = function spottable(props) { | ||
return node((0, _objectSpread3["default"])({ | ||
return node(_objectSpread({ | ||
className: 'spottable' | ||
@@ -89,3 +91,3 @@ }, coerceProps(props))); | ||
return node((0, _objectSpread3["default"])((_objectSpread2 = {}, (0, _defineProperty2["default"])(_objectSpread2, _container.containerAttribute, _id++), (0, _defineProperty2["default"])(_objectSpread2, 'data-spotlight-container', true), _objectSpread2), coerceProps(props))); | ||
return node(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, _container.containerAttribute, _id++), _defineProperty(_objectSpread2, 'data-spotlight-container', true), _objectSpread2), coerceProps(props))); | ||
}; // eslint-disable-next-line react-hooks/rules-of-hooks | ||
@@ -92,0 +94,0 @@ |
"use strict"; | ||
var _interopRequireDefault = require("/jenkins/home/workspace/enact-version-release/enact-cli/node_modules/@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -21,2 +19,4 @@ value: true | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var elementMatchesSelector = function elementMatchesSelector(selector) { | ||
@@ -23,0 +23,0 @@ var matchedNodes = (this.parentNode || this.document).querySelectorAll(selector); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
298110
6154
Updated@enact/core@^3.4.2