@dxos/plugin-navtree 0.11.0 → 0.12.0-next-bbabc02363f18d7643ea4160e3a7a7809870fd0d

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.
Files changed (125) hide show
  1. package/dist/lib/NavTreeCapabilities.mjs +10 -0
  2. package/dist/lib/NavTreeCapabilities.mjs.map +1 -0
  3. package/dist/lib/NavTreeNode.mjs +7 -0
  4. package/dist/lib/NavTreeNode.mjs.map +1 -0
  5. package/dist/lib/NavTreePlugin.mjs +5 -28
  6. package/dist/lib/NavTreePlugin.mjs.map +1 -1
  7. package/dist/lib/capabilities.mjs +44 -7
  8. package/dist/lib/capabilities.mjs.map +1 -1
  9. package/dist/lib/chunk-CommandsDialogContent.mjs +2 -2
  10. package/dist/lib/chunk-CommandsDialogContent.mjs.map +1 -1
  11. package/dist/lib/chunk-CommandsTrigger.mjs +1 -1
  12. package/dist/lib/chunk-CommandsTrigger.mjs.map +1 -1
  13. package/dist/lib/chunk-app-graph-builder.mjs +5 -4
  14. package/dist/lib/chunk-app-graph-builder.mjs.map +1 -1
  15. package/dist/lib/chunk-expose.mjs +6 -5
  16. package/dist/lib/chunk-expose.mjs.map +1 -1
  17. package/dist/lib/chunk-keyboard.mjs +8 -6
  18. package/dist/lib/chunk-keyboard.mjs.map +1 -1
  19. package/dist/lib/chunk-meta.mjs +1 -1
  20. package/dist/lib/chunk-meta.mjs.map +1 -1
  21. package/dist/lib/chunk-operation-handler.mjs +3 -2
  22. package/dist/lib/chunk-operation-handler.mjs.map +1 -1
  23. package/dist/lib/chunk-react-surface.mjs +4 -3
  24. package/dist/lib/chunk-react-surface.mjs.map +1 -1
  25. package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
  26. package/dist/lib/chunk-state.mjs +11 -9
  27. package/dist/lib/chunk-state.mjs.map +1 -1
  28. package/dist/lib/chunk-util.mjs.map +1 -1
  29. package/dist/lib/components.mjs +4 -2
  30. package/dist/lib/components.mjs.map +1 -1
  31. package/dist/lib/containers.mjs +3 -3
  32. package/dist/lib/containers.mjs.map +1 -1
  33. package/dist/lib/hooks.mjs +5 -5
  34. package/dist/lib/hooks.mjs.map +1 -1
  35. package/dist/lib/index.mjs +3 -2
  36. package/dist/lib/operations.mjs +4 -2
  37. package/dist/lib/operations.mjs.map +1 -1
  38. package/dist/lib/plugin.mjs +2 -3
  39. package/dist/lib/plugin.mjs.map +1 -1
  40. package/dist/types/src/NavTreePlugin.d.ts +1 -1
  41. package/dist/types/src/NavTreePlugin.d.ts.map +1 -1
  42. package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -2
  43. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  44. package/dist/types/src/capabilities/index.d.ts +7 -7
  45. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  46. package/dist/types/src/capabilities/keyboard.d.ts +2 -2
  47. package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
  48. package/dist/types/src/capabilities/operation-handler.d.ts +2 -3
  49. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
  50. package/dist/types/src/capabilities/react-surface.d.ts +2 -2
  51. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  52. package/dist/types/src/capabilities/state.d.ts +2 -2
  53. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  54. package/dist/types/src/components/NavTree/NavTree.stories.d.ts +1 -1
  55. package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
  56. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts +2 -2
  57. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts.map +1 -1
  58. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +1 -1
  59. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts +1 -1
  60. package/dist/types/src/components/types.d.ts +4 -4
  61. package/dist/types/src/components/types.d.ts.map +1 -1
  62. package/dist/types/src/containers/CommandsDialogContent/CommandsDialogContent.stories.d.ts +1 -1
  63. package/dist/types/src/experimental/Tree.stories.d.ts +1 -1
  64. package/dist/types/src/hooks/useActions.d.ts +3 -3
  65. package/dist/types/src/hooks/useActions.d.ts.map +1 -1
  66. package/dist/types/src/hooks/useNavTreeModel.d.ts +2 -2
  67. package/dist/types/src/hooks/useNavTreeModel.d.ts.map +1 -1
  68. package/dist/types/src/hooks/useNavTreeState.d.ts +1 -1
  69. package/dist/types/src/hooks/useNavTreeState.d.ts.map +1 -1
  70. package/dist/types/src/index.d.ts +2 -1
  71. package/dist/types/src/index.d.ts.map +1 -1
  72. package/dist/types/src/operations/expose.d.ts +2 -2
  73. package/dist/types/src/operations/expose.d.ts.map +1 -1
  74. package/dist/types/src/operations/index.d.ts +1 -1
  75. package/dist/types/src/operations/index.d.ts.map +1 -1
  76. package/dist/types/src/plugin.d.ts +1 -2
  77. package/dist/types/src/plugin.d.ts.map +1 -1
  78. package/dist/types/src/types/NavTreeCapabilities.d.ts +2 -2
  79. package/dist/types/src/types/NavTreeCapabilities.d.ts.map +1 -1
  80. package/dist/types/src/types/{schema.d.ts → NavTreeNode.d.ts} +1 -1
  81. package/dist/types/src/types/NavTreeNode.d.ts.map +1 -0
  82. package/dist/types/src/util.d.ts +5 -5
  83. package/dist/types/src/util.d.ts.map +1 -1
  84. package/dist/types/tsconfig.tsbuildinfo +1 -1
  85. package/package.json +49 -36
  86. package/src/NavTreePlugin.tsx +17 -49
  87. package/src/capabilities/app-graph-builder.ts +5 -4
  88. package/src/capabilities/index.ts +53 -10
  89. package/src/capabilities/keyboard.ts +7 -5
  90. package/src/capabilities/operation-handler.ts +4 -4
  91. package/src/capabilities/react-surface.ts +3 -2
  92. package/src/capabilities/state.ts +14 -17
  93. package/src/components/NavTree/NavTree.stories.tsx +10 -7
  94. package/src/components/NavTreeItem/NavTreeItemAction.tsx +3 -2
  95. package/src/components/Sidebar/L0Menu.tsx +1 -1
  96. package/src/components/Sidebar/L1Panel.tsx +2 -2
  97. package/src/components/types.ts +4 -5
  98. package/src/containers/CommandsDialogContent/CommandsDialogContent.tsx +1 -1
  99. package/src/containers/CommandsTrigger/CommandsTrigger.tsx +1 -1
  100. package/src/containers/NavTreeContainer/NavTreeContainer.tsx +5 -5
  101. package/src/experimental/Tree.stories.tsx +1 -1
  102. package/src/hooks/useActions.ts +4 -4
  103. package/src/hooks/useNavTreeModel.ts +4 -5
  104. package/src/hooks/useNavTreeState.ts +1 -1
  105. package/src/index.ts +2 -1
  106. package/src/meta.ts +1 -1
  107. package/src/operations/expose.ts +5 -4
  108. package/src/operations/index.ts +6 -2
  109. package/src/plugin.ts +1 -3
  110. package/src/types/NavTreeCapabilities.ts +2 -2
  111. package/src/util.ts +12 -12
  112. package/dist/lib/chunk-types.mjs +0 -26
  113. package/dist/lib/chunk-types.mjs.map +0 -1
  114. package/dist/lib/types.mjs +0 -2
  115. package/dist/types/src/components/NavTreeItem/index.d.ts +0 -3
  116. package/dist/types/src/components/NavTreeItem/index.d.ts.map +0 -1
  117. package/dist/types/src/types/NavTreeEvents.d.ts +0 -3
  118. package/dist/types/src/types/NavTreeEvents.d.ts.map +0 -1
  119. package/dist/types/src/types/index.d.ts +0 -4
  120. package/dist/types/src/types/index.d.ts.map +0 -1
  121. package/dist/types/src/types/schema.d.ts.map +0 -1
  122. package/src/components/NavTreeItem/index.ts +0 -6
  123. package/src/types/NavTreeEvents.ts +0 -12
  124. package/src/types/index.ts +0 -8
  125. /package/src/types/{schema.ts → NavTreeNode.ts} +0 -0
