@dxos/plugin-navtree 0.8.4-main.fd6878d → 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-6JDBQ25U.mjs → app-graph-builder-OHSCN3GX.mjs} +11 -10
- 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-SNGLGBFJ.mjs → chunk-7D2MPHXV.mjs} +128 -114
- 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 +5 -7
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-N35ZIHFD.mjs → intent-resolver-YUVXVPHG.mjs} +6 -6
- package/dist/lib/browser/intent-resolver-YUVXVPHG.mjs.map +7 -0
- package/dist/lib/browser/{keyboard-HMTMA33N.mjs → keyboard-YYTYJW4M.mjs} +4 -4
- package/dist/lib/browser/{keyboard-HMTMA33N.mjs.map → keyboard-YYTYJW4M.mjs.map} +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-WKWXMM2N.mjs → react-surface-J7MWWAGD.mjs} +10 -10
- package/dist/lib/browser/react-surface-J7MWWAGD.mjs.map +7 -0
- package/dist/lib/browser/{state-P5DGL7KS.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 +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts +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.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 +1 -1
- 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.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/events.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.d.ts +1 -2
- 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/types.d.ts +4 -3
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +48 -48
- package/src/NavTreePlugin.tsx +70 -71
- package/src/capabilities/app-graph-builder.ts +8 -7
- package/src/capabilities/capabilities.ts +2 -2
- package/src/capabilities/intent-resolver.ts +1 -1
- package/src/capabilities/react-surface.tsx +4 -4
- package/src/capabilities/state.ts +2 -2
- package/src/components/CommandsDialog/CommandsDialog.tsx +14 -6
- package/src/components/CommandsDialog/CommandsTrigger.tsx +4 -3
- package/src/components/NavTree/NavTree.stories.tsx +65 -51
- package/src/components/NavTree/NavTree.tsx +4 -0
- package/src/components/NavTreeContainer.tsx +54 -22
- package/src/components/NavTreeDocumentTitle.tsx +2 -2
- package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +4 -6
- package/src/components/NavTreeItem/NavTreeItemAction.tsx +5 -4
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +27 -21
- package/src/components/Sidebar/L0Menu.tsx +54 -53
- package/src/components/Sidebar/L1Panel.tsx +23 -28
- package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +9 -8
- package/src/components/UserAccountAvatar/UserAccountAvatar.tsx +20 -12
- package/src/events.ts +2 -2
- package/src/experimental/Tree.stories.tsx +28 -30
- package/src/experimental/Tree.tsx +6 -23
- package/src/meta.ts +10 -7
- package/src/testing/app-graph-builder.ts +19 -18
- package/src/testing/generator.ts +2 -2
- package/src/types.ts +4 -3
- package/dist/lib/browser/app-graph-builder-6JDBQ25U.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-SNGLGBFJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-WCARAZ7J.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-N35ZIHFD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-WKWXMM2N.mjs.map +0 -7
- package/dist/lib/browser/state-P5DGL7KS.mjs.map +0 -7
|
@@ -1,17 +1,17 @@
|
|
|
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
|
-
NAVTREE_PLUGIN,
|
|
8
7
|
meta
|
|
9
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-E6MZBCU5.mjs";
|
|
10
9
|
|
|
11
10
|
// src/components/CommandsDialog/CommandsDialog.tsx
|
|
12
11
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
13
12
|
import React, { useMemo, useState } from "react";
|
|
14
|
-
import { LayoutAction, createIntent
|
|
13
|
+
import { LayoutAction, createIntent } from "@dxos/app-framework";
|
|
14
|
+
import { useAppGraph, useIntentDispatcher } from "@dxos/app-framework/react";
|
|
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";
|
|
@@ -23,7 +23,7 @@ import { getHostPlatform } from "@dxos/util";
|
|
|
23
23
|
var CommandsDialogContent = ({ selected: initial }) => {
|
|
24
24
|
var _effect = _useSignals();
|
|
25
25
|
try {
|
|
26
|
-
const { t } = useTranslation(
|
|
26
|
+
const { t } = useTranslation(meta.id);
|
|
27
27
|
const [selected, setSelected] = useState(initial);
|
|
28
28
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
29
29
|
const { graph } = useAppGraph();
|
|
@@ -54,7 +54,7 @@ var CommandsDialogContent = ({ selected: initial }) => {
|
|
|
54
54
|
}, /* @__PURE__ */ React.createElement(Dialog.Title, {
|
|
55
55
|
classNames: cardDialogHeader
|
|
56
56
|
}, t("commands dialog title", {
|
|
57
|
-
ns:
|
|
57
|
+
ns: meta.id
|
|
58
58
|
})), /* @__PURE__ */ React.createElement(SearchList.Root, {
|
|
59
59
|
label: t("command list input placeholder"),
|
|
60
60
|
classNames: cardDialogSearchListRoot
|
|
@@ -121,13 +121,14 @@ 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 { LayoutAction as LayoutAction2, createIntent as createIntent2
|
|
124
|
+
import { LayoutAction as LayoutAction2, createIntent as createIntent2 } from "@dxos/app-framework";
|
|
125
|
+
import { useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework/react";
|
|
125
126
|
import { Button as Button2, Icon as Icon2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
126
127
|
var CommandsTrigger = () => {
|
|
127
128
|
var _effect = _useSignals2();
|
|
128
129
|
try {
|
|
129
130
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
130
|
-
const { t } = useTranslation2(
|
|
131
|
+
const { t } = useTranslation2(meta.id);
|
|
131
132
|
return /* @__PURE__ */ React2.createElement(Button2, {
|
|
132
133
|
classNames: "m-1 pli-1 lg:pli-2",
|
|
133
134
|
onClick: () => dispatch(createIntent2(LayoutAction2.UpdateDialog, {
|
|
@@ -217,7 +218,8 @@ import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/ad
|
|
|
217
218
|
import { extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
|
|
218
219
|
import { untracked } from "@preact/signals-core";
|
|
219
220
|
import React10, { memo as memo2, useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo6 } from "react";
|
|
220
|
-
import { LayoutAction as LayoutAction3,
|
|
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";
|
|
221
223
|
import { ROOT_ID, isAction as isAction3, isActionLike as isActionLike2 } from "@dxos/app-graph";
|
|
222
224
|
import { PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
|
|
223
225
|
import { useConnections, useActions as useGraphActions } from "@dxos/plugin-graph";
|
|
@@ -228,11 +230,11 @@ import { arrayMove as arrayMove2, byPosition } from "@dxos/util";
|
|
|
228
230
|
|
|
229
231
|
// src/capabilities/index.ts
|
|
230
232
|
import { lazy } from "@dxos/app-framework";
|
|
231
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-
|
|
232
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
233
|
-
var Keyboard2 = lazy(() => import("./keyboard-
|
|
234
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
235
|
-
var State = lazy(() => import("./state-
|
|
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"));
|
|
236
238
|
|
|
237
239
|
// src/components/NavTree/NavTree.tsx
|
|
238
240
|
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
@@ -252,7 +254,7 @@ var useNavTreeContext = () => useContext(NavTreeContext) ?? raise(new Error("Mis
|
|
|
252
254
|
import { useEffect } from "react";
|
|
253
255
|
import { toLocalizedString as toLocalizedString2, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
254
256
|
var NavTreeDocumentTitle = ({ node }) => {
|
|
255
|
-
const { t } = useTranslation3(
|
|
257
|
+
const { t } = useTranslation3(meta.id);
|
|
256
258
|
useEffect(() => {
|
|
257
259
|
document.title = node ? toLocalizedString2(node.properties.label, t) : t("current app name", {
|
|
258
260
|
ns: "appkit"
|
|
@@ -287,11 +289,12 @@ import { scrollJustEnoughIntoView } from "@atlaskit/pragmatic-drag-and-drop/elem
|
|
|
287
289
|
import { attachClosestEdge, extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
288
290
|
import React4, { forwardRef, useCallback, useLayoutEffect, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
289
291
|
import { invariant } from "@dxos/invariant";
|
|
292
|
+
import { DxAvatar } from "@dxos/lit-ui/react";
|
|
290
293
|
import { Icon as Icon3, ListItem, ScrollArea, Tooltip, toLocalizedString as toLocalizedString3, useMediaQuery, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
291
294
|
import { DropdownMenu, MenuProvider } from "@dxos/react-ui-menu";
|
|
292
295
|
import { Tabs } from "@dxos/react-ui-tabs";
|
|
293
296
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
294
|
-
import { arrayMove
|
|
297
|
+
import { arrayMove } from "@dxos/util";
|
|
295
298
|
|
|
296
299
|
// src/components/UserAccountAvatar/UserAccountAvatar.tsx
|
|
297
300
|
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
@@ -302,8 +305,10 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
|
|
|
302
305
|
var _effect = _useSignals3();
|
|
303
306
|
try {
|
|
304
307
|
const fallbackValue = hexToFallback(userId ?? "0");
|
|
305
|
-
return /* @__PURE__ */ React3.createElement(
|
|
306
|
-
|
|
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",
|
|
307
312
|
"data-joyride": "welcome/account"
|
|
308
313
|
}, /* @__PURE__ */ React3.createElement(Avatar.Root, null, /* @__PURE__ */ React3.createElement(Avatar.Content, {
|
|
309
314
|
variant: "circle",
|
|
@@ -312,7 +317,7 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
|
|
|
312
317
|
hue: hue || fallbackValue.hue,
|
|
313
318
|
fallback: emoji || fallbackValue.emoji,
|
|
314
319
|
"data-testid": "treeView.userAccount"
|
|
315
|
-
})));
|
|
320
|
+
}))));
|
|
316
321
|
} finally {
|
|
317
322
|
_effect.f();
|
|
318
323
|
}
|
|
@@ -322,9 +327,7 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
|
|
|
322
327
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-navtree/src/components/Sidebar/L0Menu.tsx";
|
|
323
328
|
var useL0ItemClick = ({ item, parent, path }, type) => {
|
|
324
329
|
const { tab, isCurrent, onSelect, onTabChange } = useNavTreeContext();
|
|
325
|
-
const [isLg] = useMediaQuery("lg"
|
|
326
|
-
ssr: false
|
|
327
|
-
});
|
|
330
|
+
const [isLg] = useMediaQuery("lg");
|
|
328
331
|
return useCallback((event) => {
|
|
329
332
|
switch (type) {
|
|
330
333
|
case "action": {
|
|
@@ -360,7 +363,7 @@ var useL0ItemClick = ({ item, parent, path }, type) => {
|
|
|
360
363
|
var l0Breakpoints = {
|
|
361
364
|
lg: "hidden lg:grid"
|
|
362
365
|
};
|
|
363
|
-
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';
|
|
364
367
|
var l0ItemContent = "flex justify-center items-center dx-focus-ring-group-indicator transition-colors rounded-sm";
|
|
365
368
|
var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, forwardedRef) => {
|
|
366
369
|
var _effect = _useSignals4();
|
|
@@ -375,7 +378,7 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
|
|
|
375
378
|
item.id,
|
|
376
379
|
path
|
|
377
380
|
]);
|
|
378
|
-
const { t } = useTranslation4(
|
|
381
|
+
const { t } = useTranslation4(meta.id);
|
|
379
382
|
const localizedString = toLocalizedString3(item.properties.label, t);
|
|
380
383
|
const handleClick = useL0ItemClick({
|
|
381
384
|
item,
|
|
@@ -387,21 +390,21 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
|
|
|
387
390
|
tabIndex: 0,
|
|
388
391
|
onClick: handleClick,
|
|
389
392
|
"data-testid": testId,
|
|
390
|
-
"data-
|
|
393
|
+
"data-object-id": id
|
|
391
394
|
} : type !== "collection" ? {
|
|
392
395
|
onClick: handleClick,
|
|
393
396
|
"data-testid": testId,
|
|
394
|
-
"data-
|
|
397
|
+
"data-object-id": id
|
|
395
398
|
} : {
|
|
396
|
-
onClick: handleClick
|
|
399
|
+
onClick: handleClick,
|
|
400
|
+
role: "button"
|
|
397
401
|
};
|
|
398
|
-
const Root = type === "collection" ? "h2" : type === "tab" ? Tabs.TabPrimitive : "button";
|
|
399
402
|
return /* @__PURE__ */ React4.createElement(Tooltip.Trigger, {
|
|
400
403
|
asChild: true,
|
|
401
404
|
delayDuration: 0,
|
|
402
405
|
side: "right",
|
|
403
406
|
content: localizedString
|
|
404
|
-
}, /* @__PURE__ */ React4.createElement(
|
|
407
|
+
}, /* @__PURE__ */ React4.createElement(Tabs.TabPrimitive, {
|
|
405
408
|
...rootProps,
|
|
406
409
|
"data-type": type,
|
|
407
410
|
className: mx2(l0ItemRoot, l0Breakpoints[item.properties.l0Breakpoint]),
|
|
@@ -411,28 +414,13 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
|
|
|
411
414
|
_effect.f();
|
|
412
415
|
}
|
|
413
416
|
});
|
|
414
|
-
var
|
|
417
|
+
var L0ItemActiveTabIndicator = ({ classNames }) => {
|
|
415
418
|
var _effect = _useSignals4();
|
|
416
419
|
try {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
style: {
|
|
422
|
-
color: `var(--dx-${hue}SurfaceText)`
|
|
423
|
-
}
|
|
424
|
-
};
|
|
425
|
-
const localizedString = toLocalizedString3(item.properties.label, t);
|
|
426
|
-
const avatarValue = useMemo2(() => type === "tab" ? getFirstTwoRenderableChars(localizedString).join("").toUpperCase() : [], [
|
|
427
|
-
type,
|
|
428
|
-
item.properties.label,
|
|
429
|
-
t
|
|
430
|
-
]);
|
|
431
|
-
return /* @__PURE__ */ React4.createElement("span", {
|
|
432
|
-
role: "img",
|
|
433
|
-
className: "place-self-center text-xl font-light",
|
|
434
|
-
...hueFgStyle
|
|
435
|
-
}, 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
|
+
});
|
|
436
424
|
} finally {
|
|
437
425
|
_effect.f();
|
|
438
426
|
}
|
|
@@ -440,7 +428,7 @@ var L0Avatar = ({ item }) => {
|
|
|
440
428
|
var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
|
|
441
429
|
var _effect = _useSignals4();
|
|
442
430
|
try {
|
|
443
|
-
const { t } = useTranslation4(
|
|
431
|
+
const { t } = useTranslation4(meta.id);
|
|
444
432
|
const itemElement = useRef(null);
|
|
445
433
|
const [closestEdge, setEdge] = useState2(null);
|
|
446
434
|
const localizedString = toLocalizedString3(item.properties.label, t);
|
|
@@ -529,10 +517,7 @@ var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
|
|
|
529
517
|
className: mx2(l0ItemContent, pinned ? "p-2 group-hover/l0item:bg-activeSurface" : "is-[--l0-avatar-size] bs-[--l0-avatar-size] bg-activeSurface")
|
|
530
518
|
}, /* @__PURE__ */ React4.createElement(ItemAvatar, {
|
|
531
519
|
item
|
|
532
|
-
})), /* @__PURE__ */ React4.createElement("
|
|
533
|
-
role: "none",
|
|
534
|
-
className: "hidden group-aria-selected/l0item:block absolute inline-start-0 inset-block-2 is-1 bg-accentSurface rounded-ie"
|
|
535
|
-
}), /* @__PURE__ */ React4.createElement("span", {
|
|
520
|
+
})), /* @__PURE__ */ React4.createElement(L0ItemActiveTabIndicator, null), /* @__PURE__ */ React4.createElement("span", {
|
|
536
521
|
id: `${item.id}__label`,
|
|
537
522
|
className: "sr-only"
|
|
538
523
|
}, localizedString), closestEdge && /* @__PURE__ */ React4.createElement(ListItem.DropIndicator, {
|
|
@@ -545,6 +530,7 @@ var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
|
|
|
545
530
|
var ItemAvatar = ({ item }) => {
|
|
546
531
|
var _effect = _useSignals4();
|
|
547
532
|
try {
|
|
533
|
+
const { t } = useTranslation4(meta.id);
|
|
548
534
|
const type = l0ItemType(item);
|
|
549
535
|
if (item.properties.icon) {
|
|
550
536
|
const hue = item.properties.hue ?? null;
|
|
@@ -555,13 +541,19 @@ var ItemAvatar = ({ item }) => {
|
|
|
555
541
|
};
|
|
556
542
|
return /* @__PURE__ */ React4.createElement(Icon3, {
|
|
557
543
|
icon: item.properties.icon,
|
|
558
|
-
size:
|
|
544
|
+
size: 6,
|
|
559
545
|
...hueFgStyle
|
|
560
546
|
});
|
|
561
547
|
}
|
|
562
548
|
if (type === "tab" && item.properties.disposition !== "pin-end") {
|
|
563
|
-
|
|
564
|
-
|
|
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
|
|
565
557
|
});
|
|
566
558
|
}
|
|
567
559
|
return null;
|
|
@@ -608,7 +600,7 @@ var L0Collection = ({ item, path }) => {
|
|
|
608
600
|
role: "group",
|
|
609
601
|
className: "contents group/l0c",
|
|
610
602
|
"aria-labelledby": `${item.id}__label`,
|
|
611
|
-
"data-
|
|
603
|
+
"data-object-id": id,
|
|
612
604
|
"data-testid": testId
|
|
613
605
|
}, collectionItems.map((collectionItem) => /* @__PURE__ */ React4.createElement(L0Item, {
|
|
614
606
|
key: collectionItem.id,
|
|
@@ -626,7 +618,7 @@ var L0Collection = ({ item, path }) => {
|
|
|
626
618
|
var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent, path }) => {
|
|
627
619
|
var _effect = _useSignals4();
|
|
628
620
|
try {
|
|
629
|
-
const { t } = useTranslation4(
|
|
621
|
+
const { t } = useTranslation4(meta.id);
|
|
630
622
|
return /* @__PURE__ */ React4.createElement(Tabs.Tablist, {
|
|
631
623
|
classNames: [
|
|
632
624
|
"group/l0 absolute z-[1] inset-block-0 inline-start-0 rounded-is",
|
|
@@ -640,16 +632,20 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
|
|
|
640
632
|
content: t("app menu label"),
|
|
641
633
|
side: "right",
|
|
642
634
|
asChild: true
|
|
635
|
+
}, /* @__PURE__ */ React4.createElement(Tabs.TabPrimitive, {
|
|
636
|
+
value: "options",
|
|
637
|
+
asChild: true,
|
|
638
|
+
role: "button"
|
|
643
639
|
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Trigger, {
|
|
644
640
|
"data-testid": "spacePlugin.addSpace",
|
|
645
|
-
className: mx2(l0ItemRoot, "grid place-items-center")
|
|
641
|
+
className: mx2(l0ItemRoot, "grid place-items-center dx-focus-ring-group")
|
|
646
642
|
}, /* @__PURE__ */ React4.createElement("div", {
|
|
647
643
|
role: "none",
|
|
648
644
|
className: mx2(l0ItemContent, "is-[--rail-action] bs-[--rail-action] group-hover/l0item:bg-hoverSurface")
|
|
649
645
|
}, /* @__PURE__ */ React4.createElement(Icon3, {
|
|
650
646
|
icon: "ph--list--regular",
|
|
651
647
|
size: 5
|
|
652
|
-
})))))), /* @__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", {
|
|
653
649
|
role: "none",
|
|
654
650
|
className: mx2([
|
|
655
651
|
"flex flex-col gap-1 pbs-1",
|
|
@@ -712,7 +708,7 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
|
|
|
712
708
|
// src/components/Sidebar/L1Panel.tsx
|
|
713
709
|
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
714
710
|
import React7, { useCallback as useCallback2, useMemo as useMemo3 } from "react";
|
|
715
|
-
import { IconButton as IconButton2, toLocalizedString as toLocalizedString6, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
711
|
+
import { DensityProvider, IconButton as IconButton2, toLocalizedString as toLocalizedString6, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
716
712
|
import { Tree } from "@dxos/react-ui-list";
|
|
717
713
|
import { Tabs as Tabs2 } from "@dxos/react-ui-tabs";
|
|
718
714
|
import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem as hoverableOpenControlItem2 } from "@dxos/react-ui-theme";
|
|
@@ -735,7 +731,7 @@ var coarseActionButtonProps = {
|
|
|
735
731
|
var NavTreeItemActionDropdownMenu = ({ parent, label, icon, testId, menuActions, caller }) => {
|
|
736
732
|
var _effect = _useSignals5();
|
|
737
733
|
try {
|
|
738
|
-
const { t } = useTranslation5(
|
|
734
|
+
const { t } = useTranslation5(meta.id);
|
|
739
735
|
const density = useDensityContext();
|
|
740
736
|
return /* @__PURE__ */ React5.createElement(MenuProvider2, null, /* @__PURE__ */ React5.createElement(DropdownMenu2.Root, {
|
|
741
737
|
group: parent,
|
|
@@ -780,10 +776,10 @@ var NavTreeItemMonolithicAction = ({ parent, properties: { disabled, caller, tes
|
|
|
780
776
|
label: baseLabel,
|
|
781
777
|
disabled,
|
|
782
778
|
onClick: (event) => {
|
|
779
|
+
event.stopPropagation();
|
|
783
780
|
if (disabled) {
|
|
784
781
|
return;
|
|
785
782
|
}
|
|
786
|
-
event.stopPropagation();
|
|
787
783
|
void invoke?.(caller ? {
|
|
788
784
|
parent,
|
|
789
785
|
caller
|
|
@@ -800,7 +796,7 @@ var NavTreeItemMonolithicAction = ({ parent, properties: { disabled, caller, tes
|
|
|
800
796
|
var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) => {
|
|
801
797
|
var _effect = _useSignals5();
|
|
802
798
|
try {
|
|
803
|
-
const { t } = useTranslation5(
|
|
799
|
+
const { t } = useTranslation5(meta.id);
|
|
804
800
|
const monolithicAction = menuActions?.length === 1 && menuActions[0];
|
|
805
801
|
const baseLabel = toLocalizedString4(monolithicAction ? monolithicAction.properties.label : props.label, t);
|
|
806
802
|
return monolithic && menuActions?.length === 1 ? /* @__PURE__ */ React5.createElement(NavTreeItemMonolithicAction, {
|
|
@@ -822,11 +818,11 @@ var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) =>
|
|
|
822
818
|
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
823
819
|
import React6, { Fragment, memo } from "react";
|
|
824
820
|
import { isAction as isAction2 } from "@dxos/app-graph";
|
|
825
|
-
import {
|
|
826
|
-
var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open
|
|
821
|
+
import { Popover, Treegrid, toLocalizedString as toLocalizedString5, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
822
|
+
var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open }) => {
|
|
827
823
|
var _effect = _useSignals6();
|
|
828
824
|
try {
|
|
829
|
-
const { t } = useTranslation6(
|
|
825
|
+
const { t } = useTranslation6(meta.id);
|
|
830
826
|
const { useActions: useActions3, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();
|
|
831
827
|
const level = path.length - 2;
|
|
832
828
|
const { actions: _actions, groupedActions } = useActions3(item);
|
|
@@ -837,15 +833,15 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
837
833
|
"list-item",
|
|
838
834
|
"list-item-primary"
|
|
839
835
|
].includes(a.properties?.disposition));
|
|
840
|
-
const ActionRoot = popoverAnchorId === `dxos.org/ui/${NAV_TREE_ITEM}/${item.id}` ? Popover.Anchor : Fragment;
|
|
841
836
|
useLoadDescendents(item);
|
|
842
837
|
useLoadDescendents(primaryAction && !isAction2(primaryAction) ? primaryAction : void 0);
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
}, /* @__PURE__ */ React6.createElement("div", {
|
|
838
|
+
const ActionRoot = popoverAnchorId === `dxos.org/ui/${NAV_TREE_ITEM}/${item.id}` ? Popover.Anchor : Fragment;
|
|
839
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
846
840
|
role: "none",
|
|
847
841
|
className: "contents app-no-drag"
|
|
848
|
-
}, 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, {
|
|
849
845
|
testId: primaryAction.properties?.testId,
|
|
850
846
|
label: toLocalizedString5(primaryAction.properties?.label, t),
|
|
851
847
|
icon: primaryAction.properties?.icon ?? "ph--placeholder--regular",
|
|
@@ -856,7 +852,11 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
856
852
|
] : groupedActions[primaryAction.id],
|
|
857
853
|
menuType: primaryAction.properties?.menuType,
|
|
858
854
|
caller: NAV_TREE_ITEM
|
|
859
|
-
}) : /* @__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, {
|
|
860
860
|
testId: `navtree.treeItem.actionsLevel${level}`,
|
|
861
861
|
label: t("tree item actions label"),
|
|
862
862
|
icon: "ph--dots-three-vertical--regular",
|
|
@@ -864,7 +864,11 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
864
864
|
menuActions: actions,
|
|
865
865
|
menuType: "dropdown",
|
|
866
866
|
caller: NAV_TREE_ITEM
|
|
867
|
-
}) : /* @__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, {
|
|
868
872
|
node: item,
|
|
869
873
|
open
|
|
870
874
|
})));
|
|
@@ -879,8 +883,8 @@ var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
|
|
|
879
883
|
try {
|
|
880
884
|
const { t } = useTranslation7(meta.id);
|
|
881
885
|
const { isAlternateTree, ...navTreeContext } = useNavTreeContext();
|
|
882
|
-
const { useItems: useItems2 } = navTreeContext;
|
|
883
886
|
const title = toLocalizedString6(item.properties.label, t);
|
|
887
|
+
const { useItems: useItems2 } = navTreeContext;
|
|
884
888
|
const alternateTree = useItems2(item, {
|
|
885
889
|
disposition: "alternate-tree"
|
|
886
890
|
})[0];
|
|
@@ -913,9 +917,11 @@ var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
|
|
|
913
917
|
tabIndex: -1,
|
|
914
918
|
"aria-label": title,
|
|
915
919
|
...!open && {
|
|
916
|
-
inert:
|
|
920
|
+
inert: true
|
|
917
921
|
}
|
|
918
|
-
}, item.id === currentItemId && /* @__PURE__ */ React7.createElement(
|
|
922
|
+
}, item.id === currentItemId && /* @__PURE__ */ React7.createElement(DensityProvider, {
|
|
923
|
+
density: "fine"
|
|
924
|
+
}, /* @__PURE__ */ React7.createElement(L1PanelHeader, {
|
|
919
925
|
path,
|
|
920
926
|
item,
|
|
921
927
|
currentItemId,
|
|
@@ -925,22 +931,22 @@ var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
|
|
|
925
931
|
className: "overflow-y-auto"
|
|
926
932
|
}, isAlternate ? /* @__PURE__ */ React7.createElement(Tree, {
|
|
927
933
|
...navTreeContext,
|
|
928
|
-
useItems: useAlternateItems,
|
|
929
934
|
id: alternateTree.id,
|
|
930
935
|
root: alternateTree,
|
|
931
936
|
path: alternatePath,
|
|
932
937
|
levelOffset: 5,
|
|
933
938
|
gridTemplateColumns: "[tree-row-start] 1fr min-content min-content min-content [tree-row-end]",
|
|
934
|
-
renderColumns: NavTreeItemColumns
|
|
939
|
+
renderColumns: NavTreeItemColumns,
|
|
940
|
+
useItems: useAlternateItems
|
|
935
941
|
}) : /* @__PURE__ */ React7.createElement(Tree, {
|
|
936
942
|
...navTreeContext,
|
|
937
943
|
id: item.id,
|
|
938
944
|
root: item,
|
|
939
945
|
path,
|
|
940
946
|
levelOffset: 5,
|
|
941
|
-
draggable: true,
|
|
942
947
|
gridTemplateColumns: "[tree-row-start] 1fr min-content min-content min-content [tree-row-end]",
|
|
943
|
-
renderColumns: NavTreeItemColumns
|
|
948
|
+
renderColumns: NavTreeItemColumns,
|
|
949
|
+
draggable: true
|
|
944
950
|
}))));
|
|
945
951
|
} finally {
|
|
946
952
|
_effect.f();
|
|
@@ -988,11 +994,10 @@ var L1PanelHeader = ({ item, path, onBack }) => {
|
|
|
988
994
|
className: "is-6"
|
|
989
995
|
}), /* @__PURE__ */ React7.createElement("h2", {
|
|
990
996
|
className: "flex-1 truncate min-is-0"
|
|
991
|
-
}, title),
|
|
997
|
+
}, title), backCapable && /* @__PURE__ */ React7.createElement(IconButton2, {
|
|
992
998
|
variant: "ghost",
|
|
993
999
|
icon: "ph--arrow-u-down-left--regular",
|
|
994
1000
|
iconOnly: true,
|
|
995
|
-
size: 5,
|
|
996
1001
|
label: t("button back"),
|
|
997
1002
|
classNames: [
|
|
998
1003
|
hoverableControlItem2,
|
|
@@ -1005,7 +1010,6 @@ var L1PanelHeader = ({ item, path, onBack }) => {
|
|
|
1005
1010
|
variant: "ghost",
|
|
1006
1011
|
icon: alternateTree.properties.icon ?? "ph--placeholder--regular",
|
|
1007
1012
|
iconOnly: true,
|
|
1008
|
-
size: 5,
|
|
1009
1013
|
label: toLocalizedString6(alternateTree.properties.label ?? alternateTree.id, t),
|
|
1010
1014
|
classNames: [
|
|
1011
1015
|
hoverableControlItem2,
|
|
@@ -1013,7 +1017,7 @@ var L1PanelHeader = ({ item, path, onBack }) => {
|
|
|
1013
1017
|
"pointer-fine:pli-1"
|
|
1014
1018
|
],
|
|
1015
1019
|
onClick: handleOpen
|
|
1016
|
-
})
|
|
1020
|
+
}), /* @__PURE__ */ React7.createElement(NavTreeItemColumns, {
|
|
1017
1021
|
open: true,
|
|
1018
1022
|
path,
|
|
1019
1023
|
item,
|
|
@@ -1132,25 +1136,31 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1132
1136
|
], [
|
|
1133
1137
|
id
|
|
1134
1138
|
]);
|
|
1135
|
-
return
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
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
|
+
);
|
|
1154
1164
|
} finally {
|
|
1155
1165
|
_effect.f();
|
|
1156
1166
|
}
|
|
@@ -1167,7 +1177,7 @@ var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Su
|
|
|
1167
1177
|
},
|
|
1168
1178
|
limit: 1
|
|
1169
1179
|
});
|
|
1170
|
-
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");
|
|
1171
1181
|
var filterItems = (node, disposition) => {
|
|
1172
1182
|
if (!disposition && (node.properties.disposition === "hidden" || node.properties.disposition === "alternate-tree")) {
|
|
1173
1183
|
return false;
|
|
@@ -1210,25 +1220,24 @@ var useActions2 = (node) => {
|
|
|
1210
1220
|
var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar }) => {
|
|
1211
1221
|
var _effect = _useSignals10();
|
|
1212
1222
|
try {
|
|
1213
|
-
const [isLg] = useMediaQuery2("lg"
|
|
1214
|
-
ssr: false
|
|
1215
|
-
});
|
|
1223
|
+
const [isLg] = useMediaQuery2("lg");
|
|
1216
1224
|
const { dispatchPromise: dispatch } = useIntentDispatcher3();
|
|
1217
1225
|
const { graph } = useAppGraph2();
|
|
1218
1226
|
const { isOpen, isCurrent, isAlternateTree, setItem } = useCapability(NavTreeCapabilities.State);
|
|
1219
1227
|
const layout = useLayout();
|
|
1220
|
-
const { navigationSidebarState } = useSidebars(
|
|
1228
|
+
const { navigationSidebarState } = useSidebars(meta.id);
|
|
1221
1229
|
const getProps = useCallback3((node, path) => {
|
|
1222
1230
|
const children = getChildren(graph, node, path).filter(getChildrenFilter);
|
|
1223
1231
|
const parentOf = children.length > 0 ? children.map(({ id }) => id) : node.properties.role === "branch" ? [] : void 0;
|
|
1224
1232
|
return {
|
|
1225
1233
|
id: node.id,
|
|
1226
|
-
label: node.properties.label ?? node.id,
|
|
1227
1234
|
parentOf,
|
|
1228
|
-
icon: node.properties.icon,
|
|
1229
1235
|
disabled: node.properties.disabled,
|
|
1230
|
-
|
|
1236
|
+
label: node.properties.label ?? node.id,
|
|
1237
|
+
className: mx3(node.properties.className, node.properties.modified && "italic"),
|
|
1231
1238
|
headingClassName: node.properties.headingClassName,
|
|
1239
|
+
icon: node.properties.icon,
|
|
1240
|
+
iconHue: node.properties.iconHue,
|
|
1232
1241
|
testId: node.properties.testId
|
|
1233
1242
|
};
|
|
1234
1243
|
}, [
|
|
@@ -1280,6 +1289,9 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1280
1289
|
const canDrop = useCallback3(({ source, target }) => {
|
|
1281
1290
|
return target.item.properties.canDrop?.(source) ?? false;
|
|
1282
1291
|
}, []);
|
|
1292
|
+
const canSelect = useCallback3(({ item }) => {
|
|
1293
|
+
return item.properties.selectable ?? true;
|
|
1294
|
+
}, []);
|
|
1283
1295
|
const handleSelect = useCallback3(({ item: node, path, option }) => {
|
|
1284
1296
|
if (!node.data) {
|
|
1285
1297
|
return;
|
|
@@ -1412,6 +1424,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1412
1424
|
isCurrent,
|
|
1413
1425
|
isOpen,
|
|
1414
1426
|
canDrop,
|
|
1427
|
+
canSelect,
|
|
1415
1428
|
isAlternateTree,
|
|
1416
1429
|
setAlternateTree,
|
|
1417
1430
|
onTabChange: handleTabChange,
|
|
@@ -1429,6 +1442,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1429
1442
|
isCurrent,
|
|
1430
1443
|
isOpen,
|
|
1431
1444
|
canDrop,
|
|
1445
|
+
canSelect,
|
|
1432
1446
|
isAlternateTree,
|
|
1433
1447
|
setAlternateTree,
|
|
1434
1448
|
handleTabChange,
|
|
@@ -1466,4 +1480,4 @@ export {
|
|
|
1466
1480
|
ReactSurface,
|
|
1467
1481
|
State
|
|
1468
1482
|
};
|
|
1469
|
-
//# sourceMappingURL=chunk-
|
|
1483
|
+
//# sourceMappingURL=chunk-7D2MPHXV.mjs.map
|