highmark-cli 0.0.139 → 0.0.140

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/client.js CHANGED
@@ -11,22 +11,24 @@ import View from "./view";
11
11
  import createMethods from "./createMethods";
12
12
 
13
13
  import { setOrientation } from "./state";
14
- import { DIV_SELECTOR, LOADING_DIV_SELECTOR } from "./selectors";
14
+ import { DIVS_SELECTOR, LOADING_DIV_SELECTOR } from "./selectors";
15
15
  import { getOrientation, onOrientationChange } from "./utilities/orientation";
16
16
 
17
17
  const { renderStyles } = withStyle;
18
18
 
19
19
  renderStyles();
20
20
 
21
- const divDOMElement = document.querySelector(DIV_SELECTOR);
21
+ const divDOMElements = [ ...document.querySelectorAll(DIVS_SELECTOR) ]; ///
22
22
 
23
- divDOMElement.remove();
23
+ divDOMElements.forEach((divDOMElement) => {
24
+ divDOMElement.remove();
25
+ });
24
26
 
25
27
  const scheduler = null,
26
28
  model = null,
27
29
  view =
28
30
 
29
- <View divDOMElement={divDOMElement} />
31
+ <View divDOMElements={divDOMElements} />
30
32
 
31
33
  ;
32
34
 
package/src/constants.js CHANGED
@@ -9,7 +9,6 @@ export const ZOOM_RATIO = 1.1;
9
9
  export const PI_OVER_TWO = PI / 2;
10
10
  export const SCROLL_DELAY = 10;
11
11
  export const DECELERATION = 0.0333333;
12
- export const SINGLE_SPACE = " ";
13
12
  export const UP_DIRECTION = +1;
14
13
  export const DOWN_DIRECTION = -1;
15
14
  export const MAXIMUM_SPREAD = PI / 4;
package/src/selectors.js CHANGED
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
2
 