@@ -0,0 +1,10 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import * as Capability from "@dxos/app-framework/Capability";
3
+ import { meta } from "#meta";
4
+ //#region src/types/NavTreeCapabilities.ts
5
+ var NavTreeCapabilities_exports = /* @__PURE__ */ __exportAll({ State: () => State });
6
+ var State = Capability.makeSingleton()(`${meta.profile.key}.capability.state`);
7
+ //#endregion
8
+ export { State, NavTreeCapabilities_exports as t };
9
+
10
+ //# sourceMappingURL=NavTreeCapabilities.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavTreeCapabilities.mjs","names":[],"sources":["../../src/types/NavTreeCapabilities.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { type Atom } from '@effect-atom/atom';\n\nimport * as Capability from '@dxos/app-framework/Capability';\n\nimport { meta } from '#meta';\n\nexport type NavTreeItemState = { open: boolean; current: boolean };\n\nexport type NavTreeStateStore = {\n getItem: (path: string[]) => NavTreeItemState;\n getItemAtom: (path: string[]) => Atom.Atom<NavTreeItemState>;\n setItem: (path: string[], key: 'open' | 'current', next: boolean) => void;\n};\n\nexport const State = Capability.makeSingleton<NavTreeStateStore>()(`${meta.profile.key}.capability.state`);\n"],"mappings":";;;;;AAoBA,IAAa,QAAQ,WAAW,cAAiC,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,kBAAkB"}
@@ -0,0 +1,7 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ //#region src/types/NavTreeNode.ts
3
+ var NavTreeNode_exports = /* @__PURE__ */ __exportAll({});
4
+ //#endregion
5
+ export { NavTreeNode_exports as t };
6
+
7
+ //# sourceMappingURL=NavTreeNode.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavTreeNode.mjs","names":[],"sources":["../../src/types/NavTreeNode.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Node } from '@dxos/app-graph';\nimport { type Label } from '@dxos/react-ui';\nimport { type MaybePromise, type Position } from '@dxos/util';\n\nexport type NavTreeItemGraphNode = Node.Node<\n any,\n Partial<\n NodeProperties & {\n persistenceClass: string;\n persistenceKey: string;\n acceptPersistenceClass: Set<string>;\n acceptPersistenceKey: Set<string>;\n onRearrange: (nextOrder: unknown[]) => MaybePromise<void>;\n onCopy: (activeNode: NavTreeItemGraphNode, index?: number) => MaybePromise<void>;\n onTransferStart: (activeNode: NavTreeItemGraphNode, index?: number) => MaybePromise<void>;\n onTransferEnd: (activeNode: NavTreeItemGraphNode, destinationParent: NavTreeItemGraphNode) => MaybePromise<void>;\n }\n >\n>;\n\nexport type FlattenedActions = {\n actions: Node.ActionLike[];\n groupedActions: Record<string, Node.Action[]>;\n};\n\ntype SharedProperties = {\n testId?: string;\n disabled?: boolean;\n position?: Position.Position;\n label: Label;\n className?: string;\n headingClassName?: string;\n icon?: string;\n iconHue?: string;\n};\n\nexport type NodeProperties = SharedProperties & {\n role?: string;\n error?: string;\n modified?: boolean;\n palette?: string;\n /** Optional item count rendered as a neutral badge after the label. */\n count?: number;\n /** Optional count of new/modified items; when greater than zero it shows as a rose badge in place of `count`. */\n modifiedCount?: number;\n};\n\nexport type ActionProperties = SharedProperties & {\n disposition?: string | string[];\n hidden?: boolean;\n caller?: string;\n menuType?: 'dropdown';\n keyBinding?: string | KeyBinding;\n};\n\n/**\n * Platform-specific key binding.\n */\nexport type KeyBinding = {\n // NOTE: Keys come from `getHostPlatform` in `@dxos/util`.\n // TODO(thure): Dedupe with the other platform key-binding definitions.\n windows?: string;\n macos?: string;\n ios?: string;\n linux?: string;\n unknown?: string;\n};\n"],"mappings":""}
@@ -1,39 +1,16 @@
1
- import { ActivationEvent, ActivationEvents, Capabilities, Capability, Plugin } from "@dxos/app-framework";
2
1
  import { meta } from "#meta";
3
- import { AppActivationEvents, AppCapabilities, AppPlugin, LayoutOperation } from "@dxos/app-toolkit";
4
- import { Graph } from "@dxos/plugin-graph";
5
- import * as Effect from "effect/Effect";
6
- import { AttentionEvents } from "@dxos/plugin-attention";
7
- import { AppGraphBuilder, Keyboard, OperationHandler, ReactSurface, State } from "#capabilities";
2
+ import * as Plugin from "@dxos/app-framework/Plugin";
3
+ import * as AppCapability from "@dxos/app-toolkit/AppCapability";
4
+ import { AppGraphBuilder, Expose, Keyboard, OperationHandler, ReactSurface, State } from "#capabilities";
8
5
  import { translations } from "#translations";
9
- import { NavTreeEvents } from "#types";
10
6
  //#endregion
11
7
  //#region src/NavTreePlugin.tsx
12
- var NavTreePlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }), AppPlugin.addOperationHandlerModule({ activate: OperationHandler }), AppPlugin.addSurfaceModule({ activate: ReactSurface }), AppPlugin.addTranslationsModule({ translations }), Plugin.addModule({
13
- id: "state",
14
- activatesOn: ActivationEvent.allOf(AppActivationEvents.LayoutReady, AttentionEvents.AttentionReady),
15
- firesAfterActivation: [NavTreeEvents.StateReady],
16
- activate: State
17
- }), Plugin.addModule({
18
- id: "expose",
19
- activatesOn: ActivationEvent.allOf(ActivationEvents.ProcessManagerReady, AppActivationEvents.AppGraphReady, AppActivationEvents.LayoutReady, NavTreeEvents.StateReady),
20
- activate: Effect.fnUntraced(function* () {
21
- const layout = yield* Capabilities.getAtomValue(AppCapabilities.Layout);
22
- const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);
23
- const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
24
- if (invokePromise && layout.active.length === 1) Graph.waitForPath(graph, { target: layout.active[0] }, { timeout: 3e4 }).then(() => invokePromise(LayoutOperation.Expose, { subject: layout.active[0] })).catch(() => {});
25
- return [];
26
- })
27
- }), Plugin.addModule({
28
- id: "keyboard",
29
- activatesOn: ActivationEvent.allOf(AppActivationEvents.AppGraphReady, ActivationEvents.ProcessManagerReady),
30
- activate: Keyboard
31
- }), AppPlugin.addPluginAssetModule({ asset: {
8
+ var NavTreePlugin = Plugin.define(meta).pipe(Plugin.addModule(AppGraphBuilder), Plugin.addModule(OperationHandler), Plugin.addModule(ReactSurface), Plugin.addModule(AppCapability.translations(translations)), Plugin.addModule(State), Plugin.addModule(Expose), Plugin.addModule(Keyboard), Plugin.addModule(AppCapability.pluginAsset({
32
9
  pluginId: meta.profile.key,
33
10
  path: "PLUGIN.mdl",
34
11
  content: "---\nid: org.dxos.plugin.navtree\nname: NavTreePlugin\nversion: 0.1.0\n---\n\nHierarchical navigation sidebar for `DXOS` Composer — renders the application graph as a collapsible tree, manages workspace tabs, exposes keyboard-driven command search, and handles drag-and-drop rearrangement of spaces, folders, and objects.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype NavTreeItemState\n fields:\n open: boolean # whether the tree node is expanded\n current: boolean # whether the node is in the active layout\n```\n\n```mdl\ntype KeyBinding\n fields:\n macos?: string\n windows?: string\n linux?: string\n ios?: string\n unknown?: string\n```\n\n```mdl\ntype NodeProperties\n fields:\n label: Label\n icon?: string\n iconHue?: string\n role?: string\n error?: string\n modified?: boolean\n palette?: string\n disabled?: boolean\n testId?: string\n position?: Position\n className?: string\n keyBinding?: string | KeyBinding\n persistenceClass?: string\n persistenceKey?: string\n```\n\n## Components\n\n```mdl\ncomponent NavTree\n desc: Root navigation tree that renders workspace tabs at the top level and a collapsible subtree for the active workspace.\n props:\n id: string # root node id (Node.RootId)\n root: Node # root of the application graph\n tab: string # currently active workspace tab id\n open: boolean # whether the navigation sidebar is open\n state:\n model: NavTreeModel # live tree model built from graph connections\n slots:\n itemEnd?: ReactNode # per-item trailing content (e.g. action badges)\n actions:\n openChange(item: Node, path: string[], open: boolean)\n tabChange(node: Node)\n select(item: Node, path: string[], option: boolean, shift: boolean)\n back()\n itemHover(item: Node)\n layout: |\n ┌─────────────────────────┐\n │ workspace tabs │\n │ [tab] [tab] [tab] │\n ├─────────────────────────┤\n │ collapsible tree │\n │ ▾ Space │\n │ ▾ Folder │\n │ • Object │\n │ • Object │\n │ • Object │\n └─────────────────────────┘\n```\n\n```mdl\ncomponent NavTreeContainer\n desc: Smart container that wires the NavTree to the app graph, layout state, and drag-and-drop monitor.\n props:\n tab: string\n popoverAnchorId?: string\n state:\n layout: LayoutState # active items, sidebar open/closed, mode\n model: NavTreeModel\n actions:\n handleSelect(item: Node, path: string[], option: boolean, shift: boolean)\n handleOpenChange(item: Node, path: string[], open: boolean)\n handleTabChange(node: Node)\n handleBack()\n handleDrop(source: TreeData, target: TreeData, instruction: Instruction)\n emits:\n onNavigate(subject: string | string[])\n layout: |\n ┌──────────────────────────┐\n │ NavTreeContext.Provider │\n │ └─ NavTree │\n └──────────────────────────┘\n```\n\n```mdl\ncomponent CommandsDialogContent\n desc: Full-screen command palette dialog — surfaces all graph actions, searchable by label.\n props:\n onClose?: () => void\n state:\n query: string\n results: Node[]\n actions:\n search(query: string) → Node[]\n execute(node: Node)\n layout: |\n ┌──────────────────────────┐\n │ [search input] │\n ├──────────────────────────┤\n │ result list │\n │ icon label shortcut │\n │ icon label │\n │ … │\n └──────────────────────────┘\n```\n\n```mdl\ncomponent CommandsTrigger\n desc: Search-input surface slot component — opens the commands dialog on click or ⌘K / Ctrl+K.\n slots:\n (none)\n actions:\n openCommandsDialog()\n```\n\n## Operations\n\n```mdl\nop expose\n desc: Expands tree nodes along the path to a subject and marks each as open so the item becomes visible in the NavTree.\n input:\n subject: string # attendable DXN or node id\n output: void\n effects: [echo:read]\n note: |\n Resolves the full ancestor path via expandAttendableId, calls Graph.expand per node,\n then sets each path segment open in NavTreeCapabilities.State.\n```\n\n## Features\n\n```mdl\nfeat F-1: Sidebar Navigation\n\n req F-1.1: NavTree renders all root-level graph connections as workspace tabs.\n req F-1.2:\n when: user selects a workspace tab\n then: LayoutOperation.SwitchWorkspace is invoked; subtree for that workspace is expanded\n req F-1.3:\n when: sidebar is closed and user selects a workspace tab\n then: sidebar opens (state transitions to expanded)\n req F-1.4:\n when: same active tab is clicked while sidebar is expanded\n then: sidebar collapses (state transitions to collapsed or closed on mobile)\n```\n\n```mdl\nfeat F-2: Tree Expand / Collapse\n\n req F-2.1: Tree items with children show an expand/collapse toggle.\n req F-2.2:\n when: user expands a node\n then: open state persisted to localStorage keyed by path; Graph.expand called for the node\n req F-2.3:\n when: plugin initialises after layout is ready\n then: all paths previously marked open are re-expanded from localStorage\n req F-2.4:\n when: op:expose is called\n then: all ancestors of the subject are expanded and marked open\n```\n\n```mdl\nfeat F-3: Item Selection\n\n req F-3.1:\n when: user selects a non-current item\n then: LayoutOperation.Open is invoked with disposition 'solo' and the shift modifier forwarded\n (the Open handler upgrades any disposition to 'add' when shift is held)\n req F-3.2:\n when: user option-clicks a currently active item\n then: LayoutOperation.Close is invoked for that item\n req F-3.3:\n when: user clicks a currently active item without option key\n then: LayoutOperation.ScrollIntoView is invoked\n req F-3.4:\n when: item has a default disposition action\n then: that action is run after navigation\n req F-3.5:\n when: navigation succeeds on mobile\n then: sidebar is closed automatically\n```\n\n```mdl\nfeat F-4: Drag and Drop\n\n req F-4.1: NavTree items can be dragged to rearrange within the same parent.\n req F-4.2: NavTree items can be dragged to copy or transfer to a different parent.\n req F-4.3:\n when: drop instruction is rearrange\n then: onRearrange callback on the parent node is called with the new order\n req F-4.4:\n when: drop instruction is copy\n then: onCopy callback on the target node is called\n req F-4.5:\n when: drop instruction is transfer\n then: onTransferStart and onTransferEnd callbacks are called on source and target parents\n req F-4.6:\n when: target node reports blockInstruction for an instruction type\n then: that instruction is blocked and the drop is not applied\n```\n\n```mdl\nfeat F-5: Keyboard Shortcuts\n\n req F-5.1: NavTree plugin registers keyboard shortcuts for all graph actions that declare a keyBinding property.\n req F-5.2: Graph is traversed on change (debounced 500 ms) to bind newly added shortcuts.\n req F-5.3: The commands dialog is opened via ⌘K (macOS) / Ctrl+K (Windows/Linux).\n req F-5.4:\n when: plugin deactivates\n then: Keyboard.singleton is destroyed and all shortcuts are unregistered\n```\n\n```mdl\nfeat F-6: State Persistence\n\n req F-6.1: Per-path open/current state is stored in an atom family keyed by path string.\n req F-6.2: Open state (not current) is persisted to localStorage on every change.\n req F-6.3: Current state reflects active layout items and is never persisted.\n req F-6.4:\n when: layout.active changes\n then: removed items are marked not-current; newly active items are marked current\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Workspace tab switch\n given: two workspace tabs exist in the graph\n when: user clicks the second workspace tab\n then:\n - LayoutOperation.SwitchWorkspace is invoked with the tab's node id\n - sidebar transitions to expanded\n - subtree for the selected workspace is expanded\n```\n\n```mdl\ntest T-2: Tree node expand persists\n given: NavTree is rendered with a collapsed folder node\n when: user expands the folder\n then:\n - folder node state.open === true\n - localStorage entry updated for the folder's path\n - Graph.expand called for the folder node id\n```\n\n```mdl\ntest T-3: Expose navigates to nested item\n given: a deeply nested object id is active in the layout\n when: op:expose is called with that object id\n then:\n - all ancestor paths are marked open\n - Graph.expand is called for each ancestor\n```\n\n```mdl\ntest T-4: Select item\n given: item not currently active\n when: user selects a tree item\n then: LayoutOperation.Open is invoked with the item id, disposition 'solo' and the shift modifier\n forwarded (shift-click therefore adds a plank instead of navigating)\n```\n\n```mdl\ntest T-5: Command palette opens on keyboard shortcut\n given: NavTree is active\n when: user presses ⌘K (macOS) or Ctrl+K (Windows)\n then:\n - CommandsDialogContent is shown in the layout dialog slot\n - search input is focused\n```\n\n```mdl\ntest T-6: Drag-and-drop rearrange\n given: two sibling items in the same folder\n when: user drags the first item below the second\n then:\n - onRearrange callback is called with the reordered array\n - tree re-renders with the new order\n```\n\n---\n\n## Appendix: Extension Definitions\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap\n literals?: UnionList\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap\n state?: FieldMap\n slots?: FieldMap\n actions?: ActionMap\n emits?: EventMap\n layout?: CodeBlock\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap\n output?: TypeExpr\n errors?: ErrorMap\n effects?: EffectList\n requires?: ServiceList\n note?: Prose\n```\n",
35
12
  mimeType: "application/x-mdl"
36
- } }), Plugin.make);
13
+ })), Plugin.make);
37
14
  //#endregion
