@dxos/plugin-navtree 0.8.4-main.f9ba587 → 0.8.4-main.fffef41
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-OHSCN3GX.mjs} +13 -12
- package/dist/lib/browser/app-graph-builder-OHSCN3GX.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WCARAZ7J.mjs → chunk-5VLWX4PK.mjs} +4 -4
- package/dist/lib/browser/chunk-5VLWX4PK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TZA65AKW.mjs → chunk-7D2MPHXV.mjs} +317 -262
- package/dist/lib/browser/chunk-7D2MPHXV.mjs.map +7 -0
- package/dist/lib/browser/chunk-E6MZBCU5.mjs +19 -0
- package/dist/lib/browser/chunk-E6MZBCU5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -11
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-3XYN2CBU.mjs → intent-resolver-YUVXVPHG.mjs} +7 -7
- package/dist/lib/browser/intent-resolver-YUVXVPHG.mjs.map +7 -0
- package/dist/lib/browser/{keyboard-QRS6WOQH.mjs → keyboard-YYTYJW4M.mjs} +4 -4
- package/dist/lib/{node-esm/keyboard-MOZWHFUM.mjs.map → browser/keyboard-YYTYJW4M.mjs.map} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-N2HPMYCU.mjs → react-surface-J7MWWAGD.mjs} +10 -10
- package/dist/lib/browser/react-surface-J7MWWAGD.mjs.map +7 -0
- package/dist/lib/browser/{state-54DY3DOY.mjs → state-EUSVT6BI.mjs} +7 -7
- package/dist/lib/browser/state-EUSVT6BI.mjs.map +7 -0
- package/dist/types/src/NavTreePlugin.d.ts +1 -1
- package/dist/types/src/NavTreePlugin.d.ts.map +1 -1
- 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/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +18 -15
- 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/CommandsDialog/CommandsDialog.d.ts.map +1 -1
- package/dist/types/src/components/CommandsDialog/CommandsTrigger.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.d.ts +2 -2
- package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts +26 -4
- 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.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +32 -4
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts +2 -2
- package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L0Menu.d.ts +2 -0
- package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L1Panel.d.ts +5 -6
- package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L1Tabs.d.ts +12 -0
- package/dist/types/src/components/Sidebar/L1Tabs.d.ts.map +1 -0
- package/dist/types/src/components/Sidebar/index.d.ts +1 -0
- package/dist/types/src/components/Sidebar/index.d.ts.map +1 -1
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.d.ts.map +1 -1
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts +8 -5
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.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/events.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.d.ts +4 -5
- package/dist/types/src/experimental/Tree.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.stories.d.ts +7 -4
- package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/testing/generator.d.ts +1 -1
- package/dist/types/src/testing/generator.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +4 -3
- package/dist/types/src/types.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 +49 -50
- package/src/NavTreePlugin.tsx +75 -76
- package/src/capabilities/app-graph-builder.ts +10 -9
- package/src/capabilities/capabilities.ts +2 -2
- package/src/capabilities/intent-resolver.ts +2 -2
- package/src/capabilities/keyboard.ts +2 -2
- package/src/capabilities/react-surface.tsx +5 -5
- package/src/capabilities/state.ts +4 -3
- package/src/components/CommandsDialog/CommandsDialog.tsx +15 -7
- package/src/components/CommandsDialog/CommandsTrigger.tsx +6 -7
- package/src/components/NavTree/NavTree.stories.tsx +67 -53
- package/src/components/NavTree/NavTree.tsx +7 -3
- package/src/components/NavTreeContainer.tsx +91 -36
- package/src/components/NavTreeDocumentTitle.tsx +2 -2
- package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +4 -6
- package/src/components/NavTreeItem/NavTreeItemAction.tsx +11 -10
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +33 -27
- package/src/components/Sidebar/L0Menu.tsx +56 -55
- package/src/components/Sidebar/L1Panel.tsx +72 -97
- package/src/components/Sidebar/L1Tabs.tsx +58 -0
- package/src/components/Sidebar/index.ts +1 -0
- package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +9 -8
- package/src/components/UserAccountAvatar/UserAccountAvatar.tsx +20 -12
- package/src/components/index.ts +1 -1
- package/src/components/types.ts +3 -2
- package/src/events.ts +2 -2
- package/src/experimental/Tree.stories.tsx +36 -38
- package/src/experimental/Tree.tsx +17 -35
- package/src/meta.ts +10 -7
- package/src/testing/app-graph-builder.ts +20 -19
- package/src/testing/generator.ts +2 -2
- package/src/translations.ts +1 -0
- package/src/types.ts +4 -3
- package/src/util.ts +2 -20
- package/dist/lib/browser/app-graph-builder-5J4LRWDX.mjs.map +0 -7
- package/dist/lib/browser/chunk-ERDGQTH5.mjs +0 -16
- package/dist/lib/browser/chunk-ERDGQTH5.mjs.map +0 -7
- package/dist/lib/browser/chunk-TZA65AKW.mjs.map +0 -7
- package/dist/lib/browser/chunk-WCARAZ7J.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3XYN2CBU.mjs.map +0 -7
- package/dist/lib/browser/keyboard-QRS6WOQH.mjs.map +0 -7
- package/dist/lib/browser/react-surface-N2HPMYCU.mjs.map +0 -7
- package/dist/lib/browser/state-54DY3DOY.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-GY7GCTGU.mjs +0 -46
- package/dist/lib/node-esm/app-graph-builder-GY7GCTGU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CY7QWR4R.mjs +0 -1429
- package/dist/lib/node-esm/chunk-CY7QWR4R.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-P2JGW3WR.mjs +0 -18
- package/dist/lib/node-esm/chunk-P2JGW3WR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-V3QXFDDP.mjs +0 -16
- package/dist/lib/node-esm/chunk-V3QXFDDP.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -150
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-R7UNPSZY.mjs +0 -48
- package/dist/lib/node-esm/intent-resolver-R7UNPSZY.mjs.map +0 -7
- package/dist/lib/node-esm/keyboard-MOZWHFUM.mjs +0 -52
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-EW5FDMW4.mjs +0 -52
- package/dist/lib/node-esm/react-surface-EW5FDMW4.mjs.map +0 -7
- package/dist/lib/node-esm/state-Z3OTRC2I.mjs +0 -118
- package/dist/lib/node-esm/state-Z3OTRC2I.mjs.map +0 -7
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NavTreeCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5VLWX4PK.mjs";
|
|
4
4
|
import {
|
|
5
5
|
COMMANDS_DIALOG,
|
|
6
6
|
KEY_BINDING,
|
|
7
|
-
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
meta
|
|
8
|
+
} from "./chunk-E6MZBCU5.mjs";
|
|
9
9
|
|
|
10
10
|
// src/components/CommandsDialog/CommandsDialog.tsx
|
|
11
11
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
12
12
|
import React, { useMemo, useState } from "react";
|
|
13
|
-
import {
|
|
13
|
+
import { LayoutAction, createIntent } from "@dxos/app-framework";
|
|
14
|
+
import { useAppGraph, useIntentDispatcher } from "@dxos/app-framework/react";
|
|
14
15
|
import { isAction, isActionGroup } from "@dxos/app-graph";
|
|
15
16
|
import { Keyboard, keySymbols } from "@dxos/keyboard";
|
|
16
17
|
import { useActions } from "@dxos/plugin-graph";
|
|
17
|
-
import { Button, Dialog, Icon,
|
|
18
|
+
import { Button, Dialog, Icon, toLocalizedString, useTranslation } from "@dxos/react-ui";
|
|
18
19
|
import { SearchList } from "@dxos/react-ui-searchlist";
|
|
19
20
|
import { cardDialogContent, cardDialogHeader, cardDialogPaddedOverflow, cardDialogSearchListRoot } from "@dxos/react-ui-stack";
|
|
20
21
|
import { descriptionText, mx } from "@dxos/react-ui-theme";
|
|
@@ -22,7 +23,7 @@ import { getHostPlatform } from "@dxos/util";
|
|
|
22
23
|
var CommandsDialogContent = ({ selected: initial }) => {
|
|
23
24
|
var _effect = _useSignals();
|
|
24
25
|
try {
|
|
25
|
-
const { t } = useTranslation(
|
|
26
|
+
const { t } = useTranslation(meta.id);
|
|
26
27
|
const [selected, setSelected] = useState(initial);
|
|
27
28
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
28
29
|
const { graph } = useAppGraph();
|
|
@@ -53,7 +54,7 @@ var CommandsDialogContent = ({ selected: initial }) => {
|
|
|
53
54
|
}, /* @__PURE__ */ React.createElement(Dialog.Title, {
|
|
54
55
|
classNames: cardDialogHeader
|
|
55
56
|
}, t("commands dialog title", {
|
|
56
|
-
ns:
|
|
57
|
+
ns: meta.id
|
|
57
58
|
})), /* @__PURE__ */ React.createElement(SearchList.Root, {
|
|
58
59
|
label: t("command list input placeholder"),
|
|
59
60
|
classNames: cardDialogSearchListRoot
|
|
@@ -119,16 +120,15 @@ var CommandsDialogContent = ({ selected: initial }) => {
|
|
|
119
120
|
|
|
120
121
|
// src/components/CommandsDialog/CommandsTrigger.tsx
|
|
121
122
|
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
122
|
-
import { MagnifyingGlass } from "@phosphor-icons/react";
|
|
123
123
|
import React2 from "react";
|
|
124
|
-
import {
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
124
|
+
import { LayoutAction as LayoutAction2, createIntent as createIntent2 } from "@dxos/app-framework";
|
|
125
|
+
import { useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework/react";
|
|
126
|
+
import { Button as Button2, Icon as Icon2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
127
127
|
var CommandsTrigger = () => {
|
|
128
128
|
var _effect = _useSignals2();
|
|
129
129
|
try {
|
|
130
130
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
131
|
-
const { t } = useTranslation2(
|
|
131
|
+
const { t } = useTranslation2(meta.id);
|
|
132
132
|
return /* @__PURE__ */ React2.createElement(Button2, {
|
|
133
133
|
classNames: "m-1 pli-1 lg:pli-2",
|
|
134
134
|
onClick: () => dispatch(createIntent2(LayoutAction2.UpdateDialog, {
|
|
@@ -140,8 +140,9 @@ var CommandsTrigger = () => {
|
|
|
140
140
|
}))
|
|
141
141
|
}, /* @__PURE__ */ React2.createElement("span", {
|
|
142
142
|
className: "text-description font-normal grow text-start"
|
|
143
|
-
}, t("command list input placeholder")), /* @__PURE__ */ React2.createElement(
|
|
144
|
-
|
|
143
|
+
}, t("command list input placeholder")), /* @__PURE__ */ React2.createElement(Icon2, {
|
|
144
|
+
icon: "ph--magnifying-glass--regular",
|
|
145
|
+
size: 5
|
|
145
146
|
}));
|
|
146
147
|
} finally {
|
|
147
148
|
_effect.f();
|
|
@@ -149,7 +150,7 @@ var CommandsTrigger = () => {
|
|
|
149
150
|
};
|
|
150
151
|
|
|
151
152
|
// src/util.ts
|
|
152
|
-
import {
|
|
153
|
+
import { isActionLike } from "@dxos/app-graph";
|
|
153
154
|
import { isNonNullable } from "@dxos/util";
|
|
154
155
|
var getParent = (graph, node, path) => {
|
|
155
156
|
const parentId = path[path.length - 2];
|
|
@@ -199,22 +200,6 @@ var getChildren = (graph, node, path = []) => {
|
|
|
199
200
|
return nextPath.includes(n.id) ? void 0 : n;
|
|
200
201
|
}).filter(isNonNullable);
|
|
201
202
|
};
|
|
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
203
|
var l0ItemType = (item) => {
|
|
219
204
|
if (item.properties.disposition === "collection") {
|
|
220
205
|
return "collection";
|
|
@@ -228,23 +213,32 @@ var l0ItemType = (item) => {
|
|
|
228
213
|
};
|
|
229
214
|
|
|
230
215
|
// src/components/NavTreeContainer.tsx
|
|
231
|
-
import { useSignals as
|
|
216
|
+
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
232
217
|
import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
233
218
|
import { extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
|
|
234
219
|
import { untracked } from "@preact/signals-core";
|
|
235
|
-
import
|
|
236
|
-
import {
|
|
237
|
-
import {
|
|
220
|
+
import React10, { memo as memo2, useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo6 } from "react";
|
|
221
|
+
import { LayoutAction as LayoutAction3, createIntent as createIntent3 } from "@dxos/app-framework";
|
|
222
|
+
import { Surface, useAppGraph as useAppGraph2, useCapability, useIntentDispatcher as useIntentDispatcher3, useLayout } from "@dxos/app-framework/react";
|
|
223
|
+
import { ROOT_ID, isAction as isAction3, isActionLike as isActionLike2 } from "@dxos/app-graph";
|
|
238
224
|
import { PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
|
|
239
|
-
import { useConnections } from "@dxos/plugin-graph";
|
|
225
|
+
import { useConnections, useActions as useGraphActions } from "@dxos/plugin-graph";
|
|
240
226
|
import { useMediaQuery as useMediaQuery2, useSidebars } from "@dxos/react-ui";
|
|
241
227
|
import { isTreeData } from "@dxos/react-ui-list";
|
|
242
|
-
import { mx as
|
|
228
|
+
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
243
229
|
import { arrayMove as arrayMove2, byPosition } from "@dxos/util";
|
|
244
230
|
|
|
231
|
+
// src/capabilities/index.ts
|
|
232
|
+
import { lazy } from "@dxos/app-framework";
|
|
233
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-OHSCN3GX.mjs"));
|
|
234
|
+
var IntentResolver = lazy(() => import("./intent-resolver-YUVXVPHG.mjs"));
|
|
235
|
+
var Keyboard2 = lazy(() => import("./keyboard-YYTYJW4M.mjs"));
|
|
236
|
+
var ReactSurface = lazy(() => import("./react-surface-J7MWWAGD.mjs"));
|
|
237
|
+
var State = lazy(() => import("./state-EUSVT6BI.mjs"));
|
|
238
|
+
|
|
245
239
|
// src/components/NavTree/NavTree.tsx
|
|
246
|
-
import { useSignals as
|
|
247
|
-
import
|
|
240
|
+
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
241
|
+
import React9, { useMemo as useMemo5 } from "react";
|
|
248
242
|
import { Tabs as Tabs3 } from "@dxos/react-ui-tabs";
|
|
249
243
|
|
|
250
244
|
// src/hooks.ts
|
|
@@ -260,7 +254,7 @@ var useNavTreeContext = () => useContext(NavTreeContext) ?? raise(new Error("Mis
|
|
|
260
254
|
import { useEffect } from "react";
|
|
261
255
|
import { toLocalizedString as toLocalizedString2, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
262
256
|
var NavTreeDocumentTitle = ({ node }) => {
|
|
263
|
-
const { t } = useTranslation3(
|
|
257
|
+
const { t } = useTranslation3(meta.id);
|
|
264
258
|
useEffect(() => {
|
|
265
259
|
document.title = node ? toLocalizedString2(node.properties.label, t) : t("current app name", {
|
|
266
260
|
ns: "appkit"
|
|
@@ -295,11 +289,12 @@ import { scrollJustEnoughIntoView } from "@atlaskit/pragmatic-drag-and-drop/elem
|
|
|
295
289
|
import { attachClosestEdge, extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
296
290
|
import React4, { forwardRef, useCallback, useLayoutEffect, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
297
291
|
import { invariant } from "@dxos/invariant";
|
|
298
|
-
import {
|
|
299
|
-
import {
|
|
292
|
+
import { DxAvatar } from "@dxos/lit-ui/react";
|
|
293
|
+
import { Icon as Icon3, ListItem, ScrollArea, Tooltip, toLocalizedString as toLocalizedString3, useMediaQuery, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
294
|
+
import { DropdownMenu, MenuProvider } from "@dxos/react-ui-menu";
|
|
300
295
|
import { Tabs } from "@dxos/react-ui-tabs";
|
|
301
296
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
302
|
-
import { arrayMove
|
|
297
|
+
import { arrayMove } from "@dxos/util";
|
|
303
298
|
|
|
304
299
|
// src/components/UserAccountAvatar/UserAccountAvatar.tsx
|
|
305
300
|
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
@@ -310,8 +305,10 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
|
|
|
310
305
|
var _effect = _useSignals3();
|
|
311
306
|
try {
|
|
312
307
|
const fallbackValue = hexToFallback(userId ?? "0");
|
|
313
|
-
return /* @__PURE__ */ React3.createElement(
|
|
314
|
-
|
|
308
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(L0ItemActiveTabIndicator, {
|
|
309
|
+
classNames: "inset-block-6"
|
|
310
|
+
}), /* @__PURE__ */ React3.createElement("div", {
|
|
311
|
+
className: "grid place-items-center dx-focus-ring-group-indicator rounded-full",
|
|
315
312
|
"data-joyride": "welcome/account"
|
|
316
313
|
}, /* @__PURE__ */ React3.createElement(Avatar.Root, null, /* @__PURE__ */ React3.createElement(Avatar.Content, {
|
|
317
314
|
variant: "circle",
|
|
@@ -320,7 +317,7 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
|
|
|
320
317
|
hue: hue || fallbackValue.hue,
|
|
321
318
|
fallback: emoji || fallbackValue.emoji,
|
|
322
319
|
"data-testid": "treeView.userAccount"
|
|
323
|
-
})));
|
|
320
|
+
}))));
|
|
324
321
|
} finally {
|
|
325
322
|
_effect.f();
|
|
326
323
|
}
|
|
@@ -330,9 +327,7 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
|
|
|
330
327
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-navtree/src/components/Sidebar/L0Menu.tsx";
|
|
331
328
|
var useL0ItemClick = ({ item, parent, path }, type) => {
|
|
332
329
|
const { tab, isCurrent, onSelect, onTabChange } = useNavTreeContext();
|
|
333
|
-
const [isLg] = useMediaQuery("lg"
|
|
334
|
-
ssr: false
|
|
335
|
-
});
|
|
330
|
+
const [isLg] = useMediaQuery("lg");
|
|
336
331
|
return useCallback((event) => {
|
|
337
332
|
switch (type) {
|
|
338
333
|
case "action": {
|
|
@@ -368,7 +363,7 @@ var useL0ItemClick = ({ item, parent, path }, type) => {
|
|
|
368
363
|
var l0Breakpoints = {
|
|
369
364
|
lg: "hidden lg:grid"
|
|
370
365
|
};
|
|
371
|
-
var l0ItemRoot = 'group/l0item flex
|
|
366
|
+
var l0ItemRoot = 'group/l0item flex is-full justify-center items-center relative data[type!="collection"]:cursor-pointer app-no-drag dx-focus-ring-group';
|
|
372
367
|
var l0ItemContent = "flex justify-center items-center dx-focus-ring-group-indicator transition-colors rounded-sm";
|
|
373
368
|
var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, forwardedRef) => {
|
|
374
369
|
var _effect = _useSignals4();
|
|
@@ -383,7 +378,7 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
|
|
|
383
378
|
item.id,
|
|
384
379
|
path
|
|
385
380
|
]);
|
|
386
|
-
const { t } = useTranslation4(
|
|
381
|
+
const { t } = useTranslation4(meta.id);
|
|
387
382
|
const localizedString = toLocalizedString3(item.properties.label, t);
|
|
388
383
|
const handleClick = useL0ItemClick({
|
|
389
384
|
item,
|
|
@@ -395,21 +390,21 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
|
|
|
395
390
|
tabIndex: 0,
|
|
396
391
|
onClick: handleClick,
|
|
397
392
|
"data-testid": testId,
|
|
398
|
-
"data-
|
|
393
|
+
"data-object-id": id
|
|
399
394
|
} : type !== "collection" ? {
|
|
400
395
|
onClick: handleClick,
|
|
401
396
|
"data-testid": testId,
|
|
402
|
-
"data-
|
|
397
|
+
"data-object-id": id
|
|
403
398
|
} : {
|
|
404
|
-
onClick: handleClick
|
|
399
|
+
onClick: handleClick,
|
|
400
|
+
role: "button"
|
|
405
401
|
};
|
|
406
|
-
const Root = type === "collection" ? "h2" : type === "tab" ? Tabs.TabPrimitive : "button";
|
|
407
402
|
return /* @__PURE__ */ React4.createElement(Tooltip.Trigger, {
|
|
408
403
|
asChild: true,
|
|
409
404
|
delayDuration: 0,
|
|
410
405
|
side: "right",
|
|
411
406
|
content: localizedString
|
|
412
|
-
}, /* @__PURE__ */ React4.createElement(
|
|
407
|
+
}, /* @__PURE__ */ React4.createElement(Tabs.TabPrimitive, {
|
|
413
408
|
...rootProps,
|
|
414
409
|
"data-type": type,
|
|
415
410
|
className: mx2(l0ItemRoot, l0Breakpoints[item.properties.l0Breakpoint]),
|
|
@@ -419,28 +414,13 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
|
|
|
419
414
|
_effect.f();
|
|
420
415
|
}
|
|
421
416
|
});
|
|
422
|
-
var
|
|
417
|
+
var L0ItemActiveTabIndicator = ({ classNames }) => {
|
|
423
418
|
var _effect = _useSignals4();
|
|
424
419
|
try {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
style: {
|
|
430
|
-
color: `var(--dx-${hue}SurfaceText)`
|
|
431
|
-
}
|
|
432
|
-
};
|
|
433
|
-
const localizedString = toLocalizedString3(item.properties.label, t);
|
|
434
|
-
const avatarValue = useMemo2(() => type === "tab" ? getFirstTwoRenderableChars(localizedString).join("").toUpperCase() : [], [
|
|
435
|
-
type,
|
|
436
|
-
item.properties.label,
|
|
437
|
-
t
|
|
438
|
-
]);
|
|
439
|
-
return /* @__PURE__ */ React4.createElement("span", {
|
|
440
|
-
role: "img",
|
|
441
|
-
className: "place-self-center text-xl font-light",
|
|
442
|
-
...hueFgStyle
|
|
443
|
-
}, avatarValue);
|
|
420
|
+
return /* @__PURE__ */ React4.createElement("div", {
|
|
421
|
+
role: "none",
|
|
422
|
+
className: mx2("hidden group-aria-selected/l0item:block absolute inline-start-0 inset-block-2 is-1 bg-accentSurface rounded-ie", classNames)
|
|
423
|
+
});
|
|
444
424
|
} finally {
|
|
445
425
|
_effect.f();
|
|
446
426
|
}
|
|
@@ -448,7 +428,7 @@ var L0Avatar = ({ item }) => {
|
|
|
448
428
|
var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
|
|
449
429
|
var _effect = _useSignals4();
|
|
450
430
|
try {
|
|
451
|
-
const { t } = useTranslation4(
|
|
431
|
+
const { t } = useTranslation4(meta.id);
|
|
452
432
|
const itemElement = useRef(null);
|
|
453
433
|
const [closestEdge, setEdge] = useState2(null);
|
|
454
434
|
const localizedString = toLocalizedString3(item.properties.label, t);
|
|
@@ -537,10 +517,7 @@ var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
|
|
|
537
517
|
className: mx2(l0ItemContent, pinned ? "p-2 group-hover/l0item:bg-activeSurface" : "is-[--l0-avatar-size] bs-[--l0-avatar-size] bg-activeSurface")
|
|
538
518
|
}, /* @__PURE__ */ React4.createElement(ItemAvatar, {
|
|
539
519
|
item
|
|
540
|
-
})), /* @__PURE__ */ React4.createElement("
|
|
541
|
-
role: "none",
|
|
542
|
-
className: "hidden group-aria-selected/l0item:block absolute inline-start-0 inset-block-2 is-1 bg-accentSurface rounded-ie"
|
|
543
|
-
}), /* @__PURE__ */ React4.createElement("span", {
|
|
520
|
+
})), /* @__PURE__ */ React4.createElement(L0ItemActiveTabIndicator, null), /* @__PURE__ */ React4.createElement("span", {
|
|
544
521
|
id: `${item.id}__label`,
|
|
545
522
|
className: "sr-only"
|
|
546
523
|
}, localizedString), closestEdge && /* @__PURE__ */ React4.createElement(ListItem.DropIndicator, {
|
|
@@ -553,6 +530,7 @@ var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
|
|
|
553
530
|
var ItemAvatar = ({ item }) => {
|
|
554
531
|
var _effect = _useSignals4();
|
|
555
532
|
try {
|
|
533
|
+
const { t } = useTranslation4(meta.id);
|
|
556
534
|
const type = l0ItemType(item);
|
|
557
535
|
if (item.properties.icon) {
|
|
558
536
|
const hue = item.properties.hue ?? null;
|
|
@@ -561,15 +539,21 @@ var ItemAvatar = ({ item }) => {
|
|
|
561
539
|
color: `var(--dx-${hue}SurfaceText)`
|
|
562
540
|
}
|
|
563
541
|
};
|
|
564
|
-
return /* @__PURE__ */ React4.createElement(
|
|
542
|
+
return /* @__PURE__ */ React4.createElement(Icon3, {
|
|
565
543
|
icon: item.properties.icon,
|
|
566
|
-
size:
|
|
544
|
+
size: 6,
|
|
567
545
|
...hueFgStyle
|
|
568
546
|
});
|
|
569
547
|
}
|
|
570
548
|
if (type === "tab" && item.properties.disposition !== "pin-end") {
|
|
571
|
-
|
|
572
|
-
|
|
549
|
+
const hue = item.properties.hue ?? null;
|
|
550
|
+
const localizedString = toLocalizedString3(item.properties.label, t);
|
|
551
|
+
return /* @__PURE__ */ React4.createElement(DxAvatar, {
|
|
552
|
+
hue,
|
|
553
|
+
hueVariant: "surface",
|
|
554
|
+
variant: "square",
|
|
555
|
+
size: 12,
|
|
556
|
+
fallback: localizedString
|
|
573
557
|
});
|
|
574
558
|
}
|
|
575
559
|
return null;
|
|
@@ -616,7 +600,7 @@ var L0Collection = ({ item, path }) => {
|
|
|
616
600
|
role: "group",
|
|
617
601
|
className: "contents group/l0c",
|
|
618
602
|
"aria-labelledby": `${item.id}__label`,
|
|
619
|
-
"data-
|
|
603
|
+
"data-object-id": id,
|
|
620
604
|
"data-testid": testId
|
|
621
605
|
}, collectionItems.map((collectionItem) => /* @__PURE__ */ React4.createElement(L0Item, {
|
|
622
606
|
key: collectionItem.id,
|
|
@@ -634,7 +618,7 @@ var L0Collection = ({ item, path }) => {
|
|
|
634
618
|
var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent, path }) => {
|
|
635
619
|
var _effect = _useSignals4();
|
|
636
620
|
try {
|
|
637
|
-
const { t } = useTranslation4(
|
|
621
|
+
const { t } = useTranslation4(meta.id);
|
|
638
622
|
return /* @__PURE__ */ React4.createElement(Tabs.Tablist, {
|
|
639
623
|
classNames: [
|
|
640
624
|
"group/l0 absolute z-[1] inset-block-0 inline-start-0 rounded-is",
|
|
@@ -648,16 +632,20 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
|
|
|
648
632
|
content: t("app menu label"),
|
|
649
633
|
side: "right",
|
|
650
634
|
asChild: true
|
|
635
|
+
}, /* @__PURE__ */ React4.createElement(Tabs.TabPrimitive, {
|
|
636
|
+
value: "options",
|
|
637
|
+
asChild: true,
|
|
638
|
+
role: "button"
|
|
651
639
|
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Trigger, {
|
|
652
640
|
"data-testid": "spacePlugin.addSpace",
|
|
653
|
-
className: mx2(l0ItemRoot, "grid place-items-center")
|
|
641
|
+
className: mx2(l0ItemRoot, "grid place-items-center dx-focus-ring-group")
|
|
654
642
|
}, /* @__PURE__ */ React4.createElement("div", {
|
|
655
643
|
role: "none",
|
|
656
644
|
className: mx2(l0ItemContent, "is-[--rail-action] bs-[--rail-action] group-hover/l0item:bg-hoverSurface")
|
|
657
|
-
}, /* @__PURE__ */ React4.createElement(
|
|
645
|
+
}, /* @__PURE__ */ React4.createElement(Icon3, {
|
|
658
646
|
icon: "ph--list--regular",
|
|
659
647
|
size: 5
|
|
660
|
-
})))))), /* @__PURE__ */ React4.createElement(ScrollArea.Root, null, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React4.createElement("div", {
|
|
648
|
+
}))))))), /* @__PURE__ */ React4.createElement(ScrollArea.Root, null, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React4.createElement("div", {
|
|
661
649
|
role: "none",
|
|
662
650
|
className: mx2([
|
|
663
651
|
"flex flex-col gap-1 pbs-1",
|
|
@@ -720,17 +708,17 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
|
|
|
720
708
|
// src/components/Sidebar/L1Panel.tsx
|
|
721
709
|
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
722
710
|
import React7, { useCallback as useCallback2, useMemo as useMemo3 } from "react";
|
|
723
|
-
import {
|
|
711
|
+
import { DensityProvider, IconButton as IconButton2, toLocalizedString as toLocalizedString6, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
724
712
|
import { Tree } from "@dxos/react-ui-list";
|
|
725
713
|
import { Tabs as Tabs2 } from "@dxos/react-ui-tabs";
|
|
726
|
-
import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem as hoverableOpenControlItem2
|
|
714
|
+
import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem as hoverableOpenControlItem2 } from "@dxos/react-ui-theme";
|
|
727
715
|
|
|
728
716
|
// src/components/NavTreeItem/NavTreeItemAction.tsx
|
|
729
717
|
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
730
718
|
import React5 from "react";
|
|
731
|
-
import {
|
|
719
|
+
import { IconButton, toLocalizedString as toLocalizedString4, useDensityContext, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
732
720
|
import { DropdownMenu as DropdownMenu2, MenuProvider as MenuProvider2 } from "@dxos/react-ui-menu";
|
|
733
|
-
import { hoverableControlItem, hoverableOpenControlItem
|
|
721
|
+
import { hoverableControlItem, hoverableOpenControlItem } from "@dxos/react-ui-theme";
|
|
734
722
|
var fallbackIcon = "ph--placeholder--regular";
|
|
735
723
|
var fineActionButtonProps = {
|
|
736
724
|
size: 4,
|
|
@@ -743,7 +731,7 @@ var coarseActionButtonProps = {
|
|
|
743
731
|
var NavTreeItemActionDropdownMenu = ({ parent, label, icon, testId, menuActions, caller }) => {
|
|
744
732
|
var _effect = _useSignals5();
|
|
745
733
|
try {
|
|
746
|
-
const { t } = useTranslation5(
|
|
734
|
+
const { t } = useTranslation5(meta.id);
|
|
747
735
|
const density = useDensityContext();
|
|
748
736
|
return /* @__PURE__ */ React5.createElement(MenuProvider2, null, /* @__PURE__ */ React5.createElement(DropdownMenu2.Root, {
|
|
749
737
|
group: parent,
|
|
@@ -753,7 +741,11 @@ var NavTreeItemActionDropdownMenu = ({ parent, label, icon, testId, menuActions,
|
|
|
753
741
|
asChild: true
|
|
754
742
|
}, /* @__PURE__ */ React5.createElement(IconButton, {
|
|
755
743
|
...density === "coarse" ? coarseActionButtonProps : fineActionButtonProps,
|
|
756
|
-
classNames:
|
|
744
|
+
classNames: [
|
|
745
|
+
"shrink-0 pli-2 pointer-fine:pli-1",
|
|
746
|
+
hoverableControlItem,
|
|
747
|
+
hoverableOpenControlItem
|
|
748
|
+
],
|
|
757
749
|
variant: "ghost",
|
|
758
750
|
icon: icon ?? fallbackIcon,
|
|
759
751
|
iconOnly: true,
|
|
@@ -773,16 +765,21 @@ var NavTreeItemMonolithicAction = ({ parent, properties: { disabled, caller, tes
|
|
|
773
765
|
return /* @__PURE__ */ React5.createElement(IconButton, {
|
|
774
766
|
...density === "coarse" ? coarseActionButtonProps : fineActionButtonProps,
|
|
775
767
|
variant,
|
|
776
|
-
classNames:
|
|
768
|
+
classNames: [
|
|
769
|
+
"shrink-0",
|
|
770
|
+
hoverableControlItem,
|
|
771
|
+
hoverableOpenControlItem,
|
|
772
|
+
iconOnly ? "pli-2 pointer-fine:pli-1" : "p-2 pointer-fine:p-2 mie-1"
|
|
773
|
+
],
|
|
777
774
|
icon: icon ?? fallbackIcon,
|
|
778
775
|
iconOnly,
|
|
779
776
|
label: baseLabel,
|
|
780
777
|
disabled,
|
|
781
778
|
onClick: (event) => {
|
|
779
|
+
event.stopPropagation();
|
|
782
780
|
if (disabled) {
|
|
783
781
|
return;
|
|
784
782
|
}
|
|
785
|
-
event.stopPropagation();
|
|
786
783
|
void invoke?.(caller ? {
|
|
787
784
|
parent,
|
|
788
785
|
caller
|
|
@@ -799,7 +796,7 @@ var NavTreeItemMonolithicAction = ({ parent, properties: { disabled, caller, tes
|
|
|
799
796
|
var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) => {
|
|
800
797
|
var _effect = _useSignals5();
|
|
801
798
|
try {
|
|
802
|
-
const { t } = useTranslation5(
|
|
799
|
+
const { t } = useTranslation5(meta.id);
|
|
803
800
|
const monolithicAction = menuActions?.length === 1 && menuActions[0];
|
|
804
801
|
const baseLabel = toLocalizedString4(monolithicAction ? monolithicAction.properties.label : props.label, t);
|
|
805
802
|
return monolithic && menuActions?.length === 1 ? /* @__PURE__ */ React5.createElement(NavTreeItemMonolithicAction, {
|
|
@@ -820,42 +817,46 @@ var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) =>
|
|
|
820
817
|
// src/components/NavTreeItem/NavTreeItemColumns.tsx
|
|
821
818
|
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
822
819
|
import React6, { Fragment, memo } from "react";
|
|
823
|
-
import { isAction as
|
|
824
|
-
import {
|
|
825
|
-
var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open
|
|
820
|
+
import { isAction as isAction2 } from "@dxos/app-graph";
|
|
821
|
+
import { Popover, Treegrid, toLocalizedString as toLocalizedString5, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
822
|
+
var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open }) => {
|
|
826
823
|
var _effect = _useSignals6();
|
|
827
824
|
try {
|
|
828
|
-
const { t } = useTranslation6(
|
|
829
|
-
const {
|
|
825
|
+
const { t } = useTranslation6(meta.id);
|
|
826
|
+
const { useActions: useActions3, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();
|
|
830
827
|
const level = path.length - 2;
|
|
831
|
-
const { actions: _actions, groupedActions } =
|
|
832
|
-
const [primaryAction, ...secondaryActions] = _actions.toSorted((a,
|
|
833
|
-
const actions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) =>
|
|
828
|
+
const { actions: _actions, groupedActions } = useActions3(item);
|
|
829
|
+
const [primaryAction, ...secondaryActions] = _actions.toSorted((a, _b) => a.properties?.disposition === "list-item-primary" ? -1 : 1);
|
|
830
|
+
const actions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) => isAction2(action) ? [
|
|
834
831
|
action
|
|
835
832
|
] : []).filter((a) => [
|
|
836
833
|
"list-item",
|
|
837
834
|
"list-item-primary"
|
|
838
835
|
].includes(a.properties?.disposition));
|
|
839
|
-
const ActionRoot = popoverAnchorId === `dxos.org/ui/${NAV_TREE_ITEM}/${item.id}` ? Popover.Anchor : Fragment;
|
|
840
836
|
useLoadDescendents(item);
|
|
841
|
-
useLoadDescendents(primaryAction && !
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
}, /* @__PURE__ */ React6.createElement("div", {
|
|
837
|
+
useLoadDescendents(primaryAction && !isAction2(primaryAction) ? primaryAction : void 0);
|
|
838
|
+
const ActionRoot = popoverAnchorId === `dxos.org/ui/${NAV_TREE_ITEM}/${item.id}` ? Popover.Anchor : Fragment;
|
|
839
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
845
840
|
role: "none",
|
|
846
841
|
className: "contents app-no-drag"
|
|
847
|
-
}, primaryAction?.properties?.disposition === "list-item-primary" && !primaryAction?.properties?.disabled ? /* @__PURE__ */ React6.createElement(
|
|
842
|
+
}, primaryAction?.properties?.disposition === "list-item-primary" && !primaryAction?.properties?.disabled ? /* @__PURE__ */ React6.createElement(Treegrid.Cell, {
|
|
843
|
+
classNames: "contents"
|
|
844
|
+
}, /* @__PURE__ */ React6.createElement(NavTreeItemAction, {
|
|
848
845
|
testId: primaryAction.properties?.testId,
|
|
849
846
|
label: toLocalizedString5(primaryAction.properties?.label, t),
|
|
850
847
|
icon: primaryAction.properties?.icon ?? "ph--placeholder--regular",
|
|
851
848
|
parent: item,
|
|
852
|
-
monolithic:
|
|
853
|
-
menuActions:
|
|
849
|
+
monolithic: isAction2(primaryAction),
|
|
850
|
+
menuActions: isAction2(primaryAction) ? [
|
|
854
851
|
primaryAction
|
|
855
852
|
] : groupedActions[primaryAction.id],
|
|
856
853
|
menuType: primaryAction.properties?.menuType,
|
|
857
854
|
caller: NAV_TREE_ITEM
|
|
858
|
-
}) : /* @__PURE__ */ React6.createElement(Treegrid.Cell,
|
|
855
|
+
})) : /* @__PURE__ */ React6.createElement(Treegrid.Cell, {
|
|
856
|
+
role: "none"
|
|
857
|
+
}), /* @__PURE__ */ React6.createElement(ActionRoot, null, actions.length > 0 ? /* @__PURE__ */ React6.createElement(Treegrid.Cell, {
|
|
858
|
+
classNames: "contents"
|
|
859
|
+
}, /* @__PURE__ */ React6.createElement(NavTreeItemAction, {
|
|
859
860
|
testId: `navtree.treeItem.actionsLevel${level}`,
|
|
860
861
|
label: t("tree item actions label"),
|
|
861
862
|
icon: "ph--dots-three-vertical--regular",
|
|
@@ -863,7 +864,11 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
863
864
|
menuActions: actions,
|
|
864
865
|
menuType: "dropdown",
|
|
865
866
|
caller: NAV_TREE_ITEM
|
|
866
|
-
}) : /* @__PURE__ */ React6.createElement(Treegrid.Cell,
|
|
867
|
+
})) : /* @__PURE__ */ React6.createElement(Treegrid.Cell, {
|
|
868
|
+
role: "none"
|
|
869
|
+
})), ItemEnd && /* @__PURE__ */ React6.createElement(Treegrid.Cell, {
|
|
870
|
+
classNames: "contents"
|
|
871
|
+
}, /* @__PURE__ */ React6.createElement(ItemEnd, {
|
|
867
872
|
node: item,
|
|
868
873
|
open
|
|
869
874
|
})));
|
|
@@ -873,30 +878,14 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
873
878
|
});
|
|
874
879
|
|
|
875
880
|
// src/components/Sidebar/L1Panel.tsx
|
|
876
|
-
var
|
|
877
|
-
var TitleButton = ({ title, onClick }) => {
|
|
878
|
-
var _effect = _useSignals7();
|
|
879
|
-
try {
|
|
880
|
-
return /* @__PURE__ */ React7.createElement(Button3, {
|
|
881
|
-
variant: "ghost",
|
|
882
|
-
classNames: "pli-1 flex-1 group text-start justify-start bs-[--rail-action] font-normal",
|
|
883
|
-
onClick
|
|
884
|
-
}, /* @__PURE__ */ React7.createElement(Icon3, {
|
|
885
|
-
icon: "ph--caret-left--bold",
|
|
886
|
-
size: 3
|
|
887
|
-
}), /* @__PURE__ */ React7.createElement("span", {
|
|
888
|
-
className: mx4(headingBackButtonLabel)
|
|
889
|
-
}, title));
|
|
890
|
-
} finally {
|
|
891
|
-
_effect.f();
|
|
892
|
-
}
|
|
893
|
-
};
|
|
894
|
-
var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
|
|
881
|
+
var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
|
|
895
882
|
var _effect = _useSignals7();
|
|
896
883
|
try {
|
|
897
|
-
const {
|
|
898
|
-
const {
|
|
899
|
-
const
|
|
884
|
+
const { t } = useTranslation7(meta.id);
|
|
885
|
+
const { isAlternateTree, ...navTreeContext } = useNavTreeContext();
|
|
886
|
+
const title = toLocalizedString6(item.properties.label, t);
|
|
887
|
+
const { useItems: useItems2 } = navTreeContext;
|
|
888
|
+
const alternateTree = useItems2(item, {
|
|
900
889
|
disposition: "alternate-tree"
|
|
901
890
|
})[0];
|
|
902
891
|
const alternatePath = useMemo3(() => [
|
|
@@ -906,34 +895,16 @@ var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
|
|
|
906
895
|
item.id,
|
|
907
896
|
path
|
|
908
897
|
]);
|
|
909
|
-
const handleOpen = useCallback2(() => setAlternateTree?.(alternatePath, true), [
|
|
910
|
-
alternatePath,
|
|
911
|
-
setAlternateTree
|
|
912
|
-
]);
|
|
913
898
|
const isAlternate = isAlternateTree?.(alternatePath, item) ?? false;
|
|
914
899
|
const useAlternateItems = useCallback2((node, { disposition } = {}) => {
|
|
915
|
-
return
|
|
900
|
+
return useItems2(node, {
|
|
916
901
|
disposition,
|
|
917
902
|
sort: node?.id === alternateTree.id
|
|
918
903
|
});
|
|
919
904
|
}, [
|
|
920
|
-
|
|
921
|
-
|
|
905
|
+
alternateTree,
|
|
906
|
+
useItems2
|
|
922
907
|
]);
|
|
923
|
-
const handleBack = useCallback2(() => {
|
|
924
|
-
if (isAlternate) {
|
|
925
|
-
setAlternateTree?.(alternatePath, false);
|
|
926
|
-
} else {
|
|
927
|
-
onBack?.();
|
|
928
|
-
}
|
|
929
|
-
}, [
|
|
930
|
-
isAlternate,
|
|
931
|
-
onBack,
|
|
932
|
-
alternatePath,
|
|
933
|
-
setAlternateTree
|
|
934
|
-
]);
|
|
935
|
-
const title = toLocalizedString6(item.properties.label, t);
|
|
936
|
-
const backCapable = item.id.startsWith("!") || isAlternate;
|
|
937
908
|
return /* @__PURE__ */ React7.createElement(Tabs2.Tabpanel, {
|
|
938
909
|
key: item.id,
|
|
939
910
|
value: item.id,
|
|
@@ -946,97 +917,139 @@ var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
|
|
|
946
917
|
tabIndex: -1,
|
|
947
918
|
"aria-label": title,
|
|
948
919
|
...!open && {
|
|
949
|
-
inert:
|
|
920
|
+
inert: true
|
|
950
921
|
}
|
|
951
|
-
}, item.id === currentItemId && /* @__PURE__ */ React7.createElement(
|
|
952
|
-
|
|
953
|
-
},
|
|
954
|
-
title,
|
|
955
|
-
onClick: handleBack
|
|
956
|
-
}) : /* @__PURE__ */ React7.createElement("span", {
|
|
957
|
-
className: "flex-1 truncate min-is-0 pis-6"
|
|
958
|
-
}, title), alternateTree && !isAlternate && /* @__PURE__ */ React7.createElement(IconButton2, {
|
|
959
|
-
variant: "ghost",
|
|
960
|
-
classNames: mx4("shrink-0", hoverableControlItem2, hoverableOpenControlItem2, "pli-2 pointer-fine:pli-1"),
|
|
961
|
-
iconOnly: true,
|
|
962
|
-
size: 5,
|
|
963
|
-
icon: alternateTree.properties.icon ?? "ph--placeholder--regular",
|
|
964
|
-
label: toLocalizedString6(alternateTree.properties.label ?? alternateTree.id, t),
|
|
965
|
-
"data-testid": "treeView.alternateTreeButton",
|
|
966
|
-
onClick: handleOpen
|
|
967
|
-
}), /* @__PURE__ */ React7.createElement(NavTreeItemColumns, {
|
|
922
|
+
}, item.id === currentItemId && /* @__PURE__ */ React7.createElement(DensityProvider, {
|
|
923
|
+
density: "fine"
|
|
924
|
+
}, /* @__PURE__ */ React7.createElement(L1PanelHeader, {
|
|
968
925
|
path,
|
|
969
926
|
item,
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
})
|
|
927
|
+
currentItemId,
|
|
928
|
+
onBack
|
|
929
|
+
}), /* @__PURE__ */ React7.createElement("div", {
|
|
973
930
|
role: "none",
|
|
974
931
|
className: "overflow-y-auto"
|
|
975
932
|
}, isAlternate ? /* @__PURE__ */ React7.createElement(Tree, {
|
|
976
933
|
...navTreeContext,
|
|
977
|
-
useItems: useAlternateItems,
|
|
978
934
|
id: alternateTree.id,
|
|
979
935
|
root: alternateTree,
|
|
980
936
|
path: alternatePath,
|
|
981
937
|
levelOffset: 5,
|
|
982
938
|
gridTemplateColumns: "[tree-row-start] 1fr min-content min-content min-content [tree-row-end]",
|
|
983
|
-
renderColumns: NavTreeItemColumns
|
|
939
|
+
renderColumns: NavTreeItemColumns,
|
|
940
|
+
useItems: useAlternateItems
|
|
984
941
|
}) : /* @__PURE__ */ React7.createElement(Tree, {
|
|
985
942
|
...navTreeContext,
|
|
986
943
|
id: item.id,
|
|
987
944
|
root: item,
|
|
988
945
|
path,
|
|
989
946
|
levelOffset: 5,
|
|
990
|
-
draggable: true,
|
|
991
947
|
gridTemplateColumns: "[tree-row-start] 1fr min-content min-content min-content [tree-row-end]",
|
|
992
|
-
renderColumns: NavTreeItemColumns
|
|
948
|
+
renderColumns: NavTreeItemColumns,
|
|
949
|
+
draggable: true
|
|
993
950
|
}))));
|
|
994
951
|
} finally {
|
|
995
952
|
_effect.f();
|
|
996
953
|
}
|
|
997
954
|
};
|
|
998
|
-
var
|
|
955
|
+
var L1PanelHeader = ({ item, path, onBack }) => {
|
|
999
956
|
var _effect = _useSignals7();
|
|
1000
957
|
try {
|
|
1001
|
-
const {
|
|
1002
|
-
|
|
1003
|
-
const
|
|
1004
|
-
const
|
|
958
|
+
const { t } = useTranslation7(meta.id);
|
|
959
|
+
const { isAlternateTree, setAlternateTree, ...navTreeContext } = useNavTreeContext();
|
|
960
|
+
const title = toLocalizedString6(item.properties.label, t);
|
|
961
|
+
const alternateTree = navTreeContext.useItems(item, {
|
|
962
|
+
disposition: "alternate-tree"
|
|
963
|
+
})[0];
|
|
964
|
+
const alternatePath = useMemo3(() => [
|
|
1005
965
|
...path,
|
|
1006
966
|
item.id
|
|
1007
967
|
], [
|
|
1008
968
|
item.id,
|
|
1009
969
|
path
|
|
1010
970
|
]);
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
971
|
+
const isAlternate = isAlternateTree?.(alternatePath, item) ?? false;
|
|
972
|
+
const backCapable = item.id.startsWith("!") || isAlternate;
|
|
973
|
+
const handleOpen = useCallback2(() => {
|
|
974
|
+
setAlternateTree?.(alternatePath, true);
|
|
975
|
+
}, [
|
|
976
|
+
alternatePath,
|
|
977
|
+
setAlternateTree
|
|
978
|
+
]);
|
|
979
|
+
const handleBack = useCallback2(() => {
|
|
980
|
+
if (isAlternate) {
|
|
981
|
+
setAlternateTree?.(alternatePath, false);
|
|
982
|
+
} else {
|
|
983
|
+
onBack?.();
|
|
984
|
+
}
|
|
985
|
+
}, [
|
|
986
|
+
isAlternate,
|
|
987
|
+
alternatePath,
|
|
988
|
+
setAlternateTree,
|
|
989
|
+
onBack
|
|
990
|
+
]);
|
|
991
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
992
|
+
className: "flex is-full items-center border-be border-subduedSeparator app-drag density-coarse"
|
|
993
|
+
}, /* @__PURE__ */ React7.createElement("div", {
|
|
994
|
+
className: "is-6"
|
|
995
|
+
}), /* @__PURE__ */ React7.createElement("h2", {
|
|
996
|
+
className: "flex-1 truncate min-is-0"
|
|
997
|
+
}, title), backCapable && /* @__PURE__ */ React7.createElement(IconButton2, {
|
|
998
|
+
variant: "ghost",
|
|
999
|
+
icon: "ph--arrow-u-down-left--regular",
|
|
1000
|
+
iconOnly: true,
|
|
1001
|
+
label: t("button back"),
|
|
1002
|
+
classNames: [
|
|
1003
|
+
hoverableControlItem2,
|
|
1004
|
+
hoverableOpenControlItem2,
|
|
1005
|
+
"pointer-fine:pli-1"
|
|
1006
|
+
],
|
|
1007
|
+
onClick: handleBack
|
|
1008
|
+
}) || alternateTree && !isAlternate && /* @__PURE__ */ React7.createElement(IconButton2, {
|
|
1009
|
+
"data-testid": "treeView.alternateTreeButton",
|
|
1010
|
+
variant: "ghost",
|
|
1011
|
+
icon: alternateTree.properties.icon ?? "ph--placeholder--regular",
|
|
1012
|
+
iconOnly: true,
|
|
1013
|
+
label: toLocalizedString6(alternateTree.properties.label ?? alternateTree.id, t),
|
|
1014
|
+
classNames: [
|
|
1015
|
+
hoverableControlItem2,
|
|
1016
|
+
hoverableOpenControlItem2,
|
|
1017
|
+
"pointer-fine:pli-1"
|
|
1018
|
+
],
|
|
1019
|
+
onClick: handleOpen
|
|
1020
|
+
}), /* @__PURE__ */ React7.createElement(NavTreeItemColumns, {
|
|
1021
|
+
open: true,
|
|
1022
|
+
path,
|
|
1023
|
+
item,
|
|
1024
|
+
density: "coarse"
|
|
1025
|
+
}));
|
|
1017
1026
|
} finally {
|
|
1018
1027
|
_effect.f();
|
|
1019
1028
|
}
|
|
1020
1029
|
};
|
|
1021
|
-
|
|
1022
|
-
|
|
1030
|
+
|
|
1031
|
+
// src/components/Sidebar/L1Tabs.tsx
|
|
1032
|
+
import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
|
|
1033
|
+
import React8, { useMemo as useMemo4 } from "react";
|
|
1034
|
+
var L1Tabs = ({ topLevelItems, onBack, ...props }) => {
|
|
1035
|
+
var _effect = _useSignals8();
|
|
1023
1036
|
try {
|
|
1024
|
-
return /* @__PURE__ */
|
|
1037
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, topLevelItems.map((item) => {
|
|
1025
1038
|
const type = l0ItemType(item);
|
|
1026
1039
|
switch (type) {
|
|
1027
|
-
case "collection":
|
|
1028
|
-
return /* @__PURE__ */ React7.createElement(L1PanelCollection, {
|
|
1029
|
-
key: item.id,
|
|
1030
|
-
item,
|
|
1031
|
-
...props
|
|
1032
|
-
});
|
|
1033
1040
|
case "tab":
|
|
1034
|
-
return /* @__PURE__ */
|
|
1041
|
+
return /* @__PURE__ */ React8.createElement(L1Panel, {
|
|
1035
1042
|
key: item.id,
|
|
1036
1043
|
item,
|
|
1037
1044
|
...props,
|
|
1038
1045
|
onBack
|
|
1039
1046
|
});
|
|
1047
|
+
case "collection":
|
|
1048
|
+
return /* @__PURE__ */ React8.createElement(L1PanelCollection, {
|
|
1049
|
+
key: item.id,
|
|
1050
|
+
item,
|
|
1051
|
+
...props
|
|
1052
|
+
});
|
|
1040
1053
|
default:
|
|
1041
1054
|
return null;
|
|
1042
1055
|
}
|
|
@@ -1045,11 +1058,34 @@ var L1Panels = ({ topLevelItems, onBack, ...props }) => {
|
|
|
1045
1058
|
_effect.f();
|
|
1046
1059
|
}
|
|
1047
1060
|
};
|
|
1061
|
+
var L1PanelCollection = ({ item, path, ...props }) => {
|
|
1062
|
+
var _effect = _useSignals8();
|
|
1063
|
+
try {
|
|
1064
|
+
const { useItems: useItems2 } = useNavTreeContext();
|
|
1065
|
+
useLoadDescendents(item);
|
|
1066
|
+
const collectionItems = useItems2(item);
|
|
1067
|
+
const groupPath = useMemo4(() => [
|
|
1068
|
+
...path,
|
|
1069
|
+
item.id
|
|
1070
|
+
], [
|
|
1071
|
+
item.id,
|
|
1072
|
+
path
|
|
1073
|
+
]);
|
|
1074
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, collectionItems.filter((item2) => l0ItemType(item2) === "tab").map((item2) => /* @__PURE__ */ React8.createElement(L1Panel, {
|
|
1075
|
+
key: item2.id,
|
|
1076
|
+
item: item2,
|
|
1077
|
+
path: groupPath,
|
|
1078
|
+
...props
|
|
1079
|
+
})));
|
|
1080
|
+
} finally {
|
|
1081
|
+
_effect.f();
|
|
1082
|
+
}
|
|
1083
|
+
};
|
|
1048
1084
|
|
|
1049
1085
|
// src/components/NavTree/NavTree.tsx
|
|
1050
1086
|
var NAV_TREE_ITEM = "NavTreeItem";
|
|
1051
1087
|
var NavTree = ({ id, root, ...props }) => {
|
|
1052
|
-
var _effect =
|
|
1088
|
+
var _effect = _useSignals9();
|
|
1053
1089
|
try {
|
|
1054
1090
|
const { tab, useItems: useItems2, onBack } = useNavTreeContext();
|
|
1055
1091
|
const topLevelActions = useItems2(root, {
|
|
@@ -1065,7 +1101,7 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1065
1101
|
const topLevelNavigation = useItems2(root, {
|
|
1066
1102
|
disposition: "navigation"
|
|
1067
1103
|
});
|
|
1068
|
-
const l0Items =
|
|
1104
|
+
const l0Items = useMemo5(() => [
|
|
1069
1105
|
// prettier-ignore
|
|
1070
1106
|
...topLevelCollections,
|
|
1071
1107
|
...topLevelWorkspaces,
|
|
@@ -1082,7 +1118,7 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1082
1118
|
const userAccountItem = useItems2(root, {
|
|
1083
1119
|
disposition: "user-account"
|
|
1084
1120
|
})[0];
|
|
1085
|
-
const topLevelItems =
|
|
1121
|
+
const topLevelItems = useMemo5(() => [
|
|
1086
1122
|
// prettier-ignore
|
|
1087
1123
|
...l0Items,
|
|
1088
1124
|
...pinnedItems,
|
|
@@ -1095,46 +1131,44 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1095
1131
|
userAccountItem
|
|
1096
1132
|
]);
|
|
1097
1133
|
useLoadDescendents(root);
|
|
1098
|
-
const path =
|
|
1134
|
+
const path = useMemo5(() => [
|
|
1099
1135
|
id
|
|
1100
1136
|
], [
|
|
1101
1137
|
id
|
|
1102
1138
|
]);
|
|
1103
|
-
return
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1139
|
+
return (
|
|
1140
|
+
// TODO(thure): `Tabs.Root` forces all items that should be able to receive focus to use `Tabs.Tab(Primitive)` since
|
|
1141
|
+
// it uses RovingFocus and doesn’t support moving focus to an item that is not a tab. Assess whether this situation
|
|
1142
|
+
// should change including whether it should motivate a change in the design/taxonomy, or if this means this should
|
|
1143
|
+
// not use `react-ui-tabs` at all.
|
|
1144
|
+
/* @__PURE__ */ React9.createElement(Tabs3.Root, {
|
|
1145
|
+
value: tab,
|
|
1146
|
+
orientation: "vertical",
|
|
1147
|
+
verticalVariant: "stateless",
|
|
1148
|
+
classNames: "relative"
|
|
1149
|
+
}, /* @__PURE__ */ React9.createElement(L0Menu, {
|
|
1150
|
+
menuActions: topLevelActions,
|
|
1151
|
+
topLevelItems: l0Items,
|
|
1152
|
+
pinnedItems,
|
|
1153
|
+
userAccountItem,
|
|
1154
|
+
path,
|
|
1155
|
+
parent: root
|
|
1156
|
+
}), /* @__PURE__ */ React9.createElement(L1Tabs, {
|
|
1157
|
+
topLevelItems,
|
|
1158
|
+
path,
|
|
1159
|
+
currentItemId: tab,
|
|
1160
|
+
onBack,
|
|
1161
|
+
...props
|
|
1162
|
+
}))
|
|
1163
|
+
);
|
|
1122
1164
|
} finally {
|
|
1123
1165
|
_effect.f();
|
|
1124
1166
|
}
|
|
1125
1167
|
};
|
|
1126
1168
|
|
|
1127
|
-
// src/capabilities/index.ts
|
|
1128
|
-
import { lazy } from "@dxos/app-framework";
|
|
1129
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-5J4LRWDX.mjs"));
|
|
1130
|
-
var IntentResolver = lazy(() => import("./intent-resolver-3XYN2CBU.mjs"));
|
|
1131
|
-
var Keyboard2 = lazy(() => import("./keyboard-QRS6WOQH.mjs"));
|
|
1132
|
-
var ReactSurface = lazy(() => import("./react-surface-N2HPMYCU.mjs"));
|
|
1133
|
-
var State = lazy(() => import("./state-54DY3DOY.mjs"));
|
|
1134
|
-
|
|
1135
1169
|
// src/components/NavTreeContainer.tsx
|
|
1136
1170
|
var NODE_TYPE = "dxos/app-graph/node";
|
|
1137
|
-
var renderItemEnd = ({ node, open }) => /* @__PURE__ */
|
|
1171
|
+
var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Surface, {
|
|
1138
1172
|
role: "navtree-item-end",
|
|
1139
1173
|
data: {
|
|
1140
1174
|
id: node.id,
|
|
@@ -1143,12 +1177,12 @@ var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React9.createElement(Sur
|
|
|
1143
1177
|
},
|
|
1144
1178
|
limit: 1
|
|
1145
1179
|
});
|
|
1146
|
-
var getChildrenFilter = (node) => untracked(() => !isActionLike2(node) && node.type !== PLANK_COMPANION_TYPE);
|
|
1180
|
+
var getChildrenFilter = (node) => untracked(() => !isActionLike2(node) && node.type !== PLANK_COMPANION_TYPE && node.properties.disposition !== "hidden");
|
|
1147
1181
|
var filterItems = (node, disposition) => {
|
|
1148
1182
|
if (!disposition && (node.properties.disposition === "hidden" || node.properties.disposition === "alternate-tree")) {
|
|
1149
1183
|
return false;
|
|
1150
1184
|
} else if (!disposition) {
|
|
1151
|
-
const action =
|
|
1185
|
+
const action = isAction3(node);
|
|
1152
1186
|
return !action || node.properties.disposition === "item";
|
|
1153
1187
|
} else {
|
|
1154
1188
|
return node.properties.disposition === disposition;
|
|
@@ -1159,34 +1193,51 @@ var getItems = (graph, node, disposition) => {
|
|
|
1159
1193
|
};
|
|
1160
1194
|
var useItems = (node, options) => {
|
|
1161
1195
|
const { graph } = useAppGraph2();
|
|
1162
|
-
const connections = useConnections(graph, node?.id ?? ROOT_ID)
|
|
1163
|
-
|
|
1196
|
+
const connections = useConnections(graph, node?.id ?? ROOT_ID);
|
|
1197
|
+
const filtered = connections.filter((node2) => filterItems(node2, options?.disposition));
|
|
1198
|
+
return options?.sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
|
|
1199
|
+
};
|
|
1200
|
+
var useActions2 = (node) => {
|
|
1201
|
+
const { graph } = useAppGraph2();
|
|
1202
|
+
const actions = useGraphActions(graph, node.id);
|
|
1203
|
+
return useMemo6(() => actions.reduce((acc, arg) => {
|
|
1204
|
+
if (arg.properties.disposition === "item") {
|
|
1205
|
+
return acc;
|
|
1206
|
+
}
|
|
1207
|
+
acc.actions.push(arg);
|
|
1208
|
+
if (!isAction3(arg)) {
|
|
1209
|
+
const actionGroup = graph.getActions(arg.id);
|
|
1210
|
+
acc.groupedActions[arg.id] = actionGroup;
|
|
1211
|
+
}
|
|
1212
|
+
return acc;
|
|
1213
|
+
}, {
|
|
1214
|
+
actions: [],
|
|
1215
|
+
groupedActions: {}
|
|
1216
|
+
}), [
|
|
1217
|
+
actions
|
|
1218
|
+
]);
|
|
1164
1219
|
};
|
|
1165
1220
|
var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar }) => {
|
|
1166
|
-
var _effect =
|
|
1221
|
+
var _effect = _useSignals10();
|
|
1167
1222
|
try {
|
|
1168
|
-
const [isLg] = useMediaQuery2("lg"
|
|
1169
|
-
ssr: false
|
|
1170
|
-
});
|
|
1223
|
+
const [isLg] = useMediaQuery2("lg");
|
|
1171
1224
|
const { dispatchPromise: dispatch } = useIntentDispatcher3();
|
|
1172
1225
|
const { graph } = useAppGraph2();
|
|
1173
1226
|
const { isOpen, isCurrent, isAlternateTree, setItem } = useCapability(NavTreeCapabilities.State);
|
|
1174
1227
|
const layout = useLayout();
|
|
1175
|
-
const { navigationSidebarState } = useSidebars(
|
|
1176
|
-
const getActions2 = useCallback3((node) => getActions(graph, node), [
|
|
1177
|
-
graph
|
|
1178
|
-
]);
|
|
1228
|
+
const { navigationSidebarState } = useSidebars(meta.id);
|
|
1179
1229
|
const getProps = useCallback3((node, path) => {
|
|
1180
1230
|
const children = getChildren(graph, node, path).filter(getChildrenFilter);
|
|
1181
1231
|
const parentOf = children.length > 0 ? children.map(({ id }) => id) : node.properties.role === "branch" ? [] : void 0;
|
|
1182
1232
|
return {
|
|
1183
1233
|
id: node.id,
|
|
1184
|
-
label: node.properties.label ?? node.id,
|
|
1185
1234
|
parentOf,
|
|
1186
|
-
icon: node.properties.icon,
|
|
1187
1235
|
disabled: node.properties.disabled,
|
|
1188
|
-
|
|
1236
|
+
label: node.properties.label ?? node.id,
|
|
1237
|
+
className: mx3(node.properties.className, node.properties.modified && "italic"),
|
|
1189
1238
|
headingClassName: node.properties.headingClassName,
|
|
1239
|
+
icon: node.properties.icon,
|
|
1240
|
+
iconHue: node.properties.iconHue,
|
|
1190
1241
|
testId: node.properties.testId
|
|
1191
1242
|
};
|
|
1192
1243
|
}, [
|
|
@@ -1238,11 +1289,14 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1238
1289
|
const canDrop = useCallback3(({ source, target }) => {
|
|
1239
1290
|
return target.item.properties.canDrop?.(source) ?? false;
|
|
1240
1291
|
}, []);
|
|
1292
|
+
const canSelect = useCallback3(({ item }) => {
|
|
1293
|
+
return item.properties.selectable ?? true;
|
|
1294
|
+
}, []);
|
|
1241
1295
|
const handleSelect = useCallback3(({ item: node, path, option }) => {
|
|
1242
1296
|
if (!node.data) {
|
|
1243
1297
|
return;
|
|
1244
1298
|
}
|
|
1245
|
-
if (
|
|
1299
|
+
if (isAction3(node)) {
|
|
1246
1300
|
const [parent] = graph.getConnections(node.id, "inbound");
|
|
1247
1301
|
void (parent && node.data({
|
|
1248
1302
|
parent,
|
|
@@ -1278,7 +1332,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1278
1332
|
}));
|
|
1279
1333
|
}
|
|
1280
1334
|
const defaultAction = graph.getActions(node.id).find((action) => action.properties?.disposition === "default");
|
|
1281
|
-
if (
|
|
1335
|
+
if (isAction3(defaultAction)) {
|
|
1282
1336
|
void defaultAction.data();
|
|
1283
1337
|
}
|
|
1284
1338
|
if (!isLg) {
|
|
@@ -1358,10 +1412,10 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1358
1412
|
}, [
|
|
1359
1413
|
setItem
|
|
1360
1414
|
]);
|
|
1361
|
-
const navTreeContextValue =
|
|
1415
|
+
const navTreeContextValue = useMemo6(() => ({
|
|
1362
1416
|
useItems,
|
|
1363
1417
|
tab,
|
|
1364
|
-
|
|
1418
|
+
useActions: useActions2,
|
|
1365
1419
|
loadDescendents,
|
|
1366
1420
|
renderItemEnd,
|
|
1367
1421
|
popoverAnchorId,
|
|
@@ -1370,6 +1424,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1370
1424
|
isCurrent,
|
|
1371
1425
|
isOpen,
|
|
1372
1426
|
canDrop,
|
|
1427
|
+
canSelect,
|
|
1373
1428
|
isAlternateTree,
|
|
1374
1429
|
setAlternateTree,
|
|
1375
1430
|
onTabChange: handleTabChange,
|
|
@@ -1378,7 +1433,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1378
1433
|
onBack: handleBack
|
|
1379
1434
|
}), [
|
|
1380
1435
|
tab,
|
|
1381
|
-
|
|
1436
|
+
useActions2,
|
|
1382
1437
|
loadDescendents,
|
|
1383
1438
|
renderItemEnd,
|
|
1384
1439
|
popoverAnchorId,
|
|
@@ -1387,6 +1442,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1387
1442
|
isCurrent,
|
|
1388
1443
|
isOpen,
|
|
1389
1444
|
canDrop,
|
|
1445
|
+
canSelect,
|
|
1390
1446
|
isAlternateTree,
|
|
1391
1447
|
setAlternateTree,
|
|
1392
1448
|
handleTabChange,
|
|
@@ -1394,9 +1450,9 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1394
1450
|
handleSelect,
|
|
1395
1451
|
handleBack
|
|
1396
1452
|
]);
|
|
1397
|
-
return /* @__PURE__ */
|
|
1453
|
+
return /* @__PURE__ */ React10.createElement(NavTreeContext.Provider, {
|
|
1398
1454
|
value: navTreeContextValue
|
|
1399
|
-
}, /* @__PURE__ */
|
|
1455
|
+
}, /* @__PURE__ */ React10.createElement(NavTree, {
|
|
1400
1456
|
id: ROOT_ID,
|
|
1401
1457
|
root: graph.root,
|
|
1402
1458
|
open: layout.sidebarOpen
|
|
@@ -1414,7 +1470,6 @@ export {
|
|
|
1414
1470
|
resolveMigrationOperation,
|
|
1415
1471
|
sortActions,
|
|
1416
1472
|
getChildren,
|
|
1417
|
-
getActions,
|
|
1418
1473
|
l0ItemType,
|
|
1419
1474
|
NODE_TYPE,
|
|
1420
1475
|
NavTreeContainer,
|
|
@@ -1425,4 +1480,4 @@ export {
|
|
|
1425
1480
|
ReactSurface,
|
|
1426
1481
|
State
|
|
1427
1482
|
};
|
|
1428
|
-
//# sourceMappingURL=chunk-
|
|
1483
|
+
//# sourceMappingURL=chunk-7D2MPHXV.mjs.map
|