@enact/spotlight 4.7.8 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/target.js CHANGED
@@ -16,11 +16,11 @@ var _container = require("./container");
16
16
  var _navigate = _interopRequireDefault(require("./navigate"));
17
17
  var _utils = require("./utils");
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
20
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
19
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
21
21
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
23
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
22
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
23
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
24
24
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
25
25
  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."); }
26
26
  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); }
@@ -157,51 +157,52 @@ function getTargetInContainerByDirectionFromPosition(direction, containerId, pos
157
157
  var elementRects = filterRects((0, _utils.getRects)(elements), boundingRect);
158
158
  var next = null;
159
159
  var _loop = function _loop() {
160
- var overlappingContainerId = getContainerContainingRect(elementRects, positionRect);
160
+ var overlappingContainerId = getContainerContainingRect(elementRects, positionRect);
161
161
 
162
- // if the pointer is within a container that is a candidate element, we need to ignore container
163
- // `enterTo` preferences and retrieve its spottable descendants and try to navigate to them.
164
- if (overlappingContainerId) {
165
- next = getTargetInContainerByDirectionFromPosition(direction, overlappingContainerId, positionRect, elementContainerIds, boundingRect);
166
- if (!next) {
167
- // filter out the container and try again
168
- elementRects = elementRects.filter(function (rect) {
169
- return rect.element.dataset.spotlightId !== overlappingContainerId;
170
- });
171
- return "continue";
172
- }
162
+ // if the pointer is within a container that is a candidate element, we need to ignore container
163
+ // `enterTo` preferences and retrieve its spottable descendants and try to navigate to them.
164
+ if (overlappingContainerId) {
165
+ next = getTargetInContainerByDirectionFromPosition(direction, overlappingContainerId, positionRect, elementContainerIds, boundingRect);
166
+ if (!next) {
167
+ // filter out the container and try again
168
+ elementRects = elementRects.filter(function (rect) {
169
+ return rect.element.dataset.spotlightId !== overlappingContainerId;
170
+ });
171
+ return 0; // continue
172
+ }
173
173
 
174
- // found a target so break out and return
175
- return "break";
176
- }
174
+ // found a target so break out and return
175
+ return 1; // break
176
+ }
177
177
 
178
- // try to navigate from position to one of the candidates in containerId
179
- next = (0, _navigate["default"])(positionRect, direction, elementRects, (0, _container.getContainerConfig)(containerId));
178
+ // try to navigate from position to one of the candidates in containerId
179
+ next = (0, _navigate["default"])(positionRect, direction, elementRects, (0, _container.getContainerConfig)(containerId));
180
180
 
181
- // if we match a container, recurse into it
182
- if (next && (0, _container.isContainer)(next)) {
183
- var nextContainerId = next.dataset.spotlightId;
181
+ // if we match a container, recurse into it
182
+ if (next && (0, _container.isContainer)(next)) {
183
+ var nextContainerId = next.dataset.spotlightId;
184
184
 
185
- // need to cache this reference so we can filter it out later if necessary
186
- var lastNavigated = next;
187
- next = getTargetInContainerByDirectionFromPosition(direction, nextContainerId, positionRect, elementContainerIds, getOverflowContainerRect(nextContainerId) || boundingRect);
188
- if (!next) {
189
- // filter out the container and try again
190
- elementRects = elementRects.filter(function (rect) {
191
- return rect.element !== lastNavigated;
192
- });
193
- return "continue";
185
+ // need to cache this reference so we can filter it out later if necessary
186
+ var lastNavigated = next;
187
+ next = getTargetInContainerByDirectionFromPosition(direction, nextContainerId, positionRect, elementContainerIds, getOverflowContainerRect(nextContainerId) || boundingRect);
188
+ if (!next) {
189
+ // filter out the container and try again
190
+ elementRects = elementRects.filter(function (rect) {
191
+ return rect.element !== lastNavigated;
192
+ });
193
+ return 0; // continue
194
+ }
194
195
  }
195
- }
196
196
 
197
- // If we've met every condition and haven't explicitly retried the search via `continue`,
198
- // break out and return
199
- return "break";
200
- };
197
+ // If we've met every condition and haven't explicitly retried the search via `continue`,
198
+ // break out and return
199
+ return 1; // break
200
+ },
201
+ _ret;
201
202
  while (elementRects.length > 0) {
202
- var _ret = _loop();
203
- if (_ret === "continue") continue;
204
- if (_ret === "break") break;
203
+ _ret = _loop();
204
+ if (_ret === 0) continue;
205
+ if (_ret === 1) break;
205
206
  }
206
207
  return next;
207
208
  }
