@dxos/plugin-deck 0.8.4-main.dedc0f3 → 0.8.4-main.ead640a

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.
Files changed (111) hide show
  1. package/dist/lib/browser/{app-graph-builder-DVEKLXB4.mjs → app-graph-builder-YYP67JHW.mjs} +15 -14
  2. package/dist/lib/browser/app-graph-builder-YYP67JHW.mjs.map +7 -0
  3. package/dist/lib/browser/{check-app-scheme-3BQJXWEY.mjs → check-app-scheme-GCOL6YDT.mjs} +6 -6
  4. package/dist/lib/browser/check-app-scheme-GCOL6YDT.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-F5BQOOEG.mjs → chunk-7I6H3N4Q.mjs} +8 -6
  6. package/dist/lib/browser/chunk-7I6H3N4Q.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-HUWUYTOI.mjs +16 -0
  8. package/dist/lib/browser/chunk-HUWUYTOI.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-NU7H23SK.mjs → chunk-JQKOS2HB.mjs} +341 -308
  10. package/dist/lib/browser/chunk-JQKOS2HB.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-MHP4GPX5.mjs +11 -0
  12. package/dist/lib/browser/chunk-MHP4GPX5.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-WILMPGDV.mjs → chunk-RJP5R7PY.mjs} +14 -14
  14. package/dist/lib/browser/{chunk-WILMPGDV.mjs.map → chunk-RJP5R7PY.mjs.map} +3 -3
  15. package/dist/lib/browser/{chunk-NRCPV6AV.mjs → chunk-VX7MMQOW.mjs} +9 -9
  16. package/dist/lib/browser/chunk-VX7MMQOW.mjs.map +7 -0
  17. package/dist/lib/browser/index.mjs +8 -9
  18. package/dist/lib/browser/index.mjs.map +3 -3
  19. package/dist/lib/browser/{intent-resolver-2SUIIV6N.mjs → intent-resolver-7XNOEPVN.mjs} +20 -17
  20. package/dist/lib/browser/intent-resolver-7XNOEPVN.mjs.map +7 -0
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/{react-root-7PRVDLF7.mjs → react-root-OJEF7YCH.mjs} +11 -11
  23. package/dist/lib/browser/react-root-OJEF7YCH.mjs.map +7 -0
  24. package/dist/lib/browser/{react-surface-FNY2YC2F.mjs → react-surface-XN2NJYHO.mjs} +13 -13
  25. package/dist/lib/browser/react-surface-XN2NJYHO.mjs.map +7 -0
  26. package/dist/lib/browser/{settings-LUPQPZ27.mjs → settings-M3KSKRAP.mjs} +7 -6
  27. package/dist/lib/browser/{settings-LUPQPZ27.mjs.map → settings-M3KSKRAP.mjs.map} +3 -3
  28. package/dist/lib/browser/state-6ZSDTF6Q.mjs +12 -0
  29. package/dist/lib/browser/{toolkit-XGJSBY67.mjs → toolkit-L7C3UAEU.mjs} +14 -12
  30. package/dist/lib/browser/toolkit-L7C3UAEU.mjs.map +7 -0
  31. package/dist/lib/browser/types/index.mjs +2 -2
  32. package/dist/lib/browser/{url-handler-LROZYQ26.mjs → url-handler-EHTLXZRR.mjs} +6 -6
  33. package/dist/lib/browser/{url-handler-LROZYQ26.mjs.map → url-handler-EHTLXZRR.mjs.map} +1 -1
  34. package/dist/types/src/DeckPlugin.d.ts +1 -1
  35. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  37. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  38. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  39. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  40. package/dist/types/src/capabilities/state.d.ts +3 -0
  41. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  42. package/dist/types/src/capabilities/toolkit.d.ts +3 -2
  43. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
  44. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -3
  45. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  46. package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +74 -0
  47. package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
  48. package/dist/types/src/components/DeckLayout/DeckMain.d.ts +3 -0
  49. package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -0
  50. package/dist/types/src/components/DeckLayout/Toast.d.ts +5 -0
  51. package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
  52. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
  53. package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
  54. package/dist/types/src/components/Plank/Plank.stories.d.ts +2 -1
  55. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
  56. package/dist/types/src/events.d.ts.map +1 -1
  57. package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
  58. package/dist/types/src/meta.d.ts +0 -1
  59. package/dist/types/src/meta.d.ts.map +1 -1
  60. package/dist/types/src/translations.d.ts +1 -0
  61. package/dist/types/src/translations.d.ts.map +1 -1
  62. package/dist/types/src/types/schema.d.ts +4 -3
  63. package/dist/types/src/types/schema.d.ts.map +1 -1
  64. package/dist/types/tsconfig.tsbuildinfo +1 -1
  65. package/package.json +43 -43
  66. package/src/DeckPlugin.ts +62 -63
  67. package/src/capabilities/app-graph-builder.ts +10 -9
  68. package/src/capabilities/capabilities.ts +3 -3
  69. package/src/capabilities/check-app-scheme.ts +2 -2
  70. package/src/capabilities/intent-resolver.ts +12 -9
  71. package/src/capabilities/react-root.tsx +2 -2
  72. package/src/capabilities/react-surface.tsx +4 -4
  73. package/src/capabilities/settings.ts +1 -0
  74. package/src/capabilities/state.ts +7 -4
  75. package/src/capabilities/toolkit.ts +9 -7
  76. package/src/capabilities/tools.ts +1 -1
  77. package/src/components/DeckLayout/Banner.tsx +2 -2
  78. package/src/components/DeckLayout/DeckLayout.stories.tsx +64 -0
  79. package/src/components/DeckLayout/DeckLayout.tsx +8 -278
  80. package/src/components/DeckLayout/DeckMain.tsx +285 -0
  81. package/src/components/DeckLayout/Fallback.tsx +2 -2
  82. package/src/components/DeckLayout/Toast.tsx +27 -2
  83. package/src/components/DeckSettings/DeckSettings.tsx +9 -3
  84. package/src/components/Plank/Plank.stories.tsx +3 -5
  85. package/src/components/Plank/Plank.tsx +25 -9
  86. package/src/components/Plank/PlankControls.tsx +3 -3
  87. package/src/components/Plank/PlankError.tsx +2 -2
  88. package/src/components/Plank/PlankHeading.tsx +5 -5
  89. package/src/components/Sidebar/ComplementarySidebar.tsx +5 -5
  90. package/src/components/Sidebar/Sidebar.tsx +2 -2
  91. package/src/components/Sidebar/SidebarButton.tsx +4 -4
  92. package/src/events.ts +2 -2
  93. package/src/hooks/useHoistStatusbar.ts +4 -3
  94. package/src/meta.ts +1 -3
  95. package/src/translations.ts +1 -0
  96. package/src/types/schema.ts +5 -3
  97. package/dist/lib/browser/app-graph-builder-DVEKLXB4.mjs.map +0 -7
  98. package/dist/lib/browser/check-app-scheme-3BQJXWEY.mjs.map +0 -7
  99. package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +0 -7
  100. package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
  101. package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
  102. package/dist/lib/browser/chunk-NRCPV6AV.mjs.map +0 -7
  103. package/dist/lib/browser/chunk-NU7H23SK.mjs.map +0 -7
  104. package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
  105. package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
  106. package/dist/lib/browser/intent-resolver-2SUIIV6N.mjs.map +0 -7
  107. package/dist/lib/browser/react-root-7PRVDLF7.mjs.map +0 -7
  108. package/dist/lib/browser/react-surface-FNY2YC2F.mjs.map +0 -7
  109. package/dist/lib/browser/state-CRXR7X63.mjs +0 -12
  110. package/dist/lib/browser/toolkit-XGJSBY67.mjs.map +0 -7
  111. /package/dist/lib/browser/{state-CRXR7X63.mjs.map → state-6ZSDTF6Q.mjs.map} +0 -0
@@ -6,7 +6,7 @@ import {
6
6
  useHoistStatusbar,
7
7
  useMainSize,
8
8
  useNodeActionExpander
9
- } from "./chunk-WILMPGDV.mjs";
9
+ } from "./chunk-RJP5R7PY.mjs";
10
10
  import {
11
11
  calculateOverscroll,
12
12
  layoutAppliesTopbar,
@@ -14,17 +14,17 @@ import {
14
14
  } from "./chunk-CNTGBCMK.mjs";
15
15
  import {
16
16
  DeckCapabilities
17
- } from "./chunk-M57WD3V6.mjs";
17
+ } from "./chunk-HUWUYTOI.mjs";
18
18
  import {
19
19
  DeckAction,
20
20
  NewPlankPositions,
21
21
  OverscrollOptions,
22
22
  PLANK_COMPANION_TYPE,
23
23
  getMode
24
- } from "./chunk-F5BQOOEG.mjs";
24
+ } from "./chunk-7I6H3N4Q.mjs";
25
25
  import {
26
- DECK_PLUGIN
27
- } from "./chunk-Z5KITAZW.mjs";
26
+ meta
27
+ } from "./chunk-MHP4GPX5.mjs";
28
28
 
