@dxos/plugin-deck 0.6.12-main.15a606f → 0.6.12-main.2d19bf1
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 +145 -85
- 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 +3 -4
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts +4 -3
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Sidebar.d.ts +2 -3
- package/dist/types/src/components/DeckLayout/Sidebar.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 +26 -26
- package/src/DeckPlugin.tsx +23 -28
- package/src/components/DeckLayout/ComplementarySidebar.tsx +59 -10
- package/src/components/DeckLayout/DeckLayout.tsx +9 -18
- package/src/components/DeckLayout/NodePlankHeading.tsx +10 -7
- package/src/components/DeckLayout/Plank.tsx +2 -2
- package/src/components/DeckLayout/Sidebar.tsx +6 -5
- 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,13 +1,13 @@
|
|
|
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
7
|
import { batch, effect } 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
12
|
import { LocalStorageStore } from "@dxos/local-storage";
|
|
13
13
|
import { log } from "@dxos/log";
|
|
@@ -17,7 +17,6 @@ import { createExtension } from "@dxos/plugin-graph";
|
|
|
17
17
|
import { ObservabilityAction } from "@dxos/plugin-observability/meta";
|
|
18
18
|
import { fullyQualifiedId } from "@dxos/react-client/echo";
|
|
19
19
|
import { translations as deckTranslations } from "@dxos/react-ui-deck";
|
|
20
|
-
import { Mosaic } from "@dxos/react-ui-mosaic";
|
|
21
20
|
|
|
22
21
|
// packages/plugins/plugin-deck/src/components/DeckLayout/constants.ts
|
|
23
22
|
var NAV_ID = "NavTree";
|
|
@@ -25,9 +24,10 @@ var SURFACE_PREFIX = "surface:";
|
|
|
25
24
|
|
|
26
25
|
// packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
|
|
27
26
|
import { Sidebar as MenuIcon } from "@phosphor-icons/react";
|
|
28
|
-
import React13, { useCallback as useCallback2, useEffect as useEffect5, useMemo as
|
|
27
|
+
import React13, { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo3, useRef as useRef2 } from "react";
|
|
29
28
|
import { Surface as Surface9, firstIdInPart, usePlugin } from "@dxos/app-framework";
|
|
30
29
|
import { Button as Button3, Dialog, Main as Main3, Popover as Popover2, useOnTransition, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
30
|
+
import { useAttended as useAttended3 } from "@dxos/react-ui-attention";
|
|
31
31
|
import { Deck } from "@dxos/react-ui-deck";
|
|
32
32
|
import { getSize } from "@dxos/react-ui-theme";
|
|
33
33
|
|
|
@@ -115,11 +115,11 @@ var ActiveNode = ({ id }) => {
|
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
// 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";
|
|
118
|
+
import React5, { useMemo } from "react";
|
|
119
|
+
import { NavigationAction as NavigationAction2, SLUG_PATH_SEPARATOR as SLUG_PATH_SEPARATOR2, Surface as Surface3, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
120
120
|
import { useGraph as useGraph3 } from "@dxos/plugin-graph";
|
|
121
121
|
import { Main } from "@dxos/react-ui";
|
|
122
|
-
import {
|
|
122
|
+
import { useAttended } from "@dxos/react-ui-attention";
|
|
123
123
|
import { deckGrid } from "@dxos/react-ui-deck";
|
|
124
124
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
125
125
|
|
|
@@ -130,17 +130,7 @@ import { useGraph as useGraph2 } from "@dxos/plugin-graph";
|
|
|
130
130
|
import { Icon, Popover, toLocalizedString, useMediaQuery, useTranslation } from "@dxos/react-ui";
|
|
131
131
|
import { PlankHeading } from "@dxos/react-ui-deck";
|
|
132
132
|
import { TextTooltip } from "@dxos/react-ui-text-tooltip";
|
|
133
|
-
var NodePlankHeading = ({
|
|
134
|
-
node,
|
|
135
|
-
id,
|
|
136
|
-
layoutParts,
|
|
137
|
-
layoutPart,
|
|
138
|
-
// TODO(wittjosiah): Unused?
|
|
139
|
-
layoutEntry,
|
|
140
|
-
popoverAnchorId,
|
|
141
|
-
pending,
|
|
142
|
-
flatDeck
|
|
143
|
-
}) => {
|
|
133
|
+
var NodePlankHeading = ({ node, id, layoutParts, layoutPart, popoverAnchorId, pending, flatDeck, actions = [] }) => {
|
|
144
134
|
const { t } = useTranslation(DECK_PLUGIN);
|
|
145
135
|
const { graph } = useGraph2();
|
|
146
136
|
const icon = node?.properties?.icon ?? "ph--placeholder--regular";
|
|
@@ -174,9 +164,13 @@ var NodePlankHeading = ({
|
|
|
174
164
|
classNames: "pie-1 border-b border-separator"
|
|
175
165
|
}, /* @__PURE__ */ React2.createElement(ActionRoot, null, node ? /* @__PURE__ */ React2.createElement(PlankHeading.ActionsMenu, {
|
|
176
166
|
icon,
|
|
167
|
+
related: layoutPart === "complementary",
|
|
177
168
|
attendableId,
|
|
178
169
|
triggerLabel: t("actions menu label"),
|
|
179
|
-
actions:
|
|
170
|
+
actions: [
|
|
171
|
+
actions,
|
|
172
|
+
graph.actions(node)
|
|
173
|
+
].filter((a) => a.length > 0),
|
|
180
174
|
onAction: (action) => typeof action.data === "function" && action.data?.({
|
|
181
175
|
node: action,
|
|
182
176
|
caller: DECK_PLUGIN
|
|
@@ -195,7 +189,8 @@ var NodePlankHeading = ({
|
|
|
195
189
|
text: label,
|
|
196
190
|
onlyWhenTruncating: true
|
|
197
191
|
}, /* @__PURE__ */ React2.createElement(PlankHeading.Label, {
|
|
198
|
-
attendableId
|
|
192
|
+
attendableId,
|
|
193
|
+
related: layoutPart === "complementary",
|
|
199
194
|
...pending && {
|
|
200
195
|
classNames: "text-description"
|
|
201
196
|
}
|
|
@@ -315,15 +310,79 @@ var LayoutContext = createContext(null);
|
|
|
315
310
|
var useLayout = () => useContext(LayoutContext) ?? raise(new Error("Missing LayoutContext"));
|
|
316
311
|
|
|
317
312
|
// packages/plugins/plugin-deck/src/components/DeckLayout/ComplementarySidebar.tsx
|
|
318
|
-
var
|
|
313
|
+
var panels = [
|
|
314
|
+
"comments",
|
|
315
|
+
"settings"
|
|
316
|
+
];
|
|
317
|
+
var getPanel = (part) => {
|
|
318
|
+
if (part && panels.findIndex((panel) => panel === part) !== -1) {
|
|
319
|
+
return part;
|
|
320
|
+
} else {
|
|
321
|
+
return "settings";
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
var ComplementarySidebar = ({ layoutParts, flatDeck }) => {
|
|
319
325
|
const { popoverAnchorId } = useLayout();
|
|
320
|
-
const attended =
|
|
321
|
-
const
|
|
326
|
+
const attended = useAttended();
|
|
327
|
+
const part = getPanel(layoutParts.complementary?.[0].id);
|
|
328
|
+
const id = attended[0] ? `${attended[0]}${SLUG_PATH_SEPARATOR2}${part}` : void 0;
|
|
322
329
|
const { graph } = useGraph3();
|
|
323
330
|
const node = useNode(graph, id);
|
|
324
|
-
const
|
|
331
|
+
const dispatch = useIntentDispatcher2();
|
|
325
332
|
useNodeActionExpander(node);
|
|
326
|
-
|
|
333
|
+
const actions = useMemo(() => [
|
|
334
|
+
{
|
|
335
|
+
id: "complementary-settings",
|
|
336
|
+
data: () => {
|
|
337
|
+
void dispatch({
|
|
338
|
+
action: NavigationAction2.OPEN,
|
|
339
|
+
data: {
|
|
340
|
+
activeParts: {
|
|
341
|
+
complementary: "settings"
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
},
|
|
346
|
+
properties: {
|
|
347
|
+
label: [
|
|
348
|
+
"settings label",
|
|
349
|
+
{
|
|
350
|
+
ns: DECK_PLUGIN
|
|
351
|
+
}
|
|
352
|
+
],
|
|
353
|
+
icon: "ph--gear--regular",
|
|
354
|
+
menuItemType: "toggle",
|
|
355
|
+
isChecked: part === "settings"
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
id: "complementary-comments",
|
|
360
|
+
data: () => {
|
|
361
|
+
void dispatch({
|
|
362
|
+
action: NavigationAction2.OPEN,
|
|
363
|
+
data: {
|
|
364
|
+
activeParts: {
|
|
365
|
+
complementary: "comments"
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
},
|
|
370
|
+
properties: {
|
|
371
|
+
label: [
|
|
372
|
+
"comments label",
|
|
373
|
+
{
|
|
374
|
+
ns: DECK_PLUGIN
|
|
375
|
+
}
|
|
376
|
+
],
|
|
377
|
+
icon: "ph--chat-text--regular",
|
|
378
|
+
menuItemType: "toggle",
|
|
379
|
+
isChecked: part === "comments"
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
], [
|
|
383
|
+
part
|
|
384
|
+
]);
|
|
385
|
+
return /* @__PURE__ */ React5.createElement(Main.ComplementarySidebar, null, /* @__PURE__ */ React5.createElement("div", {
|
|
327
386
|
role: "none",
|
|
328
387
|
className: mx2(deckGrid, "grid-cols-1 bs-full")
|
|
329
388
|
}, /* @__PURE__ */ React5.createElement(NodePlankHeading, {
|
|
@@ -332,12 +391,12 @@ var ComplementarySidebar = ({ context, layoutParts, flatDeck }) => {
|
|
|
332
391
|
layoutParts,
|
|
333
392
|
layoutPart: "complementary",
|
|
334
393
|
popoverAnchorId,
|
|
335
|
-
flatDeck
|
|
394
|
+
flatDeck,
|
|
395
|
+
actions
|
|
336
396
|
}), node && /* @__PURE__ */ React5.createElement(Surface3, {
|
|
337
|
-
role:
|
|
397
|
+
role: `complementary--${part}`,
|
|
338
398
|
data: {
|
|
339
|
-
subject: node.
|
|
340
|
-
part: "complementary",
|
|
399
|
+
subject: node.properties.object,
|
|
341
400
|
popoverAnchorId
|
|
342
401
|
},
|
|
343
402
|
limit: 1,
|
|
@@ -404,11 +463,11 @@ var Fullscreen = ({ id }) => {
|
|
|
404
463
|
// packages/plugins/plugin-deck/src/components/DeckLayout/Plank.tsx
|
|
405
464
|
import { Plus } from "@phosphor-icons/react";
|
|
406
465
|
import React9, { useCallback, useLayoutEffect, useRef } from "react";
|
|
407
|
-
import { LayoutAction as LayoutAction2, NavigationAction as
|
|
466
|
+
import { LayoutAction as LayoutAction2, NavigationAction as NavigationAction3, Surface as Surface6, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
408
467
|
import { debounce } from "@dxos/async";
|
|
409
468
|
import { useGraph as useGraph5 } from "@dxos/plugin-graph";
|
|
410
469
|
import { Button, Tooltip, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
411
|
-
import {
|
|
470
|
+
import { useAttendableAttributes } from "@dxos/react-ui-attention";
|
|
412
471
|
import { Plank as NaturalPlank } from "@dxos/react-ui-deck";
|
|
413
472
|
import { mainIntrinsicSize } from "@dxos/react-ui-theme";
|
|
414
473
|
|
|
@@ -421,14 +480,14 @@ var useDeckContext = () => useContext2(DeckContext) ?? raise2(new Error("Missing
|
|
|
421
480
|
// packages/plugins/plugin-deck/src/components/DeckLayout/Plank.tsx
|
|
422
481
|
var Plank = ({ entry, layoutParts, part, flatDeck, searchEnabled, layoutMode }) => {
|
|
423
482
|
const { t } = useTranslation4(DECK_PLUGIN);
|
|
424
|
-
const dispatch =
|
|
483
|
+
const dispatch = useIntentDispatcher3();
|
|
425
484
|
const { popoverAnchorId, scrollIntoView } = useLayout();
|
|
426
485
|
const { plankSizing } = useDeckContext();
|
|
427
486
|
const { graph } = useGraph5();
|
|
428
487
|
const node = useNode(graph, entry.id);
|
|
429
488
|
const rootElement = useRef(null);
|
|
430
489
|
const resizeable = layoutMode === "deck";
|
|
431
|
-
const attendableAttrs =
|
|
490
|
+
const attendableAttrs = useAttendableAttributes(entry.id);
|
|
432
491
|
const coordinate = {
|
|
433
492
|
part,
|
|
434
493
|
entryId: entry.id
|
|
@@ -532,7 +591,7 @@ var Plank = ({ entry, layoutParts, part, flatDeck, searchEnabled, layoutMode })
|
|
|
532
591
|
component: "dxos.org/plugin/search/Dialog",
|
|
533
592
|
dialogBlockAlign: "start",
|
|
534
593
|
subject: {
|
|
535
|
-
action:
|
|
594
|
+
action: NavigationAction3.SET,
|
|
536
595
|
position: "add-after",
|
|
537
596
|
coordinate
|
|
538
597
|
}
|
|
@@ -552,12 +611,14 @@ var Plank = ({ entry, layoutParts, part, flatDeck, searchEnabled, layoutMode })
|
|
|
552
611
|
};
|
|
553
612
|
|
|
554
613
|
// packages/plugins/plugin-deck/src/components/DeckLayout/Sidebar.tsx
|
|
555
|
-
import React10, { useMemo } from "react";
|
|
614
|
+
import React10, { useMemo as useMemo2 } from "react";
|
|
556
615
|
import { openIds, Surface as Surface7 } from "@dxos/app-framework";
|
|
557
616
|
import { Main as Main2 } from "@dxos/react-ui";
|
|
558
|
-
|
|
617
|
+
import { useAttended as useAttended2 } from "@dxos/react-ui-attention";
|
|
618
|
+
var Sidebar = ({ layoutParts }) => {
|
|
559
619
|
const { layoutMode, popoverAnchorId } = useLayout();
|
|
560
|
-
const
|
|
620
|
+
const attended = useAttended2();
|
|
621
|
+
const activeIds = useMemo2(() => {
|
|
561
622
|
if (layoutMode === "solo") {
|
|
562
623
|
return new Set(layoutParts?.solo?.map((e) => e.id) ?? []);
|
|
563
624
|
} else if (layoutMode === "deck") {
|
|
@@ -568,14 +629,14 @@ var Sidebar = ({ attention, layoutParts }) => {
|
|
|
568
629
|
layoutParts,
|
|
569
630
|
layoutMode
|
|
570
631
|
]);
|
|
571
|
-
const navigationData =
|
|
632
|
+
const navigationData = useMemo2(() => ({
|
|
572
633
|
popoverAnchorId,
|
|
573
634
|
activeIds,
|
|
574
|
-
attended
|
|
635
|
+
attended
|
|
575
636
|
}), [
|
|
576
637
|
popoverAnchorId,
|
|
577
638
|
activeIds,
|
|
578
|
-
|
|
639
|
+
attended
|
|
579
640
|
]);
|
|
580
641
|
return /* @__PURE__ */ React10.createElement(Main2.NavigationSidebar, null, /* @__PURE__ */ React10.createElement(Surface7, {
|
|
581
642
|
role: "navigation",
|
|
@@ -590,13 +651,18 @@ var Sidebar = ({ attention, layoutParts }) => {
|
|
|
590
651
|
import React11 from "react";
|
|
591
652
|
import { Surface as Surface8 } from "@dxos/app-framework";
|
|
592
653
|
import { mainPadding, mx as mx4 } from "@dxos/react-ui-theme";
|
|
593
|
-
var StatusBar = () => {
|
|
654
|
+
var StatusBar = ({ showHints }) => {
|
|
594
655
|
const sizeAttrs = useMainSize();
|
|
595
656
|
return /* @__PURE__ */ React11.createElement("div", {
|
|
596
657
|
role: "none",
|
|
597
658
|
...sizeAttrs,
|
|
598
|
-
className: mx4("fixed block-end-0 inset-inline-0 z-[2]", mainPadding)
|
|
599
|
-
}, /* @__PURE__ */ React11.createElement(
|
|
659
|
+
className: mx4("fixed flex justify-between block-end-0 inset-inline-0 items-center border-bs border-separator z-[2]", mainPadding)
|
|
660
|
+
}, /* @__PURE__ */ React11.createElement("div", {
|
|
661
|
+
role: "none"
|
|
662
|
+
}, showHints && /* @__PURE__ */ React11.createElement(Surface8, {
|
|
663
|
+
role: "hints",
|
|
664
|
+
limit: 1
|
|
665
|
+
})), /* @__PURE__ */ React11.createElement(Surface8, {
|
|
600
666
|
role: "status-bar",
|
|
601
667
|
limit: 1
|
|
602
668
|
}));
|
|
@@ -675,20 +741,21 @@ var calculateOverscroll = (planks, plankSizing, sidebarOpen, complementarySideba
|
|
|
675
741
|
};
|
|
676
742
|
|
|
677
743
|
// packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
|
|
678
|
-
var DeckLayout = ({ layoutParts,
|
|
744
|
+
var DeckLayout = ({ layoutParts, toasts, flatDeck, overscroll, showHints, slots, onDismissToast }) => {
|
|
679
745
|
const context = useLayout();
|
|
680
746
|
const { layoutMode, sidebarOpen, complementarySidebarOpen, dialogOpen, dialogContent, dialogBlockAlign, popoverOpen, popoverContent, popoverAnchorId } = context;
|
|
681
747
|
const { t } = useTranslation5(DECK_PLUGIN);
|
|
682
748
|
const { plankSizing } = useDeckContext();
|
|
749
|
+
const attended = useAttended3();
|
|
683
750
|
const searchPlugin = usePlugin("dxos.org/plugin/search");
|
|
684
|
-
const fullScreenSlug =
|
|
751
|
+
const fullScreenSlug = useMemo3(() => firstIdInPart(layoutParts, "fullScreen"), [
|
|
685
752
|
layoutParts
|
|
686
753
|
]);
|
|
687
754
|
const scrollLeftRef = useRef2();
|
|
688
755
|
const deckRef = useRef2(null);
|
|
689
756
|
useEffect5(() => {
|
|
690
757
|
const firstId = layoutMode === "solo" ? firstIdInPart(layoutParts, "solo") : firstIdInPart(layoutParts, "main");
|
|
691
|
-
if (
|
|
758
|
+
if (attended.length === 0 && firstId) {
|
|
692
759
|
document.querySelector(`article[data-attendable-id="${firstId}"] button`)?.focus();
|
|
693
760
|
}
|
|
694
761
|
}, []);
|
|
@@ -714,9 +781,7 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
714
781
|
}, [
|
|
715
782
|
layoutMode
|
|
716
783
|
]);
|
|
717
|
-
const firstAttendedId =
|
|
718
|
-
attention.attended
|
|
719
|
-
]);
|
|
784
|
+
const firstAttendedId = attended[0];
|
|
720
785
|
useEffect5(() => {
|
|
721
786
|
if (layoutMode === "deck" && firstAttendedId) {
|
|
722
787
|
}
|
|
@@ -724,7 +789,7 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
724
789
|
layoutMode,
|
|
725
790
|
firstAttendedId
|
|
726
791
|
]);
|
|
727
|
-
const parts =
|
|
792
|
+
const parts = useMemo3(() => {
|
|
728
793
|
const parts2 = [
|
|
729
794
|
...layoutParts.main ?? []
|
|
730
795
|
];
|
|
@@ -738,7 +803,7 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
738
803
|
layoutParts.main,
|
|
739
804
|
layoutParts.solo
|
|
740
805
|
]);
|
|
741
|
-
const padding =
|
|
806
|
+
const padding = useMemo3(() => {
|
|
742
807
|
if (layoutMode === "deck" && overscroll === "centering") {
|
|
743
808
|
return calculateOverscroll(layoutParts.main, plankSizing, sidebarOpen, complementarySidebarOpen);
|
|
744
809
|
}
|
|
@@ -800,7 +865,6 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
800
865
|
})), /* @__PURE__ */ React13.createElement(Surface9, {
|
|
801
866
|
role: "notch-end"
|
|
802
867
|
})), /* @__PURE__ */ React13.createElement(Sidebar, {
|
|
803
|
-
attention,
|
|
804
868
|
layoutParts
|
|
805
869
|
}), /* @__PURE__ */ React13.createElement(ComplementarySidebar, {
|
|
806
870
|
context: "comments",
|
|
@@ -833,12 +897,9 @@ var DeckLayout = ({ layoutParts, attention, toasts, flatDeck, overscroll, showHi
|
|
|
833
897
|
layoutMode,
|
|
834
898
|
flatDeck,
|
|
835
899
|
searchEnabled: !!searchPlugin
|
|
836
|
-
}))))), /* @__PURE__ */ React13.createElement(StatusBar,
|
|
837
|
-
|
|
838
|
-
}, /* @__PURE__ */ React13.createElement(
|
|
839
|
-
role: "hints",
|
|
840
|
-
limit: 1
|
|
841
|
-
})), /* @__PURE__ */ React13.createElement(Popover2.Portal, null, /* @__PURE__ */ React13.createElement(Popover2.Content, {
|
|
900
|
+
}))))), /* @__PURE__ */ React13.createElement(StatusBar, {
|
|
901
|
+
showHints
|
|
902
|
+
}), /* @__PURE__ */ React13.createElement(Popover2.Portal, null, /* @__PURE__ */ React13.createElement(Popover2.Content, {
|
|
842
903
|
classNames: "z-[60]",
|
|
843
904
|
onEscapeKeyDown: () => {
|
|
844
905
|
context.popoverOpen = false;
|
|
@@ -907,25 +968,25 @@ var LayoutSettings = ({ settings }) => {
|
|
|
907
968
|
key: option,
|
|
908
969
|
value: option
|
|
909
970
|
}, t(`settings overscroll ${option} label`)))))))), /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
910
|
-
label: t("settings show
|
|
971
|
+
label: t("settings show hints label")
|
|
911
972
|
}, /* @__PURE__ */ React14.createElement(Input.Switch, {
|
|
912
|
-
checked: settings.
|
|
913
|
-
onCheckedChange: (checked) => settings.
|
|
973
|
+
checked: settings.showHints,
|
|
974
|
+
onCheckedChange: (checked) => settings.showHints = checked
|
|
914
975
|
})), !isSocket && /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
915
976
|
label: t("settings native redirect label")
|
|
916
977
|
}, /* @__PURE__ */ React14.createElement(Input.Switch, {
|
|
917
978
|
checked: settings.enableNativeRedirect,
|
|
918
|
-
onCheckedChange: (checked) => settings.enableNativeRedirect =
|
|
979
|
+
onCheckedChange: (checked) => settings.enableNativeRedirect = checked
|
|
919
980
|
})), /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
920
981
|
label: t("settings custom slots")
|
|
921
982
|
}, /* @__PURE__ */ React14.createElement(Input.Switch, {
|
|
922
983
|
checked: settings.customSlots,
|
|
923
|
-
onCheckedChange: (checked) => settings.customSlots =
|
|
984
|
+
onCheckedChange: (checked) => settings.customSlots = checked
|
|
924
985
|
})), /* @__PURE__ */ React14.createElement(SettingsValue, {
|
|
925
986
|
label: t("settings flat deck")
|
|
926
987
|
}, /* @__PURE__ */ React14.createElement(Input.Switch, {
|
|
927
988
|
checked: settings.flatDeck,
|
|
928
|
-
onCheckedChange: (checked) => settings.flatDeck =
|
|
989
|
+
onCheckedChange: (checked) => settings.flatDeck = checked
|
|
929
990
|
})));
|
|
930
991
|
};
|
|
931
992
|
|
|
@@ -1087,7 +1148,7 @@ var translations_default = [
|
|
|
1087
1148
|
"content fallback message": "Unsupported",
|
|
1088
1149
|
"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.",
|
|
1089
1150
|
"toggle fullscreen label": "Toggle fullscreen",
|
|
1090
|
-
"settings show
|
|
1151
|
+
"settings show hints label": "Show hints",
|
|
1091
1152
|
"settings native redirect label": "Enable native url redirect (experimental)",
|
|
1092
1153
|
"settings custom slots": "Theme option (experimental)",
|
|
1093
1154
|
"settings new plank position start label": "Start",
|
|
@@ -1111,7 +1172,9 @@ var translations_default = [
|
|
|
1111
1172
|
"select overscroll placeholder": "Select plank overscrolling behavior",
|
|
1112
1173
|
"settings overscroll centering label": "Centering",
|
|
1113
1174
|
"settings overscroll none label": "None",
|
|
1114
|
-
"settings flat deck": "Flatten deck appearance"
|
|
1175
|
+
"settings flat deck": "Flatten deck appearance",
|
|
1176
|
+
"comments label": "Show Comments",
|
|
1177
|
+
"settings label": "Show Settings"
|
|
1115
1178
|
}
|
|
1116
1179
|
}
|
|
1117
1180
|
}
|
|
@@ -1141,7 +1204,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1141
1204
|
let currentUndoId;
|
|
1142
1205
|
let handleNavigation;
|
|
1143
1206
|
const settings = new LocalStorageStore("dxos.org/settings/layout", {
|
|
1144
|
-
|
|
1207
|
+
showHints: true,
|
|
1145
1208
|
customSlots: false,
|
|
1146
1209
|
flatDeck: false,
|
|
1147
1210
|
enableNativeRedirect: false,
|
|
@@ -1280,8 +1343,8 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1280
1343
|
deck.expunge();
|
|
1281
1344
|
}));
|
|
1282
1345
|
settings.prop({
|
|
1283
|
-
key: "
|
|
1284
|
-
storageKey: "show-
|
|
1346
|
+
key: "showHints",
|
|
1347
|
+
storageKey: "show-hints",
|
|
1285
1348
|
type: LocalStorageStore.bool()
|
|
1286
1349
|
}).prop({
|
|
1287
1350
|
key: "customSlots",
|
|
@@ -1410,12 +1473,9 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1410
1473
|
value: deck.values
|
|
1411
1474
|
}, props.children)),
|
|
1412
1475
|
root: () => {
|
|
1413
|
-
return /* @__PURE__ */ React15.createElement(
|
|
1414
|
-
attention: attentionPlugin?.provides.attention ?? {
|
|
1415
|
-
attended: /* @__PURE__ */ new Set()
|
|
1416
|
-
},
|
|
1476
|
+
return /* @__PURE__ */ React15.createElement(DeckLayout, {
|
|
1417
1477
|
layoutParts: location.values.active,
|
|
1418
|
-
|
|
1478
|
+
showHints: settings.values.showHints,
|
|
1419
1479
|
overscroll: settings.values.overscroll,
|
|
1420
1480
|
flatDeck: settings.values.flatDeck,
|
|
1421
1481
|
slots: settings.values.customSlots ? customSlots : void 0,
|
|
@@ -1431,7 +1491,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1431
1491
|
}, 1e3);
|
|
1432
1492
|
}
|
|
1433
1493
|
}
|
|
1434
|
-
})
|
|
1494
|
+
});
|
|
1435
1495
|
},
|
|
1436
1496
|
surface: {
|
|
1437
1497
|
component: ({ data, role }) => {
|
|
@@ -1467,7 +1527,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1467
1527
|
} else {
|
|
1468
1528
|
log.warn("Invalid layout mode", intent?.data?.layoutMode, {
|
|
1469
1529
|
F: __dxlog_file,
|
|
1470
|
-
L:
|
|
1530
|
+
L: 410,
|
|
1471
1531
|
S: void 0,
|
|
1472
1532
|
C: (f, a) => f(...a)
|
|
1473
1533
|
});
|
|
@@ -1513,7 +1573,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1513
1573
|
data: true
|
|
1514
1574
|
};
|
|
1515
1575
|
}
|
|
1516
|
-
case
|
|
1576
|
+
case NavigationAction4.OPEN: {
|
|
1517
1577
|
const previouslyOpenIds = new Set(openIds2(location.values.active));
|
|
1518
1578
|
const layoutMode = layout.values.layoutMode;
|
|
1519
1579
|
batch(() => {
|
|
@@ -1570,7 +1630,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1570
1630
|
] : [],
|
|
1571
1631
|
intent.data?.object ? [
|
|
1572
1632
|
{
|
|
1573
|
-
action:
|
|
1633
|
+
action: NavigationAction4.EXPOSE,
|
|
1574
1634
|
data: {
|
|
1575
1635
|
id: fullyQualifiedId(intent.data.object)
|
|
1576
1636
|
}
|
|
@@ -1593,7 +1653,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1593
1653
|
]
|
|
1594
1654
|
};
|
|
1595
1655
|
}
|
|
1596
|
-
case
|
|
1656
|
+
case NavigationAction4.ADD_TO_ACTIVE: {
|
|
1597
1657
|
const data = intent.data;
|
|
1598
1658
|
const layoutEntry = {
|
|
1599
1659
|
id: data.id
|
|
@@ -1619,7 +1679,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1619
1679
|
intents
|
|
1620
1680
|
};
|
|
1621
1681
|
}
|
|
1622
|
-
case
|
|
1682
|
+
case NavigationAction4.CLOSE: {
|
|
1623
1683
|
return batch(() => {
|
|
1624
1684
|
if (!intent.data) {
|
|
1625
1685
|
return;
|
|
@@ -1651,7 +1711,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1651
1711
|
});
|
|
1652
1712
|
}
|
|
1653
1713
|
// TODO(wittjosiah): Factor out.
|
|
1654
|
-
case
|
|
1714
|
+
case NavigationAction4.SET: {
|
|
1655
1715
|
return batch(() => {
|
|
1656
1716
|
if (isLayoutParts(intent.data?.activeParts)) {
|
|
1657
1717
|
handleSetLocation(intent.data.activeParts);
|
|
@@ -1661,7 +1721,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1661
1721
|
};
|
|
1662
1722
|
});
|
|
1663
1723
|
}
|
|
1664
|
-
case
|
|
1724
|
+
case NavigationAction4.ADJUST: {
|
|
1665
1725
|
return batch(() => {
|
|
1666
1726
|
if (isLayoutAdjustment(intent.data)) {
|
|
1667
1727
|
const adjustment = intent.data;
|
|
@@ -1685,7 +1745,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1685
1745
|
}
|
|
1686
1746
|
},
|
|
1687
1747
|
{
|
|
1688
|
-
action:
|
|
1748
|
+
action: NavigationAction4.OPEN,
|
|
1689
1749
|
data: {
|
|
1690
1750
|
activeParts: {
|
|
1691
1751
|
solo: [
|
|
@@ -1709,7 +1769,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1709
1769
|
}
|
|
1710
1770
|
},
|
|
1711
1771
|
{
|
|
1712
|
-
action:
|
|
1772
|
+
action: NavigationAction4.CLOSE,
|
|
1713
1773
|
data: {
|
|
1714
1774
|
activeParts: {
|
|
1715
1775
|
solo: [
|
|
@@ -1719,7 +1779,7 @@ var DeckPlugin = ({ observability } = {}) => {
|
|
|
1719
1779
|
}
|
|
1720
1780
|
},
|
|
1721
1781
|
{
|
|
1722
|
-
action:
|
|
1782
|
+
action: NavigationAction4.OPEN,
|
|
1723
1783
|
data: {
|
|
1724
1784
|
noToggle: true,
|
|
1725
1785
|
activeParts: {
|