@dxos/plugin-navtree 0.8.4-main.67995b8 → 0.8.4-main.a4bbb77
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-BCXDEDN7.mjs} +9 -9
- package/dist/lib/browser/app-graph-builder-BCXDEDN7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WEMCSQI7.mjs → chunk-6AZKY5WZ.mjs} +125 -124
- package/dist/lib/browser/chunk-6AZKY5WZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WCARAZ7J.mjs → chunk-LPAREX6J.mjs} +4 -4
- package/dist/lib/browser/chunk-LPAREX6J.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZENLR72O.mjs +14 -0
- package/dist/lib/browser/chunk-ZENLR72O.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -10
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-3XYN2CBU.mjs → intent-resolver-G6COWRWW.mjs} +6 -6
- package/dist/lib/browser/{intent-resolver-3XYN2CBU.mjs.map → intent-resolver-G6COWRWW.mjs.map} +3 -3
- package/dist/lib/browser/{keyboard-QRS6WOQH.mjs → keyboard-AHSAWKXA.mjs} +4 -4
- package/dist/lib/browser/{keyboard-QRS6WOQH.mjs.map → keyboard-AHSAWKXA.mjs.map} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-JSJ5SQX5.mjs → react-surface-FOCB4Y5R.mjs} +10 -10
- package/dist/lib/browser/react-surface-FOCB4Y5R.mjs.map +7 -0
- package/dist/lib/browser/{state-54DY3DOY.mjs → state-2Q623V7U.mjs} +7 -7
- package/dist/lib/browser/state-2Q623V7U.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 +6 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts +1 -1
- package/dist/types/src/capabilities/keyboard.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.d.ts.map +1 -1
- package/dist/types/src/components/NavTree/NavTree.stories.d.ts +26 -3
- 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 +32 -4
- package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeItem/NavTreeItemColumns.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L0Menu.d.ts +2 -0
- package/dist/types/src/components/Sidebar/L0Menu.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/L1Tabs.d.ts.map +1 -1
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.d.ts.map +1 -1
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts +8 -5
- package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/types.d.ts +2 -2
- package/dist/types/src/components/types.d.ts.map +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.d.ts +1 -2
- package/dist/types/src/experimental/Tree.d.ts.map +1 -1
- package/dist/types/src/experimental/Tree.stories.d.ts +10 -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/util.d.ts +1 -2
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +50 -49
- package/src/NavTreePlugin.tsx +75 -76
- package/src/capabilities/app-graph-builder.ts +5 -5
- package/src/capabilities/capabilities.ts +2 -2
- package/src/capabilities/intent-resolver.ts +1 -1
- package/src/capabilities/keyboard.ts +2 -2
- package/src/capabilities/react-surface.tsx +5 -5
- package/src/capabilities/state.ts +4 -3
- package/src/components/CommandsDialog/CommandsDialog.tsx +5 -5
- package/src/components/CommandsDialog/CommandsTrigger.tsx +3 -3
- package/src/components/NavTree/NavTree.stories.tsx +21 -18
- package/src/components/NavTree/NavTree.tsx +4 -0
- package/src/components/NavTreeContainer.tsx +41 -15
- package/src/components/NavTreeDocumentTitle.tsx +2 -2
- package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +4 -6
- package/src/components/NavTreeItem/NavTreeItemAction.tsx +5 -5
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +7 -6
- package/src/components/Sidebar/L0Menu.tsx +51 -50
- package/src/components/Sidebar/L1Panel.tsx +18 -20
- package/src/components/Sidebar/L1Tabs.tsx +1 -0
- package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +9 -8
- package/src/components/UserAccountAvatar/UserAccountAvatar.tsx +20 -12
- package/src/components/types.ts +3 -2
- package/src/events.ts +2 -2
- package/src/experimental/Tree.stories.tsx +29 -28
- package/src/experimental/Tree.tsx +5 -22
- package/src/meta.ts +5 -7
- package/src/testing/app-graph-builder.ts +1 -1
- package/src/util.ts +2 -20
- package/dist/lib/browser/app-graph-builder-5J4LRWDX.mjs.map +0 -7
- package/dist/lib/browser/chunk-ERDGQTH5.mjs +0 -16
- package/dist/lib/browser/chunk-ERDGQTH5.mjs.map +0 -7
- package/dist/lib/browser/chunk-WCARAZ7J.mjs.map +0 -7
- package/dist/lib/browser/chunk-WEMCSQI7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-JSJ5SQX5.mjs.map +0 -7
- package/dist/lib/browser/state-54DY3DOY.mjs.map +0 -7
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMMANDS_DIALOG,
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
meta
|
|
4
|
+
} from "./chunk-ZENLR72O.mjs";
|
|
5
5
|
|
|
6
6
|
// src/capabilities/app-graph-builder.ts
|
|
7
7
|
import { Rx } from "@effect-rx/rx-react";
|
|
8
8
|
import { Option, pipe } from "effect";
|
|
9
|
-
import { Capabilities, contributes, createIntent
|
|
10
|
-
import {
|
|
11
|
-
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
12
|
-
id:
|
|
9
|
+
import { Capabilities, LayoutAction, contributes, createIntent } from "@dxos/app-framework";
|
|
10
|
+
import { ROOT_ID, createExtension } from "@dxos/plugin-graph";
|
|
11
|
+
var app_graph_builder_default = ((context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
12
|
+
id: meta.id,
|
|
13
13
|
actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => [
|
|
14
14
|
{
|
|
15
15
|
id: COMMANDS_DIALOG,
|
|
@@ -27,7 +27,7 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
27
27
|
label: [
|
|
28
28
|
"open commands label",
|
|
29
29
|
{
|
|
30
|
-
ns:
|
|
30
|
+
ns: meta.id
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
33
|
icon: "ph--magnifying-glass--regular",
|
|
@@ -38,8 +38,8 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
]), Option.getOrElse(() => [])))
|
|
41
|
-
}));
|
|
41
|
+
})));
|
|
42
42
|
export {
|
|
43
43
|
app_graph_builder_default as default
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=app-graph-builder-
|
|
45
|
+
//# sourceMappingURL=app-graph-builder-BCXDEDN7.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';\nimport { ROOT_ID, createExtension } from '@dxos/plugin-graph';\n\nimport { COMMANDS_DIALOG, meta } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: meta.id,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => [\n {\n id: COMMANDS_DIALOG,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: COMMANDS_DIALOG,\n options: {\n blockAlign: 'start',\n },\n }),\n );\n },\n properties: {\n label: ['open commands label', { ns: meta.id }],\n icon: 'ph--magnifying-glass--regular',\n keyBinding: {\n macos: 'meta+k',\n windows: 'ctrl+k',\n },\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAcC,cAAkCC,aAAaC,oBAAoB;AAC1F,SAASC,SAASC,uBAAuB;AAIzC,IAAA,6BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC,KAAKD;EACTE,SAAS,CAACC,SACRC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKH,OAAOU,UAAUF,OAAOG,KAAKR,KAAAA,IAAQK,OAAOI,KAAI,CAAA,GAC/EJ,OAAOK,IAAI,MAAM;IACf;MACEb,IAAIc;MACJC,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKtB,QAAQuB,cAAcrB,aAAasB,gBAAgB;AACzF,cAAMF,SACJG,aAAaC,aAAaC,cAAc;UACtCC,MAAM;UACNC,SAASV;UACTW,SAAS;YACPC,YAAY;UACd;QACF,CAAA,CAAA;MAEJ;MACAC,YAAY;QACVC,OAAO;UAAC;UAAuB;YAAEC,IAAI5B,KAAKD;UAAG;;QAC7C8B,MAAM;QACNC,YAAY;UACVC,OAAO;UACPC,SAAS;QACX;MACF;IACF;GACD,GACDzB,OAAO0B,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
|
|
6
|
+
"names": ["Rx", "Option", "pipe", "Capabilities", "LayoutAction", "contributes", "createIntent", "ROOT_ID", "createExtension", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "ROOT_ID", "some", "none", "map", "COMMANDS_DIALOG", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "createIntent", "LayoutAction", "UpdateDialog", "part", "subject", "options", "blockAlign", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "getOrElse"]
|
|
7
|
+
}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NavTreeCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LPAREX6J.mjs";
|
|
4
4
|
import {
|
|
5
5
|
COMMANDS_DIALOG,
|
|
6
6
|
KEY_BINDING,
|
|
7
|
-
NAVTREE_PLUGIN,
|
|
8
7
|
meta
|
|
9
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZENLR72O.mjs";
|
|
10
9
|
|
|
11
10
|
// src/components/CommandsDialog/CommandsDialog.tsx
|
|
12
11
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
13
12
|
import React, { useMemo, useState } from "react";
|
|
14
|
-
import {
|
|
13
|
+
import { LayoutAction, createIntent, useAppGraph, useIntentDispatcher } from "@dxos/app-framework";
|
|
15
14
|
import { isAction, isActionGroup } from "@dxos/app-graph";
|
|
16
15
|
import { Keyboard, keySymbols } from "@dxos/keyboard";
|
|
17
16
|
import { useActions } from "@dxos/plugin-graph";
|
|
18
|
-
import { Button, Dialog, Icon,
|
|
17
|
+
import { Button, Dialog, Icon, toLocalizedString, useTranslation } from "@dxos/react-ui";
|
|
19
18
|
import { SearchList } from "@dxos/react-ui-searchlist";
|
|
20
19
|
import { cardDialogContent, cardDialogHeader, cardDialogPaddedOverflow, cardDialogSearchListRoot } from "@dxos/react-ui-stack";
|
|
21
20
|
import { descriptionText, mx } from "@dxos/react-ui-theme";
|
|
@@ -23,7 +22,7 @@ import { getHostPlatform } from "@dxos/util";
|
|
|
23
22
|
var CommandsDialogContent = ({ selected: initial }) => {
|
|
24
23
|
var _effect = _useSignals();
|
|
25
24
|
try {
|
|
26
|
-
const { t } = useTranslation(
|
|
25
|
+
const { t } = useTranslation(meta.id);
|
|
27
26
|
const [selected, setSelected] = useState(initial);
|
|
28
27
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
29
28
|
const { graph } = useAppGraph();
|
|
@@ -54,7 +53,7 @@ var CommandsDialogContent = ({ selected: initial }) => {
|
|
|
54
53
|
}, /* @__PURE__ */ React.createElement(Dialog.Title, {
|
|
55
54
|
classNames: cardDialogHeader
|
|
56
55
|
}, t("commands dialog title", {
|
|
57
|
-
ns:
|
|
56
|
+
ns: meta.id
|
|
58
57
|
})), /* @__PURE__ */ React.createElement(SearchList.Root, {
|
|
59
58
|
label: t("command list input placeholder"),
|
|
60
59
|
classNames: cardDialogSearchListRoot
|
|
@@ -121,13 +120,13 @@ var CommandsDialogContent = ({ selected: initial }) => {
|
|
|
121
120
|
// src/components/CommandsDialog/CommandsTrigger.tsx
|
|
122
121
|
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
123
122
|
import React2 from "react";
|
|
124
|
-
import {
|
|
123
|
+
import { LayoutAction as LayoutAction2, createIntent as createIntent2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
125
124
|
import { Button as Button2, Icon as Icon2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
126
125
|
var CommandsTrigger = () => {
|
|
127
126
|
var _effect = _useSignals2();
|
|
128
127
|
try {
|
|
129
128
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
130
|
-
const { t } = useTranslation2(
|
|
129
|
+
const { t } = useTranslation2(meta.id);
|
|
131
130
|
return /* @__PURE__ */ React2.createElement(Button2, {
|
|
132
131
|
classNames: "m-1 pli-1 lg:pli-2",
|
|
133
132
|
onClick: () => dispatch(createIntent2(LayoutAction2.UpdateDialog, {
|
|
@@ -149,7 +148,7 @@ var CommandsTrigger = () => {
|
|
|
149
148
|
};
|
|
150
149
|
|
|
151
150
|
// src/util.ts
|
|
152
|
-
import {
|
|
151
|
+
import { isActionLike } from "@dxos/app-graph";
|
|
153
152
|
import { isNonNullable } from "@dxos/util";
|
|
154
153
|
var getParent = (graph, node, path) => {
|
|
155
154
|
const parentId = path[path.length - 2];
|
|
@@ -199,22 +198,6 @@ var getChildren = (graph, node, path = []) => {
|
|
|
199
198
|
return nextPath.includes(n.id) ? void 0 : n;
|
|
200
199
|
}).filter(isNonNullable);
|
|
201
200
|
};
|
|
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
201
|
var l0ItemType = (item) => {
|
|
219
202
|
if (item.properties.disposition === "collection") {
|
|
220
203
|
return "collection";
|
|
@@ -233,15 +216,23 @@ import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/ad
|
|
|
233
216
|
import { extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
|
|
234
217
|
import { untracked } from "@preact/signals-core";
|
|
235
218
|
import React10, { memo as memo2, useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo6 } from "react";
|
|
236
|
-
import {
|
|
237
|
-
import { isAction as
|
|
219
|
+
import { LayoutAction as LayoutAction3, Surface, createIntent as createIntent3, useAppGraph as useAppGraph2, useCapability, useIntentDispatcher as useIntentDispatcher3, useLayout } from "@dxos/app-framework";
|
|
220
|
+
import { ROOT_ID, isAction as isAction3, isActionLike as isActionLike2 } from "@dxos/app-graph";
|
|
238
221
|
import { PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
|
|
239
|
-
import { useConnections } from "@dxos/plugin-graph";
|
|
222
|
+
import { useConnections, useActions as useGraphActions } from "@dxos/plugin-graph";
|
|
240
223
|
import { useMediaQuery as useMediaQuery2, useSidebars } from "@dxos/react-ui";
|
|
241
224
|
import { isTreeData } from "@dxos/react-ui-list";
|
|
242
225
|
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
243
226
|
import { arrayMove as arrayMove2, byPosition } from "@dxos/util";
|
|
244
227
|
|
|
228
|
+
// src/capabilities/index.ts
|
|
229
|
+
import { lazy } from "@dxos/app-framework";
|
|
230
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-BCXDEDN7.mjs"));
|
|
231
|
+
var IntentResolver = lazy(() => import("./intent-resolver-G6COWRWW.mjs"));
|
|
232
|
+
var Keyboard2 = lazy(() => import("./keyboard-AHSAWKXA.mjs"));
|
|
233
|
+
var ReactSurface = lazy(() => import("./react-surface-FOCB4Y5R.mjs"));
|
|
234
|
+
var State = lazy(() => import("./state-2Q623V7U.mjs"));
|
|
235
|
+
|
|
245
236
|
// src/components/NavTree/NavTree.tsx
|
|
246
237
|
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
247
238
|
import React9, { useMemo as useMemo5 } from "react";
|
|
@@ -260,7 +251,7 @@ var useNavTreeContext = () => useContext(NavTreeContext) ?? raise(new Error("Mis
|
|
|
260
251
|
import { useEffect } from "react";
|
|
261
252
|
import { toLocalizedString as toLocalizedString2, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
262
253
|
var NavTreeDocumentTitle = ({ node }) => {
|
|
263
|
-
const { t } = useTranslation3(
|
|
254
|
+
const { t } = useTranslation3(meta.id);
|
|
264
255
|
useEffect(() => {
|
|
265
256
|
document.title = node ? toLocalizedString2(node.properties.label, t) : t("current app name", {
|
|
266
257
|
ns: "appkit"
|
|
@@ -295,11 +286,12 @@ import { scrollJustEnoughIntoView } from "@atlaskit/pragmatic-drag-and-drop/elem
|
|
|
295
286
|
import { attachClosestEdge, extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
296
287
|
import React4, { forwardRef, useCallback, useLayoutEffect, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
297
288
|
import { invariant } from "@dxos/invariant";
|
|
289
|
+
import { DxAvatar } from "@dxos/lit-ui/react";
|
|
298
290
|
import { Icon as Icon3, ListItem, ScrollArea, Tooltip, toLocalizedString as toLocalizedString3, useMediaQuery, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
299
|
-
import {
|
|
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
|
-
import { arrayMove
|
|
294
|
+
import { arrayMove } from "@dxos/util";
|
|
303
295
|
|
|
304
296
|
// src/components/UserAccountAvatar/UserAccountAvatar.tsx
|
|
305
297
|
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
@@ -310,8 +302,10 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
|
|
|
310
302
|
var _effect = _useSignals3();
|
|
311
303
|
try {
|
|
312
304
|
const fallbackValue = hexToFallback(userId ?? "0");
|
|
313
|
-
return /* @__PURE__ */ React3.createElement(
|
|
314
|
-
|
|
305
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(L0ItemActiveTabIndicator, {
|
|
306
|
+
classNames: "inset-block-6"
|
|
307
|
+
}), /* @__PURE__ */ React3.createElement("div", {
|
|
308
|
+
className: "grid place-items-center dx-focus-ring-group-indicator rounded-full",
|
|
315
309
|
"data-joyride": "welcome/account"
|
|
316
310
|
}, /* @__PURE__ */ React3.createElement(Avatar.Root, null, /* @__PURE__ */ React3.createElement(Avatar.Content, {
|
|
317
311
|
variant: "circle",
|
|
@@ -320,7 +314,7 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
|
|
|
320
314
|
hue: hue || fallbackValue.hue,
|
|
321
315
|
fallback: emoji || fallbackValue.emoji,
|
|
322
316
|
"data-testid": "treeView.userAccount"
|
|
323
|
-
})));
|
|
317
|
+
}))));
|
|
324
318
|
} finally {
|
|
325
319
|
_effect.f();
|
|
326
320
|
}
|
|
@@ -383,7 +377,7 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
|
|
|
383
377
|
item.id,
|
|
384
378
|
path
|
|
385
379
|
]);
|
|
386
|
-
const { t } = useTranslation4(
|
|
380
|
+
const { t } = useTranslation4(meta.id);
|
|
387
381
|
const localizedString = toLocalizedString3(item.properties.label, t);
|
|
388
382
|
const handleClick = useL0ItemClick({
|
|
389
383
|
item,
|
|
@@ -401,15 +395,15 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
|
|
|
401
395
|
"data-testid": testId,
|
|
402
396
|
"data-itemid": id
|
|
403
397
|
} : {
|
|
404
|
-
onClick: handleClick
|
|
398
|
+
onClick: handleClick,
|
|
399
|
+
role: "button"
|
|
405
400
|
};
|
|
406
|
-
const Root = type === "collection" ? "h2" : type === "tab" ? Tabs.TabPrimitive : "button";
|
|
407
401
|
return /* @__PURE__ */ React4.createElement(Tooltip.Trigger, {
|
|
408
402
|
asChild: true,
|
|
409
403
|
delayDuration: 0,
|
|
410
404
|
side: "right",
|
|
411
405
|
content: localizedString
|
|
412
|
-
}, /* @__PURE__ */ React4.createElement(
|
|
406
|
+
}, /* @__PURE__ */ React4.createElement(Tabs.TabPrimitive, {
|
|
413
407
|
...rootProps,
|
|
414
408
|
"data-type": type,
|
|
415
409
|
className: mx2(l0ItemRoot, l0Breakpoints[item.properties.l0Breakpoint]),
|
|
@@ -419,28 +413,13 @@ var L0ItemRoot = /* @__PURE__ */ forwardRef(({ item, parent, path, children }, f
|
|
|
419
413
|
_effect.f();
|
|
420
414
|
}
|
|
421
415
|
});
|
|
422
|
-
var
|
|
416
|
+
var L0ItemActiveTabIndicator = ({ classNames }) => {
|
|
423
417
|
var _effect = _useSignals4();
|
|
424
418
|
try {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
style: {
|
|
430
|
-
color: `var(--dx-${hue}SurfaceText)`
|
|
431
|
-
}
|
|
432
|
-
};
|
|
433
|
-
const localizedString = toLocalizedString3(item.properties.label, t);
|
|
434
|
-
const avatarValue = useMemo2(() => type === "tab" ? getFirstTwoRenderableChars(localizedString).join("").toUpperCase() : [], [
|
|
435
|
-
type,
|
|
436
|
-
item.properties.label,
|
|
437
|
-
t
|
|
438
|
-
]);
|
|
439
|
-
return /* @__PURE__ */ React4.createElement("span", {
|
|
440
|
-
role: "img",
|
|
441
|
-
className: "place-self-center text-xl font-light",
|
|
442
|
-
...hueFgStyle
|
|
443
|
-
}, avatarValue);
|
|
419
|
+
return /* @__PURE__ */ React4.createElement("div", {
|
|
420
|
+
role: "none",
|
|
421
|
+
className: mx2("hidden group-aria-selected/l0item:block absolute inline-start-0 inset-block-2 is-1 bg-accentSurface rounded-ie", classNames)
|
|
422
|
+
});
|
|
444
423
|
} finally {
|
|
445
424
|
_effect.f();
|
|
446
425
|
}
|
|
@@ -448,7 +427,7 @@ var L0Avatar = ({ item }) => {
|
|
|
448
427
|
var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
|
|
449
428
|
var _effect = _useSignals4();
|
|
450
429
|
try {
|
|
451
|
-
const { t } = useTranslation4(
|
|
430
|
+
const { t } = useTranslation4(meta.id);
|
|
452
431
|
const itemElement = useRef(null);
|
|
453
432
|
const [closestEdge, setEdge] = useState2(null);
|
|
454
433
|
const localizedString = toLocalizedString3(item.properties.label, t);
|
|
@@ -537,10 +516,7 @@ var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
|
|
|
537
516
|
className: mx2(l0ItemContent, pinned ? "p-2 group-hover/l0item:bg-activeSurface" : "is-[--l0-avatar-size] bs-[--l0-avatar-size] bg-activeSurface")
|
|
538
517
|
}, /* @__PURE__ */ React4.createElement(ItemAvatar, {
|
|
539
518
|
item
|
|
540
|
-
})), /* @__PURE__ */ React4.createElement("
|
|
541
|
-
role: "none",
|
|
542
|
-
className: "hidden group-aria-selected/l0item:block absolute inline-start-0 inset-block-2 is-1 bg-accentSurface rounded-ie"
|
|
543
|
-
}), /* @__PURE__ */ React4.createElement("span", {
|
|
519
|
+
})), /* @__PURE__ */ React4.createElement(L0ItemActiveTabIndicator, null), /* @__PURE__ */ React4.createElement("span", {
|
|
544
520
|
id: `${item.id}__label`,
|
|
545
521
|
className: "sr-only"
|
|
546
522
|
}, localizedString), closestEdge && /* @__PURE__ */ React4.createElement(ListItem.DropIndicator, {
|
|
@@ -553,6 +529,7 @@ var L0Item = ({ item, parent, path, pinned, onRearrange }) => {
|
|
|
553
529
|
var ItemAvatar = ({ item }) => {
|
|
554
530
|
var _effect = _useSignals4();
|
|
555
531
|
try {
|
|
532
|
+
const { t } = useTranslation4(meta.id);
|
|
556
533
|
const type = l0ItemType(item);
|
|
557
534
|
if (item.properties.icon) {
|
|
558
535
|
const hue = item.properties.hue ?? null;
|
|
@@ -563,13 +540,19 @@ var ItemAvatar = ({ item }) => {
|
|
|
563
540
|
};
|
|
564
541
|
return /* @__PURE__ */ React4.createElement(Icon3, {
|
|
565
542
|
icon: item.properties.icon,
|
|
566
|
-
size:
|
|
543
|
+
size: 6,
|
|
567
544
|
...hueFgStyle
|
|
568
545
|
});
|
|
569
546
|
}
|
|
570
547
|
if (type === "tab" && item.properties.disposition !== "pin-end") {
|
|
571
|
-
|
|
572
|
-
|
|
548
|
+
const hue = item.properties.hue ?? null;
|
|
549
|
+
const localizedString = toLocalizedString3(item.properties.label, t);
|
|
550
|
+
return /* @__PURE__ */ React4.createElement(DxAvatar, {
|
|
551
|
+
hue,
|
|
552
|
+
hueVariant: "surface",
|
|
553
|
+
variant: "square",
|
|
554
|
+
size: 12,
|
|
555
|
+
fallback: localizedString
|
|
573
556
|
});
|
|
574
557
|
}
|
|
575
558
|
return null;
|
|
@@ -634,7 +617,7 @@ var L0Collection = ({ item, path }) => {
|
|
|
634
617
|
var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent, path }) => {
|
|
635
618
|
var _effect = _useSignals4();
|
|
636
619
|
try {
|
|
637
|
-
const { t } = useTranslation4(
|
|
620
|
+
const { t } = useTranslation4(meta.id);
|
|
638
621
|
return /* @__PURE__ */ React4.createElement(Tabs.Tablist, {
|
|
639
622
|
classNames: [
|
|
640
623
|
"group/l0 absolute z-[1] inset-block-0 inline-start-0 rounded-is",
|
|
@@ -648,16 +631,20 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
|
|
|
648
631
|
content: t("app menu label"),
|
|
649
632
|
side: "right",
|
|
650
633
|
asChild: true
|
|
634
|
+
}, /* @__PURE__ */ React4.createElement(Tabs.TabPrimitive, {
|
|
635
|
+
value: "options",
|
|
636
|
+
asChild: true,
|
|
637
|
+
role: "button"
|
|
651
638
|
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Trigger, {
|
|
652
639
|
"data-testid": "spacePlugin.addSpace",
|
|
653
|
-
className: mx2(l0ItemRoot, "grid place-items-center")
|
|
640
|
+
className: mx2(l0ItemRoot, "grid place-items-center dx-focus-ring-group")
|
|
654
641
|
}, /* @__PURE__ */ React4.createElement("div", {
|
|
655
642
|
role: "none",
|
|
656
643
|
className: mx2(l0ItemContent, "is-[--rail-action] bs-[--rail-action] group-hover/l0item:bg-hoverSurface")
|
|
657
644
|
}, /* @__PURE__ */ React4.createElement(Icon3, {
|
|
658
645
|
icon: "ph--list--regular",
|
|
659
646
|
size: 5
|
|
660
|
-
})))))), /* @__PURE__ */ React4.createElement(ScrollArea.Root, null, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React4.createElement("div", {
|
|
647
|
+
}))))))), /* @__PURE__ */ React4.createElement(ScrollArea.Root, null, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React4.createElement("div", {
|
|
661
648
|
role: "none",
|
|
662
649
|
className: mx2([
|
|
663
650
|
"flex flex-col gap-1 pbs-1",
|
|
@@ -728,7 +715,7 @@ import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem
|
|
|
728
715
|
// src/components/NavTreeItem/NavTreeItemAction.tsx
|
|
729
716
|
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
730
717
|
import React5 from "react";
|
|
731
|
-
import {
|
|
718
|
+
import { IconButton, toLocalizedString as toLocalizedString4, useDensityContext, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
732
719
|
import { DropdownMenu as DropdownMenu2, MenuProvider as MenuProvider2 } from "@dxos/react-ui-menu";
|
|
733
720
|
import { hoverableControlItem, hoverableOpenControlItem } from "@dxos/react-ui-theme";
|
|
734
721
|
var fallbackIcon = "ph--placeholder--regular";
|
|
@@ -743,7 +730,7 @@ var coarseActionButtonProps = {
|
|
|
743
730
|
var NavTreeItemActionDropdownMenu = ({ parent, label, icon, testId, menuActions, caller }) => {
|
|
744
731
|
var _effect = _useSignals5();
|
|
745
732
|
try {
|
|
746
|
-
const { t } = useTranslation5(
|
|
733
|
+
const { t } = useTranslation5(meta.id);
|
|
747
734
|
const density = useDensityContext();
|
|
748
735
|
return /* @__PURE__ */ React5.createElement(MenuProvider2, null, /* @__PURE__ */ React5.createElement(DropdownMenu2.Root, {
|
|
749
736
|
group: parent,
|
|
@@ -808,7 +795,7 @@ var NavTreeItemMonolithicAction = ({ parent, properties: { disabled, caller, tes
|
|
|
808
795
|
var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) => {
|
|
809
796
|
var _effect = _useSignals5();
|
|
810
797
|
try {
|
|
811
|
-
const { t } = useTranslation5(
|
|
798
|
+
const { t } = useTranslation5(meta.id);
|
|
812
799
|
const monolithicAction = menuActions?.length === 1 && menuActions[0];
|
|
813
800
|
const baseLabel = toLocalizedString4(monolithicAction ? monolithicAction.properties.label : props.label, t);
|
|
814
801
|
return monolithic && menuActions?.length === 1 ? /* @__PURE__ */ React5.createElement(NavTreeItemMonolithicAction, {
|
|
@@ -829,17 +816,17 @@ var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) =>
|
|
|
829
816
|
// src/components/NavTreeItem/NavTreeItemColumns.tsx
|
|
830
817
|
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
831
818
|
import React6, { Fragment, memo } from "react";
|
|
832
|
-
import { isAction as
|
|
833
|
-
import { DensityProvider, Popover, toLocalizedString as toLocalizedString5,
|
|
819
|
+
import { isAction as isAction2 } from "@dxos/app-graph";
|
|
820
|
+
import { DensityProvider, Popover, Treegrid, toLocalizedString as toLocalizedString5, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
834
821
|
var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fine" }) => {
|
|
835
822
|
var _effect = _useSignals6();
|
|
836
823
|
try {
|
|
837
|
-
const { t } = useTranslation6(
|
|
838
|
-
const {
|
|
824
|
+
const { t } = useTranslation6(meta.id);
|
|
825
|
+
const { useActions: useActions3, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();
|
|
839
826
|
const level = path.length - 2;
|
|
840
|
-
const { actions: _actions, groupedActions } =
|
|
827
|
+
const { actions: _actions, groupedActions } = useActions3(item);
|
|
841
828
|
const [primaryAction, ...secondaryActions] = _actions.toSorted((a, _b) => a.properties?.disposition === "list-item-primary" ? -1 : 1);
|
|
842
|
-
const actions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) =>
|
|
829
|
+
const actions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) => isAction2(action) ? [
|
|
843
830
|
action
|
|
844
831
|
] : []).filter((a) => [
|
|
845
832
|
"list-item",
|
|
@@ -847,7 +834,7 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
847
834
|
].includes(a.properties?.disposition));
|
|
848
835
|
const ActionRoot = popoverAnchorId === `dxos.org/ui/${NAV_TREE_ITEM}/${item.id}` ? Popover.Anchor : Fragment;
|
|
849
836
|
useLoadDescendents(item);
|
|
850
|
-
useLoadDescendents(primaryAction && !
|
|
837
|
+
useLoadDescendents(primaryAction && !isAction2(primaryAction) ? primaryAction : void 0);
|
|
851
838
|
return /* @__PURE__ */ React6.createElement(DensityProvider, {
|
|
852
839
|
density
|
|
853
840
|
}, /* @__PURE__ */ React6.createElement("div", {
|
|
@@ -858,8 +845,8 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
858
845
|
label: toLocalizedString5(primaryAction.properties?.label, t),
|
|
859
846
|
icon: primaryAction.properties?.icon ?? "ph--placeholder--regular",
|
|
860
847
|
parent: item,
|
|
861
|
-
monolithic:
|
|
862
|
-
menuActions:
|
|
848
|
+
monolithic: isAction2(primaryAction),
|
|
849
|
+
menuActions: isAction2(primaryAction) ? [
|
|
863
850
|
primaryAction
|
|
864
851
|
] : groupedActions[primaryAction.id],
|
|
865
852
|
menuType: primaryAction.properties?.menuType,
|
|
@@ -921,7 +908,7 @@ var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
|
|
|
921
908
|
tabIndex: -1,
|
|
922
909
|
"aria-label": title,
|
|
923
910
|
...!open && {
|
|
924
|
-
inert:
|
|
911
|
+
inert: true
|
|
925
912
|
}
|
|
926
913
|
}, item.id === currentItemId && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(L1PanelHeader, {
|
|
927
914
|
path,
|
|
@@ -996,7 +983,7 @@ var L1PanelHeader = ({ item, path, onBack }) => {
|
|
|
996
983
|
className: "is-6"
|
|
997
984
|
}), /* @__PURE__ */ React7.createElement("h2", {
|
|
998
985
|
className: "flex-1 truncate min-is-0"
|
|
999
|
-
}, title),
|
|
986
|
+
}, title), backCapable && /* @__PURE__ */ React7.createElement(IconButton2, {
|
|
1000
987
|
variant: "ghost",
|
|
1001
988
|
icon: "ph--arrow-u-down-left--regular",
|
|
1002
989
|
iconOnly: true,
|
|
@@ -1021,7 +1008,7 @@ var L1PanelHeader = ({ item, path, onBack }) => {
|
|
|
1021
1008
|
"pointer-fine:pli-1"
|
|
1022
1009
|
],
|
|
1023
1010
|
onClick: handleOpen
|
|
1024
|
-
})
|
|
1011
|
+
}), /* @__PURE__ */ React7.createElement(NavTreeItemColumns, {
|
|
1025
1012
|
open: true,
|
|
1026
1013
|
path,
|
|
1027
1014
|
item,
|
|
@@ -1140,38 +1127,36 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1140
1127
|
], [
|
|
1141
1128
|
id
|
|
1142
1129
|
]);
|
|
1143
|
-
return
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1130
|
+
return (
|
|
1131
|
+
// TODO(thure): `Tabs.Root` forces all items that should be able to receive focus to use `Tabs.Tab(Primitive)` since
|
|
1132
|
+
// it uses RovingFocus and doesn’t support moving focus to an item that is not a tab. Assess whether this situation
|
|
1133
|
+
// should change including whether it should motivate a change in the design/taxonomy, or if this means this should
|
|
1134
|
+
// not use `react-ui-tabs` at all.
|
|
1135
|
+
/* @__PURE__ */ React9.createElement(Tabs3.Root, {
|
|
1136
|
+
value: tab,
|
|
1137
|
+
orientation: "vertical",
|
|
1138
|
+
verticalVariant: "stateless",
|
|
1139
|
+
classNames: "relative"
|
|
1140
|
+
}, /* @__PURE__ */ React9.createElement(L0Menu, {
|
|
1141
|
+
menuActions: topLevelActions,
|
|
1142
|
+
topLevelItems: l0Items,
|
|
1143
|
+
pinnedItems,
|
|
1144
|
+
userAccountItem,
|
|
1145
|
+
path,
|
|
1146
|
+
parent: root
|
|
1147
|
+
}), /* @__PURE__ */ React9.createElement(L1Tabs, {
|
|
1148
|
+
topLevelItems,
|
|
1149
|
+
path,
|
|
1150
|
+
currentItemId: tab,
|
|
1151
|
+
onBack,
|
|
1152
|
+
...props
|
|
1153
|
+
}))
|
|
1154
|
+
);
|
|
1162
1155
|
} finally {
|
|
1163
1156
|
_effect.f();
|
|
1164
1157
|
}
|
|
1165
1158
|
};
|
|
1166
1159
|
|
|
1167
|
-
// src/capabilities/index.ts
|
|
1168
|
-
import { lazy } from "@dxos/app-framework";
|
|
1169
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-5J4LRWDX.mjs"));
|
|
1170
|
-
var IntentResolver = lazy(() => import("./intent-resolver-3XYN2CBU.mjs"));
|
|
1171
|
-
var Keyboard2 = lazy(() => import("./keyboard-QRS6WOQH.mjs"));
|
|
1172
|
-
var ReactSurface = lazy(() => import("./react-surface-JSJ5SQX5.mjs"));
|
|
1173
|
-
var State = lazy(() => import("./state-54DY3DOY.mjs"));
|
|
1174
|
-
|
|
1175
1160
|
// src/components/NavTreeContainer.tsx
|
|
1176
1161
|
var NODE_TYPE = "dxos/app-graph/node";
|
|
1177
1162
|
var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Surface, {
|
|
@@ -1183,12 +1168,12 @@ var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Su
|
|
|
1183
1168
|
},
|
|
1184
1169
|
limit: 1
|
|
1185
1170
|
});
|
|
1186
|
-
var getChildrenFilter = (node) => untracked(() => !isActionLike2(node) && node.type !== PLANK_COMPANION_TYPE);
|
|
1171
|
+
var getChildrenFilter = (node) => untracked(() => !isActionLike2(node) && node.type !== PLANK_COMPANION_TYPE && node.properties.disposition !== "hidden");
|
|
1187
1172
|
var filterItems = (node, disposition) => {
|
|
1188
1173
|
if (!disposition && (node.properties.disposition === "hidden" || node.properties.disposition === "alternate-tree")) {
|
|
1189
1174
|
return false;
|
|
1190
1175
|
} else if (!disposition) {
|
|
1191
|
-
const action =
|
|
1176
|
+
const action = isAction3(node);
|
|
1192
1177
|
return !action || node.properties.disposition === "item";
|
|
1193
1178
|
} else {
|
|
1194
1179
|
return node.properties.disposition === disposition;
|
|
@@ -1203,6 +1188,26 @@ var useItems = (node, options) => {
|
|
|
1203
1188
|
const filtered = connections.filter((node2) => filterItems(node2, options?.disposition));
|
|
1204
1189
|
return options?.sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
|
|
1205
1190
|
};
|
|
1191
|
+
var useActions2 = (node) => {
|
|
1192
|
+
const { graph } = useAppGraph2();
|
|
1193
|
+
const actions = useGraphActions(graph, node.id);
|
|
1194
|
+
return useMemo6(() => actions.reduce((acc, arg) => {
|
|
1195
|
+
if (arg.properties.disposition === "item") {
|
|
1196
|
+
return acc;
|
|
1197
|
+
}
|
|
1198
|
+
acc.actions.push(arg);
|
|
1199
|
+
if (!isAction3(arg)) {
|
|
1200
|
+
const actionGroup = graph.getActions(arg.id);
|
|
1201
|
+
acc.groupedActions[arg.id] = actionGroup;
|
|
1202
|
+
}
|
|
1203
|
+
return acc;
|
|
1204
|
+
}, {
|
|
1205
|
+
actions: [],
|
|
1206
|
+
groupedActions: {}
|
|
1207
|
+
}), [
|
|
1208
|
+
actions
|
|
1209
|
+
]);
|
|
1210
|
+
};
|
|
1206
1211
|
var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar }) => {
|
|
1207
1212
|
var _effect = _useSignals10();
|
|
1208
1213
|
try {
|
|
@@ -1213,10 +1218,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1213
1218
|
const { graph } = useAppGraph2();
|
|
1214
1219
|
const { isOpen, isCurrent, isAlternateTree, setItem } = useCapability(NavTreeCapabilities.State);
|
|
1215
1220
|
const layout = useLayout();
|
|
1216
|
-
const { navigationSidebarState } = useSidebars(
|
|
1217
|
-
const getActions2 = useCallback3((node) => getActions(graph, node), [
|
|
1218
|
-
graph
|
|
1219
|
-
]);
|
|
1221
|
+
const { navigationSidebarState } = useSidebars(meta.id);
|
|
1220
1222
|
const getProps = useCallback3((node, path) => {
|
|
1221
1223
|
const children = getChildren(graph, node, path).filter(getChildrenFilter);
|
|
1222
1224
|
const parentOf = children.length > 0 ? children.map(({ id }) => id) : node.properties.role === "branch" ? [] : void 0;
|
|
@@ -1283,7 +1285,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1283
1285
|
if (!node.data) {
|
|
1284
1286
|
return;
|
|
1285
1287
|
}
|
|
1286
|
-
if (
|
|
1288
|
+
if (isAction3(node)) {
|
|
1287
1289
|
const [parent] = graph.getConnections(node.id, "inbound");
|
|
1288
1290
|
void (parent && node.data({
|
|
1289
1291
|
parent,
|
|
@@ -1319,7 +1321,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1319
1321
|
}));
|
|
1320
1322
|
}
|
|
1321
1323
|
const defaultAction = graph.getActions(node.id).find((action) => action.properties?.disposition === "default");
|
|
1322
|
-
if (
|
|
1324
|
+
if (isAction3(defaultAction)) {
|
|
1323
1325
|
void defaultAction.data();
|
|
1324
1326
|
}
|
|
1325
1327
|
if (!isLg) {
|
|
@@ -1402,7 +1404,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1402
1404
|
const navTreeContextValue = useMemo6(() => ({
|
|
1403
1405
|
useItems,
|
|
1404
1406
|
tab,
|
|
1405
|
-
|
|
1407
|
+
useActions: useActions2,
|
|
1406
1408
|
loadDescendents,
|
|
1407
1409
|
renderItemEnd,
|
|
1408
1410
|
popoverAnchorId,
|
|
@@ -1419,7 +1421,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1419
1421
|
onBack: handleBack
|
|
1420
1422
|
}), [
|
|
1421
1423
|
tab,
|
|
1422
|
-
|
|
1424
|
+
useActions2,
|
|
1423
1425
|
loadDescendents,
|
|
1424
1426
|
renderItemEnd,
|
|
1425
1427
|
popoverAnchorId,
|
|
@@ -1455,7 +1457,6 @@ export {
|
|
|
1455
1457
|
resolveMigrationOperation,
|
|
1456
1458
|
sortActions,
|
|
1457
1459
|
getChildren,
|
|
1458
|
-
getActions,
|
|
1459
1460
|
l0ItemType,
|
|
1460
1461
|
NODE_TYPE,
|
|
1461
1462
|
NavTreeContainer,
|
|
@@ -1466,4 +1467,4 @@ export {
|
|
|
1466
1467
|
ReactSurface,
|
|
1467
1468
|
State
|
|
1468
1469
|
};
|
|
1469
|
-
//# sourceMappingURL=chunk-
|
|
1470
|
+
//# sourceMappingURL=chunk-6AZKY5WZ.mjs.map
|