29
29
  // src/components/DeckLayout/Banner.tsx
30
30
  import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
@@ -99,7 +99,7 @@ var plankControlSpacing = "pli-2";
99
99
  var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedRef) => {
100
100
  var _effect = _useSignals();
101
101
  try {
102
- const { t } = useTranslation(DECK_PLUGIN);
102
+ const { t } = useTranslation(meta.id);
103
103
  const { dispatchPromise: dispatch } = useIntentDispatcher();
104
104
  const handleCloseCompanion = useCallback(() => {
105
105
  invariant(primary, void 0, {
@@ -133,7 +133,7 @@ var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedR
133
133
  var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant = "default", capabilities, layoutMode, pin, close = false, onClick, ...props }, forwardedRef) => {
134
134
  var _effect = _useSignals();
135
135
  try {
136
- const { t } = useTranslation(DECK_PLUGIN);
136
+ const { t } = useTranslation(meta.id);
137
137
  const buttonClassNames = variant === "hide-disabled" ? `disabled:hidden ${plankControlSpacing}` : plankControlSpacing;
138
138
  const layoutIsAnySolo = !!layoutMode?.startsWith("solo");
139
139
  return /* @__PURE__ */ React.createElement(ButtonGroup, {
@@ -193,7 +193,7 @@ var MAX_COMPANIONS = 5;
193
193
  var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncrementStart, canIncrementEnd, popoverAnchorId, primaryId, pending, companioned, companions, layoutMode, actions = [] }) => {
194
194
  var _effect = _useSignals2();
195
195
  try {
196
- const { t } = useTranslation2(DECK_PLUGIN);
196
+ const { t } = useTranslation2(meta.id);
197
197
  const { dispatchPromise: dispatch } = useIntentDispatcher2();
198
198
  const { graph } = useAppGraph();
199
199
  const breakpoint = useBreakpoints();
@@ -201,7 +201,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
201
201
  const label3 = pending ? t("pending heading") : toLocalizedString(node?.properties?.label ?? [
202
202
  "plank heading fallback label",
203
203
  {
204
- ns: DECK_PLUGIN
204
+ ns: meta.id
205
205
  }
206
206
  ], t);
207
207
  const isCompanionNode = node?.type === PLANK_COMPANION_TYPE;
@@ -257,7 +257,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
257
257
  const handleAction = useCallback2((action) => {
258
258
  typeof action.data === "function" && void action.data?.({
259
259
  parent: node,
260
- caller: DECK_PLUGIN
260
+ caller: meta.id
261
261
  });
262
262
  }, [
263
263
  node
@@ -298,7 +298,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
298
298
  id,
299
299
  part
300
300
  ]);
301
- const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${DECK_PLUGIN}/${node.id}` ? Popover.Anchor : Fragment;
301
+ const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${meta.id}/${node.id}` ? Popover.Anchor : Fragment;
302
302
  const handleTabClick = useCallback2((event) => {
303
303
  const target = event.target.closest("[data-id]");
304
304
  const tabId = target?.dataset?.id;
@@ -400,7 +400,7 @@ var PlankLoading = () => {
400
400
  var PlankContentError = ({ error }) => {
401
401
  var _effect = _useSignals4();
402
402
  try {
403
- const { t } = useTranslation3(DECK_PLUGIN);
403
+ const { t } = useTranslation3(meta.id);
404
404
  const errorString = error?.toString() ?? "";
405
405
  return /* @__PURE__ */ React4.createElement("div", {
406
406
  role: "none",
@@ -445,7 +445,8 @@ var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, companionId, ...props }) =
445
445
  const hasCompanion = !!(companionId && currentCompanion);
446
446
  return /* @__PURE__ */ React5.createElement(PlankContainer, {
447
447
  solo: props.part === "solo",
448
- companion: hasCompanion
448
+ companion: hasCompanion,
449
+ encapsulate: !!props.settings?.encapsulatedPlanks
449
450
  }, /* @__PURE__ */ React5.createElement(PlankComponent, {
450
451
  id,
451
452
  node,
@@ -472,7 +473,7 @@ var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, companionId, ...props }) =
472
473
  _effect.f();
473
474
  }
474
475
  });
475
- var PlankContainer = ({ children, solo, companion }) => {
476
+ var PlankContainer = ({ children, solo, companion, encapsulate }) => {
476
477
  var _effect = _useSignals5();
477
478
  try {
478
479
  const sizeAttrs = useMainSize();
@@ -481,7 +482,7 @@ var PlankContainer = ({ children, solo, companion }) => {
481
482
  }
482
483
  return /* @__PURE__ */ React5.createElement("div", {
483
484
  role: "none",
484
- className: mx3("absolute inset-0 grid", companion && "grid-cols-[1fr_1fr]", railGridHorizontal, mainIntrinsicSize),
485
+ className: mx3("absolute inset-[--main-spacing] grid", encapsulate && "border border-separator rounded overflow-hidden", companion && "grid-cols-[6fr_4fr]", railGridHorizontal, mainIntrinsicSize),
485
486
  ...sizeAttrs
486
487
  }, children);
487
488
  } finally {
@@ -519,11 +520,7 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
519
520
  }, []);
520
521
  useLayoutEffect(() => {
521
522
  if (scrollIntoView === id) {
522
- const focusable = rootElement.current?.querySelector("button") || rootElement.current;
523
- focusable?.focus({
524
- preventScroll: true
525
- });
526
- layoutMode === "deck" && focusable?.scrollIntoView({
523
+ layoutMode === "deck" && rootElement.current?.scrollIntoView({
527
524
  behavior: "smooth",
528
525
  inline: "center"
529
526
  });
@@ -541,14 +538,17 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
541
538
  const isAttendable = layoutMode.startsWith("solo") && part.startsWith("solo") || layoutMode === "deck" && part === "deck";
542
539
  const sizeAttrs = useMainSize();
543
540
  const data = useMemo2(() => node && {
541
+ attendableId: id,
544
542
  subject: node.data,
545
543
  companionTo: primary?.data,
544
+ properties: node.properties,
546
545
  variant,
547
546
  path,
548
547
  popoverAnchorId
549
548
  }, [
550
549
  node,
551
550
  node?.data,
551
+ node?.properties,
552
552
  path,
553
553
  popoverAnchorId,
554
554
  primary?.data,
@@ -556,7 +556,7 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
556
556
  ]);
557
557
  const placeholder = useMemo2(() => /* @__PURE__ */ React5.createElement(PlankLoading, null), []);
558
558
  const Root = part.startsWith("solo") ? "article" : StackItem2.Root;
559
- const className = mx3("attention-surface relative dx-focus-ring-inset-over-all density-coarse", isSolo && mainIntrinsicSize, isSolo && railGridHorizontal, isSolo && "absolute inset-0", part.startsWith("solo") && "grid", part === "deck" && (companioned === "companion" ? "!border-separator border-ie" : "!border-separator border-li"), part.startsWith("solo-") && "row-span-2 grid-rows-subgrid min-is-0", part === "solo-companion" && "!border-separator border-is");
559
+ const className = mx3("attention-surface relative dx-focus-ring-inset-over-all density-coarse", isSolo && mainIntrinsicSize, isSolo && railGridHorizontal, isSolo && "absolute inset-0", part.startsWith("solo") && "grid", part === "deck" && (companioned === "companion" ? "!border-separator border-ie" : "!border-separator border-li"), part.startsWith("solo-") && "row-span-2 grid-rows-subgrid min-is-0", part === "solo-companion" && "!border-separator border-is", settings?.encapsulatedPlanks && !part.startsWith("solo") && "mli-[--main-spacing] !border-separator border rounded overflow-hidden");
560
560
  return /* @__PURE__ */ React5.createElement(Root, {
561
561
  ref: rootElement,
562
562
  "data-testid": "deck.plank",
@@ -613,7 +613,7 @@ var ToggleSidebarButton = ({ classNames, variant = "ghost" }) => {
613
613
  var _effect = _useSignals6();
614
614
  try {
615
615
  const layoutContext = useCapability2(DeckCapabilities.MutableDeckState);
616
- const { t } = useTranslation4(DECK_PLUGIN);
616
+ const { t } = useTranslation4(meta.id);
617
617
  return /* @__PURE__ */ React6.createElement(IconButton3, {
618
618
  variant,
619
619
  iconOnly: true,
@@ -631,7 +631,7 @@ var CloseSidebarButton = () => {
631
631
  var _effect = _useSignals6();
632
632
  try {
633
633
  const layoutContext = useCapability2(DeckCapabilities.MutableDeckState);
634
- const { t } = useTranslation4(DECK_PLUGIN);
634
+ const { t } = useTranslation4(meta.id);
635
635
  return /* @__PURE__ */ React6.createElement(IconButton3, {
636
636
  variant: "ghost",
637
637
  iconOnly: true,
@@ -650,7 +650,7 @@ var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
650
650
  try {
651
651
  const { dispatchPromise: dispatch } = useIntentDispatcher4();
652
652
  const layoutContext = useCapability2(DeckCapabilities.MutableDeckState);
653
- const { t } = useTranslation4(DECK_PLUGIN);
653
+ const { t } = useTranslation4(meta.id);
654
654
  const companions = useDeckCompanions();
655
655
  const handleClick = useCallback4(async () => {
656
656
  layoutContext.complementarySidebarState = layoutContext.complementarySidebarState === "expanded" ? "collapsed" : "expanded";
@@ -689,13 +689,13 @@ var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
689
689
  var label = [
690
690
  "complementary sidebar title",
691
691
  {
692
- ns: DECK_PLUGIN
692
+ ns: meta.id
693
693
  }
694
694
  ];
695
695
  var ComplementarySidebar = ({ current }) => {
696
696
  var _effect = _useSignals7();
697
697
  try {
698
- const { t } = useTranslation5(DECK_PLUGIN);
698
+ const { t } = useTranslation5(meta.id);
699
699
  const { dispatchPromise: dispatch } = useIntentDispatcher5();
700
700
  const layout = useCapability3(DeckCapabilities.MutableDeckState);
701
701
  const layoutMode = getMode(layout.deck);
@@ -791,7 +791,7 @@ var ComplementarySidebar = ({ current }) => {
791
791
  value: getCompanionId(companion.id),
792
792
  classNames: 'absolute data-[state="inactive"]:-z-[1] inset-block-0 inline-start-0 is-[calc(100%-var(--r0-size))] lg:is-[--r1-size] grid grid-cols-1 grid-rows-[var(--rail-size)_1fr_min-content] pbs-[env(safe-area-inset-top)]',
793
793
  ...layout.complementarySidebarState !== "expanded" && {
794
- inert: "true"
794
+ inert: true
795
795
  }
796
796
  }, /* @__PURE__ */ React7.createElement(ComplementarySidebarPanel, {
797
797
  companion,
@@ -816,7 +816,7 @@ var ScrollArea = ({ children }) => {
816
816
  var ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }) => {
817
817
  var _effect = _useSignals7();
818
818
  try {
819
- const { t } = useTranslation5(DECK_PLUGIN);
819
+ const { t } = useTranslation5(meta.id);
820
820
  if (getCompanionId(companion.id) !== activeId && !data) {
821
821
  return null;
822
822
  }
@@ -848,7 +848,7 @@ import { Main as Main2 } from "@dxos/react-ui";
848
848
  var label2 = [
849
849
  "sidebar title",
850
850
  {
851
- ns: DECK_PLUGIN
851
+ ns: meta.id
852
852
  }
853
853
  ];
854
854
  var Sidebar = () => {
@@ -891,7 +891,7 @@ var Sidebar = () => {
891
891
  var Banner = ({ variant, classNames }) => {
892
892
  var _effect = _useSignals9();
893
893
  try {
894
- const { t } = useTranslation6(DECK_PLUGIN);
894
+ const { t } = useTranslation6(meta.id);
895
895
  return /* @__PURE__ */ React9.createElement("header", {
896
896
  className: mx4("flex items-stretch relative plb-1 pis-1 pie-2", variant === "topbar" && "fixed inset-inline-0 block-start-[env(safe-area-inset-top)] bs-[--rail-size] border-be border-separator", classNames)
897
897
  }, variant === "sidebar" ? /* @__PURE__ */ React9.createElement(CloseSidebarButton, null) : /* @__PURE__ */ React9.createElement(ToggleSidebarButton, null), /* @__PURE__ */ React9.createElement("span", {
@@ -923,14 +923,9 @@ var Banner = ({ variant, classNames }) => {
923
923
  };
924
924
 
925
925
  // src/components/DeckLayout/DeckLayout.tsx
926
- import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
927
- import { untracked } from "@preact/signals-core";
928
- import React17, { Fragment as Fragment3, useCallback as useCallback7, useEffect as useEffect5, useMemo as useMemo6, useRef as useRef3 } from "react";
929
- import { Capabilities, LayoutAction as LayoutAction5, createIntent as createIntent6, useCapability as useCapability8, useIntentDispatcher as useIntentDispatcher6, usePluginManager } from "@dxos/app-framework";
930
- import { AttentionCapabilities } from "@dxos/plugin-attention";
931
- import { Main as Main3, useMediaQuery, useOnTransition } from "@dxos/react-ui";
932
- import { DEFAULT_HORIZONTAL_SIZE, Stack, StackContext } from "@dxos/react-ui-stack";
933
- import { mainPaddingTransitions } from "@dxos/react-ui-theme";
926
+ import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
927
+ import React18 from "react";
928
+ import { useCapability as useCapability9 } from "@dxos/app-framework";
934
929
 
935
930
  // src/components/DeckLayout/ActiveNode.tsx
936
931
  import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
@@ -960,6 +955,16 @@ var ActiveNode = () => {
960
955
  }
961
956
  };
962
957
 
958
+ // src/components/DeckLayout/DeckMain.tsx
959
+ import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
960
+ import { untracked } from "@preact/signals-core";
961
+ import React14, { Fragment as Fragment3, useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef2 } from "react";
962
+ import { Capabilities, LayoutAction as LayoutAction5, createIntent as createIntent6, useCapability as useCapability6, useIntentDispatcher as useIntentDispatcher6, usePluginManager } from "@dxos/app-framework";
963
+ import { AttentionCapabilities } from "@dxos/plugin-attention";
964
+ import { Main as Main3, useMediaQuery, useOnTransition } from "@dxos/react-ui";
965
+ import { DEFAULT_HORIZONTAL_SIZE, Stack, StackContext } from "@dxos/react-ui-stack";
966
+ import { mainPaddingTransitions, mx as mx5 } from "@dxos/react-ui-theme";
967
+
963
968
  // src/components/DeckLayout/ContentEmpty.tsx
964
969
  import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
965
970
  import React11 from "react";
@@ -986,156 +991,23 @@ var ContentEmpty = () => {
986
991
  }
987
992
  };
988
993
 
989
- // src/components/DeckLayout/Dialog.tsx
994
+ // src/components/DeckLayout/StatusBar.tsx
990
995
  import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
991
996
  import React12 from "react";
992
- import { Surface as Surface8, useCapability as useCapability6 } from "@dxos/app-framework";
993
- import { AlertDialog, Dialog as NaturalDialog } from "@dxos/react-ui";
994
- var Dialog = () => {
995
- var _effect = _useSignals12();
996
- try {
997
- const context = useCapability6(DeckCapabilities.MutableDeckState);
998
- const { dialogOpen, dialogType, dialogBlockAlign, dialogOverlayClasses, dialogOverlayStyle, dialogContent } = context;
999
- const Root = dialogType === "alert" ? AlertDialog.Root : NaturalDialog.Root;
1000
- const Overlay = dialogType === "alert" ? AlertDialog.Overlay : NaturalDialog.Overlay;
1001
- return /* @__PURE__ */ React12.createElement(Root, {
1002
- modal: dialogBlockAlign !== "end",
1003
- open: dialogOpen,
1004
- onOpenChange: (nextOpen) => context.dialogOpen = nextOpen
1005
- }, dialogBlockAlign === "end" ? (
1006
- // TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
1007
- /* @__PURE__ */ React12.createElement(Surface8, {
1008
- role: "dialog",
1009
- data: dialogContent,
1010
- limit: 1,
1011
- fallback: PlankContentError,
1012
- placeholder: /* @__PURE__ */ React12.createElement("div", null)
1013
- })
1014
- ) : /* @__PURE__ */ React12.createElement(Overlay, {
1015
- blockAlign: dialogBlockAlign,
1016
- classNames: dialogOverlayClasses,
1017
- style: dialogOverlayStyle
1018
- }, /* @__PURE__ */ React12.createElement(Surface8, {
1019
- role: "dialog",
1020
- data: dialogContent,
1021
- limit: 1,
1022
- fallback: PlankContentError
1023
- })));
1024
- } finally {
1025
- _effect.f();
1026
- }
1027
- };
1028
-
1029
- // src/components/DeckLayout/Popover.tsx
1030
- import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
1031
- import { createContext } from "@radix-ui/react-context";
1032
- import React13, { useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef2, useState as useState3 } from "react";
1033
- import { Surface as Surface9, useCapability as useCapability7 } from "@dxos/app-framework";
1034
- import { Popover as Popover2 } from "@dxos/react-ui";
1035
- var DEBOUNCE_DELAY = 40;
1036
- var [DeckPopoverProvider, useDeckPopoverContext] = createContext("DeckPopover");
1037
- var PopoverRoot = ({ children }) => {
1038
- var _effect = _useSignals13();
1039
- try {
1040
- const layout = useCapability7(DeckCapabilities.MutableDeckState);
1041
- const virtualRef = useRef2(null);
1042
- const [virtualIter, setVirtualIter] = useState3(0);
1043
- const [open, setOpen] = useState3(false);
1044
- const debounceRef = useRef2(null);
1045
- useEffect4(() => {
1046
- setOpen(false);
1047
- if (layout.popoverOpen) {
1048
- if (debounceRef.current) {
1049
- clearTimeout(debounceRef.current);
1050
- }
1051
- if (layout.popoverAnchor && virtualRef.current !== layout.popoverAnchor) {
1052
- virtualRef.current = layout.popoverAnchor ?? null;
1053
- setVirtualIter((iter) => iter + 1);
1054
- }
1055
- debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
1056
- }
1057
- }, [
1058
- layout.popoverOpen,
1059
- layout.popoverAnchorId,
1060
- layout.popoverAnchor,
1061
- layout.popoverContent
1062
- ]);
1063
- return /* @__PURE__ */ React13.createElement(DeckPopoverProvider, {
1064
- setOpen
1065
- }, /* @__PURE__ */ React13.createElement(Popover2.Root, {
1066
- modal: false,
1067
- open
1068
- }, layout.popoverAnchor && /* @__PURE__ */ React13.createElement(Popover2.VirtualTrigger, {
1069
- key: virtualIter,
1070
- virtualRef
1071
- }), children));
1072
- } finally {
1073
- _effect.f();
1074
- }
1075
- };
1076
- var PopoverContent = () => {
1077
- var _effect = _useSignals13();
1078
- try {
1079
- const layout = useCapability7(DeckCapabilities.MutableDeckState);
1080
- const { setOpen } = useDeckPopoverContext("PopoverContent");
1081
- const handleClose = useCallback6((event) => {
1082
- if (
1083
- // TODO(thure): CodeMirror should not focus itself when it updates.
1084
- event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
1085
- ) {
1086
- event.preventDefault();
1087
- } else {
1088
- setOpen(false);
1089
- layout.popoverOpen = false;
1090
- layout.popoverAnchor = void 0;
1091
- layout.popoverAnchorId = void 0;
1092
- layout.popoverSide = void 0;
1093
- }
1094
- }, [
1095
- setOpen
1096
- ]);
1097
- const collisionBoundaries = useMemo5(() => {
1098
- const closest = layout.popoverAnchor?.closest("[data-popover-collision-boundary]");
1099
- return closest ? [
1100
- closest
1101
- ] : [];
1102
- }, [
1103
- layout.popoverAnchor
1104
- ]);
1105
- return /* @__PURE__ */ React13.createElement(Popover2.Portal, null, /* @__PURE__ */ React13.createElement(Popover2.Content, {
1106
- side: layout.popoverSide,
1107
- onInteractOutside: handleClose,
1108
- onEscapeKeyDown: handleClose,
1109
- collisionBoundary: collisionBoundaries,
1110
- sticky: "always",
1111
- hideWhenDetached: true
1112
- }, /* @__PURE__ */ React13.createElement(Popover2.Viewport, null, /* @__PURE__ */ React13.createElement(Surface9, {
1113
- role: "card--popover",
1114
- data: layout.popoverContent,
1115
- limit: 1
1116
- })), /* @__PURE__ */ React13.createElement(Popover2.Arrow, null)));
1117
- } finally {
1118
- _effect.f();
1119
- }
1120
- };
1121
-
1122
- // src/components/DeckLayout/StatusBar.tsx
1123
- import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
1124
- import React14 from "react";
1125
- import { Surface as Surface10 } from "@dxos/app-framework";
997
+ import { Surface as Surface8 } from "@dxos/app-framework";
1126
998
  import { useLandmarkMover } from "@dxos/react-ui";
1127
999
  var StatusBar = ({ showHints }) => {
1128
- var _effect = _useSignals14();
1000
+ var _effect = _useSignals12();
1129
1001
  try {
1130
1002
  const mover = useLandmarkMover(void 0, "3");
1131
- return /* @__PURE__ */ React14.createElement("div", {
1003
+ return /* @__PURE__ */ React12.createElement("div", {
1132
1004
  role: "contentinfo",
1133
1005
  className: "fixed block-end-0 inset-inline-0 bs-[--statusbar-size] border-bs border-separator z-[2] flex text-description",
1134
1006
  ...mover
1135
- }, showHints && /* @__PURE__ */ React14.createElement(Surface10, {
1007
+ }, showHints && /* @__PURE__ */ React12.createElement(Surface8, {
1136
1008
  role: "hints",
1137
1009
  limit: 1
1138
- }), /* @__PURE__ */ React14.createElement(Surface10, {
1010
+ }), /* @__PURE__ */ React12.createElement(Surface8, {
1139
1011
  role: "status-bar",
1140
1012
  limit: 1
1141
1013
  }));
@@ -1144,49 +1016,13 @@ var StatusBar = ({ showHints }) => {
1144
1016
  }
1145
1017
  };
1146
1018
 
1147
- // src/components/DeckLayout/Toast.tsx
1148
- import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
1149
- import React15 from "react";
1150
- import { Button, Icon as Icon2, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as useTranslation7 } from "@dxos/react-ui";
1151
- var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange }) => {
1152
- var _effect = _useSignals15();
1153
- try {
1154
- const { t } = useTranslation7(DECK_PLUGIN);
1155
- return /* @__PURE__ */ React15.createElement(NaturalToast.Root, {
1156
- "data-testid": id,
1157
- defaultOpen: true,
1158
- duration,
1159
- onOpenChange
1160
- }, /* @__PURE__ */ React15.createElement(NaturalToast.Body, null, /* @__PURE__ */ React15.createElement(NaturalToast.Title, {
1161
- classNames: "items-center"
1162
- }, icon && /* @__PURE__ */ React15.createElement(Icon2, {
1163
- icon,
1164
- size: 5,
1165
- classNames: "inline mr-1"
1166
- }), title && /* @__PURE__ */ React15.createElement("span", null, toLocalizedString3(title, t))), description && /* @__PURE__ */ React15.createElement(NaturalToast.Description, null, description && toLocalizedString3(description, t))), /* @__PURE__ */ React15.createElement(NaturalToast.Actions, null, onAction && actionAlt && actionLabel && /* @__PURE__ */ React15.createElement(NaturalToast.Action, {
1167
- altText: toLocalizedString3(actionAlt, t),
1168
- asChild: true
1169
- }, /* @__PURE__ */ React15.createElement(Button, {
1170
- "data-testid": "toast.action",
1171
- variant: "primary",
1172
- onClick: () => onAction?.()
1173
- }, toLocalizedString3(actionLabel, t))), closeLabel && /* @__PURE__ */ React15.createElement(NaturalToast.Close, {
1174
- asChild: true
1175
- }, /* @__PURE__ */ React15.createElement(Button, {
1176
- "data-testid": "toast.close"
1177
- }, toLocalizedString3(closeLabel, t)))));
1178
- } finally {
1179
- _effect.f();
1180
- }
1181
- };
1182
-
1183
1019
  // src/components/DeckLayout/Topbar.tsx
1184
- import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
1185
- import React16 from "react";
1020
+ import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
1021
+ import React13 from "react";
1186
1022
  var Topbar = () => {
1187
- var _effect = _useSignals16();
1023
+ var _effect = _useSignals13();
1188
1024
  try {
1189
- return /* @__PURE__ */ React16.createElement(Banner, {
1025
+ return /* @__PURE__ */ React13.createElement(Banner, {
1190
1026
  variant: "topbar"
1191
1027
  });
1192
1028
  } finally {
@@ -1194,37 +1030,23 @@ var Topbar = () => {
1194
1030
  }
1195
1031
  };
1196
1032
 
1197
- // src/components/DeckLayout/DeckLayout.tsx
1198
- var PlankSeparator = ({ order }) => {
1199
- var _effect = _useSignals17();
1200
- try {
1201
- return order > 0 ? /* @__PURE__ */ React17.createElement("span", {
1202
- role: "separator",
1203
- className: "row-span-2 bg-deckSurface is-4",
1204
- style: {
1205
- gridColumn: order
1206
- }
1207
- }) : null;
1208
- } finally {
1209
- _effect.f();
1210
- }
1211
- };
1212
- var DeckLayout = ({ onDismissToast }) => {
1213
- var _effect = _useSignals17();
1033
+ // src/components/DeckLayout/DeckMain.tsx
1034
+ var DeckMain = () => {
1035
+ var _effect = _useSignals14();
1214
1036
  try {
1215
1037
  const { dispatchPromise: dispatch } = useIntentDispatcher6();
1216
- const settings = useCapability8(Capabilities.SettingsStore).getStore(DECK_PLUGIN).value;
1217
- const context = useCapability8(DeckCapabilities.MutableDeckState);
1218
- const { sidebarState, complementarySidebarState, complementarySidebarPanel, deck, toasts } = context;
1038
+ const settings = useCapability6(Capabilities.SettingsStore).getStore(meta.id)?.value;
1039
+ const context = useCapability6(DeckCapabilities.MutableDeckState);
1040
+ const { sidebarState, complementarySidebarState, complementarySidebarPanel, deck } = context;
1219
1041
  const { active, activeCompanions, fullscreen, solo, plankSizing } = deck;
1220
- const breakpoint = useBreakpoints();
1221
1042
  const layoutMode = getMode(deck);
1043
+ const breakpoint = useBreakpoints();
1222
1044
  const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
1223
1045
  const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
1224
1046
  const pluginManager = usePluginManager();
1225
- const scrollLeftRef = useRef3();
1226
- const deckRef = useRef3(null);
1227
- useEffect5(() => {
1047
+ const scrollLeftRef = useRef2(null);
1048
+ const deckRef = useRef2(null);
1049
+ useEffect4(() => {
1228
1050
  const attended = untracked(() => {
1229
1051
  const attention = pluginManager.context.getCapability(AttentionCapabilities.Attention);
1230
1052
  return attention.current;
@@ -1234,11 +1056,9 @@ var DeckLayout = ({ onDismissToast }) => {
1234
1056
  document.querySelector(`article[data-attendable-id="${firstId}"] button`)?.focus();
1235
1057
  }
1236
1058
  }, []);
1237
- const [isNotMobile] = useMediaQuery("md", {
1238
- ssr: false
1239
- });
1240
- const shouldRevert = useRef3(false);
1241
- useEffect5(() => {
1059
+ const [isNotMobile] = useMediaQuery("md");
1060
+ const shouldRevert = useRef2(false);
1061
+ useEffect4(() => {
1242
1062
  if (!isNotMobile && getMode(deck) === "deck") {
1243
1063
  const attended = untracked(() => {
1244
1064
  const attention = pluginManager.context.getCapability(AttentionCapabilities.Attention);
@@ -1265,8 +1085,8 @@ var DeckLayout = ({ onDismissToast }) => {
1265
1085
  deck,
1266
1086
  dispatch
1267
1087
  ]);
1268
- useEffect5(() => {
1269
- if (!settings.enableDeck && layoutMode === "deck") {
1088
+ useEffect4(() => {
1089
+ if (settings?.enableDeck && layoutMode === "deck") {
1270
1090
  void dispatch(createIntent6(LayoutAction5.SetLayoutMode, {
1271
1091
  part: "mode",
1272
1092
  subject: active[0],
@@ -1276,27 +1096,27 @@ var DeckLayout = ({ onDismissToast }) => {
1276
1096
  }));
1277
1097
  }
1278
1098
  }, [
1279
- settings.enableDeck,
1099
+ settings?.enableDeck,
1280
1100
  dispatch,
1281
1101
  active,
1282
1102
  layoutMode
1283
1103
  ]);
1284
- const handleResize = useCallback7(() => {
1104
+ const handleResize = useCallback6(() => {
1285
1105
  scrollLeftRef.current = null;
1286
1106
  }, []);
1287
- useEffect5(() => {
1107
+ useEffect4(() => {
1288
1108
  window.addEventListener("resize", handleResize);
1289
1109
  return () => window.removeEventListener("resize", handleResize);
1290
1110
  }, [
1291
1111
  handleResize
1292
1112
  ]);
1293
- const restoreScroll = useCallback7(() => {
1113
+ const restoreScroll = useCallback6(() => {
1294
1114
  if (deckRef.current && scrollLeftRef.current != null) {
1295
1115
  deckRef.current.scrollLeft = scrollLeftRef.current;
1296
1116
  }
1297
1117
  }, []);
1298
1118
  useOnTransition(layoutMode, (mode) => mode !== "deck", "deck", restoreScroll);
1299
- const handleScroll = useCallback7((event) => {
1119
+ const handleScroll = useCallback6((event) => {
1300
1120
  if (!solo && event.currentTarget === event.target) {
1301
1121
  scrollLeftRef.current = event.target.scrollLeft;
1302
1122
  }
@@ -1304,17 +1124,17 @@ var DeckLayout = ({ onDismissToast }) => {
1304
1124
  solo
1305
1125
  ]);
1306
1126
  const isEmpty = !solo && active.length === 0;
1307
- const padding = useMemo6(() => {
1308
- if (!solo && settings.overscroll === "centering") {
1127
+ const padding = useMemo5(() => {
1128
+ if (!solo && settings?.overscroll === "centering") {
1309
1129
  return calculateOverscroll(active.length);
1310
1130
  }
1311
1131
  return {};
1312
1132
  }, [
1313
1133
  solo,
1314
- settings.overscroll,
1134
+ settings?.overscroll,
1315
1135
  deck
1316
1136
  ]);
1317
- const mainPosition = useMemo6(() => [
1137
+ const mainPosition = useMemo5(() => [
1318
1138
  "grid !block-start-[env(safe-area-inset-top)]",
1319
1139
  topbar && "!block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
1320
1140
  hoistStatusbar && "lg:block-end-[--statusbar-size]"
@@ -1322,7 +1142,7 @@ var DeckLayout = ({ onDismissToast }) => {
1322
1142
  topbar,
1323
1143
  hoistStatusbar
1324
1144
  ]);
1325
- const { order, itemsCount } = useMemo6(() => {
1145
+ const { order, itemsCount } = useMemo5(() => {
1326
1146
  return active.reduce((acc, entryId) => {
1327
1147
  acc.order[entryId] = acc.itemsCount + 1;
1328
1148
  acc.itemsCount += activeCompanions?.[entryId] ? 3 : 2;
@@ -1335,53 +1155,55 @@ var DeckLayout = ({ onDismissToast }) => {
1335
1155
  active,
1336
1156
  activeCompanions
1337
1157
  ]);
1338
- return /* @__PURE__ */ React17.createElement(PopoverRoot, null, /* @__PURE__ */ React17.createElement(ActiveNode, null), /* @__PURE__ */ React17.createElement(Main3.Root, {
1158
+ return /* @__PURE__ */ React14.createElement(Main3.Root, {
1339
1159
  navigationSidebarState: fullscreen ? "closed" : context.sidebarState,
1340
1160
  onNavigationSidebarStateChange: (next) => context.sidebarState = next,
1341
1161
  complementarySidebarState: fullscreen ? "closed" : context.complementarySidebarState,
1342
1162
  onComplementarySidebarStateChange: (next) => context.complementarySidebarState = next
1343
- }, /* @__PURE__ */ React17.createElement(Sidebar, null), /* @__PURE__ */ React17.createElement(ComplementarySidebar, {
1163
+ }, /* @__PURE__ */ React14.createElement(Sidebar, null), /* @__PURE__ */ React14.createElement(ComplementarySidebar, {
1344
1164
  current: complementarySidebarPanel
1345
- }), /* @__PURE__ */ React17.createElement(Main3.Overlay, null), isEmpty && /* @__PURE__ */ React17.createElement(Main3.Content, {
1165
+ }), /* @__PURE__ */ React14.createElement(Main3.Overlay, null), isEmpty && /* @__PURE__ */ React14.createElement(Main3.Content, {
1346
1166
  bounce: true,
1347
1167
  handlesFocus: true,
1348
1168
  classNames: mainPosition
1349
- }, /* @__PURE__ */ React17.createElement(ContentEmpty, null)), !isEmpty && /* @__PURE__ */ React17.createElement(Main3.Content, {
1169
+ }, /* @__PURE__ */ React14.createElement(ContentEmpty, null)), !isEmpty && /* @__PURE__ */ React14.createElement(Main3.Content, {
1350
1170
  bounce: true,
1351
1171
  handlesFocus: true,
1352
1172
  classNames: mainPosition,
1353
1173
  style: {
1174
+ "--main-spacing": settings?.encapsulatedPlanks ? "0.75rem" : "0",
1354
1175
  "--dx-main-sidebarWidth": sidebarState === "expanded" ? "var(--nav-sidebar-size)" : sidebarState === "collapsed" ? "var(--l0-size)" : "0",
1355
1176
  "--dx-main-complementaryWidth": complementarySidebarState === "expanded" ? "var(--complementary-sidebar-size)" : complementarySidebarState === "collapsed" ? "var(--rail-size)" : "0",
1356
1177
  "--dx-main-contentFirstWidth": `${plankSizing[active[0] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`,
1357
1178
  "--dx-main-contentLastWidth": `${plankSizing[active[(active.length ?? 1) - 1] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`
1358
1179
  }
1359
- }, /* @__PURE__ */ React17.createElement("div", {
1180
+ }, /* @__PURE__ */ React14.createElement("div", {
1360
1181
  role: "none",
1361
1182
  className: !solo ? "relative bg-deckSurface overflow-hidden" : "sr-only",
1362
1183
  ...solo && {
1363
- inert: ""
1184
+ inert: true
1364
1185
  }
1365
- }, !topbar && !fullscreen && /* @__PURE__ */ React17.createElement(ToggleSidebarButton, {
1186
+ }, !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleSidebarButton, {
1366
1187
  classNames: fixedSidebarToggleStyles
1367
- }), !topbar && !fullscreen && /* @__PURE__ */ React17.createElement(ToggleComplementarySidebarButton, {
1188
+ }), !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleComplementarySidebarButton, {
1368
1189
  classNames: fixedComplementarySidebarToggleStyles
1369
- }), /* @__PURE__ */ React17.createElement(Stack, {
1190
+ }), /* @__PURE__ */ React14.createElement(Stack, {
1370
1191
  ref: deckRef,
1371
1192
  orientation: "horizontal",
1372
1193
  size: "contain",
1194
+ itemsCount: itemsCount - 1,
1373
1195
  classNames: [
1374
- "absolute inset-block-0 -inset-inline-px",
1196
+ "absolute inset-block-[--main-spacing] -inset-inline-px bs-[calc(100%-2*var(--main-spacing))]",
1375
1197
  mainPaddingTransitions
1376
1198
  ],
1377
- itemsCount: itemsCount - 1,
1378
1199
  style: padding,
1379
1200
  onScroll: handleScroll
1380
- }, active.map((entryId) => /* @__PURE__ */ React17.createElement(Fragment3, {
1201
+ }, active.map((entryId) => /* @__PURE__ */ React14.createElement(Fragment3, {
1381
1202
  key: entryId
1382
- }, /* @__PURE__ */ React17.createElement(PlankSeparator, {
1383
- order: order[entryId] - 1
1384
- }), /* @__PURE__ */ React17.createElement(Plank, {
1203
+ }, /* @__PURE__ */ React14.createElement(PlankSeparator, {
1204
+ order: order[entryId] - 1,
1205
+ encapsulate: !!settings?.enableDeck
1206
+ }), /* @__PURE__ */ React14.createElement(Plank, {
1385
1207
  id: entryId,
1386
1208
  companionId: activeCompanions?.[entryId],
1387
1209
  part: "deck",
@@ -1389,36 +1211,227 @@ var DeckLayout = ({ onDismissToast }) => {
1389
1211
  active,
1390
1212
  layoutMode,
1391
1213
  settings
1392
- }))))), /* @__PURE__ */ React17.createElement("div", {
1214
+ }))))), /* @__PURE__ */ React14.createElement("div", {
1393
1215
  role: "none",
1394
- className: solo ? "relative bg-deckSurface overflow-hidden" : "sr-only",
1216
+ className: solo ? "relative overflow-hidden bg-deckSurface" : "sr-only",
1395
1217
  ...!solo && {
1396
- inert: ""
1218
+ inert: true
1397
1219
  }
1398
- }, !topbar && !fullscreen && /* @__PURE__ */ React17.createElement(ToggleSidebarButton, {
1220
+ }, !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleSidebarButton, {
1399
1221
  classNames: fixedSidebarToggleStyles
1400
- }), !topbar && !fullscreen && /* @__PURE__ */ React17.createElement(ToggleComplementarySidebarButton, {
1222
+ }), !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleComplementarySidebarButton, {
1401
1223
  classNames: fixedComplementarySidebarToggleStyles
1402
- }), /* @__PURE__ */ React17.createElement(StackContext.Provider, {
1224
+ }), /* @__PURE__ */ React14.createElement(StackContext.Provider, {
1403
1225
  value: {
1404
- size: "contain",
1405
1226
  orientation: "horizontal",
1227
+ size: "contain",
1406
1228
  rail: true
1407
1229
  }
1408
- }, /* @__PURE__ */ React17.createElement(Plank, {
1230
+ }, /* @__PURE__ */ React14.createElement(Plank, {
1409
1231
  id: solo,
1410
1232
  companionId: solo ? activeCompanions?.[solo] : void 0,
1411
1233
  part: "solo",
1412
1234
  layoutMode,
1413
1235
  settings
1414
- })))), topbar && /* @__PURE__ */ React17.createElement(Topbar, null), hoistStatusbar && /* @__PURE__ */ React17.createElement(StatusBar, {
1415
- showHints: settings.showHints
1416
- })), /* @__PURE__ */ React17.createElement(PopoverContent, null), /* @__PURE__ */ React17.createElement(Dialog, null), toasts?.map((toast) => /* @__PURE__ */ React17.createElement(Toast, {
1236
+ })))), topbar && /* @__PURE__ */ React14.createElement(Topbar, null), hoistStatusbar && /* @__PURE__ */ React14.createElement(StatusBar, {
1237
+ showHints: settings?.showHints
1238
+ }));
1239
+ } finally {
1240
+ _effect.f();
1241
+ }
1242
+ };
1243
+ var PlankSeparator = ({ order, encapsulate }) => {
1244
+ var _effect = _useSignals14();
1245
+ try {
1246
+ return order > 0 ? /* @__PURE__ */ React14.createElement("span", {
1247
+ role: "separator",
1248
+ className: mx5("row-span-2 bg-deckSurface", encapsulate ? "is-0" : "is-4"),
1249
+ style: {
1250
+ gridColumn: order
1251
+ }
1252
+ }) : null;
1253
+ } finally {
1254
+ _effect.f();
1255
+ }
1256
+ };
1257
+
1258
+ // src/components/DeckLayout/Dialog.tsx
1259
+ import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
1260
+ import React15 from "react";
1261
+ import { Surface as Surface9, useCapability as useCapability7 } from "@dxos/app-framework";
1262
+ import { AlertDialog, Dialog as NaturalDialog } from "@dxos/react-ui";
1263
+ var Dialog = () => {
1264
+ var _effect = _useSignals15();
1265
+ try {
1266
+ const context = useCapability7(DeckCapabilities.MutableDeckState);
1267
+ const { dialogOpen, dialogType, dialogBlockAlign, dialogOverlayClasses, dialogOverlayStyle, dialogContent } = context;
1268
+ const Root = dialogType === "alert" ? AlertDialog.Root : NaturalDialog.Root;
1269
+ const Overlay = dialogType === "alert" ? AlertDialog.Overlay : NaturalDialog.Overlay;
1270
+ return /* @__PURE__ */ React15.createElement(Root, {
1271
+ modal: dialogBlockAlign !== "end",
1272
+ open: dialogOpen,
1273
+ onOpenChange: (nextOpen) => context.dialogOpen = nextOpen
1274
+ }, dialogBlockAlign === "end" ? (
1275
+ // TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
1276
+ /* @__PURE__ */ React15.createElement(Surface9, {
1277
+ role: "dialog",
1278
+ data: dialogContent,
1279
+ limit: 1,
1280
+ fallback: PlankContentError,
1281
+ placeholder: /* @__PURE__ */ React15.createElement("div", null)
1282
+ })
1283
+ ) : /* @__PURE__ */ React15.createElement(Overlay, {
1284
+ blockAlign: dialogBlockAlign,
1285
+ classNames: dialogOverlayClasses,
1286
+ style: dialogOverlayStyle
1287
+ }, /* @__PURE__ */ React15.createElement(Surface9, {
1288
+ role: "dialog",
1289
+ data: dialogContent,
1290
+ limit: 1,
1291
+ fallback: PlankContentError
1292
+ })));
1293
+ } finally {
1294
+ _effect.f();
1295
+ }
1296
+ };
1297
+
1298
+ // src/components/DeckLayout/Popover.tsx
1299
+ import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
1300
+ import { createContext } from "@radix-ui/react-context";
1301
+ import React16, { useCallback as useCallback7, useEffect as useEffect5, useMemo as useMemo6, useRef as useRef3, useState as useState3 } from "react";
1302
+ import { Surface as Surface10, useCapability as useCapability8 } from "@dxos/app-framework";
1303
+ import { Popover as Popover2 } from "@dxos/react-ui";
1304
+ var DEBOUNCE_DELAY = 40;
1305
+ var [DeckPopoverProvider, useDeckPopoverContext] = createContext("DeckPopover");
1306
+ var PopoverRoot = ({ children }) => {
1307
+ var _effect = _useSignals16();
1308
+ try {
1309
+ const layout = useCapability8(DeckCapabilities.MutableDeckState);
1310
+ const virtualRef = useRef3(null);
1311
+ const [virtualIter, setVirtualIter] = useState3(0);
1312
+ const [open, setOpen] = useState3(false);
1313
+ const debounceRef = useRef3(null);
1314
+ useEffect5(() => {
1315
+ setOpen(false);
1316
+ if (layout.popoverOpen) {
1317
+ if (debounceRef.current) {
1318
+ clearTimeout(debounceRef.current);
1319
+ }
1320
+ if (layout.popoverAnchor && virtualRef.current !== layout.popoverAnchor) {
1321
+ virtualRef.current = layout.popoverAnchor ?? null;
1322
+ setVirtualIter((iter) => iter + 1);
1323
+ }
1324
+ debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
1325
+ }
1326
+ }, [
1327
+ layout.popoverOpen,
1328
+ layout.popoverAnchorId,
1329
+ layout.popoverAnchor,
1330
+ layout.popoverContent
1331
+ ]);
1332
+ return /* @__PURE__ */ React16.createElement(DeckPopoverProvider, {
1333
+ setOpen
1334
+ }, /* @__PURE__ */ React16.createElement(Popover2.Root, {
1335
+ modal: false,
1336
+ open
1337
+ }, layout.popoverAnchor && /* @__PURE__ */ React16.createElement(Popover2.VirtualTrigger, {
1338
+ key: virtualIter,
1339
+ virtualRef
1340
+ }), children));
1341
+ } finally {
1342
+ _effect.f();
1343
+ }
1344
+ };
1345
+ var PopoverContent = () => {
1346
+ var _effect = _useSignals16();
1347
+ try {
1348
+ const layout = useCapability8(DeckCapabilities.MutableDeckState);
1349
+ const { setOpen } = useDeckPopoverContext("PopoverContent");
1350
+ const handleClose = useCallback7((event) => {
1351
+ if (
1352
+ // TODO(thure): CodeMirror should not focus itself when it updates.
1353
+ event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
1354
+ ) {
1355
+ event.preventDefault();
1356
+ } else {
1357
+ setOpen(false);
1358
+ layout.popoverOpen = false;
1359
+ layout.popoverAnchor = void 0;
1360
+ layout.popoverAnchorId = void 0;
1361
+ layout.popoverSide = void 0;
1362
+ }
1363
+ }, [
1364
+ setOpen
1365
+ ]);
1366
+ const collisionBoundaries = useMemo6(() => {
1367
+ const closest = layout.popoverAnchor?.closest("[data-popover-collision-boundary]");
1368
+ return closest ? [
1369
+ closest
1370
+ ] : [];
1371
+ }, [
1372
+ layout.popoverAnchor
1373
+ ]);
1374
+ return /* @__PURE__ */ React16.createElement(Popover2.Portal, null, /* @__PURE__ */ React16.createElement(Popover2.Content, {
1375
+ side: layout.popoverSide,
1376
+ onInteractOutside: handleClose,
1377
+ onEscapeKeyDown: handleClose,
1378
+ collisionBoundary: collisionBoundaries,
1379
+ sticky: "always",
1380
+ hideWhenDetached: true
1381
+ }, /* @__PURE__ */ React16.createElement(Popover2.Viewport, null, /* @__PURE__ */ React16.createElement(Surface10, {
1382
+ role: "card--popover",
1383
+ data: layout.popoverContent,
1384
+ limit: 1
1385
+ })), /* @__PURE__ */ React16.createElement(Popover2.Arrow, null)));
1386
+ } finally {
1387
+ _effect.f();
1388
+ }
1389
+ };
1390
+
1391
+ // src/components/DeckLayout/Toast.tsx
1392
+ import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
1393
+ import React17 from "react";
1394
+ import { Button, Icon as Icon2, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as useTranslation7 } from "@dxos/react-ui";
1395
+ var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange }) => {
1396
+ var _effect = _useSignals17();
1397
+ try {
1398
+ const { t } = useTranslation7(meta.id);
1399
+ return /* @__PURE__ */ React17.createElement(NaturalToast.Root, {
1400
+ "data-testid": id,
1401
+ defaultOpen: true,
1402
+ duration,
1403
+ onOpenChange
1404
+ }, /* @__PURE__ */ React17.createElement(NaturalToast.Body, null, /* @__PURE__ */ React17.createElement(NaturalToast.Title, {
1405
+ classNames: "items-center"
1406
+ }, icon && /* @__PURE__ */ React17.createElement(Icon2, {
1407
+ icon,
1408
+ size: 5,
1409
+ classNames: "inline mr-1"
1410
+ }), title && /* @__PURE__ */ React17.createElement("span", null, toLocalizedString3(title, t))), description && /* @__PURE__ */ React17.createElement(NaturalToast.Description, null, description && toLocalizedString3(description, t))), /* @__PURE__ */ React17.createElement(NaturalToast.Actions, null, onAction && actionAlt && actionLabel && /* @__PURE__ */ React17.createElement(NaturalToast.Action, {
1411
+ altText: toLocalizedString3(actionAlt, t),
1412
+ asChild: true
1413
+ }, /* @__PURE__ */ React17.createElement(Button, {
1414
+ "data-testid": "toast.action",
1415
+ variant: "primary",
1416
+ onClick: () => onAction?.()
1417
+ }, toLocalizedString3(actionLabel, t))), closeLabel && /* @__PURE__ */ React17.createElement(NaturalToast.Close, {
1418
+ asChild: true
1419
+ }, /* @__PURE__ */ React17.createElement(Button, {
1420
+ "data-testid": "toast.close"
1421
+ }, toLocalizedString3(closeLabel, t)))));
1422
+ } finally {
1423
+ _effect.f();
1424
+ }
1425
+ };
1426
+ var Toaster = ({ toasts, onDismissToast }) => {
1427
+ var _effect = _useSignals17();
1428
+ try {
1429
+ return /* @__PURE__ */ React17.createElement(React17.Fragment, null, toasts?.map((toast) => /* @__PURE__ */ React17.createElement(Toast, {
1417
1430
  ...toast,
1418
1431
  key: toast.id,
1419
1432
  onOpenChange: (open) => {
1420
1433
  if (!open) {
1421
- onDismissToast(toast.id);
1434
+ onDismissToast?.(toast.id);
1422
1435
  }
1423
1436
  return open;
1424
1437
  }
@@ -1428,60 +1441,80 @@ var DeckLayout = ({ onDismissToast }) => {
1428
1441
  }
1429
1442
  };
1430
1443
 
1444
+ // src/components/DeckLayout/DeckLayout.tsx
1445
+ var DeckLayout = ({ onDismissToast }) => {
1446
+ var _effect = _useSignals18();
1447
+ try {
1448
+ const context = useCapability9(DeckCapabilities.MutableDeckState);
1449
+ const { toasts } = context;
1450
+ return /* @__PURE__ */ React18.createElement(PopoverRoot, null, /* @__PURE__ */ React18.createElement(ActiveNode, null), /* @__PURE__ */ React18.createElement(DeckMain, null), /* @__PURE__ */ React18.createElement(PopoverContent, null), /* @__PURE__ */ React18.createElement(Dialog, null), /* @__PURE__ */ React18.createElement(Toaster, {
1451
+ toasts,
1452
+ onDismissToast
1453
+ }));
1454
+ } finally {
1455
+ _effect.f();
1456
+ }
1457
+ };
1458
+
1431
1459
  // src/components/DeckSettings/DeckSettings.tsx
1432
- import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
1433
- import React18 from "react";
1460
+ import { useSignals as _useSignals19 } from "@preact-signals/safe-react/tracking";
1461
+ import React19 from "react";
1434
1462
  import { Input, Select, useTranslation as useTranslation8 } from "@dxos/react-ui";
1435
1463
  import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from "@dxos/react-ui-form";
1436
1464
  var isSocket = !!globalThis.__args;
1437
1465
  var DeckSettings = ({ settings }) => {
1438
- var _effect = _useSignals18();
1466
+ var _effect = _useSignals19();
1439
1467
  try {
1440
- const { t } = useTranslation8(DECK_PLUGIN);
1441
- return /* @__PURE__ */ React18.createElement(ControlPage, null, /* @__PURE__ */ React18.createElement(ControlSection, {
1468
+ const { t } = useTranslation8(meta.id);
1469
+ return /* @__PURE__ */ React19.createElement(ControlPage, null, /* @__PURE__ */ React19.createElement(ControlSection, {
1442
1470
  title: t("settings title", {
1443
- ns: DECK_PLUGIN
1471
+ ns: meta.id
1444
1472
  })
1445
- }, /* @__PURE__ */ React18.createElement(ControlGroup, null, /* @__PURE__ */ React18.createElement(ControlItemInput, {
1473
+ }, /* @__PURE__ */ React19.createElement(ControlGroup, null, /* @__PURE__ */ React19.createElement(ControlItemInput, {
1446
1474
  title: t("settings enable deck label")
1447
- }, /* @__PURE__ */ React18.createElement(Input.Switch, {
1475
+ }, /* @__PURE__ */ React19.createElement(Input.Switch, {
1448
1476
  checked: settings.enableDeck,
1449
1477
  onCheckedChange: (checked) => settings.enableDeck = checked
1450
- })), /* @__PURE__ */ React18.createElement(ControlItemInput, {
1478
+ })), /* @__PURE__ */ React19.createElement(ControlItemInput, {
1479
+ title: t("settings encapsulated planks label")
1480
+ }, /* @__PURE__ */ React19.createElement(Input.Switch, {
1481
+ checked: settings.encapsulatedPlanks ?? false,
1482
+ onCheckedChange: (checked) => settings.encapsulatedPlanks = checked
1483
+ })), /* @__PURE__ */ React19.createElement(ControlItemInput, {
1451
1484
  title: t("select new plank positioning label")
1452
- }, /* @__PURE__ */ React18.createElement(Select.Root, {
1485
+ }, /* @__PURE__ */ React19.createElement(Select.Root, {
1453
1486
  disabled: !settings.enableDeck,
1454
1487
  value: settings.newPlankPositioning ?? "start",
1455
1488
  onValueChange: (value) => settings.newPlankPositioning = value
1456
- }, /* @__PURE__ */ React18.createElement(Select.TriggerButton, {
1489
+ }, /* @__PURE__ */ React19.createElement(Select.TriggerButton, {
1457
1490
  placeholder: t("select new plank positioning placeholder")
1458
- }), /* @__PURE__ */ React18.createElement(Select.Portal, null, /* @__PURE__ */ React18.createElement(Select.Content, null, /* @__PURE__ */ React18.createElement(Select.Viewport, null, NewPlankPositions.map((position) => /* @__PURE__ */ React18.createElement(Select.Option, {
1491
+ }), /* @__PURE__ */ React19.createElement(Select.Portal, null, /* @__PURE__ */ React19.createElement(Select.Content, null, /* @__PURE__ */ React19.createElement(Select.Viewport, null, NewPlankPositions.map((position) => /* @__PURE__ */ React19.createElement(Select.Option, {
1459
1492
  key: position,
1460
1493
  value: position
1461
- }, t(`settings new plank position ${position} label`)))), /* @__PURE__ */ React18.createElement(Select.Arrow, null))))), /* @__PURE__ */ React18.createElement(ControlItemInput, {
1494
+ }, t(`settings new plank position ${position} label`)))), /* @__PURE__ */ React19.createElement(Select.Arrow, null))))), /* @__PURE__ */ React19.createElement(ControlItemInput, {
1462
1495
  title: t("settings overscroll label")
1463
- }, /* @__PURE__ */ React18.createElement(Select.Root, {
1496
+ }, /* @__PURE__ */ React19.createElement(Select.Root, {
1464
1497
  disabled: !settings.enableDeck,
1465
1498
  value: settings.overscroll ?? "none",
1466
1499
  onValueChange: (value) => settings.overscroll = value
1467
- }, /* @__PURE__ */ React18.createElement(Select.TriggerButton, {
1500
+ }, /* @__PURE__ */ React19.createElement(Select.TriggerButton, {
1468
1501
  placeholder: t("select overscroll placeholder")
1469
- }), /* @__PURE__ */ React18.createElement(Select.Portal, null, /* @__PURE__ */ React18.createElement(Select.Content, null, /* @__PURE__ */ React18.createElement(Select.Viewport, null, OverscrollOptions.map((option) => /* @__PURE__ */ React18.createElement(Select.Option, {
1502
+ }), /* @__PURE__ */ React19.createElement(Select.Portal, null, /* @__PURE__ */ React19.createElement(Select.Content, null, /* @__PURE__ */ React19.createElement(Select.Viewport, null, OverscrollOptions.map((option) => /* @__PURE__ */ React19.createElement(Select.Option, {
1470
1503
  key: option,
1471
1504
  value: option
1472
- }, t(`settings overscroll ${option} label`)))), /* @__PURE__ */ React18.createElement(Select.Arrow, null))))), /* @__PURE__ */ React18.createElement(ControlItemInput, {
1505
+ }, t(`settings overscroll ${option} label`)))), /* @__PURE__ */ React19.createElement(Select.Arrow, null))))), /* @__PURE__ */ React19.createElement(ControlItemInput, {
1473
1506
  title: t("settings enable statusbar label")
1474
- }, /* @__PURE__ */ React18.createElement(Input.Switch, {
1507
+ }, /* @__PURE__ */ React19.createElement(Input.Switch, {
1475
1508
  checked: settings.enableStatusbar,
1476
1509
  onCheckedChange: (checked) => settings.enableStatusbar = checked
1477
- })), /* @__PURE__ */ React18.createElement(ControlItemInput, {
1510
+ })), /* @__PURE__ */ React19.createElement(ControlItemInput, {
1478
1511
  title: t("settings show hints label")
1479
- }, /* @__PURE__ */ React18.createElement(Input.Switch, {
1512
+ }, /* @__PURE__ */ React19.createElement(Input.Switch, {
1480
1513
  checked: settings.showHints,
1481
1514
  onCheckedChange: (checked) => settings.showHints = checked
1482
- })), !isSocket && /* @__PURE__ */ React18.createElement(ControlItemInput, {
1515
+ })), !isSocket && /* @__PURE__ */ React19.createElement(ControlItemInput, {
1483
1516
  title: t("settings native redirect label")
1484
- }, /* @__PURE__ */ React18.createElement(Input.Switch, {
1517
+ }, /* @__PURE__ */ React19.createElement(Input.Switch, {
1485
1518
  checked: settings.enableNativeRedirect,
1486
1519
  onCheckedChange: (checked) => settings.enableNativeRedirect = checked
1487
1520
  })))));
@@ -1495,4 +1528,4 @@ export {
1495
1528
  DeckLayout,
1496
1529
  DeckSettings
1497
1530
  };
1498
- //# sourceMappingURL=chunk-NU7H23SK.mjs.map
1531
+ //# sourceMappingURL=chunk-JQKOS2HB.mjs.map