@dxos/plugin-deck 0.9.0 → 0.9.1-main.c7dcc2e112
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/neutral/{DeckLayout-DEURA3KR.mjs → DeckLayout-VX2BP4Q2.mjs} +35 -22
- package/dist/lib/neutral/DeckLayout-VX2BP4Q2.mjs.map +7 -0
- package/dist/lib/neutral/DeckPlugin.mjs +2 -2
- package/dist/lib/neutral/DeckPlugin.mjs.map +4 -4
- package/dist/lib/neutral/{DeckSettings-W5I57OXM.mjs → DeckSettings-CQQZJ2YS.mjs} +3 -3
- package/dist/lib/neutral/DeckSettings-CQQZJ2YS.mjs.map +7 -0
- package/dist/lib/neutral/{add-toast-TNB6DXWU.mjs → add-toast-APKTCLIA.mjs} +2 -2
- package/dist/lib/neutral/{adjust-HNU5CCRO.mjs → adjust-7CZI4GK3.mjs} +3 -3
- package/dist/lib/neutral/{app-graph-builder-HMLT627T.mjs → app-graph-builder-6HTXRTU2.mjs} +5 -5
- package/dist/lib/neutral/app-graph-builder-6HTXRTU2.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +8 -8
- package/dist/lib/neutral/{check-app-scheme-INSOF72J.mjs → check-app-scheme-HSAORHHX.mjs} +2 -2
- package/dist/lib/neutral/{chunk-BS4EOYMK.mjs → chunk-CL7JIOI5.mjs} +28 -14
- package/dist/lib/neutral/chunk-CL7JIOI5.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-WAXJPQJI.mjs → chunk-DNG3L5QN.mjs} +31 -33
- package/dist/lib/neutral/chunk-DNG3L5QN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KY7LMF4D.mjs +46 -0
- package/dist/lib/neutral/chunk-KY7LMF4D.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-324PPIZB.mjs → chunk-KZFJ4PBT.mjs} +4 -4
- package/dist/lib/neutral/chunk-KZFJ4PBT.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-GBIGQKYW.mjs → chunk-NGX6RXNV.mjs} +4 -4
- package/dist/lib/neutral/chunk-NGX6RXNV.mjs.map +7 -0
- package/dist/lib/neutral/chunk-UZLAR4DR.mjs +8 -0
- package/dist/lib/neutral/{close-ASKR22A6.mjs → close-KJUCFIJ5.mjs} +3 -3
- package/dist/lib/neutral/components/index.mjs +1 -1
- package/dist/lib/neutral/containers/index.mjs +3 -3
- package/dist/lib/neutral/index.mjs +12 -2
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/{notification-tracker-P36322BH.mjs → notification-tracker-CUDFRDCF.mjs} +9 -9
- package/dist/lib/neutral/{notification-tracker-P36322BH.mjs.map → notification-tracker-CUDFRDCF.mjs.map} +3 -3
- package/dist/lib/neutral/{open-5OYNO3RT.mjs → open-VU7YS3HB.mjs} +7 -7
- package/dist/lib/neutral/open-VU7YS3HB.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +2 -2
- package/dist/lib/neutral/{react-root-HH5DEUOG.mjs → react-root-E6TAFHX6.mjs} +2 -2
- package/dist/lib/neutral/react-root-E6TAFHX6.mjs.map +7 -0
- package/dist/lib/neutral/{react-surface-3UVVCK3O.mjs → react-surface-O4POQWYL.mjs} +4 -5
- package/dist/lib/neutral/react-surface-O4POQWYL.mjs.map +7 -0
- package/dist/lib/neutral/{revert-workspace-B2QLT2C4.mjs → revert-workspace-24TKG3I7.mjs} +2 -2
- package/dist/lib/neutral/{scroll-into-view-B52C3PJO.mjs → scroll-into-view-3VXT6TWC.mjs} +2 -2
- package/dist/lib/neutral/{set-PA35ONXO.mjs → set-RFOLTI57.mjs} +3 -3
- package/dist/lib/neutral/{set-layout-mode-RPCCPQRB.mjs → set-layout-mode-AZ73W52Z.mjs} +2 -2
- package/dist/lib/neutral/{settings-EGNYUM4T.mjs → settings-6CDQEB6B.mjs} +3 -3
- package/dist/lib/neutral/settings-6CDQEB6B.mjs.map +7 -0
- package/dist/lib/neutral/{state-IIDXMQUO.mjs → state-D3YXB5NP.mjs} +3 -3
- package/dist/lib/neutral/{state-IIDXMQUO.mjs.map → state-D3YXB5NP.mjs.map} +2 -2
- package/dist/lib/neutral/{switch-workspace-LZF4KZXH.mjs → switch-workspace-TBPT23CZ.mjs} +4 -4
- package/dist/lib/neutral/switch-workspace-TBPT23CZ.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +1 -1
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/lib/neutral/types/index.mjs +11 -1
- package/dist/lib/neutral/{update-companion-YUCZZVGY.mjs → update-companion-5LCY6QME.mjs} +2 -2
- package/dist/lib/neutral/{update-complementary-7FZNB55J.mjs → update-complementary-HZ7QXZYE.mjs} +2 -2
- package/dist/lib/neutral/{update-dialog-FNQTSSAP.mjs → update-dialog-A7W3R5EI.mjs} +2 -2
- package/dist/lib/neutral/{update-plank-size-3YW4NXEY.mjs → update-plank-size-XHTYBLSD.mjs} +2 -2
- package/dist/lib/neutral/{update-popover-G2VUD7E6.mjs → update-popover-RDIHG73B.mjs} +2 -2
- package/dist/lib/neutral/{update-sidebar-KRHPUHUB.mjs → update-sidebar-GEI7USA5.mjs} +2 -2
- package/dist/lib/neutral/{url-handler-A6HLW4RB.mjs → url-handler-PUS4X33T.mjs} +10 -10
- package/dist/lib/neutral/url-handler-PUS4X33T.mjs.map +7 -0
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +8 -196
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- package/dist/types/src/components/Matrix/Matrix.stories.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/Banner.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/DeckViewport.d.ts.map +1 -1
- package/dist/types/src/containers/Deck/StatusBar.d.ts.map +1 -1
- package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DeckLayout/Popover.d.ts.map +1 -1
- package/dist/types/src/containers/Plank/PlankHeading.d.ts.map +1 -1
- package/dist/types/src/containers/Sidebar/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +28 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/open.d.ts.map +1 -1
- package/dist/types/src/operations/switch-workspace.d.ts.map +1 -1
- package/dist/types/src/types/DeckCapabilities.d.ts +2 -2
- package/dist/types/src/types/DeckCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +4 -2
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/surface.d.ts +12 -0
- package/dist/types/src/types/surface.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +35 -0
- package/package.json +39 -39
- package/src/DeckPlugin.test.ts +1 -1
- package/src/DeckPlugin.ts +1 -1
- package/src/capabilities/app-graph-builder.ts +4 -4
- package/src/capabilities/check-app-scheme.ts +3 -3
- package/src/capabilities/notification-tracker.ts +8 -8
- package/src/capabilities/react-root.tsx +1 -1
- package/src/capabilities/react-surface.tsx +3 -4
- package/src/capabilities/settings.ts +2 -2
- package/src/capabilities/state.ts +1 -1
- package/src/capabilities/url-handler.ts +7 -15
- package/src/components/DeckSettings/DeckSettings.tsx +2 -2
- package/src/components/Matrix/Matrix.stories.tsx +2 -1
- package/src/containers/Deck/Banner.tsx +5 -4
- package/src/containers/Deck/DeckViewport.tsx +3 -4
- package/src/containers/Deck/StatusBar.tsx +4 -2
- package/src/containers/DeckLayout/DeckLayout.stories.tsx +6 -9
- package/src/containers/DeckLayout/Fallback.tsx +1 -1
- package/src/containers/DeckLayout/Popover.tsx +37 -20
- package/src/containers/DeckLayout/Toast.tsx +1 -1
- package/src/containers/Plank/Plank.stories.tsx +2 -2
- package/src/containers/Plank/PlankControls.tsx +2 -2
- package/src/containers/Plank/PlankError.tsx +1 -1
- package/src/containers/Plank/PlankHeading.tsx +5 -6
- package/src/containers/Sidebar/ComplementarySidebar.tsx +6 -5
- package/src/containers/Sidebar/Sidebar.tsx +1 -1
- package/src/containers/Sidebar/SidebarButton.tsx +3 -3
- package/src/meta.ts +2 -27
- package/src/operations/open.ts +12 -10
- package/src/operations/switch-workspace.ts +2 -2
- package/src/translations.ts +1 -1
- package/src/types/DeckCapabilities.ts +5 -3
- package/src/types/DeckEvents.ts +1 -1
- package/src/types/DeckOperation.ts +1 -1
- package/src/types/index.ts +1 -0
- package/src/types/schema.ts +16 -12
- package/src/types/surface.ts +28 -0
- package/src/util/plank-url-params.ts +3 -3
- package/dist/lib/neutral/DeckLayout-DEURA3KR.mjs.map +0 -7
- package/dist/lib/neutral/DeckSettings-W5I57OXM.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-HMLT627T.mjs.map +0 -7
- package/dist/lib/neutral/chunk-324PPIZB.mjs.map +0 -7
- package/dist/lib/neutral/chunk-BS4EOYMK.mjs.map +0 -7
- package/dist/lib/neutral/chunk-GBIGQKYW.mjs.map +0 -7
- package/dist/lib/neutral/chunk-PYEY5SEC.mjs +0 -37
- package/dist/lib/neutral/chunk-PYEY5SEC.mjs.map +0 -7
- package/dist/lib/neutral/chunk-Q4W6B4IB.mjs +0 -8
- package/dist/lib/neutral/chunk-WAXJPQJI.mjs.map +0 -7
- package/dist/lib/neutral/open-5OYNO3RT.mjs.map +0 -7
- package/dist/lib/neutral/react-root-HH5DEUOG.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-3UVVCK3O.mjs.map +0 -7
- package/dist/lib/neutral/settings-EGNYUM4T.mjs.map +0 -7
- package/dist/lib/neutral/switch-workspace-LZF4KZXH.mjs.map +0 -7
- package/dist/lib/neutral/url-handler-A6HLW4RB.mjs.map +0 -7
- /package/dist/lib/neutral/{add-toast-TNB6DXWU.mjs.map → add-toast-APKTCLIA.mjs.map} +0 -0
- /package/dist/lib/neutral/{adjust-HNU5CCRO.mjs.map → adjust-7CZI4GK3.mjs.map} +0 -0
- /package/dist/lib/neutral/{check-app-scheme-INSOF72J.mjs.map → check-app-scheme-HSAORHHX.mjs.map} +0 -0
- /package/dist/lib/neutral/{chunk-Q4W6B4IB.mjs.map → chunk-UZLAR4DR.mjs.map} +0 -0
- /package/dist/lib/neutral/{close-ASKR22A6.mjs.map → close-KJUCFIJ5.mjs.map} +0 -0
- /package/dist/lib/neutral/{revert-workspace-B2QLT2C4.mjs.map → revert-workspace-24TKG3I7.mjs.map} +0 -0
- /package/dist/lib/neutral/{scroll-into-view-B52C3PJO.mjs.map → scroll-into-view-3VXT6TWC.mjs.map} +0 -0
- /package/dist/lib/neutral/{set-PA35ONXO.mjs.map → set-RFOLTI57.mjs.map} +0 -0
- /package/dist/lib/neutral/{set-layout-mode-RPCCPQRB.mjs.map → set-layout-mode-AZ73W52Z.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-companion-YUCZZVGY.mjs.map → update-companion-5LCY6QME.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-complementary-7FZNB55J.mjs.map → update-complementary-HZ7QXZYE.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-dialog-FNQTSSAP.mjs.map → update-dialog-A7W3R5EI.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-plank-size-3YW4NXEY.mjs.map → update-plank-size-XHTYBLSD.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-popover-G2VUD7E6.mjs.map → update-popover-RDIHG73B.mjs.map} +0 -0
- /package/dist/lib/neutral/{update-sidebar-KRHPUHUB.mjs.map → update-sidebar-GEI7USA5.mjs.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Deck,
|
|
3
3
|
PlankErrorFallback
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-DNG3L5QN.mjs";
|
|
5
|
+
import "./chunk-NGX6RXNV.mjs";
|
|
6
6
|
import "./chunk-J5LGTIGS.mjs";
|
|
7
7
|
|
|
8
8
|
// src/containers/DeckLayout/DeckLayout.tsx
|
|
@@ -86,7 +86,7 @@ import React3, { useCallback as useCallback2, useEffect, useRef, useState } from
|
|
|
86
86
|
import { Surface as Surface3 } from "@dxos/app-framework/ui";
|
|
87
87
|
import { AppSurface as AppSurface3, useObjectMenuItems } from "@dxos/app-toolkit/ui";
|
|
88
88
|
import { Obj } from "@dxos/echo";
|
|
89
|
-
import { Card, Popover, toLocalizedString,
|
|
89
|
+
import { Card, Icon, IconButton, Popover, toLocalizedString, useMediaQuery, useTranslation } from "@dxos/react-ui";
|
|
90
90
|
import { Menu } from "@dxos/react-ui-menu";
|
|
91
91
|
import { useDeckState as useDeckState2 } from "#hooks";
|
|
92
92
|
import { meta } from "#meta";
|
|
@@ -116,10 +116,11 @@ var PopoverRoot = ({ children }) => {
|
|
|
116
116
|
state.popoverAnchor,
|
|
117
117
|
state.popoverContent
|
|
118
118
|
]);
|
|
119
|
+
const modal = state.popoverKind === "rename";
|
|
119
120
|
return /* @__PURE__ */ React3.createElement(DeckPopoverProvider, {
|
|
120
121
|
setOpen
|
|
121
122
|
}, /* @__PURE__ */ React3.createElement(Popover.Root, {
|
|
122
|
-
modal
|
|
123
|
+
modal,
|
|
123
124
|
open
|
|
124
125
|
}, state.popoverAnchor && /* @__PURE__ */ React3.createElement(Popover.VirtualTrigger, {
|
|
125
126
|
key: virtualIter,
|
|
@@ -127,7 +128,7 @@ var PopoverRoot = ({ children }) => {
|
|
|
127
128
|
}), children));
|
|
128
129
|
};
|
|
129
130
|
var PopoverContent = () => {
|
|
130
|
-
const { t } = useTranslation(meta.
|
|
131
|
+
const { t } = useTranslation(meta.profile.key);
|
|
131
132
|
const { state, updateEphemeral } = useDeckState2();
|
|
132
133
|
const { setOpen } = useDeckPopoverContext("PopoverContent");
|
|
133
134
|
const popoverSubject = state.popoverContent && "subject" in state.popoverContent ? state.popoverContent.subject : void 0;
|
|
@@ -136,7 +137,14 @@ var PopoverContent = () => {
|
|
|
136
137
|
const title = state.popoverTitle ? toLocalizedString(state.popoverTitle, t) : "Unknown";
|
|
137
138
|
const icon = isObjectPopover ? Obj.getIcon(popoverSubject)?.icon ?? "ph--circle-dashed--regular" : void 0;
|
|
138
139
|
const content = state.popoverContent;
|
|
139
|
-
const
|
|
140
|
+
const isComponentPopover = (state.popoverKind === "base" || state.popoverKind === "rename") && !!content && "component" in content;
|
|
141
|
+
const isRename = state.popoverKind === "rename";
|
|
142
|
+
const [isLg] = useMediaQuery("lg", {
|
|
143
|
+
fallback: [
|
|
144
|
+
true
|
|
145
|
+
]
|
|
146
|
+
});
|
|
147
|
+
const side = isRename ? isLg ? "right" : "bottom" : state.popoverSide;
|
|
140
148
|
const handleClose = useCallback2(() => {
|
|
141
149
|
setOpen(false);
|
|
142
150
|
updateEphemeral((state2) => ({
|
|
@@ -150,25 +158,28 @@ var PopoverContent = () => {
|
|
|
150
158
|
updateEphemeral
|
|
151
159
|
]);
|
|
152
160
|
const handleInteractOutside = useCallback2((event) => {
|
|
153
|
-
if (
|
|
154
|
-
// TODO(thure): CodeMirror should not focus itself when it updates.
|
|
155
|
-
event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
|
|
156
|
-
) {
|
|
161
|
+
if (event.type === "dismissableLayer.focusOutside") {
|
|
157
162
|
event.preventDefault();
|
|
158
|
-
|
|
159
|
-
handleClose();
|
|
163
|
+
return;
|
|
160
164
|
}
|
|
165
|
+
handleClose();
|
|
161
166
|
}, [
|
|
162
167
|
handleClose
|
|
163
168
|
]);
|
|
164
169
|
return /* @__PURE__ */ React3.createElement(Popover.Portal, null, /* @__PURE__ */ React3.createElement(Popover.Content, {
|
|
165
|
-
side
|
|
170
|
+
side,
|
|
166
171
|
sticky: "always",
|
|
167
172
|
hideWhenDetached: true,
|
|
168
|
-
|
|
173
|
+
// Rename focuses its input; other popovers keep focus where it was.
|
|
174
|
+
onOpenAutoFocus: isRename ? void 0 : (event) => event.preventDefault(),
|
|
169
175
|
onInteractOutside: handleInteractOutside,
|
|
170
|
-
onEscapeKeyDown: handleInteractOutside
|
|
171
|
-
|
|
176
|
+
onEscapeKeyDown: handleInteractOutside,
|
|
177
|
+
// Reuse the dialog's enter/exit motion so the rename popover does not flicker on open.
|
|
178
|
+
classNames: isRename ? [
|
|
179
|
+
"data-[state=open]:animate-slide-up-and-fade",
|
|
180
|
+
"data-[state=closed]:animate-slide-down-and-fade"
|
|
181
|
+
] : void 0
|
|
182
|
+
}, /* @__PURE__ */ React3.createElement(Popover.Viewport, null, isComponentPopover && content && "component" in content ? (
|
|
172
183
|
/* Base popover: a plugin-provided component (e.g. editor link preview). */
|
|
173
184
|
/* @__PURE__ */ React3.createElement(Surface3.Surface, {
|
|
174
185
|
type: AppSurface3.Popover,
|
|
@@ -186,12 +197,14 @@ var PopoverContent = () => {
|
|
|
186
197
|
/* @__PURE__ */ React3.createElement(Menu.Root, null, /* @__PURE__ */ React3.createElement(Card.Root, {
|
|
187
198
|
border: false,
|
|
188
199
|
classNames: "dx-card-popover"
|
|
189
|
-
}, /* @__PURE__ */ React3.createElement(Card.Header, null, /* @__PURE__ */ React3.createElement(Card.
|
|
200
|
+
}, /* @__PURE__ */ React3.createElement(Card.Header, null, /* @__PURE__ */ React3.createElement(Card.Block, null, icon && /* @__PURE__ */ React3.createElement(Icon, {
|
|
190
201
|
icon
|
|
191
|
-
})), /* @__PURE__ */ React3.createElement(Card.Title, null, title), /* @__PURE__ */ React3.createElement(Card.
|
|
202
|
+
})), /* @__PURE__ */ React3.createElement(Card.Title, null, title), /* @__PURE__ */ React3.createElement(Card.Block, {
|
|
203
|
+
end: true
|
|
204
|
+
}, /* @__PURE__ */ React3.createElement(Menu.Trigger, {
|
|
192
205
|
asChild: true,
|
|
193
206
|
disabled: !objectMenuItems.length
|
|
194
|
-
}, /* @__PURE__ */ React3.createElement(
|
|
207
|
+
}, /* @__PURE__ */ React3.createElement(IconButton, {
|
|
195
208
|
variant: "ghost",
|
|
196
209
|
density: "sm",
|
|
197
210
|
icon: "ph--dots-three-vertical--regular",
|
|
@@ -200,7 +213,7 @@ var PopoverContent = () => {
|
|
|
200
213
|
})), /* @__PURE__ */ React3.createElement(Menu.Content, {
|
|
201
214
|
items: objectMenuItems
|
|
202
215
|
}))), content && "subject" in content ? /* @__PURE__ */ React3.createElement(Surface3.Surface, {
|
|
203
|
-
type: AppSurface3.
|
|
216
|
+
type: AppSurface3.CardContent,
|
|
204
217
|
data: content,
|
|
205
218
|
limit: 1
|
|
206
219
|
}) : /* @__PURE__ */ React3.createElement(Card.Body, {
|
|
@@ -216,7 +229,7 @@ import React4, { useState as useState2 } from "react";
|
|
|
216
229
|
import { Button, Toast as NaturalToast, toLocalizedString as toLocalizedString2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
217
230
|
import { meta as meta2 } from "#meta";
|
|
218
231
|
var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, onAction, onOpenChange }) => {
|
|
219
|
-
const { t } = useTranslation2(meta2.
|
|
232
|
+
const { t } = useTranslation2(meta2.profile.key);
|
|
220
233
|
const [open, setOpen] = useState2(true);
|
|
221
234
|
const handleOpenChange = (next) => {
|
|
222
235
|
setOpen(next);
|
|
@@ -288,4 +301,4 @@ export {
|
|
|
288
301
|
NAV_ID,
|
|
289
302
|
DeckLayout_default as default
|
|
290
303
|
};
|
|
291
|
-
//# sourceMappingURL=DeckLayout-
|
|
304
|
+
//# sourceMappingURL=DeckLayout-VX2BP4Q2.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/DeckLayout/DeckLayout.tsx", "../../../src/containers/DeckLayout/ActiveNode.tsx", "../../../src/containers/DeckLayout/Dialog.tsx", "../../../src/containers/DeckLayout/Popover.tsx", "../../../src/containers/DeckLayout/Toast.tsx", "../../../src/containers/DeckLayout/constants.ts", "../../../src/containers/DeckLayout/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { useAtomCapability, useOperationInvoker, usePluginManager } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { Mosaic } from '@dxos/react-ui-mosaic';\n\nimport { useDeckState } from '#hooks';\nimport { DeckCapabilities, getMode } from '#types';\n\nimport { Deck, type DeckLayoutChangeRequest } from '../Deck';\nimport { ActiveNode } from './ActiveNode';\nimport { Dialog } from './Dialog';\nimport { PopoverContent, PopoverRoot } from './Popover';\nimport { Toaster, type ToasterProps } from './Toast';\n\nexport type DeckLayoutProps = Pick<ToasterProps, 'onDismissToast'>;\n\nexport const DeckLayout = ({ onDismissToast }: DeckLayoutProps) => {\n const settings = useAtomCapability(DeckCapabilities.Settings);\n const pluginManager = usePluginManager();\n const { invokePromise } = useOperationInvoker();\n const { deck, state, updateState } = useDeckState();\n const layoutMode = getMode(deck);\n const { toasts } = state;\n\n const handleLayoutChange = useCallback(\n (request: DeckLayoutChangeRequest) => {\n void invokePromise(LayoutOperation.SetLayoutMode, request);\n },\n [invokePromise],\n );\n\n return (\n <Mosaic.Root>\n <PopoverRoot>\n <ActiveNode />\n <Deck.Root\n settings={settings}\n pluginManager={pluginManager}\n layoutMode={layoutMode}\n deck={deck}\n state={state}\n updateState={updateState}\n onLayoutChange={handleLayoutChange}\n >\n <Deck.Content>\n <Deck.Viewport>\n {deck.solo ? <Deck.SoloMode /> : deck.active.length === 0 ? <Deck.ContentEmpty /> : <Deck.MultiMode />}\n </Deck.Viewport>\n </Deck.Content>\n </Deck.Root>\n <PopoverContent />\n <Dialog />\n <Toaster toasts={toasts} onDismissToast={onDismissToast} />\n </PopoverRoot>\n </Mosaic.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface, useAppGraph } from '@dxos/app-toolkit/ui';\nimport { useNode } from '@dxos/plugin-graph';\nimport { useAttended } from '@dxos/react-ui-attention';\n\nimport { useNodeActionExpander } from '#hooks';\n\n// TODO(burdon): Factor out to effect in plugin set document title.\nexport const ActiveNode = () => {\n const [id] = useAttended();\n const { graph } = useAppGraph();\n const activeNode = useNode(graph, id);\n useNodeActionExpander(activeNode);\n\n return (\n <div className='sr-only'>\n {/* TODO(wittjosiah): Weird that this is a surface, feel like it's not really render logic.\n Probably this lives in React-land currently in order to access translations? */}\n <Surface.Surface\n type={AppSurface.DocumentTitle}\n data={{ subject: activeNode } satisfies AppSurface.DocumentTitleData}\n limit={1}\n />\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { AlertDialog, Dialog as NaturalDialog } from '@dxos/react-ui';\n\nimport { useDeckState } from '#hooks';\n\nimport { PlankErrorFallback } from '../Plank';\n\nexport const Dialog = () => {\n const { state, updateEphemeral } = useDeckState();\n const { dialogOpen, dialogType, dialogBlockAlign, dialogOverlayClasses, dialogOverlayStyle, dialogContent } = state;\n const Root = dialogType === 'alert' ? AlertDialog.Root : NaturalDialog.Root;\n const Overlay = dialogType === 'alert' ? AlertDialog.Overlay : NaturalDialog.Overlay;\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n updateEphemeral((s) => ({ ...s, dialogOpen: nextOpen }));\n },\n [updateEphemeral],\n );\n\n // TODO(thure): End block alignment affecting `modal` and whether the surface renders in an overlay is tailored to the needs of the ambient chat dialog. As the feature matures, consider separating concerns.\n return (\n <Root modal={dialogBlockAlign !== 'end'} open={dialogOpen} onOpenChange={handleOpenChange}>\n {dialogBlockAlign === 'end' ? (\n // TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.\n <Surface.Surface\n type={AppSurface.Dialog}\n data={dialogContent ?? undefined}\n limit={1}\n fallback={PlankErrorFallback}\n placeholder={<div />}\n />\n ) : (\n <Overlay blockAlign={dialogBlockAlign} classNames={dialogOverlayClasses} style={dialogOverlayStyle}>\n <Surface.Surface\n type={AppSurface.Dialog}\n data={dialogContent ?? undefined}\n limit={1}\n fallback={PlankErrorFallback}\n />\n </Overlay>\n )}\n </Root>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface, useObjectMenuItems } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport {\n Card,\n Icon,\n IconButton,\n Popover,\n type PopoverContentInteractOutsideEvent,\n toLocalizedString,\n useMediaQuery,\n useTranslation,\n} from '@dxos/react-ui';\nimport { Menu } from '@dxos/react-ui-menu';\n\nimport { useDeckState } from '#hooks';\nimport { meta } from '#meta';\n\nconst DEBOUNCE_DELAY = 40;\n\ntype DeckPopoverContextValue = {\n setOpen: (open: boolean) => void;\n};\n\nconst [DeckPopoverProvider, useDeckPopoverContext] = createContext<DeckPopoverContextValue>('DeckPopover');\n\nexport type PopoverRootProps = PropsWithChildren;\n\nexport const PopoverRoot = ({ children }: PopoverRootProps) => {\n const { state } = useDeckState();\n const virtualRef = useRef<HTMLButtonElement | null>(null);\n const [virtualIter, setVirtualIter] = useState(0);\n const [open, setOpen] = useState(false);\n const debounceRef = useRef<NodeJS.Timeout | null>(null);\n\n // TODO(thure): This is a workaround for the race condition between displaying a Popover and either rendering\n // the anchor further down the tree or measuring the virtual trigger's client rect.\n useEffect(() => {\n setOpen(false);\n if (state.popoverOpen) {\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n }\n if (state.popoverAnchor && virtualRef.current !== state.popoverAnchor) {\n virtualRef.current = state.popoverAnchor ?? null;\n setVirtualIter((iter) => iter + 1);\n }\n debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);\n }\n }, [state.popoverOpen, state.popoverAnchorId, state.popoverAnchor, state.popoverContent]);\n\n // The rename popover is modal so other navtree item menus are inert while it is open.\n const modal = state.popoverKind === 'rename';\n\n return (\n <DeckPopoverProvider setOpen={setOpen}>\n <Popover.Root modal={modal} open={open}>\n {state.popoverAnchor && <Popover.VirtualTrigger key={virtualIter} virtualRef={virtualRef} />}\n {children}\n </Popover.Root>\n </DeckPopoverProvider>\n );\n};\n\nexport const PopoverContent = () => {\n const { t } = useTranslation(meta.profile.key);\n const { state, updateEphemeral } = useDeckState();\n const { setOpen } = useDeckPopoverContext('PopoverContent');\n const popoverSubject =\n state.popoverContent && 'subject' in state.popoverContent ? state.popoverContent.subject : undefined;\n const isObjectPopover = Obj.isObject(popoverSubject);\n const objectMenuItems = useObjectMenuItems(popoverSubject);\n const title = state.popoverTitle ? toLocalizedString(state.popoverTitle, t) : 'Unknown';\n const icon = isObjectPopover ? (Obj.getIcon(popoverSubject)?.icon ?? 'ph--circle-dashed--regular') : undefined;\n const content = state.popoverContent;\n // Base and rename popovers render a plugin-provided component; everything else falls through to the card.\n const isComponentPopover =\n (state.popoverKind === 'base' || state.popoverKind === 'rename') && !!content && 'component' in content;\n const isRename = state.popoverKind === 'rename';\n\n // Anchor to the right of the row on wide displays; drop centered below on narrow ones.\n const [isLg] = useMediaQuery('lg', { fallback: [true] });\n const side = isRename ? (isLg ? 'right' : 'bottom') : state.popoverSide;\n\n const handleClose = useCallback(() => {\n setOpen(false);\n updateEphemeral((state) => ({\n ...state,\n popoverOpen: false,\n popoverAnchor: undefined,\n popoverAnchorId: undefined,\n popoverSide: undefined,\n }));\n }, [updateEphemeral]);\n\n const handleInteractOutside = useCallback(\n (event: KeyboardEvent | PopoverContentInteractOutsideEvent) => {\n // Focus leaving the popover (clicking into the card surfaces a portaled menu, or CodeMirror\n // re-focusing itself) must not dismiss it — only a pointer-down genuinely outside the card, or\n // Escape, closes. (Clicks inside the card never reach here; Radix scopes them to the content.)\n if (event.type === 'dismissableLayer.focusOutside') {\n event.preventDefault();\n return;\n }\n handleClose();\n },\n [handleClose],\n );\n\n return (\n <Popover.Portal>\n <Popover.Content\n side={side}\n sticky='always'\n hideWhenDetached\n // Rename focuses its input; other popovers keep focus where it was.\n onOpenAutoFocus={isRename ? undefined : (event) => event.preventDefault()}\n onInteractOutside={handleInteractOutside}\n onEscapeKeyDown={handleInteractOutside}\n // Reuse the dialog's enter/exit motion so the rename popover does not flicker on open.\n classNames={\n isRename\n ? ['data-[state=open]:animate-slide-up-and-fade', 'data-[state=closed]:animate-slide-down-and-fade']\n : undefined\n }\n >\n <Popover.Viewport>\n {isComponentPopover && content && 'component' in content ? (\n /* Base popover: a plugin-provided component (e.g. editor link preview). */\n <Surface.Surface type={AppSurface.Popover} data={content} limit={1} />\n ) : (\n /*\n * Card popover (default). Rendered for any open popover that isn't an explicit\n * base-component popover so the popover can never collapse to a bare 1px frame: the\n * header (icon + title + menu) always renders, and the body falls back to a fixed-\n * height \"no preview\" row when no subject resolves a card Surface (e.g. system-type\n * objects like a raw Feed that have no registered card and no renderable fields).\n */\n <Menu.Root>\n <Card.Root border={false} classNames='dx-card-popover'>\n <Card.Header>\n <Card.Block>{icon && <Icon icon={icon} />}</Card.Block>\n <Card.Title>{title}</Card.Title>\n {/* TODO(wittjosiah): Reconcile with Card.Menu. */}\n <Card.Block end>\n <Menu.Trigger asChild disabled={!objectMenuItems.length}>\n <IconButton\n variant='ghost'\n density='sm'\n icon='ph--dots-three-vertical--regular'\n iconOnly\n label='Actions'\n />\n </Menu.Trigger>\n <Menu.Content items={objectMenuItems} />\n </Card.Block>\n </Card.Header>\n\n {content && 'subject' in content ? (\n <Surface.Surface type={AppSurface.CardContent} data={content} limit={1} />\n ) : (\n <Card.Body classNames='min-bs-8'>\n <Card.Row>\n <Card.Text variant='description'>{t('popover-no-preview.message')}</Card.Text>\n </Card.Row>\n </Card.Body>\n )}\n </Card.Root>\n </Menu.Root>\n )}\n </Popover.Viewport>\n <Popover.Arrow />\n </Popover.Content>\n </Popover.Portal>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useState } from 'react';\n\nimport { type LayoutOperation } from '@dxos/app-toolkit';\nimport { Button, Toast as NaturalToast, type ToastRootProps, toLocalizedString, useTranslation } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\n\n// TODO(wittjosiah): Render remaining duration as a progress bar within the toast.\nexport const Toast = ({\n id,\n title,\n description,\n icon,\n duration,\n actionLabel,\n actionAlt,\n onAction,\n onOpenChange,\n}: LayoutOperation.Toast & Pick<ToastRootProps, 'onOpenChange'>) => {\n const { t } = useTranslation(meta.profile.key);\n\n // Control the open state so closing flips Radix's `open` (playing the exit animation) rather than\n // unmounting abruptly. Both the close button and Radix's own timeout/swipe route through here.\n const [open, setOpen] = useState(true);\n const handleOpenChange = (next: boolean) => {\n setOpen(next);\n onOpenChange?.(next);\n };\n\n return (\n <NaturalToast.Root data-testid={id} open={open} duration={duration} onOpenChange={handleOpenChange}>\n <NaturalToast.Title icon={icon} onClose={() => handleOpenChange(false)}>\n {title && <span>{toLocalizedString(title, t)}</span>}\n </NaturalToast.Title>\n {description && <NaturalToast.Description>{toLocalizedString(description, t)}</NaturalToast.Description>}\n {onAction && actionAlt && actionLabel && (\n <NaturalToast.Actions>\n <NaturalToast.Action altText={toLocalizedString(actionAlt, t)} asChild>\n <Button data-testid='toast.action' variant='primary' onClick={() => onAction?.()}>\n {toLocalizedString(actionLabel, t)}\n </Button>\n </NaturalToast.Action>\n </NaturalToast.Actions>\n )}\n </NaturalToast.Root>\n );\n};\n\nexport type ToasterProps = {\n toasts?: LayoutOperation.Toast[];\n onDismissToast?: (id: string) => void;\n};\n\nexport const Toaster = ({ toasts, onDismissToast }: ToasterProps) => {\n return (\n <>\n {toasts?.map((toast) => (\n <Toast\n {...toast}\n key={toast.id}\n onOpenChange={(open: boolean) => {\n if (!open) {\n onDismissToast?.(toast.id);\n }\n\n return open;\n }}\n />\n ))}\n </>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nexport const NAV_ID = 'NavTree';\n\nexport const SURFACE_PREFIX = 'surface:';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { DeckLayout } from './DeckLayout';\n\nexport { NAV_ID } from './constants';\n\nexport default DeckLayout;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,OAAOA,UAASC,eAAAA,oBAAmB;AAEnC,SAASC,mBAAmBC,qBAAqBC,wBAAwB;AACzE,SAASC,uBAAuB;AAChC,SAASC,cAAc;AAEvB,SAASC,gBAAAA,qBAAoB;AAC7B,SAASC,kBAAkBC,eAAe;;;ACP1C,OAAOC,WAAW;AAElB,SAASC,eAAe;AACxB,SAASC,YAAYC,mBAAmB;AACxC,SAASC,eAAe;AACxB,SAASC,mBAAmB;AAE5B,SAASC,6BAA6B;AAG/B,IAAMC,aAAa,MAAA;AACxB,QAAM,CAACC,EAAAA,IAAMH,YAAAA;AACb,QAAM,EAAEI,MAAK,IAAKN,YAAAA;AAClB,QAAMO,aAAaN,QAAQK,OAAOD,EAAAA;AAClCF,wBAAsBI,UAAAA;AAEtB,SACE,sBAAA,cAACC,OAAAA;IAAIC,WAAU;KAGb,sBAAA,cAACX,QAAQA,SAAO;IACdY,MAAMX,WAAWY;IACjBC,MAAM;MAAEC,SAASN;IAAW;IAC5BO,OAAO;;AAIf;;;AC3BA,OAAOC,UAASC,mBAAmB;AAEnC,SAASC,WAAAA,gBAAe;AACxB,SAASC,cAAAA,mBAAkB;AAC3B,SAASC,aAAaC,UAAUC,qBAAqB;AAErD,SAASC,oBAAoB;AAItB,IAAMC,SAAS,MAAA;AACpB,QAAM,EAAEC,OAAOC,gBAAe,IAAKC,aAAAA;AACnC,QAAM,EAAEC,YAAYC,YAAYC,kBAAkBC,sBAAsBC,oBAAoBC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AkBC,iBAAiBC,QAAQ;AAC5D,QAAMC,gBAAgBC,iBAAAA;AACtB,QAAM,EAAEC,cAAa,IAAKC,oBAAAA;AAC1B,QAAM,EAAEC,MAAMC,OAAOC,YAAW,IAAKC,cAAAA;AACrC,QAAMC,aAAaC,QAAQL,IAAAA;AAC3B,QAAM,EAAEM,OAAM,IAAKL;AAEnB,QAAMM,qBAAqBC,aACzB,CAACC,YAAAA;AACC,SAAKX,cAAcY,gBAAgBC,eAAeF,OAAAA;EACpD,GACA;IAACX;GAAc;AAGjB,SACE,gBAAAc,OAAA,cAACC,OAAOC,MAAI,MACV,gBAAAF,OAAA,cAACG,aAAAA,MACC,gBAAAH,OAAA,cAACI,YAAAA,IAAAA,GACD,gBAAAJ,OAAA,cAACK,KAAKH,MAAI;IACRtB;IACAI;IACAQ;IACAJ;IACAC;IACAC;IACAgB,gBAAgBX;KAEhB,gBAAAK,OAAA,cAACK,KAAKE,SAAO,MACX,gBAAAP,OAAA,cAACK,KAAKG,UAAQ,MACXpB,KAAKqB,OAAO,gBAAAT,OAAA,cAACK,KAAKK,UAAQ,IAAA,IAAMtB,KAAKuB,OAAOC,WAAW,IAAI,gBAAAZ,OAAA,cAACK,KAAKQ,cAAY,IAAA,IAAM,gBAAAb,OAAA,cAACK,KAAKS,WAAS,IAAA,CAAA,CAAA,CAAA,GAIzG,gBAAAd,OAAA,cAACe,gBAAAA,IAAAA,GACD,gBAAAf,OAAA,cAACgB,QAAAA,IAAAA,GACD,gBAAAhB,OAAA,cAACiB,SAAAA;IAAQvB;IAAgBf;;AAIjC;;;AKzDO,IAAMuC,SAAS;;;ACItB,IAAA,qBAAeC;",
|
|
6
|
+
"names": ["React", "useCallback", "useAtomCapability", "useOperationInvoker", "usePluginManager", "LayoutOperation", "Mosaic", "useDeckState", "DeckCapabilities", "getMode", "React", "Surface", "AppSurface", "useAppGraph", "useNode", "useAttended", "useNodeActionExpander", "ActiveNode", "id", "graph", "activeNode", "div", "className", "type", "DocumentTitle", "data", "subject", "limit", "React", "useCallback", "Surface", "AppSurface", "AlertDialog", "Dialog", "NaturalDialog", "useDeckState", "Dialog", "state", "updateEphemeral", "useDeckState", "dialogOpen", "dialogType", "dialogBlockAlign", "dialogOverlayClasses", "dialogOverlayStyle", "dialogContent", "Root", "AlertDialog", "NaturalDialog", "Overlay", "handleOpenChange", "useCallback", "nextOpen", "s", "React", "modal", "open", "onOpenChange", "Surface", "type", "AppSurface", "data", "undefined", "limit", "fallback", "PlankErrorFallback", "placeholder", "div", "blockAlign", "classNames", "style", "createContext", "React", "useCallback", "useEffect", "useRef", "useState", "Surface", "AppSurface", "useObjectMenuItems", "Obj", "Card", "Icon", "IconButton", "Popover", "toLocalizedString", "useMediaQuery", "useTranslation", "Menu", "useDeckState", "meta", "DEBOUNCE_DELAY", "DeckPopoverProvider", "useDeckPopoverContext", "PopoverRoot", "children", "state", "virtualRef", "virtualIter", "setVirtualIter", "open", "setOpen", "debounceRef", "popoverOpen", "current", "clearTimeout", "popoverAnchor", "iter", "setTimeout", "popoverAnchorId", "popoverContent", "modal", "popoverKind", "Root", "VirtualTrigger", "key", "PopoverContent", "t", "profile", "updateEphemeral", "popoverSubject", "subject", "undefined", "isObjectPopover", "isObject", "objectMenuItems", "title", "popoverTitle", "icon", "getIcon", "content", "isComponentPopover", "isRename", "isLg", "fallback", "side", "popoverSide", "handleClose", "handleInteractOutside", "event", "type", "preventDefault", "Portal", "Content", "sticky", "hideWhenDetached", "onOpenAutoFocus", "onInteractOutside", "onEscapeKeyDown", "classNames", "Viewport", "data", "limit", "border", "Header", "Block", "Title", "end", "Trigger", "asChild", "disabled", "length", "variant", "density", "iconOnly", "label", "items", "CardContent", "Body", "Row", "Text", "Arrow", "React", "useState", "Button", "Toast", "NaturalToast", "toLocalizedString", "useTranslation", "meta", "id", "title", "description", "icon", "duration", "actionLabel", "actionAlt", "onAction", "onOpenChange", "t", "profile", "key", "open", "setOpen", "handleOpenChange", "next", "Root", "data-testid", "Title", "onClose", "span", "Description", "Actions", "Action", "altText", "asChild", "variant", "onClick", "Toaster", "toasts", "onDismissToast", "map", "toast", "DeckLayout", "onDismissToast", "settings", "useAtomCapability", "DeckCapabilities", "Settings", "pluginManager", "usePluginManager", "invokePromise", "useOperationInvoker", "deck", "state", "updateState", "useDeckState", "layoutMode", "getMode", "toasts", "handleLayoutChange", "useCallback", "request", "LayoutOperation", "SetLayoutMode", "React", "Mosaic", "Root", "PopoverRoot", "ActiveNode", "Deck", "onLayoutChange", "Content", "Viewport", "solo", "SoloMode", "active", "length", "ContentEmpty", "MultiMode", "PopoverContent", "Dialog", "Toaster", "NAV_ID", "DeckLayout"]
|
|
7
|
+
}
|
|
@@ -10,7 +10,7 @@ import { meta } from "#meta";
|
|
|
10
10
|
import { translations } from "#translations";
|
|
11
11
|
import { DeckEvents } from "#types";
|
|
12
12
|
|
|
13
|
-
// raw-loader:/__w/dxos/dxos/packages/plugins/plugin-deck/PLUGIN.mdl
|
|
13
|
+
// raw-loader:/__w/dxos/dxos/packages/plugins/plugin-deck/PLUGIN.mdl
|
|
14
14
|
var PLUGIN_default = "---\nid: org.dxos.plugin.deck\nname: DeckPlugin\nversion: 0.1.0\n---\n\nThe Deck plugin is the core layout engine for DXOS Composer. It manages the multi-plank workspace\n(\"deck\"), the sidebar, the complementary sidebar, dialogs, popovers, and toast notifications.\nIt owns the persisted and ephemeral layout state, handles URL routing, and implements every\n`LayoutOperation` that changes what is visible on screen.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype LayoutMode\n literals: multi | solo | solo--fullscreen\n```\n\n```mdl\ntype PartAdjustment\n literals: close | companion | solo | solo--fullscreen | increment-start | increment-end\n```\n\n```mdl\ntype DeckState\n fields:\n initialized: boolean # false until the deck has left solo mode for the first time\n active: string[] # item IDs of planks displayed in multi mode\n inactive: string[] # item IDs that have been closed; persisted for reopening\n solo?: string # item ID of the single plank in solo or fullscreen mode\n fullscreen: boolean # true when the solo plank is displayed without any chrome\n plankSizing: Record<string, number> # persisted plank widths in rem, keyed by item ID\n companionOpen: boolean # whether the companion pane is visible\n companionVariant?: string # which companion variant to display\n companionFrameSizing: Record<string, number> # companion frame widths in rem\n```\n\n```mdl\ntype StoredDeckState\n desc: Persisted plugin state stored in KVS/localStorage.\n fields:\n sidebarState: closed | collapsed | expanded\n complementarySidebarState: closed | collapsed | expanded\n complementarySidebarPanel?: string\n activeDeck: string\n previousDeck: string\n decks: Record<string, DeckState>\n previousMode: Record<string, LayoutMode>\n```\n\n```mdl\ntype EphemeralDeckState\n desc: Transient plugin state that is NOT persisted across sessions.\n fields:\n dialogOpen: boolean\n dialogType?: default | alert\n dialogBlockAlign?: start | center | end\n dialogContent?: { component: string; props?: any }\n popoverOpen: boolean\n popoverSide?: top | right | bottom | left\n popoverKind?: base | card\n popoverTitle?: string\n popoverContentRef?: string\n popoverContent?: { component: string } | { subject: any }\n toasts: Toast[]\n currentUndoId?: string\n scrollIntoView?: string\n```\n\n```mdl\ntype DeckSettings\n fields:\n enableDeck?: boolean # display multiple panels side by side\n encapsulatedPlanks?: boolean # render each plank in an isolated container\n showHints?: boolean # show keyboard shortcut hints in the UI\n enableNativeRedirect?: boolean # redirect supported URLs to the native desktop app\n```\n\n## Components\n\n```mdl\ncomponent Matrix\n desc: |\n The primary workspace canvas. Renders the active planks side by side in multi mode,\n or a single plank in solo/fullscreen mode. Manages plank-resize handles and the\n companion pane alongside each plank.\n props:\n state: StoredDeckState # persisted layout state atom\n ephemeral: EphemeralDeckState # transient state atom\n state:\n mode: LayoutMode # current layout mode derived from state\n actions:\n openPlank(id: string)\n closePlank(id: string)\n adjustPlank(id: string, type: PartAdjustment)\n resizePlank(id: string, size: number)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 sidebar \u2502 plank A \u2502 plank B \u2502\n \u2502 \u2502 \u2502 \u2502\n \u2502 \u2502 [content] \u2502 [content] \u2502\n \u2502 \u2502 \u2502 \u2502\n \u2502 \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502\n \u2502 \u2502 companion \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent DeckSettings\n desc: Settings panel rendered in the Composer settings surface.\n props:\n settings: DeckSettings\n actions:\n updateSetting(key: string, value: any)\n```\n\n## Operations\n\n```mdl\nop Open\n desc: |\n Opens one or more subjects (item IDs or navigation paths) in the deck.\n In multi mode uses stack semantics: truncates after the pivot then appends.\n In solo or uninitialised mode, replaces the current subject entirely.\n Validates each target against the app graph and redirects to a 404 node if not found.\n Fires ScrollIntoView, Expose, and an observability event for each newly opened item.\n input:\n subject: string[] # item IDs or navigation paths to open\n pivotId?: string # truncate deck after this item before appending\n key?: string # replace an existing plank whose ID shares this key prefix\n workspace?: string # switch to this workspace before opening\n navigation?: immediate # skip validation; expand path only\n scrollIntoView?: boolean # default true; set false to suppress auto-scroll\n state?: any\n variant?: string\n output: string[]\n effects: [echo:read, layout:state]\n requires: [AppGraph, AttentionCapabilities, ClientCapabilities, DeckCapabilities]\n```\n\n```mdl\nop Close\n desc: |\n Removes one or more subjects from the active deck.\n Computes which plank (if any) should receive attention after removal and\n schedules ScrollIntoView for it.\n input:\n subject: string[]\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities, AttentionCapabilities]\n```\n\n```mdl\nop SetLayoutMode\n desc: |\n Transitions to a new layout mode (multi, solo, solo--fullscreen) or reverts\n to the previously recorded mode. Persists the previous mode so it can be\n restored later. Toggling solo--fullscreen flips the fullscreen flag rather\n than unconditionally setting it.\n input:\n mode?: LayoutMode # target mode; omit if reverting\n subject?: string # item to solo; used only for solo / solo--fullscreen\n revert?: boolean # revert to the previously persisted mode\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdateSidebar\n desc: Update the sidebar visibility state (closed / collapsed / expanded).\n input:\n state?: closed | collapsed | expanded\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdateComplementary\n desc: Update the complementary-sidebar visibility state and optional panel selection.\n input:\n state?: closed | collapsed | expanded\n panel?: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdateDialog\n desc: |\n Show or hide the global dialog overlay. Accepts a surface component identifier\n or a boolean state flag. Propagates to EphemeralDeckState.\n input:\n subject?: string # surface component identifier to display\n props?: any # props forwarded to the dialog surface\n state?: boolean # false to close the dialog\n type?: default | alert\n blockAlign?: start | center | end\n overlayClasses?: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdatePopover\n desc: |\n Show or hide the global popover. Accepts anchor, content reference, or\n an explicit subject reference.\n input:\n subject?: any # subject reference to pass to the popover surface\n contentRef?: string # surface component identifier for popover content\n anchorId?: string # DOM element ID for positioning the popover anchor\n side?: top | right | bottom | left\n kind?: base | card\n title?: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdateCompanion\n desc: Update the companion-pane open state and active variant.\n input:\n open?: boolean\n variant?: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop AdjustPlank\n desc: Apply a PartAdjustment to a specific plank (close, solo, move, companion).\n input:\n id: string\n type: PartAdjustment\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdatePlankSize\n desc: Persist the width of a plank in rem.\n input:\n id: string\n size: number\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop AddToast\n desc: Push a toast notification into the ephemeral queue.\n input:\n title?: string\n body?: string\n duration?: number\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop ScrollIntoView\n desc: Schedule a subject to be scrolled into view when its plank mounts.\n input:\n subject: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop SwitchWorkspace\n desc: Switch the active workspace deck, persisting the previous workspace ID.\n input:\n subject: string # workspace ID to switch to\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop RevertWorkspace\n desc: Revert to the previously active workspace.\n input: void\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n## Features\n\n```mdl\nfeat F-1: Multi-Plank Layout (Deck)\n\n req F-1.1:\n when: enableDeck setting is true\n then: deck renders active planks side by side in a scrollable row\n\n req F-1.2:\n when: user opens a new subject with a pivot\n then: deck is truncated after the pivot and the new subject is appended\n\n req F-1.3:\n when: subject is already present in the active deck\n then: deck is unchanged and the existing plank scrolls into view\n\n req F-1.4:\n when: user resizes a plank\n then: new width is persisted in plankSizing and restored on next load\n```\n\n```mdl\nfeat F-2: Solo / Fullscreen Mode\n\n req F-2.1:\n when: user triggers SetLayoutMode with mode=solo\n then: only the targeted plank is visible; other planks move to inactive\n\n req F-2.2:\n when: user triggers SetLayoutMode with mode=solo--fullscreen\n then: plank fills the viewport; sidebar and heading chrome are hidden\n\n req F-2.3:\n when: user triggers SetLayoutMode with revert=true\n then: layout returns to the previously persisted mode\n```\n\n```mdl\nfeat F-3: Sidebar & Complementary Sidebar\n\n req F-3.1:\n when: UpdateSidebar is dispatched with a new state\n then: sidebar transitions between closed / collapsed / expanded and state is persisted\n\n req F-3.2:\n when: UpdateComplementary is dispatched with a panel\n then: complementary sidebar opens to the specified panel\n```\n\n```mdl\nfeat F-4: Dialog & Popover Overlay\n\n req F-4.1:\n when: UpdateDialog is dispatched with a subject component\n then: the matching surface is rendered inside the global dialog overlay\n\n req F-4.2:\n when: UpdatePopover is dispatched with an anchorId\n then: popover is positioned relative to that DOM element\n\n req F-4.3:\n when: dialog or popover state is set to false\n then: overlay is closed and content is unmounted\n```\n\n```mdl\nfeat F-5: URL Navigation & Deep Linking\n\n req F-5.1:\n when: app loads with a URL referencing an item\n then: DeckPlugin resolves the path and opens the item in the deck\n\n req F-5.2:\n when: active deck changes\n then: browser URL is updated to reflect the current plank state\n\n req F-5.3:\n when: a navigation target is not found in the app graph\n then: Open operation redirects to a 404 node\n```\n\n```mdl\nfeat F-6: Toast Notifications\n\n req F-6.1:\n when: AddToast is dispatched\n then: a toast is appended to the queue and displayed for its configured duration\n\n req F-6.2:\n when: ShowUndo is dispatched\n then: a toast with an undo action is shown; invoking it executes the linked undo operation\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Open subject in multi mode\n given: deck is in multi mode with planks A and B active\n when: Open({ subject: ['C'] }) is dispatched\n then:\n - plank C is appended to the right of plank B\n - browser URL reflects the new deck state\n - plank C is scrolled into view\n```\n\n```mdl\ntest T-2: Open with pivot truncation\n given: deck has planks [A, B, C] active\n when: Open({ subject: ['D'], pivotId: 'A' }) is dispatched\n then:\n - active deck becomes [A, D]\n - planks B and C are moved to inactive\n```\n\n```mdl\ntest T-3: Open already-visible subject\n given: deck has plank A active\n when: Open({ subject: ['A'] }) is dispatched\n then:\n - active deck is unchanged\n - plank A scrolls into view\n```\n\n```mdl\ntest T-4: Solo mode\n given: deck is in multi mode\n when: SetLayoutMode({ mode: 'solo', subject: 'A' }) is dispatched\n then:\n - only plank A is visible\n - mode is stored as solo in StoredDeckState\n - previousMode records 'multi' for the active deck\n```\n\n```mdl\ntest T-5: Revert from solo to multi\n given: layout mode is solo, previousMode is multi\n when: SetLayoutMode({ revert: true }) is dispatched\n then:\n - deck returns to multi mode\n - previously inactive planks are restored\n```\n\n```mdl\ntest T-6: Close plank\n given: deck has planks [A, B, C] active; B has attention\n when: Close({ subject: ['B'] }) is dispatched\n then:\n - active deck becomes [A, C]\n - attention moves to an adjacent plank\n - ScrollIntoView is scheduled for the newly attended plank\n```\n\n```mdl\ntest T-7: Toast is shown and dismissed\n given: no toasts are in the queue\n when: AddToast({ title: 'Saved', duration: 3000 }) is dispatched\n then:\n - toast appears in the UI\n - toast is removed after 3 seconds\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive \u2014 the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n";
|
|
15
15
|
|
|
16
16
|
// src/DeckPlugin.ts
|
|
@@ -71,7 +71,7 @@ var DeckPlugin = Plugin.define(meta).pipe(
|
|
|
71
71
|
}),
|
|
72
72
|
AppPlugin.addPluginAssetModule({
|
|
73
73
|
asset: {
|
|
74
|
-
pluginId: meta.
|
|
74
|
+
pluginId: meta.profile.key,
|
|
75
75
|
path: "PLUGIN.mdl",
|
|
76
76
|
content: PLUGIN_default,
|
|
77
77
|
mimeType: "application/x-mdl"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/DeckPlugin.ts", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-deck/PLUGIN.mdl
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { setAutoFreeze } from 'immer';\n\nimport { ActivationEvent, ActivationEvents, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\nimport { translations as stackTranslations } from '@dxos/react-ui-stack/translations';\n\nimport {\n AppGraphBuilder,\n CheckAppScheme,\n DeckSettings,\n DeckState,\n NotificationTracker,\n OperationHandler,\n ReactRoot,\n ReactSurface,\n UrlHandler,\n} from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { DeckEvents } from '#types';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\n// NOTE(Zan): When producing values with immer, we shouldn't auto-freeze them because\n// our signal implementation needs to add some hidden properties to the produced values.\n// TODO(Zan): Move this to a more global location if we use immer more broadly.\nsetAutoFreeze(false);\n\nexport const DeckPlugin = Plugin.define(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations: [...translations, ...stackTranslations] }),\n Plugin.addModule({\n activatesOn: AppActivationEvents.SetupSettings,\n firesAfterActivation: [DeckEvents.SettingsReady],\n activate: DeckSettings,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(DeckEvents.SettingsReady, ActivationEvents.ProcessManagerReady),\n activate: CheckAppScheme,\n }),\n Plugin.addModule({\n // TODO(wittjosiah): Does not integrate with settings store.\n // Should this be a different event?\n // Should settings store be renamed to be more generic?\n activatesOn: ActivationEvent.oneOf(AppActivationEvents.SetupSettings, AppActivationEvents.SetupAppGraph),\n firesAfterActivation: [AppActivationEvents.LayoutReady, DeckEvents.StateReady],\n activate: DeckState,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvents.Startup,\n activate: ReactRoot,\n }),\n // Plugin.addModule({\n // activatesOn: Events.SetupArtifactDefinition,\n // activate: Tools,\n // }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(ActivationEvents.ProcessManagerReady, DeckEvents.StateReady),\n activate: UrlHandler,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(ActivationEvents.ProcessManagerReady, DeckEvents.StateReady),\n activate: NotificationTracker,\n }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.id, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default DeckPlugin;\n", "---\nid: org.dxos.plugin.deck\nname: DeckPlugin\nversion: 0.1.0\n---\n\nThe Deck plugin is the core layout engine for DXOS Composer. It manages the multi-plank workspace\n(\"deck\"), the sidebar, the complementary sidebar, dialogs, popovers, and toast notifications.\nIt owns the persisted and ephemeral layout state, handles URL routing, and implements every\n`LayoutOperation` that changes what is visible on screen.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype LayoutMode\n literals: multi | solo | solo--fullscreen\n```\n\n```mdl\ntype PartAdjustment\n literals: close | companion | solo | solo--fullscreen | increment-start | increment-end\n```\n\n```mdl\ntype DeckState\n fields:\n initialized: boolean # false until the deck has left solo mode for the first time\n active: string[] # item IDs of planks displayed in multi mode\n inactive: string[] # item IDs that have been closed; persisted for reopening\n solo?: string # item ID of the single plank in solo or fullscreen mode\n fullscreen: boolean # true when the solo plank is displayed without any chrome\n plankSizing: Record<string, number> # persisted plank widths in rem, keyed by item ID\n companionOpen: boolean # whether the companion pane is visible\n companionVariant?: string # which companion variant to display\n companionFrameSizing: Record<string, number> # companion frame widths in rem\n```\n\n```mdl\ntype StoredDeckState\n desc: Persisted plugin state stored in KVS/localStorage.\n fields:\n sidebarState: closed | collapsed | expanded\n complementarySidebarState: closed | collapsed | expanded\n complementarySidebarPanel?: string\n activeDeck: string\n previousDeck: string\n decks: Record<string, DeckState>\n previousMode: Record<string, LayoutMode>\n```\n\n```mdl\ntype EphemeralDeckState\n desc: Transient plugin state that is NOT persisted across sessions.\n fields:\n dialogOpen: boolean\n dialogType?: default | alert\n dialogBlockAlign?: start | center | end\n dialogContent?: { component: string; props?: any }\n popoverOpen: boolean\n popoverSide?: top | right | bottom | left\n popoverKind?: base | card\n popoverTitle?: string\n popoverContentRef?: string\n popoverContent?: { component: string } | { subject: any }\n toasts: Toast[]\n currentUndoId?: string\n scrollIntoView?: string\n```\n\n```mdl\ntype DeckSettings\n fields:\n enableDeck?: boolean # display multiple panels side by side\n encapsulatedPlanks?: boolean # render each plank in an isolated container\n showHints?: boolean # show keyboard shortcut hints in the UI\n enableNativeRedirect?: boolean # redirect supported URLs to the native desktop app\n```\n\n## Components\n\n```mdl\ncomponent Matrix\n desc: |\n The primary workspace canvas. Renders the active planks side by side in multi mode,\n or a single plank in solo/fullscreen mode. Manages plank-resize handles and the\n companion pane alongside each plank.\n props:\n state: StoredDeckState # persisted layout state atom\n ephemeral: EphemeralDeckState # transient state atom\n state:\n mode: LayoutMode # current layout mode derived from state\n actions:\n openPlank(id: string)\n closePlank(id: string)\n adjustPlank(id: string, type: PartAdjustment)\n resizePlank(id: string, size: number)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 sidebar \u2502 plank A \u2502 plank B \u2502\n \u2502 \u2502 \u2502 \u2502\n \u2502 \u2502 [content] \u2502 [content] \u2502\n \u2502 \u2502 \u2502 \u2502\n \u2502 \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502\n \u2502 \u2502 companion \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent DeckSettings\n desc: Settings panel rendered in the Composer settings surface.\n props:\n settings: DeckSettings\n actions:\n updateSetting(key: string, value: any)\n```\n\n## Operations\n\n```mdl\nop Open\n desc: |\n Opens one or more subjects (item IDs or navigation paths) in the deck.\n In multi mode uses stack semantics: truncates after the pivot then appends.\n In solo or uninitialised mode, replaces the current subject entirely.\n Validates each target against the app graph and redirects to a 404 node if not found.\n Fires ScrollIntoView, Expose, and an observability event for each newly opened item.\n input:\n subject: string[] # item IDs or navigation paths to open\n pivotId?: string # truncate deck after this item before appending\n key?: string # replace an existing plank whose ID shares this key prefix\n workspace?: string # switch to this workspace before opening\n navigation?: immediate # skip validation; expand path only\n scrollIntoView?: boolean # default true; set false to suppress auto-scroll\n state?: any\n variant?: string\n output: string[]\n effects: [echo:read, layout:state]\n requires: [AppGraph, AttentionCapabilities, ClientCapabilities, DeckCapabilities]\n```\n\n```mdl\nop Close\n desc: |\n Removes one or more subjects from the active deck.\n Computes which plank (if any) should receive attention after removal and\n schedules ScrollIntoView for it.\n input:\n subject: string[]\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities, AttentionCapabilities]\n```\n\n```mdl\nop SetLayoutMode\n desc: |\n Transitions to a new layout mode (multi, solo, solo--fullscreen) or reverts\n to the previously recorded mode. Persists the previous mode so it can be\n restored later. Toggling solo--fullscreen flips the fullscreen flag rather\n than unconditionally setting it.\n input:\n mode?: LayoutMode # target mode; omit if reverting\n subject?: string # item to solo; used only for solo / solo--fullscreen\n revert?: boolean # revert to the previously persisted mode\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdateSidebar\n desc: Update the sidebar visibility state (closed / collapsed / expanded).\n input:\n state?: closed | collapsed | expanded\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdateComplementary\n desc: Update the complementary-sidebar visibility state and optional panel selection.\n input:\n state?: closed | collapsed | expanded\n panel?: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdateDialog\n desc: |\n Show or hide the global dialog overlay. Accepts a surface component identifier\n or a boolean state flag. Propagates to EphemeralDeckState.\n input:\n subject?: string # surface component identifier to display\n props?: any # props forwarded to the dialog surface\n state?: boolean # false to close the dialog\n type?: default | alert\n blockAlign?: start | center | end\n overlayClasses?: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdatePopover\n desc: |\n Show or hide the global popover. Accepts anchor, content reference, or\n an explicit subject reference.\n input:\n subject?: any # subject reference to pass to the popover surface\n contentRef?: string # surface component identifier for popover content\n anchorId?: string # DOM element ID for positioning the popover anchor\n side?: top | right | bottom | left\n kind?: base | card\n title?: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdateCompanion\n desc: Update the companion-pane open state and active variant.\n input:\n open?: boolean\n variant?: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop AdjustPlank\n desc: Apply a PartAdjustment to a specific plank (close, solo, move, companion).\n input:\n id: string\n type: PartAdjustment\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdatePlankSize\n desc: Persist the width of a plank in rem.\n input:\n id: string\n size: number\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop AddToast\n desc: Push a toast notification into the ephemeral queue.\n input:\n title?: string\n body?: string\n duration?: number\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop ScrollIntoView\n desc: Schedule a subject to be scrolled into view when its plank mounts.\n input:\n subject: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop SwitchWorkspace\n desc: Switch the active workspace deck, persisting the previous workspace ID.\n input:\n subject: string # workspace ID to switch to\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop RevertWorkspace\n desc: Revert to the previously active workspace.\n input: void\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n## Features\n\n```mdl\nfeat F-1: Multi-Plank Layout (Deck)\n\n req F-1.1:\n when: enableDeck setting is true\n then: deck renders active planks side by side in a scrollable row\n\n req F-1.2:\n when: user opens a new subject with a pivot\n then: deck is truncated after the pivot and the new subject is appended\n\n req F-1.3:\n when: subject is already present in the active deck\n then: deck is unchanged and the existing plank scrolls into view\n\n req F-1.4:\n when: user resizes a plank\n then: new width is persisted in plankSizing and restored on next load\n```\n\n```mdl\nfeat F-2: Solo / Fullscreen Mode\n\n req F-2.1:\n when: user triggers SetLayoutMode with mode=solo\n then: only the targeted plank is visible; other planks move to inactive\n\n req F-2.2:\n when: user triggers SetLayoutMode with mode=solo--fullscreen\n then: plank fills the viewport; sidebar and heading chrome are hidden\n\n req F-2.3:\n when: user triggers SetLayoutMode with revert=true\n then: layout returns to the previously persisted mode\n```\n\n```mdl\nfeat F-3: Sidebar & Complementary Sidebar\n\n req F-3.1:\n when: UpdateSidebar is dispatched with a new state\n then: sidebar transitions between closed / collapsed / expanded and state is persisted\n\n req F-3.2:\n when: UpdateComplementary is dispatched with a panel\n then: complementary sidebar opens to the specified panel\n```\n\n```mdl\nfeat F-4: Dialog & Popover Overlay\n\n req F-4.1:\n when: UpdateDialog is dispatched with a subject component\n then: the matching surface is rendered inside the global dialog overlay\n\n req F-4.2:\n when: UpdatePopover is dispatched with an anchorId\n then: popover is positioned relative to that DOM element\n\n req F-4.3:\n when: dialog or popover state is set to false\n then: overlay is closed and content is unmounted\n```\n\n```mdl\nfeat F-5: URL Navigation & Deep Linking\n\n req F-5.1:\n when: app loads with a URL referencing an item\n then: DeckPlugin resolves the path and opens the item in the deck\n\n req F-5.2:\n when: active deck changes\n then: browser URL is updated to reflect the current plank state\n\n req F-5.3:\n when: a navigation target is not found in the app graph\n then: Open operation redirects to a 404 node\n```\n\n```mdl\nfeat F-6: Toast Notifications\n\n req F-6.1:\n when: AddToast is dispatched\n then: a toast is appended to the queue and displayed for its configured duration\n\n req F-6.2:\n when: ShowUndo is dispatched\n then: a toast with an undo action is shown; invoking it executes the linked undo operation\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Open subject in multi mode\n given: deck is in multi mode with planks A and B active\n when: Open({ subject: ['C'] }) is dispatched\n then:\n - plank C is appended to the right of plank B\n - browser URL reflects the new deck state\n - plank C is scrolled into view\n```\n\n```mdl\ntest T-2: Open with pivot truncation\n given: deck has planks [A, B, C] active\n when: Open({ subject: ['D'], pivotId: 'A' }) is dispatched\n then:\n - active deck becomes [A, D]\n - planks B and C are moved to inactive\n```\n\n```mdl\ntest T-3: Open already-visible subject\n given: deck has plank A active\n when: Open({ subject: ['A'] }) is dispatched\n then:\n - active deck is unchanged\n - plank A scrolls into view\n```\n\n```mdl\ntest T-4: Solo mode\n given: deck is in multi mode\n when: SetLayoutMode({ mode: 'solo', subject: 'A' }) is dispatched\n then:\n - only plank A is visible\n - mode is stored as solo in StoredDeckState\n - previousMode records 'multi' for the active deck\n```\n\n```mdl\ntest T-5: Revert from solo to multi\n given: layout mode is solo, previousMode is multi\n when: SetLayoutMode({ revert: true }) is dispatched\n then:\n - deck returns to multi mode\n - previously inactive planks are restored\n```\n\n```mdl\ntest T-6: Close plank\n given: deck has planks [A, B, C] active; B has attention\n when: Close({ subject: ['B'] }) is dispatched\n then:\n - active deck becomes [A, C]\n - attention moves to an adjacent plank\n - ScrollIntoView is scheduled for the newly attended plank\n```\n\n```mdl\ntest T-7: Toast is shown and dismissed\n given: no toasts are in the queue\n when: AddToast({ title: 'Saved', duration: 3000 }) is dispatched\n then:\n - toast appears in the UI\n - toast is removed after 3 seconds\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive \u2014 the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,qBAAqB;AAE9B,SAASC,iBAAiBC,kBAAkBC,cAAc;AAC1D,SAASC,qBAAqBC,iBAAiB;AAC/C,SAASC,gBAAgBC,yBAAyB;AAElD,SACEC,iBACAC,gBACAC,cACAC,WACAC,qBACAC,kBACAC,WACAC,cACAC,kBACK;AACP,SAASC,YAAY;AACrB,SAASX,oBAAoB;AAC7B,SAASY,kBAAkB;;;ACvB3B;;;AD+BAC,cAAc,KAAA;AAEP,IAAMC,aAAaC,OAAOC,OAAOC,IAAAA,EAAMC;EAC5CC,UAAUC,kBAAkB;IAAEC,UAAUC;EAAgB,CAAA;EACxDH,UAAUI,0BAA0B;IAAEF,UAAUG;EAAiB,CAAA;EACjEL,UAAUM,iBAAiB;IAAEJ,UAAUK;EAAa,CAAA;EACpDP,UAAUQ,sBAAsB;IAAEC,cAAc;SAAIA;SAAiBC;;EAAmB,CAAA;EACxFd,OAAOe,UAAU;IACfC,aAAaC,oBAAoBC;IACjCC,sBAAsB;MAACC,WAAWC;;IAClCf,UAAUgB;EACZ,CAAA;EACAtB,OAAOe,UAAU;IACfC,aAAaO,gBAAgBC,MAAMJ,WAAWC,eAAeI,iBAAiBC,mBAAmB;IACjGpB,UAAUqB;EACZ,CAAA;EACA3B,OAAOe,UAAU;;;;IAIfC,aAAaO,gBAAgBK,MAAMX,oBAAoBC,eAAeD,oBAAoBY,aAAa;IACvGV,sBAAsB;MAACF,oBAAoBa;MAAaV,WAAWW;;IACnEzB,UAAU0B;EACZ,CAAA;EACAhC,OAAOe,UAAU;IACfC,aAAaS,iBAAiBQ;IAC9B3B,UAAU4B;EACZ,CAAA;;;;;EAKAlC,OAAOe,UAAU;IACfC,aAAaO,gBAAgBC,MAAMC,iBAAiBC,qBAAqBN,WAAWW,UAAU;IAC9FzB,UAAU6B;EACZ,CAAA;EACAnC,OAAOe,UAAU;IACfC,aAAaO,gBAAgBC,MAAMC,iBAAiBC,qBAAqBN,WAAWW,UAAU;IAC9FzB,UAAU8B;EACZ,CAAA;EACAhC,UAAUiC,qBAAqB;IAC7BC,OAAO;MAAEC,UAAUrC,KAAKsC;
|
|
6
|
-
"names": ["setAutoFreeze", "ActivationEvent", "ActivationEvents", "Plugin", "AppActivationEvents", "AppPlugin", "translations", "stackTranslations", "AppGraphBuilder", "CheckAppScheme", "DeckSettings", "DeckState", "NotificationTracker", "OperationHandler", "ReactRoot", "ReactSurface", "UrlHandler", "meta", "DeckEvents", "setAutoFreeze", "DeckPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addAppGraphModule", "activate", "AppGraphBuilder", "addOperationHandlerModule", "OperationHandler", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "stackTranslations", "addModule", "activatesOn", "AppActivationEvents", "SetupSettings", "firesAfterActivation", "DeckEvents", "SettingsReady", "DeckSettings", "ActivationEvent", "allOf", "ActivationEvents", "ProcessManagerReady", "CheckAppScheme", "oneOf", "SetupAppGraph", "LayoutReady", "StateReady", "DeckState", "Startup", "ReactRoot", "UrlHandler", "NotificationTracker", "addPluginAssetModule", "asset", "pluginId", "
|
|
3
|
+
"sources": ["../../../src/DeckPlugin.ts", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-deck/PLUGIN.mdl"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { setAutoFreeze } from 'immer';\n\nimport { ActivationEvent, ActivationEvents, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\nimport { translations as stackTranslations } from '@dxos/react-ui-stack/translations';\n\nimport {\n AppGraphBuilder,\n CheckAppScheme,\n DeckSettings,\n DeckState,\n NotificationTracker,\n OperationHandler,\n ReactRoot,\n ReactSurface,\n UrlHandler,\n} from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { DeckEvents } from '#types';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\n// NOTE(Zan): When producing values with immer, we shouldn't auto-freeze them because\n// our signal implementation needs to add some hidden properties to the produced values.\n// TODO(Zan): Move this to a more global location if we use immer more broadly.\nsetAutoFreeze(false);\n\nexport const DeckPlugin = Plugin.define(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations: [...translations, ...stackTranslations] }),\n Plugin.addModule({\n activatesOn: AppActivationEvents.SetupSettings,\n firesAfterActivation: [DeckEvents.SettingsReady],\n activate: DeckSettings,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(DeckEvents.SettingsReady, ActivationEvents.ProcessManagerReady),\n activate: CheckAppScheme,\n }),\n Plugin.addModule({\n // TODO(wittjosiah): Does not integrate with settings store.\n // Should this be a different event?\n // Should settings store be renamed to be more generic?\n activatesOn: ActivationEvent.oneOf(AppActivationEvents.SetupSettings, AppActivationEvents.SetupAppGraph),\n firesAfterActivation: [AppActivationEvents.LayoutReady, DeckEvents.StateReady],\n activate: DeckState,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvents.Startup,\n activate: ReactRoot,\n }),\n // Plugin.addModule({\n // activatesOn: Events.SetupArtifactDefinition,\n // activate: Tools,\n // }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(ActivationEvents.ProcessManagerReady, DeckEvents.StateReady),\n activate: UrlHandler,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(ActivationEvents.ProcessManagerReady, DeckEvents.StateReady),\n activate: NotificationTracker,\n }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default DeckPlugin;\n", "---\nid: org.dxos.plugin.deck\nname: DeckPlugin\nversion: 0.1.0\n---\n\nThe Deck plugin is the core layout engine for DXOS Composer. It manages the multi-plank workspace\n(\"deck\"), the sidebar, the complementary sidebar, dialogs, popovers, and toast notifications.\nIt owns the persisted and ephemeral layout state, handles URL routing, and implements every\n`LayoutOperation` that changes what is visible on screen.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype LayoutMode\n literals: multi | solo | solo--fullscreen\n```\n\n```mdl\ntype PartAdjustment\n literals: close | companion | solo | solo--fullscreen | increment-start | increment-end\n```\n\n```mdl\ntype DeckState\n fields:\n initialized: boolean # false until the deck has left solo mode for the first time\n active: string[] # item IDs of planks displayed in multi mode\n inactive: string[] # item IDs that have been closed; persisted for reopening\n solo?: string # item ID of the single plank in solo or fullscreen mode\n fullscreen: boolean # true when the solo plank is displayed without any chrome\n plankSizing: Record<string, number> # persisted plank widths in rem, keyed by item ID\n companionOpen: boolean # whether the companion pane is visible\n companionVariant?: string # which companion variant to display\n companionFrameSizing: Record<string, number> # companion frame widths in rem\n```\n\n```mdl\ntype StoredDeckState\n desc: Persisted plugin state stored in KVS/localStorage.\n fields:\n sidebarState: closed | collapsed | expanded\n complementarySidebarState: closed | collapsed | expanded\n complementarySidebarPanel?: string\n activeDeck: string\n previousDeck: string\n decks: Record<string, DeckState>\n previousMode: Record<string, LayoutMode>\n```\n\n```mdl\ntype EphemeralDeckState\n desc: Transient plugin state that is NOT persisted across sessions.\n fields:\n dialogOpen: boolean\n dialogType?: default | alert\n dialogBlockAlign?: start | center | end\n dialogContent?: { component: string; props?: any }\n popoverOpen: boolean\n popoverSide?: top | right | bottom | left\n popoverKind?: base | card\n popoverTitle?: string\n popoverContentRef?: string\n popoverContent?: { component: string } | { subject: any }\n toasts: Toast[]\n currentUndoId?: string\n scrollIntoView?: string\n```\n\n```mdl\ntype DeckSettings\n fields:\n enableDeck?: boolean # display multiple panels side by side\n encapsulatedPlanks?: boolean # render each plank in an isolated container\n showHints?: boolean # show keyboard shortcut hints in the UI\n enableNativeRedirect?: boolean # redirect supported URLs to the native desktop app\n```\n\n## Components\n\n```mdl\ncomponent Matrix\n desc: |\n The primary workspace canvas. Renders the active planks side by side in multi mode,\n or a single plank in solo/fullscreen mode. Manages plank-resize handles and the\n companion pane alongside each plank.\n props:\n state: StoredDeckState # persisted layout state atom\n ephemeral: EphemeralDeckState # transient state atom\n state:\n mode: LayoutMode # current layout mode derived from state\n actions:\n openPlank(id: string)\n closePlank(id: string)\n adjustPlank(id: string, type: PartAdjustment)\n resizePlank(id: string, size: number)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 sidebar \u2502 plank A \u2502 plank B \u2502\n \u2502 \u2502 \u2502 \u2502\n \u2502 \u2502 [content] \u2502 [content] \u2502\n \u2502 \u2502 \u2502 \u2502\n \u2502 \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502\n \u2502 \u2502 companion \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent DeckSettings\n desc: Settings panel rendered in the Composer settings surface.\n props:\n settings: DeckSettings\n actions:\n updateSetting(key: string, value: any)\n```\n\n## Operations\n\n```mdl\nop Open\n desc: |\n Opens one or more subjects (item IDs or navigation paths) in the deck.\n In multi mode uses stack semantics: truncates after the pivot then appends.\n In solo or uninitialised mode, replaces the current subject entirely.\n Validates each target against the app graph and redirects to a 404 node if not found.\n Fires ScrollIntoView, Expose, and an observability event for each newly opened item.\n input:\n subject: string[] # item IDs or navigation paths to open\n pivotId?: string # truncate deck after this item before appending\n key?: string # replace an existing plank whose ID shares this key prefix\n workspace?: string # switch to this workspace before opening\n navigation?: immediate # skip validation; expand path only\n scrollIntoView?: boolean # default true; set false to suppress auto-scroll\n state?: any\n variant?: string\n output: string[]\n effects: [echo:read, layout:state]\n requires: [AppGraph, AttentionCapabilities, ClientCapabilities, DeckCapabilities]\n```\n\n```mdl\nop Close\n desc: |\n Removes one or more subjects from the active deck.\n Computes which plank (if any) should receive attention after removal and\n schedules ScrollIntoView for it.\n input:\n subject: string[]\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities, AttentionCapabilities]\n```\n\n```mdl\nop SetLayoutMode\n desc: |\n Transitions to a new layout mode (multi, solo, solo--fullscreen) or reverts\n to the previously recorded mode. Persists the previous mode so it can be\n restored later. Toggling solo--fullscreen flips the fullscreen flag rather\n than unconditionally setting it.\n input:\n mode?: LayoutMode # target mode; omit if reverting\n subject?: string # item to solo; used only for solo / solo--fullscreen\n revert?: boolean # revert to the previously persisted mode\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdateSidebar\n desc: Update the sidebar visibility state (closed / collapsed / expanded).\n input:\n state?: closed | collapsed | expanded\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdateComplementary\n desc: Update the complementary-sidebar visibility state and optional panel selection.\n input:\n state?: closed | collapsed | expanded\n panel?: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdateDialog\n desc: |\n Show or hide the global dialog overlay. Accepts a surface component identifier\n or a boolean state flag. Propagates to EphemeralDeckState.\n input:\n subject?: string # surface component identifier to display\n props?: any # props forwarded to the dialog surface\n state?: boolean # false to close the dialog\n type?: default | alert\n blockAlign?: start | center | end\n overlayClasses?: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdatePopover\n desc: |\n Show or hide the global popover. Accepts anchor, content reference, or\n an explicit subject reference.\n input:\n subject?: any # subject reference to pass to the popover surface\n contentRef?: string # surface component identifier for popover content\n anchorId?: string # DOM element ID for positioning the popover anchor\n side?: top | right | bottom | left\n kind?: base | card\n title?: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdateCompanion\n desc: Update the companion-pane open state and active variant.\n input:\n open?: boolean\n variant?: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop AdjustPlank\n desc: Apply a PartAdjustment to a specific plank (close, solo, move, companion).\n input:\n id: string\n type: PartAdjustment\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop UpdatePlankSize\n desc: Persist the width of a plank in rem.\n input:\n id: string\n size: number\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop AddToast\n desc: Push a toast notification into the ephemeral queue.\n input:\n title?: string\n body?: string\n duration?: number\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop ScrollIntoView\n desc: Schedule a subject to be scrolled into view when its plank mounts.\n input:\n subject: string\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop SwitchWorkspace\n desc: Switch the active workspace deck, persisting the previous workspace ID.\n input:\n subject: string # workspace ID to switch to\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n```mdl\nop RevertWorkspace\n desc: Revert to the previously active workspace.\n input: void\n output: void\n effects: [layout:state]\n requires: [DeckCapabilities]\n```\n\n## Features\n\n```mdl\nfeat F-1: Multi-Plank Layout (Deck)\n\n req F-1.1:\n when: enableDeck setting is true\n then: deck renders active planks side by side in a scrollable row\n\n req F-1.2:\n when: user opens a new subject with a pivot\n then: deck is truncated after the pivot and the new subject is appended\n\n req F-1.3:\n when: subject is already present in the active deck\n then: deck is unchanged and the existing plank scrolls into view\n\n req F-1.4:\n when: user resizes a plank\n then: new width is persisted in plankSizing and restored on next load\n```\n\n```mdl\nfeat F-2: Solo / Fullscreen Mode\n\n req F-2.1:\n when: user triggers SetLayoutMode with mode=solo\n then: only the targeted plank is visible; other planks move to inactive\n\n req F-2.2:\n when: user triggers SetLayoutMode with mode=solo--fullscreen\n then: plank fills the viewport; sidebar and heading chrome are hidden\n\n req F-2.3:\n when: user triggers SetLayoutMode with revert=true\n then: layout returns to the previously persisted mode\n```\n\n```mdl\nfeat F-3: Sidebar & Complementary Sidebar\n\n req F-3.1:\n when: UpdateSidebar is dispatched with a new state\n then: sidebar transitions between closed / collapsed / expanded and state is persisted\n\n req F-3.2:\n when: UpdateComplementary is dispatched with a panel\n then: complementary sidebar opens to the specified panel\n```\n\n```mdl\nfeat F-4: Dialog & Popover Overlay\n\n req F-4.1:\n when: UpdateDialog is dispatched with a subject component\n then: the matching surface is rendered inside the global dialog overlay\n\n req F-4.2:\n when: UpdatePopover is dispatched with an anchorId\n then: popover is positioned relative to that DOM element\n\n req F-4.3:\n when: dialog or popover state is set to false\n then: overlay is closed and content is unmounted\n```\n\n```mdl\nfeat F-5: URL Navigation & Deep Linking\n\n req F-5.1:\n when: app loads with a URL referencing an item\n then: DeckPlugin resolves the path and opens the item in the deck\n\n req F-5.2:\n when: active deck changes\n then: browser URL is updated to reflect the current plank state\n\n req F-5.3:\n when: a navigation target is not found in the app graph\n then: Open operation redirects to a 404 node\n```\n\n```mdl\nfeat F-6: Toast Notifications\n\n req F-6.1:\n when: AddToast is dispatched\n then: a toast is appended to the queue and displayed for its configured duration\n\n req F-6.2:\n when: ShowUndo is dispatched\n then: a toast with an undo action is shown; invoking it executes the linked undo operation\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Open subject in multi mode\n given: deck is in multi mode with planks A and B active\n when: Open({ subject: ['C'] }) is dispatched\n then:\n - plank C is appended to the right of plank B\n - browser URL reflects the new deck state\n - plank C is scrolled into view\n```\n\n```mdl\ntest T-2: Open with pivot truncation\n given: deck has planks [A, B, C] active\n when: Open({ subject: ['D'], pivotId: 'A' }) is dispatched\n then:\n - active deck becomes [A, D]\n - planks B and C are moved to inactive\n```\n\n```mdl\ntest T-3: Open already-visible subject\n given: deck has plank A active\n when: Open({ subject: ['A'] }) is dispatched\n then:\n - active deck is unchanged\n - plank A scrolls into view\n```\n\n```mdl\ntest T-4: Solo mode\n given: deck is in multi mode\n when: SetLayoutMode({ mode: 'solo', subject: 'A' }) is dispatched\n then:\n - only plank A is visible\n - mode is stored as solo in StoredDeckState\n - previousMode records 'multi' for the active deck\n```\n\n```mdl\ntest T-5: Revert from solo to multi\n given: layout mode is solo, previousMode is multi\n when: SetLayoutMode({ revert: true }) is dispatched\n then:\n - deck returns to multi mode\n - previously inactive planks are restored\n```\n\n```mdl\ntest T-6: Close plank\n given: deck has planks [A, B, C] active; B has attention\n when: Close({ subject: ['B'] }) is dispatched\n then:\n - active deck becomes [A, C]\n - attention moves to an adjacent plank\n - ScrollIntoView is scheduled for the newly attended plank\n```\n\n```mdl\ntest T-7: Toast is shown and dismissed\n given: no toasts are in the queue\n when: AddToast({ title: 'Saved', duration: 3000 }) is dispatched\n then:\n - toast appears in the UI\n - toast is removed after 3 seconds\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive \u2014 the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # inj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C,MAAMC,iBAAiBC,qBAAqBN,WAAWW,UAAU;IAC9FzB,UAAU8B;EACZ,CAAA;EACAhC,UAAUiC,qBAAqB;IAC7BC,OAAO;MAAEC,UAAUrC,KAAKsC,QAAQC;MAAKC,MAAM;MAAcC,SAASC;MAAYC,UAAU;IAAoB;EAC9G,CAAA;EACA7C,OAAO8C;AAAI;AAGb,IAAA,qBAAe/C;",
|
|
6
|
+
"names": ["setAutoFreeze", "ActivationEvent", "ActivationEvents", "Plugin", "AppActivationEvents", "AppPlugin", "translations", "stackTranslations", "AppGraphBuilder", "CheckAppScheme", "DeckSettings", "DeckState", "NotificationTracker", "OperationHandler", "ReactRoot", "ReactSurface", "UrlHandler", "meta", "DeckEvents", "setAutoFreeze", "DeckPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addAppGraphModule", "activate", "AppGraphBuilder", "addOperationHandlerModule", "OperationHandler", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "stackTranslations", "addModule", "activatesOn", "AppActivationEvents", "SetupSettings", "firesAfterActivation", "DeckEvents", "SettingsReady", "DeckSettings", "ActivationEvent", "allOf", "ActivationEvents", "ProcessManagerReady", "CheckAppScheme", "oneOf", "SetupAppGraph", "LayoutReady", "StateReady", "DeckState", "Startup", "ReactRoot", "UrlHandler", "NotificationTracker", "addPluginAssetModule", "asset", "pluginId", "profile", "key", "path", "content", "pluginSpec", "mimeType", "make"]
|
|
7
7
|
}
|
|
@@ -8,10 +8,10 @@ import { meta } from "#meta";
|
|
|
8
8
|
import { Settings } from "#types";
|
|
9
9
|
var isSocket = !!globalThis.__args;
|
|
10
10
|
var DeckSettings = ({ settings, onSettingsChange }) => {
|
|
11
|
-
const { t } = useTranslation(meta.
|
|
11
|
+
const { t } = useTranslation(meta.profile.key);
|
|
12
12
|
return /* @__PURE__ */ React.createElement(SettingsForm.Viewport, null, /* @__PURE__ */ React.createElement(SettingsForm.Section, {
|
|
13
13
|
title: t("settings.title", {
|
|
14
|
-
ns: meta.
|
|
14
|
+
ns: meta.profile.key
|
|
15
15
|
})
|
|
16
16
|
}, /* @__PURE__ */ React.createElement(SettingsForm.FieldSet, {
|
|
17
17
|
readonly: !onSettingsChange,
|
|
@@ -24,4 +24,4 @@ var DeckSettings = ({ settings, onSettingsChange }) => {
|
|
|
24
24
|
export {
|
|
25
25
|
DeckSettings as default
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=DeckSettings-
|
|
27
|
+
//# sourceMappingURL=DeckSettings-CQQZJ2YS.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/DeckSettings/DeckSettings.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { useTranslation } from '@dxos/react-ui';\nimport { Settings as SettingsForm } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { Settings } from '#types';\n\nconst isSocket = !!(globalThis as any).__args;\n\nexport type DeckSettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;\n\nexport const DeckSettings = ({ settings, onSettingsChange }: DeckSettingsProps) => {\n const { t } = useTranslation(meta.profile.key);\n\n return (\n <SettingsForm.Viewport>\n <SettingsForm.Section title={t('settings.title', { ns: meta.profile.key })}>\n <SettingsForm.FieldSet\n readonly={!onSettingsChange}\n schema={Settings.Settings}\n visible={(path) => path !== 'enableNativeRedirect' || !isSocket}\n values={settings}\n onValuesChanged={(values) => onSettingsChange?.(() => values)}\n />\n </SettingsForm.Section>\n </SettingsForm.Viewport>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,OAAOA,WAAW;AAGlB,SAASC,sBAAsB;AAC/B,SAASC,YAAYC,oBAAoB;AAEzC,SAASC,YAAY;AACrB,SAASF,gBAAgB;AAEzB,IAAMG,WAAW,CAAC,CAAEC,WAAmBC;AAIhC,IAAMC,eAAe,CAAC,EAAEC,UAAUC,iBAAgB,MAAqB;AAC5E,QAAM,EAAEC,EAAC,IAAKV,eAAeG,KAAKQ,QAAQC,GAAG;AAE7C,SACE,sBAAA,cAACV,aAAaW,UAAQ,MACpB,sBAAA,cAACX,aAAaY,SAAO;IAACC,OAAOL,EAAE,kBAAkB;MAAEM,IAAIb,KAAKQ,QAAQC;IAAI,CAAA;KACtE,sBAAA,cAACV,aAAae,UAAQ;IACpBC,UAAU,CAACT;IACXU,QAAQlB,SAASA;IACjBmB,SAAS,CAACC,SAASA,SAAS,0BAA0B,CAACjB;IACvDkB,QAAQd;IACRe,iBAAiB,CAACD,WAAWb,mBAAmB,MAAMa,MAAAA;;AAKhE;",
|
|
6
|
+
"names": ["React", "useTranslation", "Settings", "SettingsForm", "meta", "isSocket", "globalThis", "__args", "DeckSettings", "settings", "onSettingsChange", "t", "profile", "key", "Viewport", "Section", "title", "ns", "FieldSet", "readonly", "schema", "visible", "path", "values", "onValuesChanged"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeckCapabilities_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CL7JIOI5.mjs";
|
|
4
4
|
import "./chunk-J5LGTIGS.mjs";
|
|
5
5
|
|
|
6
6
|
// src/operations/add-toast.ts
|
|
@@ -21,4 +21,4 @@ var add_toast_default = handler;
|
|
|
21
21
|
export {
|
|
22
22
|
add_toast_default as default
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=add-toast-
|
|
24
|
+
//# sourceMappingURL=add-toast-APKTCLIA.mjs.map
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
DeckCapabilities_exports,
|
|
9
9
|
DeckOperation_exports,
|
|
10
10
|
PLANK_COMPANION_TYPE
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CL7JIOI5.mjs";
|
|
12
12
|
import {
|
|
13
13
|
computeActiveUpdates
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NGX6RXNV.mjs";
|
|
15
15
|
import "./chunk-J5LGTIGS.mjs";
|
|
16
16
|
|
|
17
17
|
// src/operations/adjust.ts
|
|
@@ -90,4 +90,4 @@ var adjust_default = handler;
|
|
|
90
90
|
export {
|
|
91
91
|
adjust_default as default
|
|
92
92
|
};
|
|
93
|
-
//# sourceMappingURL=adjust-
|
|
93
|
+
//# sourceMappingURL=adjust-7CZI4GK3.mjs.map
|
|
@@ -39,7 +39,7 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
|
|
|
39
39
|
label: [
|
|
40
40
|
"close-current.label",
|
|
41
41
|
{
|
|
42
|
-
ns: meta.
|
|
42
|
+
ns: meta.profile.key
|
|
43
43
|
}
|
|
44
44
|
],
|
|
45
45
|
icon: "ph--x--regular"
|
|
@@ -60,7 +60,7 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
|
|
|
60
60
|
label: [
|
|
61
61
|
"close-others.label",
|
|
62
62
|
{
|
|
63
|
-
ns: meta.
|
|
63
|
+
ns: meta.profile.key
|
|
64
64
|
}
|
|
65
65
|
],
|
|
66
66
|
icon: "ph--x-square--regular"
|
|
@@ -78,7 +78,7 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
|
|
|
78
78
|
label: [
|
|
79
79
|
"close-all.label",
|
|
80
80
|
{
|
|
81
|
-
ns: meta.
|
|
81
|
+
ns: meta.profile.key
|
|
82
82
|
}
|
|
83
83
|
],
|
|
84
84
|
icon: "ph--x-circle--regular"
|
|
@@ -98,7 +98,7 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
|
|
|
98
98
|
label: [
|
|
99
99
|
state.sidebarState === "expanded" ? "collapse-navigation-sidebar.label" : "open-navigation-sidebar.label",
|
|
100
100
|
{
|
|
101
|
-
ns: meta.
|
|
101
|
+
ns: meta.profile.key
|
|
102
102
|
}
|
|
103
103
|
],
|
|
104
104
|
icon: "ph--sidebar--regular",
|
|
@@ -126,4 +126,4 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
|
|
|
126
126
|
export {
|
|
127
127
|
app_graph_builder_default as default
|
|
128
128
|
};
|
|
129
|
-
//# sourceMappingURL=app-graph-builder-
|
|
129
|
+
//# sourceMappingURL=app-graph-builder-6HTXRTU2.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities, AppNode, LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';\n\nimport { meta } from '#meta';\nimport { DeckCapabilities } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* Effect.all([\n GraphBuilder.createExtension({\n id: 'notFound',\n match: NodeMatcher.whenRoot,\n connector: () => Effect.succeed([AppNode.makeNotFound()]),\n }),\n\n GraphBuilder.createExtension({\n id: 'root',\n match: NodeMatcher.whenRoot,\n actions: (_node, get) =>\n Effect.gen(function* () {\n // NOTE(Zan): This is currently disabled.\n // TODO(Zan): Fullscreen needs to know the active node and provide that to the layout part.\n // const _fullscreen = {\n // id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,\n // data: async () => {\n // const { dispatchPromise: dispatch } = context.get(Capabilities.IntentDispatcher);\n // await dispatch(\n // createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'fullscreen' } }),\n // );\n // },\n // properties: {\n // label: ['toggle-fullscreen.label', { ns: meta.id }],\n // icon: 'ph--arrows-out--regular',\n // keyBinding: {\n // macos: 'ctrl+meta+f',\n // windows: 'shift+ctrl+f',\n // },\n // },\n // };\n\n const closeCurrent = {\n id: `${LayoutOperation.Close.meta.key}.current`,\n data: Effect.fnUntraced(function* () {\n const attention = yield* Capability.get(AttentionCapabilities.Attention);\n const attended = attention.getCurrent().at(-1);\n if (attended) {\n yield* Operation.invoke(LayoutOperation.Close, { subject: [attended] });\n }\n }),\n properties: {\n label: ['close-current.label', { ns: meta.profile.key }],\n icon: 'ph--x--regular',\n },\n };\n\n const closeOthers = {\n id: `${LayoutOperation.Close.meta.key}.others`,\n data: Effect.fnUntraced(function* () {\n const attention = yield* Capability.get(AttentionCapabilities.Attention);\n const deck = yield* DeckCapabilities.getDeck();\n const attended = attention.getCurrent().at(-1);\n const ids = deck.active.filter((id: string) => id !== attended) ?? [];\n yield* Operation.invoke(LayoutOperation.Close, { subject: ids });\n }),\n properties: {\n label: ['close-others.label', { ns: meta.profile.key }],\n icon: 'ph--x-square--regular',\n },\n };\n\n const closeAll = {\n id: `${LayoutOperation.Close.meta.key}.all`,\n data: Effect.fnUntraced(function* () {\n const deck = yield* DeckCapabilities.getDeck();\n yield* Operation.invoke(LayoutOperation.Close, { subject: deck.active });\n }),\n properties: {\n label: ['close-all.label', { ns: meta.profile.key }],\n icon: 'ph--x-circle--regular',\n },\n };\n\n const state = get(yield* Capability.get(DeckCapabilities.State));\n const deck = state.decks[state.activeDeck];\n\n const toggleSidebar = {\n id: `${LayoutOperation.UpdateSidebar.meta.key}.nav`,\n data: Effect.fnUntraced(function* () {\n yield* Capabilities.updateAtomValue(DeckCapabilities.State, (s) => ({\n ...s,\n sidebarState: s.sidebarState === 'expanded' ? ('collapsed' as const) : ('expanded' as const),\n }));\n }),\n properties: {\n label: [\n state.sidebarState === 'expanded'\n ? 'collapse-navigation-sidebar.label'\n : 'open-navigation-sidebar.label',\n { ns: meta.profile.key },\n ],\n icon: 'ph--sidebar--regular',\n keyBinding: {\n macos: \"meta+'\",\n },\n disposition: 'pin-end',\n position: 'last',\n l0Breakpoint: 'lg',\n },\n };\n\n return !deck?.solo ? [closeCurrent, closeOthers, closeAll, toggleSidebar] : [toggleSidebar];\n }),\n }),\n ]);\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions.flat());\n }),\n);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,SAASC,uBAAuB;AAC1D,SAASC,iBAAiB;AAC1B,SAASC,6BAA6B;AACtC,SAASC,cAAcC,mBAAmB;AAE1C,SAASC,YAAY;AACrB,SAASC,wBAAwB;AAEjC,IAAA,4BAAeT,WAAWU,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAcC,WAAI;IACnCP,aAAaQ,gBAAgB;MAC3BC,IAAI;MACJC,OAAOT,YAAYU;MACnBC,WAAW,MAAaC,eAAQ;QAACjB,QAAQkB,aAAY;OAAG;IAC1D,CAAA;IAEAd,aAAaQ,gBAAgB;MAC3BC,IAAI;MACJC,OAAOT,YAAYU;MACnBI,SAAS,CAACC,OAAOC,QACRC,WAAI,aAAA;AAqBT,cAAMC,eAAe;UACnBV,IAAI,GAAGZ,gBAAgBuB,MAAMlB,KAAKmB,GAAG;UACrCC,MAAajB,kBAAW,aAAA;AACtB,kBAAMkB,YAAY,OAAO7B,WAAWuB,IAAIlB,sBAAsByB,SAAS;AACvE,kBAAMC,WAAWF,UAAUG,WAAU,EAAGC,GAAG,EAAC;AAC5C,gBAAIF,UAAU;AACZ,qBAAO3B,UAAU8B,OAAO/B,gBAAgBuB,OAAO;gBAAES,SAAS;kBAACJ;;cAAU,CAAA;YACvE;UACF,CAAA;UACAK,YAAY;YACVC,OAAO;cAAC;cAAuB;gBAAEC,IAAI9B,KAAK+B,QAAQZ;cAAI;;YACtDa,MAAM;UACR;QACF;AAEA,cAAMC,cAAc;UAClB1B,IAAI,GAAGZ,gBAAgBuB,MAAMlB,KAAKmB,GAAG;UACrCC,MAAajB,kBAAW,aAAA;AACtB,kBAAMkB,YAA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;cAAI;;YAEzBa,MAAM;YACNiB,YAAY;cACVC,OAAO;YACT;YACAC,aAAa;YACbC,UAAU;YACVC,cAAc;UAChB;QACF;AAEA,eAAO,CAACnB,MAAMoB,OAAO;UAACrC;UAAcgB;UAAaM;UAAUK;YAAiB;UAACA;;MAC/E,CAAA;IACJ,CAAA;GACD;AAED,SAAOpD,WAAW+D,YAAY9D,gBAAgB+D,iBAAiBpD,WAAWqD,KAAI,CAAA;AAChF,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "AppCapabilities", "AppNode", "LayoutOperation", "Operation", "AttentionCapabilities", "GraphBuilder", "NodeMatcher", "meta", "DeckCapabilities", "makeModule", "fnUntraced", "extensions", "all", "createExtension", "id", "match", "whenRoot", "connector", "succeed", "makeNotFound", "actions", "_node", "get", "gen", "closeCurrent", "Close", "key", "data", "attention", "Attention", "attended", "getCurrent", "at", "invoke", "subject", "properties", "label", "ns", "profile", "icon", "closeOthers", "deck", "getDeck", "ids", "active", "filter", "closeAll", "state", "State", "decks", "activeDeck", "toggleSidebar", "UpdateSidebar", "updateAtomValue", "s", "sidebarState", "keyBinding", "macos", "disposition", "position", "l0Breakpoint", "solo", "contributes", "AppGraphBuilder", "flat"]
|
|
7
|
+
}
|
|
@@ -2,15 +2,15 @@ import "../chunk-J5LGTIGS.mjs";
|
|
|
2
2
|
|
|
3
3
|
// src/capabilities/index.ts
|
|
4
4
|
import { Capability } from "@dxos/app-framework";
|
|
5
|
-
var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("../app-graph-builder-
|
|
6
|
-
var CheckAppScheme = Capability.lazy("CheckAppScheme", () => import("../check-app-scheme-
|
|
7
|
-
var NotificationTracker = Capability.lazy("NotificationTracker", () => import("../notification-tracker-
|
|
5
|
+
var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("../app-graph-builder-6HTXRTU2.mjs"));
|
|
6
|
+
var CheckAppScheme = Capability.lazy("CheckAppScheme", () => import("../check-app-scheme-HSAORHHX.mjs"));
|
|
7
|
+
var NotificationTracker = Capability.lazy("NotificationTracker", () => import("../notification-tracker-CUDFRDCF.mjs"));
|
|
8
8
|
var OperationHandler = Capability.lazy("OperationHandler", () => import("../operation-handler-266CVMTW.mjs"));
|
|
9
|
-
var ReactRoot = Capability.lazy("ReactRoot", () => import("../react-root-
|
|
10
|
-
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-
|
|
11
|
-
var DeckSettings = Capability.lazy("DeckSettings", () => import("../settings-
|
|
12
|
-
var DeckState = Capability.lazy("DeckState", () => import("../state-
|
|
13
|
-
var UrlHandler = Capability.lazy("UrlHandler", () => import("../url-handler-
|
|
9
|
+
var ReactRoot = Capability.lazy("ReactRoot", () => import("../react-root-E6TAFHX6.mjs"));
|
|
10
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-O4POQWYL.mjs"));
|
|
11
|
+
var DeckSettings = Capability.lazy("DeckSettings", () => import("../settings-6CDQEB6B.mjs"));
|
|
12
|
+
var DeckState = Capability.lazy("DeckState", () => import("../state-D3YXB5NP.mjs"));
|
|
13
|
+
var UrlHandler = Capability.lazy("UrlHandler", () => import("../url-handler-PUS4X33T.mjs"));
|
|
14
14
|
export {
|
|
15
15
|
AppGraphBuilder,
|
|
16
16
|
CheckAppScheme,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
check_app_scheme_default,
|
|
3
3
|
shouldDeferNavigationHandlers
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KZFJ4PBT.mjs";
|
|
5
5
|
import "./chunk-J5LGTIGS.mjs";
|
|
6
6
|
export {
|
|
7
7
|
check_app_scheme_default as default,
|
|
8
8
|
shouldDeferNavigationHandlers
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=check-app-scheme-
|
|
10
|
+
//# sourceMappingURL=check-app-scheme-HSAORHHX.mjs.map
|