@dxos/plugin-navtree 0.8.2-staging.7ac8446 → 0.8.3-main.672df60
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-4RQJXI4D.mjs → chunk-33VLL4IJ.mjs} +2 -2
- package/dist/lib/browser/chunk-33VLL4IJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-MFAWMFJC.mjs +1418 -0
- package/dist/lib/browser/chunk-MFAWMFJC.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -11
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-BZMUS24C.mjs → intent-resolver-NAYKKAOP.mjs} +7 -7
- package/dist/lib/browser/intent-resolver-NAYKKAOP.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-3HCM3SHJ.mjs → react-surface-HGA3TAQU.mjs} +3 -3
- package/dist/lib/browser/{state-M5UJ3MHL.mjs → state-R2UMYAHN.mjs} +18 -12
- package/dist/lib/browser/state-R2UMYAHN.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/capabilities.d.ts +7 -4
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +38 -183
- 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 +9 -6
- 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} +3 -5
- 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/NavTreeItem/NavTreeItemColumns.d.ts +4 -0
- 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 +20 -14
- 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 +7 -6
- 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 -0
- package/dist/types/src/translations.d.ts.map +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 +42 -32
- package/src/NavTreePlugin.tsx +2 -2
- package/src/capabilities/app-graph-builder.ts +38 -28
- package/src/capabilities/capabilities.ts +5 -4
- package/src/capabilities/intent-resolver.ts +8 -7
- package/src/capabilities/keyboard.ts +37 -32
- package/src/capabilities/state.ts +23 -17
- 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 -67
- 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} +19 -22
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +73 -0
- package/src/components/NavTreeItem/index.ts +6 -0
- package/src/components/{L0Menu.tsx → Sidebar/L0Menu.tsx} +186 -131
- package/src/components/Sidebar/L1Panel.tsx +175 -0
- 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} +7 -7
- package/src/components/UserAccountAvatar/index.ts +5 -0
- package/src/components/index.ts +0 -1
- package/src/components/types.ts +20 -15
- package/src/testing/app-graph-builder.ts +224 -0
- package/src/testing/generator.ts +15 -12
- package/src/testing/index.ts +1 -0
- package/src/translations.ts +1 -0
- package/src/util.ts +10 -32
- package/dist/lib/browser/app-graph-builder-26D3MUCA.mjs.map +0 -7
- package/dist/lib/browser/chunk-4RQJXI4D.mjs.map +0 -7
- package/dist/lib/browser/chunk-DN43QXSX.mjs +0 -1222
- package/dist/lib/browser/chunk-DN43QXSX.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-BZMUS24C.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-M5UJ3MHL.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 +0 -4
- 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/L1Panels.tsx +0 -115
- package/src/components/NavTree.stories.tsx +0 -107
- package/src/components/NavTree.tsx +0 -51
- package/src/components/NavTreeItemColumns.tsx +0 -71
- package/src/stories/Graph.stories.tsx +0 -130
- package/src/stories/StorybookNavTree.tsx +0 -63
- /package/dist/lib/browser/{react-surface-3HCM3SHJ.mjs.map → react-surface-HGA3TAQU.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":"hooks.d.ts","sourceRoot":"","sources":["../../../src/hooks.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAI5C,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/hooks.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAI5C,eAAO,MAAM,kBAAkB,GAAI,OAAO,IAAI,SAU7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../src/testing/app-graph-builder.ts"],"names":[],"mappings":"AAQA,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGtF,eAAO,MAAM,sBAAsB,EAAE,iBAoNpC,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import { type Live } from '@dxos/live-object';
|
|
3
3
|
export type TestItem = {
|
|
4
4
|
id: string;
|
|
5
5
|
type: string;
|
|
6
6
|
} & Record<string, any>;
|
|
7
7
|
type ObjectDataGenerator = {
|
|
8
|
-
createSchema?: () =>
|
|
8
|
+
createSchema?: () => Schema.Schema.AnyNoContext;
|
|
9
9
|
createData: () => any;
|
|
10
10
|
};
|
|
11
|
-
type ObjectFactory<T extends
|
|
12
|
-
schema?:
|
|
11
|
+
type ObjectFactory<T extends Live<any>> = {
|
|
12
|
+
schema?: Schema.Schema.AnyNoContext;
|
|
13
13
|
createObject: () => T;
|
|
14
14
|
};
|
|
15
15
|
type ObjectFactoryMap = {
|
|
@@ -29,7 +29,7 @@ export declare class TestObjectGenerator {
|
|
|
29
29
|
types?: string[];
|
|
30
30
|
factories?: ObjectFactoryMap;
|
|
31
31
|
});
|
|
32
|
-
get schema():
|
|
32
|
+
get schema(): Schema.Schema.AnyNoContext[];
|
|
33
33
|
createObject({ types }?: {
|
|
34
34
|
types?: string[];
|
|
35
35
|
}): any;
|
|
@@ -53,6 +53,7 @@ export declare const createTree: () => {
|
|
|
53
53
|
properties: {
|
|
54
54
|
label: any;
|
|
55
55
|
icon: string;
|
|
56
|
+
disposition: string;
|
|
56
57
|
};
|
|
57
58
|
nodes: ({
|
|
58
59
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/testing/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/testing/generator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAQ,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAQpD,MAAM,MAAM,QAAQ,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE1E,KAAK,mBAAmB,GAAG;IACzB,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IAChD,UAAU,EAAE,MAAM,GAAG,CAAC;CACvB,CAAC;AAEF,KAAK,aAAa,CAAC,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,IAAI;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC,CAAC;CACvB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC;AAW/D,eAAO,MAAM,MAAM,UAAgC,CAAC;AACpD,eAAO,MAAM,QAAQ,UAAkB,CAAC;AAExC,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAgCpE,CAAC;AAEF;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,SAAgB,SAAS,EAAE,gBAAgB,CAAC;gBAEhC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,CAAC,EAAE,gBAAgB,CAAA;KAAO;IASzF,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,CAEzC;IAED,YAAY,CAAC,EAAE,KAAK,EAAE,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;KAAO;IAMjD,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;CAGtE;AAeD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+EtB,CAAC"}
|
|
@@ -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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAMA,wBAeE"}
|
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.
|
|
3
|
+
"version": "0.8.3-main.672df60",
|
|
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,53 +25,63 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
|
|
27
27
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
|
|
28
|
-
"@preact/
|
|
28
|
+
"@preact-signals/safe-react": "^0.9.0",
|
|
29
|
+
"@preact/signals-core": "^1.9.0",
|
|
29
30
|
"@radix-ui/react-dismissable-layer": "1.1.5",
|
|
30
31
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
31
32
|
"date-fns": "^3.3.1",
|
|
32
|
-
"
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/debug": "0.8.
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/echo
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/plugin-
|
|
45
|
-
"@dxos/plugin-
|
|
46
|
-
"@dxos/plugin-
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/react-ui-list": "0.8.
|
|
50
|
-
"@dxos/react-ui-
|
|
51
|
-
"@dxos/react-ui-
|
|
52
|
-
"@dxos/react-ui-
|
|
53
|
-
"@dxos/react-ui-
|
|
54
|
-
"@dxos/
|
|
33
|
+
"effect": "^3.13.3",
|
|
34
|
+
"@dxos/app-framework": "0.8.3-main.672df60",
|
|
35
|
+
"@dxos/async": "0.8.3-main.672df60",
|
|
36
|
+
"@dxos/debug": "0.8.3-main.672df60",
|
|
37
|
+
"@dxos/app-graph": "0.8.3-main.672df60",
|
|
38
|
+
"@dxos/echo": "0.8.3-main.672df60",
|
|
39
|
+
"@dxos/echo-schema": "0.8.3-main.672df60",
|
|
40
|
+
"@dxos/invariant": "0.8.3-main.672df60",
|
|
41
|
+
"@dxos/keyboard": "0.8.3-main.672df60",
|
|
42
|
+
"@dxos/live-object": "0.8.3-main.672df60",
|
|
43
|
+
"@dxos/local-storage": "0.8.3-main.672df60",
|
|
44
|
+
"@dxos/log": "0.8.3-main.672df60",
|
|
45
|
+
"@dxos/plugin-graph": "0.8.3-main.672df60",
|
|
46
|
+
"@dxos/plugin-deck": "0.8.3-main.672df60",
|
|
47
|
+
"@dxos/plugin-observability": "0.8.3-main.672df60",
|
|
48
|
+
"@dxos/protocols": "0.8.3-main.672df60",
|
|
49
|
+
"@dxos/react-client": "0.8.3-main.672df60",
|
|
50
|
+
"@dxos/react-ui-list": "0.8.3-main.672df60",
|
|
51
|
+
"@dxos/react-ui-attention": "0.8.3-main.672df60",
|
|
52
|
+
"@dxos/react-ui-menu": "0.8.3-main.672df60",
|
|
53
|
+
"@dxos/react-ui-searchlist": "0.8.3-main.672df60",
|
|
54
|
+
"@dxos/react-ui-stack": "0.8.3-main.672df60",
|
|
55
|
+
"@dxos/react-ui-tabs": "0.8.3-main.672df60",
|
|
56
|
+
"@dxos/util": "0.8.3-main.672df60"
|
|
55
57
|
},
|
|
56
58
|
"devDependencies": {
|
|
59
|
+
"@effect-rx/rx-react": "^0.34.1",
|
|
60
|
+
"@effect/platform": "0.80.12",
|
|
57
61
|
"@phosphor-icons/react": "^2.1.5",
|
|
58
62
|
"@types/react": "~18.2.0",
|
|
59
63
|
"@types/react-dom": "~18.2.0",
|
|
60
64
|
"react": "~18.2.0",
|
|
61
65
|
"react-dom": "~18.2.0",
|
|
62
66
|
"vite": "5.4.7",
|
|
63
|
-
"@dxos/echo-signals": "0.8.
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/storybook-utils": "0.8.
|
|
67
|
+
"@dxos/echo-signals": "0.8.3-main.672df60",
|
|
68
|
+
"@dxos/plugin-storybook-layout": "0.8.3-main.672df60",
|
|
69
|
+
"@dxos/plugin-theme": "0.8.3-main.672df60",
|
|
70
|
+
"@dxos/plugin-attention": "0.8.3-main.672df60",
|
|
71
|
+
"@dxos/storybook-utils": "0.8.3-main.672df60",
|
|
72
|
+
"@dxos/react-ui-theme": "0.8.3-main.672df60",
|
|
73
|
+
"@dxos/react-ui": "0.8.3-main.672df60",
|
|
74
|
+
"@dxos/random": "0.8.3-main.672df60"
|
|
68
75
|
},
|
|
69
76
|
"peerDependencies": {
|
|
77
|
+
"@effect-rx/rx-react": "^0.34.1",
|
|
78
|
+
"@effect/platform": "0.80.12",
|
|
70
79
|
"@phosphor-icons/react": "^2.1.5",
|
|
80
|
+
"effect": "^3.13.3",
|
|
71
81
|
"react": "~18.2.0",
|
|
72
82
|
"react-dom": "~18.2.0",
|
|
73
|
-
"@dxos/react-ui": "0.8.
|
|
74
|
-
"@dxos/react-ui-theme": "0.8.
|
|
83
|
+
"@dxos/react-ui": "0.8.3-main.672df60",
|
|
84
|
+
"@dxos/react-ui-theme": "0.8.3-main.672df60"
|
|
75
85
|
},
|
|
76
86
|
"publishConfig": {
|
|
77
87
|
"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
|
);
|
|
@@ -3,17 +3,18 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type
|
|
6
|
+
import { type Live } from '@dxos/live-object';
|
|
7
7
|
|
|
8
8
|
import { NAVTREE_PLUGIN } from '../meta';
|
|
9
9
|
import { type NavTreeItemGraphNode } from '../types';
|
|
10
10
|
|
|
11
11
|
export namespace NavTreeCapabilities {
|
|
12
12
|
export const State = defineCapability<{
|
|
13
|
-
state: Map<string,
|
|
14
|
-
getItem: (path: string[]) =>
|
|
15
|
-
setItem: (path: string[], key: 'open' | 'current', next: boolean) => void;
|
|
13
|
+
state: Map<string, Live<{ open: boolean; current: boolean; alternateTree?: boolean }>>;
|
|
14
|
+
getItem: (path: string[]) => Live<{ open: boolean; current: boolean; alternateTree?: boolean }>;
|
|
15
|
+
setItem: (path: string[], key: 'open' | 'current' | 'alternateTree', next: boolean) => void;
|
|
16
16
|
isOpen: (path: string[], item: NavTreeItemGraphNode) => boolean;
|
|
17
17
|
isCurrent: (path: string[], item: NavTreeItemGraphNode) => boolean;
|
|
18
|
+
isAlternateTree: (path: string[], item: NavTreeItemGraphNode) => boolean;
|
|
18
19
|
}>(`${NAVTREE_PLUGIN}/capability/state`);
|
|
19
20
|
}
|
|
@@ -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,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import { effect } from '@preact/signals-core';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, type
|
|
8
|
-
import { type
|
|
7
|
+
import { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';
|
|
8
|
+
import { type Live, live } from '@dxos/live-object';
|
|
9
9
|
import { Path } from '@dxos/react-ui-list';
|
|
10
10
|
|
|
11
11
|
import { NavTreeCapabilities } from './capabilities';
|
|
12
12
|
import { NAVTREE_PLUGIN } from '../meta';
|
|
13
13
|
|
|
14
|
-
const KEY = `${NAVTREE_PLUGIN}/state`;
|
|
14
|
+
const KEY = `${NAVTREE_PLUGIN}/state/v1`;
|
|
15
15
|
|
|
16
16
|
const getInitialState = () => {
|
|
17
17
|
const stringified = localStorage.getItem(KEY);
|
|
@@ -24,34 +24,34 @@ const getInitialState = () => {
|
|
|
24
24
|
return cached.map(
|
|
25
25
|
([key, value]): [
|
|
26
26
|
string,
|
|
27
|
-
|
|
27
|
+
Live<{
|
|
28
28
|
open: boolean;
|
|
29
29
|
current: boolean;
|
|
30
30
|
}>,
|
|
31
|
-
] => [key,
|
|
31
|
+
] => [key, live({ open: value.open, current: false })],
|
|
32
32
|
);
|
|
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
|
-
// TODO(wittjosiah): This currently needs to be not a
|
|
40
|
-
// If it is a
|
|
41
|
-
// Ideally this could be a
|
|
39
|
+
// TODO(wittjosiah): This currently needs to be not a Live at the root.
|
|
40
|
+
// If it is a Live then React errors when initializing new paths because of state change during render.
|
|
41
|
+
// Ideally this could be a Live but be able to access and update the root level without breaking render.
|
|
42
42
|
// Wrapping accesses and updates in `untracked` didn't seem to work in all cases.
|
|
43
|
-
const state = new Map<string,
|
|
43
|
+
const state = new Map<string, Live<{ open: boolean; current: boolean; alternateTree?: boolean }>>(
|
|
44
44
|
getInitialState() ?? [
|
|
45
45
|
// TODO(thure): Initialize these dynamically.
|
|
46
|
-
['root',
|
|
47
|
-
['root~dxos.org/plugin/space-spaces',
|
|
48
|
-
['root~dxos.org/plugin/files',
|
|
46
|
+
['root', live({ open: true, current: false })],
|
|
47
|
+
['root~dxos.org/plugin/space-spaces', live({ open: true, current: false })],
|
|
48
|
+
['root~dxos.org/plugin/files', live({ open: true, current: false })],
|
|
49
49
|
],
|
|
50
50
|
);
|
|
51
51
|
|
|
52
52
|
const getItem = (_path: string[]) => {
|
|
53
53
|
const path = Path.create(..._path);
|
|
54
|
-
const value = state.get(path) ??
|
|
54
|
+
const value = state.get(path) ?? live({ open: false, current: false, alternateTree: false });
|
|
55
55
|
if (!state.has(path)) {
|
|
56
56
|
state.set(path, value);
|
|
57
57
|
}
|
|
@@ -59,7 +59,7 @@ export default (context: PluginsContext) => {
|
|
|
59
59
|
return value;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
const setItem = (path: string[], key: 'open' | 'current', next: boolean) => {
|
|
62
|
+
const setItem = (path: string[], key: 'open' | 'current' | 'alternateTree', next: boolean) => {
|
|
63
63
|
const value = getItem(path);
|
|
64
64
|
value[key] = next;
|
|
65
65
|
|
|
@@ -68,6 +68,10 @@ export default (context: PluginsContext) => {
|
|
|
68
68
|
|
|
69
69
|
const isOpen = (path: string[]) => getItem(path).open;
|
|
70
70
|
const isCurrent = (path: string[]) => getItem(path).current;
|
|
71
|
+
const isAlternateTree = (path: string[]) => {
|
|
72
|
+
const item = getItem(path);
|
|
73
|
+
return item.alternateTree ?? false;
|
|
74
|
+
};
|
|
71
75
|
|
|
72
76
|
let previous: string[] = [];
|
|
73
77
|
const unsubscribe = effect(() => {
|
|
@@ -93,5 +97,7 @@ export default (context: PluginsContext) => {
|
|
|
93
97
|
});
|
|
94
98
|
});
|
|
95
99
|
|
|
96
|
-
return contributes(NavTreeCapabilities.State, { state, getItem, setItem, isOpen, isCurrent }, () =>
|
|
100
|
+
return contributes(NavTreeCapabilities.State, { state, getItem, setItem, isOpen, isCurrent, isAlternateTree }, () =>
|
|
101
|
+
unsubscribe(),
|
|
102
|
+
);
|
|
97
103
|
};
|
|
@@ -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'
|