@djangocfg/ui-tools 2.1.316 → 2.1.318
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/TreeRoot-A3J65L6F.mjs +4 -0
- package/dist/{TreeRoot-A25RIGYE.cjs.map → TreeRoot-A3J65L6F.mjs.map} +1 -1
- package/dist/TreeRoot-DSK5JILT.cjs +19 -0
- package/dist/{TreeRoot-HBRJEHBH.mjs.map → TreeRoot-DSK5JILT.cjs.map} +1 -1
- package/dist/{chunk-4CEOJDMB.cjs → chunk-3Z3A7FHA.cjs} +36 -15
- package/dist/chunk-3Z3A7FHA.cjs.map +1 -0
- package/dist/{chunk-NFIMVYJU.mjs → chunk-MOME6KYD.mjs} +36 -15
- package/dist/chunk-MOME6KYD.mjs.map +1 -0
- package/dist/file-icon/index.cjs +173 -0
- package/dist/file-icon/index.cjs.map +1 -0
- package/dist/file-icon/index.d.cts +98 -0
- package/dist/file-icon/index.d.ts +98 -0
- package/dist/file-icon/index.mjs +167 -0
- package/dist/file-icon/index.mjs.map +1 -0
- package/dist/index.cjs +122 -122
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +3 -3
- package/dist/tree/index.cjs +33 -33
- package/dist/tree/index.d.cts +10 -172
- package/dist/tree/index.d.ts +10 -172
- package/dist/tree/index.mjs +1 -1
- package/dist/types-CevSbyfD.d.cts +204 -0
- package/dist/types-CevSbyfD.d.ts +204 -0
- package/package.json +13 -7
- package/src/tools/FileIcon/FileIcon.tsx +102 -0
- package/src/tools/FileIcon/index.ts +15 -0
- package/src/tools/FileIcon/loader.ts +47 -0
- package/src/tools/FileIcon/specialFolders.ts +93 -0
- package/src/tools/FileIcon/treeAdapter.tsx +49 -0
- package/src/tools/Tree/README.md +100 -0
- package/src/tools/Tree/Tree.story.tsx +84 -0
- package/src/tools/Tree/TreeRoot.tsx +6 -1
- package/src/tools/Tree/components/TreeContent.tsx +3 -1
- package/src/tools/Tree/components/TreeRow.tsx +17 -8
- package/src/tools/Tree/context/TreeContext.tsx +14 -3
- package/src/tools/Tree/data/flatten.ts +10 -1
- package/src/tools/Tree/index.tsx +2 -0
- package/src/tools/Tree/types.ts +43 -2
- package/dist/TreeRoot-A25RIGYE.cjs +0 -19
- package/dist/TreeRoot-HBRJEHBH.mjs +0 -4
- package/dist/chunk-4CEOJDMB.cjs.map +0 -1
- package/dist/chunk-NFIMVYJU.mjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -8,10 +8,11 @@ export { Language } from 'prism-react-renderer';
|
|
|
8
8
|
import { RJSFSchema, UiSchema, WidgetProps, FieldTemplateProps, ObjectFieldTemplateProps, ArrayFieldTemplateProps, ArrayFieldItemTemplateProps, ErrorListProps } from '@rjsf/utils';
|
|
9
9
|
import { FormProps, IChangeEvent } from '@rjsf/core';
|
|
10
10
|
import { CommonExternalProps } from 'react-json-tree';
|
|
11
|
-
import { TreeRootProps } from './
|
|
12
|
-
export {
|
|
11
|
+
import { b as TreeRootProps } from './types-CevSbyfD.cjs';
|
|
12
|
+
export { c as DEFAULT_TREE_APPEARANCE, D as DEFAULT_TREE_LABELS, F as FlatRow, R as ResolvedAppearance, m as TreeAccentIntensity, k as TreeAppearance, e as TreeContextMenuSlot, l as TreeDensity, f as TreeItemId, g as TreeLabels, j as TreeLoadChildren, T as TreeNode, n as TreeRadius, i as TreeRowRenderProps, a as TreeRowSlot, h as TreeSelectionMode, d as appearanceToStyle, r as resolveAppearance } from './types-CevSbyfD.cjs';
|
|
13
13
|
import { MediaPlayerInstance } from '@vidstack/react';
|
|
14
14
|
import * as monaco from 'monaco-editor';
|
|
15
|
+
export { ChildCache, ChildEntry, ChildEntryStatus, DemoNode, FlattenInput, PersistedTreeState, TreeRoot as Tree, TreeChevron, TreeChevronProps, TreeContent, TreeContentProps, TreeContextValue, TreeEmpty, TreeEmptyProps, TreeError, TreeErrorProps, TreeIcon, TreeIconProps, TreeIndentGuides, TreeIndentGuidesProps, TreeLabel, TreeLabelProps, TreeProvider, TreeProviderProps, TreeRoot, TreeRow, TreeRowProps, TreeSearchInput, TreeSearchInputProps, TreeSkeleton, TreeSkeletonProps, UseTreeKeyboardOptions, UseTreeTypeAheadOptions, clearTreeState, createChildCache, createDemoTree, flattenTree, loadTreeState, resolveChildren, saveTreeState, useTreeActions, useTreeContext, useTreeExpansion, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead } from './tree/index.cjs';
|
|
15
16
|
import * as zustand_middleware from 'zustand/middleware';
|
|
16
17
|
import * as zustand from 'zustand';
|
|
17
18
|
|
package/dist/index.d.ts
CHANGED
|
@@ -8,10 +8,11 @@ export { Language } from 'prism-react-renderer';
|
|
|
8
8
|
import { RJSFSchema, UiSchema, WidgetProps, FieldTemplateProps, ObjectFieldTemplateProps, ArrayFieldTemplateProps, ArrayFieldItemTemplateProps, ErrorListProps } from '@rjsf/utils';
|
|
9
9
|
import { FormProps, IChangeEvent } from '@rjsf/core';
|
|
10
10
|
import { CommonExternalProps } from 'react-json-tree';
|
|
11
|
-
import { TreeRootProps } from './
|
|
12
|
-
export {
|
|
11
|
+
import { b as TreeRootProps } from './types-CevSbyfD.js';
|
|
12
|
+
export { c as DEFAULT_TREE_APPEARANCE, D as DEFAULT_TREE_LABELS, F as FlatRow, R as ResolvedAppearance, m as TreeAccentIntensity, k as TreeAppearance, e as TreeContextMenuSlot, l as TreeDensity, f as TreeItemId, g as TreeLabels, j as TreeLoadChildren, T as TreeNode, n as TreeRadius, i as TreeRowRenderProps, a as TreeRowSlot, h as TreeSelectionMode, d as appearanceToStyle, r as resolveAppearance } from './types-CevSbyfD.js';
|
|
13
13
|
import { MediaPlayerInstance } from '@vidstack/react';
|
|
14
14
|
import * as monaco from 'monaco-editor';
|
|
15
|
+
export { ChildCache, ChildEntry, ChildEntryStatus, DemoNode, FlattenInput, PersistedTreeState, TreeRoot as Tree, TreeChevron, TreeChevronProps, TreeContent, TreeContentProps, TreeContextValue, TreeEmpty, TreeEmptyProps, TreeError, TreeErrorProps, TreeIcon, TreeIconProps, TreeIndentGuides, TreeIndentGuidesProps, TreeLabel, TreeLabelProps, TreeProvider, TreeProviderProps, TreeRoot, TreeRow, TreeRowProps, TreeSearchInput, TreeSearchInputProps, TreeSkeleton, TreeSkeletonProps, UseTreeKeyboardOptions, UseTreeTypeAheadOptions, clearTreeState, createChildCache, createDemoTree, flattenTree, loadTreeState, resolveChildren, saveTreeState, useTreeActions, useTreeContext, useTreeExpansion, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead } from './tree/index.js';
|
|
15
16
|
import * as zustand_middleware from 'zustand/middleware';
|
|
16
17
|
import * as zustand from 'zustand';
|
|
17
18
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { ArrayFieldItemTemplate, ArrayFieldTemplate, BaseInputTemplate, CheckboxWidget, ColorWidget, ErrorListTemplate, FieldTemplate, JsonSchemaForm, NumberWidget, ObjectFieldTemplate, SelectWidget, SliderWidget, SwitchWidget, TextWidget, getRequiredFields, hasRequiredFields, mergeDefaults, normalizeFormData, safeJsonParse, safeJsonStringify, validateRequiredFields, validateSchema } from './chunk-JUGQNNDC.mjs';
|
|
1
2
|
export { useLottie } from './chunk-6JTB2X72.mjs';
|
|
2
3
|
export { Player as AudioPlayer } from './chunk-FX2QFYWF.mjs';
|
|
3
4
|
export { NativeProvider, StreamProvider, VideoControls, VideoErrorFallback, VideoPlayer, VideoPlayerProvider, VidstackProvider, createVideoErrorFallback, isSimpleStreamSource, resolveFileSource, resolvePlayerMode, resolveStreamSource, useVideoPlayerContext } from './chunk-EUADAUBQ.mjs';
|
|
@@ -5,12 +6,11 @@ export { ImageViewer } from './chunk-GGKGH5PM.mjs';
|
|
|
5
6
|
export { generateContentKey, useAudioCache, useBlobUrlCleanup, useImageCache, useMediaCacheStore, useVideoCache, useVideoPlayerSettings } from './chunk-5LBDYFWH.mjs';
|
|
6
7
|
export { CronSchedulerProvider, CustomInput, DayChips, MonthDayGrid, SchedulePreview, ScheduleTypeSelector, TimeSelector, buildCron, humanizeCron, isValidCron, parseCron, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays } from './chunk-PZKAH7WQ.mjs';
|
|
7
8
|
export { TreeError, TreeSkeleton, createDemoTree } from './chunk-KR6B3LVY.mjs';
|
|
8
|
-
export { DEFAULT_TREE_APPEARANCE, DEFAULT_TREE_LABELS, TreeRoot as Tree, TreeChevron, TreeContent, TreeEmpty, TreeIcon, TreeIndentGuides, TreeLabel, TreeProvider, TreeRoot, TreeRow, TreeSearchInput, appearanceToStyle, clearTreeState, createChildCache, flattenTree, loadTreeState, resolveAppearance, resolveChildren, saveTreeState, useTreeActions, useTreeContext, useTreeExpansion, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead } from './chunk-
|
|
9
|
+
export { DEFAULT_TREE_APPEARANCE, DEFAULT_TREE_LABELS, TreeRoot as Tree, TreeChevron, TreeContent, TreeEmpty, TreeIcon, TreeIndentGuides, TreeLabel, TreeProvider, TreeRoot, TreeRow, TreeSearchInput, appearanceToStyle, clearTreeState, createChildCache, flattenTree, loadTreeState, resolveAppearance, resolveChildren, saveTreeState, useTreeActions, useTreeContext, useTreeExpansion, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead } from './chunk-MOME6KYD.mjs';
|
|
9
10
|
import { PlaygroundProvider } from './chunk-GBLQTHWT.mjs';
|
|
10
11
|
export { MarkdownMessage, Mermaid_default as Mermaid, PrettyCode_default as PrettyCode, extractTextFromChildren, useCollapsibleContent } from './chunk-GBLQTHWT.mjs';
|
|
11
12
|
export { JsonTree_default as JsonTree } from './chunk-LFWQ36LJ.mjs';
|
|
12
13
|
import './chunk-SSUOENAZ.mjs';
|
|
13
|
-
export { ArrayFieldItemTemplate, ArrayFieldTemplate, BaseInputTemplate, CheckboxWidget, ColorWidget, ErrorListTemplate, FieldTemplate, JsonSchemaForm, NumberWidget, ObjectFieldTemplate, SelectWidget, SliderWidget, SwitchWidget, TextWidget, getRequiredFields, hasRequiredFields, mergeDefaults, normalizeFormData, safeJsonParse, safeJsonStringify, validateRequiredFields, validateSchema } from './chunk-JUGQNNDC.mjs';
|
|
14
14
|
import { __name } from './chunk-CGILA3WO.mjs';
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
import { lazy, forwardRef, useRef, useState, useCallback, useImperativeHandle, useEffect, createContext, Suspense, useContext, useMemo } from 'react';
|
|
@@ -338,7 +338,7 @@ var LazyCronScheduler = createLazyComponent(
|
|
|
338
338
|
}
|
|
339
339
|
);
|
|
340
340
|
var LazyTree = createLazyComponent(
|
|
341
|
-
() => import('./TreeRoot-
|
|
341
|
+
() => import('./TreeRoot-A3J65L6F.mjs'),
|
|
342
342
|
{
|
|
343
343
|
displayName: "LazyTree",
|
|
344
344
|
fallback: /* @__PURE__ */ jsx(LoadingFallback, { minHeight: 200, text: "Loading tree\u2026" })
|
package/dist/tree/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var chunkYXBOAGIM_cjs = require('../chunk-YXBOAGIM.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunk3Z3A7FHA_cjs = require('../chunk-3Z3A7FHA.cjs');
|
|
7
7
|
require('../chunk-WGEGR3DF.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
@@ -22,131 +22,131 @@ Object.defineProperty(exports, "createDemoTree", {
|
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "DEFAULT_TREE_APPEARANCE", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunk3Z3A7FHA_cjs.DEFAULT_TREE_APPEARANCE; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "DEFAULT_TREE_LABELS", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunk3Z3A7FHA_cjs.DEFAULT_TREE_LABELS; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "Tree", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunk3Z3A7FHA_cjs.TreeRoot; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "TreeChevron", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunk3Z3A7FHA_cjs.TreeChevron; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "TreeContent", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunk3Z3A7FHA_cjs.TreeContent; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "TreeEmpty", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunk3Z3A7FHA_cjs.TreeEmpty; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "TreeIcon", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunk3Z3A7FHA_cjs.TreeIcon; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "TreeIndentGuides", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunk3Z3A7FHA_cjs.TreeIndentGuides; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "TreeLabel", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunk3Z3A7FHA_cjs.TreeLabel; }
|
|
58
58
|
});
|
|
59
59
|
Object.defineProperty(exports, "TreeProvider", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunk3Z3A7FHA_cjs.TreeProvider; }
|
|
62
62
|
});
|
|
63
63
|
Object.defineProperty(exports, "TreeRoot", {
|
|
64
64
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunk3Z3A7FHA_cjs.TreeRoot; }
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(exports, "TreeRow", {
|
|
68
68
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunk3Z3A7FHA_cjs.TreeRow; }
|
|
70
70
|
});
|
|
71
71
|
Object.defineProperty(exports, "TreeSearchInput", {
|
|
72
72
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunk3Z3A7FHA_cjs.TreeSearchInput; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "appearanceToStyle", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunk3Z3A7FHA_cjs.appearanceToStyle; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "clearTreeState", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunk3Z3A7FHA_cjs.clearTreeState; }
|
|
82
82
|
});
|
|
83
83
|
Object.defineProperty(exports, "createChildCache", {
|
|
84
84
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunk3Z3A7FHA_cjs.createChildCache; }
|
|
86
86
|
});
|
|
87
87
|
Object.defineProperty(exports, "default", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunk3Z3A7FHA_cjs.TreeRoot_default; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "flattenTree", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunk3Z3A7FHA_cjs.flattenTree; }
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, "loadTreeState", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunk3Z3A7FHA_cjs.loadTreeState; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "resolveAppearance", {
|
|
100
100
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunk3Z3A7FHA_cjs.resolveAppearance; }
|
|
102
102
|
});
|
|
103
103
|
Object.defineProperty(exports, "resolveChildren", {
|
|
104
104
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunk3Z3A7FHA_cjs.resolveChildren; }
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(exports, "saveTreeState", {
|
|
108
108
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunk3Z3A7FHA_cjs.saveTreeState; }
|
|
110
110
|
});
|
|
111
111
|
Object.defineProperty(exports, "useTreeActions", {
|
|
112
112
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunk3Z3A7FHA_cjs.useTreeActions; }
|
|
114
114
|
});
|
|
115
115
|
Object.defineProperty(exports, "useTreeContext", {
|
|
116
116
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunk3Z3A7FHA_cjs.useTreeContext; }
|
|
118
118
|
});
|
|
119
119
|
Object.defineProperty(exports, "useTreeExpansion", {
|
|
120
120
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunk3Z3A7FHA_cjs.useTreeExpansion; }
|
|
122
122
|
});
|
|
123
123
|
Object.defineProperty(exports, "useTreeFocus", {
|
|
124
124
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunk3Z3A7FHA_cjs.useTreeFocus; }
|
|
126
126
|
});
|
|
127
127
|
Object.defineProperty(exports, "useTreeKeyboard", {
|
|
128
128
|
enumerable: true,
|
|
129
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunk3Z3A7FHA_cjs.useTreeKeyboard; }
|
|
130
130
|
});
|
|
131
131
|
Object.defineProperty(exports, "useTreeLabels", {
|
|
132
132
|
enumerable: true,
|
|
133
|
-
get: function () { return
|
|
133
|
+
get: function () { return chunk3Z3A7FHA_cjs.useTreeLabels; }
|
|
134
134
|
});
|
|
135
135
|
Object.defineProperty(exports, "useTreeRows", {
|
|
136
136
|
enumerable: true,
|
|
137
|
-
get: function () { return
|
|
137
|
+
get: function () { return chunk3Z3A7FHA_cjs.useTreeRows; }
|
|
138
138
|
});
|
|
139
139
|
Object.defineProperty(exports, "useTreeSearch", {
|
|
140
140
|
enumerable: true,
|
|
141
|
-
get: function () { return
|
|
141
|
+
get: function () { return chunk3Z3A7FHA_cjs.useTreeSearch; }
|
|
142
142
|
});
|
|
143
143
|
Object.defineProperty(exports, "useTreeSelection", {
|
|
144
144
|
enumerable: true,
|
|
145
|
-
get: function () { return
|
|
145
|
+
get: function () { return chunk3Z3A7FHA_cjs.useTreeSelection; }
|
|
146
146
|
});
|
|
147
147
|
Object.defineProperty(exports, "useTreeTypeAhead", {
|
|
148
148
|
enumerable: true,
|
|
149
|
-
get: function () { return
|
|
149
|
+
get: function () { return chunk3Z3A7FHA_cjs.useTreeTypeAhead; }
|
|
150
150
|
});
|
|
151
151
|
//# sourceMappingURL=index.cjs.map
|
|
152
152
|
//# sourceMappingURL=index.cjs.map
|
package/dist/tree/index.d.cts
CHANGED
|
@@ -1,172 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { b as TreeRootProps, f as TreeItemId, T as TreeNode, F as FlatRow, o as TreeActivateOptions, g as TreeLabels, R as ResolvedAppearance, h as TreeSelectionMode, p as TreeActivationMode, a as TreeRowSlot, e as TreeContextMenuSlot } from '../types-CevSbyfD.cjs';
|
|
3
|
+
export { c as DEFAULT_TREE_APPEARANCE, D as DEFAULT_TREE_LABELS, m as TreeAccentIntensity, k as TreeAppearance, l as TreeDensity, j as TreeLoadChildren, n as TreeRadius, i as TreeRowRenderProps, d as appearanceToStyle, r as resolveAppearance } from '../types-CevSbyfD.cjs';
|
|
2
4
|
import * as React$1 from 'react';
|
|
3
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
type TreeDensity = 'compact' | 'cozy' | 'comfortable';
|
|
6
|
-
type TreeAccentIntensity = 'subtle' | 'default' | 'strong';
|
|
7
|
-
type TreeRadius = 'none' | 'sm' | 'md';
|
|
8
|
-
/**
|
|
9
|
-
* Cosmetic configuration. Every field is optional; missing values fall
|
|
10
|
-
* back to the `cozy` preset (a comfortable VSCode-Explorer-like density).
|
|
11
|
-
*
|
|
12
|
-
* Customize the look without re-implementing slots.
|
|
13
|
-
*/
|
|
14
|
-
interface TreeAppearance {
|
|
15
|
-
/** Built-in size preset. Default: `'cozy'`. */
|
|
16
|
-
density?: TreeDensity;
|
|
17
|
-
/** Override row height in px (wins over density). */
|
|
18
|
-
rowHeight?: number;
|
|
19
|
-
/** Override icon + chevron size in px (wins over density). */
|
|
20
|
-
iconSize?: number;
|
|
21
|
-
/** Lucide stroke width for icon + chevron. Default: 1.5. */
|
|
22
|
-
iconStrokeWidth?: number;
|
|
23
|
-
/** Override label font size in px (wins over density). */
|
|
24
|
-
fontSize?: number;
|
|
25
|
-
/** Pixels between chevron / icon / label. Default depends on density. */
|
|
26
|
-
gap?: number;
|
|
27
|
-
/** Pixels between nesting levels. Default: 16. */
|
|
28
|
-
indent?: number;
|
|
29
|
-
/** Hover / selected highlight intensity. Default: `'default'`. */
|
|
30
|
-
accent?: TreeAccentIntensity;
|
|
31
|
-
/** Row corner radius. Default: `'sm'`. */
|
|
32
|
-
radius?: TreeRadius;
|
|
33
|
-
/** Indent-guide line opacity (0..1). Default: 0.4. */
|
|
34
|
-
indentGuideOpacity?: number;
|
|
35
|
-
/**
|
|
36
|
-
* Show a 2px primary-tinted bar on the left of the selected row.
|
|
37
|
-
* Mimics the VSCode active-tab indicator. Default: `true`.
|
|
38
|
-
*/
|
|
39
|
-
showActiveIndicator?: boolean;
|
|
40
|
-
}
|
|
41
|
-
interface ResolvedAppearance {
|
|
42
|
-
density: TreeDensity;
|
|
43
|
-
rowHeight: number;
|
|
44
|
-
iconSize: number;
|
|
45
|
-
iconStrokeWidth: number;
|
|
46
|
-
fontSize: number;
|
|
47
|
-
gap: number;
|
|
48
|
-
indent: number;
|
|
49
|
-
accent: TreeAccentIntensity;
|
|
50
|
-
radius: TreeRadius;
|
|
51
|
-
indentGuideOpacity: number;
|
|
52
|
-
showActiveIndicator: boolean;
|
|
53
|
-
}
|
|
54
|
-
declare const DEFAULT_TREE_APPEARANCE: ResolvedAppearance;
|
|
55
|
-
/**
|
|
56
|
-
* Merge a partial appearance with the default + density preset.
|
|
57
|
-
*
|
|
58
|
-
* Explicit numeric overrides (e.g. `rowHeight`) win over the density preset.
|
|
59
|
-
*/
|
|
60
|
-
declare function resolveAppearance(input?: TreeAppearance,
|
|
61
|
-
/** Outer `indent` prop (kept on TreeRoot for back-compat). */
|
|
62
|
-
outerIndent?: number): ResolvedAppearance;
|
|
63
|
-
/**
|
|
64
|
-
* Build the `style` object that exposes the resolved appearance to any
|
|
65
|
-
* descendant via CSS variables. Set on `<TreeRoot>`'s outer div.
|
|
66
|
-
*/
|
|
67
|
-
declare function appearanceToStyle(a: ResolvedAppearance): CSSProperties;
|
|
68
|
-
|
|
69
|
-
type TreeItemId = string;
|
|
70
|
-
/** A single node in the consumer's tree data. Generic over your payload. */
|
|
71
|
-
interface TreeNode<T = unknown> {
|
|
72
|
-
id: TreeItemId;
|
|
73
|
-
data: T;
|
|
74
|
-
/** Inline children. Omit (and provide a `loadChildren`) for async loading. */
|
|
75
|
-
children?: TreeNode<T>[];
|
|
76
|
-
/**
|
|
77
|
-
* Set to `true` to mark a node as a folder even when its `children` array
|
|
78
|
-
* is empty (e.g. an unloaded async folder). Default: derived from
|
|
79
|
-
* `Array.isArray(children)`.
|
|
80
|
-
*/
|
|
81
|
-
isFolder?: boolean;
|
|
82
|
-
/** Disable interaction. */
|
|
83
|
-
disabled?: boolean;
|
|
84
|
-
}
|
|
85
|
-
interface TreeLabels {
|
|
86
|
-
loading: string;
|
|
87
|
-
empty: string;
|
|
88
|
-
error: string;
|
|
89
|
-
searchPlaceholder: string;
|
|
90
|
-
searchMatches: (count: number) => string;
|
|
91
|
-
ariaLabel: string;
|
|
92
|
-
}
|
|
93
|
-
declare const DEFAULT_TREE_LABELS: TreeLabels;
|
|
94
|
-
type TreeSelectionMode = 'none' | 'single' | 'multiple';
|
|
95
|
-
/**
|
|
96
|
-
* Async loader: called the first time a folder is expanded with no inline
|
|
97
|
-
* `children`. Result is cached; concurrent expansions are de-duplicated.
|
|
98
|
-
*/
|
|
99
|
-
type TreeLoadChildren<T> = (node: TreeNode<T>) => Promise<TreeNode<T>[]>;
|
|
100
|
-
interface TreeRowRenderProps<T> {
|
|
101
|
-
node: TreeNode<T>;
|
|
102
|
-
level: number;
|
|
103
|
-
isSelected: boolean;
|
|
104
|
-
isExpanded: boolean;
|
|
105
|
-
isFocused: boolean;
|
|
106
|
-
isFolder: boolean;
|
|
107
|
-
isLoading: boolean;
|
|
108
|
-
isMatchingSearch: boolean;
|
|
109
|
-
}
|
|
110
|
-
type TreeRowSlot<T> = (props: TreeRowRenderProps<T>) => ReactNode;
|
|
111
|
-
type TreeContextMenuSlot<T> = (props: TreeRowRenderProps<T>, trigger: ReactNode) => ReactNode;
|
|
112
|
-
interface TreeRootProps<T> {
|
|
113
|
-
/** Root nodes. Top-level items are rendered directly (no synthetic root). */
|
|
114
|
-
data: TreeNode<T>[];
|
|
115
|
-
/** Returns the human-readable name for a node (used by search/type-ahead). */
|
|
116
|
-
getItemName: (node: TreeNode<T>) => string;
|
|
117
|
-
/** Async loader for folders without inline `children`. */
|
|
118
|
-
loadChildren?: TreeLoadChildren<T>;
|
|
119
|
-
/** Selection behaviour. Default: `'single'`. */
|
|
120
|
-
selectionMode?: TreeSelectionMode;
|
|
121
|
-
/** Initially expanded ids. */
|
|
122
|
-
initialExpandedIds?: TreeItemId[];
|
|
123
|
-
/** Initially selected ids. */
|
|
124
|
-
initialSelectedIds?: TreeItemId[];
|
|
125
|
-
/** Pixels of indent per nesting level. Default: 16. (Shortcut for `appearance.indent`.) */
|
|
126
|
-
indent?: number;
|
|
127
|
-
/** Cosmetic configuration: density, sizes, accent intensity, radius. */
|
|
128
|
-
appearance?: TreeAppearance;
|
|
129
|
-
/** Triggered when selection changes. */
|
|
130
|
-
onSelectionChange?: (selectedIds: TreeItemId[]) => void;
|
|
131
|
-
/** Triggered when expanded set changes. */
|
|
132
|
-
onExpansionChange?: (expandedIds: TreeItemId[]) => void;
|
|
133
|
-
/** Enter / dblclick on a node. */
|
|
134
|
-
onActivate?: (node: TreeNode<T>) => void;
|
|
135
|
-
/** Show built-in search input. Default: false. */
|
|
136
|
-
enableSearch?: boolean;
|
|
137
|
-
/** Type printable letters to jump to a matching name. Default: true. */
|
|
138
|
-
enableTypeAhead?: boolean;
|
|
139
|
-
/** Render vertical indent guides under expanded folders. Default: false. */
|
|
140
|
-
showIndentGuides?: boolean;
|
|
141
|
-
/** Custom row renderer. Falls back to the default <TreeRow />. */
|
|
142
|
-
renderRow?: TreeRowSlot<T>;
|
|
143
|
-
/** Replace default folder/file icon. */
|
|
144
|
-
renderIcon?: TreeRowSlot<T>;
|
|
145
|
-
/** Replace default label rendering. */
|
|
146
|
-
renderLabel?: TreeRowSlot<T>;
|
|
147
|
-
/** Right-side actions slot (per row). */
|
|
148
|
-
renderActions?: TreeRowSlot<T>;
|
|
149
|
-
/** Wrap each row in a context menu (right-click). Receives the row meta + trigger element. */
|
|
150
|
-
renderContextMenu?: TreeContextMenuSlot<T>;
|
|
151
|
-
/** Override built-in copy in your locale. */
|
|
152
|
-
labels?: Partial<TreeLabels>;
|
|
153
|
-
/** Persist expanded + (optional) selected ids in localStorage under this key. */
|
|
154
|
-
persistKey?: string;
|
|
155
|
-
/** Persist selection alongside expansion. Default: false. */
|
|
156
|
-
persistSelection?: boolean;
|
|
157
|
-
className?: string;
|
|
158
|
-
style?: React.CSSProperties;
|
|
159
|
-
}
|
|
160
|
-
/** Internal flat-row representation used by the renderer + keyboard nav. */
|
|
161
|
-
interface FlatRow<T> {
|
|
162
|
-
node: TreeNode<T>;
|
|
163
|
-
level: number;
|
|
164
|
-
parentId: TreeItemId | null;
|
|
165
|
-
isFolder: boolean;
|
|
166
|
-
isExpanded: boolean;
|
|
167
|
-
isLoading: boolean;
|
|
168
|
-
hasError: boolean;
|
|
169
|
-
}
|
|
170
5
|
|
|
171
6
|
/**
|
|
172
7
|
* High-level entry point. Wraps Provider + (optional) search bar + content.
|
|
@@ -218,13 +53,14 @@ interface TreeContextValue<T> {
|
|
|
218
53
|
setQuery: (q: string) => void;
|
|
219
54
|
refresh: (id: TreeItemId) => Promise<void>;
|
|
220
55
|
refreshAll: () => Promise<void>;
|
|
221
|
-
activate: (node: TreeNode<T
|
|
56
|
+
activate: (node: TreeNode<T>, opts?: TreeActivateOptions) => void;
|
|
222
57
|
labels: TreeLabels;
|
|
223
58
|
/** Resolved cosmetic config — never null. */
|
|
224
59
|
appearance: ResolvedAppearance;
|
|
225
60
|
/** Convenience alias for `appearance.indent`. */
|
|
226
61
|
indent: number;
|
|
227
62
|
selectionMode: TreeSelectionMode;
|
|
63
|
+
activationMode: TreeActivationMode;
|
|
228
64
|
enableSearch: boolean;
|
|
229
65
|
showIndentGuides: boolean;
|
|
230
66
|
getItemName: (node: TreeNode<T>) => string;
|
|
@@ -234,7 +70,7 @@ interface TreeContextValue<T> {
|
|
|
234
70
|
renderContextMenu?: TreeContextMenuSlot<T>;
|
|
235
71
|
}
|
|
236
72
|
declare function useTreeContext<T>(): TreeContextValue<T>;
|
|
237
|
-
interface TreeProviderProps<T> extends Pick<TreeRootProps<T>, 'data' | 'getItemName' | 'loadChildren' | 'selectionMode' | 'initialExpandedIds' | 'initialSelectedIds' | 'indent' | 'appearance' | 'onSelectionChange' | 'onExpansionChange' | 'onActivate' | 'enableSearch' | 'showIndentGuides' | 'renderIcon' | 'renderLabel' | 'renderActions' | 'renderContextMenu' | 'labels' | 'persistKey' | 'persistSelection'> {
|
|
73
|
+
interface TreeProviderProps<T> extends Pick<TreeRootProps<T>, 'data' | 'getItemName' | 'loadChildren' | 'selectionMode' | 'activationMode' | 'initialExpandedIds' | 'initialSelectedIds' | 'indent' | 'appearance' | 'onSelectionChange' | 'onExpansionChange' | 'onActivate' | 'filterNode' | 'enableSearch' | 'showIndentGuides' | 'renderIcon' | 'renderLabel' | 'renderActions' | 'renderContextMenu' | 'labels' | 'persistKey' | 'persistSelection'> {
|
|
238
74
|
children: React$1.ReactNode;
|
|
239
75
|
}
|
|
240
76
|
declare function TreeProvider<T>(props: TreeProviderProps<T>): react_jsx_runtime.JSX.Element;
|
|
@@ -276,7 +112,7 @@ declare function useTreeActions<T>(): {
|
|
|
276
112
|
collapseAll: () => void;
|
|
277
113
|
refresh: (id: TreeItemId) => Promise<void>;
|
|
278
114
|
refreshAll: () => Promise<void>;
|
|
279
|
-
activate: (node: TreeNode<T
|
|
115
|
+
activate: (node: TreeNode<T>, opts?: TreeActivateOptions) => void;
|
|
280
116
|
};
|
|
281
117
|
|
|
282
118
|
interface UseTreeTypeAheadOptions<T> {
|
|
@@ -405,6 +241,8 @@ interface FlattenInput<T> {
|
|
|
405
241
|
roots: TreeNode<T>[];
|
|
406
242
|
expandedIds: ReadonlySet<TreeItemId>;
|
|
407
243
|
cache: ChildCache<T>;
|
|
244
|
+
/** Optional predicate. Nodes returning `false` (and their descendants) are excluded. */
|
|
245
|
+
filterNode?: (node: TreeNode<T>) => boolean;
|
|
408
246
|
}
|
|
409
247
|
/**
|
|
410
248
|
* Walk the tree top-to-bottom and produce a flat list of visible rows.
|
|
@@ -413,7 +251,7 @@ interface FlattenInput<T> {
|
|
|
413
251
|
* `expandedIds`. The output is ordered exactly as it should render,
|
|
414
252
|
* which keeps keyboard navigation (next/prev row) trivial.
|
|
415
253
|
*/
|
|
416
|
-
declare function flattenTree<T>({ roots, expandedIds, cache }: FlattenInput<T>): FlatRow<T>[];
|
|
254
|
+
declare function flattenTree<T>({ roots, expandedIds, cache, filterNode, }: FlattenInput<T>): FlatRow<T>[];
|
|
417
255
|
|
|
418
256
|
interface PersistedTreeState {
|
|
419
257
|
expandedItems: TreeItemId[];
|
|
@@ -439,4 +277,4 @@ declare function createDemoTree({ depth, breadth, rootPrefix, }?: {
|
|
|
439
277
|
rootPrefix?: string;
|
|
440
278
|
}): TreeNode<DemoNode>[];
|
|
441
279
|
|
|
442
|
-
export { type ChildCache, type ChildEntry, type ChildEntryStatus,
|
|
280
|
+
export { type ChildCache, type ChildEntry, type ChildEntryStatus, type DemoNode, FlatRow, type FlattenInput, type PersistedTreeState, ResolvedAppearance, TreeRoot as Tree, TreeActivateOptions, TreeActivationMode, TreeChevron, type TreeChevronProps, TreeContent, type TreeContentProps, TreeContextMenuSlot, type TreeContextValue, TreeEmpty, type TreeEmptyProps, TreeError, type TreeErrorProps, TreeIcon, type TreeIconProps, TreeIndentGuides, type TreeIndentGuidesProps, TreeItemId, TreeLabel, type TreeLabelProps, TreeLabels, TreeNode, TreeProvider, type TreeProviderProps, TreeRoot, TreeRootProps, TreeRow, type TreeRowProps, TreeRowSlot, TreeSearchInput, type TreeSearchInputProps, TreeSelectionMode, TreeSkeleton, type TreeSkeletonProps, type UseTreeKeyboardOptions, type UseTreeTypeAheadOptions, clearTreeState, createChildCache, createDemoTree, TreeRoot as default, flattenTree, loadTreeState, resolveChildren, saveTreeState, useTreeActions, useTreeContext, useTreeExpansion, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead };
|