@dxos/plugin-navtree 0.8.4-main.422d1c7879 → 0.8.4-main.43cb759274
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/LICENSE +102 -5
- package/PLUGIN.mdl +376 -0
- package/README.md +1 -1
- package/dist/lib/neutral/CommandsDialogContent-UBGIQ5FI.mjs +112 -0
- package/dist/lib/neutral/CommandsDialogContent-UBGIQ5FI.mjs.map +7 -0
- package/dist/lib/neutral/CommandsTrigger-BH5WLMHK.mjs +27 -0
- package/dist/lib/neutral/CommandsTrigger-BH5WLMHK.mjs.map +7 -0
- package/dist/lib/neutral/NavTreeContainer-6AR4BFDD.mjs +12 -0
- package/dist/lib/neutral/NavTreeContainer-6AR4BFDD.mjs.map +7 -0
- package/dist/lib/neutral/NavTreeDocumentTitle-H3E6ZLYE.mjs +22 -0
- package/dist/lib/neutral/NavTreeDocumentTitle-H3E6ZLYE.mjs.map +7 -0
- package/dist/lib/neutral/NavTreePlugin.mjs +68 -0
- package/dist/lib/neutral/NavTreePlugin.mjs.map +7 -0
- package/dist/lib/neutral/NavTreePlugin.node.mjs +18 -0
- package/dist/lib/neutral/NavTreePlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/NavTreePlugin.workerd.mjs +16 -0
- package/dist/lib/neutral/NavTreePlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-Z347LKSF.mjs +42 -0
- package/dist/lib/neutral/app-graph-builder-Z347LKSF.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +17 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-5OPDKH6B.mjs +273 -0
- package/dist/lib/neutral/chunk-5OPDKH6B.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-JOSNCOV4.mjs +79 -0
- package/dist/lib/neutral/chunk-JOSNCOV4.mjs.map +7 -0
- package/dist/lib/neutral/chunk-MDGKDQMZ.mjs +37 -0
- package/dist/lib/neutral/chunk-MDGKDQMZ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-T7QS2EFI.mjs +8 -0
- package/dist/lib/neutral/chunk-T7QS2EFI.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZSWYB7JW.mjs +27 -0
- package/dist/lib/neutral/chunk-ZSWYB7JW.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +807 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +20 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/expose-26FV4W5D.mjs +38 -0
- package/dist/lib/neutral/expose-26FV4W5D.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +178 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +34 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/keyboard-EJ65BVTC.mjs +56 -0
- package/dist/lib/neutral/keyboard-EJ65BVTC.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +12 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-ORDOJUL2.mjs +13 -0
- package/dist/lib/neutral/operation-handler-ORDOJUL2.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-Q5XMAG7Z.mjs +50 -0
- package/dist/lib/neutral/react-surface-Q5XMAG7Z.mjs.map +7 -0
- package/dist/lib/neutral/state-VVITVXWM.mjs +127 -0
- package/dist/lib/neutral/state-VVITVXWM.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +439 -0
- package/dist/lib/neutral/testing/index.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +23 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/NavTreePlugin.d.ts +1 -0
- package/dist/types/src/NavTreePlugin.d.ts.map +1 -1
- package/dist/types/src/NavTreePlugin.node.d.ts +4 -0
- package/dist/types/src/NavTreePlugin.node.d.ts.map +1 -0
- package/dist/types/src/NavTreePlugin.test.d.ts +2 -0
- package/dist/types/src/NavTreePlugin.test.d.ts.map +1 -0
- package/dist/types/src/NavTreePlugin.workerd.d.ts +4 -0
- package/dist/types/src/NavTreePlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.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 +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts +8 -9
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts +2 -2
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L1Tabs.d.ts.map +1 -1
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.d.ts.map +1 -1
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/types.d.ts +0 -1
- package/dist/types/src/components/types.d.ts.map +1 -1
- package/dist/types/src/containers/CommandsDialogContent/CommandsDialogContent.stories.d.ts +8 -9
- package/dist/types/src/containers/CommandsDialogContent/CommandsDialogContent.stories.d.ts.map +1 -1
- package/dist/types/src/containers/NavTreeContainer/NavTreeContainer.d.ts.map +1 -1
- package/dist/types/src/containers/NavTreeDocumentTitle/NavTreeDocumentTitle.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.d.ts +2 -2
- package/dist/types/src/experimental/Tree.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/useActions.d.ts +6 -0
- package/dist/types/src/hooks/useActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useLoadDescendents.d.ts.map +1 -1
- package/dist/types/src/hooks/useNavTreeModel.d.ts.map +1 -1
- package/dist/types/src/hooks/useNavTreeState.d.ts +1 -5
- package/dist/types/src/hooks/useNavTreeState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/expose.d.ts +1 -1
- package/dist/types/src/operations/expose.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/testing/generator.d.ts.map +1 -1
- package/dist/types/src/testing/update-state.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +8 -10
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/NavTreeCapabilities.d.ts +13 -0
- package/dist/types/src/types/NavTreeCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/NavTreeEvents.d.ts +3 -0
- package/dist/types/src/types/NavTreeEvents.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +4 -0
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +1 -1
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +108 -55
- package/src/NavTreePlugin.node.ts +17 -0
- package/src/NavTreePlugin.test.ts +27 -0
- package/src/NavTreePlugin.tsx +10 -22
- package/src/NavTreePlugin.workerd.ts +16 -0
- package/src/capabilities/app-graph-builder.ts +1 -1
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +3 -3
- package/src/capabilities/state.ts +12 -8
- package/src/components/NavTree/NavTree.stories.tsx +8 -10
- package/src/components/NavTree/NavTree.tsx +2 -2
- package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +2 -2
- package/src/components/NavTreeItem/NavTreeItemAction.tsx +12 -12
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +17 -60
- package/src/components/Sidebar/L0Menu.tsx +17 -11
- package/src/components/Sidebar/L1Panel.tsx +87 -168
- package/src/components/types.ts +0 -1
- package/src/containers/CommandsDialogContent/CommandsDialogContent.stories.tsx +2 -1
- package/src/containers/NavTreeContainer/NavTreeContainer.tsx +0 -9
- package/src/experimental/Tree.tsx +2 -2
- package/src/hooks/useActions.ts +10 -0
- package/src/hooks/useNavTreeModel.ts +3 -1
- package/src/hooks/useNavTreeState.ts +1 -8
- package/src/index.ts +1 -2
- package/src/meta.ts +22 -7
- package/src/operations/expose.ts +1 -1
- package/src/operations/index.ts +1 -1
- package/src/plugin.ts +11 -0
- package/src/testing/app-graph-builder.ts +7 -5
- package/src/testing/generator.ts +2 -7
- package/src/translations.ts +0 -1
- package/src/types/NavTreeCapabilities.ts +21 -0
- package/src/types/{events.ts → NavTreeEvents.ts} +3 -3
- package/src/types/index.ts +3 -2
- package/src/types/schema.ts +4 -0
- package/src/util.ts +1 -1
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/index.mjs +0 -202
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -16
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -5
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/types/capabilities.ts +0 -21
package/src/meta.ts
CHANGED
|
@@ -2,19 +2,34 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
6
7
|
import { trim } from '@dxos/util';
|
|
7
8
|
|
|
8
|
-
export const meta
|
|
9
|
-
|
|
9
|
+
export const meta = Plugin.makeMeta({
|
|
10
|
+
key: DXN.make('org.dxos.plugin.navtree'),
|
|
10
11
|
name: 'Navtree',
|
|
12
|
+
author: 'DXOS',
|
|
13
|
+
spec: 'PLUGIN.mdl',
|
|
11
14
|
description: trim`
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
NavTreePlugin renders the application graph as a collapsible hierarchical tree in the Composer sidebar.
|
|
16
|
+
It manages workspace tabs at the root level and provides expand/collapse navigation for spaces, folders,
|
|
17
|
+
and objects, with open/current state persisted to localStorage across sessions.
|
|
18
|
+
|
|
19
|
+
The plugin wires drag-and-drop rearrangement and cross-parent transfer of tree items via Pragmatic DnD,
|
|
20
|
+
and registers graph-action keyboard shortcuts (including the ⌘K / Ctrl+K command palette) through a
|
|
21
|
+
global Keyboard singleton that tracks context as the user navigates.
|
|
22
|
+
|
|
23
|
+
An operation handler for LayoutOperation.Expose expands ancestor paths on demand so that any
|
|
24
|
+
programmatically activated item is scrolled into view in the tree.
|
|
25
|
+
|
|
26
|
+
A commands dialog surfaces all discoverable graph actions as a searchable palette, making it the primary
|
|
27
|
+
keyboard-first entry point for power users.
|
|
14
28
|
`,
|
|
15
|
-
|
|
29
|
+
tags: ['system'],
|
|
30
|
+
});
|
|
16
31
|
|
|
17
32
|
// TODO(wittjosiah): Factor out.
|
|
18
33
|
export const KEY_BINDING = 'KeyBinding';
|
|
19
34
|
// TODO(wittjosiah): Factor out.
|
|
20
|
-
export const COMMANDS_DIALOG = `${meta.id}.
|
|
35
|
+
export const COMMANDS_DIALOG = DXN.make(`${meta.id}.commandsDialog`);
|
package/src/operations/expose.ts
CHANGED
|
@@ -7,8 +7,8 @@ import * as Option from 'effect/Option';
|
|
|
7
7
|
|
|
8
8
|
import { Capability } from '@dxos/app-framework';
|
|
9
9
|
import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
10
11
|
import { log } from '@dxos/log';
|
|
11
|
-
import { Operation } from '@dxos/operation';
|
|
12
12
|
import { Graph } from '@dxos/plugin-graph';
|
|
13
13
|
import { expandAttendableId } from '@dxos/react-ui-attention';
|
|
14
14
|
|
package/src/operations/index.ts
CHANGED
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const NavTreePlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { NavTreeOperationHandlerSet } from './operations';
|
|
@@ -26,7 +26,7 @@ export const storybookGraphBuilders = (): BuilderExtensions => {
|
|
|
26
26
|
Effect.all([
|
|
27
27
|
// Create app menu actions.
|
|
28
28
|
GraphBuilder.createExtension({
|
|
29
|
-
id: '
|
|
29
|
+
id: 'appMenu',
|
|
30
30
|
match: NodeMatcher.whenRoot,
|
|
31
31
|
actions: () =>
|
|
32
32
|
Effect.succeed(
|
|
@@ -45,7 +45,7 @@ export const storybookGraphBuilders = (): BuilderExtensions => {
|
|
|
45
45
|
}),
|
|
46
46
|
// Create user account node.
|
|
47
47
|
GraphBuilder.createExtension({
|
|
48
|
-
id: '
|
|
48
|
+
id: 'userAccount',
|
|
49
49
|
match: NodeMatcher.whenRoot,
|
|
50
50
|
connector: () =>
|
|
51
51
|
Effect.succeed([
|
|
@@ -127,7 +127,7 @@ export const storybookGraphBuilders = (): BuilderExtensions => {
|
|
|
127
127
|
}),
|
|
128
128
|
// Create space actions.
|
|
129
129
|
GraphBuilder.createExtension({
|
|
130
|
-
id: '
|
|
130
|
+
id: 'spaceActions',
|
|
131
131
|
match: NodeMatcher.whenNodeType('space'),
|
|
132
132
|
actions: () =>
|
|
133
133
|
Effect.succeed(
|
|
@@ -171,6 +171,8 @@ export const storybookGraphBuilders = (): BuilderExtensions => {
|
|
|
171
171
|
properties: getProperties(`object-${i}`, {
|
|
172
172
|
label: `Object ${i}`,
|
|
173
173
|
icon: random.properties.icon(),
|
|
174
|
+
...(i % 3 === 0 && { count: (i + 1) * 2 }),
|
|
175
|
+
...(i % 3 === 1 && { modifiedCount: i + 1 }),
|
|
174
176
|
}),
|
|
175
177
|
}),
|
|
176
178
|
);
|
|
@@ -178,14 +180,14 @@ export const storybookGraphBuilders = (): BuilderExtensions => {
|
|
|
178
180
|
}),
|
|
179
181
|
// Create object actions.
|
|
180
182
|
GraphBuilder.createExtension({
|
|
181
|
-
id: '
|
|
183
|
+
id: 'objectActions',
|
|
182
184
|
match: NodeMatcher.whenNodeType('object'),
|
|
183
185
|
actions: () =>
|
|
184
186
|
Effect.succeed(
|
|
185
187
|
Array.from({ length: 5 }, (_, i) => ({
|
|
186
188
|
id: `action-${i}`,
|
|
187
189
|
data: Effect.fnUntraced(function* () {
|
|
188
|
-
log.info('action', { id: '
|
|
190
|
+
log.info('action', { id: 'objectActions', index: i });
|
|
189
191
|
}),
|
|
190
192
|
properties: getProperties(`action-${i}`, {
|
|
191
193
|
label: `Action ${i}`,
|
package/src/testing/generator.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
7
|
import { type Node } from '@dxos/app-graph';
|
|
8
|
-
import { Obj, Type } from '@dxos/echo';
|
|
8
|
+
import { DXN, Obj, Type } from '@dxos/echo';
|
|
9
9
|
import { TestSchema } from '@dxos/echo/testing';
|
|
10
10
|
import { random } from '@dxos/random';
|
|
11
11
|
import { range } from '@dxos/util';
|
|
@@ -63,12 +63,7 @@ export const defaultGenerators: { [type: string]: ObjectDataGenerator } = {
|
|
|
63
63
|
repo: Schema.String,
|
|
64
64
|
status: Schema.String,
|
|
65
65
|
priority: Schema.Number,
|
|
66
|
-
}).pipe(
|
|
67
|
-
Type.object({
|
|
68
|
-
typename: 'com.example.type.project',
|
|
69
|
-
version: '0.1.0',
|
|
70
|
-
}),
|
|
71
|
-
),
|
|
66
|
+
}).pipe(Type.makeObject(DXN.make('com.example.type.project', '0.1.0'))),
|
|
72
67
|
|
|
73
68
|
createData: () => ({
|
|
74
69
|
title: random.commerce.productName(),
|
package/src/translations.ts
CHANGED
|
@@ -11,7 +11,6 @@ export const translations = [
|
|
|
11
11
|
'en-US': {
|
|
12
12
|
[meta.id]: {
|
|
13
13
|
'app-menu.label': 'App menu',
|
|
14
|
-
'open-settings.label': 'Settings',
|
|
15
14
|
'open-commands.label': 'Search commands',
|
|
16
15
|
'commands-dialog.title': 'Commands',
|
|
17
16
|
'command-list-input.placeholder': 'Search for commands…',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
8
|
+
|
|
9
|
+
import { Capability } from '@dxos/app-framework';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
|
|
13
|
+
export type NavTreeItemState = { open: boolean; current: boolean };
|
|
14
|
+
|
|
15
|
+
export type NavTreeStateStore = {
|
|
16
|
+
getItem: (path: string[]) => NavTreeItemState;
|
|
17
|
+
getItemAtom: (path: string[]) => Atom.Atom<NavTreeItemState>;
|
|
18
|
+
setItem: (path: string[], key: 'open' | 'current', next: boolean) => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const State = Capability.make<NavTreeStateStore>(`${meta.id}.capability.state`);
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
5
7
|
import { type ActivationEvent } from '@dxos/app-framework';
|
|
6
8
|
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
7
9
|
|
|
8
10
|
import { meta } from '#meta';
|
|
9
11
|
|
|
10
|
-
export
|
|
11
|
-
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(meta.id);
|
|
12
|
-
}
|
|
12
|
+
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(meta.id);
|
package/src/types/index.ts
CHANGED
package/src/types/schema.ts
CHANGED
|
@@ -43,6 +43,10 @@ export type NodeProperties = SharedProperties & {
|
|
|
43
43
|
error?: string;
|
|
44
44
|
modified?: boolean;
|
|
45
45
|
palette?: string;
|
|
46
|
+
/** Optional item count rendered as a neutral badge after the label. */
|
|
47
|
+
count?: number;
|
|
48
|
+
/** Optional count of new/modified items; when greater than zero it shows as a rose badge in place of `count`. */
|
|
49
|
+
modifiedCount?: number;
|
|
46
50
|
};
|
|
47
51
|
|
|
48
52
|
export type ActionProperties = SharedProperties & {
|
package/src/util.ts
CHANGED
|
@@ -93,7 +93,7 @@ export const getChildren = (
|
|
|
93
93
|
* Determines whether a node should be visible based on its disposition.
|
|
94
94
|
*/
|
|
95
95
|
export const filterItems = (node: Node.Node, disposition?: string) => {
|
|
96
|
-
if (!disposition &&
|
|
96
|
+
if (!disposition && node.properties.disposition === 'hidden') {
|
|
97
97
|
return false;
|
|
98
98
|
} else if (!disposition) {
|
|
99
99
|
const action = Node.isAction(node);
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
// src/types/capabilities.ts
|
|
2
|
-
import { Capability } from "@dxos/app-framework";
|
|
3
|
-
import { meta } from "#meta";
|
|
4
|
-
(function(NavTreeCapabilities2) {
|
|
5
|
-
NavTreeCapabilities2.State = Capability.make(`${meta.id}.capability.state`);
|
|
6
|
-
})(NavTreeCapabilities || (NavTreeCapabilities = {}));
|
|
7
|
-
var NavTreeCapabilities;
|
|
8
|
-
|
|
9
|
-
// src/types/events.ts
|
|
10
|
-
import { AppActivationEvents } from "@dxos/app-toolkit";
|
|
11
|
-
import { meta as meta2 } from "#meta";
|
|
12
|
-
(function(NavTreeEvents3) {
|
|
13
|
-
NavTreeEvents3.StateReady = AppActivationEvents.createStateEvent(meta2.id);
|
|
14
|
-
})(NavTreeEvents || (NavTreeEvents = {}));
|
|
15
|
-
var NavTreeEvents;
|
|
16
|
-
|
|
17
|
-
// src/NavTreePlugin.tsx
|
|
18
|
-
import * as Effect from "effect/Effect";
|
|
19
|
-
import { ActivationEvent, ActivationEvents, Capabilities, Capability as Capability2, Plugin } from "@dxos/app-framework";
|
|
20
|
-
import { AppActivationEvents as AppActivationEvents2, AppCapabilities, AppPlugin, LayoutOperation } from "@dxos/app-toolkit";
|
|
21
|
-
import { Graph } from "@dxos/plugin-graph";
|
|
22
|
-
import { AppGraphBuilder, Keyboard, OperationHandler, ReactSurface, State } from "#capabilities";
|
|
23
|
-
import { NODE_TYPE } from "#containers";
|
|
24
|
-
import { meta as meta4 } from "#meta";
|
|
25
|
-
import { NavTreeEvents as NavTreeEvents2 } from "#types";
|
|
26
|
-
|
|
27
|
-
// src/translations.ts
|
|
28
|
-
import { meta as meta3 } from "#meta";
|
|
29
|
-
var translations = [
|
|
30
|
-
{
|
|
31
|
-
"en-US": {
|
|
32
|
-
[meta3.id]: {
|
|
33
|
-
"app-menu.label": "App menu",
|
|
34
|
-
"open-settings.label": "Settings",
|
|
35
|
-
"open-commands.label": "Search commands",
|
|
36
|
-
"commands-dialog.title": "Commands",
|
|
37
|
-
"command-list-input.placeholder": "Search for commands\u2026",
|
|
38
|
-
"node-actions-menu-invoker.label": "More options",
|
|
39
|
-
"tree-item-actions.label": "More actions",
|
|
40
|
-
"button-back.button": "Back to Space"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
];
|
|
45
|
-
|
|
46
|
-
// src/NavTreePlugin.tsx
|
|
47
|
-
var NavTreePlugin = Plugin.define(meta4).pipe(AppPlugin.addAppGraphModule({
|
|
48
|
-
activate: AppGraphBuilder
|
|
49
|
-
}), AppPlugin.addMetadataModule({
|
|
50
|
-
metadata: {
|
|
51
|
-
id: NODE_TYPE,
|
|
52
|
-
metadata: {
|
|
53
|
-
parse: ({ item }, type) => {
|
|
54
|
-
switch (type) {
|
|
55
|
-
case "node":
|
|
56
|
-
return item;
|
|
57
|
-
case "object":
|
|
58
|
-
return item.data;
|
|
59
|
-
case "view-object":
|
|
60
|
-
return {
|
|
61
|
-
id: `${item.id}-view`,
|
|
62
|
-
object: item.data
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}), AppPlugin.addOperationHandlerModule({
|
|
69
|
-
activate: OperationHandler
|
|
70
|
-
}), AppPlugin.addSurfaceModule({
|
|
71
|
-
activate: ReactSurface
|
|
72
|
-
}), AppPlugin.addTranslationsModule({
|
|
73
|
-
translations
|
|
74
|
-
}), Plugin.addModule({
|
|
75
|
-
id: "state",
|
|
76
|
-
activatesOn: AppActivationEvents2.LayoutReady,
|
|
77
|
-
firesAfterActivation: [
|
|
78
|
-
NavTreeEvents2.StateReady
|
|
79
|
-
],
|
|
80
|
-
activate: State
|
|
81
|
-
}), Plugin.addModule({
|
|
82
|
-
id: "expose",
|
|
83
|
-
activatesOn: ActivationEvent.allOf(ActivationEvents.OperationInvokerReady, AppActivationEvents2.AppGraphReady, AppActivationEvents2.LayoutReady, NavTreeEvents2.StateReady),
|
|
84
|
-
activate: Effect.fnUntraced(function* () {
|
|
85
|
-
const layout = yield* Capabilities.getAtomValue(AppCapabilities.Layout);
|
|
86
|
-
const { invokePromise } = yield* Capability2.get(Capabilities.OperationInvoker);
|
|
87
|
-
const { graph } = yield* Capability2.get(AppCapabilities.AppGraph);
|
|
88
|
-
if (invokePromise && layout.active.length === 1) {
|
|
89
|
-
void Graph.waitForPath(graph, {
|
|
90
|
-
target: layout.active[0]
|
|
91
|
-
}, {
|
|
92
|
-
timeout: 3e4
|
|
93
|
-
}).then(() => invokePromise(LayoutOperation.Expose, {
|
|
94
|
-
subject: layout.active[0]
|
|
95
|
-
})).catch(() => {
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
return [];
|
|
99
|
-
})
|
|
100
|
-
}), Plugin.addModule({
|
|
101
|
-
id: "keyboard",
|
|
102
|
-
activatesOn: ActivationEvent.allOf(AppActivationEvents2.AppGraphReady, ActivationEvents.OperationInvokerReady),
|
|
103
|
-
activate: Keyboard
|
|
104
|
-
}), Plugin.make);
|
|
105
|
-
|
|
106
|
-
// src/meta.ts
|
|
107
|
-
import { trim } from "@dxos/util";
|
|
108
|
-
var meta5 = {
|
|
109
|
-
id: "org.dxos.plugin.navtree",
|
|
110
|
-
name: "Navtree",
|
|
111
|
-
description: trim`
|
|
112
|
-
Hierarchical navigation tree for browsing spaces, folders, and objects.
|
|
113
|
-
Provides sidebar navigation with collapsible sections and quick access to workspace content.
|
|
114
|
-
`
|
|
115
|
-
};
|
|
116
|
-
var KEY_BINDING = "KeyBinding";
|
|
117
|
-
var COMMANDS_DIALOG = `${meta5.id}.commands-dialog`;
|
|
118
|
-
|
|
119
|
-
// src/util.ts
|
|
120
|
-
import { Graph as Graph2, Node } from "@dxos/plugin-graph";
|
|
121
|
-
import { isNonNullable } from "@dxos/util";
|
|
122
|
-
var getParent = (graph, node, path) => {
|
|
123
|
-
const parentId = path[path.length - 2];
|
|
124
|
-
return Graph2.getConnections(graph, node.id, Node.childRelation("inbound")).find((n) => n.id === parentId);
|
|
125
|
-
};
|
|
126
|
-
var getPersistenceParent = (graph, node, path, persistenceClass) => {
|
|
127
|
-
if (node.properties.acceptPersistenceClass?.has(persistenceClass)) {
|
|
128
|
-
return node;
|
|
129
|
-
} else {
|
|
130
|
-
const parent = getParent(graph, node, path);
|
|
131
|
-
return parent ? getPersistenceParent(graph, parent, path.slice(0, path.length - 1), persistenceClass) : null;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
var resolveMigrationOperation = (graph, activeNode, destinationPath, destinationRelatedNode) => {
|
|
135
|
-
const activeClass = activeNode.properties.persistenceClass;
|
|
136
|
-
if (destinationRelatedNode && activeClass) {
|
|
137
|
-
const persistenceParent = getPersistenceParent(graph, destinationRelatedNode, destinationPath, activeClass);
|
|
138
|
-
if (persistenceParent) {
|
|
139
|
-
const activeKey = activeNode.properties.persistenceKey;
|
|
140
|
-
if (activeKey && persistenceParent?.properties.acceptPersistenceKey) {
|
|
141
|
-
return persistenceParent.properties.acceptPersistenceKey.has(activeKey) && persistenceParent.properties.onTransferStart ? "transfer" : persistenceParent.properties.onCopy ? "copy" : "reject";
|
|
142
|
-
} else {
|
|
143
|
-
return "reject";
|
|
144
|
-
}
|
|
145
|
-
} else {
|
|
146
|
-
return "reject";
|
|
147
|
-
}
|
|
148
|
-
} else {
|
|
149
|
-
return "reject";
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
var sortActions = (actions) => actions.sort((a, b) => {
|
|
153
|
-
if (a.properties.disposition === b.properties.disposition) {
|
|
154
|
-
return 0;
|
|
155
|
-
}
|
|
156
|
-
if (a.properties.disposition === "list-item-primary") {
|
|
157
|
-
return -1;
|
|
158
|
-
}
|
|
159
|
-
return 1;
|
|
160
|
-
});
|
|
161
|
-
var getChildren = (graph, node, path = []) => {
|
|
162
|
-
return Graph2.getConnections(graph, node.id, "child").map((n) => {
|
|
163
|
-
const nextPath = [
|
|
164
|
-
...path,
|
|
165
|
-
node.id
|
|
166
|
-
];
|
|
167
|
-
return nextPath.includes(n.id) ? void 0 : n;
|
|
168
|
-
}).filter(isNonNullable);
|
|
169
|
-
};
|
|
170
|
-
var filterItems = (node, disposition) => {
|
|
171
|
-
if (!disposition && (node.properties.disposition === "hidden" || node.properties.disposition === "alternate-tree")) {
|
|
172
|
-
return false;
|
|
173
|
-
} else if (!disposition) {
|
|
174
|
-
const action = Node.isAction(node);
|
|
175
|
-
return !action || node.properties.disposition === "item";
|
|
176
|
-
} else {
|
|
177
|
-
return node.properties.disposition === disposition;
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
var l0ItemType = (item) => {
|
|
181
|
-
if (Node.isActionLike(item)) {
|
|
182
|
-
return "action";
|
|
183
|
-
} else {
|
|
184
|
-
return "tab";
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
export {
|
|
188
|
-
COMMANDS_DIALOG,
|
|
189
|
-
KEY_BINDING,
|
|
190
|
-
NavTreeCapabilities,
|
|
191
|
-
NavTreeEvents,
|
|
192
|
-
NavTreePlugin,
|
|
193
|
-
filterItems,
|
|
194
|
-
getChildren,
|
|
195
|
-
getParent,
|
|
196
|
-
getPersistenceParent,
|
|
197
|
-
l0ItemType,
|
|
198
|
-
meta5 as meta,
|
|
199
|
-
resolveMigrationOperation,
|
|
200
|
-
sortActions
|
|
201
|
-
};
|
|
202
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/capabilities.ts", "../../../src/types/events.ts", "../../../src/NavTreePlugin.tsx", "../../../src/translations.ts", "../../../src/meta.ts", "../../../src/util.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nexport namespace NavTreeCapabilities {\n export type NavTreeItemState = { open: boolean; current: boolean; alternateTree?: boolean };\n\n export type NavTreeStateStore = {\n getItem: (path: string[]) => NavTreeItemState;\n getItemAtom: (path: string[]) => Atom.Atom<NavTreeItemState>;\n setItem: (path: string[], key: 'open' | 'current' | 'alternateTree', next: boolean) => void;\n };\n\n export const State = Capability.make<NavTreeStateStore>(`${meta.id}.capability.state`);\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ActivationEvent } from '@dxos/app-framework';\nimport { AppActivationEvents } from '@dxos/app-toolkit';\n\nimport { meta } from '#meta';\n\nexport namespace NavTreeEvents {\n export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(meta.id);\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { ActivationEvent, ActivationEvents, Capabilities, Capability, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppCapabilities, AppPlugin, LayoutOperation } from '@dxos/app-toolkit';\nimport { Graph } from '@dxos/plugin-graph';\nimport { type TreeData } from '@dxos/react-ui-list';\n\nimport { AppGraphBuilder, Keyboard, OperationHandler, ReactSurface, State } from '#capabilities';\nimport { NODE_TYPE } from '#containers';\nimport { meta } from '#meta';\nimport { NavTreeEvents } from '#types';\n\nimport { translations } from './translations';\n\nexport const NavTreePlugin = Plugin.define(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addMetadataModule({\n metadata: {\n id: NODE_TYPE,\n metadata: {\n parse: ({ item }: TreeData, type: string) => {\n switch (type) {\n case 'node':\n return item;\n case 'object':\n return item.data;\n case 'view-object':\n return { id: `${item.id}-view`, object: item.data };\n }\n },\n },\n },\n }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule({\n id: 'state',\n activatesOn: AppActivationEvents.LayoutReady,\n firesAfterActivation: [NavTreeEvents.StateReady],\n activate: State,\n }),\n Plugin.addModule({\n id: 'expose',\n activatesOn: ActivationEvent.allOf(\n ActivationEvents.OperationInvokerReady,\n AppActivationEvents.AppGraphReady,\n AppActivationEvents.LayoutReady,\n NavTreeEvents.StateReady,\n ),\n activate: Effect.fnUntraced(function* () {\n const layout = yield* Capabilities.getAtomValue(AppCapabilities.Layout);\n const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);\n const { graph } = yield* Capability.get(AppCapabilities.AppGraph);\n if (invokePromise && layout.active.length === 1) {\n // TODO(wittjosiah): This should really be fired once the navtree renders for the first time.\n // That is the point at which the graph is expanded and the path should be available.\n void Graph.waitForPath(graph, { target: layout.active[0] }, { timeout: 30_000 })\n .then(() => invokePromise(LayoutOperation.Expose, { subject: layout.active[0] }))\n .catch(() => {});\n }\n\n return [];\n }),\n }),\n Plugin.addModule({\n id: 'keyboard',\n activatesOn: ActivationEvent.allOf(AppActivationEvents.AppGraphReady, ActivationEvents.OperationInvokerReady),\n activate: Keyboard,\n }),\n Plugin.make,\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'app-menu.label': 'App menu',\n 'open-settings.label': 'Settings',\n 'open-commands.label': 'Search commands',\n 'commands-dialog.title': 'Commands',\n 'command-list-input.placeholder': 'Search for commands…',\n 'node-actions-menu-invoker.label': 'More options',\n 'tree-item-actions.label': 'More actions',\n 'button-back.button': 'Back to Space',\n },\n },\n },\n] as const satisfies Resource[];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.navtree',\n name: 'Navtree',\n description: trim`\n Hierarchical navigation tree for browsing spaces, folders, and objects.\n Provides sidebar navigation with collapsible sections and quick access to workspace content.\n `,\n};\n\n// TODO(wittjosiah): Factor out.\nexport const KEY_BINDING = 'KeyBinding';\n// TODO(wittjosiah): Factor out.\nexport const COMMANDS_DIALOG = `${meta.id}.commands-dialog`;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Graph, Node } from '@dxos/plugin-graph';\nimport { isNonNullable } from '@dxos/util';\n\nimport { type NavTreeItemGraphNode } from '#types';\n\nexport const getParent = (\n graph: Graph.ReadableGraph,\n node: NavTreeItemGraphNode,\n path: string[],\n): NavTreeItemGraphNode | undefined => {\n const parentId = path[path.length - 2];\n return Graph.getConnections(graph, node.id, Node.childRelation('inbound')).find(\n (n: Node.Node) => n.id === parentId,\n ) as NavTreeItemGraphNode | undefined;\n};\n\nexport const getPersistenceParent = (\n graph: Graph.ReadableGraph,\n node: NavTreeItemGraphNode,\n path: string[],\n persistenceClass: string,\n): NavTreeItemGraphNode | null => {\n if (node.properties.acceptPersistenceClass?.has(persistenceClass)) {\n return node;\n } else {\n const parent = getParent(graph, node, path);\n return parent ? getPersistenceParent(graph, parent, path.slice(0, path.length - 1), persistenceClass) : null;\n }\n};\n\nexport const resolveMigrationOperation = (\n graph: Graph.ReadableGraph,\n activeNode: NavTreeItemGraphNode,\n destinationPath: string[],\n destinationRelatedNode?: NavTreeItemGraphNode,\n): 'transfer' | 'copy' | 'reject' => {\n const activeClass = activeNode.properties.persistenceClass;\n if (destinationRelatedNode && activeClass) {\n const persistenceParent = getPersistenceParent(graph, destinationRelatedNode, destinationPath, activeClass);\n if (persistenceParent) {\n const activeKey = activeNode.properties.persistenceKey;\n if (activeKey && persistenceParent?.properties.acceptPersistenceKey) {\n return persistenceParent.properties.acceptPersistenceKey.has(activeKey) &&\n persistenceParent.properties.onTransferStart\n ? 'transfer'\n : persistenceParent.properties.onCopy\n ? 'copy'\n : 'reject';\n } else {\n return 'reject';\n }\n } else {\n return 'reject';\n }\n } else {\n return 'reject';\n }\n};\n\n// TODO(wittjosiah): Move into node implementation?\nexport const sortActions = (actions: Node.Action[]): Node.Action[] =>\n actions.sort((a, b) => {\n if (a.properties.disposition === b.properties.disposition) {\n return 0;\n }\n\n if (a.properties.disposition === 'list-item-primary') {\n return -1;\n }\n\n return 1;\n });\n\nexport const getChildren = (\n graph: Graph.ReadableGraph,\n node: NavTreeItemGraphNode,\n path: readonly string[] = [],\n): NavTreeItemGraphNode[] => {\n return Graph.getConnections(graph, node.id, 'child')\n .map((n: Node.Node) => {\n // Break cycles.\n const nextPath = [...path, node.id];\n return nextPath.includes(n.id) ? undefined : (n as NavTreeItemGraphNode);\n })\n .filter(isNonNullable) as NavTreeItemGraphNode[];\n};\n\n/**\n * Determines whether a node should be visible based on its disposition.\n */\nexport const filterItems = (node: Node.Node, disposition?: string) => {\n if (!disposition && (node.properties.disposition === 'hidden' || node.properties.disposition === 'alternate-tree')) {\n return false;\n } else if (!disposition) {\n const action = Node.isAction(node);\n return !action || node.properties.disposition === 'item';\n } else {\n return node.properties.disposition === disposition;\n }\n};\n\nexport const l0ItemType = (item: Node.Node) => {\n if (Node.isActionLike(item)) {\n return 'action';\n } else {\n return 'tab';\n }\n};\n"],
|
|
5
|
-
"mappings": ";AAMA,SAASA,kBAAkB;AAE3B,SAASC,YAAY;UAEJC,sBAAAA;uBASFC,QAAQC,WAAWC,KAAwB,GAAGC,KAAKC,EAAE,mBAAmB;AACvF,GAViBL,wBAAAA,sBAAAA,CAAAA,EAAAA;;;;ACLjB,SAASM,2BAA2B;AAEpC,SAASC,QAAAA,aAAY;UAEJC,gBAAAA;iBACFC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AAKM,IAAI,OAAA,EACzC8B,IAAI,CAAC1B,MAAAA;AAEJ,UAAM2B,WAAW;SAAIpC;MAAMD,KAAKM;;AAChC,WAAO+B,SAASC,SAAS5B,EAAEJ,EAAE,IAAIiC,SAAa7B;EAChD,CAAA,EACC8B,OAAOC,aAAAA;AACZ;AAKO,IAAMC,cAAc,CAAC1C,MAAiBkC,gBAAAA;AAC3C,MAAI,CAACA,gBAAgBlC,KAAKa,WAAWqB,gBAAgB,YAAYlC,KAAKa,WAAWqB,gBAAgB,mBAAmB;AAClH,WAAO;EACT,WAAW,CAACA,aAAa;AACvB,UAAMS,SAASpC,KAAKqC,SAAS5C,IAAAA;AAC7B,WAAO,CAAC2C,UAAU3C,KAAKa,WAAWqB,gBAAgB;EACpD,OAAO;AACL,WAAOlC,KAAKa,WAAWqB,gBAAgBA;EACzC;AACF;AAEO,IAAMW,aAAa,CAACC,SAAAA;AACzB,MAAIvC,KAAKwC,aAAaD,IAAAA,GAAO;AAC3B,WAAO;EACT,OAAO;AACL,WAAO;EACT;AACF;",
|
|
6
|
-
"names": ["Capability", "meta", "NavTreeCapabilities", "State", "Capability", "make", "meta", "id", "AppActivationEvents", "meta", "NavTreeEvents", "StateReady", "AppActivationEvents", "createStateEvent", "meta", "id", "Effect", "ActivationEvent", "ActivationEvents", "Capabilities", "Capability", "Plugin", "AppActivationEvents", "AppCapabilities", "AppPlugin", "LayoutOperation", "Graph", "AppGraphBuilder", "Keyboard", "OperationHandler", "ReactSurface", "State", "NODE_TYPE", "meta", "NavTreeEvents", "meta", "translations", "meta", "id", "NavTreePlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addAppGraphModule", "activate", "AppGraphBuilder", "addMetadataModule", "metadata", "id", "NODE_TYPE", "parse", "item", "type", "data", "object", "addOperationHandlerModule", "OperationHandler", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "addModule", "activatesOn", "AppActivationEvents", "LayoutReady", "firesAfterActivation", "NavTreeEvents", "StateReady", "State", "ActivationEvent", "allOf", "ActivationEvents", "OperationInvokerReady", "AppGraphReady", "fnUntraced", "layout", "Capabilities", "getAtomValue", "AppCapabilities", "Layout", "invokePromise", "Capability", "get", "OperationInvoker", "graph", "AppGraph", "active", "length", "Graph", "waitForPath", "target", "timeout", "then", "LayoutOperation", "Expose", "subject", "catch", "Keyboard", "make", "trim", "meta", "id", "name", "description", "trim", "KEY_BINDING", "COMMANDS_DIALOG", "Graph", "Node", "isNonNullable", "getParent", "graph", "node", "path", "parentId", "length", "Graph", "getConnections", "id", "Node", "childRelation", "find", "n", "getPersistenceParent", "persistenceClass", "properties", "acceptPersistenceClass", "has", "parent", "slice", "resolveMigrationOperation", "activeNode", "destinationPath", "destinationRelatedNode", "activeClass", "persistenceParent", "activeKey", "persistenceKey", "acceptPersistenceKey", "onTransferStart", "onCopy", "sortActions", "actions", "sort", "a", "b", "disposition", "getChildren", "map", "nextPath", "includes", "undefined", "filter", "isNonNullable", "filterItems", "action", "isAction", "l0ItemType", "item", "isActionLike"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"src/types/capabilities.ts":{"bytes":1799,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/types/events.ts":{"bytes":1322,"imports":[{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/types/schema.ts":{"bytes":2787,"imports":[],"format":"esm"},"src/types/index.ts":{"bytes":644,"imports":[{"path":"src/types/capabilities.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/types/events.ts","kind":"import-statement","original":"./events"},{"path":"src/types/schema.ts","kind":"import-statement","original":"./schema"}],"format":"esm"},"src/translations.ts":{"bytes":2172,"imports":[{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/NavTreePlugin.tsx":{"bytes":10563,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"src/meta.ts":{"bytes":2005,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/util.ts":{"bytes":11388,"imports":[{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":881,"imports":[{"path":"src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"src/NavTreePlugin.tsx","kind":"import-statement","original":"./NavTreePlugin"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/util.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15069},"dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["COMMANDS_DIALOG","KEY_BINDING","NavTreeCapabilities","NavTreeEvents","NavTreePlugin","filterItems","getChildren","getParent","getPersistenceParent","l0ItemType","meta","resolveMigrationOperation","sortActions"],"entryPoint":"src/index.ts","inputs":{"src/types/capabilities.ts":{"bytesInOutput":273},"src/types/index.ts":{"bytesInOutput":0},"src/types/events.ts":{"bytesInOutput":264},"src/index.ts":{"bytesInOutput":0},"src/NavTreePlugin.tsx":{"bytesInOutput":2428},"src/translations.ts":{"bytesInOutput":523},"src/meta.ts":{"bytesInOutput":387},"src/util.ts":{"bytesInOutput":2447}},"bytes":6762}}}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type Atom } from '@effect-atom/atom-react';
|
|
2
|
-
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
export declare namespace NavTreeCapabilities {
|
|
4
|
-
type NavTreeItemState = {
|
|
5
|
-
open: boolean;
|
|
6
|
-
current: boolean;
|
|
7
|
-
alternateTree?: boolean;
|
|
8
|
-
};
|
|
9
|
-
type NavTreeStateStore = {
|
|
10
|
-
getItem: (path: string[]) => NavTreeItemState;
|
|
11
|
-
getItemAtom: (path: string[]) => Atom.Atom<NavTreeItemState>;
|
|
12
|
-
setItem: (path: string[], key: 'open' | 'current' | 'alternateTree', next: boolean) => void;
|
|
13
|
-
};
|
|
14
|
-
const State: Capability.InterfaceDef<NavTreeStateStore>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/types/capabilities.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIjD,yBAAiB,mBAAmB,CAAC;IACnC,KAAY,gBAAgB,GAAG;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAE5F,KAAY,iBAAiB,GAAG;QAC9B,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,gBAAgB,CAAC;QAC9C,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC7D,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,eAAe,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;KAC7F,CAAC;IAEK,MAAM,KAAK,4CAAoE,CAAC;CACxF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/types/events.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAK3D,yBAAiB,aAAa,CAAC;IACtB,MAAM,UAAU,EAAE,eAAe,CAAC,eAA+D,CAAC;CAC1G"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Atom } from '@effect-atom/atom-react';
|
|
6
|
-
|
|
7
|
-
import { Capability } from '@dxos/app-framework';
|
|
8
|
-
|
|
9
|
-
import { meta } from '#meta';
|
|
10
|
-
|
|
11
|
-
export namespace NavTreeCapabilities {
|
|
12
|
-
export type NavTreeItemState = { open: boolean; current: boolean; alternateTree?: boolean };
|
|
13
|
-
|
|
14
|
-
export type NavTreeStateStore = {
|
|
15
|
-
getItem: (path: string[]) => NavTreeItemState;
|
|
16
|
-
getItemAtom: (path: string[]) => Atom.Atom<NavTreeItemState>;
|
|
17
|
-
setItem: (path: string[], key: 'open' | 'current' | 'alternateTree', next: boolean) => void;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const State = Capability.make<NavTreeStateStore>(`${meta.id}.capability.state`);
|
|
21
|
-
}
|