react-arborist 3.2.0 → 3.3.1-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/dist/main/components/cursor.d.ts +1 -0
- package/dist/main/components/cursor.js +20 -0
- package/dist/{components → main/components}/default-container.d.ts +1 -2
- package/dist/main/components/default-container.js +238 -0
- package/dist/main/components/default-cursor.js +35 -0
- package/dist/{components → main/components}/default-drag-preview.d.ts +1 -2
- package/dist/main/components/default-drag-preview.js +57 -0
- package/dist/{components → main/components}/default-node.d.ts +1 -2
- package/dist/main/components/default-node.js +32 -0
- package/dist/{components → main/components}/default-row.d.ts +1 -2
- package/dist/main/components/default-row.js +8 -0
- package/dist/main/components/drag-preview-container.d.ts +1 -0
- package/dist/main/components/drag-preview-container.js +21 -0
- package/dist/{components → main/components}/list-inner-element.d.ts +1 -1
- package/dist/main/components/list-inner-element.js +25 -0
- package/dist/main/components/list-outer-element.d.ts +2 -0
- package/dist/main/components/list-outer-element.js +38 -0
- package/dist/main/components/outer-drop.js +9 -0
- package/dist/{components → main/components}/provider.d.ts +2 -2
- package/dist/main/components/provider.js +52 -0
- package/dist/{components → main/components}/row-container.d.ts +2 -2
- package/dist/main/components/row-container.js +84 -0
- package/dist/main/components/tree-container.d.ts +1 -0
- package/dist/main/components/tree-container.js +12 -0
- package/dist/{components → main/components}/tree.d.ts +1 -1
- package/dist/main/components/tree.js +15 -0
- package/dist/{context.d.ts → main/context.d.ts} +4 -4
- package/dist/main/context.js +33 -0
- package/dist/main/data/create-index.js +10 -0
- package/dist/main/data/create-list.js +62 -0
- package/dist/main/data/create-root.js +43 -0
- package/dist/main/data/make-tree.d.ts +5 -0
- package/dist/main/data/make-tree.js +40 -0
- package/dist/{data → main/data}/simple-tree.d.ts +1 -1
- package/dist/main/data/simple-tree.js +100 -0
- package/dist/{dnd → main/dnd}/compute-drop.d.ts +6 -6
- package/dist/main/dnd/compute-drop.js +129 -0
- package/dist/main/dnd/drag-hook.js +46 -0
- package/dist/{dnd → main/dnd}/drop-hook.d.ts +2 -2
- package/dist/main/dnd/drop-hook.js +42 -0
- package/dist/main/dnd/measure-hover.d.ts +8 -0
- package/dist/main/dnd/measure-hover.js +21 -0
- package/dist/main/dnd/outer-drop-hook.js +45 -0
- package/dist/main/hooks/use-fresh-node.js +18 -0
- package/dist/{hooks → main/hooks}/use-simple-tree.d.ts +1 -1
- package/dist/main/hooks/use-simple-tree.js +35 -0
- package/dist/main/hooks/use-validated-props.js +29 -0
- package/dist/main/index.js +27 -0
- package/dist/{interfaces → main/interfaces}/node-api.d.ts +2 -1
- package/dist/main/interfaces/node-api.js +164 -0
- package/dist/{interfaces → main/interfaces}/tree-api.d.ts +90 -7
- package/dist/main/interfaces/tree-api.js +649 -0
- package/dist/main/interfaces/tree-api.test.d.ts +1 -0
- package/dist/main/interfaces/tree-api.test.js +14 -0
- package/dist/{state → main/state}/dnd-slice.d.ts +4 -4
- package/dist/main/state/dnd-slice.js +35 -0
- package/dist/{state → main/state}/drag-slice.d.ts +4 -2
- package/dist/main/state/drag-slice.js +24 -0
- package/dist/{state → main/state}/edit-slice.d.ts +1 -1
- package/dist/main/state/edit-slice.js +18 -0
- package/dist/{state → main/state}/focus-slice.d.ts +1 -1
- package/dist/main/state/focus-slice.js +26 -0
- package/dist/main/state/initial.js +29 -0
- package/dist/{state → main/state}/open-slice.d.ts +2 -2
- package/dist/main/state/open-slice.js +48 -0
- package/dist/main/state/root-reducer.d.ts +96 -0
- package/dist/main/state/root-reducer.js +20 -0
- package/dist/{state → main/state}/selection-slice.d.ts +1 -1
- package/dist/main/state/selection-slice.js +59 -0
- package/dist/{types → main/types}/dnd.d.ts +2 -2
- package/dist/main/types/dnd.js +2 -0
- package/dist/{types → main/types}/handlers.d.ts +5 -5
- package/dist/main/types/handlers.js +2 -0
- package/dist/{types → main/types}/renderers.d.ts +4 -4
- package/dist/main/types/renderers.js +2 -0
- package/dist/main/types/state.d.ts +2 -0
- package/dist/main/types/state.js +2 -0
- package/dist/main/types/tree-props.js +2 -0
- package/dist/{types → main/types}/utils.d.ts +5 -5
- package/dist/main/types/utils.js +2 -0
- package/dist/{utils.d.ts → main/utils.d.ts} +2 -2
- package/dist/main/utils.js +183 -0
- package/dist/module/components/cursor.d.ts +1 -0
- package/dist/module/components/cursor.js +16 -0
- package/dist/module/components/default-container.d.ts +6 -0
- package/dist/module/components/default-container.js +234 -0
- package/dist/module/components/default-cursor.d.ts +3 -0
- package/dist/module/components/default-cursor.js +29 -0
- package/dist/module/components/default-drag-preview.d.ts +2 -0
- package/dist/module/components/default-drag-preview.js +53 -0
- package/dist/module/components/default-node.d.ts +2 -0
- package/dist/module/components/default-node.js +28 -0
- package/dist/module/components/default-row.d.ts +2 -0
- package/dist/module/components/default-row.js +4 -0
- package/dist/module/components/drag-preview-container.d.ts +1 -0
- package/dist/module/components/drag-preview-container.js +17 -0
- package/dist/module/components/list-inner-element.d.ts +2 -0
- package/dist/module/components/list-inner-element.js +22 -0
- package/dist/module/components/list-outer-element.d.ts +2 -0
- package/dist/module/components/list-outer-element.js +35 -0
- package/dist/module/components/outer-drop.d.ts +4 -0
- package/dist/module/components/outer-drop.js +5 -0
- package/dist/module/components/provider.d.ts +10 -0
- package/dist/module/components/provider.js +48 -0
- package/dist/module/components/row-container.d.ts +7 -0
- package/dist/module/components/row-container.js +58 -0
- package/dist/module/components/tree-container.d.ts +1 -0
- package/dist/module/components/tree-container.js +8 -0
- package/dist/module/components/tree.d.ts +8 -0
- package/dist/module/components/tree.js +12 -0
- package/dist/module/context.d.ts +22 -0
- package/dist/module/context.js +26 -0
- package/dist/module/data/create-index.d.ts +4 -0
- package/dist/module/data/create-index.js +6 -0
- package/dist/module/data/create-list.d.ts +3 -0
- package/dist/module/data/create-list.js +58 -0
- package/dist/module/data/create-root.d.ts +4 -0
- package/dist/module/data/create-root.js +39 -0
- package/dist/module/data/make-tree.d.ts +5 -0
- package/dist/module/data/make-tree.js +36 -0
- package/dist/module/data/simple-tree.d.ts +44 -0
- package/dist/module/data/simple-tree.js +96 -0
- package/dist/module/dnd/compute-drop.d.ts +37 -0
- package/dist/module/dnd/compute-drop.js +125 -0
- package/dist/module/dnd/drag-hook.d.ts +3 -0
- package/dist/module/dnd/drag-hook.js +42 -0
- package/dist/module/dnd/drop-hook.d.ts +8 -0
- package/dist/module/dnd/drop-hook.js +38 -0
- package/dist/module/dnd/measure-hover.d.ts +8 -0
- package/dist/module/dnd/measure-hover.js +17 -0
- package/dist/module/dnd/outer-drop-hook.d.ts +1 -0
- package/dist/module/dnd/outer-drop-hook.js +41 -0
- package/dist/module/hooks/use-fresh-node.d.ts +1 -0
- package/dist/module/hooks/use-fresh-node.js +14 -0
- package/dist/module/hooks/use-simple-tree.d.ts +12 -0
- package/dist/module/hooks/use-simple-tree.js +31 -0
- package/dist/module/hooks/use-validated-props.d.ts +2 -0
- package/dist/module/hooks/use-validated-props.js +25 -0
- package/dist/module/index.d.ts +8 -0
- package/dist/module/index.js +9 -0
- package/dist/module/interfaces/node-api.d.ts +71 -0
- package/dist/module/interfaces/node-api.js +160 -0
- package/dist/module/interfaces/tree-api.d.ts +214 -0
- package/dist/module/interfaces/tree-api.js +622 -0
- package/dist/module/interfaces/tree-api.test.d.ts +1 -0
- package/dist/module/interfaces/tree-api.test.js +12 -0
- package/dist/module/state/dnd-slice.d.ts +29 -0
- package/dist/module/state/dnd-slice.js +31 -0
- package/dist/module/state/drag-slice.d.ts +9 -0
- package/dist/module/state/drag-slice.js +20 -0
- package/dist/module/state/edit-slice.d.ts +8 -0
- package/dist/module/state/edit-slice.js +13 -0
- package/dist/module/state/focus-slice.d.ts +12 -0
- package/dist/module/state/focus-slice.js +20 -0
- package/dist/module/state/initial.d.ts +3 -0
- package/dist/module/state/initial.js +25 -0
- package/dist/module/state/open-slice.d.ts +30 -0
- package/dist/module/state/open-slice.js +44 -0
- package/dist/module/state/root-reducer.d.ts +96 -0
- package/dist/module/state/root-reducer.js +17 -0
- package/dist/module/state/selection-slice.d.ts +42 -0
- package/dist/module/state/selection-slice.js +55 -0
- package/dist/module/types/dnd.d.ts +8 -0
- package/dist/module/types/dnd.js +1 -0
- package/dist/module/types/handlers.d.ts +30 -0
- package/dist/module/types/handlers.js +1 -0
- package/dist/module/types/renderers.d.ts +29 -0
- package/dist/module/types/renderers.js +1 -0
- package/dist/module/types/state.d.ts +2 -0
- package/dist/module/types/state.js +1 -0
- package/dist/module/types/tree-props.d.ts +56 -0
- package/dist/module/types/tree-props.js +1 -0
- package/dist/module/types/utils.d.ts +17 -0
- package/dist/module/types/utils.js +1 -0
- package/dist/module/utils.d.ts +24 -0
- package/dist/module/utils.js +162 -0
- package/package.json +26 -25
- package/src/components/default-container.tsx +2 -0
- package/src/components/provider.tsx +3 -2
- package/src/components/row-container.tsx +1 -1
- package/src/dnd/compute-drop.ts +6 -3
- package/src/dnd/drag-hook.ts +1 -1
- package/src/dnd/drop-hook.ts +1 -1
- package/src/interfaces/node-api.ts +10 -0
- package/src/interfaces/tree-api.ts +16 -3
- package/src/state/dnd-slice.ts +2 -2
- package/src/state/drag-slice.ts +27 -11
- package/src/state/initial.ts +6 -1
- package/src/utils.ts +2 -2
- package/dist/components/cursor.d.ts +0 -2
- package/dist/components/drag-preview-container.d.ts +0 -2
- package/dist/components/list-outer-element.d.ts +0 -2
- package/dist/components/tree-container.d.ts +0 -2
- package/dist/index.js +0 -2414
- package/dist/index.js.map +0 -1
- package/dist/module.js +0 -2387
- package/dist/module.js.map +0 -1
- package/dist/state/root-reducer.d.ts +0 -13
- package/dist/types/state.d.ts +0 -2
- package/jest.config.js +0 -5
- package/tsconfig.json +0 -4
- /package/dist/{components → main/components}/default-cursor.d.ts +0 -0
- /package/dist/{components → main/components}/outer-drop.d.ts +0 -0
- /package/dist/{data → main/data}/create-index.d.ts +0 -0
- /package/dist/{data → main/data}/create-list.d.ts +0 -0
- /package/dist/{data → main/data}/create-root.d.ts +0 -0
- /package/dist/{dnd → main/dnd}/drag-hook.d.ts +0 -0
- /package/dist/{dnd → main/dnd}/outer-drop-hook.d.ts +0 -0
- /package/dist/{hooks → main/hooks}/use-fresh-node.d.ts +0 -0
- /package/dist/{hooks → main/hooks}/use-validated-props.d.ts +0 -0
- /package/dist/{index.d.ts → main/index.d.ts} +0 -0
- /package/dist/{state → main/state}/initial.d.ts +0 -0
- /package/dist/{types → main/types}/tree-props.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Cursor(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Cursor = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const context_1 = require("../context");
|
|
6
|
+
function Cursor() {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const tree = (0, context_1.useTreeApi)();
|
|
9
|
+
const state = (0, context_1.useDndContext)();
|
|
10
|
+
const cursor = state.cursor;
|
|
11
|
+
if (!cursor || cursor.type !== "line")
|
|
12
|
+
return null;
|
|
13
|
+
const indent = tree.indent;
|
|
14
|
+
const top = tree.rowHeight * cursor.index +
|
|
15
|
+
((_b = (_a = tree.props.padding) !== null && _a !== void 0 ? _a : tree.props.paddingTop) !== null && _b !== void 0 ? _b : 0);
|
|
16
|
+
const left = indent * cursor.level;
|
|
17
|
+
const Cursor = tree.renderCursor;
|
|
18
|
+
return (0, jsx_runtime_1.jsx)(Cursor, { top, left, indent });
|
|
19
|
+
}
|
|
20
|
+
exports.Cursor = Cursor;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
/**
|
|
3
2
|
* All these keyboard shortcuts seem like they should be configurable.
|
|
4
3
|
* Each operation should be a given a name and separated from
|
|
5
4
|
* the event handler. Future clean up welcome.
|
|
6
5
|
*/
|
|
7
|
-
export declare function DefaultContainer(): JSX.Element;
|
|
6
|
+
export declare function DefaultContainer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultContainer = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_window_1 = require("react-window");
|
|
6
|
+
const context_1 = require("../context");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const list_outer_element_1 = require("./list-outer-element");
|
|
9
|
+
const list_inner_element_1 = require("./list-inner-element");
|
|
10
|
+
const row_container_1 = require("./row-container");
|
|
11
|
+
let focusSearchTerm = "";
|
|
12
|
+
let timeoutId = null;
|
|
13
|
+
/**
|
|
14
|
+
* All these keyboard shortcuts seem like they should be configurable.
|
|
15
|
+
* Each operation should be a given a name and separated from
|
|
16
|
+
* the event handler. Future clean up welcome.
|
|
17
|
+
*/
|
|
18
|
+
function DefaultContainer() {
|
|
19
|
+
(0, context_1.useDataUpdates)();
|
|
20
|
+
const tree = (0, context_1.useTreeApi)();
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)("div", { role: "tree", style: {
|
|
22
|
+
height: tree.height,
|
|
23
|
+
width: tree.width,
|
|
24
|
+
minHeight: 0,
|
|
25
|
+
minWidth: 0,
|
|
26
|
+
}, onContextMenu: tree.props.onContextMenu, onClick: tree.props.onClick, tabIndex: 0, onFocus: (e) => {
|
|
27
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
28
|
+
tree.onFocus();
|
|
29
|
+
}
|
|
30
|
+
}, onBlur: (e) => {
|
|
31
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
32
|
+
tree.onBlur();
|
|
33
|
+
}
|
|
34
|
+
}, onKeyDown: (e) => {
|
|
35
|
+
var _a;
|
|
36
|
+
if (tree.isEditing) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (e.key === "Backspace") {
|
|
40
|
+
if (!tree.props.onDelete)
|
|
41
|
+
return;
|
|
42
|
+
const ids = Array.from(tree.selectedIds);
|
|
43
|
+
if (ids.length > 1) {
|
|
44
|
+
let nextFocus = tree.mostRecentNode;
|
|
45
|
+
while (nextFocus && nextFocus.isSelected) {
|
|
46
|
+
nextFocus = nextFocus.nextSibling;
|
|
47
|
+
}
|
|
48
|
+
if (!nextFocus)
|
|
49
|
+
nextFocus = tree.lastNode;
|
|
50
|
+
tree.focus(nextFocus, { scroll: false });
|
|
51
|
+
tree.delete(Array.from(ids));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
const node = tree.focusedNode;
|
|
55
|
+
if (node) {
|
|
56
|
+
const sib = node.nextSibling;
|
|
57
|
+
const parent = node.parent;
|
|
58
|
+
tree.focus(sib || parent, { scroll: false });
|
|
59
|
+
tree.delete(node);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (e.key === "Tab" && !e.shiftKey) {
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
(0, utils_1.focusNextElement)(e.currentTarget);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (e.key === "Tab" && e.shiftKey) {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
(0, utils_1.focusPrevElement)(e.currentTarget);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (e.key === "ArrowDown") {
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
const next = tree.nextNode;
|
|
77
|
+
if (e.metaKey) {
|
|
78
|
+
tree.select(tree.focusedNode);
|
|
79
|
+
tree.activate(tree.focusedNode);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
else if (!e.shiftKey || tree.props.disableMultiSelection) {
|
|
83
|
+
tree.focus(next);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
if (!next)
|
|
88
|
+
return;
|
|
89
|
+
const current = tree.focusedNode;
|
|
90
|
+
if (!current) {
|
|
91
|
+
tree.focus(tree.firstNode);
|
|
92
|
+
}
|
|
93
|
+
else if (current.isSelected) {
|
|
94
|
+
tree.selectContiguous(next);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
tree.selectMulti(next);
|
|
98
|
+
}
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (e.key === "ArrowUp") {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
const prev = tree.prevNode;
|
|
105
|
+
if (!e.shiftKey || tree.props.disableMultiSelection) {
|
|
106
|
+
tree.focus(prev);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
if (!prev)
|
|
111
|
+
return;
|
|
112
|
+
const current = tree.focusedNode;
|
|
113
|
+
if (!current) {
|
|
114
|
+
tree.focus(tree.lastNode); // ?
|
|
115
|
+
}
|
|
116
|
+
else if (current.isSelected) {
|
|
117
|
+
tree.selectContiguous(prev);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
tree.selectMulti(prev);
|
|
121
|
+
}
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (e.key === "ArrowRight") {
|
|
126
|
+
const node = tree.focusedNode;
|
|
127
|
+
if (!node)
|
|
128
|
+
return;
|
|
129
|
+
if (node.isInternal && node.isOpen) {
|
|
130
|
+
tree.focus(tree.nextNode);
|
|
131
|
+
}
|
|
132
|
+
else if (node.isInternal)
|
|
133
|
+
tree.open(node.id);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (e.key === "ArrowLeft") {
|
|
137
|
+
const node = tree.focusedNode;
|
|
138
|
+
if (!node || node.isRoot)
|
|
139
|
+
return;
|
|
140
|
+
if (node.isInternal && node.isOpen)
|
|
141
|
+
tree.close(node.id);
|
|
142
|
+
else if (!((_a = node.parent) === null || _a === void 0 ? void 0 : _a.isRoot)) {
|
|
143
|
+
tree.focus(node.parent);
|
|
144
|
+
}
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (e.key === "a" && e.metaKey && !tree.props.disableMultiSelection) {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
tree.selectAll();
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (e.key === "a" && !e.metaKey && tree.props.onCreate) {
|
|
153
|
+
tree.createLeaf();
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (e.key === "A" && !e.metaKey) {
|
|
157
|
+
if (!tree.props.onCreate)
|
|
158
|
+
return;
|
|
159
|
+
tree.createInternal();
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (e.key === "Home") {
|
|
163
|
+
// add shift keys
|
|
164
|
+
e.preventDefault();
|
|
165
|
+
tree.focus(tree.firstNode);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (e.key === "End") {
|
|
169
|
+
// add shift keys
|
|
170
|
+
e.preventDefault();
|
|
171
|
+
tree.focus(tree.lastNode);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (e.key === "Enter") {
|
|
175
|
+
const node = tree.focusedNode;
|
|
176
|
+
if (!node)
|
|
177
|
+
return;
|
|
178
|
+
if (!node.isEditable || !tree.props.onRename)
|
|
179
|
+
return;
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
if (node)
|
|
182
|
+
tree.edit(node);
|
|
183
|
+
});
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
if (e.key === " ") {
|
|
187
|
+
e.preventDefault();
|
|
188
|
+
const node = tree.focusedNode;
|
|
189
|
+
if (!node)
|
|
190
|
+
return;
|
|
191
|
+
if (node.isLeaf) {
|
|
192
|
+
node.select();
|
|
193
|
+
node.activate();
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
node.toggle();
|
|
197
|
+
}
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
if (e.key === "*") {
|
|
201
|
+
const node = tree.focusedNode;
|
|
202
|
+
if (!node)
|
|
203
|
+
return;
|
|
204
|
+
tree.openSiblings(node);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (e.key === "PageUp") {
|
|
208
|
+
e.preventDefault();
|
|
209
|
+
tree.pageUp();
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (e.key === "PageDown") {
|
|
213
|
+
e.preventDefault();
|
|
214
|
+
tree.pageDown();
|
|
215
|
+
}
|
|
216
|
+
// If they type a sequence of characters
|
|
217
|
+
// collect them. Reset them after a timeout.
|
|
218
|
+
// Use it to search the tree for a node, then focus it.
|
|
219
|
+
// Clean this up a bit later
|
|
220
|
+
clearTimeout(timeoutId);
|
|
221
|
+
focusSearchTerm += e.key;
|
|
222
|
+
timeoutId = setTimeout(() => {
|
|
223
|
+
focusSearchTerm = "";
|
|
224
|
+
}, 600);
|
|
225
|
+
const node = tree.visibleNodes.find((n) => {
|
|
226
|
+
// @ts-ignore
|
|
227
|
+
const name = n.data.name;
|
|
228
|
+
if (typeof name === "string") {
|
|
229
|
+
return name.toLowerCase().startsWith(focusSearchTerm);
|
|
230
|
+
}
|
|
231
|
+
else
|
|
232
|
+
return false;
|
|
233
|
+
});
|
|
234
|
+
if (node)
|
|
235
|
+
tree.focus(node.id);
|
|
236
|
+
}, children: (0, jsx_runtime_1.jsx)(react_window_1.FixedSizeList, { className: tree.props.className, outerRef: tree.listEl, itemCount: tree.visibleNodes.length, height: tree.height, width: tree.width, itemSize: tree.rowHeight, overscanCount: tree.overscanCount, itemKey: (index) => { var _a; return ((_a = tree.visibleNodes[index]) === null || _a === void 0 ? void 0 : _a.id) || index; }, outerElementType: list_outer_element_1.ListOuterElement, innerElementType: list_inner_element_1.ListInnerElement, onScroll: tree.props.onScroll, onItemsRendered: tree.onItemsRendered.bind(tree), ref: tree.list, children: row_container_1.RowContainer }) }));
|
|
237
|
+
}
|
|
238
|
+
exports.DefaultContainer = DefaultContainer;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DefaultCursor = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const placeholderStyle = {
|
|
10
|
+
display: "flex",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
zIndex: 1,
|
|
13
|
+
};
|
|
14
|
+
const lineStyle = {
|
|
15
|
+
flex: 1,
|
|
16
|
+
height: "2px",
|
|
17
|
+
background: "#4B91E2",
|
|
18
|
+
borderRadius: "1px",
|
|
19
|
+
};
|
|
20
|
+
const circleStyle = {
|
|
21
|
+
width: "4px",
|
|
22
|
+
height: "4px",
|
|
23
|
+
boxShadow: "0 0 0 3px #4B91E2",
|
|
24
|
+
borderRadius: "50%",
|
|
25
|
+
};
|
|
26
|
+
exports.DefaultCursor = react_1.default.memo(function DefaultCursor({ top, left, indent, }) {
|
|
27
|
+
const style = {
|
|
28
|
+
position: "absolute",
|
|
29
|
+
pointerEvents: "none",
|
|
30
|
+
top: top - 2 + "px",
|
|
31
|
+
left: left + "px",
|
|
32
|
+
right: indent + "px",
|
|
33
|
+
};
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: Object.assign(Object.assign({}, placeholderStyle), style), children: [(0, jsx_runtime_1.jsx)("div", { style: Object.assign({}, circleStyle) }), (0, jsx_runtime_1.jsx)("div", { style: Object.assign({}, lineStyle) })] }));
|
|
35
|
+
});
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DragPreviewProps } from "../types/renderers";
|
|
3
|
-
export declare function DefaultDragPreview({ offset, mouse, id, dragIds, isDragging, }: DragPreviewProps): JSX.Element;
|
|
2
|
+
export declare function DefaultDragPreview({ offset, mouse, id, dragIds, isDragging, }: DragPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultDragPreview = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const context_1 = require("../context");
|
|
7
|
+
const layerStyles = {
|
|
8
|
+
position: "fixed",
|
|
9
|
+
pointerEvents: "none",
|
|
10
|
+
zIndex: 100,
|
|
11
|
+
left: 0,
|
|
12
|
+
top: 0,
|
|
13
|
+
width: "100%",
|
|
14
|
+
height: "100%",
|
|
15
|
+
};
|
|
16
|
+
const getStyle = (offset) => {
|
|
17
|
+
if (!offset)
|
|
18
|
+
return { display: "none" };
|
|
19
|
+
const { x, y } = offset;
|
|
20
|
+
return { transform: `translate(${x}px, ${y}px)` };
|
|
21
|
+
};
|
|
22
|
+
const getCountStyle = (offset) => {
|
|
23
|
+
if (!offset)
|
|
24
|
+
return { display: "none" };
|
|
25
|
+
const { x, y } = offset;
|
|
26
|
+
return { transform: `translate(${x + 10}px, ${y + 10}px)` };
|
|
27
|
+
};
|
|
28
|
+
function DefaultDragPreview({ offset, mouse, id, dragIds, isDragging, }) {
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)(Overlay, { isDragging: isDragging, children: [(0, jsx_runtime_1.jsx)(Position, { offset: offset, children: (0, jsx_runtime_1.jsx)(PreviewNode, { id: id, dragIds: dragIds }) }), (0, jsx_runtime_1.jsx)(Count, { mouse: mouse, count: dragIds.length })] }));
|
|
30
|
+
}
|
|
31
|
+
exports.DefaultDragPreview = DefaultDragPreview;
|
|
32
|
+
const Overlay = (0, react_1.memo)(function Overlay(props) {
|
|
33
|
+
if (!props.isDragging)
|
|
34
|
+
return null;
|
|
35
|
+
return (0, jsx_runtime_1.jsx)("div", { style: layerStyles, children: props.children });
|
|
36
|
+
});
|
|
37
|
+
function Position(props) {
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "row preview", style: getStyle(props.offset), children: props.children }));
|
|
39
|
+
}
|
|
40
|
+
function Count(props) {
|
|
41
|
+
const { count, mouse } = props;
|
|
42
|
+
if (count > 1)
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "selected-count", style: getCountStyle(mouse), children: count }));
|
|
44
|
+
else
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const PreviewNode = (0, react_1.memo)(function PreviewNode(props) {
|
|
48
|
+
const tree = (0, context_1.useTreeApi)();
|
|
49
|
+
const node = tree.get(props.id);
|
|
50
|
+
if (!node)
|
|
51
|
+
return null;
|
|
52
|
+
return ((0, jsx_runtime_1.jsx)(tree.renderNode, { preview: true, node: node, style: {
|
|
53
|
+
paddingLeft: node.level * tree.indent,
|
|
54
|
+
opacity: 0.2,
|
|
55
|
+
background: "transparent",
|
|
56
|
+
}, tree: tree }));
|
|
57
|
+
});
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { NodeRendererProps } from "../types/renderers";
|
|
3
|
-
export declare function DefaultNode<T>(props: NodeRendererProps<T>): JSX.Element;
|
|
2
|
+
export declare function DefaultNode<T>(props: NodeRendererProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultNode = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
function DefaultNode(props) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: props.dragHandle, style: props.style, children: [(0, jsx_runtime_1.jsx)("span", { onClick: (e) => {
|
|
8
|
+
e.stopPropagation();
|
|
9
|
+
props.node.toggle();
|
|
10
|
+
}, children: props.node.isLeaf ? "🌳" : props.node.isOpen ? "🗁" : "🗀" }), " ", props.node.isEditing ? (0, jsx_runtime_1.jsx)(Edit, Object.assign({}, props)) : (0, jsx_runtime_1.jsx)(Show, Object.assign({}, props))] }));
|
|
11
|
+
}
|
|
12
|
+
exports.DefaultNode = DefaultNode;
|
|
13
|
+
function Show(props) {
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("span", { children: props.node.data.name }) }));
|
|
15
|
+
}
|
|
16
|
+
function Edit({ node }) {
|
|
17
|
+
const input = (0, react_1.useRef)();
|
|
18
|
+
(0, react_1.useEffect)(() => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
(_a = input.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
21
|
+
(_b = input.current) === null || _b === void 0 ? void 0 : _b.select();
|
|
22
|
+
}, []);
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)("input", { ref: input,
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
defaultValue: node.data.name, onBlur: () => node.reset(), onKeyDown: (e) => {
|
|
26
|
+
var _a;
|
|
27
|
+
if (e.key === "Escape")
|
|
28
|
+
node.reset();
|
|
29
|
+
if (e.key === "Enter")
|
|
30
|
+
node.submit(((_a = input.current) === null || _a === void 0 ? void 0 : _a.value) || "");
|
|
31
|
+
} }));
|
|
32
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { RowRendererProps } from "../types/renderers";
|
|
3
|
-
export declare function DefaultRow<T>({ node, attrs, innerRef, children, }: RowRendererProps<T>): JSX.Element;
|
|
2
|
+
export declare function DefaultRow<T>({ node, attrs, innerRef, children, }: RowRendererProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultRow = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
function DefaultRow({ node, attrs, innerRef, children, }) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, attrs, { ref: innerRef, onFocus: (e) => e.stopPropagation(), onClick: node.handleClick, children: children })));
|
|
7
|
+
}
|
|
8
|
+
exports.DefaultRow = DefaultRow;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DragPreviewContainer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DragPreviewContainer = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_dnd_1 = require("react-dnd");
|
|
6
|
+
const context_1 = require("../context");
|
|
7
|
+
const default_drag_preview_1 = require("./default-drag-preview");
|
|
8
|
+
function DragPreviewContainer() {
|
|
9
|
+
const tree = (0, context_1.useTreeApi)();
|
|
10
|
+
const { offset, mouse, item, isDragging } = (0, react_dnd_1.useDragLayer)((m) => {
|
|
11
|
+
return {
|
|
12
|
+
offset: m.getSourceClientOffset(),
|
|
13
|
+
mouse: m.getClientOffset(),
|
|
14
|
+
item: m.getItem(),
|
|
15
|
+
isDragging: m.isDragging(),
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
const DragPreview = tree.props.renderDragPreview || default_drag_preview_1.DefaultDragPreview;
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(DragPreview, { offset: offset, mouse: mouse, id: (item === null || item === void 0 ? void 0 : item.id) || null, dragIds: (item === null || item === void 0 ? void 0 : item.dragIds) || [], isDragging: isDragging }));
|
|
20
|
+
}
|
|
21
|
+
exports.DragPreviewContainer = DragPreviewContainer;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const ListInnerElement: React.ForwardRefExoticComponent<
|
|
2
|
+
export declare const ListInnerElement: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.ListInnerElement = void 0;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const react_1 = require("react");
|
|
17
|
+
const context_1 = require("../context");
|
|
18
|
+
exports.ListInnerElement = (0, react_1.forwardRef)(function InnerElement(_a, ref) {
|
|
19
|
+
var _b, _c, _d, _e;
|
|
20
|
+
var { style } = _a, rest = __rest(_a, ["style"]);
|
|
21
|
+
const tree = (0, context_1.useTreeApi)();
|
|
22
|
+
const paddingTop = (_c = (_b = tree.props.padding) !== null && _b !== void 0 ? _b : tree.props.paddingTop) !== null && _c !== void 0 ? _c : 0;
|
|
23
|
+
const paddingBottom = (_e = (_d = tree.props.padding) !== null && _d !== void 0 ? _d : tree.props.paddingBottom) !== null && _e !== void 0 ? _e : 0;
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref, style: Object.assign(Object.assign({}, style), { height: `${parseFloat(style.height) + paddingTop + paddingBottom}px` }) }, rest)));
|
|
25
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.ListOuterElement = void 0;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const react_1 = require("react");
|
|
17
|
+
const context_1 = require("../context");
|
|
18
|
+
const cursor_1 = require("./cursor");
|
|
19
|
+
exports.ListOuterElement = (0, react_1.forwardRef)(function Outer(props, ref) {
|
|
20
|
+
const { children } = props, rest = __rest(props, ["children"]);
|
|
21
|
+
const tree = (0, context_1.useTreeApi)();
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
ref: ref }, rest, { onClick: (e) => {
|
|
25
|
+
if (e.currentTarget === e.target)
|
|
26
|
+
tree.deselectAll();
|
|
27
|
+
}, children: [(0, jsx_runtime_1.jsx)(DropContainer, {}), children] })));
|
|
28
|
+
});
|
|
29
|
+
const DropContainer = () => {
|
|
30
|
+
const tree = (0, context_1.useTreeApi)();
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
32
|
+
height: tree.visibleNodes.length * tree.rowHeight,
|
|
33
|
+
width: "100%",
|
|
34
|
+
position: "absolute",
|
|
35
|
+
left: "0",
|
|
36
|
+
right: "0",
|
|
37
|
+
}, children: (0, jsx_runtime_1.jsx)(cursor_1.Cursor, {}) }));
|
|
38
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OuterDrop = void 0;
|
|
4
|
+
const outer_drop_hook_1 = require("../dnd/outer-drop-hook");
|
|
5
|
+
function OuterDrop(props) {
|
|
6
|
+
(0, outer_drop_hook_1.useOuterDrop)();
|
|
7
|
+
return props.children;
|
|
8
|
+
}
|
|
9
|
+
exports.OuterDrop = OuterDrop;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { TreeApi } from "../interfaces/tree-api";
|
|
3
3
|
import { TreeProps } from "../types/tree-props";
|
|
4
|
-
|
|
4
|
+
type Props<T> = {
|
|
5
5
|
treeProps: TreeProps<T>;
|
|
6
6
|
imperativeHandle: React.Ref<TreeApi<T> | undefined>;
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
};
|
|
9
|
-
export declare function TreeProvider<T>({ treeProps, imperativeHandle, children, }: Props<T>): JSX.Element;
|
|
9
|
+
export declare function TreeProvider<T>({ treeProps, imperativeHandle, children, }: Props<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TreeProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const shim_1 = require("use-sync-external-store/shim");
|
|
7
|
+
const context_1 = require("../context");
|
|
8
|
+
const tree_api_1 = require("../interfaces/tree-api");
|
|
9
|
+
const initial_1 = require("../state/initial");
|
|
10
|
+
const root_reducer_1 = require("../state/root-reducer");
|
|
11
|
+
const react_dnd_html5_backend_1 = require("react-dnd-html5-backend");
|
|
12
|
+
const react_dnd_1 = require("react-dnd");
|
|
13
|
+
const redux_1 = require("redux");
|
|
14
|
+
const open_slice_1 = require("../state/open-slice");
|
|
15
|
+
const SERVER_STATE = (0, initial_1.initialState)();
|
|
16
|
+
function TreeProvider({ treeProps, imperativeHandle, children, }) {
|
|
17
|
+
const list = (0, react_1.useRef)(null);
|
|
18
|
+
const listEl = (0, react_1.useRef)(null);
|
|
19
|
+
const store = (0, react_1.useRef)(
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
(0, redux_1.createStore)(root_reducer_1.rootReducer, (0, initial_1.initialState)(treeProps)));
|
|
22
|
+
const state = (0, shim_1.useSyncExternalStore)(store.current.subscribe, store.current.getState, () => SERVER_STATE);
|
|
23
|
+
/* The tree api object is stable. */
|
|
24
|
+
const api = (0, react_1.useMemo)(() => {
|
|
25
|
+
return new tree_api_1.TreeApi(store.current, treeProps, list, listEl);
|
|
26
|
+
}, []);
|
|
27
|
+
/* Make sure the tree instance stays in sync */
|
|
28
|
+
const updateCount = (0, react_1.useRef)(0);
|
|
29
|
+
(0, react_1.useMemo)(() => {
|
|
30
|
+
updateCount.current += 1;
|
|
31
|
+
api.update(treeProps);
|
|
32
|
+
}, [...Object.values(treeProps), state.nodes.open]);
|
|
33
|
+
/* Expose the tree api */
|
|
34
|
+
(0, react_1.useImperativeHandle)(imperativeHandle, () => api);
|
|
35
|
+
/* Change selection based on props */
|
|
36
|
+
(0, react_1.useEffect)(() => {
|
|
37
|
+
if (api.props.selection) {
|
|
38
|
+
api.select(api.props.selection, { focus: false });
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
api.deselectAll();
|
|
42
|
+
}
|
|
43
|
+
}, [api.props.selection]);
|
|
44
|
+
/* Clear visability for filtered nodes */
|
|
45
|
+
(0, react_1.useEffect)(() => {
|
|
46
|
+
if (!api.props.searchTerm) {
|
|
47
|
+
store.current.dispatch(open_slice_1.actions.clear(true));
|
|
48
|
+
}
|
|
49
|
+
}, [api.props.searchTerm]);
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(context_1.TreeApiContext.Provider, { value: api, children: (0, jsx_runtime_1.jsx)(context_1.DataUpdatesContext.Provider, { value: updateCount.current, children: (0, jsx_runtime_1.jsx)(context_1.NodesContext.Provider, { value: state.nodes, children: (0, jsx_runtime_1.jsx)(context_1.DndContext.Provider, { value: state.dnd, children: (0, jsx_runtime_1.jsx)(react_dnd_1.DndProvider, Object.assign({ backend: react_dnd_html5_backend_1.HTML5Backend, options: { rootElement: api.props.dndRootElement || undefined } }, (treeProps.dndManager && { manager: treeProps.dndManager }), { children: children })) }) }) }) }));
|
|
51
|
+
}
|
|
52
|
+
exports.TreeProvider = TreeProvider;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
type Props = {
|
|
3
3
|
style: React.CSSProperties;
|
|
4
4
|
index: number;
|
|
5
5
|
};
|
|
6
|
-
export declare const RowContainer: React.MemoExoticComponent<(<T>({ index, style, }: Props) => JSX.Element)>;
|
|
6
|
+
export declare const RowContainer: React.MemoExoticComponent<(<T>({ index, style, }: Props) => import("react/jsx-runtime").JSX.Element)>;
|
|
7
7
|
export {};
|