@dxos/plugin-deck 0.6.12-main.5cc132e → 0.6.12-main.78ddbdf
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 -76
- 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/package.json +28 -28
- package/src/DeckPlugin.tsx +80 -51
- package/src/components/DeckLayout/ComplementarySidebar.tsx +18 -16
- package/src/components/DeckLayout/DeckLayout.tsx +34 -43
- package/src/components/DeckLayout/NodePlankHeading.tsx +6 -9
- package/src/hooks/useNode.ts +5 -1
|
@@ -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";
|
|
@@ -18,7 +17,6 @@ import { createExtension } from "@dxos/plugin-graph";
|
|
|
18
17
|
import { ObservabilityAction } from "@dxos/plugin-observability/meta";
|
|
19
18
|
import { fullyQualifiedId } from "@dxos/react-client/echo";
|
|
20
19
|
import { translations as deckTranslations } from "@dxos/react-ui-deck";
|
|
21
|
-
import { Mosaic } from "@dxos/react-ui-mosaic";
|
|
22
20
|
|
|
23
21
|
// packages/plugins/plugin-deck/src/components/DeckLayout/constants.ts
|
|
24
22
|
var NAV_ID = "NavTree";
|
|
@@ -26,9 +24,9 @@ var SURFACE_PREFIX = "surface:";
|
|
|
26
24
|
|
|
27
25
|
// packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
|
|
28
26
|
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";
|
|
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, useOnTransition, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
32
30
|
import { Deck } from "@dxos/react-ui-deck";
|
|
33
31
|
import { getSize } from "@dxos/react-ui-theme";
|
|
34
32
|
|
|
@@ -40,8 +38,11 @@ import { useGraph } from "@dxos/plugin-graph";
|
|
|
40
38
|
// packages/plugins/plugin-deck/src/hooks/useNode.ts
|
|
41
39
|
import { useEffect, useState } from "react";
|
|
42
40
|
var useNode = (graph, id, timeout) => {
|
|
43
|
-
const [nodeState, setNodeState] = useState(id ? graph.findNode(id) : void 0);
|
|
41
|
+
const [nodeState, setNodeState] = useState(id ? graph.findNode(id, false) : void 0);
|
|
44
42
|
useEffect(() => {
|
|
43
|
+
if (!id && nodeState) {
|
|
44
|
+
setNodeState(void 0);
|
|
45
|
+
}
|
|
45
46
|
if (nodeState?.id === id || !id) {
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
@@ -117,17 +118,16 @@ import React5 from "react";
|
|
|
117
118
|
import { SLUG_PATH_SEPARATOR as SLUG_PATH_SEPARATOR2, Surface as Surface3 } from "@dxos/app-framework";
|
|
118
119
|
import { useGraph as useGraph3 } from "@dxos/plugin-graph";
|
|
119
120
|
import { Main } from "@dxos/react-ui";
|
|
120
|
-
import { createAttendableAttributes } from "@dxos/react-ui-attention";
|
|
121
|
+
import { createAttendableAttributes, useAttendedIds } from "@dxos/react-ui-attention";
|
|
121
122
|
import { deckGrid } from "@dxos/react-ui-deck";
|
|
122
123
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
123
124
|
|
|
124
125
|
// 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,
|
|
127
|
+
import { LayoutAction, NavigationAction, 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 { Popover, toLocalizedString, useMediaQuery, useTranslation } from "@dxos/react-ui";
|
|
130
|
-
import { PlankHeading
|
|
129
|
+
import { Icon, Popover, toLocalizedString, useMediaQuery, useTranslation } from "@dxos/react-ui";
|
|
130
|
+
import { PlankHeading } 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 ?? "ph--placeholder--regular";
|
|
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,7 +187,10 @@ 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,
|
|
190
|
+
}, label), /* @__PURE__ */ React2.createElement(Icon, {
|
|
191
|
+
icon,
|
|
192
|
+
size: 5
|
|
193
|
+
}))), /* @__PURE__ */ React2.createElement(TextTooltip, {
|
|
191
194
|
text: label,
|
|
192
195
|
onlyWhenTruncating: true
|
|
193
196
|
}, /* @__PURE__ */ React2.createElement(PlankHeading.Label, {
|
|
@@ -237,9 +240,6 @@ var NodePlankHeading = ({
|
|
|
237
240
|
action: NavigationAction.CLOSE,
|
|
238
241
|
data: {
|
|
239
242
|
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: layoutPart === "complementary" ? "minify-end" : true
|
|
257
257
|
}));
|
|
258
258
|
};
|
|
259
259
|
|
|
@@ -314,13 +314,15 @@ 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 = ({ context, layoutParts, flatDeck }) => {
|
|
318
318
|
const { popoverAnchorId } = useLayout();
|
|
319
|
+
const attended = useAttendedIds();
|
|
320
|
+
const id = attended[0] ? `${attended[0]}${SLUG_PATH_SEPARATOR2}${context}` : void 0;
|
|
319
321
|
const { graph } = useGraph3();
|
|
320
322
|
const node = useNode(graph, id);
|
|
321
323
|
const complementaryAttrs = createAttendableAttributes(id?.split(SLUG_PATH_SEPARATOR2)[0] ?? "never");
|
|
322
324
|
useNodeActionExpander(node);
|
|
323
|
-
return /* @__PURE__ */ React5.createElement(Main.ComplementarySidebar, complementaryAttrs,
|
|
325
|
+
return /* @__PURE__ */ React5.createElement(Main.ComplementarySidebar, complementaryAttrs, /* @__PURE__ */ React5.createElement("div", {
|
|
324
326
|
role: "none",
|
|
325
327
|
className: mx2(deckGrid, "grid-cols-1 bs-full")
|
|
326
328
|
}, /* @__PURE__ */ React5.createElement(NodePlankHeading, {
|
|
@@ -330,7 +332,7 @@ var ComplementarySidebar = ({ id, layoutParts, flatDeck }) => {
|
|
|
330
332
|
layoutPart: "complementary",
|
|
331
333
|
popoverAnchorId,
|
|
332
334
|
flatDeck
|
|
333
|
-
}), /* @__PURE__ */ React5.createElement(Surface3, {
|
|
335
|
+
}), node && /* @__PURE__ */ React5.createElement(Surface3, {
|
|
334
336
|
role: "article",
|
|
335
337
|
data: {
|
|
336
338
|
subject: node.data,
|
|
@@ -340,7 +342,7 @@ var ComplementarySidebar = ({ id, layoutParts, flatDeck }) => {
|
|
|
340
342
|
limit: 1,
|
|
341
343
|
fallback: PlankContentError,
|
|
342
344
|
placeholder: /* @__PURE__ */ React5.createElement(PlankLoading, null)
|
|
343
|
-
}))
|
|
345
|
+
})));
|
|
344
346
|
};
|
|
345
347
|
|
|
346
348
|
// packages/plugins/plugin-deck/src/components/DeckLayout/ContentEmpty.tsx
|
|
@@ -681,11 +683,16 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
681
683
|
const fullScreenSlug = useMemo2(() => firstIdInPart(layoutParts, "fullScreen"), [
|
|
682
684
|
layoutParts
|
|
683
685
|
]);
|
|
684
|
-
const
|
|
686
|
+
const scrollLeftRef = useRef2();
|
|
685
687
|
const deckRef = useRef2(null);
|
|
686
|
-
|
|
688
|
+
useEffect5(() => {
|
|
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
|
+
}, []);
|
|
687
694
|
const handleResize = useCallback2(() => {
|
|
688
|
-
|
|
695
|
+
scrollLeftRef.current = null;
|
|
689
696
|
}, []);
|
|
690
697
|
useEffect5(() => {
|
|
691
698
|
window.addEventListener("resize", handleResize);
|
|
@@ -693,33 +700,19 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
693
700
|
}, [
|
|
694
701
|
handleResize
|
|
695
702
|
]);
|
|
696
|
-
|
|
697
|
-
if (
|
|
698
|
-
|
|
699
|
-
} else if (restoreScrollRef.current && deckRef.current && scrollLeft) {
|
|
700
|
-
deckRef.current.scrollLeft = scrollLeft;
|
|
701
|
-
restoreScrollRef.current = false;
|
|
703
|
+
const restoreScroll = useCallback2(() => {
|
|
704
|
+
if (deckRef.current && scrollLeftRef.current != null) {
|
|
705
|
+
deckRef.current.scrollLeft = scrollLeftRef.current;
|
|
702
706
|
}
|
|
703
|
-
}, [
|
|
704
|
-
|
|
705
|
-
deckRef.current,
|
|
706
|
-
scrollLeft
|
|
707
|
-
]);
|
|
707
|
+
}, []);
|
|
708
|
+
useOnTransition(layoutMode, (mode) => mode !== "deck", "deck", restoreScroll);
|
|
708
709
|
const handleScroll = useCallback2((event) => {
|
|
709
710
|
if (layoutMode === "deck" && event.currentTarget === event.target) {
|
|
710
|
-
|
|
711
|
+
scrollLeftRef.current = event.target.scrollLeft;
|
|
711
712
|
}
|
|
712
713
|
}, [
|
|
713
714
|
layoutMode
|
|
714
715
|
]);
|
|
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
716
|
const firstAttendedId = useMemo2(() => Array.from(attention.attended ?? [])[0], [
|
|
724
717
|
attention.attended
|
|
725
718
|
]);
|
|
@@ -744,7 +737,19 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
744
737
|
layoutParts.main,
|
|
745
738
|
layoutParts.solo
|
|
746
739
|
]);
|
|
747
|
-
const padding =
|
|
740
|
+
const padding = useMemo2(() => {
|
|
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
|
+
]);
|
|
748
753
|
if (layoutMode === "fullscreen") {
|
|
749
754
|
return /* @__PURE__ */ React13.createElement(Fullscreen, {
|
|
750
755
|
id: fullScreenSlug
|
|
@@ -766,19 +771,13 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
766
771
|
}), /* @__PURE__ */ React13.createElement(Main3.Root, {
|
|
767
772
|
navigationSidebarOpen: context.sidebarOpen,
|
|
768
773
|
onNavigationSidebarOpenChange: (next) => context.sidebarOpen = next,
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
/* complementaryAvailable && */
|
|
772
|
-
context.complementarySidebarOpen
|
|
773
|
-
),
|
|
774
|
-
onComplementarySidebarOpenChange: (next) => context.complementarySidebarOpen = next
|
|
775
|
-
}
|
|
774
|
+
complementarySidebarOpen: context.complementarySidebarOpen,
|
|
775
|
+
onComplementarySidebarOpenChange: (next) => context.complementarySidebarOpen = next
|
|
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}
|
|
782
781
|
onClick: () => context.sidebarOpen = !context.sidebarOpen,
|
|
783
782
|
variant: "ghost",
|
|
784
783
|
classNames: "p-1"
|
|
@@ -788,7 +787,6 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
788
787
|
weight: "light",
|
|
789
788
|
className: getSize(5)
|
|
790
789
|
})), /* @__PURE__ */ React13.createElement(Button3, {
|
|
791
|
-
// disabled={!complementaryAvailable}
|
|
792
790
|
onClick: () => context.complementarySidebarOpen = !context.complementarySidebarOpen,
|
|
793
791
|
variant: "ghost",
|
|
794
792
|
classNames: "p-1"
|
|
@@ -804,7 +802,7 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
804
802
|
attention,
|
|
805
803
|
layoutParts
|
|
806
804
|
}), /* @__PURE__ */ React13.createElement(ComplementarySidebar, {
|
|
807
|
-
|
|
805
|
+
context: "comments",
|
|
808
806
|
layoutParts,
|
|
809
807
|
flatDeck
|
|
810
808
|
}), /* @__PURE__ */ React13.createElement(Main3.Overlay, null), parts.length === 0 && /* @__PURE__ */ React13.createElement(Main3.Content, {
|
|
@@ -932,7 +930,7 @@ var LayoutSettings = ({ settings }) => {
|
|
|
932
930
|
|
|
933
931
|
// packages/plugins/plugin-deck/src/layout.ts
|
|
934
932
|
import { produce } from "immer";
|
|
935
|
-
import { SLUG_ENTRY_SEPARATOR, SLUG_KEY_VALUE_SEPARATOR, SLUG_LIST_SEPARATOR, SLUG_PATH_SEPARATOR as
|
|
933
|
+
import { SLUG_ENTRY_SEPARATOR, SLUG_KEY_VALUE_SEPARATOR, SLUG_LIST_SEPARATOR, SLUG_PATH_SEPARATOR as SLUG_PATH_SEPARATOR3 } from "@dxos/app-framework";
|
|
936
934
|
var partsThatSupportIncrement = [
|
|
937
935
|
"main"
|
|
938
936
|
];
|
|
@@ -1045,7 +1043,7 @@ var mergeLayoutParts = (...layoutParts) => {
|
|
|
1045
1043
|
}), {});
|
|
1046
1044
|
};
|
|
1047
1045
|
var parseLayoutEntry = (itemString) => {
|
|
1048
|
-
const [id, path] = itemString.split(
|
|
1046
|
+
const [id, path] = itemString.split(SLUG_PATH_SEPARATOR3);
|
|
1049
1047
|
const entry = {
|
|
1050
1048
|
id
|
|
1051
1049
|
};
|
|
@@ -1072,7 +1070,7 @@ var soloPartToUri = (layout) => {
|
|
|
1072
1070
|
return "";
|
|
1073
1071
|
}
|
|
1074
1072
|
const entry = soloPart[0];
|
|
1075
|
-
return `${entry.id}${entry.path ?
|
|
1073
|
+
return `${entry.id}${entry.path ? SLUG_PATH_SEPARATOR3 + entry.path : ""}`;
|
|
1076
1074
|
};
|
|
1077
1075
|
|
|
1078
1076
|
// packages/plugins/plugin-deck/src/translations.ts
|
|
@@ -1227,6 +1225,20 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1227
1225
|
}
|
|
1228
1226
|
}
|
|
1229
1227
|
};
|
|
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
|
+
};
|
|
1230
1242
|
return {
|
|
1231
1243
|
meta: meta_default,
|
|
1232
1244
|
ready: async (plugins) => {
|
|
@@ -1301,13 +1313,13 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1301
1313
|
handleNavigation = async () => {
|
|
1302
1314
|
const pathname = window.location.pathname;
|
|
1303
1315
|
if (pathname === "/reset") {
|
|
1304
|
-
|
|
1316
|
+
handleSetLocation({
|
|
1305
1317
|
sidebar: [
|
|
1306
1318
|
{
|
|
1307
1319
|
id: NAV_ID
|
|
1308
1320
|
}
|
|
1309
1321
|
]
|
|
1310
|
-
};
|
|
1322
|
+
});
|
|
1311
1323
|
location.values.closed = [];
|
|
1312
1324
|
layout.values.layoutMode = "solo";
|
|
1313
1325
|
window.location.pathname = "/";
|
|
@@ -1318,7 +1330,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1318
1330
|
return;
|
|
1319
1331
|
}
|
|
1320
1332
|
const startingLayout = removePart(location.values.active, "solo");
|
|
1321
|
-
|
|
1333
|
+
handleSetLocation(mergeLayoutParts(layoutFromUri, startingLayout));
|
|
1322
1334
|
layout.values.layoutMode = "solo";
|
|
1323
1335
|
};
|
|
1324
1336
|
await handleNavigation();
|
|
@@ -1380,8 +1392,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1380
1392
|
ns: DECK_PLUGIN
|
|
1381
1393
|
}
|
|
1382
1394
|
],
|
|
1383
|
-
icon:
|
|
1384
|
-
iconSymbol: "ph--arrows-out--regular",
|
|
1395
|
+
icon: "ph--arrows-out--regular",
|
|
1385
1396
|
keyBinding: {
|
|
1386
1397
|
macos: "ctrl+meta+f",
|
|
1387
1398
|
windows: "shift+ctrl+f"
|
|
@@ -1398,7 +1409,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1398
1409
|
value: deck.values
|
|
1399
1410
|
}, props.children)),
|
|
1400
1411
|
root: () => {
|
|
1401
|
-
return /* @__PURE__ */ React15.createElement(
|
|
1412
|
+
return /* @__PURE__ */ React15.createElement(DeckLayout, {
|
|
1402
1413
|
attention: attentionPlugin?.provides.attention ?? {
|
|
1403
1414
|
attended: /* @__PURE__ */ new Set()
|
|
1404
1415
|
},
|
|
@@ -1419,7 +1430,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1419
1430
|
}, 1e3);
|
|
1420
1431
|
}
|
|
1421
1432
|
}
|
|
1422
|
-
})
|
|
1433
|
+
});
|
|
1423
1434
|
},
|
|
1424
1435
|
surface: {
|
|
1425
1436
|
component: ({ data, role }) => {
|
|
@@ -1455,7 +1466,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1455
1466
|
} else {
|
|
1456
1467
|
log.warn("Invalid layout mode", intent?.data?.layoutMode, {
|
|
1457
1468
|
F: __dxlog_file,
|
|
1458
|
-
L:
|
|
1469
|
+
L: 411,
|
|
1459
1470
|
S: void 0,
|
|
1460
1471
|
C: (f, a) => f(...a)
|
|
1461
1472
|
});
|
|
@@ -1510,7 +1521,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1510
1521
|
}
|
|
1511
1522
|
const processLayoutEntry = (partName, entryString, currentLayout) => {
|
|
1512
1523
|
const toggle = true;
|
|
1513
|
-
const [id, path] = entryString.split(
|
|
1524
|
+
const [id, path] = entryString.split(SLUG_PATH_SEPARATOR4);
|
|
1514
1525
|
const layoutEntry = {
|
|
1515
1526
|
id,
|
|
1516
1527
|
...path ? {
|
|
@@ -1539,7 +1550,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1539
1550
|
newLayout = processLayoutEntry(partName, layoutEntries, newLayout);
|
|
1540
1551
|
}
|
|
1541
1552
|
});
|
|
1542
|
-
|
|
1553
|
+
handleSetLocation(newLayout);
|
|
1543
1554
|
});
|
|
1544
1555
|
const ids = openIds2(location.values.active);
|
|
1545
1556
|
const newlyOpen = ids.filter((i) => !previouslyOpenIds.has(i));
|
|
@@ -1587,10 +1598,10 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1587
1598
|
id: data.id
|
|
1588
1599
|
};
|
|
1589
1600
|
const effectivePart = getEffectivePart(data.part, layout.values.layoutMode);
|
|
1590
|
-
|
|
1601
|
+
handleSetLocation(openEntry(location.values.active, effectivePart, layoutEntry, {
|
|
1591
1602
|
positioning: data.positioning ?? settings.values.newPlankPositioning,
|
|
1592
1603
|
pivotId: data.pivotId
|
|
1593
|
-
});
|
|
1604
|
+
}));
|
|
1594
1605
|
const intents = [];
|
|
1595
1606
|
if (data.scrollIntoView && layout.values.layoutMode === "deck") {
|
|
1596
1607
|
intents.push([
|
|
@@ -1632,7 +1643,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1632
1643
|
});
|
|
1633
1644
|
}
|
|
1634
1645
|
});
|
|
1635
|
-
|
|
1646
|
+
handleSetLocation(newLayout);
|
|
1636
1647
|
return {
|
|
1637
1648
|
data: true
|
|
1638
1649
|
};
|
|
@@ -1642,7 +1653,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1642
1653
|
case NavigationAction3.SET: {
|
|
1643
1654
|
return batch(() => {
|
|
1644
1655
|
if (isLayoutParts(intent.data?.activeParts)) {
|
|
1645
|
-
|
|
1656
|
+
handleSetLocation(intent.data.activeParts);
|
|
1646
1657
|
}
|
|
1647
1658
|
return {
|
|
1648
1659
|
data: true
|
|
@@ -1654,10 +1665,10 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1654
1665
|
if (isLayoutAdjustment(intent.data)) {
|
|
1655
1666
|
const adjustment = intent.data;
|
|
1656
1667
|
if (adjustment.type === "increment-end" || adjustment.type === "increment-start") {
|
|
1657
|
-
|
|
1668
|
+
handleSetLocation(incrementPlank(location.values.active, {
|
|
1658
1669
|
type: adjustment.type,
|
|
1659
1670
|
layoutCoordinate: adjustment.layoutCoordinate
|
|
1660
|
-
});
|
|
1671
|
+
}));
|
|
1661
1672
|
}
|
|
1662
1673
|
if (adjustment.type === "solo") {
|
|
1663
1674
|
const entryId = adjustment.layoutCoordinate.entryId;
|