@dxos/plugin-navtree 0.10.0 → 0.11.1

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 (187) hide show
  1. package/PLUGIN.mdl +8 -6
  2. package/dist/lib/NavTreePlugin.mjs +40 -0
  3. package/dist/lib/NavTreePlugin.mjs.map +1 -0
  4. package/dist/lib/capabilities.mjs +11 -0
  5. package/dist/lib/capabilities.mjs.map +1 -0
  6. package/dist/lib/chunk-CommandsDialogContent.mjs +100 -0
  7. package/dist/lib/chunk-CommandsDialogContent.mjs.map +1 -0
  8. package/dist/lib/chunk-CommandsTrigger.mjs +27 -0
  9. package/dist/lib/chunk-CommandsTrigger.mjs.map +1 -0
  10. package/dist/lib/chunk-NavTreeDocumentTitle.mjs +17 -0
  11. package/dist/lib/chunk-NavTreeDocumentTitle.mjs.map +1 -0
  12. package/dist/lib/chunk-app-graph-builder.mjs +33 -0
  13. package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
  14. package/dist/lib/chunk-expose.mjs +31 -0
  15. package/dist/lib/chunk-expose.mjs.map +1 -0
  16. package/dist/lib/chunk-keyboard.mjs +49 -0
  17. package/dist/lib/chunk-keyboard.mjs.map +1 -0
  18. package/dist/lib/{neutral/chunk-IRQMJLRY.mjs → chunk-meta.mjs} +14 -23
  19. package/dist/lib/chunk-meta.mjs.map +1 -0
  20. package/dist/lib/chunk-operation-handler.mjs +11 -0
  21. package/dist/lib/chunk-operation-handler.mjs.map +1 -0
  22. package/dist/lib/chunk-react-surface.mjs +46 -0
  23. package/dist/lib/chunk-react-surface.mjs.map +1 -0
  24. package/dist/lib/chunk-state.mjs +106 -0
  25. package/dist/lib/chunk-state.mjs.map +1 -0
  26. package/dist/lib/chunk-types.mjs +26 -0
  27. package/dist/lib/chunk-types.mjs.map +1 -0
  28. package/dist/lib/chunk-util.mjs +51 -0
  29. package/dist/lib/chunk-util.mjs.map +1 -0
  30. package/dist/lib/components.mjs +723 -0
  31. package/dist/lib/components.mjs.map +1 -0
  32. package/dist/lib/containers.mjs +231 -0
  33. package/dist/lib/containers.mjs.map +1 -0
  34. package/dist/lib/hooks.mjs +162 -0
  35. package/dist/lib/hooks.mjs.map +1 -0
  36. package/dist/lib/index.mjs +4 -0
  37. package/dist/lib/meta.mjs +2 -0
  38. package/dist/lib/operations.mjs +7 -0
  39. package/dist/lib/operations.mjs.map +1 -0
  40. package/dist/lib/plugin.mjs +9 -0
  41. package/dist/lib/plugin.mjs.map +1 -0
  42. package/dist/lib/testing.mjs +397 -0
  43. package/dist/lib/testing.mjs.map +1 -0
  44. package/dist/lib/translations.mjs +17 -0
  45. package/dist/lib/translations.mjs.map +1 -0
  46. package/dist/lib/types.mjs +2 -0
  47. package/dist/types/src/NavTreePlugin.d.ts.map +1 -1
  48. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  49. package/dist/types/src/capabilities/keyboard.d.ts +1 -1
  50. package/dist/types/src/capabilities/nav-tree-view-state.d.ts +12 -0
  51. package/dist/types/src/capabilities/nav-tree-view-state.d.ts.map +1 -0
  52. package/dist/types/src/capabilities/nav-tree-view-state.test.d.ts +2 -0
  53. package/dist/types/src/capabilities/nav-tree-view-state.test.d.ts.map +1 -0
  54. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  55. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  56. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  57. package/dist/types/src/capabilities/state.d.ts +1 -1
  58. package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
  59. package/dist/types/src/components/NavTree/NavTree.stories.d.ts +3 -0
  60. package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
  61. package/dist/types/src/components/NavTreeContext/NavTreeContext.d.ts.map +1 -1
  62. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts +1 -1
  63. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.d.ts.map +1 -1
  64. package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
  65. package/dist/types/src/components/Sidebar/L1Panel.d.ts +5 -2
  66. package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
  67. package/dist/types/src/components/Sidebar/L1Tabs.d.ts.map +1 -1
  68. package/dist/types/src/containers/CommandsDialogContent/CommandsDialogContent.d.ts.map +1 -1
  69. package/dist/types/src/containers/CommandsDialogContent/CommandsDialogContent.stories.d.ts +2 -0
  70. package/dist/types/src/containers/CommandsDialogContent/CommandsDialogContent.stories.d.ts.map +1 -1
  71. package/dist/types/src/containers/CommandsTrigger/CommandsTrigger.d.ts +4 -1
  72. package/dist/types/src/containers/CommandsTrigger/CommandsTrigger.d.ts.map +1 -1
  73. package/dist/types/src/containers/NavTreeContainer/NavTreeContainer.d.ts.map +1 -1
  74. package/dist/types/src/containers/NavTreeDocumentTitle/NavTreeDocumentTitle.d.ts +5 -2
  75. package/dist/types/src/containers/NavTreeDocumentTitle/NavTreeDocumentTitle.d.ts.map +1 -1
  76. package/dist/types/src/experimental/Tree.d.ts +0 -1
  77. package/dist/types/src/experimental/Tree.d.ts.map +1 -1
  78. package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
  79. package/dist/types/src/experimental/visit-nodes.d.ts +3 -0
  80. package/dist/types/src/experimental/visit-nodes.d.ts.map +1 -0
  81. package/dist/types/src/hooks/useActions.d.ts +3 -1
  82. package/dist/types/src/hooks/useActions.d.ts.map +1 -1
  83. package/dist/types/src/translations.d.ts +2 -0
  84. package/dist/types/src/translations.d.ts.map +1 -1
  85. package/dist/types/src/types/NavTreeCapabilities.d.ts +1 -1
  86. package/dist/types/src/types/NavTreeCapabilities.d.ts.map +1 -1
  87. package/dist/types/src/types/schema.d.ts +1 -1
  88. package/dist/types/src/types/schema.d.ts.map +1 -1
  89. package/dist/types/src/util.d.ts.map +1 -1
  90. package/dist/types/tsconfig.tsbuildinfo +1 -1
  91. package/package.json +47 -52
  92. package/src/NavTreePlugin.tsx +3 -1
  93. package/src/capabilities/nav-tree-view-state.test.ts +55 -0
  94. package/src/capabilities/nav-tree-view-state.ts +19 -0
  95. package/src/capabilities/{react-surface.tsx → react-surface.ts} +8 -9
  96. package/src/capabilities/state.ts +47 -38
  97. package/src/components/NavTree/NavTree.stories.tsx +26 -5
  98. package/src/components/NavTree/NavTree.tsx +10 -13
  99. package/src/components/NavTreeItem/NavTreeItemAction.tsx +1 -1
  100. package/src/components/Sidebar/L0Menu.tsx +9 -3
  101. package/src/components/Sidebar/L1Panel.tsx +52 -20
  102. package/src/components/Sidebar/L1Tabs.tsx +6 -0
  103. package/src/containers/CommandsDialogContent/CommandsDialogContent.tsx +49 -44
  104. package/src/containers/CommandsTrigger/CommandsTrigger.tsx +2 -0
  105. package/src/containers/NavTreeContainer/NavTreeContainer.tsx +17 -18
  106. package/src/containers/NavTreeDocumentTitle/NavTreeDocumentTitle.tsx +2 -0
  107. package/src/experimental/Tree.stories.tsx +2 -1
  108. package/src/experimental/Tree.tsx +2 -18
  109. package/src/experimental/visit-nodes.ts +27 -0
  110. package/src/hooks/useActions.ts +15 -4
  111. package/src/hooks/useNavTreeModel.ts +1 -1
  112. package/src/operations/expose.ts +2 -2
  113. package/src/testing/app-graph-builder.ts +1 -1
  114. package/src/translations.ts +3 -0
  115. package/src/types/NavTreeCapabilities.ts +1 -1
  116. package/src/types/schema.ts +1 -1
  117. package/src/util.ts +7 -9
  118. package/dist/lib/neutral/CommandsDialogContent-TEKBCQ3U.mjs +0 -112
  119. package/dist/lib/neutral/CommandsDialogContent-TEKBCQ3U.mjs.map +0 -7
  120. package/dist/lib/neutral/CommandsTrigger-HGCI22SP.mjs +0 -27
  121. package/dist/lib/neutral/CommandsTrigger-HGCI22SP.mjs.map +0 -7
  122. package/dist/lib/neutral/NavTreeContainer-ICDKC2GI.mjs +0 -12
  123. package/dist/lib/neutral/NavTreeContainer-ICDKC2GI.mjs.map +0 -7
  124. package/dist/lib/neutral/NavTreeDocumentTitle-RMERXZGK.mjs +0 -22
  125. package/dist/lib/neutral/NavTreeDocumentTitle-RMERXZGK.mjs.map +0 -7
  126. package/dist/lib/neutral/NavTreePlugin.mjs +0 -68
  127. package/dist/lib/neutral/NavTreePlugin.mjs.map +0 -7
  128. package/dist/lib/neutral/NavTreePlugin.node.mjs +0 -18
  129. package/dist/lib/neutral/NavTreePlugin.node.mjs.map +0 -7
  130. package/dist/lib/neutral/NavTreePlugin.workerd.mjs +0 -16
  131. package/dist/lib/neutral/NavTreePlugin.workerd.mjs.map +0 -7
  132. package/dist/lib/neutral/app-graph-builder-2DYAIROU.mjs +0 -42
  133. package/dist/lib/neutral/app-graph-builder-2DYAIROU.mjs.map +0 -7
  134. package/dist/lib/neutral/capabilities/index.mjs +0 -17
  135. package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
  136. package/dist/lib/neutral/chunk-4RN6TH36.mjs +0 -292
  137. package/dist/lib/neutral/chunk-4RN6TH36.mjs.map +0 -7
  138. package/dist/lib/neutral/chunk-BAVI2K7A.mjs +0 -27
  139. package/dist/lib/neutral/chunk-BAVI2K7A.mjs.map +0 -7
  140. package/dist/lib/neutral/chunk-EAN4K6OL.mjs +0 -8
  141. package/dist/lib/neutral/chunk-EAN4K6OL.mjs.map +0 -7
  142. package/dist/lib/neutral/chunk-IRQMJLRY.mjs.map +0 -7
  143. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
  144. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
  145. package/dist/lib/neutral/chunk-JOSNCOV4.mjs +0 -79
  146. package/dist/lib/neutral/chunk-JOSNCOV4.mjs.map +0 -7
  147. package/dist/lib/neutral/components/index.mjs +0 -814
  148. package/dist/lib/neutral/components/index.mjs.map +0 -7
  149. package/dist/lib/neutral/containers/index.mjs +0 -20
  150. package/dist/lib/neutral/containers/index.mjs.map +0 -7
  151. package/dist/lib/neutral/expose-HIBA2NQG.mjs +0 -38
  152. package/dist/lib/neutral/expose-HIBA2NQG.mjs.map +0 -7
  153. package/dist/lib/neutral/hooks/index.mjs +0 -181
  154. package/dist/lib/neutral/hooks/index.mjs.map +0 -7
  155. package/dist/lib/neutral/index.mjs +0 -34
  156. package/dist/lib/neutral/index.mjs.map +0 -7
  157. package/dist/lib/neutral/keyboard-JM2HCF5N.mjs +0 -58
  158. package/dist/lib/neutral/keyboard-JM2HCF5N.mjs.map +0 -7
  159. package/dist/lib/neutral/meta.json +0 -1
  160. package/dist/lib/neutral/meta.mjs +0 -12
  161. package/dist/lib/neutral/meta.mjs.map +0 -7
  162. package/dist/lib/neutral/operation-handler-ORDOJUL2.mjs +0 -13
  163. package/dist/lib/neutral/operation-handler-ORDOJUL2.mjs.map +0 -7
  164. package/dist/lib/neutral/operations/index.mjs +0 -8
  165. package/dist/lib/neutral/operations/index.mjs.map +0 -7
  166. package/dist/lib/neutral/plugin.mjs +0 -16
  167. package/dist/lib/neutral/plugin.mjs.map +0 -7
  168. package/dist/lib/neutral/react-surface-QPMUEDZX.mjs +0 -48
  169. package/dist/lib/neutral/react-surface-QPMUEDZX.mjs.map +0 -7
  170. package/dist/lib/neutral/state-PDZU4PIP.mjs +0 -126
  171. package/dist/lib/neutral/state-PDZU4PIP.mjs.map +0 -7
  172. package/dist/lib/neutral/testing/index.mjs +0 -439
  173. package/dist/lib/neutral/testing/index.mjs.map +0 -7
  174. package/dist/lib/neutral/translations.mjs +0 -23
  175. package/dist/lib/neutral/translations.mjs.map +0 -7
  176. package/dist/lib/neutral/types/index.mjs +0 -10
  177. package/dist/lib/neutral/types/index.mjs.map +0 -7
  178. package/dist/types/src/NavTreePlugin.node.d.ts +0 -4
  179. package/dist/types/src/NavTreePlugin.node.d.ts.map +0 -1
  180. package/dist/types/src/NavTreePlugin.test.d.ts +0 -2
  181. package/dist/types/src/NavTreePlugin.test.d.ts.map +0 -1
  182. package/dist/types/src/NavTreePlugin.workerd.d.ts +0 -4
  183. package/dist/types/src/NavTreePlugin.workerd.d.ts.map +0 -1
  184. package/src/NavTreePlugin.node.ts +0 -17
  185. package/src/NavTreePlugin.test.ts +0 -27
  186. package/src/NavTreePlugin.workerd.ts +0 -16
  187. /package/src/components/NavTreeContext/{NavTreeContext.tsx → NavTreeContext.ts} +0 -0
