@dxos/plugin-deck 0.9.1-main.c7dcc2e112 → 0.10.0

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 (258) hide show
  1. package/PLUGIN.mdl +3 -1
  2. package/dist/lib/neutral/{DeckLayout-VX2BP4Q2.mjs → DeckLayout-B3RUUV5P.mjs} +4 -3
  3. package/dist/lib/neutral/DeckLayout-B3RUUV5P.mjs.map +7 -0
  4. package/dist/lib/neutral/DeckPlugin.mjs +2 -6
  5. package/dist/lib/neutral/DeckPlugin.mjs.map +3 -3
  6. package/dist/lib/neutral/DeckSettings-Z7GMB7XJ.mjs +32 -0
  7. package/dist/lib/neutral/DeckSettings-Z7GMB7XJ.mjs.map +7 -0
  8. package/dist/lib/neutral/{add-toast-APKTCLIA.mjs → add-toast-BHNEH5UY.mjs} +2 -2
  9. package/dist/lib/neutral/{adjust-7CZI4GK3.mjs → adjust-MJB6UMRQ.mjs} +16 -10
  10. package/dist/lib/neutral/adjust-MJB6UMRQ.mjs.map +7 -0
  11. package/dist/lib/neutral/{app-graph-builder-6HTXRTU2.mjs → app-graph-builder-2F7P4IFQ.mjs} +4 -3
  12. package/dist/lib/neutral/app-graph-builder-2F7P4IFQ.mjs.map +7 -0
  13. package/dist/lib/neutral/capabilities/index.mjs +5 -5
  14. package/dist/lib/neutral/chunk-FKGYHBUB.mjs +8 -0
  15. package/dist/lib/neutral/{chunk-CL7JIOI5.mjs → chunk-ICOJ4GMB.mjs} +10 -6
  16. package/dist/lib/neutral/chunk-ICOJ4GMB.mjs.map +7 -0
  17. package/dist/lib/neutral/{chunk-NGX6RXNV.mjs → chunk-PP32NEVY.mjs} +2 -2
  18. package/dist/lib/neutral/chunk-PP32NEVY.mjs.map +7 -0
  19. package/dist/lib/neutral/chunk-SONATB35.mjs +20 -0
  20. package/dist/lib/neutral/chunk-SONATB35.mjs.map +7 -0
  21. package/dist/lib/neutral/chunk-Z2B5RSVI.mjs +1096 -0
  22. package/dist/lib/neutral/chunk-Z2B5RSVI.mjs.map +7 -0
  23. package/dist/lib/neutral/{close-KJUCFIJ5.mjs → close-2YGB5IIP.mjs} +4 -3
  24. package/dist/lib/neutral/{close-KJUCFIJ5.mjs.map → close-2YGB5IIP.mjs.map} +1 -1
  25. package/dist/lib/neutral/components/index.mjs +201 -16
  26. package/dist/lib/neutral/components/index.mjs.map +4 -4
  27. package/dist/lib/neutral/containers/index.mjs +6 -11
  28. package/dist/lib/neutral/containers/index.mjs.map +3 -3
  29. package/dist/lib/neutral/hooks/index.mjs +101 -17
  30. package/dist/lib/neutral/hooks/index.mjs.map +4 -4
  31. package/dist/lib/neutral/index.mjs +7 -1
  32. package/dist/lib/neutral/meta.json +1 -1
  33. package/dist/lib/neutral/{notification-tracker-CUDFRDCF.mjs → notification-tracker-Y5CRTWJM.mjs} +4 -2
  34. package/dist/lib/neutral/notification-tracker-Y5CRTWJM.mjs.map +7 -0
  35. package/dist/lib/neutral/{open-VU7YS3HB.mjs → open-P6XQ56M7.mjs} +4 -3
  36. package/dist/lib/neutral/{open-VU7YS3HB.mjs.map → open-P6XQ56M7.mjs.map} +1 -1
  37. package/dist/lib/neutral/operations/index.mjs +1 -1
  38. package/dist/lib/neutral/plugin.mjs +1 -1
  39. package/dist/lib/neutral/{react-surface-O4POQWYL.mjs → react-surface-H63FXUK3.mjs} +2 -2
  40. package/dist/lib/neutral/{react-surface-O4POQWYL.mjs.map → react-surface-H63FXUK3.mjs.map} +1 -1
  41. package/dist/lib/neutral/{revert-workspace-24TKG3I7.mjs → revert-workspace-RXWP2TEE.mjs} +2 -2
  42. package/dist/lib/neutral/{scroll-into-view-3VXT6TWC.mjs → scroll-into-view-HFV5EGYZ.mjs} +2 -2
  43. package/dist/lib/neutral/{set-RFOLTI57.mjs → set-HOOVB7E4.mjs} +4 -3
  44. package/dist/lib/neutral/{set-RFOLTI57.mjs.map → set-HOOVB7E4.mjs.map} +1 -1
  45. package/dist/lib/neutral/{set-layout-mode-AZ73W52Z.mjs → set-layout-mode-XAGSZZGB.mjs} +2 -2
  46. package/dist/lib/neutral/{state-D3YXB5NP.mjs → state-F4X5GPGZ.mjs} +3 -2
  47. package/dist/lib/neutral/{state-D3YXB5NP.mjs.map → state-F4X5GPGZ.mjs.map} +1 -1
  48. package/dist/lib/neutral/{switch-workspace-TBPT23CZ.mjs → switch-workspace-PA7N6EUX.mjs} +2 -2
  49. package/dist/lib/neutral/translations.mjs +2 -2
  50. package/dist/lib/neutral/translations.mjs.map +2 -2
  51. package/dist/lib/neutral/types/index.mjs +1 -1
  52. package/dist/lib/neutral/{update-companion-5LCY6QME.mjs → update-companion-6A2SKQAI.mjs} +14 -6
  53. package/dist/lib/neutral/update-companion-6A2SKQAI.mjs.map +7 -0
  54. package/dist/lib/neutral/{update-complementary-HZ7QXZYE.mjs → update-complementary-K55I5EV5.mjs} +2 -2
  55. package/dist/lib/neutral/{update-dialog-A7W3R5EI.mjs → update-dialog-Z3GEXMVV.mjs} +2 -2
  56. package/dist/lib/neutral/{update-plank-size-XHTYBLSD.mjs → update-plank-size-BTESVV7N.mjs} +2 -2
  57. package/dist/lib/neutral/{update-popover-RDIHG73B.mjs → update-popover-QEVDSZSH.mjs} +2 -2
  58. package/dist/lib/neutral/{update-sidebar-GEI7USA5.mjs → update-sidebar-VSRCN47U.mjs} +2 -2
  59. package/dist/lib/neutral/{url-handler-PUS4X33T.mjs → url-handler-ERZXXEYR.mjs} +3 -2
  60. package/dist/lib/neutral/{url-handler-PUS4X33T.mjs.map → url-handler-ERZXXEYR.mjs.map} +1 -1
  61. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  62. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -2
  63. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  64. package/dist/types/src/capabilities/notification-tracker.d.ts +1 -1
  65. package/dist/types/src/capabilities/notification-tracker.d.ts.map +1 -1
  66. package/dist/types/src/capabilities/react-root.d.ts +1 -5
  67. package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
  68. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  69. package/dist/types/src/capabilities/settings.d.ts +1 -3
  70. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  71. package/dist/types/src/capabilities/state.d.ts +1 -187
  72. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  73. package/dist/types/src/capabilities/tools.d.ts +1 -1
  74. package/dist/types/src/capabilities/url-handler.d.ts +1 -1
  75. package/dist/types/src/components/Companion/Companion.d.ts +17 -0
  76. package/dist/types/src/components/Companion/Companion.d.ts.map +1 -0
  77. package/dist/types/src/components/Companion/index.d.ts +2 -0
  78. package/dist/types/src/components/Companion/index.d.ts.map +1 -0
  79. package/dist/types/src/components/Matrix/Matrix.d.ts +1 -1
  80. package/dist/types/src/components/Matrix/Matrix.d.ts.map +1 -1
  81. package/dist/types/src/components/Matrix/Matrix.stories.d.ts +2 -2
  82. package/dist/types/src/components/Matrix/Matrix.stories.d.ts.map +1 -1
  83. package/dist/types/src/components/Matrix/index.d.ts +1 -1
  84. package/dist/types/src/components/Matrix/index.d.ts.map +1 -1
  85. package/dist/types/src/components/Pane/Pane.d.ts +45 -0
  86. package/dist/types/src/components/Pane/Pane.d.ts.map +1 -0
  87. package/dist/types/src/components/Pane/Pane.stories.d.ts +7 -0
  88. package/dist/types/src/components/Pane/Pane.stories.d.ts.map +1 -0
  89. package/dist/types/src/components/Pane/index.d.ts +2 -0
  90. package/dist/types/src/components/Pane/index.d.ts.map +1 -0
  91. package/dist/types/src/components/Plank/Plank.d.ts +74 -0
  92. package/dist/types/src/components/Plank/Plank.d.ts.map +1 -0
  93. package/dist/types/src/components/Plank/Plank.stories.d.ts +6 -0
  94. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -0
  95. package/dist/types/src/components/Plank/index.d.ts +2 -0
  96. package/dist/types/src/components/Plank/index.d.ts.map +1 -0
  97. package/dist/types/src/components/index.d.ts +3 -2
  98. package/dist/types/src/components/index.d.ts.map +1 -1
  99. package/dist/types/src/containers/Deck/Deck.d.ts +1 -1
  100. package/dist/types/src/containers/Deck/Deck.d.ts.map +1 -1
  101. package/dist/types/src/containers/Deck/Deck.stories.d.ts +2 -2
  102. package/dist/types/src/containers/Deck/DeckPlank.d.ts +21 -0
  103. package/dist/types/src/containers/Deck/DeckPlank.d.ts.map +1 -0
  104. package/dist/types/src/containers/Deck/DeckViewport.d.ts +3 -1
  105. package/dist/types/src/containers/Deck/DeckViewport.d.ts.map +1 -1
  106. package/dist/types/src/containers/{Plank → Deck}/PlankControls.d.ts +3 -10
  107. package/dist/types/src/containers/Deck/PlankControls.d.ts.map +1 -0
  108. package/dist/types/src/containers/Deck/PlankFallback.d.ts +6 -0
  109. package/dist/types/src/containers/Deck/PlankFallback.d.ts.map +1 -0
  110. package/dist/types/src/containers/Deck/useDeckPlank.d.ts +49 -0
  111. package/dist/types/src/containers/Deck/useDeckPlank.d.ts.map +1 -0
  112. package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts +2 -2
  113. package/dist/types/src/containers/DeckLayout/DeckLayout.stories.d.ts.map +1 -1
  114. package/dist/types/src/{components → containers}/DeckSettings/DeckSettings.d.ts +1 -1
  115. package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts.map +1 -0
  116. package/dist/types/src/{components → containers}/DeckSettings/DeckSettings.stories.d.ts +2 -2
  117. package/dist/types/src/{components → containers}/DeckSettings/DeckSettings.stories.d.ts.map +1 -1
  118. package/dist/types/src/containers/DeckSettings/index.d.ts.map +1 -0
  119. package/dist/types/src/containers/index.d.ts +1 -1
  120. package/dist/types/src/containers/index.d.ts.map +1 -1
  121. package/dist/types/src/hooks/index.d.ts +2 -0
  122. package/dist/types/src/hooks/index.d.ts.map +1 -1
  123. package/dist/types/src/hooks/useCompanionSplit.d.ts +28 -0
  124. package/dist/types/src/hooks/useCompanionSplit.d.ts.map +1 -0
  125. package/dist/types/src/hooks/useCompanions.d.ts +11 -7
  126. package/dist/types/src/hooks/useCompanions.d.ts.map +1 -1
  127. package/dist/types/src/hooks/useDeckCompanions.d.ts +2 -2
  128. package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
  129. package/dist/types/src/hooks/useDeckState.d.ts +1 -1
  130. package/dist/types/src/hooks/useDeckState.d.ts.map +1 -1
  131. package/dist/types/src/hooks/useSelectedCompanionVariant.d.ts +6 -0
  132. package/dist/types/src/hooks/useSelectedCompanionVariant.d.ts.map +1 -0
  133. package/dist/types/src/index.d.ts +1 -0
  134. package/dist/types/src/index.d.ts.map +1 -1
  135. package/dist/types/src/meta.d.ts +4 -0
  136. package/dist/types/src/meta.d.ts.map +1 -1
  137. package/dist/types/src/operations/adjust.d.ts.map +1 -1
  138. package/dist/types/src/operations/update-companion.d.ts.map +1 -1
  139. package/dist/types/src/translations.d.ts +2 -2
  140. package/dist/types/src/translations.d.ts.map +1 -1
  141. package/dist/types/src/types/DeckCapabilities.d.ts +2 -2
  142. package/dist/types/src/types/DeckCapabilities.d.ts.map +1 -1
  143. package/dist/types/src/types/DeckOperation.d.ts +2 -2
  144. package/dist/types/src/types/DeckOperation.d.ts.map +1 -1
  145. package/dist/types/src/types/schema.d.ts +7 -7
  146. package/dist/types/src/types/schema.d.ts.map +1 -1
  147. package/dist/types/src/util/companion-view-state.d.ts +16 -0
  148. package/dist/types/src/util/companion-view-state.d.ts.map +1 -0
  149. package/dist/types/src/util/index.d.ts +1 -0
  150. package/dist/types/src/util/index.d.ts.map +1 -1
  151. package/dist/types/src/util/plank-url-params.d.ts +2 -0
  152. package/dist/types/src/util/plank-url-params.d.ts.map +1 -1
  153. package/dist/types/tsconfig.tsbuildinfo +1 -1
  154. package/package.json +49 -47
  155. package/src/DeckPlugin.ts +1 -2
  156. package/src/capabilities/app-graph-builder.ts +3 -2
  157. package/src/capabilities/notification-tracker.ts +3 -1
  158. package/src/capabilities/react-surface.tsx +1 -1
  159. package/src/components/Companion/Companion.tsx +91 -0
  160. package/src/components/Companion/index.ts +5 -0
  161. package/src/components/Matrix/Matrix.stories.tsx +13 -26
  162. package/src/components/Matrix/Matrix.tsx +3 -3
  163. package/src/components/Matrix/SPEC.md +1 -1
  164. package/src/components/Matrix/index.ts +1 -1
  165. package/src/components/Pane/Pane.stories.tsx +92 -0
  166. package/src/components/Pane/Pane.tsx +178 -0
  167. package/src/components/Pane/index.ts +5 -0
  168. package/src/components/Plank/Plank.stories.tsx +103 -0
  169. package/src/components/Plank/Plank.tsx +149 -0
  170. package/src/components/Plank/index.ts +5 -0
  171. package/src/components/index.ts +3 -4
  172. package/src/containers/Deck/Deck.tsx +3 -3
  173. package/src/containers/Deck/DeckPlank.tsx +187 -0
  174. package/src/containers/Deck/DeckViewport.tsx +116 -243
  175. package/src/containers/{Plank → Deck}/PlankControls.tsx +19 -17
  176. package/src/containers/Deck/PlankFallback.tsx +42 -0
  177. package/src/containers/Deck/useDeckPlank.ts +219 -0
  178. package/src/containers/DeckLayout/DeckLayout.stories.tsx +38 -51
  179. package/src/containers/DeckLayout/Dialog.tsx +1 -1
  180. package/src/{components → containers}/DeckSettings/DeckSettings.stories.tsx +1 -1
  181. package/src/containers/DeckSettings/DeckSettings.tsx +42 -0
  182. package/src/containers/Sidebar/ComplementarySidebar.tsx +2 -2
  183. package/src/containers/index.ts +1 -1
  184. package/src/hooks/index.ts +2 -0
  185. package/src/hooks/useCompanionSplit.ts +78 -0
  186. package/src/hooks/useCompanions.ts +39 -7
  187. package/src/hooks/useDeckCompanions.ts +3 -3
  188. package/src/hooks/useDeckState.ts +1 -1
  189. package/src/hooks/useSelectedCompanionVariant.ts +14 -0
  190. package/src/index.ts +7 -0
  191. package/src/operations/adjust.ts +23 -12
  192. package/src/operations/update-companion.ts +10 -6
  193. package/src/translations.ts +2 -2
  194. package/src/types/DeckCapabilities.ts +1 -1
  195. package/src/types/DeckOperation.ts +2 -1
  196. package/src/types/schema.ts +5 -4
  197. package/src/util/companion-view-state.ts +28 -0
  198. package/src/util/index.ts +1 -0
  199. package/src/util/plank-url-params.test.ts +5 -0
  200. package/src/util/plank-url-params.ts +3 -1
  201. package/src/util/sanitize-persisted-state.test.ts +1 -1
  202. package/src/util/set-active.test.ts +1 -1
  203. package/dist/lib/neutral/DeckLayout-VX2BP4Q2.mjs.map +0 -7
  204. package/dist/lib/neutral/DeckSettings-CQQZJ2YS.mjs +0 -27
  205. package/dist/lib/neutral/DeckSettings-CQQZJ2YS.mjs.map +0 -7
  206. package/dist/lib/neutral/adjust-7CZI4GK3.mjs.map +0 -7
  207. package/dist/lib/neutral/app-graph-builder-6HTXRTU2.mjs.map +0 -7
  208. package/dist/lib/neutral/chunk-CL7JIOI5.mjs.map +0 -7
  209. package/dist/lib/neutral/chunk-DNG3L5QN.mjs +0 -1304
  210. package/dist/lib/neutral/chunk-DNG3L5QN.mjs.map +0 -7
  211. package/dist/lib/neutral/chunk-NGX6RXNV.mjs.map +0 -7
  212. package/dist/lib/neutral/chunk-UZLAR4DR.mjs +0 -8
  213. package/dist/lib/neutral/notification-tracker-CUDFRDCF.mjs.map +0 -7
  214. package/dist/lib/neutral/update-companion-5LCY6QME.mjs.map +0 -7
  215. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +0 -1
  216. package/dist/types/src/components/DeckSettings/index.d.ts.map +0 -1
  217. package/dist/types/src/containers/Plank/Plank.d.ts +0 -17
  218. package/dist/types/src/containers/Plank/Plank.d.ts.map +0 -1
  219. package/dist/types/src/containers/Plank/Plank.stories.d.ts +0 -67
  220. package/dist/types/src/containers/Plank/Plank.stories.d.ts.map +0 -1
  221. package/dist/types/src/containers/Plank/PlankComponent.d.ts +0 -17
  222. package/dist/types/src/containers/Plank/PlankComponent.d.ts.map +0 -1
  223. package/dist/types/src/containers/Plank/PlankContent.d.ts +0 -10
  224. package/dist/types/src/containers/Plank/PlankContent.d.ts.map +0 -1
  225. package/dist/types/src/containers/Plank/PlankControls.d.ts.map +0 -1
  226. package/dist/types/src/containers/Plank/PlankError.d.ts +0 -15
  227. package/dist/types/src/containers/Plank/PlankError.d.ts.map +0 -1
  228. package/dist/types/src/containers/Plank/PlankHeading.d.ts +0 -22
  229. package/dist/types/src/containers/Plank/PlankHeading.d.ts.map +0 -1
  230. package/dist/types/src/containers/Plank/PlankLoading.d.ts +0 -3
  231. package/dist/types/src/containers/Plank/PlankLoading.d.ts.map +0 -1
  232. package/dist/types/src/containers/Plank/PlankRoot.d.ts +0 -37
  233. package/dist/types/src/containers/Plank/PlankRoot.d.ts.map +0 -1
  234. package/dist/types/src/containers/Plank/index.d.ts +0 -4
  235. package/dist/types/src/containers/Plank/index.d.ts.map +0 -1
  236. package/src/components/DeckSettings/DeckSettings.tsx +0 -34
  237. package/src/containers/Plank/Plank.stories.tsx +0 -108
  238. package/src/containers/Plank/Plank.tsx +0 -22
  239. package/src/containers/Plank/PlankComponent.tsx +0 -223
  240. package/src/containers/Plank/PlankContent.tsx +0 -45
  241. package/src/containers/Plank/PlankError.tsx +0 -82
  242. package/src/containers/Plank/PlankHeading.tsx +0 -236
  243. package/src/containers/Plank/PlankLoading.tsx +0 -10
  244. package/src/containers/Plank/PlankRoot.tsx +0 -49
  245. package/src/containers/Plank/index.ts +0 -7
  246. /package/dist/lib/neutral/{add-toast-APKTCLIA.mjs.map → add-toast-BHNEH5UY.mjs.map} +0 -0
  247. /package/dist/lib/neutral/{chunk-UZLAR4DR.mjs.map → chunk-FKGYHBUB.mjs.map} +0 -0
  248. /package/dist/lib/neutral/{revert-workspace-24TKG3I7.mjs.map → revert-workspace-RXWP2TEE.mjs.map} +0 -0
  249. /package/dist/lib/neutral/{scroll-into-view-3VXT6TWC.mjs.map → scroll-into-view-HFV5EGYZ.mjs.map} +0 -0
  250. /package/dist/lib/neutral/{set-layout-mode-AZ73W52Z.mjs.map → set-layout-mode-XAGSZZGB.mjs.map} +0 -0
  251. /package/dist/lib/neutral/{switch-workspace-TBPT23CZ.mjs.map → switch-workspace-PA7N6EUX.mjs.map} +0 -0
  252. /package/dist/lib/neutral/{update-complementary-HZ7QXZYE.mjs.map → update-complementary-K55I5EV5.mjs.map} +0 -0
  253. /package/dist/lib/neutral/{update-dialog-A7W3R5EI.mjs.map → update-dialog-Z3GEXMVV.mjs.map} +0 -0
  254. /package/dist/lib/neutral/{update-plank-size-XHTYBLSD.mjs.map → update-plank-size-BTESVV7N.mjs.map} +0 -0
  255. /package/dist/lib/neutral/{update-popover-RDIHG73B.mjs.map → update-popover-QEVDSZSH.mjs.map} +0 -0
  256. /package/dist/lib/neutral/{update-sidebar-GEI7USA5.mjs.map → update-sidebar-VSRCN47U.mjs.map} +0 -0
  257. /package/dist/types/src/{components → containers}/DeckSettings/index.d.ts +0 -0
  258. /package/src/{components → containers}/DeckSettings/index.ts +0 -0
