@dxos/plugin-navtree 0.8.3-staging.0fa589b → 0.8.4-main.2e9d522
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-5J4LRWDX.mjs} +3 -3
- package/dist/lib/browser/{chunk-IEW3JD5C.mjs → chunk-ERDGQTH5.mjs} +2 -2
- package/dist/lib/browser/{chunk-33VLL4IJ.mjs → chunk-WCARAZ7J.mjs} +3 -3
- package/dist/lib/browser/{chunk-ZJPL4XJD.mjs → chunk-WEMCSQI7.mjs} +188 -148
- package/dist/lib/browser/chunk-WEMCSQI7.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +12 -11
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-NAYKKAOP.mjs → intent-resolver-3XYN2CBU.mjs} +5 -5
- package/dist/lib/browser/{keyboard-DDFATRUG.mjs → keyboard-QRS6WOQH.mjs} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-H3JRTVNU.mjs → react-surface-JSJ5SQX5.mjs} +5 -5
- package/dist/lib/browser/{state-J6AKZRB4.mjs → state-54DY3DOY.mjs} +4 -4
- 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/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/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/translations.d.ts +14 -13
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +40 -42
- package/src/NavTreePlugin.tsx +1 -1
- package/src/components/CommandsDialog/CommandsTrigger.tsx +2 -4
- package/src/components/NavTree/NavTree.stories.tsx +2 -2
- package/src/components/NavTree/NavTree.tsx +3 -3
- package/src/components/NavTreeContainer.tsx +3 -4
- package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +1 -1
- package/src/components/NavTreeItem/NavTreeItemAction.tsx +4 -4
- package/src/components/NavTreeItem/NavTreeItemColumns.tsx +2 -3
- package/src/components/Sidebar/L1Panel.tsx +72 -93
- package/src/components/Sidebar/L1Tabs.tsx +57 -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/experimental/Tree.stories.tsx +9 -9
- package/src/experimental/Tree.tsx +15 -16
- package/src/translations.ts +7 -4
- package/dist/lib/browser/chunk-ZJPL4XJD.mjs.map +0 -7
- /package/dist/lib/browser/{app-graph-builder-P7AY3K72.mjs.map → app-graph-builder-5J4LRWDX.mjs.map} +0 -0
- /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
- /package/dist/lib/browser/{intent-resolver-NAYKKAOP.mjs.map → intent-resolver-3XYN2CBU.mjs.map} +0 -0
- /package/dist/lib/browser/{keyboard-DDFATRUG.mjs.map → keyboard-QRS6WOQH.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-H3JRTVNU.mjs.map → react-surface-JSJ5SQX5.mjs.map} +0 -0
- /package/dist/lib/browser/{state-J6AKZRB4.mjs.map → state-54DY3DOY.mjs.map} +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
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
14
|
import { createIntent, LayoutAction, useAppGraph, useIntentDispatcher } from "@dxos/app-framework";
|
|
@@ -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
124
|
import { createIntent as createIntent2, LayoutAction as LayoutAction2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
125
|
-
import { Button as Button2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
126
|
-
import { getSize } from "@dxos/react-ui-theme";
|
|
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,15 +139,16 @@ 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
|
-
//
|
|
151
|
+
// src/util.ts
|
|
152
152
|
import { isAction as isAction2, isActionLike } from "@dxos/app-graph";
|
|
153
153
|
import { isNonNullable } from "@dxos/util";
|
|
154
154
|
var getParent = (graph, node, path) => {
|
|
@@ -227,36 +227,36 @@ var l0ItemType = (item) => {
|
|
|
227
227
|
}
|
|
228
228
|
};
|
|
229
229
|
|
|
230
|
-
//
|
|
231
|
-
import { useSignals as
|
|
230
|
+
// src/components/NavTreeContainer.tsx
|
|
231
|
+
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
232
232
|
import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
233
233
|
import { extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
|
|
234
234
|
import { untracked } from "@preact/signals-core";
|
|
235
|
-
import
|
|
235
|
+
import React10, { memo as memo2, useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo6 } from "react";
|
|
236
236
|
import { createIntent as createIntent3, LayoutAction as LayoutAction3, Surface, useAppGraph as useAppGraph2, useCapability, useIntentDispatcher as useIntentDispatcher3, useLayout } from "@dxos/app-framework";
|
|
237
237
|
import { isAction as isAction4, isActionLike as isActionLike2, ROOT_ID } from "@dxos/app-graph";
|
|
238
238
|
import { PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
|
|
239
239
|
import { useConnections } from "@dxos/plugin-graph";
|
|
240
240
|
import { useMediaQuery as useMediaQuery2, useSidebars } from "@dxos/react-ui";
|
|
241
241
|
import { isTreeData } from "@dxos/react-ui-list";
|
|
242
|
-
import { mx as
|
|
242
|
+
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
243
243
|
import { arrayMove as arrayMove2, byPosition } from "@dxos/util";
|
|
244
244
|
|
|
245
|
-
//
|
|
246
|
-
import { useSignals as
|
|
247
|
-
import
|
|
245
|
+
// src/components/NavTree/NavTree.tsx
|
|
246
|
+
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
247
|
+
import React9, { useMemo as useMemo5 } from "react";
|
|
248
248
|
import { Tabs as Tabs3 } from "@dxos/react-ui-tabs";
|
|
249
249
|
|
|
250
|
-
//
|
|
250
|
+
// src/hooks.ts
|
|
251
251
|
import { useEffect as useEffect2 } from "react";
|
|
252
252
|
|
|
253
|
-
//
|
|
253
|
+
// src/components/NavTreeContext.tsx
|
|
254
254
|
import { createContext, useContext } from "react";
|
|
255
255
|
import { raise } from "@dxos/debug";
|
|
256
256
|
var NavTreeContext = /* @__PURE__ */ createContext(null);
|
|
257
257
|
var useNavTreeContext = () => useContext(NavTreeContext) ?? raise(new Error("Missing NavTreeContext"));
|
|
258
258
|
|
|
259
|
-
//
|
|
259
|
+
// src/components/NavTreeDocumentTitle.tsx
|
|
260
260
|
import { useEffect } from "react";
|
|
261
261
|
import { toLocalizedString as toLocalizedString2, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
262
262
|
var NavTreeDocumentTitle = ({ node }) => {
|
|
@@ -271,7 +271,7 @@ var NavTreeDocumentTitle = ({ node }) => {
|
|
|
271
271
|
return null;
|
|
272
272
|
};
|
|
273
273
|
|
|
274
|
-
//
|
|
274
|
+
// src/hooks.ts
|
|
275
275
|
var useLoadDescendents = (root) => {
|
|
276
276
|
const { loadDescendents } = useNavTreeContext();
|
|
277
277
|
useEffect2(() => {
|
|
@@ -286,7 +286,7 @@ var useLoadDescendents = (root) => {
|
|
|
286
286
|
]);
|
|
287
287
|
};
|
|
288
288
|
|
|
289
|
-
//
|
|
289
|
+
// src/components/Sidebar/L0Menu.tsx
|
|
290
290
|
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
291
291
|
import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
|
|
292
292
|
import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
@@ -295,13 +295,13 @@ import { scrollJustEnoughIntoView } from "@atlaskit/pragmatic-drag-and-drop/elem
|
|
|
295
295
|
import { attachClosestEdge, extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
296
296
|
import React4, { forwardRef, useCallback, useLayoutEffect, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
297
297
|
import { invariant } from "@dxos/invariant";
|
|
298
|
-
import { Icon as
|
|
298
|
+
import { Icon as Icon3, ListItem, ScrollArea, Tooltip, toLocalizedString as toLocalizedString3, useMediaQuery, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
299
299
|
import { MenuProvider, DropdownMenu } from "@dxos/react-ui-menu";
|
|
300
300
|
import { Tabs } from "@dxos/react-ui-tabs";
|
|
301
301
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
302
302
|
import { arrayMove, getFirstTwoRenderableChars } from "@dxos/util";
|
|
303
303
|
|
|
304
|
-
//
|
|
304
|
+
// src/components/UserAccountAvatar/UserAccountAvatar.tsx
|
|
305
305
|
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
306
306
|
import React3 from "react";
|
|
307
307
|
import { Avatar } from "@dxos/react-ui";
|
|
@@ -326,8 +326,8 @@ var UserAccountAvatar = ({ size, userId, hue, emoji, status }) => {
|
|
|
326
326
|
}
|
|
327
327
|
};
|
|
328
328
|
|
|
329
|
-
//
|
|
330
|
-
var __dxlog_file = "/
|
|
329
|
+
// src/components/Sidebar/L0Menu.tsx
|
|
330
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-navtree/src/components/Sidebar/L0Menu.tsx";
|
|
331
331
|
var useL0ItemClick = ({ item, parent, path }, type) => {
|
|
332
332
|
const { tab, isCurrent, onSelect, onTabChange } = useNavTreeContext();
|
|
333
333
|
const [isLg] = useMediaQuery("lg", {
|
|
@@ -561,7 +561,7 @@ var ItemAvatar = ({ item }) => {
|
|
|
561
561
|
color: `var(--dx-${hue}SurfaceText)`
|
|
562
562
|
}
|
|
563
563
|
};
|
|
564
|
-
return /* @__PURE__ */ React4.createElement(
|
|
564
|
+
return /* @__PURE__ */ React4.createElement(Icon3, {
|
|
565
565
|
icon: item.properties.icon,
|
|
566
566
|
size: 5,
|
|
567
567
|
...hueFgStyle
|
|
@@ -654,7 +654,7 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
|
|
|
654
654
|
}, /* @__PURE__ */ React4.createElement("div", {
|
|
655
655
|
role: "none",
|
|
656
656
|
className: mx2(l0ItemContent, "is-[--rail-action] bs-[--rail-action] group-hover/l0item:bg-hoverSurface")
|
|
657
|
-
}, /* @__PURE__ */ React4.createElement(
|
|
657
|
+
}, /* @__PURE__ */ React4.createElement(Icon3, {
|
|
658
658
|
icon: "ph--list--regular",
|
|
659
659
|
size: 5
|
|
660
660
|
})))))), /* @__PURE__ */ React4.createElement(ScrollArea.Root, null, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React4.createElement("div", {
|
|
@@ -717,20 +717,20 @@ var L0Menu = ({ menuActions, topLevelItems, pinnedItems, userAccountItem, parent
|
|
|
717
717
|
}
|
|
718
718
|
};
|
|
719
719
|
|
|
720
|
-
//
|
|
720
|
+
// src/components/Sidebar/L1Panel.tsx
|
|
721
721
|
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
722
722
|
import React7, { useCallback as useCallback2, useMemo as useMemo3 } from "react";
|
|
723
|
-
import {
|
|
723
|
+
import { IconButton as IconButton2, toLocalizedString as toLocalizedString6, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
724
724
|
import { Tree } from "@dxos/react-ui-list";
|
|
725
725
|
import { Tabs as Tabs2 } from "@dxos/react-ui-tabs";
|
|
726
|
-
import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem as hoverableOpenControlItem2
|
|
726
|
+
import { hoverableControlItem as hoverableControlItem2, hoverableOpenControlItem as hoverableOpenControlItem2 } from "@dxos/react-ui-theme";
|
|
727
727
|
|
|
728
|
-
//
|
|
728
|
+
// src/components/NavTreeItem/NavTreeItemAction.tsx
|
|
729
729
|
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
730
730
|
import React5 from "react";
|
|
731
731
|
import { useTranslation as useTranslation5, toLocalizedString as toLocalizedString4, IconButton, useDensityContext } from "@dxos/react-ui";
|
|
732
732
|
import { DropdownMenu as DropdownMenu2, MenuProvider as MenuProvider2 } from "@dxos/react-ui-menu";
|
|
733
|
-
import { hoverableControlItem, hoverableOpenControlItem
|
|
733
|
+
import { hoverableControlItem, hoverableOpenControlItem } from "@dxos/react-ui-theme";
|
|
734
734
|
var fallbackIcon = "ph--placeholder--regular";
|
|
735
735
|
var fineActionButtonProps = {
|
|
736
736
|
size: 4,
|
|
@@ -753,7 +753,11 @@ var NavTreeItemActionDropdownMenu = ({ parent, label, icon, testId, menuActions,
|
|
|
753
753
|
asChild: true
|
|
754
754
|
}, /* @__PURE__ */ React5.createElement(IconButton, {
|
|
755
755
|
...density === "coarse" ? coarseActionButtonProps : fineActionButtonProps,
|
|
756
|
-
classNames:
|
|
756
|
+
classNames: [
|
|
757
|
+
"shrink-0 pli-2 pointer-fine:pli-1",
|
|
758
|
+
hoverableControlItem,
|
|
759
|
+
hoverableOpenControlItem
|
|
760
|
+
],
|
|
757
761
|
variant: "ghost",
|
|
758
762
|
icon: icon ?? fallbackIcon,
|
|
759
763
|
iconOnly: true,
|
|
@@ -773,7 +777,12 @@ var NavTreeItemMonolithicAction = ({ parent, properties: { disabled, caller, tes
|
|
|
773
777
|
return /* @__PURE__ */ React5.createElement(IconButton, {
|
|
774
778
|
...density === "coarse" ? coarseActionButtonProps : fineActionButtonProps,
|
|
775
779
|
variant,
|
|
776
|
-
classNames:
|
|
780
|
+
classNames: [
|
|
781
|
+
"shrink-0",
|
|
782
|
+
hoverableControlItem,
|
|
783
|
+
hoverableOpenControlItem,
|
|
784
|
+
iconOnly ? "pli-2 pointer-fine:pli-1" : "p-2 pointer-fine:p-2 mie-1"
|
|
785
|
+
],
|
|
777
786
|
icon: icon ?? fallbackIcon,
|
|
778
787
|
iconOnly,
|
|
779
788
|
label: baseLabel,
|
|
@@ -817,7 +826,7 @@ var NavTreeItemAction = ({ monolithic, menuActions, parent: node, ...props }) =>
|
|
|
817
826
|
}
|
|
818
827
|
};
|
|
819
828
|
|
|
820
|
-
//
|
|
829
|
+
// src/components/NavTreeItem/NavTreeItemColumns.tsx
|
|
821
830
|
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
822
831
|
import React6, { Fragment, memo } from "react";
|
|
823
832
|
import { isAction as isAction3 } from "@dxos/app-graph";
|
|
@@ -829,7 +838,7 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
829
838
|
const { getActions: getActions2, renderItemEnd: ItemEnd, popoverAnchorId } = useNavTreeContext();
|
|
830
839
|
const level = path.length - 2;
|
|
831
840
|
const { actions: _actions, groupedActions } = getActions2(item);
|
|
832
|
-
const [primaryAction, ...secondaryActions] = _actions.toSorted((a,
|
|
841
|
+
const [primaryAction, ...secondaryActions] = _actions.toSorted((a, _b) => a.properties?.disposition === "list-item-primary" ? -1 : 1);
|
|
833
842
|
const actions = (primaryAction?.properties?.disposition === "list-item-primary" ? secondaryActions : _actions).flatMap((action) => isAction3(action) ? [
|
|
834
843
|
action
|
|
835
844
|
] : []).filter((a) => [
|
|
@@ -872,31 +881,15 @@ var NavTreeItemColumns = /* @__PURE__ */ memo(({ path, item, open, density = "fi
|
|
|
872
881
|
}
|
|
873
882
|
});
|
|
874
883
|
|
|
875
|
-
//
|
|
876
|
-
var
|
|
877
|
-
var TitleButton = ({ title, onClick }) => {
|
|
884
|
+
// src/components/Sidebar/L1Panel.tsx
|
|
885
|
+
var L1Panel = ({ open, path, item, currentItemId, onBack }) => {
|
|
878
886
|
var _effect = _useSignals7();
|
|
879
887
|
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, {
|
|
888
|
+
const { t } = useTranslation7(meta.id);
|
|
889
|
+
const { isAlternateTree, ...navTreeContext } = useNavTreeContext();
|
|
890
|
+
const { useItems: useItems2 } = navTreeContext;
|
|
891
|
+
const title = toLocalizedString6(item.properties.label, t);
|
|
892
|
+
const alternateTree = useItems2(item, {
|
|
900
893
|
disposition: "alternate-tree"
|
|
901
894
|
})[0];
|
|
902
895
|
const alternatePath = useMemo3(() => [
|
|
@@ -906,34 +899,16 @@ var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
|
|
|
906
899
|
item.id,
|
|
907
900
|
path
|
|
908
901
|
]);
|
|
909
|
-
const handleOpen = useCallback2(() => setAlternateTree?.(alternatePath, true), [
|
|
910
|
-
alternatePath,
|
|
911
|
-
setAlternateTree
|
|
912
|
-
]);
|
|
913
902
|
const isAlternate = isAlternateTree?.(alternatePath, item) ?? false;
|
|
914
903
|
const useAlternateItems = useCallback2((node, { disposition } = {}) => {
|
|
915
|
-
return
|
|
904
|
+
return useItems2(node, {
|
|
916
905
|
disposition,
|
|
917
906
|
sort: node?.id === alternateTree.id
|
|
918
907
|
});
|
|
919
908
|
}, [
|
|
920
|
-
|
|
921
|
-
|
|
909
|
+
alternateTree,
|
|
910
|
+
useItems2
|
|
922
911
|
]);
|
|
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
912
|
return /* @__PURE__ */ React7.createElement(Tabs2.Tabpanel, {
|
|
938
913
|
key: item.id,
|
|
939
914
|
value: item.id,
|
|
@@ -948,29 +923,12 @@ var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
|
|
|
948
923
|
...!open && {
|
|
949
924
|
inert: "true"
|
|
950
925
|
}
|
|
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, {
|
|
926
|
+
}, item.id === currentItemId && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(L1PanelHeader, {
|
|
969
927
|
path,
|
|
970
928
|
item,
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
})
|
|
929
|
+
currentItemId,
|
|
930
|
+
onBack
|
|
931
|
+
}), /* @__PURE__ */ React7.createElement("div", {
|
|
974
932
|
role: "none",
|
|
975
933
|
className: "overflow-y-auto"
|
|
976
934
|
}, isAlternate ? /* @__PURE__ */ React7.createElement(Tree, {
|
|
@@ -996,48 +954,106 @@ var L1Panel = ({ open, item, path, currentItemId, onBack }) => {
|
|
|
996
954
|
_effect.f();
|
|
997
955
|
}
|
|
998
956
|
};
|
|
999
|
-
var
|
|
957
|
+
var L1PanelHeader = ({ item, path, onBack }) => {
|
|
1000
958
|
var _effect = _useSignals7();
|
|
1001
959
|
try {
|
|
1002
|
-
const {
|
|
1003
|
-
|
|
1004
|
-
const
|
|
1005
|
-
const
|
|
960
|
+
const { t } = useTranslation7(meta.id);
|
|
961
|
+
const { isAlternateTree, setAlternateTree, ...navTreeContext } = useNavTreeContext();
|
|
962
|
+
const title = toLocalizedString6(item.properties.label, t);
|
|
963
|
+
const alternateTree = navTreeContext.useItems(item, {
|
|
964
|
+
disposition: "alternate-tree"
|
|
965
|
+
})[0];
|
|
966
|
+
const alternatePath = useMemo3(() => [
|
|
1006
967
|
...path,
|
|
1007
968
|
item.id
|
|
1008
969
|
], [
|
|
1009
970
|
item.id,
|
|
1010
971
|
path
|
|
1011
972
|
]);
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
973
|
+
const isAlternate = isAlternateTree?.(alternatePath, item) ?? false;
|
|
974
|
+
const backCapable = item.id.startsWith("!") || isAlternate;
|
|
975
|
+
const handleOpen = useCallback2(() => {
|
|
976
|
+
setAlternateTree?.(alternatePath, true);
|
|
977
|
+
}, [
|
|
978
|
+
alternatePath,
|
|
979
|
+
setAlternateTree
|
|
980
|
+
]);
|
|
981
|
+
const handleBack = useCallback2(() => {
|
|
982
|
+
if (isAlternate) {
|
|
983
|
+
setAlternateTree?.(alternatePath, false);
|
|
984
|
+
} else {
|
|
985
|
+
onBack?.();
|
|
986
|
+
}
|
|
987
|
+
}, [
|
|
988
|
+
isAlternate,
|
|
989
|
+
alternatePath,
|
|
990
|
+
setAlternateTree,
|
|
991
|
+
onBack
|
|
992
|
+
]);
|
|
993
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
994
|
+
className: "flex is-full items-center border-be border-subduedSeparator app-drag density-coarse"
|
|
995
|
+
}, /* @__PURE__ */ React7.createElement("div", {
|
|
996
|
+
className: "is-6"
|
|
997
|
+
}), /* @__PURE__ */ React7.createElement("h2", {
|
|
998
|
+
className: "flex-1 truncate min-is-0"
|
|
999
|
+
}, title), /* @__PURE__ */ React7.createElement("div", null, backCapable && /* @__PURE__ */ React7.createElement(IconButton2, {
|
|
1000
|
+
variant: "ghost",
|
|
1001
|
+
icon: "ph--arrow-u-down-left--regular",
|
|
1002
|
+
iconOnly: true,
|
|
1003
|
+
size: 5,
|
|
1004
|
+
label: t("button back"),
|
|
1005
|
+
classNames: [
|
|
1006
|
+
hoverableControlItem2,
|
|
1007
|
+
hoverableOpenControlItem2,
|
|
1008
|
+
"pointer-fine:pli-1"
|
|
1009
|
+
],
|
|
1010
|
+
onClick: handleBack
|
|
1011
|
+
}) || alternateTree && !isAlternate && /* @__PURE__ */ React7.createElement(IconButton2, {
|
|
1012
|
+
"data-testid": "treeView.alternateTreeButton",
|
|
1013
|
+
variant: "ghost",
|
|
1014
|
+
icon: alternateTree.properties.icon ?? "ph--placeholder--regular",
|
|
1015
|
+
iconOnly: true,
|
|
1016
|
+
size: 5,
|
|
1017
|
+
label: toLocalizedString6(alternateTree.properties.label ?? alternateTree.id, t),
|
|
1018
|
+
classNames: [
|
|
1019
|
+
hoverableControlItem2,
|
|
1020
|
+
hoverableOpenControlItem2,
|
|
1021
|
+
"pointer-fine:pli-1"
|
|
1022
|
+
],
|
|
1023
|
+
onClick: handleOpen
|
|
1024
|
+
}) || /* @__PURE__ */ React7.createElement("div", null)), /* @__PURE__ */ React7.createElement(NavTreeItemColumns, {
|
|
1025
|
+
open: true,
|
|
1026
|
+
path,
|
|
1027
|
+
item,
|
|
1028
|
+
density: "coarse"
|
|
1029
|
+
}));
|
|
1018
1030
|
} finally {
|
|
1019
1031
|
_effect.f();
|
|
1020
1032
|
}
|
|
1021
1033
|
};
|
|
1022
|
-
|
|
1023
|
-
|
|
1034
|
+
|
|
1035
|
+
// src/components/Sidebar/L1Tabs.tsx
|
|
1036
|
+
import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
|
|
1037
|
+
import React8, { useMemo as useMemo4 } from "react";
|
|
1038
|
+
var L1Tabs = ({ topLevelItems, onBack, ...props }) => {
|
|
1039
|
+
var _effect = _useSignals8();
|
|
1024
1040
|
try {
|
|
1025
|
-
return /* @__PURE__ */
|
|
1041
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, topLevelItems.map((item) => {
|
|
1026
1042
|
const type = l0ItemType(item);
|
|
1027
1043
|
switch (type) {
|
|
1028
|
-
case "collection":
|
|
1029
|
-
return /* @__PURE__ */ React7.createElement(L1PanelCollection, {
|
|
1030
|
-
key: item.id,
|
|
1031
|
-
item,
|
|
1032
|
-
...props
|
|
1033
|
-
});
|
|
1034
1044
|
case "tab":
|
|
1035
|
-
return /* @__PURE__ */
|
|
1045
|
+
return /* @__PURE__ */ React8.createElement(L1Panel, {
|
|
1036
1046
|
key: item.id,
|
|
1037
1047
|
item,
|
|
1038
1048
|
...props,
|
|
1039
1049
|
onBack
|
|
1040
1050
|
});
|
|
1051
|
+
case "collection":
|
|
1052
|
+
return /* @__PURE__ */ React8.createElement(L1PanelCollection, {
|
|
1053
|
+
key: item.id,
|
|
1054
|
+
item,
|
|
1055
|
+
...props
|
|
1056
|
+
});
|
|
1041
1057
|
default:
|
|
1042
1058
|
return null;
|
|
1043
1059
|
}
|
|
@@ -1046,11 +1062,34 @@ var L1Panels = ({ topLevelItems, onBack, ...props }) => {
|
|
|
1046
1062
|
_effect.f();
|
|
1047
1063
|
}
|
|
1048
1064
|
};
|
|
1065
|
+
var L1PanelCollection = ({ item, path, ...props }) => {
|
|
1066
|
+
var _effect = _useSignals8();
|
|
1067
|
+
try {
|
|
1068
|
+
const { useItems: useItems2 } = useNavTreeContext();
|
|
1069
|
+
useLoadDescendents(item);
|
|
1070
|
+
const collectionItems = useItems2(item);
|
|
1071
|
+
const groupPath = useMemo4(() => [
|
|
1072
|
+
...path,
|
|
1073
|
+
item.id
|
|
1074
|
+
], [
|
|
1075
|
+
item.id,
|
|
1076
|
+
path
|
|
1077
|
+
]);
|
|
1078
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, collectionItems.filter((item2) => l0ItemType(item2) === "tab").map((item2) => /* @__PURE__ */ React8.createElement(L1Panel, {
|
|
1079
|
+
key: item2.id,
|
|
1080
|
+
item: item2,
|
|
1081
|
+
path: groupPath,
|
|
1082
|
+
...props
|
|
1083
|
+
})));
|
|
1084
|
+
} finally {
|
|
1085
|
+
_effect.f();
|
|
1086
|
+
}
|
|
1087
|
+
};
|
|
1049
1088
|
|
|
1050
|
-
//
|
|
1089
|
+
// src/components/NavTree/NavTree.tsx
|
|
1051
1090
|
var NAV_TREE_ITEM = "NavTreeItem";
|
|
1052
1091
|
var NavTree = ({ id, root, ...props }) => {
|
|
1053
|
-
var _effect =
|
|
1092
|
+
var _effect = _useSignals9();
|
|
1054
1093
|
try {
|
|
1055
1094
|
const { tab, useItems: useItems2, onBack } = useNavTreeContext();
|
|
1056
1095
|
const topLevelActions = useItems2(root, {
|
|
@@ -1066,7 +1105,7 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1066
1105
|
const topLevelNavigation = useItems2(root, {
|
|
1067
1106
|
disposition: "navigation"
|
|
1068
1107
|
});
|
|
1069
|
-
const l0Items =
|
|
1108
|
+
const l0Items = useMemo5(() => [
|
|
1070
1109
|
// prettier-ignore
|
|
1071
1110
|
...topLevelCollections,
|
|
1072
1111
|
...topLevelWorkspaces,
|
|
@@ -1083,7 +1122,7 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1083
1122
|
const userAccountItem = useItems2(root, {
|
|
1084
1123
|
disposition: "user-account"
|
|
1085
1124
|
})[0];
|
|
1086
|
-
const topLevelItems =
|
|
1125
|
+
const topLevelItems = useMemo5(() => [
|
|
1087
1126
|
// prettier-ignore
|
|
1088
1127
|
...l0Items,
|
|
1089
1128
|
...pinnedItems,
|
|
@@ -1096,24 +1135,24 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1096
1135
|
userAccountItem
|
|
1097
1136
|
]);
|
|
1098
1137
|
useLoadDescendents(root);
|
|
1099
|
-
const path =
|
|
1138
|
+
const path = useMemo5(() => [
|
|
1100
1139
|
id
|
|
1101
1140
|
], [
|
|
1102
1141
|
id
|
|
1103
1142
|
]);
|
|
1104
|
-
return /* @__PURE__ */
|
|
1143
|
+
return /* @__PURE__ */ React9.createElement(Tabs3.Root, {
|
|
1105
1144
|
value: tab,
|
|
1106
1145
|
orientation: "vertical",
|
|
1107
1146
|
verticalVariant: "stateless",
|
|
1108
1147
|
classNames: "relative"
|
|
1109
|
-
}, /* @__PURE__ */
|
|
1148
|
+
}, /* @__PURE__ */ React9.createElement(L0Menu, {
|
|
1110
1149
|
menuActions: topLevelActions,
|
|
1111
1150
|
topLevelItems: l0Items,
|
|
1112
1151
|
pinnedItems,
|
|
1113
1152
|
userAccountItem,
|
|
1114
1153
|
path,
|
|
1115
1154
|
parent: root
|
|
1116
|
-
}), /* @__PURE__ */
|
|
1155
|
+
}), /* @__PURE__ */ React9.createElement(L1Tabs, {
|
|
1117
1156
|
topLevelItems,
|
|
1118
1157
|
path,
|
|
1119
1158
|
currentItemId: tab,
|
|
@@ -1125,17 +1164,17 @@ var NavTree = ({ id, root, ...props }) => {
|
|
|
1125
1164
|
}
|
|
1126
1165
|
};
|
|
1127
1166
|
|
|
1128
|
-
//
|
|
1167
|
+
// src/capabilities/index.ts
|
|
1129
1168
|
import { lazy } from "@dxos/app-framework";
|
|
1130
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-
|
|
1131
|
-
var IntentResolver = lazy(() => import("./intent-resolver-
|
|
1132
|
-
var Keyboard2 = lazy(() => import("./keyboard-
|
|
1133
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
1134
|
-
var State = lazy(() => import("./state-
|
|
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"));
|
|
1135
1174
|
|
|
1136
|
-
//
|
|
1175
|
+
// src/components/NavTreeContainer.tsx
|
|
1137
1176
|
var NODE_TYPE = "dxos/app-graph/node";
|
|
1138
|
-
var renderItemEnd = ({ node, open }) => /* @__PURE__ */
|
|
1177
|
+
var renderItemEnd = ({ node, open }) => /* @__PURE__ */ React10.createElement(Surface, {
|
|
1139
1178
|
role: "navtree-item-end",
|
|
1140
1179
|
data: {
|
|
1141
1180
|
id: node.id,
|
|
@@ -1160,11 +1199,12 @@ var getItems = (graph, node, disposition) => {
|
|
|
1160
1199
|
};
|
|
1161
1200
|
var useItems = (node, options) => {
|
|
1162
1201
|
const { graph } = useAppGraph2();
|
|
1163
|
-
const connections = useConnections(graph, node?.id ?? ROOT_ID)
|
|
1164
|
-
|
|
1202
|
+
const connections = useConnections(graph, node?.id ?? ROOT_ID);
|
|
1203
|
+
const filtered = connections.filter((node2) => filterItems(node2, options?.disposition));
|
|
1204
|
+
return options?.sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
|
|
1165
1205
|
};
|
|
1166
1206
|
var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar }) => {
|
|
1167
|
-
var _effect =
|
|
1207
|
+
var _effect = _useSignals10();
|
|
1168
1208
|
try {
|
|
1169
1209
|
const [isLg] = useMediaQuery2("lg", {
|
|
1170
1210
|
ssr: false
|
|
@@ -1186,7 +1226,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1186
1226
|
parentOf,
|
|
1187
1227
|
icon: node.properties.icon,
|
|
1188
1228
|
disabled: node.properties.disabled,
|
|
1189
|
-
className:
|
|
1229
|
+
className: mx3(node.properties.modified && "italic", node.properties.className),
|
|
1190
1230
|
headingClassName: node.properties.headingClassName,
|
|
1191
1231
|
testId: node.properties.testId
|
|
1192
1232
|
};
|
|
@@ -1359,7 +1399,7 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1359
1399
|
}, [
|
|
1360
1400
|
setItem
|
|
1361
1401
|
]);
|
|
1362
|
-
const navTreeContextValue =
|
|
1402
|
+
const navTreeContextValue = useMemo6(() => ({
|
|
1363
1403
|
useItems,
|
|
1364
1404
|
tab,
|
|
1365
1405
|
getActions: getActions2,
|
|
@@ -1395,9 +1435,9 @@ var NavTreeContainer = /* @__PURE__ */ memo2(({ tab, popoverAnchorId, topbar })
|
|
|
1395
1435
|
handleSelect,
|
|
1396
1436
|
handleBack
|
|
1397
1437
|
]);
|
|
1398
|
-
return /* @__PURE__ */
|
|
1438
|
+
return /* @__PURE__ */ React10.createElement(NavTreeContext.Provider, {
|
|
1399
1439
|
value: navTreeContextValue
|
|
1400
|
-
}, /* @__PURE__ */
|
|
1440
|
+
}, /* @__PURE__ */ React10.createElement(NavTree, {
|
|
1401
1441
|
id: ROOT_ID,
|
|
1402
1442
|
root: graph.root,
|
|
1403
1443
|
open: layout.sidebarOpen
|
|
@@ -1426,4 +1466,4 @@ export {
|
|
|
1426
1466
|
ReactSurface,
|
|
1427
1467
|
State
|
|
1428
1468
|
};
|
|
1429
|
-
//# sourceMappingURL=chunk-
|
|
1469
|
+
//# sourceMappingURL=chunk-WEMCSQI7.mjs.map
|