@dxos/plugin-deck 0.8.2-main.f081794 → 0.8.2-main.fbd8ed0

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 (134) hide show
  1. package/dist/lib/browser/{app-graph-builder-VYZ4IWI3.mjs → app-graph-builder-R7COZ4A6.mjs} +16 -15
  2. package/dist/lib/browser/app-graph-builder-R7COZ4A6.mjs.map +7 -0
  3. package/dist/lib/browser/{check-app-scheme-SEYECDHI.mjs → check-app-scheme-7AXGR6UT.mjs} +2 -3
  4. package/dist/lib/browser/check-app-scheme-7AXGR6UT.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-3O2UZVBA.mjs +121 -0
  6. package/dist/lib/browser/chunk-3O2UZVBA.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-JAYQ5BTF.mjs +157 -0
  8. package/dist/lib/browser/chunk-JAYQ5BTF.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-VP6FCWFV.mjs → chunk-KIGMELV2.mjs} +257 -247
  10. package/dist/lib/browser/chunk-KIGMELV2.mjs.map +7 -0
  11. package/dist/lib/browser/{state-Z6UY2Z3M.mjs → chunk-OF5RIATN.mjs} +6 -4
  12. package/dist/lib/browser/chunk-OF5RIATN.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-TRFYUEBA.mjs +145 -0
  14. package/dist/lib/browser/chunk-TRFYUEBA.mjs.map +7 -0
  15. package/dist/lib/browser/index.mjs +4 -5
  16. package/dist/lib/browser/index.mjs.map +1 -1
  17. package/dist/lib/browser/{intent-resolver-6AK45PT5.mjs → intent-resolver-MAKOS57L.mjs} +86 -63
  18. package/dist/lib/browser/intent-resolver-MAKOS57L.mjs.map +7 -0
  19. package/dist/lib/browser/meta.json +1 -1
  20. package/dist/lib/browser/{react-root-KA2IL5RA.mjs → react-root-DGQVIHXP.mjs} +6 -6
  21. package/dist/lib/browser/{react-surface-LIPGYEYN.mjs → react-surface-PXBXIOPU.mjs} +6 -6
  22. package/dist/lib/browser/{settings-6NU7CF2B.mjs → settings-UBWJF7J7.mjs} +4 -4
  23. package/dist/lib/browser/{settings-6NU7CF2B.mjs.map → settings-UBWJF7J7.mjs.map} +3 -3
  24. package/dist/lib/browser/state-4WFB4SDO.mjs +10 -0
  25. package/dist/lib/browser/state-4WFB4SDO.mjs.map +7 -0
  26. package/dist/lib/browser/{tools-VDVQTJMD.mjs → tools-IVPIPTVA.mjs} +7 -7
  27. package/dist/lib/browser/tools-IVPIPTVA.mjs.map +7 -0
  28. package/dist/lib/browser/types.mjs +1 -1
  29. package/dist/lib/browser/{url-handler-3CARFXQK.mjs → url-handler-JSYGSVSB.mjs} +4 -4
  30. package/dist/lib/browser/url-handler-JSYGSVSB.mjs.map +7 -0
  31. package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -179
  32. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  33. package/dist/types/src/capabilities/check-app-scheme.d.ts +2 -2
  34. package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
  35. package/dist/types/src/capabilities/index.d.ts +5 -180
  36. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  37. package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
  38. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  39. package/dist/types/src/capabilities/state.d.ts +2 -2
  40. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  41. package/dist/types/src/capabilities/tools.d.ts.map +1 -1
  42. package/dist/types/src/capabilities/url-handler.d.ts +2 -2
  43. package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
  44. package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
  45. package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
  46. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  47. package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -1
  48. package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +1 -1
  49. package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
  50. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
  51. package/dist/types/src/components/Plank/Plank.d.ts +18 -5
  52. package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
  53. package/dist/types/src/components/Plank/Plank.stories.d.ts +3 -3
  54. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
  55. package/dist/types/src/components/Plank/PlankControls.d.ts +1 -0
  56. package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
  57. package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
  58. package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
  59. package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
  60. package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +1 -1
  61. package/dist/types/src/components/Sidebar/SidebarButton.d.ts +2 -1
  62. package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -1
  63. package/dist/types/src/hooks/index.d.ts +5 -1
  64. package/dist/types/src/hooks/index.d.ts.map +1 -1
  65. package/dist/types/src/hooks/useBreakpoints.d.ts.map +1 -0
  66. package/dist/types/src/hooks/useCompanions.d.ts.map +1 -0
  67. package/dist/types/src/hooks/useDeckCompanions.d.ts +13 -0
  68. package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -0
  69. package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -0
  70. package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
  71. package/dist/types/src/index.d.ts +1 -1
  72. package/dist/types/src/index.d.ts.map +1 -1
  73. package/dist/types/src/layout.d.ts.map +1 -1
  74. package/dist/types/src/types.d.ts +104 -104
  75. package/dist/types/src/types.d.ts.map +1 -1
  76. package/dist/types/src/util/index.d.ts +1 -4
  77. package/dist/types/src/util/index.d.ts.map +1 -1
  78. package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
  79. package/dist/types/src/util/overscroll.d.ts.map +1 -1
  80. package/dist/types/src/util/set-active.d.ts.map +1 -1
  81. package/dist/types/tsconfig.tsbuildinfo +1 -1
  82. package/package.json +36 -29
  83. package/src/capabilities/app-graph-builder.ts +120 -92
  84. package/src/capabilities/check-app-scheme.ts +3 -7
  85. package/src/capabilities/index.ts +1 -0
  86. package/src/capabilities/intent-resolver.ts +140 -114
  87. package/src/capabilities/settings.ts +2 -2
  88. package/src/capabilities/state.ts +4 -2
  89. package/src/capabilities/tools.ts +4 -3
  90. package/src/capabilities/url-handler.ts +4 -4
  91. package/src/components/DeckLayout/ContentEmpty.tsx +3 -2
  92. package/src/components/DeckLayout/DeckLayout.tsx +12 -10
  93. package/src/components/DeckLayout/Popover.tsx +71 -43
  94. package/src/components/Plank/Plank.stories.tsx +20 -8
  95. package/src/components/Plank/Plank.tsx +101 -66
  96. package/src/components/Plank/PlankControls.tsx +26 -30
  97. package/src/components/Plank/PlankError.tsx +2 -6
  98. package/src/components/Plank/PlankHeading.tsx +23 -8
  99. package/src/components/Sidebar/ComplementarySidebar.tsx +4 -35
  100. package/src/components/Sidebar/Sidebar.tsx +2 -1
  101. package/src/components/Sidebar/SidebarButton.tsx +30 -7
  102. package/src/components/fragments.ts +1 -1
  103. package/src/hooks/index.ts +5 -1
  104. package/src/{util → hooks}/useCompanions.ts +3 -3
  105. package/src/hooks/useDeckCompanions.ts +33 -0
  106. package/src/hooks/useNodeActionExpander.ts +3 -8
  107. package/src/index.ts +1 -1
  108. package/src/types.ts +72 -71
  109. package/src/util/index.ts +1 -4
  110. package/dist/lib/browser/app-graph-builder-VYZ4IWI3.mjs.map +0 -7
  111. package/dist/lib/browser/check-app-scheme-SEYECDHI.mjs.map +0 -7
  112. package/dist/lib/browser/chunk-4QSEGMY3.mjs +0 -24
  113. package/dist/lib/browser/chunk-4QSEGMY3.mjs.map +0 -7
  114. package/dist/lib/browser/chunk-6HJZL3WT.mjs +0 -118
  115. package/dist/lib/browser/chunk-6HJZL3WT.mjs.map +0 -7
  116. package/dist/lib/browser/chunk-FLOVGNYB.mjs +0 -81
  117. package/dist/lib/browser/chunk-FLOVGNYB.mjs.map +0 -7
  118. package/dist/lib/browser/chunk-VP6FCWFV.mjs.map +0 -7
  119. package/dist/lib/browser/chunk-ZMJMCN7O.mjs +0 -157
  120. package/dist/lib/browser/chunk-ZMJMCN7O.mjs.map +0 -7
  121. package/dist/lib/browser/intent-resolver-6AK45PT5.mjs.map +0 -7
  122. package/dist/lib/browser/state-Z6UY2Z3M.mjs.map +0 -7
  123. package/dist/lib/browser/tools-VDVQTJMD.mjs.map +0 -7
  124. package/dist/lib/browser/url-handler-3CARFXQK.mjs.map +0 -7
  125. package/dist/types/src/util/useBreakpoints.d.ts.map +0 -1
  126. package/dist/types/src/util/useCompanions.d.ts.map +0 -1
  127. package/dist/types/src/util/useHoistStatusbar.d.ts.map +0 -1
  128. /package/dist/lib/browser/{react-root-KA2IL5RA.mjs.map → react-root-DGQVIHXP.mjs.map} +0 -0
  129. /package/dist/lib/browser/{react-surface-LIPGYEYN.mjs.map → react-surface-PXBXIOPU.mjs.map} +0 -0
  130. /package/dist/types/src/{util → hooks}/useBreakpoints.d.ts +0 -0
  131. /package/dist/types/src/{util → hooks}/useCompanions.d.ts +0 -0
  132. /package/dist/types/src/{util → hooks}/useHoistStatusbar.d.ts +0 -0
  133. /package/src/{util → hooks}/useBreakpoints.ts +0 -0
  134. /package/src/{util → hooks}/useHoistStatusbar.ts +0 -0
