@dxos/plugin-navtree 0.7.5-labs.e27f9b9 → 0.7.5-main.2567c87
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-BL7LRXCM.mjs → app-graph-builder-OF4MMBLH.mjs} +5 -7
- package/dist/lib/browser/{app-graph-builder-BL7LRXCM.mjs.map → app-graph-builder-OF4MMBLH.mjs.map} +3 -3
- package/dist/lib/browser/chunk-IMGT2LAL.mjs +658 -0
- package/dist/lib/browser/chunk-IMGT2LAL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AOAGODQB.mjs → chunk-OI7AAA6Q.mjs} +1 -1
- package/dist/lib/browser/chunk-OI7AAA6Q.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +26 -21
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-74JPWYBP.mjs +42 -0
- package/dist/lib/browser/intent-resolver-74JPWYBP.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-6QWXI53A.mjs +189 -0
- package/dist/lib/browser/react-surface-6QWXI53A.mjs.map +7 -0
- package/dist/lib/browser/{state-65TQKYX7.mjs → state-HT65TAYL.mjs} +9 -6
- package/dist/lib/browser/state-HT65TAYL.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 +2 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +32 -88
- 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/NavTree.d.ts +20 -3
- 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 +3 -4
- package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeFooter.d.ts +6 -0
- package/dist/types/src/components/NavTreeFooter.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/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- 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/translations.d.ts +6 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +1 -2
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +0 -9
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +31 -33
- package/src/NavTreePlugin.tsx +10 -8
- package/src/capabilities/app-graph-builder.ts +4 -6
- package/src/capabilities/capabilities.ts +2 -3
- package/src/capabilities/intent-resolver.ts +16 -22
- package/src/capabilities/react-surface.tsx +41 -15
- package/src/capabilities/state.ts +8 -5
- package/src/components/CommandsDialog.tsx +4 -3
- package/src/components/CommandsTrigger.tsx +5 -7
- package/src/components/NavTree.stories.tsx +5 -5
- package/src/components/NavTree.tsx +116 -26
- package/src/components/NavTreeContainer.tsx +32 -106
- package/src/components/NavTreeFooter.tsx +161 -0
- package/src/components/NavTreeItemAction.tsx +4 -12
- package/src/components/NotchStart.tsx +2 -2
- package/src/components/index.ts +0 -2
- package/src/stories/Graph.stories.tsx +4 -5
- package/src/translations.ts +6 -0
- package/src/types.ts +1 -2
- package/src/util.ts +0 -54
- package/dist/lib/browser/chunk-54MPRXMH.mjs +0 -1109
- package/dist/lib/browser/chunk-54MPRXMH.mjs.map +0 -7
- package/dist/lib/browser/chunk-AOAGODQB.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-U25VBFH3.mjs +0 -47
- package/dist/lib/browser/intent-resolver-U25VBFH3.mjs.map +0 -7
- package/dist/lib/browser/react-surface-LNRTNSM6.mjs +0 -57
- package/dist/lib/browser/react-surface-LNRTNSM6.mjs.map +0 -7
- package/dist/lib/browser/state-65TQKYX7.mjs.map +0 -7
- package/dist/types/src/components/L0Menu.d.ts +0 -9
- package/dist/types/src/components/L0Menu.d.ts.map +0 -1
- package/dist/types/src/components/L1Panels.d.ts +0 -8
- package/dist/types/src/components/L1Panels.d.ts.map +0 -1
- package/dist/types/src/components/NavTreeContext.d.ts +0 -4
- package/dist/types/src/components/NavTreeContext.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/types.d.ts +0 -25
- package/dist/types/src/components/types.d.ts.map +0 -1
- package/dist/types/src/hooks.d.ts +0 -3
- package/dist/types/src/hooks.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/L0Menu.tsx +0 -210
- package/src/components/L1Panels.tsx +0 -100
- package/src/components/NavTreeContext.tsx +0 -13
- package/src/components/NavTreeItemColumns.tsx +0 -71
- package/src/components/types.ts +0 -33
- package/src/hooks.ts +0 -21
- package/src/stories/StorybookNavTree.tsx +0 -63
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
2
|
import { type Meta } from '@storybook/react';
|
|
3
|
-
import {
|
|
4
|
-
declare const meta: Meta<typeof
|
|
3
|
+
import { NavTree } from './NavTree';
|
|
4
|
+
declare const meta: Meta<typeof NavTree>;
|
|
5
5
|
export default meta;
|
|
6
6
|
export declare const Default: {};
|
|
7
7
|
//# sourceMappingURL=NavTree.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavTree.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/NavTree.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAIrB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAU7C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"NavTree.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/NavTree.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAIrB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAU7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CA4E9B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type NavTreeProps } from './NavTree';
|
|
3
3
|
export declare const NODE_TYPE = "dxos/app-graph/node";
|
|
4
4
|
export type NavTreeContainerProps = {
|
|
5
5
|
popoverAnchorId?: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const NavTreeContainer: React.MemoExoticComponent<({ tab, popoverAnchorId, topbar }: NavTreeContainerProps) => React.JSX.Element>;
|
|
6
|
+
} & Pick<NavTreeProps, 'isOpen' | 'isCurrent' | 'onOpenChange'>;
|
|
7
|
+
export declare const NavTreeContainer: React.MemoExoticComponent<({ isCurrent, popoverAnchorId, ...props }: NavTreeContainerProps) => React.JSX.Element>;
|
|
9
8
|
//# sourceMappingURL=NavTreeContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavTreeContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/NavTreeContainer.tsx"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"NavTreeContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/NavTreeContainer.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAW5D,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAatE,eAAO,MAAM,SAAS,wBAAwB,CAAC;AAM/C,MAAM,MAAM,qBAAqB,GAAG;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,WAAW,GAAG,cAAc,CAAC,CAAC;AAEhE,eAAO,MAAM,gBAAgB,uEAAmD,qBAAqB,uBAkLnG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavTreeFooter.d.ts","sourceRoot":"","sources":["../../../../src/components/NavTreeFooter.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,KAAK,UAAU,EAKhB,MAAM,qBAAqB,CAAC;AA0B7B,eAAO,MAAM,aAAa,UAAW;IAAE,UAAU,CAAC,EAAE,UAAU,CAAA;CAAE,sBAyH/D,CAAC"}
|
|
@@ -10,7 +10,7 @@ export type NavTreeItemActionMenuProps = ActionProperties & {
|
|
|
10
10
|
onAction?: (action: Action) => void;
|
|
11
11
|
};
|
|
12
12
|
export declare const NavTreeItemActionDropdownMenu: ({ label, icon, testId, menuActions, onAction, }: NavTreeItemActionMenuProps) => React.JSX.Element;
|
|
13
|
-
export declare const NavTreeItemMonolithicAction: ({ parent, properties: { disabled, caller, testId, icon
|
|
13
|
+
export declare const NavTreeItemMonolithicAction: ({ parent, properties: { disabled, caller, testId, icon }, data: invoke, baseLabel, }: Action & {
|
|
14
14
|
parent: Node;
|
|
15
15
|
onAction?: (action: Action) => void;
|
|
16
16
|
baseLabel: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavTreeItemAction.d.ts","sourceRoot":"","sources":["../../../../src/components/NavTreeItemAction.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,gBAAgB,EAAU,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAMzD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,GAAG;IAC1D,MAAM,EAAE,IAAI,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAAC;
|
|
1
|
+
{"version":3,"file":"NavTreeItemAction.d.ts","sourceRoot":"","sources":["../../../../src/components/NavTreeItemAction.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,gBAAgB,EAAU,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAMzD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,GAAG;IAC1D,MAAM,EAAE,IAAI,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAAC;AAYF,eAAO,MAAM,6BAA6B,oDAMvC,0BAA0B,sBAkB5B,CAAC;AAEF,eAAO,MAAM,2BAA2B,yFAKrC,MAAM,GAAG;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,sBAiBnF,CAAC;AAEF,eAAO,MAAM,iBAAiB,wDAAyD,0BAA0B,sBAiBhH,CAAC"}
|
|
@@ -2,8 +2,6 @@ export * from './CommandsDialog';
|
|
|
2
2
|
export * from './CommandsTrigger';
|
|
3
3
|
export * from './NavTree';
|
|
4
4
|
export * from './NavTreeContainer';
|
|
5
|
-
export * from './NavTreeContext';
|
|
6
5
|
export * from './NavTreeDocumentTitle';
|
|
7
6
|
export * from './NotchStart';
|
|
8
|
-
export * from './types';
|
|
9
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
2
|
import { type Meta } from '@storybook/react';
|
|
3
|
-
import {
|
|
3
|
+
import { NavTree } from '../components';
|
|
4
4
|
export declare const Default: {};
|
|
5
|
-
declare const meta: Meta<typeof
|
|
5
|
+
declare const meta: Meta<typeof NavTree>;
|
|
6
6
|
export default meta;
|
|
7
7
|
//# sourceMappingURL=Graph.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Graph.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Graph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAKrB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAW7C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Graph.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Graph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAKrB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAW7C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAiCxC,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAuE9B,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -6,6 +6,12 @@ declare const _default: {
|
|
|
6
6
|
'commands dialog title': string;
|
|
7
7
|
'command list input placeholder': string;
|
|
8
8
|
'node actions menu invoker label': string;
|
|
9
|
+
'warning title': string;
|
|
10
|
+
'technology preview message': string;
|
|
11
|
+
'learn more label': string;
|
|
12
|
+
'released message': string;
|
|
13
|
+
'see release label': string;
|
|
14
|
+
'powered by dxos message': string;
|
|
9
15
|
'tree item actions label': string;
|
|
10
16
|
'empty branch message': string;
|
|
11
17
|
};
|
|
@@ -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,wBAoBE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Action, type ActionLike, type Node } from '@dxos/app-graph';
|
|
2
2
|
import { type Label } from '@dxos/react-ui';
|
|
3
|
-
import { type MaybePromise
|
|
3
|
+
import { type MaybePromise } from '@dxos/util';
|
|
4
4
|
export type NavTreeItemGraphNode = Node<any, Partial<NodeProperties & {
|
|
5
5
|
persistenceClass: string;
|
|
6
6
|
persistenceKey: string;
|
|
@@ -19,7 +19,6 @@ type SharedProperties = {
|
|
|
19
19
|
label: Label;
|
|
20
20
|
icon?: string;
|
|
21
21
|
disabled?: boolean;
|
|
22
|
-
position?: Position;
|
|
23
22
|
testId?: string;
|
|
24
23
|
className?: string;
|
|
25
24
|
headingClassName?: string;
|
|
@@ -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,
|
|
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;AAE/C,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,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,13 +9,4 @@ 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[];
|
|
21
12
|
//# 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,EAIX,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-navtree",
|
|
3
|
-
"version": "0.7.5-
|
|
3
|
+
"version": "0.7.5-main.2567c87",
|
|
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,32 +25,30 @@
|
|
|
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-
|
|
29
|
-
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
28
|
+
"@radix-ui/react-use-controllable-state": "^1.0.0",
|
|
30
29
|
"date-fns": "^3.3.1",
|
|
31
|
-
"@dxos/app-framework": "0.7.5-
|
|
32
|
-
"@dxos/async": "0.7.5-
|
|
33
|
-
"@dxos/app-graph": "0.7.5-
|
|
34
|
-
"@dxos/debug": "0.7.5-
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/local-storage": "0.7.5-
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/log": "0.7.5-
|
|
41
|
-
"@dxos/plugin-
|
|
42
|
-
"@dxos/plugin-
|
|
43
|
-
"@dxos/plugin-
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/react-
|
|
47
|
-
"@dxos/react-
|
|
48
|
-
"@dxos/react-ui-
|
|
49
|
-
"@dxos/react-ui-
|
|
50
|
-
"@dxos/react-ui-
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/react-ui-tabs": "0.7.5-labs.e27f9b9"
|
|
30
|
+
"@dxos/app-framework": "0.7.5-main.2567c87",
|
|
31
|
+
"@dxos/async": "0.7.5-main.2567c87",
|
|
32
|
+
"@dxos/app-graph": "0.7.5-main.2567c87",
|
|
33
|
+
"@dxos/debug": "0.7.5-main.2567c87",
|
|
34
|
+
"@dxos/invariant": "0.7.5-main.2567c87",
|
|
35
|
+
"@dxos/live-object": "0.7.5-main.2567c87",
|
|
36
|
+
"@dxos/echo-schema": "0.7.5-main.2567c87",
|
|
37
|
+
"@dxos/local-storage": "0.7.5-main.2567c87",
|
|
38
|
+
"@dxos/keyboard": "0.7.5-main.2567c87",
|
|
39
|
+
"@dxos/log": "0.7.5-main.2567c87",
|
|
40
|
+
"@dxos/plugin-client": "0.7.5-main.2567c87",
|
|
41
|
+
"@dxos/plugin-graph": "0.7.5-main.2567c87",
|
|
42
|
+
"@dxos/plugin-observability": "0.7.5-main.2567c87",
|
|
43
|
+
"@dxos/protocols": "0.7.5-main.2567c87",
|
|
44
|
+
"@dxos/plugin-theme": "0.7.5-main.2567c87",
|
|
45
|
+
"@dxos/react-client": "0.7.5-main.2567c87",
|
|
46
|
+
"@dxos/react-ui-list": "0.7.5-main.2567c87",
|
|
47
|
+
"@dxos/react-ui-mosaic": "0.7.5-main.2567c87",
|
|
48
|
+
"@dxos/react-ui-searchlist": "0.7.5-main.2567c87",
|
|
49
|
+
"@dxos/react-ui-menu": "0.7.5-main.2567c87",
|
|
50
|
+
"@dxos/util": "0.7.5-main.2567c87",
|
|
51
|
+
"@dxos/react-ui-stack": "0.7.5-main.2567c87"
|
|
54
52
|
},
|
|
55
53
|
"devDependencies": {
|
|
56
54
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -59,18 +57,18 @@
|
|
|
59
57
|
"react": "~18.2.0",
|
|
60
58
|
"react-dom": "~18.2.0",
|
|
61
59
|
"vite": "5.4.7",
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/react-ui": "0.7.5-
|
|
65
|
-
"@dxos/react-ui-theme": "0.7.5-
|
|
66
|
-
"@dxos/storybook-utils": "0.7.5-
|
|
60
|
+
"@dxos/random": "0.7.5-main.2567c87",
|
|
61
|
+
"@dxos/echo-signals": "0.7.5-main.2567c87",
|
|
62
|
+
"@dxos/react-ui": "0.7.5-main.2567c87",
|
|
63
|
+
"@dxos/react-ui-theme": "0.7.5-main.2567c87",
|
|
64
|
+
"@dxos/storybook-utils": "0.7.5-main.2567c87"
|
|
67
65
|
},
|
|
68
66
|
"peerDependencies": {
|
|
69
67
|
"@phosphor-icons/react": "^2.1.5",
|
|
70
68
|
"react": "~18.2.0",
|
|
71
69
|
"react-dom": "~18.2.0",
|
|
72
|
-
"@dxos/react-ui": "0.7.5-
|
|
73
|
-
"@dxos/react-ui-theme": "0.7.5-
|
|
70
|
+
"@dxos/react-ui": "0.7.5-main.2567c87",
|
|
71
|
+
"@dxos/react-ui-theme": "0.7.5-main.2567c87"
|
|
74
72
|
},
|
|
75
73
|
"publishConfig": {
|
|
76
74
|
"access": "public"
|
package/src/NavTreePlugin.tsx
CHANGED
|
@@ -9,8 +9,9 @@ import {
|
|
|
9
9
|
contributes,
|
|
10
10
|
Capabilities,
|
|
11
11
|
allOf,
|
|
12
|
+
oneOf,
|
|
13
|
+
NavigationAction,
|
|
12
14
|
createIntent,
|
|
13
|
-
LayoutAction,
|
|
14
15
|
} from '@dxos/app-framework';
|
|
15
16
|
import { type TreeData } from '@dxos/react-ui-list';
|
|
16
17
|
|
|
@@ -24,7 +25,7 @@ export const NavTreePlugin = () =>
|
|
|
24
25
|
definePlugin(meta, [
|
|
25
26
|
defineModule({
|
|
26
27
|
id: `${meta.id}/module/state`,
|
|
27
|
-
activatesOn: Events.LayoutReady,
|
|
28
|
+
activatesOn: allOf(Events.LayoutReady, Events.LocationReady),
|
|
28
29
|
activatesAfter: [NavTreeEvents.StateReady],
|
|
29
30
|
activate: State,
|
|
30
31
|
}),
|
|
@@ -35,7 +36,7 @@ export const NavTreePlugin = () =>
|
|
|
35
36
|
}),
|
|
36
37
|
defineModule({
|
|
37
38
|
id: `${meta.id}/module/metadata`,
|
|
38
|
-
activatesOn: Events.
|
|
39
|
+
activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),
|
|
39
40
|
activate: () =>
|
|
40
41
|
contributes(Capabilities.Metadata, {
|
|
41
42
|
id: NODE_TYPE,
|
|
@@ -55,13 +56,14 @@ export const NavTreePlugin = () =>
|
|
|
55
56
|
}),
|
|
56
57
|
defineModule({
|
|
57
58
|
id: `${meta.id}/module/expose`,
|
|
58
|
-
activatesOn: allOf(Events.DispatcherReady, Events.LayoutReady, NavTreeEvents.StateReady),
|
|
59
|
+
activatesOn: allOf(Events.DispatcherReady, Events.LayoutReady, Events.LocationReady, NavTreeEvents.StateReady),
|
|
59
60
|
activate: async (context) => {
|
|
60
|
-
const
|
|
61
|
+
const location = context.requestCapability(Capabilities.Location);
|
|
61
62
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
const soloPart = location.active.solo?.[0];
|
|
65
|
+
if (dispatch && soloPart) {
|
|
66
|
+
await dispatch(createIntent(NavigationAction.Expose, { id: soloPart.id }));
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
return [];
|
|
@@ -74,7 +76,7 @@ export const NavTreePlugin = () =>
|
|
|
74
76
|
}),
|
|
75
77
|
defineModule({
|
|
76
78
|
id: `${meta.id}/module/react-surface`,
|
|
77
|
-
activatesOn: Events.
|
|
79
|
+
activatesOn: Events.Startup,
|
|
78
80
|
activate: ReactSurface,
|
|
79
81
|
}),
|
|
80
82
|
defineModule({
|
|
@@ -19,12 +19,10 @@ 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
|
-
|
|
26
|
-
blockAlign: 'start',
|
|
27
|
-
},
|
|
22
|
+
createIntent(LayoutAction.SetLayout, {
|
|
23
|
+
element: 'dialog',
|
|
24
|
+
component: COMMANDS_DIALOG,
|
|
25
|
+
dialogBlockAlign: 'start',
|
|
28
26
|
}),
|
|
29
27
|
);
|
|
30
28
|
},
|
|
@@ -6,14 +6,13 @@ 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';
|
|
10
9
|
|
|
11
10
|
export namespace NavTreeCapabilities {
|
|
12
11
|
export const State = defineCapability<{
|
|
13
12
|
state: Map<string, ReactiveObject<{ open: boolean; current: boolean }>>;
|
|
14
13
|
getItem: (path: string[]) => ReactiveObject<{ open: boolean; current: boolean }>;
|
|
15
14
|
setItem: (path: string[], key: 'open' | 'current', next: boolean) => void;
|
|
16
|
-
isOpen: (path: string[]
|
|
17
|
-
isCurrent: (path: string[]
|
|
15
|
+
isOpen: (path: string[]) => boolean;
|
|
16
|
+
isCurrent: (path: string[]) => boolean;
|
|
18
17
|
}>(`${NAVTREE_PLUGIN}/capability/state`);
|
|
19
18
|
}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { contributes, type PluginsContext, Capabilities,
|
|
6
|
-
import { S } from '@dxos/echo-schema';
|
|
5
|
+
import { contributes, type PluginsContext, Capabilities, NavigationAction, createResolver } from '@dxos/app-framework';
|
|
7
6
|
import { log } from '@dxos/log';
|
|
8
7
|
|
|
9
8
|
import { NavTreeCapabilities } from './capabilities';
|
|
@@ -11,26 +10,21 @@ import { NavTreeCapabilities } from './capabilities';
|
|
|
11
10
|
export default (context: PluginsContext) =>
|
|
12
11
|
contributes(
|
|
13
12
|
Capabilities.IntentResolver,
|
|
14
|
-
createResolver({
|
|
15
|
-
|
|
16
|
-
|
|
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);
|
|
13
|
+
createResolver(NavigationAction.Expose, async ({ id }) => {
|
|
14
|
+
const { graph } = context.requestCapability(Capabilities.AppGraph);
|
|
15
|
+
const { getItem, setItem } = context.requestCapability(NavTreeCapabilities.State);
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
17
|
+
try {
|
|
18
|
+
const path = await graph.waitForPath({ target: id }, { timeout: 1_000 });
|
|
19
|
+
[...Array(path.length)].forEach((_, index) => {
|
|
20
|
+
const subpath = path.slice(0, index);
|
|
21
|
+
const value = getItem(subpath);
|
|
22
|
+
if (!value.open) {
|
|
23
|
+
setItem(subpath, 'open', true);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
} catch {
|
|
27
|
+
log.warn('Path to node not found', { id });
|
|
28
|
+
}
|
|
35
29
|
}),
|
|
36
30
|
);
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes,
|
|
8
|
-
import { isGraphNode } from '@dxos/plugin-graph';
|
|
7
|
+
import { createSurface, Capabilities, contributes, useCapability } from '@dxos/app-framework';
|
|
8
|
+
import { isGraphNode, type Node } from '@dxos/plugin-graph';
|
|
9
9
|
|
|
10
|
+
import { NavTreeCapabilities } from './capabilities';
|
|
10
11
|
import {
|
|
11
12
|
CommandsDialogContent,
|
|
12
13
|
CommandsTrigger,
|
|
@@ -14,28 +15,48 @@ import {
|
|
|
14
15
|
NotchStart,
|
|
15
16
|
NavTreeContainer,
|
|
16
17
|
} from '../components';
|
|
18
|
+
import { NavTreeFooter } from '../components/NavTreeFooter';
|
|
17
19
|
import { COMMANDS_DIALOG, NAVTREE_PLUGIN } from '../meta';
|
|
20
|
+
import { type NavTreeItemGraphNode } from '../types';
|
|
21
|
+
import { expandChildrenAndActions } from '../util';
|
|
18
22
|
|
|
19
23
|
export default () =>
|
|
20
24
|
contributes(Capabilities.ReactSurface, [
|
|
21
25
|
createSurface({
|
|
22
26
|
id: COMMANDS_DIALOG,
|
|
23
27
|
role: 'dialog',
|
|
24
|
-
filter: (data): data is {
|
|
25
|
-
component: ({ data }) => <CommandsDialogContent {
|
|
28
|
+
filter: (data): data is { subject?: string } => data.component === COMMANDS_DIALOG,
|
|
29
|
+
component: ({ data }) => <CommandsDialogContent selected={data.subject} />,
|
|
26
30
|
}),
|
|
27
31
|
createSurface({
|
|
28
32
|
id: `${NAVTREE_PLUGIN}/navigation`,
|
|
29
33
|
role: 'navigation',
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
component: ({ data }) => {
|
|
35
|
+
const { graph } = useCapability(Capabilities.AppGraph);
|
|
36
|
+
const { isOpen, isCurrent, setItem } = useCapability(NavTreeCapabilities.State);
|
|
37
|
+
|
|
38
|
+
const handleOpenChange = useCallback(
|
|
39
|
+
({ item: { id }, path, open }: { item: Node; path: string[]; open: boolean }) => {
|
|
40
|
+
// TODO(thure): This might become a localstorage leak; openItemIds that no longer exist should be removed from this map.
|
|
41
|
+
setItem(path, 'open', open);
|
|
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
|
+
},
|
|
39
60
|
}),
|
|
40
61
|
createSurface({
|
|
41
62
|
id: `${NAVTREE_PLUGIN}/document-title`,
|
|
@@ -47,10 +68,15 @@ export default () =>
|
|
|
47
68
|
role: 'notch-start',
|
|
48
69
|
component: () => <NotchStart />,
|
|
49
70
|
}),
|
|
71
|
+
createSurface({
|
|
72
|
+
id: `${NAVTREE_PLUGIN}/header-end`,
|
|
73
|
+
role: 'header-end',
|
|
74
|
+
component: () => <NavTreeFooter />,
|
|
75
|
+
}),
|
|
50
76
|
createSurface({
|
|
51
77
|
id: `${NAVTREE_PLUGIN}/search-input`,
|
|
52
78
|
role: 'search-input',
|
|
53
|
-
|
|
79
|
+
disposition: 'fallback',
|
|
54
80
|
component: () => <CommandsTrigger />,
|
|
55
81
|
}),
|
|
56
82
|
]);
|
|
@@ -34,8 +34,6 @@ const getInitialState = () => {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export default (context: PluginsContext) => {
|
|
37
|
-
const layout = context.requestCapability(Capabilities.Layout);
|
|
38
|
-
|
|
39
37
|
// TODO(wittjosiah): This currently needs to be not a ReactiveObject at the root.
|
|
40
38
|
// If it is a ReactiveObject then React errors when initializing new paths because of state change during render.
|
|
41
39
|
// Ideally this could be a ReactiveObject but be able to access and update the root level without breaking render.
|
|
@@ -69,10 +67,15 @@ export default (context: PluginsContext) => {
|
|
|
69
67
|
const isOpen = (path: string[]) => getItem(path).open;
|
|
70
68
|
const isCurrent = (path: string[]) => getItem(path).current;
|
|
71
69
|
|
|
70
|
+
const location = context.requestCapability(Capabilities.Location);
|
|
71
|
+
const layout = context.requestCapability(Capabilities.Layout);
|
|
72
|
+
|
|
72
73
|
let previous: string[] = [];
|
|
73
74
|
const unsubscribe = effect(() => {
|
|
74
|
-
const
|
|
75
|
-
|
|
75
|
+
const part = layout.layoutMode === 'solo' ? 'solo' : 'main';
|
|
76
|
+
const current = location.active[part]?.map(({ id }) => id) ?? [];
|
|
77
|
+
const removed = previous.filter((id) => !current.includes(id));
|
|
78
|
+
previous = current;
|
|
76
79
|
|
|
77
80
|
// TODO(wittjosiah): This is setTimeout because there's a race between the keys be initialized.
|
|
78
81
|
// This could be avoided if the location was a path as well and not just an id.
|
|
@@ -84,7 +87,7 @@ export default (context: PluginsContext) => {
|
|
|
84
87
|
});
|
|
85
88
|
});
|
|
86
89
|
|
|
87
|
-
|
|
90
|
+
current.forEach((id) => {
|
|
88
91
|
const keys = Array.from(new Set([...state.keys(), id])).filter((key) => Path.last(key) === id);
|
|
89
92
|
keys.forEach((key) => {
|
|
90
93
|
setItem(Path.parts(key), 'current', true);
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useIntentDispatcher, LayoutAction, createIntent } 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';
|
|
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';
|
|
@@ -19,7 +20,7 @@ export const CommandsDialogContent = ({ selected: initial }: { selected?: string
|
|
|
19
20
|
const { t } = useTranslation(NAVTREE_PLUGIN);
|
|
20
21
|
const [selected, setSelected] = useState<string | undefined>(initial);
|
|
21
22
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
22
|
-
const { graph } =
|
|
23
|
+
const { graph } = useGraph();
|
|
23
24
|
|
|
24
25
|
// Traverse graph.
|
|
25
26
|
// TODO(burdon): Factor out commonality with shortcut dialog.
|
|
@@ -82,7 +83,7 @@ export const CommandsDialogContent = ({ selected: initial }: { selected?: string
|
|
|
82
83
|
return;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
void dispatch(createIntent(LayoutAction.
|
|
86
|
+
void dispatch(createIntent(LayoutAction.SetLayout, { element: 'dialog', state: false }));
|
|
86
87
|
setTimeout(() => {
|
|
87
88
|
const node = graph.nodes(group ?? action, { relation: 'inbound' })[0];
|
|
88
89
|
void (node && isAction(action) && action.data({ node, caller: KEY_BINDING }));
|
|
@@ -17,15 +17,13 @@ export const CommandsTrigger = () => {
|
|
|
17
17
|
const { t } = useTranslation(NAVTREE_PLUGIN);
|
|
18
18
|
return (
|
|
19
19
|
<Button
|
|
20
|
-
classNames='m-1 pli-1 lg
|
|
20
|
+
classNames='m-1 !pli-1 lg:!pli-2'
|
|
21
21
|
onClick={() =>
|
|
22
22
|
dispatch(
|
|
23
|
-
createIntent(LayoutAction.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
blockAlign: 'start',
|
|
28
|
-
},
|
|
23
|
+
createIntent(LayoutAction.SetLayout, {
|
|
24
|
+
element: 'dialog',
|
|
25
|
+
component: COMMANDS_DIALOG,
|
|
26
|
+
dialogBlockAlign: 'start',
|
|
29
27
|
}),
|
|
30
28
|
)
|
|
31
29
|
}
|
|
@@ -16,7 +16,7 @@ import { isTreeData, type TreeData } from '@dxos/react-ui-list';
|
|
|
16
16
|
import { Path } from '@dxos/react-ui-mosaic';
|
|
17
17
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
18
18
|
|
|
19
|
-
import {
|
|
19
|
+
import { NavTree } from './NavTree';
|
|
20
20
|
import { createTree, updateState } from '../testing';
|
|
21
21
|
|
|
22
22
|
faker.seed(1234);
|
|
@@ -24,9 +24,9 @@ faker.seed(1234);
|
|
|
24
24
|
const tree = create<NodeArg<any>>(createTree());
|
|
25
25
|
const state = new Map<string, ReactiveObject<{ open: boolean; current: boolean }>>();
|
|
26
26
|
|
|
27
|
-
const meta: Meta<typeof
|
|
27
|
+
const meta: Meta<typeof NavTree> = {
|
|
28
28
|
title: 'plugins/plugin-navtree/NavTree',
|
|
29
|
-
component:
|
|
29
|
+
component: NavTree,
|
|
30
30
|
decorators: [withTheme, withLayout({ tooltips: true })],
|
|
31
31
|
render: (args) => {
|
|
32
32
|
useEffect(() => {
|
|
@@ -52,7 +52,7 @@ const meta: Meta<typeof StorybookNavTree> = {
|
|
|
52
52
|
});
|
|
53
53
|
}, []);
|
|
54
54
|
|
|
55
|
-
return <
|
|
55
|
+
return <NavTree {...args} />;
|
|
56
56
|
},
|
|
57
57
|
args: {
|
|
58
58
|
id: tree.id,
|
|
@@ -60,7 +60,7 @@ const meta: Meta<typeof StorybookNavTree> = {
|
|
|
60
60
|
actions: arg.nodes?.filter((node) => isActionLike(node)) ?? [],
|
|
61
61
|
groupedActions: {},
|
|
62
62
|
}),
|
|
63
|
-
getItems: (testItem?: any) => {
|
|
63
|
+
getItems: (testItem?: NodeArg<any>) => {
|
|
64
64
|
return testItem?.nodes ?? tree.nodes ?? [];
|
|
65
65
|
},
|
|
66
66
|
getProps: (testItem: NodeArg<any>) => ({
|