@aglyn/besigner 1.0.0-beta.143

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 (99) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +7 -0
  3. package/package.json +48 -0
  4. package/src/besigner.d.ts +28 -0
  5. package/src/besigner.js +59 -0
  6. package/src/besigner.js.map +1 -0
  7. package/src/index.d.ts +17 -0
  8. package/src/index.js +18 -0
  9. package/src/index.js.map +1 -0
  10. package/src/lib/api/app.api.d.ts +22 -0
  11. package/src/lib/api/app.api.js +59 -0
  12. package/src/lib/api/app.api.js.map +1 -0
  13. package/src/lib/api/besigner.api.d.ts +24 -0
  14. package/src/lib/api/besigner.api.js +39 -0
  15. package/src/lib/api/besigner.api.js.map +1 -0
  16. package/src/lib/clipboard-manager/clipboard-manager.d.ts +89 -0
  17. package/src/lib/clipboard-manager/clipboard-manager.js +241 -0
  18. package/src/lib/clipboard-manager/clipboard-manager.js.map +1 -0
  19. package/src/lib/clipboard-manager/clipboard-mirror.d.ts +52 -0
  20. package/src/lib/clipboard-manager/clipboard-mirror.js +75 -0
  21. package/src/lib/clipboard-manager/clipboard-mirror.js.map +1 -0
  22. package/src/lib/clipboard-manager/index.d.ts +20 -0
  23. package/src/lib/clipboard-manager/index.js +23 -0
  24. package/src/lib/clipboard-manager/index.js.map +1 -0
  25. package/src/lib/clipboard-manager/style-clipboard.d.ts +77 -0
  26. package/src/lib/clipboard-manager/style-clipboard.js +173 -0
  27. package/src/lib/clipboard-manager/style-clipboard.js.map +1 -0
  28. package/src/lib/constants/_internal.d.ts +20 -0
  29. package/src/lib/constants/_internal.js +19 -0
  30. package/src/lib/constants/_internal.js.map +1 -0
  31. package/src/lib/constants/besigner.d.ts +78 -0
  32. package/src/lib/constants/besigner.js +69 -0
  33. package/src/lib/constants/besigner.js.map +1 -0
  34. package/src/lib/controllers/besigner-app.controller.d.ts +33 -0
  35. package/src/lib/controllers/besigner-app.controller.js +57 -0
  36. package/src/lib/controllers/besigner-app.controller.js.map +1 -0
  37. package/src/lib/controllers/besigner-interface.controller.d.ts +44 -0
  38. package/src/lib/controllers/besigner-interface.controller.js +130 -0
  39. package/src/lib/controllers/besigner-interface.controller.js.map +1 -0
  40. package/src/lib/definitions/besigner-app.types.d.ts +41 -0
  41. package/src/lib/definitions/besigner-app.types.js +18 -0
  42. package/src/lib/definitions/besigner-app.types.js.map +1 -0
  43. package/src/lib/definitions/besigner-interface.types.d.ts +106 -0
  44. package/src/lib/definitions/besigner-interface.types.js +18 -0
  45. package/src/lib/definitions/besigner-interface.types.js.map +1 -0
  46. package/src/lib/definitions/emitter.types.d.ts +33 -0
  47. package/src/lib/definitions/emitter.types.js +18 -0
  48. package/src/lib/definitions/emitter.types.js.map +1 -0
  49. package/src/lib/device-preview-width.d.ts +39 -0
  50. package/src/lib/device-preview-width.js +57 -0
  51. package/src/lib/device-preview-width.js.map +1 -0
  52. package/src/lib/dnd-manager/confirm-valid-lineal-relationship.d.ts +54 -0
  53. package/src/lib/dnd-manager/confirm-valid-lineal-relationship.js +109 -0
  54. package/src/lib/dnd-manager/confirm-valid-lineal-relationship.js.map +1 -0
  55. package/src/lib/dnd-manager/dnd-manager.d.ts +75 -0
  56. package/src/lib/dnd-manager/dnd-manager.js +337 -0
  57. package/src/lib/dnd-manager/dnd-manager.js.map +1 -0
  58. package/src/lib/dnd-manager/droppable-region-utils.d.ts +72 -0
  59. package/src/lib/dnd-manager/droppable-region-utils.js +115 -0
  60. package/src/lib/dnd-manager/droppable-region-utils.js.map +1 -0
  61. package/src/lib/dnd-manager/index.d.ts +20 -0
  62. package/src/lib/dnd-manager/index.js +21 -0
  63. package/src/lib/dnd-manager/index.js.map +1 -0
  64. package/src/lib/focus-manager/focus-manager.d.ts +104 -0
  65. package/src/lib/focus-manager/focus-manager.js +353 -0
  66. package/src/lib/focus-manager/focus-manager.js.map +1 -0
  67. package/src/lib/focus-manager/index.d.ts +18 -0
  68. package/src/lib/focus-manager/index.js +19 -0
  69. package/src/lib/focus-manager/index.js.map +1 -0
  70. package/src/lib/is-root-element-id.d.ts +19 -0
  71. package/src/lib/is-root-element-id.js +22 -0
  72. package/src/lib/is-root-element-id.js.map +1 -0
  73. package/src/lib/managers.d.ts +25 -0
  74. package/src/lib/managers.js +26 -0
  75. package/src/lib/managers.js.map +1 -0
  76. package/src/lib/node-move/index.d.ts +17 -0
  77. package/src/lib/node-move/index.js +18 -0
  78. package/src/lib/node-move/index.js.map +1 -0
  79. package/src/lib/node-move/node-move.d.ts +80 -0
  80. package/src/lib/node-move/node-move.js +134 -0
  81. package/src/lib/node-move/node-move.js.map +1 -0
  82. package/src/lib/node-refs/index.d.ts +1 -0
  83. package/src/lib/node-refs/index.js +3 -0
  84. package/src/lib/node-refs/index.js.map +1 -0
  85. package/src/lib/node-refs/node-refs.d.ts +24 -0
  86. package/src/lib/node-refs/node-refs.js +30 -0
  87. package/src/lib/node-refs/node-refs.js.map +1 -0
  88. package/src/lib/pick-manager/index.d.ts +18 -0
  89. package/src/lib/pick-manager/index.js +20 -0
  90. package/src/lib/pick-manager/index.js.map +1 -0
  91. package/src/lib/pick-manager/pick-manager.d.ts +64 -0
  92. package/src/lib/pick-manager/pick-manager.js +116 -0
  93. package/src/lib/pick-manager/pick-manager.js.map +1 -0
  94. package/src/lib/text-entry/index.d.ts +17 -0
  95. package/src/lib/text-entry/index.js +18 -0
  96. package/src/lib/text-entry/index.js.map +1 -0
  97. package/src/lib/text-entry/text-entry.d.ts +71 -0
  98. package/src/lib/text-entry/text-entry.js +103 -0
  99. package/src/lib/text-entry/text-entry.js.map +1 -0
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { DropRegion } from './dnd-manager';
18
+ export type DroppableClientRect = Pick<DOMRect, 'width' | 'height' | 'top' | 'right' | 'bottom' | 'left'> & Partial<Pick<DOMRect, 'x' | 'y'>>;
19
+ export declare function buildDroppableRects(rect: DroppableClientRect): {
20
+ children: {
21
+ width: number;
22
+ height: number;
23
+ top: number;
24
+ left: number;
25
+ };
26
+ top: {
27
+ width: number;
28
+ height: number;
29
+ top: number;
30
+ left: number;
31
+ };
32
+ right: {
33
+ width: number;
34
+ height: number;
35
+ top: number;
36
+ left: number;
37
+ };
38
+ bottom: {
39
+ width: number;
40
+ height: number;
41
+ top: number;
42
+ left: number;
43
+ };
44
+ left: {
45
+ width: number;
46
+ height: number;
47
+ top: number;
48
+ left: number;
49
+ };
50
+ full: {
51
+ x: number;
52
+ y: number;
53
+ left: number;
54
+ width: number;
55
+ top: number;
56
+ height: number;
57
+ };
58
+ };
59
+ export declare function withinRegion(rect: {
60
+ left: number;
61
+ top: number;
62
+ width: number;
63
+ height: number;
64
+ }, x: number, y: number): boolean;
65
+ /**
66
+ * Before/after sibling region for a point over a leaf element, split on the
67
+ * element's dominant axis: wide elements divide left/right, tall ones divide
68
+ * top/bottom. Used when the target can't hold node children so its center
69
+ * never reads as a nest.
70
+ */
71
+ export declare function determineSiblingRegion(rect: DroppableClientRect, x: number, y: number): DropRegion.TOP | DropRegion.RIGHT | DropRegion.BOTTOM | DropRegion.LEFT;
72
+ export declare function determineDropRegion(clientRect: DroppableClientRect, x: number, y: number, acceptsChildren?: boolean, regions?: ReturnType<typeof buildDroppableRects>): DropRegion;
@@ -0,0 +1,115 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ import { DropRegion } from "./dnd-manager.js";
17
+ export function buildDroppableRects(rect) {
18
+ const { width = 0, height = 0, top = 0, right = 0, bottom = 0, left = 0, x = 0, y = 0 } = rect || {};
19
+ const isHorz = (width || 0) >= (height || 0);
20
+ const vertWRaw = width / 6;
21
+ const vertWidth = vertWRaw > 12 ? 12 : vertWRaw;
22
+ const vertHeight = height;
23
+ const horzHRaw = height / 4;
24
+ const horzWidth = width;
25
+ const horzHeight = horzHRaw > 12 ? 12 : horzHRaw;
26
+ const _top = {
27
+ width: horzWidth,
28
+ height: horzHeight,
29
+ top: top,
30
+ left: left
31
+ };
32
+ const _bottom = {
33
+ width: horzWidth,
34
+ height: horzHeight,
35
+ top: top + vertHeight - horzHeight,
36
+ left: left
37
+ };
38
+ const _left = {
39
+ width: vertWidth,
40
+ height: vertHeight,
41
+ top: top,
42
+ left: left
43
+ };
44
+ const _right = {
45
+ width: vertWidth,
46
+ height: vertHeight,
47
+ top: top,
48
+ left: left + horzWidth - vertWidth
49
+ };
50
+ const _children = {
51
+ width: _top.width - vertWidth * 2,
52
+ height: height - (_top.height + _bottom.height),
53
+ top: top + _top.height,
54
+ left: left + _left.width
55
+ };
56
+ const _full = {
57
+ x,
58
+ y,
59
+ left: _left.left,
60
+ width: _left.width + _children.width + _right.width,
61
+ top: _top.top,
62
+ height: _top.height + _children.height + _bottom.height
63
+ };
64
+ return {
65
+ children: _children,
66
+ top: _top,
67
+ right: _right,
68
+ bottom: _bottom,
69
+ left: _left,
70
+ full: _full
71
+ };
72
+ }
73
+ export function withinRegion(rect, x, y) {
74
+ const { left, top } = rect;
75
+ const { width, height } = rect;
76
+ const xis = x >= left && x <= left + width;
77
+ const yis = y >= top && y <= top + height;
78
+ return xis && yis;
79
+ }
80
+ /**
81
+ * Before/after sibling region for a point over a leaf element, split on the
82
+ * element's dominant axis: wide elements divide left/right, tall ones divide
83
+ * top/bottom. Used when the target can't hold node children so its center
84
+ * never reads as a nest.
85
+ */ export function determineSiblingRegion(rect, x, y) {
86
+ const { width = 0, height = 0, top = 0, left = 0 } = rect || {};
87
+ if (width >= height) {
88
+ return x < left + width / 2 ? DropRegion.LEFT : DropRegion.RIGHT;
89
+ }
90
+ return y < top + height / 2 ? DropRegion.TOP : DropRegion.BOTTOM;
91
+ }
92
+ export function determineDropRegion(clientRect, x, y, acceptsChildren = true, regions) {
93
+ const _regions = regions || buildDroppableRects(clientRect);
94
+ switch(true){
95
+ case withinRegion(_regions.top, x, y):
96
+ return DropRegion.TOP;
97
+ case withinRegion(_regions.right, x, y):
98
+ return DropRegion.RIGHT;
99
+ case withinRegion(_regions.bottom, x, y):
100
+ return DropRegion.BOTTOM;
101
+ case withinRegion(_regions.left, x, y):
102
+ return DropRegion.LEFT;
103
+ case !acceptsChildren:
104
+ // Leaf targets (self-closing / text-editable) have no children slot, so
105
+ // the center resolves to a sibling insert rather than a nest — keeping
106
+ // the drop indicator and the committed placement in agreement
107
+ // (AGL-575 parallel for drag-and-drop).
108
+ return determineSiblingRegion(clientRect, x, y);
109
+ case withinRegion(_regions.children, x, y):
110
+ default:
111
+ return DropRegion.CHILDREN;
112
+ }
113
+ }
114
+
115
+ //# sourceMappingURL=droppable-region-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/besigner/core/src/lib/dnd-manager/droppable-region-utils.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DropRegion } from './dnd-manager'\n\n// Structural rect type: dnd-kit passes a ClientRect that lacks DOMRect's\n// x/y/toJSON, and x/y are defaulted below anyway.\nexport type DroppableClientRect = Pick<\n DOMRect,\n 'width' | 'height' | 'top' | 'right' | 'bottom' | 'left'\n> &\n Partial<Pick<DOMRect, 'x' | 'y'>>\n\nexport function buildDroppableRects(rect: DroppableClientRect) {\n const {\n width = 0,\n height = 0,\n top = 0,\n right = 0,\n bottom = 0,\n left = 0,\n x = 0,\n y = 0,\n } = rect || {}\n const isHorz = (width || 0) >= (height || 0)\n\n const vertWRaw = width / 6\n const vertWidth = vertWRaw > 12 ? 12 : vertWRaw\n const vertHeight = height\n\n const horzHRaw = height / 4\n const horzWidth = width\n const horzHeight = horzHRaw > 12 ? 12 : horzHRaw\n\n const _top = {\n width: horzWidth,\n height: horzHeight,\n top: top,\n left: left,\n }\n const _bottom = {\n width: horzWidth,\n height: horzHeight,\n top: top + vertHeight - horzHeight,\n left: left,\n }\n const _left = {\n width: vertWidth,\n height: vertHeight,\n top: top,\n left: left,\n }\n const _right = {\n width: vertWidth,\n height: vertHeight,\n top: top,\n left: left + horzWidth - vertWidth,\n }\n const _children = {\n width: _top.width - vertWidth * 2,\n height: height - (_top.height + _bottom.height),\n top: top + _top.height,\n left: left + _left.width,\n }\n const _full = {\n x,\n y,\n left: _left.left,\n width: _left.width + _children.width + _right.width,\n top: _top.top,\n height: _top.height + _children.height + _bottom.height,\n }\n\n return {\n children: _children,\n top: _top,\n right: _right,\n bottom: _bottom,\n left: _left,\n full: _full,\n }\n}\n\nexport function withinRegion(rect: { left: number; top: number; width: number; height: number }, x: number, y: number) {\n const { left, top } = rect\n const { width, height } = rect\n const xis = x >= left && x <= left + width\n const yis = y >= top && y <= top + height\n return xis && yis\n}\n\n/**\n * Before/after sibling region for a point over a leaf element, split on the\n * element's dominant axis: wide elements divide left/right, tall ones divide\n * top/bottom. Used when the target can't hold node children so its center\n * never reads as a nest.\n */\nexport function determineSiblingRegion(rect: DroppableClientRect, x: number, y: number) {\n const { width = 0, height = 0, top = 0, left = 0 } = rect || {}\n if (width >= height) {\n return x < left + width / 2 ? DropRegion.LEFT : DropRegion.RIGHT\n }\n return y < top + height / 2 ? DropRegion.TOP : DropRegion.BOTTOM\n}\n\nexport function determineDropRegion(\n clientRect: DroppableClientRect,\n x: number,\n y: number,\n acceptsChildren = true,\n regions?: ReturnType<typeof buildDroppableRects>,\n) {\n const _regions = regions || buildDroppableRects(clientRect)\n switch (true) {\n case withinRegion(_regions.top, x, y):\n return DropRegion.TOP\n case withinRegion(_regions.right, x, y):\n return DropRegion.RIGHT\n case withinRegion(_regions.bottom, x, y):\n return DropRegion.BOTTOM\n case withinRegion(_regions.left, x, y):\n return DropRegion.LEFT\n case !acceptsChildren:\n // Leaf targets (self-closing / text-editable) have no children slot, so\n // the center resolves to a sibling insert rather than a nest — keeping\n // the drop indicator and the committed placement in agreement\n // (AGL-575 parallel for drag-and-drop).\n return determineSiblingRegion(clientRect, x, y)\n case withinRegion(_regions.children, x, y):\n default:\n return DropRegion.CHILDREN\n }\n}\n"],"names":["DropRegion","buildDroppableRects","rect","width","height","top","right","bottom","left","x","y","isHorz","vertWRaw","vertWidth","vertHeight","horzHRaw","horzWidth","horzHeight","_top","_bottom","_left","_right","_children","_full","children","full","withinRegion","xis","yis","determineSiblingRegion","LEFT","RIGHT","TOP","BOTTOM","determineDropRegion","clientRect","acceptsChildren","regions","_regions","CHILDREN"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD,SAASA,UAAU,QAAQ,mBAAe;AAU1C,OAAO,SAASC,oBAAoBC,IAAyB;IAC3D,MAAM,EACJC,QAAQ,CAAC,EACTC,SAAS,CAAC,EACVC,MAAM,CAAC,EACPC,QAAQ,CA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AwC;YACxC,OAAOP,uBAAuBM,YAAY1B,GAAGC;QAC/C,KAAKgB,aAAaY,SAASd,QAAQ,EAAEf,GAAGC;QACxC;YACE,OAAOV,WAAWuC,QAAQ;IAC9B;AACF"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export { default } from './dnd-manager';
18
+ export * from './dnd-manager';
19
+ export * from './confirm-valid-lineal-relationship';
20
+ export * from './droppable-region-utils';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ export { default } from "./dnd-manager.js";
17
+ export * from "./dnd-manager.js";
18
+ export * from "./confirm-valid-lineal-relationship.js";
19
+ export * from "./droppable-region-utils.js";
20
+
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/besigner/core/src/lib/dnd-manager/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { default } from './dnd-manager'\nexport * from './dnd-manager'\n\nexport * from './confirm-valid-lineal-relationship'\nexport * from './droppable-region-utils'\n"],"names":["default"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,OAAO,QAAQ,mBAAe;AACvC,cAAc,mBAAe;AAE7B,cAAc,yCAAqC;AACnD,cAAc,8BAA0B"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2024 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type * as Aglyn from '@aglyn/aglyn';
18
+ export type HoveredNode = Aglyn.NodeSchema<any> | null;
19
+ export type SelectedNodes = Aglyn.NodeSchema<any>[];
20
+ export type ExpandedNodes = Aglyn.NodeSchema<any>[];
21
+ export type LastSelectedNode = Aglyn.NodeSchema<any> | undefined;
22
+ export declare function getLastSelected(): LastSelectedNode;
23
+ export declare function selectionCount(): number;
24
+ export declare function hasMultipleSelected(): boolean;
25
+ export declare function getHovered(): HoveredNode | undefined;
26
+ export declare function getSelected(): SelectedNodes;
27
+ export declare function getAllExpanded(): ExpandedNodes & SelectedNodes;
28
+ export declare function getManuallyCollapsed(): Aglyn.NodeId[];
29
+ export declare function isNodeSelected(node: Aglyn.NodeSchema<any>): boolean;
30
+ export declare function isNodeOrDescendantSelected(node: Aglyn.NodeSchema<any>): boolean;
31
+ export declare function isNodeHovered(node: Aglyn.NodeSchema<any>): boolean;
32
+ export declare function isNodeExpanded(node: Aglyn.NodeSchema<any>): boolean;
33
+ export declare function isNodeEffectivelyExpanded(node: Aglyn.NodeSchema<any>): boolean;
34
+ export declare function clearFocusStatus(): void;
35
+ export declare function clearSelection(): void;
36
+ export declare function clearHover(): void;
37
+ export declare function expandNode(node: Aglyn.NodeSchema<any>): void;
38
+ export declare function collapseNode(node: Aglyn.NodeSchema<any>): void;
39
+ export declare function toggleNodeExpansion(node: Aglyn.NodeSchema<any>): void;
40
+ /**
41
+ * What a click on a node means, in the hierarchy and on the canvas alike.
42
+ *
43
+ * Toggling belongs to Cmd/Ctrl-click — which is exactly what
44
+ * `multiSelection` means at both call sites, and what both of their comments
45
+ * already claimed. A PLAIN click always selects (AGL-2486): it used to
46
+ * toggle, so clicking the row of a node that was already selected DESELECTED
47
+ * it, and since the hierarchy's expansion is derived from the selection
48
+ * (`allExpanded`), the tree then collapsed to the document root and the row
49
+ * vanished from under the pointer. Every way of putting a new element on the
50
+ * canvas leaves it selected, so "add an element, then click it in the
51
+ * hierarchy" hit this every time.
52
+ */
53
+ export declare function handleNodeSelection(node: Aglyn.NodeSchema<any>, multiSelection?: boolean): void;
54
+ export declare function deselectNode(node: Aglyn.NodeSchema<any>, multiSelection?: boolean): void;
55
+ export declare function setSelectedNode(node: Aglyn.NodeSchema<any>, multiSelection?: boolean): void;
56
+ /**
57
+ * Where the selection should land once `nodes` are deleted, best first
58
+ * (AGL-2553).
59
+ *
60
+ * Deleting used to clear the selection outright, and the hierarchy collapsing
61
+ * was the consequence: the tree only holds a branch open to reveal what is
62
+ * selected, so with nothing selected a subtree the author had navigated into
63
+ * snapped shut on every delete.
64
+ *
65
+ * Order is next sibling, then previous, then the parent. NEXT first because
66
+ * it slides into the deleted node's slot — the highlight stays where the
67
+ * author's eye already is, rather than stepping backwards. Previous covers
68
+ * deleting the last child, and the parent covers an only child, where keeping
69
+ * the branch open one level up is still better than closing it.
70
+ *
71
+ * ⚑ Returns CANDIDATES rather than a node, because it must be called BEFORE
72
+ * the delete — sibling indices shift once it runs — and the caller selects the
73
+ * first that survives. That ordering is what makes multi-selection safe
74
+ * without walking ancestors: a sibling that was itself doomed, or that hung
75
+ * off a doomed node, is simply absent from the map afterwards and the next
76
+ * candidate wins.
77
+ */
78
+ export declare function resolveSelectionAfterDeletion(nodes: readonly Aglyn.NodeSchema<any>[]): Aglyn.NodeSchema<any>[];
79
+ /**
80
+ * Selects the first of `candidates` that still exists, or clears the
81
+ * selection when none do. The other half of
82
+ * {@link resolveSelectionAfterDeletion}; call it AFTER the delete.
83
+ */
84
+ export declare function selectFirstSurviving(candidates: readonly Aglyn.NodeSchema<any>[]): void;
85
+ /**
86
+ * Flat, depth-first list of the nodes currently visible in the hierarchy —
87
+ * children of collapsed nodes are skipped (AGL-6). Range selection resolves
88
+ * its slice against this order.
89
+ */
90
+ export declare function getVisibleNodeOrder(): Aglyn.NodeSchema<any>[];
91
+ /**
92
+ * Shift+Click range selection (AGL-7): selects every visible node between
93
+ * the current anchor (`lastSelected`) and the target, in document order.
94
+ * Without an anchor it falls back to single selection.
95
+ */
96
+ export declare function rangeSelectNode(node: Aglyn.NodeSchema<any>): void;
97
+ /**
98
+ * Cmd/Ctrl+A helper (AGL-7): selects every visible node at the same tree
99
+ * depth as the current selection anchor (siblings-and-cousins). No-ops
100
+ * without an anchor.
101
+ */
102
+ export declare function selectAllAtDepth(): void;
103
+ export declare function setHoveredNode(node: Aglyn.NodeSchema<any>): void;
104
+ export declare function dehoverNode(node: Aglyn.NodeSchema<any>): void;