@dxos/plugin-navtree 0.7.5-labs.a279d8c → 0.7.5-labs.ea4b4c2
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-OF4MMBLH.mjs → app-graph-builder-BL7LRXCM.mjs} +7 -5
- package/dist/lib/browser/{app-graph-builder-OF4MMBLH.mjs.map → app-graph-builder-BL7LRXCM.mjs.map} +3 -3
- package/dist/lib/browser/chunk-54MPRXMH.mjs +1109 -0
- package/dist/lib/browser/chunk-54MPRXMH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OI7AAA6Q.mjs → chunk-AOAGODQB.mjs} +1 -1
- package/dist/lib/browser/chunk-AOAGODQB.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +21 -26
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-U25VBFH3.mjs +47 -0
- package/dist/lib/browser/intent-resolver-U25VBFH3.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-LNRTNSM6.mjs +57 -0
- package/dist/lib/browser/react-surface-LNRTNSM6.mjs.map +7 -0
- package/dist/lib/browser/{state-HT65TAYL.mjs → state-65TQKYX7.mjs} +6 -9
- package/dist/lib/browser/state-65TQKYX7.mjs.map +7 -0
- package/dist/types/src/NavTreePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +22 -22
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +3 -2
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +88 -32
- 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/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +3 -3
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/CommandsDialog.d.ts.map +1 -1
- package/dist/types/src/components/CommandsTrigger.d.ts.map +1 -1
- package/dist/types/src/components/L0Menu.d.ts +9 -0
- package/dist/types/src/components/L0Menu.d.ts.map +1 -0
- package/dist/types/src/components/L1Panels.d.ts +8 -0
- package/dist/types/src/components/L1Panels.d.ts.map +1 -0
- package/dist/types/src/components/NavTree.d.ts +3 -20
- package/dist/types/src/components/NavTree.d.ts.map +1 -1
- package/dist/types/src/components/NavTree.stories.d.ts +2 -2
- package/dist/types/src/components/NavTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeContainer.d.ts +4 -3
- package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeContext.d.ts +4 -0
- package/dist/types/src/components/NavTreeContext.d.ts.map +1 -0
- package/dist/types/src/components/NavTreeItemAction.d.ts +1 -1
- package/dist/types/src/components/NavTreeItemAction.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItemColumns.d.ts +4 -0
- package/dist/types/src/components/NavTreeItemColumns.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/types.d.ts +25 -0
- package/dist/types/src/components/types.d.ts.map +1 -0
- package/dist/types/src/hooks.d.ts +3 -0
- package/dist/types/src/hooks.d.ts.map +1 -0
- package/dist/types/src/stories/Graph.stories.d.ts +2 -2
- package/dist/types/src/stories/Graph.stories.d.ts.map +1 -1
- package/dist/types/src/stories/StorybookNavTree.d.ts +4 -0
- package/dist/types/src/stories/StorybookNavTree.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +0 -6
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +2 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +9 -0
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -31
- package/src/NavTreePlugin.tsx +8 -10
- package/src/capabilities/app-graph-builder.ts +6 -4
- package/src/capabilities/capabilities.ts +3 -2
- package/src/capabilities/intent-resolver.ts +22 -16
- package/src/capabilities/react-surface.tsx +15 -41
- package/src/capabilities/state.ts +5 -8
- package/src/components/CommandsDialog.tsx +3 -4
- package/src/components/CommandsTrigger.tsx +7 -5
- package/src/components/L0Menu.tsx +210 -0
- package/src/components/L1Panels.tsx +100 -0
- package/src/components/NavTree.stories.tsx +5 -5
- package/src/components/NavTree.tsx +26 -116
- package/src/components/NavTreeContainer.tsx +106 -32
- package/src/components/NavTreeContext.tsx +13 -0
- package/src/components/NavTreeItemAction.tsx +12 -4
- package/src/components/NavTreeItemColumns.tsx +71 -0
- package/src/components/NotchStart.tsx +2 -2
- package/src/components/index.ts +2 -0
- package/src/components/types.ts +33 -0
- package/src/hooks.ts +21 -0
- package/src/stories/Graph.stories.tsx +5 -4
- package/src/stories/StorybookNavTree.tsx +63 -0
- package/src/translations.ts +0 -6
- package/src/types.ts +2 -1
- package/src/util.ts +54 -0
- package/dist/lib/browser/chunk-IMGT2LAL.mjs +0 -658
- package/dist/lib/browser/chunk-IMGT2LAL.mjs.map +0 -7
- package/dist/lib/browser/chunk-OI7AAA6Q.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-74JPWYBP.mjs +0 -42
- package/dist/lib/browser/intent-resolver-74JPWYBP.mjs.map +0 -7
- package/dist/lib/browser/react-surface-6QWXI53A.mjs +0 -189
- package/dist/lib/browser/react-surface-6QWXI53A.mjs.map +0 -7
- package/dist/lib/browser/state-HT65TAYL.mjs.map +0 -7
- package/dist/types/src/components/NavTreeFooter.d.ts +0 -6
- package/dist/types/src/components/NavTreeFooter.d.ts.map +0 -1
- package/src/components/NavTreeFooter.tsx +0 -161
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,UAAU,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,UAAU,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,GAAG,EACH,OAAO,CACL,cAAc,GAAG;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAClC,mBAAmB,EAAE,CAAC,SAAS,EAAE,oBAAoB,EAAE,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;IAC/E,MAAM,EAAE,CAAC,UAAU,EAAE,oBAAoB,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;IACjF,eAAe,EAAE,CAAC,UAAU,EAAE,oBAAoB,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;IAC1F,aAAa,EAAE,CAAC,UAAU,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,oBAAoB,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;CAClH,CACF,CACF,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAC1C,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,GAAG;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IAGvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
package/dist/types/src/util.d.ts
CHANGED
|
@@ -9,4 +9,13 @@ export declare const getActions: (graph: Graph, node: Node) => FlattenedActions;
|
|
|
9
9
|
export declare const expandChildrenAndActions: (graph: Graph, node: Node) => Promise<[void, [void, void]]>;
|
|
10
10
|
export declare const expandChildren: (graph: Graph, node: Node) => Promise<void>;
|
|
11
11
|
export declare const expandActions: (graph: Graph, node: Node) => Promise<[void, void]>;
|
|
12
|
+
export declare const l0ItemType: (item: Node<any>) => "collection" | "action" | "link" | "tab";
|
|
13
|
+
/**
|
|
14
|
+
* Returns the first two renderable characters from a string that are separated by non-word characters.
|
|
15
|
+
* Handles Unicode characters correctly.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} label - The input string to process
|
|
18
|
+
* @returns {[string, string]} Array containing the two characters, or empty strings if not found
|
|
19
|
+
*/
|
|
20
|
+
export declare const getFirstTwoRenderableChars: (label: string) => string[];
|
|
12
21
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,KAAK,EAKX,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE3E,eAAO,MAAM,SAAS,UACb,KAAK,QACN,oBAAoB,QACpB,MAAM,EAAE,KACb,oBAAoB,GAAG,SAGzB,CAAC;AAEF,eAAO,MAAM,oBAAoB,UACxB,KAAK,QACN,oBAAoB,QACpB,MAAM,EAAE,oBACI,MAAM,KACvB,oBAAoB,GAAG,IAOzB,CAAC;AAEF,eAAO,MAAM,yBAAyB,UAC7B,KAAK,cACA,oBAAoB,mBACf,MAAM,EAAE,2BACA,oBAAoB,KAC5C,UAAU,GAAG,MAAM,GAAG,QAsBxB,CAAC;AAGF,eAAO,MAAM,WAAW,YAAa,MAAM,EAAE,KAAG,MAAM,EAWlD,CAAC;AAEL,eAAO,MAAM,WAAW,UACf,KAAK,QACN,oBAAoB,WACjB,UAAU,SACb,SAAS,MAAM,EAAE,KACtB,oBAAoB,EAStB,CAAC;AAEF,eAAO,MAAM,UAAU,UAAW,KAAK,QAAQ,IAAI,KAAG,gBAgBrD,CAAC;AAEF,eAAO,MAAM,wBAAwB,UAAW,KAAK,QAAQ,IAAI,kCAEhE,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,KAAK,QAAQ,IAAI,kBAEtD,CAAC;AAEF,eAAO,MAAM,aAAa,UAAW,KAAK,QAAQ,IAAI,0BAErD,CAAC;AAEF,eAAO,MAAM,UAAU,SAAU,IAAI,CAAC,GAAG,CAAC,6CAUzC,CAAC;AAOF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,UAAW,MAAM,aA2BvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.7.
|
|
1
|
+
{"version":"5.7.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-navtree",
|
|
3
|
-
"version": "0.7.5-labs.
|
|
3
|
+
"version": "0.7.5-labs.ea4b4c2",
|
|
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",
|
|
@@ -25,30 +25,32 @@
|
|
|
25
25
|
"@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
|
|
26
26
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
|
|
27
27
|
"@preact/signals-core": "^1.6.0",
|
|
28
|
-
"@radix-ui/react-
|
|
28
|
+
"@radix-ui/react-dismissable-layer": "1.1.5",
|
|
29
|
+
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
29
30
|
"date-fns": "^3.3.1",
|
|
30
|
-
"@dxos/app-framework": "0.7.5-labs.
|
|
31
|
-
"@dxos/app-graph": "0.7.5-labs.
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/keyboard": "0.7.5-labs.
|
|
37
|
-
"@dxos/live-object": "0.7.5-labs.
|
|
38
|
-
"@dxos/log": "0.7.5-labs.
|
|
39
|
-
"@dxos/plugin-client": "0.7.5-labs.
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/plugin-
|
|
42
|
-
"@dxos/plugin-
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/protocols": "0.7.5-labs.
|
|
45
|
-
"@dxos/react-client": "0.7.5-labs.
|
|
46
|
-
"@dxos/react-ui-list": "0.7.5-labs.
|
|
47
|
-
"@dxos/react-ui-
|
|
48
|
-
"@dxos/react-ui-
|
|
49
|
-
"@dxos/react-ui-stack": "0.7.5-labs.
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/react-ui-menu": "0.7.5-labs.
|
|
31
|
+
"@dxos/app-framework": "0.7.5-labs.ea4b4c2",
|
|
32
|
+
"@dxos/app-graph": "0.7.5-labs.ea4b4c2",
|
|
33
|
+
"@dxos/async": "0.7.5-labs.ea4b4c2",
|
|
34
|
+
"@dxos/debug": "0.7.5-labs.ea4b4c2",
|
|
35
|
+
"@dxos/echo-schema": "0.7.5-labs.ea4b4c2",
|
|
36
|
+
"@dxos/invariant": "0.7.5-labs.ea4b4c2",
|
|
37
|
+
"@dxos/keyboard": "0.7.5-labs.ea4b4c2",
|
|
38
|
+
"@dxos/live-object": "0.7.5-labs.ea4b4c2",
|
|
39
|
+
"@dxos/log": "0.7.5-labs.ea4b4c2",
|
|
40
|
+
"@dxos/plugin-client": "0.7.5-labs.ea4b4c2",
|
|
41
|
+
"@dxos/local-storage": "0.7.5-labs.ea4b4c2",
|
|
42
|
+
"@dxos/plugin-graph": "0.7.5-labs.ea4b4c2",
|
|
43
|
+
"@dxos/plugin-observability": "0.7.5-labs.ea4b4c2",
|
|
44
|
+
"@dxos/plugin-theme": "0.7.5-labs.ea4b4c2",
|
|
45
|
+
"@dxos/protocols": "0.7.5-labs.ea4b4c2",
|
|
46
|
+
"@dxos/react-client": "0.7.5-labs.ea4b4c2",
|
|
47
|
+
"@dxos/react-ui-list": "0.7.5-labs.ea4b4c2",
|
|
48
|
+
"@dxos/react-ui-searchlist": "0.7.5-labs.ea4b4c2",
|
|
49
|
+
"@dxos/react-ui-mosaic": "0.7.5-labs.ea4b4c2",
|
|
50
|
+
"@dxos/react-ui-stack": "0.7.5-labs.ea4b4c2",
|
|
51
|
+
"@dxos/react-ui-tabs": "0.7.5-labs.ea4b4c2",
|
|
52
|
+
"@dxos/react-ui-menu": "0.7.5-labs.ea4b4c2",
|
|
53
|
+
"@dxos/util": "0.7.5-labs.ea4b4c2"
|
|
52
54
|
},
|
|
53
55
|
"devDependencies": {
|
|
54
56
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -57,18 +59,18 @@
|
|
|
57
59
|
"react": "~18.2.0",
|
|
58
60
|
"react-dom": "~18.2.0",
|
|
59
61
|
"vite": "5.4.7",
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
62
|
+
"@dxos/random": "0.7.5-labs.ea4b4c2",
|
|
63
|
+
"@dxos/echo-signals": "0.7.5-labs.ea4b4c2",
|
|
64
|
+
"@dxos/react-ui-theme": "0.7.5-labs.ea4b4c2",
|
|
65
|
+
"@dxos/storybook-utils": "0.7.5-labs.ea4b4c2",
|
|
66
|
+
"@dxos/react-ui": "0.7.5-labs.ea4b4c2"
|
|
65
67
|
},
|
|
66
68
|
"peerDependencies": {
|
|
67
69
|
"@phosphor-icons/react": "^2.1.5",
|
|
68
70
|
"react": "~18.2.0",
|
|
69
71
|
"react-dom": "~18.2.0",
|
|
70
|
-
"@dxos/react-ui": "0.7.5-labs.
|
|
71
|
-
"@dxos/react-ui
|
|
72
|
+
"@dxos/react-ui-theme": "0.7.5-labs.ea4b4c2",
|
|
73
|
+
"@dxos/react-ui": "0.7.5-labs.ea4b4c2"
|
|
72
74
|
},
|
|
73
75
|
"publishConfig": {
|
|
74
76
|
"access": "public"
|
package/src/NavTreePlugin.tsx
CHANGED
|
@@ -9,9 +9,8 @@ import {
|
|
|
9
9
|
contributes,
|
|
10
10
|
Capabilities,
|
|
11
11
|
allOf,
|
|
12
|
-
oneOf,
|
|
13
|
-
NavigationAction,
|
|
14
12
|
createIntent,
|
|
13
|
+
LayoutAction,
|
|
15
14
|
} from '@dxos/app-framework';
|
|
16
15
|
import { type TreeData } from '@dxos/react-ui-list';
|
|
17
16
|
|
|
@@ -25,7 +24,7 @@ export const NavTreePlugin = () =>
|
|
|
25
24
|
definePlugin(meta, [
|
|
26
25
|
defineModule({
|
|
27
26
|
id: `${meta.id}/module/state`,
|
|
28
|
-
activatesOn:
|
|
27
|
+
activatesOn: Events.LayoutReady,
|
|
29
28
|
activatesAfter: [NavTreeEvents.StateReady],
|
|
30
29
|
activate: State,
|
|
31
30
|
}),
|
|
@@ -36,7 +35,7 @@ export const NavTreePlugin = () =>
|
|
|
36
35
|
}),
|
|
37
36
|
defineModule({
|
|
38
37
|
id: `${meta.id}/module/metadata`,
|
|
39
|
-
activatesOn:
|
|
38
|
+
activatesOn: Events.SetupMetadata,
|
|
40
39
|
activate: () =>
|
|
41
40
|
contributes(Capabilities.Metadata, {
|
|
42
41
|
id: NODE_TYPE,
|
|
@@ -56,14 +55,13 @@ export const NavTreePlugin = () =>
|
|
|
56
55
|
}),
|
|
57
56
|
defineModule({
|
|
58
57
|
id: `${meta.id}/module/expose`,
|
|
59
|
-
activatesOn: allOf(Events.DispatcherReady, Events.LayoutReady,
|
|
58
|
+
activatesOn: allOf(Events.DispatcherReady, Events.LayoutReady, NavTreeEvents.StateReady),
|
|
60
59
|
activate: async (context) => {
|
|
61
|
-
const
|
|
60
|
+
const layout = context.requestCapability(Capabilities.Layout);
|
|
62
61
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
63
62
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
await dispatch(createIntent(NavigationAction.Expose, { id: soloPart.id }));
|
|
63
|
+
if (dispatch && layout.active.length === 1) {
|
|
64
|
+
await dispatch(createIntent(LayoutAction.Expose, { part: 'navigation', subject: layout.active[0] }));
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
return [];
|
|
@@ -76,7 +74,7 @@ export const NavTreePlugin = () =>
|
|
|
76
74
|
}),
|
|
77
75
|
defineModule({
|
|
78
76
|
id: `${meta.id}/module/react-surface`,
|
|
79
|
-
activatesOn: Events.
|
|
77
|
+
activatesOn: Events.SetupSurfaces,
|
|
80
78
|
activate: ReactSurface,
|
|
81
79
|
}),
|
|
82
80
|
defineModule({
|
|
@@ -19,10 +19,12 @@ export default (context: PluginsContext) =>
|
|
|
19
19
|
data: async () => {
|
|
20
20
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
21
21
|
await dispatch(
|
|
22
|
-
createIntent(LayoutAction.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
createIntent(LayoutAction.UpdateDialog, {
|
|
23
|
+
part: 'dialog',
|
|
24
|
+
subject: COMMANDS_DIALOG,
|
|
25
|
+
options: {
|
|
26
|
+
blockAlign: 'start',
|
|
27
|
+
},
|
|
26
28
|
}),
|
|
27
29
|
);
|
|
28
30
|
},
|
|
@@ -6,13 +6,14 @@ import { defineCapability } from '@dxos/app-framework';
|
|
|
6
6
|
import { type ReactiveObject } from '@dxos/live-object';
|
|
7
7
|
|
|
8
8
|
import { NAVTREE_PLUGIN } from '../meta';
|
|
9
|
+
import { type NavTreeItemGraphNode } from '../types';
|
|
9
10
|
|
|
10
11
|
export namespace NavTreeCapabilities {
|
|
11
12
|
export const State = defineCapability<{
|
|
12
13
|
state: Map<string, ReactiveObject<{ open: boolean; current: boolean }>>;
|
|
13
14
|
getItem: (path: string[]) => ReactiveObject<{ open: boolean; current: boolean }>;
|
|
14
15
|
setItem: (path: string[], key: 'open' | 'current', next: boolean) => void;
|
|
15
|
-
isOpen: (path: string[]) => boolean;
|
|
16
|
-
isCurrent: (path: string[]) => boolean;
|
|
16
|
+
isOpen: (path: string[], item: NavTreeItemGraphNode) => boolean;
|
|
17
|
+
isCurrent: (path: string[], item: NavTreeItemGraphNode) => boolean;
|
|
17
18
|
}>(`${NAVTREE_PLUGIN}/capability/state`);
|
|
18
19
|
}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { contributes, type PluginsContext, Capabilities,
|
|
5
|
+
import { contributes, type PluginsContext, Capabilities, createResolver, LayoutAction } from '@dxos/app-framework';
|
|
6
|
+
import { S } from '@dxos/echo-schema';
|
|
6
7
|
import { log } from '@dxos/log';
|
|
7
8
|
|
|
8
9
|
import { NavTreeCapabilities } from './capabilities';
|
|
@@ -10,21 +11,26 @@ import { NavTreeCapabilities } from './capabilities';
|
|
|
10
11
|
export default (context: PluginsContext) =>
|
|
11
12
|
contributes(
|
|
12
13
|
Capabilities.IntentResolver,
|
|
13
|
-
createResolver(
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
createResolver({
|
|
15
|
+
intent: LayoutAction.UpdateLayout,
|
|
16
|
+
filter: (data): data is S.Schema.Type<typeof LayoutAction.Expose.fields.input> =>
|
|
17
|
+
S.is(LayoutAction.Expose.fields.input)(data),
|
|
18
|
+
resolve: async ({ subject }) => {
|
|
19
|
+
const { graph } = context.requestCapability(Capabilities.AppGraph);
|
|
20
|
+
const { getItem, setItem } = context.requestCapability(NavTreeCapabilities.State);
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
try {
|
|
23
|
+
const path = await graph.waitForPath({ target: subject }, { timeout: 1_000 });
|
|
24
|
+
[...Array(path.length)].forEach((_, index) => {
|
|
25
|
+
const subpath = path.slice(0, index);
|
|
26
|
+
const value = getItem(subpath);
|
|
27
|
+
if (!value.open) {
|
|
28
|
+
setItem(subpath, 'open', true);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
} catch {
|
|
32
|
+
log('Path to node not found', { subject });
|
|
33
|
+
}
|
|
34
|
+
},
|
|
29
35
|
}),
|
|
30
36
|
);
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React
|
|
5
|
+
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { isGraphNode
|
|
7
|
+
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
+
import { isGraphNode } from '@dxos/plugin-graph';
|
|
9
9
|
|
|
10
|
-
import { NavTreeCapabilities } from './capabilities';
|
|
11
10
|
import {
|
|
12
11
|
CommandsDialogContent,
|
|
13
12
|
CommandsTrigger,
|
|
@@ -15,48 +14,28 @@ import {
|
|
|
15
14
|
NotchStart,
|
|
16
15
|
NavTreeContainer,
|
|
17
16
|
} from '../components';
|
|
18
|
-
import { NavTreeFooter } from '../components/NavTreeFooter';
|
|
19
17
|
import { COMMANDS_DIALOG, NAVTREE_PLUGIN } from '../meta';
|
|
20
|
-
import { type NavTreeItemGraphNode } from '../types';
|
|
21
|
-
import { expandChildrenAndActions } from '../util';
|
|
22
18
|
|
|
23
19
|
export default () =>
|
|
24
20
|
contributes(Capabilities.ReactSurface, [
|
|
25
21
|
createSurface({
|
|
26
22
|
id: COMMANDS_DIALOG,
|
|
27
23
|
role: 'dialog',
|
|
28
|
-
filter: (data): data is {
|
|
29
|
-
component: ({ data }) => <CommandsDialogContent
|
|
24
|
+
filter: (data): data is { props: { selected?: string } } => data.component === COMMANDS_DIALOG,
|
|
25
|
+
component: ({ data }) => <CommandsDialogContent {...data.props} />,
|
|
30
26
|
}),
|
|
31
27
|
createSurface({
|
|
32
28
|
id: `${NAVTREE_PLUGIN}/navigation`,
|
|
33
29
|
role: 'navigation',
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (graph) {
|
|
44
|
-
const node = graph.findNode(id);
|
|
45
|
-
return node && expandChildrenAndActions(graph, node as NavTreeItemGraphNode);
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
[graph],
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<NavTreeContainer
|
|
53
|
-
isOpen={isOpen}
|
|
54
|
-
isCurrent={isCurrent}
|
|
55
|
-
onOpenChange={handleOpenChange}
|
|
56
|
-
popoverAnchorId={data.popoverAnchorId as string | undefined}
|
|
57
|
-
/>
|
|
58
|
-
);
|
|
59
|
-
},
|
|
30
|
+
filter: (data): data is { popoverAnchorId?: string; topbar: boolean; current: string } =>
|
|
31
|
+
typeof data.current === 'string',
|
|
32
|
+
component: ({ data }) => (
|
|
33
|
+
<NavTreeContainer
|
|
34
|
+
tab={data.current}
|
|
35
|
+
popoverAnchorId={data.popoverAnchorId as string | undefined}
|
|
36
|
+
topbar={data.topbar as boolean}
|
|
37
|
+
/>
|
|
38
|
+
),
|
|
60
39
|
}),
|
|
61
40
|
createSurface({
|
|
62
41
|
id: `${NAVTREE_PLUGIN}/document-title`,
|
|
@@ -68,15 +47,10 @@ export default () =>
|
|
|
68
47
|
role: 'notch-start',
|
|
69
48
|
component: () => <NotchStart />,
|
|
70
49
|
}),
|
|
71
|
-
createSurface({
|
|
72
|
-
id: `${NAVTREE_PLUGIN}/header-end`,
|
|
73
|
-
role: 'header-end',
|
|
74
|
-
component: () => <NavTreeFooter />,
|
|
75
|
-
}),
|
|
76
50
|
createSurface({
|
|
77
51
|
id: `${NAVTREE_PLUGIN}/search-input`,
|
|
78
52
|
role: 'search-input',
|
|
79
|
-
|
|
53
|
+
position: 'fallback',
|
|
80
54
|
component: () => <CommandsTrigger />,
|
|
81
55
|
}),
|
|
82
56
|
]);
|
|
@@ -34,6 +34,8 @@ const getInitialState = () => {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export default (context: PluginsContext) => {
|
|
37
|
+
const layout = context.requestCapability(Capabilities.Layout);
|
|
38
|
+
|
|
37
39
|
// TODO(wittjosiah): This currently needs to be not a ReactiveObject at the root.
|
|
38
40
|
// If it is a ReactiveObject then React errors when initializing new paths because of state change during render.
|
|
39
41
|
// Ideally this could be a ReactiveObject but be able to access and update the root level without breaking render.
|
|
@@ -67,15 +69,10 @@ export default (context: PluginsContext) => {
|
|
|
67
69
|
const isOpen = (path: string[]) => getItem(path).open;
|
|
68
70
|
const isCurrent = (path: string[]) => getItem(path).current;
|
|
69
71
|
|
|
70
|
-
const location = context.requestCapability(Capabilities.Location);
|
|
71
|
-
const layout = context.requestCapability(Capabilities.Layout);
|
|
72
|
-
|
|
73
72
|
let previous: string[] = [];
|
|
74
73
|
const unsubscribe = effect(() => {
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
const removed = previous.filter((id) => !current.includes(id));
|
|
78
|
-
previous = current;
|
|
74
|
+
const removed = previous.filter((id) => !layout.active.includes(id));
|
|
75
|
+
previous = layout.active;
|
|
79
76
|
|
|
80
77
|
// TODO(wittjosiah): This is setTimeout because there's a race between the keys be initialized.
|
|
81
78
|
// This could be avoided if the location was a path as well and not just an id.
|
|
@@ -87,7 +84,7 @@ export default (context: PluginsContext) => {
|
|
|
87
84
|
});
|
|
88
85
|
});
|
|
89
86
|
|
|
90
|
-
|
|
87
|
+
layout.active.forEach((id) => {
|
|
91
88
|
const keys = Array.from(new Set([...state.keys(), id])).filter((key) => Path.last(key) === id);
|
|
92
89
|
keys.forEach((key) => {
|
|
93
90
|
setItem(Path.parts(key), 'current', true);
|
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { createIntent, LayoutAction, useAppGraph, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { type ActionLike, isActionGroup, isAction } from '@dxos/app-graph';
|
|
9
9
|
import { Keyboard, keySymbols } from '@dxos/keyboard';
|
|
10
|
-
import { useGraph } from '@dxos/plugin-graph';
|
|
11
10
|
import { Button, Dialog, Icon, useTranslation, toLocalizedString } from '@dxos/react-ui';
|
|
12
11
|
import { SearchList } from '@dxos/react-ui-searchlist';
|
|
13
12
|
import { descriptionText, mx } from '@dxos/react-ui-theme';
|
|
@@ -20,7 +19,7 @@ export const CommandsDialogContent = ({ selected: initial }: { selected?: string
|
|
|
20
19
|
const { t } = useTranslation(NAVTREE_PLUGIN);
|
|
21
20
|
const [selected, setSelected] = useState<string | undefined>(initial);
|
|
22
21
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
23
|
-
const { graph } =
|
|
22
|
+
const { graph } = useAppGraph();
|
|
24
23
|
|
|
25
24
|
// Traverse graph.
|
|
26
25
|
// TODO(burdon): Factor out commonality with shortcut dialog.
|
|
@@ -83,7 +82,7 @@ export const CommandsDialogContent = ({ selected: initial }: { selected?: string
|
|
|
83
82
|
return;
|
|
84
83
|
}
|
|
85
84
|
|
|
86
|
-
void dispatch(createIntent(LayoutAction.
|
|
85
|
+
void dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } }));
|
|
87
86
|
setTimeout(() => {
|
|
88
87
|
const node = graph.nodes(group ?? action, { relation: 'inbound' })[0];
|
|
89
88
|
void (node && isAction(action) && action.data({ node, caller: KEY_BINDING }));
|
|
@@ -17,13 +17,15 @@ export const CommandsTrigger = () => {
|
|
|
17
17
|
const { t } = useTranslation(NAVTREE_PLUGIN);
|
|
18
18
|
return (
|
|
19
19
|
<Button
|
|
20
|
-
classNames='m-1
|
|
20
|
+
classNames='m-1 pli-1 lg:pli-2'
|
|
21
21
|
onClick={() =>
|
|
22
22
|
dispatch(
|
|
23
|
-
createIntent(LayoutAction.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
createIntent(LayoutAction.UpdateDialog, {
|
|
24
|
+
part: 'dialog',
|
|
25
|
+
subject: COMMANDS_DIALOG,
|
|
26
|
+
options: {
|
|
27
|
+
blockAlign: 'start',
|
|
28
|
+
},
|
|
27
29
|
}),
|
|
28
30
|
)
|
|
29
31
|
}
|