@dxos/plugin-deck 0.8.4-main.c1de068 → 0.8.4-main.c351d160a8

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 (328) hide show
  1. package/dist/lib/browser/Banner-AJW6225V.mjs +14 -0
  2. package/dist/lib/browser/Banner-AJW6225V.mjs.map +7 -0
  3. package/dist/lib/browser/DeckSettings-HSSQKFNE.mjs +96 -0
  4. package/dist/lib/browser/DeckSettings-HSSQKFNE.mjs.map +7 -0
  5. package/dist/lib/browser/app-graph-builder-MP6INIM2.mjs +123 -0
  6. package/dist/lib/browser/app-graph-builder-MP6INIM2.mjs.map +7 -0
  7. package/dist/lib/browser/check-app-scheme-AUNCD2Y6.mjs +33 -0
  8. package/dist/lib/browser/check-app-scheme-AUNCD2Y6.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-3P2FJVXC.mjs +278 -0
  10. package/dist/lib/browser/chunk-3P2FJVXC.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-BJDEG7YZ.mjs +74 -0
  12. package/dist/lib/browser/chunk-BJDEG7YZ.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-L3RYMAV7.mjs +16 -0
  14. package/dist/lib/browser/chunk-L3RYMAV7.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-TAHLKBDO.mjs +187 -0
  16. package/dist/lib/browser/chunk-TAHLKBDO.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-WTNYSXY5.mjs +1388 -0
  18. package/dist/lib/browser/chunk-WTNYSXY5.mjs.map +7 -0
  19. package/dist/lib/browser/index.mjs +90 -74
  20. package/dist/lib/browser/index.mjs.map +4 -4
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/operation-resolver-2TEGT4PG.mjs +639 -0
  23. package/dist/lib/browser/operation-resolver-2TEGT4PG.mjs.map +7 -0
  24. package/dist/lib/browser/react-root-XBFHPSCP.mjs +48 -0
  25. package/dist/lib/browser/react-root-XBFHPSCP.mjs.map +7 -0
  26. package/dist/lib/browser/react-surface-4J3BZNT2.mjs +44 -0
  27. package/dist/lib/browser/react-surface-4J3BZNT2.mjs.map +7 -0
  28. package/dist/lib/browser/settings-PTMGCSJH.mjs +40 -0
  29. package/dist/lib/browser/settings-PTMGCSJH.mjs.map +7 -0
  30. package/dist/lib/browser/state-MA4SQ7BE.mjs +106 -0
  31. package/dist/lib/browser/state-MA4SQ7BE.mjs.map +7 -0
  32. package/dist/lib/browser/toolkit-6B34QFU3.mjs +55 -0
  33. package/dist/lib/browser/toolkit-6B34QFU3.mjs.map +7 -0
  34. package/dist/lib/browser/types/index.mjs +14 -8
  35. package/dist/lib/browser/url-handler-FEUFPQIP.mjs +98 -0
  36. package/dist/lib/browser/url-handler-FEUFPQIP.mjs.map +7 -0
  37. package/dist/lib/node-esm/Banner-XBH2IIDR.mjs +15 -0
  38. package/dist/lib/node-esm/Banner-XBH2IIDR.mjs.map +7 -0
  39. package/dist/lib/node-esm/DeckSettings-DJRFLKQS.mjs +97 -0
  40. package/dist/lib/node-esm/DeckSettings-DJRFLKQS.mjs.map +7 -0
  41. package/dist/lib/node-esm/app-graph-builder-ACHG5HY7.mjs +124 -0
  42. package/dist/lib/node-esm/app-graph-builder-ACHG5HY7.mjs.map +7 -0
  43. package/dist/lib/node-esm/check-app-scheme-WN76GWVC.mjs +34 -0
  44. package/dist/lib/node-esm/check-app-scheme-WN76GWVC.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-CQ3XYTNJ.mjs +1389 -0
  46. package/dist/lib/node-esm/chunk-CQ3XYTNJ.mjs.map +7 -0
  47. package/dist/lib/node-esm/chunk-DGTRKKWZ.mjs +76 -0
  48. package/dist/lib/node-esm/chunk-DGTRKKWZ.mjs.map +7 -0
  49. package/dist/lib/node-esm/chunk-EMU4VIPH.mjs +188 -0
  50. package/dist/lib/node-esm/chunk-EMU4VIPH.mjs.map +7 -0
  51. package/dist/lib/node-esm/chunk-GZJAQ5IP.mjs +279 -0
  52. package/dist/lib/node-esm/chunk-GZJAQ5IP.mjs.map +7 -0
  53. package/dist/lib/node-esm/chunk-XCNF4COU.mjs +18 -0
  54. package/dist/lib/node-esm/chunk-XCNF4COU.mjs.map +7 -0
  55. package/dist/lib/node-esm/index.mjs +185 -0
  56. package/dist/lib/node-esm/index.mjs.map +7 -0
  57. package/dist/lib/node-esm/meta.json +1 -0
  58. package/dist/lib/node-esm/operation-resolver-GCMCCI7A.mjs +640 -0
  59. package/dist/lib/node-esm/operation-resolver-GCMCCI7A.mjs.map +7 -0
  60. package/dist/lib/node-esm/react-root-32LZ6APH.mjs +49 -0
  61. package/dist/lib/node-esm/react-root-32LZ6APH.mjs.map +7 -0
  62. package/dist/lib/node-esm/react-surface-CO4ZDZKM.mjs +45 -0
  63. package/dist/lib/node-esm/react-surface-CO4ZDZKM.mjs.map +7 -0
  64. package/dist/lib/node-esm/settings-LPPFLXNJ.mjs +41 -0
  65. package/dist/lib/node-esm/settings-LPPFLXNJ.mjs.map +7 -0
  66. package/dist/lib/node-esm/state-KNRU3GDC.mjs +107 -0
  67. package/dist/lib/node-esm/state-KNRU3GDC.mjs.map +7 -0
  68. package/dist/lib/node-esm/toolkit-SOWYKJY3.mjs +56 -0
  69. package/dist/lib/node-esm/toolkit-SOWYKJY3.mjs.map +7 -0
  70. package/dist/lib/node-esm/types/index.mjs +39 -0
  71. package/dist/lib/node-esm/url-handler-4LEB7UWF.mjs +99 -0
  72. package/dist/lib/node-esm/url-handler-4LEB7UWF.mjs.map +7 -0
  73. package/dist/types/src/DeckPlugin.d.ts +2 -1
  74. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  76. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  77. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  78. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts +5 -0
  80. package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/check-app-scheme/index.d.ts +3 -0
  82. package/dist/types/src/capabilities/check-app-scheme/index.d.ts.map +1 -0
  83. package/dist/types/src/capabilities/index.d.ts +8 -13
  84. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  85. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  86. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  87. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  88. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  89. package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
  90. package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
  92. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  94. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  96. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/settings/index.d.ts +19 -0
  98. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  99. package/dist/types/src/capabilities/settings/settings.d.ts +22 -0
  100. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  101. package/dist/types/src/capabilities/state/index.d.ts +172 -0
  102. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  103. package/dist/types/src/capabilities/state/state.d.ts +175 -0
  104. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
  106. package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
  107. package/dist/types/src/capabilities/toolkit/toolkit.d.ts +27 -0
  108. package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
  109. package/dist/types/src/capabilities/tools/index.d.ts +3 -0
  110. package/dist/types/src/capabilities/tools/index.d.ts.map +1 -0
  111. package/dist/types/src/capabilities/tools/tools.d.ts +12 -0
  112. package/dist/types/src/capabilities/tools/tools.d.ts.map +1 -0
  113. package/dist/types/src/capabilities/url-handler/index.d.ts +3 -0
  114. package/dist/types/src/capabilities/url-handler/index.d.ts.map +1 -0
  115. package/dist/types/src/capabilities/url-handler/url-handler.d.ts +5 -0
  116. package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -0
  117. package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
  118. package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
  119. package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
  120. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -3
  121. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  122. package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +75 -0
  123. package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
  124. package/dist/types/src/components/DeckLayout/DeckMain.d.ts +3 -0
  125. package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -0
  126. package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +1 -1
  127. package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +1 -1
  128. package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -1
  129. package/dist/types/src/components/DeckLayout/Toast.d.ts +7 -2
  130. package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
  131. package/dist/types/src/components/Plank/Plank.d.ts +6 -6
  132. package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
  133. package/dist/types/src/components/Plank/Plank.stories.d.ts +105 -5
  134. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
  135. package/dist/types/src/components/Plank/PlankControls.d.ts +1 -1
  136. package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
  137. package/dist/types/src/components/Plank/PlankError.d.ts +6 -4
  138. package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
  139. package/dist/types/src/components/Plank/PlankHeading.d.ts +3 -3
  140. package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
  141. package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
  142. package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +1 -1
  143. package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -1
  144. package/dist/types/src/components/fragments.d.ts +4 -1
  145. package/dist/types/src/components/fragments.d.ts.map +1 -1
  146. package/dist/types/src/components/index.d.ts +0 -1
  147. package/dist/types/src/components/index.d.ts.map +1 -1
  148. package/dist/types/src/containers/Banner/Banner.d.ts +2 -0
  149. package/dist/types/src/containers/Banner/Banner.d.ts.map +1 -0
  150. package/dist/types/src/containers/Banner/index.d.ts +3 -0
  151. package/dist/types/src/containers/Banner/index.d.ts.map +1 -0
  152. package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts +8 -0
  153. package/dist/types/src/containers/DeckSettings/DeckSettings.d.ts.map +1 -0
  154. package/dist/types/src/containers/DeckSettings/index.d.ts +3 -0
  155. package/dist/types/src/containers/DeckSettings/index.d.ts.map +1 -0
  156. package/dist/types/src/containers/index.d.ts +4 -0
  157. package/dist/types/src/containers/index.d.ts.map +1 -0
  158. package/dist/types/src/hooks/index.d.ts +2 -0
  159. package/dist/types/src/hooks/index.d.ts.map +1 -1
  160. package/dist/types/src/hooks/useDeckCompanions.d.ts +3 -4
  161. package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
  162. package/dist/types/src/hooks/useDeckState.d.ts +17 -0
  163. package/dist/types/src/hooks/useDeckState.d.ts.map +1 -0
  164. package/dist/types/src/hooks/useHoistStatusbar.d.ts +1 -1
  165. package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
  166. package/dist/types/src/hooks/useMainSize.d.ts +2 -2
  167. package/dist/types/src/hooks/useNodeActionExpander.d.ts +1 -1
  168. package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
  169. package/dist/types/src/hooks/useSelectedCompanion.d.ts +13 -0
  170. package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -0
  171. package/dist/types/src/index.d.ts +1 -2
  172. package/dist/types/src/index.d.ts.map +1 -1
  173. package/dist/types/src/layout.d.ts +1 -7
  174. package/dist/types/src/layout.d.ts.map +1 -1
  175. package/dist/types/src/meta.d.ts +2 -3
  176. package/dist/types/src/meta.d.ts.map +1 -1
  177. package/dist/types/src/translations.d.ts +4 -1
  178. package/dist/types/src/translations.d.ts.map +1 -1
  179. package/dist/types/src/{capabilities → types}/capabilities.d.ts +96 -90
  180. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  181. package/dist/types/src/types/events.d.ts +7 -0
  182. package/dist/types/src/types/events.d.ts.map +1 -0
  183. package/dist/types/src/types/index.d.ts +2 -0
  184. package/dist/types/src/types/index.d.ts.map +1 -1
  185. package/dist/types/src/types/schema.d.ts +103 -41
  186. package/dist/types/src/types/schema.d.ts.map +1 -1
  187. package/dist/types/src/util/set-active.d.ts +18 -3
  188. package/dist/types/src/util/set-active.d.ts.map +1 -1
  189. package/dist/types/tsconfig.tsbuildinfo +1 -1
  190. package/package.json +61 -47
  191. package/src/DeckPlugin.ts +46 -61
  192. package/src/capabilities/app-graph-builder/app-graph-builder.ts +119 -0
  193. package/src/capabilities/app-graph-builder/index.ts +7 -0
  194. package/src/capabilities/check-app-scheme/check-app-scheme.ts +45 -0
  195. package/src/capabilities/check-app-scheme/index.ts +7 -0
  196. package/src/capabilities/index.ts +9 -13
  197. package/src/capabilities/operation-resolver/index.ts +10 -0
  198. package/src/capabilities/operation-resolver/operation-resolver.ts +558 -0
  199. package/src/capabilities/react-root/index.ts +7 -0
  200. package/src/capabilities/react-root/react-root.tsx +47 -0
  201. package/src/capabilities/react-surface/index.ts +7 -0
  202. package/src/capabilities/react-surface/react-surface.tsx +38 -0
  203. package/src/capabilities/settings/index.ts +7 -0
  204. package/src/capabilities/settings/settings.ts +39 -0
  205. package/src/capabilities/state/index.ts +7 -0
  206. package/src/capabilities/state/state.ts +105 -0
  207. package/src/capabilities/toolkit/index.ts +7 -0
  208. package/src/capabilities/toolkit/toolkit.ts +64 -0
  209. package/src/capabilities/tools/index.ts +7 -0
  210. package/src/capabilities/tools/tools.ts +91 -0
  211. package/src/capabilities/url-handler/index.ts +7 -0
  212. package/src/capabilities/url-handler/url-handler.ts +98 -0
  213. package/src/components/DeckLayout/ActiveNode.tsx +3 -2
  214. package/src/components/DeckLayout/Banner.tsx +12 -12
  215. package/src/components/DeckLayout/ContentEmpty.tsx +6 -7
  216. package/src/components/DeckLayout/DeckLayout.stories.tsx +53 -0
  217. package/src/components/DeckLayout/DeckLayout.tsx +18 -285
  218. package/src/components/DeckLayout/DeckMain.tsx +287 -0
  219. package/src/components/DeckLayout/Dialog.tsx +22 -13
  220. package/src/components/DeckLayout/Fallback.tsx +4 -8
  221. package/src/components/DeckLayout/Popover.tsx +76 -32
  222. package/src/components/DeckLayout/StatusBar.tsx +4 -4
  223. package/src/components/DeckLayout/Toast.tsx +30 -5
  224. package/src/components/Plank/Plank.stories.tsx +26 -17
  225. package/src/components/Plank/Plank.tsx +111 -70
  226. package/src/components/Plank/PlankControls.tsx +12 -14
  227. package/src/components/Plank/PlankError.tsx +33 -18
  228. package/src/components/Plank/PlankHeading.tsx +45 -51
  229. package/src/components/Plank/PlankLoading.tsx +1 -1
  230. package/src/components/Sidebar/ComplementarySidebar.tsx +80 -53
  231. package/src/components/Sidebar/Sidebar.tsx +9 -9
  232. package/src/components/Sidebar/SidebarButton.tsx +40 -33
  233. package/src/components/fragments.ts +10 -5
  234. package/src/components/index.ts +0 -1
  235. package/src/containers/Banner/Banner.tsx +5 -0
  236. package/src/containers/Banner/index.ts +7 -0
  237. package/src/containers/DeckSettings/DeckSettings.tsx +113 -0
  238. package/src/containers/DeckSettings/index.ts +7 -0
  239. package/src/containers/index.ts +8 -0
  240. package/src/hooks/index.ts +2 -0
  241. package/src/hooks/useCompanions.ts +2 -2
  242. package/src/hooks/useDeckCompanions.ts +8 -11
  243. package/src/hooks/useDeckState.ts +82 -0
  244. package/src/hooks/useHoistStatusbar.ts +4 -5
  245. package/src/hooks/useMainSize.ts +2 -2
  246. package/src/hooks/useNodeActionExpander.ts +4 -4
  247. package/src/hooks/useSelectedCompanion.ts +32 -0
  248. package/src/index.ts +1 -2
  249. package/src/layout.ts +1 -14
  250. package/src/meta.ts +8 -5
  251. package/src/translations.ts +4 -1
  252. package/src/types/capabilities.ts +33 -0
  253. package/src/types/events.ts +21 -0
  254. package/src/types/index.ts +2 -0
  255. package/src/types/schema.ts +99 -26
  256. package/src/util/layoutAppliesTopbar.ts +1 -1
  257. package/src/util/overscroll.ts +3 -3
  258. package/src/util/set-active.ts +49 -29
  259. package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs +0 -152
  260. package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs.map +0 -7
  261. package/dist/lib/browser/check-app-scheme-57U62A3A.mjs +0 -32
  262. package/dist/lib/browser/check-app-scheme-57U62A3A.mjs.map +0 -7
  263. package/dist/lib/browser/chunk-CNTGBCMK.mjs +0 -145
  264. package/dist/lib/browser/chunk-CNTGBCMK.mjs.map +0 -7
  265. package/dist/lib/browser/chunk-D7KTFCUV.mjs +0 -1494
  266. package/dist/lib/browser/chunk-D7KTFCUV.mjs.map +0 -7
  267. package/dist/lib/browser/chunk-F5BQOOEG.mjs +0 -160
  268. package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +0 -7
  269. package/dist/lib/browser/chunk-JFTXENFN.mjs +0 -129
  270. package/dist/lib/browser/chunk-JFTXENFN.mjs.map +0 -7
  271. package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
  272. package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
  273. package/dist/lib/browser/chunk-QDZO4AJ4.mjs +0 -127
  274. package/dist/lib/browser/chunk-QDZO4AJ4.mjs.map +0 -7
  275. package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
  276. package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
  277. package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs +0 -521
  278. package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs.map +0 -7
  279. package/dist/lib/browser/react-root-PO64J7ML.mjs +0 -43
  280. package/dist/lib/browser/react-root-PO64J7ML.mjs.map +0 -7
  281. package/dist/lib/browser/react-surface-E45YOVF5.mjs +0 -40
  282. package/dist/lib/browser/react-surface-E45YOVF5.mjs.map +0 -7
  283. package/dist/lib/browser/settings-6AJZPZPM.mjs +0 -29
  284. package/dist/lib/browser/settings-6AJZPZPM.mjs.map +0 -7
  285. package/dist/lib/browser/state-MVDYX77Y.mjs +0 -12
  286. package/dist/lib/browser/tools-TKQDPCHJ.mjs +0 -88
  287. package/dist/lib/browser/tools-TKQDPCHJ.mjs.map +0 -7
  288. package/dist/lib/browser/url-handler-7L7M6IKH.mjs +0 -70
  289. package/dist/lib/browser/url-handler-7L7M6IKH.mjs.map +0 -7
  290. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  291. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  292. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  293. package/dist/types/src/capabilities/check-app-scheme.d.ts +0 -4
  294. package/dist/types/src/capabilities/check-app-scheme.d.ts.map +0 -1
  295. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  296. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  297. package/dist/types/src/capabilities/react-root.d.ts +0 -7
  298. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  299. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  300. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  301. package/dist/types/src/capabilities/settings.d.ts +0 -4
  302. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  303. package/dist/types/src/capabilities/state.d.ts +0 -101
  304. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  305. package/dist/types/src/capabilities/tools.d.ts +0 -11
  306. package/dist/types/src/capabilities/tools.d.ts.map +0 -1
  307. package/dist/types/src/capabilities/url-handler.d.ts +0 -4
  308. package/dist/types/src/capabilities/url-handler.d.ts.map +0 -1
  309. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +0 -6
  310. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +0 -1
  311. package/dist/types/src/components/DeckSettings/index.d.ts +0 -2
  312. package/dist/types/src/components/DeckSettings/index.d.ts.map +0 -1
  313. package/dist/types/src/events.d.ts +0 -4
  314. package/dist/types/src/events.d.ts.map +0 -1
  315. package/src/capabilities/app-graph-builder.ts +0 -141
  316. package/src/capabilities/capabilities.ts +0 -14
  317. package/src/capabilities/check-app-scheme.ts +0 -40
  318. package/src/capabilities/intent-resolver.ts +0 -468
  319. package/src/capabilities/react-root.tsx +0 -38
  320. package/src/capabilities/react-surface.tsx +0 -30
  321. package/src/capabilities/settings.ts +0 -26
  322. package/src/capabilities/state.ts +0 -104
  323. package/src/capabilities/tools.ts +0 -81
  324. package/src/capabilities/url-handler.ts +0 -59
  325. package/src/components/DeckSettings/DeckSettings.tsx +0 -88
  326. package/src/components/DeckSettings/index.ts +0 -5
  327. package/src/events.ts +0 -11
  328. /package/dist/lib/{browser/state-MVDYX77Y.mjs.map → node-esm/types/index.mjs.map} +0 -0