38
15
  export { NavTreePlugin, NavTreePlugin as default };
39
16
 
@@ -1 +1 @@
1
- {"version":3,"file":"NavTreePlugin.mjs","names":[],"sources":["../../src/NavTreePlugin.tsx"],"sourcesContent":["//\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 { AttentionEvents } from '@dxos/plugin-attention';\nimport { Graph } from '@dxos/plugin-graph';\n\nimport { AppGraphBuilder, Keyboard, OperationHandler, ReactSurface, State } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { NavTreeEvents } from '#types';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const NavTreePlugin = Plugin.define(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule({\n id: 'state',\n // Wait for AttentionReady too so the ViewState Manager (the expansion persistence backend) is available.\n activatesOn: ActivationEvent.allOf(AppActivationEvents.LayoutReady, AttentionEvents.AttentionReady),\n firesAfterActivation: [NavTreeEvents.StateReady],\n activate: State,\n }),\n Plugin.addModule({\n id: 'expose',\n activatesOn: ActivationEvent.allOf(\n ActivationEvents.ProcessManagerReady,\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.ProcessManagerReady),\n activate: Keyboard,\n }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default NavTreePlugin;\n"],"mappings":";;;;;;;;;;;AAmBA,IAAa,gBAAgB,OAAO,OAAO,IAAI,CAAC,CAAC,KAC/C,UAAU,kBAAkB,EAAE,UAAU,gBAAgB,CAAC,GACzD,UAAU,0BAA0B,EAAE,UAAU,iBAAiB,CAAC,GAClE,UAAU,iBAAiB,EAAE,UAAU,aAAa,CAAC,GACrD,UAAU,sBAAsB,EAAE,aAAa,CAAC,GAChD,OAAO,UAAU;CACf,IAAI;CAEJ,aAAa,gBAAgB,MAAM,oBAAoB,aAAa,gBAAgB,cAAc;CAClG,sBAAsB,CAAC,cAAc,UAAU;CAC/C,UAAU;AACZ,CAAC,GACD,OAAO,UAAU;CACf,IAAI;CACJ,aAAa,gBAAgB,MAC3B,iBAAiB,qBACjB,oBAAoB,eACpB,oBAAoB,aACpB,cAAc,UAChB;CACA,UAAU,OAAO,WAAW,aAAa;EACvC,MAAM,SAAS,OAAO,aAAa,aAAa,gBAAgB,MAAM;EACtE,MAAM,EAAE,kBAAkB,OAAO,WAAW,IAAI,aAAa,gBAAgB;EAC7E,MAAM,EAAE,UAAU,OAAO,WAAW,IAAI,gBAAgB,QAAQ;EAChE,IAAI,iBAAiB,OAAO,OAAO,WAAW,GAG5C,MAAW,YAAY,OAAO,EAAE,QAAQ,OAAO,OAAO,GAAG,GAAG,EAAE,SAAS,IAAO,CAAC,CAAA,CAC5E,WAAW,cAAc,gBAAgB,QAAQ,EAAE,SAAS,OAAO,OAAO,GAAG,CAAC,CAAC,CAAA,CAC/E,YAAY,CAAC,CAAC;EAGnB,OAAO,CAAC;CACV,CAAC;AACH,CAAC,GACD,OAAO,UAAU;CACf,IAAI;CACJ,aAAa,gBAAgB,MAAM,oBAAoB,eAAe,iBAAiB,mBAAmB;CAC1G,UAAU;AACZ,CAAC,GACD,UAAU,qBAAqB,EAC7B,OAAO;CAAE,UAAU,KAAK,QAAQ;CAAK,MAAM;CAAc,SAAS;CAAY,UAAU;AAAoB,EAC9G,CAAC,GACD,OAAO,IACT"}
1
+ {"version":3,"file":"NavTreePlugin.mjs","names":[],"sources":["../../src/NavTreePlugin.tsx"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\n\nimport { AppGraphBuilder, Expose, Keyboard, OperationHandler, ReactSurface, State } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const NavTreePlugin = Plugin.define(meta).pipe(\n Plugin.addModule(AppGraphBuilder),\n Plugin.addModule(OperationHandler),\n Plugin.addModule(ReactSurface),\n Plugin.addModule(AppCapability.translations(translations)),\n Plugin.addModule(State),\n Plugin.addModule(Expose),\n Plugin.addModule(Keyboard),\n Plugin.addModule(\n AppCapability.pluginAsset({\n pluginId: meta.profile.key,\n path: 'PLUGIN.mdl',\n content: pluginSpec,\n mimeType: 'application/x-mdl',\n }),\n ),\n Plugin.make,\n);\n\nexport default NavTreePlugin;\n"],"mappings":";;;;;;;AAcA,IAAa,gBAAgB,OAAO,OAAO,IAAI,CAAC,CAAC,KAC/C,OAAO,UAAU,eAAe,GAChC,OAAO,UAAU,gBAAgB,GACjC,OAAO,UAAU,YAAY,GAC7B,OAAO,UAAU,cAAc,aAAa,YAAY,CAAC,GACzD,OAAO,UAAU,KAAK,GACtB,OAAO,UAAU,MAAM,GACvB,OAAO,UAAU,QAAQ,GACzB,OAAO,UACL,cAAc,YAAY;CACxB,UAAU,KAAK,QAAQ;CACvB,MAAM;CACN,SAAS;CACT,UAAU;AACZ,CAAC,CACH,GACA,OAAO,IACT"}
@@ -1,11 +1,48 @@
1
- import { Capability } from "@dxos/app-framework";
1
+ import { State as State$1 } from "./NavTreeCapabilities.mjs";
2
+ import * as Capability from "@dxos/app-framework/Capability";
3
+ import { Graph } from "@dxos/plugin-graph";
4
+ import * as AppCapability from "@dxos/app-toolkit/AppCapability";
5
+ import * as Effect from "effect/Effect";
6
+ import * as Capabilities from "@dxos/app-framework/Capabilities";
7
+ import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
8
+ import * as LayoutOperation from "@dxos/app-toolkit/LayoutOperation";
9
+ import * as AttentionCapabilities from "@dxos/plugin-attention/AttentionCapabilities";
2
10
  //#region src/capabilities/index.ts
3
- var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("./chunk-app-graph-builder.mjs"));
4
- var Keyboard = Capability.lazy("Keyboard", () => import("./chunk-keyboard.mjs"));
5
- var OperationHandler = Capability.lazy("OperationHandler", () => import("./chunk-operation-handler.mjs"));
6
- var ReactSurface = Capability.lazy("ReactSurface", () => import("./chunk-react-surface.mjs"));
7
- var State = Capability.lazy("State", () => import("./chunk-state.mjs"));
11
+ var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"));
12
+ var Expose = Capability.inlineModule("expose", {
13
+ requires: [
14
+ AppCapabilities.AppGraph,
15
+ AppCapabilities.Layout,
16
+ Capabilities.OperationInvoker
17
+ ],
18
+ provides: []
19
+ }, Effect.fnUntraced(function* () {
20
+ const layout = yield* Capabilities.getAtomValue(AppCapabilities.Layout);
21
+ const { invokePromise } = yield* Capabilities.OperationInvoker;
22
+ const { graph } = yield* AppCapabilities.AppGraph;
23
+ if (invokePromise && layout.active.length === 1) Graph.waitForPath(graph, { target: layout.active[0] }, { timeout: 3e4 }).then(() => invokePromise(LayoutOperation.Expose, { subject: layout.active[0] })).catch(() => {});
24
+ return [];
25
+ }));
26
+ var Keyboard = Capability.lazyModule("Keyboard", {
27
+ requires: [AppCapabilities.AppGraph, Capabilities.OperationInvoker],
28
+ provides: []
29
+ }, () => import("./chunk-keyboard.mjs"));
30
+ var OperationHandler = AppCapability.operationHandler(() => import("./chunk-operation-handler.mjs"));
31
+ var ReactSurface = AppCapability.surface(() => import("./chunk-react-surface.mjs"), { roles: [
32
+ "org.dxos.role.dialog",
33
+ "org.dxos.role.documentTitle",
34
+ "org.dxos.role.navigation",
35
+ "org.dxos.role.searchInput"
36
+ ] });
37
+ var State = Capability.lazyModule("State", {
38
+ requires: [
39
+ Capabilities.AtomRegistry,
40
+ AppCapabilities.Layout,
41
+ AttentionCapabilities.ViewState
42
+ ],
43
+ provides: [State$1]
44
+ }, () => import("./chunk-state.mjs"));
8
45
  //#endregion
9
- export { AppGraphBuilder, Keyboard, OperationHandler, ReactSurface, State };
46
+ export { AppGraphBuilder, Expose, Keyboard, OperationHandler, ReactSurface, State };
10
47
 
11
48
  //# sourceMappingURL=capabilities.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\nexport const Keyboard = Capability.lazy('Keyboard', () => import('./keyboard'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\nexport const State = Capability.lazy('State', () => import('./state'));\n"],"mappings":";;AAOA,IAAa,kBAAkB,WAAW,KAAK,yBAAyB,OAAO,gCAAsB;AACrG,IAAa,WAAW,WAAW,KAAK,kBAAkB,OAAO,uBAAa;AAC9E,IAAa,mBAAmB,WAAW,KACzC,0BACM,OAAO,gCACf;AACA,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB;AAC3F,IAAa,QAAQ,WAAW,KAAK,eAAe,OAAO,oBAAU"}
1
+ {"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport * as AttentionCapabilities from '@dxos/plugin-attention/AttentionCapabilities';\nimport { Graph } from '@dxos/plugin-graph';\n\nimport * as NavTreeCapabilities from '../types/NavTreeCapabilities';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('./app-graph-builder'));\nexport const Expose = Capability.inlineModule(\n 'expose',\n { requires: [AppCapabilities.AppGraph, AppCapabilities.Layout, Capabilities.OperationInvoker], provides: [] },\n Effect.fnUntraced(function* () {\n const layout = yield* Capabilities.getAtomValue(AppCapabilities.Layout);\n const { invokePromise } = yield* Capabilities.OperationInvoker;\n const { graph } = yield* 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);\nexport const Keyboard = Capability.lazyModule(\n 'Keyboard',\n { requires: [AppCapabilities.AppGraph, Capabilities.OperationInvoker], provides: [] },\n () => import('./keyboard'),\n);\nexport const OperationHandler = AppCapability.operationHandler(() => import('./operation-handler'));\nexport const ReactSurface = AppCapability.surface(() => import('./react-surface'), {\n roles: [\n 'org.dxos.role.dialog',\n 'org.dxos.role.documentTitle',\n 'org.dxos.role.navigation',\n 'org.dxos.role.searchInput',\n ],\n});\nexport const State = Capability.lazyModule(\n 'State',\n {\n // ViewState is the persistence backend for per-path expansion.\n requires: [Capabilities.AtomRegistry, AppCapabilities.Layout, AttentionCapabilities.ViewState],\n provides: [NavTreeCapabilities.State],\n },\n () => import('./state'),\n);\n"],"mappings":";;;;;;;;;;AAgBA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,gCAAsB;AAChG,IAAa,SAAS,WAAW,aAC/B,UACA;CAAE,UAAU;EAAC,gBAAgB;EAAU,gBAAgB;EAAQ,aAAa;CAAgB;CAAG,UAAU,CAAC;AAAE,GAC5G,OAAO,WAAW,aAAa;CAC7B,MAAM,SAAS,OAAO,aAAa,aAAa,gBAAgB,MAAM;CACtE,MAAM,EAAE,kBAAkB,OAAO,aAAa;CAC9C,MAAM,EAAE,UAAU,OAAO,gBAAgB;CACzC,IAAI,iBAAiB,OAAO,OAAO,WAAW,GAG5C,MAAW,YAAY,OAAO,EAAE,QAAQ,OAAO,OAAO,GAAG,GAAG,EAAE,SAAS,IAAO,CAAC,CAAA,CAC5E,WAAW,cAAc,gBAAgB,QAAQ,EAAE,SAAS,OAAO,OAAO,GAAG,CAAC,CAAC,CAAA,CAC/E,YAAY,CAAC,CAAC;CAGnB,OAAO,CAAC;AACV,CAAC,CACH;AACA,IAAa,WAAW,WAAW,WACjC,YACA;CAAE,UAAU,CAAC,gBAAgB,UAAU,aAAa,gBAAgB;CAAG,UAAU,CAAC;AAAE,SAC9E,OAAO,uBACf;AACA,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,gCAAsB;AAClG,IAAa,eAAe,cAAc,cAAc,OAAO,8BAAoB,EACjF,OAAO;CACL;CACA;CACA;CACA;AACF,EACF,CAAC;AACD,IAAa,QAAQ,WAAW,WAC9B,SACA;CAEE,UAAU;EAAC,aAAa;EAAc,gBAAgB;EAAQ,sBAAsB;CAAS;CAC7F,UAAU,CAAC,OAAyB;AACtC,SACM,OAAO,oBACf"}
@@ -1,7 +1,7 @@
1
- import { getHostPlatform } from "@dxos/util";
2
1
  import { KEY_BINDING, meta } from "#meta";
