@dxos/plugin-deck 0.6.12-staging.e11e696 → 0.6.13-main.09887cd
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/{chunk-YVHGFQQR.mjs → chunk-GVOGPULO.mjs} +1 -1
- package/dist/lib/browser/chunk-GVOGPULO.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +149 -95
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts +1 -1
- package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -2
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts +3 -1
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts +3 -1
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +1 -1
- package/dist/types/src/components/LayoutSettings.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +1 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/overscroll.d.ts +1 -1
- package/dist/types/src/util/overscroll.d.ts.map +1 -1
- package/package.json +27 -26
- package/src/DeckPlugin.tsx +18 -24
- package/src/components/DeckLayout/ComplementarySidebar.tsx +51 -8
- package/src/components/DeckLayout/DeckLayout.tsx +25 -35
- package/src/components/DeckLayout/NodePlankHeading.tsx +4 -2
- package/src/components/DeckLayout/Plank.tsx +1 -1
- package/src/components/DeckLayout/StatusBar.tsx +12 -3
- package/src/components/LayoutSettings.tsx +5 -8
- package/src/meta.ts +3 -1
- package/src/translations.ts +3 -1
- package/src/types.ts +1 -1
- package/src/util/overscroll.ts +5 -5
- package/dist/lib/browser/chunk-YVHGFQQR.mjs.map +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const DECK_PLUGIN = 'dxos.org/plugin/deck';\n\nexport default {\n id: DECK_PLUGIN,\n name: 'Deck',\n} satisfies PluginMeta;\n"],
|
|
5
|
+
"mappings": ";AAMO,IAAMA,cAAc;AAE3B,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;AACR;",
|
|
6
|
+
"names": ["DECK_PLUGIN", "id", "name"]
|
|
7
|
+
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DECK_PLUGIN,
|
|
3
3
|
meta_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GVOGPULO.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-deck/src/DeckPlugin.tsx
|
|
7
|
-
import { batch
|
|
7
|
+
import { batch } from "@preact/signals-core";
|
|
8
8
|
import { setAutoFreeze } from "immer";
|
|
9
9
|
import React15 from "react";
|
|
10
|
-
import { IntentAction, LayoutAction as LayoutAction3, NavigationAction as
|
|
10
|
+
import { IntentAction, LayoutAction as LayoutAction3, NavigationAction as NavigationAction4, parseGraphPlugin, parseIntentPlugin, resolvePlugin, Toast as ToastSchema, SLUG_PATH_SEPARATOR as SLUG_PATH_SEPARATOR4, isLayoutParts, isLayoutAdjustment, isLayoutMode, openIds as openIds2 } from "@dxos/app-framework";
|
|
11
11
|
import { create, getTypename, isReactiveObject } from "@dxos/echo-schema";
|
|
12
|
+
import { scheduledEffect } from "@dxos/echo-signals/core";
|
|
12
13
|
import { LocalStorageStore } from "@dxos/local-storage";
|
|
13
14
|
import { log } from "@dxos/log";
|
|
14
15
|
import { parseAttentionPlugin } from "@dxos/plugin-attention";
|
|
@@ -24,12 +25,12 @@ var SURFACE_PREFIX = "surface:";
|
|
|
24
25
|
|
|
25
26
|
// packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
|
|
26
27
|
import { Sidebar as MenuIcon } from "@phosphor-icons/react";
|
|
27
|
-
import React13, { useCallback as useCallback2, useEffect as useEffect5, useMemo as
|
|
28
|
+
import React13, { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo3, useRef as useRef2 } from "react";
|
|
28
29
|
import { Surface as Surface9, firstIdInPart, usePlugin } from "@dxos/app-framework";
|
|
29
30
|
import { Button as Button3, Dialog, Main as Main3, Popover as Popover2, useOnTransition, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
30
31
|
import { useAttended as useAttended3 } from "@dxos/react-ui-attention";
|
|
31
32
|
import { Deck } from "@dxos/react-ui-deck";
|
|
32
|
-
import { getSize } from "@dxos/react-ui-theme";
|
|
33
|
+
import { getSize, mainPaddingTransitions as mainPaddingTransitions2 } from "@dxos/react-ui-theme";
|
|
33
34
|
|
|
34
35
|
// packages/plugins/plugin-deck/src/components/DeckLayout/ActiveNode.tsx
|
|
35
36
|
import React from "react";
|
|
@@ -115,8 +116,8 @@ var ActiveNode = ({ id }) => {
|
|
|
115
116
|
};
|
|
116
117
|
|
|
117
118
|
// packages/plugins/plugin-deck/src/components/DeckLayout/ComplementarySidebar.tsx
|
|
118
|
-
import React5 from "react";
|
|
119
|
-
import { SLUG_PATH_SEPARATOR as SLUG_PATH_SEPARATOR2, Surface as Surface3 } from "@dxos/app-framework";
|
|
119
|
+
import React5, { useMemo } from "react";
|
|
120
|
+
import { NavigationAction as NavigationAction2, SLUG_PATH_SEPARATOR as SLUG_PATH_SEPARATOR2, Surface as Surface3, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
120
121
|
import { useGraph as useGraph3 } from "@dxos/plugin-graph";
|
|
121
122
|
import { Main } from "@dxos/react-ui";
|
|
122
123
|
import { useAttended } from "@dxos/react-ui-attention";
|
|
@@ -130,7 +131,7 @@ import { useGraph as useGraph2 } from "@dxos/plugin-graph";
|
|
|
130
131
|
import { Icon, Popover, toLocalizedString, useMediaQuery, useTranslation } from "@dxos/react-ui";
|
|
131
132
|
import { PlankHeading } from "@dxos/react-ui-deck";
|
|
132
133
|
import { TextTooltip } from "@dxos/react-ui-text-tooltip";
|
|
133
|
-
var NodePlankHeading = ({ node, id, layoutParts, layoutPart, popoverAnchorId, pending, flatDeck }) => {
|
|
134
|
+
var NodePlankHeading = ({ node, id, layoutParts, layoutPart, popoverAnchorId, pending, flatDeck, actions = [] }) => {
|
|
134
135
|
const { t } = useTranslation(DECK_PLUGIN);
|
|
135
136
|
const { graph } = useGraph2();
|
|
136
137
|
const icon = node?.properties?.icon ?? "ph--placeholder--regular";
|
|
@@ -167,7 +168,10 @@ var NodePlankHeading = ({ node, id, layoutParts, layoutPart, popoverAnchorId, pe
|
|
|
167
168
|
related: layoutPart === "complementary",
|
|
168
169
|
attendableId,
|
|
169
170
|
triggerLabel: t("actions menu label"),
|
|
170
|
-
actions:
|
|
171
|
+
actions: [
|
|
172
|
+
actions,
|
|
173
|
+
graph.actions(node)
|
|
174
|
+
].filter((a) => a.length > 0),
|
|
171
175
|
onAction: (action) => typeof action.data === "function" && action.data?.({
|
|
172
176
|
node: action,
|
|
173
177
|
caller: DECK_PLUGIN
|
|
@@ -307,13 +311,67 @@ var LayoutContext = createContext(null);
|
|
|
307
311
|
var useLayout = () => useContext(LayoutContext) ?? raise(new Error("Missing LayoutContext"));
|
|
308
312
|
|
|
309
313
|
// packages/plugins/plugin-deck/src/components/DeckLayout/ComplementarySidebar.tsx
|
|
310
|
-
var
|
|
314
|
+
var panels = [
|
|
315
|
+
"comments",
|
|
316
|
+
"settings",
|
|
317
|
+
"debug"
|
|
318
|
+
];
|
|
319
|
+
var nodes = [
|
|
320
|
+
{
|
|
321
|
+
id: "comments",
|
|
322
|
+
icon: "ph--chat-text--regular"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
id: "settings",
|
|
326
|
+
icon: "ph--gear--regular"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
id: "debug",
|
|
330
|
+
icon: "ph--bug--regular"
|
|
331
|
+
}
|
|
332
|
+
];
|
|
333
|
+
var getPanel = (part) => {
|
|
334
|
+
if (part && panels.findIndex((panel) => panel === part) !== -1) {
|
|
335
|
+
return part;
|
|
336
|
+
} else {
|
|
337
|
+
return "settings";
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
var ComplementarySidebar = ({ layoutParts, flatDeck }) => {
|
|
311
341
|
const { popoverAnchorId } = useLayout();
|
|
312
342
|
const attended = useAttended();
|
|
313
|
-
const
|
|
343
|
+
const part = getPanel(layoutParts.complementary?.[0].id);
|
|
344
|
+
const id = attended[0] ? `${attended[0]}${SLUG_PATH_SEPARATOR2}${part}` : void 0;
|
|
314
345
|
const { graph } = useGraph3();
|
|
315
346
|
const node = useNode(graph, id);
|
|
347
|
+
const dispatch = useIntentDispatcher2();
|
|
316
348
|
useNodeActionExpander(node);
|
|
349
|
+
const actions = useMemo(() => nodes.map(({ id: id2, icon }) => ({
|
|
350
|
+
id: `complementary-${id2}`,
|
|
351
|
+
data: () => {
|
|
352
|
+
void dispatch({
|
|
353
|
+
action: NavigationAction2.OPEN,
|
|
354
|
+
data: {
|
|
355
|
+
activeParts: {
|
|
356
|
+
complementary: id2
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
},
|
|
361
|
+
properties: {
|
|
362
|
+
label: [
|
|
363
|
+
`${id2} label`,
|
|
364
|
+
{
|
|
365
|
+
ns: DECK_PLUGIN
|
|
366
|
+
}
|
|
367
|
+
],
|
|
368
|
+
icon,
|
|
369
|
+
menuItemType: "toggle",
|
|
370
|
+
isChecked: part === id2
|
|
371
|
+
}
|
|
372
|
+
})), [
|
|
373
|
+
part
|
|
374
|
+
]);
|
|
317
375
|
return /* @__PURE__ */ React5.createElement(Main.ComplementarySidebar, null, /* @__PURE__ */ React5.createElement("div", {
|
|
318
376
|
role: "none",
|
|
319
377
|
className: mx2(deckGrid, "grid-cols-1 bs-full")
|
|
@@ -323,12 +381,12 @@ var ComplementarySidebar = ({ context, layoutParts, flatDeck }) => {
|
|
|
323
381
|
layoutParts,
|
|
324
382
|
layoutPart: "complementary",
|
|
325
383
|
popoverAnchorId,
|
|
326
|
-
flatDeck
|
|
384
|
+
flatDeck,
|
|
385
|
+
actions
|
|
327
386
|
}), node && /* @__PURE__ */ React5.createElement(Surface3, {
|
|
328
|
-
role:
|
|
387
|
+
role: `complementary--${part}`,
|
|
329
388
|
data: {
|
|
330
389
|
subject: node.properties.object,
|
|
331
|
-
part: "complementary",
|
|
332
390
|
popoverAnchorId
|
|
333
391
|
},
|
|
334
392
|
limit: 1,
|
|
@@ -395,7 +453,7 @@ var Fullscreen = ({ id }) => {
|
|
|
395
453
|
// packages/plugins/plugin-deck/src/components/DeckLayout/Plank.tsx
|
|
396
454
|
import { Plus } from "@phosphor-icons/react";
|
|
397
455
|
import React9, { useCallback, useLayoutEffect, useRef } from "react";
|
|
398
|
-
import { LayoutAction as LayoutAction2, NavigationAction as
|
|
456
|
+
import { LayoutAction as LayoutAction2, NavigationAction as NavigationAction3, Surface as Surface6, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
399
457
|
import { debounce } from "@dxos/async";
|
|
400
458
|
import { useGraph as useGraph5 } from "@dxos/plugin-graph";
|
|
401
459
|
import { Button, Tooltip, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
@@ -412,7 +470,7 @@ var useDeckContext = () => useContext2(DeckContext) ?? raise2(new Error("Missing
|
|
|
412
470
|
// packages/plugins/plugin-deck/src/components/DeckLayout/Plank.tsx
|
|
413
471
|
var Plank = ({ entry, layoutParts, part, flatDeck, searchEnabled, layoutMode }) => {
|
|
414
472
|
const { t } = useTranslation4(DECK_PLUGIN);
|
|
415
|
-
const dispatch =
|
|
473
|
+
const dispatch = useIntentDispatcher3();
|
|
416
474
|
const { popoverAnchorId, scrollIntoView } = useLayout();
|
|
417
475
|
const { plankSizing } = useDeckContext();
|
|
418
476
|
const { graph } = useGraph5();
|
|
@@ -457,7 +515,7 @@ var Plank = ({ entry, layoutParts, part, flatDeck, searchEnabled, layoutMode })
|
|
|
457
515
|
layoutMode
|
|
458
516
|
]);
|
|
459
517
|
const isSolo = layoutMode === "solo" && part === "solo";
|
|
460
|
-
const isSuppressed = layoutMode === "solo" && part !== "solo";
|
|
518
|
+
const isSuppressed = layoutMode === "solo" && part !== "solo" || layoutMode === "deck" && part === "solo";
|
|
461
519
|
const sizeAttrs = useMainSize();
|
|
462
520
|
return /* @__PURE__ */ React9.createElement(NaturalPlank.Root, {
|
|
463
521
|
size,
|
|
@@ -523,7 +581,7 @@ var Plank = ({ entry, layoutParts, part, flatDeck, searchEnabled, layoutMode })
|
|
|
523
581
|
component: "dxos.org/plugin/search/Dialog",
|
|
524
582
|
dialogBlockAlign: "start",
|
|
525
583
|
subject: {
|
|
526
|
-
action:
|
|
584
|
+
action: NavigationAction3.SET,
|
|
527
585
|
position: "add-after",
|
|
528
586
|
coordinate
|
|
529
587
|
}
|
|
@@ -543,14 +601,14 @@ var Plank = ({ entry, layoutParts, part, flatDeck, searchEnabled, layoutMode })
|
|
|
543
601
|
};
|
|
544
602
|
|
|
545
603
|
// packages/plugins/plugin-deck/src/components/DeckLayout/Sidebar.tsx
|
|
546
|
-
import React10, { useMemo } from "react";
|
|
604
|
+
import React10, { useMemo as useMemo2 } from "react";
|
|
547
605
|
import { openIds, Surface as Surface7 } from "@dxos/app-framework";
|
|
548
606
|
import { Main as Main2 } from "@dxos/react-ui";
|
|
549
607
|
import { useAttended as useAttended2 } from "@dxos/react-ui-attention";
|
|
550
608
|
var Sidebar = ({ layoutParts }) => {
|
|
551
609
|
const { layoutMode, popoverAnchorId } = useLayout();
|
|
552
610
|
const attended = useAttended2();
|
|
553
|
-
const activeIds =
|
|
611
|
+
const activeIds = useMemo2(() => {
|
|
554
612
|
if (layoutMode === "solo") {
|
|
555
613
|
return new Set(layoutParts?.solo?.map((e) => e.id) ?? []);
|
|
556
614
|
} else if (layoutMode === "deck") {
|
|
@@ -561,7 +619,7 @@ var Sidebar = ({ layoutParts }) => {
|
|
|
561
619
|
layoutParts,
|
|
562
620
|
layoutMode
|
|
563
621
|
]);
|
|
564
|
-
const navigationData =
|
|
622
|
+
const navigationData = useMemo2(() => ({
|
|
565
623
|
popoverAnchorId,
|
|
566
624
|
activeIds,
|
|
567
625
|
attended
|
|
@@ -582,14 +640,19 @@ var Sidebar = ({ layoutParts }) => {
|
|
|
582
640
|
// packages/plugins/plugin-deck/src/components/DeckLayout/StatusBar.tsx
|
|
583
641
|
import React11 from "react";
|
|
584
642
|
import { Surface as Surface8 } from "@dxos/app-framework";
|
|
585
|
-
import { mainPadding, mx as mx4 } from "@dxos/react-ui-theme";
|
|
586
|
-
var StatusBar = () => {
|
|
643
|
+
import { mainPadding, mainPaddingTransitions, mx as mx4 } from "@dxos/react-ui-theme";
|
|
644
|
+
var StatusBar = ({ showHints }) => {
|
|
587
645
|
const sizeAttrs = useMainSize();
|
|
588
646
|
return /* @__PURE__ */ React11.createElement("div", {
|
|
589
647
|
role: "none",
|
|
590
648
|
...sizeAttrs,
|
|
591
|
-
className: mx4("fixed block-end-0 inset-inline-0 z-[2]", mainPadding)
|
|
592
|
-
}, /* @__PURE__ */ React11.createElement(
|
|
649
|
+
className: mx4("fixed flex justify-between block-end-0 inset-inline-0 items-center border-bs border-separator z-[2]", mainPadding, mainPaddingTransitions)
|
|
650
|
+
}, /* @__PURE__ */ React11.createElement("div", {
|
|
651
|
+
role: "none"
|
|
652
|
+
}, showHints && /* @__PURE__ */ React11.createElement(Surface8, {
|
|
653
|
+
role: "hints",
|
|
654
|
+
limit: 1
|
|
655
|
+
})), /* @__PURE__ */ React11.createElement(Surface8, {
|
|
593
656
|
role: "status-bar",
|
|
594
657
|
limit: 1
|
|
595
658
|
}));
|
|
@@ -642,7 +705,10 @@ var getEffectivePart = (partName, layoutMode) => layoutMode === "solo" && partNa
|
|
|
642
705
|
import { PLANK_DEFAULTS } from "@dxos/react-ui-deck";
|
|
643
706
|
var calculateOverscroll = (planks, plankSizing, sidebarOpen, complementarySidebarOpen) => {
|
|
644
707
|
if (!planks?.length) {
|
|
645
|
-
return
|
|
708
|
+
return {
|
|
709
|
+
paddingInlineStart: 0,
|
|
710
|
+
paddingInlineEnd: 0
|
|
711
|
+
};
|
|
646
712
|
}
|
|
647
713
|
const sidebarWidth = sidebarOpen ? "270px" : "0px";
|
|
648
714
|
const complementarySidebarWidth = complementarySidebarOpen ? "360px" : "0px";
|
|
@@ -652,8 +718,8 @@ var calculateOverscroll = (planks, plankSizing, sidebarOpen, complementarySideba
|
|
|
652
718
|
const plankSize = getPlankSize(plank.id);
|
|
653
719
|
const overscrollPadding = `max(0px, calc(((100dvw - ${sidebarWidth} - ${complementarySidebarWidth} - (${plankSize} + 20px)) / 2)))`;
|
|
654
720
|
return {
|
|
655
|
-
|
|
656
|
-
|
|
721
|
+
paddingInlineStart: overscrollPadding,
|
|
722
|
+
paddingInlineEnd: overscrollPadding
|
|
657
723
|
};
|
|
658
724
|
} else {
|
|
659
725
|
const first = planks[0];
|
|
@@ -661,21 +727,21 @@ var calculateOverscroll = (planks, plankSizing, sidebarOpen, complementarySideba
|
|
|
661
727
|
const last = planks[planks.length - 1];
|
|
662
728
|
const lastSize = getPlankSize(last.id);
|
|
663
729
|
return {
|
|
664
|
-
|
|
665
|
-
|
|
730
|
+
paddingInlineStart: `max(0px, calc(((100dvw - (${firstSize} + 20px)) / 2) - ${sidebarWidth}))`,
|
|
731
|
+
paddingInlineEnd: `max(0px, calc(((100dvw - (${lastSize} + 20px)) / 2) - ${complementarySidebarWidth}))`
|
|
666
732
|
};
|
|
667
733
|
}
|
|
668
734
|
};
|
|
669
735
|
|
|
670
736
|
// packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
|
|
671
|
-
var DeckLayout = ({ layoutParts, toasts, flatDeck, overscroll,
|
|
737
|
+
var DeckLayout = ({ layoutParts, toasts, flatDeck, overscroll, showHints, slots, onDismissToast }) => {
|
|
672
738
|
const context = useLayout();
|
|
673
739
|
const { layoutMode, sidebarOpen, complementarySidebarOpen, dialogOpen, dialogContent, dialogBlockAlign, popoverOpen, popoverContent, popoverAnchorId } = context;
|
|
674
740
|
const { t } = useTranslation5(DECK_PLUGIN);
|
|
675
741
|
const { plankSizing } = useDeckContext();
|
|
676
742
|
const attended = useAttended3();
|
|
677
743
|
const searchPlugin = usePlugin("dxos.org/plugin/search");
|
|
678
|
-
const fullScreenSlug =
|
|
744
|
+
const fullScreenSlug = useMemo3(() => firstIdInPart(layoutParts, "fullScreen"), [
|
|
679
745
|
layoutParts
|
|
680
746
|
]);
|
|
681
747
|
const scrollLeftRef = useRef2();
|
|
@@ -716,21 +782,8 @@ var DeckLayout = ({ layoutParts, toasts, flatDeck, overscroll, showHintsFooter,
|
|
|
716
782
|
layoutMode,
|
|
717
783
|
firstAttendedId
|
|
718
784
|
]);
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
...layoutParts.main ?? []
|
|
722
|
-
];
|
|
723
|
-
for (const part of layoutParts.solo ?? []) {
|
|
724
|
-
if (!parts2.find((entry) => entry.id === part.id)) {
|
|
725
|
-
parts2.push(part);
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
return parts2;
|
|
729
|
-
}, [
|
|
730
|
-
layoutParts.main,
|
|
731
|
-
layoutParts.solo
|
|
732
|
-
]);
|
|
733
|
-
const padding = useMemo2(() => {
|
|
785
|
+
const isEmpty = layoutParts.main?.length === 0 && layoutParts.solo?.length === 0;
|
|
786
|
+
const padding = useMemo3(() => {
|
|
734
787
|
if (layoutMode === "deck" && overscroll === "centering") {
|
|
735
788
|
return calculateOverscroll(layoutParts.main, plankSizing, sidebarOpen, complementarySidebarOpen);
|
|
736
789
|
}
|
|
@@ -797,9 +850,9 @@ var DeckLayout = ({ layoutParts, toasts, flatDeck, overscroll, showHintsFooter,
|
|
|
797
850
|
context: "comments",
|
|
798
851
|
layoutParts,
|
|
799
852
|
flatDeck
|
|
800
|
-
}), /* @__PURE__ */ React13.createElement(Main3.Overlay, null),
|
|
853
|
+
}), /* @__PURE__ */ React13.createElement(Main3.Overlay, null), isEmpty && /* @__PURE__ */ React13.createElement(Main3.Content, {
|
|
801
854
|
handlesFocus: true
|
|
802
|
-
}, /* @__PURE__ */ React13.createElement(ContentEmpty, null)),
|
|
855
|
+
}, /* @__PURE__ */ React13.createElement(ContentEmpty, null)), !isEmpty && /* @__PURE__ */ React13.createElement(Main3.Content, {
|
|
803
856
|
bounce: true,
|
|
804
857
|
classNames: "grid block-end-[--statusbar-size]",
|
|
805
858
|
handlesFocus: true
|
|
@@ -810,26 +863,33 @@ var DeckLayout = ({ layoutParts, toasts, flatDeck, overscroll, showHintsFooter,
|
|
|
810
863
|
style: padding,
|
|
811
864
|
classNames: [
|
|
812
865
|
!flatDeck && "bg-deck",
|
|
866
|
+
mainPaddingTransitions2,
|
|
813
867
|
"absolute inset-0",
|
|
814
868
|
slots?.wallpaper?.classNames
|
|
815
869
|
],
|
|
816
870
|
solo: layoutMode === "solo",
|
|
817
871
|
onScroll: handleScroll,
|
|
818
872
|
ref: deckRef
|
|
819
|
-
},
|
|
873
|
+
}, /* @__PURE__ */ React13.createElement(Plank, {
|
|
874
|
+
entry: layoutParts.solo?.[0] ?? {
|
|
875
|
+
id: "unknown-solo"
|
|
876
|
+
},
|
|
877
|
+
layoutParts,
|
|
878
|
+
part: "solo",
|
|
879
|
+
layoutMode,
|
|
880
|
+
flatDeck,
|
|
881
|
+
searchEnabled: !!searchPlugin
|
|
882
|
+
}), layoutParts.main?.map((layoutEntry) => /* @__PURE__ */ React13.createElement(Plank, {
|
|
820
883
|
key: layoutEntry.id,
|
|
821
884
|
entry: layoutEntry,
|
|
822
885
|
layoutParts,
|
|
823
|
-
part:
|
|
886
|
+
part: "main",
|
|
824
887
|
layoutMode,
|
|
825
888
|
flatDeck,
|
|
826
889
|
searchEnabled: !!searchPlugin
|
|
827
|
-
}))))), /* @__PURE__ */ React13.createElement(StatusBar,
|
|
828
|
-
|
|
829
|
-
}, /* @__PURE__ */ React13.createElement(
|
|
830
|
-
role: "hints",
|
|
831
|
-
limit: 1
|
|
832
|
-
})), /* @__PURE__ */ React13.createElement(Popover2.Portal, null, /* @__PURE__ */ React13.createElement(Popover2.Content, {
|
|
890
|
+
}))))), /* @__PURE__ */ React13.createElement(StatusBar, {
|
|
891
|
+
showHints
|
|
892
|
+
}), /* @__PURE__ */ React13.createElement(Popover2.Portal, null, /* @__PURE__ */ React13.createElement(Popover2.Content, {
|
|
833
893
|
classNames: "z-[60]",
|
|
834
894
|
onEscapeKeyDown: () => {
|
|
835
895
|
context.popoverOpen = false;
|
|
@@ -898,25 +958,25 @@ var LayoutSettings = ({ settings }) => {
|
|
|
898
958
|
key: option,
|
|
899
959
|
value: option
|
|
900
960
|
}, t(`settings overscroll ${option} label`)))))))), /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
901
|
-
label: t("settings show
|
|
961
|
+
label: t("settings show hints label")
|
|
902
962
|
}, /* @__PURE__ */ React14.createElement(Input.Switch, {
|
|
903
|
-
checked: settings.
|
|
904
|
-
onCheckedChange: (checked) => settings.
|
|
963
|
+
checked: settings.showHints,
|
|
964
|
+
onCheckedChange: (checked) => settings.showHints = checked
|
|
905
965
|
})), !isSocket && /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
906
966
|
label: t("settings native redirect label")
|
|
907
967
|
}, /* @__PURE__ */ React14.createElement(Input.Switch, {
|
|
908
968
|
checked: settings.enableNativeRedirect,
|
|
909
|
-
onCheckedChange: (checked) => settings.enableNativeRedirect =
|
|
969
|
+
onCheckedChange: (checked) => settings.enableNativeRedirect = checked
|
|
910
970
|
})), /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
911
971
|
label: t("settings custom slots")
|
|
912
972
|
}, /* @__PURE__ */ React14.createElement(Input.Switch, {
|
|
913
973
|
checked: settings.customSlots,
|
|
914
|
-
onCheckedChange: (checked) => settings.customSlots =
|
|
974
|
+
onCheckedChange: (checked) => settings.customSlots = checked
|
|
915
975
|
})), /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
916
976
|
label: t("settings flat deck")
|
|
917
977
|
}, /* @__PURE__ */ React14.createElement(Input.Switch, {
|
|
918
978
|
checked: settings.flatDeck,
|
|
919
|
-
onCheckedChange: (checked) => settings.flatDeck =
|
|
979
|
+
onCheckedChange: (checked) => settings.flatDeck = checked
|
|
920
980
|
})));
|
|
921
981
|
};
|
|
922
982
|
|
|
@@ -1078,7 +1138,7 @@ var translations_default = [
|
|
|
1078
1138
|
"content fallback message": "Unsupported",
|
|
1079
1139
|
"content fallback description": "No plugin had a response for the address you navigated\xA0to. Double-check the URL, and ensure you\u2019ve enabled a plugin that supports the\xA0object.",
|
|
1080
1140
|
"toggle fullscreen label": "Toggle fullscreen",
|
|
1081
|
-
"settings show
|
|
1141
|
+
"settings show hints label": "Show hints",
|
|
1082
1142
|
"settings native redirect label": "Enable native url redirect (experimental)",
|
|
1083
1143
|
"settings custom slots": "Theme option (experimental)",
|
|
1084
1144
|
"settings new plank position start label": "Start",
|
|
@@ -1102,7 +1162,9 @@ var translations_default = [
|
|
|
1102
1162
|
"select overscroll placeholder": "Select plank overscrolling behavior",
|
|
1103
1163
|
"settings overscroll centering label": "Centering",
|
|
1104
1164
|
"settings overscroll none label": "None",
|
|
1105
|
-
"settings flat deck": "Flatten deck appearance"
|
|
1165
|
+
"settings flat deck": "Flatten deck appearance",
|
|
1166
|
+
"comments label": "Show Comments",
|
|
1167
|
+
"settings label": "Show Settings"
|
|
1106
1168
|
}
|
|
1107
1169
|
}
|
|
1108
1170
|
}
|
|
@@ -1132,7 +1194,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1132
1194
|
let currentUndoId;
|
|
1133
1195
|
let handleNavigation;
|
|
1134
1196
|
const settings = new LocalStorageStore("dxos.org/settings/layout", {
|
|
1135
|
-
|
|
1197
|
+
showHints: true,
|
|
1136
1198
|
customSlots: false,
|
|
1137
1199
|
flatDeck: false,
|
|
1138
1200
|
enableNativeRedirect: false,
|
|
@@ -1224,9 +1286,11 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1224
1286
|
const ids = (layout.values.layoutMode === "deck" ? next.main : next.solo)?.map(({ id }) => id) ?? [];
|
|
1225
1287
|
const isAttendedAvailable = !!attendedId && ids.includes(attendedId);
|
|
1226
1288
|
if (!isAttendedAvailable) {
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1289
|
+
requestAnimationFrame(() => {
|
|
1290
|
+
const nextAttended = layout.values.layoutMode === "solo" ? next.solo?.[0].id : next.main?.[0]?.id;
|
|
1291
|
+
const article = document.querySelector(`article[data-attendable-id="${nextAttended}"]`);
|
|
1292
|
+
article?.focus();
|
|
1293
|
+
});
|
|
1230
1294
|
}
|
|
1231
1295
|
}
|
|
1232
1296
|
location.values.active = next;
|
|
@@ -1271,8 +1335,8 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1271
1335
|
deck.expunge();
|
|
1272
1336
|
}));
|
|
1273
1337
|
settings.prop({
|
|
1274
|
-
key: "
|
|
1275
|
-
storageKey: "show-
|
|
1338
|
+
key: "showHints",
|
|
1339
|
+
storageKey: "show-hints",
|
|
1276
1340
|
type: LocalStorageStore.bool()
|
|
1277
1341
|
}).prop({
|
|
1278
1342
|
key: "customSlots",
|
|
@@ -1327,21 +1391,11 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1327
1391
|
};
|
|
1328
1392
|
await handleNavigation();
|
|
1329
1393
|
window.addEventListener("popstate", handleNavigation);
|
|
1330
|
-
unsubscriptionCallbacks.push(
|
|
1331
|
-
|
|
1394
|
+
unsubscriptionCallbacks.push(scheduledEffect(() => ({
|
|
1395
|
+
selectedPath: soloPartToUri(location.values.active)
|
|
1396
|
+
}), ({ selectedPath }) => {
|
|
1332
1397
|
history.pushState(null, "", `/${selectedPath}${window.location.search}`);
|
|
1333
1398
|
}));
|
|
1334
|
-
unsubscriptionCallbacks.push(effect(() => {
|
|
1335
|
-
const soloId = location.values.active.solo?.[0].id;
|
|
1336
|
-
if (layout.values.layoutMode === "solo" && soloId && layout.values.scrollIntoView !== soloId) {
|
|
1337
|
-
void intentPlugin?.provides.intent.dispatch({
|
|
1338
|
-
action: LayoutAction3.SCROLL_INTO_VIEW,
|
|
1339
|
-
data: {
|
|
1340
|
-
id: soloId
|
|
1341
|
-
}
|
|
1342
|
-
});
|
|
1343
|
-
}
|
|
1344
|
-
}));
|
|
1345
1399
|
layoutModeHistory.values.push(`${layout.values.layoutMode}`);
|
|
1346
1400
|
},
|
|
1347
1401
|
unload: async () => {
|
|
@@ -1403,7 +1457,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1403
1457
|
root: () => {
|
|
1404
1458
|
return /* @__PURE__ */ React15.createElement(DeckLayout, {
|
|
1405
1459
|
layoutParts: location.values.active,
|
|
1406
|
-
|
|
1460
|
+
showHints: settings.values.showHints,
|
|
1407
1461
|
overscroll: settings.values.overscroll,
|
|
1408
1462
|
flatDeck: settings.values.flatDeck,
|
|
1409
1463
|
slots: settings.values.customSlots ? customSlots : void 0,
|
|
@@ -1455,7 +1509,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1455
1509
|
} else {
|
|
1456
1510
|
log.warn("Invalid layout mode", intent?.data?.layoutMode, {
|
|
1457
1511
|
F: __dxlog_file,
|
|
1458
|
-
L:
|
|
1512
|
+
L: 404,
|
|
1459
1513
|
S: void 0,
|
|
1460
1514
|
C: (f, a) => f(...a)
|
|
1461
1515
|
});
|
|
@@ -1501,7 +1555,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1501
1555
|
data: true
|
|
1502
1556
|
};
|
|
1503
1557
|
}
|
|
1504
|
-
case
|
|
1558
|
+
case NavigationAction4.OPEN: {
|
|
1505
1559
|
const previouslyOpenIds = new Set(openIds2(location.values.active));
|
|
1506
1560
|
const layoutMode = layout.values.layoutMode;
|
|
1507
1561
|
batch(() => {
|
|
@@ -1558,7 +1612,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1558
1612
|
] : [],
|
|
1559
1613
|
intent.data?.object ? [
|
|
1560
1614
|
{
|
|
1561
|
-
action:
|
|
1615
|
+
action: NavigationAction4.EXPOSE,
|
|
1562
1616
|
data: {
|
|
1563
1617
|
id: fullyQualifiedId(intent.data.object)
|
|
1564
1618
|
}
|
|
@@ -1581,7 +1635,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1581
1635
|
]
|
|
1582
1636
|
};
|
|
1583
1637
|
}
|
|
1584
|
-
case
|
|
1638
|
+
case NavigationAction4.ADD_TO_ACTIVE: {
|
|
1585
1639
|
const data = intent.data;
|
|
1586
1640
|
const layoutEntry = {
|
|
1587
1641
|
id: data.id
|
|
@@ -1607,7 +1661,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1607
1661
|
intents
|
|
1608
1662
|
};
|
|
1609
1663
|
}
|
|
1610
|
-
case
|
|
1664
|
+
case NavigationAction4.CLOSE: {
|
|
1611
1665
|
return batch(() => {
|
|
1612
1666
|
if (!intent.data) {
|
|
1613
1667
|
return;
|
|
@@ -1639,7 +1693,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1639
1693
|
});
|
|
1640
1694
|
}
|
|
1641
1695
|
// TODO(wittjosiah): Factor out.
|
|
1642
|
-
case
|
|
1696
|
+
case NavigationAction4.SET: {
|
|
1643
1697
|
return batch(() => {
|
|
1644
1698
|
if (isLayoutParts(intent.data?.activeParts)) {
|
|
1645
1699
|
handleSetLocation(intent.data.activeParts);
|
|
@@ -1649,7 +1703,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1649
1703
|
};
|
|
1650
1704
|
});
|
|
1651
1705
|
}
|
|
1652
|
-
case
|
|
1706
|
+
case NavigationAction4.ADJUST: {
|
|
1653
1707
|
return batch(() => {
|
|
1654
1708
|
if (isLayoutAdjustment(intent.data)) {
|
|
1655
1709
|
const adjustment = intent.data;
|
|
@@ -1673,7 +1727,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1673
1727
|
}
|
|
1674
1728
|
},
|
|
1675
1729
|
{
|
|
1676
|
-
action:
|
|
1730
|
+
action: NavigationAction4.OPEN,
|
|
1677
1731
|
data: {
|
|
1678
1732
|
activeParts: {
|
|
1679
1733
|
solo: [
|
|
@@ -1697,7 +1751,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1697
1751
|
}
|
|
1698
1752
|
},
|
|
1699
1753
|
{
|
|
1700
|
-
action:
|
|
1754
|
+
action: NavigationAction4.CLOSE,
|
|
1701
1755
|
data: {
|
|
1702
1756
|
activeParts: {
|
|
1703
1757
|
solo: [
|
|
@@ -1707,7 +1761,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1707
1761
|
}
|
|
1708
1762
|
},
|
|
1709
1763
|
{
|
|
1710
|
-
action:
|
|
1764
|
+
action: NavigationAction4.OPEN,
|
|
1711
1765
|
data: {
|
|
1712
1766
|
noToggle: true,
|
|
1713
1767
|
activeParts: {
|