@@ -1,112 +0,0 @@
1
- import "./chunk-J5LGTIGS.mjs";
2
-
3
- // src/containers/CommandsDialogContent/CommandsDialogContent.tsx
4
- import React, { forwardRef, useMemo, useState } from "react";
5
- import { useOperationInvoker } from "@dxos/app-framework/ui";
6
- import { LayoutOperation } from "@dxos/app-toolkit";
7
- import { useAppGraph } from "@dxos/app-toolkit/ui";
8
- import { Keyboard, keySymbols } from "@dxos/keyboard";
9
- import { Graph, Node, useActionRunner } from "@dxos/plugin-graph";
10
- import { useActions } from "@dxos/plugin-graph";
11
- import { Button, Dialog, toLocalizedString, useTranslation } from "@dxos/react-ui";
12
- import { SearchList, useSearchListResults } from "@dxos/react-ui-search";
13
- import { osTranslations } from "@dxos/ui-theme";
14
- import { getHostPlatform } from "@dxos/util";
15
- import { KEY_BINDING, meta } from "#meta";
16
- var CommandsDialogContent = /* @__PURE__ */ forwardRef(({ selected: initial }, forwardedRef) => {
17
- const { t } = useTranslation(meta.profile.key);
18
- const { invokePromise } = useOperationInvoker();
19
- const runAction = useActionRunner();
20
- const { graph } = useAppGraph();
21
- const [selected, setSelected] = useState(initial);
22
- const allActions = useMemo(() => {
23
- const current = Keyboard.singleton.getCurrentContext();
24
- const actionMap = /* @__PURE__ */ new Set();
25
- const actions2 = [];
26
- Graph.traverse(graph, {
27
- relation: [
28
- "child",
29
- "action"
30
- ],
31
- visitor: (node, path) => {
32
- const isActionLike = Node.isAction(node) || Node.isActionGroup(node);
33
- const parentId = path.at(-2) ?? "";
34
- const matches = current === parentId || current.startsWith(parentId + "/");
35
- if (isActionLike && !actionMap.has(node.id) && matches) {
36
- actionMap.add(node.id);
37
- actions2.push(node);
38
- }
39
- }
40
- });
41
- actions2.sort((a, b) => {
42
- return toLocalizedString(a.properties.label, t)?.toLowerCase().localeCompare(toLocalizedString(b.properties.label, t)?.toLowerCase());
43
- });
44
- return actions2;
45
- }, [
46
- graph
47
- ]);
48
- const group = allActions.find(({ id }) => id === selected);
49
- const groupActions = useActions(graph, group?.id);
50
- const actions = Node.isActionGroup(group) ? groupActions : allActions;
51
- const { results, handleSearch } = useSearchListResults({
52
- items: actions,
53
- extract: (action) => toLocalizedString(action.properties.label, t)
54
- });
55
- return /* @__PURE__ */ React.createElement(Dialog.Content, {
56
- ref: forwardedRef
57
- }, /* @__PURE__ */ React.createElement(Dialog.Title, {
58
- srOnly: true
59
- }, t("commands-dialog.title", {
60
- ns: meta.profile.key
61
- })), /* @__PURE__ */ React.createElement(SearchList.Root, {
62
- onSearch: handleSearch
63
- }, /* @__PURE__ */ React.createElement(SearchList.Input, {
64
- placeholder: t("command-list-input.placeholder")
65
- }), /* @__PURE__ */ React.createElement(SearchList.Viewport, null, results.map((action) => {
66
- const shortcut = typeof action.properties.keyBinding === "string" ? action.properties.keyBinding : action.properties.keyBinding?.[getHostPlatform()];
67
- return /* @__PURE__ */ React.createElement(SearchList.Item, {
68
- value: action.id,
69
- key: action.id,
70
- label: toLocalizedString(action.properties.label, t),
71
- icon: action.properties.icon,
72
- suffix: shortcut ? keySymbols(shortcut).join("") : void 0,
73
- onSelect: () => {
74
- if (action.properties.disabled) {
75
- return;
76
- }
77
- if (Node.isActionGroup(action)) {
78
- setSelected(action.id);
79
- return;
80
- }
81
- void invokePromise(LayoutOperation.UpdateDialog, {
82
- state: false
83
- });
84
- setTimeout(() => {
85
- const lookupId = group?.id ?? action.id;
86
- const node = Graph.getConnections(graph, lookupId, Node.actionRelation("inbound"))[0];
87
- if (node && Node.isAction(action)) {
88
- void runAction(action, {
89
- parent: node,
90
- caller: KEY_BINDING
91
- });
92
- }
93
- });
94
- },
95
- classNames: "flex items-center gap-2",
96
- disabled: action.properties.disabled,
97
- ...action.properties?.testId && {
98
- "data-testid": action.properties.testId
99
- }
100
- });
101
- }))), /* @__PURE__ */ React.createElement(Dialog.ActionBar, null, /* @__PURE__ */ React.createElement(Dialog.Close, {
102
- asChild: true
103
- }, /* @__PURE__ */ React.createElement(Button, {
104
- classNames: "w-full"
105
- }, t("close.label", {
106
- ns: osTranslations
107
- })))));
108
- });
109
- export {
110
- CommandsDialogContent as default
111
- };
112
- //# sourceMappingURL=CommandsDialogContent-TEKBCQ3U.mjs.map
@@ -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.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 <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: osTranslations })}</Button>\n </Dialog.Close>\n </Dialog.ActionBar>\n </Dialog.Content>\n );\n },\n);\n"],
5
- "mappings": "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",
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", "profile", "key", "invokePromise", "runAction", "graph", "setSelected", "allActions", "current", "singleton", "getCurrentContext", "actionMap", "Set", "actions", "traverse", "relation", "visitor", "node", "path", "isActionLike", "isAction", "isActionGroup", "parentId", "at", "matches", "startsWith", "has", "id", "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", "icon", "suffix", "join", "undefined", "onSelect", "disabled", "UpdateDialog", "state", "setTimeout", "lookupId", "getConnections", "actionRelation", "parent", "caller", "classNames", "testId", "ActionBar", "Close", "asChild"]
7
- }
@@ -1,27 +0,0 @@
1
- import "./chunk-J5LGTIGS.mjs";
2
-
3
- // src/containers/CommandsTrigger/CommandsTrigger.tsx
4
- import React from "react";
5
- import { useOperationInvoker } from "@dxos/app-framework/ui";
6
- import { LayoutOperation } from "@dxos/app-toolkit";
7
- import { Button, Icon, useTranslation } from "@dxos/react-ui";
8
- import { COMMANDS_DIALOG, meta } from "#meta";
9
- var CommandsTrigger = () => {
10
- const { invokePromise } = useOperationInvoker();
11
- const { t } = useTranslation(meta.profile.key);
12
- return /* @__PURE__ */ React.createElement(Button, {
13
- classNames: "m-1 px-1 lg:px-2",
14
- onClick: () => void invokePromise(LayoutOperation.UpdateDialog, {
15
- subject: COMMANDS_DIALOG,
16
- blockAlign: "start"
17
- })
18
- }, /* @__PURE__ */ React.createElement("span", {
19
- className: "text-description font-normal grow text-start"
20
- }, t("command-list-input.placeholder")), /* @__PURE__ */ React.createElement(Icon, {
21
- icon: "ph--magnifying-glass--regular"
22
- }));
23
- };
24
- export {
25
- CommandsTrigger as default
26
- };
27
- //# sourceMappingURL=CommandsTrigger-HGCI22SP.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/containers/CommandsTrigger/CommandsTrigger.tsx"],
4
- "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"],
5
- "mappings": ";;;AAIA,OAAOA,WAAW;AAElB,SAASC,2BAA2B;AACpC,SAASC,uBAAuB;AAChC,SAASC,QAAQC,MAAMC,sBAAsB;AAE7C,SAASC,iBAAiBC,YAAY;AAG/B,IAAMC,kBAAkB,MAAA;AAC7B,QAAM,EAAEC,cAAa,IAAKR,oBAAAA;AAC1B,QAAM,EAAES,EAAC,IAAKL,eAAeE,KAAKI,QAAQC,GAAG;AAC7C,SACE,sBAAA,cAACT,QAAAA;IACCU,YAAW;IACXC,SAAS,MACP,KAAKL,cAAcP,gBAAgBa,cAAc;MAAEC,SAASV;MAAiBW,YAAY;IAAQ,CAAA;KAGnG,sBAAA,cAACC,QAAAA;IAAKC,WAAU;KAAgDT,EAAE,gCAAA,CAAA,GAClE,sBAAA,cAACN,MAAAA;IAAKgB,MAAK;;AAGjB;",
6
- "names": ["React", "useOperationInvoker", "LayoutOperation", "Button", "Icon", "useTranslation", "COMMANDS_DIALOG", "meta", "CommandsTrigger", "invokePromise", "t", "profile", "key", "classNames", "onClick", "UpdateDialog", "subject", "blockAlign", "span", "className", "icon"]
7
- }
@@ -1,12 +0,0 @@
1
- import {
2
- NODE_TYPE,
3
- NavTreeContainer
4
- } from "./chunk-4RN6TH36.mjs";
5
- import "./chunk-JOSNCOV4.mjs";
6
- import "./chunk-J5LGTIGS.mjs";
7
- export {
8
- NODE_TYPE,
9
- NavTreeContainer,
10
- NavTreeContainer as default
11
- };
12
- //# sourceMappingURL=NavTreeContainer-ICDKC2GI.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
@@ -1,22 +0,0 @@
1
- import "./chunk-J5LGTIGS.mjs";
2
-
3
- // src/containers/NavTreeDocumentTitle/NavTreeDocumentTitle.tsx
4
- import { useEffect } from "react";
5
- import { toLocalizedString, useTranslation } from "@dxos/react-ui";
6
- import { osTranslations } from "@dxos/ui-theme";
7
- import { meta } from "#meta";
8
- var NavTreeDocumentTitle = ({ node }) => {
9
- const { t } = useTranslation(meta.profile.key);
10
- useEffect(() => {
11
- document.title = node ? toLocalizedString(node.properties.label, t) : t("current-app.name", {
12
- ns: osTranslations
13
- });
14
- }, [
15
- node?.properties?.label
16
- ]);
17
- return null;
18
- };
19
- export {
20
- NavTreeDocumentTitle as default
21
- };
22
- //# sourceMappingURL=NavTreeDocumentTitle-RMERXZGK.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/containers/NavTreeDocumentTitle/NavTreeDocumentTitle.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\nimport { useEffect } from 'react';\n\nimport { type Node } from '@dxos/app-graph';\nimport { toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { osTranslations } from '@dxos/ui-theme';\n\nimport { meta } from '#meta';\n\nexport const NavTreeDocumentTitle = ({ node }: { node?: Node.Node }) => {\n const { t } = useTranslation(meta.profile.key);\n useEffect(() => {\n document.title = node ? toLocalizedString(node.properties.label, t) : t('current-app.name', { ns: osTranslations });\n }, [node?.properties?.label]);\n return null;\n};\n"],
5
- "mappings": ";;;AAGA,SAASA,iBAAiB;AAG1B,SAASC,mBAAmBC,sBAAsB;AAClD,SAASC,sBAAsB;AAE/B,SAASC,YAAY;AAEd,IAAMC,uBAAuB,CAAC,EAAEC,KAAI,MAAwB;AACjE,QAAM,EAAEC,EAAC,IAAKL,eAAeE,KAAKI,QAAQC,GAAG;AAC7CT,YAAU,MAAA;AACRU,aAASC,QAAQL,OAAOL,kBAAkBK,KAAKM,WAAWC,OAAON,CAAAA,IAAKA,EAAE,oBAAoB;MAAEO,IAAIX;IAAe,CAAA;EACnH,GAAG;IAACG,MAAMM,YAAYC;GAAM;AAC5B,SAAO;AACT;",
6
- "names": ["useEffect", "toLocalizedString", "useTranslation", "osTranslations", "meta", "NavTreeDocumentTitle", "node", "t", "profile", "key", "document", "title", "properties", "label", "ns"]
7
- }
@@ -1,68 +0,0 @@
1
- import "./chunk-J5LGTIGS.mjs";
2
-
3
- // src/NavTreePlugin.tsx
4
- import * as Effect from "effect/Effect";
5
- import { ActivationEvent, ActivationEvents, Capabilities, Capability, Plugin } from "@dxos/app-framework";
6
- import { AppActivationEvents, AppCapabilities, AppPlugin, LayoutOperation } from "@dxos/app-toolkit";
7
- import { Graph } from "@dxos/plugin-graph";
8
- import { AppGraphBuilder, Keyboard, OperationHandler, ReactSurface, State } from "#capabilities";
9
- import { meta } from "#meta";
10
- import { translations } from "#translations";
11
- import { NavTreeEvents } from "#types";
12
-
13
- // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-navtree/PLUGIN.mdl
14
- var PLUGIN_default = "---\nid: org.dxos.plugin.navtree\nname: NavTreePlugin\nversion: 0.1.0\n---\n\nHierarchical navigation sidebar for `DXOS` Composer \u2014 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)\n back()\n itemHover(item: Node)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 workspace tabs \u2502\n \u2502 [tab] [tab] [tab] \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 collapsible tree \u2502\n \u2502 \u25BE Space \u2502\n \u2502 \u25BE Folder \u2502\n \u2502 \u2022 Object \u2502\n \u2502 \u2022 Object \u2502\n \u2502 \u2022 Object \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\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)\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 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 NavTreeContext.Provider \u2502\n \u2502 \u2514\u2500 NavTree \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent CommandsDialogContent\n desc: Full-screen command palette dialog \u2014 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) \u2192 Node[]\n execute(node: Node)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [search input] \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 result list \u2502\n \u2502 icon label shortcut \u2502\n \u2502 icon label \u2502\n \u2502 \u2026 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent CommandsTrigger\n desc: Search-input surface slot component \u2014 opens the commands dialog on click or \u2318K / 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 (single mode) or LayoutOperation.Set (multi mode) is invoked\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 \u2318K (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 in single mode\n given: layout.mode === single, item not currently active\n when: user selects a tree item\n then: LayoutOperation.Open is invoked with the item id\n```\n\n```mdl\ntest T-5: Command palette opens on keyboard shortcut\n given: NavTree is active\n when: user presses \u2318K (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";
15
-
16
- // src/NavTreePlugin.tsx
17
- var NavTreePlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
18
- activate: AppGraphBuilder
19
- }), AppPlugin.addOperationHandlerModule({
20
- activate: OperationHandler
21
- }), AppPlugin.addSurfaceModule({
22
- activate: ReactSurface
23
- }), AppPlugin.addTranslationsModule({
24
- translations
25
- }), Plugin.addModule({
26
- id: "state",
27
- activatesOn: AppActivationEvents.LayoutReady,
28
- firesAfterActivation: [
29
- NavTreeEvents.StateReady
30
- ],
31
- activate: State
32
- }), Plugin.addModule({
33
- id: "expose",
34
- activatesOn: ActivationEvent.allOf(ActivationEvents.ProcessManagerReady, AppActivationEvents.AppGraphReady, AppActivationEvents.LayoutReady, NavTreeEvents.StateReady),
35
- activate: Effect.fnUntraced(function* () {
36
- const layout = yield* Capabilities.getAtomValue(AppCapabilities.Layout);
37
- const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);
38
- const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
39
- if (invokePromise && layout.active.length === 1) {
40
- void Graph.waitForPath(graph, {
41
- target: layout.active[0]
42
- }, {
43
- timeout: 3e4
44
- }).then(() => invokePromise(LayoutOperation.Expose, {
45
- subject: layout.active[0]
46
- })).catch(() => {
47
- });
48
- }
49
- return [];
50
- })
51
- }), Plugin.addModule({
52
- id: "keyboard",
53
- activatesOn: ActivationEvent.allOf(AppActivationEvents.AppGraphReady, ActivationEvents.ProcessManagerReady),
54
- activate: Keyboard
55
- }), AppPlugin.addPluginAssetModule({
56
- asset: {
57
- pluginId: meta.profile.key,
58
- path: "PLUGIN.mdl",
59
- content: PLUGIN_default,
60
- mimeType: "application/x-mdl"
61
- }
62
- }), Plugin.make);
63
- var NavTreePlugin_default = NavTreePlugin;
64
- export {
65
- NavTreePlugin,
66
- NavTreePlugin_default as default
67
- };
68
- //# sourceMappingURL=NavTreePlugin.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/NavTreePlugin.tsx", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-navtree/PLUGIN.mdl"],
4
- "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 { 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 activatesOn: AppActivationEvents.LayoutReady,\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", "---\nid: org.dxos.plugin.navtree\nname: NavTreePlugin\nversion: 0.1.0\n---\n\nHierarchical navigation sidebar for `DXOS` Composer \u2014 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)\n back()\n itemHover(item: Node)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 workspace tabs \u2502\n \u2502 [tab] [tab] [tab] \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 collapsible tree \u2502\n \u2502 \u25BE Space \u2502\n \u2502 \u25BE Folder \u2502\n \u2502 \u2022 Object \u2502\n \u2502 \u2022 Object \u2502\n \u2502 \u2022 Object \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\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)\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 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 NavTreeContext.Provider \u2502\n \u2502 \u2514\u2500 NavTree \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent CommandsDialogContent\n desc: Full-screen command palette dialog \u2014 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) \u2192 Node[]\n execute(node: Node)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [search input] \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 result list \u2502\n \u2502 icon label shortcut \u2502\n \u2502 icon label \u2502\n \u2502 \u2026 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent CommandsTrigger\n desc: Search-input surface slot component \u2014 opens the commands dialog on click or \u2318K / 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 (single mode) or LayoutOperation.Set (multi mode) is invoked\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 \u2318K (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 in single mode\n given: layout.mode === single, item not currently active\n when: user selects a tree item\n then: LayoutOperation.Open is invoked with the item id\n```\n\n```mdl\ntest T-5: Command palette opens on keyboard shortcut\n given: NavTree is active\n when: user presses \u2318K (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"],
5
- "mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiBC,kBAAkBC,cAAcC,YAAYC,cAAc;AACpF,SAASC,qBAAqBC,iBAAiBC,WAAWC,uBAAuB;AACjF,SAASC,aAAa;AAEtB,SAASC,iBAAiBC,UAAUC,kBAAkBC,cAAcC,aAAa;AACjF,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAC7B,SAASC,qBAAqB;;;ACb9B;;;ADkBO,IAAMC,gBAAgBC,OAAOC,OAAOC,IAAAA,EAAMC,KAC/CC,UAAUC,kBAAkB;EAAEC,UAAUC;AAAgB,CAAA,GACxDH,UAAUI,0BAA0B;EAAEF,UAAUG;AAAiB,CAAA,GACjEL,UAAUM,iBAAiB;EAAEJ,UAAUK;AAAa,CAAA,GACpDP,UAAUQ,sBAAsB;EAAEC;AAAa,CAAA,GAC/Cb,OAAOc,UAAU;EACfC,IAAI;EACJC,aAAaC,oBAAoBC;EACjCC,sBAAsB;IAACC,cAAcC;;EACrCf,UAAUgB;AACZ,CAAA,GACAtB,OAAOc,UAAU;EACfC,IAAI;EACJC,aAAaO,gBAAgBC,MAC3BC,iBAAiBC,qBACjBT,oBAAoBU,eACpBV,oBAAoBC,aACpBE,cAAcC,UAAU;EAE1Bf,UAAiBsB,kBAAW,aAAA;AAC1B,UAAMC,SAAS,OAAOC,aAAaC,aAAaC,gBAAgBC,MAAM;AACtE,UAAM,EAAEC,cAAa,IAAK,OAAOC,WAAWC,IAAIN,aAAaO,gBAAgB;AAC7E,UAAM,EAAEC,MAAK,IAAK,OAAOH,WAAWC,IAAIJ,gBAAgBO,QAAQ;AAChE,QAAIL,iBAAiBL,OAAOW,OAAOC,WAAW,GAAG;AAG/C,WAAKC,MAAMC,YAAYL,OAAO;QAAEM,QAAQf,OAAOW,OAAO,CAAA;MAAG,GAAG;QAAEK,SAAS;MAAO,CAAA,EAC3EC,KAAK,MAAMZ,cAAca,gBAAgBC,QAAQ;QAAEC,SAASpB,OAAOW,OAAO,CAAA;MAAG,CAAA,CAAA,EAC7EU,MAAM,MAAA;MAAO,CAAA;IAClB;AAEA,WAAO,CAAA;EACT,CAAA;AACF,CAAA,GACAlD,OAAOc,UAAU;EACfC,IAAI;EACJC,aAAaO,gBAAgBC,MAAMP,oBAAoBU,eAAeF,iBAAiBC,mBAAmB;EAC1GpB,UAAU6C;AACZ,CAAA,GACA/C,UAAUgD,qBAAqB;EAC7BC,OAAO;IAAEC,UAAUpD,KAAKqD,QAAQC;IAAKC,MAAM;IAAcC,SAASC;IAAYC,UAAU;EAAoB;AAC9G,CAAA,GACA5D,OAAO6D,IAAI;AAGb,IAAA,wBAAe9D;",
6
- "names": ["Effect", "ActivationEvent", "ActivationEvents", "Capabilities", "Capability", "Plugin", "AppActivationEvents", "AppCapabilities", "AppPlugin", "LayoutOperation", "Graph", "AppGraphBuilder", "Keyboard", "OperationHandler", "ReactSurface", "State", "meta", "translations", "NavTreeEvents", "NavTreePlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addAppGraphModule", "activate", "AppGraphBuilder", "addOperationHandlerModule", "OperationHandler", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "addModule", "id", "activatesOn", "AppActivationEvents", "LayoutReady", "firesAfterActivation", "NavTreeEvents", "StateReady", "State", "ActivationEvent", "allOf", "ActivationEvents", "ProcessManagerReady", "AppGraphReady", "fnUntraced", "layout", "Capabilities", "getAtomValue", "AppCapabilities", "Layout", "invokePromise", "Capability", "get", "OperationInvoker", "graph", "AppGraph", "active", "length", "Graph", "waitForPath", "target", "timeout", "then", "LayoutOperation", "Expose", "subject", "catch", "Keyboard", "addPluginAssetModule", "asset", "pluginId", "profile", "key", "path", "content", "pluginSpec", "mimeType", "make"]
7
- }
@@ -1,18 +0,0 @@
1
- import "./chunk-J5LGTIGS.mjs";
2
-
3
- // src/NavTreePlugin.node.ts
4
- import { Plugin } from "@dxos/app-framework";
5
- import { AppPlugin } from "@dxos/app-toolkit";
6
- import { AppGraphBuilder, OperationHandler } from "#capabilities";
7
- import { meta } from "#meta";
8
- var NavTreePlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
9
- activate: AppGraphBuilder
10
- }), AppPlugin.addOperationHandlerModule({
11
- activate: OperationHandler
12
- }), Plugin.make);
13
- var NavTreePlugin_node_default = NavTreePlugin;
14
- export {
15
- NavTreePlugin,
16
- NavTreePlugin_node_default as default
17
- };
18
- //# sourceMappingURL=NavTreePlugin.node.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/NavTreePlugin.node.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { AppGraphBuilder, OperationHandler } from '#capabilities';\nimport { meta } from '#meta';\n\nexport const NavTreePlugin = Plugin.define(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n Plugin.make,\n);\n\nexport default NavTreePlugin;\n"],
5
- "mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,iBAAiBC,wBAAwB;AAClD,SAASC,YAAY;AAEd,IAAMC,gBAAgBL,OAAOM,OAAOF,IAAAA,EAAMG,KAC/CN,UAAUO,kBAAkB;EAAEC,UAAUP;AAAgB,CAAA,GACxDD,UAAUS,0BAA0B;EAAED,UAAUN;AAAiB,CAAA,GACjEH,OAAOW,IAAI;AAGb,IAAA,6BAAeN;",
6
- "names": ["Plugin", "AppPlugin", "AppGraphBuilder", "OperationHandler", "meta", "NavTreePlugin", "define", "pipe", "addAppGraphModule", "activate", "addOperationHandlerModule", "make"]
7
- }
@@ -1,16 +0,0 @@
1
- import "./chunk-J5LGTIGS.mjs";
2
-
3
- // src/NavTreePlugin.workerd.ts
4
- import { Plugin } from "@dxos/app-framework";
5
- import { AppPlugin } from "@dxos/app-toolkit";
6
- import { OperationHandler } from "#capabilities";
7
- import { meta } from "#meta";
8
- var NavTreePlugin = Plugin.define(meta).pipe(AppPlugin.addOperationHandlerModule({
9
- activate: OperationHandler
10
- }), Plugin.make);
11
- var NavTreePlugin_workerd_default = NavTreePlugin;
12
- export {
13
- NavTreePlugin,
14
- NavTreePlugin_workerd_default as default
15
- };
16
- //# sourceMappingURL=NavTreePlugin.workerd.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/NavTreePlugin.workerd.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { OperationHandler } from '#capabilities';\nimport { meta } from '#meta';\n\nexport const NavTreePlugin = Plugin.define(meta).pipe(\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n Plugin.make,\n);\n\nexport default NavTreePlugin;\n"],
5
- "mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,wBAAwB;AACjC,SAASC,YAAY;AAEd,IAAMC,gBAAgBJ,OAAOK,OAAOF,IAAAA,EAAMG,KAC/CL,UAAUM,0BAA0B;EAAEC,UAAUN;AAAiB,CAAA,GACjEF,OAAOS,IAAI;AAGb,IAAA,gCAAeL;",
6
- "names": ["Plugin", "AppPlugin", "OperationHandler", "meta", "NavTreePlugin", "define", "pipe", "addOperationHandlerModule", "activate", "make"]
7
- }
@@ -1,42 +0,0 @@
1
- import "./chunk-J5LGTIGS.mjs";
2
-
3
- // src/capabilities/app-graph-builder.ts
4
- import * as Effect from "effect/Effect";
5
- import { Capability } from "@dxos/app-framework";
6
- import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
7
- import { Operation } from "@dxos/compute";
8
- import { GraphBuilder, Node, NodeMatcher } from "@dxos/plugin-graph";
9
- import { COMMANDS_DIALOG, meta } from "#meta";
10
- var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
11
- const extensions = yield* GraphBuilder.createExtension({
12
- id: "root",
13
- match: NodeMatcher.whenRoot,
14
- actions: () => Effect.succeed([
15
- Node.makeAction({
16
- id: COMMANDS_DIALOG,
17
- data: () => Operation.invoke(LayoutOperation.UpdateDialog, {
18
- subject: COMMANDS_DIALOG,
19
- blockAlign: "start"
20
- }),
21
- properties: {
22
- label: [
23
- "open-commands.label",
24
- {
25
- ns: meta.profile.key
26
- }
27
- ],
28
- icon: "ph--magnifying-glass--regular",
29
- keyBinding: {
30
- macos: "meta+k",
31
- windows: "ctrl+k"
32
- }
33
- }
34
- })
35
- ])
36
- });
37
- return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
38
- }));
39
- export {
40
- app_graph_builder_default as default
41
- };
42
- //# sourceMappingURL=app-graph-builder-2DYAIROU.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/app-graph-builder.ts"],
4
- "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"],
5
- "mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiBC,uBAAuB;AACjD,SAASC,iBAAiB;AAC1B,SAASC,cAAcC,MAAMC,mBAAmB;AAEhD,SAASC,iBAAiBC,YAAY;AAEtC,IAAA,4BAAeR,WAAWS,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAOP,aAAaQ,gBAAgB;IACrDC,IAAI;IACJC,OAAOR,YAAYS;IACnBC,SAAS,MACAC,eAAQ;MACbZ,KAAKa,WAAW;QACdL,IAAIN;QACJY,MAAM,MACJhB,UAAUiB,OAAOlB,gBAAgBmB,cAAc;UAC7CC,SAASf;UACTgB,YAAY;QACd,CAAA;QACFC,YAAY;UACVC,OAAO;YAAC;YAAuB;cAAEC,IAAIlB,KAAKmB,QAAQC;YAAI;;UACtDC,MAAM;UACNC,YAAY;YACVC,OAAO;YACPC,SAAS;UACX;QACF;MACF,CAAA;KACD;EACL,CAAA;AAEA,SAAOhC,WAAWiC,YAAYhC,gBAAgBiC,iBAAiBvB,UAAAA;AACjE,CAAA,CAAA;",
6
- "names": ["Effect", "Capability", "AppCapabilities", "LayoutOperation", "Operation", "GraphBuilder", "Node", "NodeMatcher", "COMMANDS_DIALOG", "meta", "makeModule", "fnUntraced", "extensions", "createExtension", "id", "match", "whenRoot", "actions", "succeed", "makeAction", "data", "invoke", "UpdateDialog", "subject", "blockAlign", "properties", "label", "ns", "profile", "key", "icon", "keyBinding", "macos", "windows", "contributes", "AppGraphBuilder"]
7
- }
@@ -1,17 +0,0 @@
1
- import "../chunk-J5LGTIGS.mjs";
2
-
3
- // src/capabilities/index.ts
4
- import { Capability } from "@dxos/app-framework";
5
- var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("../app-graph-builder-2DYAIROU.mjs"));
6
- var Keyboard = Capability.lazy("Keyboard", () => import("../keyboard-JM2HCF5N.mjs"));
7
- var OperationHandler = Capability.lazy("OperationHandler", () => import("../operation-handler-ORDOJUL2.mjs"));
8
- var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-QPMUEDZX.mjs"));
9
- var State = Capability.lazy("State", () => import("../state-PDZU4PIP.mjs"));
10
- export {
11
- AppGraphBuilder,
12
- Keyboard,
13
- OperationHandler,
14
- ReactSurface,
15
- State
16
- };
17
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/capabilities/index.ts"],
4
- "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"],
5
- "mappings": ";;;AAIA,SAASA,kBAAkB;AAGpB,IAAMC,kBAAkBD,WAAWE,KAAK,mBAAmB,MAAM,OAAO,mCAAA,CAAA;AACxE,IAAMC,WAAWH,WAAWE,KAAK,YAAY,MAAM,OAAO,0BAAA,CAAA;AAC1D,IAAME,mBAAmBJ,WAAWE,KACzC,oBACA,MAAM,OAAO,mCAAA,CAAA;AAER,IAAMG,eAAeL,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMI,QAAQN,WAAWE,KAAK,SAAS,MAAM,OAAO,uBAAA,CAAA;",
6
- "names": ["Capability", "AppGraphBuilder", "lazy", "Keyboard", "OperationHandler", "ReactSurface", "State"]
7
- }