@ark-ui/solid 5.16.1 → 5.18.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 (78) hide show
  1. package/dist/chunk/{KIDL2HC3.jsx → 4L4266PL.jsx} +4 -4
  2. package/dist/chunk/{WBYGZCTU.jsx → 6XAZQVOY.jsx} +4 -4
  3. package/dist/chunk/7HON4OS6.js +217 -0
  4. package/dist/chunk/{EIA3BZ33.jsx → 7OXBQSIZ.jsx} +4 -4
  5. package/dist/chunk/{FC67EFPW.jsx → D2MI7N5P.jsx} +1 -1
  6. package/dist/chunk/{5PKZLVXE.jsx → DLZTFD37.jsx} +4 -4
  7. package/dist/chunk/{JPJUQ5CI.jsx → H4MJ4254.jsx} +1 -1
  8. package/dist/chunk/{P7WR6WX5.js → HJFJPRY5.js} +1 -1
  9. package/dist/chunk/{FQGMWBGA.js → HSBJVWHB.js} +1 -1
  10. package/dist/chunk/{KNVMVQG6.jsx → L22RABDV.jsx} +10 -0
  11. package/dist/chunk/{ACABJNIJ.jsx → L5XYJCAK.jsx} +1 -1
  12. package/dist/chunk/{KJ353BY6.jsx → LBI4ZRKN.jsx} +2 -0
  13. package/dist/chunk/{4T2T3PMU.jsx → UYFUB47A.jsx} +2 -0
  14. package/dist/chunk/{FRSNRGQK.jsx → VXQNQSLM.jsx} +4 -4
  15. package/dist/chunk/{ZB7AEDAJ.jsx → XENPQFEN.jsx} +1 -1
  16. package/dist/chunk/XFW6RT6G.js +321 -0
  17. package/dist/chunk/{C46RVY7A.jsx → XOIHVYJ7.jsx} +4 -4
  18. package/dist/chunk/{L4PQJRRA.js → XZJYSF6N.js} +15 -1
  19. package/dist/chunk/{G3JCG6HD.jsx → Y2LC36B4.jsx} +1 -1
  20. package/dist/chunk/{BBWRZLB6.jsx → YJX4W6VT.jsx} +1 -1
  21. package/dist/chunk/{NVETRSKA.jsx → YM35RFYG.jsx} +1 -1
  22. package/dist/chunk/YRHUWQ7U.jsx +237 -0
  23. package/dist/chunk/ZHSHZ7SJ.jsx +240 -0
  24. package/dist/components/checkbox/index.d.ts +17 -8
  25. package/dist/components/checkbox/index.js +1 -1
  26. package/dist/components/checkbox/index.jsx +3 -1
  27. package/dist/components/collection/index.d.ts +106 -4
  28. package/dist/components/collection/index.js +1 -1
  29. package/dist/components/collection/index.jsx +5 -3
  30. package/dist/components/color-picker/index.d.ts +1 -1
  31. package/dist/components/color-picker/index.jsx +3 -3
  32. package/dist/components/combobox/index.d.ts +1 -1
  33. package/dist/components/combobox/index.js +1 -1
  34. package/dist/components/combobox/index.jsx +6 -6
  35. package/dist/components/date-picker/index.d.ts +1 -1
  36. package/dist/components/date-picker/index.jsx +3 -3
  37. package/dist/components/dialog/index.jsx +3 -3
  38. package/dist/components/field/index.d.ts +1 -1
  39. package/dist/components/fieldset/index.d.ts +1 -1
  40. package/dist/components/file-upload/index.d.ts +6 -3
  41. package/dist/components/file-upload/index.js +1 -1
  42. package/dist/components/file-upload/index.jsx +1 -1
  43. package/dist/components/floating-panel/index.jsx +3 -3
  44. package/dist/components/hover-card/index.jsx +3 -3
  45. package/dist/components/index.d.ts +7 -4
  46. package/dist/components/index.js +26 -25
  47. package/dist/components/index.jsx +416 -402
  48. package/dist/components/json-tree-view/index.d.ts +69 -0
  49. package/dist/components/json-tree-view/index.js +1 -0
  50. package/dist/components/json-tree-view/index.jsx +26 -0
  51. package/dist/components/listbox/index.js +1 -1
  52. package/dist/components/listbox/index.jsx +1 -1
  53. package/dist/components/menu/index.jsx +3 -3
  54. package/dist/components/popover/index.jsx +3 -3
  55. package/dist/components/presence/index.jsx +2 -2
  56. package/dist/components/select/index.d.ts +1 -1
  57. package/dist/components/select/index.js +1 -1
  58. package/dist/components/select/index.jsx +6 -6
  59. package/dist/components/signature-pad/index.js +1 -1
  60. package/dist/components/signature-pad/index.jsx +1 -1
  61. package/dist/components/tabs/index.jsx +3 -3
  62. package/dist/components/time-picker/index.jsx +3 -3
  63. package/dist/components/tooltip/index.jsx +3 -3
  64. package/dist/components/tour/index.jsx +3 -3
  65. package/dist/components/tree-view/index.d.ts +9 -39
  66. package/dist/components/tree-view/index.js +1 -1
  67. package/dist/components/tree-view/index.jsx +1 -1
  68. package/dist/index.d.ts +8 -5
  69. package/dist/index.js +26 -25
  70. package/dist/index.jsx +416 -402
  71. package/dist/tree-view-tree-CbBeWSwi.d.ts +41 -0
  72. package/dist/{use-list-collection-C2rvMTSM.d.ts → use-list-collection-Dk2gVdQ2.d.ts} +1 -1
  73. package/package.json +65 -64
  74. package/dist/chunk/AQUEJK4Z.jsx +0 -122
  75. package/dist/chunk/XL4VFEPW.js +0 -104
  76. package/dist/chunk/{BJ3QT4LE.jsx → H7TJLB3R.jsx} +0 -0
  77. package/dist/chunk/{QBN5FEQF.js → NWXJCBMN.js} +0 -0
  78. package/dist/chunk/{H6ODLFPJ.jsx → WC2HBDLJ.jsx} +3 -3