3
- export const DIV_SELECTOR = "body > div:not(.loading)"; ///
4
- export const DIVS_SELECTOR = "div"; ///
3
+ export const DIVS_SELECTOR = "body > div:not(.loading)"; ///
5
4
  export const LOADING_DIV_SELECTOR = "body > div.loading";
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- import { SINGLE_SPACE } from "../constants";
4
-
5
3
  export function elementsFromDOMElements(domElements, Element) {
6
4
  const elements = domElements.map((domElement) => {
7
5
  const element = elementFromDOMElement(domElement, Element);
@@ -13,22 +11,14 @@ export function elementsFromDOMElements(domElements, Element) {
13
11
  }
14
12
 
15
13
  export function elementFromDOMElement(domElement, Element) {
16
- const element = <Element/>;
14
+ const element =
17
15
 
18
- const { domElement: temporaryDOMElement } = element,
19
- { className: classNamesString } = temporaryDOMElement,
20
- classNames = classNamesString.split(SINGLE_SPACE);
16
+ <Element/>
21
17
 
22
- const { classList } = domElement,
23
- { childNodes } = temporaryDOMElement;
18
+ ,
19
+ className = classNameFromElement(element);
24
20
 
25
- childNodes.forEach((childNode) => {
26
- domElement.appendChild(childNode);
27
- });
28
-
29
- classNames.forEach((className) => {
30
- classList.add(className);
31
- });
21
+ addClassNameToDOMElement(domElement, className)
32
22
 
33
23
  element.domElement = domElement; ///
34
24
 
@@ -36,3 +26,16 @@ export function elementFromDOMElement(domElement, Element) {
36
26
 
37
27
  return element;
38
28
  }
29
+
30
+ function classNameFromElement(element) {
31
+ const domElement = element.getDOMElement(),
32
+ { className } = domElement;
33
+
34
+ return className;
35
+ }
36
+
37
+ function addClassNameToDOMElement(domElement, className) {
38
+ const { classList } = domElement;
39
+
40
+ classList.add(className);
41
+ }
@@ -5,14 +5,12 @@ import withStyle from "easy-with-style"; ///
5
5
  import { window } from "easy";
6
6
  import { keyCodes } from "necessary";
7
7
 
8
+ import Div from "../div";
8
9
  import Element from "../element";
9
- import LeafDiv from "../div/leaf";
10
10
  import touchMixins from "../../mixins/touch";
11
11
  import fullScreenMixins from "../../mixins/fullsrean";
12
12
 
13
13
  import { isFullScreen } from "../../utilities/fullScreen";
14
- import { DIVS_SELECTOR } from "../../selectors";
15
- import { leafNodesFromNodeList } from "../../utilities/tree";
16
14
  import { elementsFromDOMElements } from "../../utilities/element";
17
15
  import { SCROLL_DELAY, UP_DIRECTION, DECELERATION, DOWN_DIRECTION, OPEN_MENU_TAP_AREA_HEIGHT } from "../../constants";
18
16
  import { getViewZoom as getZoom, setViewZoom as setZoom, setColoursInverted, areColoursInverted } from "../../state";
@@ -63,11 +61,11 @@ class OverlayDiv extends Element {
63
61
  }
64
62
 
65
63
  swipeRightCustomHandler = (event, element) => {
66
- this.showLeftLeafDiv();
64
+ this.showLeftDiv();
67
65
  }
68
66
 
69
67
  swipeLeftCustomHandler = (event, element) => {
70
- this.showRightLeftDiv();
68
+ this.showRightDiv();
71
69
  }
72
70
 
73
71
  swipeDownCustomHandler = (event, element, top, left, speed) => {
@@ -138,14 +136,14 @@ class OverlayDiv extends Element {
138
136
  switch (keyCode) {
139
137
  case ENTER_KEY_CODE:
140
138
  case ARROW_RIGHT_KEY_CODE: {
141
- this.showRightLeftDiv();
139
+ this.showRightDiv();
142
140
 
143
141
  break;
144
142
  }
145
143
 
146
144
  case BACKSPACE_KEY_CODE:
147
145
  case ARROW_LEFT_KEY_CODE: {
148
- this.showLeftLeafDiv();
146
+ this.showLeftDiv();
149
147
 
150
148
  break;
151
149
  }
@@ -157,13 +155,13 @@ class OverlayDiv extends Element {
157
155
  }
158
156
 
159
157
  case ARROW_UP_KEY_CODE: {
160
- this.showFirstLeafDiv();
158
+ this.showFirstDiv();
161
159
 
162
160
  break;
163
161
  }
164
162
 
165
163
  case ARROW_DOWN_KEY_CODE: {
166
- this.showLastLeafDiv();
164
+ this.showLastDiv();
167
165
 
168
166
  break;
169
167
  }
@@ -182,9 +180,9 @@ class OverlayDiv extends Element {
182
180
 
183
181
  updateZoom() {
184
182
  const zoom = getZoom(),
185
- displayedLeafDiv = this.findDisplayedLeafDiv();
183
+ displayedDiv = this.findDisplayedDiv();
186
184
 
187
- displayedLeafDiv.zoom(zoom);
185
+ displayedDiv.zoom(zoom);
188
186
  }
189
187
 
190
188
  scrollToTop() {
@@ -271,22 +269,37 @@ class OverlayDiv extends Element {
271
269
  this.enableCustomGestures();
272
270
  }
273
271
 
274
- showFirstLeafDiv() {
275
- const displayedLeafDiv = this.findDisplayedLeafDiv(),
276
- leafDivs = this.getLeafDivs(),
277
- index = leafDivs.indexOf(displayedLeafDiv),
272
+ showRightDiv() {
273
+ const displayedDiv = this.findDisplayedDiv(),
274
+ divs = this.getDivs(),
275
+ divsLength = divs.length,
276
+ index = divs.indexOf(displayedDiv),
277
+ nextIndex = index + 1,
278
+ previousIndex = index; ///
279
+
280
+ if (nextIndex === divsLength) {
281
+ return;
282
+ }
283
+
284
+ this.showNextDiv(nextIndex, previousIndex);
285
+ }
286
+
287
+ showFirstDiv() {
288
+ const displayedDiv = this.findDisplayedDiv(),
289
+ divs = this.getDivs(),
290
+ index = divs.indexOf(displayedDiv),
278
291
  nextIndex = 0,
279
292
  previousIndex = (index === -1) ?
280
293
  nextIndex : ///
281
294
  index; ///
282
295
 
283
- this.showNextLeafDiv(nextIndex, previousIndex);
296
+ this.showNextDiv(nextIndex, previousIndex);
284
297
  }
285
298
 
286
- showLeftLeafDiv() {
287
- const displayedLeafDiv = this.findDisplayedLeafDiv(),
288
- leafDivs = this.getLeafDivs(),
289
- index = leafDivs.indexOf(displayedLeafDiv),
299
+ showLeftDiv() {
300
+ const displayedDiv = this.findDisplayedDiv(),
301
+ divs = this.getDivs(),
302
+ index = divs.indexOf(displayedDiv),
290
303
  nextIndex = index - 1,
291
304
  previousIndex = index; ///
292
305
 
@@ -294,54 +307,39 @@ class OverlayDiv extends Element {
294
307
  return;
295
308
  }
296
309
 
297
- this.showNextLeafDiv(nextIndex, previousIndex);
298
- }
299
-
300
- showRightLeftDiv() {
301
- const displayedLeafDiv = this.findDisplayedLeafDiv(),
302
- leafDivs = this.getLeafDivs(),
303
- leafDivsLength = leafDivs.length,
304
- index = leafDivs.indexOf(displayedLeafDiv),
305
- nextIndex = index + 1,
306
- previousIndex = index; ///
307
-
308
- if (nextIndex === leafDivsLength) {
309
- return;
310
- }
311
-
312
- this.showNextLeafDiv(nextIndex, previousIndex);
310
+ this.showNextDiv(nextIndex, previousIndex);
313
311
  }
314
312
 
315
- showLastLeafDiv() {
316
- const displayedLeafDiv = this.findDisplayedLeafDiv(),
317
- leafDivs = this.getLeafDivs(),
318
- index = leafDivs.indexOf(displayedLeafDiv),
319
- leafDivsLength = leafDivs.length,
320
- nextIndex = leafDivsLength - 1,
313
+ showLastDiv() {
314
+ const displayedDiv = this.findDisplayedDiv(),
315
+ divs = this.getDivs(),
316
+ index = divs.indexOf(displayedDiv),
317
+ divsLength = divs.length,
318
+ nextIndex = divsLength - 1,
321
319
  previousIndex = (index === -1) ?
322
320
  nextIndex : ///
323
321
  index; ///
324
322
 
325
- this.showNextLeafDiv(nextIndex, previousIndex);
323
+ this.showNextDiv(nextIndex, previousIndex);
326
324
  }
327
325
 
328
- showNextLeafDiv(nextIndex, previousIndex) {
329
- const leafDivs = this.getLeafDivs(),
330
- nextLeafDiv = leafDivs[nextIndex],
331
- previousLeafDiv = leafDivs[previousIndex],
332
- backgroundColour = nextLeafDiv.getBackgroundColour();
326
+ showNextDiv(nextIndex, previousIndex) {
327
+ const divs = this.getDivs(),
328
+ nextDiv = divs[nextIndex],
329
+ previousDiv = divs[previousIndex],
330
+ backgroundColour = nextDiv.getBackgroundColour();
333
331
 
334
332
  let zoom;
335
333
 
336
334
  zoom = 1;
337
335
 
338
- previousLeafDiv.zoom(zoom);
336
+ previousDiv.zoom(zoom);
339
337
 
340
338
  zoom = getZoom();
341
339
 
342
- nextLeafDiv.zoom(zoom);
340
+ nextDiv.zoom(zoom);
343
341
 
344
- previousLeafDiv.hide();
342
+ previousDiv.hide();
345
343
 
346
344
  this.setBackgroundColour(backgroundColour);
347
345
 
@@ -349,7 +347,7 @@ class OverlayDiv extends Element {
349
347
 
350
348
  this.scrollToTop();
351
349
 
352
- nextLeafDiv.show();
350
+ nextDiv.show();
353
351
  }
354
352
 
355
353
  setBackgroundColour(backgroundColour) {
@@ -361,50 +359,24 @@ class OverlayDiv extends Element {
361
359
  this.css(css);
362
360
  }
363
361
 
364
- hideAllLeafDivs() {
365
- this.forEachLeafDiv((leafDiv) => {
366
- leafDiv.hide();
367
- });
368
- }
369
-
370
- findDisplayedLeafDiv() {
371
- const leafDivs = this.getLeafDivs(),
372
- displayedLeafDiv = leafDivs.find((leafDiv) => {
373
- const displayed = leafDiv.isDisplayed();
362
+ findDisplayedDiv() {
363
+ const divs = this.getDivs(),
364
+ displayedDiv = divs.find((div) => {
365
+ const displayed = div.isDisplayed();
374
366
 
375
367
  if (displayed) {
376
368
  return true;
377
369
  }
378
370
  });
379
371
 
380
- return displayedLeafDiv;
381
- }
382
-
383
- retrieveLeafDivs() {
384
- const domElement = this.getDOMElement(),
385
- divNodeList = domElement.querySelectorAll(DIVS_SELECTOR),
386
- leafDivNodes = leafNodesFromNodeList(divNodeList), ///
387
- leafDivs = elementsFromDOMElements(leafDivNodes, LeafDiv);
388
-
389
- return leafDivs;
372
+ return displayedDiv;
390
373
  }
391
374
 
392
- forEachLeafDiv(callback) {
393
- const leafDivs = this.getLeafDivs();
375
+ getDivs() {
376
+ const childElements = this.getChildElements(),
377
+ divs = childElements; ///
394
378
 
395
- leafDivs.forEach(callback);
396
- }
397
-
398
- getLeafDivs() {
399
- const { leafDivs } = this.getState();
400
-
401
- return leafDivs;
402
- }
403
-
404
- setLeftDivs(leafDivs) {
405
- this.updateState({
406
- leafDivs
407
- });
379
+ return divs;
408
380
  }
409
381
 
410
382
  getInterval() {
@@ -444,26 +416,17 @@ class OverlayDiv extends Element {
444
416
  }
445
417
 
446
418
  setInitialState() {
447
- const leafDivs = this.retrieveLeafDivs(),
448
- interval = null,
419
+ const interval = null,
449
420
  startZoom = null,
450
421
  startScrollTop = null;
451
422
 
452
423
  this.setState({
453
- leafDivs,
454
424
  interval,
455
425
  startZoom,
456
426
  startScrollTop
457
427
  });
458
428
  }
459
429
 
460
- appendDivDOMElement() {
461
- const { divDOMElement } = this.properties,
462
- domElement = this.getDOMElement();
463
-
464
- domElement.append(divDOMElement);
465
- }
466
-
467
430
  didMount() {
468
431
  window.onKeyDown(this.keyDownHandler);
469
432
 
@@ -482,17 +445,17 @@ class OverlayDiv extends Element {
482
445
  this.onCustomFullScreenChange(this.fullScreenChangeCustomHandler);
483
446
 
484
447
  this.enableFullScreen();
448
+
485
449
  this.enableTouch();
486
450
 
487
- this.showFirstLeafDiv();
451
+ this.updateZoom();
488
452
 
489
453
  this.updateColours();
490
-
491
- this.updateZoom();
492
454
  }
493
455
 
494
456
  willUnmount() {
495
457
  this.disableTouch();
458
+
496
459
  this.disableFullScreen();
497
460
 
498
461
  this.offCustomTap(this.tapCustomHandler);
@@ -512,6 +475,16 @@ class OverlayDiv extends Element {
512
475
  window.offKeyDown(this.keyDownHandler);
513
476
  }
514
477
 
478
+ childElements() {
479
+ const { divDOMElements } = this.properties,
480
+ divs = elementsFromDOMElements(divDOMElements, Div),
481
+ childElements = [
482
+ ...divs
483
+ ];
484
+
485
+ return childElements;
486
+ }
487
+
515
488
  parentContext() {
516
489
  const invertColours = this.invertColours.bind(this),
517
490
  revertColours = this.revertColours.bind(this),
@@ -535,19 +508,15 @@ class OverlayDiv extends Element {
535
508
  initialise() {
536
509
  this.assignContext();
537
510
 
538
- this.appendDivDOMElement();
539
-
540
511
  this.setInitialState();
541
512
 
542
- this.suppressNativeGestures();
543
-
544
- this.hideAllLeafDivs();
513
+ this.showFirstDiv();
545
514
  }
546
515
 
547
516
  static tagName = "div";
548
517
 
549
518
  static ignoredProperties = [
550
- "divDOMElement"
519
+ "divDOMElements"
551
520
  ];
552
521
 
553
522
  static defaultProperties = {
@@ -4,9 +4,9 @@ import withStyle from "easy-with-style"; ///
4
4
 
5
5
  import { Element } from "easy";
6
6
 
7
- import { BACKGROUND_COLOUR } from "../../constants";
7
+ import { BACKGROUND_COLOUR } from "../constants";
8
8
 
9
- class LeafDiv extends Element {
9
+ class Div extends Element {
10
10
  getBackgroundColour() {
11
11
  const backgroundColour = this.css(BACKGROUND_COLOUR) || null;
12
12
 
@@ -26,15 +26,12 @@ class LeafDiv extends Element {
26
26
  }
27
27
 
28
28
  static tagName = "div";
29
-
30
- static defaultProperties = {
31
- className: "leaf"
32
- };
33
29
  }
34
30
 
35
- export default withStyle(LeafDiv)`
31
+ export default withStyle(Div)`
36
32
 
37
33
  width: 100%;
34
+ display: none;
38
35
  min-height: 100%;
39
36
  pointer-events: none;
40
37
  transform-origin: top left;
package/src/view.js CHANGED
@@ -14,12 +14,12 @@ class View extends Element {
14
14
  }
15
15
 
16
16
  childElements() {
17
- const { divDOMElement } = this.properties;
17
+ const { divDOMElements } = this.properties;
18
18
 
19
19
  return ([
20
20
 
21
21
  <PreloaderDiv/>,
22
- <OverlayDiv divDOMElement={divDOMElement} />,
22
+ <OverlayDiv divDOMElements={divDOMElements} />,
23
23
  <MenuDiv/>
24
24
 
25
25
  ]);
@@ -34,7 +34,7 @@ class View extends Element {
34
34
  static tagName = "div";
35
35
 
36
36
  static ignoredProperties = [
37
- "divDOMElement"
37
+ "divDOMElements"
38
38
  ];
39
39
 
40
40
  static defaultProperties = {
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "leafNodesFromNodeList", {
6
- enumerable: true,
7
- get: function() {
8
- return leafNodesFromNodeList;
9
- }
10
- });
11
- var _necessary = require("necessary");
12
- function _array_like_to_array(arr, len) {
13
- if (len == null || len > arr.length) len = arr.length;
14
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
15
- return arr2;
16
- }
17
- function _array_without_holes(arr) {
18
- if (Array.isArray(arr)) return _array_like_to_array(arr);
19
- }
20
- function _iterable_to_array(iter) {
21
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
22
- }
23
- function _non_iterable_spread() {
24
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
25
- }
26
- function _to_consumable_array(arr) {
27
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
28
- }
29
- function _unsupported_iterable_to_array(o, minLen) {
30
- if (!o) return;
31
- if (typeof o === "string") return _array_like_to_array(o, minLen);
32
- var n = Object.prototype.toString.call(o).slice(8, -1);
33
- if (n === "Object" && o.constructor) n = o.constructor.name;
34
- if (n === "Map" || n === "Set") return Array.from(n);
35
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
36
- }
37
- var filter = _necessary.arrayUtilities.filter;
38
- function leafNodesFromNodeList(nodeList) {
39
- var nodes = _to_consumable_array(nodeList);
40
- filter(nodes, function(node) {
41
- var childNodeList = node.childNodes, childNodes = _to_consumable_array(childNodeList), childNodesIncludesNodes = nodes.some(function(node) {
42
- var childNodesIncludesNode = childNodes.includes(node);
43
- if (childNodesIncludesNode) {
44
- return true;
45
- }
46
- });
47
- if (!childNodesIncludesNodes) {
48
- return true;
49
- }
50
- });
51
- var leafNodes = nodes; ///
52
- return leafNodes;
53
- }
54
-
55
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvdHJlZS5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuaW1wb3J0IHsgYXJyYXlVdGlsaXRpZXMgfSBmcm9tIFwibmVjZXNzYXJ5XCI7XG5cbmNvbnN0IHsgZmlsdGVyIH0gPSBhcnJheVV0aWxpdGllcztcblxuZXhwb3J0IGZ1bmN0aW9uIGxlYWZOb2Rlc0Zyb21Ob2RlTGlzdChub2RlTGlzdCkge1xuICBjb25zdCBub2RlcyA9IFsgLi4ubm9kZUxpc3QgXTtcblxuICBmaWx0ZXIobm9kZXMsIChub2RlKSA9PiB7XG4gICAgY29uc3QgeyBjaGlsZE5vZGVzOiBjaGlsZE5vZGVMaXN0IH0gPSBub2RlLFxuICAgICAgICAgIGNoaWxkTm9kZXMgPSBbIC4uLmNoaWxkTm9kZUxpc3QgXSxcbiAgICAgICAgICBjaGlsZE5vZGVzSW5jbHVkZXNOb2RlcyA9IG5vZGVzLnNvbWUoKG5vZGUpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGNoaWxkTm9kZXNJbmNsdWRlc05vZGUgPSBjaGlsZE5vZGVzLmluY2x1ZGVzKG5vZGUpO1xuXG4gICAgICAgICAgICBpZiAoY2hpbGROb2Rlc0luY2x1ZGVzTm9kZSkge1xuICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcblxuICAgIGlmICghY2hpbGROb2Rlc0luY2x1ZGVzTm9kZXMpIHtcbiAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cbiAgfSk7XG5cbiAgY29uc3QgbGVhZk5vZGVzID0gbm9kZXM7ICAvLy9cblxuICByZXR1cm4gbGVhZk5vZGVzO1xufVxuIl0sIm5hbWVzIjpbImxlYWZOb2Rlc0Zyb21Ob2RlTGlzdCIsImZpbHRlciIsImFycmF5VXRpbGl0aWVzIiwibm9kZUxpc3QiLCJub2RlcyIsIm5vZGUiLCJjaGlsZE5vZGVzIiwiY2hpbGROb2RlTGlzdCIsImNoaWxkTm9kZXNJbmNsdWRlc05vZGVzIiwic29tZSIsImNoaWxkTm9kZXNJbmNsdWRlc05vZGUiLCJpbmNsdWRlcyIsImxlYWZOb2RlcyJdLCJyYW5nZU1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyIsIm1hcHBpbmdzIjoiQUFBQTs7OzsrQkFNZ0JBOzs7ZUFBQUE7Ozt5QkFKZTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFFL0IsSUFBTSxBQUFFQyxTQUFXQyx5QkFBYyxDQUF6QkQ7QUFFRCxTQUFTRCxzQkFBc0JHLFFBQVE7SUFDNUMsSUFBTUMsUUFBVSxxQkFBR0Q7SUFFbkJGLE9BQU9HLE9BQU8sU0FBQ0M7UUFDYixJQUFRQyxBQUFZQyxnQkFBa0JGLEtBQTlCQyxZQUNGQSxhQUFlLHFCQUFHQyxnQkFDbEJDLDBCQUEwQkosTUFBTUssSUFBSSxDQUFDLFNBQUNKO1lBQ3BDLElBQU1LLHlCQUF5QkosV0FBV0ssUUFBUSxDQUFDTjtZQUVuRCxJQUFJSyx3QkFBd0I7Z0JBQzFCLE9BQU87WUFDVDtRQUNGO1FBRU4sSUFBSSxDQUFDRix5QkFBeUI7WUFDNUIsT0FBTztRQUNUO0lBQ0Y7SUFFQSxJQUFNSSxZQUFZUixPQUFRLEdBQUc7SUFFN0IsT0FBT1E7QUFDVCJ9
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- import { arrayUtilities } from "necessary";
4
-
5
- const { filter } = arrayUtilities;
6
-
7
- export function leafNodesFromNodeList(nodeList) {
8
- const nodes = [ ...nodeList ];
9
-
10
- filter(nodes, (node) => {
11
- const { childNodes: childNodeList } = node,
12
- childNodes = [ ...childNodeList ],
13
- childNodesIncludesNodes = nodes.some((node) => {
14
- const childNodesIncludesNode = childNodes.includes(node);
15
-
16
- if (childNodesIncludesNode) {
17
- return true;
18
- }
19
- });
20
-
21
- if (!childNodesIncludesNodes) {
22
- return true;
23
- }
24
- });
25
-
26
- const leafNodes = nodes; ///
27
-
28
- return leafNodes;
29
- }