@@ -227,69 +228,70 @@ function getTargetInContainerByDirectionFromElement(direction, containerId, elem
227
228
  var elementRects = filterRects((0, _utils.getRects)(elements), boundingRect);
228
229
  var next = null;
229
230
  var _loop2 = function _loop2() {
230
- var overlappingContainerId = getContainerContainingRect(elementRects, elementRect);
231
+ var overlappingContainerId = getContainerContainingRect(elementRects, elementRect);
231
232
 
232
- // if the next element is a container AND the current element is *visually* contained within
233
- // one of the candidate elements, we need to ignore container `enterTo` preferences and
234
- // retrieve its spottable descendants and try to navigate to them.
235
- if (overlappingContainerId) {
236
- next = getTargetInContainerByDirectionFromElement(direction, overlappingContainerId, element, elementRect, elementContainerIds, boundingRect);
237
- if (!next) {
238
- // filter out the container and try again
239
- elementRects = elementRects.filter(function (rect) {
240
- return rect.element.dataset.spotlightId !== overlappingContainerId;
241
- });
242
- return "continue";
243
- }
233
+ // if the next element is a container AND the current element is *visually* contained within
234
+ // one of the candidate elements, we need to ignore container `enterTo` preferences and
235
+ // retrieve its spottable descendants and try to navigate to them.
236
+ if (overlappingContainerId) {
237
+ next = getTargetInContainerByDirectionFromElement(direction, overlappingContainerId, element, elementRect, elementContainerIds, boundingRect);
238
+ if (!next) {
239
+ // filter out the container and try again
240
+ elementRects = elementRects.filter(function (rect) {
241
+ return rect.element.dataset.spotlightId !== overlappingContainerId;
242
+ });
243
+ return 0; // continue
244
+ }
244
245
 
245
- // found a target so break out and return
246
- return "break";
247
- }
246
+ // found a target so break out and return
247
+ return 1; // break
248
+ }
248
249
 
249
- // If one of the downstream containers is configured for partition, we use that
250
- // container's bounds as the partition rect for navigation.
251
- var partitionContainer = elementContainerIds.slice(elementContainerIds.indexOf(containerId) + 1).find(function (id) {
252
- var cfg = (0, _container.getContainerConfig)(id);
253
- return cfg && cfg.partition;
254
- });
255
- var partitionRect = elementRect;
256
- if (partitionContainer) {
257
- partitionRect = (0, _utils.getContainerRect)(partitionContainer);
258
- }
250
+ // If one of the downstream containers is configured for partition, we use that
251
+ // container's bounds as the partition rect for navigation.
252
+ var partitionContainer = elementContainerIds.slice(elementContainerIds.indexOf(containerId) + 1).find(function (id) {
253
+ var cfg = (0, _container.getContainerConfig)(id);
254
+ return cfg && cfg.partition;
255
+ });
256
+ var partitionRect = elementRect;
257
+ if (partitionContainer) {
258
+ partitionRect = (0, _utils.getContainerRect)(partitionContainer);
259
+ }
259
260
 
260
- // try to navigate from element to one of the candidates in containerId
261
- next = (0, _navigate["default"])(elementRect, direction, elementRects, (0, _container.getContainerConfig)(containerId), partitionRect);
261
+ // try to navigate from element to one of the candidates in containerId
262
+ next = (0, _navigate["default"])(elementRect, direction, elementRects, (0, _container.getContainerConfig)(containerId), partitionRect);
262
263
 
263
- // if we match a container,
264
- if (next && (0, _container.isContainer)(next)) {
265
- var nextContainerId = next.dataset.spotlightId;
264
+ // if we match a container,
265
+ if (next && (0, _container.isContainer)(next)) {
266
+ var nextContainerId = next.dataset.spotlightId;
266
267
 
267
- // need to cache this reference so we can filter it out later if necessary
268
- var lastNavigated = next;
268
+ // need to cache this reference so we can filter it out later if necessary
269
+ var lastNavigated = next;
269
270
 
270
- // and it is restricted, return its target
271
- if (isRestrictedContainer(nextContainerId)) {
272
- next = getTargetByContainer(nextContainerId);
273
- } else {
274
- // otherwise, recurse into it
275
- next = getTargetInContainerByDirectionFromElement(direction, nextContainerId, element, elementRect, elementContainerIds, getOverflowContainerRect(nextContainerId) || boundingRect);
276
- }
277
- if (!next) {
278
- elementRects = elementRects.filter(function (rect) {
279
- return rect.element !== lastNavigated;
280
- });
281
- return "continue";
271
+ // and it is restricted, return its target
272
+ if (isRestrictedContainer(nextContainerId)) {
273
+ next = getTargetByContainer(nextContainerId);
274
+ } else {
275
+ // otherwise, recurse into it
276
+ next = getTargetInContainerByDirectionFromElement(direction, nextContainerId, element, elementRect, elementContainerIds, getOverflowContainerRect(nextContainerId) || boundingRect);
277
+ }
278
+ if (!next) {
279
+ elementRects = elementRects.filter(function (rect) {
280
+ return rect.element !== lastNavigated;
281
+ });
282
+ return 0; // continue
283
+ }
282
284
  }
283
- }
284
285
 
285
- // If we've met every condition and haven't explicitly retried the search via `continue`,
286
- // break out and return
287
- return "break";
288
- };
286
+ // If we've met every condition and haven't explicitly retried the search via `continue`,
287
+ // break out and return
288
+ return 1; // break
289
+ },
290
+ _ret2;
289
291
  while (elementRects.length > 0) {
290
- var _ret2 = _loop2();
291
- if (_ret2 === "continue") continue;
292
- if (_ret2 === "break") break;
292
+ _ret2 = _loop2();
293
+ if (_ret2 === 0) continue;
294
+ if (_ret2 === 1) break;
293
295
  }
294
296
  return next;
295
297
  }
