@dxos/plugin-deck 0.7.5-main.9d2a38b → 0.7.5-main.b19bfc8

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 (233) hide show
  1. package/dist/lib/browser/{app-graph-builder-67VRUD5K.mjs → app-graph-builder-IYHAGFA3.mjs} +61 -31
  2. package/dist/lib/browser/app-graph-builder-IYHAGFA3.mjs.map +7 -0
  3. package/dist/lib/browser/{check-app-scheme-GEX6W2R5.mjs → check-app-scheme-S3EYUPMF.mjs} +3 -3
  4. package/dist/lib/browser/{check-app-scheme-GEX6W2R5.mjs.map → check-app-scheme-S3EYUPMF.mjs.map} +2 -2
  5. package/dist/lib/browser/{chunk-5VFDMW5M.mjs → chunk-22AQ5IVX.mjs} +2 -2
  6. package/dist/lib/browser/chunk-22AQ5IVX.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-CYE6QZBQ.mjs +128 -0
  8. package/dist/lib/browser/chunk-CYE6QZBQ.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-DIM5INBX.mjs +24 -0
  10. package/dist/lib/browser/chunk-DIM5INBX.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-DIXE74SK.mjs +1097 -0
  12. package/dist/lib/browser/chunk-DIXE74SK.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-KANJBSIX.mjs +97 -0
  14. package/dist/lib/browser/chunk-KANJBSIX.mjs.map +7 -0
  15. package/dist/lib/browser/{chunk-JQJ5UWVB.mjs → chunk-N7TEPFVR.mjs} +3 -2
  16. package/dist/lib/browser/{chunk-JQJ5UWVB.mjs.map → chunk-N7TEPFVR.mjs.map} +3 -3
  17. package/dist/lib/browser/index.mjs +45 -78
  18. package/dist/lib/browser/index.mjs.map +4 -4
  19. package/dist/lib/browser/intent-resolver-MWUADUNI.mjs +488 -0
  20. package/dist/lib/browser/intent-resolver-MWUADUNI.mjs.map +7 -0
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/{react-root-UL7ZDRVZ.mjs → react-root-IELFERPV.mjs} +12 -17
  23. package/dist/lib/browser/react-root-IELFERPV.mjs.map +7 -0
  24. package/dist/lib/browser/react-surface-WL45R43W.mjs +39 -0
  25. package/dist/lib/browser/react-surface-WL45R43W.mjs.map +7 -0
  26. package/dist/lib/browser/{settings-FNWW6WIJ.mjs → settings-YONG3QB7.mjs} +6 -7
  27. package/dist/lib/browser/settings-YONG3QB7.mjs.map +7 -0
  28. package/dist/lib/browser/state-MZZL5S2D.mjs +124 -0
  29. package/dist/lib/browser/state-MZZL5S2D.mjs.map +7 -0
  30. package/dist/lib/browser/tools-5LDJNU56.mjs +51 -0
  31. package/dist/lib/browser/tools-5LDJNU56.mjs.map +7 -0
  32. package/dist/lib/browser/types.mjs +16 -4
  33. package/dist/lib/browser/url-handler-MVHTKUYA.mjs +72 -0
  34. package/dist/lib/browser/url-handler-MVHTKUYA.mjs.map +7 -0
  35. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
  37. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  38. package/dist/types/src/capabilities/capabilities.d.ts +137 -8
  39. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  40. package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -0
  41. package/dist/types/src/capabilities/index.d.ts +188 -3
  42. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  43. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
  44. package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
  45. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  46. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  47. package/dist/types/src/capabilities/state.d.ts +79 -0
  48. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  49. package/dist/types/src/capabilities/tools.d.ts +10 -0
  50. package/dist/types/src/capabilities/tools.d.ts.map +1 -0
  51. package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
  52. package/dist/types/src/components/DeckLayout/ActiveNode.d.ts +1 -2
  53. package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
  54. package/dist/types/src/components/DeckLayout/Banner.d.ts +1 -2
  55. package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
  56. package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts +1 -4
  57. package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts.map +1 -1
  58. package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts +1 -2
  59. package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
  60. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -7
  61. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  62. package/dist/types/src/components/DeckLayout/Fallback.d.ts +1 -2
  63. package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +1 -1
  64. package/dist/types/src/components/DeckLayout/Fullscreen.d.ts +1 -2
  65. package/dist/types/src/components/DeckLayout/Fullscreen.d.ts.map +1 -1
  66. package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts +3 -3
  67. package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts.map +1 -1
  68. package/dist/types/src/components/DeckLayout/Plank.d.ts +8 -6
  69. package/dist/types/src/components/DeckLayout/Plank.d.ts.map +1 -1
  70. package/dist/types/src/components/DeckLayout/PlankControls.d.ts +2 -2
  71. package/dist/types/src/components/DeckLayout/PlankControls.d.ts.map +1 -1
  72. package/dist/types/src/components/DeckLayout/PlankError.d.ts +6 -6
  73. package/dist/types/src/components/DeckLayout/PlankError.d.ts.map +1 -1
  74. package/dist/types/src/components/DeckLayout/PlankLoading.d.ts +1 -2
  75. package/dist/types/src/components/DeckLayout/PlankLoading.d.ts.map +1 -1
  76. package/dist/types/src/components/DeckLayout/Sidebar.d.ts +1 -2
  77. package/dist/types/src/components/DeckLayout/Sidebar.d.ts.map +1 -1
  78. package/dist/types/src/components/DeckLayout/SidebarButton.d.ts +6 -5
  79. package/dist/types/src/components/DeckLayout/SidebarButton.d.ts.map +1 -1
  80. package/dist/types/src/components/DeckLayout/StatusBar.d.ts +1 -2
  81. package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +1 -1
  82. package/dist/types/src/components/DeckLayout/Toast.d.ts +2 -3
  83. package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
  84. package/dist/types/src/components/DeckLayout/Topbar.d.ts +1 -2
  85. package/dist/types/src/components/DeckLayout/Topbar.d.ts.map +1 -1
  86. package/dist/types/src/components/LayoutSettings.d.ts +1 -2
  87. package/dist/types/src/components/LayoutSettings.d.ts.map +1 -1
  88. package/dist/types/src/components/fragments.d.ts +2 -0
  89. package/dist/types/src/components/fragments.d.ts.map +1 -1
  90. package/dist/types/src/components/index.d.ts +0 -2
  91. package/dist/types/src/components/index.d.ts.map +1 -1
  92. package/dist/types/src/events.d.ts +1 -0
  93. package/dist/types/src/events.d.ts.map +1 -1
  94. package/dist/types/src/hooks/useMainSize.d.ts +2 -2
  95. package/dist/types/src/hooks/useNode.d.ts.map +1 -1
  96. package/dist/types/src/layout.d.ts +5 -19
  97. package/dist/types/src/layout.d.ts.map +1 -1
  98. package/dist/types/src/meta.d.ts +1 -0
  99. package/dist/types/src/meta.d.ts.map +1 -1
  100. package/dist/types/src/translations.d.ts +3 -3
  101. package/dist/types/src/types.d.ts +111 -2
  102. package/dist/types/src/types.d.ts.map +1 -1
  103. package/dist/types/src/util/index.d.ts +3 -1
  104. package/dist/types/src/util/index.d.ts.map +1 -1
  105. package/dist/types/src/util/layoutAppliesTopbar.d.ts +2 -0
  106. package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -0
  107. package/dist/types/src/util/set-active.d.ts +9 -0
  108. package/dist/types/src/util/set-active.d.ts.map +1 -0
  109. package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -1
  110. package/package.json +32 -31
  111. package/src/DeckPlugin.ts +23 -59
  112. package/src/capabilities/{layout/app-graph-builder.ts → app-graph-builder.ts} +40 -28
  113. package/src/capabilities/capabilities.ts +5 -7
  114. package/src/capabilities/{navigation/check-app-scheme.ts → check-app-scheme.ts} +2 -2
  115. package/src/capabilities/index.ts +12 -3
  116. package/src/capabilities/intent-resolver.ts +368 -0
  117. package/src/capabilities/{layout/react-root.tsx → react-root.tsx} +8 -14
  118. package/src/capabilities/react-surface.tsx +31 -0
  119. package/src/capabilities/{settings/settings.ts → settings.ts} +4 -5
  120. package/src/capabilities/state.ts +107 -0
  121. package/src/capabilities/tools.ts +61 -0
  122. package/src/capabilities/url-handler.ts +65 -0
  123. package/src/components/DeckLayout/ActiveNode.tsx +2 -3
  124. package/src/components/DeckLayout/ComplementarySidebar.tsx +137 -76
  125. package/src/components/DeckLayout/ContentEmpty.tsx +7 -10
  126. package/src/components/DeckLayout/DeckLayout.tsx +141 -84
  127. package/src/components/DeckLayout/Fullscreen.tsx +2 -3
  128. package/src/components/DeckLayout/NodePlankHeading.tsx +57 -65
  129. package/src/components/DeckLayout/Plank.tsx +33 -41
  130. package/src/components/DeckLayout/PlankControls.tsx +12 -11
  131. package/src/components/DeckLayout/PlankError.tsx +6 -5
  132. package/src/components/DeckLayout/Sidebar.tsx +17 -20
  133. package/src/components/DeckLayout/SidebarButton.tsx +25 -31
  134. package/src/components/DeckLayout/StatusBar.tsx +5 -11
  135. package/src/components/DeckLayout/Toast.tsx +2 -2
  136. package/src/components/LayoutSettings.tsx +8 -8
  137. package/src/components/fragments.ts +8 -0
  138. package/src/components/index.ts +0 -2
  139. package/src/events.ts +1 -0
  140. package/src/hooks/useMainSize.ts +3 -3
  141. package/src/hooks/useNode.ts +3 -1
  142. package/src/layout.ts +43 -212
  143. package/src/meta.ts +1 -0
  144. package/src/translations.ts +8 -8
  145. package/src/types.ts +97 -4
  146. package/src/util/index.ts +3 -1
  147. package/src/util/layoutAppliesTopbar.ts +7 -0
  148. package/src/util/set-active.ts +47 -0
  149. package/src/util/useHoistStatusbar.ts +13 -8
  150. package/dist/lib/browser/app-graph-builder-67VRUD5K.mjs.map +0 -7
  151. package/dist/lib/browser/chunk-2M4PXYNB.mjs +0 -1052
  152. package/dist/lib/browser/chunk-2M4PXYNB.mjs.map +0 -7
  153. package/dist/lib/browser/chunk-2PJNBVCY.mjs +0 -39
  154. package/dist/lib/browser/chunk-2PJNBVCY.mjs.map +0 -7
  155. package/dist/lib/browser/chunk-4C2AFTET.mjs +0 -186
  156. package/dist/lib/browser/chunk-4C2AFTET.mjs.map +0 -7
  157. package/dist/lib/browser/chunk-5VFDMW5M.mjs.map +0 -7
  158. package/dist/lib/browser/chunk-KY5WXIXY.mjs +0 -44
  159. package/dist/lib/browser/chunk-KY5WXIXY.mjs.map +0 -7
  160. package/dist/lib/browser/deck-PLCSKPGL.mjs +0 -26
  161. package/dist/lib/browser/deck-PLCSKPGL.mjs.map +0 -7
  162. package/dist/lib/browser/intent-resolver-FVOQSTBX.mjs +0 -152
  163. package/dist/lib/browser/intent-resolver-FVOQSTBX.mjs.map +0 -7
  164. package/dist/lib/browser/intent-resolver-K7GW4A2I.mjs +0 -249
  165. package/dist/lib/browser/intent-resolver-K7GW4A2I.mjs.map +0 -7
  166. package/dist/lib/browser/location-QHRBQBQN.mjs +0 -35
  167. package/dist/lib/browser/location-QHRBQBQN.mjs.map +0 -7
  168. package/dist/lib/browser/react-context-3BDW7W2N.mjs +0 -32
  169. package/dist/lib/browser/react-context-3BDW7W2N.mjs.map +0 -7
  170. package/dist/lib/browser/react-root-UL7ZDRVZ.mjs.map +0 -7
  171. package/dist/lib/browser/react-surface-VPNOGGNN.mjs +0 -28
  172. package/dist/lib/browser/react-surface-VPNOGGNN.mjs.map +0 -7
  173. package/dist/lib/browser/settings-FNWW6WIJ.mjs.map +0 -7
  174. package/dist/lib/browser/state-7I5BD7SE.mjs +0 -34
  175. package/dist/lib/browser/state-7I5BD7SE.mjs.map +0 -7
  176. package/dist/lib/browser/url-handler-Z5B7LD3N.mjs +0 -76
  177. package/dist/lib/browser/url-handler-Z5B7LD3N.mjs.map +0 -7
  178. package/dist/types/src/capabilities/layout/app-graph-builder.d.ts +0 -181
  179. package/dist/types/src/capabilities/layout/app-graph-builder.d.ts.map +0 -1
  180. package/dist/types/src/capabilities/layout/deck.d.ts +0 -4
  181. package/dist/types/src/capabilities/layout/deck.d.ts.map +0 -1
  182. package/dist/types/src/capabilities/layout/index.d.ts +0 -229
  183. package/dist/types/src/capabilities/layout/index.d.ts.map +0 -1
  184. package/dist/types/src/capabilities/layout/intent-resolver.d.ts.map +0 -1
  185. package/dist/types/src/capabilities/layout/react-context.d.ts +0 -8
  186. package/dist/types/src/capabilities/layout/react-context.d.ts.map +0 -1
  187. package/dist/types/src/capabilities/layout/react-root.d.ts.map +0 -1
  188. package/dist/types/src/capabilities/layout/state.d.ts +0 -42
  189. package/dist/types/src/capabilities/layout/state.d.ts.map +0 -1
  190. package/dist/types/src/capabilities/navigation/check-app-scheme.d.ts.map +0 -1
  191. package/dist/types/src/capabilities/navigation/index.d.ts +0 -5
  192. package/dist/types/src/capabilities/navigation/index.d.ts.map +0 -1
  193. package/dist/types/src/capabilities/navigation/intent-resolver.d.ts +0 -4
  194. package/dist/types/src/capabilities/navigation/intent-resolver.d.ts.map +0 -1
  195. package/dist/types/src/capabilities/navigation/location.d.ts +0 -4
  196. package/dist/types/src/capabilities/navigation/location.d.ts.map +0 -1
  197. package/dist/types/src/capabilities/navigation/set-location.d.ts +0 -10
  198. package/dist/types/src/capabilities/navigation/set-location.d.ts.map +0 -1
  199. package/dist/types/src/capabilities/navigation/url-handler.d.ts.map +0 -1
  200. package/dist/types/src/capabilities/settings/index.d.ts +0 -3
  201. package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
  202. package/dist/types/src/capabilities/settings/react-surface.d.ts.map +0 -1
  203. package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
  204. package/dist/types/src/components/DeckContext.d.ts +0 -11
  205. package/dist/types/src/components/DeckContext.d.ts.map +0 -1
  206. package/dist/types/src/components/LayoutContext.d.ts +0 -5
  207. package/dist/types/src/components/LayoutContext.d.ts.map +0 -1
  208. package/dist/types/src/layout.test.d.ts +0 -2
  209. package/dist/types/src/layout.test.d.ts.map +0 -1
  210. package/dist/types/src/util/layout-parts.d.ts +0 -7
  211. package/dist/types/src/util/layout-parts.d.ts.map +0 -1
  212. package/src/capabilities/layout/deck.ts +0 -25
  213. package/src/capabilities/layout/index.ts +0 -12
  214. package/src/capabilities/layout/intent-resolver.ts +0 -128
  215. package/src/capabilities/layout/react-context.tsx +0 -26
  216. package/src/capabilities/layout/state.ts +0 -32
  217. package/src/capabilities/navigation/index.ts +0 -10
  218. package/src/capabilities/navigation/intent-resolver.ts +0 -216
  219. package/src/capabilities/navigation/location.ts +0 -28
  220. package/src/capabilities/navigation/set-location.ts +0 -38
  221. package/src/capabilities/navigation/url-handler.ts +0 -67
  222. package/src/capabilities/settings/index.ts +0 -8
  223. package/src/capabilities/settings/react-surface.tsx +0 -23
  224. package/src/components/DeckContext.ts +0 -19
  225. package/src/components/LayoutContext.ts +0 -12
  226. package/src/layout.test.ts +0 -380
  227. package/src/util/layout-parts.ts +0 -12
  228. /package/dist/types/src/capabilities/{navigation/check-app-scheme.d.ts → check-app-scheme.d.ts} +0 -0
  229. /package/dist/types/src/capabilities/{layout/intent-resolver.d.ts → intent-resolver.d.ts} +0 -0
  230. /package/dist/types/src/capabilities/{layout/react-root.d.ts → react-root.d.ts} +0 -0
  231. /package/dist/types/src/capabilities/{settings/react-surface.d.ts → react-surface.d.ts} +0 -0
  232. /package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +0 -0
  233. /package/dist/types/src/capabilities/{navigation/url-handler.d.ts → url-handler.d.ts} +0 -0
