@dxos/plugin-navtree 0.8.4-main.5acf9ea → 0.8.4-main.5ea62a8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{app-graph-builder-5J4LRWDX.mjs → app-graph-builder-6JDBQ25U.mjs} +3 -3
- package/dist/lib/browser/{app-graph-builder-5J4LRWDX.mjs.map → app-graph-builder-6JDBQ25U.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-WEMCSQI7.mjs → chunk-ZKVY35IG.mjs} +54 -54
- package/dist/lib/browser/chunk-ZKVY35IG.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +2 -4
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-3XYN2CBU.mjs → intent-resolver-N35ZIHFD.mjs} +2 -2
- package/dist/lib/browser/{intent-resolver-3XYN2CBU.mjs.map → intent-resolver-N35ZIHFD.mjs.map} +3 -3
- package/dist/lib/browser/{keyboard-QRS6WOQH.mjs → keyboard-HMTMA33N.mjs} +1 -1
- package/dist/lib/browser/{keyboard-QRS6WOQH.mjs.map → keyboard-HMTMA33N.mjs.map} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-JSJ5SQX5.mjs → react-surface-5PZ4XJT7.mjs} +2 -2
- package/dist/lib/browser/{react-surface-JSJ5SQX5.mjs.map → react-surface-5PZ4XJT7.mjs.map} +1 -1
- package/dist/lib/browser/{state-54DY3DOY.mjs → state-P5DGL7KS.mjs} +1 -1
- package/dist/lib/browser/state-P5DGL7KS.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +6 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts +25 -2
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +32 -3
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L1Tabs.d.ts.map +1 -1
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts +8 -4
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/types.d.ts +2 -2
- package/dist/types/src/components/types.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.stories.d.ts +6 -2
- package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +1 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -41
- package/src/NavTreePlugin.tsx +5 -5
- package/src/capabilities/app-graph-builder.ts +2 -2
- package/src/capabilities/intent-resolver.ts +1 -1
- package/src/capabilities/keyboard.ts +2 -2
- package/src/capabilities/react-surface.tsx +1 -1
- package/src/capabilities/state.ts +3 -2
- package/src/components/CommandsDialog/CommandsDialog.tsx +2 -2
- package/src/components/CommandsDialog/CommandsTrigger.tsx +1 -1
- package/src/components/NavTree/NavTree.stories.tsx +5 -5
- package/src/components/NavTreeContainer.tsx +40 -14
- package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +2 -2
- package/src/components/NavTreeItem/NavTreeItemAction.tsx +2 -2
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +5 -4
- package/src/components/Sidebar/L0Menu.tsx +2 -2
- package/src/components/Sidebar/L1Panel.tsx +17 -19
- package/src/components/Sidebar/L1Tabs.tsx +1 -0
- package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +6 -4
- package/src/components/types.ts +3 -2
- package/src/experimental/Tree.stories.tsx +5 -3
- package/src/testing/app-graph-builder.ts +1 -1
- package/src/util.ts +2 -20
- package/dist/lib/browser/chunk-WEMCSQI7.mjs.map +0 -7
- package/dist/lib/browser/state-54DY3DOY.mjs.map +0 -7
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
// src/capabilities/app-graph-builder.ts
|
|
7
7
|
import { Rx } from "@effect-rx/rx-react";
|
|
8
8
|
import { Option, pipe } from "effect";
|
|
9
|
-
import { Capabilities, contributes, createIntent
|
|
10
|
-
import {
|
|
9
|
+
import { Capabilities, LayoutAction, contributes, createIntent } from "@dxos/app-framework";
|
|
10
|
+
import { ROOT_ID, createExtension } from "@dxos/plugin-graph";
|
|
11
11
|
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
12
12
|
id: NAVTREE_PLUGIN,
|
|
13
13
|
actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => [
|
|
@@ -42,4 +42,4 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
42
42
|
export {
|
|
43
43
|
app_graph_builder_default as default
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=app-graph-builder-
|
|
45
|
+
//# sourceMappingURL=app-graph-builder-6JDBQ25U.mjs.map
|
package/dist/lib/browser/{app-graph-builder-5J4LRWDX.mjs.map → app-graph-builder-6JDBQ25U.mjs.map}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities,
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAcC,
|
|
6
|
-
"names": ["Rx", "Option", "pipe", "Capabilities", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';\nimport { ROOT_ID, createExtension } from '@dxos/plugin-graph';\n\nimport { COMMANDS_DIALOG, NAVTREE_PLUGIN } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: NAVTREE_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => [\n {\n id: COMMANDS_DIALOG,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: COMMANDS_DIALOG,\n options: {\n blockAlign: 'start',\n },\n }),\n );\n },\n properties: {\n label: ['open commands label', { ns: NAVTREE_PLUGIN }],\n icon: 'ph--magnifying-glass--regular',\n keyBinding: {\n macos: 'meta+k',\n windows: 'ctrl+k',\n },\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAcC,cAAkCC,aAAaC,oBAAoB;AAC1F,SAASC,SAASC,uBAAuB;AAIzC,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,SAAS,CAACC,SACRC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKH,OAAOU,UAAUF,OAAOG,KAAKR,KAAAA,IAAQK,OAAOI,KAAI,CAAA,GAC/EJ,OAAOK,IAAI,MAAM;IACf;MACEb,IAAIc;MACJC,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKtB,QAAQuB,cAAcrB,aAAasB,gBAAgB;AACzF,cAAMF,SACJG,aAAaC,aAAaC,cAAc;UACtCC,MAAM;UACNC,SAASV;UACTW,SAAS;YACPC,YAAY;UACd;QACF,CAAA,CAAA;MAEJ;MACAC,YAAY;QACVC,OAAO;UAAC;UAAuB;YAAEC,IAAI5B;UAAe;;QACpD6B,MAAM;QACNC,YAAY;UACVC,OAAO;UACPC,SAAS;QACX;MACF;IACF;GACD,GACDzB,OAAO0B,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
|
|
6
|
+
"names": ["Rx", "Option", "pipe", "Capabilities", "LayoutAction", "contributes", "createIntent", "ROOT_ID", "createExtension", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "NAVTREE_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "ROOT_ID", "some", "none", "map", "COMMANDS_DIALOG", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "createIntent", "LayoutAction", "UpdateDialog", "part", "subject", "options", "blockAlign", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "getOrElse"]
|
|
7
7
|
}
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
// src/components/CommandsDialog/CommandsDialog.tsx
|
|
12
12
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
13
13
|
import React, { useMemo, useState } from "react";
|
|
14
|
-
import {
|
|
14
|
+
import { LayoutAction, createIntent, useAppGraph, useIntentDispatcher } from "@dxos/app-framework";
|
|
15
15
|
import { isAction, isActionGroup } from "@dxos/app-graph";
|
|
16
16
|
import { Keyboard, keySymbols } from "@dxos/keyboard";
|
|
17
17
|
import { useActions } from "@dxos/plugin-graph";
|
|
18
|
-
import { Button, Dialog, Icon,
|
|
18
|
+
import { Button, Dialog, Icon, toLocalizedString, useTranslation } from "@dxos/react-ui";
|
|
19
19
|
import { SearchList } from "@dxos/react-ui-searchlist";
|
|
20
20
|
import { cardDialogContent, cardDialogHeader, cardDialogPaddedOverflow, cardDialogSearchListRoot } from "@dxos/react-ui-stack";
|
|
21
21
|
import { descriptionText, mx } from "@dxos/react-ui-theme";
|
|
@@ -121,7 +121,7 @@ var CommandsDialogContent = ({ selected: initial }) => {
|
|
|
121
121
|
// src/components/CommandsDialog/CommandsTrigger.tsx
|
|
122
122
|
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
123
123
|
import React2 from "react";
|
|
124
|
-
import {
|
|
124
|
+
import { LayoutAction as LayoutAction2, createIntent as createIntent2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
125
125
|
import { Button as Button2, Icon as Icon2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
126
126
|
var CommandsTrigger = () => {
|
|
127
127
|
var _effect = _useSignals2();
|
|
@@ -149,7 +149,7 @@ var CommandsTrigger = () => {
|
|
|
149
149
|
};
|
|
150
150
|
|
|
151
151
|
// src/util.ts
|
|
152
|
-
import {
|
|
152
|
+
import { isActionLike } from "@dxos/app-graph";
|
|
153
153
|
import { isNonNullable } from "@dxos/util";
|
|
154
154
|
var getParent = (graph, node, path) => {
|
|
155
155
|
const parentId = path[path.length - 2];
|
|
@@ -199,22 +199,6 @@ var getChildren = (graph, node, path = []) => {
|
|
|
199
199
|
return nextPath.includes(n.id) ? void 0 : n;
|
|
200
200
|
}).filter(isNonNullable);
|
|
201
201
|
};
|
|
202
|
-
var getActions = (graph, node) => {
|
|
203
|
-
return graph.getActions(node.id).reduce((acc, arg) => {
|
|
204
|
-
if (arg.properties.disposition === "item") {
|
|
205
|
-
return acc;
|
|
206
|
-
}
|
|
207
|
-
acc.actions.push(arg);
|
|
208
|
-
if (!isAction2(arg)) {
|
|
209
|
-
const actionGroup = graph.getActions(arg.id);
|
|
210
|
-
acc.groupedActions[arg.id] = actionGroup;
|
|
211
|
-
}
|
|
212
|
-
return acc;
|
|
213
|
-
}, {
|
|
214
|
-
actions: [],
|
|
215
|
-
groupedActions: {}
|
|
216
|
-
});
|
|
217
|
-
};
|
|
218
202
|
var l0ItemType = (item) => {
|
|
219
203
|
if (item.properties.disposition === "collection") {
|
|
220
204
|
return "collection";
|
|
@@ -233,15 +217,23 @@ import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/ad
|
|
|
233
217
|
import { extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
|
|
234
218
|
import { untracked } from "@preact/signals-core";
|
|
235
219
|
import React10, { memo as memo2, useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo6 } from "react";
|
|
236
|
-
import {
|
|
237
|
-
import { isAction as
|
|
220
|
+
import { LayoutAction as LayoutAction3, Surface, createIntent as createIntent3, useAppGraph as useAppGraph2, useCapability, useIntentDispatcher as useIntentDispatcher3, useLayout } from "@dxos/app-framework";
|
|
221
|
+
import { ROOT_ID, isAction as isAction3, isActionLike as isActionLike2 } from "@dxos/app-graph";
|
|
238
222
|
import { PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
|
|
239
|
-
import { useConnections } from "@dxos/plugin-graph";
|
|
223
|
+
import { useConnections, useActions as useGraphActions } from "@dxos/plugin-graph";
|
|
240
224
|
import { useMediaQuery as useMediaQuery2, useSidebars } from "@dxos/react-ui";
|
|
241
225
|
import { isTreeData } from "@dxos/react-ui-list";
|
|
242
226
|
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
243
227
|
import { arrayMove as arrayMove2, byPosition } from "@dxos/util";
|
|
244
228
|
|
|
229
|
+
// src/capabilities/index.ts
|
|
230
|
+
import { lazy } from "@dxos/app-framework";
|
|
231
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-6JDBQ25U.mjs"));
|
|
232
|
+
var IntentResolver = lazy(() => import("./intent-resolver-N35ZIHFD.mjs"));
|
|
233
|
+
var Keyboard2 = lazy(() => import("./keyboard-HMTMA33N.mjs"));
|
|
234
|
+
var ReactSurface = lazy(() => import("./react-surface-5PZ4XJT7.mjs"));
|
|
235
|
+
var State = lazy(() => import("./state-P5DGL7KS.mjs"));
|
|
236
|
+
|
|
245
237
|
// src/components/NavTree/NavTree.tsx
|
|
246
238
|
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
247
239
|
import React9, { useMemo as useMemo5 } from "react";
|
|
@@ -296,7 +288,7 @@ import { attachClosestEdge, extractClosestEdge } from "@atlaskit/pragmatic-drag-
|
|
|
296
288
|
import React4, { forwardRef, useCallback, useLayoutEffect, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
297
289
|
import { invariant } from "@dxos/invariant";
|
|
298
290
|
import { Icon as Icon3, ListItem, ScrollArea, Tooltip, toLocalizedString as toLocalizedString3, useMediaQuery, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
299
|
-
import {
|
|
291
|
+
import { DropdownMenu, MenuProvider } from "@dxos/react-ui-menu";
|
|
300
292
|
import { Tabs } from "@dxos/react-ui-tabs";
|
|
301
293
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
302
294
|
import { arrayMove, getFirstTwoRenderableChars } from "@dxos/util";
|
|
@@ -728,7 +720,7 @@ import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem
|
|
|
728
720
|
// src/components/NavTreeItem/NavTreeItemAction.tsx
|
|
729
721
|
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
730
722
|
import React5 from "react";
|
|
731
|
-
import {
|
|
723
|
+
import { IconButton, toLocalizedString as toLocalizedString4, useDensityContext, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
732
724
|
import { DropdownMenu as DropdownMenu2, MenuProvider as MenuProvider2 } from "@dxos/react-ui-menu";
|
|
733
725
|
import { hoverableControlItem, hoverableOpenControlItem } from "@dxos/react-ui-theme";
|
|
734
726
|
var fallbackIcon = "ph--placeholder--regular";
|
|
@@ -829,17 +821,17 @@ var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) =>
|
|
|
829
821
|
// src/components/NavTreeItem/NavTreeItemColumns.tsx
|
|
830
822
|
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
831
823
|
import React6, { Fragment, memo } from "react";
|
|
832
|
-
import { isAction as
|
|
833
|
-
import { DensityProvider, Popover, toLocalizedString as toLocalizedString5,
|
|
824
|
+
import { isAction as isAction2 } from "@dxos/app-graph";
|
|
825
|
+
import { DensityProvider, Popover, Treegrid, toLocalizedString as toLocalizedString5, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
834
826
|
var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fine" }) => {
|
|
835
827
|
var _effect = _useSignals6();
|
|
836
828
|
try {
|
|
837
829
|
const { t } = useTranslation6(NAVTREE_PLUGIN);
|
|
838
|
-
const {
|
|
830
|
+
const { useActions: useActions3, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();
|
|
839
831
|
const level = path.length - 2;
|
|
840
|
-
const { actions: _actions, groupedActions } =
|
|
832
|
+
const { actions: _actions, groupedActions } = useActions3(item);
|
|
841
833
|
const [primaryAction, ...secondaryActions] = _actions.toSorted((a, _b) => a.properties?.disposition === "list-item-primary" ? -1 : 1);
|
|
842
|
-
const actions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) =>
|
|
834
|
+
const actions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) => isAction2(action) ? [
|
|
843
835
|
action
|
|
844
836
|
] : []).filter((a) => [
|
|
845
837
|
"list-item",
|
|
@@ -847,7 +839,7 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
847
839
|
].includes(a.properties?.disposition));
|
|
848
840
|
const ActionRoot = popoverAnchorId === `dxos.org/ui/${NAV_TREE_ITEM}/${item.id}` ? Popover.Anchor : Fragment;
|
|
849
841
|
useLoadDescendents(item);
|
|
850
|
-
useLoadDescendents(primaryAction && !
|
|
842
|
+
useLoadDescendents(primaryAction && !isAction2(primaryAction) ? primaryAction : void 0);
|
|
851
843
|
return /* @__PURE__ */ React6.createElement(DensityProvider, {
|
|
852
844
|
density
|
|
853
845
|
}, /* @__PURE__ */ React6.createElement("div", {
|
|
@@ -858,8 +850,8 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
858
850
|
label: toLocalizedString5(primaryAction.properties?.label, t),
|
|
859
851
|
icon: primaryAction.properties?.icon ?? "ph--placeholder--regular",
|
|
860
852
|
parent: item,
|
|
861
|
-
monolithic:
|
|
862
|
-
menuActions:
|
|
853
|
+
monolithic: isAction2(primaryAction),
|
|
854
|
+
menuActions: isAction2(primaryAction) ? [
|
|
863
855
|
primaryAction
|
|
864
856
|
] : groupedActions[primaryAction.id],
|
|
865
857
|
menuType: primaryAction.properties?.menuType,
|
|
@@ -996,7 +988,7 @@ var L1PanelHeader = ({ item, path, onBack }) => {
|
|
|
996
988
|
className: "is-6"
|
|
997
989
|
}), /* @__PURE__ */ React7.createElement("h2", {
|
|
998
990
|
className: "flex-1 truncate min-is-0"
|
|
999
|
-
}, title),
|
|
991
|
+
}, title), backCapable && /* @__PURE__ */ React7.createElement(IconButton2, {
|
|
1000
992
|
variant: "ghost",
|
|
1001
993
|
icon: "ph--arrow-u-down-left--regular",
|
|
1002
994
|
iconOnly: true,
|
|
@@ -1021,7 +1013,7 @@ var L1PanelHeader = ({ item, path, onBack }) => {
|
|
|
1021
1013
|
"pointer-fine:pli-1"
|
|
1022
1014
|
],
|
|
1023
1015
|
onClick: handleOpen
|
|
1024
|
-
})
|
|
1016
|
+
}), /* @__PURE__ */ React7.createElement(NavTreeItemColumns, {
|
|
1025
1017
|
open: true,
|
|
1026
1018
|
path,
|
|
1027
1019
|
item,
|
|
@@ -1164,14 +1156,6 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1164
1156
|
}
|
|
1165
1157
|
};
|
|
1166
1158
|
|
|
1167
|
-
// src/capabilities/index.ts
|
|
1168
|
-
import { lazy } from "@dxos/app-framework";
|
|
1169
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-5J4LRWDX.mjs"));
|
|
1170
|
-
var IntentResolver = lazy(() => import("./intent-resolver-3XYN2CBU.mjs"));
|
|
1171
|
-
var Keyboard2 = lazy(() => import("./keyboard-QRS6WOQH.mjs"));
|
|
1172
|
-
var ReactSurface = lazy(() => import("./react-surface-JSJ5SQX5.mjs"));
|
|
1173
|
-
var State = lazy(() => import("./state-54DY3DOY.mjs"));
|
|
1174
|
-
|
|
1175
1159
|
// src/components/NavTreeContainer.tsx
|
|
1176
1160
|
var NODE_TYPE = "dxos/app-graph/node";
|
|
1177
1161
|
var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Surface, {
|
|
@@ -1183,12 +1167,12 @@ var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Su
|
|
|
1183
1167
|
},
|
|
1184
1168
|
limit: 1
|
|
1185
1169
|
});
|
|
1186
|
-
var getChildrenFilter = (node) => untracked(() => !isActionLike2(node) && node.type !== PLANK_COMPANION_TYPE);
|
|
1170
|
+
var getChildrenFilter = (node) => untracked(() => !isActionLike2(node) && node.type !== PLANK_COMPANION_TYPE && node.properties.disposition !== "hidden");
|
|
1187
1171
|
var filterItems = (node, disposition) => {
|
|
1188
1172
|
if (!disposition && (node.properties.disposition === "hidden" || node.properties.disposition === "alternate-tree")) {
|
|
1189
1173
|
return false;
|
|
1190
1174
|
} else if (!disposition) {
|
|
1191
|
-
const action =
|
|
1175
|
+
const action = isAction3(node);
|
|
1192
1176
|
return !action || node.properties.disposition === "item";
|
|
1193
1177
|
} else {
|
|
1194
1178
|
return node.properties.disposition === disposition;
|
|
@@ -1203,6 +1187,26 @@ var useItems = (node, options) => {
|
|
|
1203
1187
|
const filtered = connections.filter((node2) => filterItems(node2, options?.disposition));
|
|
1204
1188
|
return options?.sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
|
|
1205
1189
|
};
|
|
1190
|
+
var useActions2 = (node) => {
|
|
1191
|
+
const { graph } = useAppGraph2();
|
|
1192
|
+
const actions = useGraphActions(graph, node.id);
|
|
1193
|
+
return useMemo6(() => actions.reduce((acc, arg) => {
|
|
1194
|
+
if (arg.properties.disposition === "item") {
|
|
1195
|
+
return acc;
|
|
1196
|
+
}
|
|
1197
|
+
acc.actions.push(arg);
|
|
1198
|
+
if (!isAction3(arg)) {
|
|
1199
|
+
const actionGroup = graph.getActions(arg.id);
|
|
1200
|
+
acc.groupedActions[arg.id] = actionGroup;
|
|
1201
|
+
}
|
|
1202
|
+
return acc;
|
|
1203
|
+
}, {
|
|
1204
|
+
actions: [],
|
|
1205
|
+
groupedActions: {}
|
|
1206
|
+
}), [
|
|
1207
|
+
actions
|
|
1208
|
+
]);
|
|
1209
|
+
};
|
|
1206
1210
|
var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar }) => {
|
|
1207
1211
|
var _effect = _useSignals10();
|
|
1208
1212
|
try {
|
|
@@ -1214,9 +1218,6 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1214
1218
|
const { isOpen, isCurrent, isAlternateTree, setItem } = useCapability(NavTreeCapabilities.State);
|
|
1215
1219
|
const layout = useLayout();
|
|
1216
1220
|
const { navigationSidebarState } = useSidebars(NAVTREE_PLUGIN);
|
|
1217
|
-
const getActions2 = useCallback3((node) => getActions(graph, node), [
|
|
1218
|
-
graph
|
|
1219
|
-
]);
|
|
1220
1221
|
const getProps = useCallback3((node, path) => {
|
|
1221
1222
|
const children = getChildren(graph, node, path).filter(getChildrenFilter);
|
|
1222
1223
|
const parentOf = children.length > 0 ? children.map(({ id }) => id) : node.properties.role === "branch" ? [] : void 0;
|
|
@@ -1283,7 +1284,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1283
1284
|
if (!node.data) {
|
|
1284
1285
|
return;
|
|
1285
1286
|
}
|
|
1286
|
-
if (
|
|
1287
|
+
if (isAction3(node)) {
|
|
1287
1288
|
const [parent] = graph.getConnections(node.id, "inbound");
|
|
1288
1289
|
void (parent && node.data({
|
|
1289
1290
|
parent,
|
|
@@ -1319,7 +1320,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1319
1320
|
}));
|
|
1320
1321
|
}
|
|
1321
1322
|
const defaultAction = graph.getActions(node.id).find((action) => action.properties?.disposition === "default");
|
|
1322
|
-
if (
|
|
1323
|
+
if (isAction3(defaultAction)) {
|
|
1323
1324
|
void defaultAction.data();
|
|
1324
1325
|
}
|
|
1325
1326
|
if (!isLg) {
|
|
@@ -1402,7 +1403,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1402
1403
|
const navTreeContextValue = useMemo6(() => ({
|
|
1403
1404
|
useItems,
|
|
1404
1405
|
tab,
|
|
1405
|
-
|
|
1406
|
+
useActions: useActions2,
|
|
1406
1407
|
loadDescendents,
|
|
1407
1408
|
renderItemEnd,
|
|
1408
1409
|
popoverAnchorId,
|
|
@@ -1419,7 +1420,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1419
1420
|
onBack: handleBack
|
|
1420
1421
|
}), [
|
|
1421
1422
|
tab,
|
|
1422
|
-
|
|
1423
|
+
useActions2,
|
|
1423
1424
|
loadDescendents,
|
|
1424
1425
|
renderItemEnd,
|
|
1425
1426
|
popoverAnchorId,
|
|
@@ -1455,7 +1456,6 @@ export {
|
|
|
1455
1456
|
resolveMigrationOperation,
|
|
1456
1457
|
sortActions,
|
|
1457
1458
|
getChildren,
|
|
1458
|
-
getActions,
|
|
1459
1459
|
l0ItemType,
|
|
1460
1460
|
NODE_TYPE,
|
|
1461
1461
|
NavTreeContainer,
|
|
@@ -1466,4 +1466,4 @@ export {
|
|
|
1466
1466
|
ReactSurface,
|
|
1467
1467
|
State
|
|
1468
1468
|
};
|
|
1469
|
-
//# sourceMappingURL=chunk-
|
|
1469
|
+
//# sourceMappingURL=chunk-ZKVY35IG.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/CommandsDialog/CommandsDialog.tsx", "../../../src/components/CommandsDialog/CommandsTrigger.tsx", "../../../src/util.ts", "../../../src/components/NavTreeContainer.tsx", "../../../src/capabilities/index.ts", "../../../src/components/NavTree/NavTree.tsx", "../../../src/hooks.ts", "../../../src/components/NavTreeContext.tsx", "../../../src/components/NavTreeDocumentTitle.tsx", "../../../src/components/Sidebar/L0Menu.tsx", "../../../src/components/UserAccountAvatar/UserAccountAvatar.tsx", "../../../src/components/Sidebar/L1Panel.tsx", "../../../src/components/NavTreeItem/NavTreeItemAction.tsx", "../../../src/components/NavTreeItem/NavTreeItemColumns.tsx", "../../../src/components/Sidebar/L1Tabs.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useMemo, useState } from 'react';\n\nimport { LayoutAction, createIntent, useAppGraph, useIntentDispatcher } from '@dxos/app-framework';\nimport { type ActionLike, isAction, isActionGroup } from '@dxos/app-graph';\nimport { Keyboard, keySymbols } from '@dxos/keyboard';\nimport { useActions } from '@dxos/plugin-graph';\nimport { Button, Dialog, Icon, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { SearchList } from '@dxos/react-ui-searchlist';\nimport {\n cardDialogContent,\n cardDialogHeader,\n cardDialogPaddedOverflow,\n cardDialogSearchListRoot,\n} from '@dxos/react-ui-stack';\nimport { descriptionText, mx } from '@dxos/react-ui-theme';\nimport { getHostPlatform } from '@dxos/util';\n\nimport { KEY_BINDING, NAVTREE_PLUGIN } from '../../meta';\n\n// TODO(wittjosiah): This probably deserves its own plugin but for now it lives here w/ other navigation UI.\nexport const CommandsDialogContent = ({ selected: initial }: { selected?: string }) => {\n const { t } = useTranslation(NAVTREE_PLUGIN);\n const [selected, setSelected] = useState<string | undefined>(initial);\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const { graph } = useAppGraph();\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: ActionLike[] = [];\n graph.traverse({\n visitor: (node, path) => {\n if (\n (isAction(node) || isActionGroup(node)) &&\n !actionMap.has(node.id) &&\n current.startsWith(path.slice(0, -1).join('/'))\n ) {\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 = isActionGroup(group) ? groupActions : allActions;\n\n return (\n <Dialog.Content classNames={cardDialogContent}>\n <Dialog.Title classNames={cardDialogHeader}>{t('commands dialog title', { ns: NAVTREE_PLUGIN })}</Dialog.Title>\n\n {/* TODO(burdon): BUG: Overscrolls container. */}\n <SearchList.Root label={t('command list input placeholder')} classNames={cardDialogSearchListRoot}>\n <SearchList.Input placeholder={t('command list input placeholder')} />\n <SearchList.Content classNames={cardDialogPaddedOverflow}>\n {actions?.map((action) => {\n const label = toLocalizedString(action.properties.label, t);\n const shortcut =\n typeof action.properties.keyBinding === 'string'\n ? action.properties.keyBinding\n : action.properties.keyBinding?.[getHostPlatform()];\n return (\n <SearchList.Item\n value={label}\n key={action.id}\n onSelect={() => {\n if (action.properties.disabled) {\n return;\n }\n\n if (isActionGroup(action)) {\n setSelected(action.id);\n return;\n }\n\n void dispatch(createIntent(LayoutAction.UpdateDialog, { part: 'dialog', options: { state: false } }));\n setTimeout(() => {\n const node = graph.getConnections(group?.id ?? action.id, 'inbound')[0];\n void (node && isAction(action) && action.data({ parent: node, caller: KEY_BINDING }));\n });\n }}\n classNames='flex items-center gap-2'\n disabled={action.properties.disabled}\n {...(action.properties?.testId && { 'data-testid': action.properties.testId })}\n >\n <Icon icon={action.properties.icon} size={4} />\n <span className='grow truncate'>{label}</span>\n {shortcut && <span className={mx('shrink-0', descriptionText)}>{keySymbols(shortcut).join('')}</span>}\n </SearchList.Item>\n );\n })}\n </SearchList.Content>\n </SearchList.Root>\n\n <div role='none' className='pli-cardSpacingInline pbe-cardSpacingBlock'>\n <Dialog.Close asChild>\n <Button classNames='is-full'>{t('close label', { ns: 'os' })}</Button>\n </Dialog.Close>\n </div>\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { Button, Icon, useTranslation } from '@dxos/react-ui';\n\nimport { COMMANDS_DIALOG, NAVTREE_PLUGIN } from '../../meta';\n\n// TODO(thure): Refactor to be handled by a more appropriate plugin.\nexport const CommandsTrigger = () => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const { t } = useTranslation(NAVTREE_PLUGIN);\n return (\n <Button\n classNames='m-1 pli-1 lg:pli-2'\n onClick={() =>\n dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: COMMANDS_DIALOG,\n options: {\n blockAlign: 'start',\n },\n }),\n )\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' size={5} />\n </Button>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Action, type Node, type ReadableGraph, isActionLike } from '@dxos/app-graph';\nimport { isNonNullable } from '@dxos/util';\n\nimport { type NavTreeItemGraphNode } from './types';\n\nexport const getParent = (\n graph: ReadableGraph,\n node: NavTreeItemGraphNode,\n path: string[],\n): NavTreeItemGraphNode | undefined => {\n const parentId = path[path.length - 2];\n return graph.getConnections(node.id, 'inbound').find((n) => n.id === parentId) as NavTreeItemGraphNode | undefined;\n};\n\nexport const getPersistenceParent = (\n graph: ReadableGraph,\n node: NavTreeItemGraphNode,\n path: string[],\n persistenceClass: string,\n): NavTreeItemGraphNode | null => {\n if (node.properties.acceptPersistenceClass?.has(persistenceClass)) {\n return node;\n } else {\n const parent = getParent(graph, node, path);\n return parent ? getPersistenceParent(graph, parent, path.slice(0, path.length - 1), persistenceClass) : null;\n }\n};\n\nexport const resolveMigrationOperation = (\n graph: ReadableGraph,\n activeNode: NavTreeItemGraphNode,\n destinationPath: string[],\n destinationRelatedNode?: NavTreeItemGraphNode,\n): 'transfer' | 'copy' | 'reject' => {\n const activeClass = activeNode.properties.persistenceClass;\n if (destinationRelatedNode && activeClass) {\n const persistenceParent = getPersistenceParent(graph, destinationRelatedNode, destinationPath, activeClass);\n if (persistenceParent) {\n const activeKey = activeNode.properties.persistenceKey;\n if (activeKey && persistenceParent?.properties.acceptPersistenceKey) {\n return persistenceParent.properties.acceptPersistenceKey.has(activeKey) &&\n persistenceParent.properties.onTransferStart\n ? 'transfer'\n : persistenceParent.properties.onCopy\n ? 'copy'\n : 'reject';\n } else {\n return 'reject';\n }\n } else {\n return 'reject';\n }\n } else {\n return 'reject';\n }\n};\n\n// TODO(wittjosiah): Move into node implementation?\nexport const sortActions = (actions: Action[]): Action[] =>\n actions.sort((a, b) => {\n if (a.properties.disposition === b.properties.disposition) {\n return 0;\n }\n\n if (a.properties.disposition === 'list-item-primary') {\n return -1;\n }\n\n return 1;\n });\n\nexport const getChildren = (\n graph: ReadableGraph,\n node: NavTreeItemGraphNode,\n path: readonly string[] = [],\n): NavTreeItemGraphNode[] => {\n return graph\n .getConnections(node.id, 'outbound')\n .map((n) => {\n // Break cycles.\n const nextPath = [...path, node.id];\n return nextPath.includes(n.id) ? undefined : (n as NavTreeItemGraphNode);\n })\n .filter(isNonNullable) as NavTreeItemGraphNode[];\n};\n\nexport const l0ItemType = (item: Node<any>) => {\n if (item.properties.disposition === 'collection') {\n return 'collection';\n } else if (isActionLike(item)) {\n return 'action';\n } else if (item.properties.disposition === 'navigation') {\n return 'link';\n } else {\n return 'tab';\n }\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { type Instruction, extractInstruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\nimport { untracked } from '@preact/signals-core';\nimport React, { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport {\n LayoutAction,\n Surface,\n createIntent,\n useAppGraph,\n useCapability,\n useIntentDispatcher,\n useLayout,\n} from '@dxos/app-framework';\nimport { type Node, ROOT_ID, type ReadableGraph, isAction, isActionLike } from '@dxos/app-graph';\nimport { PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';\nimport { useConnections, useActions as useGraphActions } from '@dxos/plugin-graph';\nimport { useMediaQuery, useSidebars } from '@dxos/react-ui';\nimport { type TreeData, type TreeItemDataProps, isTreeData } from '@dxos/react-ui-list';\nimport { mx } from '@dxos/react-ui-theme';\nimport { arrayMove, byPosition } from '@dxos/util';\n\nimport { NavTreeCapabilities } from '../capabilities';\nimport { NAVTREE_PLUGIN } from '../meta';\nimport { type FlattenedActions, type NavTreeItemGraphNode } from '../types';\nimport { getChildren, getParent, resolveMigrationOperation } from '../util';\n\nimport { NAV_TREE_ITEM, NavTree } from './NavTree';\nimport { NavTreeContext } from './NavTreeContext';\nimport { type NavTreeContextValue } from './types';\n\n// TODO(thure): Is NavTree truly authoritative in this regard?\nexport const NODE_TYPE = 'dxos/app-graph/node';\n\nconst renderItemEnd = ({ node, open }: { node: Node; open: boolean }) => (\n <Surface role='navtree-item-end' data={{ id: node.id, subject: node.data, open }} limit={1} />\n);\n\nconst getChildrenFilter = (node: Node): node is Node =>\n untracked(\n () => !isActionLike(node) && node.type !== PLANK_COMPANION_TYPE && node.properties.disposition !== 'hidden',\n );\n\nconst filterItems = (node: Node, disposition?: string) => {\n if (!disposition && (node.properties.disposition === 'hidden' || node.properties.disposition === 'alternate-tree')) {\n return false;\n } else if (!disposition) {\n const action = isAction(node);\n return !action || node.properties.disposition === 'item';\n } else {\n return node.properties.disposition === disposition;\n }\n};\n\nconst getItems = (graph: ReadableGraph, node?: Node, disposition?: string) => {\n return graph.getConnections(node?.id ?? ROOT_ID, 'outbound').filter((node) => filterItems(node, disposition));\n};\n\nconst useItems = (node?: Node, options?: { disposition?: string; sort?: boolean }) => {\n const { graph } = useAppGraph();\n const connections = useConnections(graph, node?.id ?? ROOT_ID);\n const filtered = connections.filter((node) => filterItems(node, options?.disposition));\n return options?.sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;\n};\n\nconst useActions = (node: Node): FlattenedActions => {\n const { graph } = useAppGraph();\n const actions = useGraphActions(graph, node.id);\n\n return useMemo(\n () =>\n actions.reduce(\n (acc: FlattenedActions, arg) => {\n if (arg.properties.disposition === 'item') {\n return acc;\n }\n\n acc.actions.push(arg);\n if (!isAction(arg)) {\n const actionGroup = graph.getActions(arg.id);\n acc.groupedActions[arg.id] = actionGroup;\n }\n return acc;\n },\n { actions: [], groupedActions: {} },\n ),\n [actions],\n );\n};\n\nexport type NavTreeContainerProps = {\n popoverAnchorId?: string;\n topbar?: boolean;\n} & Pick<NavTreeContextValue, 'tab'>;\n\nexport const NavTreeContainer = memo(({ tab, popoverAnchorId, topbar }: NavTreeContainerProps) => {\n const [isLg] = useMediaQuery('lg', { ssr: false });\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const { graph } = useAppGraph();\n const { isOpen, isCurrent, isAlternateTree, setItem } = useCapability(NavTreeCapabilities.State);\n const layout = useLayout();\n const { navigationSidebarState } = useSidebars(NAVTREE_PLUGIN);\n\n const getProps = useCallback(\n (node: Node, path: string[]): TreeItemDataProps => {\n const children = getChildren(graph, node, path).filter(getChildrenFilter);\n const parentOf =\n children.length > 0 ? children.map(({ id }) => id) : node.properties.role === 'branch' ? [] : undefined;\n return {\n id: node.id,\n label: node.properties.label ?? node.id,\n parentOf,\n icon: node.properties.icon,\n disabled: node.properties.disabled,\n className: mx(node.properties.modified && 'italic', node.properties.className),\n headingClassName: node.properties.headingClassName,\n testId: node.properties.testId,\n };\n },\n [graph],\n );\n\n const loadDescendents = useCallback(\n (node: Node) => {\n graph.expand(node.id, 'outbound');\n // Load one level deeper, which resolves some juddering observed on open/close.\n graph.getConnections(node.id, 'outbound').forEach((child) => {\n graph.expand(child.id, 'outbound');\n });\n },\n [graph],\n );\n\n const handleOpenChange = useCallback(\n ({ item: { id }, path, open }: { item: Node; path: string[]; open: boolean }) => {\n // TODO(thure): This might become a localstorage leak; openItemIds that no longer exist should be removed from this map.\n setItem(path, 'open', open);\n graph.expand(id, 'outbound');\n },\n [graph],\n );\n\n const handleTabChange = useCallback(\n async (node: NavTreeItemGraphNode) => {\n await dispatch(\n createIntent(LayoutAction.UpdateSidebar, {\n part: 'sidebar',\n options: {\n state:\n node.id === tab\n ? navigationSidebarState === 'expanded'\n ? isLg\n ? 'collapsed'\n : 'closed'\n : 'expanded'\n : 'expanded',\n },\n }),\n );\n\n await dispatch(createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: node.id }));\n\n // Open the first item if the workspace is empty.\n if (layout.active.length === 0) {\n const [item] = getItems(graph, node).filter((node) => !isActionLike(node));\n if (item && item.data) {\n await dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [item.id] }));\n }\n }\n },\n [dispatch, layout.active, tab, navigationSidebarState, isLg],\n );\n\n const canDrop = useCallback(({ source, target }: { source: TreeData; target: TreeData }) => {\n return target.item.properties.canDrop?.(source) ?? false;\n }, []);\n\n const handleSelect = useCallback(\n ({ item: node, path, option }: { item: Node; path: string[]; option: boolean }) => {\n if (!node.data) {\n return;\n }\n\n if (isAction(node)) {\n const [parent] = graph.getConnections(node.id, 'inbound');\n void (parent && node.data({ parent, caller: NAV_TREE_ITEM }));\n return;\n }\n\n const current = isCurrent(path, node);\n if (!current) {\n void dispatch(\n createIntent(LayoutAction.Open, {\n part: 'main',\n subject: [node.id],\n options: { key: node.properties.key },\n }),\n );\n } else if (option) {\n void dispatch(\n createIntent(LayoutAction.Close, { part: 'main', subject: [node.id], options: { state: false } }),\n );\n } else {\n void dispatch(createIntent(LayoutAction.ScrollIntoView, { part: 'current', subject: node.id }));\n }\n\n const defaultAction = graph.getActions(node.id).find((action) => action.properties?.disposition === 'default');\n if (isAction(defaultAction)) {\n void (defaultAction.data as () => void)();\n }\n\n if (!isLg) {\n void dispatch(createIntent(LayoutAction.UpdateSidebar, { part: 'sidebar', options: { state: 'closed' } }));\n }\n },\n [graph, dispatch, isCurrent, isLg],\n );\n\n const handleBack = useCallback(\n () => dispatch(createIntent(LayoutAction.RevertWorkspace, { part: 'workspace', options: { revert: true } })),\n [dispatch],\n );\n\n // TODO(wittjosiah): Factor out hook.\n useEffect(() => {\n return monitorForElements({\n canMonitor: ({ source }) => isTreeData(source.data),\n onDrop: ({ location, source }) => {\n // Didn't drop on anything.\n if (!location.current.dropTargets.length) {\n return;\n }\n const target = location.current.dropTargets[0];\n const instruction: Instruction | null = extractInstruction(target.data);\n if (instruction !== null && instruction.type !== 'instruction-blocked') {\n const sourceNode = source.data.item as NavTreeItemGraphNode;\n const targetNode = target.data.item as NavTreeItemGraphNode;\n const sourcePath = source.data.path as string[];\n const targetPath = target.data.path as string[];\n const operation =\n sourcePath.slice(0, -1).join() === targetPath.slice(0, -1).join() && instruction.type !== 'make-child'\n ? 'rearrange'\n : resolveMigrationOperation(graph, sourceNode, targetPath, targetNode);\n const sourceParent = getParent(graph, sourceNode, sourcePath);\n const targetParent = getParent(graph, targetNode, targetPath);\n const sourceItems = getItems(graph, sourceParent);\n const targetItems = getItems(graph, targetParent);\n const sourceIndex = sourceItems.findIndex(({ id }) => id === sourceNode.id);\n const targetIndex = targetItems.findIndex(({ id }) => id === targetNode.id);\n const migrationIndex =\n instruction.type === 'make-child'\n ? undefined\n : instruction.type === 'reorder-below'\n ? targetIndex + 1\n : targetIndex;\n switch (operation) {\n case 'rearrange': {\n const nextItems = sourceItems.map(({ data }) => data);\n arrayMove(nextItems, sourceIndex, targetIndex);\n void sourceParent?.properties.onRearrangeChildren?.(nextItems);\n break;\n }\n case 'copy': {\n const target = instruction.type === 'make-child' ? targetNode : targetParent;\n void target?.properties.onCopy?.(sourceNode, migrationIndex);\n break;\n }\n case 'transfer': {\n const target = instruction.type === 'make-child' ? targetNode : targetParent;\n if (!target?.properties.onTransferStart || !sourceParent?.properties.onTransferEnd) {\n break;\n }\n void target?.properties.onTransferStart(sourceNode, migrationIndex);\n void sourceParent?.properties.onTransferEnd?.(sourceNode, target);\n break;\n }\n }\n }\n },\n });\n }, [graph]);\n\n const setAlternateTree = useCallback(\n (path: string[], open: boolean) => {\n setItem(path, 'alternateTree', open);\n },\n [setItem],\n );\n\n const navTreeContextValue = useMemo(\n () => ({\n useItems,\n tab,\n useActions,\n loadDescendents,\n renderItemEnd,\n popoverAnchorId,\n topbar,\n getProps,\n isCurrent,\n isOpen,\n canDrop,\n isAlternateTree,\n setAlternateTree,\n onTabChange: handleTabChange,\n onOpenChange: handleOpenChange,\n onSelect: handleSelect,\n onBack: handleBack,\n }),\n [\n tab,\n useActions,\n loadDescendents,\n renderItemEnd,\n popoverAnchorId,\n topbar,\n getProps,\n isCurrent,\n isOpen,\n canDrop,\n isAlternateTree,\n setAlternateTree,\n handleTabChange,\n handleOpenChange,\n handleSelect,\n handleBack,\n ],\n );\n\n return (\n <NavTreeContext.Provider value={navTreeContextValue}>\n <NavTree id={ROOT_ID} root={graph.root} open={layout.sidebarOpen} />\n </NavTreeContext.Provider>\n );\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const Keyboard = lazy(() => import('./keyboard'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\nexport const State = lazy(() => import('./state'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useMemo } from 'react';\n\nimport { type TreeProps } from '@dxos/react-ui-list';\nimport { Tabs } from '@dxos/react-ui-tabs';\n\nimport { useLoadDescendents } from '../../hooks';\nimport { type NavTreeItemGraphNode } from '../../types';\nimport { useNavTreeContext } from '../NavTreeContext';\nimport { L0Menu, L1Tabs, type L1TabsProps } from '../Sidebar';\n\nexport const NAV_TREE_ITEM = 'NavTreeItem';\n\nexport type NavTreeProps = Pick<TreeProps<NavTreeItemGraphNode>, 'id' | 'root'> & Pick<L1TabsProps, 'open'>;\n\nexport const NavTree = ({ id, root, ...props }: NavTreeProps) => {\n const { tab, useItems, onBack } = useNavTreeContext();\n const topLevelActions = useItems(root, { disposition: 'menu', sort: true });\n const topLevelCollections = useItems(root, { disposition: 'collection' });\n const topLevelWorkspaces = useItems(root, { disposition: 'workspace' });\n const topLevelNavigation = useItems(root, { disposition: 'navigation' });\n const l0Items = useMemo(\n () => [\n // prettier-ignore\n ...topLevelCollections,\n ...topLevelWorkspaces,\n ...topLevelNavigation,\n ],\n [topLevelCollections, topLevelWorkspaces, topLevelNavigation],\n );\n const pinnedItems = useItems(root, { disposition: 'pin-end', sort: true });\n const userAccountItem = useItems(root, { disposition: 'user-account' })[0];\n const topLevelItems = useMemo(\n () => [\n // prettier-ignore\n ...l0Items,\n ...pinnedItems,\n ...(userAccountItem ? [userAccountItem] : []),\n ],\n [l0Items, pinnedItems, userAccountItem],\n );\n\n useLoadDescendents(root);\n const path = useMemo(() => [id], [id]);\n\n return (\n <Tabs.Root value={tab} orientation='vertical' verticalVariant='stateless' classNames='relative'>\n <L0Menu\n menuActions={topLevelActions}\n topLevelItems={l0Items}\n pinnedItems={pinnedItems}\n userAccountItem={userAccountItem}\n path={path}\n parent={root}\n />\n <L1Tabs topLevelItems={topLevelItems} path={path} currentItemId={tab} onBack={onBack} {...props} />\n </Tabs.Root>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { type Node } from '@dxos/app-graph';\n\nimport { useNavTreeContext } from './components';\n\nexport const useLoadDescendents = (root?: Node) => {\n const { loadDescendents } = useNavTreeContext();\n useEffect(() => {\n const frame = requestAnimationFrame(() => {\n if (root) {\n void loadDescendents?.(root);\n }\n });\n return () => cancelAnimationFrame(frame);\n }, [root]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { type NavTreeContextValue } from './types';\n\nexport const NavTreeContext = createContext<NavTreeContextValue | null>(null);\n\nexport const useNavTreeContext = () => useContext(NavTreeContext) ?? raise(new Error('Missing NavTreeContext'));\n", "//\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';\n\nimport { NAVTREE_PLUGIN } from '../meta';\n\nexport const NavTreeDocumentTitle = ({ node }: { node?: Node }) => {\n const { t } = useTranslation(NAVTREE_PLUGIN);\n useEffect(() => {\n document.title = node ? toLocalizedString(node.properties.label, t) : t('current app name', { ns: 'appkit' });\n }, [node?.properties?.label]);\n return null;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source';\nimport { scrollJustEnoughIntoView } from '@atlaskit/pragmatic-drag-and-drop/element/scroll-just-enough-into-view';\nimport {\n type Edge,\n attachClosestEdge,\n extractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport React, {\n type MouseEvent,\n type PropsWithChildren,\n forwardRef,\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type Node } from '@dxos/app-graph';\nimport { invariant } from '@dxos/invariant';\nimport { Icon, ListItem, ScrollArea, Tooltip, toLocalizedString, useMediaQuery, useTranslation } from '@dxos/react-ui';\nimport { DropdownMenu, type MenuItem, MenuProvider } from '@dxos/react-ui-menu';\nimport type { StackItemRearrangeHandler } from '@dxos/react-ui-stack';\nimport { Tabs } from '@dxos/react-ui-tabs';\nimport { mx } from '@dxos/react-ui-theme';\nimport { arrayMove, getFirstTwoRenderableChars } from '@dxos/util';\n\nimport { useLoadDescendents } from '../../hooks';\nimport { NAVTREE_PLUGIN } from '../../meta';\nimport { l0ItemType } from '../../util';\nimport { useNavTreeContext } from '../NavTreeContext';\nimport { UserAccountAvatar } from '../UserAccountAvatar';\n\n//\n// L0Item\n//\n\ntype L0ItemData = {\n id: L0ItemProps['item']['id'];\n type: 'l0Item';\n};\n\ntype L0ItemRootProps = {\n item: Node<any>;\n parent?: Node<any>;\n path: string[];\n};\n\ntype L0ItemProps = L0ItemRootProps & {\n item: Node<any>;\n parent?: Node<any>;\n path: string[];\n pinned?: boolean;\n onRearrange?: StackItemRearrangeHandler<L0ItemData>;\n};\n\nconst useL0ItemClick = ({ item, parent, path }: L0ItemProps, type: string) => {\n const { tab, isCurrent, onSelect, onTabChange } = useNavTreeContext();\n const [isLg] = useMediaQuery('lg', { ssr: false });\n\n return useCallback(\n (event: MouseEvent) => {\n switch (type) {\n case 'action': {\n const {\n data: invoke,\n properties: { caller },\n } = item;\n\n return invoke?.(caller ? { node: parent, caller } : { node: parent });\n }\n\n case 'tab':\n return onTabChange?.(item);\n\n case 'link':\n return onSelect?.({ item, path, current: !isCurrent(path, item), option: event.altKey });\n }\n },\n [item, parent, type, tab, isCurrent, onSelect, onTabChange, isLg],\n );\n};\n\nconst l0Breakpoints: Record<string, string> = {\n lg: 'hidden lg:grid',\n};\n\nconst l0ItemRoot =\n 'group/l0item flex w-full justify-center items-center relative data[type!=\"collection\"]:cursor-pointer app-no-drag dx-focus-ring-group';\n\nconst l0ItemContent = 'flex justify-center items-center dx-focus-ring-group-indicator transition-colors rounded-sm';\n\nconst L0ItemRoot = forwardRef<HTMLElement, PropsWithChildren<L0ItemRootProps>>(\n ({ item, parent, path, children }, forwardedRef) => {\n const { getProps } = useNavTreeContext();\n const { id, testId } = getProps?.(item, path) ?? {};\n const type = l0ItemType(item);\n const itemPath = useMemo(() => [...path, item.id], [item.id, path]);\n\n const { t } = useTranslation(NAVTREE_PLUGIN);\n const localizedString = toLocalizedString(item.properties.label, t);\n\n const handleClick = useL0ItemClick({ item, parent, path: itemPath }, type);\n const rootProps =\n type === 'tab'\n ? { value: item.id, tabIndex: 0, onClick: handleClick, 'data-testid': testId, 'data-itemid': id }\n : type !== 'collection'\n ? { onClick: handleClick, 'data-testid': testId, 'data-itemid': id }\n : { onClick: handleClick };\n\n const Root = type === 'collection' ? 'h2' : type === 'tab' ? Tabs.TabPrimitive : 'button';\n\n return (\n <Tooltip.Trigger asChild delayDuration={0} side='right' content={localizedString}>\n <Root\n {...(rootProps as any)}\n data-type={type}\n className={mx(l0ItemRoot, l0Breakpoints[item.properties.l0Breakpoint])}\n ref={forwardedRef}\n >\n {children}\n </Root>\n </Tooltip.Trigger>\n );\n },\n);\n\nconst L0Avatar = ({ item }: Pick<L0ItemProps, 'item'>) => {\n const { t } = useTranslation(NAVTREE_PLUGIN);\n const type = l0ItemType(item);\n const hue = item.properties.hue ?? null;\n const hueFgStyle = hue && { style: { color: `var(--dx-${hue}SurfaceText)` } };\n const localizedString = toLocalizedString(item.properties.label, t);\n const avatarValue = useMemo(\n () => (type === 'tab' ? getFirstTwoRenderableChars(localizedString).join('').toUpperCase() : []),\n [type, item.properties.label, t],\n );\n\n return (\n <span role='img' className='place-self-center text-xl font-light' {...hueFgStyle}>\n {avatarValue}\n </span>\n );\n};\n\n// TODO(burdon): Factor out pinned (non-draggable) items.\nconst L0Item = ({ item, parent, path, pinned, onRearrange }: L0ItemProps) => {\n const { t } = useTranslation(NAVTREE_PLUGIN);\n const itemElement = useRef<HTMLElement | null>(null);\n const [closestEdge, setEdge] = useState<Edge | null>(null);\n const localizedString = toLocalizedString(item.properties.label, t);\n const hue = item.properties.hue ?? null;\n\n useLayoutEffect(() => {\n // NOTE(thure): This is copied from StackItem, perhaps this should be DRYed out.\n if (!itemElement.current || !onRearrange) {\n return;\n }\n\n return combine(\n draggable({\n element: itemElement.current,\n getInitialData: () => ({ id: item.id, type: 'l0Item' }) satisfies L0ItemData,\n onGenerateDragPreview: ({ nativeSetDragImage, source, location }) => {\n document.body.setAttribute('data-drag-preview', 'true');\n const element = source.element.querySelector('[data-frame]') as HTMLElement;\n scrollJustEnoughIntoView({ element });\n const { x, y } = preserveOffsetOnSource({ element, input: location.current.input })({\n container: (element.offsetParent ?? document.body) as HTMLElement,\n });\n nativeSetDragImage?.(element, x, y);\n },\n onDragStart: () => {\n document.body.removeAttribute('data-drag-preview');\n itemElement.current!.closest('[data-drag-autoscroll]')?.setAttribute('data-drag-autoscroll', 'active');\n },\n onDrop: () => {\n itemElement.current!.closest('[data-drag-autoscroll]')?.setAttribute('data-drag-autoscroll', 'idle');\n },\n }),\n dropTargetForElements({\n element: itemElement.current,\n getData: ({ input, element }) => {\n return attachClosestEdge(\n { id: item.id, type: 'l0Item' },\n { input, element, allowedEdges: ['top', 'bottom'] },\n );\n },\n onDragEnter: ({ self, source }) => {\n if (source.data.type === self.data.type) {\n setEdge(extractClosestEdge(self.data));\n }\n },\n onDrag: ({ self, source }) => {\n if (source.data.type === self.data.type) {\n setEdge(extractClosestEdge(self.data));\n }\n },\n onDragLeave: () => setEdge(null),\n onDrop: ({ self, source }) => {\n setEdge(null);\n if (source.data.type === self.data.type) {\n onRearrange(source.data as L0ItemData, self.data as L0ItemData, extractClosestEdge(self.data));\n }\n },\n }),\n );\n }, [item, onRearrange]);\n\n return (\n <L0ItemRoot ref={itemElement} item={item} parent={parent} path={path}>\n <div\n role='none'\n data-frame={true}\n {...(hue && { style: { background: `var(--dx-${hue}Surface)` } })}\n className={mx(\n l0ItemContent,\n pinned\n ? 'p-2 group-hover/l0item:bg-activeSurface'\n : 'is-[--l0-avatar-size] bs-[--l0-avatar-size] bg-activeSurface',\n )}\n >\n <ItemAvatar item={item} />\n </div>\n <div\n role='none'\n className='hidden group-aria-selected/l0item:block absolute inline-start-0 inset-block-2 is-1 bg-accentSurface rounded-ie'\n />\n <span id={`${item.id}__label`} className='sr-only'>\n {localizedString}\n </span>\n {closestEdge && <ListItem.DropIndicator edge={closestEdge} />}\n </L0ItemRoot>\n );\n};\n\nconst ItemAvatar = ({ item }: Pick<L0ItemProps, 'item'>) => {\n const type = l0ItemType(item);\n if (item.properties.icon) {\n const hue = item.properties.hue ?? null;\n const hueFgStyle = hue && { style: { color: `var(--dx-${hue}SurfaceText)` } };\n return <Icon icon={item.properties.icon} size={5} {...hueFgStyle} />;\n }\n\n if (type === 'tab' && item.properties.disposition !== 'pin-end') {\n return <L0Avatar item={item} />;\n }\n\n return null;\n};\n\n//\n// L0Collection\n//\n\nconst L0Collection = ({ item, path }: L0ItemProps) => {\n const navTreeContext = useNavTreeContext();\n useLoadDescendents(item);\n const collectionItems = navTreeContext.useItems(item);\n const groupPath = useMemo(() => [...path, item.id], [item.id, path]);\n const { id, testId } = navTreeContext.getProps?.(item, path) ?? {};\n\n const handleRearrange = useCallback<StackItemRearrangeHandler<L0ItemData>>(\n (source, target, closestEdge) => {\n invariant(item.properties.onRearrangeChildren);\n const sourceIndex = collectionItems.findIndex((i) => i.id === source.id);\n const targetIndex = collectionItems.findIndex((i) => i.id === target.id);\n const insertIndex =\n source.id === target.id\n ? sourceIndex\n : targetIndex +\n (sourceIndex < targetIndex ? (closestEdge === 'top' ? -1 : 0) : closestEdge === 'bottom' ? 1 : 0);\n const nextOrder = arrayMove([...collectionItems], sourceIndex, insertIndex);\n return item.properties.onRearrangeChildren(nextOrder);\n },\n [collectionItems, item.properties.onRearrangeChildren],\n );\n\n return (\n <div\n role='group'\n className='contents group/l0c'\n aria-labelledby={`${item.id}__label`}\n data-itemid={id}\n data-testid={testId}\n >\n {collectionItems.map((collectionItem) => (\n <L0Item\n key={collectionItem.id}\n item={collectionItem}\n parent={item}\n path={groupPath}\n {...(item.properties.onRearrangeChildren && { onRearrange: handleRearrange })}\n />\n ))}\n </div>\n );\n};\n\n//\n// L0Menu\n//\n\nexport type L0MenuProps = {\n menuActions: MenuItem[];\n topLevelItems: Node<any>[];\n pinnedItems: Node<any>[];\n userAccountItem?: Node<any>;\n parent?: Node<any>;\n path: string[];\n};\n\nexport const L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent, path }: L0MenuProps) => {\n const { t } = useTranslation(NAVTREE_PLUGIN);\n\n return (\n <Tabs.Tablist\n classNames={[\n 'group/l0 absolute z-[1] inset-block-0 inline-start-0 rounded-is',\n 'grid grid-cols-[var(--l0-size)] grid-rows-[var(--rail-size)_1fr_min-content_var(--l0-size)] contain-layout',\n '!is-[--l0-size] bg-baseSurface border-ie border-subduedSeparator app-drag pbe-[env(safe-area-inset-bottom)]',\n ]}\n >\n {/* TODO(wittjosiah): Use L0Item trigger. */}\n <MenuProvider>\n <DropdownMenu.Root group={parent} items={menuActions}>\n <Tooltip.Trigger content={t('app menu label')} side='right' asChild>\n <DropdownMenu.Trigger\n data-testid='spacePlugin.addSpace'\n className={mx(l0ItemRoot, 'grid place-items-center')}\n >\n <div\n role='none'\n className={mx(\n l0ItemContent,\n 'is-[--rail-action] bs-[--rail-action] group-hover/l0item:bg-hoverSurface',\n )}\n >\n <Icon icon='ph--list--regular' size={5} />\n </div>\n </DropdownMenu.Trigger>\n </Tooltip.Trigger>\n </DropdownMenu.Root>\n </MenuProvider>\n\n {/* Space list. */}\n <ScrollArea.Root>\n <ScrollArea.Viewport>\n <div\n role='none'\n className={mx([\n 'flex flex-col gap-1 pbs-1',\n '[body[data-platform=\"darwin\"]_&]:pbs-[calc(30px+0.25rem)]',\n '[body[data-platform=\"ios\"]_&]:pbs-[max(env(safe-area-inset-top),0.25rem)]',\n ])}\n >\n {topLevelItems.map((item) => {\n if (l0ItemType(item) === 'collection') {\n return <L0Collection key={item.id} item={item} parent={parent} path={path} />;\n } else {\n return <L0Item key={item.id} item={item} parent={parent} path={path} />;\n }\n })}\n </div>\n <ScrollArea.Scrollbar orientation='vertical'>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n\n {/* Actions. */}\n <div role='none' className='grid grid-cols-1 auto-rows-[--rail-action] pbs-2'>\n {pinnedItems\n .filter((item) => l0ItemType(item) !== 'collection')\n .map((item) => (\n <L0Item key={item.id} item={item} parent={parent} path={path} pinned />\n ))}\n </div>\n\n {userAccountItem && (\n <div role='none' className='grid app-no-drag'>\n <L0ItemRoot key={userAccountItem.id} item={userAccountItem} parent={parent} path={path}>\n <UserAccountAvatar\n userId={userAccountItem.properties.userId}\n hue={userAccountItem.properties.hue}\n emoji={userAccountItem.properties.emoji}\n status={userAccountItem.properties.status}\n size={10}\n />\n </L0ItemRoot>\n </div>\n )}\n\n <div\n role='none'\n className='hidden [body[data-platform=\"darwin\"]_&]:block absolute block-start-0 is-[calc(var(--l0-size)-1px)] bs-[calc(40px+0.25rem)]'\n style={{\n background:\n 'linear-gradient(to bottom, var(--dx-sidebarSurface) 0%, var(--dx-sidebarSurface) 70%, transparent 100%)',\n }}\n />\n </Tabs.Tablist>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Avatar, type AvatarStatus, type Size } from '@dxos/react-ui';\nimport { hexToFallback } from '@dxos/util';\n\nexport type UserAccountAvatarProps = {\n size?: Size;\n userId?: string;\n hue?: string;\n emoji?: string;\n status?: AvatarStatus;\n};\n\nexport const UserAccountAvatar = ({ size, userId, hue, emoji, status }: UserAccountAvatarProps) => {\n const fallbackValue = hexToFallback(userId ?? '0');\n\n return (\n <div className='grid place-items-center' data-joyride='welcome/account'>\n <Avatar.Root>\n <Avatar.Content\n variant='circle'\n size={size ?? 12}\n status={status ?? 'active'}\n hue={hue || fallbackValue.hue}\n fallback={emoji || fallbackValue.emoji}\n data-testid='treeView.userAccount'\n />\n </Avatar.Root>\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { type Node } from '@dxos/app-graph';\nimport { IconButton, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { Tree } from '@dxos/react-ui-list';\nimport { Tabs } from '@dxos/react-ui-tabs';\nimport { hoverableControlItem, hoverableOpenControlItem } from '@dxos/react-ui-theme';\n\nimport { meta } from '../../meta';\nimport { useNavTreeContext } from '../NavTreeContext';\nimport { NavTreeItemColumns } from '../NavTreeItem';\n\nexport type L1PanelProps = {\n open?: boolean;\n path: string[];\n item: Node<any>;\n currentItemId: string;\n onBack?: () => void;\n};\n\n/**\n * Space or settings panel.\n */\nexport const L1Panel = ({ open, path, item, currentItemId, onBack }: L1PanelProps) => {\n const { t } = useTranslation(meta.id);\n const { isAlternateTree, ...navTreeContext } = useNavTreeContext();\n // NOTE(burdon): I'm very uneasy about this pattern of declaring hooks as context props.\n const { useItems } = navTreeContext;\n const title = toLocalizedString(item.properties.label, t);\n\n // TODO(wittjosiah): Support multiple alternate trees.\n const alternateTree = useItems(item, { disposition: 'alternate-tree' })[0];\n const alternatePath = useMemo(() => [...path, item.id], [item.id, path]);\n const isAlternate = isAlternateTree?.(alternatePath, item) ?? false;\n const useAlternateItems = useCallback(\n (node?: Node, { disposition }: { disposition?: string } = {}) => {\n // TODO(wittjosiah): Sorting is expensive, limit to necessary items for now.\n return useItems(node, { disposition, sort: node?.id === alternateTree.id });\n },\n [alternateTree, useItems],\n );\n\n return (\n <Tabs.Tabpanel\n key={item.id}\n value={item.id}\n classNames={[\n 'absolute inset-block-0 inline-end-0',\n 'is-[calc(100%-var(--l0-size))] lg:is-[--l1-size] grid-cols-1 grid-rows-[var(--rail-size)_1fr]',\n 'pbs-[env(safe-area-inset-top)]',\n item.id === currentItemId && 'grid',\n ]}\n tabIndex={-1}\n aria-label={title}\n {...(!open && { inert: 'true' })}\n >\n {item.id === currentItemId && (\n <>\n <L1PanelHeader path={path} item={item} currentItemId={currentItemId} onBack={onBack} />\n <div role='none' className='overflow-y-auto'>\n {isAlternate ? (\n <Tree\n {...navTreeContext}\n useItems={useAlternateItems}\n id={alternateTree.id}\n root={alternateTree}\n path={alternatePath}\n levelOffset={5}\n gridTemplateColumns='[tree-row-start] 1fr min-content min-content min-content [tree-row-end]'\n renderColumns={NavTreeItemColumns}\n />\n ) : (\n <Tree\n {...navTreeContext}\n id={item.id}\n root={item}\n path={path}\n levelOffset={5}\n draggable\n gridTemplateColumns='[tree-row-start] 1fr min-content min-content min-content [tree-row-end]'\n renderColumns={NavTreeItemColumns}\n />\n )}\n </div>\n </>\n )}\n </Tabs.Tabpanel>\n );\n};\n\n/**\n * Header row.\n */\nconst L1PanelHeader = ({ item, path, onBack }: L1PanelProps) => {\n const { t } = useTranslation(meta.id);\n const { isAlternateTree, setAlternateTree, ...navTreeContext } = useNavTreeContext();\n const title = toLocalizedString(item.properties.label, t);\n\n // TODO(wittjosiah): Support multiple alternate trees.\n const alternateTree = navTreeContext.useItems(item, { disposition: 'alternate-tree' })[0];\n const alternatePath = useMemo(() => [...path, item.id], [item.id, path]);\n const isAlternate = isAlternateTree?.(alternatePath, item) ?? false;\n const backCapable = item.id.startsWith('!') || isAlternate;\n\n const handleOpen = useCallback(() => {\n setAlternateTree?.(alternatePath, true);\n }, [alternatePath, setAlternateTree]);\n\n const handleBack = useCallback(() => {\n if (isAlternate) {\n setAlternateTree?.(alternatePath, false);\n } else {\n onBack?.();\n }\n }, [isAlternate, alternatePath, setAlternateTree, onBack]);\n\n // TODO(burdon): Reuse same grid as tree?\n return (\n <div className='flex is-full items-center border-be border-subduedSeparator app-drag density-coarse'>\n <div className='is-6' />\n <h2 className='flex-1 truncate min-is-0'>{title}</h2>\n {(backCapable && (\n <IconButton\n variant='ghost'\n icon='ph--arrow-u-down-left--regular'\n iconOnly\n size={5}\n label={t('button back')}\n classNames={[hoverableControlItem, hoverableOpenControlItem, 'pointer-fine:pli-1']}\n onClick={handleBack}\n />\n )) ||\n (alternateTree && !isAlternate && (\n <IconButton\n data-testid='treeView.alternateTreeButton'\n variant='ghost'\n icon={alternateTree.properties.icon ?? 'ph--placeholder--regular'}\n iconOnly\n size={5}\n label={toLocalizedString(alternateTree.properties.label ?? alternateTree.id, t)}\n classNames={[hoverableControlItem, hoverableOpenControlItem, 'pointer-fine:pli-1']}\n onClick={handleOpen}\n />\n ))}\n <NavTreeItemColumns open path={path} item={item} density='coarse' />\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Action, type Node } from '@dxos/app-graph';\nimport { IconButton, toLocalizedString, useDensityContext, useTranslation } from '@dxos/react-ui';\nimport { DropdownMenu, type MenuItem, MenuProvider } from '@dxos/react-ui-menu';\nimport { hoverableControlItem, hoverableOpenControlItem } from '@dxos/react-ui-theme';\n\nimport { NAVTREE_PLUGIN } from '../../meta';\nimport { type ActionProperties } from '../../types';\n\nexport type NavTreeItemActionMenuProps = ActionProperties & {\n parent: Node;\n caller?: string;\n monolithic?: boolean;\n menuActions?: Action[];\n};\n\nconst fallbackIcon = 'ph--placeholder--regular';\n\nconst fineActionButtonProps = {\n size: 4 as const,\n density: 'fine' as const,\n};\nconst coarseActionButtonProps = {\n size: 5 as const,\n density: 'coarse' as const,\n};\n\nexport const NavTreeItemActionDropdownMenu = ({\n parent,\n label,\n icon,\n testId,\n menuActions,\n caller,\n}: NavTreeItemActionMenuProps) => {\n const { t } = useTranslation(NAVTREE_PLUGIN);\n const density = useDensityContext();\n return (\n <MenuProvider>\n <DropdownMenu.Root group={parent} items={menuActions as MenuItem[]} caller={caller}>\n <DropdownMenu.Trigger asChild>\n <IconButton\n {...(density === 'coarse' ? coarseActionButtonProps : fineActionButtonProps)}\n classNames={['shrink-0 pli-2 pointer-fine:pli-1', hoverableControlItem, hoverableOpenControlItem]}\n variant='ghost'\n icon={icon ?? fallbackIcon}\n iconOnly\n label={toLocalizedString(label, t)}\n data-testid={testId}\n />\n </DropdownMenu.Trigger>\n </DropdownMenu.Root>\n </MenuProvider>\n );\n};\n\nexport const NavTreeItemMonolithicAction = ({\n parent,\n properties: { disabled, caller, testId, icon, variant = 'ghost', iconOnly = true } = { label: 'never' },\n data: invoke,\n baseLabel,\n}: Action & { parent: Node; onAction?: (action: Action) => void; baseLabel: string }) => {\n const density = useDensityContext();\n return (\n <IconButton\n {...(density === 'coarse' ? coarseActionButtonProps : fineActionButtonProps)}\n variant={variant}\n classNames={[\n 'shrink-0',\n hoverableControlItem,\n hoverableOpenControlItem,\n iconOnly ? 'pli-2 pointer-fine:pli-1' : 'p-2 pointer-fine:p-2 mie-1',\n ]}\n icon={icon ?? fallbackIcon}\n iconOnly={iconOnly}\n label={baseLabel}\n disabled={disabled}\n onClick={(event) => {\n if (disabled) {\n return;\n }\n event.stopPropagation();\n void invoke?.(caller ? { parent, caller } : { parent });\n }}\n data-testid={testId}\n />\n );\n};\n\nexport const NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }: NavTreeItemActionMenuProps) => {\n const { t } = useTranslation(NAVTREE_PLUGIN);\n\n const monolithicAction = menuActions?.length === 1 && menuActions[0];\n const baseLabel = toLocalizedString(monolithicAction ? monolithicAction.properties!.label : props.label, t);\n\n return monolithic && menuActions?.length === 1 ? (\n <NavTreeItemMonolithicAction baseLabel={baseLabel} parent={node} {...menuActions[0]} />\n ) : (\n <NavTreeItemActionDropdownMenu {...props} label={baseLabel} parent={node} menuActions={menuActions} />\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { Fragment, memo } from 'react';\n\nimport { isAction } from '@dxos/app-graph';\nimport { DensityProvider, Popover, Treegrid, toLocalizedString, useTranslation } from '@dxos/react-ui';\n\nimport { useLoadDescendents } from '../../hooks';\nimport { NAVTREE_PLUGIN } from '../../meta';\nimport { NAV_TREE_ITEM } from '../NavTree';\nimport { useNavTreeContext } from '../NavTreeContext';\nimport { type NavTreeItemColumnsProps } from '../types';\n\nimport { NavTreeItemAction } from './NavTreeItemAction';\n\nexport const NavTreeItemColumns = memo(({ path, item, open, density = 'fine' }: NavTreeItemColumnsProps) => {\n const { t } = useTranslation(NAVTREE_PLUGIN);\n const { useActions, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();\n\n const level = path.length - 2;\n const { actions: _actions, groupedActions } = useActions(item);\n const [primaryAction, ...secondaryActions] = _actions.toSorted((a, _b) =>\n a.properties?.disposition === 'list-item-primary' ? -1 : 1,\n );\n\n const actions = (primaryAction?.properties?.disposition === 'list-item-primary' ? secondaryActions : _actions)\n .flatMap((action) => (isAction(action) ? [action] : []))\n .filter((a) => ['list-item', 'list-item-primary'].includes(a.properties?.disposition));\n\n const ActionRoot = popoverAnchorId === `dxos.org/ui/${NAV_TREE_ITEM}/${item.id}` ? Popover.Anchor : Fragment;\n\n useLoadDescendents(item);\n useLoadDescendents(primaryAction && !isAction(primaryAction) ? primaryAction : undefined);\n\n return (\n <DensityProvider density={density}>\n <div role='none' className='contents app-no-drag'>\n {primaryAction?.properties?.disposition === 'list-item-primary' && !primaryAction?.properties?.disabled ? (\n <NavTreeItemAction\n testId={primaryAction.properties?.testId}\n label={toLocalizedString(primaryAction.properties?.label, t)}\n icon={primaryAction.properties?.icon ?? 'ph--placeholder--regular'}\n parent={item}\n monolithic={isAction(primaryAction)}\n menuActions={isAction(primaryAction) ? [primaryAction] : groupedActions[primaryAction.id]}\n menuType={primaryAction.properties?.menuType}\n caller={NAV_TREE_ITEM}\n />\n ) : (\n <Treegrid.Cell />\n )}\n <ActionRoot>\n {actions.length > 0 ? (\n <NavTreeItemAction\n testId={`navtree.treeItem.actionsLevel${level}`}\n label={t('tree item actions label')}\n icon='ph--dots-three-vertical--regular'\n parent={item}\n menuActions={actions}\n menuType='dropdown'\n caller={NAV_TREE_ITEM}\n />\n ) : (\n <Treegrid.Cell />\n )}\n </ActionRoot>\n {ItemEnd && <ItemEnd node={item} open={open} />}\n </div>\n </DensityProvider>\n );\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useMemo } from 'react';\n\nimport { type Node } from '@dxos/app-graph';\n\nimport { useLoadDescendents } from '../../hooks';\nimport { l0ItemType } from '../../util';\nimport { useNavTreeContext } from '../NavTreeContext';\n\nimport { L1Panel, type L1PanelProps } from './L1Panel';\n\nexport type L1TabsProps = Pick<L1PanelProps, 'open' | 'currentItemId' | 'onBack'> & {\n path: string[];\n topLevelItems: Node<any>[];\n};\n\n/**\n * Each space is an L1 tab.\n */\nexport const L1Tabs = ({ topLevelItems, onBack, ...props }: L1TabsProps) => {\n return (\n <>\n {topLevelItems.map((item) => {\n const type = l0ItemType(item);\n switch (type) {\n case 'tab':\n return <L1Panel key={item.id} item={item} {...props} onBack={onBack} />;\n case 'collection':\n return <L1PanelCollection key={item.id} item={item} {...props} />;\n default:\n return null;\n }\n })}\n </>\n );\n};\n\n/**\n *\n */\nconst L1PanelCollection = ({ item, path, ...props }: L1PanelProps) => {\n const { useItems } = useNavTreeContext();\n useLoadDescendents(item);\n const collectionItems = useItems(item);\n const groupPath = useMemo(() => [...path, item.id], [item.id, path]);\n return (\n <>\n {collectionItems\n .filter((item) => l0ItemType(item) === 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CAAA;IACF,GAAG;MAACnF;KAAM;AAEV,UAAMkI,mBAAmBhF,aACvB,CAACC,MAAgBtE,SAAAA;AACf2D,cAAQW,MAAM,iBAAiBtE,IAAAA;IACjC,GACA;MAAC2D;KAAQ;AAGX,UAAM2F,sBAAsBjH,SAC1B,OAAO;MACLd;MACAwB;MACAb,YAAAA;MACAmD;MACAvF;MACAkD;MACAC;MACAmB;MACAX;MACAD;MACA4C;MACA1C;MACA2F;MACAE,aAAa5D;MACb6D,cAAc/D;MACdgE,UAAUlD;MACVmD,QAAQxC;IACV,IACA;MACEnE;MACAb;MACAmD;MACAvF;MACAkD;MACAC;MACAmB;MACAX;MACAD;MACA4C;MACA1C;MACA2F;MACA1D;MACAF;MACAc;MACAW;KACD;AAGH,WACE,gBAAAjH,QAAA,cAAC0J,eAAeC,UAAQ;MAACC,OAAOP;OAC9B,gBAAArJ,QAAA,cAAC6J,SAAAA;MAAQzJ,IAAIgB;MAAS0I,MAAM5I,MAAM4I;MAAM/J,MAAM+D,OAAOiG;;;;;AAG3D,CAAA;",
|
|
6
|
+
"names": ["React", "useMemo", "useState", "LayoutAction", "createIntent", "useAppGraph", "useIntentDispatcher", "isAction", "isActionGroup", "Keyboard", "keySymbols", "useActions", "Button", "Dialog", "Icon", "toLocalizedString", "useTranslation", "SearchList", "cardDialogContent", "cardDialogHeader", "cardDialogPaddedOverflow", "cardDialogSearchListRoot", "descriptionText", "mx", "getHostPlatform", "CommandsDialogContent", "selected", "initial", "t", "useTranslation", "NAVTREE_PLUGIN", "setSelected", "useState", "dispatchPromise", "dispatch", "useIntentDispatcher", "graph", "useAppGraph", "allActions", "useMemo", "current", "Keyboard", "singleton", "getCurrentContext", "actionMap", "Set", "actions", "traverse", "visitor", "node", "path", "isAction", "isActionGroup", "has", "id", "startsWith", "slice", "join", "add", "push", "sort", "a", "b", "toLocalizedString", "properties", "label", "toLowerCase", "localeCompare", "group", "find", "groupActions", "useActions", "Dialog", "Content", "classNames", "cardDialogContent", "Title", "cardDialogHeader", "ns", "SearchList", "Root", "cardDialogSearchListRoot", "Input", "placeholder", "cardDialogPaddedOverflow", "map", "action", "shortcut", "keyBinding", "getHostPlatform", "Item", "value", "key", "onSelect", "disabled", "createIntent", "LayoutAction", "UpdateDialog", "part", "options", "state", "setTimeout", "getConnections", "data", "parent", "caller", "KEY_BINDING", "testId", "Icon", "icon", "size", "span", "className", "mx", "descriptionText", "keySymbols", "div", "role", "Close", "asChild", "Button", "React", "LayoutAction", "createIntent", "useIntentDispatcher", "Button", "Icon", "useTranslation", "CommandsTrigger", "dispatchPromise", "dispatch", "useIntentDispatcher", "t", "useTranslation", "NAVTREE_PLUGIN", "React", "Button", "classNames", "onClick", "createIntent", "LayoutAction", "UpdateDialog", "part", "subject", "COMMANDS_DIALOG", "options", "blockAlign", "span", "className", "Icon", "icon", "size", "isActionLike", "isNonNullable", "getParent", "graph", "node", "path", "parentId", "length", "getConnections", "id", "find", "n", "getPersistenceParent", "persistenceClass", "properties", "acceptPersistenceClass", "has", "parent", "slice", "resolveMigrationOperation", "activeNode", "destinationPath", "destinationRelatedNode", "activeClass", "persistenceParent", "activeKey", "persistenceKey", "acceptPersistenceKey", "onTransferStart", "onCopy", "sortActions", "actions", "sort", "a", "b", "disposition", "getChildren", "map", "nextPath", "includes", "undefined", "filter", "isNonNullable", "l0ItemType", "item", "isActionLike", "monitorForElements", "extractInstruction", "untracked", "React", "memo", "useCallback", "useEffect", "useMemo", "LayoutAction", "Surface", "createIntent", "useAppGraph", "useCapability", "useIntentDispatcher", "useLayout", "ROOT_ID", "isAction", "isActionLike", "PLANK_COMPANION_TYPE", "useConnections", "useActions", "useGraphActions", "useMediaQuery", "useSidebars", "isTreeData", "mx", "arrayMove", "byPosition", "lazy", "AppGraphBuilder", "lazy", "IntentResolver", "Keyboard", "ReactSurface", "State", "React", "useMemo", "Tabs", "useEffect", "createContext", "useContext", "raise", "NavTreeContext", "createContext", "useNavTreeContext", "useContext", "raise", "Error", "useEffect", "toLocalizedString", "useTranslation", "NavTreeDocumentTitle", "node", "t", "useTranslation", "NAVTREE_PLUGIN", "useEffect", "document", "title", "toLocalizedString", "properties", "label", "ns", "useLoadDescendents", "root", "loadDescendents", "useNavTreeContext", "useEffect", "frame", "requestAnimationFrame", "cancelAnimationFrame", "combine", "draggable", "dropTargetForElements", "preserveOffsetOnSource", "scrollJustEnoughIntoView", "attachClosestEdge", "extractClosestEdge", "React", "forwardRef", "useCallback", "useLayoutEffect", "useMemo", "useRef", "useState", "invariant", "Icon", "ListItem", "ScrollArea", "Tooltip", "toLocalizedString", "useMediaQuery", "useTranslation", "DropdownMenu", "MenuProvider", "Tabs", "mx", "arrayMove", "getFirstTwoRenderableChars", "React", "Avatar", "hexToFallback", "UserAccountAvatar", "size", "userId", "hue", "emoji", "status", "fallbackValue", "hexToFallback", "React", "div", "className", "data-joyride", "Avatar", "Root", "Content", "variant", "fallback", "data-testid", "useL0ItemClick", "item", "parent", "path", "type", "tab", "isCurrent", "onSelect", "onTabChange", "useNavTreeContext", "isLg", "useMediaQuery", "ssr", "useCallback", "event", "data", "invoke", "properties", "caller", "node", "current", "option", "altKey", "l0Breakpoints", "lg", "l0ItemRoot", "l0ItemContent", "L0ItemRoot", "forwardRef", "children", "forwardedRef", "getProps", "id", "testId", "l0ItemType", "itemPath", "useMemo", "t", "useTranslation", "NAVTREE_PLUGIN", "localizedString", "toLocalizedString", "label", "handleClick", "rootProps", "value", "tabIndex", "onClick", "Root", "Tabs", "TabPrimitive", "React", "Tooltip", "Trigger", "asChild", "delayDuration", "side", "content", "data-type", "className", "mx", "l0Breakpoint", "ref", "L0Avatar", "hue", "hueFgStyle", "style", "color", "avatarValue", "getFirstTwoRenderableChars", "join", "toUpperCase", "span", "role", "L0Item", "pinned", "onRearrange", "itemElement", "useRef", "closestEdge", "setEdge", "useState", "useLayoutEffect", "combine", "draggable", "element", "getInitialData", "onGenerateDragPreview", "nativeSetDragImage", "source", "location", "document", "body", "setAttribute", "querySelector", "scrollJustEnoughIntoView", "x", "y", "preserveOffsetOnSource", "input", "container", "offsetParent", "onDragStart", "removeAttribute", "closest", "onDrop", "dropTargetForElements", "getData", "attachClosestEdge", "allowedEdges", "onDragEnter", "self", "extractClosestEdge", "onDrag", "onDragLeave", "div", "data-frame", "background", "ItemAvatar", "ListItem", "DropIndicator", "edge", "icon", "Icon", "size", "disposition", "L0Collection", "navTreeContext", "useLoadDescendents", "collectionItems", "useItems", "groupPath", "handleRearrange", "target", "invariant", "onRearrangeChildren", "sourceIndex", "findIndex", "i", "targetIndex", "insertIndex", "nextOrder", "arrayMove", "aria-labelledby", "data-itemid", "data-testid", "map", "collectionItem", "key", "L0Menu", "menuActions", "topLevelItems", "pinnedItems", "userAccountItem", "Tablist", "classNames", "MenuProvider", "DropdownMenu", "group", "items", "ScrollArea", "Viewport", "Scrollbar", "orientation", "Thumb", "filter", "UserAccountAvatar", "userId", "emoji", "status", "React", "useCallback", "useMemo", "IconButton", "toLocalizedString", "useTranslation", "Tree", "Tabs", "hoverableControlItem", "hoverableOpenControlItem", "React", "IconButton", "toLocalizedString", "useDensityContext", "useTranslation", "DropdownMenu", "MenuProvider", "hoverableControlItem", "hoverableOpenControlItem", "fallbackIcon", "fineActionButtonProps", "size", "density", "coarseActionButtonProps", "NavTreeItemActionDropdownMenu", "parent", "label", "icon", "testId", "menuActions", "caller", "t", "useTranslation", "NAVTREE_PLUGIN", "useDensityContext", "React", "MenuProvider", "DropdownMenu", "Root", "group", "items", "Trigger", "asChild", "IconButton", "classNames", "hoverableControlItem", "hoverableOpenControlItem", "variant", "iconOnly", "toLocalizedString", "data-testid", "NavTreeItemMonolithicAction", "properties", "disabled", "data", "invoke", "baseLabel", "onClick", "event", "stopPropagation", "NavTreeItemAction", "monolithic", "node", "props", "monolithicAction", "length", "React", "Fragment", "memo", "isAction", "DensityProvider", "Popover", "Treegrid", "toLocalizedString", "useTranslation", "NavTreeItemColumns", "memo", "path", "item", "open", "density", "t", "useTranslation", "NAVTREE_PLUGIN", "useActions", "renderItemEnd", "ItemEnd", "popoverAnchorId", "useNavTreeContext", "level", "length", "actions", "_actions", "groupedActions", "primaryAction", "secondaryActions", "toSorted", "a", "_b", "properties", "disposition", "flatMap", "action", "isAction", "filter", "includes", "ActionRoot", "NAV_TREE_ITEM", "id", "Popover", "Anchor", "Fragment", "useLoadDescendents", "undefined", "React", "DensityProvider", "div", "role", "className", "disabled", "NavTreeItemAction", "testId", "label", "toLocalizedString", "icon", "parent", "monolithic", "menuActions", "menuType", "caller", "Treegrid", "Cell", "node", "L1Panel", "open", "path", "item", "currentItemId", "onBack", "t", "useTranslation", "meta", "id", "isAlternateTree", "navTreeContext", "useNavTreeContext", "useItems", "title", "toLocalizedString", "properties", "label", "alternateTree", "disposition", "alternatePath", "useMemo", "isAlternate", "useAlternateItems", "useCallback", "node", "sort", "React", "Tabs", "Tabpanel", "key", "value", "classNames", "tabIndex", "aria-label", "inert", "L1PanelHeader", "div", "role", "className", "Tree", "root", "levelOffset", "gridTemplateColumns", "renderColumns", "NavTreeItemColumns", "draggable", "setAlternateTree", "backCapable", "startsWith", "handleOpen", "handleBack", "h2", "IconButton", "variant", "icon", "iconOnly", "size", "hoverableControlItem", "hoverableOpenControlItem", "onClick", "data-testid", "density", "React", "useMemo", "L1Tabs", "topLevelItems", "onBack", "props", "React", "map", "item", "type", "l0ItemType", "L1Panel", "key", "id", "L1PanelCollection", "path", "useItems", "useNavTreeContext", "useLoadDescendents", "collectionItems", "groupPath", "useMemo", "filter", "NAV_TREE_ITEM", "NavTree", "id", "root", "props", "tab", "useItems", "onBack", "useNavTreeContext", "topLevelActions", "disposition", "sort", "topLevelCollections", "topLevelWorkspaces", "topLevelNavigation", "l0Items", "useMemo", "pinnedItems", "userAccountItem", "topLevelItems", "useLoadDescendents", "path", "React", "Tabs", "Root", "value", "orientation", "verticalVariant", "classNames", "L0Menu", "menuActions", "parent", "L1Tabs", "currentItemId", "NODE_TYPE", "renderItemEnd", "node", "open", "React", "Surface", "role", "data", "id", "subject", "limit", "getChildrenFilter", "untracked", "isActionLike", "type", "PLANK_COMPANION_TYPE", "properties", "disposition", "filterItems", "action", "isAction", "getItems", "graph", "getConnections", "ROOT_ID", "filter", "useItems", "options", "useAppGraph", "connections", "useConnections", "filtered", "sort", "toSorted", "a", "b", "byPosition", "useActions", "actions", "useGraphActions", "useMemo", "reduce", "acc", "arg", "push", "actionGroup", "getActions", "groupedActions", "NavTreeContainer", "memo", "tab", "popoverAnchorId", "topbar", "isLg", "useMediaQuery", "ssr", "dispatchPromise", "dispatch", "useIntentDispatcher", "isOpen", "isCurrent", "isAlternateTree", "setItem", "useCapability", "NavTreeCapabilities", "State", "layout", "useLayout", "navigationSidebarState", "useSidebars", "NAVTREE_PLUGIN", "getProps", "useCallback", "path", "children", "getChildren", "parentOf", "length", "map", "undefined", "label", "icon", "disabled", "className", "mx", "modified", "headingClassName", "testId", "loadDescendents", "expand", "forEach", "child", "handleOpenChange", "item", "handleTabChange", "createIntent", "LayoutAction", "UpdateSidebar", "part", "state", "SwitchWorkspace", "active", "Open", "canDrop", "source", "target", "handleSelect", "option", "parent", "caller", "NAV_TREE_ITEM", "current", "key", "Close", "ScrollIntoView", "defaultAction", "find", "handleBack", "RevertWorkspace", "revert", "useEffect", "monitorForElements", "canMonitor", "isTreeData", "onDrop", "location", "dropTargets", "instruction", "extractInstruction", "sourceNode", "targetNode", "sourcePath", "targetPath", "operation", "slice", "join", "resolveMigrationOperation", "sourceParent", "getParent", "targetParent", "sourceItems", "targetItems", "sourceIndex", "findIndex", "targetIndex", "migrationIndex", "nextItems", "arrayMove", "onRearrangeChildren", "onCopy", "onTransferStart", "onTransferEnd", "setAlternateTree", "navTreeContextValue", "onTabChange", "onOpenChange", "onSelect", "onBack", "NavTreeContext", "Provider", "value", "NavTree", "root", "sidebarOpen"]
|
|
7
|
+
}
|
|
@@ -5,14 +5,13 @@ import {
|
|
|
5
5
|
NODE_TYPE,
|
|
6
6
|
ReactSurface,
|
|
7
7
|
State,
|
|
8
|
-
getActions,
|
|
9
8
|
getChildren,
|
|
10
9
|
getParent,
|
|
11
10
|
getPersistenceParent,
|
|
12
11
|
l0ItemType,
|
|
13
12
|
resolveMigrationOperation,
|
|
14
13
|
sortActions
|
|
15
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZKVY35IG.mjs";
|
|
16
15
|
import {
|
|
17
16
|
NavTreeCapabilities
|
|
18
17
|
} from "./chunk-WCARAZ7J.mjs";
|
|
@@ -31,7 +30,7 @@ import { Events } from "@dxos/app-framework";
|
|
|
31
30
|
var NavTreeEvents;
|
|
32
31
|
|
|
33
32
|
// src/NavTreePlugin.tsx
|
|
34
|
-
import {
|
|
33
|
+
import { Capabilities, Events as Events2, LayoutAction, allOf, contributes, createIntent, defineModule, definePlugin } from "@dxos/app-framework";
|
|
35
34
|
|
|
36
35
|
// src/translations.ts
|
|
37
36
|
var translations = [
|
|
@@ -138,7 +137,6 @@ export {
|
|
|
138
137
|
NavTreeCapabilities,
|
|
139
138
|
NavTreeEvents,
|
|
140
139
|
NavTreePlugin,
|
|
141
|
-
getActions,
|
|
142
140
|
getChildren,
|
|
143
141
|
getParent,
|
|
144
142
|
getPersistenceParent,
|