@dxos/plugin-deck 0.8.2-main.f11618f → 0.8.2-staging.7ac8446
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-O7JPE4TM.mjs → check-app-scheme-SEYECDHI.mjs} +3 -2
- package/dist/lib/browser/check-app-scheme-SEYECDHI.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6HJZL3WT.mjs → chunk-6ZSOFCPP.mjs} +7 -8
- package/dist/lib/browser/{chunk-6HJZL3WT.mjs.map → chunk-6ZSOFCPP.mjs.map} +3 -3
- package/dist/lib/browser/chunk-B4LOJUWW.mjs +24 -0
- package/dist/lib/browser/{chunk-RBJ6DLAC.mjs.map → chunk-B4LOJUWW.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-RDFJGGGX.mjs → chunk-FJBMNSUC.mjs} +162 -207
- package/dist/lib/browser/chunk-FJBMNSUC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZMJMCN7O.mjs → chunk-RJNCG4ND.mjs} +6 -9
- package/dist/lib/browser/chunk-RJNCG4ND.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3 -5
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-resolver-JKWXWUV6.mjs → intent-resolver-UDYKO2QW.mjs} +34 -59
- package/dist/lib/browser/intent-resolver-UDYKO2QW.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-S6ZAKNZA.mjs → react-root-XLXN2VEW.mjs} +5 -5
- package/dist/lib/browser/{react-surface-I7WZBOGM.mjs → react-surface-WNGMZL7I.mjs} +5 -5
- package/dist/lib/browser/{settings-6NU7CF2B.mjs → settings-HMDGSBGO.mjs} +4 -4
- package/dist/lib/browser/settings-HMDGSBGO.mjs.map +7 -0
- package/dist/lib/browser/{state-Z6UY2Z3M.mjs → state-7TN26M42.mjs} +5 -6
- package/dist/lib/browser/state-7TN26M42.mjs.map +7 -0
- package/dist/lib/browser/{tools-VDVQTJMD.mjs → tools-SC6QEN7R.mjs} +2 -2
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/browser/{url-handler-3CARFXQK.mjs → url-handler-ODG4B6NX.mjs} +2 -2
- package/dist/types/src/capabilities/capabilities.d.ts +6 -8
- 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 +4 -5
- package/dist/types/src/capabilities/state.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/Fullscreen.d.ts +5 -0
- package/dist/types/src/components/DeckLayout/Fullscreen.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 +2 -3
- 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 +0 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +9 -11
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts +1 -2
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
- package/dist/types/src/util/useHoistStatusbar.d.ts +1 -2
- package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -1
- package/package.json +28 -29
- package/src/capabilities/check-app-scheme.ts +5 -3
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/intent-resolver.ts +65 -89
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/state.ts +2 -3
- package/src/components/DeckLayout/ContentEmpty.tsx +2 -6
- package/src/components/DeckLayout/DeckLayout.tsx +181 -114
- package/src/components/DeckLayout/Fullscreen.tsx +31 -0
- package/src/components/Plank/Plank.tsx +3 -6
- package/src/components/Plank/PlankControls.tsx +34 -40
- package/src/components/Plank/PlankError.tsx +6 -2
- package/src/components/Plank/PlankHeading.tsx +5 -12
- package/src/components/Sidebar/ComplementarySidebar.tsx +20 -30
- package/src/components/Sidebar/Sidebar.tsx +3 -5
- package/src/translations.ts +0 -2
- package/src/types.ts +6 -9
- package/src/util/layoutAppliesTopbar.ts +2 -8
- package/src/util/useHoistStatusbar.ts +4 -9
- package/dist/lib/browser/check-app-scheme-O7JPE4TM.mjs.map +0 -7
- package/dist/lib/browser/chunk-RBJ6DLAC.mjs +0 -24
- package/dist/lib/browser/chunk-RDFJGGGX.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZMJMCN7O.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-JKWXWUV6.mjs.map +0 -7
- package/dist/lib/browser/settings-6NU7CF2B.mjs.map +0 -7
- package/dist/lib/browser/state-Z6UY2Z3M.mjs.map +0 -7
- package/dist/types/src/components/DeckLayout/Dialog.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts +0 -5
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +0 -1
- package/src/components/DeckLayout/Dialog.tsx +0 -36
- package/src/components/DeckLayout/Popover.tsx +0 -104
- /package/dist/lib/browser/{react-root-S6ZAKNZA.mjs.map → react-root-XLXN2VEW.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-I7WZBOGM.mjs.map → react-surface-WNGMZL7I.mjs.map} +0 -0
- /package/dist/lib/browser/{tools-VDVQTJMD.mjs.map → tools-SC6QEN7R.mjs.map} +0 -0
- /package/dist/lib/browser/{url-handler-3CARFXQK.mjs.map → url-handler-ODG4B6NX.mjs.map} +0 -0
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
useBreakpoints,
|
|
8
8
|
useCompanions,
|
|
9
9
|
useHoistStatusbar
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6ZSOFCPP.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-RJNCG4ND.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 { descriptionText, 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
|
-
icon
|
|
155
|
+
// icon='ph--minus--regular'
|
|
156
|
+
icon: "ph--caret-left--regular",
|
|
156
157
|
onClick: handleCloseCompanion,
|
|
157
158
|
classNames: plankControlSpacing
|
|
158
159
|
}));
|
|
159
160
|
});
|
|
160
|
-
var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant = "default", capabilities,
|
|
161
|
+
var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant = "default", capabilities, isSolo, pin, close = false, onClick, ...props }, forwardedRef) => {
|
|
161
162
|
const { t } = useTranslation2(DECK_PLUGIN);
|
|
162
163
|
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,17 +168,12 @@ var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant
|
|
|
168
168
|
classNames
|
|
169
169
|
],
|
|
170
170
|
ref: forwardedRef
|
|
171
|
-
}, capabilities.deck &&
|
|
172
|
-
label: t("show
|
|
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"),
|
|
171
|
+
}, capabilities.deck && capabilities.solo && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
172
|
+
label: isSolo ? t("show deck plank label") : t("show solo plank label"),
|
|
178
173
|
classNames: buttonClassNames,
|
|
179
|
-
icon:
|
|
180
|
-
onClick: () => onClick?.(
|
|
181
|
-
})
|
|
174
|
+
icon: isSolo ? "ph--corners-in--regular" : "ph--corners-out--regular",
|
|
175
|
+
onClick: () => onClick?.("solo")
|
|
176
|
+
}), !isSolo && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
182
177
|
label: t("increment start label"),
|
|
183
178
|
disabled: !capabilities.incrementStart,
|
|
184
179
|
classNames: buttonClassNames,
|
|
@@ -190,7 +185,7 @@ var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant
|
|
|
190
185
|
classNames: buttonClassNames,
|
|
191
186
|
icon: "ph--caret-right--regular",
|
|
192
187
|
onClick: () => onClick?.("increment-end")
|
|
193
|
-
}))), close && !
|
|
188
|
+
}))), close && !isSolo && /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
194
189
|
label: t(`${typeof close === "string" ? "minify" : "close"} label`),
|
|
195
190
|
classNames: buttonClassNames,
|
|
196
191
|
"data-testid": "plankHeading.close",
|
|
@@ -213,8 +208,7 @@ var fixedSidebarToggleStyles = mx(sidebarToggleStyles, "inline-start-2");
|
|
|
213
208
|
var fixedComplementarySidebarToggleStyles = mx(sidebarToggleStyles, "inline-end-2");
|
|
214
209
|
|
|
215
210
|
// packages/plugins/plugin-deck/src/components/Plank/PlankHeading.tsx
|
|
216
|
-
var
|
|
217
|
-
var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncrementStart, canIncrementEnd, popoverAnchorId, primaryId, pending, companioned, companions, layoutMode, actions = [] }) => {
|
|
211
|
+
var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncrementStart, canIncrementEnd, popoverAnchorId, primaryId, pending, companioned, companions, actions = [] }) => {
|
|
218
212
|
const { t } = useTranslation3(DECK_PLUGIN);
|
|
219
213
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
220
214
|
const { graph } = useAppGraph();
|
|
@@ -276,7 +270,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
276
270
|
});
|
|
277
271
|
}, []);
|
|
278
272
|
const handlePlankAction = useCallback2((eventType) => {
|
|
279
|
-
if (eventType
|
|
273
|
+
if (eventType === "solo") {
|
|
280
274
|
return dispatch(createIntent2(DeckAction.Adjust, {
|
|
281
275
|
type: eventType,
|
|
282
276
|
id
|
|
@@ -326,11 +320,9 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
326
320
|
]);
|
|
327
321
|
return /* @__PURE__ */ React3.createElement(StackItem.Heading, {
|
|
328
322
|
classNames: [
|
|
329
|
-
"plb-1 border-be border-separator items-stretch gap-1 sticky inline-start-12 app-drag min-is-0 contain
|
|
330
|
-
part === "solo" ? soloInlinePadding : "pli-1"
|
|
331
|
-
|
|
332
|
-
],
|
|
333
|
-
"data-plank-heading": true
|
|
323
|
+
"plb-1 border-be border-separator items-stretch gap-1 sticky inline-start-12 app-drag min-is-0 layout-contain",
|
|
324
|
+
part === "solo" ? soloInlinePadding : "pli-1"
|
|
325
|
+
]
|
|
334
326
|
}, companions && isCompanionNode ? /* @__PURE__ */ React3.createElement("div", {
|
|
335
327
|
role: "none",
|
|
336
328
|
className: "flex-1 min-is-0 overflow-x-auto scrollbar-thin flex gap-1"
|
|
@@ -338,7 +330,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
338
330
|
key: id2,
|
|
339
331
|
"data-id": id2,
|
|
340
332
|
icon: icon2,
|
|
341
|
-
iconOnly:
|
|
333
|
+
iconOnly: node?.id !== id2,
|
|
342
334
|
label: toLocalizedString(label4, t),
|
|
343
335
|
size: 5,
|
|
344
336
|
variant: node?.id === id2 ? "primary" : "default",
|
|
@@ -378,7 +370,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
378
370
|
primary: primaryId
|
|
379
371
|
}) : /* @__PURE__ */ React3.createElement(PlankControls, {
|
|
380
372
|
capabilities,
|
|
381
|
-
|
|
373
|
+
isSolo: part === "solo",
|
|
382
374
|
close: part === "complementary" ? "minify-end" : true,
|
|
383
375
|
onClick: handlePlankAction
|
|
384
376
|
}));
|
|
@@ -402,7 +394,7 @@ var PlankContentError = ({ error }) => {
|
|
|
402
394
|
className: "overflow-auto p-8 attention-surface grid place-items-center"
|
|
403
395
|
}, /* @__PURE__ */ React5.createElement("p", {
|
|
404
396
|
role: "alert",
|
|
405
|
-
className: mx2(
|
|
397
|
+
className: mx2(descriptionText, "break-words border border-dashed border-separator rounded-lg p-8", errorString.length < 256 && "text-lg")
|
|
406
398
|
}, error ? errorString : t("error fallback message")));
|
|
407
399
|
};
|
|
408
400
|
var PlankError = ({ id, part, node, error }) => {
|
|
@@ -501,8 +493,8 @@ var PlankImpl = /* @__PURE__ */ memo2(({ id, node, part, path, order, active, la
|
|
|
501
493
|
scrollIntoView,
|
|
502
494
|
layoutMode
|
|
503
495
|
]);
|
|
504
|
-
const isSolo = layoutMode
|
|
505
|
-
const isAttendable = layoutMode
|
|
496
|
+
const isSolo = layoutMode === "solo" && part === "solo";
|
|
497
|
+
const isAttendable = layoutMode === "solo" && part.startsWith("solo") || layoutMode === "deck" && part === "deck";
|
|
506
498
|
const sizeAttrs = useMainSize();
|
|
507
499
|
const data = useMemo2(() => node && {
|
|
508
500
|
subject: node.data,
|
|
@@ -515,11 +507,10 @@ var PlankImpl = /* @__PURE__ */ memo2(({ id, node, part, path, order, active, la
|
|
|
515
507
|
node?.data,
|
|
516
508
|
path,
|
|
517
509
|
popoverAnchorId,
|
|
518
|
-
primary?.data
|
|
519
|
-
variant
|
|
510
|
+
primary?.data
|
|
520
511
|
]);
|
|
521
512
|
const placeholder = useMemo2(() => /* @__PURE__ */ React6.createElement(PlankLoading, null), []);
|
|
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"
|
|
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");
|
|
523
514
|
return /* @__PURE__ */ React6.createElement(Root, {
|
|
524
515
|
ref: rootElement,
|
|
525
516
|
"data-testid": "deck.plank",
|
|
@@ -543,7 +534,6 @@ var PlankImpl = /* @__PURE__ */ memo2(({ id, node, part, path, order, active, la
|
|
|
543
534
|
id,
|
|
544
535
|
part: part.startsWith("solo-") ? "solo" : part,
|
|
545
536
|
node,
|
|
546
|
-
layoutMode,
|
|
547
537
|
deckEnabled: settings?.enableDeck,
|
|
548
538
|
canIncrementStart,
|
|
549
539
|
canIncrementEnd,
|
|
@@ -631,13 +621,12 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
631
621
|
const { t } = useTranslation5(DECK_PLUGIN);
|
|
632
622
|
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
633
623
|
const layout = useCapability3(DeckCapabilities.MutableDeckState);
|
|
634
|
-
const layoutMode = getMode(layout.deck);
|
|
635
624
|
const breakpoint = useBreakpoints();
|
|
636
|
-
const topbar = layoutAppliesTopbar(breakpoint
|
|
637
|
-
const hoistStatusbar = useHoistStatusbar(breakpoint
|
|
625
|
+
const topbar = layoutAppliesTopbar(breakpoint);
|
|
626
|
+
const hoistStatusbar = useHoistStatusbar(breakpoint);
|
|
638
627
|
const companions = useDeckCompanions();
|
|
639
|
-
const activeCompanion = companions.find((companion) => getCompanionId(companion.id) === current);
|
|
640
|
-
const activeId =
|
|
628
|
+
const activeCompanion = companions.find((companion) => getCompanionId(companion.id) === current) ?? companions.at(0);
|
|
629
|
+
const activeId = getCompanionId(activeCompanion?.id ?? "never");
|
|
641
630
|
const [internalValue, setInternalValue] = useState2(activeId);
|
|
642
631
|
useEffect4(() => {
|
|
643
632
|
setInternalValue(activeId);
|
|
@@ -668,19 +657,6 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
668
657
|
activeCompanion?.id,
|
|
669
658
|
activeCompanion?.data
|
|
670
659
|
]);
|
|
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
|
-
]);
|
|
684
660
|
return /* @__PURE__ */ React7.createElement(Main.ComplementarySidebar, {
|
|
685
661
|
label,
|
|
686
662
|
classNames: [
|
|
@@ -719,7 +695,7 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
719
695
|
})), /* @__PURE__ */ React7.createElement("div", {
|
|
720
696
|
role: "none",
|
|
721
697
|
className: "hidden lg:grid grid-cols-1 auto-rows-[--rail-action] p-1"
|
|
722
|
-
}, /* @__PURE__ */ React7.createElement(ToggleComplementarySidebarButton, null))),
|
|
698
|
+
}, /* @__PURE__ */ React7.createElement(ToggleComplementarySidebarButton, null))), companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tabpanel, {
|
|
723
699
|
key: getCompanionId(companion.id),
|
|
724
700
|
value: getCompanionId(companion.id),
|
|
725
701
|
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)]',
|
|
@@ -771,11 +747,10 @@ var label2 = [
|
|
|
771
747
|
}
|
|
772
748
|
];
|
|
773
749
|
var Sidebar = () => {
|
|
774
|
-
const { popoverAnchorId, activeDeck: current
|
|
750
|
+
const { popoverAnchorId, activeDeck: current } = useCapability4(DeckCapabilities.DeckState);
|
|
775
751
|
const breakpoint = useBreakpoints();
|
|
776
|
-
const
|
|
777
|
-
const
|
|
778
|
-
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
752
|
+
const topbar = layoutAppliesTopbar(breakpoint);
|
|
753
|
+
const hoistStatusbar = useHoistStatusbar(breakpoint);
|
|
779
754
|
const navigationData = useMemo4(() => ({
|
|
780
755
|
popoverAnchorId,
|
|
781
756
|
topbar,
|
|
@@ -833,10 +808,10 @@ var Banner = ({ variant, classNames }) => {
|
|
|
833
808
|
|
|
834
809
|
// packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
|
|
835
810
|
import { untracked } from "@preact/signals-core";
|
|
836
|
-
import React17, { useCallback as
|
|
837
|
-
import { Capabilities, LayoutAction as LayoutAction4, createIntent as createIntent5, useCapability as
|
|
811
|
+
import React17, { useCallback as useCallback5, useEffect as useEffect5, useMemo as useMemo5, useRef as useRef2, Fragment as Fragment4, useState as useState3 } from "react";
|
|
812
|
+
import { Capabilities, LayoutAction as LayoutAction4, Surface as Surface10, createIntent as createIntent5, useCapability as useCapability5, useIntentDispatcher as useIntentDispatcher5, usePluginManager } from "@dxos/app-framework";
|
|
838
813
|
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
839
|
-
import { Main as Main3, useMediaQuery, useOnTransition } from "@dxos/react-ui";
|
|
814
|
+
import { AlertDialog, Dialog as NaturalDialog, Main as Main3, Popover as Popover2, useMediaQuery, useOnTransition } from "@dxos/react-ui";
|
|
840
815
|
import { Stack, StackContext, DEFAULT_HORIZONTAL_SIZE } from "@dxos/react-ui-stack";
|
|
841
816
|
import { mainPaddingTransitions } from "@dxos/react-ui-theme";
|
|
842
817
|
|
|
@@ -864,12 +839,10 @@ var ActiveNode = () => {
|
|
|
864
839
|
|
|
865
840
|
// packages/plugins/plugin-deck/src/components/DeckLayout/ContentEmpty.tsx
|
|
866
841
|
import React11 from "react";
|
|
867
|
-
import { Surface as Surface7
|
|
842
|
+
import { Surface as Surface7 } from "@dxos/app-framework";
|
|
868
843
|
var ContentEmpty = () => {
|
|
869
844
|
const breakpoint = useBreakpoints();
|
|
870
|
-
const
|
|
871
|
-
const layoutMode = getMode(deck);
|
|
872
|
-
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
845
|
+
const topbar = layoutAppliesTopbar(breakpoint);
|
|
873
846
|
return /* @__PURE__ */ React11.createElement("div", {
|
|
874
847
|
role: "none",
|
|
875
848
|
className: "grid place-items-center p-8 relative bg-deck",
|
|
@@ -882,123 +855,51 @@ var ContentEmpty = () => {
|
|
|
882
855
|
}));
|
|
883
856
|
};
|
|
884
857
|
|
|
885
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/
|
|
858
|
+
// packages/plugins/plugin-deck/src/components/DeckLayout/Fullscreen.tsx
|
|
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
|
|
886
865
|
import React12 from "react";
|
|
887
|
-
import {
|
|
888
|
-
import {
|
|
889
|
-
var
|
|
890
|
-
const
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
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
|
-
})));
|
|
866
|
+
import { useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
867
|
+
import { errorText, mx as mx5 } from "@dxos/react-ui-theme";
|
|
868
|
+
var Fallback = () => {
|
|
869
|
+
const { t } = useTranslation7(DECK_PLUGIN);
|
|
870
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
871
|
+
role: "none",
|
|
872
|
+
className: "min-bs-screen is-full flex items-center justify-center p-8"
|
|
873
|
+
}, /* @__PURE__ */ React12.createElement("p", {
|
|
874
|
+
role: "alert",
|
|
875
|
+
className: mx5(errorText, "border border-error-400/50 rounded-lg flex items-center justify-center p-8 font-normal text-lg")
|
|
876
|
+
}, t("plugin error message")));
|
|
915
877
|
};
|
|
916
878
|
|
|
917
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
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);
|
|
941
|
-
}
|
|
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;
|
|
879
|
+
// packages/plugins/plugin-deck/src/components/DeckLayout/constants.ts
|
|
880
|
+
var SURFACE_PREFIX = "surface:";
|
|
881
|
+
|
|
882
|
+
// packages/plugins/plugin-deck/src/components/DeckLayout/Fullscreen.tsx
|
|
883
|
+
var Fullscreen = ({ id }) => {
|
|
884
|
+
const { graph } = useAppGraph5();
|
|
885
|
+
const fullScreenNode = useNode3(graph, id);
|
|
886
|
+
return /* @__PURE__ */ React13.createElement("div", {
|
|
887
|
+
role: "none",
|
|
888
|
+
className: fixedInsetFlexLayout
|
|
889
|
+
}, /* @__PURE__ */ React13.createElement(Surface8, {
|
|
890
|
+
role: "main",
|
|
891
|
+
limit: 1,
|
|
892
|
+
fallback: Fallback,
|
|
893
|
+
data: {
|
|
894
|
+
subject: fullScreenNode?.data,
|
|
895
|
+
component: id?.startsWith(SURFACE_PREFIX) ? id.slice(SURFACE_PREFIX.length) : void 0
|
|
973
896
|
}
|
|
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)));
|
|
897
|
+
}));
|
|
997
898
|
};
|
|
998
899
|
|
|
999
900
|
// packages/plugins/plugin-deck/src/components/DeckLayout/StatusBar.tsx
|
|
1000
901
|
import React14 from "react";
|
|
1001
|
-
import { Surface as
|
|
902
|
+
import { Surface as Surface9 } from "@dxos/app-framework";
|
|
1002
903
|
import { useLandmarkMover } from "@dxos/react-ui";
|
|
1003
904
|
var StatusBar = ({ showHints }) => {
|
|
1004
905
|
const mover = useLandmarkMover(void 0, "3");
|
|
@@ -1006,10 +907,10 @@ var StatusBar = ({ showHints }) => {
|
|
|
1006
907
|
role: "contentinfo",
|
|
1007
908
|
className: "fixed block-end-0 inset-inline-0 bs-[--statusbar-size] border-bs border-separator z-[2] flex text-description",
|
|
1008
909
|
...mover
|
|
1009
|
-
}, showHints && /* @__PURE__ */ React14.createElement(
|
|
910
|
+
}, showHints && /* @__PURE__ */ React14.createElement(Surface9, {
|
|
1010
911
|
role: "hints",
|
|
1011
912
|
limit: 1
|
|
1012
|
-
}), /* @__PURE__ */ React14.createElement(
|
|
913
|
+
}), /* @__PURE__ */ React14.createElement(Surface9, {
|
|
1013
914
|
role: "status-bar",
|
|
1014
915
|
limit: 1
|
|
1015
916
|
}));
|
|
@@ -1017,9 +918,9 @@ var StatusBar = ({ showHints }) => {
|
|
|
1017
918
|
|
|
1018
919
|
// packages/plugins/plugin-deck/src/components/DeckLayout/Toast.tsx
|
|
1019
920
|
import React15 from "react";
|
|
1020
|
-
import { Button as Button2, Icon as Icon3, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as
|
|
921
|
+
import { Button as Button2, Icon as Icon3, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
1021
922
|
var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange }) => {
|
|
1022
|
-
const { t } =
|
|
923
|
+
const { t } = useTranslation8(DECK_PLUGIN);
|
|
1023
924
|
return /* @__PURE__ */ React15.createElement(NaturalToast.Root, {
|
|
1024
925
|
"data-testid": id,
|
|
1025
926
|
defaultOpen: true,
|
|
@@ -1063,18 +964,23 @@ var PlankSeparator = ({ order }) => order > 0 ? /* @__PURE__ */ React17.createEl
|
|
|
1063
964
|
}) : null;
|
|
1064
965
|
var DeckLayout = ({ onDismissToast }) => {
|
|
1065
966
|
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
1066
|
-
const settings =
|
|
1067
|
-
const context =
|
|
1068
|
-
const { sidebarState, complementarySidebarState, complementarySidebarPanel, deck, toasts } = context;
|
|
967
|
+
const settings = useCapability5(Capabilities.SettingsStore).getStore(DECK_PLUGIN).value;
|
|
968
|
+
const context = useCapability5(DeckCapabilities.MutableDeckState);
|
|
969
|
+
const { sidebarState, complementarySidebarState, complementarySidebarPanel, dialogOpen, dialogContent, dialogBlockAlign, dialogType, popoverOpen, popoverContent, popoverAnchorId, deck, toasts } = context;
|
|
1069
970
|
const { active, activeCompanions, fullscreen, solo, plankSizing } = deck;
|
|
1070
971
|
const breakpoint = useBreakpoints();
|
|
1071
|
-
const
|
|
1072
|
-
const
|
|
1073
|
-
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
972
|
+
const topbar = layoutAppliesTopbar(breakpoint);
|
|
973
|
+
const hoistStatusbar = useHoistStatusbar(breakpoint);
|
|
1074
974
|
const pluginManager = usePluginManager();
|
|
1075
|
-
const scrollLeftRef =
|
|
1076
|
-
const deckRef =
|
|
1077
|
-
|
|
975
|
+
const scrollLeftRef = useRef2();
|
|
976
|
+
const deckRef = useRef2(null);
|
|
977
|
+
const [delayedPopoverVisibility, setDelayedPopoverVisibility] = useState3(false);
|
|
978
|
+
useEffect5(() => {
|
|
979
|
+
popoverOpen ? setTimeout(() => setDelayedPopoverVisibility(true), 40) : setDelayedPopoverVisibility(false);
|
|
980
|
+
}, [
|
|
981
|
+
popoverOpen
|
|
982
|
+
]);
|
|
983
|
+
useEffect5(() => {
|
|
1078
984
|
const attended = untracked(() => {
|
|
1079
985
|
const attention = pluginManager.context.requestCapability(AttentionCapabilities.Attention);
|
|
1080
986
|
return attention.current;
|
|
@@ -1087,8 +993,8 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1087
993
|
const [isNotMobile] = useMediaQuery("md", {
|
|
1088
994
|
ssr: false
|
|
1089
995
|
});
|
|
1090
|
-
const shouldRevert =
|
|
1091
|
-
|
|
996
|
+
const shouldRevert = useRef2(false);
|
|
997
|
+
useEffect5(() => {
|
|
1092
998
|
if (!isNotMobile && getMode(deck) === "deck") {
|
|
1093
999
|
const attended = untracked(() => {
|
|
1094
1000
|
const attention = pluginManager.context.requestCapability(AttentionCapabilities.Attention);
|
|
@@ -1115,7 +1021,7 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1115
1021
|
deck,
|
|
1116
1022
|
dispatch
|
|
1117
1023
|
]);
|
|
1118
|
-
|
|
1024
|
+
useEffect5(() => {
|
|
1119
1025
|
if (!settings.enableDeck) {
|
|
1120
1026
|
void dispatch(createIntent5(LayoutAction4.SetLayoutMode, {
|
|
1121
1027
|
part: "mode",
|
|
@@ -1130,22 +1036,23 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1130
1036
|
dispatch,
|
|
1131
1037
|
active
|
|
1132
1038
|
]);
|
|
1133
|
-
const handleResize =
|
|
1039
|
+
const handleResize = useCallback5(() => {
|
|
1134
1040
|
scrollLeftRef.current = null;
|
|
1135
1041
|
}, []);
|
|
1136
|
-
|
|
1042
|
+
useEffect5(() => {
|
|
1137
1043
|
window.addEventListener("resize", handleResize);
|
|
1138
1044
|
return () => window.removeEventListener("resize", handleResize);
|
|
1139
1045
|
}, [
|
|
1140
1046
|
handleResize
|
|
1141
1047
|
]);
|
|
1142
|
-
const restoreScroll =
|
|
1048
|
+
const restoreScroll = useCallback5(() => {
|
|
1143
1049
|
if (deckRef.current && scrollLeftRef.current != null) {
|
|
1144
1050
|
deckRef.current.scrollLeft = scrollLeftRef.current;
|
|
1145
1051
|
}
|
|
1146
1052
|
}, []);
|
|
1053
|
+
const layoutMode = getMode(deck);
|
|
1147
1054
|
useOnTransition(layoutMode, (mode) => mode !== "deck", "deck", restoreScroll);
|
|
1148
|
-
const handleScroll =
|
|
1055
|
+
const handleScroll = useCallback5((event) => {
|
|
1149
1056
|
if (!solo && event.currentTarget === event.target) {
|
|
1150
1057
|
scrollLeftRef.current = event.target.scrollLeft;
|
|
1151
1058
|
}
|
|
@@ -1153,7 +1060,7 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1153
1060
|
solo
|
|
1154
1061
|
]);
|
|
1155
1062
|
const isEmpty = !solo && active.length === 0;
|
|
1156
|
-
const padding =
|
|
1063
|
+
const padding = useMemo5(() => {
|
|
1157
1064
|
if (!solo && settings.overscroll === "centering") {
|
|
1158
1065
|
return calculateOverscroll(active.length);
|
|
1159
1066
|
}
|
|
@@ -1163,7 +1070,7 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1163
1070
|
settings.overscroll,
|
|
1164
1071
|
deck
|
|
1165
1072
|
]);
|
|
1166
|
-
const mainPosition =
|
|
1073
|
+
const mainPosition = useMemo5(() => [
|
|
1167
1074
|
"grid !block-start-[env(safe-area-inset-top)]",
|
|
1168
1075
|
topbar && "!block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
|
|
1169
1076
|
hoistStatusbar && "lg:block-end-[--statusbar-size]"
|
|
@@ -1171,7 +1078,22 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1171
1078
|
topbar,
|
|
1172
1079
|
hoistStatusbar
|
|
1173
1080
|
]);
|
|
1174
|
-
const
|
|
1081
|
+
const Dialog = dialogType === "alert" ? AlertDialog : NaturalDialog;
|
|
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(() => {
|
|
1175
1097
|
return active.reduce((acc, entryId) => {
|
|
1176
1098
|
acc.order[entryId] = acc.itemsCount + 1;
|
|
1177
1099
|
acc.itemsCount += activeCompanions?.[entryId] ? 3 : 2;
|
|
@@ -1184,10 +1106,16 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1184
1106
|
active,
|
|
1185
1107
|
activeCompanions
|
|
1186
1108
|
]);
|
|
1187
|
-
return /* @__PURE__ */ React17.createElement(
|
|
1188
|
-
|
|
1109
|
+
return /* @__PURE__ */ React17.createElement(Popover2.Root, {
|
|
1110
|
+
modal: true,
|
|
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,
|
|
1189
1117
|
onNavigationSidebarStateChange: (next) => context.sidebarState = next,
|
|
1190
|
-
complementarySidebarState:
|
|
1118
|
+
complementarySidebarState: context.complementarySidebarState,
|
|
1191
1119
|
onComplementarySidebarStateChange: (next) => context.complementarySidebarState = next
|
|
1192
1120
|
}, /* @__PURE__ */ React17.createElement(Sidebar, null), /* @__PURE__ */ React17.createElement(ComplementarySidebar, {
|
|
1193
1121
|
current: complementarySidebarPanel
|
|
@@ -1211,9 +1139,9 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1211
1139
|
...solo && {
|
|
1212
1140
|
inert: ""
|
|
1213
1141
|
}
|
|
1214
|
-
}, !topbar &&
|
|
1142
|
+
}, !topbar && /* @__PURE__ */ React17.createElement(ToggleSidebarButton, {
|
|
1215
1143
|
classNames: fixedSidebarToggleStyles
|
|
1216
|
-
}), !topbar &&
|
|
1144
|
+
}), !topbar && /* @__PURE__ */ React17.createElement(ToggleComplementarySidebarButton, {
|
|
1217
1145
|
classNames: fixedComplementarySidebarToggleStyles
|
|
1218
1146
|
}), /* @__PURE__ */ React17.createElement(Stack, {
|
|
1219
1147
|
ref: deckRef,
|
|
@@ -1244,9 +1172,9 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1244
1172
|
...!solo && {
|
|
1245
1173
|
inert: ""
|
|
1246
1174
|
}
|
|
1247
|
-
}, !topbar &&
|
|
1175
|
+
}, !topbar && /* @__PURE__ */ React17.createElement(ToggleSidebarButton, {
|
|
1248
1176
|
classNames: fixedSidebarToggleStyles
|
|
1249
|
-
}), !topbar &&
|
|
1177
|
+
}), !topbar && /* @__PURE__ */ React17.createElement(ToggleComplementarySidebarButton, {
|
|
1250
1178
|
classNames: fixedComplementarySidebarToggleStyles
|
|
1251
1179
|
}), /* @__PURE__ */ React17.createElement(StackContext.Provider, {
|
|
1252
1180
|
value: {
|
|
@@ -1262,7 +1190,34 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1262
1190
|
settings
|
|
1263
1191
|
})))), topbar && /* @__PURE__ */ React17.createElement(Topbar, null), hoistStatusbar && /* @__PURE__ */ React17.createElement(StatusBar, {
|
|
1264
1192
|
showHints: settings.showHints
|
|
1265
|
-
})), /* @__PURE__ */ React17.createElement(
|
|
1193
|
+
})), /* @__PURE__ */ React17.createElement(Popover2.Portal, null, /* @__PURE__ */ React17.createElement(Popover2.Content, {
|
|
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, {
|
|
1266
1221
|
...toast,
|
|
1267
1222
|
key: toast.id,
|
|
1268
1223
|
onOpenChange: (open) => {
|
|
@@ -1276,11 +1231,11 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1276
1231
|
|
|
1277
1232
|
// packages/plugins/plugin-deck/src/components/DeckSettings/DeckSettings.tsx
|
|
1278
1233
|
import React18 from "react";
|
|
1279
|
-
import { Input, Select, useTranslation as
|
|
1234
|
+
import { Input, Select, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
1280
1235
|
import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
1281
1236
|
var isSocket = !!globalThis.__args;
|
|
1282
1237
|
var DeckSettings = ({ settings }) => {
|
|
1283
|
-
const { t } =
|
|
1238
|
+
const { t } = useTranslation9(DECK_PLUGIN);
|
|
1284
1239
|
return /* @__PURE__ */ React18.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
|
|
1285
1240
|
label: t("settings enable deck label")
|
|
1286
1241
|
}, /* @__PURE__ */ React18.createElement(Input.Switch, {
|
|
@@ -1331,4 +1286,4 @@ export {
|
|
|
1331
1286
|
DeckLayout,
|
|
1332
1287
|
DeckSettings
|
|
1333
1288
|
};
|
|
1334
|
-
//# sourceMappingURL=chunk-
|
|
1289
|
+
//# sourceMappingURL=chunk-FJBMNSUC.mjs.map
|