ebaoferc 0.0.1 → 0.0.2-beta.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.
Files changed (133) hide show
  1. package/dist/{FlexRowCol → components/FlexRowCol}/index.js +1 -1
  2. package/dist/components/MindGraph/core/default.d.ts +6 -0
  3. package/dist/components/MindGraph/core/default.js +81 -0
  4. package/dist/components/MindGraph/core/graphic/drag.d.ts +42 -0
  5. package/dist/components/MindGraph/core/graphic/drag.js +120 -0
  6. package/dist/components/MindGraph/core/graphic/index.d.ts +181 -0
  7. package/dist/components/MindGraph/core/graphic/index.js +423 -0
  8. package/dist/components/MindGraph/core/graphic/node-translate-to.d.ts +11 -0
  9. package/dist/components/MindGraph/core/graphic/node-translate-to.js +55 -0
  10. package/dist/components/MindGraph/core/graphic/zoom.d.ts +17 -0
  11. package/dist/components/MindGraph/core/graphic/zoom.js +89 -0
  12. package/dist/components/MindGraph/core/helper/breadth-first-walk-tree.d.ts +5 -0
  13. package/dist/components/MindGraph/core/helper/breadth-first-walk-tree.js +21 -0
  14. package/dist/components/MindGraph/core/helper/depth-first-walk-tree.d.ts +10 -0
  15. package/dist/components/MindGraph/core/helper/depth-first-walk-tree.js +17 -0
  16. package/dist/components/MindGraph/core/helper/descendant.d.ts +6 -0
  17. package/dist/components/MindGraph/core/helper/descendant.js +28 -0
  18. package/dist/components/MindGraph/core/helper/error.d.ts +1 -0
  19. package/dist/components/MindGraph/core/helper/error.js +3 -0
  20. package/dist/components/MindGraph/core/helper/get-layout-calc-children.d.ts +10 -0
  21. package/dist/components/MindGraph/core/helper/get-layout-calc-children.js +37 -0
  22. package/dist/components/MindGraph/core/helper/get-svg-path-id.d.ts +1 -0
  23. package/dist/components/MindGraph/core/helper/get-svg-path-id.js +4 -0
  24. package/dist/components/MindGraph/core/helper/index.d.ts +23 -0
  25. package/dist/components/MindGraph/core/helper/index.js +26 -0
  26. package/dist/components/MindGraph/core/helper/judge-if-all-child-fold.d.ts +7 -0
  27. package/dist/components/MindGraph/core/helper/judge-if-all-child-fold.js +14 -0
  28. package/dist/components/MindGraph/core/helper/judge-if-heir-and-fold.d.ts +10 -0
  29. package/dist/components/MindGraph/core/helper/judge-if-heir-and-fold.js +26 -0
  30. package/dist/components/MindGraph/core/helper/judge-if-visual-leaf.d.ts +6 -0
  31. package/dist/components/MindGraph/core/helper/judge-if-visual-leaf.js +7 -0
  32. package/dist/components/MindGraph/core/helper/root-to-node-array.d.ts +2 -0
  33. package/dist/components/MindGraph/core/helper/root-to-node-array.js +27 -0
  34. package/dist/components/MindGraph/core/helper/transform-root-to-walkable.d.ts +5 -0
  35. package/dist/components/MindGraph/core/helper/transform-root-to-walkable.js +32 -0
  36. package/dist/components/MindGraph/core/helper/with-prefix.d.ts +1 -0
  37. package/dist/components/MindGraph/core/helper/with-prefix.js +3 -0
  38. package/dist/components/MindGraph/core/index.d.ts +394 -0
  39. package/dist/components/MindGraph/core/index.js +86 -0
  40. package/dist/components/MindGraph/core/process/anchor.d.ts +12 -0
  41. package/dist/components/MindGraph/core/process/anchor.js +63 -0
  42. package/dist/components/MindGraph/core/process/index.d.ts +91 -0
  43. package/dist/components/MindGraph/core/process/index.js +30 -0
  44. package/dist/components/MindGraph/core/process/layout/dagre.d.ts +2 -0
  45. package/dist/components/MindGraph/core/process/layout/dagre.js +20 -0
  46. package/dist/components/MindGraph/core/process/layout/descendant-center.d.ts +10 -0
  47. package/dist/components/MindGraph/core/process/layout/descendant-center.js +146 -0
  48. package/dist/components/MindGraph/core/process/layout/heir-center.d.ts +10 -0
  49. package/dist/components/MindGraph/core/process/layout/heir-center.js +52 -0
  50. package/dist/components/MindGraph/core/process/layout/index.d.ts +3 -0
  51. package/dist/components/MindGraph/core/process/layout/index.js +3 -0
  52. package/dist/components/MindGraph/core/process/layout/structured/calc-drag-attach.d.ts +2 -0
  53. package/dist/components/MindGraph/core/process/layout/structured/calc-drag-attach.js +172 -0
  54. package/dist/components/MindGraph/core/process/layout/structured/calc-drop-index.d.ts +2 -0
  55. package/dist/components/MindGraph/core/process/layout/structured/calc-drop-index.js +38 -0
  56. package/dist/components/MindGraph/core/process/layout/structured/get-node-cross-boundary.d.ts +10 -0
  57. package/dist/components/MindGraph/core/process/layout/structured/get-node-cross-boundary.js +35 -0
  58. package/dist/components/MindGraph/core/process/layout/structured/index.d.ts +13 -0
  59. package/dist/components/MindGraph/core/process/layout/structured/index.js +321 -0
  60. package/dist/components/MindGraph/core/process/layout/type.d.ts +44 -0
  61. package/dist/components/MindGraph/core/process/layout/type.js +51 -0
  62. package/dist/components/MindGraph/core/process/line.d.ts +9 -0
  63. package/dist/components/MindGraph/core/process/line.js +69 -0
  64. package/dist/components/MindGraph/core/process/node-valid.d.ts +6 -0
  65. package/dist/components/MindGraph/core/process/node-valid.js +35 -0
  66. package/dist/components/MindGraph/core/process/orientation.d.ts +8 -0
  67. package/dist/components/MindGraph/core/process/orientation.js +40 -0
  68. package/dist/components/MindGraph/core/process/size.d.ts +4 -0
  69. package/dist/components/MindGraph/core/process/size.js +16 -0
  70. package/dist/components/MindGraph/core/process/visible.d.ts +16 -0
  71. package/dist/components/MindGraph/core/process/visible.js +99 -0
  72. package/dist/components/MindGraph/core/render/calc-visible.d.ts +11 -0
  73. package/dist/components/MindGraph/core/render/calc-visible.js +25 -0
  74. package/dist/components/MindGraph/core/render/connect/bezier.d.ts +2 -0
  75. package/dist/components/MindGraph/core/render/connect/bezier.js +12 -0
  76. package/dist/components/MindGraph/core/render/connect/get-path-render.d.ts +2 -0
  77. package/dist/components/MindGraph/core/render/connect/get-path-render.js +17 -0
  78. package/dist/components/MindGraph/core/render/connect/index.d.ts +10 -0
  79. package/dist/components/MindGraph/core/render/connect/index.js +45 -0
  80. package/dist/components/MindGraph/core/render/connect/line.d.ts +2 -0
  81. package/dist/components/MindGraph/core/render/connect/line.js +71 -0
  82. package/dist/components/MindGraph/core/render/connect/temporary-line.d.ts +15 -0
  83. package/dist/components/MindGraph/core/render/connect/temporary-line.js +44 -0
  84. package/dist/components/MindGraph/core/render/index.d.ts +27 -0
  85. package/dist/components/MindGraph/core/render/index.js +8 -0
  86. package/dist/components/MindGraph/core/render/layout.d.ts +12 -0
  87. package/dist/components/MindGraph/core/render/layout.js +85 -0
  88. package/dist/components/MindGraph/demo.js +54 -0
  89. package/dist/components/MindGraph/index.d.ts +3 -0
  90. package/dist/components/MindGraph/index.js +3 -0
  91. package/dist/components/MindGraph/react/component/index.d.ts +3 -0
  92. package/dist/components/MindGraph/react/component/index.js +227 -0
  93. package/dist/components/MindGraph/react/component/index.module.less +72 -0
  94. package/dist/components/MindGraph/react/component/nodes.d.ts +13 -0
  95. package/dist/components/MindGraph/react/component/nodes.js +153 -0
  96. package/dist/components/MindGraph/react/hook/use-drag.d.ts +20 -0
  97. package/dist/components/MindGraph/react/hook/use-drag.js +191 -0
  98. package/dist/components/MindGraph/react/hook/use-shadow-state.d.ts +2 -0
  99. package/dist/components/MindGraph/react/hook/use-shadow-state.js +24 -0
  100. package/dist/components/MindGraph/react/index.d.ts +154 -0
  101. package/dist/components/MindGraph/react/index.js +9 -0
  102. package/dist/components/MindGraph/react/scrollbar/axis/index.d.ts +25 -0
  103. package/dist/components/MindGraph/react/scrollbar/axis/index.js +143 -0
  104. package/dist/components/MindGraph/react/scrollbar/axis/index.module.less +48 -0
  105. package/dist/components/MindGraph/react/scrollbar/index.d.ts +8 -0
  106. package/dist/components/MindGraph/react/scrollbar/index.js +134 -0
  107. package/dist/components/MindGraph/react/tools/class-name-wrapper.d.ts +1 -0
  108. package/dist/components/MindGraph/react/tools/class-name-wrapper.js +5 -0
  109. package/dist/{SliderVerify → components/SliderVerify}/icons/close.js +0 -1
  110. package/dist/{SliderVerify → components/SliderVerify}/icons/refresh.js +0 -1
  111. package/dist/components/SliderVerify/icons/slider.d.ts +1 -0
  112. package/dist/{SliderVerify → components/SliderVerify}/icons/slider.js +0 -1
  113. package/dist/{SliderVerify → components/SliderVerify}/style.module.less +119 -121
  114. package/dist/{StyledQueryFilter → components/StyledQueryFilter}/index.less +22 -22
  115. package/dist/{StyledTable → components/StyledTable}/index.less +11 -11
  116. package/dist/{TabSearchTools → components/TabSearchTools}/index.d.ts +2 -2
  117. package/dist/{TabSearchTools → components/TabSearchTools}/index.js +1 -1
  118. package/dist/components/index.d.ts +6 -0
  119. package/dist/components/index.js +6 -0
  120. package/dist/index.d.ts +3 -5
  121. package/dist/index.js +3 -5
  122. package/dist/utils/format/index.js +8 -8
  123. package/package.json +32 -20
  124. /package/dist/{FlexRowCol → components/FlexRowCol}/index.d.ts +0 -0
  125. /package/dist/{SliderVerify/icons/close.d.ts → components/MindGraph/demo.d.ts} +0 -0
  126. /package/dist/{SliderVerify/icons/refresh.d.ts → components/SliderVerify/icons/close.d.ts} +0 -0
  127. /package/dist/{SliderVerify/icons/slider.d.ts → components/SliderVerify/icons/refresh.d.ts} +0 -0
  128. /package/dist/{SliderVerify → components/SliderVerify}/index.d.ts +0 -0
  129. /package/dist/{SliderVerify → components/SliderVerify}/index.js +0 -0
  130. /package/dist/{StyledQueryFilter → components/StyledQueryFilter}/index.d.ts +0 -0
  131. /package/dist/{StyledQueryFilter → components/StyledQueryFilter}/index.js +0 -0
  132. /package/dist/{StyledTable → components/StyledTable}/index.d.ts +0 -0
  133. /package/dist/{StyledTable → components/StyledTable}/index.js +0 -0
