@dxos/plugin-deck 0.8.4-main.e098934 → 0.8.4-main.e8ec1fe
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-DVEKLXB4.mjs → app-graph-builder-D74NTOMK.mjs} +18 -42
- package/dist/lib/browser/app-graph-builder-D74NTOMK.mjs.map +7 -0
- package/dist/lib/browser/{check-app-scheme-3BQJXWEY.mjs → check-app-scheme-HIEVFAAX.mjs} +6 -6
- package/dist/lib/browser/check-app-scheme-HIEVFAAX.mjs.map +7 -0
- package/dist/lib/browser/chunk-5KMJPIQC.mjs +16 -0
- package/dist/lib/browser/chunk-5KMJPIQC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-F5BQOOEG.mjs → chunk-F3VCCHVL.mjs} +8 -6
- package/dist/lib/browser/chunk-F3VCCHVL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WILMPGDV.mjs → chunk-QKCGZ45E.mjs} +18 -17
- 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-NRCPV6AV.mjs → chunk-VBYJ664A.mjs} +12 -9
- package/dist/lib/browser/chunk-VBYJ664A.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NU7H23SK.mjs → chunk-VUJ6UNIJ.mjs} +410 -355
- package/dist/lib/browser/chunk-VUJ6UNIJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -9
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-2SUIIV6N.mjs → intent-resolver-UA4YQGAC.mjs} +20 -17
- package/dist/lib/browser/intent-resolver-UA4YQGAC.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-7PRVDLF7.mjs → react-root-JAMHKYWN.mjs} +13 -12
- package/dist/lib/browser/react-root-JAMHKYWN.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-FNY2YC2F.mjs → react-surface-6LW337ZT.mjs} +13 -13
- package/dist/lib/browser/react-surface-6LW337ZT.mjs.map +7 -0
- package/dist/lib/browser/{settings-LUPQPZ27.mjs → settings-SDPTOCCM.mjs} +7 -6
- package/dist/lib/browser/{settings-LUPQPZ27.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-LROZYQ26.mjs → url-handler-QEYGYE2H.mjs} +6 -6
- package/dist/lib/browser/{url-handler-LROZYQ26.mjs.map → url-handler-QEYGYE2H.mjs.map} +1 -1
- package/dist/types/src/DeckPlugin.d.ts +1 -1
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- 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 +23 -3
- 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/events.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 +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +4 -3
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -44
- package/src/DeckPlugin.ts +62 -63
- package/src/capabilities/app-graph-builder.ts +31 -30
- package/src/capabilities/capabilities.ts +3 -3
- package/src/capabilities/check-app-scheme.ts +2 -2
- package/src/capabilities/intent-resolver.ts +12 -10
- package/src/capabilities/react-root.tsx +4 -3
- package/src/capabilities/react-surface.tsx +4 -4
- package/src/capabilities/settings.ts +1 -0
- package/src/capabilities/state.ts +12 -4
- package/src/capabilities/toolkit.ts +28 -17
- package/src/capabilities/tools.ts +1 -1
- package/src/components/DeckLayout/ActiveNode.tsx +1 -1
- package/src/components/DeckLayout/Banner.tsx +3 -3
- 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 +3 -3
- package/src/components/DeckLayout/Popover.tsx +4 -13
- package/src/components/DeckLayout/StatusBar.tsx +1 -1
- package/src/components/DeckLayout/Toast.tsx +28 -3
- package/src/components/DeckSettings/DeckSettings.tsx +9 -3
- package/src/components/Plank/Plank.stories.tsx +3 -5
- package/src/components/Plank/Plank.tsx +69 -37
- package/src/components/Plank/PlankControls.tsx +6 -5
- package/src/components/Plank/PlankError.tsx +2 -2
- package/src/components/Plank/PlankHeading.tsx +10 -9
- package/src/components/Sidebar/ComplementarySidebar.tsx +36 -16
- package/src/components/Sidebar/Sidebar.tsx +3 -3
- package/src/components/Sidebar/SidebarButton.tsx +14 -13
- package/src/events.ts +2 -2
- package/src/hooks/useCompanions.ts +1 -1
- package/src/hooks/useDeckCompanions.ts +2 -1
- package/src/hooks/useHoistStatusbar.ts +6 -4
- package/src/meta.ts +6 -3
- package/src/translations.ts +1 -0
- package/src/types/schema.ts +5 -3
- package/dist/lib/browser/app-graph-builder-DVEKLXB4.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-3BQJXWEY.mjs.map +0 -7
- package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +0 -7
- package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
- package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
- package/dist/lib/browser/chunk-NRCPV6AV.mjs.map +0 -7
- package/dist/lib/browser/chunk-NU7H23SK.mjs.map +0 -7
- package/dist/lib/browser/chunk-WILMPGDV.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
- package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-2SUIIV6N.mjs.map +0 -7
- package/dist/lib/browser/react-root-7PRVDLF7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FNY2YC2F.mjs.map +0 -7
- package/dist/lib/browser/state-CRXR7X63.mjs +0 -12
- package/dist/lib/browser/toolkit-XGJSBY67.mjs +0 -61
- package/dist/lib/browser/toolkit-XGJSBY67.mjs.map +0 -7
- /package/dist/lib/browser/{state-CRXR7X63.mjs.map → state-7IFAGZQO.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
|
-
|
|
27
|
-
} from "./chunk-
|
|
26
|
+
meta
|
|
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
|
|
@@ -99,12 +104,12 @@ var plankControlSpacing = "pli-2";
|
|
|
99
104
|
var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedRef) => {
|
|
100
105
|
var _effect = _useSignals();
|
|
101
106
|
try {
|
|
102
|
-
const { t } = useTranslation(
|
|
107
|
+
const { t } = useTranslation(meta.id);
|
|
103
108
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
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",
|
|
@@ -133,7 +138,7 @@ var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedR
|
|
|
133
138
|
var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant = "default", capabilities, layoutMode, pin, close = false, onClick, ...props }, forwardedRef) => {
|
|
134
139
|
var _effect = _useSignals();
|
|
135
140
|
try {
|
|
136
|
-
const { t } = useTranslation(
|
|
141
|
+
const { t } = useTranslation(meta.id);
|
|
137
142
|
const buttonClassNames = variant === "hide-disabled" ? `disabled:hidden ${plankControlSpacing}` : plankControlSpacing;
|
|
138
143
|
const layoutIsAnySolo = !!layoutMode?.startsWith("solo");
|
|
139
144
|
return /* @__PURE__ */ React.createElement(ButtonGroup, {
|
|
@@ -193,7 +198,7 @@ var MAX_COMPANIONS = 5;
|
|
|
193
198
|
var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncrementStart, canIncrementEnd, popoverAnchorId, primaryId, pending, companioned, companions, layoutMode, actions = [] }) => {
|
|
194
199
|
var _effect = _useSignals2();
|
|
195
200
|
try {
|
|
196
|
-
const { t } = useTranslation2(
|
|
201
|
+
const { t } = useTranslation2(meta.id);
|
|
197
202
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
198
203
|
const { graph } = useAppGraph();
|
|
199
204
|
const breakpoint = useBreakpoints();
|
|
@@ -201,7 +206,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
201
206
|
const label3 = pending ? t("pending heading") : toLocalizedString(node?.properties?.label ?? [
|
|
202
207
|
"plank heading fallback label",
|
|
203
208
|
{
|
|
204
|
-
ns:
|
|
209
|
+
ns: meta.id
|
|
205
210
|
}
|
|
206
211
|
], t);
|
|
207
212
|
const isCompanionNode = node?.type === PLANK_COMPANION_TYPE;
|
|
@@ -257,7 +262,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
257
262
|
const handleAction = useCallback2((action) => {
|
|
258
263
|
typeof action.data === "function" && void action.data?.({
|
|
259
264
|
parent: node,
|
|
260
|
-
caller:
|
|
265
|
+
caller: meta.id
|
|
261
266
|
});
|
|
262
267
|
}, [
|
|
263
268
|
node
|
|
@@ -298,7 +303,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
298
303
|
id,
|
|
299
304
|
part
|
|
300
305
|
]);
|
|
301
|
-
const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${
|
|
306
|
+
const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${meta.id}/${node.id}` ? Popover.Anchor : Fragment;
|
|
302
307
|
const handleTabClick = useCallback2((event) => {
|
|
303
308
|
const target = event.target.closest("[data-id]");
|
|
304
309
|
const tabId = target?.dataset?.id;
|
|
@@ -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
|
|
@@ -400,7 +404,7 @@ var PlankLoading = () => {
|
|
|
400
404
|
var PlankContentError = ({ error }) => {
|
|
401
405
|
var _effect = _useSignals4();
|
|
402
406
|
try {
|
|
403
|
-
const { t } = useTranslation3(
|
|
407
|
+
const { t } = useTranslation3(meta.id);
|
|
404
408
|
const errorString = error?.toString() ?? "";
|
|
405
409
|
return /* @__PURE__ */ React4.createElement("div", {
|
|
406
410
|
role: "none",
|
|
@@ -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,17 +520,20 @@ 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(() => {
|
|
521
535
|
if (scrollIntoView === id) {
|
|
522
|
-
|
|
523
|
-
focusable?.focus({
|
|
524
|
-
preventScroll: true
|
|
525
|
-
});
|
|
526
|
-
layoutMode === "deck" && focusable?.scrollIntoView({
|
|
536
|
+
layoutMode === "deck" && rootElement.current?.scrollIntoView({
|
|
527
537
|
behavior: "smooth",
|
|
528
538
|
inline: "center"
|
|
529
539
|
});
|
|
@@ -541,14 +551,17 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
541
551
|
const isAttendable = layoutMode.startsWith("solo") && part.startsWith("solo") || layoutMode === "deck" && part === "deck";
|
|
542
552
|
const sizeAttrs = useMainSize();
|
|
543
553
|
const data = useMemo2(() => node && {
|
|
554
|
+
attendableId: id,
|
|
544
555
|
subject: node.data,
|
|
545
556
|
companionTo: primary?.data,
|
|
557
|
+
properties: node.properties,
|
|
546
558
|
variant,
|
|
547
559
|
path,
|
|
548
560
|
popoverAnchorId
|
|
549
561
|
}, [
|
|
550
562
|
node,
|
|
551
563
|
node?.data,
|
|
564
|
+
node?.properties,
|
|
552
565
|
path,
|
|
553
566
|
popoverAnchorId,
|
|
554
567
|
primary?.data,
|
|
@@ -556,10 +569,12 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
556
569
|
]);
|
|
557
570
|
const placeholder = useMemo2(() => /* @__PURE__ */ React5.createElement(PlankLoading, null), []);
|
|
558
571
|
const Root = part.startsWith("solo") ? "article" : StackItem2.Root;
|
|
559
|
-
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");
|
|
560
574
|
return /* @__PURE__ */ React5.createElement(Root, {
|
|
561
575
|
ref: rootElement,
|
|
562
576
|
"data-testid": "deck.plank",
|
|
577
|
+
"data-popover-collision-boundary": true,
|
|
563
578
|
tabIndex: 0,
|
|
564
579
|
...part.startsWith("solo") ? {
|
|
565
580
|
...sizeAttrs,
|
|
@@ -576,7 +591,7 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
576
591
|
},
|
|
577
592
|
...isAttendable ? attentionAttrs : {},
|
|
578
593
|
onKeyDown: handleKeyDown
|
|
579
|
-
}, node ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(PlankHeading, {
|
|
594
|
+
}, node ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, !fullscreen && /* @__PURE__ */ React5.createElement(PlankHeading, {
|
|
580
595
|
id,
|
|
581
596
|
part: part.startsWith("solo-") ? "solo" : part,
|
|
582
597
|
node,
|
|
@@ -607,17 +622,18 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
607
622
|
// src/components/Sidebar/SidebarButton.tsx
|
|
608
623
|
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
609
624
|
import React6, { useCallback as useCallback4 } from "react";
|
|
610
|
-
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";
|
|
611
627
|
import { IconButton as IconButton3, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
612
628
|
var ToggleSidebarButton = ({ classNames, variant = "ghost" }) => {
|
|
613
629
|
var _effect = _useSignals6();
|
|
614
630
|
try {
|
|
615
631
|
const layoutContext = useCapability2(DeckCapabilities.MutableDeckState);
|
|
616
|
-
const { t } = useTranslation4(
|
|
632
|
+
const { t } = useTranslation4(meta.id);
|
|
617
633
|
return /* @__PURE__ */ React6.createElement(IconButton3, {
|
|
618
634
|
variant,
|
|
619
|
-
iconOnly: true,
|
|
620
635
|
icon: "ph--sidebar--regular",
|
|
636
|
+
iconOnly: true,
|
|
621
637
|
size: 4,
|
|
622
638
|
label: t("open navigation sidebar label"),
|
|
623
639
|
onClick: () => layoutContext.sidebarState = layoutContext.sidebarState === "expanded" ? "collapsed" : "expanded",
|
|
@@ -631,11 +647,11 @@ var CloseSidebarButton = () => {
|
|
|
631
647
|
var _effect = _useSignals6();
|
|
632
648
|
try {
|
|
633
649
|
const layoutContext = useCapability2(DeckCapabilities.MutableDeckState);
|
|
634
|
-
const { t } = useTranslation4(
|
|
650
|
+
const { t } = useTranslation4(meta.id);
|
|
635
651
|
return /* @__PURE__ */ React6.createElement(IconButton3, {
|
|
636
652
|
variant: "ghost",
|
|
637
|
-
iconOnly: true,
|
|
638
653
|
icon: "ph--caret-line-left--regular",
|
|
654
|
+
iconOnly: true,
|
|
639
655
|
size: 4,
|
|
640
656
|
label: t("close navigation sidebar label"),
|
|
641
657
|
onClick: () => layoutContext.sidebarState = "collapsed",
|
|
@@ -650,15 +666,15 @@ var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
|
|
|
650
666
|
try {
|
|
651
667
|
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
652
668
|
const layoutContext = useCapability2(DeckCapabilities.MutableDeckState);
|
|
653
|
-
const { t } = useTranslation4(
|
|
669
|
+
const { t } = useTranslation4(meta.id);
|
|
654
670
|
const companions = useDeckCompanions();
|
|
655
671
|
const handleClick = useCallback4(async () => {
|
|
656
672
|
layoutContext.complementarySidebarState = layoutContext.complementarySidebarState === "expanded" ? "collapsed" : "expanded";
|
|
657
|
-
const
|
|
658
|
-
if (layoutContext.complementarySidebarState === "expanded" && !current &&
|
|
673
|
+
const subject = layoutContext.complementarySidebarPanel ?? (companions[0] && getCompanionId(companions[0].id));
|
|
674
|
+
if (layoutContext.complementarySidebarState === "expanded" && !current && subject) {
|
|
659
675
|
await dispatch(createIntent4(LayoutAction3.UpdateComplementary, {
|
|
660
676
|
part: "complementary",
|
|
661
|
-
subject
|
|
677
|
+
subject
|
|
662
678
|
}));
|
|
663
679
|
}
|
|
664
680
|
}, [
|
|
@@ -668,17 +684,17 @@ var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
|
|
|
668
684
|
dispatch
|
|
669
685
|
]);
|
|
670
686
|
return /* @__PURE__ */ React6.createElement(IconButton3, {
|
|
671
|
-
iconOnly: true,
|
|
672
|
-
onClick: handleClick,
|
|
673
687
|
variant: "ghost",
|
|
674
|
-
label: t("open complementary sidebar label"),
|
|
675
688
|
classNames: [
|
|
676
689
|
"[&>svg]:-scale-x-100",
|
|
677
690
|
classNames
|
|
678
691
|
],
|
|
679
692
|
icon: "ph--sidebar-simple--regular",
|
|
693
|
+
iconOnly: true,
|
|
694
|
+
label: t("open complementary sidebar label"),
|
|
680
695
|
size: inR0 ? 5 : 4,
|
|
681
|
-
tooltipSide: inR0 ? "left" : void 0
|
|
696
|
+
tooltipSide: inR0 ? "left" : void 0,
|
|
697
|
+
onClick: handleClick
|
|
682
698
|
});
|
|
683
699
|
} finally {
|
|
684
700
|
_effect.f();
|
|
@@ -689,13 +705,13 @@ var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
|
|
|
689
705
|
var label = [
|
|
690
706
|
"complementary sidebar title",
|
|
691
707
|
{
|
|
692
|
-
ns:
|
|
708
|
+
ns: meta.id
|
|
693
709
|
}
|
|
694
710
|
];
|
|
695
711
|
var ComplementarySidebar = ({ current }) => {
|
|
696
712
|
var _effect = _useSignals7();
|
|
697
713
|
try {
|
|
698
|
-
const { t } = useTranslation5(
|
|
714
|
+
const { t } = useTranslation5(meta.id);
|
|
699
715
|
const { dispatchPromise: dispatch } = useIntentDispatcher5();
|
|
700
716
|
const layout = useCapability3(DeckCapabilities.MutableDeckState);
|
|
701
717
|
const layoutMode = getMode(layout.deck);
|
|
@@ -761,7 +777,7 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
761
777
|
classNames: "contents"
|
|
762
778
|
}, /* @__PURE__ */ React7.createElement("div", {
|
|
763
779
|
role: "none",
|
|
764
|
-
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")
|
|
765
781
|
}, /* @__PURE__ */ React7.createElement(Tabs.Tablist, {
|
|
766
782
|
classNames: "grid grid-cols-1 auto-rows-[--rail-action] p-1 gap-1 !overflow-y-auto"
|
|
767
783
|
}, companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tab, {
|
|
@@ -771,7 +787,6 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
771
787
|
}, /* @__PURE__ */ React7.createElement(IconButton4, {
|
|
772
788
|
label: toLocalizedString2(companion.properties.label, t),
|
|
773
789
|
icon: companion.properties.icon,
|
|
774
|
-
size: 5,
|
|
775
790
|
iconOnly: true,
|
|
776
791
|
tooltipSide: "left",
|
|
777
792
|
"data-value": getCompanionId(companion.id),
|
|
@@ -789,9 +804,13 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
789
804
|
}, /* @__PURE__ */ React7.createElement(ToggleComplementarySidebarButton, null))), activeId && companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tabpanel, {
|
|
790
805
|
key: getCompanionId(companion.id),
|
|
791
806
|
value: getCompanionId(companion.id),
|
|
792
|
-
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
|
+
],
|
|
793
812
|
...layout.complementarySidebarState !== "expanded" && {
|
|
794
|
-
inert:
|
|
813
|
+
inert: true
|
|
795
814
|
}
|
|
796
815
|
}, /* @__PURE__ */ React7.createElement(ComplementarySidebarPanel, {
|
|
797
816
|
companion,
|
|
@@ -803,27 +822,29 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
803
822
|
_effect.f();
|
|
804
823
|
}
|
|
805
824
|
};
|
|
806
|
-
var ScrollArea = ({ children }) => {
|
|
807
|
-
var _effect = _useSignals7();
|
|
808
|
-
try {
|
|
809
|
-
return /* @__PURE__ */ React7.createElement("div", {
|
|
810
|
-
className: "flex flex-col grow overflow-x-hidden overflow-y-auto scrollbar-thin"
|
|
811
|
-
}, children);
|
|
812
|
-
} finally {
|
|
813
|
-
_effect.f();
|
|
814
|
-
}
|
|
815
|
-
};
|
|
816
825
|
var ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }) => {
|
|
817
826
|
var _effect = _useSignals7();
|
|
818
827
|
try {
|
|
819
|
-
const { t } = useTranslation5(
|
|
828
|
+
const { t } = useTranslation5(meta.id);
|
|
820
829
|
if (getCompanionId(companion.id) !== activeId && !data) {
|
|
821
830
|
return null;
|
|
822
831
|
}
|
|
823
832
|
const Wrapper = companion.properties.fixed ? Fragment2 : ScrollArea;
|
|
824
|
-
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("
|
|
825
|
-
|
|
826
|
-
|
|
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, {
|
|
827
848
|
role: `deck-companion--${getCompanionId(companion.id)}`,
|
|
828
849
|
data,
|
|
829
850
|
fallback: PlankContentError,
|
|
@@ -839,16 +860,26 @@ var ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar })
|
|
|
839
860
|
_effect.f();
|
|
840
861
|
}
|
|
841
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
|
+
};
|
|
842
873
|
|
|
843
874
|
// src/components/Sidebar/Sidebar.tsx
|
|
844
875
|
import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
|
|
845
876
|
import React8, { useMemo as useMemo4 } from "react";
|
|
846
|
-
import { Surface as Surface4, useCapability as useCapability4 } from "@dxos/app-framework";
|
|
877
|
+
import { Surface as Surface4, useCapability as useCapability4 } from "@dxos/app-framework/react";
|
|
847
878
|
import { Main as Main2 } from "@dxos/react-ui";
|
|
848
879
|
var label2 = [
|
|
849
880
|
"sidebar title",
|
|
850
881
|
{
|
|
851
|
-
ns:
|
|
882
|
+
ns: meta.id
|
|
852
883
|
}
|
|
853
884
|
];
|
|
854
885
|
var Sidebar = () => {
|
|
@@ -891,9 +922,9 @@ var Sidebar = () => {
|
|
|
891
922
|
var Banner = ({ variant, classNames }) => {
|
|
892
923
|
var _effect = _useSignals9();
|
|
893
924
|
try {
|
|
894
|
-
const { t } = useTranslation6(
|
|
925
|
+
const { t } = useTranslation6(meta.id);
|
|
895
926
|
return /* @__PURE__ */ React9.createElement("header", {
|
|
896
|
-
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)
|
|
897
928
|
}, variant === "sidebar" ? /* @__PURE__ */ React9.createElement(CloseSidebarButton, null) : /* @__PURE__ */ React9.createElement(ToggleSidebarButton, null), /* @__PURE__ */ React9.createElement("span", {
|
|
898
929
|
className: "self-center grow mis-1"
|
|
899
930
|
}, t("current app name", {
|
|
@@ -923,19 +954,14 @@ var Banner = ({ variant, classNames }) => {
|
|
|
923
954
|
};
|
|
924
955
|
|
|
925
956
|
// src/components/DeckLayout/DeckLayout.tsx
|
|
926
|
-
import { useSignals as
|
|
927
|
-
import
|
|
928
|
-
import
|
|
929
|
-
import { Capabilities, LayoutAction as LayoutAction5, createIntent as createIntent6, useCapability as useCapability8, useIntentDispatcher as useIntentDispatcher6, usePluginManager } from "@dxos/app-framework";
|
|
930
|
-
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
931
|
-
import { Main as Main3, useMediaQuery, useOnTransition } from "@dxos/react-ui";
|
|
932
|
-
import { DEFAULT_HORIZONTAL_SIZE, Stack, StackContext } from "@dxos/react-ui-stack";
|
|
933
|
-
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";
|
|
934
960
|
|
|
935
961
|
// src/components/DeckLayout/ActiveNode.tsx
|
|
936
962
|
import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
|
|
937
963
|
import React10 from "react";
|
|
938
|
-
import { Surface as Surface6, useAppGraph as useAppGraph3 } from "@dxos/app-framework";
|
|
964
|
+
import { Surface as Surface6, useAppGraph as useAppGraph3 } from "@dxos/app-framework/react";
|
|
939
965
|
import { useNode as useNode2 } from "@dxos/plugin-graph";
|
|
940
966
|
import { useAttended } from "@dxos/react-ui-attention";
|
|
941
967
|
var ActiveNode = () => {
|
|
@@ -960,10 +986,21 @@ var ActiveNode = () => {
|
|
|
960
986
|
}
|
|
961
987
|
};
|
|
962
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
|
+
|
|
963
1000
|
// src/components/DeckLayout/ContentEmpty.tsx
|
|
964
1001
|
import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
|
|
965
1002
|
import React11 from "react";
|
|
966
|
-
import { Surface as Surface7, useCapability as useCapability5 } from "@dxos/app-framework";
|
|
1003
|
+
import { Surface as Surface7, useCapability as useCapability5 } from "@dxos/app-framework/react";
|
|
967
1004
|
var ContentEmpty = () => {
|
|
968
1005
|
var _effect = _useSignals11();
|
|
969
1006
|
try {
|
|
@@ -986,156 +1023,23 @@ var ContentEmpty = () => {
|
|
|
986
1023
|
}
|
|
987
1024
|
};
|
|
988
1025
|
|
|
989
|
-
// src/components/DeckLayout/
|
|
1026
|
+
// src/components/DeckLayout/StatusBar.tsx
|
|
990
1027
|
import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
|
|
991
1028
|
import React12 from "react";
|
|
992
|
-
import { Surface as Surface8
|
|
993
|
-
import { AlertDialog, Dialog as NaturalDialog } from "@dxos/react-ui";
|
|
994
|
-
var Dialog = () => {
|
|
995
|
-
var _effect = _useSignals12();
|
|
996
|
-
try {
|
|
997
|
-
const context = useCapability6(DeckCapabilities.MutableDeckState);
|
|
998
|
-
const { dialogOpen, dialogType, dialogBlockAlign, dialogOverlayClasses, dialogOverlayStyle, dialogContent } = context;
|
|
999
|
-
const Root = dialogType === "alert" ? AlertDialog.Root : NaturalDialog.Root;
|
|
1000
|
-
const Overlay = dialogType === "alert" ? AlertDialog.Overlay : NaturalDialog.Overlay;
|
|
1001
|
-
return /* @__PURE__ */ React12.createElement(Root, {
|
|
1002
|
-
modal: dialogBlockAlign !== "end",
|
|
1003
|
-
open: dialogOpen,
|
|
1004
|
-
onOpenChange: (nextOpen) => context.dialogOpen = nextOpen
|
|
1005
|
-
}, dialogBlockAlign === "end" ? (
|
|
1006
|
-
// TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
|
|
1007
|
-
/* @__PURE__ */ React12.createElement(Surface8, {
|
|
1008
|
-
role: "dialog",
|
|
1009
|
-
data: dialogContent,
|
|
1010
|
-
limit: 1,
|
|
1011
|
-
fallback: PlankContentError,
|
|
1012
|
-
placeholder: /* @__PURE__ */ React12.createElement("div", null)
|
|
1013
|
-
})
|
|
1014
|
-
) : /* @__PURE__ */ React12.createElement(Overlay, {
|
|
1015
|
-
blockAlign: dialogBlockAlign,
|
|
1016
|
-
classNames: dialogOverlayClasses,
|
|
1017
|
-
style: dialogOverlayStyle
|
|
1018
|
-
}, /* @__PURE__ */ React12.createElement(Surface8, {
|
|
1019
|
-
role: "dialog",
|
|
1020
|
-
data: dialogContent,
|
|
1021
|
-
limit: 1,
|
|
1022
|
-
fallback: PlankContentError
|
|
1023
|
-
})));
|
|
1024
|
-
} finally {
|
|
1025
|
-
_effect.f();
|
|
1026
|
-
}
|
|
1027
|
-
};
|
|
1028
|
-
|
|
1029
|
-
// src/components/DeckLayout/Popover.tsx
|
|
1030
|
-
import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
|
|
1031
|
-
import { createContext } from "@radix-ui/react-context";
|
|
1032
|
-
import React13, { useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef2, useState as useState3 } from "react";
|
|
1033
|
-
import { Surface as Surface9, useCapability as useCapability7 } from "@dxos/app-framework";
|
|
1034
|
-
import { Popover as Popover2 } from "@dxos/react-ui";
|
|
1035
|
-
var DEBOUNCE_DELAY = 40;
|
|
1036
|
-
var [DeckPopoverProvider, useDeckPopoverContext] = createContext("DeckPopover");
|
|
1037
|
-
var PopoverRoot = ({ children }) => {
|
|
1038
|
-
var _effect = _useSignals13();
|
|
1039
|
-
try {
|
|
1040
|
-
const layout = useCapability7(DeckCapabilities.MutableDeckState);
|
|
1041
|
-
const virtualRef = useRef2(null);
|
|
1042
|
-
const [virtualIter, setVirtualIter] = useState3(0);
|
|
1043
|
-
const [open, setOpen] = useState3(false);
|
|
1044
|
-
const debounceRef = useRef2(null);
|
|
1045
|
-
useEffect4(() => {
|
|
1046
|
-
setOpen(false);
|
|
1047
|
-
if (layout.popoverOpen) {
|
|
1048
|
-
if (debounceRef.current) {
|
|
1049
|
-
clearTimeout(debounceRef.current);
|
|
1050
|
-
}
|
|
1051
|
-
if (layout.popoverAnchor && virtualRef.current !== layout.popoverAnchor) {
|
|
1052
|
-
virtualRef.current = layout.popoverAnchor ?? null;
|
|
1053
|
-
setVirtualIter((iter) => iter + 1);
|
|
1054
|
-
}
|
|
1055
|
-
debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
|
|
1056
|
-
}
|
|
1057
|
-
}, [
|
|
1058
|
-
layout.popoverOpen,
|
|
1059
|
-
layout.popoverAnchorId,
|
|
1060
|
-
layout.popoverAnchor,
|
|
1061
|
-
layout.popoverContent
|
|
1062
|
-
]);
|
|
1063
|
-
return /* @__PURE__ */ React13.createElement(DeckPopoverProvider, {
|
|
1064
|
-
setOpen
|
|
1065
|
-
}, /* @__PURE__ */ React13.createElement(Popover2.Root, {
|
|
1066
|
-
modal: false,
|
|
1067
|
-
open
|
|
1068
|
-
}, layout.popoverAnchor && /* @__PURE__ */ React13.createElement(Popover2.VirtualTrigger, {
|
|
1069
|
-
key: virtualIter,
|
|
1070
|
-
virtualRef
|
|
1071
|
-
}), children));
|
|
1072
|
-
} finally {
|
|
1073
|
-
_effect.f();
|
|
1074
|
-
}
|
|
1075
|
-
};
|
|
1076
|
-
var PopoverContent = () => {
|
|
1077
|
-
var _effect = _useSignals13();
|
|
1078
|
-
try {
|
|
1079
|
-
const layout = useCapability7(DeckCapabilities.MutableDeckState);
|
|
1080
|
-
const { setOpen } = useDeckPopoverContext("PopoverContent");
|
|
1081
|
-
const handleClose = useCallback6((event) => {
|
|
1082
|
-
if (
|
|
1083
|
-
// TODO(thure): CodeMirror should not focus itself when it updates.
|
|
1084
|
-
event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
|
|
1085
|
-
) {
|
|
1086
|
-
event.preventDefault();
|
|
1087
|
-
} else {
|
|
1088
|
-
setOpen(false);
|
|
1089
|
-
layout.popoverOpen = false;
|
|
1090
|
-
layout.popoverAnchor = void 0;
|
|
1091
|
-
layout.popoverAnchorId = void 0;
|
|
1092
|
-
layout.popoverSide = void 0;
|
|
1093
|
-
}
|
|
1094
|
-
}, [
|
|
1095
|
-
setOpen
|
|
1096
|
-
]);
|
|
1097
|
-
const collisionBoundaries = useMemo5(() => {
|
|
1098
|
-
const closest = layout.popoverAnchor?.closest("[data-popover-collision-boundary]");
|
|
1099
|
-
return closest ? [
|
|
1100
|
-
closest
|
|
1101
|
-
] : [];
|
|
1102
|
-
}, [
|
|
1103
|
-
layout.popoverAnchor
|
|
1104
|
-
]);
|
|
1105
|
-
return /* @__PURE__ */ React13.createElement(Popover2.Portal, null, /* @__PURE__ */ React13.createElement(Popover2.Content, {
|
|
1106
|
-
side: layout.popoverSide,
|
|
1107
|
-
onInteractOutside: handleClose,
|
|
1108
|
-
onEscapeKeyDown: handleClose,
|
|
1109
|
-
collisionBoundary: collisionBoundaries,
|
|
1110
|
-
sticky: "always",
|
|
1111
|
-
hideWhenDetached: true
|
|
1112
|
-
}, /* @__PURE__ */ React13.createElement(Popover2.Viewport, null, /* @__PURE__ */ React13.createElement(Surface9, {
|
|
1113
|
-
role: "card--popover",
|
|
1114
|
-
data: layout.popoverContent,
|
|
1115
|
-
limit: 1
|
|
1116
|
-
})), /* @__PURE__ */ React13.createElement(Popover2.Arrow, null)));
|
|
1117
|
-
} finally {
|
|
1118
|
-
_effect.f();
|
|
1119
|
-
}
|
|
1120
|
-
};
|
|
1121
|
-
|
|
1122
|
-
// src/components/DeckLayout/StatusBar.tsx
|
|
1123
|
-
import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
|
|
1124
|
-
import React14 from "react";
|
|
1125
|
-
import { Surface as Surface10 } from "@dxos/app-framework";
|
|
1029
|
+
import { Surface as Surface8 } from "@dxos/app-framework/react";
|
|
1126
1030
|
import { useLandmarkMover } from "@dxos/react-ui";
|
|
1127
1031
|
var StatusBar = ({ showHints }) => {
|
|
1128
|
-
var _effect =
|
|
1032
|
+
var _effect = _useSignals12();
|
|
1129
1033
|
try {
|
|
1130
1034
|
const mover = useLandmarkMover(void 0, "3");
|
|
1131
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
1132
1036
|
role: "contentinfo",
|
|
1133
1037
|
className: "fixed block-end-0 inset-inline-0 bs-[--statusbar-size] border-bs border-separator z-[2] flex text-description",
|
|
1134
1038
|
...mover
|
|
1135
|
-
}, showHints && /* @__PURE__ */
|
|
1039
|
+
}, showHints && /* @__PURE__ */ React12.createElement(Surface8, {
|
|
1136
1040
|
role: "hints",
|
|
1137
1041
|
limit: 1
|
|
1138
|
-
}), /* @__PURE__ */
|
|
1042
|
+
}), /* @__PURE__ */ React12.createElement(Surface8, {
|
|
1139
1043
|
role: "status-bar",
|
|
1140
1044
|
limit: 1
|
|
1141
1045
|
}));
|
|
@@ -1144,49 +1048,13 @@ var StatusBar = ({ showHints }) => {
|
|
|
1144
1048
|
}
|
|
1145
1049
|
};
|
|
1146
1050
|
|
|
1147
|
-
// src/components/DeckLayout/Toast.tsx
|
|
1148
|
-
import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
|
|
1149
|
-
import React15 from "react";
|
|
1150
|
-
import { Button, Icon as Icon2, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
1151
|
-
var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange }) => {
|
|
1152
|
-
var _effect = _useSignals15();
|
|
1153
|
-
try {
|
|
1154
|
-
const { t } = useTranslation7(DECK_PLUGIN);
|
|
1155
|
-
return /* @__PURE__ */ React15.createElement(NaturalToast.Root, {
|
|
1156
|
-
"data-testid": id,
|
|
1157
|
-
defaultOpen: true,
|
|
1158
|
-
duration,
|
|
1159
|
-
onOpenChange
|
|
1160
|
-
}, /* @__PURE__ */ React15.createElement(NaturalToast.Body, null, /* @__PURE__ */ React15.createElement(NaturalToast.Title, {
|
|
1161
|
-
classNames: "items-center"
|
|
1162
|
-
}, icon && /* @__PURE__ */ React15.createElement(Icon2, {
|
|
1163
|
-
icon,
|
|
1164
|
-
size: 5,
|
|
1165
|
-
classNames: "inline mr-1"
|
|
1166
|
-
}), 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, {
|
|
1167
|
-
altText: toLocalizedString3(actionAlt, t),
|
|
1168
|
-
asChild: true
|
|
1169
|
-
}, /* @__PURE__ */ React15.createElement(Button, {
|
|
1170
|
-
"data-testid": "toast.action",
|
|
1171
|
-
variant: "primary",
|
|
1172
|
-
onClick: () => onAction?.()
|
|
1173
|
-
}, toLocalizedString3(actionLabel, t))), closeLabel && /* @__PURE__ */ React15.createElement(NaturalToast.Close, {
|
|
1174
|
-
asChild: true
|
|
1175
|
-
}, /* @__PURE__ */ React15.createElement(Button, {
|
|
1176
|
-
"data-testid": "toast.close"
|
|
1177
|
-
}, toLocalizedString3(closeLabel, t)))));
|
|
1178
|
-
} finally {
|
|
1179
|
-
_effect.f();
|
|
1180
|
-
}
|
|
1181
|
-
};
|
|
1182
|
-
|
|
1183
1051
|
// src/components/DeckLayout/Topbar.tsx
|
|
1184
|
-
import { useSignals as
|
|
1185
|
-
import
|
|
1052
|
+
import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
|
|
1053
|
+
import React13 from "react";
|
|
1186
1054
|
var Topbar = () => {
|
|
1187
|
-
var _effect =
|
|
1055
|
+
var _effect = _useSignals13();
|
|
1188
1056
|
try {
|
|
1189
|
-
return /* @__PURE__ */
|
|
1057
|
+
return /* @__PURE__ */ React13.createElement(Banner, {
|
|
1190
1058
|
variant: "topbar"
|
|
1191
1059
|
});
|
|
1192
1060
|
} finally {
|
|
@@ -1194,37 +1062,23 @@ var Topbar = () => {
|
|
|
1194
1062
|
}
|
|
1195
1063
|
};
|
|
1196
1064
|
|
|
1197
|
-
// src/components/DeckLayout/
|
|
1198
|
-
var
|
|
1199
|
-
var _effect =
|
|
1200
|
-
try {
|
|
1201
|
-
return order > 0 ? /* @__PURE__ */ React17.createElement("span", {
|
|
1202
|
-
role: "separator",
|
|
1203
|
-
className: "row-span-2 bg-deckSurface is-4",
|
|
1204
|
-
style: {
|
|
1205
|
-
gridColumn: order
|
|
1206
|
-
}
|
|
1207
|
-
}) : null;
|
|
1208
|
-
} finally {
|
|
1209
|
-
_effect.f();
|
|
1210
|
-
}
|
|
1211
|
-
};
|
|
1212
|
-
var DeckLayout = ({ onDismissToast }) => {
|
|
1213
|
-
var _effect = _useSignals17();
|
|
1065
|
+
// src/components/DeckLayout/DeckMain.tsx
|
|
1066
|
+
var DeckMain = () => {
|
|
1067
|
+
var _effect = _useSignals14();
|
|
1214
1068
|
try {
|
|
1215
1069
|
const { dispatchPromise: dispatch } = useIntentDispatcher6();
|
|
1216
|
-
const settings =
|
|
1217
|
-
const context =
|
|
1218
|
-
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;
|
|
1219
1073
|
const { active, activeCompanions, fullscreen, solo, plankSizing } = deck;
|
|
1220
|
-
const breakpoint = useBreakpoints();
|
|
1221
1074
|
const layoutMode = getMode(deck);
|
|
1075
|
+
const breakpoint = useBreakpoints();
|
|
1222
1076
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
1223
1077
|
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
1224
1078
|
const pluginManager = usePluginManager();
|
|
1225
|
-
const scrollLeftRef =
|
|
1226
|
-
const deckRef =
|
|
1227
|
-
|
|
1079
|
+
const scrollLeftRef = useRef2(null);
|
|
1080
|
+
const deckRef = useRef2(null);
|
|
1081
|
+
useEffect4(() => {
|
|
1228
1082
|
const attended = untracked(() => {
|
|
1229
1083
|
const attention = pluginManager.context.getCapability(AttentionCapabilities.Attention);
|
|
1230
1084
|
return attention.current;
|
|
@@ -1234,11 +1088,9 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1234
1088
|
document.querySelector(`article[data-attendable-id="${firstId}"] button`)?.focus();
|
|
1235
1089
|
}
|
|
1236
1090
|
}, []);
|
|
1237
|
-
const [isNotMobile] = useMediaQuery("md"
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
const shouldRevert = useRef3(false);
|
|
1241
|
-
useEffect5(() => {
|
|
1091
|
+
const [isNotMobile] = useMediaQuery("md");
|
|
1092
|
+
const shouldRevert = useRef2(false);
|
|
1093
|
+
useEffect4(() => {
|
|
1242
1094
|
if (!isNotMobile && getMode(deck) === "deck") {
|
|
1243
1095
|
const attended = untracked(() => {
|
|
1244
1096
|
const attention = pluginManager.context.getCapability(AttentionCapabilities.Attention);
|
|
@@ -1265,8 +1117,8 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1265
1117
|
deck,
|
|
1266
1118
|
dispatch
|
|
1267
1119
|
]);
|
|
1268
|
-
|
|
1269
|
-
if (!settings
|
|
1120
|
+
useEffect4(() => {
|
|
1121
|
+
if (!settings?.enableDeck && layoutMode === "deck") {
|
|
1270
1122
|
void dispatch(createIntent6(LayoutAction5.SetLayoutMode, {
|
|
1271
1123
|
part: "mode",
|
|
1272
1124
|
subject: active[0],
|
|
@@ -1276,27 +1128,27 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1276
1128
|
}));
|
|
1277
1129
|
}
|
|
1278
1130
|
}, [
|
|
1279
|
-
settings
|
|
1131
|
+
settings?.enableDeck,
|
|
1280
1132
|
dispatch,
|
|
1281
1133
|
active,
|
|
1282
1134
|
layoutMode
|
|
1283
1135
|
]);
|
|
1284
|
-
const handleResize =
|
|
1136
|
+
const handleResize = useCallback6(() => {
|
|
1285
1137
|
scrollLeftRef.current = null;
|
|
1286
1138
|
}, []);
|
|
1287
|
-
|
|
1139
|
+
useEffect4(() => {
|
|
1288
1140
|
window.addEventListener("resize", handleResize);
|
|
1289
1141
|
return () => window.removeEventListener("resize", handleResize);
|
|
1290
1142
|
}, [
|
|
1291
1143
|
handleResize
|
|
1292
1144
|
]);
|
|
1293
|
-
const restoreScroll =
|
|
1145
|
+
const restoreScroll = useCallback6(() => {
|
|
1294
1146
|
if (deckRef.current && scrollLeftRef.current != null) {
|
|
1295
1147
|
deckRef.current.scrollLeft = scrollLeftRef.current;
|
|
1296
1148
|
}
|
|
1297
1149
|
}, []);
|
|
1298
1150
|
useOnTransition(layoutMode, (mode) => mode !== "deck", "deck", restoreScroll);
|
|
1299
|
-
const handleScroll =
|
|
1151
|
+
const handleScroll = useCallback6((event) => {
|
|
1300
1152
|
if (!solo && event.currentTarget === event.target) {
|
|
1301
1153
|
scrollLeftRef.current = event.target.scrollLeft;
|
|
1302
1154
|
}
|
|
@@ -1304,17 +1156,17 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1304
1156
|
solo
|
|
1305
1157
|
]);
|
|
1306
1158
|
const isEmpty = !solo && active.length === 0;
|
|
1307
|
-
const padding =
|
|
1308
|
-
if (!solo && settings
|
|
1159
|
+
const padding = useMemo5(() => {
|
|
1160
|
+
if (!solo && settings?.overscroll === "centering") {
|
|
1309
1161
|
return calculateOverscroll(active.length);
|
|
1310
1162
|
}
|
|
1311
1163
|
return {};
|
|
1312
1164
|
}, [
|
|
1313
1165
|
solo,
|
|
1314
|
-
settings
|
|
1166
|
+
settings?.overscroll,
|
|
1315
1167
|
deck
|
|
1316
1168
|
]);
|
|
1317
|
-
const mainPosition =
|
|
1169
|
+
const mainPosition = useMemo5(() => [
|
|
1318
1170
|
"grid !block-start-[env(safe-area-inset-top)]",
|
|
1319
1171
|
topbar && "!block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
|
|
1320
1172
|
hoistStatusbar && "lg:block-end-[--statusbar-size]"
|
|
@@ -1322,7 +1174,7 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1322
1174
|
topbar,
|
|
1323
1175
|
hoistStatusbar
|
|
1324
1176
|
]);
|
|
1325
|
-
const { order, itemsCount } =
|
|
1177
|
+
const { order, itemsCount } = useMemo5(() => {
|
|
1326
1178
|
return active.reduce((acc, entryId) => {
|
|
1327
1179
|
acc.order[entryId] = acc.itemsCount + 1;
|
|
1328
1180
|
acc.itemsCount += activeCompanions?.[entryId] ? 3 : 2;
|
|
@@ -1335,53 +1187,55 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1335
1187
|
active,
|
|
1336
1188
|
activeCompanions
|
|
1337
1189
|
]);
|
|
1338
|
-
return /* @__PURE__ */
|
|
1190
|
+
return /* @__PURE__ */ React14.createElement(Main3.Root, {
|
|
1339
1191
|
navigationSidebarState: fullscreen ? "closed" : context.sidebarState,
|
|
1340
|
-
onNavigationSidebarStateChange: (next) => context.sidebarState = next,
|
|
1341
1192
|
complementarySidebarState: fullscreen ? "closed" : context.complementarySidebarState,
|
|
1193
|
+
onNavigationSidebarStateChange: (next) => context.sidebarState = next,
|
|
1342
1194
|
onComplementarySidebarStateChange: (next) => context.complementarySidebarState = next
|
|
1343
|
-
}, /* @__PURE__ */
|
|
1195
|
+
}, /* @__PURE__ */ React14.createElement(Sidebar, null), /* @__PURE__ */ React14.createElement(ComplementarySidebar, {
|
|
1344
1196
|
current: complementarySidebarPanel
|
|
1345
|
-
}), /* @__PURE__ */
|
|
1197
|
+
}), /* @__PURE__ */ React14.createElement(Main3.Overlay, null), isEmpty && /* @__PURE__ */ React14.createElement(Main3.Content, {
|
|
1346
1198
|
bounce: true,
|
|
1347
1199
|
handlesFocus: true,
|
|
1348
1200
|
classNames: mainPosition
|
|
1349
|
-
}, /* @__PURE__ */
|
|
1201
|
+
}, /* @__PURE__ */ React14.createElement(ContentEmpty, null)), !isEmpty && /* @__PURE__ */ React14.createElement(Main3.Content, {
|
|
1350
1202
|
bounce: true,
|
|
1351
1203
|
handlesFocus: true,
|
|
1352
1204
|
classNames: mainPosition,
|
|
1353
1205
|
style: {
|
|
1206
|
+
"--main-spacing": settings?.encapsulatedPlanks ? "0.75rem" : "0",
|
|
1354
1207
|
"--dx-main-sidebarWidth": sidebarState === "expanded" ? "var(--nav-sidebar-size)" : sidebarState === "collapsed" ? "var(--l0-size)" : "0",
|
|
1355
1208
|
"--dx-main-complementaryWidth": complementarySidebarState === "expanded" ? "var(--complementary-sidebar-size)" : complementarySidebarState === "collapsed" ? "var(--rail-size)" : "0",
|
|
1356
1209
|
"--dx-main-contentFirstWidth": `${plankSizing[active[0] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`,
|
|
1357
1210
|
"--dx-main-contentLastWidth": `${plankSizing[active[(active.length ?? 1) - 1] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`
|
|
1358
1211
|
}
|
|
1359
|
-
}, /* @__PURE__ */
|
|
1212
|
+
}, /* @__PURE__ */ React14.createElement("div", {
|
|
1360
1213
|
role: "none",
|
|
1361
1214
|
className: !solo ? "relative bg-deckSurface overflow-hidden" : "sr-only",
|
|
1362
1215
|
...solo && {
|
|
1363
|
-
inert:
|
|
1216
|
+
inert: true
|
|
1364
1217
|
}
|
|
1365
|
-
}, !topbar && !fullscreen && /* @__PURE__ */
|
|
1218
|
+
}, !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleSidebarButton, {
|
|
1366
1219
|
classNames: fixedSidebarToggleStyles
|
|
1367
|
-
}), !topbar && !fullscreen && /* @__PURE__ */
|
|
1220
|
+
}), !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleComplementarySidebarButton, {
|
|
1368
1221
|
classNames: fixedComplementarySidebarToggleStyles
|
|
1369
|
-
}), /* @__PURE__ */
|
|
1222
|
+
}), /* @__PURE__ */ React14.createElement(Stack, {
|
|
1370
1223
|
ref: deckRef,
|
|
1371
1224
|
orientation: "horizontal",
|
|
1372
1225
|
size: "contain",
|
|
1226
|
+
itemsCount: itemsCount - 1,
|
|
1373
1227
|
classNames: [
|
|
1374
|
-
"absolute inset-block-
|
|
1228
|
+
"absolute inset-block-[--main-spacing] -inset-inline-px bs-[calc(100%-2*var(--main-spacing))]",
|
|
1375
1229
|
mainPaddingTransitions
|
|
1376
1230
|
],
|
|
1377
|
-
itemsCount: itemsCount - 1,
|
|
1378
1231
|
style: padding,
|
|
1379
1232
|
onScroll: handleScroll
|
|
1380
|
-
}, active.map((entryId) => /* @__PURE__ */
|
|
1233
|
+
}, active.map((entryId) => /* @__PURE__ */ React14.createElement(Fragment3, {
|
|
1381
1234
|
key: entryId
|
|
1382
|
-
}, /* @__PURE__ */
|
|
1383
|
-
order: order[entryId] - 1
|
|
1384
|
-
|
|
1235
|
+
}, /* @__PURE__ */ React14.createElement(PlankSeparator, {
|
|
1236
|
+
order: order[entryId] - 1,
|
|
1237
|
+
encapsulate: !!settings?.enableDeck
|
|
1238
|
+
}), /* @__PURE__ */ React14.createElement(Plank, {
|
|
1385
1239
|
id: entryId,
|
|
1386
1240
|
companionId: activeCompanions?.[entryId],
|
|
1387
1241
|
part: "deck",
|
|
@@ -1389,36 +1243,217 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1389
1243
|
active,
|
|
1390
1244
|
layoutMode,
|
|
1391
1245
|
settings
|
|
1392
|
-
}))))), /* @__PURE__ */
|
|
1246
|
+
}))))), /* @__PURE__ */ React14.createElement("div", {
|
|
1393
1247
|
role: "none",
|
|
1394
|
-
className: solo ? "relative bg-deckSurface
|
|
1248
|
+
className: solo ? "relative overflow-hidden bg-deckSurface" : "sr-only",
|
|
1395
1249
|
...!solo && {
|
|
1396
|
-
inert:
|
|
1250
|
+
inert: true
|
|
1397
1251
|
}
|
|
1398
|
-
}, !topbar && !fullscreen && /* @__PURE__ */
|
|
1252
|
+
}, !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleSidebarButton, {
|
|
1399
1253
|
classNames: fixedSidebarToggleStyles
|
|
1400
|
-
}), !topbar && !fullscreen && /* @__PURE__ */
|
|
1254
|
+
}), !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleComplementarySidebarButton, {
|
|
1401
1255
|
classNames: fixedComplementarySidebarToggleStyles
|
|
1402
|
-
}), /* @__PURE__ */
|
|
1256
|
+
}), /* @__PURE__ */ React14.createElement(StackContext.Provider, {
|
|
1403
1257
|
value: {
|
|
1404
|
-
size: "contain",
|
|
1405
1258
|
orientation: "horizontal",
|
|
1259
|
+
size: "contain",
|
|
1406
1260
|
rail: true
|
|
1407
1261
|
}
|
|
1408
|
-
}, /* @__PURE__ */
|
|
1262
|
+
}, /* @__PURE__ */ React14.createElement(Plank, {
|
|
1409
1263
|
id: solo,
|
|
1410
1264
|
companionId: solo ? activeCompanions?.[solo] : void 0,
|
|
1411
1265
|
part: "solo",
|
|
1412
1266
|
layoutMode,
|
|
1413
1267
|
settings
|
|
1414
|
-
})))), topbar && /* @__PURE__ */
|
|
1415
|
-
showHints: settings
|
|
1416
|
-
}))
|
|
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, {
|
|
1417
1452
|
...toast,
|
|
1418
1453
|
key: toast.id,
|
|
1419
1454
|
onOpenChange: (open) => {
|
|
1420
1455
|
if (!open) {
|
|
1421
|
-
onDismissToast(toast.id);
|
|
1456
|
+
onDismissToast?.(toast.id);
|
|
1422
1457
|
}
|
|
1423
1458
|
return open;
|
|
1424
1459
|
}
|
|
@@ -1428,60 +1463,80 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1428
1463
|
}
|
|
1429
1464
|
};
|
|
1430
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
|
+
|
|
1431
1481
|
// src/components/DeckSettings/DeckSettings.tsx
|
|
1432
|
-
import { useSignals as
|
|
1433
|
-
import
|
|
1482
|
+
import { useSignals as _useSignals19 } from "@preact-signals/safe-react/tracking";
|
|
1483
|
+
import React19 from "react";
|
|
1434
1484
|
import { Input, Select, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
1435
1485
|
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
1436
1486
|
var isSocket = !!globalThis.__args;
|
|
1437
1487
|
var DeckSettings = ({ settings }) => {
|
|
1438
|
-
var _effect =
|
|
1488
|
+
var _effect = _useSignals19();
|
|
1439
1489
|
try {
|
|
1440
|
-
const { t } = useTranslation8(
|
|
1441
|
-
return /* @__PURE__ */
|
|
1490
|
+
const { t } = useTranslation8(meta.id);
|
|
1491
|
+
return /* @__PURE__ */ React19.createElement(ControlPage, null, /* @__PURE__ */ React19.createElement(ControlSection, {
|
|
1442
1492
|
title: t("settings title", {
|
|
1443
|
-
ns:
|
|
1493
|
+
ns: meta.id
|
|
1444
1494
|
})
|
|
1445
|
-
}, /* @__PURE__ */
|
|
1495
|
+
}, /* @__PURE__ */ React19.createElement(ControlGroup, null, /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1446
1496
|
title: t("settings enable deck label")
|
|
1447
|
-
}, /* @__PURE__ */
|
|
1497
|
+
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1448
1498
|
checked: settings.enableDeck,
|
|
1449
1499
|
onCheckedChange: (checked) => settings.enableDeck = checked
|
|
1450
|
-
})), /* @__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, {
|
|
1451
1506
|
title: t("select new plank positioning label")
|
|
1452
|
-
}, /* @__PURE__ */
|
|
1507
|
+
}, /* @__PURE__ */ React19.createElement(Select.Root, {
|
|
1453
1508
|
disabled: !settings.enableDeck,
|
|
1454
1509
|
value: settings.newPlankPositioning ?? "start",
|
|
1455
1510
|
onValueChange: (value) => settings.newPlankPositioning = value
|
|
1456
|
-
}, /* @__PURE__ */
|
|
1511
|
+
}, /* @__PURE__ */ React19.createElement(Select.TriggerButton, {
|
|
1457
1512
|
placeholder: t("select new plank positioning placeholder")
|
|
1458
|
-
}), /* @__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, {
|
|
1459
1514
|
key: position,
|
|
1460
1515
|
value: position
|
|
1461
|
-
}, 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, {
|
|
1462
1517
|
title: t("settings overscroll label")
|
|
1463
|
-
}, /* @__PURE__ */
|
|
1518
|
+
}, /* @__PURE__ */ React19.createElement(Select.Root, {
|
|
1464
1519
|
disabled: !settings.enableDeck,
|
|
1465
1520
|
value: settings.overscroll ?? "none",
|
|
1466
1521
|
onValueChange: (value) => settings.overscroll = value
|
|
1467
|
-
}, /* @__PURE__ */
|
|
1522
|
+
}, /* @__PURE__ */ React19.createElement(Select.TriggerButton, {
|
|
1468
1523
|
placeholder: t("select overscroll placeholder")
|
|
1469
|
-
}), /* @__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, {
|
|
1470
1525
|
key: option,
|
|
1471
1526
|
value: option
|
|
1472
|
-
}, t(`settings overscroll ${option} label`)))), /* @__PURE__ */
|
|
1527
|
+
}, t(`settings overscroll ${option} label`)))), /* @__PURE__ */ React19.createElement(Select.Arrow, null))))), /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1473
1528
|
title: t("settings enable statusbar label")
|
|
1474
|
-
}, /* @__PURE__ */
|
|
1529
|
+
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1475
1530
|
checked: settings.enableStatusbar,
|
|
1476
1531
|
onCheckedChange: (checked) => settings.enableStatusbar = checked
|
|
1477
|
-
})), /* @__PURE__ */
|
|
1532
|
+
})), /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1478
1533
|
title: t("settings show hints label")
|
|
1479
|
-
}, /* @__PURE__ */
|
|
1534
|
+
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1480
1535
|
checked: settings.showHints,
|
|
1481
1536
|
onCheckedChange: (checked) => settings.showHints = checked
|
|
1482
|
-
})), !isSocket && /* @__PURE__ */
|
|
1537
|
+
})), !isSocket && /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1483
1538
|
title: t("settings native redirect label")
|
|
1484
|
-
}, /* @__PURE__ */
|
|
1539
|
+
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1485
1540
|
checked: settings.enableNativeRedirect,
|
|
1486
1541
|
onCheckedChange: (checked) => settings.enableNativeRedirect = checked
|
|
1487
1542
|
})))));
|
|
@@ -1495,4 +1550,4 @@ export {
|
|
|
1495
1550
|
DeckLayout,
|
|
1496
1551
|
DeckSettings
|
|
1497
1552
|
};
|
|
1498
|
-
//# sourceMappingURL=chunk-
|
|
1553
|
+
//# sourceMappingURL=chunk-VUJ6UNIJ.mjs.map
|