@dxos/plugin-deck 0.6.12-staging.e11e696 → 0.6.13-main.548ca8d
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 +138 -88
- 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/package.json +27 -26
- package/src/DeckPlugin.tsx +18 -24
- package/src/components/DeckLayout/ComplementarySidebar.tsx +51 -8
- package/src/components/DeckLayout/DeckLayout.tsx +18 -33
- package/src/components/DeckLayout/NodePlankHeading.tsx +4 -2
- package/src/components/DeckLayout/Plank.tsx +1 -1
- package/src/components/DeckLayout/StatusBar.tsx +10 -2
- 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/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,7 +25,7 @@ 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";
|
|
@@ -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
|
|
@@ -583,13 +641,18 @@ var Sidebar = ({ layoutParts }) => {
|
|
|
583
641
|
import React11 from "react";
|
|
584
642
|
import { Surface as Surface8 } from "@dxos/app-framework";
|
|
585
643
|
import { mainPadding, mx as mx4 } from "@dxos/react-ui-theme";
|
|
586
|
-
var StatusBar = () => {
|
|
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)
|
|
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
|
}));
|
|
@@ -668,14 +731,14 @@ var calculateOverscroll = (planks, plankSizing, sidebarOpen, complementarySideba
|
|
|
668
731
|
};
|
|
669
732
|
|
|
670
733
|
// packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
|
|
671
|
-
var DeckLayout = ({ layoutParts, toasts, flatDeck, overscroll,
|
|
734
|
+
var DeckLayout = ({ layoutParts, toasts, flatDeck, overscroll, showHints, slots, onDismissToast }) => {
|
|
672
735
|
const context = useLayout();
|
|
673
736
|
const { layoutMode, sidebarOpen, complementarySidebarOpen, dialogOpen, dialogContent, dialogBlockAlign, popoverOpen, popoverContent, popoverAnchorId } = context;
|
|
674
737
|
const { t } = useTranslation5(DECK_PLUGIN);
|
|
675
738
|
const { plankSizing } = useDeckContext();
|
|
676
739
|
const attended = useAttended3();
|
|
677
740
|
const searchPlugin = usePlugin("dxos.org/plugin/search");
|
|
678
|
-
const fullScreenSlug =
|
|
741
|
+
const fullScreenSlug = useMemo3(() => firstIdInPart(layoutParts, "fullScreen"), [
|
|
679
742
|
layoutParts
|
|
680
743
|
]);
|
|
681
744
|
const scrollLeftRef = useRef2();
|
|
@@ -716,21 +779,8 @@ var DeckLayout = ({ layoutParts, toasts, flatDeck, overscroll, showHintsFooter,
|
|
|
716
779
|
layoutMode,
|
|
717
780
|
firstAttendedId
|
|
718
781
|
]);
|
|
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(() => {
|
|
782
|
+
const isEmpty = layoutParts.main?.length === 0 && layoutParts.solo?.length === 0;
|
|
783
|
+
const padding = useMemo3(() => {
|
|
734
784
|
if (layoutMode === "deck" && overscroll === "centering") {
|
|
735
785
|
return calculateOverscroll(layoutParts.main, plankSizing, sidebarOpen, complementarySidebarOpen);
|
|
736
786
|
}
|
|
@@ -797,9 +847,9 @@ var DeckLayout = ({ layoutParts, toasts, flatDeck, overscroll, showHintsFooter,
|
|
|
797
847
|
context: "comments",
|
|
798
848
|
layoutParts,
|
|
799
849
|
flatDeck
|
|
800
|
-
}), /* @__PURE__ */ React13.createElement(Main3.Overlay, null),
|
|
850
|
+
}), /* @__PURE__ */ React13.createElement(Main3.Overlay, null), isEmpty && /* @__PURE__ */ React13.createElement(Main3.Content, {
|
|
801
851
|
handlesFocus: true
|
|
802
|
-
}, /* @__PURE__ */ React13.createElement(ContentEmpty, null)),
|
|
852
|
+
}, /* @__PURE__ */ React13.createElement(ContentEmpty, null)), !isEmpty && /* @__PURE__ */ React13.createElement(Main3.Content, {
|
|
803
853
|
bounce: true,
|
|
804
854
|
classNames: "grid block-end-[--statusbar-size]",
|
|
805
855
|
handlesFocus: true
|
|
@@ -816,20 +866,26 @@ var DeckLayout = ({ layoutParts, toasts, flatDeck, overscroll, showHintsFooter,
|
|
|
816
866
|
solo: layoutMode === "solo",
|
|
817
867
|
onScroll: handleScroll,
|
|
818
868
|
ref: deckRef
|
|
819
|
-
},
|
|
869
|
+
}, /* @__PURE__ */ React13.createElement(Plank, {
|
|
870
|
+
entry: layoutParts.solo?.[0] ?? {
|
|
871
|
+
id: "unknown-solo"
|
|
872
|
+
},
|
|
873
|
+
layoutParts,
|
|
874
|
+
part: "solo",
|
|
875
|
+
layoutMode,
|
|
876
|
+
flatDeck,
|
|
877
|
+
searchEnabled: !!searchPlugin
|
|
878
|
+
}), layoutParts.main?.map((layoutEntry) => /* @__PURE__ */ React13.createElement(Plank, {
|
|
820
879
|
key: layoutEntry.id,
|
|
821
880
|
entry: layoutEntry,
|
|
822
881
|
layoutParts,
|
|
823
|
-
part:
|
|
882
|
+
part: "main",
|
|
824
883
|
layoutMode,
|
|
825
884
|
flatDeck,
|
|
826
885
|
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, {
|
|
886
|
+
}))))), /* @__PURE__ */ React13.createElement(StatusBar, {
|
|
887
|
+
showHints
|
|
888
|
+
}), /* @__PURE__ */ React13.createElement(Popover2.Portal, null, /* @__PURE__ */ React13.createElement(Popover2.Content, {
|
|
833
889
|
classNames: "z-[60]",
|
|
834
890
|
onEscapeKeyDown: () => {
|
|
835
891
|
context.popoverOpen = false;
|
|
@@ -898,25 +954,25 @@ var LayoutSettings = ({ settings }) => {
|
|
|
898
954
|
key: option,
|
|
899
955
|
value: option
|
|
900
956
|
}, t(`settings overscroll ${option} label`)))))))), /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
901
|
-
label: t("settings show
|
|
957
|
+
label: t("settings show hints label")
|
|
902
958
|
}, /* @__PURE__ */ React14.createElement(Input.Switch, {
|
|
903
|
-
checked: settings.
|
|
904
|
-
onCheckedChange: (checked) => settings.
|
|
959
|
+
checked: settings.showHints,
|
|
960
|
+
onCheckedChange: (checked) => settings.showHints = checked
|
|
905
961
|
})), !isSocket && /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
906
962
|
label: t("settings native redirect label")
|
|
907
963
|
}, /* @__PURE__ */ React14.createElement(Input.Switch, {
|
|
908
964
|
checked: settings.enableNativeRedirect,
|
|
909
|
-
onCheckedChange: (checked) => settings.enableNativeRedirect =
|
|
965
|
+
onCheckedChange: (checked) => settings.enableNativeRedirect = checked
|
|
910
966
|
})), /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
911
967
|
label: t("settings custom slots")
|
|
912
968
|
}, /* @__PURE__ */ React14.createElement(Input.Switch, {
|
|
913
969
|
checked: settings.customSlots,
|
|
914
|
-
onCheckedChange: (checked) => settings.customSlots =
|
|
970
|
+
onCheckedChange: (checked) => settings.customSlots = checked
|
|
915
971
|
})), /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
916
972
|
label: t("settings flat deck")
|
|
917
973
|
}, /* @__PURE__ */ React14.createElement(Input.Switch, {
|
|
918
974
|
checked: settings.flatDeck,
|
|
919
|
-
onCheckedChange: (checked) => settings.flatDeck =
|
|
975
|
+
onCheckedChange: (checked) => settings.flatDeck = checked
|
|
920
976
|
})));
|
|
921
977
|
};
|
|
922
978
|
|
|
@@ -1078,7 +1134,7 @@ var translations_default = [
|
|
|
1078
1134
|
"content fallback message": "Unsupported",
|
|
1079
1135
|
"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
1136
|
"toggle fullscreen label": "Toggle fullscreen",
|
|
1081
|
-
"settings show
|
|
1137
|
+
"settings show hints label": "Show hints",
|
|
1082
1138
|
"settings native redirect label": "Enable native url redirect (experimental)",
|
|
1083
1139
|
"settings custom slots": "Theme option (experimental)",
|
|
1084
1140
|
"settings new plank position start label": "Start",
|
|
@@ -1102,7 +1158,9 @@ var translations_default = [
|
|
|
1102
1158
|
"select overscroll placeholder": "Select plank overscrolling behavior",
|
|
1103
1159
|
"settings overscroll centering label": "Centering",
|
|
1104
1160
|
"settings overscroll none label": "None",
|
|
1105
|
-
"settings flat deck": "Flatten deck appearance"
|
|
1161
|
+
"settings flat deck": "Flatten deck appearance",
|
|
1162
|
+
"comments label": "Show Comments",
|
|
1163
|
+
"settings label": "Show Settings"
|
|
1106
1164
|
}
|
|
1107
1165
|
}
|
|
1108
1166
|
}
|
|
@@ -1132,7 +1190,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1132
1190
|
let currentUndoId;
|
|
1133
1191
|
let handleNavigation;
|
|
1134
1192
|
const settings = new LocalStorageStore("dxos.org/settings/layout", {
|
|
1135
|
-
|
|
1193
|
+
showHints: true,
|
|
1136
1194
|
customSlots: false,
|
|
1137
1195
|
flatDeck: false,
|
|
1138
1196
|
enableNativeRedirect: false,
|
|
@@ -1224,9 +1282,11 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1224
1282
|
const ids = (layout.values.layoutMode === "deck" ? next.main : next.solo)?.map(({ id }) => id) ?? [];
|
|
1225
1283
|
const isAttendedAvailable = !!attendedId && ids.includes(attendedId);
|
|
1226
1284
|
if (!isAttendedAvailable) {
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1285
|
+
requestAnimationFrame(() => {
|
|
1286
|
+
const nextAttended = layout.values.layoutMode === "solo" ? next.solo?.[0].id : next.main?.[0]?.id;
|
|
1287
|
+
const article = document.querySelector(`article[data-attendable-id="${nextAttended}"]`);
|
|
1288
|
+
article?.focus();
|
|
1289
|
+
});
|
|
1230
1290
|
}
|
|
1231
1291
|
}
|
|
1232
1292
|
location.values.active = next;
|
|
@@ -1271,8 +1331,8 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1271
1331
|
deck.expunge();
|
|
1272
1332
|
}));
|
|
1273
1333
|
settings.prop({
|
|
1274
|
-
key: "
|
|
1275
|
-
storageKey: "show-
|
|
1334
|
+
key: "showHints",
|
|
1335
|
+
storageKey: "show-hints",
|
|
1276
1336
|
type: LocalStorageStore.bool()
|
|
1277
1337
|
}).prop({
|
|
1278
1338
|
key: "customSlots",
|
|
@@ -1327,21 +1387,11 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1327
1387
|
};
|
|
1328
1388
|
await handleNavigation();
|
|
1329
1389
|
window.addEventListener("popstate", handleNavigation);
|
|
1330
|
-
unsubscriptionCallbacks.push(
|
|
1331
|
-
|
|
1390
|
+
unsubscriptionCallbacks.push(scheduledEffect(() => ({
|
|
1391
|
+
selectedPath: soloPartToUri(location.values.active)
|
|
1392
|
+
}), ({ selectedPath }) => {
|
|
1332
1393
|
history.pushState(null, "", `/${selectedPath}${window.location.search}`);
|
|
1333
1394
|
}));
|
|
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
1395
|
layoutModeHistory.values.push(`${layout.values.layoutMode}`);
|
|
1346
1396
|
},
|
|
1347
1397
|
unload: async () => {
|
|
@@ -1403,7 +1453,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1403
1453
|
root: () => {
|
|
1404
1454
|
return /* @__PURE__ */ React15.createElement(DeckLayout, {
|
|
1405
1455
|
layoutParts: location.values.active,
|
|
1406
|
-
|
|
1456
|
+
showHints: settings.values.showHints,
|
|
1407
1457
|
overscroll: settings.values.overscroll,
|
|
1408
1458
|
flatDeck: settings.values.flatDeck,
|
|
1409
1459
|
slots: settings.values.customSlots ? customSlots : void 0,
|
|
@@ -1455,7 +1505,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1455
1505
|
} else {
|
|
1456
1506
|
log.warn("Invalid layout mode", intent?.data?.layoutMode, {
|
|
1457
1507
|
F: __dxlog_file,
|
|
1458
|
-
L:
|
|
1508
|
+
L: 404,
|
|
1459
1509
|
S: void 0,
|
|
1460
1510
|
C: (f, a) => f(...a)
|
|
1461
1511
|
});
|
|
@@ -1501,7 +1551,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1501
1551
|
data: true
|
|
1502
1552
|
};
|
|
1503
1553
|
}
|
|
1504
|
-
case
|
|
1554
|
+
case NavigationAction4.OPEN: {
|
|
1505
1555
|
const previouslyOpenIds = new Set(openIds2(location.values.active));
|
|
1506
1556
|
const layoutMode = layout.values.layoutMode;
|
|
1507
1557
|
batch(() => {
|
|
@@ -1558,7 +1608,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1558
1608
|
] : [],
|
|
1559
1609
|
intent.data?.object ? [
|
|
1560
1610
|
{
|
|
1561
|
-
action:
|
|
1611
|
+
action: NavigationAction4.EXPOSE,
|
|
1562
1612
|
data: {
|
|
1563
1613
|
id: fullyQualifiedId(intent.data.object)
|
|
1564
1614
|
}
|
|
@@ -1581,7 +1631,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1581
1631
|
]
|
|
1582
1632
|
};
|
|
1583
1633
|
}
|
|
1584
|
-
case
|
|
1634
|
+
case NavigationAction4.ADD_TO_ACTIVE: {
|
|
1585
1635
|
const data = intent.data;
|
|
1586
1636
|
const layoutEntry = {
|
|
1587
1637
|
id: data.id
|
|
@@ -1607,7 +1657,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1607
1657
|
intents
|
|
1608
1658
|
};
|
|
1609
1659
|
}
|
|
1610
|
-
case
|
|
1660
|
+
case NavigationAction4.CLOSE: {
|
|
1611
1661
|
return batch(() => {
|
|
1612
1662
|
if (!intent.data) {
|
|
1613
1663
|
return;
|
|
@@ -1639,7 +1689,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1639
1689
|
});
|
|
1640
1690
|
}
|
|
1641
1691
|
// TODO(wittjosiah): Factor out.
|
|
1642
|
-
case
|
|
1692
|
+
case NavigationAction4.SET: {
|
|
1643
1693
|
return batch(() => {
|
|
1644
1694
|
if (isLayoutParts(intent.data?.activeParts)) {
|
|
1645
1695
|
handleSetLocation(intent.data.activeParts);
|
|
@@ -1649,7 +1699,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1649
1699
|
};
|
|
1650
1700
|
});
|
|
1651
1701
|
}
|
|
1652
|
-
case
|
|
1702
|
+
case NavigationAction4.ADJUST: {
|
|
1653
1703
|
return batch(() => {
|
|
1654
1704
|
if (isLayoutAdjustment(intent.data)) {
|
|
1655
1705
|
const adjustment = intent.data;
|
|
@@ -1673,7 +1723,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1673
1723
|
}
|
|
1674
1724
|
},
|
|
1675
1725
|
{
|
|
1676
|
-
action:
|
|
1726
|
+
action: NavigationAction4.OPEN,
|
|
1677
1727
|
data: {
|
|
1678
1728
|
activeParts: {
|
|
1679
1729
|
solo: [
|
|
@@ -1697,7 +1747,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1697
1747
|
}
|
|
1698
1748
|
},
|
|
1699
1749
|
{
|
|
1700
|
-
action:
|
|
1750
|
+
action: NavigationAction4.CLOSE,
|
|
1701
1751
|
data: {
|
|
1702
1752
|
activeParts: {
|
|
1703
1753
|
solo: [
|
|
@@ -1707,7 +1757,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1707
1757
|
}
|
|
1708
1758
|
},
|
|
1709
1759
|
{
|
|
1710
|
-
action:
|
|
1760
|
+
action: NavigationAction4.OPEN,
|
|
1711
1761
|
data: {
|
|
1712
1762
|
noToggle: true,
|
|
1713
1763
|
activeParts: {
|