@@ -0,0 +1,28 @@
1
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
+ 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); }
3
+ 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; }
4
+ /**
5
+ * 获取某个节点的所有后代
6
+ * @param node 节点
7
+ */
8
+ export var descendant = function descendant(node) {
9
+ var result = [];
10
+ var recursion = function recursion() {
11
+ var nodes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
12
+ var _iterator = _createForOfIteratorHelper(nodes),
13
+ _step;
14
+ try {
15
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
16
+ var disposeNode = _step.value;
17
+ result.push(disposeNode);
18
+ recursion(disposeNode.children);
19
+ }
20
+ } catch (err) {
21
+ _iterator.e(err);
22
+ } finally {
23
+ _iterator.f();
24
+ }
25
+ };
26
+ recursion(node.children);
27
+ return result;
28
+ };
@@ -0,0 +1 @@
1
+ export declare const error: (message: string) => Error;
@@ -0,0 +1,3 @@
1
+ export var error = function error(message) {
2
+ return new Error("".concat(message));
3
+ };
@@ -0,0 +1,10 @@
1
+ import { Mind } from '../index';
2
+ import { Process } from '../process';
3
+ /**
4
+ * 获取用于布局计算的子代
5
+ * - 剔除掉被折叠的部分
6
+ * @param node
7
+ * @param rootId
8
+ * @param getRootHeirOrientation
9
+ */
10
+ export declare const getLayoutCalcChildren: (node: Mind.Node, rootId: string, getRootHeirOrientation: Process.getRootHeirOrientationFunc) => Mind.Node[];
@@ -0,0 +1,37 @@
1
+ import { Mind } from "../index";
2
+ import { Helper } from "./index";
3
+
4
+ /**
5
+ * 获取用于布局计算的子代
6
+ * - 剔除掉被折叠的部分
7
+ * @param node
8
+ * @param rootId
9
+ * @param getRootHeirOrientation
10
+ */
11
+ export var getLayoutCalcChildren = function getLayoutCalcChildren(node, rootId, getRootHeirOrientation) {
12
+ // 判断是否所有子代都折叠了
13
+ if (Helper.judgeIfAllChildFold(node, rootId)) {
14
+ return [];
15
+ }
16
+ var children = node.children || [];
17
+ // 非根节点,则直接返回子代(非根节点只有一侧子代)
18
+ if (node.id !== rootId) {
19
+ return children;
20
+ } else {
21
+ var fold = node.fold || [];
22
+ // 只有 negative 折叠
23
+ if (fold[0]) {
24
+ return children.filter(function (item) {
25
+ return getRootHeirOrientation(item.id) === Mind.Orientation.positive;
26
+ });
27
+ }
28
+
29
+ // 只有 positive 折叠
30
+ if (fold[1]) {
31
+ return children.filter(function (item) {
32
+ return getRootHeirOrientation(item.id) === Mind.Orientation.negative;
33
+ });
34
+ }
35
+ return children;
36
+ }
37
+ };
@@ -0,0 +1 @@
1
+ export declare const getSvgPathId: (id: string) => string;
@@ -0,0 +1,4 @@
1
+ import { withPrefix } from "./with-prefix";
2
+ export var getSvgPathId = function getSvgPathId(id) {
3
+ return withPrefix("line-".concat(id));
4
+ };
@@ -0,0 +1,23 @@
1
+ export declare const Helper: {
2
+ breadthFirstWalkTree: (node: import("..").Mind.Node, callback: {
3
+ before: (node: import("..").Mind.Node) => boolean;
4
+ after: (rank: import("..").Mind.Node[]) => void;
5
+ }) => void;
6
+ depthFirstWalkTree: (root: import("..").Mind.Node, callback: {
7
+ before: (node: import("..").Mind.Node, parent?: import("..").Mind.Node | undefined) => boolean;
8
+ after: (node: import("..").Mind.Node, parent?: import("..").Mind.Node | undefined) => void;
9
+ }) => void;
10
+ descendant: (node: import("..").Mind.Node) => import("..").Mind.Node[];
11
+ error: (message: string) => Error;
12
+ getLayoutCalcChildren: (node: import("..").Mind.Node, rootId: string, getRootHeirOrientation: import("../process").Process.getRootHeirOrientationFunc) => import("..").Mind.Node[];
13
+ getSvgPathId: (id: string) => string;
14
+ judgeIfAllChildFold: (node: import("..").Mind.Node, rootId: string) => boolean;
15
+ judgeIfHeirAndFold: (node: import("..").Mind.Node, parent: import("..").Mind.Node | undefined, root: import("..").Mind.Root, getRootHeirOrientation: import("../process").Process.getRootHeirOrientationFunc) => boolean;
16
+ judgeIfVisualLeaf: (node: import("..").Mind.Node, children?: import("..").Mind.Node[] | undefined) => boolean | boolean[] | undefined;
17
+ rootToNodeArray: (root: import("..").Mind.Root, callback: (node: import("..").Mind.Node) => void) => import("..").Mind.Node[];
18
+ transformRootToWalkable: (root: import("..").Mind.Root) => {
19
+ getRootHeirOrientation: (id: string) => import("..").Mind.Orientation;
20
+ shadowNode: import("..").Mind.Node;
21
+ };
22
+ withPrefix: (message: string) => string;
23
+ };
@@ -0,0 +1,26 @@
1
+ import { breadthFirstWalkTree } from "./breadth-first-walk-tree";
2
+ import { depthFirstWalkTree } from "./depth-first-walk-tree";
3
+ import { descendant } from "./descendant";
4
+ import { error } from "./error";
5
+ import { getLayoutCalcChildren } from "./get-layout-calc-children";
6
+ import { getSvgPathId } from "./get-svg-path-id";
7
+ import { judgeIfAllChildFold } from "./judge-if-all-child-fold";
8
+ import { judgeIfHeirAndFold } from "./judge-if-heir-and-fold";
9
+ import { judgeIfVisualLeaf } from "./judge-if-visual-leaf";
10
+ import { rootToNodeArray } from "./root-to-node-array";
11
+ import { transformRootToWalkable } from "./transform-root-to-walkable";
12
+ import { withPrefix } from "./with-prefix";
13
+ export var Helper = {
14
+ breadthFirstWalkTree: breadthFirstWalkTree,
15
+ depthFirstWalkTree: depthFirstWalkTree,
16
+ descendant: descendant,
17
+ error: error,
18
+ getLayoutCalcChildren: getLayoutCalcChildren,
19
+ getSvgPathId: getSvgPathId,
20
+ judgeIfAllChildFold: judgeIfAllChildFold,
21
+ judgeIfHeirAndFold: judgeIfHeirAndFold,
22
+ judgeIfVisualLeaf: judgeIfVisualLeaf,
23
+ rootToNodeArray: rootToNodeArray,
24
+ transformRootToWalkable: transformRootToWalkable,
25
+ withPrefix: withPrefix
26
+ };
@@ -0,0 +1,7 @@
1
+ import { Mind } from '../index';
2
+ /**
3
+ * 判断节点是否所有子代都需要被折叠
4
+ * @param node
5
+ * @param rootId
6
+ */
7
+ export declare const judgeIfAllChildFold: (node: Mind.Node, rootId: string) => boolean;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 判断节点是否所有子代都需要被折叠
3
+ * @param node
4
+ * @param rootId
5
+ */
6
+ export var judgeIfAllChildFold = function judgeIfAllChildFold(node, rootId) {
7
+ if (node.id === rootId) {
8
+ return !!node.fold && Array.from(node.fold).length > 0 && Array.from(node.fold).every(function (item) {
9
+ return item;
10
+ });
11
+ } else {
12
+ return !!node.fold;
13
+ }
14
+ };
@@ -0,0 +1,10 @@
1
+ import { Mind } from '../index';
2
+ import { Process } from '../process';
3
+ /**
4
+ * 判断节点是否为root直系子代并且已经被折叠了
5
+ * @param node
6
+ * @param parent
7
+ * @param root
8
+ * @param getRootHeirOrientation
9
+ */
10
+ export declare const judgeIfHeirAndFold: (node: Mind.Node, parent: Mind.Node | undefined, root: Mind.Root, getRootHeirOrientation: Process.getRootHeirOrientationFunc) => boolean;
@@ -0,0 +1,26 @@
1
+ import { Mind } from "../index";
2
+ /**
3
+ * 判断节点是否为root直系子代并且已经被折叠了
4
+ * @param node
5
+ * @param parent
6
+ * @param root
7
+ * @param getRootHeirOrientation
8
+ */
9
+ export var judgeIfHeirAndFold = function judgeIfHeirAndFold(node, parent, root, getRootHeirOrientation) {
10
+ // 是否为根节点直系子代
11
+ var isRootChild = (parent === null || parent === void 0 ? void 0 : parent.id) === root.node.id;
12
+ // 保证后续处理节点的节点都没有被折叠
13
+ // 此处处理根节点只有左侧折叠或者右侧折叠的情况
14
+ if (isRootChild && root.node.fold) {
15
+ // negative 折叠,并且节点为root直系negative
16
+ if (root.node.fold[0] && getRootHeirOrientation(node.id) === Mind.Orientation.negative) {
17
+ return true;
18
+ }
19
+
20
+ // positive 折叠,并且节点为root直系positive
21
+ if (root.node.fold[1] && getRootHeirOrientation(node.id) === Mind.Orientation.positive) {
22
+ return true;
23
+ }
24
+ }
25
+ return false;
26
+ };
@@ -0,0 +1,6 @@
1
+ import { Mind } from '../index';
2
+ /**
3
+ * 判断节点是否为视觉上的叶节点
4
+ * - 子代被折叠也算视觉上叶节点
5
+ */
6
+ export declare const judgeIfVisualLeaf: (node: Mind.Node, children?: Mind.Node[]) => boolean | boolean[] | undefined;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 判断节点是否为视觉上的叶节点
3
+ * - 子代被折叠也算视觉上叶节点
4
+ */
5
+ export var judgeIfVisualLeaf = function judgeIfVisualLeaf(node, children) {
6
+ return !children || children.length === 0 || node.fold;
7
+ };
@@ -0,0 +1,2 @@
1
+ import { Mind } from '../index';
2
+ export declare const rootToNodeArray: (root: Mind.Root, callback: (node: Mind.Node) => void) => Mind.Node[];
@@ -0,0 +1,27 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ 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."); }
3
+ 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); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ 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; }
7
+ export var rootToNodeArray = function rootToNodeArray(root, callback) {
8
+ var result = [];
9
+ callback(root.node);
10
+ result.push(root.node);
11
+ var dispose = [].concat(_toConsumableArray(root.negative || []), _toConsumableArray(root.positive || []));
12
+ var _loop = function _loop() {
13
+ var cache = [];
14
+ dispose.forEach(function (item) {
15
+ callback(item);
16
+ result.push(item);
17
+ });
18
+ dispose.forEach(function (item) {
19
+ return cache.push.apply(cache, _toConsumableArray(item.children || []));
20
+ });
21
+ dispose = cache;
22
+ };
23
+ while (dispose.length) {
24
+ _loop();
25
+ }
26
+ return result;
27
+ };
@@ -0,0 +1,5 @@
1
+ import { Mind } from '../index';
2
+ export declare const transformRootToWalkable: (root: Mind.Root) => {
3
+ getRootHeirOrientation: (id: string) => Mind.Orientation;
4
+ shadowNode: Mind.Node;
5
+ };
@@ -0,0 +1,32 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ 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."); }
4
+ 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); }
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ 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; }
8
+ 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; }
9
+ 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; }
10
+ 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; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ 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); }
13
+ import { Mind } from "../index";
14
+ export var transformRootToWalkable = function transformRootToWalkable(root) {
15
+ var negative = root.negative || [];
16
+ var positive = root.positive || [];
17
+ var shadowNode = _objectSpread({}, root.node);
18
+ shadowNode.children = [].concat(_toConsumableArray(negative), _toConsumableArray(positive));
19
+ var cache = new Map();
20
+ negative.forEach(function (item) {
21
+ return cache.set(item.id, Mind.Orientation.negative);
22
+ });
23
+ positive.forEach(function (item) {
24
+ return cache.set(item.id, Mind.Orientation.positive);
25
+ });
26
+ return {
27
+ getRootHeirOrientation: function getRootHeirOrientation(id) {
28
+ return cache.get(id);
29
+ },
30
+ shadowNode: shadowNode
31
+ };
32
+ };
@@ -0,0 +1 @@
1
+ export declare const withPrefix: (message: string) => string;
@@ -0,0 +1,3 @@
1
+ export var withPrefix = function withPrefix(message) {
2
+ return "mind__".concat(message);
3
+ };