@dxos/plugin-navtree 0.8.2-main.f081794 → 0.8.2-main.fbd8ed0
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/{app-graph-builder-26D3MUCA.mjs → app-graph-builder-P7AY3K72.mjs} +7 -6
- package/dist/lib/browser/app-graph-builder-P7AY3K72.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FHOAKMRS.mjs → chunk-UM2C5XK3.mjs} +352 -360
- package/dist/lib/browser/chunk-UM2C5XK3.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +4 -10
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-OBGGMBVJ.mjs → intent-resolver-PW7B76HO.mjs} +6 -6
- package/dist/lib/browser/intent-resolver-PW7B76HO.mjs.map +7 -0
- package/dist/lib/browser/keyboard-DDFATRUG.mjs +51 -0
- package/dist/lib/browser/keyboard-DDFATRUG.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-DWMOF2TM.mjs → react-surface-M3CAS7ZP.mjs} +2 -2
- package/dist/lib/browser/{state-EW62QYEN.mjs → state-3UBYOTQT.mjs} +2 -2
- package/dist/lib/browser/state-3UBYOTQT.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -179
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +4 -180
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts +2 -2
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- 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 +17 -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 +3 -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 +7 -10
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +40 -31
- package/src/NavTreePlugin.tsx +2 -2
- package/src/capabilities/app-graph-builder.ts +38 -28
- package/src/capabilities/intent-resolver.ts +8 -7
- package/src/capabilities/keyboard.ts +37 -32
- package/src/capabilities/state.ts +3 -3
- package/src/components/{CommandsDialog.tsx → CommandsDialog/CommandsDialog.tsx} +8 -7
- 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 +159 -0
- package/src/components/NavTree/NavTree.tsx +62 -0
- package/src/components/NavTree/index.ts +5 -0
- package/src/components/NavTreeContainer.tsx +85 -79
- 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} +188 -131
- package/src/components/{L1Panels.tsx → Sidebar/L1Panel.tsx} +40 -65
- 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 +17 -16
- package/src/hooks.ts +12 -11
- package/src/testing/app-graph-builder.ts +224 -0
- package/src/testing/generator.ts +12 -9
- package/src/testing/index.ts +1 -0
- package/src/translations.ts +1 -1
- package/src/util.ts +10 -32
- package/dist/lib/browser/app-graph-builder-26D3MUCA.mjs.map +0 -7
- package/dist/lib/browser/chunk-FHOAKMRS.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-OBGGMBVJ.mjs.map +0 -7
- package/dist/lib/browser/keyboard-IQXHKUWM.mjs +0 -46
- package/dist/lib/browser/keyboard-IQXHKUWM.mjs.map +0 -7
- package/dist/lib/browser/state-EW62QYEN.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/components/NavTree.tsx +0 -51
- 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-M3CAS7ZP.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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-state.d.ts","sourceRoot":"","sources":["../../../../src/testing/update-state.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,oDAAoD,CAAC;AAEtF,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAmBpD,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"update-state.d.ts","sourceRoot":"","sources":["../../../../src/testing/update-state.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,oDAAoD,CAAC;AAEtF,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAmBpD,eAAO,MAAM,WAAW,GAAI,yCAKzB;IACD,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,QAAQ,CAAC;IACjB,MAAM,EAAE,QAAQ,CAAC;CAClB,SAgCA,CAAC"}
|
package/dist/types/src/util.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { type Action, type Node, type
|
|
1
|
+
import { type Action, type Node, type ReadableGraph } from '@dxos/app-graph';
|
|
2
2
|
import { type FlattenedActions, type NavTreeItemGraphNode } from './types';
|
|
3
|
-
export declare const getParent: (graph:
|
|
4
|
-
export declare const getPersistenceParent: (graph:
|
|
5
|
-
export declare const resolveMigrationOperation: (graph:
|
|
3
|
+
export declare const getParent: (graph: ReadableGraph, node: NavTreeItemGraphNode, path: string[]) => NavTreeItemGraphNode | undefined;
|
|
4
|
+
export declare const getPersistenceParent: (graph: ReadableGraph, node: NavTreeItemGraphNode, path: string[], persistenceClass: string) => NavTreeItemGraphNode | null;
|
|
5
|
+
export declare const resolveMigrationOperation: (graph: ReadableGraph, activeNode: NavTreeItemGraphNode, destinationPath: string[], destinationRelatedNode?: NavTreeItemGraphNode) => "transfer" | "copy" | "reject";
|
|
6
6
|
export declare const sortActions: (actions: Action[]) => Action[];
|
|
7
|
-
export declare const getChildren: (graph:
|
|
8
|
-
export declare const getActions: (graph:
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const expandChildren: (graph: Graph, node: Node) => Promise<void>;
|
|
11
|
-
export declare const expandActions: (graph: Graph, node: Node) => Promise<[void, void]>;
|
|
12
|
-
export declare const l0ItemType: (item: Node<any>) => "link" | "tab" | "collection" | "action";
|
|
7
|
+
export declare const getChildren: (graph: ReadableGraph, node: NavTreeItemGraphNode, path?: readonly string[]) => NavTreeItemGraphNode[];
|
|
8
|
+
export declare const getActions: (graph: ReadableGraph, node: Node) => FlattenedActions;
|
|
9
|
+
export declare const l0ItemType: (item: Node<any>) => "collection" | "action" | "link" | "tab";
|
|
13
10
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,IAAI,EAAE,KAAK,aAAa,EAA0B,MAAM,iBAAiB,CAAC;AAGrG,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE3E,eAAO,MAAM,SAAS,GACpB,OAAO,aAAa,EACpB,MAAM,oBAAoB,EAC1B,MAAM,MAAM,EAAE,KACb,oBAAoB,GAAG,SAGzB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,aAAa,EACpB,MAAM,oBAAoB,EAC1B,MAAM,MAAM,EAAE,EACd,kBAAkB,MAAM,KACvB,oBAAoB,GAAG,IAOzB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,OAAO,aAAa,EACpB,YAAY,oBAAoB,EAChC,iBAAiB,MAAM,EAAE,EACzB,yBAAyB,oBAAoB,KAC5C,UAAU,GAAG,MAAM,GAAG,QAsBxB,CAAC;AAGF,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,KAAG,MAAM,EAWlD,CAAC;AAEL,eAAO,MAAM,WAAW,GACtB,OAAO,aAAa,EACpB,MAAM,oBAAoB,EAC1B,OAAM,SAAS,MAAM,EAAO,KAC3B,oBAAoB,EAStB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,aAAa,EAAE,MAAM,IAAI,KAAG,gBAgB7D,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,IAAI,CAAC,GAAG,CAAC,6CAUzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-navtree",
|
|
3
|
-
"version": "0.8.2-main.
|
|
3
|
+
"version": "0.8.2-main.fbd8ed0",
|
|
4
4
|
"description": "DXOS Surface plugin for a tree view visualization of the graph.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -29,49 +29,58 @@
|
|
|
29
29
|
"@radix-ui/react-dismissable-layer": "1.1.5",
|
|
30
30
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
31
31
|
"date-fns": "^3.3.1",
|
|
32
|
-
"
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/live-object": "0.8.2-main.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/plugin-deck": "0.8.2-main.
|
|
45
|
-
"@dxos/plugin-
|
|
46
|
-
"@dxos/plugin-
|
|
47
|
-
"@dxos/protocols": "0.8.2-main.
|
|
48
|
-
"@dxos/react-ui-
|
|
49
|
-
"@dxos/react-client": "0.8.2-main.
|
|
50
|
-
"@dxos/react-ui-
|
|
51
|
-
"@dxos/react-ui-
|
|
52
|
-
"@dxos/react-ui-stack": "0.8.2-main.
|
|
53
|
-
"@dxos/react-ui-
|
|
54
|
-
"@dxos/
|
|
32
|
+
"effect": "^3.13.3",
|
|
33
|
+
"@dxos/app-framework": "0.8.2-main.fbd8ed0",
|
|
34
|
+
"@dxos/app-graph": "0.8.2-main.fbd8ed0",
|
|
35
|
+
"@dxos/async": "0.8.2-main.fbd8ed0",
|
|
36
|
+
"@dxos/debug": "0.8.2-main.fbd8ed0",
|
|
37
|
+
"@dxos/echo": "0.8.2-main.fbd8ed0",
|
|
38
|
+
"@dxos/invariant": "0.8.2-main.fbd8ed0",
|
|
39
|
+
"@dxos/keyboard": "0.8.2-main.fbd8ed0",
|
|
40
|
+
"@dxos/live-object": "0.8.2-main.fbd8ed0",
|
|
41
|
+
"@dxos/echo-schema": "0.8.2-main.fbd8ed0",
|
|
42
|
+
"@dxos/local-storage": "0.8.2-main.fbd8ed0",
|
|
43
|
+
"@dxos/log": "0.8.2-main.fbd8ed0",
|
|
44
|
+
"@dxos/plugin-deck": "0.8.2-main.fbd8ed0",
|
|
45
|
+
"@dxos/plugin-graph": "0.8.2-main.fbd8ed0",
|
|
46
|
+
"@dxos/plugin-observability": "0.8.2-main.fbd8ed0",
|
|
47
|
+
"@dxos/protocols": "0.8.2-main.fbd8ed0",
|
|
48
|
+
"@dxos/react-ui-attention": "0.8.2-main.fbd8ed0",
|
|
49
|
+
"@dxos/react-client": "0.8.2-main.fbd8ed0",
|
|
50
|
+
"@dxos/react-ui-menu": "0.8.2-main.fbd8ed0",
|
|
51
|
+
"@dxos/react-ui-list": "0.8.2-main.fbd8ed0",
|
|
52
|
+
"@dxos/react-ui-stack": "0.8.2-main.fbd8ed0",
|
|
53
|
+
"@dxos/react-ui-searchlist": "0.8.2-main.fbd8ed0",
|
|
54
|
+
"@dxos/react-ui-tabs": "0.8.2-main.fbd8ed0",
|
|
55
|
+
"@dxos/util": "0.8.2-main.fbd8ed0"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
58
|
+
"@effect-rx/rx-react": "^0.34.1",
|
|
59
|
+
"@effect/platform": "0.80.12",
|
|
57
60
|
"@phosphor-icons/react": "^2.1.5",
|
|
58
61
|
"@types/react": "~18.2.0",
|
|
59
62
|
"@types/react-dom": "~18.2.0",
|
|
60
63
|
"react": "~18.2.0",
|
|
61
64
|
"react-dom": "~18.2.0",
|
|
62
65
|
"vite": "5.4.7",
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
66
|
+
"@dxos/plugin-attention": "0.8.2-main.fbd8ed0",
|
|
67
|
+
"@dxos/plugin-storybook-layout": "0.8.2-main.fbd8ed0",
|
|
68
|
+
"@dxos/echo-signals": "0.8.2-main.fbd8ed0",
|
|
69
|
+
"@dxos/plugin-theme": "0.8.2-main.fbd8ed0",
|
|
70
|
+
"@dxos/random": "0.8.2-main.fbd8ed0",
|
|
71
|
+
"@dxos/react-ui-theme": "0.8.2-main.fbd8ed0",
|
|
72
|
+
"@dxos/react-ui": "0.8.2-main.fbd8ed0",
|
|
73
|
+
"@dxos/storybook-utils": "0.8.2-main.fbd8ed0"
|
|
68
74
|
},
|
|
69
75
|
"peerDependencies": {
|
|
76
|
+
"@effect-rx/rx-react": "^0.34.1",
|
|
77
|
+
"@effect/platform": "0.80.12",
|
|
70
78
|
"@phosphor-icons/react": "^2.1.5",
|
|
79
|
+
"effect": "^3.13.3",
|
|
71
80
|
"react": "~18.2.0",
|
|
72
81
|
"react-dom": "~18.2.0",
|
|
73
|
-
"@dxos/react-ui
|
|
74
|
-
"@dxos/react-ui": "0.8.2-main.
|
|
82
|
+
"@dxos/react-ui": "0.8.2-main.fbd8ed0",
|
|
83
|
+
"@dxos/react-ui-theme": "0.8.2-main.fbd8ed0"
|
|
75
84
|
},
|
|
76
85
|
"publishConfig": {
|
|
77
86
|
"access": "public"
|
package/src/NavTreePlugin.tsx
CHANGED
|
@@ -57,8 +57,8 @@ export const NavTreePlugin = () =>
|
|
|
57
57
|
id: `${meta.id}/module/expose`,
|
|
58
58
|
activatesOn: allOf(Events.DispatcherReady, Events.LayoutReady, NavTreeEvents.StateReady),
|
|
59
59
|
activate: async (context) => {
|
|
60
|
-
const layout = context.
|
|
61
|
-
const { dispatchPromise: dispatch } = context.
|
|
60
|
+
const layout = context.getCapability(Capabilities.Layout);
|
|
61
|
+
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
62
62
|
if (dispatch && layout.active.length === 1) {
|
|
63
63
|
await dispatch(createIntent(LayoutAction.Expose, { part: 'navigation', subject: layout.active[0] }));
|
|
64
64
|
}
|
|
@@ -2,41 +2,51 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
+
import { Option, pipe } from 'effect';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, contributes, type PluginContext, createIntent, LayoutAction } from '@dxos/app-framework';
|
|
9
|
+
import { createExtension, ROOT_ID } from '@dxos/plugin-graph';
|
|
7
10
|
|
|
8
11
|
import { COMMANDS_DIALOG, NAVTREE_PLUGIN } from '../meta';
|
|
9
12
|
|
|
10
|
-
export default (context:
|
|
13
|
+
export default (context: PluginContext) =>
|
|
11
14
|
contributes(
|
|
12
15
|
Capabilities.AppGraphBuilder,
|
|
13
16
|
createExtension({
|
|
14
17
|
id: NAVTREE_PLUGIN,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
actions: (node) =>
|
|
19
|
+
Rx.make((get) =>
|
|
20
|
+
pipe(
|
|
21
|
+
get(node),
|
|
22
|
+
Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
|
|
23
|
+
Option.map(() => [
|
|
24
|
+
{
|
|
25
|
+
id: COMMANDS_DIALOG,
|
|
26
|
+
data: async () => {
|
|
27
|
+
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
28
|
+
await dispatch(
|
|
29
|
+
createIntent(LayoutAction.UpdateDialog, {
|
|
30
|
+
part: 'dialog',
|
|
31
|
+
subject: COMMANDS_DIALOG,
|
|
32
|
+
options: {
|
|
33
|
+
blockAlign: 'start',
|
|
34
|
+
},
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
37
|
+
},
|
|
38
|
+
properties: {
|
|
39
|
+
label: ['open commands label', { ns: NAVTREE_PLUGIN }],
|
|
40
|
+
icon: 'ph--magnifying-glass--regular',
|
|
41
|
+
keyBinding: {
|
|
42
|
+
macos: 'meta+k',
|
|
43
|
+
windows: 'ctrl+k',
|
|
44
|
+
},
|
|
27
45
|
},
|
|
28
|
-
}
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
icon: 'ph--magnifying-glass--regular',
|
|
34
|
-
keyBinding: {
|
|
35
|
-
macos: 'meta+k',
|
|
36
|
-
windows: 'ctrl+k',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
],
|
|
46
|
+
},
|
|
47
|
+
]),
|
|
48
|
+
Option.getOrElse(() => []),
|
|
49
|
+
),
|
|
50
|
+
),
|
|
41
51
|
}),
|
|
42
52
|
);
|
|
@@ -2,22 +2,23 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { contributes, type PluginContext, Capabilities, createResolver, LayoutAction } from '@dxos/app-framework';
|
|
7
8
|
import { log } from '@dxos/log';
|
|
8
9
|
|
|
9
10
|
import { NavTreeCapabilities } from './capabilities';
|
|
10
11
|
|
|
11
|
-
export default (context:
|
|
12
|
+
export default (context: PluginContext) =>
|
|
12
13
|
contributes(
|
|
13
14
|
Capabilities.IntentResolver,
|
|
14
15
|
createResolver({
|
|
15
16
|
intent: LayoutAction.UpdateLayout,
|
|
16
|
-
filter: (data): data is
|
|
17
|
-
|
|
17
|
+
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.Expose.fields.input> =>
|
|
18
|
+
Schema.is(LayoutAction.Expose.fields.input)(data),
|
|
18
19
|
resolve: async ({ subject }) => {
|
|
19
|
-
const { graph } = context.
|
|
20
|
-
const { getItem, setItem } = context.
|
|
20
|
+
const { graph } = context.getCapability(Capabilities.AppGraph);
|
|
21
|
+
const { getItem, setItem } = context.getCapability(NavTreeCapabilities.State);
|
|
21
22
|
|
|
22
23
|
try {
|
|
23
24
|
const path = await graph.waitForPath({ target: subject }, { timeout: 1_000 });
|
|
@@ -2,46 +2,51 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities as AppCapabilities, contributes, type
|
|
5
|
+
import { Capabilities as AppCapabilities, contributes, type PluginContext } from '@dxos/app-framework';
|
|
6
|
+
import { debounce } from '@dxos/async';
|
|
6
7
|
import { Keyboard } from '@dxos/keyboard';
|
|
7
|
-
import { isAction } from '@dxos/plugin-graph';
|
|
8
|
+
import { isAction, type Node } from '@dxos/plugin-graph';
|
|
8
9
|
import { getHostPlatform } from '@dxos/util';
|
|
9
10
|
|
|
10
11
|
import { KEY_BINDING } from '../meta';
|
|
11
12
|
|
|
12
|
-
export default (context:
|
|
13
|
-
const { graph } = context.
|
|
13
|
+
export default (context: PluginContext) => {
|
|
14
|
+
const { graph } = context.getCapability(AppCapabilities.AppGraph);
|
|
14
15
|
|
|
15
16
|
// TODO(wittjosiah): Factor out.
|
|
16
17
|
// TODO(wittjosiah): Handle removal of actions.
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
18
|
+
const visitor = (node: Node, path: string[]) => {
|
|
19
|
+
let shortcut: string | undefined;
|
|
20
|
+
if (typeof node.properties.keyBinding === 'object') {
|
|
21
|
+
const availablePlatforms = Object.keys(node.properties.keyBinding);
|
|
22
|
+
const platform = getHostPlatform();
|
|
23
|
+
shortcut = availablePlatforms.includes(platform)
|
|
24
|
+
? node.properties.keyBinding[platform]
|
|
25
|
+
: platform === 'ios'
|
|
26
|
+
? node.properties.keyBinding.macos // Fallback to macos if ios-specific bindings not provided.
|
|
27
|
+
: platform === 'linux' || platform === 'unknown'
|
|
28
|
+
? node.properties.keyBinding.windows // Fallback to windows if platform-specific bindings not provided.
|
|
29
|
+
: undefined;
|
|
30
|
+
} else {
|
|
31
|
+
shortcut = node.properties.keyBinding;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (shortcut && isAction(node)) {
|
|
35
|
+
Keyboard.singleton.getContext(path.slice(0, -1).join('/')).bind({
|
|
36
|
+
shortcut,
|
|
37
|
+
handler: () => {
|
|
38
|
+
void node.data({ parent: node, caller: KEY_BINDING });
|
|
39
|
+
},
|
|
40
|
+
data: node.properties.label,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const eventHandler = debounce(() => {
|
|
46
|
+
graph.traverse({ visitor });
|
|
47
|
+
}, 500);
|
|
48
|
+
|
|
49
|
+
const unsubscribe = graph.onNodeChanged.on(eventHandler);
|
|
45
50
|
|
|
46
51
|
// TODO(burdon): Create context and plugin.
|
|
47
52
|
Keyboard.singleton.initialize();
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { effect } from '@preact/signals-core';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, type
|
|
7
|
+
import { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';
|
|
8
8
|
import { type Live, live } from '@dxos/live-object';
|
|
9
9
|
import { Path } from '@dxos/react-ui-list';
|
|
10
10
|
|
|
@@ -33,8 +33,8 @@ const getInitialState = () => {
|
|
|
33
33
|
} catch {}
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
export default (context:
|
|
37
|
-
const layout = context.
|
|
36
|
+
export default (context: PluginContext) => {
|
|
37
|
+
const layout = context.getCapability(Capabilities.Layout);
|
|
38
38
|
|
|
39
39
|
// TODO(wittjosiah): This currently needs to be not a Live at the root.
|
|
40
40
|
// If it is a Live then React errors when initializing new paths because of state change during render.
|
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
import React, { useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { createIntent, LayoutAction, useAppGraph, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
-
import { type ActionLike,
|
|
8
|
+
import { type ActionLike, isAction, isActionGroup } from '@dxos/app-graph';
|
|
9
9
|
import { Keyboard, keySymbols } from '@dxos/keyboard';
|
|
10
|
+
import { useActions } from '@dxos/plugin-graph';
|
|
10
11
|
import { Button, Dialog, Icon, useTranslation, toLocalizedString } from '@dxos/react-ui';
|
|
11
12
|
import { SearchList } from '@dxos/react-ui-searchlist';
|
|
12
13
|
import { descriptionText, mx } from '@dxos/react-ui-theme';
|
|
13
14
|
import { getHostPlatform } from '@dxos/util';
|
|
14
15
|
|
|
15
|
-
import { KEY_BINDING, NAVTREE_PLUGIN } from '
|
|
16
|
+
import { KEY_BINDING, NAVTREE_PLUGIN } from '../../meta';
|
|
16
17
|
|
|
17
18
|
// TODO(wittjosiah): This probably deserves its own plugin but for now it lives here w/ other navigation UI.
|
|
18
19
|
export const CommandsDialogContent = ({ selected: initial }: { selected?: string }) => {
|
|
@@ -28,7 +29,7 @@ export const CommandsDialogContent = ({ selected: initial }: { selected?: string
|
|
|
28
29
|
const current = Keyboard.singleton.getCurrentContext();
|
|
29
30
|
const actionMap = new Set<string>();
|
|
30
31
|
const actions: ActionLike[] = [];
|
|
31
|
-
graph
|
|
32
|
+
graph.traverse({
|
|
32
33
|
visitor: (node, path) => {
|
|
33
34
|
if (
|
|
34
35
|
(isAction(node) || isActionGroup(node)) &&
|
|
@@ -47,12 +48,12 @@ export const CommandsDialogContent = ({ selected: initial }: { selected?: string
|
|
|
47
48
|
.localeCompare(toLocalizedString(b.properties.label, t)?.toLowerCase());
|
|
48
49
|
});
|
|
49
50
|
|
|
50
|
-
// console.log(JSON.stringify(actions, undefined, 2));
|
|
51
51
|
return actions;
|
|
52
52
|
}, [graph]);
|
|
53
53
|
|
|
54
54
|
const group = allActions.find(({ id }) => id === selected);
|
|
55
|
-
const
|
|
55
|
+
const groupActions = useActions(graph, group?.id);
|
|
56
|
+
const actions = isActionGroup(group) ? groupActions : allActions;
|
|
56
57
|
|
|
57
58
|
return (
|
|
58
59
|
<Dialog.Content classNames={['md:max-is-[30rem] overflow-hidden mbs-12']}>
|
|
@@ -84,8 +85,8 @@ export const CommandsDialogContent = ({ selected: initial }: { selected?: string
|
|
|
84
85
|
|
|
85
86
|
void dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } }));
|
|
86
87
|
setTimeout(() => {
|
|
87
|
-
const node = graph.
|
|
88
|
-
void (node && isAction(action) && action.data({ node, caller: KEY_BINDING }));
|
|
88
|
+
const node = graph.getConnections(group?.id ?? action.id, 'inbound')[0];
|
|
89
|
+
void (node && isAction(action) && action.data({ parent: node, caller: KEY_BINDING }));
|
|
89
90
|
});
|
|
90
91
|
}}
|
|
91
92
|
classNames='flex items-center gap-2'
|
|
@@ -9,7 +9,7 @@ import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-frame
|
|
|
9
9
|
import { Button, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { getSize } from '@dxos/react-ui-theme';
|
|
11
11
|
|
|
12
|
-
import { COMMANDS_DIALOG, NAVTREE_PLUGIN } from '
|
|
12
|
+
import { COMMANDS_DIALOG, NAVTREE_PLUGIN } from '../../meta';
|
|
13
13
|
|
|
14
14
|
// TODO(thure): Refactor to be handled by a more appropriate plugin.
|
|
15
15
|
export const CommandsTrigger = () => {
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
+
import { Schema } from 'effect';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
Capabilities,
|
|
13
|
+
IntentPlugin,
|
|
14
|
+
LayoutAction,
|
|
15
|
+
SettingsPlugin,
|
|
16
|
+
contributes,
|
|
17
|
+
createResolver,
|
|
18
|
+
defineCapability,
|
|
19
|
+
useCapability,
|
|
20
|
+
} from '@dxos/app-framework';
|
|
21
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
22
|
+
import { live } from '@dxos/live-object';
|
|
23
|
+
import { AttentionPlugin } from '@dxos/plugin-attention';
|
|
24
|
+
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
25
|
+
import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
26
|
+
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
27
|
+
import { faker } from '@dxos/random';
|
|
28
|
+
import { IconButton, Input, Main, Toolbar } from '@dxos/react-ui';
|
|
29
|
+
import { useAttendableAttributes, useAttention } from '@dxos/react-ui-attention';
|
|
30
|
+
import { Stack, StackItem } from '@dxos/react-ui-stack';
|
|
31
|
+
import { defaultTx, mx } from '@dxos/react-ui-theme';
|
|
32
|
+
import { withLayout } from '@dxos/storybook-utils';
|
|
33
|
+
|
|
34
|
+
import { NavTreePlugin } from '../../NavTreePlugin';
|
|
35
|
+
import { storybookGraphBuilders } from '../../testing';
|
|
36
|
+
import translations from '../../translations';
|
|
37
|
+
import { NavTreeContainer } from '../NavTreeContainer';
|
|
38
|
+
|
|
39
|
+
faker.seed(1234);
|
|
40
|
+
|
|
41
|
+
const StoryState = defineCapability<{ tab: string }>('story-state');
|
|
42
|
+
|
|
43
|
+
// TODO(burdon): Fix outline (e.g., button in sidebar nav is clipped when focused).
|
|
44
|
+
// TODO(burdon): Consider similar containment of: Table, Sheet, Kanban Column, Form, etc.
|
|
45
|
+
|
|
46
|
+
const container = 'flex flex-col grow gap-2 p-4 rounded-md';
|
|
47
|
+
|
|
48
|
+
// TODO(burdon): Factor out PlankHeader.
|
|
49
|
+
const StoryPlankHeading = ({ attendableId }: { attendableId: string }) => {
|
|
50
|
+
const { hasAttention } = useAttention(attendableId);
|
|
51
|
+
console.log('hasAttention', hasAttention);
|
|
52
|
+
return (
|
|
53
|
+
<div className='flex p-1 items-center border-b border-separator'>
|
|
54
|
+
<IconButton
|
|
55
|
+
density='coarse'
|
|
56
|
+
icon='ph--atom--regular'
|
|
57
|
+
label='Test'
|
|
58
|
+
iconOnly
|
|
59
|
+
variant={hasAttention ? 'primary' : 'ghost'}
|
|
60
|
+
classNames='is-[--rail-action] bs-[--rail-action]'
|
|
61
|
+
/>
|
|
62
|
+
<StackItem.ResizeHandle />
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const StoryPlank = ({ attendableId }: { attendableId: string }) => {
|
|
68
|
+
const attentionAttrs = useAttendableAttributes(attendableId);
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<StackItem.Root
|
|
72
|
+
item={{ id: attendableId }}
|
|
73
|
+
{...attentionAttrs}
|
|
74
|
+
classNames='bg-baseSurface border-ie border-separator'
|
|
75
|
+
size={30}
|
|
76
|
+
>
|
|
77
|
+
<StoryPlankHeading attendableId={attendableId} />
|
|
78
|
+
<StackItem.Content toolbar>
|
|
79
|
+
<Toolbar.Root classNames='border-b border-separator'>
|
|
80
|
+
<Toolbar.Button>Test</Toolbar.Button>
|
|
81
|
+
</Toolbar.Root>
|
|
82
|
+
|
|
83
|
+
<div className={mx(container, 'm-2 bg-groupSurface')}>
|
|
84
|
+
<Input.Root>
|
|
85
|
+
<Input.Label>Level 1 (group)</Input.Label>
|
|
86
|
+
</Input.Root>
|
|
87
|
+
<div className={mx(container, 'bg-baseSurface')}>
|
|
88
|
+
<Input.Root>
|
|
89
|
+
<Input.Label>Level 2 (base)</Input.Label>
|
|
90
|
+
<Input.TextArea placeholder='Enter text' />
|
|
91
|
+
</Input.Root>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</StackItem.Content>
|
|
95
|
+
</StackItem.Root>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const DefaultStory = () => {
|
|
100
|
+
const state = useCapability(StoryState);
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<Main.Root complementarySidebarState='closed'>
|
|
104
|
+
<Main.NavigationSidebar label='Navigation' classNames='grid'>
|
|
105
|
+
<NavTreeContainer tab={state.tab} />
|
|
106
|
+
</Main.NavigationSidebar>
|
|
107
|
+
<Main.Content bounce handlesFocus>
|
|
108
|
+
<Stack orientation='horizontal' size='contain'>
|
|
109
|
+
<StoryPlank attendableId='space-0:object-0' />
|
|
110
|
+
<StoryPlank attendableId='space-0:object-1' />
|
|
111
|
+
</Stack>
|
|
112
|
+
</Main.Content>
|
|
113
|
+
</Main.Root>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const meta: Meta<typeof NavTreeContainer> = {
|
|
118
|
+
title: 'plugins/plugin-navtree/NavTree',
|
|
119
|
+
component: NavTreeContainer,
|
|
120
|
+
render: DefaultStory,
|
|
121
|
+
decorators: [
|
|
122
|
+
withPluginManager({
|
|
123
|
+
plugins: [
|
|
124
|
+
ThemePlugin({ tx: defaultTx }),
|
|
125
|
+
StorybookLayoutPlugin({ initialState: { sidebarState: 'expanded' } }),
|
|
126
|
+
GraphPlugin(),
|
|
127
|
+
IntentPlugin(),
|
|
128
|
+
SettingsPlugin(),
|
|
129
|
+
AttentionPlugin(),
|
|
130
|
+
NavTreePlugin(),
|
|
131
|
+
],
|
|
132
|
+
capabilities: (context) => [
|
|
133
|
+
contributes(StoryState, live({ tab: 'space-0' })),
|
|
134
|
+
contributes(Capabilities.AppGraphBuilder, storybookGraphBuilders),
|
|
135
|
+
contributes(Capabilities.IntentResolver, [
|
|
136
|
+
createResolver({
|
|
137
|
+
intent: LayoutAction.UpdateLayout,
|
|
138
|
+
filter: (data): data is Schema.Schema.Type<typeof LayoutAction.SwitchWorkspace.fields.input> =>
|
|
139
|
+
Schema.is(LayoutAction.SwitchWorkspace.fields.input)(data),
|
|
140
|
+
resolve: ({ subject }) => {
|
|
141
|
+
const state = context.getCapability(StoryState);
|
|
142
|
+
state.tab = subject;
|
|
143
|
+
},
|
|
144
|
+
}),
|
|
145
|
+
]),
|
|
146
|
+
],
|
|
147
|
+
}),
|
|
148
|
+
withLayout({ fullscreen: true }),
|
|
149
|
+
],
|
|
150
|
+
parameters: {
|
|
151
|
+
translations,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export default meta;
|
|
156
|
+
|
|
157
|
+
type Story = StoryObj<typeof NavTreeContainer>;
|
|
158
|
+
|
|
159
|
+
export const Default: Story = {};
|