@dxos/plugin-deck 0.8.1 → 0.8.2-main.2f9c567
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/{check-app-scheme-SEYECDHI.mjs → check-app-scheme-O7JPE4TM.mjs} +2 -3
- package/dist/lib/browser/check-app-scheme-O7JPE4TM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FJBMNSUC.mjs → chunk-AHTP72DY.mjs} +207 -162
- package/dist/lib/browser/chunk-AHTP72DY.mjs.map +7 -0
- package/dist/lib/browser/chunk-E7TOEOGO.mjs +157 -0
- package/dist/lib/browser/chunk-E7TOEOGO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6ZSOFCPP.mjs → chunk-PGSJT5PG.mjs} +8 -7
- package/dist/lib/browser/{chunk-6ZSOFCPP.mjs.map → chunk-PGSJT5PG.mjs.map} +3 -3
- package/dist/lib/browser/chunk-RKYIMUKW.mjs +24 -0
- package/dist/lib/browser/{chunk-B4LOJUWW.mjs.map → chunk-RKYIMUKW.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +5 -3
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-resolver-UDYKO2QW.mjs → intent-resolver-NO6L67KF.mjs} +78 -53
- package/dist/lib/browser/intent-resolver-NO6L67KF.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-XLXN2VEW.mjs → react-root-5RWCIUXV.mjs} +5 -5
- package/dist/lib/browser/{react-surface-WNGMZL7I.mjs → react-surface-DIDOPTH7.mjs} +5 -5
- package/dist/lib/browser/{settings-HMDGSBGO.mjs → settings-C7LX2GXF.mjs} +4 -4
- package/dist/lib/browser/settings-C7LX2GXF.mjs.map +7 -0
- package/dist/lib/browser/{state-7TN26M42.mjs → state-AX74YEJD.mjs} +6 -5
- package/dist/lib/browser/state-AX74YEJD.mjs.map +7 -0
- package/dist/lib/browser/{tools-SC6QEN7R.mjs → tools-7W7KZRAX.mjs} +7 -7
- package/dist/lib/browser/tools-7W7KZRAX.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/browser/{url-handler-ODG4B6NX.mjs → url-handler-AF5SYROZ.mjs} +2 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +8 -6
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +5 -4
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Dialog.d.ts +3 -0
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/Popover.d.ts +5 -0
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -0
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts +2 -2
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts +3 -2
- 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/Sidebar.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +106 -104
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts +2 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
- package/dist/types/src/util/useHoistStatusbar.d.ts +2 -1
- package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -1
- package/package.json +31 -29
- package/src/capabilities/check-app-scheme.ts +3 -5
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/intent-resolver.ts +120 -96
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/state.ts +3 -2
- package/src/capabilities/tools.ts +4 -3
- package/src/components/DeckLayout/ContentEmpty.tsx +6 -2
- package/src/components/DeckLayout/DeckLayout.tsx +114 -181
- package/src/components/DeckLayout/Dialog.tsx +36 -0
- package/src/components/DeckLayout/Popover.tsx +104 -0
- package/src/components/Plank/Plank.tsx +6 -3
- package/src/components/Plank/PlankControls.tsx +40 -34
- package/src/components/Plank/PlankError.tsx +2 -6
- package/src/components/Plank/PlankHeading.tsx +12 -5
- package/src/components/Sidebar/ComplementarySidebar.tsx +30 -20
- package/src/components/Sidebar/Sidebar.tsx +5 -3
- package/src/translations.ts +2 -0
- package/src/types.ts +75 -71
- package/src/util/layoutAppliesTopbar.ts +8 -2
- package/src/util/useHoistStatusbar.ts +9 -4
- package/dist/lib/browser/check-app-scheme-SEYECDHI.mjs.map +0 -7
- package/dist/lib/browser/chunk-B4LOJUWW.mjs +0 -24
- package/dist/lib/browser/chunk-FJBMNSUC.mjs.map +0 -7
- package/dist/lib/browser/chunk-RJNCG4ND.mjs +0 -154
- package/dist/lib/browser/chunk-RJNCG4ND.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-UDYKO2QW.mjs.map +0 -7
- package/dist/lib/browser/settings-HMDGSBGO.mjs.map +0 -7
- package/dist/lib/browser/state-7TN26M42.mjs.map +0 -7
- package/dist/lib/browser/tools-SC6QEN7R.mjs.map +0 -7
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts +0 -5
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts.map +0 -1
- package/src/components/DeckLayout/Fullscreen.tsx +0 -31
- /package/dist/lib/browser/{react-root-XLXN2VEW.mjs.map → react-root-5RWCIUXV.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-WNGMZL7I.mjs.map → react-surface-DIDOPTH7.mjs.map} +0 -0
- /package/dist/lib/browser/{url-handler-ODG4B6NX.mjs.map → url-handler-AF5SYROZ.mjs.map} +0 -0
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
useBreakpoints,
|
|
8
8
|
useCompanions,
|
|
9
9
|
useHoistStatusbar
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PGSJT5PG.mjs";
|
|
11
11
|
import {
|
|
12
12
|
DeckCapabilities
|
|
13
13
|
} from "./chunk-XMCG42ID.mjs";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
OverscrollOptions,
|
|
20
20
|
PLANK_COMPANION_TYPE,
|
|
21
21
|
getMode
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-E7TOEOGO.mjs";
|
|
23
23
|
import {
|
|
24
24
|
DECK_PLUGIN
|
|
25
25
|
} from "./chunk-NSATFAEE.mjs";
|
|
@@ -97,7 +97,7 @@ import { mainIntrinsicSize, mx as mx3 } from "@dxos/react-ui-theme";
|
|
|
97
97
|
// packages/plugins/plugin-deck/src/components/Plank/PlankError.tsx
|
|
98
98
|
import React5, { useEffect as useEffect2, useState } from "react";
|
|
99
99
|
import { useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
100
|
-
import {
|
|
100
|
+
import { descriptionMessage, mx as mx2 } from "@dxos/react-ui-theme";
|
|
101
101
|
|
|
102
102
|
// packages/plugins/plugin-deck/src/components/Plank/PlankHeading.tsx
|
|
103
103
|
import React3, { Fragment, memo, useCallback as useCallback2, useEffect, useMemo } from "react";
|
|
@@ -152,15 +152,15 @@ var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedR
|
|
|
152
152
|
}, /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
153
153
|
label: t("close companion label"),
|
|
154
154
|
variant: "ghost",
|
|
155
|
-
|
|
156
|
-
icon: "ph--caret-left--regular",
|
|
155
|
+
icon: "ph--x--regular",
|
|
157
156
|
onClick: handleCloseCompanion,
|
|
158
157
|
classNames: plankControlSpacing
|
|
159
158
|
}));
|
|
160
159
|
});
|
|
161
|
-
var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant = "default", capabilities,
|
|
160
|
+
var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant = "default", capabilities, layoutMode, pin, close = false, onClick, ...props }, forwardedRef) => {
|
|
162
161
|
const { t } = useTranslation2(DECK_PLUGIN);
|
|
163
162
|
const buttonClassNames = variant === "hide-disabled" ? `disabled:hidden ${plankControlSpacing}` : plankControlSpacing;
|
|
163
|
+
const layoutIsAnySolo = !!layoutMode?.startsWith("solo");
|
|
164
164
|
return /* @__PURE__ */ React2.createElement(ButtonGroup, {
|
|
165
165
|
...props,
|
|
166
166
|
classNames: [
|
|
@@ -168,12 +168,17 @@ var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant
|
|
|
168
168
|
classNames
|
|
169
169
|
],
|
|
170
170
|
ref: forwardedRef
|
|
171
|
-
}, capabilities.deck && capabilities.solo && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
172
|
-
label:
|
|
171
|
+
}, capabilities.deck && /* @__PURE__ */ React2.createElement(React2.Fragment, null, capabilities.solo && /* @__PURE__ */ React2.createElement(React2.Fragment, null, layoutMode === "solo" && /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
172
|
+
label: t("show fullscreen plank label"),
|
|
173
|
+
classNames: buttonClassNames,
|
|
174
|
+
icon: "ph--corners-out--regular",
|
|
175
|
+
onClick: () => onClick?.("solo--fullscreen")
|
|
176
|
+
}), /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
177
|
+
label: t(layoutMode === "solo--fullscreen" ? "exit fullscreen label" : layoutIsAnySolo ? "show deck plank label" : "show solo plank label"),
|
|
173
178
|
classNames: buttonClassNames,
|
|
174
|
-
icon:
|
|
175
|
-
onClick: () => onClick?.("solo")
|
|
176
|
-
}), !
|
|
179
|
+
icon: layoutMode === "solo--fullscreen" ? "ph--corners-in--regular" : layoutIsAnySolo ? "ph--arrows-in-line-horizontal--regular" : "ph--arrows-out-line-horizontal--regular",
|
|
180
|
+
onClick: () => onClick?.(layoutMode === "solo--fullscreen" ? "solo--fullscreen" : "solo")
|
|
181
|
+
})), !layoutIsAnySolo && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
177
182
|
label: t("increment start label"),
|
|
178
183
|
disabled: !capabilities.incrementStart,
|
|
179
184
|
classNames: buttonClassNames,
|
|
@@ -185,7 +190,7 @@ var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant
|
|
|
185
190
|
classNames: buttonClassNames,
|
|
186
191
|
icon: "ph--caret-right--regular",
|
|
187
192
|
onClick: () => onClick?.("increment-end")
|
|
188
|
-
}))), close && !
|
|
193
|
+
}))), close && !layoutIsAnySolo && /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
189
194
|
label: t(`${typeof close === "string" ? "minify" : "close"} label`),
|
|
190
195
|
classNames: buttonClassNames,
|
|
191
196
|
"data-testid": "plankHeading.close",
|
|
@@ -208,7 +213,8 @@ var fixedSidebarToggleStyles = mx(sidebarToggleStyles, "inline-start-2");
|
|
|
208
213
|
var fixedComplementarySidebarToggleStyles = mx(sidebarToggleStyles, "inline-end-2");
|
|
209
214
|
|
|
210
215
|
// packages/plugins/plugin-deck/src/components/Plank/PlankHeading.tsx
|
|
211
|
-
var
|
|
216
|
+
var MAX_COMPANIONS = 5;
|
|
217
|
+
var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncrementStart, canIncrementEnd, popoverAnchorId, primaryId, pending, companioned, companions, layoutMode, actions = [] }) => {
|
|
212
218
|
const { t } = useTranslation3(DECK_PLUGIN);
|
|
213
219
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
214
220
|
const { graph } = useAppGraph();
|
|
@@ -270,7 +276,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
270
276
|
});
|
|
271
277
|
}, []);
|
|
272
278
|
const handlePlankAction = useCallback2((eventType) => {
|
|
273
|
-
if (eventType
|
|
279
|
+
if (eventType.startsWith("solo")) {
|
|
274
280
|
return dispatch(createIntent2(DeckAction.Adjust, {
|
|
275
281
|
type: eventType,
|
|
276
282
|
id
|
|
@@ -320,9 +326,11 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
320
326
|
]);
|
|
321
327
|
return /* @__PURE__ */ React3.createElement(StackItem.Heading, {
|
|
322
328
|
classNames: [
|
|
323
|
-
"plb-1 border-be border-separator items-stretch gap-1 sticky inline-start-12 app-drag min-is-0 layout
|
|
324
|
-
part === "solo" ? soloInlinePadding : "pli-1"
|
|
325
|
-
|
|
329
|
+
"plb-1 border-be border-separator items-stretch gap-1 sticky inline-start-12 app-drag min-is-0 contain-layout",
|
|
330
|
+
part === "solo" ? soloInlinePadding : "pli-1",
|
|
331
|
+
layoutMode === "solo--fullscreen" && "opacity-0 border-transparent hover:border-separator hover:opacity-100 transition-[border-color,opacity]"
|
|
332
|
+
],
|
|
333
|
+
"data-plank-heading": true
|
|
326
334
|
}, companions && isCompanionNode ? /* @__PURE__ */ React3.createElement("div", {
|
|
327
335
|
role: "none",
|
|
328
336
|
className: "flex-1 min-is-0 overflow-x-auto scrollbar-thin flex gap-1"
|
|
@@ -330,7 +338,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
330
338
|
key: id2,
|
|
331
339
|
"data-id": id2,
|
|
332
340
|
icon: icon2,
|
|
333
|
-
iconOnly: node?.id !== id2,
|
|
341
|
+
iconOnly: companions.length > MAX_COMPANIONS && node?.id !== id2,
|
|
334
342
|
label: toLocalizedString(label4, t),
|
|
335
343
|
size: 5,
|
|
336
344
|
variant: node?.id === id2 ? "primary" : "default",
|
|
@@ -370,7 +378,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
370
378
|
primary: primaryId
|
|
371
379
|
}) : /* @__PURE__ */ React3.createElement(PlankControls, {
|
|
372
380
|
capabilities,
|
|
373
|
-
|
|
381
|
+
layoutMode,
|
|
374
382
|
close: part === "complementary" ? "minify-end" : true,
|
|
375
383
|
onClick: handlePlankAction
|
|
376
384
|
}));
|
|
@@ -394,7 +402,7 @@ var PlankContentError = ({ error }) => {
|
|
|
394
402
|
className: "overflow-auto p-8 attention-surface grid place-items-center"
|
|
395
403
|
}, /* @__PURE__ */ React5.createElement("p", {
|
|
396
404
|
role: "alert",
|
|
397
|
-
className: mx2(
|
|
405
|
+
className: mx2(descriptionMessage, "break-words rounded-lg p-8", errorString.length < 256 && "text-lg")
|
|
398
406
|
}, error ? errorString : t("error fallback message")));
|
|
399
407
|
};
|
|
400
408
|
var PlankError = ({ id, part, node, error }) => {
|
|
@@ -493,8 +501,8 @@ var PlankImpl = /* @__PURE__ */ memo2(({ id, node, part, path, order, active, la
|
|
|
493
501
|
scrollIntoView,
|
|
494
502
|
layoutMode
|
|
495
503
|
]);
|
|
496
|
-
const isSolo = layoutMode
|
|
497
|
-
const isAttendable = layoutMode
|
|
504
|
+
const isSolo = layoutMode.startsWith("solo") && part === "solo";
|
|
505
|
+
const isAttendable = layoutMode.startsWith("solo") && part.startsWith("solo") || layoutMode === "deck" && part === "deck";
|
|
498
506
|
const sizeAttrs = useMainSize();
|
|
499
507
|
const data = useMemo2(() => node && {
|
|
500
508
|
subject: node.data,
|
|
@@ -507,10 +515,11 @@ var PlankImpl = /* @__PURE__ */ memo2(({ id, node, part, path, order, active, la
|
|
|
507
515
|
node?.data,
|
|
508
516
|
path,
|
|
509
517
|
popoverAnchorId,
|
|
510
|
-
primary?.data
|
|
518
|
+
primary?.data,
|
|
519
|
+
variant
|
|
511
520
|
]);
|
|
512
521
|
const placeholder = useMemo2(() => /* @__PURE__ */ React6.createElement(PlankLoading, null), []);
|
|
513
|
-
const className = mx3("attention-surface relative", isSolo && mainIntrinsicSize, isSolo && railGridHorizontal, isSolo && "absolute inset-0", part.startsWith("solo") && "grid", part === "deck" && (companioned === "companion" ? "!border-separator border-ie" : "!border-separator border-li"), part.startsWith("solo-") && "row-span-2 grid-rows-subgrid min-is-0", part === "solo-companion" && "!border-separator border-is");
|
|
522
|
+
const className = mx3("attention-surface relative", isSolo && mainIntrinsicSize, isSolo && railGridHorizontal, isSolo && "absolute inset-0", part.startsWith("solo") && "grid", part === "deck" && (companioned === "companion" ? "!border-separator border-ie" : "!border-separator border-li"), part.startsWith("solo-") && "row-span-2 grid-rows-subgrid min-is-0", part === "solo-companion" && "!border-separator border-is", layoutMode === "solo--fullscreen" && "!transition-[margin-block-start,inline-size] -mbs-[--rail-action] has-[[data-plank-heading]:hover]:mbs-0");
|
|
514
523
|
return /* @__PURE__ */ React6.createElement(Root, {
|
|
515
524
|
ref: rootElement,
|
|
516
525
|
"data-testid": "deck.plank",
|
|
@@ -534,6 +543,7 @@ var PlankImpl = /* @__PURE__ */ memo2(({ id, node, part, path, order, active, la
|
|
|
534
543
|
id,
|
|
535
544
|
part: part.startsWith("solo-") ? "solo" : part,
|
|
536
545
|
node,
|
|
546
|
+
layoutMode,
|
|
537
547
|
deckEnabled: settings?.enableDeck,
|
|
538
548
|
canIncrementStart,
|
|
539
549
|
canIncrementEnd,
|
|
@@ -621,12 +631,13 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
621
631
|
const { t } = useTranslation5(DECK_PLUGIN);
|
|
622
632
|
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
623
633
|
const layout = useCapability3(DeckCapabilities.MutableDeckState);
|
|
634
|
+
const layoutMode = getMode(layout.deck);
|
|
624
635
|
const breakpoint = useBreakpoints();
|
|
625
|
-
const topbar = layoutAppliesTopbar(breakpoint);
|
|
626
|
-
const hoistStatusbar = useHoistStatusbar(breakpoint);
|
|
636
|
+
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
637
|
+
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
627
638
|
const companions = useDeckCompanions();
|
|
628
|
-
const activeCompanion = companions.find((companion) => getCompanionId(companion.id) === current)
|
|
629
|
-
const activeId = getCompanionId(activeCompanion
|
|
639
|
+
const activeCompanion = companions.find((companion) => getCompanionId(companion.id) === current);
|
|
640
|
+
const activeId = activeCompanion && getCompanionId(activeCompanion.id);
|
|
630
641
|
const [internalValue, setInternalValue] = useState2(activeId);
|
|
631
642
|
useEffect4(() => {
|
|
632
643
|
setInternalValue(activeId);
|
|
@@ -657,6 +668,19 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
657
668
|
activeCompanion?.id,
|
|
658
669
|
activeCompanion?.data
|
|
659
670
|
]);
|
|
671
|
+
useEffect4(() => {
|
|
672
|
+
if (!activeId) {
|
|
673
|
+
void dispatch(createIntent4(LayoutAction3.UpdateComplementary, {
|
|
674
|
+
part: "complementary",
|
|
675
|
+
options: {
|
|
676
|
+
state: "collapsed"
|
|
677
|
+
}
|
|
678
|
+
}));
|
|
679
|
+
}
|
|
680
|
+
}, [
|
|
681
|
+
activeId,
|
|
682
|
+
dispatch
|
|
683
|
+
]);
|
|
660
684
|
return /* @__PURE__ */ React7.createElement(Main.ComplementarySidebar, {
|
|
661
685
|
label,
|
|
662
686
|
classNames: [
|
|
@@ -695,7 +719,7 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
695
719
|
})), /* @__PURE__ */ React7.createElement("div", {
|
|
696
720
|
role: "none",
|
|
697
721
|
className: "hidden lg:grid grid-cols-1 auto-rows-[--rail-action] p-1"
|
|
698
|
-
}, /* @__PURE__ */ React7.createElement(ToggleComplementarySidebarButton, null))), companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tabpanel, {
|
|
722
|
+
}, /* @__PURE__ */ React7.createElement(ToggleComplementarySidebarButton, null))), activeId && companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tabpanel, {
|
|
699
723
|
key: getCompanionId(companion.id),
|
|
700
724
|
value: getCompanionId(companion.id),
|
|
701
725
|
classNames: 'absolute data-[state="inactive"]:-z-[1] inset-block-0 inline-start-0 is-[calc(100%-var(--r0-size))] lg:is-[--r1-size] grid grid-cols-1 grid-rows-[var(--rail-size)_1fr_min-content] pbs-[env(safe-area-inset-top)]',
|
|
@@ -747,10 +771,11 @@ var label2 = [
|
|
|
747
771
|
}
|
|
748
772
|
];
|
|
749
773
|
var Sidebar = () => {
|
|
750
|
-
const { popoverAnchorId, activeDeck: current } = useCapability4(DeckCapabilities.DeckState);
|
|
774
|
+
const { popoverAnchorId, activeDeck: current, deck } = useCapability4(DeckCapabilities.DeckState);
|
|
751
775
|
const breakpoint = useBreakpoints();
|
|
752
|
-
const
|
|
753
|
-
const
|
|
776
|
+
const layoutMode = getMode(deck);
|
|
777
|
+
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
778
|
+
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
754
779
|
const navigationData = useMemo4(() => ({
|
|
755
780
|
popoverAnchorId,
|
|
756
781
|
topbar,
|
|
@@ -808,10 +833,10 @@ var Banner = ({ variant, classNames }) => {
|
|
|
808
833
|
|
|
809
834
|
// packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
|
|
810
835
|
import { untracked } from "@preact/signals-core";
|
|
811
|
-
import React17, { useCallback as
|
|
812
|
-
import { Capabilities, LayoutAction as LayoutAction4,
|
|
836
|
+
import React17, { useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo6, useRef as useRef3, Fragment as Fragment4 } from "react";
|
|
837
|
+
import { Capabilities, LayoutAction as LayoutAction4, createIntent as createIntent5, useCapability as useCapability8, useIntentDispatcher as useIntentDispatcher5, usePluginManager } from "@dxos/app-framework";
|
|
813
838
|
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
814
|
-
import {
|
|
839
|
+
import { Main as Main3, useMediaQuery, useOnTransition } from "@dxos/react-ui";
|
|
815
840
|
import { Stack, StackContext, DEFAULT_HORIZONTAL_SIZE } from "@dxos/react-ui-stack";
|
|
816
841
|
import { mainPaddingTransitions } from "@dxos/react-ui-theme";
|
|
817
842
|
|
|
@@ -839,10 +864,12 @@ var ActiveNode = () => {
|
|
|
839
864
|
|
|
840
865
|
// packages/plugins/plugin-deck/src/components/DeckLayout/ContentEmpty.tsx
|
|
841
866
|
import React11 from "react";
|
|
842
|
-
import { Surface as Surface7 } from "@dxos/app-framework";
|
|
867
|
+
import { Surface as Surface7, useCapability as useCapability5 } from "@dxos/app-framework";
|
|
843
868
|
var ContentEmpty = () => {
|
|
844
869
|
const breakpoint = useBreakpoints();
|
|
845
|
-
const
|
|
870
|
+
const { deck } = useCapability5(DeckCapabilities.MutableDeckState);
|
|
871
|
+
const layoutMode = getMode(deck);
|
|
872
|
+
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
846
873
|
return /* @__PURE__ */ React11.createElement("div", {
|
|
847
874
|
role: "none",
|
|
848
875
|
className: "grid place-items-center p-8 relative bg-deck",
|
|
@@ -855,51 +882,123 @@ var ContentEmpty = () => {
|
|
|
855
882
|
}));
|
|
856
883
|
};
|
|
857
884
|
|
|
858
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/
|
|
859
|
-
import React13 from "react";
|
|
860
|
-
import { Surface as Surface8, useAppGraph as useAppGraph5 } from "@dxos/app-framework";
|
|
861
|
-
import { useNode as useNode3 } from "@dxos/plugin-graph";
|
|
862
|
-
import { fixedInsetFlexLayout } from "@dxos/react-ui-theme";
|
|
863
|
-
|
|
864
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/Fallback.tsx
|
|
885
|
+
// packages/plugins/plugin-deck/src/components/DeckLayout/Dialog.tsx
|
|
865
886
|
import React12 from "react";
|
|
866
|
-
import {
|
|
867
|
-
import {
|
|
868
|
-
var
|
|
869
|
-
const
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
887
|
+
import { Surface as Surface8, useCapability as useCapability6 } from "@dxos/app-framework";
|
|
888
|
+
import { AlertDialog, Dialog as NaturalDialog } from "@dxos/react-ui";
|
|
889
|
+
var Dialog = () => {
|
|
890
|
+
const context = useCapability6(DeckCapabilities.MutableDeckState);
|
|
891
|
+
const { dialogType, dialogBlockAlign, dialogContent, dialogOpen } = context;
|
|
892
|
+
const Root = dialogType === "alert" ? AlertDialog.Root : NaturalDialog.Root;
|
|
893
|
+
const Overlay = dialogType === "alert" ? AlertDialog.Overlay : NaturalDialog.Overlay;
|
|
894
|
+
return /* @__PURE__ */ React12.createElement(Root, {
|
|
895
|
+
modal: dialogBlockAlign !== "end",
|
|
896
|
+
open: dialogOpen,
|
|
897
|
+
onOpenChange: (nextOpen) => context.dialogOpen = nextOpen
|
|
898
|
+
}, dialogBlockAlign === "end" ? (
|
|
899
|
+
// TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
|
|
900
|
+
/* @__PURE__ */ React12.createElement(Surface8, {
|
|
901
|
+
role: "dialog",
|
|
902
|
+
data: dialogContent,
|
|
903
|
+
limit: 1,
|
|
904
|
+
fallback: PlankContentError,
|
|
905
|
+
placeholder: /* @__PURE__ */ React12.createElement("div", null)
|
|
906
|
+
})
|
|
907
|
+
) : /* @__PURE__ */ React12.createElement(Overlay, {
|
|
908
|
+
blockAlign: dialogBlockAlign
|
|
909
|
+
}, /* @__PURE__ */ React12.createElement(Surface8, {
|
|
910
|
+
role: "dialog",
|
|
911
|
+
data: dialogContent,
|
|
912
|
+
limit: 1,
|
|
913
|
+
fallback: PlankContentError
|
|
914
|
+
})));
|
|
877
915
|
};
|
|
878
916
|
|
|
879
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
917
|
+
// packages/plugins/plugin-deck/src/components/DeckLayout/Popover.tsx
|
|
918
|
+
import { createContext } from "@radix-ui/react-context";
|
|
919
|
+
import React13, { useCallback as useCallback5, useEffect as useEffect5, useMemo as useMemo5, useRef as useRef2, useState as useState3 } from "react";
|
|
920
|
+
import { Surface as Surface9, useCapability as useCapability7 } from "@dxos/app-framework";
|
|
921
|
+
import { Popover as Popover2 } from "@dxos/react-ui";
|
|
922
|
+
var DEBOUNCE_DELAY = 40;
|
|
923
|
+
var [DeckPopoverProvider, useDeckPopoverContext] = createContext("DeckPopover");
|
|
924
|
+
var PopoverRoot = ({ children }) => {
|
|
925
|
+
const layout = useCapability7(DeckCapabilities.MutableDeckState);
|
|
926
|
+
const virtualRef = useRef2(null);
|
|
927
|
+
const [virtualIter, setVirtualIter] = useState3(0);
|
|
928
|
+
const [open, setOpen] = useState3(false);
|
|
929
|
+
const debounceRef = useRef2(null);
|
|
930
|
+
useEffect5(() => {
|
|
931
|
+
setOpen(false);
|
|
932
|
+
if (layout.popoverOpen) {
|
|
933
|
+
if (debounceRef.current) {
|
|
934
|
+
clearTimeout(debounceRef.current);
|
|
935
|
+
}
|
|
936
|
+
if (layout.popoverAnchor && virtualRef.current !== layout.popoverAnchor) {
|
|
937
|
+
virtualRef.current = layout.popoverAnchor ?? null;
|
|
938
|
+
setVirtualIter((iter) => iter + 1);
|
|
939
|
+
}
|
|
940
|
+
debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
|
|
896
941
|
}
|
|
897
|
-
}
|
|
942
|
+
}, [
|
|
943
|
+
layout.popoverOpen,
|
|
944
|
+
layout.popoverAnchorId,
|
|
945
|
+
layout.popoverAnchor,
|
|
946
|
+
layout.popoverContent
|
|
947
|
+
]);
|
|
948
|
+
return /* @__PURE__ */ React13.createElement(DeckPopoverProvider, {
|
|
949
|
+
setOpen
|
|
950
|
+
}, /* @__PURE__ */ React13.createElement(Popover2.Root, {
|
|
951
|
+
modal: false,
|
|
952
|
+
open
|
|
953
|
+
}, layout.popoverAnchor && /* @__PURE__ */ React13.createElement(Popover2.VirtualTrigger, {
|
|
954
|
+
key: virtualIter,
|
|
955
|
+
virtualRef
|
|
956
|
+
}), children));
|
|
957
|
+
};
|
|
958
|
+
var PopoverContent = () => {
|
|
959
|
+
const layout = useCapability7(DeckCapabilities.MutableDeckState);
|
|
960
|
+
const { setOpen } = useDeckPopoverContext("PopoverContent");
|
|
961
|
+
const handleClose = useCallback5((event) => {
|
|
962
|
+
if (
|
|
963
|
+
// TODO(thure): CodeMirror should not focus itself when it updates.
|
|
964
|
+
event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
|
|
965
|
+
) {
|
|
966
|
+
event.preventDefault();
|
|
967
|
+
} else {
|
|
968
|
+
setOpen(false);
|
|
969
|
+
layout.popoverOpen = false;
|
|
970
|
+
layout.popoverAnchor = void 0;
|
|
971
|
+
layout.popoverAnchorId = void 0;
|
|
972
|
+
layout.popoverSide = void 0;
|
|
973
|
+
}
|
|
974
|
+
}, [
|
|
975
|
+
setOpen
|
|
976
|
+
]);
|
|
977
|
+
const collisionBoundaries = useMemo5(() => {
|
|
978
|
+
const closest = layout.popoverAnchor?.closest("[data-popover-collision-boundary]");
|
|
979
|
+
return closest ? [
|
|
980
|
+
closest
|
|
981
|
+
] : [];
|
|
982
|
+
}, [
|
|
983
|
+
layout.popoverAnchor
|
|
984
|
+
]);
|
|
985
|
+
return /* @__PURE__ */ React13.createElement(Popover2.Portal, null, /* @__PURE__ */ React13.createElement(Popover2.Content, {
|
|
986
|
+
side: layout.popoverSide,
|
|
987
|
+
onInteractOutside: handleClose,
|
|
988
|
+
onEscapeKeyDown: handleClose,
|
|
989
|
+
collisionBoundary: collisionBoundaries,
|
|
990
|
+
sticky: "always",
|
|
991
|
+
hideWhenDetached: true
|
|
992
|
+
}, /* @__PURE__ */ React13.createElement(Popover2.Viewport, null, /* @__PURE__ */ React13.createElement(Surface9, {
|
|
993
|
+
role: "popover",
|
|
994
|
+
data: layout.popoverContent,
|
|
995
|
+
limit: 1
|
|
996
|
+
})), /* @__PURE__ */ React13.createElement(Popover2.Arrow, null)));
|
|
898
997
|
};
|
|
899
998
|
|
|
900
999
|
// packages/plugins/plugin-deck/src/components/DeckLayout/StatusBar.tsx
|
|
901
1000
|
import React14 from "react";
|
|
902
|
-
import { Surface as
|
|
1001
|
+
import { Surface as Surface10 } from "@dxos/app-framework";
|
|
903
1002
|
import { useLandmarkMover } from "@dxos/react-ui";
|
|
904
1003
|
var StatusBar = ({ showHints }) => {
|
|
905
1004
|
const mover = useLandmarkMover(void 0, "3");
|
|
@@ -907,10 +1006,10 @@ var StatusBar = ({ showHints }) => {
|
|
|
907
1006
|
role: "contentinfo",
|
|
908
1007
|
className: "fixed block-end-0 inset-inline-0 bs-[--statusbar-size] border-bs border-separator z-[2] flex text-description",
|
|
909
1008
|
...mover
|
|
910
|
-
}, showHints && /* @__PURE__ */ React14.createElement(
|
|
1009
|
+
}, showHints && /* @__PURE__ */ React14.createElement(Surface10, {
|
|
911
1010
|
role: "hints",
|
|
912
1011
|
limit: 1
|
|
913
|
-
}), /* @__PURE__ */ React14.createElement(
|
|
1012
|
+
}), /* @__PURE__ */ React14.createElement(Surface10, {
|
|
914
1013
|
role: "status-bar",
|
|
915
1014
|
limit: 1
|
|
916
1015
|
}));
|
|
@@ -918,9 +1017,9 @@ var StatusBar = ({ showHints }) => {
|
|
|
918
1017
|
|
|
919
1018
|
// packages/plugins/plugin-deck/src/components/DeckLayout/Toast.tsx
|
|
920
1019
|
import React15 from "react";
|
|
921
|
-
import { Button as Button2, Icon as Icon3, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as
|
|
1020
|
+
import { Button as Button2, Icon as Icon3, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
922
1021
|
var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange }) => {
|
|
923
|
-
const { t } =
|
|
1022
|
+
const { t } = useTranslation7(DECK_PLUGIN);
|
|
924
1023
|
return /* @__PURE__ */ React15.createElement(NaturalToast.Root, {
|
|
925
1024
|
"data-testid": id,
|
|
926
1025
|
defaultOpen: true,
|
|
@@ -964,23 +1063,18 @@ var PlankSeparator = ({ order }) => order > 0 ? /* @__PURE__ */ React17.createEl
|
|
|
964
1063
|
}) : null;
|
|
965
1064
|
var DeckLayout = ({ onDismissToast }) => {
|
|
966
1065
|
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
967
|
-
const settings =
|
|
968
|
-
const context =
|
|
969
|
-
const { sidebarState, complementarySidebarState, complementarySidebarPanel,
|
|
1066
|
+
const settings = useCapability8(Capabilities.SettingsStore).getStore(DECK_PLUGIN).value;
|
|
1067
|
+
const context = useCapability8(DeckCapabilities.MutableDeckState);
|
|
1068
|
+
const { sidebarState, complementarySidebarState, complementarySidebarPanel, deck, toasts } = context;
|
|
970
1069
|
const { active, activeCompanions, fullscreen, solo, plankSizing } = deck;
|
|
971
1070
|
const breakpoint = useBreakpoints();
|
|
972
|
-
const
|
|
973
|
-
const
|
|
1071
|
+
const layoutMode = getMode(deck);
|
|
1072
|
+
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
1073
|
+
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
974
1074
|
const pluginManager = usePluginManager();
|
|
975
|
-
const scrollLeftRef =
|
|
976
|
-
const deckRef =
|
|
977
|
-
|
|
978
|
-
useEffect5(() => {
|
|
979
|
-
popoverOpen ? setTimeout(() => setDelayedPopoverVisibility(true), 40) : setDelayedPopoverVisibility(false);
|
|
980
|
-
}, [
|
|
981
|
-
popoverOpen
|
|
982
|
-
]);
|
|
983
|
-
useEffect5(() => {
|
|
1075
|
+
const scrollLeftRef = useRef3();
|
|
1076
|
+
const deckRef = useRef3(null);
|
|
1077
|
+
useEffect6(() => {
|
|
984
1078
|
const attended = untracked(() => {
|
|
985
1079
|
const attention = pluginManager.context.requestCapability(AttentionCapabilities.Attention);
|
|
986
1080
|
return attention.current;
|
|
@@ -993,8 +1087,8 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
993
1087
|
const [isNotMobile] = useMediaQuery("md", {
|
|
994
1088
|
ssr: false
|
|
995
1089
|
});
|
|
996
|
-
const shouldRevert =
|
|
997
|
-
|
|
1090
|
+
const shouldRevert = useRef3(false);
|
|
1091
|
+
useEffect6(() => {
|
|
998
1092
|
if (!isNotMobile && getMode(deck) === "deck") {
|
|
999
1093
|
const attended = untracked(() => {
|
|
1000
1094
|
const attention = pluginManager.context.requestCapability(AttentionCapabilities.Attention);
|
|
@@ -1021,7 +1115,7 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1021
1115
|
deck,
|
|
1022
1116
|
dispatch
|
|
1023
1117
|
]);
|
|
1024
|
-
|
|
1118
|
+
useEffect6(() => {
|
|
1025
1119
|
if (!settings.enableDeck) {
|
|
1026
1120
|
void dispatch(createIntent5(LayoutAction4.SetLayoutMode, {
|
|
1027
1121
|
part: "mode",
|
|
@@ -1036,23 +1130,22 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1036
1130
|
dispatch,
|
|
1037
1131
|
active
|
|
1038
1132
|
]);
|
|
1039
|
-
const handleResize =
|
|
1133
|
+
const handleResize = useCallback6(() => {
|
|
1040
1134
|
scrollLeftRef.current = null;
|
|
1041
1135
|
}, []);
|
|
1042
|
-
|
|
1136
|
+
useEffect6(() => {
|
|
1043
1137
|
window.addEventListener("resize", handleResize);
|
|
1044
1138
|
return () => window.removeEventListener("resize", handleResize);
|
|
1045
1139
|
}, [
|
|
1046
1140
|
handleResize
|
|
1047
1141
|
]);
|
|
1048
|
-
const restoreScroll =
|
|
1142
|
+
const restoreScroll = useCallback6(() => {
|
|
1049
1143
|
if (deckRef.current && scrollLeftRef.current != null) {
|
|
1050
1144
|
deckRef.current.scrollLeft = scrollLeftRef.current;
|
|
1051
1145
|
}
|
|
1052
1146
|
}, []);
|
|
1053
|
-
const layoutMode = getMode(deck);
|
|
1054
1147
|
useOnTransition(layoutMode, (mode) => mode !== "deck", "deck", restoreScroll);
|
|
1055
|
-
const handleScroll =
|
|
1148
|
+
const handleScroll = useCallback6((event) => {
|
|
1056
1149
|
if (!solo && event.currentTarget === event.target) {
|
|
1057
1150
|
scrollLeftRef.current = event.target.scrollLeft;
|
|
1058
1151
|
}
|
|
@@ -1060,7 +1153,7 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1060
1153
|
solo
|
|
1061
1154
|
]);
|
|
1062
1155
|
const isEmpty = !solo && active.length === 0;
|
|
1063
|
-
const padding =
|
|
1156
|
+
const padding = useMemo6(() => {
|
|
1064
1157
|
if (!solo && settings.overscroll === "centering") {
|
|
1065
1158
|
return calculateOverscroll(active.length);
|
|
1066
1159
|
}
|
|
@@ -1070,7 +1163,7 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1070
1163
|
settings.overscroll,
|
|
1071
1164
|
deck
|
|
1072
1165
|
]);
|
|
1073
|
-
const mainPosition =
|
|
1166
|
+
const mainPosition = useMemo6(() => [
|
|
1074
1167
|
"grid !block-start-[env(safe-area-inset-top)]",
|
|
1075
1168
|
topbar && "!block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
|
|
1076
1169
|
hoistStatusbar && "lg:block-end-[--statusbar-size]"
|
|
@@ -1078,22 +1171,7 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1078
1171
|
topbar,
|
|
1079
1172
|
hoistStatusbar
|
|
1080
1173
|
]);
|
|
1081
|
-
const
|
|
1082
|
-
const handlePopoverOpenChange = useCallback5((nextOpen) => {
|
|
1083
|
-
if (nextOpen && popoverAnchorId) {
|
|
1084
|
-
context.popoverOpen = true;
|
|
1085
|
-
} else {
|
|
1086
|
-
context.popoverOpen = false;
|
|
1087
|
-
context.popoverAnchorId = void 0;
|
|
1088
|
-
context.popoverSide = void 0;
|
|
1089
|
-
}
|
|
1090
|
-
}, [
|
|
1091
|
-
context
|
|
1092
|
-
]);
|
|
1093
|
-
const handlePopoverClose = useCallback5(() => handlePopoverOpenChange(false), [
|
|
1094
|
-
handlePopoverOpenChange
|
|
1095
|
-
]);
|
|
1096
|
-
const { order, itemsCount } = useMemo5(() => {
|
|
1174
|
+
const { order, itemsCount } = useMemo6(() => {
|
|
1097
1175
|
return active.reduce((acc, entryId) => {
|
|
1098
1176
|
acc.order[entryId] = acc.itemsCount + 1;
|
|
1099
1177
|
acc.itemsCount += activeCompanions?.[entryId] ? 3 : 2;
|
|
@@ -1106,16 +1184,10 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1106
1184
|
active,
|
|
1107
1185
|
activeCompanions
|
|
1108
1186
|
]);
|
|
1109
|
-
return /* @__PURE__ */ React17.createElement(
|
|
1110
|
-
|
|
1111
|
-
open: !!(popoverAnchorId && delayedPopoverVisibility),
|
|
1112
|
-
onOpenChange: handlePopoverOpenChange
|
|
1113
|
-
}, /* @__PURE__ */ React17.createElement(ActiveNode, null), fullscreen && /* @__PURE__ */ React17.createElement(Fullscreen, {
|
|
1114
|
-
id: solo
|
|
1115
|
-
}), !fullscreen && /* @__PURE__ */ React17.createElement(Main3.Root, {
|
|
1116
|
-
navigationSidebarState: context.sidebarState,
|
|
1187
|
+
return /* @__PURE__ */ React17.createElement(PopoverRoot, null, /* @__PURE__ */ React17.createElement(ActiveNode, null), /* @__PURE__ */ React17.createElement(Main3.Root, {
|
|
1188
|
+
navigationSidebarState: fullscreen ? "closed" : context.sidebarState,
|
|
1117
1189
|
onNavigationSidebarStateChange: (next) => context.sidebarState = next,
|
|
1118
|
-
complementarySidebarState: context.complementarySidebarState,
|
|
1190
|
+
complementarySidebarState: fullscreen ? "closed" : context.complementarySidebarState,
|
|
1119
1191
|
onComplementarySidebarStateChange: (next) => context.complementarySidebarState = next
|
|
1120
1192
|
}, /* @__PURE__ */ React17.createElement(Sidebar, null), /* @__PURE__ */ React17.createElement(ComplementarySidebar, {
|
|
1121
1193
|
current: complementarySidebarPanel
|
|
@@ -1139,9 +1211,9 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1139
1211
|
...solo && {
|
|
1140
1212
|
inert: ""
|
|
1141
1213
|
}
|
|
1142
|
-
}, !topbar && /* @__PURE__ */ React17.createElement(ToggleSidebarButton, {
|
|
1214
|
+
}, !topbar && !fullscreen && /* @__PURE__ */ React17.createElement(ToggleSidebarButton, {
|
|
1143
1215
|
classNames: fixedSidebarToggleStyles
|
|
1144
|
-
}), !topbar && /* @__PURE__ */ React17.createElement(ToggleComplementarySidebarButton, {
|
|
1216
|
+
}), !topbar && !fullscreen && /* @__PURE__ */ React17.createElement(ToggleComplementarySidebarButton, {
|
|
1145
1217
|
classNames: fixedComplementarySidebarToggleStyles
|
|
1146
1218
|
}), /* @__PURE__ */ React17.createElement(Stack, {
|
|
1147
1219
|
ref: deckRef,
|
|
@@ -1172,9 +1244,9 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1172
1244
|
...!solo && {
|
|
1173
1245
|
inert: ""
|
|
1174
1246
|
}
|
|
1175
|
-
}, !topbar && /* @__PURE__ */ React17.createElement(ToggleSidebarButton, {
|
|
1247
|
+
}, !topbar && !fullscreen && /* @__PURE__ */ React17.createElement(ToggleSidebarButton, {
|
|
1176
1248
|
classNames: fixedSidebarToggleStyles
|
|
1177
|
-
}), !topbar && /* @__PURE__ */ React17.createElement(ToggleComplementarySidebarButton, {
|
|
1249
|
+
}), !topbar && !fullscreen && /* @__PURE__ */ React17.createElement(ToggleComplementarySidebarButton, {
|
|
1178
1250
|
classNames: fixedComplementarySidebarToggleStyles
|
|
1179
1251
|
}), /* @__PURE__ */ React17.createElement(StackContext.Provider, {
|
|
1180
1252
|
value: {
|
|
@@ -1190,34 +1262,7 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1190
1262
|
settings
|
|
1191
1263
|
})))), topbar && /* @__PURE__ */ React17.createElement(Topbar, null), hoistStatusbar && /* @__PURE__ */ React17.createElement(StatusBar, {
|
|
1192
1264
|
showHints: settings.showHints
|
|
1193
|
-
})), /* @__PURE__ */ React17.createElement(
|
|
1194
|
-
side: context.popoverSide,
|
|
1195
|
-
onEscapeKeyDown: handlePopoverClose
|
|
1196
|
-
}, /* @__PURE__ */ React17.createElement(Popover2.Viewport, null, /* @__PURE__ */ React17.createElement(Surface10, {
|
|
1197
|
-
role: "popover",
|
|
1198
|
-
data: popoverContent,
|
|
1199
|
-
limit: 1
|
|
1200
|
-
})), /* @__PURE__ */ React17.createElement(Popover2.Arrow, null))), /* @__PURE__ */ React17.createElement(Dialog.Root, {
|
|
1201
|
-
modal: dialogBlockAlign !== "end",
|
|
1202
|
-
open: dialogOpen,
|
|
1203
|
-
onOpenChange: (nextOpen) => context.dialogOpen = nextOpen
|
|
1204
|
-
}, dialogBlockAlign === "end" ? (
|
|
1205
|
-
// TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
|
|
1206
|
-
/* @__PURE__ */ React17.createElement(Surface10, {
|
|
1207
|
-
role: "dialog",
|
|
1208
|
-
data: dialogContent,
|
|
1209
|
-
limit: 1,
|
|
1210
|
-
fallback: PlankContentError,
|
|
1211
|
-
placeholder: /* @__PURE__ */ React17.createElement("div", null)
|
|
1212
|
-
})
|
|
1213
|
-
) : /* @__PURE__ */ React17.createElement(Dialog.Overlay, {
|
|
1214
|
-
blockAlign: dialogBlockAlign
|
|
1215
|
-
}, /* @__PURE__ */ React17.createElement(Surface10, {
|
|
1216
|
-
role: "dialog",
|
|
1217
|
-
data: dialogContent,
|
|
1218
|
-
limit: 1,
|
|
1219
|
-
fallback: PlankContentError
|
|
1220
|
-
}))), toasts?.map((toast) => /* @__PURE__ */ React17.createElement(Toast, {
|
|
1265
|
+
})), /* @__PURE__ */ React17.createElement(PopoverContent, null), /* @__PURE__ */ React17.createElement(Dialog, null), toasts?.map((toast) => /* @__PURE__ */ React17.createElement(Toast, {
|
|
1221
1266
|
...toast,
|
|
1222
1267
|
key: toast.id,
|
|
1223
1268
|
onOpenChange: (open) => {
|
|
@@ -1231,11 +1276,11 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1231
1276
|
|
|
1232
1277
|
// packages/plugins/plugin-deck/src/components/DeckSettings/DeckSettings.tsx
|
|
1233
1278
|
import React18 from "react";
|
|
1234
|
-
import { Input, Select, useTranslation as
|
|
1279
|
+
import { Input, Select, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
1235
1280
|
import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1236
1281
|
var isSocket = !!globalThis.__args;
|
|
1237
1282
|
var DeckSettings = ({ settings }) => {
|
|
1238
|
-
const { t } =
|
|
1283
|
+
const { t } = useTranslation8(DECK_PLUGIN);
|
|
1239
1284
|
return /* @__PURE__ */ React18.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
|
|
1240
1285
|
label: t("settings enable deck label")
|
|
1241
1286
|
}, /* @__PURE__ */ React18.createElement(Input.Switch, {
|
|
@@ -1286,4 +1331,4 @@ export {
|
|
|
1286
1331
|
DeckLayout,
|
|
1287
1332
|
DeckSettings
|
|
1288
1333
|
};
|
|
1289
|
-
//# sourceMappingURL=chunk-
|
|
1334
|
+
//# sourceMappingURL=chunk-AHTP72DY.mjs.map
|