3
- import { LayoutOperation } from "@dxos/app-toolkit";
2
+ import { getHostPlatform } from "@dxos/util";
4
3
  import { Graph, Node } from "@dxos/plugin-graph";
4
+ import * as LayoutOperation from "@dxos/app-toolkit/LayoutOperation";
5
5
  import { forwardRef, useMemo, useState } from "react";
6
6
  import { useAppGraph } from "@dxos/app-toolkit/ui";
7
7
  import { useActionRunner, useActions } from "@dxos/plugin-graph/hooks";
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-CommandsDialogContent.mjs","names":[],"sources":["../../src/containers/CommandsDialogContent/CommandsDialogContent.tsx"],"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 } from '@dxos/plugin-graph';\nimport { useActions } from '@dxos/plugin-graph/hooks';\nimport { useActionRunner } from '@dxos/plugin-graph/hooks';\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.profile.key);\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.profile.key })}</Dialog.Title>\n <Dialog.Body>\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.Body>\n <Dialog.ActionBar>\n <Dialog.Close asChild>\n <Button classNames='w-full'>{t('close.label', { ns: osTranslations })}</Button>\n </Dialog.Close>\n </Dialog.ActionBar>\n </Dialog.Content>\n );\n },\n);\n\nCommandsDialogContent.displayName = 'CommandsDialogContent';\n"],"mappings":"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"}
1
+ {"version":3,"file":"chunk-CommandsDialogContent.mjs","names":[],"sources":["../../src/containers/CommandsDialogContent/CommandsDialogContent.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { forwardRef, useMemo, useState } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { Keyboard, keySymbols } from '@dxos/keyboard';\nimport { Graph, Node } from '@dxos/plugin-graph';\nimport { useActions } from '@dxos/plugin-graph/hooks';\nimport { useActionRunner } from '@dxos/plugin-graph/hooks';\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.profile.key);\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.profile.key })}</Dialog.Title>\n <Dialog.Body>\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.Body>\n <Dialog.ActionBar>\n <Dialog.Close asChild>\n <Button classNames='w-full'>{t('close.label', { ns: osTranslations })}</Button>\n </Dialog.Close>\n </Dialog.ActionBar>\n </Dialog.Content>\n );\n },\n);\n\nCommandsDialogContent.displayName = 'CommandsDialogContent';\n"],"mappings":"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"}
@@ -1,5 +1,5 @@
1
1
  import { COMMANDS_DIALOG, meta } from "#meta";