@@ -0,0 +1,41 @@
1
+ import * as solid_js from 'solid-js';
2
+ import { Accessor } from 'solid-js';
3
+ import { O as Optional, M as MaybeAccessor, A as Assign } from './types-Bc0WfPsv.js';
4
+ import { R as RenderStrategyProps } from './render-strategy-B5MqQP3X.js';
5
+ import { TreeNode, TreeCollection } from '@zag-js/collection';
6
+ import { HTMLProps, PolymorphicProps } from './components/factory.js';
7
+ import { PropTypes } from '@zag-js/solid';
8
+ import * as treeView from '@zag-js/tree-view';
9
+
10
+ interface UseTreeViewProps<T extends TreeNode> extends Optional<Omit<treeView.Props, 'dir' | 'getRootNode' | 'colllection'>, 'id'> {
11
+ /**
12
+ * The collection of tree nodes
13
+ */
14
+ collection: TreeCollection<T>;
15
+ }
16
+ interface UseTreeViewReturn<T extends TreeNode> extends Accessor<treeView.Api<PropTypes, T>> {
17
+ }
18
+ declare const useTreeView: <T extends TreeNode>(props: MaybeAccessor<UseTreeViewProps<T>>) => UseTreeViewReturn<T>;
19
+
20
+ interface TreeViewRootBaseProps<T extends TreeNode> extends UseTreeViewProps<T>, RenderStrategyProps, PolymorphicProps<'div'> {
21
+ }
22
+ interface TreeViewRootProps<T extends TreeNode> extends Assign<HTMLProps<'div'>, TreeViewRootBaseProps<T>> {
23
+ }
24
+ declare const TreeViewRoot: <T extends TreeNode>(props: TreeViewRootProps<T>) => solid_js.JSX.Element;
25
+
26
+ interface RootProviderProps<T extends TreeNode> {
27
+ value: UseTreeViewReturn<T>;
28
+ }
29
+ interface TreeViewRootProviderBaseProps<T extends TreeNode> extends RootProviderProps<T>, RenderStrategyProps, PolymorphicProps<'div'> {
30
+ }
31
+ interface TreeViewRootProviderProps<T extends TreeNode> extends HTMLProps<'div'>, TreeViewRootProviderBaseProps<T> {
32
+ }
33
+ declare const TreeViewRootProvider: <T extends TreeNode>(props: TreeViewRootProviderProps<T>) => solid_js.JSX.Element;
34
+
35
+ interface TreeViewTreeBaseProps extends PolymorphicProps<'div'> {
36
+ }
37
+ interface TreeViewTreeProps extends HTMLProps<'div'>, TreeViewTreeBaseProps {
38
+ }
39
+ declare const TreeViewTree: (props: TreeViewTreeProps) => solid_js.JSX.Element;
40
+
41
+ export { TreeViewRoot as T, type UseTreeViewProps as U, type TreeViewRootBaseProps as a, type TreeViewRootProps as b, TreeViewRootProvider as c, type TreeViewRootProviderBaseProps as d, type TreeViewRootProviderProps as e, TreeViewTree as f, type TreeViewTreeBaseProps as g, type TreeViewTreeProps as h, type UseTreeViewReturn as i, useTreeView as u };
@@ -88,4 +88,4 @@ interface UseListCollectionReturn<T> {
88
88
  update: (value: string, item: T) => void;
89
89
  }
