@dxos/plugin-deck 0.8.4-main.5ad4a44 → 0.8.4-main.66e292d
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/{app-graph-builder-YYP67JHW.mjs → app-graph-builder-D74NTOMK.mjs} +8 -33
- package/dist/lib/browser/app-graph-builder-D74NTOMK.mjs.map +7 -0
- package/dist/lib/browser/{check-app-scheme-GCOL6YDT.mjs → check-app-scheme-HIEVFAAX.mjs} +2 -2
- package/dist/lib/browser/{chunk-HUWUYTOI.mjs → chunk-5KMJPIQC.mjs} +2 -2
- package/dist/lib/browser/{chunk-A4SRCSJX.mjs → chunk-F3VCCHVL.mjs} +5 -3
- package/dist/lib/browser/chunk-F3VCCHVL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YRDCQS7E.mjs → chunk-QKCGZ45E.mjs} +17 -16
- package/dist/lib/browser/chunk-QKCGZ45E.mjs.map +7 -0
- package/dist/lib/browser/chunk-UXLU6CMW.mjs +16 -0
- package/dist/lib/browser/chunk-UXLU6CMW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JH4ZCG5I.mjs → chunk-VBYJ664A.mjs} +8 -5
- package/dist/lib/browser/chunk-VBYJ664A.mjs.map +7 -0
- package/dist/lib/browser/{chunk-3SV2V3AN.mjs → chunk-VUJ6UNIJ.mjs} +384 -326
- package/dist/lib/browser/chunk-VUJ6UNIJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +7 -6
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-resolver-2NFDKRFG.mjs → intent-resolver-UA4YQGAC.mjs} +6 -6
- package/dist/lib/browser/{intent-resolver-2NFDKRFG.mjs.map → intent-resolver-UA4YQGAC.mjs.map} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-JTWYCDJT.mjs → react-root-JAMHKYWN.mjs} +9 -8
- package/dist/lib/browser/react-root-JAMHKYWN.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-PZKJ73JS.mjs → react-surface-6LW337ZT.mjs} +7 -7
- package/dist/lib/browser/{settings-JK7UIZSB.mjs → settings-SDPTOCCM.mjs} +5 -4
- package/dist/lib/browser/{settings-JK7UIZSB.mjs.map → settings-SDPTOCCM.mjs.map} +3 -3
- package/dist/lib/browser/state-7IFAGZQO.mjs +12 -0
- package/dist/lib/browser/toolkit-L5CFXJCF.mjs +52 -0
- package/dist/lib/browser/toolkit-L5CFXJCF.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/browser/{url-handler-MRYBE3HF.mjs → url-handler-QEYGYE2H.mjs} +4 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +3 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +21 -2
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -3
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +74 -0
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts +3 -0
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +5 -0
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +2 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +1 -0
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -33
- package/src/capabilities/app-graph-builder.ts +22 -22
- package/src/capabilities/intent-resolver.ts +0 -1
- package/src/capabilities/react-root.tsx +2 -1
- package/src/capabilities/settings.ts +1 -0
- package/src/capabilities/state.ts +8 -0
- package/src/capabilities/toolkit.ts +23 -14
- package/src/components/DeckLayout/ActiveNode.tsx +1 -1
- package/src/components/DeckLayout/Banner.tsx +1 -1
- package/src/components/DeckLayout/ContentEmpty.tsx +1 -1
- package/src/components/DeckLayout/DeckLayout.stories.tsx +63 -0
- package/src/components/DeckLayout/DeckLayout.tsx +8 -278
- package/src/components/DeckLayout/DeckMain.tsx +281 -0
- package/src/components/DeckLayout/Dialog.tsx +1 -1
- package/src/components/DeckLayout/Fallback.tsx +1 -1
- package/src/components/DeckLayout/Popover.tsx +4 -13
- package/src/components/DeckLayout/StatusBar.tsx +1 -1
- package/src/components/DeckLayout/Toast.tsx +26 -1
- package/src/components/DeckSettings/DeckSettings.tsx +6 -0
- package/src/components/Plank/Plank.tsx +65 -31
- package/src/components/Plank/PlankControls.tsx +3 -2
- package/src/components/Plank/PlankHeading.tsx +5 -4
- package/src/components/Sidebar/ComplementarySidebar.tsx +31 -11
- package/src/components/Sidebar/Sidebar.tsx +1 -1
- package/src/components/Sidebar/SidebarButton.tsx +10 -9
- package/src/hooks/useCompanions.ts +1 -1
- package/src/hooks/useDeckCompanions.ts +2 -1
- package/src/hooks/useHoistStatusbar.ts +5 -3
- package/src/meta.ts +5 -0
- package/src/translations.ts +2 -1
- package/src/types/schema.ts +2 -0
- package/dist/lib/browser/app-graph-builder-YYP67JHW.mjs.map +0 -7
- package/dist/lib/browser/chunk-3SV2V3AN.mjs.map +0 -7
- package/dist/lib/browser/chunk-A4SRCSJX.mjs.map +0 -7
- package/dist/lib/browser/chunk-JH4ZCG5I.mjs.map +0 -7
- package/dist/lib/browser/chunk-MHP4GPX5.mjs +0 -11
- package/dist/lib/browser/chunk-MHP4GPX5.mjs.map +0 -7
- package/dist/lib/browser/chunk-YRDCQS7E.mjs.map +0 -7
- package/dist/lib/browser/react-root-JTWYCDJT.mjs.map +0 -7
- package/dist/lib/browser/state-IFKFOBBX.mjs +0 -12
- package/dist/lib/browser/toolkit-L7C3UAEU.mjs +0 -63
- package/dist/lib/browser/toolkit-L7C3UAEU.mjs.map +0 -7
- /package/dist/lib/browser/{check-app-scheme-GCOL6YDT.mjs.map → check-app-scheme-HIEVFAAX.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-HUWUYTOI.mjs.map → chunk-5KMJPIQC.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-PZKJ73JS.mjs.map → react-surface-6LW337ZT.mjs.map} +0 -0
- /package/dist/lib/browser/{state-IFKFOBBX.mjs.map → state-7IFAGZQO.mjs.map} +0 -0
- /package/dist/lib/browser/{url-handler-MRYBE3HF.mjs.map → url-handler-QEYGYE2H.mjs.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useHoistStatusbar,
|
|
7
7
|
useMainSize,
|
|
8
8
|
useNodeActionExpander
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QKCGZ45E.mjs";
|
|
10
10
|
import {
|
|
11
11
|
calculateOverscroll,
|
|
12
12
|
layoutAppliesTopbar,
|
|
@@ -14,36 +14,40 @@ import {
|
|
|
14
14
|
} from "./chunk-CNTGBCMK.mjs";
|
|
15
15
|
import {
|
|
16
16
|
DeckCapabilities
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5KMJPIQC.mjs";
|
|
18
18
|
import {
|
|
19
19
|
DeckAction,
|
|
20
20
|
NewPlankPositions,
|
|
21
21
|
OverscrollOptions,
|
|
22
22
|
PLANK_COMPANION_TYPE,
|
|
23
23
|
getMode
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-F3VCCHVL.mjs";
|
|
25
25
|
import {
|
|
26
26
|
meta
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-UXLU6CMW.mjs";
|
|
28
28
|
|
|
29
29
|
// src/components/DeckLayout/Banner.tsx
|
|
30
30
|
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
31
31
|
import React9 from "react";
|
|
32
|
-
import { Surface as Surface5 } from "@dxos/app-framework";
|
|
32
|
+
import { Surface as Surface5 } from "@dxos/app-framework/react";
|
|
33
33
|
import { useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
34
|
-
import { mx as
|
|
34
|
+
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
35
35
|
|
|
36
36
|
// src/components/Sidebar/ComplementarySidebar.tsx
|
|
37
37
|
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
38
38
|
import React7, { Fragment as Fragment2, useCallback as useCallback5, useEffect as useEffect3, useMemo as useMemo3, useState as useState2 } from "react";
|
|
39
|
-
import { LayoutAction as LayoutAction4,
|
|
39
|
+
import { LayoutAction as LayoutAction4, createIntent as createIntent5 } from "@dxos/app-framework";
|
|
40
|
+
import { Surface as Surface3, useCapability as useCapability3, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework/react";
|
|
40
41
|
import { IconButton as IconButton4, Main, toLocalizedString as toLocalizedString2, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
41
42
|
import { Tabs } from "@dxos/react-ui-tabs";
|
|
43
|
+
import { mx as mx4 } from "@dxos/react-ui-theme";
|
|
42
44
|
|
|
43
45
|
// src/components/Plank/Plank.tsx
|
|
44
46
|
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
47
|
+
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
45
48
|
import React5, { memo as memo2, useCallback as useCallback3, useLayoutEffect, useMemo as useMemo2, useRef } from "react";
|
|
46
|
-
import { LayoutAction as LayoutAction2,
|
|
49
|
+
import { LayoutAction as LayoutAction2, createIntent as createIntent3 } from "@dxos/app-framework";
|
|
50
|
+
import { Surface as Surface2, useAppGraph as useAppGraph2, useCapability, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework/react";
|
|
47
51
|
import { debounce } from "@dxos/async";
|
|
48
52
|
import { useNode } from "@dxos/plugin-graph";
|
|
49
53
|
import { ATTENDABLE_PATH_SEPARATOR, useAttentionAttributes } from "@dxos/react-ui-attention";
|
|
@@ -59,7 +63,8 @@ import { descriptionMessage, mx as mx2 } from "@dxos/react-ui-theme";
|
|
|
59
63
|
// src/components/Plank/PlankHeading.tsx
|
|
60
64
|
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
61
65
|
import React2, { Fragment, memo, useCallback as useCallback2, useEffect, useMemo } from "react";
|
|
62
|
-
import { LayoutAction,
|
|
66
|
+
import { LayoutAction, createIntent as createIntent2 } from "@dxos/app-framework";
|
|
67
|
+
import { Surface, useAppGraph, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework/react";
|
|
63
68
|
import { Icon, IconButton as IconButton2, Popover, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
64
69
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
65
70
|
import { TextTooltip } from "@dxos/react-ui-text-tooltip";
|
|
@@ -75,7 +80,8 @@ var fixedComplementarySidebarToggleStyles = mx(sidebarToggleStyles, "inline-end-
|
|
|
75
80
|
// src/components/Plank/PlankControls.tsx
|
|
76
81
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
77
82
|
import React, { forwardRef, useCallback } from "react";
|
|
78
|
-
import { createIntent
|
|
83
|
+
import { createIntent } from "@dxos/app-framework";
|
|
84
|
+
import { useIntentDispatcher } from "@dxos/app-framework/react";
|
|
79
85
|
import { invariant } from "@dxos/invariant";
|
|
80
86
|
import { ButtonGroup, IconButton, useTranslation } from "@dxos/react-ui";
|
|
81
87
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/components/Plank/PlankControls.tsx";
|
|
@@ -83,10 +89,9 @@ var PlankControl = ({ icon, label: label3, ...props }) => {
|
|
|
83
89
|
var _effect = _useSignals();
|
|
84
90
|
try {
|
|
85
91
|
return /* @__PURE__ */ React.createElement(IconButton, {
|
|
86
|
-
iconOnly: true,
|
|
87
92
|
label: label3,
|
|
88
93
|
icon,
|
|
89
|
-
|
|
94
|
+
iconOnly: true,
|
|
90
95
|
variant: "ghost",
|
|
91
96
|
tooltipSide: "bottom",
|
|
92
97
|
...props
|
|
@@ -104,7 +109,7 @@ var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedR
|
|
|
104
109
|
const handleCloseCompanion = useCallback(() => {
|
|
105
110
|
invariant(primary, void 0, {
|
|
106
111
|
F: __dxlog_file,
|
|
107
|
-
L:
|
|
112
|
+
L: 50,
|
|
108
113
|
S: void 0,
|
|
109
114
|
A: [
|
|
110
115
|
"primary",
|
|
@@ -318,7 +323,8 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
318
323
|
...layoutMode === "solo--fullscreen" ? [
|
|
319
324
|
hoverableControls,
|
|
320
325
|
hoverableFocusedWithinControls,
|
|
321
|
-
"*:transition-opacity *:opacity-[--controls-opacity] bg-transparent border-transparent transition-[background-color,border-color]
|
|
326
|
+
"*:transition-opacity *:opacity-[--controls-opacity] bg-transparent border-transparent transition-[background-color,border-color]",
|
|
327
|
+
"hover-hover:hover:bg-headerSurface focus-within:bg-headerSurface hover-hover:hover:border-subduedSeparator focus-within:border-subduedSeparator"
|
|
322
328
|
] : []
|
|
323
329
|
],
|
|
324
330
|
"data-plank-heading": true
|
|
@@ -333,7 +339,6 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
333
339
|
icon: icon2,
|
|
334
340
|
iconOnly: companions.length > MAX_COMPANIONS && node?.id !== id2,
|
|
335
341
|
label: toLocalizedString(label4, t),
|
|
336
|
-
size: 5,
|
|
337
342
|
variant: node?.id === id2 ? "primary" : "ghost",
|
|
338
343
|
onClick: handleTabClick
|
|
339
344
|
})))
|
|
@@ -352,8 +357,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
352
357
|
})) : /* @__PURE__ */ React2.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React2.createElement("span", {
|
|
353
358
|
className: "sr-only"
|
|
354
359
|
}, label3), /* @__PURE__ */ React2.createElement(Icon, {
|
|
355
|
-
icon
|
|
356
|
-
size: 5
|
|
360
|
+
icon
|
|
357
361
|
}))), /* @__PURE__ */ React2.createElement(TextTooltip, {
|
|
358
362
|
text: label3,
|
|
359
363
|
onlyWhenTruncating: true
|
|
@@ -445,7 +449,8 @@ var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, companionId, ...props }) =
|
|
|
445
449
|
const hasCompanion = !!(companionId && currentCompanion);
|
|
446
450
|
return /* @__PURE__ */ React5.createElement(PlankContainer, {
|
|
447
451
|
solo: props.part === "solo",
|
|
448
|
-
companion: hasCompanion
|
|
452
|
+
companion: hasCompanion,
|
|
453
|
+
encapsulate: !!props.settings?.encapsulatedPlanks
|
|
449
454
|
}, /* @__PURE__ */ React5.createElement(PlankComponent, {
|
|
450
455
|
id,
|
|
451
456
|
node,
|
|
@@ -472,7 +477,7 @@ var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, companionId, ...props }) =
|
|
|
472
477
|
_effect.f();
|
|
473
478
|
}
|
|
474
479
|
});
|
|
475
|
-
var PlankContainer = ({ children, solo, companion }) => {
|
|
480
|
+
var PlankContainer = ({ children, solo, companion, encapsulate }) => {
|
|
476
481
|
var _effect = _useSignals5();
|
|
477
482
|
try {
|
|
478
483
|
const sizeAttrs = useMainSize();
|
|
@@ -481,7 +486,8 @@ var PlankContainer = ({ children, solo, companion }) => {
|
|
|
481
486
|
}
|
|
482
487
|
return /* @__PURE__ */ React5.createElement("div", {
|
|
483
488
|
role: "none",
|
|
484
|
-
|
|
489
|
+
"data-popover-collision-boundary": true,
|
|
490
|
+
className: mx3("absolute inset-[--main-spacing] grid", encapsulate && "border border-separator rounded overflow-hidden", companion && "grid-cols-[6fr_4fr]", railGridHorizontal, mainIntrinsicSize),
|
|
485
491
|
...sizeAttrs
|
|
486
492
|
}, children);
|
|
487
493
|
} finally {
|
|
@@ -493,6 +499,7 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
493
499
|
try {
|
|
494
500
|
const { dispatchPromise: dispatch } = useIntentDispatcher3();
|
|
495
501
|
const { deck, popoverAnchorId, scrollIntoView } = useCapability(DeckCapabilities.DeckState);
|
|
502
|
+
const { findFirstFocusable } = useFocusFinders();
|
|
496
503
|
const canResize = layoutMode === "deck";
|
|
497
504
|
const attentionAttrs = useAttentionAttributes(primary?.id ?? id);
|
|
498
505
|
const index = active ? active.findIndex((entryId) => entryId === id) : 0;
|
|
@@ -513,8 +520,15 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
513
520
|
sizeKey
|
|
514
521
|
]);
|
|
515
522
|
const handleKeyDown = useCallback3((event) => {
|
|
516
|
-
if (event.target === event.currentTarget
|
|
517
|
-
|
|
523
|
+
if (event.target === event.currentTarget) {
|
|
524
|
+
switch (event.key) {
|
|
525
|
+
case "Escape":
|
|
526
|
+
rootElement.current?.closest("main")?.focus();
|
|
527
|
+
break;
|
|
528
|
+
case "Enter":
|
|
529
|
+
rootElement.current && findFirstFocusable(rootElement.current)?.focus();
|
|
530
|
+
break;
|
|
531
|
+
}
|
|
518
532
|
}
|
|
519
533
|
}, []);
|
|
520
534
|
useLayoutEffect(() => {
|
|
@@ -555,10 +569,12 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
555
569
|
]);
|
|
556
570
|
const placeholder = useMemo2(() => /* @__PURE__ */ React5.createElement(PlankLoading, null), []);
|
|
557
571
|
const Root = part.startsWith("solo") ? "article" : StackItem2.Root;
|
|
558
|
-
const
|
|
572
|
+
const fullscreen = layoutMode === "solo--fullscreen";
|
|
573
|
+
const className = mx3("attention-surface relative dx-focus-ring-inset-over-all density-coarse", isSolo && "absolute inset-0", isSolo && mainIntrinsicSize, railGridHorizontal, part.startsWith("solo") && "grid", part.startsWith("solo-") && "grid-rows-subgrid row-span-2 min-is-0", fullscreen && "grid-rows-1", part === "deck" && (companioned === "companion" ? "!border-separator border-ie" : "!border-separator border-li"), part === "solo-companion" && "!border-separator border-is", settings?.encapsulatedPlanks && !part.startsWith("solo") && "mli-[--main-spacing] !border-separator border rounded overflow-hidden");
|
|
559
574
|
return /* @__PURE__ */ React5.createElement(Root, {
|
|
560
575
|
ref: rootElement,
|
|
561
576
|
"data-testid": "deck.plank",
|
|
577
|
+
"data-popover-collision-boundary": true,
|
|
562
578
|
tabIndex: 0,
|
|
563
579
|
...part.startsWith("solo") ? {
|
|
564
580
|
...sizeAttrs,
|
|
@@ -575,7 +591,7 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
575
591
|
},
|
|
576
592
|
...isAttendable ? attentionAttrs : {},
|
|
577
593
|
onKeyDown: handleKeyDown
|
|
578
|
-
}, node ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(PlankHeading, {
|
|
594
|
+
}, node ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, !fullscreen && /* @__PURE__ */ React5.createElement(PlankHeading, {
|
|
579
595
|
id,
|
|
580
596
|
part: part.startsWith("solo-") ? "solo" : part,
|
|
581
597
|
node,
|
|
@@ -606,7 +622,8 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
606
622
|
// src/components/Sidebar/SidebarButton.tsx
|
|
607
623
|
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
608
624
|
import React6, { useCallback as useCallback4 } from "react";
|
|
609
|
-
import { LayoutAction as LayoutAction3, createIntent as createIntent4
|
|
625
|
+
import { LayoutAction as LayoutAction3, createIntent as createIntent4 } from "@dxos/app-framework";
|
|
626
|
+
import { useCapability as useCapability2, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework/react";
|
|
610
627
|
import { IconButton as IconButton3, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
611
628
|
var ToggleSidebarButton = ({ classNames, variant = "ghost" }) => {
|
|
612
629
|
var _effect = _useSignals6();
|
|
@@ -615,8 +632,8 @@ var ToggleSidebarButton = ({ classNames, variant = "ghost" }) => {
|
|
|
615
632
|
const { t } = useTranslation4(meta.id);
|
|
616
633
|
return /* @__PURE__ */ React6.createElement(IconButton3, {
|
|
617
634
|
variant,
|
|
618
|
-
iconOnly: true,
|
|
619
635
|
icon: "ph--sidebar--regular",
|
|
636
|
+
iconOnly: true,
|
|
620
637
|
size: 4,
|
|
621
638
|
label: t("open navigation sidebar label"),
|
|
622
639
|
onClick: () => layoutContext.sidebarState = layoutContext.sidebarState === "expanded" ? "collapsed" : "expanded",
|
|
@@ -633,8 +650,8 @@ var CloseSidebarButton = () => {
|
|
|
633
650
|
const { t } = useTranslation4(meta.id);
|
|
634
651
|
return /* @__PURE__ */ React6.createElement(IconButton3, {
|
|
635
652
|
variant: "ghost",
|
|
636
|
-
iconOnly: true,
|
|
637
653
|
icon: "ph--caret-line-left--regular",
|
|
654
|
+
iconOnly: true,
|
|
638
655
|
size: 4,
|
|
639
656
|
label: t("close navigation sidebar label"),
|
|
640
657
|
onClick: () => layoutContext.sidebarState = "collapsed",
|
|
@@ -653,11 +670,11 @@ var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
|
|
|
653
670
|
const companions = useDeckCompanions();
|
|
654
671
|
const handleClick = useCallback4(async () => {
|
|
655
672
|
layoutContext.complementarySidebarState = layoutContext.complementarySidebarState === "expanded" ? "collapsed" : "expanded";
|
|
656
|
-
const
|
|
657
|
-
if (layoutContext.complementarySidebarState === "expanded" && !current &&
|
|
673
|
+
const subject = layoutContext.complementarySidebarPanel ?? (companions[0] && getCompanionId(companions[0].id));
|
|
674
|
+
if (layoutContext.complementarySidebarState === "expanded" && !current && subject) {
|
|
658
675
|
await dispatch(createIntent4(LayoutAction3.UpdateComplementary, {
|
|
659
676
|
part: "complementary",
|
|
660
|
-
subject
|
|
677
|
+
subject
|
|
661
678
|
}));
|
|
662
679
|
}
|
|
663
680
|
}, [
|
|
@@ -667,17 +684,17 @@ var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
|
|
|
667
684
|
dispatch
|
|
668
685
|
]);
|
|
669
686
|
return /* @__PURE__ */ React6.createElement(IconButton3, {
|
|
670
|
-
iconOnly: true,
|
|
671
|
-
onClick: handleClick,
|
|
672
687
|
variant: "ghost",
|
|
673
|
-
label: t("open complementary sidebar label"),
|
|
674
688
|
classNames: [
|
|
675
689
|
"[&>svg]:-scale-x-100",
|
|
676
690
|
classNames
|
|
677
691
|
],
|
|
678
692
|
icon: "ph--sidebar-simple--regular",
|
|
693
|
+
iconOnly: true,
|
|
694
|
+
label: t("open complementary sidebar label"),
|
|
679
695
|
size: inR0 ? 5 : 4,
|
|
680
|
-
tooltipSide: inR0 ? "left" : void 0
|
|
696
|
+
tooltipSide: inR0 ? "left" : void 0,
|
|
697
|
+
onClick: handleClick
|
|
681
698
|
});
|
|
682
699
|
} finally {
|
|
683
700
|
_effect.f();
|
|
@@ -760,7 +777,7 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
760
777
|
classNames: "contents"
|
|
761
778
|
}, /* @__PURE__ */ React7.createElement("div", {
|
|
762
779
|
role: "none",
|
|
763
|
-
className: "absolute z-[1] inset-block-0 inline-end-0 !is-[--r0-size] pbs-[env(safe-area-inset-top)] pbe-[env(safe-area-inset-bottom)] border-is border-subduedSeparator grid grid-cols-1 grid-rows-[1fr_min-content] bg-baseSurface contain-layout app-drag"
|
|
780
|
+
className: mx4("absolute z-[1] inset-block-0 inline-end-0 !is-[--r0-size]", "pbs-[env(safe-area-inset-top)] pbe-[env(safe-area-inset-bottom)] border-is border-subduedSeparator", "grid grid-cols-1 grid-rows-[1fr_min-content] bg-baseSurface contain-layout app-drag")
|
|
764
781
|
}, /* @__PURE__ */ React7.createElement(Tabs.Tablist, {
|
|
765
782
|
classNames: "grid grid-cols-1 auto-rows-[--rail-action] p-1 gap-1 !overflow-y-auto"
|
|
766
783
|
}, companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tab, {
|
|
@@ -770,7 +787,6 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
770
787
|
}, /* @__PURE__ */ React7.createElement(IconButton4, {
|
|
771
788
|
label: toLocalizedString2(companion.properties.label, t),
|
|
772
789
|
icon: companion.properties.icon,
|
|
773
|
-
size: 5,
|
|
774
790
|
iconOnly: true,
|
|
775
791
|
tooltipSide: "left",
|
|
776
792
|
"data-value": getCompanionId(companion.id),
|
|
@@ -788,7 +804,11 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
788
804
|
}, /* @__PURE__ */ React7.createElement(ToggleComplementarySidebarButton, null))), activeId && companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tabpanel, {
|
|
789
805
|
key: getCompanionId(companion.id),
|
|
790
806
|
value: getCompanionId(companion.id),
|
|
791
|
-
classNames:
|
|
807
|
+
classNames: [
|
|
808
|
+
'absolute data-[state="inactive"]:-z-[1] overflow-hidden',
|
|
809
|
+
"inset-block-0 inline-start-0 is-[calc(100%-var(--r0-size))] lg:is-[--r1-size]",
|
|
810
|
+
"grid grid-cols-1 grid-rows-[var(--rail-size)_1fr_min-content] pbs-[env(safe-area-inset-top)]"
|
|
811
|
+
],
|
|
792
812
|
...layout.complementarySidebarState !== "expanded" && {
|
|
793
813
|
inert: true
|
|
794
814
|
}
|
|
@@ -802,16 +822,6 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
802
822
|
_effect.f();
|
|
803
823
|
}
|
|
804
824
|
};
|
|
805
|
-
var ScrollArea = ({ children }) => {
|
|
806
|
-
var _effect = _useSignals7();
|
|
807
|
-
try {
|
|
808
|
-
return /* @__PURE__ */ React7.createElement("div", {
|
|
809
|
-
className: "flex flex-col grow overflow-x-hidden overflow-y-auto scrollbar-thin"
|
|
810
|
-
}, children);
|
|
811
|
-
} finally {
|
|
812
|
-
_effect.f();
|
|
813
|
-
}
|
|
814
|
-
};
|
|
815
825
|
var ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }) => {
|
|
816
826
|
var _effect = _useSignals7();
|
|
817
827
|
try {
|
|
@@ -820,9 +830,21 @@ var ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar })
|
|
|
820
830
|
return null;
|
|
821
831
|
}
|
|
822
832
|
const Wrapper = companion.properties.fixed ? Fragment2 : ScrollArea;
|
|
823
|
-
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("
|
|
824
|
-
|
|
825
|
-
|
|
833
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("div", {
|
|
834
|
+
role: "none",
|
|
835
|
+
className: "flex items-center p-1 gap-1 border-be border-subduedSeparator"
|
|
836
|
+
}, /* @__PURE__ */ React7.createElement(IconButton4, {
|
|
837
|
+
label: toLocalizedString2(companion.properties.label, t),
|
|
838
|
+
icon: companion.properties.icon,
|
|
839
|
+
iconOnly: true,
|
|
840
|
+
tooltipSide: "left",
|
|
841
|
+
"data-value": getCompanionId(companion.id),
|
|
842
|
+
classNames: "bs-10 is-10",
|
|
843
|
+
variant: "default"
|
|
844
|
+
}), /* @__PURE__ */ React7.createElement("div", {
|
|
845
|
+
role: "none",
|
|
846
|
+
className: "pli-1"
|
|
847
|
+
}, toLocalizedString2(companion.properties.label, t))), /* @__PURE__ */ React7.createElement(Wrapper, null, /* @__PURE__ */ React7.createElement(Surface3, {
|
|
826
848
|
role: `deck-companion--${getCompanionId(companion.id)}`,
|
|
827
849
|
data,
|
|
828
850
|
fallback: PlankContentError,
|
|
@@ -838,11 +860,21 @@ var ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar })
|
|
|
838
860
|
_effect.f();
|
|
839
861
|
}
|
|
840
862
|
};
|
|
863
|
+
var ScrollArea = ({ children }) => {
|
|
864
|
+
var _effect = _useSignals7();
|
|
865
|
+
try {
|
|
866
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
867
|
+
className: "flex flex-col grow overflow-x-hidden overflow-y-auto scrollbar-thin"
|
|
868
|
+
}, children);
|
|
869
|
+
} finally {
|
|
870
|
+
_effect.f();
|
|
871
|
+
}
|
|
872
|
+
};
|
|
841
873
|
|
|
842
874
|
// src/components/Sidebar/Sidebar.tsx
|
|
843
875
|
import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
|
|
844
876
|
import React8, { useMemo as useMemo4 } from "react";
|
|
845
|
-
import { Surface as Surface4, useCapability as useCapability4 } from "@dxos/app-framework";
|
|
877
|
+
import { Surface as Surface4, useCapability as useCapability4 } from "@dxos/app-framework/react";
|
|
846
878
|
import { Main as Main2 } from "@dxos/react-ui";
|
|
847
879
|
var label2 = [
|
|
848
880
|
"sidebar title",
|
|
@@ -892,7 +924,7 @@ var Banner = ({ variant, classNames }) => {
|
|
|
892
924
|
try {
|
|
893
925
|
const { t } = useTranslation6(meta.id);
|
|
894
926
|
return /* @__PURE__ */ React9.createElement("header", {
|
|
895
|
-
className:
|
|
927
|
+
className: mx5("flex items-stretch relative plb-1 pis-1 pie-2", variant === "topbar" && "fixed inset-inline-0 block-start-[env(safe-area-inset-top)] bs-[--rail-size] border-be border-separator", classNames)
|
|
896
928
|
}, variant === "sidebar" ? /* @__PURE__ */ React9.createElement(CloseSidebarButton, null) : /* @__PURE__ */ React9.createElement(ToggleSidebarButton, null), /* @__PURE__ */ React9.createElement("span", {
|
|
897
929
|
className: "self-center grow mis-1"
|
|
898
930
|
}, t("current app name", {
|
|
@@ -922,19 +954,14 @@ var Banner = ({ variant, classNames }) => {
|
|
|
922
954
|
};
|
|
923
955
|
|
|
924
956
|
// src/components/DeckLayout/DeckLayout.tsx
|
|
925
|
-
import { useSignals as
|
|
926
|
-
import
|
|
927
|
-
import
|
|
928
|
-
import { Capabilities, LayoutAction as LayoutAction5, createIntent as createIntent6, useCapability as useCapability8, useIntentDispatcher as useIntentDispatcher6, usePluginManager } from "@dxos/app-framework";
|
|
929
|
-
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
930
|
-
import { Main as Main3, useMediaQuery, useOnTransition } from "@dxos/react-ui";
|
|
931
|
-
import { DEFAULT_HORIZONTAL_SIZE, Stack, StackContext } from "@dxos/react-ui-stack";
|
|
932
|
-
import { mainPaddingTransitions } from "@dxos/react-ui-theme";
|
|
957
|
+
import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
|
|
958
|
+
import React18 from "react";
|
|
959
|
+
import { useCapability as useCapability9 } from "@dxos/app-framework/react";
|
|
933
960
|
|
|
934
961
|
// src/components/DeckLayout/ActiveNode.tsx
|
|
935
962
|
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
936
963
|
import React10 from "react";
|
|
937
|
-
import { Surface as Surface6, useAppGraph as useAppGraph3 } from "@dxos/app-framework";
|
|
964
|
+
import { Surface as Surface6, useAppGraph as useAppGraph3 } from "@dxos/app-framework/react";
|
|
938
965
|
import { useNode as useNode2 } from "@dxos/plugin-graph";
|
|
939
966
|
import { useAttended } from "@dxos/react-ui-attention";
|
|
940
967
|
var ActiveNode = () => {
|
|
@@ -959,10 +986,21 @@ var ActiveNode = () => {
|
|
|
959
986
|
}
|
|
960
987
|
};
|
|
961
988
|
|
|
989
|
+
// src/components/DeckLayout/DeckMain.tsx
|
|
990
|
+
import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
|
|
991
|
+
import { untracked } from "@preact/signals-core";
|
|
992
|
+
import React14, { Fragment as Fragment3, useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef2 } from "react";
|
|
993
|
+
import { Capabilities, LayoutAction as LayoutAction5, createIntent as createIntent6 } from "@dxos/app-framework";
|
|
994
|
+
import { useCapability as useCapability6, useIntentDispatcher as useIntentDispatcher6, usePluginManager } from "@dxos/app-framework/react";
|
|
995
|
+
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
996
|
+
import { Main as Main3, useMediaQuery, useOnTransition } from "@dxos/react-ui";
|
|
997
|
+
import { DEFAULT_HORIZONTAL_SIZE, Stack, StackContext } from "@dxos/react-ui-stack";
|
|
998
|
+
import { mainPaddingTransitions, mx as mx6 } from "@dxos/react-ui-theme";
|
|
999
|
+
|
|
962
1000
|
// src/components/DeckLayout/ContentEmpty.tsx
|
|
963
1001
|
import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
|
|
964
1002
|
import React11 from "react";
|
|
965
|
-
import { Surface as Surface7, useCapability as useCapability5 } from "@dxos/app-framework";
|
|
1003
|
+
import { Surface as Surface7, useCapability as useCapability5 } from "@dxos/app-framework/react";
|
|
966
1004
|
var ContentEmpty = () => {
|
|
967
1005
|
var _effect = _useSignals11();
|
|
968
1006
|
try {
|
|
@@ -985,156 +1023,23 @@ var ContentEmpty = () => {
|
|
|
985
1023
|
}
|
|
986
1024
|
};
|
|
987
1025
|
|
|
988
|
-
// src/components/DeckLayout/
|
|
1026
|
+
// src/components/DeckLayout/StatusBar.tsx
|
|
989
1027
|
import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
|
|
990
1028
|
import React12 from "react";
|
|
991
|
-
import { Surface as Surface8
|
|
992
|
-
import { AlertDialog, Dialog as NaturalDialog } from "@dxos/react-ui";
|
|
993
|
-
var Dialog = () => {
|
|
994
|
-
var _effect = _useSignals12();
|
|
995
|
-
try {
|
|
996
|
-
const context = useCapability6(DeckCapabilities.MutableDeckState);
|
|
997
|
-
const { dialogOpen, dialogType, dialogBlockAlign, dialogOverlayClasses, dialogOverlayStyle, dialogContent } = context;
|
|
998
|
-
const Root = dialogType === "alert" ? AlertDialog.Root : NaturalDialog.Root;
|
|
999
|
-
const Overlay = dialogType === "alert" ? AlertDialog.Overlay : NaturalDialog.Overlay;
|
|
1000
|
-
return /* @__PURE__ */ React12.createElement(Root, {
|
|
1001
|
-
modal: dialogBlockAlign !== "end",
|
|
1002
|
-
open: dialogOpen,
|
|
1003
|
-
onOpenChange: (nextOpen) => context.dialogOpen = nextOpen
|
|
1004
|
-
}, dialogBlockAlign === "end" ? (
|
|
1005
|
-
// TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
|
|
1006
|
-
/* @__PURE__ */ React12.createElement(Surface8, {
|
|
1007
|
-
role: "dialog",
|
|
1008
|
-
data: dialogContent,
|
|
1009
|
-
limit: 1,
|
|
1010
|
-
fallback: PlankContentError,
|
|
1011
|
-
placeholder: /* @__PURE__ */ React12.createElement("div", null)
|
|
1012
|
-
})
|
|
1013
|
-
) : /* @__PURE__ */ React12.createElement(Overlay, {
|
|
1014
|
-
blockAlign: dialogBlockAlign,
|
|
1015
|
-
classNames: dialogOverlayClasses,
|
|
1016
|
-
style: dialogOverlayStyle
|
|
1017
|
-
}, /* @__PURE__ */ React12.createElement(Surface8, {
|
|
1018
|
-
role: "dialog",
|
|
1019
|
-
data: dialogContent,
|
|
1020
|
-
limit: 1,
|
|
1021
|
-
fallback: PlankContentError
|
|
1022
|
-
})));
|
|
1023
|
-
} finally {
|
|
1024
|
-
_effect.f();
|
|
1025
|
-
}
|
|
1026
|
-
};
|
|
1027
|
-
|
|
1028
|
-
// src/components/DeckLayout/Popover.tsx
|
|
1029
|
-
import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
|
|
1030
|
-
import { createContext } from "@radix-ui/react-context";
|
|
1031
|
-
import React13, { useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef2, useState as useState3 } from "react";
|
|
1032
|
-
import { Surface as Surface9, useCapability as useCapability7 } from "@dxos/app-framework";
|
|
1033
|
-
import { Popover as Popover2 } from "@dxos/react-ui";
|
|
1034
|
-
var DEBOUNCE_DELAY = 40;
|
|
1035
|
-
var [DeckPopoverProvider, useDeckPopoverContext] = createContext("DeckPopover");
|
|
1036
|
-
var PopoverRoot = ({ children }) => {
|
|
1037
|
-
var _effect = _useSignals13();
|
|
1038
|
-
try {
|
|
1039
|
-
const layout = useCapability7(DeckCapabilities.MutableDeckState);
|
|
1040
|
-
const virtualRef = useRef2(null);
|
|
1041
|
-
const [virtualIter, setVirtualIter] = useState3(0);
|
|
1042
|
-
const [open, setOpen] = useState3(false);
|
|
1043
|
-
const debounceRef = useRef2(null);
|
|
1044
|
-
useEffect4(() => {
|
|
1045
|
-
setOpen(false);
|
|
1046
|
-
if (layout.popoverOpen) {
|
|
1047
|
-
if (debounceRef.current) {
|
|
1048
|
-
clearTimeout(debounceRef.current);
|
|
1049
|
-
}
|
|
1050
|
-
if (layout.popoverAnchor && virtualRef.current !== layout.popoverAnchor) {
|
|
1051
|
-
virtualRef.current = layout.popoverAnchor ?? null;
|
|
1052
|
-
setVirtualIter((iter) => iter + 1);
|
|
1053
|
-
}
|
|
1054
|
-
debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
|
|
1055
|
-
}
|
|
1056
|
-
}, [
|
|
1057
|
-
layout.popoverOpen,
|
|
1058
|
-
layout.popoverAnchorId,
|
|
1059
|
-
layout.popoverAnchor,
|
|
1060
|
-
layout.popoverContent
|
|
1061
|
-
]);
|
|
1062
|
-
return /* @__PURE__ */ React13.createElement(DeckPopoverProvider, {
|
|
1063
|
-
setOpen
|
|
1064
|
-
}, /* @__PURE__ */ React13.createElement(Popover2.Root, {
|
|
1065
|
-
modal: false,
|
|
1066
|
-
open
|
|
1067
|
-
}, layout.popoverAnchor && /* @__PURE__ */ React13.createElement(Popover2.VirtualTrigger, {
|
|
1068
|
-
key: virtualIter,
|
|
1069
|
-
virtualRef
|
|
1070
|
-
}), children));
|
|
1071
|
-
} finally {
|
|
1072
|
-
_effect.f();
|
|
1073
|
-
}
|
|
1074
|
-
};
|
|
1075
|
-
var PopoverContent = () => {
|
|
1076
|
-
var _effect = _useSignals13();
|
|
1077
|
-
try {
|
|
1078
|
-
const layout = useCapability7(DeckCapabilities.MutableDeckState);
|
|
1079
|
-
const { setOpen } = useDeckPopoverContext("PopoverContent");
|
|
1080
|
-
const handleClose = useCallback6((event) => {
|
|
1081
|
-
if (
|
|
1082
|
-
// TODO(thure): CodeMirror should not focus itself when it updates.
|
|
1083
|
-
event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
|
|
1084
|
-
) {
|
|
1085
|
-
event.preventDefault();
|
|
1086
|
-
} else {
|
|
1087
|
-
setOpen(false);
|
|
1088
|
-
layout.popoverOpen = false;
|
|
1089
|
-
layout.popoverAnchor = void 0;
|
|
1090
|
-
layout.popoverAnchorId = void 0;
|
|
1091
|
-
layout.popoverSide = void 0;
|
|
1092
|
-
}
|
|
1093
|
-
}, [
|
|
1094
|
-
setOpen
|
|
1095
|
-
]);
|
|
1096
|
-
const collisionBoundaries = useMemo5(() => {
|
|
1097
|
-
const closest = layout.popoverAnchor?.closest("[data-popover-collision-boundary]");
|
|
1098
|
-
return closest ? [
|
|
1099
|
-
closest
|
|
1100
|
-
] : [];
|
|
1101
|
-
}, [
|
|
1102
|
-
layout.popoverAnchor
|
|
1103
|
-
]);
|
|
1104
|
-
return /* @__PURE__ */ React13.createElement(Popover2.Portal, null, /* @__PURE__ */ React13.createElement(Popover2.Content, {
|
|
1105
|
-
side: layout.popoverSide,
|
|
1106
|
-
onInteractOutside: handleClose,
|
|
1107
|
-
onEscapeKeyDown: handleClose,
|
|
1108
|
-
collisionBoundary: collisionBoundaries,
|
|
1109
|
-
sticky: "always",
|
|
1110
|
-
hideWhenDetached: true
|
|
1111
|
-
}, /* @__PURE__ */ React13.createElement(Popover2.Viewport, null, /* @__PURE__ */ React13.createElement(Surface9, {
|
|
1112
|
-
role: "card--popover",
|
|
1113
|
-
data: layout.popoverContent,
|
|
1114
|
-
limit: 1
|
|
1115
|
-
})), /* @__PURE__ */ React13.createElement(Popover2.Arrow, null)));
|
|
1116
|
-
} finally {
|
|
1117
|
-
_effect.f();
|
|
1118
|
-
}
|
|
1119
|
-
};
|
|
1120
|
-
|
|
1121
|
-
// src/components/DeckLayout/StatusBar.tsx
|
|
1122
|
-
import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
|
|
1123
|
-
import React14 from "react";
|
|
1124
|
-
import { Surface as Surface10 } from "@dxos/app-framework";
|
|
1029
|
+
import { Surface as Surface8 } from "@dxos/app-framework/react";
|
|
1125
1030
|
import { useLandmarkMover } from "@dxos/react-ui";
|
|
1126
1031
|
var StatusBar = ({ showHints }) => {
|
|
1127
|
-
var _effect =
|
|
1032
|
+
var _effect = _useSignals12();
|
|
1128
1033
|
try {
|
|
1129
1034
|
const mover = useLandmarkMover(void 0, "3");
|
|
1130
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
1131
1036
|
role: "contentinfo",
|
|
1132
1037
|
className: "fixed block-end-0 inset-inline-0 bs-[--statusbar-size] border-bs border-separator z-[2] flex text-description",
|
|
1133
1038
|
...mover
|
|
1134
|
-
}, showHints && /* @__PURE__ */
|
|
1039
|
+
}, showHints && /* @__PURE__ */ React12.createElement(Surface8, {
|
|
1135
1040
|
role: "hints",
|
|
1136
1041
|
limit: 1
|
|
1137
|
-
}), /* @__PURE__ */
|
|
1042
|
+
}), /* @__PURE__ */ React12.createElement(Surface8, {
|
|
1138
1043
|
role: "status-bar",
|
|
1139
1044
|
limit: 1
|
|
1140
1045
|
}));
|
|
@@ -1143,49 +1048,13 @@ var StatusBar = ({ showHints }) => {
|
|
|
1143
1048
|
}
|
|
1144
1049
|
};
|
|
1145
1050
|
|
|
1146
|
-
// src/components/DeckLayout/Toast.tsx
|
|
1147
|
-
import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
|
|
1148
|
-
import React15 from "react";
|
|
1149
|
-
import { Button, Icon as Icon2, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
1150
|
-
var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange }) => {
|
|
1151
|
-
var _effect = _useSignals15();
|
|
1152
|
-
try {
|
|
1153
|
-
const { t } = useTranslation7(meta.id);
|
|
1154
|
-
return /* @__PURE__ */ React15.createElement(NaturalToast.Root, {
|
|
1155
|
-
"data-testid": id,
|
|
1156
|
-
defaultOpen: true,
|
|
1157
|
-
duration,
|
|
1158
|
-
onOpenChange
|
|
1159
|
-
}, /* @__PURE__ */ React15.createElement(NaturalToast.Body, null, /* @__PURE__ */ React15.createElement(NaturalToast.Title, {
|
|
1160
|
-
classNames: "items-center"
|
|
1161
|
-
}, icon && /* @__PURE__ */ React15.createElement(Icon2, {
|
|
1162
|
-
icon,
|
|
1163
|
-
size: 5,
|
|
1164
|
-
classNames: "inline mr-1"
|
|
1165
|
-
}), title && /* @__PURE__ */ React15.createElement("span", null, toLocalizedString3(title, t))), description && /* @__PURE__ */ React15.createElement(NaturalToast.Description, null, description && toLocalizedString3(description, t))), /* @__PURE__ */ React15.createElement(NaturalToast.Actions, null, onAction && actionAlt && actionLabel && /* @__PURE__ */ React15.createElement(NaturalToast.Action, {
|
|
1166
|
-
altText: toLocalizedString3(actionAlt, t),
|
|
1167
|
-
asChild: true
|
|
1168
|
-
}, /* @__PURE__ */ React15.createElement(Button, {
|
|
1169
|
-
"data-testid": "toast.action",
|
|
1170
|
-
variant: "primary",
|
|
1171
|
-
onClick: () => onAction?.()
|
|
1172
|
-
}, toLocalizedString3(actionLabel, t))), closeLabel && /* @__PURE__ */ React15.createElement(NaturalToast.Close, {
|
|
1173
|
-
asChild: true
|
|
1174
|
-
}, /* @__PURE__ */ React15.createElement(Button, {
|
|
1175
|
-
"data-testid": "toast.close"
|
|
1176
|
-
}, toLocalizedString3(closeLabel, t)))));
|
|
1177
|
-
} finally {
|
|
1178
|
-
_effect.f();
|
|
1179
|
-
}
|
|
1180
|
-
};
|
|
1181
|
-
|
|
1182
1051
|
// src/components/DeckLayout/Topbar.tsx
|
|
1183
|
-
import { useSignals as
|
|
1184
|
-
import
|
|
1052
|
+
import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
|
|
1053
|
+
import React13 from "react";
|
|
1185
1054
|
var Topbar = () => {
|
|
1186
|
-
var _effect =
|
|
1055
|
+
var _effect = _useSignals13();
|
|
1187
1056
|
try {
|
|
1188
|
-
return /* @__PURE__ */
|
|
1057
|
+
return /* @__PURE__ */ React13.createElement(Banner, {
|
|
1189
1058
|
variant: "topbar"
|
|
1190
1059
|
});
|
|
1191
1060
|
} finally {
|
|
@@ -1193,37 +1062,23 @@ var Topbar = () => {
|
|
|
1193
1062
|
}
|
|
1194
1063
|
};
|
|
1195
1064
|
|
|
1196
|
-
// src/components/DeckLayout/
|
|
1197
|
-
var
|
|
1198
|
-
var _effect =
|
|
1199
|
-
try {
|
|
1200
|
-
return order > 0 ? /* @__PURE__ */ React17.createElement("span", {
|
|
1201
|
-
role: "separator",
|
|
1202
|
-
className: "row-span-2 bg-deckSurface is-4",
|
|
1203
|
-
style: {
|
|
1204
|
-
gridColumn: order
|
|
1205
|
-
}
|
|
1206
|
-
}) : null;
|
|
1207
|
-
} finally {
|
|
1208
|
-
_effect.f();
|
|
1209
|
-
}
|
|
1210
|
-
};
|
|
1211
|
-
var DeckLayout = ({ onDismissToast }) => {
|
|
1212
|
-
var _effect = _useSignals17();
|
|
1065
|
+
// src/components/DeckLayout/DeckMain.tsx
|
|
1066
|
+
var DeckMain = () => {
|
|
1067
|
+
var _effect = _useSignals14();
|
|
1213
1068
|
try {
|
|
1214
1069
|
const { dispatchPromise: dispatch } = useIntentDispatcher6();
|
|
1215
|
-
const settings =
|
|
1216
|
-
const context =
|
|
1217
|
-
const { sidebarState, complementarySidebarState, complementarySidebarPanel, deck
|
|
1070
|
+
const settings = useCapability6(Capabilities.SettingsStore).getStore(meta.id)?.value;
|
|
1071
|
+
const context = useCapability6(DeckCapabilities.MutableDeckState);
|
|
1072
|
+
const { sidebarState, complementarySidebarState, complementarySidebarPanel, deck } = context;
|
|
1218
1073
|
const { active, activeCompanions, fullscreen, solo, plankSizing } = deck;
|
|
1219
|
-
const breakpoint = useBreakpoints();
|
|
1220
1074
|
const layoutMode = getMode(deck);
|
|
1075
|
+
const breakpoint = useBreakpoints();
|
|
1221
1076
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
1222
1077
|
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
1223
1078
|
const pluginManager = usePluginManager();
|
|
1224
|
-
const scrollLeftRef =
|
|
1225
|
-
const deckRef =
|
|
1226
|
-
|
|
1079
|
+
const scrollLeftRef = useRef2(null);
|
|
1080
|
+
const deckRef = useRef2(null);
|
|
1081
|
+
useEffect4(() => {
|
|
1227
1082
|
const attended = untracked(() => {
|
|
1228
1083
|
const attention = pluginManager.context.getCapability(AttentionCapabilities.Attention);
|
|
1229
1084
|
return attention.current;
|
|
@@ -1234,8 +1089,8 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1234
1089
|
}
|
|
1235
1090
|
}, []);
|
|
1236
1091
|
const [isNotMobile] = useMediaQuery("md");
|
|
1237
|
-
const shouldRevert =
|
|
1238
|
-
|
|
1092
|
+
const shouldRevert = useRef2(false);
|
|
1093
|
+
useEffect4(() => {
|
|
1239
1094
|
if (!isNotMobile && getMode(deck) === "deck") {
|
|
1240
1095
|
const attended = untracked(() => {
|
|
1241
1096
|
const attention = pluginManager.context.getCapability(AttentionCapabilities.Attention);
|
|
@@ -1262,8 +1117,8 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1262
1117
|
deck,
|
|
1263
1118
|
dispatch
|
|
1264
1119
|
]);
|
|
1265
|
-
|
|
1266
|
-
if (!settings
|
|
1120
|
+
useEffect4(() => {
|
|
1121
|
+
if (!settings?.enableDeck && layoutMode === "deck") {
|
|
1267
1122
|
void dispatch(createIntent6(LayoutAction5.SetLayoutMode, {
|
|
1268
1123
|
part: "mode",
|
|
1269
1124
|
subject: active[0],
|
|
@@ -1273,27 +1128,27 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1273
1128
|
}));
|
|
1274
1129
|
}
|
|
1275
1130
|
}, [
|
|
1276
|
-
settings
|
|
1131
|
+
settings?.enableDeck,
|
|
1277
1132
|
dispatch,
|
|
1278
1133
|
active,
|
|
1279
1134
|
layoutMode
|
|
1280
1135
|
]);
|
|
1281
|
-
const handleResize =
|
|
1136
|
+
const handleResize = useCallback6(() => {
|
|
1282
1137
|
scrollLeftRef.current = null;
|
|
1283
1138
|
}, []);
|
|
1284
|
-
|
|
1139
|
+
useEffect4(() => {
|
|
1285
1140
|
window.addEventListener("resize", handleResize);
|
|
1286
1141
|
return () => window.removeEventListener("resize", handleResize);
|
|
1287
1142
|
}, [
|
|
1288
1143
|
handleResize
|
|
1289
1144
|
]);
|
|
1290
|
-
const restoreScroll =
|
|
1145
|
+
const restoreScroll = useCallback6(() => {
|
|
1291
1146
|
if (deckRef.current && scrollLeftRef.current != null) {
|
|
1292
1147
|
deckRef.current.scrollLeft = scrollLeftRef.current;
|
|
1293
1148
|
}
|
|
1294
1149
|
}, []);
|
|
1295
1150
|
useOnTransition(layoutMode, (mode) => mode !== "deck", "deck", restoreScroll);
|
|
1296
|
-
const handleScroll =
|
|
1151
|
+
const handleScroll = useCallback6((event) => {
|
|
1297
1152
|
if (!solo && event.currentTarget === event.target) {
|
|
1298
1153
|
scrollLeftRef.current = event.target.scrollLeft;
|
|
1299
1154
|
}
|
|
@@ -1301,17 +1156,17 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1301
1156
|
solo
|
|
1302
1157
|
]);
|
|
1303
1158
|
const isEmpty = !solo && active.length === 0;
|
|
1304
|
-
const padding =
|
|
1305
|
-
if (!solo && settings
|
|
1159
|
+
const padding = useMemo5(() => {
|
|
1160
|
+
if (!solo && settings?.overscroll === "centering") {
|
|
1306
1161
|
return calculateOverscroll(active.length);
|
|
1307
1162
|
}
|
|
1308
1163
|
return {};
|
|
1309
1164
|
}, [
|
|
1310
1165
|
solo,
|
|
1311
|
-
settings
|
|
1166
|
+
settings?.overscroll,
|
|
1312
1167
|
deck
|
|
1313
1168
|
]);
|
|
1314
|
-
const mainPosition =
|
|
1169
|
+
const mainPosition = useMemo5(() => [
|
|
1315
1170
|
"grid !block-start-[env(safe-area-inset-top)]",
|
|
1316
1171
|
topbar && "!block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
|
|
1317
1172
|
hoistStatusbar && "lg:block-end-[--statusbar-size]"
|
|
@@ -1319,7 +1174,7 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1319
1174
|
topbar,
|
|
1320
1175
|
hoistStatusbar
|
|
1321
1176
|
]);
|
|
1322
|
-
const { order, itemsCount } =
|
|
1177
|
+
const { order, itemsCount } = useMemo5(() => {
|
|
1323
1178
|
return active.reduce((acc, entryId) => {
|
|
1324
1179
|
acc.order[entryId] = acc.itemsCount + 1;
|
|
1325
1180
|
acc.itemsCount += activeCompanions?.[entryId] ? 3 : 2;
|
|
@@ -1332,53 +1187,55 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1332
1187
|
active,
|
|
1333
1188
|
activeCompanions
|
|
1334
1189
|
]);
|
|
1335
|
-
return /* @__PURE__ */
|
|
1190
|
+
return /* @__PURE__ */ React14.createElement(Main3.Root, {
|
|
1336
1191
|
navigationSidebarState: fullscreen ? "closed" : context.sidebarState,
|
|
1337
|
-
onNavigationSidebarStateChange: (next) => context.sidebarState = next,
|
|
1338
1192
|
complementarySidebarState: fullscreen ? "closed" : context.complementarySidebarState,
|
|
1193
|
+
onNavigationSidebarStateChange: (next) => context.sidebarState = next,
|
|
1339
1194
|
onComplementarySidebarStateChange: (next) => context.complementarySidebarState = next
|
|
1340
|
-
}, /* @__PURE__ */
|
|
1195
|
+
}, /* @__PURE__ */ React14.createElement(Sidebar, null), /* @__PURE__ */ React14.createElement(ComplementarySidebar, {
|
|
1341
1196
|
current: complementarySidebarPanel
|
|
1342
|
-
}), /* @__PURE__ */
|
|
1197
|
+
}), /* @__PURE__ */ React14.createElement(Main3.Overlay, null), isEmpty && /* @__PURE__ */ React14.createElement(Main3.Content, {
|
|
1343
1198
|
bounce: true,
|
|
1344
1199
|
handlesFocus: true,
|
|
1345
1200
|
classNames: mainPosition
|
|
1346
|
-
}, /* @__PURE__ */
|
|
1201
|
+
}, /* @__PURE__ */ React14.createElement(ContentEmpty, null)), !isEmpty && /* @__PURE__ */ React14.createElement(Main3.Content, {
|
|
1347
1202
|
bounce: true,
|
|
1348
1203
|
handlesFocus: true,
|
|
1349
1204
|
classNames: mainPosition,
|
|
1350
1205
|
style: {
|
|
1206
|
+
"--main-spacing": settings?.encapsulatedPlanks ? "0.75rem" : "0",
|
|
1351
1207
|
"--dx-main-sidebarWidth": sidebarState === "expanded" ? "var(--nav-sidebar-size)" : sidebarState === "collapsed" ? "var(--l0-size)" : "0",
|
|
1352
1208
|
"--dx-main-complementaryWidth": complementarySidebarState === "expanded" ? "var(--complementary-sidebar-size)" : complementarySidebarState === "collapsed" ? "var(--rail-size)" : "0",
|
|
1353
1209
|
"--dx-main-contentFirstWidth": `${plankSizing[active[0] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`,
|
|
1354
1210
|
"--dx-main-contentLastWidth": `${plankSizing[active[(active.length ?? 1) - 1] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`
|
|
1355
1211
|
}
|
|
1356
|
-
}, /* @__PURE__ */
|
|
1212
|
+
}, /* @__PURE__ */ React14.createElement("div", {
|
|
1357
1213
|
role: "none",
|
|
1358
1214
|
className: !solo ? "relative bg-deckSurface overflow-hidden" : "sr-only",
|
|
1359
1215
|
...solo && {
|
|
1360
1216
|
inert: true
|
|
1361
1217
|
}
|
|
1362
|
-
}, !topbar && !fullscreen && /* @__PURE__ */
|
|
1218
|
+
}, !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleSidebarButton, {
|
|
1363
1219
|
classNames: fixedSidebarToggleStyles
|
|
1364
|
-
}), !topbar && !fullscreen && /* @__PURE__ */
|
|
1220
|
+
}), !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleComplementarySidebarButton, {
|
|
1365
1221
|
classNames: fixedComplementarySidebarToggleStyles
|
|
1366
|
-
}), /* @__PURE__ */
|
|
1222
|
+
}), /* @__PURE__ */ React14.createElement(Stack, {
|
|
1367
1223
|
ref: deckRef,
|
|
1368
1224
|
orientation: "horizontal",
|
|
1369
1225
|
size: "contain",
|
|
1226
|
+
itemsCount: itemsCount - 1,
|
|
1370
1227
|
classNames: [
|
|
1371
|
-
"absolute inset-block-
|
|
1228
|
+
"absolute inset-block-[--main-spacing] -inset-inline-px bs-[calc(100%-2*var(--main-spacing))]",
|
|
1372
1229
|
mainPaddingTransitions
|
|
1373
1230
|
],
|
|
1374
|
-
itemsCount: itemsCount - 1,
|
|
1375
1231
|
style: padding,
|
|
1376
1232
|
onScroll: handleScroll
|
|
1377
|
-
}, active.map((entryId) => /* @__PURE__ */
|
|
1233
|
+
}, active.map((entryId) => /* @__PURE__ */ React14.createElement(Fragment3, {
|
|
1378
1234
|
key: entryId
|
|
1379
|
-
}, /* @__PURE__ */
|
|
1380
|
-
order: order[entryId] - 1
|
|
1381
|
-
|
|
1235
|
+
}, /* @__PURE__ */ React14.createElement(PlankSeparator, {
|
|
1236
|
+
order: order[entryId] - 1,
|
|
1237
|
+
encapsulate: !!settings?.enableDeck
|
|
1238
|
+
}), /* @__PURE__ */ React14.createElement(Plank, {
|
|
1382
1239
|
id: entryId,
|
|
1383
1240
|
companionId: activeCompanions?.[entryId],
|
|
1384
1241
|
part: "deck",
|
|
@@ -1386,36 +1243,217 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1386
1243
|
active,
|
|
1387
1244
|
layoutMode,
|
|
1388
1245
|
settings
|
|
1389
|
-
}))))), /* @__PURE__ */
|
|
1246
|
+
}))))), /* @__PURE__ */ React14.createElement("div", {
|
|
1390
1247
|
role: "none",
|
|
1391
|
-
className: solo ? "relative bg-deckSurface
|
|
1248
|
+
className: solo ? "relative overflow-hidden bg-deckSurface" : "sr-only",
|
|
1392
1249
|
...!solo && {
|
|
1393
1250
|
inert: true
|
|
1394
1251
|
}
|
|
1395
|
-
}, !topbar && !fullscreen && /* @__PURE__ */
|
|
1252
|
+
}, !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleSidebarButton, {
|
|
1396
1253
|
classNames: fixedSidebarToggleStyles
|
|
1397
|
-
}), !topbar && !fullscreen && /* @__PURE__ */
|
|
1254
|
+
}), !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleComplementarySidebarButton, {
|
|
1398
1255
|
classNames: fixedComplementarySidebarToggleStyles
|
|
1399
|
-
}), /* @__PURE__ */
|
|
1256
|
+
}), /* @__PURE__ */ React14.createElement(StackContext.Provider, {
|
|
1400
1257
|
value: {
|
|
1401
|
-
size: "contain",
|
|
1402
1258
|
orientation: "horizontal",
|
|
1259
|
+
size: "contain",
|
|
1403
1260
|
rail: true
|
|
1404
1261
|
}
|
|
1405
|
-
}, /* @__PURE__ */
|
|
1262
|
+
}, /* @__PURE__ */ React14.createElement(Plank, {
|
|
1406
1263
|
id: solo,
|
|
1407
1264
|
companionId: solo ? activeCompanions?.[solo] : void 0,
|
|
1408
1265
|
part: "solo",
|
|
1409
1266
|
layoutMode,
|
|
1410
1267
|
settings
|
|
1411
|
-
})))), topbar && /* @__PURE__ */
|
|
1412
|
-
showHints: settings
|
|
1413
|
-
}))
|
|
1268
|
+
})))), topbar && /* @__PURE__ */ React14.createElement(Topbar, null), hoistStatusbar && /* @__PURE__ */ React14.createElement(StatusBar, {
|
|
1269
|
+
showHints: settings?.showHints
|
|
1270
|
+
}));
|
|
1271
|
+
} finally {
|
|
1272
|
+
_effect.f();
|
|
1273
|
+
}
|
|
1274
|
+
};
|
|
1275
|
+
var PlankSeparator = ({ order, encapsulate }) => {
|
|
1276
|
+
var _effect = _useSignals14();
|
|
1277
|
+
try {
|
|
1278
|
+
return order > 0 ? /* @__PURE__ */ React14.createElement("span", {
|
|
1279
|
+
role: "separator",
|
|
1280
|
+
className: mx6("row-span-2 bg-deckSurface", encapsulate ? "is-0" : "is-4"),
|
|
1281
|
+
style: {
|
|
1282
|
+
gridColumn: order
|
|
1283
|
+
}
|
|
1284
|
+
}) : null;
|
|
1285
|
+
} finally {
|
|
1286
|
+
_effect.f();
|
|
1287
|
+
}
|
|
1288
|
+
};
|
|
1289
|
+
|
|
1290
|
+
// src/components/DeckLayout/Dialog.tsx
|
|
1291
|
+
import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
|
|
1292
|
+
import React15 from "react";
|
|
1293
|
+
import { Surface as Surface9, useCapability as useCapability7 } from "@dxos/app-framework/react";
|
|
1294
|
+
import { AlertDialog, Dialog as NaturalDialog } from "@dxos/react-ui";
|
|
1295
|
+
var Dialog = () => {
|
|
1296
|
+
var _effect = _useSignals15();
|
|
1297
|
+
try {
|
|
1298
|
+
const context = useCapability7(DeckCapabilities.MutableDeckState);
|
|
1299
|
+
const { dialogOpen, dialogType, dialogBlockAlign, dialogOverlayClasses, dialogOverlayStyle, dialogContent } = context;
|
|
1300
|
+
const Root = dialogType === "alert" ? AlertDialog.Root : NaturalDialog.Root;
|
|
1301
|
+
const Overlay = dialogType === "alert" ? AlertDialog.Overlay : NaturalDialog.Overlay;
|
|
1302
|
+
return /* @__PURE__ */ React15.createElement(Root, {
|
|
1303
|
+
modal: dialogBlockAlign !== "end",
|
|
1304
|
+
open: dialogOpen,
|
|
1305
|
+
onOpenChange: (nextOpen) => context.dialogOpen = nextOpen
|
|
1306
|
+
}, dialogBlockAlign === "end" ? (
|
|
1307
|
+
// TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
|
|
1308
|
+
/* @__PURE__ */ React15.createElement(Surface9, {
|
|
1309
|
+
role: "dialog",
|
|
1310
|
+
data: dialogContent,
|
|
1311
|
+
limit: 1,
|
|
1312
|
+
fallback: PlankContentError,
|
|
1313
|
+
placeholder: /* @__PURE__ */ React15.createElement("div", null)
|
|
1314
|
+
})
|
|
1315
|
+
) : /* @__PURE__ */ React15.createElement(Overlay, {
|
|
1316
|
+
blockAlign: dialogBlockAlign,
|
|
1317
|
+
classNames: dialogOverlayClasses,
|
|
1318
|
+
style: dialogOverlayStyle
|
|
1319
|
+
}, /* @__PURE__ */ React15.createElement(Surface9, {
|
|
1320
|
+
role: "dialog",
|
|
1321
|
+
data: dialogContent,
|
|
1322
|
+
limit: 1,
|
|
1323
|
+
fallback: PlankContentError
|
|
1324
|
+
})));
|
|
1325
|
+
} finally {
|
|
1326
|
+
_effect.f();
|
|
1327
|
+
}
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1330
|
+
// src/components/DeckLayout/Popover.tsx
|
|
1331
|
+
import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
|
|
1332
|
+
import { createContext } from "@radix-ui/react-context";
|
|
1333
|
+
import React16, { useCallback as useCallback7, useEffect as useEffect5, useRef as useRef3, useState as useState3 } from "react";
|
|
1334
|
+
import { Surface as Surface10, useCapability as useCapability8 } from "@dxos/app-framework/react";
|
|
1335
|
+
import { Popover as Popover2 } from "@dxos/react-ui";
|
|
1336
|
+
var DEBOUNCE_DELAY = 40;
|
|
1337
|
+
var [DeckPopoverProvider, useDeckPopoverContext] = createContext("DeckPopover");
|
|
1338
|
+
var PopoverRoot = ({ children }) => {
|
|
1339
|
+
var _effect = _useSignals16();
|
|
1340
|
+
try {
|
|
1341
|
+
const layout = useCapability8(DeckCapabilities.MutableDeckState);
|
|
1342
|
+
const virtualRef = useRef3(null);
|
|
1343
|
+
const [virtualIter, setVirtualIter] = useState3(0);
|
|
1344
|
+
const [open, setOpen] = useState3(false);
|
|
1345
|
+
const debounceRef = useRef3(null);
|
|
1346
|
+
useEffect5(() => {
|
|
1347
|
+
setOpen(false);
|
|
1348
|
+
if (layout.popoverOpen) {
|
|
1349
|
+
if (debounceRef.current) {
|
|
1350
|
+
clearTimeout(debounceRef.current);
|
|
1351
|
+
}
|
|
1352
|
+
if (layout.popoverAnchor && virtualRef.current !== layout.popoverAnchor) {
|
|
1353
|
+
virtualRef.current = layout.popoverAnchor ?? null;
|
|
1354
|
+
setVirtualIter((iter) => iter + 1);
|
|
1355
|
+
}
|
|
1356
|
+
debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
|
|
1357
|
+
}
|
|
1358
|
+
}, [
|
|
1359
|
+
layout.popoverOpen,
|
|
1360
|
+
layout.popoverAnchorId,
|
|
1361
|
+
layout.popoverAnchor,
|
|
1362
|
+
layout.popoverContent
|
|
1363
|
+
]);
|
|
1364
|
+
return /* @__PURE__ */ React16.createElement(DeckPopoverProvider, {
|
|
1365
|
+
setOpen
|
|
1366
|
+
}, /* @__PURE__ */ React16.createElement(Popover2.Root, {
|
|
1367
|
+
modal: false,
|
|
1368
|
+
open
|
|
1369
|
+
}, layout.popoverAnchor && /* @__PURE__ */ React16.createElement(Popover2.VirtualTrigger, {
|
|
1370
|
+
key: virtualIter,
|
|
1371
|
+
virtualRef
|
|
1372
|
+
}), children));
|
|
1373
|
+
} finally {
|
|
1374
|
+
_effect.f();
|
|
1375
|
+
}
|
|
1376
|
+
};
|
|
1377
|
+
var PopoverContent = () => {
|
|
1378
|
+
var _effect = _useSignals16();
|
|
1379
|
+
try {
|
|
1380
|
+
const layout = useCapability8(DeckCapabilities.MutableDeckState);
|
|
1381
|
+
const { setOpen } = useDeckPopoverContext("PopoverContent");
|
|
1382
|
+
const handleClose = useCallback7((event) => {
|
|
1383
|
+
if (
|
|
1384
|
+
// TODO(thure): CodeMirror should not focus itself when it updates.
|
|
1385
|
+
event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
|
|
1386
|
+
) {
|
|
1387
|
+
event.preventDefault();
|
|
1388
|
+
} else {
|
|
1389
|
+
setOpen(false);
|
|
1390
|
+
layout.popoverOpen = false;
|
|
1391
|
+
layout.popoverAnchor = void 0;
|
|
1392
|
+
layout.popoverAnchorId = void 0;
|
|
1393
|
+
layout.popoverSide = void 0;
|
|
1394
|
+
}
|
|
1395
|
+
}, [
|
|
1396
|
+
setOpen
|
|
1397
|
+
]);
|
|
1398
|
+
return /* @__PURE__ */ React16.createElement(Popover2.Portal, null, /* @__PURE__ */ React16.createElement(Popover2.Content, {
|
|
1399
|
+
side: layout.popoverSide,
|
|
1400
|
+
sticky: "always",
|
|
1401
|
+
hideWhenDetached: true,
|
|
1402
|
+
onInteractOutside: handleClose,
|
|
1403
|
+
onEscapeKeyDown: handleClose
|
|
1404
|
+
}, /* @__PURE__ */ React16.createElement(Popover2.Viewport, null, /* @__PURE__ */ React16.createElement(Surface10, {
|
|
1405
|
+
role: "card--popover",
|
|
1406
|
+
data: layout.popoverContent,
|
|
1407
|
+
limit: 1
|
|
1408
|
+
})), /* @__PURE__ */ React16.createElement(Popover2.Arrow, null)));
|
|
1409
|
+
} finally {
|
|
1410
|
+
_effect.f();
|
|
1411
|
+
}
|
|
1412
|
+
};
|
|
1413
|
+
|
|
1414
|
+
// src/components/DeckLayout/Toast.tsx
|
|
1415
|
+
import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
|
|
1416
|
+
import React17 from "react";
|
|
1417
|
+
import { Button, Icon as Icon2, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
1418
|
+
var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange }) => {
|
|
1419
|
+
var _effect = _useSignals17();
|
|
1420
|
+
try {
|
|
1421
|
+
const { t } = useTranslation7(meta.id);
|
|
1422
|
+
return /* @__PURE__ */ React17.createElement(NaturalToast.Root, {
|
|
1423
|
+
"data-testid": id,
|
|
1424
|
+
defaultOpen: true,
|
|
1425
|
+
duration,
|
|
1426
|
+
onOpenChange
|
|
1427
|
+
}, /* @__PURE__ */ React17.createElement(NaturalToast.Body, null, /* @__PURE__ */ React17.createElement(NaturalToast.Title, {
|
|
1428
|
+
classNames: "items-center"
|
|
1429
|
+
}, icon && /* @__PURE__ */ React17.createElement(Icon2, {
|
|
1430
|
+
icon,
|
|
1431
|
+
classNames: "inline mr-1"
|
|
1432
|
+
}), title && /* @__PURE__ */ React17.createElement("span", null, toLocalizedString3(title, t))), description && /* @__PURE__ */ React17.createElement(NaturalToast.Description, null, description && toLocalizedString3(description, t))), /* @__PURE__ */ React17.createElement(NaturalToast.Actions, null, onAction && actionAlt && actionLabel && /* @__PURE__ */ React17.createElement(NaturalToast.Action, {
|
|
1433
|
+
altText: toLocalizedString3(actionAlt, t),
|
|
1434
|
+
asChild: true
|
|
1435
|
+
}, /* @__PURE__ */ React17.createElement(Button, {
|
|
1436
|
+
"data-testid": "toast.action",
|
|
1437
|
+
variant: "primary",
|
|
1438
|
+
onClick: () => onAction?.()
|
|
1439
|
+
}, toLocalizedString3(actionLabel, t))), closeLabel && /* @__PURE__ */ React17.createElement(NaturalToast.Close, {
|
|
1440
|
+
asChild: true
|
|
1441
|
+
}, /* @__PURE__ */ React17.createElement(Button, {
|
|
1442
|
+
"data-testid": "toast.close"
|
|
1443
|
+
}, toLocalizedString3(closeLabel, t)))));
|
|
1444
|
+
} finally {
|
|
1445
|
+
_effect.f();
|
|
1446
|
+
}
|
|
1447
|
+
};
|
|
1448
|
+
var Toaster = ({ toasts, onDismissToast }) => {
|
|
1449
|
+
var _effect = _useSignals17();
|
|
1450
|
+
try {
|
|
1451
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, toasts?.map((toast) => /* @__PURE__ */ React17.createElement(Toast, {
|
|
1414
1452
|
...toast,
|
|
1415
1453
|
key: toast.id,
|
|
1416
1454
|
onOpenChange: (open) => {
|
|
1417
1455
|
if (!open) {
|
|
1418
|
-
onDismissToast(toast.id);
|
|
1456
|
+
onDismissToast?.(toast.id);
|
|
1419
1457
|
}
|
|
1420
1458
|
return open;
|
|
1421
1459
|
}
|
|
@@ -1425,60 +1463,80 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1425
1463
|
}
|
|
1426
1464
|
};
|
|
1427
1465
|
|
|
1466
|
+
// src/components/DeckLayout/DeckLayout.tsx
|
|
1467
|
+
var DeckLayout = ({ onDismissToast }) => {
|
|
1468
|
+
var _effect = _useSignals18();
|
|
1469
|
+
try {
|
|
1470
|
+
const context = useCapability9(DeckCapabilities.MutableDeckState);
|
|
1471
|
+
const { toasts } = context;
|
|
1472
|
+
return /* @__PURE__ */ React18.createElement(PopoverRoot, null, /* @__PURE__ */ React18.createElement(ActiveNode, null), /* @__PURE__ */ React18.createElement(DeckMain, null), /* @__PURE__ */ React18.createElement(PopoverContent, null), /* @__PURE__ */ React18.createElement(Dialog, null), /* @__PURE__ */ React18.createElement(Toaster, {
|
|
1473
|
+
toasts,
|
|
1474
|
+
onDismissToast
|
|
1475
|
+
}));
|
|
1476
|
+
} finally {
|
|
1477
|
+
_effect.f();
|
|
1478
|
+
}
|
|
1479
|
+
};
|
|
1480
|
+
|
|
1428
1481
|
// src/components/DeckSettings/DeckSettings.tsx
|
|
1429
|
-
import { useSignals as
|
|
1430
|
-
import
|
|
1482
|
+
import { useSignals as _useSignals19 } from "@preact-signals/safe-react/tracking";
|
|
1483
|
+
import React19 from "react";
|
|
1431
1484
|
import { Input, Select, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
1432
1485
|
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
1433
1486
|
var isSocket = !!globalThis.__args;
|
|
1434
1487
|
var DeckSettings = ({ settings }) => {
|
|
1435
|
-
var _effect =
|
|
1488
|
+
var _effect = _useSignals19();
|
|
1436
1489
|
try {
|
|
1437
1490
|
const { t } = useTranslation8(meta.id);
|
|
1438
|
-
return /* @__PURE__ */
|
|
1491
|
+
return /* @__PURE__ */ React19.createElement(ControlPage, null, /* @__PURE__ */ React19.createElement(ControlSection, {
|
|
1439
1492
|
title: t("settings title", {
|
|
1440
1493
|
ns: meta.id
|
|
1441
1494
|
})
|
|
1442
|
-
}, /* @__PURE__ */
|
|
1495
|
+
}, /* @__PURE__ */ React19.createElement(ControlGroup, null, /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1443
1496
|
title: t("settings enable deck label")
|
|
1444
|
-
}, /* @__PURE__ */
|
|
1497
|
+
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1445
1498
|
checked: settings.enableDeck,
|
|
1446
1499
|
onCheckedChange: (checked) => settings.enableDeck = checked
|
|
1447
|
-
})), /* @__PURE__ */
|
|
1500
|
+
})), /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1501
|
+
title: t("settings encapsulated planks label")
|
|
1502
|
+
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1503
|
+
checked: settings.encapsulatedPlanks ?? false,
|
|
1504
|
+
onCheckedChange: (checked) => settings.encapsulatedPlanks = checked
|
|
1505
|
+
})), /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1448
1506
|
title: t("select new plank positioning label")
|
|
1449
|
-
}, /* @__PURE__ */
|
|
1507
|
+
}, /* @__PURE__ */ React19.createElement(Select.Root, {
|
|
1450
1508
|
disabled: !settings.enableDeck,
|
|
1451
1509
|
value: settings.newPlankPositioning ?? "start",
|
|
1452
1510
|
onValueChange: (value) => settings.newPlankPositioning = value
|
|
1453
|
-
}, /* @__PURE__ */
|
|
1511
|
+
}, /* @__PURE__ */ React19.createElement(Select.TriggerButton, {
|
|
1454
1512
|
placeholder: t("select new plank positioning placeholder")
|
|
1455
|
-
}), /* @__PURE__ */
|
|
1513
|
+
}), /* @__PURE__ */ React19.createElement(Select.Portal, null, /* @__PURE__ */ React19.createElement(Select.Content, null, /* @__PURE__ */ React19.createElement(Select.Viewport, null, NewPlankPositions.map((position) => /* @__PURE__ */ React19.createElement(Select.Option, {
|
|
1456
1514
|
key: position,
|
|
1457
1515
|
value: position
|
|
1458
|
-
}, t(`settings new plank position ${position} label`)))), /* @__PURE__ */
|
|
1516
|
+
}, t(`settings new plank position ${position} label`)))), /* @__PURE__ */ React19.createElement(Select.Arrow, null))))), /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1459
1517
|
title: t("settings overscroll label")
|
|
1460
|
-
}, /* @__PURE__ */
|
|
1518
|
+
}, /* @__PURE__ */ React19.createElement(Select.Root, {
|
|
1461
1519
|
disabled: !settings.enableDeck,
|
|
1462
1520
|
value: settings.overscroll ?? "none",
|
|
1463
1521
|
onValueChange: (value) => settings.overscroll = value
|
|
1464
|
-
}, /* @__PURE__ */
|
|
1522
|
+
}, /* @__PURE__ */ React19.createElement(Select.TriggerButton, {
|
|
1465
1523
|
placeholder: t("select overscroll placeholder")
|
|
1466
|
-
}), /* @__PURE__ */
|
|
1524
|
+
}), /* @__PURE__ */ React19.createElement(Select.Portal, null, /* @__PURE__ */ React19.createElement(Select.Content, null, /* @__PURE__ */ React19.createElement(Select.Viewport, null, OverscrollOptions.map((option) => /* @__PURE__ */ React19.createElement(Select.Option, {
|
|
1467
1525
|
key: option,
|
|
1468
1526
|
value: option
|
|
1469
|
-
}, t(`settings overscroll ${option} label`)))), /* @__PURE__ */
|
|
1527
|
+
}, t(`settings overscroll ${option} label`)))), /* @__PURE__ */ React19.createElement(Select.Arrow, null))))), /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1470
1528
|
title: t("settings enable statusbar label")
|
|
1471
|
-
}, /* @__PURE__ */
|
|
1529
|
+
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1472
1530
|
checked: settings.enableStatusbar,
|
|
1473
1531
|
onCheckedChange: (checked) => settings.enableStatusbar = checked
|
|
1474
|
-
})), /* @__PURE__ */
|
|
1532
|
+
})), /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1475
1533
|
title: t("settings show hints label")
|
|
1476
|
-
}, /* @__PURE__ */
|
|
1534
|
+
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1477
1535
|
checked: settings.showHints,
|
|
1478
1536
|
onCheckedChange: (checked) => settings.showHints = checked
|
|
1479
|
-
})), !isSocket && /* @__PURE__ */
|
|
1537
|
+
})), !isSocket && /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1480
1538
|
title: t("settings native redirect label")
|
|
1481
|
-
}, /* @__PURE__ */
|
|
1539
|
+
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1482
1540
|
checked: settings.enableNativeRedirect,
|
|
1483
1541
|
onCheckedChange: (checked) => settings.enableNativeRedirect = checked
|
|
1484
1542
|
})))));
|
|
@@ -1492,4 +1550,4 @@ export {
|
|
|
1492
1550
|
DeckLayout,
|
|
1493
1551
|
DeckSettings
|
|
1494
1552
|
};
|
|
1495
|
-
//# sourceMappingURL=chunk-
|
|
1553
|
+
//# sourceMappingURL=chunk-VUJ6UNIJ.mjs.map
|