2
- import { LayoutOperation } from "@dxos/app-toolkit";
2
+ import * as LayoutOperation from "@dxos/app-toolkit/LayoutOperation";
3
3
  import "react";
4
4
  import { Button, Icon, useTranslation } from "@dxos/react-ui";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-CommandsTrigger.mjs","names":[],"sources":["../../src/containers/CommandsTrigger/CommandsTrigger.tsx"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Button, Icon, useTranslation } from '@dxos/react-ui';\n\nimport { COMMANDS_DIALOG, meta } from '#meta';\n\n// TODO(thure): Refactor to be handled by a more appropriate plugin.\nexport const CommandsTrigger = () => {\n const { invokePromise } = useOperationInvoker();\n const { t } = useTranslation(meta.profile.key);\n return (\n <Button\n classNames='m-1 px-1 lg:px-2'\n onClick={() =>\n void invokePromise(LayoutOperation.UpdateDialog, { subject: COMMANDS_DIALOG, blockAlign: 'start' })\n }\n >\n <span className='text-description font-normal grow text-start'>{t('command-list-input.placeholder')}</span>\n <Icon icon='ph--magnifying-glass--regular' />\n </Button>\n );\n};\n\nCommandsTrigger.displayName = 'CommandsTrigger';\n"],"mappings":";;;;;;;AAaA,IAAa,wBAAwB;CACnC,MAAM,EAAE,kBAAkB,oBAAoB;CAC9C,MAAM,EAAE,MAAM,eAAe,KAAK,QAAQ,GAAG;CAC7C,OACE,qBAAC,QAAD;EACE,YAAW;EACX,eACE,KAAK,cAAc,gBAAgB,cAAc;GAAE,SAAS;GAAiB,YAAY;EAAQ,CAAC;YAHtG,CAME,oBAAC,QAAD;GAAM,WAAU;aAAgD,EAAE,gCAAgC;EAAQ,CAAA,GAC1G,oBAAC,MAAD,EAAM,MAAK,gCAAiC,CAAA,CACtC;;AAEZ;AAEA,gBAAgB,cAAc"}
1
+ {"version":3,"file":"chunk-CommandsTrigger.mjs","names":[],"sources":["../../src/containers/CommandsTrigger/CommandsTrigger.tsx"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport { Button, Icon, useTranslation } from '@dxos/react-ui';\n\nimport { COMMANDS_DIALOG, meta } from '#meta';\n\n// TODO(thure): Refactor to be handled by a more appropriate plugin.\nexport const CommandsTrigger = () => {\n const { invokePromise } = useOperationInvoker();\n const { t } = useTranslation(meta.profile.key);\n return (\n <Button\n classNames='m-1 px-1 lg:px-2'\n onClick={() =>\n void invokePromise(LayoutOperation.UpdateDialog, { subject: COMMANDS_DIALOG, blockAlign: 'start' })\n }\n >\n <span className='text-description font-normal grow text-start'>{t('command-list-input.placeholder')}</span>\n <Icon icon='ph--magnifying-glass--regular' />\n </Button>\n );\n};\n\nCommandsTrigger.displayName = 'CommandsTrigger';\n"],"mappings":";;;;;;;AAaA,IAAa,wBAAwB;CACnC,MAAM,EAAE,kBAAkB,oBAAoB;CAC9C,MAAM,EAAE,MAAM,eAAe,KAAK,QAAQ,GAAG;CAC7C,OACE,qBAAC,QAAD;EACE,YAAW;EACX,eACE,KAAK,cAAc,gBAAgB,cAAc;GAAE,SAAS;GAAiB,YAAY;EAAQ,CAAC;YAHtG,CAME,oBAAC,QAAD;GAAM,WAAU;aAAgD,EAAE,gCAAgC;EAAQ,CAAA,GAC1G,oBAAC,MAAD,EAAM,MAAK,gCAAiC,CAAA,CACtC;;AAEZ;AAEA,gBAAgB,cAAc"}
@@ -1,9 +1,10 @@
1
- import { Capability } from "@dxos/app-framework";
1
+ import * as Capability from "@dxos/app-framework/Capability";
2
2
  import { COMMANDS_DIALOG, meta } from "#meta";
3
- import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
4
3
  import { GraphBuilder, Node, NodeMatcher } from "@dxos/plugin-graph";
5
4
  import * as Effect from "effect/Effect";
6
- import { Operation } from "@dxos/compute";
5
+ import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
6
+ import * as LayoutOperation from "@dxos/app-toolkit/LayoutOperation";
7
+ import * as Operation from "@dxos/compute/Operation";
7
8
  //#region src/capabilities/app-graph-builder.ts
8
9
  var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
9
10
  const extensions = yield* GraphBuilder.createExtension({
@@ -25,7 +26,7 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
25
26
  }
26
27
  })])
27
28
  });
28
- return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
29
+ return Capability.contribute(AppCapabilities.AppGraphBuilder, extensions);
29
30
  }));
30
31
  //#endregion
