@dxos/plugin-navtree 0.8.3-staging.0fa589b → 0.8.4-main.28f8d3d
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-P7AY3K72.mjs → app-graph-builder-6JDBQ25U.mjs} +5 -5
- package/dist/lib/browser/{app-graph-builder-P7AY3K72.mjs.map → app-graph-builder-6JDBQ25U.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-IEW3JD5C.mjs → chunk-ERDGQTH5.mjs} +2 -2
- package/dist/lib/browser/{chunk-ZJPL4XJD.mjs → chunk-SNGLGBFJ.mjs} +232 -192
- package/dist/lib/browser/chunk-SNGLGBFJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-33VLL4IJ.mjs → chunk-WCARAZ7J.mjs} +3 -3
- package/dist/lib/browser/index.mjs +13 -14
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-NAYKKAOP.mjs → intent-resolver-N35ZIHFD.mjs} +6 -6
- package/dist/lib/browser/{intent-resolver-NAYKKAOP.mjs.map → intent-resolver-N35ZIHFD.mjs.map} +3 -3
- package/dist/lib/browser/{keyboard-DDFATRUG.mjs → keyboard-HMTMA33N.mjs} +3 -3
- package/dist/lib/browser/{keyboard-DDFATRUG.mjs.map → keyboard-HMTMA33N.mjs.map} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-H3JRTVNU.mjs → react-surface-WKWXMM2N.mjs} +5 -5
- package/dist/lib/browser/{react-surface-H3JRTVNU.mjs.map → react-surface-WKWXMM2N.mjs.map} +1 -1
- package/dist/lib/browser/{state-J6AKZRB4.mjs → state-P5DGL7KS.mjs} +4 -4
- package/dist/lib/browser/state-P5DGL7KS.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/CommandsDialog/CommandsTrigger.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.d.ts +2 -2
- package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts +1 -1
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +1 -1
- 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.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.stories.d.ts +1 -1
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/types.d.ts +2 -2
- package/dist/types/src/components/types.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.d.ts +5 -5
- package/dist/types/src/experimental/Tree.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.stories.d.ts +1 -1
- package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/testing/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +14 -13
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +1 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -42
- package/src/NavTreePlugin.tsx +6 -6
- package/src/capabilities/app-graph-builder.ts +2 -2
- package/src/capabilities/intent-resolver.ts +1 -1
- package/src/capabilities/keyboard.ts +2 -2
- package/src/capabilities/react-surface.tsx +1 -1
- package/src/capabilities/state.ts +3 -2
- package/src/components/CommandsDialog/CommandsDialog.tsx +2 -2
- package/src/components/CommandsDialog/CommandsTrigger.tsx +3 -5
- package/src/components/NavTree/NavTree.stories.tsx +4 -4
- package/src/components/NavTree/NavTree.tsx +3 -3
- package/src/components/NavTreeContainer.tsx +39 -16
- package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +1 -1
- package/src/components/NavTreeItem/NavTreeItemAction.tsx +6 -6
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +7 -7
- package/src/components/Sidebar/L0Menu.tsx +2 -2
- package/src/components/Sidebar/L1Panel.tsx +72 -93
- package/src/components/Sidebar/L1Tabs.tsx +58 -0
- package/src/components/Sidebar/index.ts +1 -0
- package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +1 -1
- package/src/components/index.ts +1 -1
- package/src/components/types.ts +3 -2
- package/src/experimental/Tree.stories.tsx +9 -9
- package/src/experimental/Tree.tsx +15 -16
- package/src/testing/app-graph-builder.ts +1 -1
- package/src/translations.ts +7 -4
- package/src/util.ts +2 -20
- package/dist/lib/browser/chunk-ZJPL4XJD.mjs.map +0 -7
- package/dist/lib/browser/state-J6AKZRB4.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-IEW3JD5C.mjs.map → chunk-ERDGQTH5.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-33VLL4IJ.mjs.map → chunk-WCARAZ7J.mjs.map} +0 -0
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NavTreeCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WCARAZ7J.mjs";
|
|
4
4
|
import {
|
|
5
5
|
COMMANDS_DIALOG,
|
|
6
6
|
KEY_BINDING,
|
|
7
|
-
NAVTREE_PLUGIN
|
|
8
|
-
|
|
7
|
+
NAVTREE_PLUGIN,
|
|
8
|
+
meta
|
|
9
|
+
} from "./chunk-ERDGQTH5.mjs";
|
|
9
10
|
|
|
10
|
-
//
|
|
11
|
+
// src/components/CommandsDialog/CommandsDialog.tsx
|
|
11
12
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
12
13
|
import React, { useMemo, useState } from "react";
|
|
13
|
-
import {
|
|
14
|
+
import { LayoutAction, createIntent, useAppGraph, useIntentDispatcher } from "@dxos/app-framework";
|
|
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";
|
|
@@ -117,13 +118,11 @@ var CommandsDialogContent = ({ selected: initial }) => {
|
|
|
117
118
|
}
|
|
118
119
|
};
|
|
119
120
|
|
|
120
|
-
//
|
|
121
|
+
// src/components/CommandsDialog/CommandsTrigger.tsx
|
|
121
122
|
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
122
|
-
import { MagnifyingGlass } from "@phosphor-icons/react";
|
|
123
123
|
import React2 from "react";
|
|
124
|
-
import {
|
|
125
|
-
import { Button as Button2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
126
|
-
import { getSize } from "@dxos/react-ui-theme";
|
|
124
|
+
import { LayoutAction as LayoutAction2, createIntent as createIntent2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
125
|
+
import { Button as Button2, Icon as Icon2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
127
126
|
var CommandsTrigger = () => {
|
|
128
127
|
var _effect = _useSignals2();
|
|
129
128
|
try {
|
|
@@ -140,16 +139,17 @@ var CommandsTrigger = () => {
|
|
|
140
139
|
}))
|
|
141
140
|
}, /* @__PURE__ */ React2.createElement("span", {
|
|
142
141
|
className: "text-description font-normal grow text-start"
|
|
143
|
-
}, t("command list input placeholder")), /* @__PURE__ */ React2.createElement(
|
|
144
|
-
|
|
142
|
+
}, t("command list input placeholder")), /* @__PURE__ */ React2.createElement(Icon2, {
|
|
143
|
+
icon: "ph--magnifying-glass--regular",
|
|
144
|
+
size: 5
|
|
145
145
|
}));
|
|
146
146
|
} finally {
|
|
147
147
|
_effect.f();
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
-
//
|
|
152
|
-
import {
|
|
151
|
+
// src/util.ts
|
|
152
|
+
import { isActionLike } from "@dxos/app-graph";
|
|
153
153
|
import { isNonNullable } from "@dxos/util";
|
|
154
154
|
var getParent = (graph, node, path) => {
|
|
155
155
|
const parentId = path[path.length - 2];
|
|
@@ -199,22 +199,6 @@ var getChildren = (graph, node, path = []) => {
|
|
|
199
199
|
return nextPath.includes(n.id) ? void 0 : n;
|
|
200
200
|
}).filter(isNonNullable);
|
|
201
201
|
};
|
|
202
|
-
var getActions = (graph, node) => {
|
|
203
|
-
return graph.getActions(node.id).reduce((acc, arg) => {
|
|
204
|
-
if (arg.properties.disposition === "item") {
|
|
205
|
-
return acc;
|
|
206
|
-
}
|
|
207
|
-
acc.actions.push(arg);
|
|
208
|
-
if (!isAction2(arg)) {
|
|
209
|
-
const actionGroup = graph.getActions(arg.id);
|
|
210
|
-
acc.groupedActions[arg.id] = actionGroup;
|
|
211
|
-
}
|
|
212
|
-
return acc;
|
|
213
|
-
}, {
|
|
214
|
-
actions: [],
|
|
215
|
-
groupedActions: {}
|
|
216
|
-
});
|
|
217
|
-
};
|
|
218
202
|
var l0ItemType = (item) => {
|
|
219
203
|
if (item.properties.disposition === "collection") {
|
|
220
204
|
return "collection";
|
|
@@ -227,36 +211,44 @@ var l0ItemType = (item) => {
|
|
|
227
211
|
}
|
|
228
212
|
};
|
|
229
213
|
|
|
230
|
-
//
|
|
231
|
-
import { useSignals as
|
|
214
|
+
// src/components/NavTreeContainer.tsx
|
|
215
|
+
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
232
216
|
import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
233
217
|
import { extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
|
|
234
218
|
import { untracked } from "@preact/signals-core";
|
|
235
|
-
import
|
|
236
|
-
import {
|
|
237
|
-
import { isAction as
|
|
219
|
+
import React10, { memo as memo2, useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo6 } from "react";
|
|
220
|
+
import { LayoutAction as LayoutAction3, Surface, createIntent as createIntent3, useAppGraph as useAppGraph2, useCapability, useIntentDispatcher as useIntentDispatcher3, useLayout } from "@dxos/app-framework";
|
|
221
|
+
import { ROOT_ID, isAction as isAction3, isActionLike as isActionLike2 } from "@dxos/app-graph";
|
|
238
222
|
import { PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
|
|
239
|
-
import { useConnections } from "@dxos/plugin-graph";
|
|
223
|
+
import { useConnections, useActions as useGraphActions } from "@dxos/plugin-graph";
|
|
240
224
|
import { useMediaQuery as useMediaQuery2, useSidebars } from "@dxos/react-ui";
|
|
241
225
|
import { isTreeData } from "@dxos/react-ui-list";
|
|
242
|
-
import { mx as
|
|
226
|
+
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
243
227
|
import { arrayMove as arrayMove2, byPosition } from "@dxos/util";
|
|
244
228
|
|
|
245
|
-
//
|
|
246
|
-
import {
|
|
247
|
-
|
|
229
|
+
// src/capabilities/index.ts
|
|
230
|
+
import { lazy } from "@dxos/app-framework";
|
|
231
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-6JDBQ25U.mjs"));
|
|
232
|
+
var IntentResolver = lazy(() => import("./intent-resolver-N35ZIHFD.mjs"));
|
|
233
|
+
var Keyboard2 = lazy(() => import("./keyboard-HMTMA33N.mjs"));
|
|
234
|
+
var ReactSurface = lazy(() => import("./react-surface-WKWXMM2N.mjs"));
|
|
235
|
+
var State = lazy(() => import("./state-P5DGL7KS.mjs"));
|
|
236
|
+
|
|
237
|
+
// src/components/NavTree/NavTree.tsx
|
|
238
|
+
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
239
|
+
import React9, { useMemo as useMemo5 } from "react";
|
|
248
240
|
import { Tabs as Tabs3 } from "@dxos/react-ui-tabs";
|
|
249
241
|
|
|
250
|
-
//
|
|
242
|
+
// src/hooks.ts
|
|
251
243
|
import { useEffect as useEffect2 } from "react";
|
|
252
244
|
|
|
253
|
-
//
|
|
245
|
+
// src/components/NavTreeContext.tsx
|
|
254
246
|
import { createContext, useContext } from "react";
|
|
255
247
|
import { raise } from "@dxos/debug";
|
|
256
248
|
var NavTreeContext = /* @__PURE__ */ createContext(null);
|
|
257
249
|
var useNavTreeContext = () => useContext(NavTreeContext) ?? raise(new Error("Missing NavTreeContext"));
|
|
258
250
|
|
|
259
|
-
//
|
|
251
|
+
// src/components/NavTreeDocumentTitle.tsx
|
|
260
252
|
import { useEffect } from "react";
|
|
261
253
|
import { toLocalizedString as toLocalizedString2, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
262
254
|
var NavTreeDocumentTitle = ({ node }) => {
|
|
@@ -271,7 +263,7 @@ var NavTreeDocumentTitle = ({ node }) => {
|
|
|
271
263
|
return null;
|
|
272
264
|
};
|
|
273
265
|
|
|
274
|
-
//
|
|
266
|
+
// src/hooks.ts
|
|
275
267
|
var useLoadDescendents = (root) => {
|
|
276
268
|
const { loadDescendents } = useNavTreeContext();
|
|
277
269
|
useEffect2(() => {
|
|
@@ -286,7 +278,7 @@ var useLoadDescendents = (root) => {
|
|
|
286
278
|
]);
|
|
287
279
|
};
|
|
288
280
|
|
|
289
|
-
//
|
|
281
|
+
// src/components/Sidebar/L0Menu.tsx
|
|
290
282
|
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
291
283
|
import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
|
|
292
284
|
import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
@@ -295,13 +287,13 @@ import { scrollJustEnoughIntoView } from "@atlaskit/pragmatic-drag-and-drop/elem
|
|
|
295
287
|
import { attachClosestEdge, extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
296
288
|
import React4, { forwardRef, useCallback, useLayoutEffect, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
297
289
|
import { invariant } from "@dxos/invariant";
|
|
298
|
-
import { Icon as
|
|
299
|
-
import {
|
|
290
|
+
import { Icon as Icon3, ListItem, ScrollArea, Tooltip, toLocalizedString as toLocalizedString3, useMediaQuery, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
291
|
+
import { DropdownMenu, MenuProvider } from "@dxos/react-ui-menu";
|
|
300
292
|
import { Tabs } from "@dxos/react-ui-tabs";
|
|
301
293
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
302
294
|
import { arrayMove, getFirstTwoRenderableChars } from "@dxos/util";
|
|
303
295
|
|
|
304
|
-
//
|
|
296
|
+
// src/components/UserAccountAvatar/UserAccountAvatar.tsx
|
|
305
297
|
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
306
298
|
import React3 from "react";
|
|
307
299
|
import { Avatar } from "@dxos/react-ui";
|
|
@@ -326,8 +318,8 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
|
|
|
326
318
|
}
|
|
327
319
|
};
|
|
328
320
|
|
|
329
|
-
//
|
|
330
|
-
var __dxlog_file = "/
|
|
321
|
+
// src/components/Sidebar/L0Menu.tsx
|
|
322
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-navtree/src/components/Sidebar/L0Menu.tsx";
|
|
331
323
|
var useL0ItemClick = ({ item, parent, path }, type) => {
|
|
332
324
|
const { tab, isCurrent, onSelect, onTabChange } = useNavTreeContext();
|
|
333
325
|
const [isLg] = useMediaQuery("lg", {
|
|
@@ -561,7 +553,7 @@ var ItemAvatar = ({ item }) => {
|
|
|
561
553
|
color: `var(--dx-${hue}SurfaceText)`
|
|
562
554
|
}
|
|
563
555
|
};
|
|
564
|
-
return /* @__PURE__ */ React4.createElement(
|
|
556
|
+
return /* @__PURE__ */ React4.createElement(Icon3, {
|
|
565
557
|
icon: item.properties.icon,
|
|
566
558
|
size: 5,
|
|
567
559
|
...hueFgStyle
|
|
@@ -654,7 +646,7 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
|
|
|
654
646
|
}, /* @__PURE__ */ React4.createElement("div", {
|
|
655
647
|
role: "none",
|
|
656
648
|
className: mx2(l0ItemContent, "is-[--rail-action] bs-[--rail-action] group-hover/l0item:bg-hoverSurface")
|
|
657
|
-
}, /* @__PURE__ */ React4.createElement(
|
|
649
|
+
}, /* @__PURE__ */ React4.createElement(Icon3, {
|
|
658
650
|
icon: "ph--list--regular",
|
|
659
651
|
size: 5
|
|
660
652
|
})))))), /* @__PURE__ */ React4.createElement(ScrollArea.Root, null, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React4.createElement("div", {
|
|
@@ -717,20 +709,20 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
|
|
|
717
709
|
}
|
|
718
710
|
};
|
|
719
711
|
|
|
720
|
-
//
|
|
712
|
+
// src/components/Sidebar/L1Panel.tsx
|
|
721
713
|
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
722
714
|
import React7, { useCallback as useCallback2, useMemo as useMemo3 } from "react";
|
|
723
|
-
import {
|
|
715
|
+
import { IconButton as IconButton2, toLocalizedString as toLocalizedString6, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
724
716
|
import { Tree } from "@dxos/react-ui-list";
|
|
725
717
|
import { Tabs as Tabs2 } from "@dxos/react-ui-tabs";
|
|
726
|
-
import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem as hoverableOpenControlItem2
|
|
718
|
+
import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem as hoverableOpenControlItem2 } from "@dxos/react-ui-theme";
|
|
727
719
|
|
|
728
|
-
//
|
|
720
|
+
// src/components/NavTreeItem/NavTreeItemAction.tsx
|
|
729
721
|
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
730
722
|
import React5 from "react";
|
|
731
|
-
import {
|
|
723
|
+
import { IconButton, toLocalizedString as toLocalizedString4, useDensityContext, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
732
724
|
import { DropdownMenu as DropdownMenu2, MenuProvider as MenuProvider2 } from "@dxos/react-ui-menu";
|
|
733
|
-
import { hoverableControlItem, hoverableOpenControlItem
|
|
725
|
+
import { hoverableControlItem, hoverableOpenControlItem } from "@dxos/react-ui-theme";
|
|
734
726
|
var fallbackIcon = "ph--placeholder--regular";
|
|
735
727
|
var fineActionButtonProps = {
|
|
736
728
|
size: 4,
|
|
@@ -753,7 +745,11 @@ var NavTreeItemActionDropdownMenu = ({ parent, label, icon, testId, menuActions,
|
|
|
753
745
|
asChild: true
|
|
754
746
|
}, /* @__PURE__ */ React5.createElement(IconButton, {
|
|
755
747
|
...density === "coarse" ? coarseActionButtonProps : fineActionButtonProps,
|
|
756
|
-
classNames:
|
|
748
|
+
classNames: [
|
|
749
|
+
"shrink-0 pli-2 pointer-fine:pli-1",
|
|
750
|
+
hoverableControlItem,
|
|
751
|
+
hoverableOpenControlItem
|
|
752
|
+
],
|
|
757
753
|
variant: "ghost",
|
|
758
754
|
icon: icon ?? fallbackIcon,
|
|
759
755
|
iconOnly: true,
|
|
@@ -773,7 +769,12 @@ var NavTreeItemMonolithicAction = ({ parent, properties: { disabled, caller, tes
|
|
|
773
769
|
return /* @__PURE__ */ React5.createElement(IconButton, {
|
|
774
770
|
...density === "coarse" ? coarseActionButtonProps : fineActionButtonProps,
|
|
775
771
|
variant,
|
|
776
|
-
classNames:
|
|
772
|
+
classNames: [
|
|
773
|
+
"shrink-0",
|
|
774
|
+
hoverableControlItem,
|
|
775
|
+
hoverableOpenControlItem,
|
|
776
|
+
iconOnly ? "pli-2 pointer-fine:pli-1" : "p-2 pointer-fine:p-2 mie-1"
|
|
777
|
+
],
|
|
777
778
|
icon: icon ?? fallbackIcon,
|
|
778
779
|
iconOnly,
|
|
779
780
|
label: baseLabel,
|
|
@@ -817,20 +818,20 @@ var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) =>
|
|
|
817
818
|
}
|
|
818
819
|
};
|
|
819
820
|
|
|
820
|
-
//
|
|
821
|
+
// src/components/NavTreeItem/NavTreeItemColumns.tsx
|
|
821
822
|
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
822
823
|
import React6, { Fragment, memo } from "react";
|
|
823
|
-
import { isAction as
|
|
824
|
-
import { DensityProvider, Popover, toLocalizedString as toLocalizedString5,
|
|
824
|
+
import { isAction as isAction2 } from "@dxos/app-graph";
|
|
825
|
+
import { DensityProvider, Popover, Treegrid, toLocalizedString as toLocalizedString5, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
825
826
|
var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fine" }) => {
|
|
826
827
|
var _effect = _useSignals6();
|
|
827
828
|
try {
|
|
828
829
|
const { t } = useTranslation6(NAVTREE_PLUGIN);
|
|
829
|
-
const {
|
|
830
|
+
const { useActions: useActions3, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();
|
|
830
831
|
const level = path.length - 2;
|
|
831
|
-
const { actions: _actions, groupedActions } =
|
|
832
|
-
const [primaryAction, ...secondaryActions] = _actions.toSorted((a,
|
|
833
|
-
const actions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) =>
|
|
832
|
+
const { actions: _actions, groupedActions } = useActions3(item);
|
|
833
|
+
const [primaryAction, ...secondaryActions] = _actions.toSorted((a, _b) => a.properties?.disposition === "list-item-primary" ? -1 : 1);
|
|
834
|
+
const actions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) => isAction2(action) ? [
|
|
834
835
|
action
|
|
835
836
|
] : []).filter((a) => [
|
|
836
837
|
"list-item",
|
|
@@ -838,7 +839,7 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
838
839
|
].includes(a.properties?.disposition));
|
|
839
840
|
const ActionRoot = popoverAnchorId === `dxos.org/ui/${NAV_TREE_ITEM}/${item.id}` ? Popover.Anchor : Fragment;
|
|
840
841
|
useLoadDescendents(item);
|
|
841
|
-
useLoadDescendents(primaryAction && !
|
|
842
|
+
useLoadDescendents(primaryAction && !isAction2(primaryAction) ? primaryAction : void 0);
|
|
842
843
|
return /* @__PURE__ */ React6.createElement(DensityProvider, {
|
|
843
844
|
density
|
|
844
845
|
}, /* @__PURE__ */ React6.createElement("div", {
|
|
@@ -849,8 +850,8 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
849
850
|
label: toLocalizedString5(primaryAction.properties?.label, t),
|
|
850
851
|
icon: primaryAction.properties?.icon ?? "ph--placeholder--regular",
|
|
851
852
|
parent: item,
|
|
852
|
-
monolithic:
|
|
853
|
-
menuActions:
|
|
853
|
+
monolithic: isAction2(primaryAction),
|
|
854
|
+
menuActions: isAction2(primaryAction) ? [
|
|
854
855
|
primaryAction
|
|
855
856
|
] : groupedActions[primaryAction.id],
|
|
856
857
|
menuType: primaryAction.properties?.menuType,
|
|
@@ -872,31 +873,15 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
872
873
|
}
|
|
873
874
|
});
|
|
874
875
|
|
|
875
|
-
//
|
|
876
|
-
var
|
|
877
|
-
var TitleButton = ({ title, onClick }) => {
|
|
876
|
+
// src/components/Sidebar/L1Panel.tsx
|
|
877
|
+
var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
|
|
878
878
|
var _effect = _useSignals7();
|
|
879
879
|
try {
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
icon: "ph--caret-left--bold",
|
|
886
|
-
size: 3
|
|
887
|
-
}), /* @__PURE__ */ React7.createElement("span", {
|
|
888
|
-
className: mx4(headingBackButtonLabel)
|
|
889
|
-
}, title));
|
|
890
|
-
} finally {
|
|
891
|
-
_effect.f();
|
|
892
|
-
}
|
|
893
|
-
};
|
|
894
|
-
var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
|
|
895
|
-
var _effect = _useSignals7();
|
|
896
|
-
try {
|
|
897
|
-
const { isAlternateTree, setAlternateTree, ...navTreeContext } = useNavTreeContext();
|
|
898
|
-
const { t } = useTranslation7(NAVTREE_PLUGIN);
|
|
899
|
-
const alternateTree = navTreeContext.useItems(item, {
|
|
880
|
+
const { t } = useTranslation7(meta.id);
|
|
881
|
+
const { isAlternateTree, ...navTreeContext } = useNavTreeContext();
|
|
882
|
+
const { useItems: useItems2 } = navTreeContext;
|
|
883
|
+
const title = toLocalizedString6(item.properties.label, t);
|
|
884
|
+
const alternateTree = useItems2(item, {
|
|
900
885
|
disposition: "alternate-tree"
|
|
901
886
|
})[0];
|
|
902
887
|
const alternatePath = useMemo3(() => [
|
|
@@ -906,34 +891,16 @@ var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
|
|
|
906
891
|
item.id,
|
|
907
892
|
path
|
|
908
893
|
]);
|
|
909
|
-
const handleOpen = useCallback2(() => setAlternateTree?.(alternatePath, true), [
|
|
910
|
-
alternatePath,
|
|
911
|
-
setAlternateTree
|
|
912
|
-
]);
|
|
913
894
|
const isAlternate = isAlternateTree?.(alternatePath, item) ?? false;
|
|
914
895
|
const useAlternateItems = useCallback2((node, { disposition } = {}) => {
|
|
915
|
-
return
|
|
896
|
+
return useItems2(node, {
|
|
916
897
|
disposition,
|
|
917
898
|
sort: node?.id === alternateTree.id
|
|
918
899
|
});
|
|
919
900
|
}, [
|
|
920
|
-
|
|
921
|
-
|
|
901
|
+
alternateTree,
|
|
902
|
+
useItems2
|
|
922
903
|
]);
|
|
923
|
-
const handleBack = useCallback2(() => {
|
|
924
|
-
if (isAlternate) {
|
|
925
|
-
setAlternateTree?.(alternatePath, false);
|
|
926
|
-
} else {
|
|
927
|
-
onBack?.();
|
|
928
|
-
}
|
|
929
|
-
}, [
|
|
930
|
-
isAlternate,
|
|
931
|
-
onBack,
|
|
932
|
-
alternatePath,
|
|
933
|
-
setAlternateTree
|
|
934
|
-
]);
|
|
935
|
-
const title = toLocalizedString6(item.properties.label, t);
|
|
936
|
-
const backCapable = item.id.startsWith("!") || isAlternate;
|
|
937
904
|
return /* @__PURE__ */ React7.createElement(Tabs2.Tabpanel, {
|
|
938
905
|
key: item.id,
|
|
939
906
|
value: item.id,
|
|
@@ -948,29 +915,12 @@ var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
|
|
|
948
915
|
...!open && {
|
|
949
916
|
inert: "true"
|
|
950
917
|
}
|
|
951
|
-
}, item.id === currentItemId && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(
|
|
952
|
-
className: "flex items-center border-be border-subduedSeparator app-drag pli-1"
|
|
953
|
-
}, backCapable ? /* @__PURE__ */ React7.createElement(TitleButton, {
|
|
954
|
-
title,
|
|
955
|
-
onClick: handleBack
|
|
956
|
-
}) : /* @__PURE__ */ React7.createElement("span", {
|
|
957
|
-
className: "flex-1 truncate min-is-0 pis-6"
|
|
958
|
-
}, title), alternateTree && !isAlternate && /* @__PURE__ */ React7.createElement(IconButton2, {
|
|
959
|
-
variant: "ghost",
|
|
960
|
-
classNames: mx4("shrink-0", hoverableControlItem2, hoverableOpenControlItem2, "pli-2 pointer-fine:pli-1"),
|
|
961
|
-
iconOnly: true,
|
|
962
|
-
size: 5,
|
|
963
|
-
density: "coarse",
|
|
964
|
-
icon: alternateTree.properties.icon ?? "ph--placeholder--regular",
|
|
965
|
-
label: toLocalizedString6(alternateTree.properties.label ?? alternateTree.id, t),
|
|
966
|
-
"data-testid": "treeView.alternateTreeButton",
|
|
967
|
-
onClick: handleOpen
|
|
968
|
-
}), /* @__PURE__ */ React7.createElement(NavTreeItemColumns, {
|
|
918
|
+
}, item.id === currentItemId && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(L1PanelHeader, {
|
|
969
919
|
path,
|
|
970
920
|
item,
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
})
|
|
921
|
+
currentItemId,
|
|
922
|
+
onBack
|
|
923
|
+
}), /* @__PURE__ */ React7.createElement("div", {
|
|
974
924
|
role: "none",
|
|
975
925
|
className: "overflow-y-auto"
|
|
976
926
|
}, isAlternate ? /* @__PURE__ */ React7.createElement(Tree, {
|
|
@@ -996,48 +946,106 @@ var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
|
|
|
996
946
|
_effect.f();
|
|
997
947
|
}
|
|
998
948
|
};
|
|
999
|
-
var
|
|
949
|
+
var L1PanelHeader = ({ item, path, onBack }) => {
|
|
1000
950
|
var _effect = _useSignals7();
|
|
1001
951
|
try {
|
|
1002
|
-
const {
|
|
1003
|
-
|
|
1004
|
-
const
|
|
1005
|
-
const
|
|
952
|
+
const { t } = useTranslation7(meta.id);
|
|
953
|
+
const { isAlternateTree, setAlternateTree, ...navTreeContext } = useNavTreeContext();
|
|
954
|
+
const title = toLocalizedString6(item.properties.label, t);
|
|
955
|
+
const alternateTree = navTreeContext.useItems(item, {
|
|
956
|
+
disposition: "alternate-tree"
|
|
957
|
+
})[0];
|
|
958
|
+
const alternatePath = useMemo3(() => [
|
|
1006
959
|
...path,
|
|
1007
960
|
item.id
|
|
1008
961
|
], [
|
|
1009
962
|
item.id,
|
|
1010
963
|
path
|
|
1011
964
|
]);
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
965
|
+
const isAlternate = isAlternateTree?.(alternatePath, item) ?? false;
|
|
966
|
+
const backCapable = item.id.startsWith("!") || isAlternate;
|
|
967
|
+
const handleOpen = useCallback2(() => {
|
|
968
|
+
setAlternateTree?.(alternatePath, true);
|
|
969
|
+
}, [
|
|
970
|
+
alternatePath,
|
|
971
|
+
setAlternateTree
|
|
972
|
+
]);
|
|
973
|
+
const handleBack = useCallback2(() => {
|
|
974
|
+
if (isAlternate) {
|
|
975
|
+
setAlternateTree?.(alternatePath, false);
|
|
976
|
+
} else {
|
|
977
|
+
onBack?.();
|
|
978
|
+
}
|
|
979
|
+
}, [
|
|
980
|
+
isAlternate,
|
|
981
|
+
alternatePath,
|
|
982
|
+
setAlternateTree,
|
|
983
|
+
onBack
|
|
984
|
+
]);
|
|
985
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
986
|
+
className: "flex is-full items-center border-be border-subduedSeparator app-drag density-coarse"
|
|
987
|
+
}, /* @__PURE__ */ React7.createElement("div", {
|
|
988
|
+
className: "is-6"
|
|
989
|
+
}), /* @__PURE__ */ React7.createElement("h2", {
|
|
990
|
+
className: "flex-1 truncate min-is-0"
|
|
991
|
+
}, title), /* @__PURE__ */ React7.createElement("div", null, backCapable && /* @__PURE__ */ React7.createElement(IconButton2, {
|
|
992
|
+
variant: "ghost",
|
|
993
|
+
icon: "ph--arrow-u-down-left--regular",
|
|
994
|
+
iconOnly: true,
|
|
995
|
+
size: 5,
|
|
996
|
+
label: t("button back"),
|
|
997
|
+
classNames: [
|
|
998
|
+
hoverableControlItem2,
|
|
999
|
+
hoverableOpenControlItem2,
|
|
1000
|
+
"pointer-fine:pli-1"
|
|
1001
|
+
],
|
|
1002
|
+
onClick: handleBack
|
|
1003
|
+
}) || alternateTree && !isAlternate && /* @__PURE__ */ React7.createElement(IconButton2, {
|
|
1004
|
+
"data-testid": "treeView.alternateTreeButton",
|
|
1005
|
+
variant: "ghost",
|
|
1006
|
+
icon: alternateTree.properties.icon ?? "ph--placeholder--regular",
|
|
1007
|
+
iconOnly: true,
|
|
1008
|
+
size: 5,
|
|
1009
|
+
label: toLocalizedString6(alternateTree.properties.label ?? alternateTree.id, t),
|
|
1010
|
+
classNames: [
|
|
1011
|
+
hoverableControlItem2,
|
|
1012
|
+
hoverableOpenControlItem2,
|
|
1013
|
+
"pointer-fine:pli-1"
|
|
1014
|
+
],
|
|
1015
|
+
onClick: handleOpen
|
|
1016
|
+
}) || /* @__PURE__ */ React7.createElement("div", null)), /* @__PURE__ */ React7.createElement(NavTreeItemColumns, {
|
|
1017
|
+
open: true,
|
|
1018
|
+
path,
|
|
1019
|
+
item,
|
|
1020
|
+
density: "coarse"
|
|
1021
|
+
}));
|
|
1018
1022
|
} finally {
|
|
1019
1023
|
_effect.f();
|
|
1020
1024
|
}
|
|
1021
1025
|
};
|
|
1022
|
-
|
|
1023
|
-
|
|
1026
|
+
|
|
1027
|
+
// src/components/Sidebar/L1Tabs.tsx
|
|
1028
|
+
import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
|
|
1029
|
+
import React8, { useMemo as useMemo4 } from "react";
|
|
1030
|
+
var L1Tabs = ({ topLevelItems, onBack, ...props }) => {
|
|
1031
|
+
var _effect = _useSignals8();
|
|
1024
1032
|
try {
|
|
1025
|
-
return /* @__PURE__ */
|
|
1033
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, topLevelItems.map((item) => {
|
|
1026
1034
|
const type = l0ItemType(item);
|
|
1027
1035
|
switch (type) {
|
|
1028
|
-
case "collection":
|
|
1029
|
-
return /* @__PURE__ */ React7.createElement(L1PanelCollection, {
|
|
1030
|
-
key: item.id,
|
|
1031
|
-
item,
|
|
1032
|
-
...props
|
|
1033
|
-
});
|
|
1034
1036
|
case "tab":
|
|
1035
|
-
return /* @__PURE__ */
|
|
1037
|
+
return /* @__PURE__ */ React8.createElement(L1Panel, {
|
|
1036
1038
|
key: item.id,
|
|
1037
1039
|
item,
|
|
1038
1040
|
...props,
|
|
1039
1041
|
onBack
|
|
1040
1042
|
});
|
|
1043
|
+
case "collection":
|
|
1044
|
+
return /* @__PURE__ */ React8.createElement(L1PanelCollection, {
|
|
1045
|
+
key: item.id,
|
|
1046
|
+
item,
|
|
1047
|
+
...props
|
|
1048
|
+
});
|
|
1041
1049
|
default:
|
|
1042
1050
|
return null;
|
|
1043
1051
|
}
|
|
@@ -1046,11 +1054,34 @@ var L1Panels = ({ topLevelItems, onBack, ...props }) => {
|
|
|
1046
1054
|
_effect.f();
|
|
1047
1055
|
}
|
|
1048
1056
|
};
|
|
1057
|
+
var L1PanelCollection = ({ item, path, ...props }) => {
|
|
1058
|
+
var _effect = _useSignals8();
|
|
1059
|
+
try {
|
|
1060
|
+
const { useItems: useItems2 } = useNavTreeContext();
|
|
1061
|
+
useLoadDescendents(item);
|
|
1062
|
+
const collectionItems = useItems2(item);
|
|
1063
|
+
const groupPath = useMemo4(() => [
|
|
1064
|
+
...path,
|
|
1065
|
+
item.id
|
|
1066
|
+
], [
|
|
1067
|
+
item.id,
|
|
1068
|
+
path
|
|
1069
|
+
]);
|
|
1070
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, collectionItems.filter((item2) => l0ItemType(item2) === "tab").map((item2) => /* @__PURE__ */ React8.createElement(L1Panel, {
|
|
1071
|
+
key: item2.id,
|
|
1072
|
+
item: item2,
|
|
1073
|
+
path: groupPath,
|
|
1074
|
+
...props
|
|
1075
|
+
})));
|
|
1076
|
+
} finally {
|
|
1077
|
+
_effect.f();
|
|
1078
|
+
}
|
|
1079
|
+
};
|
|
1049
1080
|
|
|
1050
|
-
//
|
|
1081
|
+
// src/components/NavTree/NavTree.tsx
|
|
1051
1082
|
var NAV_TREE_ITEM = "NavTreeItem";
|
|
1052
1083
|
var NavTree = ({ id, root, ...props }) => {
|
|
1053
|
-
var _effect =
|
|
1084
|
+
var _effect = _useSignals9();
|
|
1054
1085
|
try {
|
|
1055
1086
|
const { tab, useItems: useItems2, onBack } = useNavTreeContext();
|
|
1056
1087
|
const topLevelActions = useItems2(root, {
|
|
@@ -1066,7 +1097,7 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1066
1097
|
const topLevelNavigation = useItems2(root, {
|
|
1067
1098
|
disposition: "navigation"
|
|
1068
1099
|
});
|
|
1069
|
-
const l0Items =
|
|
1100
|
+
const l0Items = useMemo5(() => [
|
|
1070
1101
|
// prettier-ignore
|
|
1071
1102
|
...topLevelCollections,
|
|
1072
1103
|
...topLevelWorkspaces,
|
|
@@ -1083,7 +1114,7 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1083
1114
|
const userAccountItem = useItems2(root, {
|
|
1084
1115
|
disposition: "user-account"
|
|
1085
1116
|
})[0];
|
|
1086
|
-
const topLevelItems =
|
|
1117
|
+
const topLevelItems = useMemo5(() => [
|
|
1087
1118
|
// prettier-ignore
|
|
1088
1119
|
...l0Items,
|
|
1089
1120
|
...pinnedItems,
|
|
@@ -1096,24 +1127,24 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1096
1127
|
userAccountItem
|
|
1097
1128
|
]);
|
|
1098
1129
|
useLoadDescendents(root);
|
|
1099
|
-
const path =
|
|
1130
|
+
const path = useMemo5(() => [
|
|
1100
1131
|
id
|
|
1101
1132
|
], [
|
|
1102
1133
|
id
|
|
1103
1134
|
]);
|
|
1104
|
-
return /* @__PURE__ */
|
|
1135
|
+
return /* @__PURE__ */ React9.createElement(Tabs3.Root, {
|
|
1105
1136
|
value: tab,
|
|
1106
1137
|
orientation: "vertical",
|
|
1107
1138
|
verticalVariant: "stateless",
|
|
1108
1139
|
classNames: "relative"
|
|
1109
|
-
}, /* @__PURE__ */
|
|
1140
|
+
}, /* @__PURE__ */ React9.createElement(L0Menu, {
|
|
1110
1141
|
menuActions: topLevelActions,
|
|
1111
1142
|
topLevelItems: l0Items,
|
|
1112
1143
|
pinnedItems,
|
|
1113
1144
|
userAccountItem,
|
|
1114
1145
|
path,
|
|
1115
1146
|
parent: root
|
|
1116
|
-
}), /* @__PURE__ */
|
|
1147
|
+
}), /* @__PURE__ */ React9.createElement(L1Tabs, {
|
|
1117
1148
|
topLevelItems,
|
|
1118
1149
|
path,
|
|
1119
1150
|
currentItemId: tab,
|
|
@@ -1125,17 +1156,9 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1125
1156
|
}
|
|
1126
1157
|
};
|
|
1127
1158
|
|
|
1128
|
-
//
|
|
1129
|
-
import { lazy } from "@dxos/app-framework";
|
|
1130
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-P7AY3K72.mjs"));
|
|
1131
|
-
var IntentResolver = lazy(() => import("./intent-resolver-NAYKKAOP.mjs"));
|
|
1132
|
-
var Keyboard2 = lazy(() => import("./keyboard-DDFATRUG.mjs"));
|
|
1133
|
-
var ReactSurface = lazy(() => import("./react-surface-H3JRTVNU.mjs"));
|
|
1134
|
-
var State = lazy(() => import("./state-J6AKZRB4.mjs"));
|
|
1135
|
-
|
|
1136
|
-
// packages/plugins/plugin-navtree/src/components/NavTreeContainer.tsx
|
|
1159
|
+
// src/components/NavTreeContainer.tsx
|
|
1137
1160
|
var NODE_TYPE = "dxos/app-graph/node";
|
|
1138
|
-
var renderItemEnd = ({ node, open }) => /* @__PURE__ */
|
|
1161
|
+
var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Surface, {
|
|
1139
1162
|
role: "navtree-item-end",
|
|
1140
1163
|
data: {
|
|
1141
1164
|
id: node.id,
|
|
@@ -1149,7 +1172,7 @@ var filterItems = (node, disposition) => {
|
|
|
1149
1172
|
if (!disposition && (node.properties.disposition === "hidden" || node.properties.disposition === "alternate-tree")) {
|
|
1150
1173
|
return false;
|
|
1151
1174
|
} else if (!disposition) {
|
|
1152
|
-
const action =
|
|
1175
|
+
const action = isAction3(node);
|
|
1153
1176
|
return !action || node.properties.disposition === "item";
|
|
1154
1177
|
} else {
|
|
1155
1178
|
return node.properties.disposition === disposition;
|
|
@@ -1160,11 +1183,32 @@ var getItems = (graph, node, disposition) => {
|
|
|
1160
1183
|
};
|
|
1161
1184
|
var useItems = (node, options) => {
|
|
1162
1185
|
const { graph } = useAppGraph2();
|
|
1163
|
-
const connections = useConnections(graph, node?.id ?? ROOT_ID)
|
|
1164
|
-
|
|
1186
|
+
const connections = useConnections(graph, node?.id ?? ROOT_ID);
|
|
1187
|
+
const filtered = connections.filter((node2) => filterItems(node2, options?.disposition));
|
|
1188
|
+
return options?.sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
|
|
1189
|
+
};
|
|
1190
|
+
var useActions2 = (node) => {
|
|
1191
|
+
const { graph } = useAppGraph2();
|
|
1192
|
+
const actions = useGraphActions(graph, node.id);
|
|
1193
|
+
return useMemo6(() => actions.reduce((acc, arg) => {
|
|
1194
|
+
if (arg.properties.disposition === "item") {
|
|
1195
|
+
return acc;
|
|
1196
|
+
}
|
|
1197
|
+
acc.actions.push(arg);
|
|
1198
|
+
if (!isAction3(arg)) {
|
|
1199
|
+
const actionGroup = graph.getActions(arg.id);
|
|
1200
|
+
acc.groupedActions[arg.id] = actionGroup;
|
|
1201
|
+
}
|
|
1202
|
+
return acc;
|
|
1203
|
+
}, {
|
|
1204
|
+
actions: [],
|
|
1205
|
+
groupedActions: {}
|
|
1206
|
+
}), [
|
|
1207
|
+
actions
|
|
1208
|
+
]);
|
|
1165
1209
|
};
|
|
1166
1210
|
var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar }) => {
|
|
1167
|
-
var _effect =
|
|
1211
|
+
var _effect = _useSignals10();
|
|
1168
1212
|
try {
|
|
1169
1213
|
const [isLg] = useMediaQuery2("lg", {
|
|
1170
1214
|
ssr: false
|
|
@@ -1174,9 +1218,6 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1174
1218
|
const { isOpen, isCurrent, isAlternateTree, setItem } = useCapability(NavTreeCapabilities.State);
|
|
1175
1219
|
const layout = useLayout();
|
|
1176
1220
|
const { navigationSidebarState } = useSidebars(NAVTREE_PLUGIN);
|
|
1177
|
-
const getActions2 = useCallback3((node) => getActions(graph, node), [
|
|
1178
|
-
graph
|
|
1179
|
-
]);
|
|
1180
1221
|
const getProps = useCallback3((node, path) => {
|
|
1181
1222
|
const children = getChildren(graph, node, path).filter(getChildrenFilter);
|
|
1182
1223
|
const parentOf = children.length > 0 ? children.map(({ id }) => id) : node.properties.role === "branch" ? [] : void 0;
|
|
@@ -1186,7 +1227,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1186
1227
|
parentOf,
|
|
1187
1228
|
icon: node.properties.icon,
|
|
1188
1229
|
disabled: node.properties.disabled,
|
|
1189
|
-
className:
|
|
1230
|
+
className: mx3(node.properties.modified && "italic", node.properties.className),
|
|
1190
1231
|
headingClassName: node.properties.headingClassName,
|
|
1191
1232
|
testId: node.properties.testId
|
|
1192
1233
|
};
|
|
@@ -1243,7 +1284,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1243
1284
|
if (!node.data) {
|
|
1244
1285
|
return;
|
|
1245
1286
|
}
|
|
1246
|
-
if (
|
|
1287
|
+
if (isAction3(node)) {
|
|
1247
1288
|
const [parent] = graph.getConnections(node.id, "inbound");
|
|
1248
1289
|
void (parent && node.data({
|
|
1249
1290
|
parent,
|
|
@@ -1279,7 +1320,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1279
1320
|
}));
|
|
1280
1321
|
}
|
|
1281
1322
|
const defaultAction = graph.getActions(node.id).find((action) => action.properties?.disposition === "default");
|
|
1282
|
-
if (
|
|
1323
|
+
if (isAction3(defaultAction)) {
|
|
1283
1324
|
void defaultAction.data();
|
|
1284
1325
|
}
|
|
1285
1326
|
if (!isLg) {
|
|
@@ -1359,10 +1400,10 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1359
1400
|
}, [
|
|
1360
1401
|
setItem
|
|
1361
1402
|
]);
|
|
1362
|
-
const navTreeContextValue =
|
|
1403
|
+
const navTreeContextValue = useMemo6(() => ({
|
|
1363
1404
|
useItems,
|
|
1364
1405
|
tab,
|
|
1365
|
-
|
|
1406
|
+
useActions: useActions2,
|
|
1366
1407
|
loadDescendents,
|
|
1367
1408
|
renderItemEnd,
|
|
1368
1409
|
popoverAnchorId,
|
|
@@ -1379,7 +1420,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1379
1420
|
onBack: handleBack
|
|
1380
1421
|
}), [
|
|
1381
1422
|
tab,
|
|
1382
|
-
|
|
1423
|
+
useActions2,
|
|
1383
1424
|
loadDescendents,
|
|
1384
1425
|
renderItemEnd,
|
|
1385
1426
|
popoverAnchorId,
|
|
@@ -1395,9 +1436,9 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1395
1436
|
handleSelect,
|
|
1396
1437
|
handleBack
|
|
1397
1438
|
]);
|
|
1398
|
-
return /* @__PURE__ */
|
|
1439
|
+
return /* @__PURE__ */ React10.createElement(NavTreeContext.Provider, {
|
|
1399
1440
|
value: navTreeContextValue
|
|
1400
|
-
}, /* @__PURE__ */
|
|
1441
|
+
}, /* @__PURE__ */ React10.createElement(NavTree, {
|
|
1401
1442
|
id: ROOT_ID,
|
|
1402
1443
|
root: graph.root,
|
|
1403
1444
|
open: layout.sidebarOpen
|
|
@@ -1415,7 +1456,6 @@ export {
|
|
|
1415
1456
|
resolveMigrationOperation,
|
|
1416
1457
|
sortActions,
|
|
1417
1458
|
getChildren,
|
|
1418
|
-
getActions,
|
|
1419
1459
|
l0ItemType,
|
|
1420
1460
|
NODE_TYPE,
|
|
1421
1461
|
NavTreeContainer,
|
|
@@ -1426,4 +1466,4 @@ export {
|
|
|
1426
1466
|
ReactSurface,
|
|
1427
1467
|
State
|
|
1428
1468
|
};
|
|
1429
|
-
//# sourceMappingURL=chunk-
|
|
1469
|
+
//# sourceMappingURL=chunk-SNGLGBFJ.mjs.map
|