@@ -1,25 +1,27 @@
1
1
  import {
2
- parseEntryId
3
- } from "./chunk-FLOVGNYB.mjs";
2
+ getCompanionId,
3
+ useBreakpoints,
4
+ useCompanions,
5
+ useDeckCompanions,
6
+ useHoistStatusbar,
7
+ useMainSize,
8
+ useNodeActionExpander
9
+ } from "./chunk-3O2UZVBA.mjs";
4
10
  import {
5
11
  calculateOverscroll,
6
12
  layoutAppliesTopbar,
7
- useBreakpoints,
8
- useCompanions,
9
- useHoistStatusbar
10
- } from "./chunk-6HJZL3WT.mjs";
13
+ parseEntryId
14
+ } from "./chunk-TRFYUEBA.mjs";
11
15
  import {
12
16
  DeckCapabilities
13
17
  } from "./chunk-XMCG42ID.mjs";
14
18
  import {
15
- ATTENDABLE_PATH_SEPARATOR,
16
- DECK_COMPANION_TYPE,
17
19
  DeckAction,
18
20
  NewPlankPositions,
19
21
  OverscrollOptions,
20
22
  PLANK_COMPANION_TYPE,
21
23
  getMode
22
- } from "./chunk-ZMJMCN7O.mjs";
24
+ } from "./chunk-JAYQ5BTF.mjs";
23
25
  import {
24
26
  DECK_PLUGIN
25
27
  } from "./chunk-NSATFAEE.mjs";
@@ -31,15 +33,14 @@ import { useTranslation as useTranslation6 } from "@dxos/react-ui";
31
33
  import { mx as mx4 } from "@dxos/react-ui-theme";
32
34
 
33
35
  // packages/plugins/plugin-deck/src/components/Sidebar/ComplementarySidebar.tsx
34
- import React7, { Fragment as Fragment3, useCallback as useCallback4, useEffect as useEffect4, useMemo as useMemo3, useState as useState2 } from "react";
35
- import { LayoutAction as LayoutAction3, Surface as Surface3, createIntent as createIntent4, useAppGraph as useAppGraph3, useCapability as useCapability3, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
36
- import { Main, useTranslation as useTranslation5, toLocalizedString as toLocalizedString2, IconButton as IconButton3 } from "@dxos/react-ui";
36
+ import React7, { Fragment as Fragment2, useCallback as useCallback5, useEffect as useEffect3, useMemo as useMemo3, useState as useState2 } from "react";
37
+ import { LayoutAction as LayoutAction4, Surface as Surface3, createIntent as createIntent5, useCapability as useCapability3, useIntentDispatcher as useIntentDispatcher5 } from "@dxos/app-framework";
38
+ import { Main, useTranslation as useTranslation5, toLocalizedString as toLocalizedString2, IconButton as IconButton4 } from "@dxos/react-ui";
37
39
  import { Tabs } from "@dxos/react-ui-tabs";
38
- import { byPosition } from "@dxos/util";
39
40
 
40
41
  // packages/plugins/plugin-deck/src/components/Sidebar/SidebarButton.tsx
41
- import React from "react";
42
- import { useCapability } from "@dxos/app-framework";
42
+ import React, { useCallback } from "react";
43
+ import { createIntent, LayoutAction, useCapability, useIntentDispatcher } from "@dxos/app-framework";
43
44
  import { IconButton, useTranslation } from "@dxos/react-ui";
44
45
  var ToggleSidebarButton = ({ classNames, variant = "ghost" }) => {
45
46
  const layoutContext = useCapability(DeckCapabilities.MutableDeckState);
@@ -67,12 +68,30 @@ var CloseSidebarButton = () => {
67
68
  classNames: "rounded-none pli-1 dx-focus-ring-inset pie-[max(.5rem,env(safe-area-inset-left))]"
68
69
  });
69
70
  };