31
32
  export { app_graph_builder_default as default };
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-app-graph-builder.mjs","names":[],"sources":["../../src/capabilities/app-graph-builder.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';\n\nimport { COMMANDS_DIALOG, meta } from '#meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* GraphBuilder.createExtension({\n id: 'root',\n match: NodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n Node.makeAction({\n id: COMMANDS_DIALOG,\n data: () =>\n Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: COMMANDS_DIALOG,\n blockAlign: 'start',\n }),\n properties: {\n label: ['open-commands.label', { ns: meta.profile.key }],\n icon: 'ph--magnifying-glass--regular',\n keyBinding: {\n macos: 'meta+k',\n windows: 'ctrl+k',\n },\n },\n }),\n ]),\n });\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],"mappings":";;;;;;;AAaA,IAAA,4BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,MAAM,aAAa,OAAO,aAAa,gBAAgB;EACrD,IAAI;EACJ,OAAO,YAAY;EACnB,eACE,OAAO,QAAQ,CACb,KAAK,WAAW;GACd,IAAI;GACJ,YACE,UAAU,OAAO,gBAAgB,cAAc;IAC7C,SAAS;IACT,YAAY;GACd,CAAC;GACH,YAAY;IACV,OAAO,CAAC,uBAAuB,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;IACvD,MAAM;IACN,YAAY;KACV,OAAO;KACP,SAAS;IACX;GACF;EACF,CAAC,CACH,CAAC;CACL,CAAC;CAED,OAAO,WAAW,YAAY,gBAAgB,iBAAiB,UAAU;AAC3E,CAAC,CACH"}
1
+ {"version":3,"file":"chunk-app-graph-builder.mjs","names":[],"sources":["../../src/capabilities/app-graph-builder.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport * as Operation from '@dxos/compute/Operation';\nimport { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';\n\nimport { COMMANDS_DIALOG, meta } from '#meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* GraphBuilder.createExtension({\n id: 'root',\n match: NodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n Node.makeAction({\n id: COMMANDS_DIALOG,\n data: () =>\n Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: COMMANDS_DIALOG,\n blockAlign: 'start',\n }),\n properties: {\n label: ['open-commands.label', { ns: meta.profile.key }],\n icon: 'ph--magnifying-glass--regular',\n keyBinding: {\n macos: 'meta+k',\n windows: 'ctrl+k',\n },\n },\n }),\n ]),\n });\n\n return Capability.contribute(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],"mappings":";;;;;;;;AAcA,IAAA,4BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,MAAM,aAAa,OAAO,aAAa,gBAAgB;EACrD,IAAI;EACJ,OAAO,YAAY;EACnB,eACE,OAAO,QAAQ,CACb,KAAK,WAAW;GACd,IAAI;GACJ,YACE,UAAU,OAAO,gBAAgB,cAAc;IAC7C,SAAS;IACT,YAAY;GACd,CAAC;GACH,YAAY;IACV,OAAO,CAAC,uBAAuB,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;IACvD,MAAM;IACN,YAAY;KACV,OAAO;KACP,SAAS;IACX;GACF;EACF,CAAC,CACH,CAAC;CACL,CAAC;CAED,OAAO,WAAW,WAAW,gBAAgB,iBAAiB,UAAU;AAC1E,CAAC,CACH"}
@@ -1,10 +1,11 @@
1
- import { r as State } from "./chunk-types.mjs";
2
- import { Capability } from "@dxos/app-framework";
3
- import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
1
+ import { State } from "./NavTreeCapabilities.mjs";
2
+ import * as Capability from "@dxos/app-framework/Capability";
4
3
  import { Graph } from "@dxos/plugin-graph";
5
4
  import * as Effect from "effect/Effect";
5
+ import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
6
+ import * as LayoutOperation from "@dxos/app-toolkit/LayoutOperation";
6
7
  import * as Option from "effect/Option";
7
- import { Operation } from "@dxos/compute";
8
+ import * as Operation from "@dxos/compute/Operation";
8
9
  import { log } from "@dxos/log";
9
10
  import { Attention } from "@dxos/react-ui-attention";
10
11
  //#region src/operations/expose.ts
@@ -21,7 +22,7 @@ var handler = LayoutOperation.Expose.pipe(Operation.withHandler(Effect.fnUntrace
21
22
  if (Option.isNone(Graph.getNode(graph, subject))) log("Node not found after expansion", { subject }, {
22
23
  "~LogMeta": "~LogMeta",
23
24
  F: __dxlog_file,
24
- L: 36,
25
+ L: 37,
25
26
  S: this
26
27
  });
27
28
  })));
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-expose.mjs","names":[],"sources":["../../src/operations/expose.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { log } from '@dxos/log';\nimport { Graph } from '@dxos/plugin-graph';\nimport { Attention } from '@dxos/react-ui-attention';\n\nimport { NavTreeCapabilities } from '../types';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.Expose> = LayoutOperation.Expose.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ subject }) {\n const { graph } = yield* Capability.get(AppCapabilities.AppGraph);\n const { getItem, setItem } = yield* Capability.get(NavTreeCapabilities.State);\n\n const prefixes = Attention.expandAttendableId(subject);\n\n for (const qualifiedId of prefixes) {\n Graph.expand(graph, qualifiedId, 'child');\n\n const treePath = prefixes.slice(0, prefixes.indexOf(qualifiedId) + 1);\n const state = getItem(treePath);\n if (!state.open) {\n setItem(treePath, 'open', true);\n }\n }\n\n if (Option.isNone(Graph.getNode(graph, subject))) {\n log('Node not found after expansion', { subject });\n }\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;;;;;;AAgBA,IAAM,UAAgE,gBAAgB,OAAO,KAC3F,UAAU,YACR,OAAO,WAAW,WAAW,EAAE,WAAW;CACxC,MAAM,EAAE,UAAU,OAAO,WAAW,IAAI,gBAAgB,QAAQ;CAChE,MAAM,EAAE,SAAS,YAAY,OAAO,WAAW,IAAI,KAAyB;CAE5E,MAAM,WAAW,UAAU,mBAAmB,OAAO;CAErD,KAAK,MAAM,eAAe,UAAU;EAClC,MAAM,OAAO,OAAO,aAAa,OAAO;EAExC,MAAM,WAAW,SAAS,MAAM,GAAG,SAAS,QAAQ,WAAW,IAAI,CAAC;EAEpE,IAAI,CADU,QAAQ,QACjB,CAAA,CAAM,MACT,QAAQ,UAAU,QAAQ,IAAI;CAElC;CAEA,IAAI,OAAO,OAAO,MAAM,QAAQ,OAAO,OAAO,CAAC,GAC7C,IAAI,kCAAkC,EAAE,QAAQ,GAAA;EAAA,YAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA;CAAA,CAAC;AAErD,CAAC,CACH,CACF"}
1
+ {"version":3,"file":"chunk-expose.mjs","names":[],"sources":["../../src/operations/expose.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport * as Operation from '@dxos/compute/Operation';\nimport { log } from '@dxos/log';\nimport { Graph } from '@dxos/plugin-graph';\nimport { Attention } from '@dxos/react-ui-attention';\n\nimport * as NavTreeCapabilities from '../types/NavTreeCapabilities';\n\nconst handler: Operation.WithHandler<typeof LayoutOperation.Expose> = LayoutOperation.Expose.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ subject }) {\n const { graph } = yield* Capability.get(AppCapabilities.AppGraph);\n const { getItem, setItem } = yield* Capability.get(NavTreeCapabilities.State);\n\n const prefixes = Attention.expandAttendableId(subject);\n\n for (const qualifiedId of prefixes) {\n Graph.expand(graph, qualifiedId, 'child');\n\n const treePath = prefixes.slice(0, prefixes.indexOf(qualifiedId) + 1);\n const state = getItem(treePath);\n if (!state.open) {\n setItem(treePath, 'open', true);\n }\n }\n\n if (Option.isNone(Graph.getNode(graph, subject))) {\n log('Node not found after expansion', { subject });\n }\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAM,UAAgE,gBAAgB,OAAO,KAC3F,UAAU,YACR,OAAO,WAAW,WAAW,EAAE,WAAW;CACxC,MAAM,EAAE,UAAU,OAAO,WAAW,IAAI,gBAAgB,QAAQ;CAChE,MAAM,EAAE,SAAS,YAAY,OAAO,WAAW,IAAI,KAAyB;CAE5E,MAAM,WAAW,UAAU,mBAAmB,OAAO;CAErD,KAAK,MAAM,eAAe,UAAU;EAClC,MAAM,OAAO,OAAO,aAAa,OAAO;EAExC,MAAM,WAAW,SAAS,MAAM,GAAG,SAAS,QAAQ,WAAW,IAAI,CAAC;EAEpE,IAAI,CADU,QAAQ,QACjB,CAAA,CAAM,MACT,QAAQ,UAAU,QAAQ,IAAI;CAElC;CAEA,IAAI,OAAO,OAAO,MAAM,QAAQ,OAAO,OAAO,CAAC,GAC7C,IAAI,kCAAkC,EAAE,QAAQ,GAAA;EAAA,YAAA;EAAA,GAAA;EAAA,GAAA;EAAA,GAAA;CAAA,CAAC;AAErD,CAAC,CACH,CACF"}
@@ -1,15 +1,16 @@
1
- import { Capabilities, Capability } from "@dxos/app-framework";
2
- import { getHostPlatform } from "@dxos/util";
1
+ import * as Capability from "@dxos/app-framework/Capability";
3
2
  import { KEY_BINDING } from "#meta";
4
- import { AppCapabilities } from "@dxos/app-toolkit";
3
+ import { getHostPlatform } from "@dxos/util";
5
4
  import { Graph, Node, runAction } from "@dxos/plugin-graph";
6
5
  import * as Effect from "effect/Effect";
6
+ import * as Capabilities from "@dxos/app-framework/Capabilities";
7
+ import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
7
8
  import { debounce } from "@dxos/async";
8
9
  import { Keyboard } from "@dxos/keyboard";
9
10
  //#region src/capabilities/keyboard.ts
10
11
  var keyboard_default = Capability.makeModule(Effect.fnUntraced(function* () {
11
- const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
12
- const invoker = yield* Capability.get(Capabilities.OperationInvoker);
12
+ const { graph } = yield* AppCapabilities.AppGraph;
13
+ const invoker = yield* Capabilities.OperationInvoker;
13
14
  const pluginContext = yield* Capability.Service;
14
15
  const visitor = (node, path) => {
15
16
  let shortcut;
@@ -38,10 +39,11 @@ var keyboard_default = Capability.makeModule(Effect.fnUntraced(function* () {
38
39
  syncBindings();
39
40
  Keyboard.singleton.initialize();
40
41
  Keyboard.singleton.setCurrentContext(Node.RootId);
41
- return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => {
42
+ yield* Effect.addFinalizer(() => Effect.sync(() => {
42
43
  unsubscribe();
43
44
  Keyboard.singleton.destroy();
44
45
  }));
46
+ return [];
45
47
  }));
46
48
  //#endregion
47
49
  export { keyboard_default as default };
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-keyboard.mjs","names":[],"sources":["../../src/capabilities/keyboard.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { debounce } from '@dxos/async';\nimport { Keyboard } from '@dxos/keyboard';\nimport { Graph, Node, runAction } from '@dxos/plugin-graph';\nimport { getHostPlatform } from '@dxos/util';\n\nimport { KEY_BINDING } from '#meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const { graph } = yield* Capability.get(AppCapabilities.AppGraph);\n const invoker = yield* Capability.get(Capabilities.OperationInvoker);\n const pluginContext = yield* Capability.Service;\n\n // TODO(wittjosiah): Factor out.\n // TODO(wittjosiah): Handle removal of actions.\n const visitor = (node: Node.Node, path: string[]) => {\n let shortcut: string | undefined;\n if (typeof node.properties.keyBinding === 'object') {\n const availablePlatforms = Object.keys(node.properties.keyBinding);\n const platform = getHostPlatform();\n shortcut = availablePlatforms.includes(platform)\n ? node.properties.keyBinding[platform]\n : platform === 'ios'\n ? node.properties.keyBinding.macos // Fallback to macos if ios-specific bindings not provided.\n : platform === 'linux' || platform === 'unknown'\n ? node.properties.keyBinding.windows // Fallback to windows if platform-specific bindings not provided.\n : undefined;\n } else {\n shortcut = node.properties.keyBinding;\n }\n\n if (shortcut && Node.isAction(node)) {\n Keyboard.singleton.getContext(path.slice(0, -1).join('/')).bind({\n shortcut,\n handler: () => void runAction(invoker, pluginContext, node, { parent: node, caller: KEY_BINDING }),\n data: node.properties.label,\n });\n }\n };\n\n const syncBindings = () => {\n Graph.traverse(graph, { relation: ['child', 'action'], visitor });\n };\n\n const eventHandler = debounce(syncBindings, 500);\n\n const unsubscribe = graph.onNodeChanged.on(eventHandler);\n syncBindings();\n\n // TODO(burdon): Create context and plugin.\n Keyboard.singleton.initialize();\n Keyboard.singleton.setCurrentContext(Node.RootId);\n\n return Capability.contributes(Capabilities.Null, null, () =>\n Effect.sync(() => {\n unsubscribe();\n Keyboard.singleton.destroy();\n }),\n );\n }),\n);\n"],"mappings":";;;;;;;;;AAeA,IAAA,mBAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,MAAM,EAAE,UAAU,OAAO,WAAW,IAAI,gBAAgB,QAAQ;CAChE,MAAM,UAAU,OAAO,WAAW,IAAI,aAAa,gBAAgB;CACnE,MAAM,gBAAgB,OAAO,WAAW;CAIxC,MAAM,WAAW,MAAiB,SAAmB;EACnD,IAAI;EACJ,IAAI,OAAO,KAAK,WAAW,eAAe,UAAU;GAClD,MAAM,qBAAqB,OAAO,KAAK,KAAK,WAAW,UAAU;GACjE,MAAM,WAAW,gBAAgB;GACjC,WAAW,mBAAmB,SAAS,QAAQ,IAC3C,KAAK,WAAW,WAAW,YAC3B,aAAa,QACX,KAAK,WAAW,WAAW,QAC3B,aAAa,WAAW,aAAa,YACnC,KAAK,WAAW,WAAW,UAC3B,KAAA;EACV,OACE,WAAW,KAAK,WAAW;EAG7B,IAAI,YAAY,KAAK,SAAS,IAAI,GAChC,SAAS,UAAU,WAAW,KAAK,MAAM,GAAG,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK;GAC9D;GACA,eAAe,KAAK,UAAU,SAAS,eAAe,MAAM;IAAE,QAAQ;IAAM,QAAQ;GAAY,CAAC;GACjG,MAAM,KAAK,WAAW;EACxB,CAAC;CAEL;CAEA,MAAM,qBAAqB;EACzB,MAAM,SAAS,OAAO;GAAE,UAAU,CAAC,SAAS,QAAQ;GAAG;EAAQ,CAAC;CAClE;CAEA,MAAM,eAAe,SAAS,cAAc,GAAG;CAE/C,MAAM,cAAc,MAAM,cAAc,GAAG,YAAY;CACvD,aAAa;CAGb,SAAS,UAAU,WAAW;CAC9B,SAAS,UAAU,kBAAkB,KAAK,MAAM;CAEhD,OAAO,WAAW,YAAY,aAAa,MAAM,YAC/C,OAAO,WAAW;EAChB,YAAY;EACZ,SAAS,UAAU,QAAQ;CAC7B,CAAC,CACH;AACF,CAAC,CACH"}
1
+ {"version":3,"file":"chunk-keyboard.mjs","names":[],"sources":["../../src/capabilities/keyboard.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport { debounce } from '@dxos/async';\nimport { Keyboard } from '@dxos/keyboard';\nimport { Graph, Node, runAction } from '@dxos/plugin-graph';\nimport { getHostPlatform } from '@dxos/util';\n\nimport { KEY_BINDING } from '#meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const { graph } = yield* AppCapabilities.AppGraph;\n const invoker = yield* Capabilities.OperationInvoker;\n const pluginContext = yield* Capability.Service;\n\n // TODO(wittjosiah): Factor out.\n // TODO(wittjosiah): Handle removal of actions.\n const visitor = (node: Node.Node, path: string[]) => {\n let shortcut: string | undefined;\n if (typeof node.properties.keyBinding === 'object') {\n const availablePlatforms = Object.keys(node.properties.keyBinding);\n const platform = getHostPlatform();\n shortcut = availablePlatforms.includes(platform)\n ? node.properties.keyBinding[platform]\n : platform === 'ios'\n ? node.properties.keyBinding.macos // Fallback to macos if ios-specific bindings not provided.\n : platform === 'linux' || platform === 'unknown'\n ? node.properties.keyBinding.windows // Fallback to windows if platform-specific bindings not provided.\n : undefined;\n } else {\n shortcut = node.properties.keyBinding;\n }\n\n if (shortcut && Node.isAction(node)) {\n Keyboard.singleton.getContext(path.slice(0, -1).join('/')).bind({\n shortcut,\n handler: () => void runAction(invoker, pluginContext, node, { parent: node, caller: KEY_BINDING }),\n data: node.properties.label,\n });\n }\n };\n\n const syncBindings = () => {\n Graph.traverse(graph, { relation: ['child', 'action'], visitor });\n };\n\n const eventHandler = debounce(syncBindings, 500);\n\n const unsubscribe = graph.onNodeChanged.on(eventHandler);\n syncBindings();\n\n // TODO(burdon): Create context and plugin.\n Keyboard.singleton.initialize();\n Keyboard.singleton.setCurrentContext(Node.RootId);\n\n yield* Effect.addFinalizer(() =>\n Effect.sync(() => {\n unsubscribe();\n Keyboard.singleton.destroy();\n }),\n );\n return [];\n }),\n);\n"],"mappings":";;;;;;;;;;AAgBA,IAAA,mBAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,MAAM,EAAE,UAAU,OAAO,gBAAgB;CACzC,MAAM,UAAU,OAAO,aAAa;CACpC,MAAM,gBAAgB,OAAO,WAAW;CAIxC,MAAM,WAAW,MAAiB,SAAmB;EACnD,IAAI;EACJ,IAAI,OAAO,KAAK,WAAW,eAAe,UAAU;GAClD,MAAM,qBAAqB,OAAO,KAAK,KAAK,WAAW,UAAU;GACjE,MAAM,WAAW,gBAAgB;GACjC,WAAW,mBAAmB,SAAS,QAAQ,IAC3C,KAAK,WAAW,WAAW,YAC3B,aAAa,QACX,KAAK,WAAW,WAAW,QAC3B,aAAa,WAAW,aAAa,YACnC,KAAK,WAAW,WAAW,UAC3B,KAAA;EACV,OACE,WAAW,KAAK,WAAW;EAG7B,IAAI,YAAY,KAAK,SAAS,IAAI,GAChC,SAAS,UAAU,WAAW,KAAK,MAAM,GAAG,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK;GAC9D;GACA,eAAe,KAAK,UAAU,SAAS,eAAe,MAAM;IAAE,QAAQ;IAAM,QAAQ;GAAY,CAAC;GACjG,MAAM,KAAK,WAAW;EACxB,CAAC;CAEL;CAEA,MAAM,qBAAqB;EACzB,MAAM,SAAS,OAAO;GAAE,UAAU,CAAC,SAAS,QAAQ;GAAG;EAAQ,CAAC;CAClE;CAEA,MAAM,eAAe,SAAS,cAAc,GAAG;CAE/C,MAAM,cAAc,MAAM,cAAc,GAAG,YAAY;CACvD,aAAa;CAGb,SAAS,UAAU,WAAW;CAC9B,SAAS,UAAU,kBAAkB,KAAK,MAAM;CAEhD,OAAO,OAAO,mBACZ,OAAO,WAAW;EAChB,YAAY;EACZ,SAAS,UAAU,QAAQ;CAC7B,CAAC,CACH;CACA,OAAO,CAAC;AACV,CAAC,CACH"}
@@ -1,4 +1,4 @@
1
- import { Plugin } from "@dxos/app-framework";
1
+ import * as Plugin from "@dxos/app-framework/Plugin";
2
2
  import { DXN } from "@dxos/keys";
3
3
  import { Config2 } from "@dxos/app-framework/config";
4
4
  import { trim } from "@dxos/util";
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-meta.mjs","names":[],"sources":["../../dx.config.ts","../../src/meta.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.navtree',\n name: 'Navtree',\n author: 'DXOS',\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 spec: 'PLUGIN.mdl',\n tags: ['system'],\n },\n});\n","//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { DXN } from '@dxos/keys';\n\nimport config from '../dx.config';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n\n// TODO(wittjosiah): Factor out.\nexport const KEY_BINDING = 'KeyBinding';\n// TODO(wittjosiah): Factor out.\nexport const COMMANDS_DIALOG = DXN.make(`${meta.profile.key}.commandsDialog`);\n"],"mappings":";;;;;AAOA,IAAA,oBAAe,QAAQ,KAAK,EAC1B,QAAQ;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,aAAa,IAAI;;;;;;;;;;;;;;;CAejB,MAAM;CACN,MAAM,CAAC,QAAQ;AACjB,EACF,CAAC;;;ACrBD,IAAa,OAAO,OAAO,kBAAkB,iBAAM;AAGnD,IAAa,cAAc;AAE3B,IAAa,kBAAkB,IAAI,KAAK,GAAG,KAAK,QAAQ,IAAI,gBAAgB"}
1
+ {"version":3,"file":"chunk-meta.mjs","names":[],"sources":["../../dx.config.ts","../../src/meta.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.navtree',\n name: 'Navtree',\n author: 'DXOS',\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 spec: 'PLUGIN.mdl',\n tags: ['system'],\n },\n});\n","//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport { DXN } from '@dxos/keys';\n\nimport config from '../dx.config';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n\n// TODO(wittjosiah): Factor out.\nexport const KEY_BINDING = 'KeyBinding';\n// TODO(wittjosiah): Factor out.\nexport const COMMANDS_DIALOG = DXN.make(`${meta.profile.key}.commandsDialog`);\n"],"mappings":";;;;;AAOA,IAAA,oBAAe,QAAQ,KAAK,EAC1B,QAAQ;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,aAAa,IAAI;;;;;;;;;;;;;;;CAejB,MAAM;CACN,MAAM,CAAC,QAAQ;AACjB,EACF,CAAC;;;ACrBD,IAAa,OAAO,OAAO,kBAAkB,iBAAM;AAGnD,IAAa,cAAc;AAE3B,IAAa,kBAAkB,IAAI,KAAK,GAAG,KAAK,QAAQ,IAAI,gBAAgB"}
@@ -1,9 +1,10 @@
1
- import { Capabilities, Capability } from "@dxos/app-framework";
1
+ import * as Capability from "@dxos/app-framework/Capability";
2
2
  import * as Effect from "effect/Effect";
3
+ import * as Capabilities from "@dxos/app-framework/Capabilities";
3
4
  import { NavTreeOperationHandlerSet } from "#operations";
4
5
  //#region src/capabilities/operation-handler.ts
5
6
  var operation_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
6
- return Capability.contributes(Capabilities.OperationHandler, NavTreeOperationHandlerSet);
7
+ return Capability.contribute(Capabilities.OperationHandler, NavTreeOperationHandlerSet);
7
8
  }));
8
9
  //#endregion
9
10
  export { operation_handler_default as default };
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-operation-handler.mjs","names":[],"sources":["../../src/capabilities/operation-handler.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport type { OperationHandlerSet } from '@dxos/compute';\n\nimport { NavTreeOperationHandlerSet } from '#operations';\n\nexport default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Capabilities.OperationHandler, NavTreeOperationHandlerSet);\n }),\n);\n"],"mappings":";;;;AAWA,IAAA,4BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,OAAO,WAAW,YAAY,aAAa,kBAAkB,0BAA0B;AACzF,CAAC,CACH"}
1
+ {"version":3,"file":"chunk-operation-handler.mjs","names":[],"sources":["../../src/capabilities/operation-handler.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\n\nimport { NavTreeOperationHandlerSet } from '#operations';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contribute(Capabilities.OperationHandler, NavTreeOperationHandlerSet);\n }),\n);\n"],"mappings":";;;;;AAWA,IAAA,4BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,OAAO,WAAW,WAAW,aAAa,kBAAkB,0BAA0B;AACxF,CAAC,CACH"}
@@ -1,13 +1,14 @@
1
- import { Capabilities, Capability } from "@dxos/app-framework";
2
- import { Position } from "@dxos/util";
1
+ import * as Capability from "@dxos/app-framework/Capability";
3
2
  import { COMMANDS_DIALOG } from "#meta";
