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