@@ -360,7 +362,6 @@ function getNavigableTarget(target) {
360
362
  parent = target.parentNode;
361
363
  target = parent === document ? null : parent; // calling isNavigable on document is problematic
362
364
  }
363
-
364
365
  return target;
365
366
  }
366
367
  var getOffsetDistanceToTargetFromPosition = function getOffsetDistanceToTargetFromPosition(distance, direction, _ref, _ref2) {
@@ -425,7 +426,6 @@ var getNearestTargetInContainerFromPosition = function getNearestTargetInContain
425
426
  });
426
427
  return targets[0].target;
427
428
  };
428
- var getNearestTargetFromPosition = function getNearestTargetFromPosition(position, containerId) {
429
+ var getNearestTargetFromPosition = exports.getNearestTargetFromPosition = function getNearestTargetFromPosition(position, containerId) {
429
430
  return getNavigableTarget(document.elementFromPoint(position.x, position.y)) || getNearestTargetInContainerFromPosition(position, containerId);
430
- };
431
- exports.getNearestTargetFromPosition = getNearestTargetFromPosition;
431
+ };
@@ -2,10 +2,9 @@
2
2
 
3
3
  var _container17 = require("../container");
4
4
  var _utils = require("./utils");
5
- var _node, _container, _container2, _container3, _container4, _container5, _container6, _container7, _container8, _container9, _container10, _container11, _container12, _container13, _container15, _container16;
6
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
8
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
8
  var nonSpottable = function nonSpottable() {
10
9
  return (0, _utils.node)({
11
10
  className: 'other'
@@ -17,50 +16,50 @@ var scenarios = {
17
16
  spottableAndContainers: (0, _utils.someSpottablesAndContainers)(5),
18
17
  nonSpottableSiblings: (0, _utils.join)((0, _utils.someSpottables)(5), (0, _utils.someNodes)(nonSpottable, 5)),
19
18
  nestedContainers: (0, _utils.container)((0, _utils.container)((0, _utils.container)())),
20
- 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))),
19
+ disabledContainers: (0, _utils.join)((0, _utils.someSpottables)(5), (0, _utils.someContainers)(5), (0, _utils.node)(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'disabled-container'), 'data-spotlight-container-disabled', true))),
21
20
  nestedContainersWithSpottables: (0, _utils.join)((0, _utils.someSpottables)(5), (0, _utils.container)({
22
21
  children: (0, _utils.someSpottables)(5)
23
22
  })),
