@dxos/plugin-navtree 0.8.2-main.12df754 → 0.8.2-main.30e4dbb
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/{chunk-FHOAKMRS.mjs → chunk-ZULGSU3L.mjs} +240 -205
- package/dist/lib/browser/chunk-ZULGSU3L.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2 -2
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-resolver-OBGGMBVJ.mjs → intent-resolver-XCABZFA6.mjs} +4 -4
- package/dist/lib/browser/intent-resolver-XCABZFA6.mjs.map +7 -0
- package/dist/lib/browser/{keyboard-IQXHKUWM.mjs → keyboard-2KXRP22I.mjs} +2 -2
- package/dist/lib/browser/{keyboard-IQXHKUWM.mjs.map → keyboard-2KXRP22I.mjs.map} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-DWMOF2TM.mjs → react-surface-BVZN7664.mjs} +2 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/CommandsDialog/CommandsDialog.d.ts.map +1 -0
- package/dist/types/src/components/CommandsDialog/CommandsTrigger.d.ts.map +1 -0
- package/dist/types/src/components/CommandsDialog/index.d.ts +3 -0
- package/dist/types/src/components/CommandsDialog/index.d.ts.map +1 -0
- package/dist/types/src/components/NavTree/NavTree.d.ts +8 -0
- package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -0
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts +8 -0
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -0
- package/dist/types/src/components/NavTree/index.d.ts +2 -0
- package/dist/types/src/components/NavTree/index.d.ts.map +1 -0
- package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeContext.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeDocumentTitle.d.ts.map +1 -1
- package/dist/types/src/components/{NavTreeItemAction.d.ts → NavTreeItem/NavTreeItemAction.d.ts} +2 -3
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts.map +1 -0
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +8 -0
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -0
- package/dist/types/src/components/{NavTreeItemColumns.d.ts → NavTreeItem/NavTreeItemColumns.d.ts} +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts.map +1 -0
- package/dist/types/src/components/NavTreeItem/index.d.ts +3 -0
- package/dist/types/src/components/NavTreeItem/index.d.ts.map +1 -0
- package/dist/types/src/components/Sidebar/L0Menu.d.ts +13 -0
- package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -0
- package/dist/types/src/components/Sidebar/L1Panel.d.ts +15 -0
- package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -0
- package/dist/types/src/components/Sidebar/index.d.ts +3 -0
- package/dist/types/src/components/Sidebar/index.d.ts.map +1 -0
- package/dist/types/src/components/{UserAccountAvatar.d.ts → UserAccountAvatar/UserAccountAvatar.d.ts} +1 -1
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.d.ts.map +1 -0
- package/dist/types/src/components/{UserAccountAvatar.stories.d.ts → UserAccountAvatar/UserAccountAvatar.stories.d.ts} +1 -2
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -0
- package/dist/types/src/components/UserAccountAvatar/index.d.ts +2 -0
- package/dist/types/src/components/UserAccountAvatar/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/types.d.ts +14 -15
- package/dist/types/src/components/types.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.d.ts.map +1 -1
- package/dist/types/src/hooks.d.ts.map +1 -1
- package/dist/types/src/testing/app-graph-builder.d.ts +11 -0
- package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/testing/generator.d.ts +5 -4
- package/dist/types/src/testing/generator.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/update-state.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -1
- package/dist/types/src/util.d.ts +1 -1
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -31
- package/src/capabilities/intent-resolver.ts +4 -3
- package/src/capabilities/keyboard.ts +1 -1
- package/src/components/{CommandsDialog.tsx → CommandsDialog/CommandsDialog.tsx} +2 -2
- package/src/components/{CommandsTrigger.tsx → CommandsDialog/CommandsTrigger.tsx} +1 -1
- package/src/components/CommandsDialog/index.ts +6 -0
- package/src/components/NavTree/NavTree.stories.tsx +87 -0
- package/src/components/{NavTree.tsx → NavTree/NavTree.tsx} +24 -11
- package/src/components/NavTree/index.ts +5 -0
- package/src/components/NavTreeContainer.tsx +35 -16
- package/src/components/NavTreeContext.tsx +1 -1
- package/src/components/{NavTreeItemAction.stories.tsx → NavTreeItem/NavTreeItemAction.stories.tsx} +12 -6
- package/src/components/{NavTreeItemAction.tsx → NavTreeItem/NavTreeItemAction.tsx} +13 -14
- package/src/components/{NavTreeItemColumns.tsx → NavTreeItem/NavTreeItemColumns.tsx} +5 -5
- package/src/components/NavTreeItem/index.ts +6 -0
- package/src/components/{L0Menu.tsx → Sidebar/L0Menu.tsx} +182 -129
- package/src/components/{L1Panels.tsx → Sidebar/L1Panel.tsx} +29 -48
- package/src/components/Sidebar/index.ts +6 -0
- package/src/components/{UserAccountAvatar.stories.tsx → UserAccountAvatar/UserAccountAvatar.stories.tsx} +5 -5
- package/src/components/{UserAccountAvatar.tsx → UserAccountAvatar/UserAccountAvatar.tsx} +6 -6
- package/src/components/UserAccountAvatar/index.ts +5 -0
- package/src/components/index.ts +0 -1
- package/src/components/types.ts +13 -15
- package/src/testing/app-graph-builder.ts +158 -0
- package/src/testing/generator.ts +12 -9
- package/src/testing/index.ts +1 -0
- package/src/translations.ts +1 -1
- package/dist/lib/browser/chunk-FHOAKMRS.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-OBGGMBVJ.mjs.map +0 -7
- package/dist/types/src/components/CommandsDialog.d.ts.map +0 -1
- package/dist/types/src/components/CommandsTrigger.d.ts.map +0 -1
- package/dist/types/src/components/L0Menu.d.ts +0 -10
- package/dist/types/src/components/L0Menu.d.ts.map +0 -1
- package/dist/types/src/components/L1Panels.d.ts +0 -14
- package/dist/types/src/components/L1Panels.d.ts.map +0 -1
- package/dist/types/src/components/NavTree.d.ts +0 -5
- package/dist/types/src/components/NavTree.d.ts.map +0 -1
- package/dist/types/src/components/NavTree.stories.d.ts +0 -7
- package/dist/types/src/components/NavTree.stories.d.ts.map +0 -1
- package/dist/types/src/components/NavTreeItemAction.d.ts.map +0 -1
- package/dist/types/src/components/NavTreeItemAction.stories.d.ts +0 -41
- package/dist/types/src/components/NavTreeItemAction.stories.d.ts.map +0 -1
- package/dist/types/src/components/NavTreeItemColumns.d.ts.map +0 -1
- package/dist/types/src/components/UserAccountAvatar.d.ts.map +0 -1
- package/dist/types/src/components/UserAccountAvatar.stories.d.ts.map +0 -1
- package/dist/types/src/stories/Graph.stories.d.ts +0 -7
- package/dist/types/src/stories/Graph.stories.d.ts.map +0 -1
- package/dist/types/src/stories/StorybookNavTree.d.ts +0 -4
- package/dist/types/src/stories/StorybookNavTree.d.ts.map +0 -1
- package/src/components/NavTree.stories.tsx +0 -107
- package/src/stories/Graph.stories.tsx +0 -130
- package/src/stories/StorybookNavTree.tsx +0 -63
- /package/dist/lib/browser/{react-surface-DWMOF2TM.mjs.map → react-surface-BVZN7664.mjs.map} +0 -0
- /package/dist/types/src/components/{CommandsDialog.d.ts → CommandsDialog/CommandsDialog.d.ts} +0 -0
- /package/dist/types/src/components/{CommandsTrigger.d.ts → CommandsDialog/CommandsTrigger.d.ts} +0 -0
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type Node } from '@dxos/app-graph';
|
|
3
|
-
export declare const L0Menu: ({ topLevelItems, pinnedItems, userAccountItem, parent, path, }: {
|
|
4
|
-
topLevelItems: Node<any>[];
|
|
5
|
-
pinnedItems: Node<any>[];
|
|
6
|
-
userAccountItem: Node<any>;
|
|
7
|
-
parent?: Node<any>;
|
|
8
|
-
path: string[];
|
|
9
|
-
}) => React.JSX.Element;
|
|
10
|
-
//# sourceMappingURL=L0Menu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"L0Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/L0Menu.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAmF,MAAM,OAAO,CAAC;AAGxG,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAiR5C,eAAO,MAAM,MAAM,mEAMhB;IACD,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC3B,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACzB,eAAe,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,sBA4CA,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type Node } from '@dxos/app-graph';
|
|
3
|
-
export type L1PanelProps = {
|
|
4
|
-
item: Node<any>;
|
|
5
|
-
path: string[];
|
|
6
|
-
currentItemId: string;
|
|
7
|
-
onBack?: () => void;
|
|
8
|
-
};
|
|
9
|
-
export declare const L1Panels: ({ topLevelItems, path, currentItemId, onBack, }: Pick<L1PanelProps, "onBack"> & {
|
|
10
|
-
topLevelItems: Node<any>[];
|
|
11
|
-
path: string[];
|
|
12
|
-
currentItemId: string;
|
|
13
|
-
}) => React.JSX.Element;
|
|
14
|
-
//# sourceMappingURL=L1Panels.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"L1Panels.d.ts","sourceRoot":"","sources":["../../../../src/components/L1Panels.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAa5C,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAqJF,eAAO,MAAM,QAAQ,oDAKlB,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,GAAG;IAChC,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC3B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACvB,sBAgBA,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NavTree.d.ts","sourceRoot":"","sources":["../../../../src/components/NavTree.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAQvC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,eAAO,MAAM,aAAa,gBAAgB,CAAC;AAE3C,eAAO,MAAM,OAAO,iBAAkB,YAAY,sBAiCjD,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import '@dxos-theme';
|
|
2
|
-
import { type Meta } from '@storybook/react';
|
|
3
|
-
import { StorybookNavTree } from '../stories/StorybookNavTree';
|
|
4
|
-
declare const meta: Meta<typeof StorybookNavTree>;
|
|
5
|
-
export default meta;
|
|
6
|
-
export declare const Default: {};
|
|
7
|
-
//# sourceMappingURL=NavTree.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NavTree.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/NavTree.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAIrB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAU7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAQ/D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CA4EvC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NavTreeItemAction.d.ts","sourceRoot":"","sources":["../../../../src/components/NavTreeItemAction.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,gBAAgB,EAAU,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAMzD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,GAAG;IAC1D,MAAM,EAAE,IAAI,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAAC;AAaF,eAAO,MAAM,6BAA6B,oDAMvC,0BAA0B,sBAsB5B,CAAC;AAEF,eAAO,MAAM,2BAA2B,4GAKrC,MAAM,GAAG;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,sBA0BnF,CAAC;AAEF,eAAO,MAAM,iBAAiB,wDAAyD,0BAA0B,sBAiBhH,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import '@dxos-theme';
|
|
2
|
-
import { type NavTreeItemActionMenuProps } from './NavTreeItemAction';
|
|
3
|
-
declare const _default: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: ({ monolithic, menuActions, parent: node, ...props }: NavTreeItemActionMenuProps) => import("react").JSX.Element;
|
|
6
|
-
decorators: import("@storybook/react").Decorator[];
|
|
7
|
-
args: {
|
|
8
|
-
icon: string;
|
|
9
|
-
parent: {
|
|
10
|
-
id: string;
|
|
11
|
-
type: string;
|
|
12
|
-
data: null;
|
|
13
|
-
properties: {
|
|
14
|
-
label: string;
|
|
15
|
-
icon: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
menuActions: {
|
|
19
|
-
id: string;
|
|
20
|
-
type: string;
|
|
21
|
-
data: () => void;
|
|
22
|
-
properties: {
|
|
23
|
-
label: string;
|
|
24
|
-
icon: string;
|
|
25
|
-
};
|
|
26
|
-
}[];
|
|
27
|
-
label: string;
|
|
28
|
-
onAction: (action: Readonly<Omit<Readonly<{
|
|
29
|
-
id: string;
|
|
30
|
-
type: string;
|
|
31
|
-
cacheable?: string[];
|
|
32
|
-
properties: Readonly<Record<string, any>>;
|
|
33
|
-
data: import("@dxos/app-graph").ActionData;
|
|
34
|
-
}>, "properties"> & {
|
|
35
|
-
properties: Readonly<Record<string, any>>;
|
|
36
|
-
}>) => void;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
export default _default;
|
|
40
|
-
export declare const Default: {};
|
|
41
|
-
//# sourceMappingURL=NavTreeItemAction.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NavTreeItemAction.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/NavTreeItemAction.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAMrB,OAAO,EAAqB,KAAK,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BzF,wBAaE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NavTreeItemColumns.d.ts","sourceRoot":"","sources":["../../../../src/components/NavTreeItemColumns.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAQ9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAIvD,eAAO,MAAM,kBAAkB,4DAAiD,uBAAuB,uBAwDrG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserAccountAvatar.d.ts","sourceRoot":"","sources":["../../../../src/components/UserAccountAvatar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAU,KAAK,YAAY,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAGtE,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAAW,sBAAsB,sBAiB9D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserAccountAvatar.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/UserAccountAvatar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,eAAO,MAAM,OAAO,UAAW,GAAG,sBAEjC,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,iBAAiB,CAGxC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import '@dxos-theme';
|
|
2
|
-
import { type Meta } from '@storybook/react';
|
|
3
|
-
import { StorybookNavTree } from './StorybookNavTree';
|
|
4
|
-
export declare const Default: {};
|
|
5
|
-
declare const meta: Meta<typeof StorybookNavTree>;
|
|
6
|
-
export default meta;
|
|
7
|
-
//# sourceMappingURL=Graph.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Graph.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Graph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAKrB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAW7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAiCtD,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAwEvC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type NavTreeContextValue, type NavTreeProps } from '../components';
|
|
3
|
-
export declare const StorybookNavTree: ({ getActions, loadDescendents, renderItemEnd, popoverAnchorId, getItems, getProps, isCurrent, canDrop, onSelect, isOpen, onOpenChange, ...props }: NavTreeProps & NavTreeContextValue) => React.JSX.Element;
|
|
4
|
-
//# sourceMappingURL=StorybookNavTree.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StorybookNavTree.d.ts","sourceRoot":"","sources":["../../../../src/stories/StorybookNavTree.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,EAA2B,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAGrG,eAAO,MAAM,gBAAgB,sJAa1B,YAAY,GAAG,mBAAmB,sBAwCpC,CAAC"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
8
|
-
import { extractInstruction, type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';
|
|
9
|
-
import { type Meta } from '@storybook/react';
|
|
10
|
-
import React, { useEffect } from 'react';
|
|
11
|
-
|
|
12
|
-
import { isActionLike, type NodeArg } from '@dxos/app-graph';
|
|
13
|
-
import { live, type Live } from '@dxos/live-object';
|
|
14
|
-
import { faker } from '@dxos/random';
|
|
15
|
-
import { isTreeData, type TreeData } from '@dxos/react-ui-list';
|
|
16
|
-
import { Path } from '@dxos/react-ui-list';
|
|
17
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
18
|
-
|
|
19
|
-
import { StorybookNavTree } from '../stories/StorybookNavTree';
|
|
20
|
-
import { createTree, updateState } from '../testing';
|
|
21
|
-
|
|
22
|
-
faker.seed(1234);
|
|
23
|
-
|
|
24
|
-
const tree = live<NodeArg<any>>(createTree());
|
|
25
|
-
const state = new Map<string, Live<{ open: boolean; current: boolean }>>();
|
|
26
|
-
|
|
27
|
-
const meta: Meta<typeof StorybookNavTree> = {
|
|
28
|
-
title: 'plugins/plugin-navtree/NavTree',
|
|
29
|
-
component: StorybookNavTree,
|
|
30
|
-
decorators: [withTheme, withLayout({ tooltips: true })],
|
|
31
|
-
render: (args) => {
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
return monitorForElements({
|
|
34
|
-
canMonitor: ({ source }) => isTreeData(source),
|
|
35
|
-
onDrop: ({ location, source }) => {
|
|
36
|
-
// Didn't drop on anything.
|
|
37
|
-
if (!location.current.dropTargets.length) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const target = location.current.dropTargets[0];
|
|
42
|
-
const instruction: Instruction | null = extractInstruction(target.data);
|
|
43
|
-
if (instruction !== null) {
|
|
44
|
-
updateState({
|
|
45
|
-
state: tree,
|
|
46
|
-
instruction,
|
|
47
|
-
source: source.data as TreeData,
|
|
48
|
-
target: target.data as TreeData,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
}, []);
|
|
54
|
-
|
|
55
|
-
return <StorybookNavTree {...args} />;
|
|
56
|
-
},
|
|
57
|
-
args: {
|
|
58
|
-
id: tree.id,
|
|
59
|
-
getActions: (arg: NodeArg<any>) => ({
|
|
60
|
-
actions: arg.nodes?.filter((node) => isActionLike(node)) ?? [],
|
|
61
|
-
groupedActions: {},
|
|
62
|
-
}),
|
|
63
|
-
getItems: (testItem?: any) => {
|
|
64
|
-
return testItem?.nodes ?? tree.nodes ?? [];
|
|
65
|
-
},
|
|
66
|
-
getProps: (testItem: NodeArg<any>) => ({
|
|
67
|
-
id: testItem.id,
|
|
68
|
-
label: testItem.properties?.label ?? testItem.id,
|
|
69
|
-
icon: testItem.properties?.icon,
|
|
70
|
-
...((testItem.nodes?.length ?? 0) > 0 && {
|
|
71
|
-
parentOf: testItem.nodes!.map(({ id }) => id),
|
|
72
|
-
}),
|
|
73
|
-
}),
|
|
74
|
-
isOpen: (_path: string[]) => {
|
|
75
|
-
const path = Path.create(..._path);
|
|
76
|
-
const value = state.get(path) ?? live({ open: false, current: false });
|
|
77
|
-
if (!state.has(path)) {
|
|
78
|
-
state.set(path, value);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return value.open;
|
|
82
|
-
},
|
|
83
|
-
isCurrent: (_path: string[]) => {
|
|
84
|
-
const path = Path.create(..._path);
|
|
85
|
-
const value = state.get(path) ?? live({ open: false, current: false });
|
|
86
|
-
if (!state.has(path)) {
|
|
87
|
-
state.set(path, value);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return value.current;
|
|
91
|
-
},
|
|
92
|
-
onOpenChange: ({ path: _path, open }) => {
|
|
93
|
-
const path = Path.create(..._path);
|
|
94
|
-
const object = state.get(path);
|
|
95
|
-
object!.open = open;
|
|
96
|
-
},
|
|
97
|
-
onSelect: ({ path: _path, current }) => {
|
|
98
|
-
const path = Path.create(..._path);
|
|
99
|
-
const object = state.get(path);
|
|
100
|
-
object!.current = current;
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export default meta;
|
|
106
|
-
|
|
107
|
-
export const Default = {};
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
8
|
-
import { extractInstruction, type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';
|
|
9
|
-
import { batch } from '@preact/signals-core';
|
|
10
|
-
import { type Meta } from '@storybook/react';
|
|
11
|
-
import React, { useEffect } from 'react';
|
|
12
|
-
|
|
13
|
-
import { Graph, ROOT_ID, type Node } from '@dxos/app-graph';
|
|
14
|
-
import { registerSignalsRuntime } from '@dxos/echo-signals/react';
|
|
15
|
-
import { live, type Live } from '@dxos/live-object';
|
|
16
|
-
import { faker } from '@dxos/random';
|
|
17
|
-
import { isTreeData, type PropsFromTreeItem } from '@dxos/react-ui-list';
|
|
18
|
-
import { Path } from '@dxos/react-ui-list';
|
|
19
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
20
|
-
|
|
21
|
-
import { StorybookNavTree } from './StorybookNavTree';
|
|
22
|
-
import { getActions, getChildren } from '../util';
|
|
23
|
-
|
|
24
|
-
faker.seed(3);
|
|
25
|
-
registerSignalsRuntime();
|
|
26
|
-
|
|
27
|
-
const createGraph = () => {
|
|
28
|
-
const graph = new Graph();
|
|
29
|
-
|
|
30
|
-
batch(() => {
|
|
31
|
-
(graph as any)._addNode({
|
|
32
|
-
id: ROOT_ID,
|
|
33
|
-
nodes: [...Array(2)].map((_, i) => ({
|
|
34
|
-
id: faker.string.hexadecimal({ length: 4 }).slice(2).toUpperCase(),
|
|
35
|
-
properties: { index: `a${i}`, label: faker.lorem.words(2), description: faker.lorem.sentence() },
|
|
36
|
-
nodes: [...Array(2)].map((_, j) => ({
|
|
37
|
-
id: faker.string.hexadecimal({ length: 4 }).slice(2).toUpperCase(),
|
|
38
|
-
properties: { index: `a${j}`, label: faker.lorem.words(2), description: faker.lorem.sentence() },
|
|
39
|
-
nodes: [...Array(2)].map((_, k) => ({
|
|
40
|
-
id: faker.string.hexadecimal({ length: 4 }).slice(2).toUpperCase(),
|
|
41
|
-
properties: { index: `a${k}`, label: faker.lorem.words(2), description: faker.lorem.sentence() },
|
|
42
|
-
})),
|
|
43
|
-
})),
|
|
44
|
-
})),
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
return graph;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const graph = createGraph();
|
|
52
|
-
const state = new Map<string, Live<{ open: boolean; current: boolean }>>();
|
|
53
|
-
|
|
54
|
-
export const Default = {};
|
|
55
|
-
|
|
56
|
-
const meta: Meta<typeof StorybookNavTree> = {
|
|
57
|
-
title: 'plugins/plugin-navtree/Graph',
|
|
58
|
-
component: StorybookNavTree,
|
|
59
|
-
decorators: [withTheme, withLayout({ tooltips: true })],
|
|
60
|
-
render: (args) => {
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
return monitorForElements({
|
|
63
|
-
canMonitor: ({ source }) => isTreeData(source.data),
|
|
64
|
-
onDrop: ({ location, source }) => {
|
|
65
|
-
// Didn't drop on anything.
|
|
66
|
-
if (!location.current.dropTargets.length) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const target = location.current.dropTargets[0];
|
|
71
|
-
|
|
72
|
-
const instruction: Instruction | null = extractInstruction(target.data);
|
|
73
|
-
if (instruction !== null) {
|
|
74
|
-
// TODO(wittjosiah): Implement drop logic.
|
|
75
|
-
console.log('update', instruction);
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
}, []);
|
|
80
|
-
|
|
81
|
-
return <StorybookNavTree {...args} />;
|
|
82
|
-
},
|
|
83
|
-
args: {
|
|
84
|
-
root: graph.root,
|
|
85
|
-
id: graph.root.id,
|
|
86
|
-
getActions: (node: Node) => getActions(graph, node),
|
|
87
|
-
getItems: (node?: Node) => graph.nodes(node ?? graph.root),
|
|
88
|
-
getProps: (node: Node, path: string[]) => {
|
|
89
|
-
const children = getChildren(graph, node, undefined, path);
|
|
90
|
-
const parentOf =
|
|
91
|
-
children.length > 0 ? children.map(({ id }) => id) : node.properties.role === 'branch' ? [] : undefined;
|
|
92
|
-
return {
|
|
93
|
-
id: node.id,
|
|
94
|
-
label: node.properties.label ?? node.id,
|
|
95
|
-
icon: node.properties.icon,
|
|
96
|
-
parentOf,
|
|
97
|
-
} satisfies PropsFromTreeItem;
|
|
98
|
-
},
|
|
99
|
-
isOpen: (_path: string[]) => {
|
|
100
|
-
const path = Path.create(..._path);
|
|
101
|
-
const value = state.get(path) ?? live({ open: false, current: false });
|
|
102
|
-
if (!state.has(path)) {
|
|
103
|
-
state.set(path, value);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return value.open;
|
|
107
|
-
},
|
|
108
|
-
isCurrent: (_path: string[]) => {
|
|
109
|
-
const path = Path.create(..._path);
|
|
110
|
-
const value = state.get(path) ?? live({ open: false, current: false });
|
|
111
|
-
if (!state.has(path)) {
|
|
112
|
-
state.set(path, value);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return value.current;
|
|
116
|
-
},
|
|
117
|
-
onOpenChange: ({ path: _path, open }) => {
|
|
118
|
-
const path = Path.create(..._path);
|
|
119
|
-
const object = state.get(path);
|
|
120
|
-
object!.open = open;
|
|
121
|
-
},
|
|
122
|
-
onSelect: ({ path: _path, current }) => {
|
|
123
|
-
const path = Path.create(..._path);
|
|
124
|
-
const object = state.get(path);
|
|
125
|
-
object!.current = current;
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export default meta;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useMemo, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { NavTree, NavTreeContext, type NavTreeContextValue, type NavTreeProps } from '../components';
|
|
8
|
-
import { type NavTreeItemGraphNode } from '../types';
|
|
9
|
-
|
|
10
|
-
export const StorybookNavTree = ({
|
|
11
|
-
getActions,
|
|
12
|
-
loadDescendents,
|
|
13
|
-
renderItemEnd,
|
|
14
|
-
popoverAnchorId,
|
|
15
|
-
getItems,
|
|
16
|
-
getProps,
|
|
17
|
-
isCurrent,
|
|
18
|
-
canDrop,
|
|
19
|
-
onSelect,
|
|
20
|
-
isOpen,
|
|
21
|
-
onOpenChange,
|
|
22
|
-
...props
|
|
23
|
-
}: NavTreeProps & NavTreeContextValue) => {
|
|
24
|
-
const [tab, setTab] = useState('never');
|
|
25
|
-
|
|
26
|
-
const contextValue = useMemo(
|
|
27
|
-
() => ({
|
|
28
|
-
tab,
|
|
29
|
-
onTabChange: (node: NavTreeItemGraphNode) => setTab(node.id),
|
|
30
|
-
getActions,
|
|
31
|
-
loadDescendents,
|
|
32
|
-
renderItemEnd,
|
|
33
|
-
popoverAnchorId,
|
|
34
|
-
getItems,
|
|
35
|
-
getProps,
|
|
36
|
-
isCurrent,
|
|
37
|
-
isOpen,
|
|
38
|
-
onOpenChange,
|
|
39
|
-
canDrop,
|
|
40
|
-
onSelect,
|
|
41
|
-
}),
|
|
42
|
-
[
|
|
43
|
-
tab,
|
|
44
|
-
setTab,
|
|
45
|
-
getActions,
|
|
46
|
-
loadDescendents,
|
|
47
|
-
renderItemEnd,
|
|
48
|
-
popoverAnchorId,
|
|
49
|
-
getItems,
|
|
50
|
-
getProps,
|
|
51
|
-
isCurrent,
|
|
52
|
-
isOpen,
|
|
53
|
-
onOpenChange,
|
|
54
|
-
canDrop,
|
|
55
|
-
onSelect,
|
|
56
|
-
],
|
|
57
|
-
);
|
|
58
|
-
return (
|
|
59
|
-
<NavTreeContext.Provider value={contextValue}>
|
|
60
|
-
<NavTree {...props} />
|
|
61
|
-
</NavTreeContext.Provider>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
File without changes
|
/package/dist/types/src/components/{CommandsDialog.d.ts → CommandsDialog/CommandsDialog.d.ts}
RENAMED
|
File without changes
|
/package/dist/types/src/components/{CommandsTrigger.d.ts → CommandsDialog/CommandsTrigger.d.ts}
RENAMED
|
File without changes
|