@dxos/plugin-navtree 0.9.0 → 0.9.1-staging.ee54ba693a
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/neutral/{CommandsDialogContent-UBGIQ5FI.mjs → CommandsDialogContent-TEKBCQ3U.mjs} +3 -3
- package/dist/lib/neutral/CommandsDialogContent-TEKBCQ3U.mjs.map +7 -0
- package/dist/lib/neutral/{CommandsTrigger-BH5WLMHK.mjs → CommandsTrigger-HGCI22SP.mjs} +2 -2
- package/dist/lib/neutral/{CommandsTrigger-BH5WLMHK.mjs.map → CommandsTrigger-HGCI22SP.mjs.map} +3 -3
- package/dist/lib/neutral/{NavTreeContainer-6AR4BFDD.mjs → NavTreeContainer-ICDKC2GI.mjs} +2 -2
- package/dist/lib/neutral/{NavTreeDocumentTitle-H3E6ZLYE.mjs → NavTreeDocumentTitle-RMERXZGK.mjs} +2 -2
- package/dist/lib/neutral/{NavTreeDocumentTitle-H3E6ZLYE.mjs.map → NavTreeDocumentTitle-RMERXZGK.mjs.map} +3 -3
- package/dist/lib/neutral/NavTreePlugin.mjs +2 -2
- package/dist/lib/neutral/NavTreePlugin.mjs.map +4 -4
- package/dist/lib/neutral/{app-graph-builder-Z347LKSF.mjs → app-graph-builder-2DYAIROU.mjs} +2 -2
- package/dist/lib/neutral/{app-graph-builder-Z347LKSF.mjs.map → app-graph-builder-2DYAIROU.mjs.map} +3 -3
- package/dist/lib/neutral/capabilities/index.mjs +4 -4
- package/dist/lib/neutral/{chunk-5OPDKH6B.mjs → chunk-4RN6TH36.mjs} +23 -4
- package/dist/lib/neutral/chunk-4RN6TH36.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-ZSWYB7JW.mjs → chunk-BAVI2K7A.mjs} +3 -3
- package/dist/lib/neutral/{chunk-ZSWYB7JW.mjs.map → chunk-BAVI2K7A.mjs.map} +3 -3
- package/dist/lib/neutral/{chunk-T7QS2EFI.mjs → chunk-EAN4K6OL.mjs} +2 -2
- package/dist/lib/neutral/chunk-IRQMJLRY.mjs +45 -0
- package/dist/lib/neutral/chunk-IRQMJLRY.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +52 -43
- package/dist/lib/neutral/components/index.mjs.map +3 -3
- package/dist/lib/neutral/containers/index.mjs +5 -5
- package/dist/lib/neutral/{expose-26FV4W5D.mjs → expose-HIBA2NQG.mjs} +2 -2
- package/dist/lib/neutral/hooks/index.mjs +7 -4
- package/dist/lib/neutral/hooks/index.mjs.map +3 -3
- package/dist/lib/neutral/index.mjs +2 -2
- package/dist/lib/neutral/{keyboard-EJ65BVTC.mjs → keyboard-JM2HCF5N.mjs} +5 -3
- package/dist/lib/neutral/{keyboard-EJ65BVTC.mjs.map → keyboard-JM2HCF5N.mjs.map} +3 -3
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +2 -2
- package/dist/lib/neutral/{react-surface-Q5XMAG7Z.mjs → react-surface-QPMUEDZX.mjs} +11 -13
- package/dist/lib/neutral/react-surface-QPMUEDZX.mjs.map +7 -0
- package/dist/lib/neutral/{state-VVJEWUHM.mjs → state-PDZU4PIP.mjs} +2 -2
- package/dist/lib/neutral/state-PDZU4PIP.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +2 -2
- package/dist/lib/neutral/testing/index.mjs.map +3 -3
- package/dist/lib/neutral/translations.mjs +1 -1
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/lib/neutral/types/index.mjs +1 -1
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +4 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +1 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.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/containers/NavTreeContainer/NavTreeContainer.d.ts.map +1 -1
- package/dist/types/src/hooks/useNavTreeModel.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +32 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/generator.d.ts.map +1 -1
- package/dist/types/src/types/NavTreeCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/NavTreeEvents.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +1 -1
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +31 -0
- package/package.json +41 -41
- package/src/NavTreePlugin.test.ts +1 -1
- package/src/NavTreePlugin.tsx +1 -1
- package/src/capabilities/app-graph-builder.ts +1 -1
- package/src/capabilities/keyboard.ts +5 -2
- package/src/capabilities/react-surface.tsx +8 -14
- package/src/capabilities/state.ts +1 -1
- package/src/components/NavTree/NavTree.stories.tsx +43 -36
- package/src/components/NavTree/NavTree.tsx +5 -4
- package/src/components/NavTreeItem/NavTreeItemAction.tsx +2 -2
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +7 -4
- package/src/components/Sidebar/L0Menu.tsx +14 -7
- package/src/components/Sidebar/L1Panel.tsx +5 -5
- package/src/containers/CommandsDialogContent/CommandsDialogContent.tsx +2 -2
- package/src/containers/CommandsTrigger/CommandsTrigger.tsx +1 -1
- package/src/containers/NavTreeContainer/NavTreeContainer.tsx +17 -3
- package/src/containers/NavTreeDocumentTitle/NavTreeDocumentTitle.tsx +1 -1
- package/src/hooks/useNavTreeModel.ts +8 -4
- package/src/meta.ts +3 -23
- package/src/testing/generator.ts +8 -6
- package/src/translations.ts +1 -1
- package/src/types/NavTreeCapabilities.ts +1 -1
- package/src/types/NavTreeEvents.ts +1 -1
- package/src/types/schema.ts +2 -2
- package/dist/lib/neutral/CommandsDialogContent-UBGIQ5FI.mjs.map +0 -7
- package/dist/lib/neutral/chunk-5OPDKH6B.mjs.map +0 -7
- package/dist/lib/neutral/chunk-MDGKDQMZ.mjs +0 -37
- package/dist/lib/neutral/chunk-MDGKDQMZ.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-Q5XMAG7Z.mjs.map +0 -7
- package/dist/lib/neutral/state-VVJEWUHM.mjs.map +0 -7
- /package/dist/lib/neutral/{NavTreeContainer-6AR4BFDD.mjs.map → NavTreeContainer-ICDKC2GI.mjs.map} +0 -0
- /package/dist/lib/neutral/{chunk-T7QS2EFI.mjs.map → chunk-EAN4K6OL.mjs.map} +0 -0
- /package/dist/lib/neutral/{expose-26FV4W5D.mjs.map → expose-HIBA2NQG.mjs.map} +0 -0
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Instruction, extractInstruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';
|
|
6
6
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
7
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
7
8
|
import React, { forwardRef, memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
8
9
|
|
|
9
10
|
import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
10
11
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
11
|
-
import { useAppGraph, useLayout } from '@dxos/app-toolkit/ui';
|
|
12
|
+
import { AppSurface, useAppGraph, useLayout } from '@dxos/app-toolkit/ui';
|
|
12
13
|
import { Graph, Node, useActionRunner } from '@dxos/plugin-graph';
|
|
13
14
|
import { useMediaQuery, useSidebars } from '@dxos/react-ui';
|
|
14
15
|
import { type TreeData, isTreeData } from '@dxos/react-ui-list';
|
|
@@ -27,7 +28,7 @@ export const NODE_TYPE = 'dxos/app-graph/node';
|
|
|
27
28
|
// TODO(wittjosiah): Avoid using Surface within the navtree, prefer declarative data flow.
|
|
28
29
|
const NavTreeItemEnd = ({ node, open }: { node: Node.Node; open: boolean }) => {
|
|
29
30
|
const data = useMemo(() => ({ id: node.id, subject: node.data, open }), [node.id, node.data, open]);
|
|
30
|
-
return <Surface.Surface
|
|
31
|
+
return <Surface.Surface type={AppSurface.NavtreeItemEnd} data={data} limit={1} />;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
const getItems = (graph: Graph.ReadableGraph, node?: Node.Node, disposition?: string) => {
|
|
@@ -48,7 +49,7 @@ export const NavTreeContainer$ = forwardRef<HTMLDivElement, NavTreeContainerProp
|
|
|
48
49
|
const { getItem, setItem } = useNavTreeState();
|
|
49
50
|
const layout = useLayout();
|
|
50
51
|
const model = useNavTreeModel(Node.RootId);
|
|
51
|
-
const { navigationSidebarState } = useSidebars(meta.
|
|
52
|
+
const { navigationSidebarState } = useSidebars(meta.profile.key);
|
|
52
53
|
const latestRef = useRef({
|
|
53
54
|
tab,
|
|
54
55
|
activeItems: layout.active,
|
|
@@ -230,6 +231,19 @@ export const NavTreeContainer$ = forwardRef<HTMLDivElement, NavTreeContainerProp
|
|
|
230
231
|
});
|
|
231
232
|
}, [graph]);
|
|
232
233
|
|
|
234
|
+
// Group nodes are always expanded and have no toggle, so they never trigger Graph.expand through
|
|
235
|
+
// user interaction. Watch the workspace's children reactively and mark any group nodes as open
|
|
236
|
+
// so the state machinery treats them consistently with regular open nodes (including on next load).
|
|
237
|
+
const workspaceChildren = useAtomValue(graph.connections(tab, 'child'));
|
|
238
|
+
useEffect(() => {
|
|
239
|
+
for (const child of workspaceChildren) {
|
|
240
|
+
if (child.properties.disposition === 'group') {
|
|
241
|
+
setItem([Node.RootId, tab, child.id], 'open', true);
|
|
242
|
+
Graph.expand(graph, child.id, 'child');
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}, [workspaceChildren, tab, setItem, graph]);
|
|
246
|
+
|
|
233
247
|
const onItemHover = useCallback(({ item }: { item: Node.Node }) => Graph.expand(graph, item.id, 'child'), [graph]);
|
|
234
248
|
|
|
235
249
|
const navTreeContextValue = useMemo(
|
|
@@ -10,7 +10,7 @@ import { osTranslations } from '@dxos/ui-theme';
|
|
|
10
10
|
import { meta } from '#meta';
|
|
11
11
|
|
|
12
12
|
export const NavTreeDocumentTitle = ({ node }: { node?: Node.Node }) => {
|
|
13
|
-
const { t } = useTranslation(meta.
|
|
13
|
+
const { t } = useTranslation(meta.profile.key);
|
|
14
14
|
useEffect(() => {
|
|
15
15
|
document.title = node ? toLocalizedString(node.properties.label, t) : t('current-app.name', { ns: osTranslations });
|
|
16
16
|
}, [node?.properties?.label]);
|
|
@@ -45,12 +45,16 @@ const createItemPropsFamily = (graph: ReturnType<typeof useAppGraph>['graph']) =
|
|
|
45
45
|
const droppable =
|
|
46
46
|
node.properties.droppable === false || parentNode?.properties.childrenDroppable === false ? false : undefined;
|
|
47
47
|
|
|
48
|
+
const disposition = node.properties.disposition as string | undefined;
|
|
49
|
+
const isGroup = disposition === 'group';
|
|
50
|
+
|
|
48
51
|
return {
|
|
49
52
|
id: node.id,
|
|
50
|
-
parentOf,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
parentOf: isGroup ? undefined : parentOf,
|
|
54
|
+
disposition,
|
|
55
|
+
disabled: isGroup || node.properties.disabled,
|
|
56
|
+
draggable: isGroup ? false : node.properties.draggable,
|
|
57
|
+
droppable: isGroup ? false : droppable,
|
|
54
58
|
label: node.properties.label ?? node.id,
|
|
55
59
|
className: mx(node.properties.className, node.properties.modified && 'italic'),
|
|
56
60
|
headingClassName: node.properties.headingClassName,
|
package/src/meta.ts
CHANGED
|
@@ -4,32 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { DXN } from '@dxos/keys';
|
|
7
|
-
import { trim } from '@dxos/util';
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
key: DXN.make('org.dxos.plugin.navtree'),
|
|
11
|
-
name: 'Navtree',
|
|
12
|
-
author: 'DXOS',
|
|
13
|
-
spec: 'PLUGIN.mdl',
|
|
14
|
-
description: trim`
|
|
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.
|
|
8
|
+
import config from '../dx.config';
|
|
18
9
|
|
|
19
|
-
|
|
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.
|
|
28
|
-
`,
|
|
29
|
-
tags: ['system'],
|
|
30
|
-
});
|
|
10
|
+
export const meta = Plugin.getMetaFromConfig(config);
|
|
31
11
|
|
|
32
12
|
// TODO(wittjosiah): Factor out.
|
|
33
13
|
export const KEY_BINDING = 'KeyBinding';
|
|
34
14
|
// TODO(wittjosiah): Factor out.
|
|
35
|
-
export const COMMANDS_DIALOG = DXN.make(`${meta.
|
|
15
|
+
export const COMMANDS_DIALOG = DXN.make(`${meta.profile.key}.commandsDialog`);
|
package/src/testing/generator.ts
CHANGED
|
@@ -58,12 +58,14 @@ export const defaultGenerators: { [type: string]: ObjectDataGenerator } = {
|
|
|
58
58
|
|
|
59
59
|
project: {
|
|
60
60
|
createSchema: () =>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
Type.makeObject(DXN.make('com.example.type.project', '0.1.0'))(
|
|
62
|
+
Schema.Struct({
|
|
63
|
+
title: Schema.String,
|
|
64
|
+
repo: Schema.String,
|
|
65
|
+
status: Schema.String,
|
|
66
|
+
priority: Schema.Number,
|
|
67
|
+
}),
|
|
68
|
+
),
|
|
67
69
|
|
|
68
70
|
createData: () => ({
|
|
69
71
|
title: random.commerce.productName(),
|
package/src/translations.ts
CHANGED
|
@@ -18,4 +18,4 @@ export type NavTreeStateStore = {
|
|
|
18
18
|
setItem: (path: string[], key: 'open' | 'current', next: boolean) => void;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export const State = Capability.make<NavTreeStateStore>(`${meta.
|
|
21
|
+
export const State = Capability.make<NavTreeStateStore>(`${meta.profile.key}.capability.state`);
|
|
@@ -9,4 +9,4 @@ import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
|
9
9
|
|
|
10
10
|
import { meta } from '#meta';
|
|
11
11
|
|
|
12
|
-
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(meta.
|
|
12
|
+
export const StateReady: ActivationEvent.ActivationEvent = AppActivationEvents.createStateEvent(meta.profile.key);
|
package/src/types/schema.ts
CHANGED
|
@@ -30,7 +30,7 @@ export type FlattenedActions = {
|
|
|
30
30
|
type SharedProperties = {
|
|
31
31
|
testId?: string;
|
|
32
32
|
disabled?: boolean;
|
|
33
|
-
position?: Position;
|
|
33
|
+
position?: Position.Position;
|
|
34
34
|
label: Label;
|
|
35
35
|
className?: string;
|
|
36
36
|
headingClassName?: string;
|
|
@@ -62,7 +62,7 @@ export type ActionProperties = SharedProperties & {
|
|
|
62
62
|
*/
|
|
63
63
|
export type KeyBinding = {
|
|
64
64
|
// NOTE: Keys come from `getHostPlatform` in `@dxos/util`.
|
|
65
|
-
// TODO(thure): Dedupe
|
|
65
|
+
// TODO(thure): Dedupe with the other platform key-binding definitions.
|
|
66
66
|
windows?: string;
|
|
67
67
|
macos?: string;
|
|
68
68
|
ios?: string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/CommandsDialogContent/CommandsDialogContent.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { forwardRef, useMemo, useState } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { Keyboard, keySymbols } from '@dxos/keyboard';\nimport { Graph, Node, useActionRunner } from '@dxos/plugin-graph';\nimport { useActions } from '@dxos/plugin-graph';\nimport { Button, Dialog, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { SearchList, useSearchListResults } from '@dxos/react-ui-search';\nimport { osTranslations } from '@dxos/ui-theme';\nimport { getHostPlatform } from '@dxos/util';\n\nimport { KEY_BINDING, meta } from '#meta';\n\nexport type CommandsDialogContentProps = {\n selected?: string;\n};\n\n// TODO(wittjosiah): This probably deserves its own plugin but for now it lives here w/ other navigation UI.\nexport const CommandsDialogContent = forwardRef<HTMLDivElement, CommandsDialogContentProps>(\n ({ selected: initial }, forwardedRef) => {\n const { t } = useTranslation(meta.id);\n const { invokePromise } = useOperationInvoker();\n const runAction = useActionRunner();\n const { graph } = useAppGraph();\n const [selected, setSelected] = useState<string | undefined>(initial);\n\n // Traverse graph.\n // TODO(burdon): Factor out commonality with shortcut dialog.\n const allActions = useMemo(() => {\n // TODO(burdon): Get from navtree (not keyboard).\n const current = Keyboard.singleton.getCurrentContext();\n const actionMap = new Set<string>();\n const actions: Node.ActionLike[] = [];\n Graph.traverse(graph, {\n relation: ['child', 'action'],\n visitor: (node, path) => {\n const isActionLike = Node.isAction(node) || Node.isActionGroup(node);\n const parentId = path.at(-2) ?? '';\n const matches = current === parentId || current.startsWith(parentId + '/');\n if (isActionLike && !actionMap.has(node.id) && matches) {\n actionMap.add(node.id);\n actions.push(node);\n }\n },\n });\n\n actions.sort((a, b) => {\n return toLocalizedString(a.properties.label, t)\n ?.toLowerCase()\n .localeCompare(toLocalizedString(b.properties.label, t)?.toLowerCase());\n });\n\n return actions;\n }, [graph]);\n\n const group = allActions.find(({ id }) => id === selected);\n const groupActions = useActions(graph, group?.id);\n const actions = Node.isActionGroup(group) ? groupActions : allActions;\n\n const { results, handleSearch } = useSearchListResults({\n items: actions,\n extract: (action) => toLocalizedString(action.properties.label, t),\n });\n\n return (\n <Dialog.Content ref={forwardedRef}>\n <Dialog.Title srOnly>{t('commands-dialog.title', { ns: meta.id })}</Dialog.Title>\n <SearchList.Root onSearch={handleSearch}>\n <SearchList.Input placeholder={t('command-list-input.placeholder')} />\n <SearchList.Viewport>\n {results.map((action) => {\n const shortcut =\n typeof action.properties.keyBinding === 'string'\n ? action.properties.keyBinding\n : action.properties.keyBinding?.[getHostPlatform()];\n\n return (\n <SearchList.Item\n value={action.id}\n key={action.id}\n label={toLocalizedString(action.properties.label, t)}\n icon={action.properties.icon}\n suffix={shortcut ? keySymbols(shortcut).join('') : undefined}\n onSelect={() => {\n if (action.properties.disabled) {\n return;\n }\n\n if (Node.isActionGroup(action)) {\n setSelected(action.id);\n return;\n }\n\n void invokePromise(LayoutOperation.UpdateDialog, { state: false });\n setTimeout(() => {\n const lookupId = group?.id ?? action.id;\n const node = Graph.getConnections(graph, lookupId, Node.actionRelation('inbound'))[0];\n if (node && Node.isAction(action)) {\n void runAction(action, { parent: node, caller: KEY_BINDING });\n }\n });\n }}\n classNames='flex items-center gap-2'\n disabled={action.properties.disabled}\n {...(action.properties?.testId && {\n 'data-testid': action.properties.testId,\n })}\n />\n );\n })}\n </SearchList.Viewport>\n </SearchList.Root>\n <Dialog.ActionBar>\n <Dialog.Close asChild>\n <Button classNames='w-full'>{t('close.label', { ns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OAAO5C,kBAAkBsD,OAAOX,WAAWC,OAAOhC,CAAAA;MAClD2D,MAAMjB,OAAOX,WAAW4B;MACxBC,QAAQN,WAAWzE,WAAWyE,QAAAA,EAAUO,KAAK,EAAA,IAAMC;MACnDC,UAAU,MAAA;AACR,YAAIrB,OAAOX,WAAWiC,UAAU;AAC9B;QACF;AAEA,YAAIjF,KAAKqC,cAAcsB,MAAAA,GAAS;AAC9BrC,sBAAYqC,OAAOzC,EAAE;AACrB;QACF;AAEA,aAAKC,cAAcxB,gBAAgBuF,cAAc;UAAEC,OAAO;QAAM,CAAA;AAChEC,mBAAW,MAAA;AACT,gBAAMC,WAAWjC,OAAOlC,MAAMyC,OAAOzC;AACrC,gBAAMe,OAAOlC,MAAMuF,eAAejE,OAAOgE,UAAUrF,KAAKuF,eAAe,SAAA,CAAA,EAAY,CAAA;AACnF,cAAItD,QAAQjC,KAAKoC,SAASuB,MAAAA,GAAS;AACjC,iBAAKvC,UAAUuC,QAAQ;cAAE6B,QAAQvD;cAAMwD,QAAQ9E;YAAY,CAAA;UAC7D;QACF,CAAA;MACF;MACA+E,YAAW;MACXT,UAAUtB,OAAOX,WAAWiC;MAC3B,GAAItB,OAAOX,YAAY2C,UAAU;QAChC,eAAehC,OAAOX,WAAW2C;MACnC;;EAGN,CAAA,CAAA,CAAA,GAGJ,sBAAA,cAACvF,OAAOwF,WAAS,MACf,sBAAA,cAACxF,OAAOyF,OAAK;IAACC,SAAAA;KACZ,sBAAA,cAAC3F,QAAAA;IAAOuF,YAAW;KAAUzE,EAAE,eAAe;IAAE+C,IAAIvD;EAAe,CAAA,CAAA,CAAA,CAAA,CAAA;AAK7E,CAAA;",
|
|
6
|
-
"names": ["React", "forwardRef", "useMemo", "useState", "useOperationInvoker", "LayoutOperation", "useAppGraph", "Keyboard", "keySymbols", "Graph", "Node", "useActionRunner", "useActions", "Button", "Dialog", "toLocalizedString", "useTranslation", "SearchList", "useSearchListResults", "osTranslations", "getHostPlatform", "KEY_BINDING", "meta", "CommandsDialogContent", "selected", "initial", "forwardedRef", "t", "id", "invokePromise", "runAction", "graph", "setSelected", "allActions", "current", "singleton", "getCurrentContext", "actionMap", "Set", "actions", "traverse", "relation", "visitor", "node", "path", "isActionLike", "isAction", "isActionGroup", "parentId", "at", "matches", "startsWith", "has", "add", "push", "sort", "a", "b", "properties", "label", "toLowerCase", "localeCompare", "group", "find", "groupActions", "results", "handleSearch", "items", "extract", "action", "Content", "ref", "Title", "srOnly", "ns", "Root", "onSearch", "Input", "placeholder", "Viewport", "map", "shortcut", "keyBinding", "Item", "value", "key", "icon", "suffix", "join", "undefined", "onSelect", "disabled", "UpdateDialog", "state", "setTimeout", "lookupId", "getConnections", "actionRelation", "parent", "caller", "classNames", "testId", "ActionBar", "Close", "asChild"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/NavTreeContainer/NavTreeContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Instruction, extractInstruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport React, { forwardRef, memo, useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { Surface, useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { useAppGraph, useLayout } from '@dxos/app-toolkit/ui';\nimport { Graph, Node, useActionRunner } from '@dxos/plugin-graph';\nimport { useMediaQuery, useSidebars } from '@dxos/react-ui';\nimport { type TreeData, isTreeData } from '@dxos/react-ui-list';\nimport { arrayMove } from '@dxos/util';\n\nimport { NAV_TREE_ITEM, NavTree, NavTreeContext } from '#components';\nimport { useNavTreeModel, useNavTreeState } from '#hooks';\nimport { meta } from '#meta';\nimport { type NavTreeItemGraphNode } from '#types';\n\nimport { filterItems, getParent, resolveMigrationOperation } from '../../util';\n\n// TODO(thure): Is NavTree truly authoritative in this regard?\nexport const NODE_TYPE = 'dxos/app-graph/node';\n\n// TODO(wittjosiah): Avoid using Surface within the navtree, prefer declarative data flow.\nconst NavTreeItemEnd = ({ node, open }: { node: Node.Node; open: boolean }) => {\n const data = useMemo(() => ({ id: node.id, subject: node.data, open }), [node.id, node.data, open]);\n return <Surface.Surface role='navtree-item-end' data={data} limit={1} />;\n};\n\nconst getItems = (graph: Graph.ReadableGraph, node?: Node.Node, disposition?: string) => {\n return Graph.getConnections(graph, node?.id ?? Node.RootId, 'child').filter((node) => filterItems(node, disposition));\n};\n\nexport type NavTreeContainerProps = {\n popoverAnchorId?: string;\n tab: string;\n};\n\nexport const NavTreeContainer$ = forwardRef<HTMLDivElement, NavTreeContainerProps>(\n ({ tab, popoverAnchorId }, forwardedRef) => {\n const [isLg] = useMediaQuery('lg');\n const { invokePromise } = useOperationInvoker();\n const runAction = useActionRunner();\n const { graph } = useAppGraph();\n const { getItem, setItem } = useNavTreeState();\n const layout = useLayout();\n const model = useNavTreeModel(Node.RootId);\n const { navigationSidebarState } = useSidebars(meta.id);\n const latestRef = useRef({\n tab,\n activeItems: layout.active,\n navigationSidebarState,\n isLg,\n });\n\n useEffect(() => {\n latestRef.current = {\n tab,\n activeItems: layout.active,\n navigationSidebarState,\n isLg,\n };\n }, [tab, layout.active, navigationSidebarState, isLg]);\n\n const handleOpenChange = useCallback(\n ({ item: { id }, path, open }: { item: Node.Node; path: string[]; open: boolean }) => {\n // TODO(thure): This might become a localstorage leak; openItemIds that no longer exist should be removed from this map.\n setItem(path, 'open', open);\n Graph.expand(graph, id, 'child');\n },\n [graph, setItem],\n );\n\n const handleTabChange = useCallback(\n (node: NavTreeItemGraphNode) => {\n Graph.expand(graph, node.id, 'child');\n\n const {\n tab: activeTab,\n activeItems,\n navigationSidebarState: currentSidebarState,\n isLg: latestIsLg,\n } = latestRef.current;\n void invokePromise(LayoutOperation.UpdateSidebar, {\n state:\n node.id === activeTab\n ? currentSidebarState === 'expanded'\n ? latestIsLg\n ? 'collapsed'\n : 'closed'\n : 'expanded'\n : 'expanded',\n });\n\n void invokePromise(LayoutOperation.SwitchWorkspace, { subject: node.id });\n\n // Open the first item if the workspace is empty.\n if (activeItems.length === 0) {\n const [item] = getItems(graph, node).filter((node) => !Node.isActionLike(node));\n if (item && item.data) {\n if (layout.mode === 'multi') {\n void invokePromise(LayoutOperation.Set, { subject: [item.id] });\n } else {\n void invokePromise(LayoutOperation.Open, { subject: [item.id] });\n }\n }\n }\n },\n [invokePromise, graph, layout.mode],\n );\n\n const blockInstruction = useCallback(\n ({ instruction, source, target }: { instruction: Instruction; source: TreeData; target: TreeData }) => {\n return target.item.properties.blockInstruction?.(source, instruction) ?? false;\n },\n [],\n );\n\n const canDrop = useCallback(({ source, target }: { source: TreeData; target: TreeData }) => {\n return target.item.properties.canDrop?.(source) ?? false;\n }, []);\n\n const canSelect = useCallback(({ item }: { item: Node.Node }) => {\n return item.properties.selectable ?? true;\n }, []);\n\n const handleSelect = useCallback(\n ({ item: node, path, option }: { item: Node.Node; path: string[]; option: boolean }) => {\n if (!node.data) {\n return;\n }\n\n if (Node.isAction(node)) {\n const [parent] = Graph.getConnections(graph, node.id, Node.childRelation('inbound'));\n if (parent) {\n void runAction(node, { parent, path, caller: NAV_TREE_ITEM });\n }\n return;\n }\n\n const current = getItem(path).current;\n if (!current) {\n if (layout.mode === 'multi') {\n void invokePromise(LayoutOperation.Set, { subject: [node.id] });\n } else {\n void invokePromise(LayoutOperation.Open, { subject: [node.id], key: node.properties.key });\n }\n } else if (option) {\n void invokePromise(LayoutOperation.Close, { subject: [node.id] });\n } else {\n void invokePromise(LayoutOperation.ScrollIntoView, { subject: node.id });\n }\n\n const defaultAction = Graph.getActions(graph, node.id).find(\n (action) => action.properties?.disposition === 'default',\n );\n if (Node.isAction(defaultAction)) {\n void runAction(defaultAction);\n }\n\n if (!isLg) {\n void invokePromise(LayoutOperation.UpdateSidebar, { state: 'closed' });\n }\n },\n [graph, invokePromise, getItem, runAction, isLg, layout.mode],\n );\n\n const handleBack = useCallback(() => void invokePromise(LayoutOperation.RevertWorkspace), [invokePromise]);\n\n // TODO(wittjosiah): Factor out hook.\n useEffect(() => {\n return monitorForElements({\n canMonitor: ({ source }) => isTreeData(source.data),\n onDrop: ({ location, source }) => {\n // Didn't drop on anything.\n if (!location.current.dropTargets.length) {\n return;\n }\n const target = location.current.dropTargets[0];\n const instruction: Instruction | null = extractInstruction(target.data);\n if (instruction !== null && instruction.type !== 'instruction-blocked') {\n const sourceNode = source.data.item as NavTreeItemGraphNode;\n const targetNode = target.data.item as NavTreeItemGraphNode;\n const sourcePath = source.data.path as string[];\n const targetPath = target.data.path as string[];\n const sameParent = sourcePath.slice(0, -1).join() === targetPath.slice(0, -1).join();\n const operation =\n sameParent && instruction.type !== 'make-child'\n ? 'rearrange'\n : resolveMigrationOperation(graph, sourceNode, targetPath, targetNode);\n const sourceParent = getParent(graph, sourceNode, sourcePath);\n const targetParent = getParent(graph, targetNode, targetPath);\n const sourceItems = getItems(graph, sourceParent);\n const targetItems = getItems(graph, targetParent);\n const sourceIndex = sourceItems.findIndex(({ id }) => id === sourceNode.id);\n const targetIndex = targetItems.findIndex(({ id }) => id === targetNode.id);\n const migrationIndex =\n instruction.type === 'make-child'\n ? undefined\n : instruction.type === 'reorder-below'\n ? targetIndex + 1\n : targetIndex;\n switch (operation) {\n case 'rearrange': {\n const nextItems = sourceItems.map(({ data }) => data);\n arrayMove(nextItems, sourceIndex, targetIndex);\n void sourceNode.properties.onRearrange?.(nextItems);\n break;\n }\n case 'copy': {\n const target = instruction.type === 'make-child' ? targetNode : targetParent;\n void target?.properties.onCopy?.(sourceNode, migrationIndex);\n break;\n }\n case 'transfer': {\n const target = instruction.type === 'make-child' ? targetNode : targetParent;\n if (!target?.properties.onTransferStart || target?.id === sourceParent?.id) {\n break;\n }\n void target?.properties.onTransferStart(sourceNode, migrationIndex);\n void sourceParent?.properties.onTransferEnd?.(sourceNode, target);\n break;\n }\n }\n }\n },\n });\n }, [graph]);\n\n const onItemHover = useCallback(({ item }: { item: Node.Node }) => Graph.expand(graph, item.id, 'child'), [graph]);\n\n const navTreeContextValue = useMemo(\n () => ({\n model,\n popoverAnchorId,\n renderItemEnd: NavTreeItemEnd,\n blockInstruction,\n canDrop,\n canSelect,\n onBack: handleBack,\n onOpenChange: handleOpenChange,\n onSelect: handleSelect,\n onTabChange: handleTabChange,\n onItemHover,\n }),\n [\n model,\n popoverAnchorId,\n blockInstruction,\n canDrop,\n canSelect,\n handleBack,\n handleOpenChange,\n handleSelect,\n handleTabChange,\n onItemHover,\n ],\n );\n\n return (\n <NavTreeContext.Provider value={navTreeContextValue}>\n <NavTree id={Node.RootId} root={Graph.getRoot(graph)} tab={tab} open={layout.sidebarOpen} ref={forwardedRef} />\n </NavTreeContext.Provider>\n );\n },\n);\n\nexport const NavTreeContainer = memo(NavTreeContainer$);\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,SAA2BA,0BAA0B;AACrD,SAASC,0BAA0B;AACnC,OAAOC,SAASC,YAAYC,MAAMC,aAAaC,WAAWC,SAASC,cAAc;AAEjF,SAASC,SAASC,2BAA2B;AAC7C,SAASC,uBAAuB;AAChC,SAASC,aAAaC,iBAAiB;AACvC,SAASC,OAAOC,MAAMC,uBAAuB;AAC7C,SAASC,eAAeC,mBAAmB;AAC3C,SAAwBC,kBAAkB;AAC1C,SAASC,iBAAiB;AAE1B,SAASC,eAAeC,SAASC,sBAAsB;AACvD,SAASC,iBAAiBC,uBAAuB;AACjD,SAASC,YAAY;AAMd,IAAMC,YAAY;AAGzB,IAAMC,iBAAiB,CAAC,EAAEC,MAAMC,KAAI,MAAsC;AACxE,QAAMC,OAAOC,QAAQ,OAAO;IAAEC,IAAIJ,KAAKI;IAAIC,SAASL,KAAKE;IAAMD;EAAK,IAAI;IAACD,KAAKI;IAAIJ,KAAKE;IAAMD;GAAK;AAClG,SAAO,sBAAA,cAACK,QA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AKxH,iBAAAA;",
|
|
6
|
-
"names": ["extractInstruction", "monitorForElements", "React", "forwardRef", "memo", "useCallback", "useEffect", "useMemo", "useRef", "Surface", "useOperationInvoker", "LayoutOperation", "useAppGraph", "useLayout", "Graph", "Node", "useActionRunner", "useMediaQuery", "useSidebars", "isTreeData", "arrayMove", "NAV_TREE_ITEM", "NavTree", "NavTreeContext", "useNavTreeModel", "useNavTreeState", "meta", "NODE_TYPE", "NavTreeItemEnd", "node", "open", "data", "useMemo", "id", "subject", "Surface", "role", "limit", "getItems", "graph", "disposition", "Graph", "getConnections", "Node", "RootId", "filter", "filterItems", "NavTreeContainer$", "forwardRef", "tab", "popoverAnchorId", "forwardedRef", "isLg", "useMediaQuery", "invokePromise", "useOperationInvoker", "runAction", "useActionRunner", "useAppGraph", "getItem", "setItem", "useNavTreeState", "layout", "useLayout", "model", "useNavTreeModel", "navigationSidebarState", "useSidebars", "meta", "latestRef", "useRef", "activeItems", "active", "useEffect", "current", "handleOpenChange", "useCallback", "item", "path", "expand", "handleTabChange", "activeTab", "currentSidebarState", "latestIsLg", "LayoutOperation", "UpdateSidebar", "state", "SwitchWorkspace", "length", "isActionLike", "mode", "Set", "Open", "blockInstruction", "instruction", "source", "target", "properties", "canDrop", "canSelect", "selectable", "handleSelect", "option", "isAction", "parent", "childRelation", "caller", "NAV_TREE_ITEM", "key", "Close", "ScrollIntoView", "defaultAction", "getActions", "find", "action", "handleBack", "RevertWorkspace", "monitorForElements", "canMonitor", "isTreeData", "onDrop", "location", "dropTargets", "extractInstruction", "type", "sourceNode", "targetNode", "sourcePath", "targetPath", "sameParent", "slice", "join", "operation", "resolveMigrationOperation", "sourceParent", "getParent", "targetParent", "sourceItems", "targetItems", "sourceIndex", "findIndex", "targetIndex", "migrationIndex", "undefined", "nextItems", "map", "arrayMove", "onRearrange", "onCopy", "onTransferStart", "onTransferEnd", "onItemHover", "navTreeContextValue", "renderItemEnd", "onBack", "onOpenChange", "onSelect", "onTabChange", "NavTreeContext", "Provider", "value", "NavTree", "root", "getRoot", "sidebarOpen", "ref", "NavTreeContainer", "memo"]
|
|
7
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// src/meta.ts
|
|
2
|
-
import { Plugin } from "@dxos/app-framework";
|
|
3
|
-
import { DXN } from "@dxos/keys";
|
|
4
|
-
import { trim } from "@dxos/util";
|
|
5
|
-
var meta = Plugin.makeMeta({
|
|
6
|
-
key: DXN.make("org.dxos.plugin.navtree"),
|
|
7
|
-
name: "Navtree",
|
|
8
|
-
author: "DXOS",
|
|
9
|
-
spec: "PLUGIN.mdl",
|
|
10
|
-
description: trim`
|
|
11
|
-
NavTreePlugin renders the application graph as a collapsible hierarchical tree in the Composer sidebar.
|
|
12
|
-
It manages workspace tabs at the root level and provides expand/collapse navigation for spaces, folders,
|
|
13
|
-
and objects, with open/current state persisted to localStorage across sessions.
|
|
14
|
-
|
|
15
|
-
The plugin wires drag-and-drop rearrangement and cross-parent transfer of tree items via Pragmatic DnD,
|
|
16
|
-
and registers graph-action keyboard shortcuts (including the ⌘K / Ctrl+K command palette) through a
|
|
17
|
-
global Keyboard singleton that tracks context as the user navigates.
|
|
18
|
-
|
|
19
|
-
An operation handler for LayoutOperation.Expose expands ancestor paths on demand so that any
|
|
20
|
-
programmatically activated item is scrolled into view in the tree.
|
|
21
|
-
|
|
22
|
-
A commands dialog surfaces all discoverable graph actions as a searchable palette, making it the primary
|
|
23
|
-
keyboard-first entry point for power users.
|
|
24
|
-
`,
|
|
25
|
-
tags: [
|
|
26
|
-
"system"
|
|
27
|
-
]
|
|
28
|
-
});
|
|
29
|
-
var KEY_BINDING = "KeyBinding";
|
|
30
|
-
var COMMANDS_DIALOG = DXN.make(`${meta.id}.commandsDialog`);
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
meta,
|
|
34
|
-
KEY_BINDING,
|
|
35
|
-
COMMANDS_DIALOG
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=chunk-MDGKDQMZ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const meta = Plugin.makeMeta({\n key: DXN.make('org.dxos.plugin.navtree'),\n name: 'Navtree',\n author: 'DXOS',\n spec: 'PLUGIN.mdl',\n description: trim`\n NavTreePlugin renders the application graph as a collapsible hierarchical tree in the Composer sidebar.\n It manages workspace tabs at the root level and provides expand/collapse navigation for spaces, folders,\n and objects, with open/current state persisted to localStorage across sessions.\n\n The plugin wires drag-and-drop rearrangement and cross-parent transfer of tree items via Pragmatic DnD,\n and registers graph-action keyboard shortcuts (including the ⌘K / Ctrl+K command palette) through a\n global Keyboard singleton that tracks context as the user navigates.\n\n An operation handler for LayoutOperation.Expose expands ancestor paths on demand so that any\n programmatically activated item is scrolled into view in the tree.\n\n A commands dialog surfaces all discoverable graph actions as a searchable palette, making it the primary\n keyboard-first entry point for power users.\n `,\n tags: ['system'],\n});\n\n// TODO(wittjosiah): Factor out.\nexport const KEY_BINDING = 'KeyBinding';\n// TODO(wittjosiah): Factor out.\nexport const COMMANDS_DIALOG = DXN.make(`${meta.id}.commandsDialog`);\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,WAAW;AACpB,SAASC,YAAY;AAEd,IAAMC,OAAOH,OAAOI,SAAS;EAClCC,KAAKJ,IAAIK,KAAK,yBAAA;EACdC,MAAM;EACNC,QAAQ;EACRC,MAAM;EACNC,aAAaR;;;;;;;;;;;;;;;EAebS,MAAM;IAAC;;AACT,CAAA;AAGO,IAAMC,cAAc;AAEpB,IAAMC,kBAAkBZ,IAAIK,KAAK,GAAGH,KAAKW,EAAE,iBAAiB;",
|
|
6
|
-
"names": ["Plugin", "DXN", "trim", "meta", "makeMeta", "key", "make", "name", "author", "spec", "description", "tags", "KEY_BINDING", "COMMANDS_DIALOG", "id"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React, { type ComponentProps } from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { Node } from '@dxos/plugin-graph';\n\nimport { CommandsDialogContent, CommandsTrigger, NavTreeContainer, NavTreeDocumentTitle } from '#containers';\nimport { COMMANDS_DIALOG } from '#meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: COMMANDS_DIALOG,\n filter: AppSurface.component<ComponentProps<typeof CommandsDialogContent>>(AppSurface.Dialog, COMMANDS_DIALOG),\n component: ({ data, ref }) => <CommandsDialogContent {...data.props} ref={ref} />,\n }),\n Surface.create({\n id: 'navigation',\n role: 'navigation',\n filter: (data): data is { popoverAnchorId?: string; current: string } => typeof data.current === 'string',\n component: ({ data, ref }) => {\n return (\n <NavTreeContainer\n tab={data.current}\n popoverAnchorId={data.popoverAnchorId as string | undefined}\n ref={ref}\n />\n );\n },\n }),\n Surface.create({\n id: 'documentTitle',\n role: 'document-title',\n component: ({ data }) => (\n <NavTreeDocumentTitle node={Node.isGraphNode(data.subject) ? data.subject : undefined} />\n ),\n }),\n Surface.create({\n id: 'searchInput',\n role: 'search-input',\n position: 'last',\n component: () => <CommandsTrigger />,\n }),\n ]),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAoC;AAE3C,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,kBAAkB;AAC3B,SAASC,YAAY;AAErB,SAASC,uBAAuBC,iBAAiBC,kBAAkBC,4BAA4B;AAC/F,SAASC,uBAAuB;AAEhC,IAAA,wBAAeR,WAAWS,WAAW,MAC5BC,eACLV,WAAWW,YAAYZ,aAAaa,cAAc;EAChDX,QAAQY,OAAO;IACbC,IAAIN;IACJO,QAAQb,WAAWc,UAAwDd,WAAWe,QAAQT,eAAAA;IAC9FQ,WAAW,CAAC,EAAEE,MAAMC,IAAG,MAAO,sBAAA,cAACf,uBAAAA;MAAuB,GAAGc,KAAKE;MAAOD;;EACvE,CAAA;EACAlB,QAAQY,OAAO;IACbC,IAAI;IACJO,MAAM;IACNN,QAAQ,CAACG,SAAgE,OAAOA,KAAKI,YAAY;IACjGN,WAAW,CAAC,EAAEE,MAAMC,IAAG,MAAE;AACvB,aACE,sBAAA,cAACb,kBAAAA;QACCiB,KAAKL,KAAKI;QACVE,iBAAiBN,KAAKM;QACtBL;;IAGN;EACF,CAAA;EACAlB,QAAQY,OAAO;IACbC,IAAI;IACJO,MAAM;IACNL,WAAW,CAAC,EAAEE,KAAI,MAChB,sBAAA,cAACX,sBAAAA;MAAqBkB,MAAMtB,KAAKuB,YAAYR,KAAKS,OAAO,IAAIT,KAAKS,UAAUC;;EAEhF,CAAA;EACA3B,QAAQY,OAAO;IACbC,IAAI;IACJO,MAAM;IACNQ,UAAU;IACVb,WAAW,MAAM,sBAAA,cAACX,iBAAAA,IAAAA;EACpB,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "AppSurface", "Node", "CommandsDialogContent", "CommandsTrigger", "NavTreeContainer", "NavTreeDocumentTitle", "COMMANDS_DIALOG", "makeModule", "succeed", "contributes", "ReactSurface", "create", "id", "filter", "component", "Dialog", "data", "ref", "props", "role", "current", "tab", "popoverAnchorId", "node", "isGraphNode", "subject", "undefined", "position"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/state.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Graph, Node } from '@dxos/plugin-graph';\nimport { Path } from '@dxos/react-ui-list';\n\nimport { meta } from '#meta';\nimport { NavTreeCapabilities } from '#types';\n\nconst KEY = `${meta.id}.state.v1`;\n\n/** Default item state for new entries. */\nconst defaultItemState: NavTreeCapabilities.NavTreeItemState = { open: false, current: false };\n\n/** L0 (top-level workspace) paths are direct children of root — not part of the expandable tree model. */\nconst isTopLevelPath = (path: string[]): boolean => path.length === 2 && path[0] === Node.RootId;\n\n/** Default state entries for initial tree structure. */\n// TODO(thure): Initialize these dynamically.\nconst defaultStateEntries: [string, NavTreeCapabilities.NavTreeItemState][] = [\n ['root', { open: true, current: false }],\n];\n\nconst getInitialState = (): Map<string, NavTreeCapabilities.NavTreeItemState> => {\n const stringified = localStorage.getItem(KEY);\n if (!stringified) {\n return new Map(defaultStateEntries);\n }\n\n try {\n const cached: [string, { open: boolean; current: boolean }][] = JSON.parse(stringified);\n return new Map(cached.map(([key, value]) => [key, { open: value.open, current: false }]));\n } catch {\n return new Map(defaultStateEntries);\n }\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const layoutAtom = yield* Capability.get(AppCapabilities.Layout);\n\n // Backing state for persistence (not reactive).\n const backingState = getInitialState();\n\n // Per-path atom family for fine-grained reactivity.\n // keepAlive prevents atoms from being garbage collected when components unmount,\n // ensuring state is preserved across deletion/restoration cycles.\n const itemAtomFamily = Atom.family((pathString: string) =>\n Atom.make<NavTreeCapabilities.NavTreeItemState>(backingState.get(pathString) ?? { ...defaultItemState }).pipe(\n Atom.keepAlive,\n ),\n );\n\n const getItemAtom = (path: string[]): Atom.Atom<NavTreeCapabilities.NavTreeItemState> => {\n const pathString = Path.create(...path);\n if (!backingState.has(pathString)) {\n backingState.set(pathString, { ...defaultItemState });\n }\n return itemAtomFamily(pathString);\n };\n\n const getItem = (path: string[]): NavTreeCapabilities.NavTreeItemState => {\n return registry.get(getItemAtom(path));\n };\n\n const setItem = (path: string[], key: 'open' | 'current', next: boolean) => {\n const pathString = Path.create(...path);\n const atom = itemAtomFamily(pathString);\n const currentValue = registry.get(atom);\n const newValue = { ...currentValue, [key]: next };\n\n registry.set(atom, newValue);\n\n if (!(key === 'open' && isTopLevelPath(path))) {\n backingState.set(pathString, newValue);\n localStorage.setItem(KEY, JSON.stringify(Array.from(backingState.entries())));\n }\n };\n\n // Subscribe to layout changes to update current state.\n let previous: string[] = [];\n const unsubscribe = registry.subscribe(layoutAtom, (layout) => {\n const removed = previous.filter((id) => !layout.active.includes(id));\n previous = layout.active;\n\n const handleUpdate = () => {\n // Mark removed items as not current.\n removed.forEach((id) => {\n const keys = Array.from(backingState.keys()).filter((key) => Path.last(key) === id);\n keys.forEach((key) => {\n setItem(Path.parts(key), 'current', false);\n });\n });\n\n // Mark active items as current.\n layout.active.forEach((id: string) => {\n const keys = Array.from(new Set([...backingState.keys(), id])).filter((key) => Path.last(key) === id);\n keys.forEach((key) => {\n setItem(Path.parts(key), 'current', true);\n });\n });\n };\n\n // TODO(wittjosiah): This is setTimeout because there's a race between the keys being initialized.\n // Keys are initialized on the first render of an item in the navtree.\n // This could be avoided if the location was a path as well and not just an id.\n // Defer so item path atoms exist and we do not setState during tree render.\n const timeout = setTimeout(handleUpdate, 500);\n return () => clearTimeout(timeout);\n });\n\n // Once graph is ready, expand every node marked open in state so the graph has children loaded for rendering.\n yield* Effect.gen(function* () {\n const { graph } = yield* Capability.waitFor(AppCapabilities.AppGraph);\n\n // Always expand the active workspace so its subtree is initialized.\n const layout = registry.get(layoutAtom);\n if (layout.workspace) {\n Graph.expand(graph, layout.workspace, 'child');\n }\n\n // Expand persisted open nodes, skipping inactive workspace tabs.\n const openPaths = Array.from(backingState.entries())\n .filter(([, state]) => state.open)\n .map(([pathString]) => Path.parts(pathString))\n .filter((path) => !isTopLevelPath(path));\n for (const path of openPaths) {\n const nodeId = path[path.length - 1];\n if (!nodeId) {\n continue;\n }\n Graph.expand(graph, nodeId, 'child');\n }\n }).pipe(Effect.forkDaemon);\n\n return Capability.contributes(\n NavTreeCapabilities.State,\n {\n getItem,\n getItemAtom,\n setItem,\n },\n () => Effect.sync(() => unsubscribe()),\n );\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,YAAY;AACrB,YAAYC,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,OAAOC,YAAY;AAC5B,SAASC,YAAY;AAErB,SAASC,YAAY;AACrB,SAASC,2BAA2B;AAEpC,IAAMC,MAAM,GAAGF,KAAKG,EAAE;AAGtB,IAAMC,mBAAyD;EAAEC,MAAM;EAAOC,SAAS;AAAM;AAG7F,IAAMC,iBAAiB,CAACC,SAA4BA,KAAKC,WAAW,KAAKD,KAAK,CAAA,MAAOV,KAAKY;AAI1F,IAAMC,sBAAwE;EAC5E;IAAC;IAAQ;MAAEN,MAAM;MAAMC,SAAS;IAAM;;;AAGxC,IAAMM,kBAAkB,MAAA;AACtB,QAAMC,cAAcC,aAAaC,QAAQb,GAAAA;AACzC,MAAI,CAACW,aAAa;AAChB,WAAO,IAAIG,IAAIL,mBAAAA;EACjB;AAEA,MAAI;AACF,UAAMM,SAA0DC,KAAKC,MAAMN,WAAAA;AAC3E,WAAO,IAAIG,IAAIC,OAAOG,IAAI,CAAC,CAACC,KAAKC,KAAAA,MAAW;MAACD;MAAK;QAAEhB,MAAMiB,MAAMjB;QAAMC,SAAS;MAAM;KAAE,CAAA;EACzF,QAAQ;AACN,WAAO,IAAIU,IAAIL,mBAAAA;EACjB;AACF;AAEA,IA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AAC,CAACa,UAAAA,MAAgBlC,KAAK+D,MAAM7B,UAAAA,CAAAA,EACjCsB,OAAO,CAAC/C,SAAS,CAACD,eAAeC,IAAAA,CAAAA;AACpC,eAAWA,QAAQiE,WAAW;AAC5B,YAAME,SAASnE,KAAKA,KAAKC,SAAS,CAAA;AAClC,UAAI,CAACkE,QAAQ;AACX;MACF;AACA9E,YAAM2E,OAAOJ,OAAOO,QAAQ,OAAA;IAC9B;EACF,CAAA,EAAGxC,KAAYyC,iBAAU;AAEzB,SAAOjF,WAAWkF,YAChB5E,oBAAoB6E,OACpB;IACE/D;IACAsB;IACAI;EACF,GACA,MAAasC,YAAK,MAAM5B,YAAAA,CAAAA,CAAAA;AAE5B,CAAA,CAAA;",
|
|
6
|
-
"names": ["Atom", "Effect", "Capabilities", "Capability", "AppCapabilities", "Graph", "Node", "Path", "meta", "NavTreeCapabilities", "KEY", "id", "defaultItemState", "open", "current", "isTopLevelPath", "path", "length", "RootId", "defaultStateEntries", "getInitialState", "stringified", "localStorage", "getItem", "Map", "cached", "JSON", "parse", "map", "key", "value", "makeModule", "fnUntraced", "registry", "get", "AtomRegistry", "layoutAtom", "Layout", "backingState", "itemAtomFamily", "family", "pathString", "make", "pipe", "keepAlive", "getItemAtom", "create", "has", "set", "setItem", "next", "atom", "currentValue", "newValue", "stringify", "Array", "from", "entries", "previous", "unsubscribe", "subscribe", "layout", "removed", "filter", "active", "includes", "handleUpdate", "forEach", "keys", "last", "parts", "Set", "timeout", "setTimeout", "clearTimeout", "gen", "graph", "waitFor", "AppGraph", "workspace", "expand", "openPaths", "state", "nodeId", "forkDaemon", "contributes", "State", "sync"]
|
|
7
|
-
}
|
/package/dist/lib/neutral/{NavTreeContainer-6AR4BFDD.mjs.map → NavTreeContainer-ICDKC2GI.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|