24
- 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))),
25
- mixedOrder: (0, _utils.join)((0, _utils.container)((_container3 = {}, _defineProperty(_container3, _container17.containerAttribute, 'first'), _defineProperty(_container3, "name", 'c1'), _container3)), (0, _utils.spottable)({
23
+ siblingContainers: (0, _utils.join)((0, _utils.container)(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'first'), "children", (0, _utils.someSpottables)(5))), (0, _utils.container)(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'second'), "children", (0, _utils.someSpottables)(5)))),
24
+ mixedOrder: (0, _utils.join)((0, _utils.container)(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'first'), "name", 'c1')), (0, _utils.spottable)({
26
25
  name: 's1'
27
- }), (0, _utils.container)((_container4 = {}, _defineProperty(_container4, _container17.containerAttribute, 'second'), _defineProperty(_container4, "name", 'c2'), _container4)), (0, _utils.spottable)({
26
+ }), (0, _utils.container)(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'second'), "name", 'c2')), (0, _utils.spottable)({
28
27
  name: 's2'
29
28
  })),
30
- 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)({
29
+ complexTree: (0, _utils.join)((0, _utils.spottable)(nonSpottable()), (0, _utils.container)(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'first-container'), "children", (0, _utils.join)((0, _utils.someSpottables)(2), (0, _utils.container)(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'second-container'), "children", (0, _utils.join)((0, _utils.spottable)({
31
30
  id: 'secondContainerFirstSpottable'
32
- }), (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)({
31
+ }), (0, _utils.someSpottables)(2), (0, _utils.container)(_defineProperty(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'third-container'), 'data-spotlight-container-disabled', true), "children", (0, _utils.join)((0, _utils.someSpottables)(4), (0, _utils.node)({
33
32
  id: 'child-of-third'
34
- }))), _container5)))), _container6)))), _container7))),
35
- 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)),
36
- 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)),
37
- containerWithDefaultAndLastFocused: (0, _utils.container)((_container11 = {}, _defineProperty(_container11, _container17.containerAttribute, 'container'), _defineProperty(_container11, "children", (0, _utils.join)((0, _utils.spottable)({
33
+ }))))))))))),
34
+ spottablesInDisabledContainer: (0, _utils.container)(_defineProperty(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'container'), 'data-spotlight-container-disabled', true), "children", (0, _utils.someSpottables)(5))),
35
+ spottablesInNestedDisabledContainer: (0, _utils.container)(_defineProperty(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'container'), 'data-spotlight-container-disabled', true), "children", (0, _utils.container)(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'child'), "children", (0, _utils.someSpottables)(5))))),
36
+ containerWithDefaultAndLastFocused: (0, _utils.container)(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'container'), "children", (0, _utils.join)((0, _utils.spottable)({
38
37
  id: 'firstSpottable'
39
38
  }), (0, _utils.someSpottables)(5), (0, _utils.node)({
40
39
  id: 'spottableDefault',
41
40
  className: 'spottable spottable-default'
42
41
  }), (0, _utils.spottable)({
43
42
  id: 'lastFocused'
44
- }))), _container11)),
45
- nestedContainersWithDefaultAndLastFocused: (0, _utils.container)((_container13 = {}, _defineProperty(_container13, _container17.containerAttribute, 'container'), _defineProperty(_container13, "children", (0, _utils.join)((0, _utils.spottable)({
43
+ })))),
44
+ nestedContainersWithDefaultAndLastFocused: (0, _utils.container)(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'container'), "children", (0, _utils.join)((0, _utils.spottable)({
46
45
  id: 'firstSpottable'
47
- }), (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)({
46
+ }), (0, _utils.someSpottables)(5), (0, _utils.container)(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'child'), "id", 'spottableDefault'), "className", 'spottable-default'), "children", (0, _utils.join)((0, _utils.spottable)({
48
47
  id: 'firstChildSpottable'
49
48
  }), (0, _utils.someSpottables)(5), (0, _utils.spottable)({
50
49
  id: 'lastChildFocused'
51
- }))), _container12)), (0, _utils.spottable)({
50
+ })))), (0, _utils.spottable)({
52
51
  id: 'lastFocused'
53
- }))), _container13)),
54
- 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)({
52
+ })))),
53
+ emptySubcontainer: (0, _utils.container)(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'container'), "children", (0, _utils.join)((0, _utils.container)(_defineProperty({}, _container17.containerAttribute, 'subcontainer')), (0, _utils.spottable)({
55
54
  id: 'afterSubcontainer'
56
- }))), _container15)),
55
+ })))),
57
56
  owned: (0, _utils.join)((0, _utils.spottable)({
58
57
  id: 's1'
59
58
  }), (0, _utils.node)({
60
59
  id: 'n1'
61
- }), (0, _utils.container)((_container16 = {}, _defineProperty(_container16, _container17.containerAttribute, 'container'), _defineProperty(_container16, 'aria-owns', 's1 n1'), _defineProperty(_container16, "children", (0, _utils.spottable)({
60
+ }), (0, _utils.container)(_defineProperty(_defineProperty(_defineProperty({}, _container17.containerAttribute, 'container'), 'aria-owns', 's1 n1'), "children", (0, _utils.spottable)({
62
61
  id: 's2'
63
- })), _container16)))
62
+ }))))
64
63
  };