90
90
 
91
- export { type UseListCollectionProps as U, useListCollection as u };
91
+ export { type UseListCollectionProps as U, type UseListCollectionReturn as a, useListCollection as u };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ark-ui/solid",
3
3
  "type": "module",
4
- "version": "5.16.1",
4
+ "version": "5.18.0",
5
5
  "description": "A collection of unstyled, accessible UI components for Solid, utilizing state machines for seamless interaction.",
6
6
  "keywords": [
7
7
  "accordion",
@@ -110,71 +110,72 @@
110
110
  "sideEffects": false,
111
111
  "dependencies": {
112
112
  "@internationalized/date": "3.8.2",
113
- "@zag-js/accordion": "1.18.2",
114
- "@zag-js/angle-slider": "1.18.2",
115
- "@zag-js/anatomy": "1.18.2",
116
- "@zag-js/auto-resize": "1.18.2",
117
- "@zag-js/avatar": "1.18.2",
118
- "@zag-js/carousel": "1.18.2",
119
- "@zag-js/checkbox": "1.18.2",
120
- "@zag-js/clipboard": "1.18.2",
121
- "@zag-js/collapsible": "1.18.2",
122
- "@zag-js/collection": "1.18.2",
123
- "@zag-js/color-picker": "1.18.2",
124
- "@zag-js/color-utils": "1.18.2",
125
- "@zag-js/combobox": "1.18.2",
126
- "@zag-js/core": "1.18.2",
127
- "@zag-js/date-picker": "1.18.2",
128
- "@zag-js/date-utils": "1.18.2",
129
- "@zag-js/dialog": "1.18.2",
130
- "@zag-js/dom-query": "1.18.2",
131
- "@zag-js/editable": "1.18.2",
132
- "@zag-js/file-upload": "1.18.2",
133
- "@zag-js/file-utils": "1.18.2",
134
- "@zag-js/focus-trap": "1.18.2",
135
- "@zag-js/floating-panel": "1.18.2",
136
- "@zag-js/highlight-word": "1.18.2",
137
- "@zag-js/hover-card": "1.18.2",
138
- "@zag-js/i18n-utils": "1.18.2",
139
- "@zag-js/listbox": "1.18.2",
140
- "@zag-js/menu": "1.18.2",
141
- "@zag-js/number-input": "1.18.2",
142
- "@zag-js/pagination": "1.18.2",
143
- "@zag-js/password-input": "1.18.2",
144
- "@zag-js/pin-input": "1.18.2",
145
- "@zag-js/popover": "1.18.2",
146
- "@zag-js/presence": "1.18.2",
147
- "@zag-js/progress": "1.18.2",
148
- "@zag-js/qr-code": "1.18.2",
149
- "@zag-js/radio-group": "1.18.2",
150
- "@zag-js/rating-group": "1.18.2",
151
- "@zag-js/select": "1.18.2",
152
- "@zag-js/signature-pad": "1.18.2",
153
- "@zag-js/slider": "1.18.2",
154
- "@zag-js/solid": "1.18.2",
155
- "@zag-js/splitter": "1.18.2",
156
- "@zag-js/steps": "1.18.2",
157
- "@zag-js/switch": "1.18.2",
158
- "@zag-js/tabs": "1.18.2",
159
- "@zag-js/tags-input": "1.18.2",
160
- "@zag-js/time-picker": "1.18.2",
161
- "@zag-js/timer": "1.18.2",
162
- "@zag-js/toast": "1.18.2",
163
- "@zag-js/toggle": "1.18.2",
164
- "@zag-js/toggle-group": "1.18.2",
165
- "@zag-js/tooltip": "1.18.2",
166
- "@zag-js/tour": "1.18.2",
167
- "@zag-js/tree-view": "1.18.2",
168
- "@zag-js/types": "1.18.2",
169
- "@zag-js/utils": "1.18.2"
113
+ "@zag-js/accordion": "1.20.0",
114
+ "@zag-js/angle-slider": "1.20.0",
115
+ "@zag-js/anatomy": "1.20.0",
116
+ "@zag-js/auto-resize": "1.20.0",
117
+ "@zag-js/avatar": "1.20.0",
118
+ "@zag-js/carousel": "1.20.0",
119
+ "@zag-js/checkbox": "1.20.0",
120
+ "@zag-js/clipboard": "1.20.0",
121
+ "@zag-js/collapsible": "1.20.0",
122
+ "@zag-js/collection": "1.20.0",
123
+ "@zag-js/color-picker": "1.20.0",
124
+ "@zag-js/color-utils": "1.20.0",
125
+ "@zag-js/combobox": "1.20.0",
126
+ "@zag-js/core": "1.20.0",
127
+ "@zag-js/date-picker": "1.20.0",
128
+ "@zag-js/date-utils": "1.20.0",
129
+ "@zag-js/dialog": "1.20.0",
130
+ "@zag-js/dom-query": "1.20.0",
131
+ "@zag-js/editable": "1.20.0",
132
+ "@zag-js/file-upload": "1.20.0",
133
+ "@zag-js/file-utils": "1.20.0",
134
+ "@zag-js/focus-trap": "1.20.0",
135
+ "@zag-js/floating-panel": "1.20.0",
136
+ "@zag-js/highlight-word": "1.20.0",
137
+ "@zag-js/hover-card": "1.20.0",
138
+ "@zag-js/i18n-utils": "1.20.0",
139
+ "@zag-js/json-tree-utils": "1.20.0",
140
+ "@zag-js/listbox": "1.20.0",
141
+ "@zag-js/menu": "1.20.0",
142
+ "@zag-js/number-input": "1.20.0",
143
+ "@zag-js/pagination": "1.20.0",
144
+ "@zag-js/password-input": "1.20.0",
145
+ "@zag-js/pin-input": "1.20.0",
146
+ "@zag-js/popover": "1.20.0",
147
+ "@zag-js/presence": "1.20.0",
148
+ "@zag-js/progress": "1.20.0",
149
+ "@zag-js/qr-code": "1.20.0",
150
+ "@zag-js/radio-group": "1.20.0",
151
+ "@zag-js/rating-group": "1.20.0",
152
+ "@zag-js/select": "1.20.0",
153
+ "@zag-js/signature-pad": "1.20.0",
154
+ "@zag-js/slider": "1.20.0",
155
+ "@zag-js/solid": "1.20.0",
156
+ "@zag-js/splitter": "1.20.0",
157
+ "@zag-js/steps": "1.20.0",
158
+ "@zag-js/switch": "1.20.0",
159
+ "@zag-js/tabs": "1.20.0",
160
+ "@zag-js/tags-input": "1.20.0",
161
+ "@zag-js/time-picker": "1.20.0",
162
+ "@zag-js/timer": "1.20.0",
163
+ "@zag-js/toast": "1.20.0",
164
+ "@zag-js/toggle": "1.20.0",
165
+ "@zag-js/toggle-group": "1.20.0",
166
+ "@zag-js/tooltip": "1.20.0",
167
+ "@zag-js/tour": "1.20.0",
168
+ "@zag-js/tree-view": "1.20.0",
169
+ "@zag-js/types": "1.20.0",
170
+ "@zag-js/utils": "1.20.0"
170
171
  },
171
172
  "devDependencies": {
172
173
  "@biomejs/biome": "1.9.4",
173
174
  "@modular-forms/solid": "0.25.1",
174
175
  "@solidjs/testing-library": "0.8.10",
175
- "@storybook/addon-a11y": "9.0.15",
176
- "@storybook/addon-links": "9.0.15",
177
- "@storybook/addon-vitest": "9.0.15",
176
+ "@storybook/addon-a11y": "9.0.18",
177
+ "@storybook/addon-links": "9.0.18",
178
+ "@storybook/addon-vitest": "9.0.18",
178
179
  "@testing-library/dom": "10.4.0",
179
180
  "@testing-library/jest-dom": "6.6.3",
180
181
  "@testing-library/user-event": "14.6.1",
@@ -186,11 +187,11 @@
186
187
  "lucide-solid": "0.525.0",
187
188
  "resize-observer-polyfill": "1.5.1",
188
189
  "solid-js": "1.9.7",
189
- "storybook": "9.0.15",
190
- "storybook-solidjs-vite": "9.0.0",
190
+ "storybook": "9.0.18",
191
+ "storybook-solidjs-vite": "9.0.2",
191
192
  "tsup": "8.5.0",
192
193
  "typescript": "5.8.3",
193
- "vite": "7.0.2",
194
+ "vite": "7.0.5",
194
195
  "vite-plugin-solid": "2.11.7",
195
196
  "vitest": "3.2.4",
196
197
  "@vitest/coverage-v8": "3.2.4",
@@ -1,122 +0,0 @@
1
- // src/components/collection/grid-collection.ts
2
- import {
3
- GridCollection
4
- } from "@zag-js/collection";
5
- var createGridCollection = (options) => new GridCollection(options);
6
-
7
- // src/components/collection/list-collection.ts
8
- import { ListCollection } from "@zag-js/collection";
9
- var createListCollection = (options) => new ListCollection(options);
10
-
11
- // src/components/collection/tree-collection.ts
12
- import {
13
- TreeCollection,
14
- filePathToTree
15
- } from "@zag-js/collection";
16
- var createTreeCollection = (options) => new TreeCollection(options);
17
- var createFileTreeCollection = (paths) => filePathToTree(paths);
18
-
19
- // src/components/collection/use-list-collection.ts
20
- import { createMemo, createSignal, splitProps } from "solid-js";
21
- function useListCollection(props) {
22
- const splittedProps = createMemo(() => {
23
- const rawProps = typeof props === "function" ? props() : props;
24
- return splitProps(rawProps, ["initialItems", "filter", "limit"]);
25
- });
26
- const init = () => {
27
- const [localProps] = splittedProps();
28
- return localProps.initialItems;
29
- };
30
- const [items, setItemsImpl] = createSignal(init());
31
- const [filterText, setFilterText] = createSignal("");
32
- const setItems = (newItems) => {
33
- setItemsImpl(newItems);
34
- setFilterText("");
35
- };
36
- const create = (itemsToCreate) => {
37
- const [, collectionOptions] = splittedProps();
38
- return createListCollection({ ...collectionOptions, items: itemsToCreate });
39
- };
40
- const collection = createMemo(() => {
41
- const [localProps, collectionOptions] = splittedProps();
42
- const filter = localProps.filter;
43
- let activeItems = items();
44
- if (filterText() && filter) {
45
- activeItems = create(items()).filter((itemString, _index, item) => filter(itemString, filterText(), item)).items;
46
- }
47
- const limitedItems = localProps.limit == null ? activeItems : activeItems.slice(0, localProps.limit);
48
- return createListCollection({ ...collectionOptions, items: limitedItems });
49
- });
50
- return {
51
- collection,
52
- filter: (inputValue = "") => {
53
- setFilterText(inputValue);
54
- },
55
- set: (newItems) => {
56
- setItems(newItems);
57
- },
58
- reset: () => {
59
- const [localProps] = splittedProps();
60
- setItems(localProps.initialItems);
61
- },
62
- clear: () => {
63
- setItems([]);
64
- },
65
- insert: (index, ...itemsToInsert) => {
66
- const newItems = create(items()).insert(index, ...itemsToInsert).items;
67
- setItems(newItems);
68
- },
69
- insertBefore: (value, ...itemsToInsert) => {
70
- const newItems = create(items()).insertBefore(value, ...itemsToInsert).items;
71
- setItems(newItems);
72
- },
73
- insertAfter: (value, ...itemsToInsert) => {
74
- const newItems = create(items()).insertAfter(value, ...itemsToInsert).items;
75
- setItems(newItems);
76
- },
77
- remove: (...itemOrValues) => {
78
- const newItems = create(items()).remove(...itemOrValues).items;
79
- setItems(newItems);
80
- },
81
- move: (value, to) => {
82
- const newItems = create(items()).move(value, to).items;
83
- setItems(newItems);
84
- },
85
- moveBefore: (value, ...values) => {
86
- const newItems = create(items()).moveBefore(value, ...values).items;
87
- setItems(newItems);
88
- },
89
- moveAfter: (value, ...values) => {
90
- const newItems = create(items()).moveAfter(value, ...values).items;
91
- setItems(newItems);
92
- },
93
- reorder: (from, to) => {
94
- const newItems = create(items()).reorder(from, to).items;
95
- setItems(newItems);
96
- },
97
- append: (...itemsToAppend) => {
98
- const newItems = create(items()).append(...itemsToAppend).items;
99
- setItems(newItems);
100
- },
101
- upsert: (value, item, mode = "append") => {
102
- const newItems = create(items()).upsert(value, item, mode).items;
103
- setItems(newItems);
104
- },
105
- prepend: (...itemsToPrepend) => {
106
- const newItems = create(items()).prepend(...itemsToPrepend).items;
107
- setItems(newItems);
108
- },
109
- update: (value, item) => {
110
- const newItems = create(items()).update(value, item).items;
111
- setItems(newItems);
112
- }
113
- };
114
- }
115
-
116
- export {
117
- createGridCollection,
118
- createListCollection,
119
- createTreeCollection,
120
- createFileTreeCollection,
121
- useListCollection
122
- };
@@ -1,104 +0,0 @@
1
- import { GridCollection, ListCollection, TreeCollection, filePathToTree } from '@zag-js/collection';
2
- import { createMemo, splitProps, createSignal } from 'solid-js';
3
-
4
- // src/components/collection/grid-collection.ts
5
- var createGridCollection = (options) => new GridCollection(options);
6
- var createListCollection = (options) => new ListCollection(options);
7
- var createTreeCollection = (options) => new TreeCollection(options);
8
- var createFileTreeCollection = (paths) => filePathToTree(paths);
9
- function useListCollection(props) {
10
- const splittedProps = createMemo(() => {
11
- const rawProps = typeof props === "function" ? props() : props;
12
- return splitProps(rawProps, ["initialItems", "filter", "limit"]);
13
- });
14
- const init = () => {
15
- const [localProps] = splittedProps();
16
- return localProps.initialItems;
17
- };
18
- const [items, setItemsImpl] = createSignal(init());
19
- const [filterText, setFilterText] = createSignal("");
20
- const setItems = (newItems) => {
21
- setItemsImpl(newItems);
22
- setFilterText("");
23
- };
24
- const create = (itemsToCreate) => {
25
- const [, collectionOptions] = splittedProps();
26
- return createListCollection({ ...collectionOptions, items: itemsToCreate });
27
- };
28
- const collection = createMemo(() => {
29
- const [localProps, collectionOptions] = splittedProps();
30
- const filter = localProps.filter;
31
- let activeItems = items();
32
- if (filterText() && filter) {
33
- activeItems = create(items()).filter((itemString, _index, item) => filter(itemString, filterText(), item)).items;
34
- }
35
- const limitedItems = localProps.limit == null ? activeItems : activeItems.slice(0, localProps.limit);
36
- return createListCollection({ ...collectionOptions, items: limitedItems });
37
- });
38
- return {
39
- collection,
40
- filter: (inputValue = "") => {
41
- setFilterText(inputValue);
42
- },
43
- set: (newItems) => {
44
- setItems(newItems);
45
- },
46
- reset: () => {
47
- const [localProps] = splittedProps();
48
- setItems(localProps.initialItems);
49
- },
50
- clear: () => {
51
- setItems([]);
52
- },
53
- insert: (index, ...itemsToInsert) => {
54
- const newItems = create(items()).insert(index, ...itemsToInsert).items;
55
- setItems(newItems);
56
- },
57
- insertBefore: (value, ...itemsToInsert) => {
58
- const newItems = create(items()).insertBefore(value, ...itemsToInsert).items;
59
- setItems(newItems);
60
- },
61
- insertAfter: (value, ...itemsToInsert) => {
62
- const newItems = create(items()).insertAfter(value, ...itemsToInsert).items;
63
- setItems(newItems);
64
- },
65
- remove: (...itemOrValues) => {
66
- const newItems = create(items()).remove(...itemOrValues).items;
67
- setItems(newItems);
68
- },
69
- move: (value, to) => {
70
- const newItems = create(items()).move(value, to).items;
71
- setItems(newItems);
72
- },
73
- moveBefore: (value, ...values) => {
74
- const newItems = create(items()).moveBefore(value, ...values).items;
75
- setItems(newItems);
76
- },
77
- moveAfter: (value, ...values) => {
78
- const newItems = create(items()).moveAfter(value, ...values).items;
79
- setItems(newItems);
80
- },
81
- reorder: (from, to) => {
82
- const newItems = create(items()).reorder(from, to).items;
83
- setItems(newItems);
84
- },
85
- append: (...itemsToAppend) => {
86
- const newItems = create(items()).append(...itemsToAppend).items;
87
- setItems(newItems);
88
- },
89
- upsert: (value, item, mode = "append") => {
90
- const newItems = create(items()).upsert(value, item, mode).items;
91
- setItems(newItems);
92
- },
93
- prepend: (...itemsToPrepend) => {
94
- const newItems = create(items()).prepend(...itemsToPrepend).items;
95
- setItems(newItems);
96
- },
97
- update: (value, item) => {
98
- const newItems = create(items()).update(value, item).items;
99
- setItems(newItems);
100
- }
101
- };
102
- }
103
-
104
- export { createFileTreeCollection, createGridCollection, createListCollection, createTreeCollection, useListCollection };
File without changes
File without changes
@@ -1,9 +1,9 @@
1
- import {
2
- splitRenderStrategyProps
3
- } from "./NEBB7COJ.jsx";
4
1
  import {
5
2
  composeRefs
6
3
  } from "./DOBZPYAN.jsx";
4
+ import {
5
+ splitRenderStrategyProps
6
+ } from "./NEBB7COJ.jsx";
7
7
  import {
8
8
  createSplitProps
9
9
  } from "./6WEDGJKQ.jsx";