@@ -0,0 +1,1097 @@
1
+ import {
2
+ calculateOverscroll,
3
+ layoutAppliesTopbar,
4
+ useBreakpoints,
5
+ useHoistStatusbar
6
+ } from "./chunk-KANJBSIX.mjs";
7
+ import {
8
+ DeckCapabilities
9
+ } from "./chunk-22AQ5IVX.mjs";
10
+ import {
11
+ DeckAction,
12
+ NewPlankPositions,
13
+ OverscrollOptions,
14
+ SLUG_PATH_SEPARATOR,
15
+ getMode
16
+ } from "./chunk-CYE6QZBQ.mjs";
17
+ import {
18
+ DECK_PLUGIN
19
+ } from "./chunk-N7TEPFVR.mjs";
20
+
21
+ // packages/plugins/plugin-deck/src/components/DeckLayout/Banner.tsx
22
+ import React2 from "react";
23
+ import { Surface } from "@dxos/app-framework";
24
+ import { mx } from "@dxos/react-ui-theme";
25
+
26
+ // packages/plugins/plugin-deck/src/components/DeckLayout/SidebarButton.tsx
27
+ import React from "react";
28
+ import { useCapability } from "@dxos/app-framework";
29
+ import { IconButton, useTranslation } from "@dxos/react-ui";
30
+ var ToggleSidebarButton = ({ classNames, variant = "ghost" }) => {
31
+ const layoutContext = useCapability(DeckCapabilities.MutableDeckState);
32
+ const { t } = useTranslation(DECK_PLUGIN);
33
+ return /* @__PURE__ */ React.createElement(IconButton, {
34
+ variant,
35
+ iconOnly: true,
36
+ icon: "ph--sidebar--regular",
37
+ size: 4,
38
+ label: t("open navigation sidebar label"),
39
+ onClick: () => layoutContext.sidebarState = layoutContext.sidebarState === "expanded" ? "collapsed" : "expanded",
40
+ classNames
41
+ });
42
+ };
43
+ var CloseSidebarButton = () => {
44
+ const layoutContext = useCapability(DeckCapabilities.MutableDeckState);
45
+ const { t } = useTranslation(DECK_PLUGIN);
46
+ return /* @__PURE__ */ React.createElement(IconButton, {
47
+ variant: "ghost",
48
+ iconOnly: true,
49
+ icon: "ph--caret-line-left--regular",
50
+ size: 4,
51
+ label: t("close navigation sidebar label"),
52
+ onClick: () => layoutContext.sidebarState = "collapsed",
53
+ classNames: "rounded-none pli-1 dx-focus-ring-inset pie-[max(.5rem,env(safe-area-inset-left))]"
54
+ });
55
+ };
56
+ var ToggleComplementarySidebarButton = ({ inR0, classNames }) => {
57
+ const layoutContext = useCapability(DeckCapabilities.MutableDeckState);
58
+ const { t } = useTranslation(DECK_PLUGIN);
59
+ return /* @__PURE__ */ React.createElement(IconButton, {
60
+ iconOnly: true,
61
+ onClick: () => layoutContext.complementarySidebarState = layoutContext.complementarySidebarState === "expanded" ? "collapsed" : "expanded",
62
+ variant: "ghost",
63
+ label: t("open complementary sidebar label"),
64
+ classNames: [
65
+ "[&>svg]:-scale-x-100",
66
+ classNames
67
+ ],
68
+ icon: "ph--sidebar-simple--regular",
69
+ size: inR0 ? 5 : 4,
70
+ tooltipSide: inR0 ? "left" : void 0
71
+ });
72
+ };
73
+
74
+ // packages/plugins/plugin-deck/src/components/DeckLayout/Banner.tsx
75
+ var Banner = ({ variant, classNames }) => {
76
+ return /* @__PURE__ */ React2.createElement("header", {
77
+ className: mx("flex items-stretch relative plb-1 pis-1 pie-2", variant === "topbar" && "fixed inset-inline-0 block-start-[env(safe-area-inset-top)] bs-[--rail-size] border-be border-separator", classNames)
78
+ }, variant === "sidebar" ? /* @__PURE__ */ React2.createElement(CloseSidebarButton, null) : /* @__PURE__ */ React2.createElement(ToggleSidebarButton, null), /* @__PURE__ */ React2.createElement("span", {
79
+ className: "self-center grow mis-1"
80
+ }, "Composer"), variant === "topbar" && /* @__PURE__ */ React2.createElement("div", {
81
+ role: "none",
82
+ className: "absolute inset-0 pointer-events-none"
83
+ }, /* @__PURE__ */ React2.createElement("div", {
84
+ role: "none",
85
+ className: "grid bs-full pointer-fine:p-1 max-is-md mli-auto pointer-events-auto"
86
+ }, /* @__PURE__ */ React2.createElement(Surface, {
87
+ role: "search-input",
88
+ limit: 1
89
+ }))), /* @__PURE__ */ React2.createElement("span", {
90
+ role: "none",
91
+ className: "grow"
92
+ }), /* @__PURE__ */ React2.createElement(Surface, {
93
+ role: "header-end",
94
+ limit: 1
95
+ }), /* @__PURE__ */ React2.createElement(Surface, {
96
+ role: "notch-start",
97
+ limit: 1
98
+ }));
99
+ };
100
+
101
+ // packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
102
+ import { untracked } from "@preact/signals-core";
103
+ import React17, { useCallback as useCallback4, useEffect as useEffect6, useMemo as useMemo5, useRef as useRef2, Fragment as Fragment2, useState as useState4 } from "react";
104
+ import { LayoutAction as LayoutAction4, createIntent as createIntent4, Surface as Surface10, useCapability as useCapability5, useIntentDispatcher as useIntentDispatcher4, usePluginManager } from "@dxos/app-framework";
105
+ import { AttentionCapabilities } from "@dxos/plugin-attention";
106
+ import { AlertDialog, Dialog as NaturalDialog, Main as Main3, Popover as Popover2, useOnTransition, useMediaQuery } from "@dxos/react-ui";
107
+ import { Stack, StackContext, DEFAULT_HORIZONTAL_SIZE } from "@dxos/react-ui-stack";
108
+ import { mainPaddingTransitions } from "@dxos/react-ui-theme";
109
+
110
+ // packages/plugins/plugin-deck/src/components/DeckLayout/ActiveNode.tsx
111
+ import React3 from "react";
112
+ import { Surface as Surface2, useAppGraph } from "@dxos/app-framework";
113
+ import { useAttended } from "@dxos/react-ui-attention";
114
+
115
+ // packages/plugins/plugin-deck/src/hooks/useNode.ts
116
+ import { useEffect, useState } from "react";
117
+ var useNode = (graph, id, timeout) => {
118
+ const [nodeState, setNodeState] = useState(id ? graph.findNode(id, false) : void 0);
119
+ useEffect(() => {
120
+ if (!id && nodeState) {
121
+ setNodeState(void 0);
122
+ }
123
+ if (nodeState?.id === id || !id) {
124
+ return;
125
+ }
126
+ const frame = requestAnimationFrame(async () => {
127
+ try {
128
+ const node = await graph.waitForNode(id, timeout);
129
+ if (node) {
130
+ setNodeState(node);
131
+ }
132
+ } catch {
133
+ }
134
+ });
135
+ return () => cancelAnimationFrame(frame);
136
+ }, [
137
+ graph,
138
+ id,
139
+ timeout,
140
+ nodeState?.id
141
+ ]);
142
+ return nodeState;
143
+ };
144
+
145
+ // packages/plugins/plugin-deck/src/hooks/useNodeActionExpander.ts
146
+ import { useEffect as useEffect2 } from "react";
147
+ import { ACTION_GROUP_TYPE, ACTION_TYPE, getGraph } from "@dxos/plugin-graph";
148
+ var expandNodeActions = async (node) => {
149
+ const graph = getGraph(node);
150
+ await graph.expand(node, "outbound", ACTION_GROUP_TYPE);
151
+ await graph.expand(node, "outbound", ACTION_TYPE);
152
+ };
153
+ var useNodeActionExpander = (node) => {
154
+ useEffect2(() => {
155
+ if (node) {
156
+ const frame = requestAnimationFrame(() => {
157
+ void expandNodeActions(node);
158
+ });
159
+ return () => cancelAnimationFrame(frame);
160
+ }
161
+ }, [
162
+ node
163
+ ]);
164
+ };
165
+
166
+ // packages/plugins/plugin-deck/src/hooks/useMainSize.ts
167
+ import { useMainContext } from "@dxos/react-ui";
168
+ var useMainSize = () => {
169
+ const { navigationSidebarState, complementarySidebarState } = useMainContext("DeckPluginPlank");
170
+ return {
171
+ "data-sidebar-inline-start-state": navigationSidebarState,
172
+ "data-sidebar-inline-end-state": complementarySidebarState
173
+ };
174
+ };
175
+
176
+ // packages/plugins/plugin-deck/src/components/DeckLayout/ActiveNode.tsx
177
+ var ActiveNode = () => {
178
+ const [id] = useAttended();
179
+ const { graph } = useAppGraph();
180
+ const activeNode = useNode(graph, id);
181
+ useNodeActionExpander(activeNode);
182
+ return /* @__PURE__ */ React3.createElement("div", {
183
+ role: "none",
184
+ className: "sr-only"
185
+ }, /* @__PURE__ */ React3.createElement(Surface2, {
186
+ role: "document-title",
187
+ data: {
188
+ subject: activeNode
189
+ },
190
+ limit: 1
191
+ }));
192
+ };
193
+
194
+ // packages/plugins/plugin-deck/src/components/DeckLayout/ComplementarySidebar.tsx
195
+ import React8, { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo2, useState as useState3 } from "react";
196
+ import { createIntent as createIntent2, LayoutAction as LayoutAction2, Surface as Surface4, useAppGraph as useAppGraph3, useCapabilities, useCapability as useCapability2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
197
+ import { Main, useTranslation as useTranslation5, toLocalizedString as toLocalizedString2, IconButton as IconButton2, ScrollArea } from "@dxos/react-ui";
198
+ import { useAttended as useAttended2 } from "@dxos/react-ui-attention";
199
+ import { Tabs } from "@dxos/react-ui-tabs";
200
+
201
+ // packages/plugins/plugin-deck/src/components/DeckLayout/PlankError.tsx
202
+ import React7, { useEffect as useEffect4, useState as useState2 } from "react";
203
+ import { useTranslation as useTranslation4 } from "@dxos/react-ui";
204
+ import { descriptionText, mx as mx3 } from "@dxos/react-ui-theme";
205
+
206
+ // packages/plugins/plugin-deck/src/components/DeckLayout/NodePlankHeading.tsx
207
+ import React5, { Fragment, memo, useCallback, useEffect as useEffect3, useMemo } from "react";
208
+ import { createIntent, LayoutAction, Surface as Surface3, useAppGraph as useAppGraph2, useIntentDispatcher } from "@dxos/app-framework";
209
+ import { Icon as Icon2, Popover, toLocalizedString, useTranslation as useTranslation3 } from "@dxos/react-ui";
210
+ import { StackItem } from "@dxos/react-ui-stack";
211
+ import { TextTooltip } from "@dxos/react-ui-text-tooltip";
212
+
213
+ // packages/plugins/plugin-deck/src/components/DeckLayout/PlankControls.tsx
214
+ import React4, { forwardRef } from "react";
215
+ import { Button, ButtonGroup, Icon, Tooltip, useTranslation as useTranslation2 } from "@dxos/react-ui";
216
+ var PlankControl = ({ icon, label, ...props }) => {
217
+ return /* @__PURE__ */ React4.createElement(Tooltip.Root, null, /* @__PURE__ */ React4.createElement(Tooltip.Trigger, {
218
+ asChild: true
219
+ }, /* @__PURE__ */ React4.createElement(Button, {
220
+ variant: "ghost",
221
+ ...props
222
+ }, /* @__PURE__ */ React4.createElement("span", {
223
+ className: "sr-only"
224
+ }, label), /* @__PURE__ */ React4.createElement(Icon, {
225
+ icon,
226
+ size: 5
227
+ }))), /* @__PURE__ */ React4.createElement(Tooltip.Portal, null, /* @__PURE__ */ React4.createElement(Tooltip.Content, {
228
+ side: "bottom"
229
+ }, label)));
230
+ };
231
+ var PlankControls = /* @__PURE__ */ forwardRef(({ onClick, variant = "default", capabilities: can, isSolo, pin, close = false, children, classNames, ...props }, forwardedRef) => {
232
+ const { t } = useTranslation2(DECK_PLUGIN);
233
+ const buttonClassNames = variant === "hide-disabled" ? "disabled:hidden pli-2 plb-3" : "pli-2 plb-3";
234
+ return /* @__PURE__ */ React4.createElement(ButtonGroup, {
235
+ ...props,
236
+ classNames: [
237
+ "app-no-drag",
238
+ classNames
239
+ ],
240
+ ref: forwardedRef
241
+ }, can.solo && /* @__PURE__ */ React4.createElement(PlankControl, {
242
+ label: isSolo ? t("show deck plank label") : t("show solo plank label"),
243
+ classNames: buttonClassNames,
244
+ onClick: () => onClick?.("solo"),
245
+ icon: isSolo ? "ph--corners-in--regular" : "ph--corners-out--regular"
246
+ }), !isSolo && can.solo && /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(PlankControl, {
247
+ label: t("increment start label"),
248
+ disabled: !can.incrementStart,
249
+ classNames: buttonClassNames,
250
+ onClick: () => onClick?.("increment-start"),
251
+ icon: "ph--caret-left--regular"
252
+ }), /* @__PURE__ */ React4.createElement(PlankControl, {
253
+ label: t("increment end label"),
254
+ disabled: !can.incrementEnd,
255
+ classNames: buttonClassNames,
256
+ onClick: () => onClick?.("increment-end"),
257
+ icon: "ph--caret-right--regular"
258
+ })), close && !isSolo && /* @__PURE__ */ React4.createElement(PlankControl, {
259
+ label: t(`${typeof close === "string" ? "minify" : "close"} label`),
260
+ classNames: buttonClassNames,
261
+ onClick: () => onClick?.("close"),
262
+ "data-testid": "plankHeading.close",
263
+ icon: close === "minify-start" ? "ph--caret-line-left--regular" : close === "minify-end" ? "ph--caret-line-right--regular" : "ph--x--regular"
264
+ }), children);
265
+ });
266
+
267
+ // packages/plugins/plugin-deck/src/components/fragments.ts
268
+ import { mx as mx2 } from "@dxos/react-ui-theme";
269
+ var soloInlinePadding = "pis-[calc(env(safe-area-inset-left)+.25rem)] pie-[calc(env(safe-area-inset-left)+.25rem)]";
270
+ var sidebarToggleStyles = "bs-[--rail-item] is-[--rail-item] absolute block-end-2 z-[1] !bg-deck lg:hidden";
271
+ var fixedSidebarToggleStyles = mx2(sidebarToggleStyles, "inline-start-2");
272
+ var fixedComplementarySidebarToggleStyles = mx2(sidebarToggleStyles, "inline-end-2");
273
+
274
+ // packages/plugins/plugin-deck/src/components/DeckLayout/NodePlankHeading.tsx
275
+ var NodePlankHeading = /* @__PURE__ */ memo(({ id, part, node, canIncrementStart, canIncrementEnd, popoverAnchorId, pending, actions = [] }) => {
276
+ const { t } = useTranslation3(DECK_PLUGIN);
277
+ const { graph } = useAppGraph2();
278
+ const breakpoint = useBreakpoints();
279
+ const icon = node?.properties?.icon ?? "ph--placeholder--regular";
280
+ const label = pending ? t("pending heading") : toLocalizedString(node?.properties?.label ?? [
281
+ "plank heading fallback label",
282
+ {
283
+ ns: DECK_PLUGIN
284
+ }
285
+ ], t);
286
+ const { dispatchPromise: dispatch } = useIntentDispatcher();
287
+ const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${DECK_PLUGIN}/${node.id}` ? Popover.Anchor : Fragment;
288
+ useEffect3(() => {
289
+ const frame = requestAnimationFrame(() => {
290
+ node && graph.actions(node);
291
+ });
292
+ return () => cancelAnimationFrame(frame);
293
+ }, [
294
+ node
295
+ ]);
296
+ const attendableId = id.split(SLUG_PATH_SEPARATOR).at(0);
297
+ const capabilities = useMemo(() => ({
298
+ solo: breakpoint !== "mobile" && (part === "solo" || part === "deck"),
299
+ incrementStart: canIncrementStart,
300
+ incrementEnd: canIncrementEnd
301
+ }), [
302
+ breakpoint,
303
+ part,
304
+ canIncrementStart,
305
+ canIncrementEnd
306
+ ]);
307
+ const sigilActions = useMemo(() => node && [
308
+ actions,
309
+ graph.actions(node)
310
+ ].filter((a) => a.length > 0), [
311
+ actions,
312
+ node,
313
+ graph
314
+ ]);
315
+ const handleAction = useCallback((action) => {
316
+ typeof action.data === "function" && action.data?.({
317
+ node: action,
318
+ caller: DECK_PLUGIN
319
+ });
320
+ }, []);
321
+ const handlePlankAction = useCallback((eventType) => {
322
+ if (eventType === "solo") {
323
+ return dispatch(createIntent(DeckAction.Adjust, {
324
+ type: eventType,
325
+ id
326
+ }));
327
+ } else if (eventType === "close") {
328
+ if (part === "complementary") {
329
+ return dispatch(createIntent(LayoutAction.UpdateComplementary, {
330
+ part: "complementary",
331
+ options: {
332
+ state: "collapsed"
333
+ }
334
+ }));
335
+ } else {
336
+ return dispatch(createIntent(LayoutAction.Close, {
337
+ part: "main",
338
+ subject: [
339
+ id
340
+ ],
341
+ options: {
342
+ state: false
343
+ }
344
+ }));
345
+ }
346
+ } else {
347
+ return dispatch(createIntent(DeckAction.Adjust, {
348
+ type: eventType,
349
+ id
350
+ }));
351
+ }
352
+ }, [
353
+ dispatch,
354
+ id,
355
+ part
356
+ ]);
357
+ return /* @__PURE__ */ React5.createElement(StackItem.Heading, {
358
+ classNames: [
359
+ "plb-1 border-be border-separator items-stretch gap-1 sticky inline-start-12 app-drag",
360
+ part === "solo" ? soloInlinePadding : "pli-1"
361
+ ]
362
+ }, /* @__PURE__ */ React5.createElement(ActionRoot, null, node && sigilActions ? /* @__PURE__ */ React5.createElement(StackItem.Sigil, {
363
+ icon,
364
+ related: part === "complementary",
365
+ attendableId,
366
+ triggerLabel: t("actions menu label"),
367
+ actions: sigilActions,
368
+ onAction: handleAction
369
+ }, /* @__PURE__ */ React5.createElement(Surface3, {
370
+ role: "menu-footer",
371
+ data: {
372
+ subject: node.data
373
+ }
374
+ })) : /* @__PURE__ */ React5.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React5.createElement("span", {
375
+ className: "sr-only"
376
+ }, label), /* @__PURE__ */ React5.createElement(Icon2, {
377
+ icon,
378
+ size: 5
379
+ }))), /* @__PURE__ */ React5.createElement(TextTooltip, {
380
+ text: label,
381
+ onlyWhenTruncating: true
382
+ }, /* @__PURE__ */ React5.createElement(StackItem.HeadingLabel, {
383
+ attendableId,
384
+ related: part === "complementary",
385
+ ...pending && {
386
+ classNames: "text-description"
387
+ }
388
+ }, label)), node && part !== "complementary" && /* @__PURE__ */ React5.createElement(Surface3, {
389
+ role: "navbar-end",
390
+ data: {
391
+ subject: node.data
392
+ }
393
+ }), /* @__PURE__ */ React5.createElement(PlankControls, {
394
+ capabilities,
395
+ isSolo: part === "solo",
396
+ onClick: handlePlankAction,
397
+ close: part === "complementary" ? "minify-end" : true
398
+ }));
399
+ });
400
+
401
+ // packages/plugins/plugin-deck/src/components/DeckLayout/PlankLoading.tsx
402
+ import React6 from "react";
403
+ var PlankLoading = () => {
404
+ return /* @__PURE__ */ React6.createElement("div", {
405
+ role: "none",
406
+ className: "grid place-items-center attention-surface"
407
+ });
408
+ };
409
+
410
+ // packages/plugins/plugin-deck/src/components/DeckLayout/PlankError.tsx
411
+ var PlankContentError = ({ error }) => {
412
+ const { t } = useTranslation4(DECK_PLUGIN);
413
+ const errorString = error?.toString() ?? "";
414
+ return /* @__PURE__ */ React7.createElement("div", {
415
+ role: "none",
416
+ className: "overflow-auto p-8 attention-surface grid place-items-center"
417
+ }, /* @__PURE__ */ React7.createElement("p", {
418
+ role: "alert",
419
+ className: mx3(descriptionText, "break-words border border-dashed border-separator rounded-lg p-8", errorString.length < 256 && "text-lg")
420
+ }, error ? errorString : t("error fallback message")));
421
+ };
422
+ var PlankError = ({ id, part, node, error }) => {
423
+ const [timedOut, setTimedOut] = useState2(false);
424
+ useEffect4(() => {
425
+ setTimeout(() => setTimedOut(true), 5e3);
426
+ }, []);
427
+ return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(NodePlankHeading, {
428
+ id,
429
+ part,
430
+ node,
431
+ pending: !timedOut
432
+ }), timedOut ? /* @__PURE__ */ React7.createElement(PlankContentError, {
433
+ error
434
+ }) : /* @__PURE__ */ React7.createElement(PlankLoading, null));
435
+ };
436
+
437
+ // packages/plugins/plugin-deck/src/components/DeckLayout/ComplementarySidebar.tsx
438
+ var ComplementarySidebar = ({ current }) => {
439
+ const { t } = useTranslation5(DECK_PLUGIN);
440
+ const { dispatchPromise: dispatch } = useIntentDispatcher2();
441
+ const layout = useCapability2(DeckCapabilities.MutableDeckState);
442
+ const attended = useAttended2();
443
+ const { graph } = useAppGraph3();
444
+ const node = useNode(graph, attended[0]);
445
+ const breakpoint = useBreakpoints();
446
+ const topbar = layoutAppliesTopbar(breakpoint);
447
+ const hoistStatusbar = useHoistStatusbar(breakpoint);
448
+ const panels = useCapabilities(DeckCapabilities.ComplementaryPanel);
449
+ const availablePanels = panels.filter((panel) => {
450
+ if (!node || !panel.filter) {
451
+ return true;
452
+ }
453
+ return panel.filter(node);
454
+ });
455
+ const activePanelId = availablePanels.find((panel) => panel.id === current)?.id ?? availablePanels[0]?.id;
456
+ const [internalValue, setInternalValue] = useState3(activePanelId);
457
+ useEffect5(() => {
458
+ setInternalValue(activePanelId);
459
+ }, [
460
+ activePanelId
461
+ ]);
462
+ const handleTabClick = useCallback2((event) => {
463
+ const nextValue = event.currentTarget.getAttribute("data-value");
464
+ if (nextValue === activePanelId) {
465
+ layout.complementarySidebarState = layout.complementarySidebarState === "expanded" ? "collapsed" : "expanded";
466
+ } else {
467
+ setInternalValue(nextValue);
468
+ layout.complementarySidebarState = "expanded";
469
+ void dispatch(createIntent2(LayoutAction2.UpdateComplementary, {
470
+ part: "complementary",
471
+ subject: nextValue
472
+ }));
473
+ }
474
+ }, [
475
+ layout,
476
+ activePanelId,
477
+ dispatch
478
+ ]);
479
+ const data = useMemo2(() => node && {
480
+ id: node.id,
481
+ subject: node.data,
482
+ workspace: layout.activeDeck,
483
+ popoverAnchorId: layout.popoverAnchorId
484
+ }, [
485
+ node,
486
+ layout.popoverAnchorId
487
+ ]);
488
+ return /* @__PURE__ */ React8.createElement(Main.ComplementarySidebar, {
489
+ classNames: [
490
+ topbar && "block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
491
+ hoistStatusbar && "block-end-[--statusbar-size]"
492
+ ]
493
+ }, /* @__PURE__ */ React8.createElement(Tabs.Root, {
494
+ orientation: "vertical",
495
+ verticalVariant: "stateless",
496
+ value: internalValue,
497
+ attendableId: attended[0],
498
+ classNames: "contents"
499
+ }, /* @__PURE__ */ React8.createElement("div", {
500
+ role: "none",
501
+ className: "absolute z-[1] inset-block-0 inline-end-0 !is-[--r0-size] pbs-[env(safe-area-inset-top)] pbe-[env(safe-area-inset-bottom)] border-is border-separator grid grid-cols-1 grid-rows-[1fr_min-content] bg-baseSurface contain-layout app-drag"
502
+ }, /* @__PURE__ */ React8.createElement(Tabs.Tablist, {
503
+ classNames: "grid grid-cols-1 auto-rows-[--rail-action] p-1 gap-1 !overflow-y-auto"
504
+ }, availablePanels.map((panel) => /* @__PURE__ */ React8.createElement(Tabs.Tab, {
505
+ key: panel.id,
506
+ value: panel.id,
507
+ asChild: true
508
+ }, /* @__PURE__ */ React8.createElement(IconButton2, {
509
+ label: toLocalizedString2(panel.label, t),
510
+ icon: panel.icon,
511
+ size: 5,
512
+ iconOnly: true,
513
+ tooltipSide: "left",
514
+ "data-value": panel.id,
515
+ variant: activePanelId === panel.id ? layout.complementarySidebarState === "expanded" ? "primary" : "default" : "ghost",
516
+ onClick: handleTabClick
517
+ })))), !hoistStatusbar && /* @__PURE__ */ React8.createElement("div", {
518
+ role: "none",
519
+ className: "grid grid-cols-1 auto-rows-[--rail-item] p-1 overflow-y-auto"
520
+ }, /* @__PURE__ */ React8.createElement(Surface4, {
521
+ role: "status-bar--r0-footer",
522
+ limit: 1
523
+ })), /* @__PURE__ */ React8.createElement("div", {
524
+ role: "none",
525
+ className: "hidden lg:grid grid-cols-1 auto-rows-[--rail-action] p-1"
526
+ }, /* @__PURE__ */ React8.createElement(ToggleComplementarySidebarButton, null))), availablePanels.map((panel) => /* @__PURE__ */ React8.createElement(Tabs.Tabpanel, {
527
+ key: panel.id,
528
+ value: panel.id,
529
+ classNames: 'absolute data-[state="inactive"]:-z-[1] inset-block-0 inline-start-0 is-[calc(100%-var(--r0-size))] lg:is-[--r1-size] grid grid-cols-1 grid-rows-[var(--rail-size)_1fr_min-content] pbs-[env(safe-area-inset-top)]',
530
+ ...layout.complementarySidebarState !== "expanded" && {
531
+ inert: "true"
532
+ }
533
+ }, panel.id === activePanelId && data && /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("h2", {
534
+ className: "flex items-center pli-2 border-separator border-be"
535
+ }, toLocalizedString2(panel.label, t)), /* @__PURE__ */ React8.createElement(ScrollArea.Root, null, /* @__PURE__ */ React8.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React8.createElement(Surface4, {
536
+ role: `complementary--${activePanelId}`,
537
+ data,
538
+ fallback: PlankContentError,
539
+ placeholder: /* @__PURE__ */ React8.createElement(PlankLoading, null)
540
+ })), /* @__PURE__ */ React8.createElement(ScrollArea.Scrollbar, {
541
+ orientation: "vertical"
542
+ }, /* @__PURE__ */ React8.createElement(ScrollArea.Thumb, null))), !hoistStatusbar && /* @__PURE__ */ React8.createElement("div", {
543
+ role: "contentinfo",
544
+ className: "flex flex-wrap justify-center items-center border-bs border-separator pbs-1 pbe-[max(env(safe-area-inset-bottom),0.25rem)]"
545
+ }, /* @__PURE__ */ React8.createElement(Surface4, {
546
+ role: "status-bar--r1-footer",
547
+ limit: 1
548
+ })))))));
549
+ };
550
+
551
+ // packages/plugins/plugin-deck/src/components/DeckLayout/ContentEmpty.tsx
552
+ import React9 from "react";
553
+ import { Surface as Surface5 } from "@dxos/app-framework";
554
+ var ContentEmpty = () => {
555
+ const breakpoint = useBreakpoints();
556
+ const topbar = layoutAppliesTopbar(breakpoint);
557
+ return /* @__PURE__ */ React9.createElement("div", {
558
+ role: "none",
559
+ className: "grid place-items-center p-8 relative bg-deck",
560
+ "data-testid": "layoutPlugin.firstRunMessage"
561
+ }, /* @__PURE__ */ React9.createElement(Surface5, {
562
+ role: "keyshortcuts"
563
+ }), !topbar && /* @__PURE__ */ React9.createElement(ToggleSidebarButton, {
564
+ variant: "default",
565
+ classNames: fixedSidebarToggleStyles
566
+ }));
567
+ };
568
+
569
+ // packages/plugins/plugin-deck/src/components/DeckLayout/Fullscreen.tsx
570
+ import React11 from "react";
571
+ import { Surface as Surface6, useAppGraph as useAppGraph4 } from "@dxos/app-framework";
572
+ import { fixedInsetFlexLayout } from "@dxos/react-ui-theme";
573
+
574
+ // packages/plugins/plugin-deck/src/components/DeckLayout/Fallback.tsx
575
+ import React10 from "react";
576
+ import { useTranslation as useTranslation6 } from "@dxos/react-ui";
577
+ import { errorText, mx as mx4 } from "@dxos/react-ui-theme";
578
+ var Fallback = () => {
579
+ const { t } = useTranslation6(DECK_PLUGIN);
580
+ return /* @__PURE__ */ React10.createElement("div", {
581
+ role: "none",
582
+ className: "min-bs-screen is-full flex items-center justify-center p-8"
583
+ }, /* @__PURE__ */ React10.createElement("p", {
584
+ role: "alert",
585
+ className: mx4(errorText, "border border-error-400/50 rounded-lg flex items-center justify-center p-8 font-normal text-lg")
586
+ }, t("plugin error message")));
587
+ };
588
+
589
+ // packages/plugins/plugin-deck/src/components/DeckLayout/constants.ts
590
+ var SURFACE_PREFIX = "surface:";
591
+
592
+ // packages/plugins/plugin-deck/src/components/DeckLayout/Fullscreen.tsx
593
+ var Fullscreen = ({ id }) => {
594
+ const { graph } = useAppGraph4();
595
+ const fullScreenNode = useNode(graph, id);
596
+ return /* @__PURE__ */ React11.createElement("div", {
597
+ role: "none",
598
+ className: fixedInsetFlexLayout
599
+ }, /* @__PURE__ */ React11.createElement(Surface6, {
600
+ role: "main",
601
+ limit: 1,
602
+ fallback: Fallback,
603
+ data: {
604
+ subject: fullScreenNode?.data,
605
+ component: id?.startsWith(SURFACE_PREFIX) ? id.slice(SURFACE_PREFIX.length) : void 0
606
+ }
607
+ }));
608
+ };
609
+
610
+ // packages/plugins/plugin-deck/src/components/DeckLayout/Plank.tsx
611
+ import React12, { memo as memo2, useCallback as useCallback3, useLayoutEffect, useMemo as useMemo3, useRef } from "react";
612
+ import { createIntent as createIntent3, LayoutAction as LayoutAction3, Surface as Surface7, useCapability as useCapability3, useAppGraph as useAppGraph5, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
613
+ import { debounce } from "@dxos/async";
614
+ import { useAttendableAttributes } from "@dxos/react-ui-attention";
615
+ import { StackItem as StackItem2, railGridHorizontal } from "@dxos/react-ui-stack";
616
+ import { mainIntrinsicSize, mx as mx5 } from "@dxos/react-ui-theme";
617
+ var UNKNOWN_ID = "unknown_id";
618
+ var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, part, path, order, active, layoutMode }) => {
619
+ const { dispatchPromise: dispatch } = useIntentDispatcher3();
620
+ const { deck, popoverAnchorId, scrollIntoView } = useCapability3(DeckCapabilities.DeckState);
621
+ const { graph } = useAppGraph5();
622
+ const node = useNode(graph, id);
623
+ const rootElement = useRef(null);
624
+ const canResize = layoutMode === "deck";
625
+ const Root = part === "solo" ? "article" : StackItem2.Root;
626
+ const attendableAttrs = useAttendableAttributes(id);
627
+ const index = active ? active.findIndex((entryId) => entryId === id) : 0;
628
+ const length = active?.length ?? 1;
629
+ const canIncrementStart = active && index !== void 0 && index > 0 && length !== void 0 && length > 1;
630
+ const canIncrementEnd = active && index !== void 0 && index < length - 1 && length !== void 0;
631
+ const key = id.split("+")[0];
632
+ const size = deck.plankSizing[key];
633
+ const setSize = useCallback3(debounce((nextSize) => {
634
+ return dispatch(createIntent3(DeckAction.UpdatePlankSize, {
635
+ id: key,
636
+ size: nextSize
637
+ }));
638
+ }, 200), [
639
+ dispatch,
640
+ key
641
+ ]);
642
+ const handleKeyDown = useCallback3((event) => {
643
+ if (event.target === event.currentTarget && event.key === "Escape") {
644
+ rootElement.current?.closest("main")?.focus();
645
+ }
646
+ }, []);
647
+ useLayoutEffect(() => {
648
+ if (scrollIntoView === id) {
649
+ const focusable = rootElement.current?.querySelector("button") || rootElement.current;
650
+ focusable?.focus({
651
+ preventScroll: true
652
+ });
653
+ layoutMode === "deck" && focusable?.scrollIntoView({
654
+ behavior: "smooth",
655
+ inline: "center"
656
+ });
657
+ void dispatch(createIntent3(LayoutAction3.ScrollIntoView, {
658
+ part: "current",
659
+ subject: void 0
660
+ }));
661
+ }
662
+ }, [
663
+ id,
664
+ scrollIntoView,
665
+ layoutMode
666
+ ]);
667
+ const isSolo = layoutMode === "solo" && part === "solo";
668
+ const isAttendable = isSolo || layoutMode === "deck" && part === "deck";
669
+ const sizeAttrs = useMainSize();
670
+ const data = useMemo3(() => node && {
671
+ subject: node.data,
672
+ path,
673
+ popoverAnchorId
674
+ }, [
675
+ node,
676
+ node?.data,
677
+ path,
678
+ popoverAnchorId
679
+ ]);
680
+ const placeholder = useMemo3(() => /* @__PURE__ */ React12.createElement(PlankLoading, null), []);
681
+ const className = mx5("attention-surface relative", isSolo && mainIntrinsicSize, isSolo && railGridHorizontal, isSolo ? "grid absolute inset-0" : "!border-separator border-li");
682
+ return /* @__PURE__ */ React12.createElement(Root, {
683
+ ref: rootElement,
684
+ "data-testid": "deck.plank",
685
+ tabIndex: 0,
686
+ ...part === "solo" ? {
687
+ ...sizeAttrs,
688
+ className
689
+ } : {
690
+ item: {
691
+ id
692
+ },
693
+ size,
694
+ onSizeChange: setSize,
695
+ classNames: className,
696
+ order,
697
+ role: "article"
698
+ },
699
+ ...isAttendable ? attendableAttrs : {},
700
+ onKeyDown: handleKeyDown
701
+ }, node ? /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(NodePlankHeading, {
702
+ id,
703
+ part,
704
+ node,
705
+ canIncrementStart,
706
+ canIncrementEnd,
707
+ popoverAnchorId
708
+ }), /* @__PURE__ */ React12.createElement(Surface7, {
709
+ key: node.id,
710
+ role: "article",
711
+ data,
712
+ limit: 1,
713
+ fallback: PlankContentError,
714
+ placeholder
715
+ })) : /* @__PURE__ */ React12.createElement(PlankError, {
716
+ id,
717
+ part
718
+ }), canResize && /* @__PURE__ */ React12.createElement(StackItem2.ResizeHandle, null));
719
+ });
720
+
721
+ // packages/plugins/plugin-deck/src/components/DeckLayout/Sidebar.tsx
722
+ import React13, { useMemo as useMemo4 } from "react";
723
+ import { Surface as Surface8, useCapability as useCapability4 } from "@dxos/app-framework";
724
+ import { Main as Main2 } from "@dxos/react-ui";
725
+ var Sidebar = () => {
726
+ const { popoverAnchorId, activeDeck: current } = useCapability4(DeckCapabilities.DeckState);
727
+ const breakpoint = useBreakpoints();
728
+ const topbar = layoutAppliesTopbar(breakpoint);
729
+ const hoistStatusbar = useHoistStatusbar(breakpoint);
730
+ const navigationData = useMemo4(() => ({
731
+ popoverAnchorId,
732
+ topbar,
733
+ hoistStatusbar,
734
+ current
735
+ }), [
736
+ popoverAnchorId,
737
+ topbar,
738
+ hoistStatusbar,
739
+ current
740
+ ]);
741
+ return /* @__PURE__ */ React13.createElement(Main2.NavigationSidebar, {
742
+ classNames: [
743
+ "grid",
744
+ topbar && "block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
745
+ hoistStatusbar && "block-end-[--statusbar-size]"
746
+ ]
747
+ }, /* @__PURE__ */ React13.createElement(Surface8, {
748
+ role: "navigation",
749
+ data: navigationData,
750
+ limit: 1
751
+ }));
752
+ };
753
+
754
+ // packages/plugins/plugin-deck/src/components/DeckLayout/StatusBar.tsx
755
+ import React14 from "react";
756
+ import { Surface as Surface9 } from "@dxos/app-framework";
757
+ import { useLandmarkMover } from "@dxos/react-ui";
758
+ var StatusBar = ({ showHints }) => {
759
+ const mover = useLandmarkMover(void 0, "3");
760
+ return /* @__PURE__ */ React14.createElement("div", {
761
+ role: "contentinfo",
762
+ className: "fixed block-end-0 inset-inline-0 bs-[--statusbar-size] border-bs border-separator z-[2] flex text-description",
763
+ ...mover
764
+ }, showHints && /* @__PURE__ */ React14.createElement(Surface9, {
765
+ role: "hints",
766
+ limit: 1
767
+ }), /* @__PURE__ */ React14.createElement(Surface9, {
768
+ role: "status-bar",
769
+ limit: 1
770
+ }));
771
+ };
772
+
773
+ // packages/plugins/plugin-deck/src/components/DeckLayout/Toast.tsx
774
+ import React15 from "react";
775
+ import { Button as Button2, Icon as Icon3, Toast as NaturalToast, toLocalizedString as toLocalizedString3, useTranslation as useTranslation7 } from "@dxos/react-ui";
776
+ var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange }) => {
777
+ const { t } = useTranslation7(DECK_PLUGIN);
778
+ return /* @__PURE__ */ React15.createElement(NaturalToast.Root, {
779
+ "data-testid": id,
780
+ defaultOpen: true,
781
+ duration,
782
+ onOpenChange
783
+ }, /* @__PURE__ */ React15.createElement(NaturalToast.Body, null, /* @__PURE__ */ React15.createElement(NaturalToast.Title, {
784
+ classNames: "items-center"
785
+ }, icon && /* @__PURE__ */ React15.createElement(Icon3, {
786
+ icon,
787
+ size: 5,
788
+ classNames: "inline mr-1"
789
+ }), title && /* @__PURE__ */ React15.createElement("span", null, toLocalizedString3(title, t))), description && /* @__PURE__ */ React15.createElement(NaturalToast.Description, null, description && toLocalizedString3(description, t))), /* @__PURE__ */ React15.createElement(NaturalToast.Actions, null, onAction && actionAlt && actionLabel && /* @__PURE__ */ React15.createElement(NaturalToast.Action, {
790
+ altText: toLocalizedString3(actionAlt, t),
791
+ asChild: true
792
+ }, /* @__PURE__ */ React15.createElement(Button2, {
793
+ "data-testid": "toast.action",
794
+ variant: "primary",
795
+ onClick: () => onAction?.()
796
+ }, toLocalizedString3(actionLabel, t))), closeLabel && /* @__PURE__ */ React15.createElement(NaturalToast.Close, {
797
+ asChild: true
798
+ }, /* @__PURE__ */ React15.createElement(Button2, {
799
+ "data-testid": "toast.close"
800
+ }, toLocalizedString3(closeLabel, t)))));
801
+ };
802
+
803
+ // packages/plugins/plugin-deck/src/components/DeckLayout/Topbar.tsx
804
+ import React16 from "react";
805
+ var Topbar = () => {
806
+ return /* @__PURE__ */ React16.createElement(Banner, {
807
+ variant: "topbar"
808
+ });
809
+ };
810
+
811
+ // packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
812
+ var PlankSeparator = ({ index }) => index > 0 ? /* @__PURE__ */ React17.createElement("span", {
813
+ role: "separator",
814
+ className: "row-span-2 bg-deck is-4",
815
+ style: {
816
+ gridColumn: index * 2
817
+ }
818
+ }) : null;
819
+ var DeckLayout = ({ overscroll, showHints, onDismissToast }) => {
820
+ const { dispatchPromise: dispatch } = useIntentDispatcher4();
821
+ const context = useCapability5(DeckCapabilities.MutableDeckState);
822
+ const { sidebarState, complementarySidebarState, complementarySidebarPanel, dialogOpen, dialogContent, dialogBlockAlign, dialogType, popoverOpen, popoverContent, popoverAnchorId, deck, toasts } = context;
823
+ const { active, fullscreen, solo, plankSizing } = deck;
824
+ const breakpoint = useBreakpoints();
825
+ const topbar = layoutAppliesTopbar(breakpoint);
826
+ const hoistStatusbar = useHoistStatusbar(breakpoint);
827
+ const pluginManager = usePluginManager();
828
+ const scrollLeftRef = useRef2();
829
+ const deckRef = useRef2(null);
830
+ const [delayedPopoverVisibility, setDelayedPopoverVisibility] = useState4(false);
831
+ useEffect6(() => {
832
+ popoverOpen ? setTimeout(() => setDelayedPopoverVisibility(true), 40) : setDelayedPopoverVisibility(false);
833
+ }, [
834
+ popoverOpen
835
+ ]);
836
+ useEffect6(() => {
837
+ const attended = untracked(() => {
838
+ const attention = pluginManager.context.requestCapability(AttentionCapabilities.Attention);
839
+ return attention.current;
840
+ });
841
+ const firstId = solo ?? active[0];
842
+ if (attended.length === 0 && firstId) {
843
+ document.querySelector(`article[data-attendable-id="${firstId}"] button`)?.focus();
844
+ }
845
+ }, []);
846
+ const [isNotMobile] = useMediaQuery("md", {
847
+ ssr: false
848
+ });
849
+ const shouldRevert = useRef2(false);
850
+ useEffect6(() => {
851
+ if (!isNotMobile && getMode(deck) === "deck") {
852
+ const attended = untracked(() => {
853
+ const attention = pluginManager.context.requestCapability(AttentionCapabilities.Attention);
854
+ return attention.current;
855
+ });
856
+ shouldRevert.current = true;
857
+ void dispatch(createIntent4(LayoutAction4.SetLayoutMode, {
858
+ part: "mode",
859
+ subject: attended[0],
860
+ options: {
861
+ mode: "solo"
862
+ }
863
+ }));
864
+ } else if (isNotMobile && getMode(deck) === "solo" && shouldRevert.current) {
865
+ void dispatch(createIntent4(LayoutAction4.SetLayoutMode, {
866
+ part: "mode",
867
+ options: {
868
+ revert: true
869
+ }
870
+ }));
871
+ }
872
+ }, [
873
+ isNotMobile,
874
+ deck,
875
+ dispatch
876
+ ]);
877
+ const handleResize = useCallback4(() => {
878
+ scrollLeftRef.current = null;
879
+ }, []);
880
+ useEffect6(() => {
881
+ window.addEventListener("resize", handleResize);
882
+ return () => window.removeEventListener("resize", handleResize);
883
+ }, [
884
+ handleResize
885
+ ]);
886
+ const restoreScroll = useCallback4(() => {
887
+ if (deckRef.current && scrollLeftRef.current != null) {
888
+ deckRef.current.scrollLeft = scrollLeftRef.current;
889
+ }
890
+ }, []);
891
+ const layoutMode = getMode(deck);
892
+ useOnTransition(layoutMode, (mode) => mode !== "deck", "deck", restoreScroll);
893
+ const handleScroll = useCallback4((event) => {
894
+ if (!solo && event.currentTarget === event.target) {
895
+ scrollLeftRef.current = event.target.scrollLeft;
896
+ }
897
+ }, [
898
+ solo
899
+ ]);
900
+ const isEmpty = !solo && active.length === 0;
901
+ const padding = useMemo5(() => {
902
+ if (!solo && overscroll === "centering") {
903
+ return calculateOverscroll(active.length);
904
+ }
905
+ return {};
906
+ }, [
907
+ solo,
908
+ overscroll,
909
+ deck
910
+ ]);
911
+ const mainPosition = useMemo5(() => [
912
+ "grid !block-start-[env(safe-area-inset-top)]",
913
+ topbar && "!block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
914
+ hoistStatusbar && "lg:block-end-[--statusbar-size]"
915
+ ], [
916
+ topbar,
917
+ hoistStatusbar
918
+ ]);
919
+ const Dialog = dialogType === "alert" ? AlertDialog : NaturalDialog;
920
+ const handlePopoverOpenChange = useCallback4((nextOpen) => {
921
+ if (nextOpen && popoverAnchorId) {
922
+ context.popoverOpen = true;
923
+ } else {
924
+ context.popoverOpen = false;
925
+ context.popoverAnchorId = void 0;
926
+ context.popoverSide = void 0;
927
+ }
928
+ }, [
929
+ context
930
+ ]);
931
+ const handlePopoverClose = useCallback4(() => handlePopoverOpenChange(false), [
932
+ handlePopoverOpenChange
933
+ ]);
934
+ return /* @__PURE__ */ React17.createElement(Popover2.Root, {
935
+ modal: true,
936
+ open: !!(popoverAnchorId && delayedPopoverVisibility),
937
+ onOpenChange: handlePopoverOpenChange
938
+ }, /* @__PURE__ */ React17.createElement(ActiveNode, null), fullscreen && /* @__PURE__ */ React17.createElement(Fullscreen, {
939
+ id: solo
940
+ }), !fullscreen && /* @__PURE__ */ React17.createElement(Main3.Root, {
941
+ navigationSidebarState: context.sidebarState,
942
+ onNavigationSidebarStateChange: (next) => context.sidebarState = next,
943
+ complementarySidebarState: context.complementarySidebarState,
944
+ onComplementarySidebarStateChange: (next) => context.complementarySidebarState = next
945
+ }, /* @__PURE__ */ React17.createElement(Sidebar, null), /* @__PURE__ */ React17.createElement(ComplementarySidebar, {
946
+ current: complementarySidebarPanel
947
+ }), /* @__PURE__ */ React17.createElement(Main3.Overlay, null), isEmpty && /* @__PURE__ */ React17.createElement(Main3.Content, {
948
+ bounce: true,
949
+ handlesFocus: true,
950
+ classNames: mainPosition
951
+ }, /* @__PURE__ */ React17.createElement(ContentEmpty, null)), !isEmpty && /* @__PURE__ */ React17.createElement(Main3.Content, {
952
+ bounce: true,
953
+ classNames: mainPosition,
954
+ handlesFocus: true,
955
+ style: {
956
+ "--dx-main-sidebarWidth": sidebarState === "expanded" ? "var(--nav-sidebar-size)" : sidebarState === "collapsed" ? "var(--l0-size)" : "0",
957
+ "--dx-main-complementaryWidth": complementarySidebarState === "expanded" ? "var(--complementary-sidebar-size)" : complementarySidebarState === "collapsed" ? "var(--rail-size)" : "0",
958
+ "--dx-main-contentFirstWidth": `${plankSizing[active[0] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`,
959
+ "--dx-main-contentLastWidth": `${plankSizing[active[(active.length ?? 1) - 1] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`
960
+ }
961
+ }, /* @__PURE__ */ React17.createElement("div", {
962
+ role: "none",
963
+ className: !solo ? "relative bg-deck overflow-hidden" : "sr-only",
964
+ ...solo && {
965
+ inert: ""
966
+ }
967
+ }, !topbar && /* @__PURE__ */ React17.createElement(ToggleSidebarButton, {
968
+ classNames: fixedSidebarToggleStyles
969
+ }), !topbar && /* @__PURE__ */ React17.createElement(ToggleComplementarySidebarButton, {
970
+ classNames: fixedComplementarySidebarToggleStyles
971
+ }), /* @__PURE__ */ React17.createElement(Stack, {
972
+ orientation: "horizontal",
973
+ size: "contain",
974
+ classNames: [
975
+ "absolute inset-block-0 -inset-inline-px",
976
+ mainPaddingTransitions
977
+ ],
978
+ onScroll: handleScroll,
979
+ itemsCount: 2 * (active.length ?? 0) - 1,
980
+ style: padding,
981
+ ref: deckRef
982
+ }, active.map((entryId, index) => /* @__PURE__ */ React17.createElement(Fragment2, {
983
+ key: entryId
984
+ }, /* @__PURE__ */ React17.createElement(PlankSeparator, {
985
+ index
986
+ }), /* @__PURE__ */ React17.createElement(Plank, {
987
+ id: entryId,
988
+ part: "deck",
989
+ order: index * 2 + 1,
990
+ active,
991
+ layoutMode
992
+ }))))), /* @__PURE__ */ React17.createElement("div", {
993
+ role: "none",
994
+ className: solo ? "relative bg-deck overflow-hidden" : "sr-only",
995
+ ...!solo && {
996
+ inert: ""
997
+ }
998
+ }, !topbar && /* @__PURE__ */ React17.createElement(ToggleSidebarButton, {
999
+ classNames: fixedSidebarToggleStyles
1000
+ }), !topbar && /* @__PURE__ */ React17.createElement(ToggleComplementarySidebarButton, {
1001
+ classNames: fixedComplementarySidebarToggleStyles
1002
+ }), /* @__PURE__ */ React17.createElement(StackContext.Provider, {
1003
+ value: {
1004
+ size: "contain",
1005
+ orientation: "horizontal",
1006
+ rail: true
1007
+ }
1008
+ }, /* @__PURE__ */ React17.createElement(Plank, {
1009
+ id: solo,
1010
+ part: "solo",
1011
+ layoutMode
1012
+ })))), topbar && /* @__PURE__ */ React17.createElement(Topbar, null), hoistStatusbar && /* @__PURE__ */ React17.createElement(StatusBar, {
1013
+ showHints
1014
+ })), /* @__PURE__ */ React17.createElement(Popover2.Portal, null, /* @__PURE__ */ React17.createElement(Popover2.Content, {
1015
+ side: context.popoverSide,
1016
+ onEscapeKeyDown: handlePopoverClose
1017
+ }, /* @__PURE__ */ React17.createElement(Popover2.Viewport, null, /* @__PURE__ */ React17.createElement(Surface10, {
1018
+ role: "popover",
1019
+ data: popoverContent,
1020
+ limit: 1
1021
+ })), /* @__PURE__ */ React17.createElement(Popover2.Arrow, null))), /* @__PURE__ */ React17.createElement(Dialog.Root, {
1022
+ modal: dialogBlockAlign !== "end",
1023
+ open: dialogOpen,
1024
+ onOpenChange: (nextOpen) => context.dialogOpen = nextOpen
1025
+ }, dialogBlockAlign === "end" ? /* @__PURE__ */ React17.createElement(Surface10, {
1026
+ role: "dialog",
1027
+ data: dialogContent,
1028
+ limit: 1
1029
+ }) : /* @__PURE__ */ React17.createElement(Dialog.Overlay, {
1030
+ blockAlign: dialogBlockAlign
1031
+ }, /* @__PURE__ */ React17.createElement(Surface10, {
1032
+ role: "dialog",
1033
+ data: dialogContent,
1034
+ limit: 1
1035
+ }))), toasts?.map((toast) => /* @__PURE__ */ React17.createElement(Toast, {
1036
+ ...toast,
1037
+ key: toast.id,
1038
+ onOpenChange: (open) => {
1039
+ if (!open) {
1040
+ onDismissToast(toast.id);
1041
+ }
1042
+ return open;
1043
+ }
1044
+ })));
1045
+ };
1046
+
1047
+ // packages/plugins/plugin-deck/src/components/LayoutSettings.tsx
1048
+ import React18 from "react";
1049
+ import { Input, Select, useTranslation as useTranslation8 } from "@dxos/react-ui";
1050
+ import { DeprecatedFormContainer, DeprecatedFormInput } from "@dxos/react-ui-form";
1051
+ var isSocket = !!globalThis.__args;
1052
+ var LayoutSettings = ({ settings }) => {
1053
+ const { t } = useTranslation8(DECK_PLUGIN);
1054
+ return /* @__PURE__ */ React18.createElement(DeprecatedFormContainer, null, /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
1055
+ label: t("select new plank positioning label")
1056
+ }, /* @__PURE__ */ React18.createElement(Select.Root, {
1057
+ value: settings.newPlankPositioning ?? "start",
1058
+ onValueChange: (value) => settings.newPlankPositioning = value
1059
+ }, /* @__PURE__ */ React18.createElement(Select.TriggerButton, {
1060
+ placeholder: t("select new plank positioning placeholder")
1061
+ }), /* @__PURE__ */ React18.createElement(Select.Portal, null, /* @__PURE__ */ React18.createElement(Select.Content, null, /* @__PURE__ */ React18.createElement(Select.Viewport, null, NewPlankPositions.map((position) => /* @__PURE__ */ React18.createElement(Select.Option, {
1062
+ key: position,
1063
+ value: position
1064
+ }, t(`settings new plank position ${position} label`)))))))), /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
1065
+ label: t("settings overscroll label")
1066
+ }, /* @__PURE__ */ React18.createElement(Select.Root, {
1067
+ value: settings.overscroll ?? "none",
1068
+ onValueChange: (value) => settings.overscroll = value
1069
+ }, /* @__PURE__ */ React18.createElement(Select.TriggerButton, {
1070
+ placeholder: t("select overscroll placeholder")
1071
+ }), /* @__PURE__ */ React18.createElement(Select.Portal, null, /* @__PURE__ */ React18.createElement(Select.Content, null, /* @__PURE__ */ React18.createElement(Select.Viewport, null, OverscrollOptions.map((option) => /* @__PURE__ */ React18.createElement(Select.Option, {
1072
+ key: option,
1073
+ value: option
1074
+ }, t(`settings overscroll ${option} label`)))))))), /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
1075
+ label: t("settings show hints label")
1076
+ }, /* @__PURE__ */ React18.createElement(Input.Switch, {
1077
+ checked: settings.showHints,
1078
+ onCheckedChange: (checked) => settings.showHints = checked
1079
+ })), !isSocket && /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
1080
+ label: t("settings native redirect label")
1081
+ }, /* @__PURE__ */ React18.createElement(Input.Switch, {
1082
+ checked: settings.enableNativeRedirect,
1083
+ onCheckedChange: (checked) => settings.enableNativeRedirect = checked
1084
+ })), /* @__PURE__ */ React18.createElement(DeprecatedFormInput, {
1085
+ label: t("settings enable ide-style statusbar label")
1086
+ }, /* @__PURE__ */ React18.createElement(Input.Switch, {
1087
+ checked: settings.enableIdeStyleStatusbar,
1088
+ onCheckedChange: (checked) => settings.enableIdeStyleStatusbar = checked
1089
+ })));
1090
+ };
1091
+
1092
+ export {
1093
+ Banner,
1094
+ DeckLayout,
1095
+ LayoutSettings
1096
+ };
1097
+ //# sourceMappingURL=chunk-DIXE74SK.mjs.map