65
64
  var setupContainers = function setupContainers() {
66
65
  (0, _container17.configureDefaults)({
@@ -3,11 +3,10 @@
3
3
  var _container4 = require("../container");
4
4
  var _spotlight = _interopRequireDefault(require("../spotlight"));
5
5
  var _utils = require("./utils");
6
- var _container, _container2, _container3;
7
6
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8
7
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
10
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
9
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
10
  var nonSpottable = function nonSpottable() {
12
11
  return (0, _utils.node)({
13
12
  className: 'other'
@@ -16,11 +15,11 @@ var nonSpottable = function nonSpottable() {
16
15
  var scenarios = {
17
16
  complexTree: (0, _utils.join)((0, _utils.spottable)({
18
17
  'data-spotlight-id': 's1'
19
- }), (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)({
18
+ }), (0, _utils.spottable)(nonSpottable()), (0, _utils.container)(_defineProperty(_defineProperty({}, _container4.containerAttribute, 'first-container'), "children", (0, _utils.join)((0, _utils.someSpottables)(2), (0, _utils.container)(_defineProperty(_defineProperty({}, _container4.containerAttribute, 'second-container'), "children", (0, _utils.join)((0, _utils.spottable)({
20
19
  id: 'secondContainerFirstSpottable'
21
- }), (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)({
20
+ }), (0, _utils.someSpottables)(2), (0, _utils.container)(_defineProperty(_defineProperty(_defineProperty({}, _container4.containerAttribute, 'third-container'), 'data-spotlight-container-disabled', true), "children", (0, _utils.join)((0, _utils.someSpottables)(4), (0, _utils.node)({
22
21
  id: 'child-of-third'
23
- }))), _container)))), _container2)))), _container3)))
22
+ })))))))))))
24
23
  };