70
- var ToggleComplementarySidebarButton = ({ inR0, classNames }) => {
71
+ var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
72
+ const { dispatchPromise: dispatch } = useIntentDispatcher();
71
73
  const layoutContext = useCapability(DeckCapabilities.MutableDeckState);
72
74
  const { t } = useTranslation(DECK_PLUGIN);
75
+ const companions = useDeckCompanions();
76
+ const handleClick = useCallback(async () => {
77
+ layoutContext.complementarySidebarState = layoutContext.complementarySidebarState === "expanded" ? "collapsed" : "expanded";
78
+ const firstCompanion = companions[0];
79
+ if (layoutContext.complementarySidebarState === "expanded" && !current && firstCompanion) {
80
+ await dispatch(createIntent(LayoutAction.UpdateComplementary, {
81
+ part: "complementary",
82
+ subject: getCompanionId(firstCompanion.id)
83
+ }));
84
+ }
85
+ }, [
86
+ layoutContext,
87
+ current,
88
+ companions,
89
+ dispatch
90
+ ]);
73
91
  return /* @__PURE__ */ React.createElement(IconButton, {
92
+ noTooltip: true,
74
93
  iconOnly: true,
75
- onClick: () => layoutContext.complementarySidebarState = layoutContext.complementarySidebarState === "expanded" ? "collapsed" : "expanded",
94
+ onClick: handleClick,
76
95
  variant: "ghost",
77
96
  label: t("open complementary sidebar label"),
78
97
  classNames: [
@@ -86,62 +105,59 @@ var ToggleComplementarySidebarButton = ({ inR0, classNames }) => {
86
105
  };
87
106
 
88
107
  // packages/plugins/plugin-deck/src/components/Plank/Plank.tsx
89
- import React6, { Fragment as Fragment2, memo as memo2, useCallback as useCallback3, useLayoutEffect, useMemo as useMemo2, useRef } from "react";
90
- import { LayoutAction as LayoutAction2, Surface as Surface2, createIntent as createIntent3, useCapability as useCapability2, useAppGraph as useAppGraph2, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
108
+ import React6, { memo as memo2, useCallback as useCallback4, useLayoutEffect, useMemo as useMemo2, useRef } from "react";
109
+ import { LayoutAction as LayoutAction3, Surface as Surface2, createIntent as createIntent4, useCapability as useCapability2, useAppGraph as useAppGraph2, useIntentDispatcher as useIntentDispatcher4 } from "@dxos/app-framework";
91
110
  import { debounce } from "@dxos/async";
92
111
  import { useNode } from "@dxos/plugin-graph";
93
- import { ATTENDABLE_PATH_SEPARATOR as ATTENDABLE_PATH_SEPARATOR2, useAttendableAttributes } from "@dxos/react-ui-attention";
112
+ import { ATTENDABLE_PATH_SEPARATOR, useAttendableAttributes } from "@dxos/react-ui-attention";
94
113
  import { StackItem as StackItem2, railGridHorizontal } from "@dxos/react-ui-stack";
95
114
  import { mainIntrinsicSize, mx as mx3 } from "@dxos/react-ui-theme";
96
115
 
97
116
  // packages/plugins/plugin-deck/src/components/Plank/PlankError.tsx
98
117
  import React5, { useEffect as useEffect2, useState } from "react";
99
118
  import { useTranslation as useTranslation4 } from "@dxos/react-ui";
100
- import { descriptionText, mx as mx2 } from "@dxos/react-ui-theme";
119
+ import { descriptionMessage, mx as mx2 } from "@dxos/react-ui-theme";
101
120
 
102
121
  // packages/plugins/plugin-deck/src/components/Plank/PlankHeading.tsx
103
- import React3, { Fragment, memo, useCallback as useCallback2, useEffect, useMemo } from "react";
104
- import { createIntent as createIntent2, LayoutAction, Surface, useAppGraph, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
105
- import { Icon as Icon2, IconButton as IconButton2, Popover, toLocalizedString, useTranslation as useTranslation3 } from "@dxos/react-ui";
122
+ import React3, { Fragment, memo, useCallback as useCallback3, useEffect, useMemo } from "react";
123
+ import { createIntent as createIntent3, LayoutAction as LayoutAction2, Surface, useAppGraph, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
124
+ import { Icon, IconButton as IconButton3, Popover, toLocalizedString, useTranslation as useTranslation3 } from "@dxos/react-ui";
106
125
  import { StackItem } from "@dxos/react-ui-stack";
107
126
  import { TextTooltip } from "@dxos/react-ui-text-tooltip";
127
+ import { hoverableControls, hoverableFocusedWithinControls } from "@dxos/react-ui-theme";
108
128
 
109
129
  // packages/plugins/plugin-deck/src/components/Plank/PlankControls.tsx
110
- import React2, { forwardRef, useCallback } from "react";
111
- import { createIntent, useIntentDispatcher } from "@dxos/app-framework";
130
+ import React2, { forwardRef, useCallback as useCallback2 } from "react";
131
+ import { createIntent as createIntent2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
112
132
  import { invariant } from "@dxos/invariant";
113
- import { Button, ButtonGroup, Icon, Tooltip, useTranslation as useTranslation2 } from "@dxos/react-ui";
133
+ import { ButtonGroup, IconButton as IconButton2, useTranslation as useTranslation2 } from "@dxos/react-ui";
114
134
  var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-deck/src/components/Plank/PlankControls.tsx";
115
135
  var PlankControl = ({ icon, label: label3, ...props }) => {
116
- return /* @__PURE__ */ React2.createElement(Tooltip.Root, null, /* @__PURE__ */ React2.createElement(Tooltip.Trigger, {
117
- asChild: true
118
- }, /* @__PURE__ */ React2.createElement(Button, {
136
+ return /* @__PURE__ */ React2.createElement(IconButton2, {
137
+ iconOnly: true,
138
+ label: label3,
139
+ icon,
140
+ size: 5,
119
141
  variant: "ghost",
142
+ tooltipSide: "bottom",
120
143
  ...props
121
- }, /* @__PURE__ */ React2.createElement("span", {
122
- className: "sr-only"
123
- }, label3), /* @__PURE__ */ React2.createElement(Icon, {
124
- icon,
125
- size: 5
126
- }))), /* @__PURE__ */ React2.createElement(Tooltip.Portal, null, /* @__PURE__ */ React2.createElement(Tooltip.Content, {
127
- side: "bottom"
128
- }, label3)));
144
+ });
129
145
  };
130
- var plankControlSpacing = "pli-2 plb-3";
146
+ var plankControlSpacing = "pli-2";
131
147
  var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedRef) => {
132
148
  const { t } = useTranslation2(DECK_PLUGIN);
133
- const { dispatchPromise: dispatch } = useIntentDispatcher();
134
- const handleCloseCompanion = useCallback(() => {
149
+ const { dispatchPromise: dispatch } = useIntentDispatcher2();
150
+ const handleCloseCompanion = useCallback2(() => {
135
151
  invariant(primary, void 0, {
136
152
  F: __dxlog_file,
137
- L: 68,
153
+ L: 49,
138
154
  S: void 0,
139
155
  A: [
140
156
  "primary",
141
157
  ""
142
158
  ]
143
159
  });
144
- return dispatch(createIntent(DeckAction.ChangeCompanion, {
160
+ return dispatch(createIntent2(DeckAction.ChangeCompanion, {
145
161
  primary,
146
162
  companion: null
147
163
  }));
@@ -152,7 +168,7 @@ var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedR
152
168
  }, /* @__PURE__ */ React2.createElement(PlankControl, {
153
169
  label: t("close companion label"),
154
170
  variant: "ghost",
155
- icon: "ph--caret-left--regular",
171
+ icon: "ph--x--regular",
156
172
  onClick: handleCloseCompanion,
157
173
  classNames: plankControlSpacing
158
174
  }));
@@ -164,19 +180,19 @@ var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant
164
180
  return /* @__PURE__ */ React2.createElement(ButtonGroup, {
165
181
  ...props,
166
182
  classNames: [
167
- "app-no-drag",
183
+ "app-no-drag !opacity-100",
168
184
  classNames
169
185
  ],
170
186
  ref: forwardedRef
171
- }, capabilities.deck && /* @__PURE__ */ React2.createElement(React2.Fragment, null, capabilities.solo && /* @__PURE__ */ React2.createElement(React2.Fragment, null, layoutMode === "solo" && /* @__PURE__ */ React2.createElement(PlankControl, {
187
+ }, capabilities.deck ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, capabilities.solo && /* @__PURE__ */ React2.createElement(React2.Fragment, null, layoutMode === "solo" && /* @__PURE__ */ React2.createElement(PlankControl, {
172
188
  label: t("show fullscreen plank label"),
173
189
  classNames: buttonClassNames,
174
190
  icon: "ph--corners-out--regular",
175
191
  onClick: () => onClick?.("solo--fullscreen")
176
192
  }), /* @__PURE__ */ React2.createElement(PlankControl, {
177
- label: t(layoutMode === "solo--fullscreen" ? "exit fullscreen label" : !layoutIsAnySolo ? "show solo plank label" : "show deck plank label"),
193
+ label: t(layoutMode === "solo--fullscreen" ? "exit fullscreen label" : layoutIsAnySolo ? "show deck plank label" : "show solo plank label"),
178
194
  classNames: buttonClassNames,
179
- icon: layoutIsAnySolo ? "ph--corners-in--regular" : "ph--corners-out--regular",
195
+ icon: layoutMode === "solo--fullscreen" ? "ph--corners-in--regular" : layoutIsAnySolo ? "ph--arrows-in-line-horizontal--regular" : "ph--arrows-out-line-horizontal--regular",
180
196
  onClick: () => onClick?.(layoutMode === "solo--fullscreen" ? "solo--fullscreen" : "solo")
181
197
  })), !layoutIsAnySolo && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(PlankControl, {
182
198
  label: t("increment start label"),
@@ -190,7 +206,12 @@ var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant
190
206
  classNames: buttonClassNames,
191
207
  icon: "ph--caret-right--regular",
192
208
  onClick: () => onClick?.("increment-end")
193
- }))), close && !layoutIsAnySolo && /* @__PURE__ */ React2.createElement(PlankControl, {
209
+ }))) : capabilities.fullscreen && /* @__PURE__ */ React2.createElement(PlankControl, {
210
+ label: t(layoutMode === "solo--fullscreen" ? "exit fullscreen label" : "show fullscreen plank label"),
211
+ classNames: buttonClassNames,
212
+ icon: layoutMode === "solo--fullscreen" ? "ph--corners-in--regular" : "ph--corners-out--regular",
213
+ onClick: () => onClick?.("solo--fullscreen")
214
+ }), close && !layoutIsAnySolo && /* @__PURE__ */ React2.createElement(PlankControl, {
194
215
  label: t(`${typeof close === "string" ? "minify" : "close"} label`),
195
216
  classNames: buttonClassNames,
196
217
  "data-testid": "plankHeading.close",
@@ -208,14 +229,15 @@ var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant
208
229
  // packages/plugins/plugin-deck/src/components/fragments.ts
209
230
  import { mx } from "@dxos/react-ui-theme";
210
231
  var soloInlinePadding = "pis-[calc(env(safe-area-inset-left)+.25rem)] pie-[calc(env(safe-area-inset-left)+.25rem)]";
211
- var sidebarToggleStyles = "bs-[--rail-item] is-[--rail-item] absolute block-end-2 z-[1] !bg-deck lg:hidden";
232
+ var sidebarToggleStyles = "bs-[--rail-item] is-[--rail-item] absolute block-end-2 z-[1] !bg-deckSurface lg:hidden";
212
233
  var fixedSidebarToggleStyles = mx(sidebarToggleStyles, "inline-start-2");
213
234
  var fixedComplementarySidebarToggleStyles = mx(sidebarToggleStyles, "inline-end-2");
214
235
 
215
236
  // packages/plugins/plugin-deck/src/components/Plank/PlankHeading.tsx
237
+ var MAX_COMPANIONS = 5;
216
238
  var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncrementStart, canIncrementEnd, popoverAnchorId, primaryId, pending, companioned, companions, layoutMode, actions = [] }) => {
217
239
  const { t } = useTranslation3(DECK_PLUGIN);
218
- const { dispatchPromise: dispatch } = useIntentDispatcher2();
240
+ const { dispatchPromise: dispatch } = useIntentDispatcher3();
219
241
  const { graph } = useAppGraph();
220
242
  const breakpoint = useBreakpoints();
221
243
  const icon = node?.properties?.icon ?? "ph--placeholder--regular";
@@ -228,7 +250,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
228
250
  const isCompanionNode = node?.type === PLANK_COMPANION_TYPE;
229
251
  useEffect(() => {
230
252
  const frame = requestAnimationFrame(() => {
231
- node && graph.actions(node);
253
+ node && graph.expand(node.id);
232
254
  });
233
255
  return () => cancelAnimationFrame(frame);
234
256
  }, [
@@ -240,6 +262,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
240
262
  solo: breakpoint !== "mobile" && (part === "solo" || part === "deck"),
241
263
  incrementStart: canIncrementStart,
242
264
  incrementEnd: canIncrementEnd,
265
+ fullscreen: !isCompanionNode,
243
266
  companion: !isCompanionNode && companions && companions.length > 0
244
267
  }), [
245
268
  breakpoint,
@@ -259,7 +282,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
259
282
  } else {
260
283
  return [
261
284
  actions,
262
- graph.actions(node)
285
+ graph.getActions(node.id)
263
286
  ].filter((a) => a.length > 0);
264
287
  }
265
288
  }, [
@@ -268,28 +291,30 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
268
291
  variant,
269
292
  graph
270
293
  ]);
271
- const handleAction = useCallback2((action) => {
294
+ const handleAction = useCallback3((action) => {
272
295
  typeof action.data === "function" && action.data?.({
273
- node: action,
296
+ parent: node,
274
297
  caller: DECK_PLUGIN
275
298
  });
276
- }, []);
277
- const handlePlankAction = useCallback2((eventType) => {
299
+ }, [
300
+ node
301
+ ]);
302
+ const handlePlankAction = useCallback3((eventType) => {
278
303
  if (eventType.startsWith("solo")) {
279
- return dispatch(createIntent2(DeckAction.Adjust, {
304
+ return dispatch(createIntent3(DeckAction.Adjust, {
280
305
  type: eventType,
281
306
  id
282
307
  }));
283
308
  } else if (eventType === "close") {
284
309
  if (part === "complementary") {
285
- return dispatch(createIntent2(LayoutAction.UpdateComplementary, {
310
+ return dispatch(createIntent3(LayoutAction2.UpdateComplementary, {
286
311
  part: "complementary",
287
312
  options: {
288
313
  state: "collapsed"
289
314
  }
290
315
  }));
291
316
  } else {
292
- return dispatch(createIntent2(LayoutAction.Close, {
317
+ return dispatch(createIntent3(LayoutAction2.Close, {
293
318
  part: "main",
294
319
  subject: [
295
320
  id
@@ -300,7 +325,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
300
325
  }));
301
326
  }
302
327
  } else {
303
- return dispatch(createIntent2(DeckAction.Adjust, {
328
+ return dispatch(createIntent3(DeckAction.Adjust, {
304
329
  type: eventType,
305
330
  id
306
331
  }));
@@ -311,11 +336,11 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
311
336
  part
312
337
  ]);
313
338
  const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${DECK_PLUGIN}/${node.id}` ? Popover.Anchor : Fragment;
314
- const handleTabClick = useCallback2((event) => {
339
+ const handleTabClick = useCallback3((event) => {
315
340
  const target = event.target.closest("[data-id]");
316
341
  const tabId = target?.dataset?.id;
317
342
  if (primaryId && tabId) {
318
- void dispatch(createIntent2(DeckAction.ChangeCompanion, {
343
+ void dispatch(createIntent3(DeckAction.ChangeCompanion, {
319
344
  primary: primaryId,
320
345
  companion: tabId
321
346
  }));
@@ -326,16 +351,22 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
326
351
  return /* @__PURE__ */ React3.createElement(StackItem.Heading, {
327
352
  classNames: [
328
353
  "plb-1 border-be border-separator items-stretch gap-1 sticky inline-start-12 app-drag min-is-0 contain-layout",
329
- part === "solo" ? soloInlinePadding : "pli-1"
330
- ]
354
+ part === "solo" ? soloInlinePadding : "pli-1",
355
+ ...layoutMode === "solo--fullscreen" ? [
356
+ hoverableControls,
357
+ hoverableFocusedWithinControls,
358
+ "[&>*]:transition-opacity [&>*]:opacity-[--controls-opacity] bg-transparent border-transparent transition-[background-color,border-color] hover-hover:hover:bg-headerSurface focus-within:bg-headerSurface hover-hover:hover:border-separator focus-within:border-separator"
359
+ ] : []
360
+ ],
361
+ "data-plank-heading": true
331
362
  }, companions && isCompanionNode ? /* @__PURE__ */ React3.createElement("div", {
332
363
  role: "none",
333
364
  className: "flex-1 min-is-0 overflow-x-auto scrollbar-thin flex gap-1"
334
- }, companions.map(({ id: id2, properties: { icon: icon2, label: label4 } }) => /* @__PURE__ */ React3.createElement(IconButton2, {
365
+ }, companions.map(({ id: id2, properties: { icon: icon2, label: label4 } }) => /* @__PURE__ */ React3.createElement(IconButton3, {
335
366
  key: id2,
336
367
  "data-id": id2,
337
368
  icon: icon2,
338
- iconOnly: node?.id !== id2,
369
+ iconOnly: companions.length > MAX_COMPANIONS && node?.id !== id2,
339
370
  label: toLocalizedString(label4, t),
340
371
  size: 5,
341
372
  variant: node?.id === id2 ? "primary" : "default",
@@ -354,7 +385,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
354
385
  }
355
386
  })) : /* @__PURE__ */ React3.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React3.createElement("span", {
356
387
  className: "sr-only"
357
- }, label3), /* @__PURE__ */ React3.createElement(Icon2, {
388
+ }, label3), /* @__PURE__ */ React3.createElement(Icon, {
358
389
  icon,
359
390
  size: 5
360
391
  }))), /* @__PURE__ */ React3.createElement(TextTooltip, {
@@ -399,7 +430,7 @@ var PlankContentError = ({ error }) => {
399
430
  className: "overflow-auto p-8 attention-surface grid place-items-center"
400
431
  }, /* @__PURE__ */ React5.createElement("p", {
401
432
  role: "alert",
402
- className: mx2(descriptionText, "break-words border border-dashed border-separator rounded-lg p-8", errorString.length < 256 && "text-lg")
433
+ className: mx2(descriptionMessage, "break-words rounded-lg p-8", errorString.length < 256 && "text-lg")
403
434
  }, error ? errorString : t("error fallback message")));
404
435
  };
405
436
  var PlankError = ({ id, part, node, error }) => {
@@ -417,55 +448,66 @@ var PlankError = ({ id, part, node, error }) => {
417
448
  }) : /* @__PURE__ */ React5.createElement(PlankLoading, null));
418
449
  };
419
450
 
420
- // packages/plugins/plugin-deck/src/hooks/useNodeActionExpander.ts
421
- import { useEffect as useEffect3 } from "react";
422
- import { ACTION_GROUP_TYPE, ACTION_TYPE, getGraph } from "@dxos/plugin-graph";
423
- var expandNodeActions = async (node) => {
424
- const graph = getGraph(node);
425
- await graph.expand(node, "outbound", ACTION_GROUP_TYPE);
426
- await graph.expand(node, "outbound", ACTION_TYPE);
427
- };
428
- var useNodeActionExpander = (node) => {
429
- useEffect3(() => {
430
- if (node) {
431
- const frame = requestAnimationFrame(() => {
432
- void expandNodeActions(node);
433
- });
434
- return () => cancelAnimationFrame(frame);
435
- }
436
- }, [
437
- node
438
- ]);
439
- };
440
-
441
- // packages/plugins/plugin-deck/src/hooks/useMainSize.ts
442
- import { useMainContext } from "@dxos/react-ui";
443
- var useMainSize = () => {
444
- const { navigationSidebarState, complementarySidebarState } = useMainContext("DeckPluginPlank");
445
- return {
446
- "data-sidebar-inline-start-state": navigationSidebarState,
447
- "data-sidebar-inline-end-state": complementarySidebarState
448
- };
449
- };
450
-
451
451
  // packages/plugins/plugin-deck/src/components/Plank/Plank.tsx
452
452
  var UNKNOWN_ID = "unknown_id";
453
- var PlankImpl = /* @__PURE__ */ memo2(({ id, node, part, path, order, active, layoutMode, companioned, primary, companions, settings }) => {
454
- const { dispatchPromise: dispatch } = useIntentDispatcher3();
453
+ var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, companionId, ...props }) => {
454
+ const { graph } = useAppGraph2();
455
+ const node = useNode(graph, id);
456
+ const companions = useCompanions(id);
457
+ const currentCompanion = companions.find(({ id: id2 }) => id2 === companionId);
458
+ const hasCompanion = !!(companionId && currentCompanion);
459
+ return /* @__PURE__ */ React6.createElement(PlankContainer, {
460
+ solo: props.part === "solo",
461
+ companion: hasCompanion
462
+ }, /* @__PURE__ */ React6.createElement(PlankComponent, {
463
+ id,
464
+ node,
465
+ companioned: hasCompanion ? "primary" : void 0,
466
+ companions: hasCompanion ? [] : companions,
467
+ ...props,
468
+ ...props.part === "solo" ? {
469
+ part: "solo-primary"
470
+ } : {}
471
+ }), hasCompanion && /* @__PURE__ */ React6.createElement(PlankComponent, {
472
+ id: companionId,
473
+ node: currentCompanion,
474
+ primary: node,
475
+ companions,
476
+ companioned: "companion",
477
+ ...props,
478
+ ...props.part === "solo" ? {
479
+ part: "solo-companion"
480
+ } : {
481
+ order: (props.order ?? 0) + 1
482
+ }
483
+ }));
484
+ });
485
+ var PlankContainer = ({ children, solo, companion }) => {
486
+ const sizeAttrs = useMainSize();
487
+ if (!solo) {
488
+ return children;
489
+ }
490
+ return /* @__PURE__ */ React6.createElement("div", {
491
+ role: "none",
492
+ className: mx3("absolute inset-0 grid", companion && "grid-cols-[1fr_1fr]", railGridHorizontal, mainIntrinsicSize),
493
+ ...sizeAttrs
494
+ }, children);
495
+ };
496
+ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order, active, companioned, node, primary, companions, settings }) => {
497
+ const { dispatchPromise: dispatch } = useIntentDispatcher4();
455
498
  const { deck, popoverAnchorId, scrollIntoView } = useCapability2(DeckCapabilities.DeckState);
456
- const rootElement = useRef(null);
457
499
  const canResize = layoutMode === "deck";
458
- const Root = part.startsWith("solo") ? "article" : StackItem2.Root;
459
500
  const attendableAttrs = useAttendableAttributes(primary?.id ?? id);
460
501
  const index = active ? active.findIndex((entryId) => entryId === id) : 0;
461
502
  const length = active?.length ?? 1;
462
503
  const canIncrementStart = active && index !== void 0 && index > 0 && length !== void 0 && length > 1;
463
504
  const canIncrementEnd = active && index !== void 0 && index < length - 1 && length !== void 0;
505
+ const rootElement = useRef(null);
464
506
  const { variant } = parseEntryId(id);
465
- const sizeKey = `${id.split("+")[0]}${variant ? `${ATTENDABLE_PATH_SEPARATOR2}${variant}` : ""}`;
507
+ const sizeKey = `${id.split("+")[0]}${variant ? `${ATTENDABLE_PATH_SEPARATOR}${variant}` : ""}`;
466
508
  const size = deck.plankSizing[sizeKey];
467
- const setSize = useCallback3(debounce((nextSize) => {
468
- return dispatch(createIntent3(DeckAction.UpdatePlankSize, {
509
+ const handleSizeChange = useCallback4(debounce((nextSize) => {
510
+ return dispatch(createIntent4(DeckAction.UpdatePlankSize, {
469
511
  id: sizeKey,
470
512
  size: nextSize
471
513
  }));
@@ -473,7 +515,7 @@ var PlankImpl = /* @__PURE__ */ memo2(({ id, node, part, path, order, active, la
473
515
  dispatch,
474
516
  sizeKey
475
517
  ]);
476
- const handleKeyDown = useCallback3((event) => {
518
+ const handleKeyDown = useCallback4((event) => {
477
519
  if (event.target === event.currentTarget && event.key === "Escape") {
478
520
  rootElement.current?.closest("main")?.focus();
479
521
  }
@@ -488,7 +530,7 @@ var PlankImpl = /* @__PURE__ */ memo2(({ id, node, part, path, order, active, la
488
530
  behavior: "smooth",
489
531
  inline: "center"
490
532
  });
491
- void dispatch(createIntent3(LayoutAction2.ScrollIntoView, {
533
+ void dispatch(createIntent4(LayoutAction3.ScrollIntoView, {
492
534
  part: "current",
493
535
  subject: void 0
494
536
  }));
@@ -512,9 +554,11 @@ var PlankImpl = /* @__PURE__ */ memo2(({ id, node, part, path, order, active, la
512
554
  node?.data,
513
555
  path,
514
556
  popoverAnchorId,
515
- primary?.data
557
+ primary?.data,
558
+ variant
516
559
  ]);
517
560
  const placeholder = useMemo2(() => /* @__PURE__ */ React6.createElement(PlankLoading, null), []);
561
+ const Root = part.startsWith("solo") ? "article" : StackItem2.Root;
518
562
  const className = mx3("attention-surface relative", isSolo && mainIntrinsicSize, isSolo && railGridHorizontal, isSolo && "absolute inset-0", part.startsWith("solo") && "grid", part === "deck" && (companioned === "companion" ? "!border-separator border-ie" : "!border-separator border-li"), part.startsWith("solo-") && "row-span-2 grid-rows-subgrid min-is-0", part === "solo-companion" && "!border-separator border-is");
519
563
  return /* @__PURE__ */ React6.createElement(Root, {
520
564
  ref: rootElement,
@@ -528,7 +572,7 @@ var PlankImpl = /* @__PURE__ */ memo2(({ id, node, part, path, order, active, la
528
572
  id
529
573
  },
530
574
  size,
531
- onSizeChange: setSize,
575
+ onSizeChange: handleSizeChange,
532
576
  classNames: className,
533
577
  order,
534
578
  role: "article"
@@ -559,51 +603,6 @@ var PlankImpl = /* @__PURE__ */ memo2(({ id, node, part, path, order, active, la
559
603
  part
560
604
  }), canResize && /* @__PURE__ */ React6.createElement(StackItem2.ResizeHandle, null));
561
605
  });
562
- var SplitFrame = ({ children }) => {
563
- const sizeAttrs = useMainSize();
564
- return /* @__PURE__ */ React6.createElement("div", {
565
- role: "none",
566
- className: mx3("grid grid-cols-[1fr_1fr] absolute inset-0", railGridHorizontal, mainIntrinsicSize),
567
- ...sizeAttrs
568
- }, children);
569
- };
570
- var Plank = ({ id = UNKNOWN_ID, ...props }) => {
571
- const { graph } = useAppGraph2();
572
- const node = useNode(graph, id);
573
- const companions = useCompanions(id);
574
- const currentCompanion = companions.find(({ id: id2 }) => id2 === props.companionId);
575
- if (props.companionId) {
576
- const Root = props.part === "solo" ? SplitFrame : Fragment2;
577
- return /* @__PURE__ */ React6.createElement(Root, null, /* @__PURE__ */ React6.createElement(PlankImpl, {
578
- id,
579
- node,
580
- companioned: "primary",
581
- ...props,
582
- ...props.part === "solo" ? {
583
- part: "solo-primary"
584
- } : {}
585
- }), /* @__PURE__ */ React6.createElement(PlankImpl, {
586
- id: props.companionId,
587
- node: currentCompanion,
588
- companioned: "companion",
589
- primary: node,
590
- companions,
591
- ...props,
592
- ...props.part === "solo" ? {
593
- part: "solo-companion"
594
- } : {
595
- order: props.order + 1
596
- }
597
- }));
598
- } else {
599
- return /* @__PURE__ */ React6.createElement(PlankImpl, {
600
- id,
601
- node,
602
- companions,
603
- ...props
604
- });
605
- }
606
- };
607
606
 
608
607
  // packages/plugins/plugin-deck/src/components/Sidebar/ComplementarySidebar.tsx
609
608
  var label = [
@@ -612,20 +611,9 @@ var label = [
612
611
  ns: DECK_PLUGIN
613
612
  }
614
613
  ];
615
- var getCompanionId = (id) => {
616
- const [_, companionId] = id.split(ATTENDABLE_PATH_SEPARATOR);
617
- return companionId ?? "never";
618
- };
619
- var useDeckCompanions = () => {
620
- const { graph } = useAppGraph3();
621
- const companions = graph.nodes(graph.root, {
622
- type: DECK_COMPANION_TYPE
623
- });
624
- return companions.toSorted((a, b) => byPosition(a.properties, b.properties));
625
- };
626
614
  var ComplementarySidebar = ({ current }) => {
627
615
  const { t } = useTranslation5(DECK_PLUGIN);
628
- const { dispatchPromise: dispatch } = useIntentDispatcher4();
616
+ const { dispatchPromise: dispatch } = useIntentDispatcher5();
629
617
  const layout = useCapability3(DeckCapabilities.MutableDeckState);
630
618
  const layoutMode = getMode(layout.deck);
631
619
  const breakpoint = useBreakpoints();
@@ -635,19 +623,19 @@ var ComplementarySidebar = ({ current }) => {
635
623
  const activeCompanion = companions.find((companion) => getCompanionId(companion.id) === current);
636
624
  const activeId = activeCompanion && getCompanionId(activeCompanion.id);
637
625
  const [internalValue, setInternalValue] = useState2(activeId);
638
- useEffect4(() => {
626
+ useEffect3(() => {
639
627
  setInternalValue(activeId);
640
628
  }, [
641
629
  activeId
642
630
  ]);
643
- const handleTabClick = useCallback4((event) => {
631
+ const handleTabClick = useCallback5((event) => {
644
632
  const nextValue = event.currentTarget.getAttribute("data-value");
645
633
  if (nextValue === activeId) {
646
634
  layout.complementarySidebarState = layout.complementarySidebarState === "expanded" ? "collapsed" : "expanded";
647
635
  } else {
648
636
  setInternalValue(nextValue);
649
637
  layout.complementarySidebarState = "expanded";
650
- void dispatch(createIntent4(LayoutAction3.UpdateComplementary, {
638
+ void dispatch(createIntent5(LayoutAction4.UpdateComplementary, {
651
639
  part: "complementary",
652
640
  subject: nextValue
653
641
  }));
@@ -664,9 +652,9 @@ var ComplementarySidebar = ({ current }) => {
664
652
  activeCompanion?.id,
665
653
  activeCompanion?.data
666
654
  ]);
667
- useEffect4(() => {
655
+ useEffect3(() => {
668
656
  if (!activeId) {
669
- void dispatch(createIntent4(LayoutAction3.UpdateComplementary, {
657
+ void dispatch(createIntent5(LayoutAction4.UpdateComplementary, {
670
658
  part: "complementary",
671
659
  options: {
672
660
  state: "collapsed"
@@ -697,7 +685,7 @@ var ComplementarySidebar = ({ current }) => {
697
685
  key: getCompanionId(companion.id),
698
686
  value: getCompanionId(companion.id),
699
687
  asChild: true
700
- }, /* @__PURE__ */ React7.createElement(IconButton3, {
688
+ }, /* @__PURE__ */ React7.createElement(IconButton4, {
701
689
  label: toLocalizedString2(companion.properties.label, t),
702
690
  icon: companion.properties.icon,
703
691
  size: 5,
@@ -739,7 +727,7 @@ var ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar })
739
727
  if (getCompanionId(companion.id) !== activeId && !data) {
740
728
  return null;
741
729
  }
742
- const Wrapper = companion.properties.fixed ? Fragment3 : ScrollArea;
730
+ const Wrapper = companion.properties.fixed ? Fragment2 : ScrollArea;
743
731
  return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("h2", {
744
732
  className: "flex items-center pli-2 border-separator border-be font-medium"
745
733
  }, toLocalizedString2(companion.properties.label, t)), /* @__PURE__ */ React7.createElement(Wrapper, null, /* @__PURE__ */ React7.createElement(Surface3, {
@@ -829,8 +817,8 @@ var Banner = ({ variant, classNames }) => {
829
817
 
830
818
  // packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
831
819
  import { untracked } from "@preact/signals-core";
832
- import React17, { useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo5, useRef as useRef3, Fragment as Fragment4 } from "react";
833
- import { Capabilities, LayoutAction as LayoutAction4, createIntent as createIntent5, useCapability as useCapability8, useIntentDispatcher as useIntentDispatcher5, usePluginManager } from "@dxos/app-framework";
820
+ import React17, { useCallback as useCallback7, useEffect as useEffect5, useMemo as useMemo6, useRef as useRef3, Fragment as Fragment3 } from "react";
821
+ import { Capabilities, LayoutAction as LayoutAction5, createIntent as createIntent6, useCapability as useCapability8, useIntentDispatcher as useIntentDispatcher6, usePluginManager } from "@dxos/app-framework";
834
822
  import { AttentionCapabilities } from "@dxos/plugin-attention";
835
823
  import { Main as Main3, useMediaQuery, useOnTransition } from "@dxos/react-ui";
836
824
  import { Stack, StackContext, DEFAULT_HORIZONTAL_SIZE } from "@dxos/react-ui-stack";
@@ -838,12 +826,12 @@ import { mainPaddingTransitions } from "@dxos/react-ui-theme";
838
826
 
839
827
  // packages/plugins/plugin-deck/src/components/DeckLayout/ActiveNode.tsx
840
828
  import React10 from "react";
841
- import { Surface as Surface6, useAppGraph as useAppGraph4 } from "@dxos/app-framework";
829
+ import { Surface as Surface6, useAppGraph as useAppGraph3 } from "@dxos/app-framework";
842
830
  import { useNode as useNode2 } from "@dxos/plugin-graph";
843
831
  import { useAttended } from "@dxos/react-ui-attention";
844
832
  var ActiveNode = () => {
845
833
  const [id] = useAttended();
846
- const { graph } = useAppGraph4();
834
+ const { graph } = useAppGraph3();
847
835
  const activeNode = useNode2(graph, id);
848
836
  useNodeActionExpander(activeNode);
849
837
  return /* @__PURE__ */ React10.createElement("div", {
@@ -868,7 +856,7 @@ var ContentEmpty = () => {
868
856
  const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
869
857
  return /* @__PURE__ */ React11.createElement("div", {
870
858
  role: "none",
871
- className: "grid place-items-center p-8 relative bg-deck",
859
+ className: "grid place-items-center p-8 relative bg-deckSurface",
872
860
  "data-testid": "layoutPlugin.firstRunMessage"
873
861
  }, /* @__PURE__ */ React11.createElement(Surface7, {
874
862
  role: "keyshortcuts"
@@ -911,62 +899,83 @@ var Dialog = () => {
911
899
  };
912
900
 
913
901
  // packages/plugins/plugin-deck/src/components/DeckLayout/Popover.tsx
914
- import React13, { useCallback as useCallback5, useEffect as useEffect5, useRef as useRef2, useState as useState3 } from "react";
902
+ import { createContext } from "@radix-ui/react-context";
903
+ import React13, { useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef2, useState as useState3 } from "react";
915
904
  import { Surface as Surface9, useCapability as useCapability7 } from "@dxos/app-framework";
916
905
  import { Popover as Popover2 } from "@dxos/react-ui";
906
+ var DEBOUNCE_DELAY = 40;
907
+ var [DeckPopoverProvider, useDeckPopoverContext] = createContext("DeckPopover");
917
908
  var PopoverRoot = ({ children }) => {
918
- const context = useCapability7(DeckCapabilities.MutableDeckState);
909
+ const layout = useCapability7(DeckCapabilities.MutableDeckState);
919
910
  const virtualRef = useRef2(null);
920
911
  const [virtualIter, setVirtualIter] = useState3(0);
921
- const [delayedPopoverVisibility, setDelayedPopoverVisibility] = useState3(false);
922
- useEffect5(() => {
923
- context.popoverOpen ? setTimeout(() => setDelayedPopoverVisibility(true), 40) : setDelayedPopoverVisibility(false);
924
- }, [
925
- context.popoverOpen
926
- ]);
927
- const handlePopoverOpenChange = useCallback5((nextOpen) => {
928
- if (nextOpen && (context.popoverAnchor || context.popoverAnchorId)) {
929
- context.popoverOpen = true;
930
- } else {
931
- context.popoverOpen = false;
932
- context.popoverAnchor = void 0;
933
- context.popoverAnchorId = void 0;
934
- context.popoverSide = void 0;
912
+ const [open, setOpen] = useState3(false);
913
+ const debounceRef = useRef2(null);
914
+ useEffect4(() => {
915
+ setOpen(false);
916
+ if (layout.popoverOpen) {
917
+ if (debounceRef.current) {
918
+ clearTimeout(debounceRef.current);
919
+ }
920
+ if (layout.popoverAnchor && virtualRef.current !== layout.popoverAnchor) {
921
+ virtualRef.current = layout.popoverAnchor ?? null;
922
+ setVirtualIter((iter) => iter + 1);
923
+ }
924
+ debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
935
925
  }
936
926
  }, [
937
- context
938
- ]);
939
- useEffect5(() => {
940
- virtualRef.current = context.popoverAnchor ?? null;
941
- setVirtualIter((iter) => iter + 1);
942
- }, [
943
- context.popoverAnchor
927
+ layout.popoverOpen,
928
+ layout.popoverAnchorId,
929
+ layout.popoverAnchor,
930
+ layout.popoverContent
944
931
  ]);
945
- return /* @__PURE__ */ React13.createElement(Popover2.Root, {
946
- modal: true,
947
- open: !!((context.popoverAnchor || context.popoverAnchorId) && delayedPopoverVisibility),
948
- onOpenChange: handlePopoverOpenChange
949
- }, context.popoverAnchor && /* @__PURE__ */ React13.createElement(Popover2.VirtualTrigger, {
932
+ return /* @__PURE__ */ React13.createElement(DeckPopoverProvider, {
933
+ setOpen
934
+ }, /* @__PURE__ */ React13.createElement(Popover2.Root, {
935
+ modal: false,
936
+ open
937
+ }, layout.popoverAnchor && /* @__PURE__ */ React13.createElement(Popover2.VirtualTrigger, {
950
938
  key: virtualIter,
951
939
  virtualRef
952
- }), children);
940
+ }), children));
953
941
  };
954
942
  var PopoverContent = () => {
955
- const context = useCapability7(DeckCapabilities.MutableDeckState);
956
- const handlePopoverClose = useCallback5(() => {
957
- context.popoverOpen = false;
958
- context.popoverAnchor = void 0;
959
- context.popoverAnchorId = void 0;
960
- context.popoverSide = void 0;
943
+ const layout = useCapability7(DeckCapabilities.MutableDeckState);
944
+ const { setOpen } = useDeckPopoverContext("PopoverContent");
945
+ const handleClose = useCallback6((event) => {
946
+ if (
947
+ // TODO(thure): CodeMirror should not focus itself when it updates.
948
+ event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
949
+ ) {
950
+ event.preventDefault();
951
+ } else {
952
+ setOpen(false);
953
+ layout.popoverOpen = false;
954
+ layout.popoverAnchor = void 0;
955
+ layout.popoverAnchorId = void 0;
956
+ layout.popoverSide = void 0;
957
+ }
961
958
  }, [
962
- context
959
+ setOpen
960
+ ]);
961
+ const collisionBoundaries = useMemo5(() => {
962
+ const closest = layout.popoverAnchor?.closest("[data-popover-collision-boundary]");
963
+ return closest ? [
964
+ closest
965
+ ] : [];
966
+ }, [
967
+ layout.popoverAnchor
963
968
  ]);
964
969
  return /* @__PURE__ */ React13.createElement(Popover2.Portal, null, /* @__PURE__ */ React13.createElement(Popover2.Content, {
965
- side: context.popoverSide,
966
- onEscapeKeyDown: handlePopoverClose
970
+ side: layout.popoverSide,
971
+ onInteractOutside: handleClose,
972
+ onEscapeKeyDown: handleClose,
973
+ collisionBoundary: collisionBoundaries,
974
+ sticky: "always",
975
+ hideWhenDetached: true
967
976
  }, /* @__PURE__ */ React13.createElement(Popover2.Viewport, null, /* @__PURE__ */ React13.createElement(Surface9, {
968
977
  role: "popover",
969
- data: context.popoverContent,
978
+ data: layout.popoverContent,
970
979
  limit: 1
971
980
  })), /* @__PURE__ */ React13.createElement(Popover2.Arrow, null)));
972
981
  };
@@ -992,7 +1001,7 @@ var StatusBar = ({ showHints }) => {
992
1001
 
993
1002
  // packages/plugins/plugin-deck/src/components/DeckLayout/Toast.tsx
994
1003
  import React15 from "react";
995
- import { Button as Button2, Icon as Icon3, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as useTranslation7 } from "@dxos/react-ui";
1004
+ import { Button, Icon as Icon2, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as useTranslation7 } from "@dxos/react-ui";
996
1005
  var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange }) => {
997
1006
  const { t } = useTranslation7(DECK_PLUGIN);
998
1007
  return /* @__PURE__ */ React15.createElement(NaturalToast.Root, {
@@ -1002,20 +1011,20 @@ var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, c
1002
1011
  onOpenChange
1003
1012
  }, /* @__PURE__ */ React15.createElement(NaturalToast.Body, null, /* @__PURE__ */ React15.createElement(NaturalToast.Title, {
1004
1013
  classNames: "items-center"
1005
- }, icon && /* @__PURE__ */ React15.createElement(Icon3, {
1014
+ }, icon && /* @__PURE__ */ React15.createElement(Icon2, {
1006
1015
  icon,
1007
1016
  size: 5,
1008
1017
  classNames: "inline mr-1"
1009
1018
  }), 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, {
1010
1019
  altText: toLocalizedString3(actionAlt, t),
1011
1020
  asChild: true
1012
- }, /* @__PURE__ */ React15.createElement(Button2, {
1021
+ }, /* @__PURE__ */ React15.createElement(Button, {
1013
1022
  "data-testid": "toast.action",
1014
1023
  variant: "primary",
1015
1024
  onClick: () => onAction?.()
1016
1025
  }, toLocalizedString3(actionLabel, t))), closeLabel && /* @__PURE__ */ React15.createElement(NaturalToast.Close, {
1017
1026
  asChild: true
1018
- }, /* @__PURE__ */ React15.createElement(Button2, {
1027
+ }, /* @__PURE__ */ React15.createElement(Button, {
1019
1028
  "data-testid": "toast.close"
1020
1029
  }, toLocalizedString3(closeLabel, t)))));
1021
1030
  };
@@ -1031,13 +1040,13 @@ var Topbar = () => {
1031
1040
  // packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
1032
1041
  var PlankSeparator = ({ order }) => order > 0 ? /* @__PURE__ */ React17.createElement("span", {
1033
1042
  role: "separator",
1034
- className: "row-span-2 bg-deck is-4",
1043
+ className: "row-span-2 bg-deckSurface is-4",
1035
1044
  style: {
1036
1045
  gridColumn: order
1037
1046
  }
1038
1047
  }) : null;
1039
1048
  var DeckLayout = ({ onDismissToast }) => {
1040
- const { dispatchPromise: dispatch } = useIntentDispatcher5();
1049
+ const { dispatchPromise: dispatch } = useIntentDispatcher6();
1041
1050
  const settings = useCapability8(Capabilities.SettingsStore).getStore(DECK_PLUGIN).value;
1042
1051
  const context = useCapability8(DeckCapabilities.MutableDeckState);
1043
1052
  const { sidebarState, complementarySidebarState, complementarySidebarPanel, deck, toasts } = context;
@@ -1049,9 +1058,9 @@ var DeckLayout = ({ onDismissToast }) => {
1049
1058
  const pluginManager = usePluginManager();
1050
1059
  const scrollLeftRef = useRef3();
1051
1060
  const deckRef = useRef3(null);
1052
- useEffect6(() => {
1061
+ useEffect5(() => {
1053
1062
  const attended = untracked(() => {
1054
- const attention = pluginManager.context.requestCapability(AttentionCapabilities.Attention);
1063
+ const attention = pluginManager.context.getCapability(AttentionCapabilities.Attention);
1055
1064
  return attention.current;
1056
1065
  });
1057
1066
  const firstId = solo ?? active[0];
@@ -1063,14 +1072,14 @@ var DeckLayout = ({ onDismissToast }) => {
1063
1072
  ssr: false
1064
1073
  });
1065
1074
  const shouldRevert = useRef3(false);
1066
- useEffect6(() => {
1075
+ useEffect5(() => {
1067
1076
  if (!isNotMobile && getMode(deck) === "deck") {
1068
1077
  const attended = untracked(() => {
1069
- const attention = pluginManager.context.requestCapability(AttentionCapabilities.Attention);
1078
+ const attention = pluginManager.context.getCapability(AttentionCapabilities.Attention);
1070
1079
  return attention.current;
1071
1080
  });
1072
1081
  shouldRevert.current = true;
1073
- void dispatch(createIntent5(LayoutAction4.SetLayoutMode, {
1082
+ void dispatch(createIntent6(LayoutAction5.SetLayoutMode, {
1074
1083
  part: "mode",
1075
1084
  subject: attended[0],
1076
1085
  options: {
@@ -1078,7 +1087,7 @@ var DeckLayout = ({ onDismissToast }) => {
1078
1087
  }
1079
1088
  }));
1080
1089
  } else if (isNotMobile && getMode(deck) === "solo" && shouldRevert.current) {
1081
- void dispatch(createIntent5(LayoutAction4.SetLayoutMode, {
1090
+ void dispatch(createIntent6(LayoutAction5.SetLayoutMode, {
1082
1091
  part: "mode",
1083
1092
  options: {
1084
1093
  revert: true
@@ -1090,9 +1099,9 @@ var DeckLayout = ({ onDismissToast }) => {
1090
1099
  deck,
1091
1100
  dispatch
1092
1101
  ]);
1093
- useEffect6(() => {
1094
- if (!settings.enableDeck) {
1095
- void dispatch(createIntent5(LayoutAction4.SetLayoutMode, {
1102
+ useEffect5(() => {
1103
+ if (!settings.enableDeck && layoutMode === "deck") {
1104
+ void dispatch(createIntent6(LayoutAction5.SetLayoutMode, {
1096
1105
  part: "mode",
1097
1106
  subject: active[0],
1098
1107
  options: {
@@ -1103,24 +1112,25 @@ var DeckLayout = ({ onDismissToast }) => {
1103
1112
  }, [
1104
1113
  settings.enableDeck,
1105
1114
  dispatch,
1106
- active
1115
+ active,
1116
+ layoutMode
1107
1117
  ]);
1108
- const handleResize = useCallback6(() => {
1118
+ const handleResize = useCallback7(() => {
1109
1119
  scrollLeftRef.current = null;
1110
1120
  }, []);
1111
- useEffect6(() => {
1121
+ useEffect5(() => {
1112
1122
  window.addEventListener("resize", handleResize);
1113
1123
  return () => window.removeEventListener("resize", handleResize);
1114
1124
  }, [
1115
1125
  handleResize
1116
1126
  ]);
1117
- const restoreScroll = useCallback6(() => {
1127
+ const restoreScroll = useCallback7(() => {
1118
1128
  if (deckRef.current && scrollLeftRef.current != null) {
1119
1129
  deckRef.current.scrollLeft = scrollLeftRef.current;
1120
1130
  }
1121
1131
  }, []);
1122
1132
  useOnTransition(layoutMode, (mode) => mode !== "deck", "deck", restoreScroll);
1123
- const handleScroll = useCallback6((event) => {
1133
+ const handleScroll = useCallback7((event) => {
1124
1134
  if (!solo && event.currentTarget === event.target) {
1125
1135
  scrollLeftRef.current = event.target.scrollLeft;
1126
1136
  }
@@ -1128,7 +1138,7 @@ var DeckLayout = ({ onDismissToast }) => {
1128
1138
  solo
1129
1139
  ]);
1130
1140
  const isEmpty = !solo && active.length === 0;
1131
- const padding = useMemo5(() => {
1141
+ const padding = useMemo6(() => {
1132
1142
  if (!solo && settings.overscroll === "centering") {
1133
1143
  return calculateOverscroll(active.length);
1134
1144
  }
@@ -1138,7 +1148,7 @@ var DeckLayout = ({ onDismissToast }) => {
1138
1148
  settings.overscroll,
1139
1149
  deck
1140
1150
  ]);
1141
- const mainPosition = useMemo5(() => [
1151
+ const mainPosition = useMemo6(() => [
1142
1152
  "grid !block-start-[env(safe-area-inset-top)]",
1143
1153
  topbar && "!block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
1144
1154
  hoistStatusbar && "lg:block-end-[--statusbar-size]"
@@ -1146,7 +1156,7 @@ var DeckLayout = ({ onDismissToast }) => {
1146
1156
  topbar,
1147
1157
  hoistStatusbar
1148
1158
  ]);
1149
- const { order, itemsCount } = useMemo5(() => {
1159
+ const { order, itemsCount } = useMemo6(() => {
1150
1160
  return active.reduce((acc, entryId) => {
1151
1161
  acc.order[entryId] = acc.itemsCount + 1;
1152
1162
  acc.itemsCount += activeCompanions?.[entryId] ? 3 : 2;
@@ -1172,8 +1182,8 @@ var DeckLayout = ({ onDismissToast }) => {
1172
1182
  classNames: mainPosition
1173
1183
  }, /* @__PURE__ */ React17.createElement(ContentEmpty, null)), !isEmpty && /* @__PURE__ */ React17.createElement(Main3.Content, {
1174
1184
  bounce: true,
1175
- classNames: mainPosition,
1176
1185
  handlesFocus: true,
1186
+ classNames: mainPosition,
1177
1187
  style: {
1178
1188
  "--dx-main-sidebarWidth": sidebarState === "expanded" ? "var(--nav-sidebar-size)" : sidebarState === "collapsed" ? "var(--l0-size)" : "0",
1179
1189
  "--dx-main-complementaryWidth": complementarySidebarState === "expanded" ? "var(--complementary-sidebar-size)" : complementarySidebarState === "collapsed" ? "var(--rail-size)" : "0",
@@ -1182,7 +1192,7 @@ var DeckLayout = ({ onDismissToast }) => {
1182
1192
  }
1183
1193
  }, /* @__PURE__ */ React17.createElement("div", {
1184
1194
  role: "none",
1185
- className: !solo ? "relative bg-deck overflow-hidden" : "sr-only",
1195
+ className: !solo ? "relative bg-deckSurface overflow-hidden" : "sr-only",
1186
1196
  ...solo && {
1187
1197
  inert: ""
1188
1198
  }
@@ -1201,7 +1211,7 @@ var DeckLayout = ({ onDismissToast }) => {
1201
1211
  itemsCount: itemsCount - 1,
1202
1212
  style: padding,
1203
1213
  onScroll: handleScroll
1204
- }, active.map((entryId) => /* @__PURE__ */ React17.createElement(Fragment4, {
1214
+ }, active.map((entryId) => /* @__PURE__ */ React17.createElement(Fragment3, {
1205
1215
  key: entryId
1206
1216
  }, /* @__PURE__ */ React17.createElement(PlankSeparator, {
1207
1217
  order: order[entryId] - 1
@@ -1215,7 +1225,7 @@ var DeckLayout = ({ onDismissToast }) => {
1215
1225
  settings
1216
1226
  }))))), /* @__PURE__ */ React17.createElement("div", {
1217
1227
  role: "none",
1218
- className: solo ? "relative bg-deck overflow-hidden" : "sr-only",
1228
+ className: solo ? "relative bg-deckSurface overflow-hidden" : "sr-only",
1219
1229
  ...!solo && {
1220
1230
  inert: ""
1221
1231
  }
@@ -1306,4 +1316,4 @@ export {
1306
1316
  DeckLayout,
1307
1317
  DeckSettings
1308
1318
  };
1309
- //# sourceMappingURL=chunk-VP6FCWFV.mjs.map
1319
+ //# sourceMappingURL=chunk-KIGMELV2.mjs.map