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