@dxos/plugin-deck 0.6.12-main.f9d0246 → 0.6.12-staging.0b4bb48
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/index.mjs +76 -87
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts +2 -2
- package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts.map +1 -1
- package/dist/types/src/hooks/useNode.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts.map +1 -1
- package/package.json +29 -29
- package/src/DeckPlugin.tsx +51 -80
- package/src/components/DeckLayout/ComplementarySidebar.tsx +16 -18
- package/src/components/DeckLayout/DeckLayout.tsx +43 -34
- package/src/components/DeckLayout/NodePlankHeading.tsx +9 -6
- package/src/hooks/useNode.ts +1 -5
- package/src/layout.ts +0 -1
|
@@ -4,10 +4,11 @@ import {
|
|
|
4
4
|
} from "./chunk-YVHGFQQR.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-deck/src/DeckPlugin.tsx
|
|
7
|
+
import { ArrowsOut } from "@phosphor-icons/react";
|
|
7
8
|
import { batch, effect } from "@preact/signals-core";
|
|
8
9
|
import { setAutoFreeze } from "immer";
|
|
9
10
|
import React15 from "react";
|
|
10
|
-
import { IntentAction, LayoutAction as LayoutAction3, NavigationAction as NavigationAction3, parseGraphPlugin, parseIntentPlugin, resolvePlugin, Toast as ToastSchema, SLUG_PATH_SEPARATOR as
|
|
11
|
+
import { IntentAction, LayoutAction as LayoutAction3, NavigationAction as NavigationAction3, parseGraphPlugin, parseIntentPlugin, resolvePlugin, Toast as ToastSchema, SLUG_PATH_SEPARATOR as SLUG_PATH_SEPARATOR5, isLayoutParts, isLayoutAdjustment, isLayoutMode, openIds as openIds2 } from "@dxos/app-framework";
|
|
11
12
|
import { create, getTypename, isReactiveObject } from "@dxos/echo-schema";
|
|
12
13
|
import { LocalStorageStore } from "@dxos/local-storage";
|
|
13
14
|
import { log } from "@dxos/log";
|
|
@@ -17,6 +18,7 @@ import { createExtension } from "@dxos/plugin-graph";
|
|
|
17
18
|
import { ObservabilityAction } from "@dxos/plugin-observability/meta";
|
|
18
19
|
import { fullyQualifiedId } from "@dxos/react-client/echo";
|
|
19
20
|
import { translations as deckTranslations } from "@dxos/react-ui-deck";
|
|
21
|
+
import { Mosaic } from "@dxos/react-ui-mosaic";
|
|
20
22
|
|
|
21
23
|
// packages/plugins/plugin-deck/src/components/DeckLayout/constants.ts
|
|
22
24
|
var NAV_ID = "NavTree";
|
|
@@ -24,9 +26,9 @@ var SURFACE_PREFIX = "surface:";
|
|
|
24
26
|
|
|
25
27
|
// packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
|
|
26
28
|
import { Sidebar as MenuIcon } from "@phosphor-icons/react";
|
|
27
|
-
import React13, { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo2, useRef as useRef2 } from "react";
|
|
28
|
-
import { Surface as Surface9, firstIdInPart, usePlugin } from "@dxos/app-framework";
|
|
29
|
-
import { Button as Button3, Dialog, Main as Main3, Popover as Popover2,
|
|
29
|
+
import React13, { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo2, useRef as useRef2, useState as useState3, useLayoutEffect as useLayoutEffect2 } from "react";
|
|
30
|
+
import { SLUG_PATH_SEPARATOR as SLUG_PATH_SEPARATOR3, Surface as Surface9, firstIdInPart, usePlugin } from "@dxos/app-framework";
|
|
31
|
+
import { Button as Button3, Dialog, Main as Main3, Popover as Popover2, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
30
32
|
import { Deck } from "@dxos/react-ui-deck";
|
|
31
33
|
import { getSize } from "@dxos/react-ui-theme";
|
|
32
34
|
|
|
@@ -38,11 +40,8 @@ import { useGraph } from "@dxos/plugin-graph";
|
|
|
38
40
|
// packages/plugins/plugin-deck/src/hooks/useNode.ts
|
|
39
41
|
import { useEffect, useState } from "react";
|
|
40
42
|
var useNode = (graph, id, timeout) => {
|
|
41
|
-
const [nodeState, setNodeState] = useState(id ? graph.findNode(id
|
|
43
|
+
const [nodeState, setNodeState] = useState(id ? graph.findNode(id) : void 0);
|
|
42
44
|
useEffect(() => {
|
|
43
|
-
if (!id && nodeState) {
|
|
44
|
-
setNodeState(void 0);
|
|
45
|
-
}
|
|
46
45
|
if (nodeState?.id === id || !id) {
|
|
47
46
|
return;
|
|
48
47
|
}
|
|
@@ -118,16 +117,17 @@ import React5 from "react";
|
|
|
118
117
|
import { SLUG_PATH_SEPARATOR as SLUG_PATH_SEPARATOR2, Surface as Surface3 } from "@dxos/app-framework";
|
|
119
118
|
import { useGraph as useGraph3 } from "@dxos/plugin-graph";
|
|
120
119
|
import { Main } from "@dxos/react-ui";
|
|
121
|
-
import { createAttendableAttributes
|
|
120
|
+
import { createAttendableAttributes } from "@dxos/react-ui-attention";
|
|
122
121
|
import { deckGrid } from "@dxos/react-ui-deck";
|
|
123
122
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
124
123
|
|
|
125
124
|
// packages/plugins/plugin-deck/src/components/DeckLayout/NodePlankHeading.tsx
|
|
125
|
+
import { Placeholder } from "@phosphor-icons/react";
|
|
126
126
|
import React2, { Fragment, useEffect as useEffect3 } from "react";
|
|
127
|
-
import { LayoutAction, NavigationAction, SLUG_PATH_SEPARATOR, Surface as Surface2, useIntentDispatcher, indexInPart, partLength } from "@dxos/app-framework";
|
|
127
|
+
import { LayoutAction, NavigationAction, SLUG_COLLECTION_INDICATOR, SLUG_PATH_SEPARATOR, Surface as Surface2, useIntentDispatcher, indexInPart, partLength } from "@dxos/app-framework";
|
|
128
128
|
import { useGraph as useGraph2 } from "@dxos/plugin-graph";
|
|
129
|
-
import {
|
|
130
|
-
import { PlankHeading } from "@dxos/react-ui-deck";
|
|
129
|
+
import { Popover, toLocalizedString, useMediaQuery, useTranslation } from "@dxos/react-ui";
|
|
130
|
+
import { PlankHeading, plankHeadingIconProps } from "@dxos/react-ui-deck";
|
|
131
131
|
import { TextTooltip } from "@dxos/react-ui-text-tooltip";
|
|
132
132
|
var NodePlankHeading = ({
|
|
133
133
|
node,
|
|
@@ -142,7 +142,7 @@ var NodePlankHeading = ({
|
|
|
142
142
|
}) => {
|
|
143
143
|
const { t } = useTranslation(DECK_PLUGIN);
|
|
144
144
|
const { graph } = useGraph2();
|
|
145
|
-
const
|
|
145
|
+
const Icon = node?.properties?.icon ?? Placeholder;
|
|
146
146
|
const label = pending ? t("pending heading") : toLocalizedString(node?.properties?.label ?? [
|
|
147
147
|
"plank heading fallback label",
|
|
148
148
|
{
|
|
@@ -172,7 +172,7 @@ var NodePlankHeading = ({
|
|
|
172
172
|
return /* @__PURE__ */ React2.createElement(PlankHeading.Root, (layoutPart !== "main" || !flatDeck) && {
|
|
173
173
|
classNames: "pie-1 border-b border-separator"
|
|
174
174
|
}, /* @__PURE__ */ React2.createElement(ActionRoot, null, node ? /* @__PURE__ */ React2.createElement(PlankHeading.ActionsMenu, {
|
|
175
|
-
|
|
175
|
+
Icon,
|
|
176
176
|
attendableId,
|
|
177
177
|
triggerLabel: t("actions menu label"),
|
|
178
178
|
actions: graph.actions(node),
|
|
@@ -187,10 +187,7 @@ var NodePlankHeading = ({
|
|
|
187
187
|
}
|
|
188
188
|
})) : /* @__PURE__ */ React2.createElement(PlankHeading.Button, null, /* @__PURE__ */ React2.createElement("span", {
|
|
189
189
|
className: "sr-only"
|
|
190
|
-
}, label), /* @__PURE__ */ React2.createElement(Icon, {
|
|
191
|
-
icon,
|
|
192
|
-
size: 5
|
|
193
|
-
}))), /* @__PURE__ */ React2.createElement(TextTooltip, {
|
|
190
|
+
}, label), /* @__PURE__ */ React2.createElement(Icon, plankHeadingIconProps))), /* @__PURE__ */ React2.createElement(TextTooltip, {
|
|
194
191
|
text: label,
|
|
195
192
|
onlyWhenTruncating: true
|
|
196
193
|
}, /* @__PURE__ */ React2.createElement(PlankHeading.Label, {
|
|
@@ -240,6 +237,9 @@ var NodePlankHeading = ({
|
|
|
240
237
|
action: NavigationAction.CLOSE,
|
|
241
238
|
data: {
|
|
242
239
|
activeParts: {
|
|
240
|
+
complementary: [
|
|
241
|
+
`${id}${SLUG_PATH_SEPARATOR}comments${SLUG_COLLECTION_INDICATOR}`
|
|
242
|
+
],
|
|
243
243
|
[layoutPart]: [
|
|
244
244
|
id
|
|
245
245
|
]
|
|
@@ -253,7 +253,7 @@ var NodePlankHeading = ({
|
|
|
253
253
|
}
|
|
254
254
|
});
|
|
255
255
|
},
|
|
256
|
-
close:
|
|
256
|
+
close: layoutCoordinate?.part === "complementary" ? "minify-end" : true
|
|
257
257
|
}));
|
|
258
258
|
};
|
|
259
259
|
|
|
@@ -314,15 +314,13 @@ var LayoutContext = createContext(null);
|
|
|
314
314
|
var useLayout = () => useContext(LayoutContext) ?? raise(new Error("Missing LayoutContext"));
|
|
315
315
|
|
|
316
316
|
// packages/plugins/plugin-deck/src/components/DeckLayout/ComplementarySidebar.tsx
|
|
317
|
-
var ComplementarySidebar = ({
|
|
317
|
+
var ComplementarySidebar = ({ id, layoutParts, flatDeck }) => {
|
|
318
318
|
const { popoverAnchorId } = useLayout();
|
|
319
|
-
const attended = useAttendedIds();
|
|
320
|
-
const id = attended[0] ? `${attended[0]}${SLUG_PATH_SEPARATOR2}${context}` : void 0;
|
|
321
319
|
const { graph } = useGraph3();
|
|
322
320
|
const node = useNode(graph, id);
|
|
323
321
|
const complementaryAttrs = createAttendableAttributes(id?.split(SLUG_PATH_SEPARATOR2)[0] ?? "never");
|
|
324
322
|
useNodeActionExpander(node);
|
|
325
|
-
return /* @__PURE__ */ React5.createElement(Main.ComplementarySidebar, complementaryAttrs, /* @__PURE__ */ React5.createElement("div", {
|
|
323
|
+
return /* @__PURE__ */ React5.createElement(Main.ComplementarySidebar, complementaryAttrs, node ? /* @__PURE__ */ React5.createElement("div", {
|
|
326
324
|
role: "none",
|
|
327
325
|
className: mx2(deckGrid, "grid-cols-1 bs-full")
|
|
328
326
|
}, /* @__PURE__ */ React5.createElement(NodePlankHeading, {
|
|
@@ -332,7 +330,7 @@ var ComplementarySidebar = ({ context, layoutParts, flatDeck }) => {
|
|
|
332
330
|
layoutPart: "complementary",
|
|
333
331
|
popoverAnchorId,
|
|
334
332
|
flatDeck
|
|
335
|
-
}),
|
|
333
|
+
}), /* @__PURE__ */ React5.createElement(Surface3, {
|
|
336
334
|
role: "article",
|
|
337
335
|
data: {
|
|
338
336
|
subject: node.data,
|
|
@@ -342,7 +340,7 @@ var ComplementarySidebar = ({ context, layoutParts, flatDeck }) => {
|
|
|
342
340
|
limit: 1,
|
|
343
341
|
fallback: PlankContentError,
|
|
344
342
|
placeholder: /* @__PURE__ */ React5.createElement(PlankLoading, null)
|
|
345
|
-
})));
|
|
343
|
+
})) : null);
|
|
346
344
|
};
|
|
347
345
|
|
|
348
346
|
// packages/plugins/plugin-deck/src/components/DeckLayout/ContentEmpty.tsx
|
|
@@ -683,16 +681,11 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
683
681
|
const fullScreenSlug = useMemo2(() => firstIdInPart(layoutParts, "fullScreen"), [
|
|
684
682
|
layoutParts
|
|
685
683
|
]);
|
|
686
|
-
const
|
|
684
|
+
const [scrollLeft, setScrollLeft] = useState3(null);
|
|
687
685
|
const deckRef = useRef2(null);
|
|
688
|
-
|
|
689
|
-
const firstId = layoutMode === "solo" ? firstIdInPart(layoutParts, "solo") : firstIdInPart(layoutParts, "main");
|
|
690
|
-
if (attention.attended.size === 0 && firstId) {
|
|
691
|
-
document.querySelector(`article[data-attendable-id="${firstId}"] button`)?.focus();
|
|
692
|
-
}
|
|
693
|
-
}, []);
|
|
686
|
+
const restoreScrollRef = useRef2(false);
|
|
694
687
|
const handleResize = useCallback2(() => {
|
|
695
|
-
|
|
688
|
+
setScrollLeft(null);
|
|
696
689
|
}, []);
|
|
697
690
|
useEffect5(() => {
|
|
698
691
|
window.addEventListener("resize", handleResize);
|
|
@@ -700,19 +693,33 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
700
693
|
}, [
|
|
701
694
|
handleResize
|
|
702
695
|
]);
|
|
703
|
-
|
|
704
|
-
if (
|
|
705
|
-
|
|
696
|
+
useLayoutEffect2(() => {
|
|
697
|
+
if (layoutMode !== "deck") {
|
|
698
|
+
restoreScrollRef.current = true;
|
|
699
|
+
} else if (restoreScrollRef.current && deckRef.current && scrollLeft) {
|
|
700
|
+
deckRef.current.scrollLeft = scrollLeft;
|
|
701
|
+
restoreScrollRef.current = false;
|
|
706
702
|
}
|
|
707
|
-
}, [
|
|
708
|
-
|
|
703
|
+
}, [
|
|
704
|
+
layoutMode,
|
|
705
|
+
deckRef.current,
|
|
706
|
+
scrollLeft
|
|
707
|
+
]);
|
|
709
708
|
const handleScroll = useCallback2((event) => {
|
|
710
709
|
if (layoutMode === "deck" && event.currentTarget === event.target) {
|
|
711
|
-
|
|
710
|
+
setScrollLeft(event.target.scrollLeft);
|
|
712
711
|
}
|
|
713
712
|
}, [
|
|
714
713
|
layoutMode
|
|
715
714
|
]);
|
|
715
|
+
const complementarySlug = useMemo2(() => {
|
|
716
|
+
const entry = layoutParts.complementary?.at(0);
|
|
717
|
+
if (entry) {
|
|
718
|
+
return entry.path ? `${entry.id}${SLUG_PATH_SEPARATOR3}${entry.path}` : entry.id;
|
|
719
|
+
}
|
|
720
|
+
}, [
|
|
721
|
+
layoutParts
|
|
722
|
+
]);
|
|
716
723
|
const firstAttendedId = useMemo2(() => Array.from(attention.attended ?? [])[0], [
|
|
717
724
|
attention.attended
|
|
718
725
|
]);
|
|
@@ -737,19 +744,7 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
737
744
|
layoutParts.main,
|
|
738
745
|
layoutParts.solo
|
|
739
746
|
]);
|
|
740
|
-
const padding =
|
|
741
|
-
if (layoutMode === "deck" && overscroll === "centering") {
|
|
742
|
-
return calculateOverscroll(layoutParts.main, plankSizing, sidebarOpen, complementarySidebarOpen);
|
|
743
|
-
}
|
|
744
|
-
return {};
|
|
745
|
-
}, [
|
|
746
|
-
layoutMode,
|
|
747
|
-
overscroll,
|
|
748
|
-
layoutParts.main,
|
|
749
|
-
plankSizing,
|
|
750
|
-
sidebarOpen,
|
|
751
|
-
complementarySidebarOpen
|
|
752
|
-
]);
|
|
747
|
+
const padding = layoutMode === "deck" && overscroll === "centering" ? calculateOverscroll(layoutParts.main, plankSizing, sidebarOpen, complementarySidebarOpen) : {};
|
|
753
748
|
if (layoutMode === "fullscreen") {
|
|
754
749
|
return /* @__PURE__ */ React13.createElement(Fullscreen, {
|
|
755
750
|
id: fullScreenSlug
|
|
@@ -771,13 +766,19 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
771
766
|
}), /* @__PURE__ */ React13.createElement(Main3.Root, {
|
|
772
767
|
navigationSidebarOpen: context.sidebarOpen,
|
|
773
768
|
onNavigationSidebarOpenChange: (next) => context.sidebarOpen = next,
|
|
774
|
-
complementarySidebarOpen
|
|
775
|
-
|
|
769
|
+
...complementarySidebarOpen !== null && {
|
|
770
|
+
complementarySidebarOpen: (
|
|
771
|
+
/* complementaryAvailable && */
|
|
772
|
+
context.complementarySidebarOpen
|
|
773
|
+
),
|
|
774
|
+
onComplementarySidebarOpenChange: (next) => context.complementarySidebarOpen = next
|
|
775
|
+
}
|
|
776
776
|
}, /* @__PURE__ */ React13.createElement(Main3.Notch, {
|
|
777
777
|
classNames: "z-[21]"
|
|
778
778
|
}, /* @__PURE__ */ React13.createElement(Surface9, {
|
|
779
779
|
role: "notch-start"
|
|
780
780
|
}), /* @__PURE__ */ React13.createElement(Button3, {
|
|
781
|
+
// disabled={!sidebarAvailable}
|
|
781
782
|
onClick: () => context.sidebarOpen = !context.sidebarOpen,
|
|
782
783
|
variant: "ghost",
|
|
783
784
|
classNames: "p-1"
|
|
@@ -787,6 +788,7 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
787
788
|
weight: "light",
|
|
788
789
|
className: getSize(5)
|
|
789
790
|
})), /* @__PURE__ */ React13.createElement(Button3, {
|
|
791
|
+
// disabled={!complementaryAvailable}
|
|
790
792
|
onClick: () => context.complementarySidebarOpen = !context.complementarySidebarOpen,
|
|
791
793
|
variant: "ghost",
|
|
792
794
|
classNames: "p-1"
|
|
@@ -802,7 +804,7 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
802
804
|
attention,
|
|
803
805
|
layoutParts
|
|
804
806
|
}), /* @__PURE__ */ React13.createElement(ComplementarySidebar, {
|
|
805
|
-
|
|
807
|
+
id: complementarySlug,
|
|
806
808
|
layoutParts,
|
|
807
809
|
flatDeck
|
|
808
810
|
}), /* @__PURE__ */ React13.createElement(Main3.Overlay, null), parts.length === 0 && /* @__PURE__ */ React13.createElement(Main3.Content, {
|
|
@@ -930,7 +932,7 @@ var LayoutSettings = ({ settings }) => {
|
|
|
930
932
|
|
|
931
933
|
// packages/plugins/plugin-deck/src/layout.ts
|
|
932
934
|
import { produce } from "immer";
|
|
933
|
-
import { SLUG_ENTRY_SEPARATOR, SLUG_KEY_VALUE_SEPARATOR, SLUG_LIST_SEPARATOR, SLUG_PATH_SEPARATOR as
|
|
935
|
+
import { SLUG_ENTRY_SEPARATOR, SLUG_KEY_VALUE_SEPARATOR, SLUG_LIST_SEPARATOR, SLUG_PATH_SEPARATOR as SLUG_PATH_SEPARATOR4 } from "@dxos/app-framework";
|
|
934
936
|
var partsThatSupportIncrement = [
|
|
935
937
|
"main"
|
|
936
938
|
];
|
|
@@ -1043,7 +1045,7 @@ var mergeLayoutParts = (...layoutParts) => {
|
|
|
1043
1045
|
}), {});
|
|
1044
1046
|
};
|
|
1045
1047
|
var parseLayoutEntry = (itemString) => {
|
|
1046
|
-
const [id, path] = itemString.split(
|
|
1048
|
+
const [id, path] = itemString.split(SLUG_PATH_SEPARATOR4);
|
|
1047
1049
|
const entry = {
|
|
1048
1050
|
id
|
|
1049
1051
|
};
|
|
@@ -1070,7 +1072,7 @@ var soloPartToUri = (layout) => {
|
|
|
1070
1072
|
return "";
|
|
1071
1073
|
}
|
|
1072
1074
|
const entry = soloPart[0];
|
|
1073
|
-
return `${entry.id}${entry.path ?
|
|
1075
|
+
return `${entry.id}${entry.path ? SLUG_PATH_SEPARATOR4 + entry.path : ""}`;
|
|
1074
1076
|
};
|
|
1075
1077
|
|
|
1076
1078
|
// packages/plugins/plugin-deck/src/translations.ts
|
|
@@ -1225,20 +1227,6 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1225
1227
|
}
|
|
1226
1228
|
}
|
|
1227
1229
|
};
|
|
1228
|
-
const handleSetLocation = (next) => {
|
|
1229
|
-
if (attentionPlugin) {
|
|
1230
|
-
const attended = attentionPlugin.provides.attention.attended;
|
|
1231
|
-
const [attendedId] = Array.from(attended);
|
|
1232
|
-
const ids = (layout.values.layoutMode === "deck" ? next.main : next.solo)?.map(({ id }) => id) ?? [];
|
|
1233
|
-
const isAttendedAvailable = !!attendedId && ids.includes(attendedId);
|
|
1234
|
-
if (!isAttendedAvailable) {
|
|
1235
|
-
const nextAttended = next.main?.[0]?.id;
|
|
1236
|
-
const article = document.querySelector(`article[data-attendable-id="${nextAttended}"]`);
|
|
1237
|
-
article?.focus();
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
location.values.active = next;
|
|
1241
|
-
};
|
|
1242
1230
|
return {
|
|
1243
1231
|
meta: meta_default,
|
|
1244
1232
|
ready: async (plugins) => {
|
|
@@ -1313,13 +1301,13 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1313
1301
|
handleNavigation = async () => {
|
|
1314
1302
|
const pathname = window.location.pathname;
|
|
1315
1303
|
if (pathname === "/reset") {
|
|
1316
|
-
|
|
1304
|
+
location.values.active = {
|
|
1317
1305
|
sidebar: [
|
|
1318
1306
|
{
|
|
1319
1307
|
id: NAV_ID
|
|
1320
1308
|
}
|
|
1321
1309
|
]
|
|
1322
|
-
}
|
|
1310
|
+
};
|
|
1323
1311
|
location.values.closed = [];
|
|
1324
1312
|
layout.values.layoutMode = "solo";
|
|
1325
1313
|
window.location.pathname = "/";
|
|
@@ -1330,7 +1318,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1330
1318
|
return;
|
|
1331
1319
|
}
|
|
1332
1320
|
const startingLayout = removePart(location.values.active, "solo");
|
|
1333
|
-
|
|
1321
|
+
location.values.active = mergeLayoutParts(layoutFromUri, startingLayout);
|
|
1334
1322
|
layout.values.layoutMode = "solo";
|
|
1335
1323
|
};
|
|
1336
1324
|
await handleNavigation();
|
|
@@ -1392,7 +1380,8 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1392
1380
|
ns: DECK_PLUGIN
|
|
1393
1381
|
}
|
|
1394
1382
|
],
|
|
1395
|
-
icon:
|
|
1383
|
+
icon: (props) => /* @__PURE__ */ React15.createElement(ArrowsOut, props),
|
|
1384
|
+
iconSymbol: "ph--arrows-out--regular",
|
|
1396
1385
|
keyBinding: {
|
|
1397
1386
|
macos: "ctrl+meta+f",
|
|
1398
1387
|
windows: "shift+ctrl+f"
|
|
@@ -1409,7 +1398,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1409
1398
|
value: deck.values
|
|
1410
1399
|
}, props.children)),
|
|
1411
1400
|
root: () => {
|
|
1412
|
-
return /* @__PURE__ */ React15.createElement(DeckLayout, {
|
|
1401
|
+
return /* @__PURE__ */ React15.createElement(Mosaic.Root, null, /* @__PURE__ */ React15.createElement(DeckLayout, {
|
|
1413
1402
|
attention: attentionPlugin?.provides.attention ?? {
|
|
1414
1403
|
attended: /* @__PURE__ */ new Set()
|
|
1415
1404
|
},
|
|
@@ -1430,7 +1419,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1430
1419
|
}, 1e3);
|
|
1431
1420
|
}
|
|
1432
1421
|
}
|
|
1433
|
-
});
|
|
1422
|
+
}), /* @__PURE__ */ React15.createElement(Mosaic.DragOverlay, null));
|
|
1434
1423
|
},
|
|
1435
1424
|
surface: {
|
|
1436
1425
|
component: ({ data, role }) => {
|
|
@@ -1466,7 +1455,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1466
1455
|
} else {
|
|
1467
1456
|
log.warn("Invalid layout mode", intent?.data?.layoutMode, {
|
|
1468
1457
|
F: __dxlog_file,
|
|
1469
|
-
L:
|
|
1458
|
+
L: 390,
|
|
1470
1459
|
S: void 0,
|
|
1471
1460
|
C: (f, a) => f(...a)
|
|
1472
1461
|
});
|
|
@@ -1521,7 +1510,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1521
1510
|
}
|
|
1522
1511
|
const processLayoutEntry = (partName, entryString, currentLayout) => {
|
|
1523
1512
|
const toggle = true;
|
|
1524
|
-
const [id, path] = entryString.split(
|
|
1513
|
+
const [id, path] = entryString.split(SLUG_PATH_SEPARATOR5);
|
|
1525
1514
|
const layoutEntry = {
|
|
1526
1515
|
id,
|
|
1527
1516
|
...path ? {
|
|
@@ -1550,7 +1539,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1550
1539
|
newLayout = processLayoutEntry(partName, layoutEntries, newLayout);
|
|
1551
1540
|
}
|
|
1552
1541
|
});
|
|
1553
|
-
|
|
1542
|
+
location.values.active = newLayout;
|
|
1554
1543
|
});
|
|
1555
1544
|
const ids = openIds2(location.values.active);
|
|
1556
1545
|
const newlyOpen = ids.filter((i) => !previouslyOpenIds.has(i));
|
|
@@ -1598,10 +1587,10 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1598
1587
|
id: data.id
|
|
1599
1588
|
};
|
|
1600
1589
|
const effectivePart = getEffectivePart(data.part, layout.values.layoutMode);
|
|
1601
|
-
|
|
1590
|
+
location.values.active = openEntry(location.values.active, effectivePart, layoutEntry, {
|
|
1602
1591
|
positioning: data.positioning ?? settings.values.newPlankPositioning,
|
|
1603
1592
|
pivotId: data.pivotId
|
|
1604
|
-
})
|
|
1593
|
+
});
|
|
1605
1594
|
const intents = [];
|
|
1606
1595
|
if (data.scrollIntoView && layout.values.layoutMode === "deck") {
|
|
1607
1596
|
intents.push([
|
|
@@ -1643,7 +1632,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1643
1632
|
});
|
|
1644
1633
|
}
|
|
1645
1634
|
});
|
|
1646
|
-
|
|
1635
|
+
location.values.active = newLayout;
|
|
1647
1636
|
return {
|
|
1648
1637
|
data: true
|
|
1649
1638
|
};
|
|
@@ -1653,7 +1642,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1653
1642
|
case NavigationAction3.SET: {
|
|
1654
1643
|
return batch(() => {
|
|
1655
1644
|
if (isLayoutParts(intent.data?.activeParts)) {
|
|
1656
|
-
|
|
1645
|
+
location.values.active = intent.data.activeParts;
|
|
1657
1646
|
}
|
|
1658
1647
|
return {
|
|
1659
1648
|
data: true
|
|
@@ -1665,10 +1654,10 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1665
1654
|
if (isLayoutAdjustment(intent.data)) {
|
|
1666
1655
|
const adjustment = intent.data;
|
|
1667
1656
|
if (adjustment.type === "increment-end" || adjustment.type === "increment-start") {
|
|
1668
|
-
|
|
1657
|
+
location.values.active = incrementPlank(location.values.active, {
|
|
1669
1658
|
type: adjustment.type,
|
|
1670
1659
|
layoutCoordinate: adjustment.layoutCoordinate
|
|
1671
|
-
})
|
|
1660
|
+
});
|
|
1672
1661
|
}
|
|
1673
1662
|
if (adjustment.type === "solo") {
|
|
1674
1663
|
const entryId = adjustment.layoutCoordinate.entryId;
|