@@ -0,0 +1,1096 @@
1
+ import {
2
+ layoutAppliesTopbar
3
+ } from "./chunk-PP32NEVY.mjs";
4
+
5
+ // src/containers/Sidebar/SidebarButton.tsx
6
+ import React, { useCallback } from "react";
7
+ import { useOperationInvoker } from "@dxos/app-framework/ui";
8
+ import { LayoutOperation } from "@dxos/app-toolkit";
9
+ import { IconButton, useTranslation } from "@dxos/react-ui";
10
+ import { getLinkedVariant } from "@dxos/react-ui-attention";
11
+ import { useDeckCompanions, useDeckState } from "#hooks";
12
+ import { meta } from "#meta";
13
+ var ToggleSidebarButton = ({ classNames, variant = "ghost" }) => {
14
+ const { updateState } = useDeckState();
15
+ const { t } = useTranslation(meta.profile.key);
16
+ const handleClick = useCallback(() => {
17
+ updateState((state) => ({
18
+ ...state,
19
+ sidebarState: state.sidebarState === "expanded" ? "collapsed" : "expanded"
20
+ }));
21
+ }, [
22
+ updateState
23
+ ]);
24
+ return /* @__PURE__ */ React.createElement(IconButton, {
25
+ variant,
26
+ icon: "ph--sidebar--regular",
27
+ iconOnly: true,
28
+ size: 4,
29
+ label: t("open-navigation-sidebar.label"),
30
+ onClick: handleClick,
31
+ classNames
32
+ });
33
+ };
34
+ var CloseSidebarButton = () => {
35
+ const { updateState } = useDeckState();
36
+ const { t } = useTranslation(meta.profile.key);
37
+ const handleClick = useCallback(() => {
38
+ updateState((state) => ({
39
+ ...state,
40
+ sidebarState: "collapsed"
41
+ }));
42
+ }, [
43
+ updateState
44
+ ]);
45
+ return /* @__PURE__ */ React.createElement(IconButton, {
46
+ variant: "ghost",
47
+ icon: "ph--caret-line-left--regular",
48
+ iconOnly: true,
49
+ size: 4,
50
+ label: t("close-navigation-sidebar.button"),
51
+ onClick: handleClick,
52
+ classNames: "rounded-none px-1 dx-focus-ring-inset pe-[max(.5rem,env(safe-area-inset-left))]"
53
+ });
54
+ };
55
+ var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
56
+ const { invokePromise } = useOperationInvoker();
57
+ const { state, updateState } = useDeckState();
58
+ const { t } = useTranslation(meta.profile.key);
59
+ const companions = useDeckCompanions();
60
+ const handleClick = useCallback(() => {
61
+ const nextState = state.complementarySidebarState === "expanded" ? "collapsed" : "expanded";
62
+ updateState((state2) => ({
63
+ ...state2,
64
+ complementarySidebarState: nextState
65
+ }));
66
+ const subject = state.complementarySidebarPanel ?? (companions[0] && getLinkedVariant(companions[0].id));
67
+ if (nextState === "expanded" && !current && subject) {
68
+ void invokePromise(LayoutOperation.UpdateComplementary, {
69
+ subject
70
+ });
71
+ }
72
+ }, [
73
+ state,
74
+ updateState,
75
+ current,
76
+ companions,
77
+ invokePromise
78
+ ]);
79
+ const label3 = t(state.complementarySidebarState === "expanded" ? "close-complementary-sidebar.label" : "open-complementary-sidebar.label");
80
+ return /* @__PURE__ */ React.createElement(IconButton, {
81
+ variant: "ghost",
82
+ classNames: [
83
+ "[&>svg]:-scale-x-100",
84
+ classNames
85
+ ],
86
+ icon: "ph--sidebar-simple--regular",
87
+ iconOnly: true,
88
+ label: label3,
89
+ tooltipSide: inR0 ? "left" : void 0,
90
+ onClick: handleClick
91
+ });
92
+ };
93
+
94
+ // src/containers/Sidebar/ComplementarySidebar.tsx
95
+ import React3, { useCallback as useCallback2, useEffect as useEffect2, useMemo, useState } from "react";
96
+ import { Surface, useOperationInvoker as useOperationInvoker2 } from "@dxos/app-framework/ui";
97
+ import { LayoutOperation as LayoutOperation2 } from "@dxos/app-toolkit";
98
+ import { AppSurface } from "@dxos/app-toolkit/ui";
99
+ import { IconButton as IconButton2, Main, Panel, Toolbar, toLocalizedString, useTranslation as useTranslation3 } from "@dxos/react-ui";
100
+ import { getLinkedVariant as getLinkedVariant2 } from "@dxos/react-ui-attention";
101
+ import { Tabs } from "@dxos/react-ui-tabs";
102
+ import { iconSize, mx as mx2 } from "@dxos/ui-theme";
103
+ import { useBreakpoints, useDeckCompanions as useDeckCompanions2, useDeckState as useDeckState2 } from "#hooks";
104
+ import { meta as meta3 } from "#meta";
105
+ import { getMode } from "#types";
106
+
107
+ // src/containers/Deck/PlankFallback.tsx
108
+ import React2, { useEffect } from "react";
109
+ import { log } from "@dxos/log";
110
+ import { ErrorFallback, useTranslation as useTranslation2 } from "@dxos/react-ui";
111
+ import { descriptionMessage, mx } from "@dxos/ui-theme";
112
+ import { meta as meta2 } from "#meta";
113
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/containers/Deck/PlankFallback.tsx";
114
+ var PlankLoading = () => /* @__PURE__ */ React2.createElement("div", {
115
+ className: "grid place-items-center dx-attention-surface"
116
+ });
117
+ var PlankErrorFallback = ({ error }) => {
118
+ const { t } = useTranslation2(meta2.profile.key);
119
+ useEffect(() => {
120
+ if (error) {
121
+ log.error("plank error", {
122
+ error
123
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 17, S: void 0 });
124
+ }
125
+ }, [
126
+ error
127
+ ]);
128
+ if (process.env.NODE_ENV === "development") {
129
+ return /* @__PURE__ */ React2.createElement(ErrorFallback, {
130
+ title: "Plank Error",
131
+ error
132
+ });
133
+ }
134
+ return /* @__PURE__ */ React2.createElement("div", {
135
+ role: "alert",
136
+ "data-testid": "plank-content-error",
137
+ className: "dx-attention-surface overflow-y-auto p-8 grid place-items-center"
138
+ }, /* @__PURE__ */ React2.createElement("div", {
139
+ className: "flex flex-col items-center gap-2"
140
+ }, /* @__PURE__ */ React2.createElement("p", {
141
+ className: mx(descriptionMessage, "break-all rounded-md p-4")
142
+ }, t("error-fallback.message"))));
143
+ };
144
+
145
+ // src/containers/Sidebar/ComplementarySidebar.tsx
146
+ var label = [
147
+ "complementary-sidebar.title",
148
+ {
149
+ ns: meta3.profile.key
150
+ }
151
+ ];
152
+ var ComplementarySidebar = ({ current }) => {
153
+ const { invokePromise } = useOperationInvoker2();
154
+ const { t } = useTranslation3(meta3.profile.key);
155
+ const { state, deck, updateState } = useDeckState2();
156
+ const layoutMode = getMode(deck);
157
+ const breakpoint = useBreakpoints();
158
+ const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
159
+ const companions = useDeckCompanions2();
160
+ const activeCompanion = companions.find((companion) => getLinkedVariant2(companion.id) === current);
161
+ const activeId = activeCompanion && getLinkedVariant2(activeCompanion.id);
162
+ const [internalValue, setInternalValue] = useState(activeId);
163
+ useEffect2(() => {
164
+ setInternalValue(activeId);
165
+ }, [
166
+ activeId
167
+ ]);
168
+ const handleTabClick = useCallback2((event) => {
169
+ const nextValue = event.currentTarget.getAttribute("data-value");
170
+ if (nextValue === activeId) {
171
+ updateState((state2) => ({
172
+ ...state2,
173
+ complementarySidebarState: state2.complementarySidebarState === "expanded" ? "collapsed" : "expanded"
174
+ }));
175
+ } else {
176
+ setInternalValue(nextValue);
177
+ updateState((state2) => ({
178
+ ...state2,
179
+ complementarySidebarState: "expanded"
180
+ }));
181
+ void invokePromise(LayoutOperation2.UpdateComplementary, {
182
+ subject: nextValue
183
+ });
184
+ }
185
+ }, [
186
+ state.complementarySidebarState,
187
+ activeId,
188
+ invokePromise,
189
+ updateState
190
+ ]);
191
+ const data = useMemo(() => activeCompanion && {
192
+ id: activeCompanion.id,
193
+ subject: activeCompanion.data
194
+ }, [
195
+ activeCompanion?.id,
196
+ activeCompanion?.data
197
+ ]);
198
+ useEffect2(() => {
199
+ if (!activeId) {
200
+ void invokePromise(LayoutOperation2.UpdateComplementary, {
201
+ state: "collapsed"
202
+ });
203
+ }
204
+ }, [
205
+ activeId,
206
+ invokePromise
207
+ ]);
208
+ return /* @__PURE__ */ React3.createElement(Main.ComplementarySidebar, {
209
+ label,
210
+ classNames: [
211
+ topbar && "top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]"
212
+ ]
213
+ }, /* @__PURE__ */ React3.createElement(Tabs.Root, {
214
+ classNames: "contents",
215
+ orientation: "vertical",
216
+ value: internalValue
217
+ }, /* @__PURE__ */ React3.createElement("div", {
218
+ "data-tauri-drag-region": true,
219
+ style: iconSize(5),
220
+ className: mx2("absolute z-1 inset-y-0 end-0 w-(--dx-r0-size)!", "py-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] border-s border-subdued-separator", "grid grid-cols-1 grid-rows-[1fr_min-content] bg-r0-surface dx-contain-layout dx-app-drag")
221
+ }, /* @__PURE__ */ React3.createElement(Tabs.Tablist, {
222
+ classNames: "grid grid-cols-1 auto-rows-(--dx-rail-action) overflow-y-auto scrollbar-none gap-1 p-1"
223
+ }, companions.map((companion) => /* @__PURE__ */ React3.createElement(Tabs.Tab, {
224
+ key: getLinkedVariant2(companion.id),
225
+ value: getLinkedVariant2(companion.id),
226
+ asChild: true
227
+ }, /* @__PURE__ */ React3.createElement(IconButton2, {
228
+ classNames: "w-(--dx-rail-action) h-(--dx-rail-action) min-h-0 px-0",
229
+ label: toLocalizedString(companion.properties.label, t),
230
+ icon: companion.properties.icon,
231
+ iconOnly: true,
232
+ tooltipSide: "left",
233
+ "data-value": getLinkedVariant2(companion.id),
234
+ ...companion.properties.joyride && {
235
+ "data-joyride": companion.properties.joyride
236
+ },
237
+ variant: activeId === getLinkedVariant2(companion.id) ? state.complementarySidebarState === "expanded" ? "primary" : "ghost" : "ghost",
238
+ onClick: handleTabClick
239
+ })))), /* @__PURE__ */ React3.createElement("div", {
240
+ className: "grid grid-cols-1 auto-rows-(--dx-rail-item) py-0.5 gap-0.5 overflow-y-auto scrollbar-none",
241
+ style: iconSize(4)
242
+ }, /* @__PURE__ */ React3.createElement(Surface.Surface, {
243
+ type: AppSurface.StatusIndicator
244
+ })), /* @__PURE__ */ React3.createElement("div", {
245
+ className: "hidden lg:grid grid-cols-1 auto-rows-(--dx-rail-action) p-1"
246
+ }, /* @__PURE__ */ React3.createElement(ToggleComplementarySidebarButton, null))), activeId && companions.map((companion) => /* @__PURE__ */ React3.createElement(Tabs.Panel, {
247
+ key: getLinkedVariant2(companion.id),
248
+ value: getLinkedVariant2(companion.id),
249
+ classNames: [
250
+ 'absolute data-[state="inactive"]:-z-[1] overflow-hidden',
251
+ "inset-y-0 start-0 w-full lg:w-(--dx-r1-size)"
252
+ ],
253
+ ...state.complementarySidebarState !== "expanded" && {
254
+ inert: true
255
+ }
256
+ }, /* @__PURE__ */ React3.createElement(ComplementarySidebarPanel, {
257
+ companion,
258
+ activeId,
259
+ data
260
+ })))));
261
+ };
262
+ var ComplementarySidebarPanel = ({ companion, activeId, data }) => {
263
+ const { t } = useTranslation3(meta3.profile.key);
264
+ if (getLinkedVariant2(companion.id) !== activeId && !data) {
265
+ return null;
266
+ }
267
+ return /* @__PURE__ */ React3.createElement(Panel.Root, null, /* @__PURE__ */ React3.createElement(Panel.Toolbar, {
268
+ asChild: true,
269
+ size: "lg"
270
+ }, /* @__PURE__ */ React3.createElement(Toolbar.Root, {
271
+ style: iconSize(5),
272
+ classNames: "bg-header-surface"
273
+ }, /* @__PURE__ */ React3.createElement(IconButton2, {
274
+ classNames: "w-(--dx-rail-action) h-(--dx-rail-action) min-h-0 px-0",
275
+ label: toLocalizedString(companion.properties.label, t),
276
+ icon: companion.properties.icon,
277
+ iconOnly: true,
278
+ tooltipSide: "left",
279
+ "data-value": getLinkedVariant2(companion.id),
280
+ variant: "default"
281
+ }), /* @__PURE__ */ React3.createElement("div", {
282
+ className: "px-1"
283
+ }, toLocalizedString(companion.properties.label, t)))), /* @__PURE__ */ React3.createElement(Panel.Content, {
284
+ classNames: "bg-r1-surface"
285
+ }, /* @__PURE__ */ React3.createElement(Surface.Surface, {
286
+ type: AppSurface.deckCompanion(getLinkedVariant2(companion.id)),
287
+ data,
288
+ fallback: PlankErrorFallback,
289
+ placeholder: /* @__PURE__ */ React3.createElement(PlankLoading, null)
290
+ })));
291
+ };
292
+
293
+ // src/containers/Sidebar/Sidebar.tsx
294
+ import React4, { useMemo as useMemo2 } from "react";
295
+ import { Surface as Surface2 } from "@dxos/app-framework/ui";
296
+ import { AppSurface as AppSurface2 } from "@dxos/app-toolkit/ui";
297
+ import { Main as Main2 } from "@dxos/react-ui";
298
+ import { useBreakpoints as useBreakpoints2, useDeckState as useDeckState3 } from "#hooks";
299
+ import { meta as meta4 } from "#meta";
300
+ import { getMode as getMode2 } from "#types";
301
+ var label2 = [
302
+ "sidebar.title",
303
+ {
304
+ ns: meta4.profile.key
305
+ }
306
+ ];
307
+ var Sidebar = () => {
308
+ const { state, deck } = useDeckState3();
309
+ const { popoverAnchorId, activeDeck: current } = state;
310
+ const breakpoint = useBreakpoints2();
311
+ const layoutMode = getMode2(deck);
312
+ const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
313
+ const navigationData = useMemo2(() => ({
314
+ popoverAnchorId,
315
+ topbar,
316
+ current
317
+ }), [
318
+ popoverAnchorId,
319
+ topbar,
320
+ current
321
+ ]);
322
+ return /* @__PURE__ */ React4.createElement(Main2.NavigationSidebar, {
323
+ label: label2,
324
+ classNames: [
325
+ "grid",
326
+ topbar && "top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]"
327
+ ]
328
+ }, /* @__PURE__ */ React4.createElement(Surface2.Surface, {
329
+ type: AppSurface2.Navigation,
330
+ data: navigationData,
331
+ limit: 1
332
+ }));
333
+ };
334
+
335
+ // src/containers/Deck/DeckContent.tsx
336
+ import React7, { useCallback as useCallback3, useEffect as useEffect3, useRef } from "react";
337
+ import { AttentionCapabilities } from "@dxos/plugin-attention";
338
+ import { Main as Main3, useMediaQuery } from "@dxos/react-ui";
339
+ import { useBreakpoints as useBreakpoints3 } from "#hooks";
340
+
341
+ // src/containers/Deck/Banner.tsx
342
+ import React5 from "react";
343
+ import { Surface as Surface3 } from "@dxos/app-framework/ui";
344
+ import { AppSurface as AppSurface3 } from "@dxos/app-toolkit/ui";
345
+ import { useTranslation as useTranslation4 } from "@dxos/react-ui";
346
+ import { mx as mx3, osTranslations } from "@dxos/ui-theme";
347
+ import { meta as meta5 } from "#meta";
348
+ import { VersionInfo } from "#types";
349
+ var Banner = ({ variant, classNames }) => {
350
+ const { t } = useTranslation4(meta5.profile.key);
351
+ return /* @__PURE__ */ React5.createElement("header", {
352
+ className: mx3("flex items-stretch relative py-1 ps-1 pe-2", variant === "topbar" && "fixed inset-x-0 top-[env(safe-area-inset-top)] h-(--dx-rail-size) border-b border-separator", classNames)
353
+ }, variant === "sidebar" ? /* @__PURE__ */ React5.createElement(CloseSidebarButton, null) : /* @__PURE__ */ React5.createElement(ToggleSidebarButton, null), /* @__PURE__ */ React5.createElement("span", {
354
+ className: "self-center grow ms-1"
355
+ }, t("current-app.name", {
356
+ ns: osTranslations
357
+ })), variant === "topbar" && /* @__PURE__ */ React5.createElement("div", {
358
+ className: "absolute inset-0 pointer-events-none"
359
+ }, /* @__PURE__ */ React5.createElement("div", {
360
+ className: "grid h-full pointer-fine:p-1 max-w-md mx-auto pointer-events-auto"
361
+ }, /* @__PURE__ */ React5.createElement(Surface3.Surface, {
362
+ type: AppSurface3.SearchInput,
363
+ limit: 1
364
+ }))), /* @__PURE__ */ React5.createElement("span", {
365
+ className: "grow"
366
+ }), /* @__PURE__ */ React5.createElement(Surface3.Surface, {
367
+ type: VersionInfo,
368
+ limit: 1
369
+ }));
370
+ };
371
+
372
+ // src/containers/Deck/DeckRoot.tsx
373
+ import { createContext } from "@radix-ui/react-context";
374
+ import React6 from "react";
375
+ var DECK_NAME = "Deck";
376
+ var DECK_ROOT_NAME = "DeckRoot";
377
+ var [DeckProvider, useDeckContext] = createContext(DECK_NAME);
378
+ var DeckRoot = ({ children, ...context }) => {
379
+ return /* @__PURE__ */ React6.createElement(DeckProvider, context, children);
380
+ };
381
+ DeckRoot.displayName = DECK_ROOT_NAME;
382
+
383
+ // src/containers/Deck/DeckContent.tsx
384
+ var DECK_CONTENT_NAME = "DeckContent";
385
+ var DeckContent = ({ children }) => {
386
+ const { state: { sidebarState, complementarySidebarState, complementarySidebarPanel }, deck: { active, fullscreen, solo }, updateState, layoutMode, settings, pluginManager, onLayoutChange } = useDeckContext(DECK_CONTENT_NAME);
387
+ const breakpoint = useBreakpoints3();
388
+ const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
389
+ useEffect3(() => {
390
+ const attention = pluginManager.capabilities.get(AttentionCapabilities.Attention);
391
+ const attended = attention.getCurrent();
392
+ const firstId = solo ?? active[0];
393
+ if (attended.length === 0 && firstId) {
394
+ document.querySelector(`article[data-attendable-id="${firstId}"] button`)?.focus();
395
+ }
396
+ }, []);
397
+ const [isNotMobile] = useMediaQuery("md");
398
+ const shouldRevert = useRef(false);
399
+ useEffect3(() => {
400
+ if (!isNotMobile && layoutMode === "multi") {
401
+ const attention = pluginManager.capabilities.get(AttentionCapabilities.Attention);
402
+ const attended = attention.getCurrent();
403
+ shouldRevert.current = true;
404
+ onLayoutChange({
405
+ subject: attended[0],
406
+ mode: "solo"
407
+ });
408
+ } else if (isNotMobile && layoutMode === "solo" && shouldRevert.current) {
409
+ onLayoutChange({
410
+ revert: true
411
+ });
412
+ }
413
+ }, [
414
+ isNotMobile,
415
+ layoutMode,
416
+ onLayoutChange
417
+ ]);
418
+ useEffect3(() => {
419
+ if (!settings?.enableDeck && layoutMode === "multi") {
420
+ onLayoutChange({
421
+ subject: active[0],
422
+ mode: "solo"
423
+ });
424
+ }
425
+ }, [
426
+ settings?.enableDeck,
427
+ onLayoutChange,
428
+ active,
429
+ layoutMode
430
+ ]);
431
+ const handleNavigationSidebarStateChange = useCallback3((next) => {
432
+ updateState((s) => ({
433
+ ...s,
434
+ sidebarState: next
435
+ }));
436
+ }, [
437
+ updateState
438
+ ]);
439
+ const handleComplementarySidebarStateChange = useCallback3((next) => {
440
+ updateState((s) => ({
441
+ ...s,
442
+ complementarySidebarState: next
443
+ }));
444
+ }, [
445
+ updateState
446
+ ]);
447
+ return /* @__PURE__ */ React7.createElement(Main3.Root, {
448
+ navigationSidebarState: fullscreen ? "closed" : sidebarState,
449
+ complementarySidebarState: fullscreen ? "closed" : complementarySidebarState,
450
+ onNavigationSidebarStateChange: handleNavigationSidebarStateChange,
451
+ onComplementarySidebarStateChange: handleComplementarySidebarStateChange
452
+ }, /* @__PURE__ */ React7.createElement(Sidebar, null), /* @__PURE__ */ React7.createElement(ComplementarySidebar, {
453
+ current: complementarySidebarPanel
454
+ }), /* @__PURE__ */ React7.createElement(Main3.Overlay, null), children, topbar && /* @__PURE__ */ React7.createElement(Banner, {
455
+ variant: "topbar"
456
+ }));
457
+ };
458
+ DeckContent.displayName = DECK_CONTENT_NAME;
459
+
460
+ // src/containers/Deck/DeckViewport.tsx
461
+ import React10, { useCallback as useCallback7, useEffect as useEffect6, useRef as useRef3 } from "react";
462
+ import { Surface as Surface5, useOperationInvoker as useOperationInvoker5 } from "@dxos/app-framework/ui";
463
+ import { LayoutOperation as LayoutOperation5 } from "@dxos/app-toolkit";
464
+ import { addEventListener } from "@dxos/async";
465
+ import { invariant } from "@dxos/invariant";
466
+ import { IconButton as IconButton4, Main as Main4, ScrollArea, useOnTransition, useTranslation as useTranslation6 } from "@dxos/react-ui";
467
+ import { mainIntrinsicSize, mainPaddingTransitions } from "@dxos/react-ui";
468
+ import { Mosaic } from "@dxos/react-ui-mosaic";
469
+ import { hoverableControls, hoverableFocusedWithinControls, mx as mx4 } from "@dxos/ui-theme";
470
+ import { useBreakpoints as useBreakpoints5, useDeckState as useDeckState5 } from "#hooks";
471
+ import { meta as meta8 } from "#meta";
472
+ import { DeckOperation as DeckOperation2, Keyshortcuts, getMode as getMode3 } from "#types";
473
+
474
+ // src/containers/Deck/DeckPlank.tsx
475
+ import { useFocusFinders } from "@fluentui/react-tabster";
476
+ import React9, { memo, useCallback as useCallback6, useEffect as useEffect5, useMemo as useMemo4, useRef as useRef2, useState as useState2 } from "react";
477
+ import { Surface as Surface4 } from "@dxos/app-framework/ui";
478
+ import { AppSurface as AppSurface4 } from "@dxos/app-toolkit/ui";
479
+ import { Splitter } from "@dxos/react-ui";
480
+ import { Companion, Plank } from "#components";
481
+ import { useCompanionSplit } from "#hooks";
482
+
483
+ // src/containers/Deck/PlankControls.tsx
484
+ import React8, { forwardRef, useCallback as useCallback4 } from "react";
485
+ import { useOperationInvoker as useOperationInvoker3 } from "@dxos/app-framework/ui";
486
+ import { LayoutOperation as LayoutOperation3 } from "@dxos/app-toolkit";
487
+ import { ButtonGroup, IconButton as IconButton3, useTranslation as useTranslation5 } from "@dxos/react-ui";
488
+ import { meta as meta6 } from "#meta";
489
+ var plankControlSpacing = "px-2";
490
+ var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedRef) => {
491
+ const { t } = useTranslation5(meta6.profile.key);
492
+ const { invokePromise } = useOperationInvoker3();
493
+ const handleCloseCompanion = useCallback4(() => {
494
+ return invokePromise(LayoutOperation3.UpdateCompanion, {
495
+ subject: null
496
+ });
497
+ }, [
498
+ invokePromise
499
+ ]);
500
+ return /* @__PURE__ */ React8.createElement("div", {
501
+ ref: forwardedRef,
502
+ className: "contents dx-app-no-drag"
503
+ }, /* @__PURE__ */ React8.createElement(PlankControl, {
504
+ label: t("close-companion.label"),
505
+ variant: "ghost",
506
+ icon: "ph--x--regular",
507
+ onClick: handleCloseCompanion,
508
+ classNames: plankControlSpacing
509
+ }));
510
+ });
511
+ var PlankControl = ({ icon, label: label3, ...props }) => {
512
+ return /* @__PURE__ */ React8.createElement(IconButton3, {
513
+ label: label3,
514
+ icon,
515
+ iconOnly: true,
516
+ variant: "ghost",
517
+ tooltipSide: "bottom",
518
+ ...props
519
+ });
520
+ };
521
+ var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant = "default", capabilities, layoutMode, pin, close = false, onClick, ...props }, forwardedRef) => {
522
+ const { t } = useTranslation5(meta6.profile.key);
523
+ const buttonClassNames = variant === "hide-disabled" ? `disabled:hidden ${plankControlSpacing}` : plankControlSpacing;
524
+ const layoutIsAnySolo = !!layoutMode?.startsWith("solo");
525
+ return /* @__PURE__ */ React8.createElement(ButtonGroup, {
526
+ ...props,
527
+ classNames: [
528
+ "dx-app-no-drag opacity-100!",
529
+ classNames
530
+ ],
531
+ ref: forwardedRef
532
+ }, capabilities.deck ? /* @__PURE__ */ React8.createElement(React8.Fragment, null, capabilities.solo && /* @__PURE__ */ React8.createElement(React8.Fragment, null, layoutMode === "solo" && /* @__PURE__ */ React8.createElement(PlankControl, {
533
+ label: t("show-fullscreen-plank.label"),
534
+ classNames: buttonClassNames,
535
+ icon: "ph--corners-out--regular",
536
+ onClick: () => onClick?.("solo--fullscreen")
537
+ }), /* @__PURE__ */ React8.createElement(PlankControl, {
538
+ label: t(layoutMode === "solo--fullscreen" ? "exit-fullscreen.label" : layoutIsAnySolo ? "show-deck-plank.label" : "show-solo-plank.label"),
539
+ classNames: buttonClassNames,
540
+ icon: layoutMode === "solo--fullscreen" ? "ph--corners-in--regular" : layoutIsAnySolo ? "ph--arrows-in-line-horizontal--regular" : "ph--arrows-out-line-horizontal--regular",
541
+ onClick: () => onClick?.(layoutMode === "solo--fullscreen" ? "solo--fullscreen" : "solo")
542
+ })), !layoutIsAnySolo && layoutMode !== "multi" && /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(PlankControl, {
543
+ label: t("increment-start.label"),
544
+ disabled: !capabilities.incrementStart,
545
+ classNames: buttonClassNames,
546
+ icon: "ph--caret-left--regular",
547
+ onClick: () => onClick?.("increment-start")
548
+ }), /* @__PURE__ */ React8.createElement(PlankControl, {
549
+ label: t("increment-end.label"),
550
+ disabled: !capabilities.incrementEnd,
551
+ classNames: buttonClassNames,
552
+ icon: "ph--caret-right--regular",
553
+ onClick: () => onClick?.("increment-end")
554
+ }))) : capabilities.fullscreen && /* @__PURE__ */ React8.createElement(PlankControl, {
555
+ label: t(layoutMode === "solo--fullscreen" ? "exit-fullscreen.label" : "show-fullscreen-plank.label"),
556
+ classNames: buttonClassNames,
557
+ icon: layoutMode === "solo--fullscreen" ? "ph--corners-in--regular" : "ph--corners-out--regular",
558
+ onClick: () => onClick?.("solo--fullscreen")
559
+ }), close && !layoutIsAnySolo && /* @__PURE__ */ React8.createElement(PlankControl, {
560
+ label: t(`${typeof close === "string" ? "minify" : "close"}.label`),
561
+ classNames: buttonClassNames,
562
+ "data-testid": "plankHeading.close",
563
+ icon: close === "minify-start" ? "ph--caret-line-left--regular" : close === "minify-end" ? "ph--caret-line-right--regular" : "ph--x--regular",
564
+ onClick: () => onClick?.("close")
565
+ }), capabilities.companion && /* @__PURE__ */ React8.createElement(ButtonGroup, null, /* @__PURE__ */ React8.createElement(PlankControl, {
566
+ label: t("open-companion.label"),
567
+ classNames: buttonClassNames,
568
+ "data-testid": "plankHeading.companion",
569
+ icon: "ph--square-split-horizontal--regular",
570
+ onClick: () => onClick?.("companion")
571
+ }), /* @__PURE__ */ React8.createElement(PlankControl, {
572
+ label: t("open-companion-vertical.label"),
573
+ classNames: buttonClassNames,
574
+ "data-testid": "plankHeading.companion-vertical",
575
+ icon: "ph--square-split-vertical--regular",
576
+ onClick: () => onClick?.("companion-vertical")
577
+ })), children);
578
+ });
579
+
580
+ // src/containers/Deck/useDeckPlank.ts
581
+ import { useCallback as useCallback5, useEffect as useEffect4, useMemo as useMemo3 } from "react";
582
+ import { useOperationInvoker as useOperationInvoker4 } from "@dxos/app-framework/ui";
583
+ import { LayoutOperation as LayoutOperation4 } from "@dxos/app-toolkit";
584
+ import { useAppGraph } from "@dxos/app-toolkit/ui";
585
+ import { Graph, useActionRunner, useActions, useNode } from "@dxos/plugin-graph";
586
+ import { getLinkedVariant as getLinkedVariant3, useAttention } from "@dxos/react-ui-attention";
587
+ import { useBreakpoints as useBreakpoints4, useCompanions, useDeckState as useDeckState4, useSelectedCompanion, useSelectedCompanionVariant } from "#hooks";
588
+ import { meta as meta7 } from "#meta";
589
+ import { DeckOperation, PLANK_COMPANION_TYPE } from "#types";
590
+ var PLANK_ACTION_DISPOSITIONS = [
591
+ "list-item",
592
+ "list-item-primary",
593
+ "heading-list-item"
594
+ ];
595
+ var useDeckPlank = ({ id, part, layoutMode, active, companionShown, deckEnabled }) => {
596
+ const { graph } = useAppGraph();
597
+ const { invokePromise } = useOperationInvoker4();
598
+ const { state, deck } = useDeckState4();
599
+ const runAction = useActionRunner();
600
+ const breakpoint = useBreakpoints4();
601
+ const node = useNode(graph, id);
602
+ const actions = useActions(graph, node?.id);
603
+ const companions = useCompanions(id);
604
+ const { hasAttention } = useAttention(id);
605
+ const selectedVariant = useSelectedCompanionVariant();
606
+ const showCompanion = !!companionShown && (layoutMode !== "multi" || hasAttention);
607
+ const { companionId } = useSelectedCompanion(companions, showCompanion ? selectedVariant : void 0);
608
+ const resolvedCompanionId = showCompanion ? companionId : void 0;
609
+ const currentCompanion = companions.find((companion) => companion.id === resolvedCompanionId);
610
+ const hasCompanion = !!(resolvedCompanionId && currentCompanion);
611
+ const companionOrientation = deck.companionOrientation ?? "horizontal";
612
+ const index = active ? active.findIndex((entryId) => entryId === id) : -1;
613
+ const isOrdered = !!active && index >= 0;
614
+ const canIncrementStart = isOrdered && index > 0;
615
+ const canIncrementEnd = isOrdered && index < (active?.length ?? 1) - 1;
616
+ const isCompanionNode = node?.type === PLANK_COMPANION_TYPE;
617
+ const capabilities = useMemo3(() => ({
618
+ deck: deckEnabled ?? true,
619
+ solo: breakpoint !== "mobile" && (part === "solo" || part === "multi"),
620
+ incrementStart: canIncrementStart,
621
+ incrementEnd: canIncrementEnd,
622
+ fullscreen: !isCompanionNode,
623
+ // Offer to open the companion (solo, or the attended plank in multi) when one exists and isn't shown.
624
+ companion: !isCompanionNode && companions.length > 0 && !hasCompanion && (layoutMode !== "multi" || hasAttention)
625
+ }), [
626
+ deckEnabled,
627
+ breakpoint,
628
+ part,
629
+ canIncrementStart,
630
+ canIncrementEnd,
631
+ isCompanionNode,
632
+ layoutMode,
633
+ companions.length,
634
+ hasCompanion,
635
+ hasAttention
636
+ ]);
637
+ useEffect4(() => {
638
+ const frame = requestAnimationFrame(() => {
639
+ if (node) {
640
+ void Graph.expand(graph, node.id, "child");
641
+ }
642
+ });
643
+ return () => cancelAnimationFrame(frame);
644
+ }, [
645
+ graph,
646
+ node
647
+ ]);
648
+ const variant = isCompanionNode ? getLinkedVariant3(id) : void 0;
649
+ const sigilActions = useMemo3(() => {
650
+ if (!node) {
651
+ return void 0;
652
+ }
653
+ if (variant) {
654
+ return [];
655
+ }
656
+ return [
657
+ actions.filter((action) => PLANK_ACTION_DISPOSITIONS.includes(action.properties.disposition))
658
+ ].filter((group) => group.length > 0);
659
+ }, [
660
+ actions,
661
+ node,
662
+ variant
663
+ ]);
664
+ const onAction = useCallback5((action) => {
665
+ if (typeof action.data === "function") {
666
+ void runAction(action, {
667
+ parent: node,
668
+ caller: meta7.profile.key
669
+ });
670
+ }
671
+ }, [
672
+ node,
673
+ runAction
674
+ ]);
675
+ const onAdjust = useCallback5((type) => {
676
+ if (type === "close") {
677
+ if (part === "complementary") {
678
+ return invokePromise(LayoutOperation4.UpdateComplementary, {
679
+ state: "collapsed"
680
+ });
681
+ }
682
+ if (active) {
683
+ const closeIndex = active.indexOf(id);
684
+ const toClose = closeIndex !== -1 ? active.slice(closeIndex) : [
685
+ id
686
+ ];
687
+ return invokePromise(LayoutOperation4.Close, {
688
+ subject: toClose
689
+ });
690
+ }
691
+ return invokePromise(LayoutOperation4.Close, {
692
+ subject: [
693
+ id
694
+ ]
695
+ });
696
+ }
697
+ return invokePromise(DeckOperation.Adjust, {
698
+ type,
699
+ id
700
+ });
701
+ }, [
702
+ invokePromise,
703
+ part,
704
+ active,
705
+ id
706
+ ]);
707
+ const onResize = useCallback5((size) => invokePromise(DeckOperation.UpdatePlankSize, {
708
+ id,
709
+ size
710
+ }), [
711
+ invokePromise,
712
+ id
713
+ ]);
714
+ const onScrollIntoView = useCallback5((subject) => invokePromise(LayoutOperation4.ScrollIntoView, {
715
+ subject
716
+ }), [
717
+ invokePromise
718
+ ]);
719
+ const onUpdateCompanion = useCallback5((companion) => invokePromise(LayoutOperation4.UpdateCompanion, {
720
+ subject: companion
721
+ }), [
722
+ invokePromise
723
+ ]);
724
+ return {
725
+ node,
726
+ companions,
727
+ resolvedCompanionId,
728
+ currentCompanion,
729
+ hasCompanion,
730
+ companionOrientation,
731
+ capabilities,
732
+ sigilActions,
733
+ popoverAnchorId: state.popoverAnchorId,
734
+ scrollIntoView: state.scrollIntoView,
735
+ onAction,
736
+ onAdjust,
737
+ onResize,
738
+ onScrollIntoView,
739
+ onUpdateCompanion
740
+ };
741
+ };
742
+
743
+ // src/containers/Deck/DeckPlank.tsx
744
+ var PLANK_LOADING = /* @__PURE__ */ React9.createElement(PlankLoading, null);
745
+ var DeckPlank = /* @__PURE__ */ memo(({ id, part, layoutMode, active, companionShown, settings, path, classNames }) => {
746
+ const { findFirstFocusable } = useFocusFinders();
747
+ const rootRef = useRef2(null);
748
+ const { node, companions, resolvedCompanionId, hasCompanion, companionOrientation, capabilities, sigilActions, popoverAnchorId, scrollIntoView, onAction, onAdjust, onScrollIntoView, onUpdateCompanion } = useDeckPlank({
749
+ id,
750
+ part,
751
+ layoutMode,
752
+ active,
753
+ companionShown,
754
+ deckEnabled: settings?.enableDeck
755
+ });
756
+ const { size: companionSize, onSizeChange: onCompanionSizeChange } = useCompanionSplit(companionOrientation);
757
+ useEffect5(() => {
758
+ if (scrollIntoView === id) {
759
+ rootRef.current?.focus();
760
+ onScrollIntoView(void 0);
761
+ }
762
+ }, [
763
+ scrollIntoView,
764
+ id,
765
+ onScrollIntoView
766
+ ]);
767
+ const handleKeyDown = useCallback6((event) => {
768
+ if (event.target === event.currentTarget) {
769
+ switch (event.key) {
770
+ case "Escape":
771
+ event.currentTarget.closest("main")?.focus();
772
+ break;
773
+ case "Enter":
774
+ findFirstFocusable(event.currentTarget)?.focus();
775
+ break;
776
+ }
777
+ }
778
+ }, [
779
+ findFirstFocusable
780
+ ]);
781
+ const articleData = useMemo4(() => ({
782
+ path
783
+ }), [
784
+ path
785
+ ]);
786
+ const [companionMounted, setCompanionMounted] = useState2(hasCompanion);
787
+ useEffect5(() => {
788
+ if (hasCompanion) {
789
+ setCompanionMounted(true);
790
+ return;
791
+ }
792
+ const timer = setTimeout(() => setCompanionMounted(false), 250);
793
+ return () => clearTimeout(timer);
794
+ }, [
795
+ hasCompanion
796
+ ]);
797
+ const companionControls = useMemo4(() => /* @__PURE__ */ React9.createElement(PlankCompanionControls, {
798
+ primary: id
799
+ }), [
800
+ id
801
+ ]);
802
+ if (!node) {
803
+ return PLANK_LOADING;
804
+ }
805
+ const controls = /* @__PURE__ */ React9.createElement(PlankControls, {
806
+ capabilities,
807
+ layoutMode,
808
+ close: part === "complementary" ? "minify-end" : true,
809
+ onClick: onAdjust
810
+ });
811
+ const navbarEnd = part !== "complementary" ? /* @__PURE__ */ React9.createElement(Surface4.Surface, {
812
+ type: AppSurface4.NavbarEnd,
813
+ data: {
814
+ subject: node.data
815
+ }
816
+ }) : void 0;
817
+ const sigilFooter = /* @__PURE__ */ React9.createElement(Surface4.Surface, {
818
+ type: AppSurface4.MenuFooter,
819
+ data: {
820
+ subject: node.data
821
+ }
822
+ });
823
+ const headless = layoutMode === "solo--fullscreen";
824
+ return /* @__PURE__ */ React9.createElement(Splitter.Root, {
825
+ orientation: companionOrientation,
826
+ anchor: "end",
827
+ mode: hasCompanion ? "split" : "start",
828
+ resizable: hasCompanion,
829
+ size: companionSize,
830
+ minSize: 20,
831
+ onSizeChange: onCompanionSizeChange,
832
+ classNames
833
+ }, /* @__PURE__ */ React9.createElement(Splitter.Panel, {
834
+ position: "start"
835
+ }, /* @__PURE__ */ React9.createElement(Plank, {
836
+ ref: rootRef,
837
+ node,
838
+ attendableId: id,
839
+ related: part === "complementary",
840
+ actions: sigilActions,
841
+ onAction,
842
+ popoverAnchorId,
843
+ articleData,
844
+ controls,
845
+ navbarEnd,
846
+ sigilFooter,
847
+ fallback: PlankErrorFallback,
848
+ placeholder: PLANK_LOADING,
849
+ headless,
850
+ onKeyDown: handleKeyDown
851
+ })), companionMounted && /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(Splitter.Handle, null), /* @__PURE__ */ React9.createElement(Splitter.Panel, {
852
+ position: "end"
853
+ }, /* @__PURE__ */ React9.createElement(Companion, {
854
+ companions,
855
+ value: resolvedCompanionId,
856
+ onValueChange: onUpdateCompanion,
857
+ attendableId: id,
858
+ companionTo: node.data,
859
+ controls: companionControls
860
+ }))));
861
+ });
862
+ DeckPlank.displayName = "DeckPlank";
863
+
864
+ // src/containers/Deck/DeckViewport.tsx
865
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/containers/Deck/DeckViewport.tsx";
866
+ var DECK_VIEWPORT_NAME = "DeckViewport";
867
+ var DEFAULT_PLANK_SIZE = 50;
868
+ var MIN_PLANK_SIZE = 20;
869
+ var MAX_PLANK_SIZE = 120;
870
+ var DeckViewport = ({ children }) => {
871
+ const { state: { sidebarState, complementarySidebarState }, settings, layoutMode } = useDeckContext(DECK_VIEWPORT_NAME);
872
+ const breakpoint = useBreakpoints5();
873
+ const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
874
+ return /* @__PURE__ */ React10.createElement(Main4.Content, {
875
+ bounce: true,
876
+ handlesFocus: true,
877
+ classNames: [
878
+ "grid top-[env(safe-area-inset-top)]!",
879
+ topbar && "top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]!"
880
+ ],
881
+ style: {
882
+ "--main-spacing": settings?.encapsulatedPlanks ? "0.75rem" : "0",
883
+ "--main-sidebar-width": sidebarState === "expanded" ? "var(--dx-nav-sidebar-size)" : sidebarState === "collapsed" ? "var(--dx-l0-size)" : "0",
884
+ "--main-complementary-width": complementarySidebarState === "expanded" ? "var(--dx-complementary-sidebar-size)" : complementarySidebarState === "collapsed" ? "var(--dx-rail-size)" : "0"
885
+ }
886
+ }, children);
887
+ };
888
+ DeckViewport.displayName = DECK_VIEWPORT_NAME;
889
+ var DeckContentEmpty = () => {
890
+ const breakpoint = useBreakpoints5();
891
+ const { deck } = useDeckState5();
892
+ const layoutMode = getMode3(deck);
893
+ const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
894
+ return /* @__PURE__ */ React10.createElement("div", {
895
+ className: "grid place-items-center p-8 relative bg-deck-surface",
896
+ "data-testid": "layoutPlugin.firstRunMessage"
897
+ }, /* @__PURE__ */ React10.createElement(Surface5.Surface, {
898
+ type: Keyshortcuts
899
+ }), !topbar && /* @__PURE__ */ React10.createElement(ToggleSidebarButton2, null));
900
+ };
901
+ var DeckSoloMode = () => {
902
+ const { deck, settings, layoutMode, onLayoutChange } = useDeckContext("DeckSoloMode");
903
+ const { companionOpen, fullscreen, solo } = deck;
904
+ const breakpoint = useBreakpoints5();
905
+ const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
906
+ invariant(solo, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 71, S: void 0, A: ["solo", ""] });
907
+ useEffect6(() => {
908
+ if (!fullscreen) {
909
+ return;
910
+ }
911
+ const handleKeyDown = (event) => {
912
+ if (event.key === "Escape") {
913
+ event.preventDefault();
914
+ event.stopPropagation();
915
+ onLayoutChange({
916
+ mode: "solo--fullscreen"
917
+ });
918
+ }
919
+ };
920
+ document.addEventListener("keydown", handleKeyDown);
921
+ return () => document.removeEventListener("keydown", handleKeyDown);
922
+ }, [
923
+ fullscreen,
924
+ onLayoutChange
925
+ ]);
926
+ return /* @__PURE__ */ React10.createElement("div", {
927
+ className: "relative overflow-hidden bg-deck-surface"
928
+ }, /* @__PURE__ */ React10.createElement(DeckSidebarToggles, {
929
+ topbar,
930
+ fullscreen
931
+ }), fullscreen && /* @__PURE__ */ React10.createElement(ExitFullscreenButton, {
932
+ onExit: () => onLayoutChange({
933
+ mode: "solo--fullscreen"
934
+ })
935
+ }), /* @__PURE__ */ React10.createElement(DeckPlank, {
936
+ id: solo,
937
+ part: "solo",
938
+ layoutMode,
939
+ companionShown: !fullscreen && companionOpen,
940
+ settings,
941
+ classNames: mx4("absolute inset-0", mainIntrinsicSize)
942
+ }));
943
+ };
944
+ var getPlankId = (id) => id;
945
+ var DeckPlankTile = (props) => {
946
+ const id = props.data;
947
+ const { deck, settings, layoutMode } = useDeckContext("DeckPlankTile");
948
+ const { invokePromise } = useOperationInvoker5();
949
+ const handleSizeChange = useCallback7((size) => {
950
+ if (typeof size === "number") {
951
+ void invokePromise(DeckOperation2.UpdatePlankSize, {
952
+ id,
953
+ size: Math.round(size)
954
+ });
955
+ }
956
+ }, [
957
+ invokePromise,
958
+ id
959
+ ]);
960
+ return /* @__PURE__ */ React10.createElement(Mosaic.Tile, {
961
+ ...props,
962
+ classNames: "relative h-full",
963
+ size: deck.plankSizing[id] ?? DEFAULT_PLANK_SIZE,
964
+ minSize: MIN_PLANK_SIZE,
965
+ maxSize: MAX_PLANK_SIZE,
966
+ onSizeChange: handleSizeChange
967
+ }, /* @__PURE__ */ React10.createElement(DeckPlank, {
968
+ id,
969
+ part: "multi",
970
+ layoutMode,
971
+ active: deck.active,
972
+ companionShown: deck.companionOpen,
973
+ settings,
974
+ classNames: "size-full"
975
+ }), /* @__PURE__ */ React10.createElement(Mosaic.ResizeHandle, null));
976
+ };
977
+ var DeckMultiMode = () => {
978
+ const { deck, layoutMode } = useDeckContext("DeckMultiMode");
979
+ const { active, fullscreen } = deck;
980
+ const { state } = useDeckState5();
981
+ const { invokePromise } = useOperationInvoker5();
982
+ const breakpoint = useBreakpoints5();
983
+ const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
984
+ const viewportRef = useRef3(null);
985
+ const scrollLeftRef = useRef3(null);
986
+ useEffect6(() => addEventListener(window, "resize", () => {
987
+ scrollLeftRef.current = null;
988
+ }), []);
989
+ const restoreScroll = useCallback7(() => {
990
+ if (viewportRef.current && scrollLeftRef.current != null) {
991
+ viewportRef.current.scrollLeft = scrollLeftRef.current;
992
+ }
993
+ }, []);
994
+ useOnTransition(layoutMode, (mode) => mode !== "multi", "multi", restoreScroll);
995
+ useEffect6(() => {
996
+ const viewport = viewportRef.current;
997
+ if (!viewport) {
998
+ return;
999
+ }
1000
+ return addEventListener(viewport, "scroll", () => {
1001
+ scrollLeftRef.current = viewport.scrollLeft;
1002
+ });
1003
+ }, []);
1004
+ useEffect6(() => {
1005
+ const id = state.scrollIntoView;
1006
+ const viewport = viewportRef.current;
1007
+ if (!id || !viewport) {
1008
+ return;
1009
+ }
1010
+ const tile = viewport.querySelector(`[data-object-id="${CSS.escape(id)}"]`);
1011
+ if (tile) {
1012
+ const offset = tile.getBoundingClientRect().left - viewport.getBoundingClientRect().left + viewport.scrollLeft;
1013
+ viewport.scrollTo({
1014
+ left: offset,
1015
+ behavior: "smooth"
1016
+ });
1017
+ }
1018
+ void invokePromise(LayoutOperation5.ScrollIntoView, {
1019
+ subject: void 0
1020
+ });
1021
+ }, [
1022
+ state.scrollIntoView,
1023
+ invokePromise
1024
+ ]);
1025
+ return /* @__PURE__ */ React10.createElement("div", {
1026
+ className: "relative bg-deck-surface overflow-hidden"
1027
+ }, /* @__PURE__ */ React10.createElement(DeckSidebarToggles, {
1028
+ topbar,
1029
+ fullscreen
1030
+ }), /* @__PURE__ */ React10.createElement(Mosaic.Root, null, /* @__PURE__ */ React10.createElement(Mosaic.Container, {
1031
+ orientation: "horizontal",
1032
+ classNames: [
1033
+ "absolute inset-0",
1034
+ mainPaddingTransitions
1035
+ ]
1036
+ }, /* @__PURE__ */ React10.createElement(ScrollArea.Root, {
1037
+ orientation: "horizontal",
1038
+ classNames: "size-full"
1039
+ }, /* @__PURE__ */ React10.createElement(ScrollArea.Viewport, {
1040
+ ref: viewportRef
1041
+ }, /* @__PURE__ */ React10.createElement(Mosaic.Stack, {
1042
+ orientation: "horizontal",
1043
+ classNames: "h-full gap-(--main-spacing) px-(--main-spacing)",
1044
+ getId: getPlankId,
1045
+ items: active,
1046
+ Tile: DeckPlankTile,
1047
+ draggable: false
1048
+ }))))));
1049
+ };
1050
+ var sidebarToggleStyles = "h-(--dx-rail-item) w-(--dx-rail-item) absolute bottom-2 z-[1] bg-deck-surface! lg:hidden";
1051
+ var ToggleSidebarButton2 = () => /* @__PURE__ */ React10.createElement(ToggleSidebarButton, {
1052
+ classNames: mx4(sidebarToggleStyles, "left-2")
1053
+ });
1054
+ var ToggleComplementarySidebarButton2 = () => /* @__PURE__ */ React10.createElement(ToggleComplementarySidebarButton, {
1055
+ classNames: mx4(sidebarToggleStyles, "right-2")
1056
+ });
1057
+ var ExitFullscreenButton = ({ onExit }) => {
1058
+ const { t } = useTranslation6(meta8.profile.key);
1059
+ return /* @__PURE__ */ React10.createElement("div", {
1060
+ className: mx4("fixed top-2 right-2 z-[1]", hoverableControls, hoverableFocusedWithinControls, "transition-opacity opacity-(--controls-opacity)")
1061
+ }, /* @__PURE__ */ React10.createElement(IconButton4, {
1062
+ label: t("exit-fullscreen.label"),
1063
+ icon: "ph--corners-in--regular",
1064
+ iconOnly: true,
1065
+ variant: "ghost",
1066
+ tooltipSide: "bottom",
1067
+ onClick: onExit
1068
+ }));
1069
+ };
1070
+ var DeckSidebarToggles = ({ topbar, fullscreen }) => {
1071
+ if (topbar || fullscreen) {
1072
+ return null;
1073
+ }
1074
+ return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(ToggleSidebarButton2, null), /* @__PURE__ */ React10.createElement(ToggleComplementarySidebarButton2, null));
1075
+ };
1076
+
1077
+ // src/containers/Deck/Deck.tsx
1078
+ var Deck = {
1079
+ Root: DeckRoot,
1080
+ Content: DeckContent,
1081
+ Viewport: DeckViewport,
1082
+ ContentEmpty: DeckContentEmpty,
1083
+ MultiMode: DeckMultiMode,
1084
+ SoloMode: DeckSoloMode
1085
+ };
1086
+
1087
+ export {
1088
+ PlankErrorFallback,
1089
+ ToggleSidebarButton,
1090
+ CloseSidebarButton,
1091
+ ToggleComplementarySidebarButton,
1092
+ ComplementarySidebar,
1093
+ Sidebar,
1094
+ Deck
1095
+ };
1096
+ //# sourceMappingURL=chunk-Z2B5RSVI.mjs.map