@sanity/hierarchical-document-list 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +365 -297
  3. package/dist/index.d.ts +240 -0
  4. package/dist/index.esm.js +18 -0
  5. package/dist/index.esm.js.map +1 -0
  6. package/dist/index.js +18 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +94 -55
  9. package/sanity.json +8 -12
  10. package/src/TreeDeskStructure.tsx +80 -0
  11. package/src/TreeInputComponent.tsx +41 -0
  12. package/src/components/DeskWarning.tsx +40 -0
  13. package/src/components/DocumentInNode.tsx +133 -0
  14. package/src/components/DocumentPreviewStatus.tsx +70 -0
  15. package/src/components/NodeActions.tsx +85 -0
  16. package/src/components/NodeContentRenderer.tsx +141 -0
  17. package/src/components/PlaceholderDropzone.tsx +45 -0
  18. package/src/components/TreeEditor.tsx +167 -0
  19. package/src/components/TreeEditorErrorBoundary.tsx +14 -0
  20. package/src/components/TreeNodeRenderer.tsx +37 -0
  21. package/src/components/TreeNodeRendererScaffold.tsx +193 -0
  22. package/src/createDeskHierarchy.tsx +110 -0
  23. package/src/createHierarchicalSchemas.tsx +151 -0
  24. package/src/hooks/useAllItems.ts +119 -0
  25. package/src/hooks/useLocalTree.ts +40 -0
  26. package/src/hooks/useTreeOperations.ts +25 -0
  27. package/src/hooks/useTreeOperationsProvider.ts +86 -0
  28. package/src/index.ts +25 -0
  29. package/src/schemas/hierarchy.tree.ts +19 -0
  30. package/src/types.ts +148 -0
  31. package/src/utils/flatDataToTree.ts +20 -0
  32. package/src/utils/getAdjescentNodes.ts +30 -0
  33. package/src/utils/getCommonTreeProps.tsx +28 -0
  34. package/src/utils/getTreeHeight.ts +10 -0
  35. package/src/utils/gradientPatchAdapter.ts +43 -0
  36. package/src/utils/idUtils.ts +7 -0
  37. package/src/utils/injectNodeTypeInPatches.ts +60 -0
  38. package/src/utils/moveItemInArray.ts +26 -0
  39. package/src/utils/throwError.ts +9 -0
  40. package/src/utils/treeData.tsx +119 -0
  41. package/src/utils/treePatches.ts +171 -0
  42. package/v2-incompatible.js +11 -0
  43. package/lib/TreeDeskStructure.d.ts +0 -8
  44. package/lib/TreeDeskStructure.js +0 -96
  45. package/lib/TreeInputComponent.d.ts +0 -19
  46. package/lib/TreeInputComponent.js +0 -52
  47. package/lib/components/DeskWarning.d.ts +0 -6
  48. package/lib/components/DeskWarning.js +0 -46
  49. package/lib/components/DocumentInNode.d.ts +0 -11
  50. package/lib/components/DocumentInNode.js +0 -82
  51. package/lib/components/DocumentPreviewStatus.d.ts +0 -7
  52. package/lib/components/DocumentPreviewStatus.js +0 -39
  53. package/lib/components/NodeActions.d.ts +0 -10
  54. package/lib/components/NodeActions.js +0 -61
  55. package/lib/components/NodeContentRenderer.d.ts +0 -8
  56. package/lib/components/NodeContentRenderer.js +0 -105
  57. package/lib/components/PlaceholderDropzone.d.ts +0 -9
  58. package/lib/components/PlaceholderDropzone.js +0 -30
  59. package/lib/components/TreeEditor.d.ts +0 -12
  60. package/lib/components/TreeEditor.js +0 -59
  61. package/lib/components/TreeEditorErrorBoundary.d.ts +0 -3
  62. package/lib/components/TreeEditorErrorBoundary.js +0 -59
  63. package/lib/components/TreeNodeRenderer.d.ts +0 -3
  64. package/lib/components/TreeNodeRenderer.js +0 -59
  65. package/lib/components/TreeNodeRendererScaffold.d.ts +0 -4
  66. package/lib/components/TreeNodeRendererScaffold.js +0 -44
  67. package/lib/createDeskHierarchy.d.ts +0 -14
  68. package/lib/createDeskHierarchy.js +0 -85
  69. package/lib/createHierarchicalSchemas.d.ts +0 -78
  70. package/lib/createHierarchicalSchemas.js +0 -138
  71. package/lib/hooks/useAllItems.d.ts +0 -7
  72. package/lib/hooks/useAllItems.js +0 -119
  73. package/lib/hooks/useLocalTree.d.ts +0 -17
  74. package/lib/hooks/useLocalTree.js +0 -59
  75. package/lib/hooks/useTreeOperations.d.ts +0 -9
  76. package/lib/hooks/useTreeOperations.js +0 -39
  77. package/lib/hooks/useTreeOperationsProvider.d.ts +0 -14
  78. package/lib/hooks/useTreeOperationsProvider.js +0 -85
  79. package/lib/index.d.ts +0 -3
  80. package/lib/index.js +0 -12
  81. package/lib/schemas/hierarchy.tree.d.ts +0 -13
  82. package/lib/schemas/hierarchy.tree.js +0 -19
  83. package/lib/utils/flatDataToTree.d.ts +0 -6
  84. package/lib/utils/flatDataToTree.js +0 -26
  85. package/lib/utils/getAdjescentNodes.d.ts +0 -12
  86. package/lib/utils/getAdjescentNodes.js +0 -19
  87. package/lib/utils/getCommonTreeProps.d.ts +0 -7
  88. package/lib/utils/getCommonTreeProps.js +0 -33
  89. package/lib/utils/getTreeHeight.d.ts +0 -3
  90. package/lib/utils/getTreeHeight.js +0 -11
  91. package/lib/utils/gradientPatchAdapter.d.ts +0 -4
  92. package/lib/utils/gradientPatchAdapter.js +0 -42
  93. package/lib/utils/idUtils.d.ts +0 -2
  94. package/lib/utils/idUtils.js +0 -13
  95. package/lib/utils/injectNodeTypeInPatches.d.ts +0 -12
  96. package/lib/utils/injectNodeTypeInPatches.js +0 -58
  97. package/lib/utils/moveItemInArray.d.ts +0 -5
  98. package/lib/utils/moveItemInArray.js +0 -26
  99. package/lib/utils/throwError.d.ts +0 -7
  100. package/lib/utils/throwError.js +0 -12
  101. package/lib/utils/treeData.d.ts +0 -18
  102. package/lib/utils/treeData.js +0 -118
  103. package/lib/utils/treePatches.d.ts +0 -15
  104. package/lib/utils/treePatches.js +0 -171
  105. package/screenshot-1.jpg +0 -0
  106. package/tsconfig.json +0 -20
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import { TreeDeskStructureProps } from './types';
3
- interface ComponentProps {
4
- options: TreeDeskStructureProps;
5
- }
6
- export declare const DEFAULT_FIELD_KEY = "tree";
7
- declare const TreeDeskStructure: React.FC<ComponentProps>;
8
- export default TreeDeskStructure;
@@ -1,96 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
- var __rest = (this && this.__rest) || function (s, e) {
33
- var t = {};
34
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
35
- t[p] = s[p];
36
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
37
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
38
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
39
- t[p[i]] = s[p[i]];
40
- }
41
- return t;
42
- };
43
- var __importDefault = (this && this.__importDefault) || function (mod) {
44
- return (mod && mod.__esModule) ? mod : { "default": mod };
45
- };
46
- Object.defineProperty(exports, "__esModule", { value: true });
47
- exports.DEFAULT_FIELD_KEY = void 0;
48
- var jsx_runtime_1 = require("react/jsx-runtime");
49
- var icons_1 = require("@sanity/icons");
50
- var react_hooks_1 = require("@sanity/react-hooks");
51
- var ui_1 = require("@sanity/ui");
52
- var React = __importStar(require("react"));
53
- var DeskWarning_1 = __importDefault(require("./components/DeskWarning"));
54
- var TreeEditor_1 = __importDefault(require("./components/TreeEditor"));
55
- var gradientPatchAdapter_1 = require("./utils/gradientPatchAdapter");
56
- var injectNodeTypeInPatches_1 = __importStar(require("./utils/injectNodeTypeInPatches"));
57
- exports.DEFAULT_FIELD_KEY = 'tree';
58
- var TreeDeskStructure = function (props) {
59
- var treeDocType = props.options.documentType || injectNodeTypeInPatches_1.DEFAULT_DOC_TYPE;
60
- var treeFieldKey = props.options.fieldKeyInDocument || exports.DEFAULT_FIELD_KEY;
61
- var _a = (0, react_hooks_1.useEditState)(props.options.documentId, treeDocType), published = _a.published, draft = _a.draft, liveEdit = _a.liveEdit;
62
- var _b = (0, react_hooks_1.useDocumentOperation)(props.options.documentId, treeDocType), patch = _b.patch, ops = __rest(_b, ["patch"]);
63
- var push = (0, ui_1.useToast)().push;
64
- var treeValue = ((published === null || published === void 0 ? void 0 : published[treeFieldKey]) || []);
65
- var handleChange = React.useCallback(function (patchEvent) {
66
- if (!(patch === null || patch === void 0 ? void 0 : patch.execute)) {
67
- return;
68
- }
69
- patch.execute((0, gradientPatchAdapter_1.toGradient)((0, injectNodeTypeInPatches_1.default)(patchEvent.patches, treeDocType)));
70
- }, [patch]);
71
- React.useEffect(function () {
72
- var _a;
73
- if (!(published === null || published === void 0 ? void 0 : published._id) && (patch === null || patch === void 0 ? void 0 : patch.execute) && !(patch === null || patch === void 0 ? void 0 : patch.disabled)) {
74
- // If no published document, create it
75
- patch.execute([{ setIfMissing: (_a = {}, _a[treeFieldKey] = [], _a) }]);
76
- }
77
- }, [published === null || published === void 0 ? void 0 : published._id, patch]);
78
- if (!liveEdit) {
79
- return ((0, jsx_runtime_1.jsx)(DeskWarning_1.default, { title: "Invalid configuration", subtitle: "The `documentType` passed to `createDeskHiearchy` isn't live editable. \\nTo continue using this plugin, add `liveEdit: true` to your custom schema type or unset `documentType` in your hierarchy configuration." }, void 0));
80
- }
81
- if (draft === null || draft === void 0 ? void 0 : draft._id) {
82
- return ((0, jsx_runtime_1.jsx)(DeskWarning_1.default, __assign({ title: "This hierarchy tree contains a draft", subtitle: "Click on the button below to publish your draft in order to continue editing the live\n published document." }, { children: (0, jsx_runtime_1.jsx)(ui_1.Button, { fontSize: 1, tone: "positive", text: "Publish draft", icon: icons_1.PublishIcon, onClick: function () {
83
- var _a, _b;
84
- (_b = (_a = ops.publish) === null || _a === void 0 ? void 0 : _a.execute) === null || _b === void 0 ? void 0 : _b.call(_a);
85
- push({
86
- status: 'info',
87
- title: 'Publishing draft...'
88
- });
89
- } }, void 0) }), void 0));
90
- }
91
- if (!(published === null || published === void 0 ? void 0 : published._id)) {
92
- return ((0, jsx_runtime_1.jsx)(ui_1.Flex, __assign({ padding: 5, align: 'center', justify: 'center', height: 'fill' }, { children: (0, jsx_runtime_1.jsx)(ui_1.Spinner, { width: 4, muted: true }, void 0) }), void 0));
93
- }
94
- return ((0, jsx_runtime_1.jsx)(ui_1.Box, __assign({ paddingBottom: 5, paddingRight: 2 }, { children: (0, jsx_runtime_1.jsx)(TreeEditor_1.default, { options: props.options, tree: treeValue, onChange: handleChange, patchPrefix: treeFieldKey }, void 0) }), void 0));
95
- };
96
- exports.default = TreeDeskStructure;
@@ -1,19 +0,0 @@
1
- import { FormFieldPresence } from '@sanity/base/presence';
2
- import { Marker, Path } from '@sanity/types';
3
- import * as React from 'react';
4
- import { StoredTreeItem, TreeFieldSchema } from './types';
5
- export interface TreeInputComponentProps {
6
- type: TreeFieldSchema;
7
- value: StoredTreeItem[];
8
- compareValue: StoredTreeItem[];
9
- markers: Marker[];
10
- level: number;
11
- onChange: (event: unknown) => void;
12
- onFocus: (path: Path) => void;
13
- onBlur: () => void;
14
- focusPath: Path;
15
- readOnly: boolean;
16
- presence: FormFieldPresence[];
17
- }
18
- declare const TreeInputComponent: React.FC<TreeInputComponentProps>;
19
- export default TreeInputComponent;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
- var __importDefault = (this && this.__importDefault) || function (mod) {
33
- return (mod && mod.__esModule) ? mod : { "default": mod };
34
- };
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- var jsx_runtime_1 = require("react/jsx-runtime");
37
- var components_1 = require("@sanity/base/components");
38
- var PatchEvent_1 = __importDefault(require("@sanity/form-builder/PatchEvent"));
39
- var React = __importStar(require("react"));
40
- var TreeEditor_1 = __importDefault(require("./components/TreeEditor"));
41
- var injectNodeTypeInPatches_1 = __importStar(require("./utils/injectNodeTypeInPatches"));
42
- var TreeInputComponent = React.forwardRef(function (props) {
43
- var documentType = props.type.options.documentType || injectNodeTypeInPatches_1.DEFAULT_DOC_TYPE;
44
- var onChange = React.useCallback(function (patch) {
45
- var patches = (0, injectNodeTypeInPatches_1.default)(patch === null || patch === void 0 ? void 0 : patch.patches, documentType);
46
- props.onChange(new PatchEvent_1.default(patches));
47
- }, [props.onChange]);
48
- return ((0, jsx_runtime_1.jsx)(components_1.FormField, __assign({ description: props.type.description, title: props.type.title, __unstable_markers: props.markers, __unstable_presence: props.presence,
49
- // @ts-expect-error FormField's TS definitions are off - it doesn't include compareValue
50
- compareValue: props.compareValue }, { children: (0, jsx_runtime_1.jsx)(TreeEditor_1.default, { options: props.type.options, tree: props.value || [], onChange: onChange }, void 0) }), void 0));
51
- });
52
- exports.default = TreeInputComponent;
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- declare const DeskWarning: React.FC<{
3
- title: string;
4
- subtitle?: string;
5
- }>;
6
- export default DeskWarning;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
- Object.defineProperty(exports, "__esModule", { value: true });
33
- var jsx_runtime_1 = require("react/jsx-runtime");
34
- var ui_1 = require("@sanity/ui");
35
- var React = __importStar(require("react"));
36
- // React component that wraps text between two delimiters in a <pre> tag
37
- var WrapCodeBlocks = function (_a) {
38
- var text = _a.text;
39
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: text.split('`').map(function (part, i) { return ((0, jsx_runtime_1.jsx)(React.Fragment, { children: i % 2 === 0 ? part : (0, jsx_runtime_1.jsx)("code", { children: part }, void 0) }, i)); }) }, void 0));
40
- };
41
- var DeskWarning = function (_a) {
42
- var subtitle = _a.subtitle, title = _a.title, children = _a.children;
43
- return ((0, jsx_runtime_1.jsx)(ui_1.Container, __assign({ padding: 5, style: { maxWidth: '25rem' }, sizing: 'content' }, { children: (0, jsx_runtime_1.jsx)(ui_1.Card, __assign({ padding: 4, border: true, radius: 2, width: 0, tone: "caution" }, { children: (0, jsx_runtime_1.jsxs)(ui_1.Stack, __assign({ space: 3 }, { children: [(0, jsx_runtime_1.jsx)(ui_1.Heading, __assign({ size: 1 }, { children: title }), void 0), subtitle &&
44
- subtitle.split('\\n').map(function (line) { return ((0, jsx_runtime_1.jsx)(ui_1.Text, __assign({ size: 1 }, { children: (0, jsx_runtime_1.jsx)(WrapCodeBlocks, { text: line }, void 0) }), void 0)); }), children && (0, jsx_runtime_1.jsx)(ui_1.Box, __assign({ marginTop: 2 }, { children: children }), void 0)] }), void 0) }), void 0) }), void 0));
45
- };
46
- exports.default = DeskWarning;
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- import { LocalTreeItem } from '../types';
3
- /**
4
- * Renders a preview for each referenced document.
5
- * Nested inside TreeNode.tsx
6
- */
7
- declare const DocumentInNode: React.FC<{
8
- item: LocalTreeItem;
9
- action?: React.ReactNode;
10
- }>;
11
- export default DocumentInNode;
@@ -1,82 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
- var __importDefault = (this && this.__importDefault) || function (mod) {
33
- return (mod && mod.__esModule) ? mod : { "default": mod };
34
- };
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- var jsx_runtime_1 = require("react/jsx-runtime");
37
- var components_1 = require("@sanity/base/components");
38
- var desk_tool_1 = require("@sanity/desk-tool");
39
- var icons_1 = require("@sanity/icons");
40
- var ui_1 = require("@sanity/ui");
41
- var preview_1 = __importDefault(require("part:@sanity/base/preview"));
42
- var schema_1 = __importDefault(require("part:@sanity/base/schema"));
43
- var React = __importStar(require("react"));
44
- var useTreeOperations_1 = __importDefault(require("../hooks/useTreeOperations"));
45
- var DocumentPreviewStatus_1 = __importDefault(require("./DocumentPreviewStatus"));
46
- /**
47
- * Renders a preview for each referenced document.
48
- * Nested inside TreeNode.tsx
49
- */
50
- var DocumentInNode = function (props) {
51
- var _a = props.item, _b = _a.value, _c = _b === void 0 ? {} : _b, reference = _c.reference, docType = _c.docType, draftId = _a.draftId, publishedId = _a.publishedId;
52
- var _d = (0, desk_tool_1.usePaneRouter)(), routerPanesState = _d.routerPanesState, ChildLink = _d.ChildLink;
53
- var allItemsStatus = (0, useTreeOperations_1.default)().allItemsStatus;
54
- var isActive = React.useMemo(function () {
55
- // If some pane is active with the current document `_id`, it's active
56
- return routerPanesState.some(function (pane) { return pane.some(function (group) { return group.id === (reference === null || reference === void 0 ? void 0 : reference._ref); }); });
57
- }, [routerPanesState]);
58
- var schemaType = React.useMemo(function () { return schema_1.default.get(docType); }, [docType]);
59
- var LinkComponent = React.useMemo(function () {
60
- // eslint-disable-next-line @typescript-eslint/no-shadow
61
- return React.forwardRef(function (linkProps, ref) { return ((0, jsx_runtime_1.jsx)(ChildLink, __assign({}, linkProps, { childId: reference === null || reference === void 0 ? void 0 : reference._ref, ref: ref, childParameters: {
62
- type: docType
63
- } }), void 0)); });
64
- }, [ChildLink, reference === null || reference === void 0 ? void 0 : reference._ref]);
65
- if (!(reference === null || reference === void 0 ? void 0 : reference._ref)) {
66
- return null;
67
- }
68
- return ((0, jsx_runtime_1.jsxs)(ui_1.Flex, __assign({ gap: 2, align: "center", style: { flex: 1 } }, { children: [publishedId || allItemsStatus !== 'success' ? (
69
- /* Card loosely copied from @sanity/desk-tool's PaneItem.tsx */
70
- (0, jsx_runtime_1.jsx)(ui_1.Card, __assign({ __unstable_focusRing: true, as: LinkComponent, tone: isActive ? 'primary' : 'default', padding: 1, radius: 2, flex: 1, "data-as": "a", "data-ui": "PaneItem" }, { children: (0, jsx_runtime_1.jsx)(preview_1.default, { layout: "default", type: schemaType, value: { _ref: draftId || (reference === null || reference === void 0 ? void 0 : reference._ref) }, status: (0, jsx_runtime_1.jsx)(DocumentPreviewStatus_1.default, { draft: draftId
71
- ? {
72
- _id: draftId,
73
- _type: docType,
74
- _updatedAt: props.item.draftUpdatedAt
75
- }
76
- : undefined, published: {
77
- _id: reference === null || reference === void 0 ? void 0 : reference._ref,
78
- _type: docType,
79
- _updatedAt: props.item.publishedUpdatedAt
80
- } }, void 0) }, void 0) }), void 0)) : ((0, jsx_runtime_1.jsx)(ui_1.Card, __assign({ padding: 3, radius: 1, flex: 1 }, { children: (0, jsx_runtime_1.jsxs)(ui_1.Flex, __assign({ align: "center" }, { children: [(0, jsx_runtime_1.jsx)(ui_1.Text, __assign({ size: 2, muted: true, style: { flex: 1 } }, { children: "Invalid document" }), void 0), (0, jsx_runtime_1.jsx)(ui_1.Tooltip, __assign({ placement: "left", portal: true, content: (0, jsx_runtime_1.jsx)(ui_1.Box, __assign({ padding: 3 }, { children: (0, jsx_runtime_1.jsxs)(ui_1.Flex, __assign({ align: "flex-start", gap: 3 }, { children: [(0, jsx_runtime_1.jsx)(components_1.TextWithTone, __assign({ tone: "default", size: 3 }, { children: (0, jsx_runtime_1.jsx)(icons_1.HelpCircleIcon, {}, void 0) }), void 0), (0, jsx_runtime_1.jsxs)(ui_1.Stack, __assign({ space: 3 }, { children: [(0, jsx_runtime_1.jsx)(ui_1.Text, __assign({ as: "h2", size: 1, weight: "semibold" }, { children: "This document is not valid" }), void 0), (0, jsx_runtime_1.jsxs)(ui_1.Text, __assign({ size: 1 }, { children: ["ID: ", reference === null || reference === void 0 ? void 0 : reference._ref] }), void 0)] }), void 0)] }), void 0) }), void 0) }, { children: (0, jsx_runtime_1.jsx)(components_1.TextWithTone, __assign({ tone: "default", size: 2 }, { children: (0, jsx_runtime_1.jsx)(icons_1.HelpCircleIcon, {}, void 0) }), void 0) }), void 0)] }), void 0) }), void 0)), props.action] }), void 0));
81
- };
82
- exports.default = DocumentInNode;
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- import { DocumentPair } from '../types';
3
- export declare function TimeAgo({ time }: {
4
- time: string | Date;
5
- }): JSX.Element;
6
- declare const DocumentPreviewStatus: React.FC<DocumentPair>;
7
- export default DocumentPreviewStatus;
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.TimeAgo = void 0;
15
- var jsx_runtime_1 = require("react/jsx-runtime");
16
- var components_1 = require("@sanity/base/components");
17
- var hooks_1 = require("@sanity/base/hooks");
18
- var icons_1 = require("@sanity/icons");
19
- var ui_1 = require("@sanity/ui");
20
- function TimeAgo(_a) {
21
- var time = _a.time;
22
- var timeAgo = (0, hooks_1.useTimeAgo)(time);
23
- return ((0, jsx_runtime_1.jsxs)("span", __assign({ title: timeAgo }, { children: [timeAgo, timeAgo.toLowerCase().trim().startsWith('just now') ? '' : ' ago'] }), void 0));
24
- }
25
- exports.TimeAgo = TimeAgo;
26
- var PublishedStatus = function (_a) {
27
- var document = _a.document;
28
- return ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, __assign({ portal: true, content: (0, jsx_runtime_1.jsx)(ui_1.Box, __assign({ padding: 2 }, { children: (0, jsx_runtime_1.jsx)(ui_1.Text, __assign({ size: 1 }, { children: document ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Published ", document._updatedAt && (0, jsx_runtime_1.jsx)(TimeAgo, { time: document._updatedAt }, void 0)] }, void 0)) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Not published" }, void 0)) }), void 0) }), void 0) }, { children: (0, jsx_runtime_1.jsx)(components_1.TextWithTone, __assign({ tone: "positive", dimmed: !document, muted: !document, size: 1 }, { children: (0, jsx_runtime_1.jsx)(icons_1.PublishIcon, {}, void 0) }), void 0) }), void 0));
29
- };
30
- var DraftStatus = function (_a) {
31
- var document = _a.document;
32
- return ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, __assign({ portal: true, content: (0, jsx_runtime_1.jsx)(ui_1.Box, __assign({ padding: 2 }, { children: (0, jsx_runtime_1.jsx)(ui_1.Text, __assign({ size: 1 }, { children: document ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Edited ", (document === null || document === void 0 ? void 0 : document._updatedAt) && (0, jsx_runtime_1.jsx)(TimeAgo, { time: document === null || document === void 0 ? void 0 : document._updatedAt }, void 0)] }, void 0)) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "No unpublished edits" }, void 0)) }), void 0) }), void 0) }, { children: (0, jsx_runtime_1.jsx)(components_1.TextWithTone, __assign({ tone: "caution", dimmed: !document, muted: !document, size: 1 }, { children: (0, jsx_runtime_1.jsx)(icons_1.EditIcon, {}, void 0) }), void 0) }), void 0));
33
- };
34
- // Adapted from @sanity\desk-tool\src\components\paneItem\helpers.tsx
35
- var DocumentPreviewStatus = function (_a) {
36
- var draft = _a.draft, published = _a.published;
37
- return ((0, jsx_runtime_1.jsxs)(ui_1.Inline, __assign({ space: 4 }, { children: [(0, jsx_runtime_1.jsx)(PublishedStatus, { document: published }, void 0), (0, jsx_runtime_1.jsx)(DraftStatus, { document: draft }, void 0)] }), void 0));
38
- };
39
- exports.default = DocumentPreviewStatus;
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- import { NodeProps } from '../types';
3
- /**
4
- * Applicable only to nodes inside the main tree.
5
- * Unadded items have their actions defined in TreeEditor.
6
- */
7
- declare const NodeActions: React.FC<{
8
- nodeProps: NodeProps;
9
- }>;
10
- export default NodeActions;
@@ -1,61 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
- var __importDefault = (this && this.__importDefault) || function (mod) {
33
- return (mod && mod.__esModule) ? mod : { "default": mod };
34
- };
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- var jsx_runtime_1 = require("react/jsx-runtime");
37
- var components_1 = require("@sanity/base/components");
38
- var icons_1 = require("@sanity/icons");
39
- var ui_1 = require("@sanity/ui");
40
- var React = __importStar(require("react"));
41
- var useTreeOperations_1 = __importDefault(require("../hooks/useTreeOperations"));
42
- /**
43
- * Applicable only to nodes inside the main tree.
44
- * Unadded items have their actions defined in TreeEditor.
45
- */
46
- var NodeActions = function (_a) {
47
- var nodeProps = _a.nodeProps;
48
- var operations = (0, useTreeOperations_1.default)();
49
- var node = nodeProps.node;
50
- var _b = (node === null || node === void 0 ? void 0 : node.value) || {}, reference = _b.reference, docType = _b.docType;
51
- // Adapted from @sanity\form-builder\src\inputs\ReferenceInput\ArrayItemReferenceInput.tsx
52
- var OpenLink = React.useMemo(function () {
53
- // eslint-disable-next-line @typescript-eslint/no-shadow
54
- return React.forwardRef(function OpenLinkInner(restProps, _ref) {
55
- return ((0, jsx_runtime_1.jsx)(components_1.IntentLink, __assign({}, restProps, { intent: "edit", params: { id: reference === null || reference === void 0 ? void 0 : reference._ref, type: docType }, target: "_blank", rel: "noopener noreferrer", ref: _ref }), void 0));
56
- });
57
- }, [reference === null || reference === void 0 ? void 0 : reference._ref, docType]);
58
- var isValid = !!node.publishedId;
59
- return ((0, jsx_runtime_1.jsx)(ui_1.MenuButton, { button: (0, jsx_runtime_1.jsx)(ui_1.Button, { padding: 2, mode: "bleed", icon: icons_1.EllipsisVerticalIcon }, void 0), id: "hiearchical-doc-list--".concat(node._key, "-menuButton"), menu: (0, jsx_runtime_1.jsxs)(ui_1.Menu, { children: [(0, jsx_runtime_1.jsx)(ui_1.MenuItem, { text: "Remove from list", tone: "critical", icon: icons_1.RemoveCircleIcon, onClick: function () { return operations.removeItem(nodeProps); } }, void 0), (0, jsx_runtime_1.jsx)(ui_1.MenuItem, { text: "Duplicate item", icon: icons_1.CopyIcon, disabled: !isValid, onClick: function () { return operations.duplicateItem(nodeProps); } }, void 0), (0, jsx_runtime_1.jsx)(ui_1.MenuDivider, {}, void 0), (0, jsx_runtime_1.jsx)(ui_1.MenuItem, { text: "Open in new tab", icon: icons_1.LaunchIcon, disabled: !isValid, as: OpenLink, "data-as": "a" }, void 0)] }, void 0), placement: "right", popover: { portal: true, tone: 'default' } }, void 0));
60
- };
61
- exports.default = NodeActions;
@@ -1,8 +0,0 @@
1
- import { NodeRenderer } from 'react-sortable-tree';
2
- /**
3
- * Customization of react-sortable-tree's default node.
4
- * Created in order to use Sanity UI for styles.
5
- * Reference: https://github.com/frontend-collective/react-sortable-tree/blob/master/src/node-renderer-default.js
6
- */
7
- declare const NodeContentRenderer: NodeRenderer;
8
- export default NodeContentRenderer;
@@ -1,105 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __assign = (this && this.__assign) || function () {
7
- __assign = Object.assign || function(t) {
8
- for (var s, i = 1, n = arguments.length; i < n; i++) {
9
- s = arguments[i];
10
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
- t[p] = s[p];
12
- }
13
- return t;
14
- };
15
- return __assign.apply(this, arguments);
16
- };
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- var jsx_runtime_1 = require("react/jsx-runtime");
41
- var color_1 = require("@sanity/color");
42
- var icons_1 = require("@sanity/icons");
43
- var ui_1 = require("@sanity/ui");
44
- var React = __importStar(require("react"));
45
- var react_sortable_tree_1 = require("react-sortable-tree");
46
- var styled_components_1 = __importDefault(require("styled-components"));
47
- var Root = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Adapted from react-sortable-tree/style.css\n &[data-landing='true'] > *,\n &[data-cancel='true'] > * {\n opacity: 0 !important;\n }\n &[data-landing='true']::before,\n &[data-cancel='true']::before {\n background-color: ", ";\n border: 2px dashed ", ";\n border-radius: 3px;\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n }\n\n &[data-cancel='true']::before {\n background-color: ", ";\n }\n"], ["\n // Adapted from react-sortable-tree/style.css\n &[data-landing='true'] > *,\n &[data-cancel='true'] > * {\n opacity: 0 !important;\n }\n &[data-landing='true']::before,\n &[data-cancel='true']::before {\n background-color: ", ";\n border: 2px dashed ", ";\n border-radius: 3px;\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n }\n\n &[data-cancel='true']::before {\n background-color: ", ";\n }\n"
48
- /**
49
- * Customization of react-sortable-tree's default node.
50
- * Created in order to use Sanity UI for styles.
51
- * Reference: https://github.com/frontend-collective/react-sortable-tree/blob/master/src/node-renderer-default.js
52
- */
53
- ])), color_1.cyan[50].hex, color_1.gray[400].hex, color_1.red[50].hex);
54
- /**
55
- * Customization of react-sortable-tree's default node.
56
- * Created in order to use Sanity UI for styles.
57
- * Reference: https://github.com/frontend-collective/react-sortable-tree/blob/master/src/node-renderer-default.js
58
- */
59
- var NodeContentRenderer = function (props) {
60
- var node = props.node, path = props.path, treeIndex = props.treeIndex, _a = props.canDrag, canDrag = _a === void 0 ? false : _a;
61
- var nodeTitle = node.title;
62
- var Handle = React.useMemo(function () {
63
- if (!canDrag) {
64
- return null;
65
- }
66
- if (typeof node.children === 'function' && node.expanded) {
67
- // Show a loading symbol on the handle when the children are expanded
68
- // and yet still defined by a function (a callback to fetch the children)
69
- return (0, jsx_runtime_1.jsx)(ui_1.Spinner, {}, void 0);
70
- }
71
- var BtnElement = ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(ui_1.Button, __assign({ mode: "bleed", paddingX: 0, paddingY: 1, style: {
72
- cursor: node.publishedId ? 'grab' : 'default',
73
- fontSize: '1.5625rem'
74
- }, "data-ui": "DragHandleButton", "data-drag-handle": canDrag, disabled: !node.publishedId }, { children: (0, jsx_runtime_1.jsx)(icons_1.DragHandleIcon, { style: { marginBottom: '-0.1em' } }, void 0) }), void 0) }, void 0));
75
- // Don't allow editors to drag invalid documents
76
- if (!node.publishedId) {
77
- return BtnElement;
78
- }
79
- // Show the handle used to initiate a drag-and-drop
80
- return props.connectDragSource(BtnElement, {
81
- dropEffect: 'copy'
82
- });
83
- }, [canDrag, node, typeof node.children === 'function']);
84
- var isDraggedDescendant = props.draggedNode && (0, react_sortable_tree_1.isDescendant)(props.draggedNode, node);
85
- var isLandingPadActive = !props.didDrop && props.isDragging;
86
- return ((0, jsx_runtime_1.jsxs)(ui_1.Box, __assign({ style: { position: 'relative' } }, { children: [props.toggleChildrenVisibility &&
87
- node.children &&
88
- (node.children.length > 0 || typeof node.children === 'function') && ((0, jsx_runtime_1.jsx)("div", __assign({ style: {
89
- position: 'absolute',
90
- left: '-2px',
91
- top: '40%',
92
- transform: 'translate(-100%, -50%)'
93
- } }, { children: (0, jsx_runtime_1.jsx)(ui_1.Button, { "aria-label": node.expanded ? 'Collapse' : 'Expand', icon: node.expanded ? ((0, jsx_runtime_1.jsx)(icons_1.ChevronDownIcon, { color: color_1.gray[200].hex }, void 0)) : ((0, jsx_runtime_1.jsx)(icons_1.ChevronRightIcon, { color: color_1.gray[200].hex }, void 0)), mode: "bleed", fontSize: 2, padding: 1, type: "button", onClick: function () {
94
- var _a;
95
- return (_a = props.toggleChildrenVisibility) === null || _a === void 0 ? void 0 : _a.call(props, {
96
- node: node,
97
- path: path,
98
- treeIndex: treeIndex
99
- });
100
- } }, void 0) }), void 0)), props.connectDragPreview((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Root, __assign({ "data-landing": isLandingPadActive, "data-cancel": isLandingPadActive && !props.canDrop, style: {
101
- opacity: isDraggedDescendant ? 0.5 : 1
102
- } }, { children: (0, jsx_runtime_1.jsxs)(ui_1.Flex, __assign({ align: "center" }, { children: [Handle, typeof nodeTitle === 'function' ? nodeTitle(props) : nodeTitle] }), void 0) }), void 0) }, void 0))] }), void 0));
103
- };
104
- exports.default = NodeContentRenderer;
105
- var templateObject_1;
@@ -1,9 +0,0 @@
1
- import { CardTone } from '@sanity/ui';
2
- import * as React from 'react';
3
- import { PlaceholderRendererProps } from 'react-sortable-tree';
4
- declare const PlaceholderDropzone: React.FC<{
5
- tone?: CardTone;
6
- title: string;
7
- subtitle?: string;
8
- } & PlaceholderRendererProps>;
9
- export default PlaceholderDropzone;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- var jsx_runtime_1 = require("react/jsx-runtime");
15
- var ui_1 = require("@sanity/ui");
16
- var PlaceholderDropzone = function (props) {
17
- var isValid = props.isOver && props.canDrop;
18
- var isInvalid = props.isOver && !props.canDrop;
19
- var tone = 'transparent';
20
- if (isValid) {
21
- tone = 'positive';
22
- }
23
- if (isInvalid) {
24
- tone = 'caution';
25
- }
26
- return ((0, jsx_runtime_1.jsx)(ui_1.Box, __assign({ padding: 3 }, { children: (0, jsx_runtime_1.jsx)(ui_1.Card, __assign({ padding: 5, radius: 2, border: true, tone: tone, style: {
27
- borderStyle: props.isOver ? undefined : 'dashed'
28
- } }, { children: (0, jsx_runtime_1.jsxs)(ui_1.Stack, __assign({ space: 2, style: { textAlign: 'center' } }, { children: [(0, jsx_runtime_1.jsxs)(ui_1.Text, __assign({ size: 2, as: "h2", muted: true }, { children: [!props.isOver && props.title, isValid && 'Drop here', isInvalid && 'Invalid location or element'] }), void 0), props.subtitle && (0, jsx_runtime_1.jsx)(ui_1.Text, __assign({ size: 1 }, { children: props.subtitle }), void 0), props.children] }), void 0) }), void 0) }), void 0));
29
- };
30
- exports.default = PlaceholderDropzone;
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- import { StoredTreeItem, TreeInputOptions } from '../types';
3
- /**
4
- * The loaded tree users interact with
5
- */
6
- declare const TreeEditor: React.FC<{
7
- tree: StoredTreeItem[];
8
- onChange: (patch: unknown) => void;
9
- options: TreeInputOptions;
10
- patchPrefix?: string;
11
- }>;
12
- export default TreeEditor;