@dxos/plugin-navtree 0.8.4-main.67995b8 → 0.8.4-main.70d3990
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-E6MZBCU5.mjs +19 -0
- package/dist/lib/browser/chunk-E6MZBCU5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WEMCSQI7.mjs → chunk-UDAINHB6.mjs} +195 -176
- package/dist/lib/browser/chunk-UDAINHB6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -10
- 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-YJEK2HTH.mjs} +8 -10
- package/dist/lib/browser/{keyboard-QRS6WOQH.mjs.map → keyboard-YJEK2HTH.mjs.map} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-JSJ5SQX5.mjs → react-surface-V6LS3R4L.mjs} +10 -10
- package/dist/lib/browser/react-surface-V6LS3R4L.mjs.map +7 -0
- package/dist/lib/browser/{state-54DY3DOY.mjs → state-BFD5KJCV.mjs} +7 -7
- package/dist/lib/browser/state-BFD5KJCV.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 +3 -3
- 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/Sidebar/L1Tabs.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/types.d.ts +3 -3
- 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 +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 +2 -2
- 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/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 +50 -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 +3 -5
- package/src/capabilities/react-surface.tsx +5 -5
- package/src/capabilities/state.ts +5 -5
- package/src/components/CommandsDialog/CommandsDialog.tsx +15 -7
- package/src/components/CommandsDialog/CommandsTrigger.tsx +4 -3
- package/src/components/NavTree/NavTree.stories.tsx +67 -53
- package/src/components/NavTree/NavTree.tsx +4 -0
- package/src/components/NavTreeContainer.tsx +120 -55
- package/src/components/NavTreeDocumentTitle.tsx +2 -2
- package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +4 -6
- package/src/components/NavTreeItem/NavTreeItemAction.tsx +7 -6
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +31 -24
- package/src/components/Sidebar/L0Menu.tsx +56 -55
- package/src/components/Sidebar/L1Panel.tsx +23 -28
- package/src/components/Sidebar/L1Tabs.tsx +1 -0
- package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +9 -8
- package/src/components/UserAccountAvatar/UserAccountAvatar.tsx +20 -12
- package/src/components/types.ts +4 -3
- 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 +20 -19
- package/src/testing/generator.ts +10 -8
- 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-WCARAZ7J.mjs.map +0 -7
- package/dist/lib/browser/chunk-WEMCSQI7.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3XYN2CBU.mjs.map +0 -7
- package/dist/lib/browser/react-surface-JSJ5SQX5.mjs.map +0 -7
- package/dist/lib/browser/state-54DY3DOY.mjs.map +0 -7
|
@@ -1,21 +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
|
-
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 {
|
|
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";
|
|
18
|
-
import { Button, Dialog, Icon,
|
|
18
|
+
import { Button, Dialog, Icon, toLocalizedString, useTranslation } from "@dxos/react-ui";
|
|
19
19
|
import { SearchList } from "@dxos/react-ui-searchlist";
|
|
20
20
|
import { cardDialogContent, cardDialogHeader, cardDialogPaddedOverflow, cardDialogSearchListRoot } from "@dxos/react-ui-stack";
|
|
21
21
|
import { descriptionText, mx } from "@dxos/react-ui-theme";
|
|
@@ -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 {
|
|
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, {
|
|
@@ -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";
|
|
@@ -233,15 +218,24 @@ import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/ad
|
|
|
233
218
|
import { extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
|
|
234
219
|
import { untracked } from "@preact/signals-core";
|
|
235
220
|
import React10, { memo as memo2, useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo6 } from "react";
|
|
236
|
-
import {
|
|
237
|
-
import {
|
|
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
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-YJEK2HTH.mjs"));
|
|
236
|
+
var ReactSurface = lazy(() => import("./react-surface-V6LS3R4L.mjs"));
|
|
237
|
+
var State = lazy(() => import("./state-BFD5KJCV.mjs"));
|
|
238
|
+
|
|
245
239
|
// src/components/NavTree/NavTree.tsx
|
|
246
240
|
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
247
241
|
import React9, { useMemo as useMemo5 } from "react";
|
|
@@ -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";
|
|
292
|
+
import { DxAvatar } from "@dxos/lit-ui/react";
|
|
298
293
|
import { Icon as Icon3, ListItem, ScrollArea, Tooltip, toLocalizedString as toLocalizedString3, useMediaQuery, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
299
|
-
import {
|
|
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;
|
|
@@ -563,13 +541,19 @@ var ItemAvatar = ({ item }) => {
|
|
|
563
541
|
};
|
|
564
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
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,7 +708,7 @@ 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 { 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";
|
|
724
712
|
import { Tree } from "@dxos/react-ui-list";
|
|
725
713
|
import { Tabs as Tabs2 } from "@dxos/react-ui-tabs";
|
|
726
714
|
import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem as hoverableOpenControlItem2 } from "@dxos/react-ui-theme";
|
|
@@ -728,7 +716,7 @@ import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem
|
|
|
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
721
|
import { hoverableControlItem, hoverableOpenControlItem } from "@dxos/react-ui-theme";
|
|
734
722
|
var fallbackIcon = "ph--placeholder--regular";
|
|
@@ -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,
|
|
@@ -788,10 +776,10 @@ var NavTreeItemMonolithicAction = ({ parent, properties: { disabled, caller, tes
|
|
|
788
776
|
label: baseLabel,
|
|
789
777
|
disabled,
|
|
790
778
|
onClick: (event) => {
|
|
779
|
+
event.stopPropagation();
|
|
791
780
|
if (disabled) {
|
|
792
781
|
return;
|
|
793
782
|
}
|
|
794
|
-
event.stopPropagation();
|
|
795
783
|
void invoke?.(caller ? {
|
|
796
784
|
parent,
|
|
797
785
|
caller
|
|
@@ -808,7 +796,7 @@ var NavTreeItemMonolithicAction = ({ parent, properties: { disabled, caller, tes
|
|
|
808
796
|
var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) => {
|
|
809
797
|
var _effect = _useSignals5();
|
|
810
798
|
try {
|
|
811
|
-
const { t } = useTranslation5(
|
|
799
|
+
const { t } = useTranslation5(meta.id);
|
|
812
800
|
const monolithicAction = menuActions?.length === 1 && menuActions[0];
|
|
813
801
|
const baseLabel = toLocalizedString4(monolithicAction ? monolithicAction.properties.label : props.label, t);
|
|
814
802
|
return monolithic && menuActions?.length === 1 ? /* @__PURE__ */ React5.createElement(NavTreeItemMonolithicAction, {
|
|
@@ -829,42 +817,46 @@ var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) =>
|
|
|
829
817
|
// src/components/NavTreeItem/NavTreeItemColumns.tsx
|
|
830
818
|
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
831
819
|
import React6, { Fragment, memo } from "react";
|
|
832
|
-
import { isAction as
|
|
833
|
-
import {
|
|
834
|
-
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 }) => {
|
|
835
823
|
var _effect = _useSignals6();
|
|
836
824
|
try {
|
|
837
|
-
const { t } = useTranslation6(
|
|
838
|
-
const {
|
|
825
|
+
const { t } = useTranslation6(meta.id);
|
|
826
|
+
const { useActions: useActions3, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();
|
|
839
827
|
const level = path.length - 2;
|
|
840
|
-
const { actions: _actions, groupedActions } =
|
|
828
|
+
const { actions: _actions, groupedActions } = useActions3(item);
|
|
841
829
|
const [primaryAction, ...secondaryActions] = _actions.toSorted((a, _b) => a.properties?.disposition === "list-item-primary" ? -1 : 1);
|
|
842
|
-
const actions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) =>
|
|
830
|
+
const actions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) => isAction2(action) ? [
|
|
843
831
|
action
|
|
844
832
|
] : []).filter((a) => [
|
|
845
833
|
"list-item",
|
|
846
834
|
"list-item-primary"
|
|
847
835
|
].includes(a.properties?.disposition));
|
|
848
|
-
const ActionRoot = popoverAnchorId === `dxos.org/ui/${NAV_TREE_ITEM}/${item.id}` ? Popover.Anchor : Fragment;
|
|
849
836
|
useLoadDescendents(item);
|
|
850
|
-
useLoadDescendents(primaryAction && !
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
}, /* @__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", {
|
|
854
840
|
role: "none",
|
|
855
841
|
className: "contents app-no-drag"
|
|
856
|
-
}, 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, {
|
|
857
845
|
testId: primaryAction.properties?.testId,
|
|
858
846
|
label: toLocalizedString5(primaryAction.properties?.label, t),
|
|
859
847
|
icon: primaryAction.properties?.icon ?? "ph--placeholder--regular",
|
|
860
848
|
parent: item,
|
|
861
|
-
monolithic:
|
|
862
|
-
menuActions:
|
|
849
|
+
monolithic: isAction2(primaryAction),
|
|
850
|
+
menuActions: isAction2(primaryAction) ? [
|
|
863
851
|
primaryAction
|
|
864
852
|
] : groupedActions[primaryAction.id],
|
|
865
853
|
menuType: primaryAction.properties?.menuType,
|
|
866
854
|
caller: NAV_TREE_ITEM
|
|
867
|
-
}) : /* @__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, {
|
|
868
860
|
testId: `navtree.treeItem.actionsLevel${level}`,
|
|
869
861
|
label: t("tree item actions label"),
|
|
870
862
|
icon: "ph--dots-three-vertical--regular",
|
|
@@ -872,7 +864,11 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
872
864
|
menuActions: actions,
|
|
873
865
|
menuType: "dropdown",
|
|
874
866
|
caller: NAV_TREE_ITEM
|
|
875
|
-
}) : /* @__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, {
|
|
876
872
|
node: item,
|
|
877
873
|
open
|
|
878
874
|
})));
|
|
@@ -887,8 +883,8 @@ var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
|
|
|
887
883
|
try {
|
|
888
884
|
const { t } = useTranslation7(meta.id);
|
|
889
885
|
const { isAlternateTree, ...navTreeContext } = useNavTreeContext();
|
|
890
|
-
const { useItems: useItems2 } = navTreeContext;
|
|
891
886
|
const title = toLocalizedString6(item.properties.label, t);
|
|
887
|
+
const { useItems: useItems2 } = navTreeContext;
|
|
892
888
|
const alternateTree = useItems2(item, {
|
|
893
889
|
disposition: "alternate-tree"
|
|
894
890
|
})[0];
|
|
@@ -921,9 +917,11 @@ var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
|
|
|
921
917
|
tabIndex: -1,
|
|
922
918
|
"aria-label": title,
|
|
923
919
|
...!open && {
|
|
924
|
-
inert:
|
|
920
|
+
inert: true
|
|
925
921
|
}
|
|
926
|
-
}, item.id === currentItemId && /* @__PURE__ */ React7.createElement(
|
|
922
|
+
}, item.id === currentItemId && /* @__PURE__ */ React7.createElement(DensityProvider, {
|
|
923
|
+
density: "fine"
|
|
924
|
+
}, /* @__PURE__ */ React7.createElement(L1PanelHeader, {
|
|
927
925
|
path,
|
|
928
926
|
item,
|
|
929
927
|
currentItemId,
|
|
@@ -933,22 +931,22 @@ var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
|
|
|
933
931
|
className: "overflow-y-auto"
|
|
934
932
|
}, isAlternate ? /* @__PURE__ */ React7.createElement(Tree, {
|
|
935
933
|
...navTreeContext,
|
|
936
|
-
useItems: useAlternateItems,
|
|
937
934
|
id: alternateTree.id,
|
|
938
935
|
root: alternateTree,
|
|
939
936
|
path: alternatePath,
|
|
940
937
|
levelOffset: 5,
|
|
941
938
|
gridTemplateColumns: "[tree-row-start] 1fr min-content min-content min-content [tree-row-end]",
|
|
942
|
-
renderColumns: NavTreeItemColumns
|
|
939
|
+
renderColumns: NavTreeItemColumns,
|
|
940
|
+
useItems: useAlternateItems
|
|
943
941
|
}) : /* @__PURE__ */ React7.createElement(Tree, {
|
|
944
942
|
...navTreeContext,
|
|
945
943
|
id: item.id,
|
|
946
944
|
root: item,
|
|
947
945
|
path,
|
|
948
946
|
levelOffset: 5,
|
|
949
|
-
draggable: true,
|
|
950
947
|
gridTemplateColumns: "[tree-row-start] 1fr min-content min-content min-content [tree-row-end]",
|
|
951
|
-
renderColumns: NavTreeItemColumns
|
|
948
|
+
renderColumns: NavTreeItemColumns,
|
|
949
|
+
draggable: true
|
|
952
950
|
}))));
|
|
953
951
|
} finally {
|
|
954
952
|
_effect.f();
|
|
@@ -996,11 +994,10 @@ var L1PanelHeader = ({ item, path, onBack }) => {
|
|
|
996
994
|
className: "is-6"
|
|
997
995
|
}), /* @__PURE__ */ React7.createElement("h2", {
|
|
998
996
|
className: "flex-1 truncate min-is-0"
|
|
999
|
-
}, title),
|
|
997
|
+
}, title), backCapable && /* @__PURE__ */ React7.createElement(IconButton2, {
|
|
1000
998
|
variant: "ghost",
|
|
1001
999
|
icon: "ph--arrow-u-down-left--regular",
|
|
1002
1000
|
iconOnly: true,
|
|
1003
|
-
size: 5,
|
|
1004
1001
|
label: t("button back"),
|
|
1005
1002
|
classNames: [
|
|
1006
1003
|
hoverableControlItem2,
|
|
@@ -1013,7 +1010,6 @@ var L1PanelHeader = ({ item, path, onBack }) => {
|
|
|
1013
1010
|
variant: "ghost",
|
|
1014
1011
|
icon: alternateTree.properties.icon ?? "ph--placeholder--regular",
|
|
1015
1012
|
iconOnly: true,
|
|
1016
|
-
size: 5,
|
|
1017
1013
|
label: toLocalizedString6(alternateTree.properties.label ?? alternateTree.id, t),
|
|
1018
1014
|
classNames: [
|
|
1019
1015
|
hoverableControlItem2,
|
|
@@ -1021,7 +1017,7 @@ var L1PanelHeader = ({ item, path, onBack }) => {
|
|
|
1021
1017
|
"pointer-fine:pli-1"
|
|
1022
1018
|
],
|
|
1023
1019
|
onClick: handleOpen
|
|
1024
|
-
})
|
|
1020
|
+
}), /* @__PURE__ */ React7.createElement(NavTreeItemColumns, {
|
|
1025
1021
|
open: true,
|
|
1026
1022
|
path,
|
|
1027
1023
|
item,
|
|
@@ -1140,38 +1136,36 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1140
1136
|
], [
|
|
1141
1137
|
id
|
|
1142
1138
|
]);
|
|
1143
|
-
return
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
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
|
+
);
|
|
1162
1164
|
} finally {
|
|
1163
1165
|
_effect.f();
|
|
1164
1166
|
}
|
|
1165
1167
|
};
|
|
1166
1168
|
|
|
1167
|
-
// src/capabilities/index.ts
|
|
1168
|
-
import { lazy } from "@dxos/app-framework";
|
|
1169
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-5J4LRWDX.mjs"));
|
|
1170
|
-
var IntentResolver = lazy(() => import("./intent-resolver-3XYN2CBU.mjs"));
|
|
1171
|
-
var Keyboard2 = lazy(() => import("./keyboard-QRS6WOQH.mjs"));
|
|
1172
|
-
var ReactSurface = lazy(() => import("./react-surface-JSJ5SQX5.mjs"));
|
|
1173
|
-
var State = lazy(() => import("./state-54DY3DOY.mjs"));
|
|
1174
|
-
|
|
1175
1169
|
// src/components/NavTreeContainer.tsx
|
|
1176
1170
|
var NODE_TYPE = "dxos/app-graph/node";
|
|
1177
1171
|
var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Surface, {
|
|
@@ -1183,12 +1177,12 @@ var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Su
|
|
|
1183
1177
|
},
|
|
1184
1178
|
limit: 1
|
|
1185
1179
|
});
|
|
1186
|
-
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");
|
|
1187
1181
|
var filterItems = (node, disposition) => {
|
|
1188
1182
|
if (!disposition && (node.properties.disposition === "hidden" || node.properties.disposition === "alternate-tree")) {
|
|
1189
1183
|
return false;
|
|
1190
1184
|
} else if (!disposition) {
|
|
1191
|
-
const action =
|
|
1185
|
+
const action = isAction3(node);
|
|
1192
1186
|
return !action || node.properties.disposition === "item";
|
|
1193
1187
|
} else {
|
|
1194
1188
|
return node.properties.disposition === disposition;
|
|
@@ -1203,31 +1197,47 @@ var useItems = (node, options) => {
|
|
|
1203
1197
|
const filtered = connections.filter((node2) => filterItems(node2, options?.disposition));
|
|
1204
1198
|
return options?.sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
|
|
1205
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
|
+
]);
|
|
1219
|
+
};
|
|
1206
1220
|
var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar }) => {
|
|
1207
1221
|
var _effect = _useSignals10();
|
|
1208
1222
|
try {
|
|
1209
|
-
const [isLg] = useMediaQuery2("lg"
|
|
1210
|
-
ssr: false
|
|
1211
|
-
});
|
|
1223
|
+
const [isLg] = useMediaQuery2("lg");
|
|
1212
1224
|
const { dispatchPromise: dispatch } = useIntentDispatcher3();
|
|
1213
1225
|
const { graph } = useAppGraph2();
|
|
1214
1226
|
const { isOpen, isCurrent, isAlternateTree, setItem } = useCapability(NavTreeCapabilities.State);
|
|
1215
1227
|
const layout = useLayout();
|
|
1216
|
-
const { navigationSidebarState } = useSidebars(
|
|
1217
|
-
const getActions2 = useCallback3((node) => getActions(graph, node), [
|
|
1218
|
-
graph
|
|
1219
|
-
]);
|
|
1228
|
+
const { navigationSidebarState } = useSidebars(meta.id);
|
|
1220
1229
|
const getProps = useCallback3((node, path) => {
|
|
1221
1230
|
const children = getChildren(graph, node, path).filter(getChildrenFilter);
|
|
1222
1231
|
const parentOf = children.length > 0 ? children.map(({ id }) => id) : node.properties.role === "branch" ? [] : void 0;
|
|
1223
1232
|
return {
|
|
1224
1233
|
id: node.id,
|
|
1225
|
-
label: node.properties.label ?? node.id,
|
|
1226
1234
|
parentOf,
|
|
1227
|
-
icon: node.properties.icon,
|
|
1228
1235
|
disabled: node.properties.disabled,
|
|
1229
|
-
|
|
1236
|
+
label: node.properties.label ?? node.id,
|
|
1237
|
+
className: mx3(node.properties.className, node.properties.modified && "italic"),
|
|
1230
1238
|
headingClassName: node.properties.headingClassName,
|
|
1239
|
+
icon: node.properties.icon,
|
|
1240
|
+
iconHue: node.properties.iconHue,
|
|
1231
1241
|
testId: node.properties.testId
|
|
1232
1242
|
};
|
|
1233
1243
|
}, [
|
|
@@ -1276,14 +1286,20 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1276
1286
|
navigationSidebarState,
|
|
1277
1287
|
isLg
|
|
1278
1288
|
]);
|
|
1289
|
+
const blockInstruction = useCallback3(({ instruction, source, target }) => {
|
|
1290
|
+
return target.item.properties.blockInstruction?.(source, instruction) ?? false;
|
|
1291
|
+
}, []);
|
|
1279
1292
|
const canDrop = useCallback3(({ source, target }) => {
|
|
1280
1293
|
return target.item.properties.canDrop?.(source) ?? false;
|
|
1281
1294
|
}, []);
|
|
1295
|
+
const canSelect = useCallback3(({ item }) => {
|
|
1296
|
+
return item.properties.selectable ?? true;
|
|
1297
|
+
}, []);
|
|
1282
1298
|
const handleSelect = useCallback3(({ item: node, path, option }) => {
|
|
1283
1299
|
if (!node.data) {
|
|
1284
1300
|
return;
|
|
1285
1301
|
}
|
|
1286
|
-
if (
|
|
1302
|
+
if (isAction3(node)) {
|
|
1287
1303
|
const [parent] = graph.getConnections(node.id, "inbound");
|
|
1288
1304
|
void (parent && node.data({
|
|
1289
1305
|
parent,
|
|
@@ -1319,7 +1335,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1319
1335
|
}));
|
|
1320
1336
|
}
|
|
1321
1337
|
const defaultAction = graph.getActions(node.id).find((action) => action.properties?.disposition === "default");
|
|
1322
|
-
if (
|
|
1338
|
+
if (isAction3(defaultAction)) {
|
|
1323
1339
|
void defaultAction.data();
|
|
1324
1340
|
}
|
|
1325
1341
|
if (!isLg) {
|
|
@@ -1400,40 +1416,44 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1400
1416
|
setItem
|
|
1401
1417
|
]);
|
|
1402
1418
|
const navTreeContextValue = useMemo6(() => ({
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
loadDescendents,
|
|
1407
|
-
renderItemEnd,
|
|
1408
|
-
popoverAnchorId,
|
|
1409
|
-
topbar,
|
|
1419
|
+
blockInstruction,
|
|
1420
|
+
canDrop,
|
|
1421
|
+
canSelect,
|
|
1410
1422
|
getProps,
|
|
1423
|
+
isAlternateTree,
|
|
1411
1424
|
isCurrent,
|
|
1412
1425
|
isOpen,
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
setAlternateTree,
|
|
1416
|
-
onTabChange: handleTabChange,
|
|
1426
|
+
loadDescendents,
|
|
1427
|
+
onBack: handleBack,
|
|
1417
1428
|
onOpenChange: handleOpenChange,
|
|
1418
1429
|
onSelect: handleSelect,
|
|
1419
|
-
|
|
1420
|
-
}), [
|
|
1421
|
-
tab,
|
|
1422
|
-
getActions2,
|
|
1423
|
-
loadDescendents,
|
|
1424
|
-
renderItemEnd,
|
|
1430
|
+
onTabChange: handleTabChange,
|
|
1425
1431
|
popoverAnchorId,
|
|
1432
|
+
renderItemEnd,
|
|
1433
|
+
setAlternateTree,
|
|
1434
|
+
tab,
|
|
1426
1435
|
topbar,
|
|
1436
|
+
useActions: useActions2,
|
|
1437
|
+
useItems
|
|
1438
|
+
}), [
|
|
1439
|
+
blockInstruction,
|
|
1440
|
+
canDrop,
|
|
1441
|
+
canSelect,
|
|
1427
1442
|
getProps,
|
|
1443
|
+
handleBack,
|
|
1444
|
+
handleOpenChange,
|
|
1445
|
+
handleSelect,
|
|
1446
|
+
handleTabChange,
|
|
1447
|
+
isAlternateTree,
|
|
1428
1448
|
isCurrent,
|
|
1429
1449
|
isOpen,
|
|
1430
|
-
|
|
1431
|
-
|
|
1450
|
+
loadDescendents,
|
|
1451
|
+
popoverAnchorId,
|
|
1452
|
+
renderItemEnd,
|
|
1432
1453
|
setAlternateTree,
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
handleBack
|
|
1454
|
+
tab,
|
|
1455
|
+
topbar,
|
|
1456
|
+
useActions2
|
|
1437
1457
|
]);
|
|
1438
1458
|
return /* @__PURE__ */ React10.createElement(NavTreeContext.Provider, {
|
|
1439
1459
|
value: navTreeContextValue
|
|
@@ -1455,7 +1475,6 @@ export {
|
|
|
1455
1475
|
resolveMigrationOperation,
|
|
1456
1476
|
sortActions,
|
|
1457
1477
|
getChildren,
|
|
1458
|
-
getActions,
|
|
1459
1478
|
l0ItemType,
|
|
1460
1479
|
NODE_TYPE,
|
|
1461
1480
|
NavTreeContainer,
|
|
@@ -1466,4 +1485,4 @@ export {
|
|
|
1466
1485
|
ReactSurface,
|
|
1467
1486
|
State
|
|
1468
1487
|
};
|
|
1469
|
-
//# sourceMappingURL=chunk-
|
|
1488
|
+
//# sourceMappingURL=chunk-UDAINHB6.mjs.map
|