3
+ import { Position } from "@dxos/util";
4
4
  import { Node } from "@dxos/plugin-graph";
5
5
  import * as Effect from "effect/Effect";
6
+ import * as Capabilities from "@dxos/app-framework/Capabilities";
6
7
  import { AppSurface } from "@dxos/app-toolkit/ui";
7
8
  import { Surface } from "@dxos/app-framework/ui";
8
9
  import { CommandsDialogContent, CommandsTrigger, NavTreeContainer, NavTreeDocumentTitle } from "#containers";
9
10
  //#region src/capabilities/react-surface.ts
10
- var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
11
+ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contribute(Capabilities.ReactSurface, [
11
12
  Surface.create({
12
13
  id: COMMANDS_DIALOG,
13
14
  filter: AppSurface.component(AppSurface.Dialog, COMMANDS_DIALOG),
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport { 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';\nimport { Position } from '@dxos/util';\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: CommandsDialogContent,\n props: ({ data: { props }, ref }) => ({ ...props, ref }),\n }),\n Surface.create({\n id: 'navigation',\n filter: Surface.makeFilter(AppSurface.Navigation),\n component: NavTreeContainer,\n props: ({ data: { current, popoverAnchorId }, ref }) => ({ tab: current, popoverAnchorId, ref }),\n }),\n Surface.create({\n id: 'documentTitle',\n filter: Surface.makeFilter(AppSurface.DocumentTitle),\n component: NavTreeDocumentTitle,\n props: ({ data: { subject } }) => ({ node: Node.isGraphNode(subject) ? subject : undefined }),\n }),\n Surface.create({\n id: 'searchInput',\n filter: Surface.makeFilter(AppSurface.SearchInput),\n position: Position.last,\n component: CommandsTrigger,\n }),\n ]),\n ),\n);\n"],"mappings":";;;;;;;;;AAgBA,IAAA,wBAAe,WAAW,iBACxB,OAAO,QACL,WAAW,YAAY,aAAa,cAAc;CAChD,QAAQ,OAAO;EACb,IAAI;EACJ,QAAQ,WAAW,UAAwD,WAAW,QAAQ,eAAe;EAC7G,WAAW;EACX,QAAQ,EAAE,MAAM,EAAE,SAAS,WAAW;GAAE,GAAG;GAAO;EAAI;CACxD,CAAC;CACD,QAAQ,OAAO;EACb,IAAI;EACJ,QAAQ,QAAQ,WAAW,WAAW,UAAU;EAChD,WAAW;EACX,QAAQ,EAAE,MAAM,EAAE,SAAS,mBAAmB,WAAW;GAAE,KAAK;GAAS;GAAiB;EAAI;CAChG,CAAC;CACD,QAAQ,OAAO;EACb,IAAI;EACJ,QAAQ,QAAQ,WAAW,WAAW,aAAa;EACnD,WAAW;EACX,QAAQ,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,KAAK,YAAY,OAAO,IAAI,UAAU,KAAA,EAAU;CAC7F,CAAC;CACD,QAAQ,OAAO;EACb,IAAI;EACJ,QAAQ,QAAQ,WAAW,WAAW,WAAW;EACjD,UAAU,SAAS;EACnB,WAAW;CACb,CAAC;AACH,CAAC,CACH,CACF"}
1
+ {"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport { type ComponentProps } from 'react';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { Node } from '@dxos/plugin-graph';\nimport { Position } from '@dxos/util';\n\nimport { CommandsDialogContent, CommandsTrigger, NavTreeContainer, NavTreeDocumentTitle } from '#containers';\nimport { COMMANDS_DIALOG } from '#meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contribute(Capabilities.ReactSurface, [\n Surface.create({\n id: COMMANDS_DIALOG,\n filter: AppSurface.component<ComponentProps<typeof CommandsDialogContent>>(AppSurface.Dialog, COMMANDS_DIALOG),\n component: CommandsDialogContent,\n props: ({ data: { props }, ref }) => ({ ...props, ref }),\n }),\n Surface.create({\n id: 'navigation',\n filter: Surface.makeFilter(AppSurface.Navigation),\n component: NavTreeContainer,\n props: ({ data: { current, popoverAnchorId }, ref }) => ({ tab: current, popoverAnchorId, ref }),\n }),\n Surface.create({\n id: 'documentTitle',\n filter: Surface.makeFilter(AppSurface.DocumentTitle),\n component: NavTreeDocumentTitle,\n props: ({ data: { subject } }) => ({ node: Node.isGraphNode(subject) ? subject : undefined }),\n }),\n Surface.create({\n id: 'searchInput',\n filter: Surface.makeFilter(AppSurface.SearchInput),\n position: Position.last,\n component: CommandsTrigger,\n }),\n ]),\n ),\n);\n"],"mappings":";;;;;;;;;;AAiBA,IAAA,wBAAe,WAAW,iBACxB,OAAO,QACL,WAAW,WAAW,aAAa,cAAc;CAC/C,QAAQ,OAAO;EACb,IAAI;EACJ,QAAQ,WAAW,UAAwD,WAAW,QAAQ,eAAe;EAC7G,WAAW;EACX,QAAQ,EAAE,MAAM,EAAE,SAAS,WAAW;GAAE,GAAG;GAAO;EAAI;CACxD,CAAC;CACD,QAAQ,OAAO;EACb,IAAI;EACJ,QAAQ,QAAQ,WAAW,WAAW,UAAU;EAChD,WAAW;EACX,QAAQ,EAAE,MAAM,EAAE,SAAS,mBAAmB,WAAW;GAAE,KAAK;GAAS;GAAiB;EAAI;CAChG,CAAC;CACD,QAAQ,OAAO;EACb,IAAI;EACJ,QAAQ,QAAQ,WAAW,WAAW,aAAa;EACnD,WAAW;EACX,QAAQ,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,KAAK,YAAY,OAAO,IAAI,UAAU,KAAA,EAAU;CAC7F,CAAC;CACD,QAAQ,OAAO;EACb,IAAI;EACJ,QAAQ,QAAQ,WAAW,WAAW,WAAW;EACjD,UAAU,SAAS;EACnB,WAAW;CACb,CAAC;AACH,CAAC,CACH,CACF"}
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll as t };
@@ -1,9 +1,10 @@
1
- import { Capabilities, Capability } from "@dxos/app-framework";
2
- import { AppCapabilities } from "@dxos/app-toolkit";
1
+ import { State } from "./NavTreeCapabilities.mjs";
2
+ import * as Capability from "@dxos/app-framework/Capability";
3
3
  import { Graph, Node } from "@dxos/plugin-graph";
4
4
  import * as Effect from "effect/Effect";
5
- import { AttentionCapabilities } from "@dxos/plugin-attention";
6
- import { NavTreeCapabilities } from "#types";
5
+ import * as Capabilities from "@dxos/app-framework/Capabilities";
6
+ import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
7
+ import * as AttentionCapabilities from "@dxos/plugin-attention/AttentionCapabilities";
7
8
  import { Path } from "@dxos/react-ui-list";
8
9
  import { Atom } from "@effect-atom/atom";
9
10
  import * as Schema from "effect/Schema";
@@ -32,9 +33,9 @@ var defaultStateEntries = [["root", {
32
33
  current: false
33
34
  }]];
34
35
  var state_default = Capability.makeModule(Effect.fnUntraced(function* () {
35
- const registry = yield* Capability.get(Capabilities.AtomRegistry);
36
- const layoutAtom = yield* Capability.get(AppCapabilities.Layout);
37
- const viewState = yield* Capability.get(AttentionCapabilities.ViewState);
36
+ const registry = yield* Capabilities.AtomRegistry;
37
+ const layoutAtom = yield* AppCapabilities.Layout;
38
+ const viewState = yield* AttentionCapabilities.ViewState;
38
39
  let activeIds = registry.get(layoutAtom).active;
39
40
  /** Item state for a path not seen before: `current` follows the layout, `open` starts closed. */
40
41
  const initialItemState = (pathString) => ({
@@ -94,11 +95,12 @@ var state_default = Capability.makeModule(Effect.fnUntraced(function* () {
94
95
  Graph.expand(graph, nodeId, "child");
95
96
  }
96
97
  }).pipe(Effect.forkDaemon);
97
- return Capability.contributes(NavTreeCapabilities.State, {
98
+ yield* Effect.addFinalizer(() => Effect.sync(() => unsubscribe()));
99
+ return Capability.contribute(State, {
98
100
  getItem,
99
101
  getItemAtom,
100
102
  setItem
101
- }, () => Effect.sync(() => unsubscribe()));
103
+ });
102
104
  }));
103
105
  //#endregion
104
106
  export { state_default as default };