@dxos/react-ui-list 0.8.3 → 0.8.4-main.f9ba587
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/lib/browser/index.mjs +23 -23
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +23 -23
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Accordion/Accordion.stories.d.ts +1 -1
- package/dist/types/src/components/Accordion/Accordion.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/List.d.ts.map +1 -1
- package/dist/types/src/components/List/List.stories.d.ts +1 -1
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/ListItem.d.ts +1 -1
- package/dist/types/src/components/List/ListItem.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -19
- package/src/components/Accordion/Accordion.stories.tsx +1 -1
- package/src/components/List/List.stories.tsx +1 -1
- package/src/components/List/ListItem.tsx +9 -7
- package/src/components/Tree/Tree.stories.tsx +1 -1
- package/dist/lib/node/index.cjs +0 -886
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-list",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4-main.f9ba587",
|
|
4
4
|
"description": "A list component.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -29,35 +29,33 @@
|
|
|
29
29
|
"@preact/signals-core": "^1.9.0",
|
|
30
30
|
"@radix-ui/react-accordion": "1.2.3",
|
|
31
31
|
"@radix-ui/react-context": "1.1.1",
|
|
32
|
-
"@dxos/debug": "0.8.
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/live-object": "0.8.
|
|
36
|
-
"@dxos/log": "0.8.
|
|
37
|
-
"@dxos/react-ui
|
|
38
|
-
"@dxos/react-ui-
|
|
39
|
-
"@dxos/
|
|
32
|
+
"@dxos/debug": "0.8.4-main.f9ba587",
|
|
33
|
+
"@dxos/echo-schema": "0.8.4-main.f9ba587",
|
|
34
|
+
"@dxos/invariant": "0.8.4-main.f9ba587",
|
|
35
|
+
"@dxos/live-object": "0.8.4-main.f9ba587",
|
|
36
|
+
"@dxos/log": "0.8.4-main.f9ba587",
|
|
37
|
+
"@dxos/react-ui": "0.8.4-main.f9ba587",
|
|
38
|
+
"@dxos/react-ui-text-tooltip": "0.8.4-main.f9ba587",
|
|
39
|
+
"@dxos/react-ui-theme": "0.8.4-main.f9ba587",
|
|
40
|
+
"@dxos/util": "0.8.4-main.f9ba587",
|
|
41
|
+
"@dxos/react-ui-types": "0.8.4-main.f9ba587"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
43
44
|
"@types/react": "~18.2.0",
|
|
44
45
|
"@types/react-dom": "~18.2.0",
|
|
45
|
-
"effect": "3.
|
|
46
|
+
"effect": "3.16.13",
|
|
46
47
|
"react": "~18.2.0",
|
|
47
48
|
"react-dom": "~18.2.0",
|
|
48
49
|
"vite": "5.4.7",
|
|
49
|
-
"@dxos/random": "0.8.
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/react-ui": "0.8.3",
|
|
52
|
-
"@dxos/storybook-utils": "0.8.3"
|
|
50
|
+
"@dxos/random": "0.8.4-main.f9ba587",
|
|
51
|
+
"@dxos/storybook-utils": "0.8.4-main.f9ba587"
|
|
53
52
|
},
|
|
54
53
|
"peerDependencies": {
|
|
55
|
-
"
|
|
56
|
-
"effect": "3.13.3",
|
|
54
|
+
"effect": "^3.13.3",
|
|
57
55
|
"react": "~18.2.0",
|
|
58
56
|
"react-dom": "~18.2.0",
|
|
59
|
-
"@dxos/react-ui
|
|
60
|
-
"@dxos/react-ui": "0.8.
|
|
57
|
+
"@dxos/react-ui": "0.8.4-main.f9ba587",
|
|
58
|
+
"@dxos/react-ui-theme": "0.8.4-main.f9ba587"
|
|
61
59
|
},
|
|
62
60
|
"publishConfig": {
|
|
63
61
|
"access": "public"
|
|
@@ -72,10 +72,11 @@ export const [ListItemProvider, useListItemContext] = createContext<ListItemCont
|
|
|
72
72
|
);
|
|
73
73
|
|
|
74
74
|
export type ListItemProps<T extends ListItemRecord> = ThemedClassName<
|
|
75
|
-
PropsWithChildren<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
HTMLAttributes<HTMLDivElement>
|
|
75
|
+
PropsWithChildren<
|
|
76
|
+
{
|
|
77
|
+
item: T;
|
|
78
|
+
} & HTMLAttributes<HTMLDivElement>
|
|
79
|
+
>
|
|
79
80
|
>;
|
|
80
81
|
|
|
81
82
|
/**
|
|
@@ -86,6 +87,7 @@ export const ListItem = <T extends ListItemRecord>({ children, classNames, item,
|
|
|
86
87
|
const ref = useRef<HTMLDivElement | null>(null);
|
|
87
88
|
const dragHandleRef = useRef<HTMLElement | null>(null);
|
|
88
89
|
const [state, setState] = useState<ItemDragState>(idle);
|
|
90
|
+
|
|
89
91
|
useEffect(() => {
|
|
90
92
|
const element = ref.current;
|
|
91
93
|
invariant(element);
|
|
@@ -142,6 +144,9 @@ export const ListItem = <T extends ListItemRecord>({ children, classNames, item,
|
|
|
142
144
|
const closestEdge = extractClosestEdge(self.data);
|
|
143
145
|
setState({ type: 'is-dragging-over', closestEdge });
|
|
144
146
|
},
|
|
147
|
+
onDragLeave: () => {
|
|
148
|
+
setState(idle);
|
|
149
|
+
},
|
|
145
150
|
onDrag: ({ self }) => {
|
|
146
151
|
const closestEdge = extractClosestEdge(self.data);
|
|
147
152
|
setState((current) => {
|
|
@@ -151,9 +156,6 @@ export const ListItem = <T extends ListItemRecord>({ children, classNames, item,
|
|
|
151
156
|
return { type: 'is-dragging-over', closestEdge };
|
|
152
157
|
});
|
|
153
158
|
},
|
|
154
|
-
onDragLeave: () => {
|
|
155
|
-
setState(idle);
|
|
156
|
-
},
|
|
157
159
|
onDrop: () => {
|
|
158
160
|
setState(idle);
|
|
159
161
|
},
|
|
@@ -6,7 +6,7 @@ import '@dxos-theme';
|
|
|
6
6
|
|
|
7
7
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
8
8
|
import { extractInstruction, type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';
|
|
9
|
-
import { type Meta, type StoryObj } from '@storybook/react';
|
|
9
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
10
10
|
import React, { useEffect } from 'react';
|
|
11
11
|
|
|
12
12
|
import { live, type Live } from '@dxos/live-object';
|