@@ -0,0 +1,1388 @@
1
+ import {
2
+ useBreakpoints,
3
+ useCompanions,
4
+ useDeckCompanions,
5
+ useDeckState,
6
+ useHoistStatusbar,
7
+ useMainSize,
8
+ useNodeActionExpander,
9
+ useSelectedCompanion
10
+ } from "./chunk-TAHLKBDO.mjs";
11
+ import {
12
+ calculateOverscroll,
13
+ layoutAppliesTopbar
14
+ } from "./chunk-BJDEG7YZ.mjs";
15
+ import {
16
+ DeckCapabilities,
17
+ DeckOperation,
18
+ PLANK_COMPANION_TYPE,
19
+ getMode
20
+ } from "./chunk-3P2FJVXC.mjs";
21
+ import {
22
+ meta
23
+ } from "./chunk-L3RYMAV7.mjs";
24
+
25
+ // src/components/DeckLayout/Banner.tsx
26
+ import React9 from "react";
27
+ import { Surface as Surface5 } from "@dxos/app-framework/ui";
28
+ import { useTranslation as useTranslation6 } from "@dxos/react-ui";
29
+ import { mx as mx5, osTranslations } from "@dxos/ui-theme";
30
+
31
+ // src/components/Sidebar/ComplementarySidebar.tsx
32
+ import React7, { Fragment as Fragment2, useCallback as useCallback5, useEffect as useEffect3, useMemo as useMemo3, useState as useState2 } from "react";
33
+ import { Surface as Surface3, useOperationInvoker as useOperationInvoker5 } from "@dxos/app-framework/ui";
34
+ import { LayoutOperation as LayoutOperation4, getCompanionVariant as getCompanionVariant4 } from "@dxos/app-toolkit";
35
+ import { IconButton as IconButton4, Main, ScrollArea, toLocalizedString as toLocalizedString2, useTranslation as useTranslation5 } from "@dxos/react-ui";
36
+ import { Tabs } from "@dxos/react-ui-tabs";
37
+ import { largeIconSize as largeIconSize2, mx as mx4 } from "@dxos/ui-theme";
38
+
39
+ // src/components/Plank/Plank.tsx
40
+ import { useFocusFinders } from "@fluentui/react-tabster";
41
+ import React5, { memo as memo2, useCallback as useCallback3, useLayoutEffect, useMemo as useMemo2, useRef } from "react";
42
+ import { Surface as Surface2, useOperationInvoker as useOperationInvoker3 } from "@dxos/app-framework/ui";
43
+ import { LayoutOperation as LayoutOperation2, getCompanionVariant as getCompanionVariant2 } from "@dxos/app-toolkit";
44
+ import { useAppGraph as useAppGraph2 } from "@dxos/app-toolkit/ui";
45
+ import { debounce } from "@dxos/async";
46
+ import { useNode } from "@dxos/plugin-graph";
47
+ import { useAttentionAttributes } from "@dxos/react-ui-attention";
48
+ import { StackItem as StackItem2, railGridHorizontal } from "@dxos/react-ui-stack";
49
+ import { mainIntrinsicSize, mx as mx3 } from "@dxos/ui-theme";
50
+
51
+ // src/components/Plank/PlankError.tsx
52
+ import React4, { useEffect as useEffect2, useState } from "react";
53
+ import { ErrorFallback, useTranslation as useTranslation3 } from "@dxos/react-ui";
54
+ import "@dxos/ui-theme";
55
+
56
+ // src/components/Plank/PlankHeading.tsx
57
+ import React2, { Fragment, memo, useCallback as useCallback2, useEffect, useMemo } from "react";
58
+ import { Surface, useOperationInvoker as useOperationInvoker2 } from "@dxos/app-framework/ui";
59
+ import { LayoutOperation, getCompanionVariant } from "@dxos/app-toolkit";
60
+ import { useAppGraph } from "@dxos/app-toolkit/ui";
61
+ import { Graph, useActionRunner } from "@dxos/plugin-graph";
62
+ import { Icon, IconButton as IconButton2, Popover, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
63
+ import { StackItem } from "@dxos/react-ui-stack";
64
+ import { TextTooltip } from "@dxos/react-ui-text-tooltip";
65
+ import { hoverableControls, hoverableFocusedWithinControls, largeIconSize } from "@dxos/ui-theme";
66
+
67
+ // src/components/fragments.ts
68
+ import { mx } from "@dxos/ui-theme";
69
+ var soloInlinePadding = "ps-[calc(env(safe-area-inset-left)+.25rem)] pe-[calc(env(safe-area-inset-right)+.25rem)]";
70
+ var sidebarToggleStyles = "h-(--dx-rail-item) w-(--dx-rail-item) absolute bottom-2 z-[1] !bg-deck-surface lg:hidden";
71
+ var fixedSidebarToggleStyles = mx(sidebarToggleStyles, "left-2");
72
+ var fixedComplementarySidebarToggleStyles = mx(sidebarToggleStyles, "right-2");
73
+
74
+ // src/components/Plank/PlankControls.tsx
75
+ import React, { forwardRef, useCallback } from "react";
76
+ import { useOperationInvoker } from "@dxos/app-framework/ui";
77
+ import { ButtonGroup, IconButton, useTranslation } from "@dxos/react-ui";
78
+ var PlankControl = ({ icon, label: label3, ...props }) => {
79
+ return /* @__PURE__ */ React.createElement(IconButton, {
80
+ label: label3,
81
+ icon,
82
+ iconOnly: true,
83
+ variant: "ghost",
84
+ tooltipSide: "bottom",
85
+ ...props
86
+ });
87
+ };
88
+ var plankControlSpacing = "px-2";
89
+ var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedRef) => {
90
+ const { t } = useTranslation(meta.id);
91
+ const { invokePromise } = useOperationInvoker();
92
+ const handleCloseCompanion = useCallback(() => {
93
+ return invokePromise(DeckOperation.ChangeCompanion, {
94
+ companion: null
95
+ });
96
+ }, [
97
+ invokePromise
98
+ ]);
99
+ return /* @__PURE__ */ React.createElement("div", {
100
+ ref: forwardedRef,
101
+ className: "contents dx-app-no-drag"
102
+ }, /* @__PURE__ */ React.createElement(PlankControl, {
103
+ label: t("close companion label"),
104
+ variant: "ghost",
105
+ icon: "ph--x--regular",
106
+ onClick: handleCloseCompanion,
107
+ classNames: plankControlSpacing
108
+ }));
109
+ });
110
+ var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant = "default", capabilities, layoutMode, pin, close = false, onClick, ...props }, forwardedRef) => {
111
+ const { t } = useTranslation(meta.id);
112
+ const buttonClassNames = variant === "hide-disabled" ? `disabled:hidden ${plankControlSpacing}` : plankControlSpacing;
113
+ const layoutIsAnySolo = !!layoutMode?.startsWith("solo");
114
+ return /* @__PURE__ */ React.createElement(ButtonGroup, {
115
+ ...props,
116
+ classNames: [
117
+ "dx-app-no-drag opacity-100!",
118
+ classNames
119
+ ],
120
+ ref: forwardedRef
121
+ }, capabilities.deck ? /* @__PURE__ */ React.createElement(React.Fragment, null, capabilities.solo && /* @__PURE__ */ React.createElement(React.Fragment, null, layoutMode === "solo" && /* @__PURE__ */ React.createElement(PlankControl, {
122
+ label: t("show fullscreen plank label"),
123
+ classNames: buttonClassNames,
124
+ icon: "ph--corners-out--regular",
125
+ onClick: () => onClick?.("solo--fullscreen")
126
+ }), /* @__PURE__ */ React.createElement(PlankControl, {
127
+ label: t(layoutMode === "solo--fullscreen" ? "exit fullscreen label" : layoutIsAnySolo ? "show deck plank label" : "show solo plank label"),
128
+ classNames: buttonClassNames,
129
+ icon: layoutMode === "solo--fullscreen" ? "ph--corners-in--regular" : layoutIsAnySolo ? "ph--arrows-in-line-horizontal--regular" : "ph--arrows-out-line-horizontal--regular",
130
+ onClick: () => onClick?.(layoutMode === "solo--fullscreen" ? "solo--fullscreen" : "solo")
131
+ })), !layoutIsAnySolo && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(PlankControl, {
132
+ label: t("increment start label"),
133
+ disabled: !capabilities.incrementStart,
134
+ classNames: buttonClassNames,
135
+ icon: "ph--caret-left--regular",
136
+ onClick: () => onClick?.("increment-start")
137
+ }), /* @__PURE__ */ React.createElement(PlankControl, {
138
+ label: t("increment end label"),
139
+ disabled: !capabilities.incrementEnd,
140
+ classNames: buttonClassNames,
141
+ icon: "ph--caret-right--regular",
142
+ onClick: () => onClick?.("increment-end")
143
+ }))) : capabilities.fullscreen && /* @__PURE__ */ React.createElement(PlankControl, {
144
+ label: t(layoutMode === "solo--fullscreen" ? "exit fullscreen label" : "show fullscreen plank label"),
145
+ classNames: buttonClassNames,
146
+ icon: layoutMode === "solo--fullscreen" ? "ph--corners-in--regular" : "ph--corners-out--regular",
147
+ onClick: () => onClick?.("solo--fullscreen")
148
+ }), close && !layoutIsAnySolo && /* @__PURE__ */ React.createElement(PlankControl, {
149
+ label: t(`${typeof close === "string" ? "minify" : "close"} label`),
150
+ classNames: buttonClassNames,
151
+ "data-testid": "plankHeading.close",
152
+ icon: close === "minify-start" ? "ph--caret-line-left--regular" : close === "minify-end" ? "ph--caret-line-right--regular" : "ph--x--regular",
153
+ onClick: () => onClick?.("close")
154
+ }), capabilities.companion && /* @__PURE__ */ React.createElement(PlankControl, {
155
+ label: t("open companion label"),
156
+ classNames: buttonClassNames,
157
+ "data-testid": "plankHeading.companion",
158
+ icon: "ph--square-split-horizontal--regular",
159
+ onClick: () => onClick?.("companion")
160
+ }), children);
161
+ });
162
+
163
+ // src/components/Plank/PlankHeading.tsx
164
+ var MAX_COMPANIONS = 5;
165
+ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncrementStart, canIncrementEnd, popoverAnchorId, primaryId, pending, companioned, companions, layoutMode, actions = [] }) => {
166
+ const { t } = useTranslation2(meta.id);
167
+ const { invokePromise, invokeSync } = useOperationInvoker2();
168
+ const runAction = useActionRunner();
169
+ const { graph } = useAppGraph();
170
+ const breakpoint = useBreakpoints();
171
+ const icon = node?.properties?.icon ?? "ph--placeholder--regular";
172
+ const label3 = pending ? t("pending heading") : toLocalizedString(node?.properties?.label ?? [
173
+ "plank heading fallback label",
174
+ {
175
+ ns: meta.id
176
+ }
177
+ ], t);
178
+ const isCompanionNode = node?.type === PLANK_COMPANION_TYPE;
179
+ useEffect(() => {
180
+ const frame = requestAnimationFrame(() => {
181
+ if (node) {
182
+ void Graph.expand(graph, node.id, "child");
183
+ }
184
+ });
185
+ return () => cancelAnimationFrame(frame);
186
+ }, [
187
+ node
188
+ ]);
189
+ const attendableId = primaryId ?? id;
190
+ const capabilities = useMemo(() => ({
191
+ deck: deckEnabled ?? true,
192
+ solo: breakpoint !== "mobile" && (part === "solo" || part === "deck"),
193
+ incrementStart: canIncrementStart,
194
+ incrementEnd: canIncrementEnd,
195
+ fullscreen: !isCompanionNode,
196
+ companion: !isCompanionNode && companions && companions.length > 0
197
+ }), [
198
+ breakpoint,
199
+ part,
200
+ companions,
201
+ canIncrementStart,
202
+ canIncrementEnd,
203
+ isCompanionNode,
204
+ deckEnabled
205
+ ]);
206
+ const variant = isCompanionNode ? getCompanionVariant(id) : void 0;
207
+ const sigilActions = useMemo(() => {
208
+ if (!node) {
209
+ return void 0;
210
+ } else if (variant) {
211
+ return [];
212
+ } else {
213
+ return [
214
+ actions,
215
+ Graph.getActions(graph, node.id).filter((action) => [
216
+ "list-item",
217
+ "list-item-primary",
218
+ "heading-list-item"
219
+ ].includes(action.properties.disposition))
220
+ ].filter((a) => a.length > 0);
221
+ }
222
+ }, [
223
+ actions,
224
+ node,
225
+ variant,
226
+ graph
227
+ ]);
228
+ const handleAction = useCallback2((action) => {
229
+ if (typeof action.data === "function") {
230
+ void runAction(action, {
231
+ parent: node,
232
+ caller: meta.id
233
+ });
234
+ }
235
+ }, [
236
+ node,
237
+ runAction
238
+ ]);
239
+ const handlePlankAction = useCallback2((eventType) => {
240
+ if (eventType.startsWith("solo")) {
241
+ return invokePromise(DeckOperation.Adjust, {
242
+ type: eventType,
243
+ id
244
+ });
245
+ } else if (eventType === "close") {
246
+ if (part === "complementary") {
247
+ return invokeSync(LayoutOperation.UpdateComplementary, {
248
+ state: "collapsed"
249
+ });
250
+ } else {
251
+ return invokeSync(LayoutOperation.Close, {
252
+ subject: [
253
+ id
254
+ ]
255
+ });
256
+ }
257
+ } else {
258
+ return invokePromise(DeckOperation.Adjust, {
259
+ type: eventType,
260
+ id
261
+ });
262
+ }
263
+ }, [
264
+ invokePromise,
265
+ invokeSync,
266
+ id,
267
+ part
268
+ ]);
269
+ const ActionRoot = node && popoverAnchorId === `${meta.id}:${node.id}` ? Popover.Anchor : Fragment;
270
+ const handleTabClick = useCallback2((event) => {
271
+ const target = event.target.closest("[data-id]");
272
+ const tabId = target?.dataset?.id;
273
+ if (tabId) {
274
+ void invokePromise(DeckOperation.ChangeCompanion, {
275
+ companion: tabId
276
+ });
277
+ }
278
+ }, [
279
+ invokePromise
280
+ ]);
281
+ return /* @__PURE__ */ React2.createElement(StackItem.Heading, {
282
+ "data-plank-heading": true,
283
+ style: largeIconSize,
284
+ classNames: [
285
+ "py-1 items-stretch gap-1 sticky left-12 dx-app-drag min-w-0 dx-contain-layout dx-density-coarse",
286
+ part === "solo" ? soloInlinePadding : "px-1",
287
+ ...layoutMode === "solo--fullscreen" ? [
288
+ hoverableControls,
289
+ hoverableFocusedWithinControls,
290
+ "*:transition-opacity *:opacity-(--controls-opacity) bg-transparent border-transparent transition-[background-color,border-color]",
291
+ "hover-hover:hover:bg-header-surface focus-within:bg-header-surface hover-hover:hover:border-subdued-separator focus-within:border-subdued-separator"
292
+ ] : []
293
+ ]
294
+ }, companions && isCompanionNode ? (
295
+ /* TODO(thure): IMPORTANT: This is a tablist; it should be implemented as such. */
296
+ /* @__PURE__ */ React2.createElement("div", {
297
+ role: "none",
298
+ className: "flex-1 min-w-0 overflow-x-auto scrollbar-none flex gap-1"
299
+ }, companions.map(({ id: id2, properties: { icon: icon2, label: label4 } }) => /* @__PURE__ */ React2.createElement(IconButton2, {
300
+ key: id2,
301
+ "data-id": id2,
302
+ icon: icon2,
303
+ iconOnly: companions.length > MAX_COMPANIONS && node?.id !== id2,
304
+ label: toLocalizedString(label4, t),
305
+ variant: node?.id === id2 ? "primary" : "ghost",
306
+ onClick: handleTabClick
307
+ })))
308
+ ) : /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(ActionRoot, null, node && sigilActions ? /* @__PURE__ */ React2.createElement(StackItem.Sigil, {
309
+ icon,
310
+ related: part === "complementary",
311
+ attendableId,
312
+ triggerLabel: t("actions menu label"),
313
+ actions: sigilActions,
314
+ onAction: handleAction
315
+ }, /* @__PURE__ */ React2.createElement(Surface.Surface, {
316
+ role: "menu-footer",
317
+ data: {
318
+ subject: node.data
319
+ }
320
+ })) : /* @__PURE__ */ React2.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React2.createElement("span", {
321
+ className: "sr-only"
322
+ }, label3), /* @__PURE__ */ React2.createElement(Icon, {
323
+ icon
324
+ }))), /* @__PURE__ */ React2.createElement(TextTooltip, {
325
+ text: label3,
326
+ onlyWhenTruncating: true
327
+ }, /* @__PURE__ */ React2.createElement(StackItem.HeadingLabel, {
328
+ attendableId,
329
+ related: part === "complementary",
330
+ ...pending && {
331
+ classNames: "text-description"
332
+ }
333
+ }, label3))), node && part !== "complementary" && /* @__PURE__ */ React2.createElement(Surface.Surface, {
334
+ role: "navbar-end",
335
+ data: {
336
+ subject: node.data
337
+ }
338
+ }), companioned === "companion" ? /* @__PURE__ */ React2.createElement(PlankCompanionControls, {
339
+ primary: primaryId
340
+ }) : /* @__PURE__ */ React2.createElement(PlankControls, {
341
+ capabilities,
342
+ layoutMode,
343
+ close: part === "complementary" ? "minify-end" : true,
344
+ onClick: handlePlankAction
345
+ }));
346
+ });
347
+
348
+ // src/components/Plank/PlankLoading.tsx
349
+ import React3 from "react";
350
+ var PlankLoading = () => {
351
+ return /* @__PURE__ */ React3.createElement("div", {
352
+ role: "none",
353
+ className: "grid place-items-center dx-attention-surface"
354
+ });
355
+ };
356
+
357
+ // src/components/Plank/PlankError.tsx
358
+ var PlankError = ({ id, part, node, error }) => {
359
+ const [timedOut, setTimedOut] = useState(false);
360
+ useEffect2(() => {
361
+ const timer = setTimeout(() => setTimedOut(true), 5e3);
362
+ return () => clearTimeout(timer);
363
+ }, []);
364
+ return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(PlankHeading, {
365
+ id,
366
+ part,
367
+ node,
368
+ pending: !timedOut
369
+ }), timedOut ? /* @__PURE__ */ React4.createElement(PlankErrorFallback, {
370
+ error
371
+ }) : /* @__PURE__ */ React4.createElement(PlankLoading, null));
372
+ };
373
+ var PlankErrorFallback = ({ error }) => {
374
+ const { t } = useTranslation3(meta.id);
375
+ if (true) {
376
+ return /* @__PURE__ */ React4.createElement(ErrorFallback, {
377
+ title: "Plank Error",
378
+ error
379
+ });
380
+ } else {
381
+ const errorString = error?.toString() ?? "";
382
+ return /* @__PURE__ */ React4.createElement("div", {
383
+ role: "alert",
384
+ "data-testid": "plank-content-error",
385
+ className: "dx-attention-surface overflow-y-auto p-8 grid place-items-center"
386
+ }, /* @__PURE__ */ React4.createElement("p", {
387
+ className: mx2(descriptionMessage, "break-all rounded-md p-4")
388
+ }, error ? errorString : t("error fallback message")));
389
+ }
390
+ };
391
+
392
+ // src/components/Plank/Plank.tsx
393
+ var UNKNOWN_ID = "unknown_id";
394
+ var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, companionVariant, ...props }) => {
395
+ const { graph } = useAppGraph2();
396
+ const node = useNode(graph, id);
397
+ const companions = useCompanions(id);
398
+ const { companionId } = useSelectedCompanion(companions, companionVariant);
399
+ const resolvedCompanionId = companionVariant ? companionId : void 0;
400
+ const currentCompanion = companions.find(({ id: id2 }) => id2 === resolvedCompanionId);
401
+ const hasCompanion = !!(resolvedCompanionId && currentCompanion);
402
+ return /* @__PURE__ */ React5.createElement(PlankContainer, {
403
+ solo: props.part === "solo",
404
+ companion: hasCompanion,
405
+ encapsulate: !!props.settings?.encapsulatedPlanks
406
+ }, /* @__PURE__ */ React5.createElement(PlankComponent, {
407
+ id,
408
+ node,
409
+ companioned: hasCompanion ? "primary" : void 0,
410
+ companions: hasCompanion ? [] : companions,
411
+ ...props,
412
+ ...props.part === "solo" ? {
413
+ part: "solo-primary"
414
+ } : {}
415
+ }), hasCompanion && /* @__PURE__ */ React5.createElement(PlankComponent, {
416
+ id: resolvedCompanionId,
417
+ node: currentCompanion,
418
+ primary: node,
419
+ companions,
420
+ companioned: "companion",
421
+ ...props,
422
+ ...props.part === "solo" ? {
423
+ part: "solo-companion"
424
+ } : {
425
+ order: (props.order ?? 0) + 1
426
+ }
427
+ }));
428
+ });
429
+ var PlankContainer = ({ children, solo, companion, encapsulate }) => {
430
+ const sizeAttrs = useMainSize();
431
+ if (!solo) {
432
+ return children;
433
+ }
434
+ return /* @__PURE__ */ React5.createElement("div", {
435
+ role: "none",
436
+ "data-popover-collision-boundary": true,
437
+ className: mx3("absolute inset-(--main-spacing) grid", encapsulate && "border border-separator rounded-sm overflow-hidden", companion && "grid-cols-[6fr_4fr]", railGridHorizontal, mainIntrinsicSize),
438
+ ...sizeAttrs
439
+ }, children);
440
+ };
441
+ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order, active, companioned, node, primary, companions, settings }) => {
442
+ const { invokePromise } = useOperationInvoker3();
443
+ const { state, deck } = useDeckState();
444
+ const { popoverAnchorId, scrollIntoView } = state;
445
+ const { findFirstFocusable } = useFocusFinders();
446
+ const canResize = layoutMode === "deck";
447
+ const attentionAttrs = useAttentionAttributes(primary?.id ?? id);
448
+ const index = active ? active.findIndex((entryId) => entryId === id) : 0;
449
+ const length = active?.length ?? 1;
450
+ const canIncrementStart = active && index !== void 0 && index > 0 && length !== void 0 && length > 1;
451
+ const canIncrementEnd = active && index !== void 0 && index < length - 1 && length !== void 0;
452
+ const rootElement = useRef(null);
453
+ const variant = node?.type === PLANK_COMPANION_TYPE ? getCompanionVariant2(id) : void 0;
454
+ const sizeKey = id.split("+")[0];
455
+ const size = deck.plankSizing[sizeKey];
456
+ const handleSizeChange = useCallback3(debounce((nextSize) => {
457
+ return invokePromise(DeckOperation.UpdatePlankSize, {
458
+ id: sizeKey,
459
+ size: nextSize
460
+ });
461
+ }, 200), [
462
+ invokePromise,
463
+ sizeKey
464
+ ]);
465
+ const handleKeyDown = useCallback3((event) => {
466
+ if (event.target === event.currentTarget) {
467
+ switch (event.key) {
468
+ case "Escape":
469
+ rootElement.current?.closest("main")?.focus();
470
+ break;
471
+ case "Enter":
472
+ rootElement.current && findFirstFocusable(rootElement.current)?.focus();
473
+ break;
474
+ }
475
+ }
476
+ }, []);
477
+ useLayoutEffect(() => {
478
+ if (scrollIntoView === id) {
479
+ layoutMode === "deck" && rootElement.current?.scrollIntoView({
480
+ behavior: "smooth",
481
+ inline: "center"
482
+ });
483
+ void invokePromise(LayoutOperation2.ScrollIntoView, {
484
+ subject: void 0
485
+ });
486
+ }
487
+ }, [
488
+ id,
489
+ scrollIntoView,
490
+ layoutMode,
491
+ invokePromise
492
+ ]);
493
+ const isSolo = layoutMode.startsWith("solo") && part === "solo";
494
+ const isAttendable = layoutMode.startsWith("solo") && part.startsWith("solo") || layoutMode === "deck" && part === "deck";
495
+ const sizeAttrs = useMainSize();
496
+ const data = useMemo2(() => node && {
497
+ attendableId: id,
498
+ subject: node.data,
499
+ companionTo: primary?.data,
500
+ properties: node.properties,
501
+ variant,
502
+ path,
503
+ popoverAnchorId
504
+ }, [
505
+ node,
506
+ node?.data,
507
+ node?.properties,
508
+ path,
509
+ popoverAnchorId,
510
+ primary?.data,
511
+ variant
512
+ ]);
513
+ const placeholder = useMemo2(() => /* @__PURE__ */ React5.createElement(PlankLoading, null), []);
514
+ const Root = part.startsWith("solo") ? "article" : StackItem2.Root;
515
+ const fullscreen = layoutMode === "solo--fullscreen";
516
+ const className = mx3("dx-attention-surface relative dx-focus-ring-inset-over-all dx-density-coarse", isSolo && "absolute inset-0", isSolo && mainIntrinsicSize, railGridHorizontal, part.startsWith("solo") && "grid", part.startsWith("solo-") && "grid-rows-subgrid row-span-2 min-w-0", fullscreen && "grid-rows-1", part === "deck" && (companioned === "companion" ? "border-separator! border-e" : "border-separator! border-x"), part === "solo-companion" && "border-separator! border-s", settings?.encapsulatedPlanks && !part.startsWith("solo") && "mx-(--main-spacing) border-separator! border rounded-sm overflow-hidden");
517
+ return /* @__PURE__ */ React5.createElement(Root, {
518
+ ref: rootElement,
519
+ "data-testid": "deck.plank",
520
+ "data-popover-collision-boundary": true,
521
+ tabIndex: 0,
522
+ ...part.startsWith("solo") ? {
523
+ ...sizeAttrs,
524
+ className
525
+ } : {
526
+ item: {
527
+ id
528
+ },
529
+ size,
530
+ onSizeChange: handleSizeChange,
531
+ classNames: className,
532
+ order,
533
+ role: "article"
534
+ },
535
+ ...isAttendable ? attentionAttrs : {},
536
+ onKeyDown: handleKeyDown
537
+ }, node ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, !fullscreen && /* @__PURE__ */ React5.createElement(PlankHeading, {
538
+ id,
539
+ part: part.startsWith("solo-") ? "solo" : part,
540
+ node,
541
+ layoutMode,
542
+ deckEnabled: settings?.enableDeck,
543
+ canIncrementStart,
544
+ canIncrementEnd,
545
+ popoverAnchorId,
546
+ primaryId: primary?.id,
547
+ companioned,
548
+ companions
549
+ }), /* @__PURE__ */ React5.createElement(Surface2.Surface, {
550
+ key: node.id,
551
+ role: "article",
552
+ data,
553
+ limit: 1,
554
+ fallback: PlankErrorFallback,
555
+ placeholder
556
+ })) : /* @__PURE__ */ React5.createElement(PlankError, {
557
+ id,
558
+ part
559
+ }), canResize && /* @__PURE__ */ React5.createElement(StackItem2.ResizeHandle, null));
560
+ });
561
+
562
+ // src/components/Sidebar/SidebarButton.tsx
563
+ import React6, { useCallback as useCallback4 } from "react";
564
+ import { useOperationInvoker as useOperationInvoker4 } from "@dxos/app-framework/ui";
565
+ import { LayoutOperation as LayoutOperation3, getCompanionVariant as getCompanionVariant3 } from "@dxos/app-toolkit";
566
+ import { IconButton as IconButton3, useTranslation as useTranslation4 } from "@dxos/react-ui";
567
+ var ToggleSidebarButton = ({ classNames, variant = "ghost" }) => {
568
+ const { updateState } = useDeckState();
569
+ const { t } = useTranslation4(meta.id);
570
+ const handleClick = useCallback4(() => {
571
+ updateState((state) => ({
572
+ ...state,
573
+ sidebarState: state.sidebarState === "expanded" ? "collapsed" : "expanded"
574
+ }));
575
+ }, [
576
+ updateState
577
+ ]);
578
+ return /* @__PURE__ */ React6.createElement(IconButton3, {
579
+ variant,
580
+ icon: "ph--sidebar--regular",
581
+ iconOnly: true,
582
+ size: 4,
583
+ label: t("open navigation sidebar label"),
584
+ onClick: handleClick,
585
+ classNames
586
+ });
587
+ };
588
+ var CloseSidebarButton = () => {
589
+ const { updateState } = useDeckState();
590
+ const { t } = useTranslation4(meta.id);
591
+ const handleClick = useCallback4(() => {
592
+ updateState((state) => ({
593
+ ...state,
594
+ sidebarState: "collapsed"
595
+ }));
596
+ }, [
597
+ updateState
598
+ ]);
599
+ return /* @__PURE__ */ React6.createElement(IconButton3, {
600
+ variant: "ghost",
601
+ icon: "ph--caret-line-left--regular",
602
+ iconOnly: true,
603
+ size: 4,
604
+ label: t("close navigation sidebar label"),
605
+ onClick: handleClick,
606
+ classNames: "rounded-none px-1 dx-focus-ring-inset pe-[max(.5rem,env(safe-area-inset-left))]"
607
+ });
608
+ };
609
+ var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
610
+ const { invokeSync } = useOperationInvoker4();
611
+ const { state, updateState } = useDeckState();
612
+ const { t } = useTranslation4(meta.id);
613
+ const companions = useDeckCompanions();
614
+ const handleClick = useCallback4(() => {
615
+ const nextState = state.complementarySidebarState === "expanded" ? "collapsed" : "expanded";
616
+ updateState((state2) => ({
617
+ ...state2,
618
+ complementarySidebarState: nextState
619
+ }));
620
+ const subject = state.complementarySidebarPanel ?? (companions[0] && getCompanionVariant3(companions[0].id));
621
+ if (nextState === "expanded" && !current && subject) {
622
+ invokeSync(LayoutOperation3.UpdateComplementary, {
623
+ subject
624
+ });
625
+ }
626
+ }, [
627
+ state,
628
+ updateState,
629
+ current,
630
+ companions,
631
+ invokeSync
632
+ ]);
633
+ return /* @__PURE__ */ React6.createElement(IconButton3, {
634
+ variant: "ghost",
635
+ classNames: [
636
+ "[&>svg]:-scale-x-100",
637
+ classNames
638
+ ],
639
+ icon: "ph--sidebar-simple--regular",
640
+ iconOnly: true,
641
+ label: t("open complementary sidebar label"),
642
+ size: inR0 ? 5 : 4,
643
+ tooltipSide: inR0 ? "left" : void 0,
644
+ onClick: handleClick
645
+ });
646
+ };
647
+
648
+ // src/components/Sidebar/ComplementarySidebar.tsx
649
+ var label = [
650
+ "complementary sidebar title",
651
+ {
652
+ ns: meta.id
653
+ }
654
+ ];
655
+ var ComplementarySidebar = ({ current }) => {
656
+ const { t } = useTranslation5(meta.id);
657
+ const { invokeSync } = useOperationInvoker5();
658
+ const { state, deck, updateState } = useDeckState();
659
+ const layoutMode = getMode(deck);
660
+ const breakpoint = useBreakpoints();
661
+ const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
662
+ const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
663
+ const companions = useDeckCompanions();
664
+ const activeCompanion = companions.find((companion) => getCompanionVariant4(companion.id) === current);
665
+ const activeId = activeCompanion && getCompanionVariant4(activeCompanion.id);
666
+ const [internalValue, setInternalValue] = useState2(activeId);
667
+ useEffect3(() => {
668
+ setInternalValue(activeId);
669
+ }, [
670
+ activeId
671
+ ]);
672
+ const handleTabClick = useCallback5((event) => {
673
+ const nextValue = event.currentTarget.getAttribute("data-value");
674
+ if (nextValue === activeId) {
675
+ updateState((state2) => ({
676
+ ...state2,
677
+ complementarySidebarState: state2.complementarySidebarState === "expanded" ? "collapsed" : "expanded"
678
+ }));
679
+ } else {
680
+ setInternalValue(nextValue);
681
+ updateState((state2) => ({
682
+ ...state2,
683
+ complementarySidebarState: "expanded"
684
+ }));
685
+ invokeSync(LayoutOperation4.UpdateComplementary, {
686
+ subject: nextValue
687
+ });
688
+ }
689
+ }, [
690
+ state.complementarySidebarState,
691
+ activeId,
692
+ invokeSync,
693
+ updateState
694
+ ]);
695
+ const data = useMemo3(() => activeCompanion && {
696
+ id: activeCompanion.id,
697
+ subject: activeCompanion.data
698
+ }, [
699
+ activeCompanion?.id,
700
+ activeCompanion?.data
701
+ ]);
702
+ useEffect3(() => {
703
+ if (!activeId) {
704
+ invokeSync(LayoutOperation4.UpdateComplementary, {
705
+ state: "collapsed"
706
+ });
707
+ }
708
+ }, [
709
+ activeId,
710
+ invokeSync
711
+ ]);
712
+ return /* @__PURE__ */ React7.createElement(Main.ComplementarySidebar, {
713
+ label,
714
+ classNames: [
715
+ topbar && "top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]",
716
+ hoistStatusbar && "bottom-(--dx-statusbar-size)"
717
+ ]
718
+ }, /* @__PURE__ */ React7.createElement(Tabs.Root, {
719
+ orientation: "vertical",
720
+ verticalVariant: "stateless",
721
+ value: internalValue,
722
+ classNames: "contents"
723
+ }, /* @__PURE__ */ React7.createElement("div", {
724
+ role: "none",
725
+ style: largeIconSize2,
726
+ className: mx4("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-toolbar-surface dx-contain-layout dx-app-drag")
727
+ }, /* @__PURE__ */ React7.createElement(Tabs.Tablist, {
728
+ classNames: "grid grid-cols-1 auto-rows-(--dx-rail-action) p-1 gap-1 overflow-y-auto!"
729
+ }, companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tab, {
730
+ key: getCompanionVariant4(companion.id),
731
+ value: getCompanionVariant4(companion.id),
732
+ asChild: true
733
+ }, /* @__PURE__ */ React7.createElement(IconButton4, {
734
+ label: toLocalizedString2(companion.properties.label, t),
735
+ icon: companion.properties.icon,
736
+ iconOnly: true,
737
+ tooltipSide: "left",
738
+ "data-value": getCompanionVariant4(companion.id),
739
+ variant: activeId === getCompanionVariant4(companion.id) ? state.complementarySidebarState === "expanded" ? "primary" : "default" : "ghost",
740
+ onClick: handleTabClick
741
+ })))), !hoistStatusbar && /* @__PURE__ */ React7.createElement("div", {
742
+ role: "none",
743
+ className: "grid grid-cols-1 auto-rows-(--dx-rail-item) p-1 overflow-y-auto"
744
+ }, /* @__PURE__ */ React7.createElement(Surface3.Surface, {
745
+ role: "status-bar--r0-footer",
746
+ limit: 1
747
+ })), /* @__PURE__ */ React7.createElement("div", {
748
+ role: "none",
749
+ className: "hidden lg:grid grid-cols-1 auto-rows-(--dx-rail-action) p-1"
750
+ }, /* @__PURE__ */ React7.createElement(ToggleComplementarySidebarButton, null))), activeId && companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tabpanel, {
751
+ key: getCompanionVariant4(companion.id),
752
+ value: getCompanionVariant4(companion.id),
753
+ classNames: [
754
+ 'absolute data-[state="inactive"]:-z-[1] overflow-hidden',
755
+ "inset-y-0 start-0 w-[calc(100%-var(--dx-r0-size))] lg:w-(--dx-r1-size)",
756
+ "grid grid-cols-1 grid-rows-[var(--dx-rail-size)_1fr_min-content] py-[env(safe-area-inset-top)]"
757
+ ],
758
+ ...state.complementarySidebarState !== "expanded" && {
759
+ inert: true
760
+ }
761
+ }, /* @__PURE__ */ React7.createElement(ComplementarySidebarPanel, {
762
+ companion,
763
+ activeId,
764
+ data,
765
+ hoistStatusbar
766
+ })))));
767
+ };
768
+ var ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }) => {
769
+ const { t } = useTranslation5(meta.id);
770
+ if (getCompanionVariant4(companion.id) !== activeId && !data) {
771
+ return null;
772
+ }
773
+ const Wrapper = companion.properties.fixed ? Fragment2 : ScrollAreaWrapper;
774
+ return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("div", {
775
+ role: "none",
776
+ className: "flex items-center p-1 gap-1 border-b border-subdued-separator"
777
+ }, /* @__PURE__ */ React7.createElement(IconButton4, {
778
+ label: toLocalizedString2(companion.properties.label, t),
779
+ icon: companion.properties.icon,
780
+ iconOnly: true,
781
+ tooltipSide: "left",
782
+ "data-value": getCompanionVariant4(companion.id),
783
+ classNames: "h-10 w-10",
784
+ variant: "default"
785
+ }), /* @__PURE__ */ React7.createElement("div", {
786
+ role: "none",
787
+ className: "px-1"
788
+ }, toLocalizedString2(companion.properties.label, t))), /* @__PURE__ */ React7.createElement(Wrapper, null, /* @__PURE__ */ React7.createElement(Surface3.Surface, {
789
+ role: `deck-companion--${getCompanionVariant4(companion.id)}`,
790
+ data,
791
+ fallback: PlankErrorFallback,
792
+ placeholder: /* @__PURE__ */ React7.createElement(PlankLoading, null)
793
+ })), !hoistStatusbar && /* @__PURE__ */ React7.createElement("div", {
794
+ role: "contentinfo",
795
+ className: "flex flex-wrap justify-center items-center border-y border-subdued-separator pt-1 pb-[max(env(safe-area-inset-bottom),0.25rem)]"
796
+ }, /* @__PURE__ */ React7.createElement(Surface3.Surface, {
797
+ role: "status-bar--r1-footer",
798
+ limit: 1
799
+ })));
800
+ };
801
+ var ScrollAreaWrapper = ({ children }) => {
802
+ return /* @__PURE__ */ React7.createElement(ScrollArea.Root, {
803
+ thin: true,
804
+ orientation: "vertical",
805
+ classNames: "grow"
806
+ }, /* @__PURE__ */ React7.createElement(ScrollArea.Viewport, null, children));
807
+ };
808
+
809
+ // src/components/Sidebar/Sidebar.tsx
810
+ import React8, { useMemo as useMemo4 } from "react";
811
+ import { Surface as Surface4 } from "@dxos/app-framework/ui";
812
+ import { Main as Main2 } from "@dxos/react-ui";
813
+ var label2 = [
814
+ "sidebar title",
815
+ {
816
+ ns: meta.id
817
+ }
818
+ ];
819
+ var Sidebar = () => {
820
+ const { state, deck } = useDeckState();
821
+ const { popoverAnchorId, activeDeck: current } = state;
822
+ const breakpoint = useBreakpoints();
823
+ const layoutMode = getMode(deck);
824
+ const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
825
+ const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
826
+ const navigationData = useMemo4(() => ({
827
+ popoverAnchorId,
828
+ topbar,
829
+ hoistStatusbar,
830
+ current
831
+ }), [
832
+ popoverAnchorId,
833
+ topbar,
834
+ hoistStatusbar,
835
+ current
836
+ ]);
837
+ return /* @__PURE__ */ React8.createElement(Main2.NavigationSidebar, {
838
+ label: label2,
839
+ classNames: [
840
+ "grid",
841
+ topbar && "top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]",
842
+ hoistStatusbar && "bottom-(--dx-statusbar-size)"
843
+ ]
844
+ }, /* @__PURE__ */ React8.createElement(Surface4.Surface, {
845
+ role: "navigation",
846
+ data: navigationData,
847
+ limit: 1
848
+ }));
849
+ };
850
+
851
+ // src/components/DeckLayout/Banner.tsx
852
+ var Banner = ({ variant, classNames }) => {
853
+ const { t } = useTranslation6(meta.id);
854
+ return /* @__PURE__ */ React9.createElement("header", {
855
+ className: mx5("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)
856
+ }, variant === "sidebar" ? /* @__PURE__ */ React9.createElement(CloseSidebarButton, null) : /* @__PURE__ */ React9.createElement(ToggleSidebarButton, null), /* @__PURE__ */ React9.createElement("span", {
857
+ className: "self-center grow ms-1"
858
+ }, t("current app name", {
859
+ ns: osTranslations
860
+ })), variant === "topbar" && /* @__PURE__ */ React9.createElement("div", {
861
+ role: "none",
862
+ className: "absolute inset-0 pointer-events-none"
863
+ }, /* @__PURE__ */ React9.createElement("div", {
864
+ role: "none",
865
+ className: "grid h-full pointer-fine:p-1 max-w-md mx-auto pointer-events-auto"
866
+ }, /* @__PURE__ */ React9.createElement(Surface5.Surface, {
867
+ role: "search-input",
868
+ limit: 1
869
+ }))), /* @__PURE__ */ React9.createElement("span", {
870
+ role: "none",
871
+ className: "grow"
872
+ }), /* @__PURE__ */ React9.createElement(Surface5.Surface, {
873
+ role: "header-end",
874
+ limit: 1
875
+ }), /* @__PURE__ */ React9.createElement(Surface5.Surface, {
876
+ role: "notch-start",
877
+ limit: 1
878
+ }));
879
+ };
880
+
881
+ // src/components/DeckLayout/DeckLayout.tsx
882
+ import React18 from "react";
883
+ import { Mosaic } from "@dxos/react-ui-mosaic";
884
+
885
+ // src/components/DeckLayout/ActiveNode.tsx
886
+ import React10 from "react";
887
+ import { Surface as Surface6 } from "@dxos/app-framework/ui";
888
+ import { useAppGraph as useAppGraph3 } from "@dxos/app-toolkit/ui";
889
+ import { useNode as useNode2 } from "@dxos/plugin-graph";
890
+ import { useAttended } from "@dxos/react-ui-attention";
891
+ var ActiveNode = () => {
892
+ const [id] = useAttended();
893
+ const { graph } = useAppGraph3();
894
+ const activeNode = useNode2(graph, id);
895
+ useNodeActionExpander(activeNode);
896
+ return /* @__PURE__ */ React10.createElement("div", {
897
+ role: "none",
898
+ className: "sr-only"
899
+ }, /* @__PURE__ */ React10.createElement(Surface6.Surface, {
900
+ role: "document-title",
901
+ data: {
902
+ subject: activeNode
903
+ },
904
+ limit: 1
905
+ }));
906
+ };
907
+
908
+ // src/components/DeckLayout/DeckMain.tsx
909
+ import React14, { Fragment as Fragment3, useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef2 } from "react";
910
+ import { useAtomCapability, useOperationInvoker as useOperationInvoker6, usePluginManager } from "@dxos/app-framework/ui";
911
+ import { LayoutOperation as LayoutOperation5 } from "@dxos/app-toolkit";
912
+ import { AttentionCapabilities } from "@dxos/plugin-attention";
913
+ import { Main as Main3, useMediaQuery, useOnTransition } from "@dxos/react-ui";
914
+ import { DEFAULT_HORIZONTAL_SIZE, Stack, StackContext } from "@dxos/react-ui-stack";
915
+ import { mainPaddingTransitions, mx as mx6 } from "@dxos/ui-theme";
916
+
917
+ // src/components/DeckLayout/ContentEmpty.tsx
918
+ import React11 from "react";
919
+ import { Surface as Surface7 } from "@dxos/app-framework/ui";
920
+ var ContentEmpty = () => {
921
+ const breakpoint = useBreakpoints();
922
+ const { deck } = useDeckState();
923
+ const layoutMode = getMode(deck);
924
+ const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
925
+ return /* @__PURE__ */ React11.createElement("div", {
926
+ role: "none",
927
+ className: "grid place-items-center p-8 relative bg-deck-surface",
928
+ "data-testid": "layoutPlugin.firstRunMessage"
929
+ }, /* @__PURE__ */ React11.createElement(Surface7.Surface, {
930
+ role: "keyshortcuts"
931
+ }), !topbar && /* @__PURE__ */ React11.createElement(ToggleSidebarButton, {
932
+ variant: "default",
933
+ classNames: fixedSidebarToggleStyles
934
+ }));
935
+ };
936
+
937
+ // src/components/DeckLayout/StatusBar.tsx
938
+ import React12 from "react";
939
+ import { Surface as Surface8 } from "@dxos/app-framework/ui";
940
+ import { useLandmarkMover } from "@dxos/react-ui";
941
+ var StatusBar = ({ showHints }) => {
942
+ const mover = useLandmarkMover(void 0, "3");
943
+ return /* @__PURE__ */ React12.createElement("div", {
944
+ role: "contentinfo",
945
+ className: "fixed bottom-0 inset-x-0 h-(--dx-statusbar-size) border-y border-separator z-[2] flex text-description",
946
+ ...mover
947
+ }, showHints && /* @__PURE__ */ React12.createElement(Surface8.Surface, {
948
+ role: "hints",
949
+ limit: 1
950
+ }), /* @__PURE__ */ React12.createElement(Surface8.Surface, {
951
+ role: "status-bar",
952
+ limit: 1
953
+ }));
954
+ };
955
+
956
+ // src/components/DeckLayout/Topbar.tsx
957
+ import React13 from "react";
958
+ var Topbar = () => {
959
+ return /* @__PURE__ */ React13.createElement(Banner, {
960
+ variant: "topbar"
961
+ });
962
+ };
963
+
964
+ // src/components/DeckLayout/DeckMain.tsx
965
+ var DeckMain = () => {
966
+ const { invokeSync } = useOperationInvoker6();
967
+ const settings = useAtomCapability(DeckCapabilities.Settings);
968
+ const { state, deck, updateState } = useDeckState();
969
+ const { sidebarState, complementarySidebarState, complementarySidebarPanel } = state;
970
+ const { active, companionOpen, companionVariant, fullscreen, solo, plankSizing } = deck;
971
+ const effectiveCompanionVariant = companionOpen ? companionVariant : void 0;
972
+ const layoutMode = getMode(deck);
973
+ const breakpoint = useBreakpoints();
974
+ const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
975
+ const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
976
+ const pluginManager = usePluginManager();
977
+ const scrollLeftRef = useRef2(null);
978
+ const deckRef = useRef2(null);
979
+ useEffect4(() => {
980
+ const attention = pluginManager.capabilities.get(AttentionCapabilities.Attention);
981
+ const attended = attention.getCurrent();
982
+ const firstId = solo ?? active[0];
983
+ if (attended.length === 0 && firstId) {
984
+ document.querySelector(`article[data-attendable-id="${firstId}"] button`)?.focus();
985
+ }
986
+ }, []);
987
+ const [isNotMobile] = useMediaQuery("md");
988
+ const shouldRevert = useRef2(false);
989
+ useEffect4(() => {
990
+ if (!isNotMobile && layoutMode === "deck") {
991
+ const attention = pluginManager.capabilities.get(AttentionCapabilities.Attention);
992
+ const attended = attention.getCurrent();
993
+ shouldRevert.current = true;
994
+ invokeSync(LayoutOperation5.SetLayoutMode, {
995
+ subject: attended[0],
996
+ mode: "solo"
997
+ });
998
+ } else if (isNotMobile && layoutMode === "solo" && shouldRevert.current) {
999
+ invokeSync(LayoutOperation5.SetLayoutMode, {
1000
+ revert: true
1001
+ });
1002
+ }
1003
+ }, [
1004
+ isNotMobile,
1005
+ layoutMode,
1006
+ invokeSync
1007
+ ]);
1008
+ useEffect4(() => {
1009
+ if (!settings?.enableDeck && layoutMode === "deck") {
1010
+ invokeSync(LayoutOperation5.SetLayoutMode, {
1011
+ subject: active[0],
1012
+ mode: "solo"
1013
+ });
1014
+ }
1015
+ }, [
1016
+ settings?.enableDeck,
1017
+ invokeSync,
1018
+ active,
1019
+ layoutMode
1020
+ ]);
1021
+ const handleResize = useCallback6(() => {
1022
+ scrollLeftRef.current = null;
1023
+ }, []);
1024
+ useEffect4(() => {
1025
+ window.addEventListener("resize", handleResize);
1026
+ return () => window.removeEventListener("resize", handleResize);
1027
+ }, [
1028
+ handleResize
1029
+ ]);
1030
+ const restoreScroll = useCallback6(() => {
1031
+ if (deckRef.current && scrollLeftRef.current != null) {
1032
+ deckRef.current.scrollLeft = scrollLeftRef.current;
1033
+ }
1034
+ }, []);
1035
+ useOnTransition(layoutMode, (mode) => mode !== "deck", "deck", restoreScroll);
1036
+ const handleScroll = useCallback6((event) => {
1037
+ if (!solo && event.currentTarget === event.target) {
1038
+ scrollLeftRef.current = event.target.scrollLeft;
1039
+ }
1040
+ }, [
1041
+ solo
1042
+ ]);
1043
+ const isEmpty = !solo && active.length === 0;
1044
+ const padding = useMemo5(() => {
1045
+ if (!solo && settings?.overscroll === "centering") {
1046
+ return calculateOverscroll(active.length);
1047
+ }
1048
+ return {};
1049
+ }, [
1050
+ solo,
1051
+ settings?.overscroll,
1052
+ deck
1053
+ ]);
1054
+ const mainPosition = useMemo5(() => [
1055
+ "grid !top-[env(safe-area-inset-top)]",
1056
+ topbar && "!top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]",
1057
+ hoistStatusbar && "lg:bottom-(--dx-statusbar-size)"
1058
+ ], [
1059
+ topbar,
1060
+ hoistStatusbar
1061
+ ]);
1062
+ const { order, itemsCount } = useMemo5(() => {
1063
+ return active.reduce((acc, entryId) => {
1064
+ acc.order[entryId] = acc.itemsCount + 1;
1065
+ acc.itemsCount += companionOpen ? 3 : 2;
1066
+ return acc;
1067
+ }, {
1068
+ order: {},
1069
+ itemsCount: 0
1070
+ });
1071
+ }, [
1072
+ active,
1073
+ companionOpen
1074
+ ]);
1075
+ const handleNavigationSidebarStateChange = useCallback6((next) => {
1076
+ updateState((s) => ({
1077
+ ...s,
1078
+ sidebarState: next
1079
+ }));
1080
+ }, [
1081
+ updateState
1082
+ ]);
1083
+ const handleComplementarySidebarStateChange = useCallback6((next) => {
1084
+ updateState((s) => ({
1085
+ ...s,
1086
+ complementarySidebarState: next
1087
+ }));
1088
+ }, [
1089
+ updateState
1090
+ ]);
1091
+ return /* @__PURE__ */ React14.createElement(Main3.Root, {
1092
+ navigationSidebarState: fullscreen ? "closed" : sidebarState,
1093
+ complementarySidebarState: fullscreen ? "closed" : complementarySidebarState,
1094
+ onNavigationSidebarStateChange: handleNavigationSidebarStateChange,
1095
+ onComplementarySidebarStateChange: handleComplementarySidebarStateChange
1096
+ }, /* @__PURE__ */ React14.createElement(Sidebar, null), /* @__PURE__ */ React14.createElement(ComplementarySidebar, {
1097
+ current: complementarySidebarPanel
1098
+ }), /* @__PURE__ */ React14.createElement(Main3.Overlay, null), isEmpty && /* @__PURE__ */ React14.createElement(Main3.Content, {
1099
+ bounce: true,
1100
+ handlesFocus: true,
1101
+ classNames: mainPosition
1102
+ }, /* @__PURE__ */ React14.createElement(ContentEmpty, null)), !isEmpty && /* @__PURE__ */ React14.createElement(Main3.Content, {
1103
+ bounce: true,
1104
+ handlesFocus: true,
1105
+ classNames: mainPosition,
1106
+ style: {
1107
+ "--main-spacing": settings?.encapsulatedPlanks ? "0.75rem" : "0",
1108
+ "--dx-main-sidebar-width": sidebarState === "expanded" ? "var(--dx-nav-sidebar-size)" : sidebarState === "collapsed" ? "var(--dx-l0-size)" : "0",
1109
+ "--dx-main-complementary-width": complementarySidebarState === "expanded" ? "var(--dx-complementary-sidebar-size)" : complementarySidebarState === "collapsed" ? "var(--dx-rail-size)" : "0",
1110
+ "--dx-main-content-first-width": `${plankSizing[active[0] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`,
1111
+ "--dx-main-content-last-width": `${plankSizing[active[(active.length ?? 1) - 1] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`
1112
+ }
1113
+ }, /* @__PURE__ */ React14.createElement("div", {
1114
+ role: "none",
1115
+ className: !solo ? "relative bg-deck-surface overflow-hidden" : "sr-only",
1116
+ ...solo && {
1117
+ inert: true
1118
+ }
1119
+ }, !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleSidebarButton, {
1120
+ classNames: fixedSidebarToggleStyles
1121
+ }), !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleComplementarySidebarButton, {
1122
+ classNames: fixedComplementarySidebarToggleStyles
1123
+ }), /* @__PURE__ */ React14.createElement(Stack, {
1124
+ ref: deckRef,
1125
+ orientation: "horizontal",
1126
+ size: "contain",
1127
+ itemsCount: itemsCount - 1,
1128
+ classNames: [
1129
+ "absolute inset-y-(--main-spacing) -inset-w-px h-[calc(100%-2*var(--main-spacing))]",
1130
+ mainPaddingTransitions
1131
+ ],
1132
+ style: padding,
1133
+ onScroll: handleScroll
1134
+ }, active.map((entryId) => /* @__PURE__ */ React14.createElement(Fragment3, {
1135
+ key: entryId
1136
+ }, /* @__PURE__ */ React14.createElement(PlankSeparator, {
1137
+ order: order[entryId] - 1,
1138
+ encapsulate: !!settings?.enableDeck
1139
+ }), /* @__PURE__ */ React14.createElement(Plank, {
1140
+ id: entryId,
1141
+ companionVariant: effectiveCompanionVariant,
1142
+ part: "deck",
1143
+ order: order[entryId],
1144
+ active,
1145
+ layoutMode,
1146
+ settings
1147
+ }))))), /* @__PURE__ */ React14.createElement("div", {
1148
+ role: "none",
1149
+ className: solo ? "relative overflow-hidden bg-deck-surface" : "sr-only",
1150
+ ...!solo && {
1151
+ inert: true
1152
+ }
1153
+ }, !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleSidebarButton, {
1154
+ classNames: fixedSidebarToggleStyles
1155
+ }), !topbar && !fullscreen && /* @__PURE__ */ React14.createElement(ToggleComplementarySidebarButton, {
1156
+ classNames: fixedComplementarySidebarToggleStyles
1157
+ }), /* @__PURE__ */ React14.createElement(StackContext.Provider, {
1158
+ value: {
1159
+ orientation: "horizontal",
1160
+ size: "contain",
1161
+ rail: true
1162
+ }
1163
+ }, /* @__PURE__ */ React14.createElement(Plank, {
1164
+ id: solo,
1165
+ companionVariant: effectiveCompanionVariant,
1166
+ part: "solo",
1167
+ layoutMode,
1168
+ settings
1169
+ })))), topbar && /* @__PURE__ */ React14.createElement(Topbar, null), hoistStatusbar && /* @__PURE__ */ React14.createElement(StatusBar, {
1170
+ showHints: settings?.showHints
1171
+ }));
1172
+ };
1173
+ var PlankSeparator = ({ order, encapsulate }) => order > 0 ? /* @__PURE__ */ React14.createElement("span", {
1174
+ role: "separator",
1175
+ className: mx6("row-span-2 bg-deck-surface", encapsulate ? "w-0" : "w-4"),
1176
+ style: {
1177
+ gridColumn: order
1178
+ }
1179
+ }) : null;
1180
+
1181
+ // src/components/DeckLayout/Dialog.tsx
1182
+ import React15, { useCallback as useCallback7 } from "react";
1183
+ import { Surface as Surface9 } from "@dxos/app-framework/ui";
1184
+ import { AlertDialog, Dialog as NaturalDialog } from "@dxos/react-ui";
1185
+ var Dialog = () => {
1186
+ const { state, updateEphemeral } = useDeckState();
1187
+ const { dialogOpen, dialogType, dialogBlockAlign, dialogOverlayClasses, dialogOverlayStyle, dialogContent } = state;
1188
+ const Root = dialogType === "alert" ? AlertDialog.Root : NaturalDialog.Root;
1189
+ const Overlay = dialogType === "alert" ? AlertDialog.Overlay : NaturalDialog.Overlay;
1190
+ const handleOpenChange = useCallback7((nextOpen) => {
1191
+ updateEphemeral((s) => ({
1192
+ ...s,
1193
+ dialogOpen: nextOpen
1194
+ }));
1195
+ }, [
1196
+ updateEphemeral
1197
+ ]);
1198
+ return /* @__PURE__ */ React15.createElement(Root, {
1199
+ modal: dialogBlockAlign !== "end",
1200
+ open: dialogOpen,
1201
+ onOpenChange: handleOpenChange
1202
+ }, dialogBlockAlign === "end" ? (
1203
+ // TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
1204
+ /* @__PURE__ */ React15.createElement(Surface9.Surface, {
1205
+ role: "dialog",
1206
+ data: dialogContent,
1207
+ limit: 1,
1208
+ fallback: PlankErrorFallback,
1209
+ placeholder: /* @__PURE__ */ React15.createElement("div", null)
1210
+ })
1211
+ ) : /* @__PURE__ */ React15.createElement(Overlay, {
1212
+ blockAlign: dialogBlockAlign,
1213
+ classNames: dialogOverlayClasses,
1214
+ style: dialogOverlayStyle
1215
+ }, /* @__PURE__ */ React15.createElement(Surface9.Surface, {
1216
+ role: "dialog",
1217
+ data: dialogContent,
1218
+ limit: 1,
1219
+ fallback: PlankErrorFallback
1220
+ })));
1221
+ };
1222
+
1223
+ // src/components/DeckLayout/Popover.tsx
1224
+ import { createContext } from "@radix-ui/react-context";
1225
+ import * as Function from "effect/Function";
1226
+ import * as Option from "effect/Option";
1227
+ import React16, { useCallback as useCallback8, useEffect as useEffect5, useRef as useRef3, useState as useState3 } from "react";
1228
+ import { Surface as Surface10 } from "@dxos/app-framework/ui";
1229
+ import { useObjectMenuItems } from "@dxos/app-toolkit/ui";
1230
+ import { Annotation, Obj } from "@dxos/echo";
1231
+ import { Card, Popover as Popover2, toLocalizedString as toLocalizedString3, Toolbar, useTranslation as useTranslation7 } from "@dxos/react-ui";
1232
+ import { Menu } from "@dxos/react-ui-menu";
1233
+ var DEBOUNCE_DELAY = 40;
1234
+ var [DeckPopoverProvider, useDeckPopoverContext] = createContext("DeckPopover");
1235
+ var PopoverRoot = ({ children }) => {
1236
+ const { state } = useDeckState();
1237
+ const virtualRef = useRef3(null);
1238
+ const [virtualIter, setVirtualIter] = useState3(0);
1239
+ const [open, setOpen] = useState3(false);
1240
+ const debounceRef = useRef3(null);
1241
+ useEffect5(() => {
1242
+ setOpen(false);
1243
+ if (state.popoverOpen) {
1244
+ if (debounceRef.current) {
1245
+ clearTimeout(debounceRef.current);
1246
+ }
1247
+ if (state.popoverAnchor && virtualRef.current !== state.popoverAnchor) {
1248
+ virtualRef.current = state.popoverAnchor ?? null;
1249
+ setVirtualIter((iter) => iter + 1);
1250
+ }
1251
+ debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
1252
+ }
1253
+ }, [
1254
+ state.popoverOpen,
1255
+ state.popoverAnchorId,
1256
+ state.popoverAnchor,
1257
+ state.popoverContent
1258
+ ]);
1259
+ return /* @__PURE__ */ React16.createElement(DeckPopoverProvider, {
1260
+ setOpen
1261
+ }, /* @__PURE__ */ React16.createElement(Popover2.Root, {
1262
+ modal: false,
1263
+ open
1264
+ }, state.popoverAnchor && /* @__PURE__ */ React16.createElement(Popover2.VirtualTrigger, {
1265
+ key: virtualIter,
1266
+ virtualRef
1267
+ }), children));
1268
+ };
1269
+ var PopoverContent = () => {
1270
+ const { t } = useTranslation7(meta.id);
1271
+ const { state, updateEphemeral } = useDeckState();
1272
+ const { setOpen } = useDeckPopoverContext("PopoverContent");
1273
+ const popoverSubject = state.popoverContent?.subject;
1274
+ const isObjectPopover = Obj.isObject(popoverSubject);
1275
+ const objectMenuItems = useObjectMenuItems(popoverSubject);
1276
+ const icon = isObjectPopover ? Function.pipe(Obj.getSchema(popoverSubject), Option.fromNullable, Option.flatMap(Annotation.IconAnnotation.get), Option.map(({ icon: icon2 }) => icon2), Option.getOrElse(() => "ph--placeholder--regular")) : void 0;
1277
+ const handleClose = useCallback8(() => {
1278
+ setOpen(false);
1279
+ updateEphemeral((state2) => ({
1280
+ ...state2,
1281
+ popoverOpen: false,
1282
+ popoverAnchor: void 0,
1283
+ popoverAnchorId: void 0,
1284
+ popoverSide: void 0
1285
+ }));
1286
+ }, [
1287
+ updateEphemeral
1288
+ ]);
1289
+ const handleInteractOutside = useCallback8((event) => {
1290
+ if (
1291
+ // TODO(thure): CodeMirror should not focus itself when it updates.
1292
+ event.type === "dismissableLayer.focusOutside" && event.currentTarget?.classList.contains("cm-content")
1293
+ ) {
1294
+ event.preventDefault();
1295
+ } else {
1296
+ handleClose();
1297
+ }
1298
+ }, [
1299
+ handleClose
1300
+ ]);
1301
+ return /* @__PURE__ */ React16.createElement(Popover2.Portal, null, /* @__PURE__ */ React16.createElement(Popover2.Content, {
1302
+ side: state.popoverSide,
1303
+ sticky: "always",
1304
+ hideWhenDetached: true,
1305
+ onInteractOutside: handleInteractOutside,
1306
+ onEscapeKeyDown: handleInteractOutside
1307
+ }, /* @__PURE__ */ React16.createElement(Popover2.Viewport, null, state.popoverKind === "base" && /* @__PURE__ */ React16.createElement(Surface10.Surface, {
1308
+ role: "popover",
1309
+ data: state.popoverContent,
1310
+ limit: 1
1311
+ }), state.popoverKind === "card" && /* @__PURE__ */ React16.createElement(Menu.Root, null, /* @__PURE__ */ React16.createElement(Card.Root, {
1312
+ border: false,
1313
+ classNames: "dx-card-popover"
1314
+ }, /* @__PURE__ */ React16.createElement(Card.Toolbar, null, icon ? /* @__PURE__ */ React16.createElement(Card.Icon, {
1315
+ icon
1316
+ }) : /* @__PURE__ */ React16.createElement(Card.IconBlock, null), state.popoverTitle ? /* @__PURE__ */ React16.createElement(Card.Title, null, toLocalizedString3(state.popoverTitle, t)) : /* @__PURE__ */ React16.createElement("span", null), /* @__PURE__ */ React16.createElement(Menu.Trigger, {
1317
+ asChild: true,
1318
+ disabled: !objectMenuItems.length
1319
+ }, /* @__PURE__ */ React16.createElement(Toolbar.IconButton, {
1320
+ iconOnly: true,
1321
+ variant: "ghost",
1322
+ icon: "ph--dots-three-vertical--regular",
1323
+ label: "Actions"
1324
+ })), /* @__PURE__ */ React16.createElement(Menu.Content, {
1325
+ items: objectMenuItems
1326
+ })), /* @__PURE__ */ React16.createElement(Surface10.Surface, {
1327
+ role: "card--content",
1328
+ data: state.popoverContent,
1329
+ limit: 1
1330
+ })))), /* @__PURE__ */ React16.createElement(Popover2.Arrow, null)));
1331
+ };
1332
+
1333
+ // src/components/DeckLayout/Toast.tsx
1334
+ import React17 from "react";
1335
+ import { Button, Icon as Icon2, Toast as NaturalToast, toLocalizedString as toLocalizedString4, useTranslation as useTranslation8 } from "@dxos/react-ui";
1336
+ var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange }) => {
1337
+ const { t } = useTranslation8(meta.id);
1338
+ return /* @__PURE__ */ React17.createElement(NaturalToast.Root, {
1339
+ "data-testid": id,
1340
+ defaultOpen: true,
1341
+ duration,
1342
+ onOpenChange
1343
+ }, /* @__PURE__ */ React17.createElement(NaturalToast.Body, null, /* @__PURE__ */ React17.createElement(NaturalToast.Title, {
1344
+ classNames: "items-center"
1345
+ }, icon && /* @__PURE__ */ React17.createElement(Icon2, {
1346
+ icon,
1347
+ classNames: "inline mr-1"
1348
+ }), title && /* @__PURE__ */ React17.createElement("span", null, toLocalizedString4(title, t))), description && /* @__PURE__ */ React17.createElement(NaturalToast.Description, null, description && toLocalizedString4(description, t))), /* @__PURE__ */ React17.createElement(NaturalToast.Actions, null, onAction && actionAlt && actionLabel && /* @__PURE__ */ React17.createElement(NaturalToast.Action, {
1349
+ altText: toLocalizedString4(actionAlt, t),
1350
+ asChild: true
1351
+ }, /* @__PURE__ */ React17.createElement(Button, {
1352
+ "data-testid": "toast.action",
1353
+ variant: "primary",
1354
+ onClick: () => onAction?.()
1355
+ }, toLocalizedString4(actionLabel, t))), closeLabel && /* @__PURE__ */ React17.createElement(NaturalToast.Close, {
1356
+ asChild: true
1357
+ }, /* @__PURE__ */ React17.createElement(Button, {
1358
+ "data-testid": "toast.close"
1359
+ }, toLocalizedString4(closeLabel, t)))));
1360
+ };
1361
+ var Toaster = ({ toasts, onDismissToast }) => {
1362
+ return /* @__PURE__ */ React17.createElement(React17.Fragment, null, toasts?.map((toast) => /* @__PURE__ */ React17.createElement(Toast, {
1363
+ ...toast,
1364
+ key: toast.id,
1365
+ onOpenChange: (open) => {
1366
+ if (!open) {
1367
+ onDismissToast?.(toast.id);
1368
+ }
1369
+ return open;
1370
+ }
1371
+ })));
1372
+ };
1373
+
1374
+ // src/components/DeckLayout/DeckLayout.tsx
1375
+ var DeckLayout = ({ onDismissToast }) => {
1376
+ const { state } = useDeckState();
1377
+ const { toasts } = state;
1378
+ return /* @__PURE__ */ React18.createElement(Mosaic.Root, null, /* @__PURE__ */ React18.createElement(PopoverRoot, null, /* @__PURE__ */ React18.createElement(ActiveNode, null), /* @__PURE__ */ React18.createElement(DeckMain, null), /* @__PURE__ */ React18.createElement(PopoverContent, null), /* @__PURE__ */ React18.createElement(Dialog, null), /* @__PURE__ */ React18.createElement(Toaster, {
1379
+ toasts,
1380
+ onDismissToast
1381
+ })));
1382
+ };
1383
+
1384
+ export {
1385
+ Banner,
1386
+ DeckLayout
1387
+ };
1388
+ //# sourceMappingURL=chunk-WTNYSXY5.mjs.map