25
24
  var setupContainers = function setupContainers() {
26
25
  _spotlight["default"].setPointerMode(false);
@@ -3,10 +3,9 @@
3
3
  var _container12 = require("../container");
4
4
  var _target = require("../target");
5
5
  var _utils = require("./utils");
6
- var _container2, _container3, _container4, _container5, _container6, _container7, _container8, _container9, _container10, _container11;
7
6
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
9
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
8
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
9
  var nonSpottable = function nonSpottable() {
11
10
  return (0, _utils.node)({
12
11
  className: 'other'
@@ -22,18 +21,17 @@ var positionedSpottable = function positionedSpottable(id, top, left) {
22
21
  });
23
22
  };
24
23
  var grid = function grid() {
25
- var _container;
26
- 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));
24
+ return (0, _utils.container)(_defineProperty(_defineProperty(_defineProperty({}, _container12.containerAttribute, 'grid'), "style", 'position: relative; height: 30px; width: 30px;'), "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))));
27
25
  };
28
26
  var scenarios = {
29
- 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)({
27
+ complexTree: (0, _utils.join)((0, _utils.spottable)(nonSpottable()), (0, _utils.container)(_defineProperty(_defineProperty({}, _container12.containerAttribute, 'first-container'), "children", (0, _utils.join)((0, _utils.someSpottables)(2), (0, _utils.container)(_defineProperty(_defineProperty({}, _container12.containerAttribute, 'second-container'), "children", (0, _utils.join)((0, _utils.someSpottables)(3), (0, _utils.container)(_defineProperty(_defineProperty(_defineProperty({}, _container12.containerAttribute, 'third-container'), 'data-spotlight-container-disabled', true), "children", (0, _utils.join)((0, _utils.someSpottables)(4), (0, _utils.node)({
30
28
  id: 'child-of-third'
31
- }))), _container2)))), _container3)))), _container4))),
29
+ }))))))))))),
32
30
  nonSpottableInContainer: (0, _utils.join)((0, _utils.spottable)({
33
31
  id: 'in-root'
34
- }), (0, _utils.container)((_container5 = {}, _defineProperty(_container5, _container12.containerAttribute, 'first'), _defineProperty(_container5, "children", (0, _utils.join)(nonSpottable(), (0, _utils.spottable)({
32
+ }), (0, _utils.container)(_defineProperty(_defineProperty({}, _container12.containerAttribute, 'first'), "children", (0, _utils.join)(nonSpottable(), (0, _utils.spottable)({
35
33
  id: 'in-first'
36
- }))), _container5)), (0, _utils.container)((_container6 = {}, _defineProperty(_container6, _container12.containerAttribute, 'second'), _defineProperty(_container6, "children", (0, _utils.join)(nonSpottable())), _container6))),
34
+ })))), (0, _utils.container)(_defineProperty(_defineProperty({}, _container12.containerAttribute, 'second'), "children", (0, _utils.join)(nonSpottable())))),
37
35
  grid: (0, _utils.join)((0, _utils.spottable)({
38
36
  id: 'before-grid',
39
37
  style: 'height: 10px'
@@ -53,7 +51,7 @@ var scenarios = {
53
51
  }), (0, _utils.node)({
54
52
  // allocate some empty space so that overflow items would be otherwise navigable
55
53
  style: 'height: 100px'
56
- }), (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)({
54
+ }), (0, _utils.container)(_defineProperty(_defineProperty(_defineProperty({}, _container12.containerAttribute, 'overflow-container'), "style", 'position: relative; height: 30px; width: 30px;'), "children", (0, _utils.join)((0, _utils.spottable)({
57
55
  id: 'overflow-above',
58
56
  style: 'position: absolute; top: -10px; left: 0px; height: 10px; width: 10px;'
59
57
  }), (0, _utils.spottable)({
@@ -62,23 +60,23 @@ var scenarios = {
62
60
  }), (0, _utils.spottable)({
63
61
  id: 'overflow-within',
64
62
  style: 'position: absolute; top: 0px; left: 0px; height: 10px; width: 10px;'
65
- }))), _container7))),
63
+ }))))),
66
64
  overflowLargeSubContainer: (0, _utils.join)((0, _utils.spottable)({
67
65
  id: 'outside-overflow'
68
66
  }), (0, _utils.node)({
69
67
  // allocate some empty space so that overflow items would be otherwise navigable
70
68
  style: 'height: 100px'
71
- }), (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)({
69
+ }), (0, _utils.container)(_defineProperty(_defineProperty(_defineProperty({}, _container12.containerAttribute, 'overflow-container'), "style", 'position: relative; height: 30px; width: 30px;'), "children", (0, _utils.join)((0, _utils.container)(_defineProperty(_defineProperty(_defineProperty({}, _container12.containerAttribute, 'inside'), "style", 'position: absolute; top: -10px; left: 0px; height: 50px; width: 10px;'), "children", (0, _utils.join)((0, _utils.node)({
72
70
  // allocate space to push following spottable into view
73
71
  style: 'height: 10px'
74
72
  }), (0, _utils.spottable)({
75
73
  id: 'in-large-container'
76
- }))), _container8)), (0, _utils.spottable)({
74
+ })))), (0, _utils.spottable)({
77
75
  id: 'below-large-container',
78
76
  style: 'position: absolute; top: 40px; left: 0px; height: 10px; width: 10px;'
79
- }))), _container9))),
80
- 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)),
81
- 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))
77
+ }))))),
78
+ emptyContainer: (0, _utils.join)(positionedSpottable('above', 0, 10), (0, _utils.container)(_defineProperty(_defineProperty({}, _container12.containerAttribute, 'empty-container'), "style", position(10, 10))), positionedSpottable('below', 30, 0)),
79
+ emptyContainerOverlap: (0, _utils.join)(positionedSpottable('above', 5, 10), (0, _utils.container)(_defineProperty(_defineProperty({}, _container12.containerAttribute, 'empty-container'), "style", position(10, 10))), positionedSpottable('below', 30, 0))
82
80
  };
83
81
  var safeTarget = function safeTarget(n, fn) {
84
82
  return n ? fn(n) : 'NOT FOUND';
@@ -7,14 +7,13 @@ exports.testScenario = exports.spottable = exports.someSpottablesAndContainers =
7
7
  var _ramda = _interopRequireDefault(require("ramda"));
8
8
  var _container = require("../container");
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
12
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
- var join = _ramda["default"].unapply(_ramda["default"].join('\n'));
16
- exports.join = join;
17
- var testScenario = function testScenario(scenario, callback) {
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
14
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
+ var join = exports.join = _ramda["default"].unapply(_ramda["default"].join('\n'));
16
+ var testScenario = exports.testScenario = function testScenario(scenario, callback) {
18
17
  return function () {
19
18
  var rootId = 'test-root';
20
19
  var html = join("<div id=\"".concat(rootId, "\">"), scenario, '</div>');
@@ -28,12 +27,10 @@ var testScenario = function testScenario(scenario, callback) {
28
27
  }
29
28
  };
30
29
  };
31
- exports.testScenario = testScenario;
32
30
  var _id = 1;
33
- var generateContainerId = function generateContainerId() {
31
+ var generateContainerId = exports.generateContainerId = function generateContainerId() {
34
32
  return "".concat(_container.containerAttribute, "=").concat(_id++);
35
33
  };
36
- exports.generateContainerId = generateContainerId;
37
34
  var coerceProps = function coerceProps(v) {
38
35
  if (typeof v === 'object') {
39
36
  return v;
@@ -43,7 +40,7 @@ var coerceProps = function coerceProps(v) {
43
40
  };
44
41
  }
45
42
  };
46
- var node = function node(props) {
43
+ var node = exports.node = function node(props) {
47
44
  var children = '';
48
45
  var attributes = '';
49
46
  var tag = 'div';
@@ -62,25 +59,17 @@ var node = function node(props) {
62
59
  });
63
60
  return "<".concat(tag, " ").concat(attributes, ">").concat(children, "</").concat(tag, ">");
64
61
  };
65
- exports.node = node;
66
- var spottable = function spottable(props) {
62
+ var spottable = exports.spottable = function spottable(props) {
67
63
  return node(_objectSpread({
68
64
  className: 'spottable'
69
65
  }, coerceProps(props)));
70
66
  };
71
- exports.spottable = spottable;
72
- var container = function container(props) {
73
- var _objectSpread2;
74
- return node(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, _container.containerAttribute, _id++), _defineProperty(_objectSpread2, 'data-spotlight-container', true), _objectSpread2), coerceProps(props)));
67
+ var container = exports.container = function container(props) {
68
+ return node(_objectSpread(_defineProperty(_defineProperty({}, _container.containerAttribute, _id++), 'data-spotlight-container', true), coerceProps(props)));
75
69
  };
76
70
 
77
71
  // eslint-disable-next-line react-hooks/rules-of-hooks
78
- exports.container = container;
79
- var someNodes = _ramda["default"].useWith(_ramda["default"].compose(_ramda["default"].join('\n'), _ramda["default"].map), [_ramda["default"].identity, _ramda["default"].range(0)]);
80
- exports.someNodes = someNodes;
81
- var someSpottables = someNodes(spottable);
82
- exports.someSpottables = someSpottables;
83
- var someContainers = someNodes(container);
84
- exports.someContainers = someContainers;
85
- var someSpottablesAndContainers = _ramda["default"].converge(_ramda["default"].concat, [someSpottables, someContainers]);
86
- exports.someSpottablesAndContainers = someSpottablesAndContainers;
72
+ var someNodes = exports.someNodes = _ramda["default"].useWith(_ramda["default"].compose(_ramda["default"].join('\n'), _ramda["default"].map), [_ramda["default"].identity, _ramda["default"].range(0)]);
73
+ var someSpottables = exports.someSpottables = someNodes(spottable);
74
+ var someContainers = exports.someContainers = someNodes(container);
75
+ var someSpottablesAndContainers = exports.someSpottablesAndContainers = _ramda["default"].converge(_ramda["default"].concat, [someSpottables, someContainers]);
package/src/utils.js CHANGED
@@ -23,7 +23,7 @@ var elementMatchesSelector = function elementMatchesSelector(selector) {
23
23
  if (typeof window === 'object') {
24
24
  elementMatchesSelector = window.Element.prototype.matches || window.Element.prototype.matchesSelector || window.Element.prototype.mozMatchesSelector || window.Element.prototype.webkitMatchesSelector || window.Element.prototype.msMatchesSelector || window.Element.prototype.oMatchesSelector || elementMatchesSelector;
25
25
  }
26
- var matchSelector = (0, _curry["default"])(function (selector, elem) {
26
+ var matchSelector = exports.matchSelector = (0, _curry["default"])(function (selector, elem) {
27
27
  if (typeof selector === 'string') {
28
28
  return elementMatchesSelector.call(elem, selector);
29
29
  } else if (typeof selector === 'object' && selector.length) {
@@ -33,7 +33,6 @@ var matchSelector = (0, _curry["default"])(function (selector, elem) {
33
33
  }
34
34
  return false;
35
35
  });
36
- exports.matchSelector = matchSelector;
37
36
  function parseSelector(selector) {
38
37
  var result = [];
39
38
  try {
@@ -74,17 +73,14 @@ var testIntersection = function testIntersection(type, containerRect, elementRec
74
73
  b > T - epsilon && b < B + epsilon // bottom
75
74
  ;
76
75
  }
77
-
78
76
  return true;
79
77
  };
80
- var intersects = (0, _curry["default"])(function (containerRect, elementRect) {
78
+ var intersects = exports.intersects = (0, _curry["default"])(function (containerRect, elementRect) {
81
79
  return testIntersection('intersects', containerRect, elementRect);
82
80
  });
83
- exports.intersects = intersects;
84
- var contains = (0, _curry["default"])(function (containerRect, elementRect) {
81
+ var contains = exports.contains = (0, _curry["default"])(function (containerRect, elementRect) {
85
82
  return testIntersection('contains', containerRect, elementRect);
86
83
  });
87
- exports.contains = contains;
88
84
  function getRect(elem) {
89
85
  var cr = elem.getBoundingClientRect();
90
86
  var rect = {