@dxos/plugin-deck 0.8.4-main.84f28bd → 0.8.4-main.ae835ea

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 (184) hide show
  1. package/dist/lib/browser/{app-graph-builder-JTFSDT2I.mjs → app-graph-builder-PCMSER2O.mjs} +17 -16
  2. package/dist/lib/browser/app-graph-builder-PCMSER2O.mjs.map +7 -0
  3. package/dist/lib/browser/{check-app-scheme-57U62A3A.mjs → check-app-scheme-HIEVFAAX.mjs} +6 -6
  4. package/dist/lib/browser/check-app-scheme-HIEVFAAX.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-QO3VIMKQ.mjs → chunk-27I7DJUG.mjs} +10 -9
  6. package/dist/lib/browser/chunk-27I7DJUG.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-5KMJPIQC.mjs +16 -0
  8. package/dist/lib/browser/chunk-5KMJPIQC.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-XL7EWOGI.mjs → chunk-F3VCCHVL.mjs} +13 -13
  10. package/dist/lib/browser/chunk-F3VCCHVL.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-7LJDT5OH.mjs → chunk-MFFZK4LT.mjs} +15 -15
  12. package/dist/lib/browser/chunk-MFFZK4LT.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-QBKDUEDV.mjs → chunk-SBJLGRJV.mjs} +535 -497
  14. package/dist/lib/browser/chunk-SBJLGRJV.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-UXLU6CMW.mjs +16 -0
  16. package/dist/lib/browser/chunk-UXLU6CMW.mjs.map +7 -0
  17. package/dist/lib/browser/index.mjs +20 -14
  18. package/dist/lib/browser/index.mjs.map +3 -3
  19. package/dist/lib/browser/{intent-resolver-6YMAE4SF.mjs → intent-resolver-Q3KETDSS.mjs} +21 -18
  20. package/dist/lib/browser/intent-resolver-Q3KETDSS.mjs.map +7 -0
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/{react-root-UVN2LMU3.mjs → react-root-LU3662ME.mjs} +11 -11
  23. package/dist/lib/browser/react-root-LU3662ME.mjs.map +7 -0
  24. package/dist/lib/browser/{react-surface-WOLHGHMN.mjs → react-surface-TDBFPN5T.mjs} +13 -13
  25. package/dist/lib/browser/react-surface-TDBFPN5T.mjs.map +7 -0
  26. package/dist/lib/browser/{settings-L5CR5GTJ.mjs → settings-SDPTOCCM.mjs} +7 -6
  27. package/dist/lib/browser/{settings-L5CR5GTJ.mjs.map → settings-SDPTOCCM.mjs.map} +3 -3
  28. package/dist/lib/browser/state-QTVNH7N6.mjs +12 -0
  29. package/dist/lib/browser/toolkit-TM2Y6YL2.mjs +53 -0
  30. package/dist/lib/browser/toolkit-TM2Y6YL2.mjs.map +7 -0
  31. package/dist/lib/browser/{types.mjs → types/index.mjs} +3 -5
  32. package/dist/lib/browser/{url-handler-KZW7GBA2.mjs → url-handler-QEYGYE2H.mjs} +7 -7
  33. package/dist/lib/browser/url-handler-QEYGYE2H.mjs.map +7 -0
  34. package/dist/types/src/DeckPlugin.d.ts +1 -1
  35. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  37. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  38. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  39. package/dist/types/src/capabilities/check-app-scheme.d.ts +1 -1
  40. package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
  41. package/dist/types/src/capabilities/index.d.ts +9 -9
  42. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  43. package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
  44. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  45. package/dist/types/src/capabilities/react-root.d.ts +2 -2
  46. package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
  47. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  48. package/dist/types/src/capabilities/settings.d.ts +1 -1
  49. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  50. package/dist/types/src/capabilities/state.d.ts +5 -2
  51. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  52. package/dist/types/src/capabilities/toolkit.d.ts +23 -0
  53. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
  54. package/dist/types/src/capabilities/tools.d.ts +1 -1
  55. package/dist/types/src/capabilities/tools.d.ts.map +1 -1
  56. package/dist/types/src/capabilities/url-handler.d.ts +1 -1
  57. package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
  58. package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
  59. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -3
  60. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  61. package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +74 -0
  62. package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
  63. package/dist/types/src/components/DeckLayout/DeckMain.d.ts +3 -0
  64. package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -0
  65. package/dist/types/src/components/DeckLayout/Toast.d.ts +5 -0
  66. package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
  67. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
  68. package/dist/types/src/components/Plank/Plank.d.ts +1 -1
  69. package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
  70. package/dist/types/src/components/Plank/Plank.stories.d.ts +86 -5
  71. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
  72. package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
  73. package/dist/types/src/components/Plank/PlankHeading.d.ts +1 -1
  74. package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
  75. package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
  76. package/dist/types/src/events.d.ts.map +1 -1
  77. package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
  78. package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
  79. package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
  80. package/dist/types/src/meta.d.ts +0 -1
  81. package/dist/types/src/meta.d.ts.map +1 -1
  82. package/dist/types/src/translations.d.ts +2 -0
  83. package/dist/types/src/translations.d.ts.map +1 -1
  84. package/dist/types/src/types/index.d.ts +2 -0
  85. package/dist/types/src/types/index.d.ts.map +1 -0
  86. package/dist/types/src/{types.d.ts → types/schema.d.ts} +11 -11
  87. package/dist/types/src/types/schema.d.ts.map +1 -0
  88. package/dist/types/tsconfig.tsbuildinfo +1 -1
  89. package/package.json +48 -44
  90. package/src/DeckPlugin.ts +64 -59
  91. package/src/capabilities/app-graph-builder.ts +13 -11
  92. package/src/capabilities/capabilities.ts +3 -3
  93. package/src/capabilities/check-app-scheme.ts +3 -3
  94. package/src/capabilities/index.ts +2 -1
  95. package/src/capabilities/intent-resolver.ts +22 -18
  96. package/src/capabilities/react-root.tsx +4 -3
  97. package/src/capabilities/react-surface.tsx +5 -5
  98. package/src/capabilities/settings.ts +2 -1
  99. package/src/capabilities/state.ts +10 -6
  100. package/src/capabilities/toolkit.ts +68 -0
  101. package/src/capabilities/tools.ts +10 -7
  102. package/src/capabilities/url-handler.ts +3 -2
  103. package/src/components/DeckLayout/Banner.tsx +3 -3
  104. package/src/components/DeckLayout/ContentEmpty.tsx +1 -1
  105. package/src/components/DeckLayout/DeckLayout.stories.tsx +64 -0
  106. package/src/components/DeckLayout/DeckLayout.tsx +10 -279
  107. package/src/components/DeckLayout/DeckMain.tsx +285 -0
  108. package/src/components/DeckLayout/Fallback.tsx +2 -2
  109. package/src/components/DeckLayout/Popover.tsx +1 -1
  110. package/src/components/DeckLayout/Toast.tsx +27 -2
  111. package/src/components/DeckSettings/DeckSettings.tsx +80 -65
  112. package/src/components/Plank/Plank.stories.tsx +10 -11
  113. package/src/components/Plank/Plank.tsx +34 -18
  114. package/src/components/Plank/PlankControls.tsx +3 -3
  115. package/src/components/Plank/PlankError.tsx +5 -7
  116. package/src/components/Plank/PlankHeading.tsx +12 -10
  117. package/src/components/Sidebar/ComplementarySidebar.tsx +9 -8
  118. package/src/components/Sidebar/Sidebar.tsx +2 -2
  119. package/src/components/Sidebar/SidebarButton.tsx +6 -6
  120. package/src/events.ts +2 -2
  121. package/src/hooks/useDeckCompanions.ts +2 -2
  122. package/src/hooks/useHoistStatusbar.ts +4 -3
  123. package/src/hooks/useNodeActionExpander.ts +1 -1
  124. package/src/meta.ts +6 -3
  125. package/src/translations.ts +2 -0
  126. package/src/types/index.ts +5 -0
  127. package/src/{types.ts → types/schema.ts} +9 -9
  128. package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs.map +0 -7
  129. package/dist/lib/browser/check-app-scheme-57U62A3A.mjs.map +0 -7
  130. package/dist/lib/browser/chunk-7LJDT5OH.mjs.map +0 -7
  131. package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
  132. package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
  133. package/dist/lib/browser/chunk-QBKDUEDV.mjs.map +0 -7
  134. package/dist/lib/browser/chunk-QO3VIMKQ.mjs.map +0 -7
  135. package/dist/lib/browser/chunk-XL7EWOGI.mjs.map +0 -7
  136. package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
  137. package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
  138. package/dist/lib/browser/intent-resolver-6YMAE4SF.mjs.map +0 -7
  139. package/dist/lib/browser/react-root-UVN2LMU3.mjs.map +0 -7
  140. package/dist/lib/browser/react-surface-WOLHGHMN.mjs.map +0 -7
  141. package/dist/lib/browser/state-ZTYWMORZ.mjs +0 -10
  142. package/dist/lib/browser/tools-2YYFHQAS.mjs +0 -88
  143. package/dist/lib/browser/tools-2YYFHQAS.mjs.map +0 -7
  144. package/dist/lib/browser/url-handler-KZW7GBA2.mjs.map +0 -7
  145. package/dist/lib/node-esm/app-graph-builder-YCSX45KJ.mjs +0 -153
  146. package/dist/lib/node-esm/app-graph-builder-YCSX45KJ.mjs.map +0 -7
  147. package/dist/lib/node-esm/check-app-scheme-3YZIA73T.mjs +0 -33
  148. package/dist/lib/node-esm/check-app-scheme-3YZIA73T.mjs.map +0 -7
  149. package/dist/lib/node-esm/chunk-ANLUUC3J.mjs +0 -129
  150. package/dist/lib/node-esm/chunk-ANLUUC3J.mjs.map +0 -7
  151. package/dist/lib/node-esm/chunk-F4YIQ5GG.mjs +0 -128
  152. package/dist/lib/node-esm/chunk-F4YIQ5GG.mjs.map +0 -7
  153. package/dist/lib/node-esm/chunk-HHG6H2BX.mjs +0 -15
  154. package/dist/lib/node-esm/chunk-HHG6H2BX.mjs.map +0 -7
  155. package/dist/lib/node-esm/chunk-KTPDAVNM.mjs +0 -17
  156. package/dist/lib/node-esm/chunk-KTPDAVNM.mjs.map +0 -7
  157. package/dist/lib/node-esm/chunk-NMSUKHE3.mjs +0 -1495
  158. package/dist/lib/node-esm/chunk-NMSUKHE3.mjs.map +0 -7
  159. package/dist/lib/node-esm/chunk-QFKYT4JK.mjs +0 -163
  160. package/dist/lib/node-esm/chunk-QFKYT4JK.mjs.map +0 -7
  161. package/dist/lib/node-esm/chunk-UJGQAMF7.mjs +0 -147
  162. package/dist/lib/node-esm/chunk-UJGQAMF7.mjs.map +0 -7
  163. package/dist/lib/node-esm/index.mjs +0 -169
  164. package/dist/lib/node-esm/index.mjs.map +0 -7
  165. package/dist/lib/node-esm/intent-resolver-URTWBGD7.mjs +0 -522
  166. package/dist/lib/node-esm/intent-resolver-URTWBGD7.mjs.map +0 -7
  167. package/dist/lib/node-esm/meta.json +0 -1
  168. package/dist/lib/node-esm/react-root-GFX4GOJT.mjs +0 -44
  169. package/dist/lib/node-esm/react-root-GFX4GOJT.mjs.map +0 -7
  170. package/dist/lib/node-esm/react-surface-F6L5PLWK.mjs +0 -41
  171. package/dist/lib/node-esm/react-surface-F6L5PLWK.mjs.map +0 -7
  172. package/dist/lib/node-esm/settings-WE3TBMOC.mjs +0 -30
  173. package/dist/lib/node-esm/settings-WE3TBMOC.mjs.map +0 -7
  174. package/dist/lib/node-esm/state-DUK6WFDX.mjs +0 -11
  175. package/dist/lib/node-esm/state-DUK6WFDX.mjs.map +0 -7
  176. package/dist/lib/node-esm/tools-HH6NN7HB.mjs +0 -89
  177. package/dist/lib/node-esm/tools-HH6NN7HB.mjs.map +0 -7
  178. package/dist/lib/node-esm/types.mjs +0 -35
  179. package/dist/lib/node-esm/types.mjs.map +0 -7
  180. package/dist/lib/node-esm/url-handler-774BWWKI.mjs +0 -71
  181. package/dist/lib/node-esm/url-handler-774BWWKI.mjs.map +0 -7
  182. package/dist/types/src/types.d.ts.map +0 -1
  183. /package/dist/lib/browser/{state-ZTYWMORZ.mjs.map → state-QTVNH7N6.mjs.map} +0 -0
  184. /package/dist/lib/browser/{types.mjs.map → types/index.mjs.map} +0 -0
@@ -16,23 +16,24 @@ import {
16
16
  LayoutAction,
17
17
  Surface,
18
18
  createIntent,
19
- useCapability,
20
19
  useAppGraph,
20
+ useCapability,
21
21
  useIntentDispatcher,
22
22
  } from '@dxos/app-framework';
23
23
  import { debounce } from '@dxos/async';
24
- import { useNode, type Node } from '@dxos/plugin-graph';
24
+ import { type Node, useNode } from '@dxos/plugin-graph';
25
25
  import { ATTENDABLE_PATH_SEPARATOR, useAttentionAttributes } from '@dxos/react-ui-attention';
26
26
  import { StackItem, railGridHorizontal } from '@dxos/react-ui-stack';
27
27
  import { mainIntrinsicSize, mx } from '@dxos/react-ui-theme';
28
28
 
29
+ import { DeckCapabilities } from '../../capabilities';
30
+ import { useCompanions, useMainSize } from '../../hooks';
31
+ import { parseEntryId } from '../../layout';
32
+ import { DeckAction, type DeckSettingsProps, type LayoutMode, type ResolvedPart } from '../../types';
33
+
29
34
  import { PlankContentError, PlankError } from './PlankError';
30
35
  import { PlankHeading } from './PlankHeading';
31
36
  import { PlankLoading } from './PlankLoading';
32
- import { DeckCapabilities } from '../../capabilities';
33
- import { useMainSize, useCompanions } from '../../hooks';
34
- import { parseEntryId } from '../../layout';
35
- import { DeckAction, type LayoutMode, type ResolvedPart, type DeckSettingsProps } from '../../types';
36
37
 
37
38
  const UNKNOWN_ID = 'unknown_id';
38
39
 
@@ -67,7 +68,11 @@ export const Plank = memo(({ id = UNKNOWN_ID, companionId, ...props }: PlankProp
67
68
  const hasCompanion = !!(companionId && currentCompanion);
68
69
 
69
70
  return (
70
- <PlankContainer solo={props.part === 'solo'} companion={hasCompanion}>
71
+ <PlankContainer
72
+ solo={props.part === 'solo'}
73
+ companion={hasCompanion}
74
+ encapsulate={!!props.settings?.encapsulatedPlanks}
75
+ >
71
76
  <PlankComponent
72
77
  id={id}
73
78
  node={node}
@@ -91,7 +96,12 @@ export const Plank = memo(({ id = UNKNOWN_ID, companionId, ...props }: PlankProp
91
96
  );
92
97
  });
93
98
 
94
- const PlankContainer = ({ children, solo, companion }: PropsWithChildren<{ solo: boolean; companion: boolean }>) => {
99
+ const PlankContainer = ({
100
+ children,
101
+ solo,
102
+ companion,
103
+ encapsulate,
104
+ }: PropsWithChildren<{ solo: boolean; companion: boolean; encapsulate: boolean }>) => {
95
105
  const sizeAttrs = useMainSize();
96
106
  if (!solo) {
97
107
  return children;
@@ -101,7 +111,13 @@ const PlankContainer = ({ children, solo, companion }: PropsWithChildren<{ solo:
101
111
  return (
102
112
  <div
103
113
  role='none'
104
- className={mx('absolute inset-0 grid', companion && 'grid-cols-[1fr_1fr]', railGridHorizontal, mainIntrinsicSize)}
114
+ className={mx(
115
+ 'absolute inset-[--main-spacing] grid',
116
+ encapsulate && 'border border-separator rounded overflow-hidden',
117
+ companion && 'grid-cols-[6fr_4fr]',
118
+ railGridHorizontal,
119
+ mainIntrinsicSize,
120
+ )}
105
121
  {...sizeAttrs}
106
122
  >
107
123
  {children}
@@ -170,11 +186,7 @@ const PlankComponent = memo(
170
186
 
171
187
  useLayoutEffect(() => {
172
188
  if (scrollIntoView === id) {
173
- // TODO(wittjosiah): When focused on page load, the focus is always visible.
174
- // Forcing focus to something smaller than the plank prevents large focus ring in the interim.
175
- const focusable = rootElement.current?.querySelector('button') || rootElement.current;
176
- focusable?.focus({ preventScroll: true });
177
- layoutMode === 'deck' && focusable?.scrollIntoView({ behavior: 'smooth', inline: 'center' });
189
+ layoutMode === 'deck' && rootElement.current?.scrollIntoView({ behavior: 'smooth', inline: 'center' });
178
190
  // Clear the scroll into view state once it has been actioned.
179
191
  void dispatch(createIntent(LayoutAction.ScrollIntoView, { part: 'current', subject: undefined }));
180
192
  }
@@ -189,13 +201,15 @@ const PlankComponent = memo(
189
201
  const data = useMemo(
190
202
  () =>
191
203
  node && {
204
+ attendableId: id,
192
205
  subject: node.data,
193
206
  companionTo: primary?.data,
207
+ properties: node.properties,
194
208
  variant,
195
209
  path,
196
210
  popoverAnchorId,
197
211
  },
198
- [node, node?.data, path, popoverAnchorId, primary?.data, variant],
212
+ [node, node?.data, node?.properties, path, popoverAnchorId, primary?.data, variant],
199
213
  );
200
214
 
201
215
  // TODO(wittjosiah): Change prop to accept a component.
@@ -204,13 +218,16 @@ const PlankComponent = memo(
204
218
  const Root = part.startsWith('solo') ? 'article' : StackItem.Root;
205
219
  const className = mx(
206
220
  'attention-surface relative dx-focus-ring-inset-over-all density-coarse',
207
- isSolo && mainIntrinsicSize,
208
- isSolo && railGridHorizontal,
209
221
  isSolo && 'absolute inset-0',
222
+ isSolo && mainIntrinsicSize,
223
+ railGridHorizontal,
210
224
  part.startsWith('solo') && 'grid',
211
225
  part === 'deck' && (companioned === 'companion' ? '!border-separator border-ie' : '!border-separator border-li'),
212
226
  part.startsWith('solo-') && 'row-span-2 grid-rows-subgrid min-is-0',
213
227
  part === 'solo-companion' && '!border-separator border-is',
228
+ settings?.encapsulatedPlanks &&
229
+ !part.startsWith('solo') &&
230
+ 'mli-[--main-spacing] !border-separator border rounded overflow-hidden',
214
231
  );
215
232
 
216
233
  return (
@@ -258,7 +275,6 @@ const PlankComponent = memo(
258
275
  ) : (
259
276
  <PlankError id={id} part={part} />
260
277
  )}
261
-
262
278
  {canResize && <StackItem.ResizeHandle />}
263
279
  </Root>
264
280
  );
@@ -8,7 +8,7 @@ import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
8
8
  import { invariant } from '@dxos/invariant';
9
9
  import { ButtonGroup, type ButtonGroupProps, type ButtonProps, IconButton, useTranslation } from '@dxos/react-ui';
10
10
 
11
- import { DECK_PLUGIN } from '../../meta';
11
+ import { meta } from '../../meta';
12
12
  import { DeckAction, type LayoutMode } from '../../types';
13
13
 
14
14
  export type PlankControlHandler = (event: DeckAction.PartAdjustment) => void;
@@ -43,7 +43,7 @@ type PlankComplimentControlsProps = {
43
43
 
44
44
  export const PlankCompanionControls = forwardRef<HTMLDivElement, PlankComplimentControlsProps>(
45
45
  ({ primary }, forwardedRef) => {
46
- const { t } = useTranslation(DECK_PLUGIN);
46
+ const { t } = useTranslation(meta.id);
47
47
  const { dispatchPromise: dispatch } = useIntentDispatcher();
48
48
  const handleCloseCompanion = useCallback(() => {
49
49
  invariant(primary);
@@ -71,7 +71,7 @@ export const PlankControls = forwardRef<HTMLDivElement, PlankControlsProps>(
71
71
  { children, classNames, variant = 'default', capabilities, layoutMode, pin, close = false, onClick, ...props },
72
72
  forwardedRef,
73
73
  ) => {
74
- const { t } = useTranslation(DECK_PLUGIN);
74
+ const { t } = useTranslation(meta.id);
75
75
  const buttonClassNames =
76
76
  variant === 'hide-disabled' ? `disabled:hidden ${plankControlSpacing}` : plankControlSpacing;
77
77
 
@@ -8,19 +8,17 @@ import { type Node } from '@dxos/plugin-graph';
8
8
  import { useTranslation } from '@dxos/react-ui';
9
9
  import { descriptionMessage, mx } from '@dxos/react-ui-theme';
10
10
 
11
+ import { meta } from '../../meta';
12
+
11
13
  import { PlankHeading, type PlankHeadingProps } from './PlankHeading';
12
14
  import { PlankLoading } from './PlankLoading';
13
- import { DECK_PLUGIN } from '../../meta';
14
15
 
15
16
  export const PlankContentError = ({ error }: { error?: Error }) => {
16
- const { t } = useTranslation(DECK_PLUGIN);
17
+ const { t } = useTranslation(meta.id);
17
18
  const errorString = error?.toString() ?? '';
18
19
  return (
19
- <div role='none' className='overflow-auto p-8 attention-surface grid place-items-center'>
20
- <p
21
- role='alert'
22
- className={mx(descriptionMessage, 'break-words rounded-md p-8', errorString.length < 256 && 'text-lg')}
23
- >
20
+ <div role='none' className='overflow-y-auto p-8 attention-surface grid place-items-center'>
21
+ <p role='alert' className={mx(descriptionMessage, 'break-all rounded-md p-4')}>
24
22
  {error ? errorString : t('error fallback message')}
25
23
  </p>
26
24
  </div>
@@ -2,22 +2,23 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import React, { Fragment, memo, useCallback, useEffect, useMemo, type MouseEvent } from 'react';
5
+ import React, { Fragment, type MouseEvent, memo, useCallback, useEffect, useMemo } from 'react';
6
6
 
7
- import { createIntent, LayoutAction, Surface, useAppGraph, useIntentDispatcher } from '@dxos/app-framework';
7
+ import { LayoutAction, Surface, createIntent, useAppGraph, useIntentDispatcher } from '@dxos/app-framework';
8
8
  import { type Node } from '@dxos/plugin-graph';
9
9
  import { Icon, IconButton, Popover, toLocalizedString, useTranslation } from '@dxos/react-ui';
10
10
  import { StackItem, type StackItemSigilAction } from '@dxos/react-ui-stack';
11
11
  import { TextTooltip } from '@dxos/react-ui-text-tooltip';
12
12
  import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/react-ui-theme';
13
13
 
14
- import { PlankCompanionControls, PlankControls } from './PlankControls';
15
14
  import { useBreakpoints } from '../../hooks';
16
15
  import { parseEntryId } from '../../layout';
17
- import { DECK_PLUGIN } from '../../meta';
18
- import { PLANK_COMPANION_TYPE, DeckAction, type ResolvedPart, type LayoutMode } from '../../types';
16
+ import { meta } from '../../meta';
17
+ import { DeckAction, type LayoutMode, PLANK_COMPANION_TYPE, type ResolvedPart } from '../../types';
19
18
  import { soloInlinePadding } from '../fragments';
20
19
 
20
+ import { PlankCompanionControls, PlankControls } from './PlankControls';
21
+
21
22
  const MAX_COMPANIONS = 5;
22
23
 
23
24
  export type PlankHeadingProps = {
@@ -52,14 +53,14 @@ export const PlankHeading = memo(
52
53
  layoutMode,
53
54
  actions = [],
54
55
  }: PlankHeadingProps) => {
55
- const { t } = useTranslation(DECK_PLUGIN);
56
+ const { t } = useTranslation(meta.id);
56
57
  const { dispatchPromise: dispatch } = useIntentDispatcher();
57
58
  const { graph } = useAppGraph();
58
59
  const breakpoint = useBreakpoints();
59
60
  const icon = node?.properties?.icon ?? 'ph--placeholder--regular';
60
61
  const label = pending
61
62
  ? t('pending heading')
62
- : toLocalizedString(node?.properties?.label ?? ['plank heading fallback label', { ns: DECK_PLUGIN }], t);
63
+ : toLocalizedString(node?.properties?.label ?? ['plank heading fallback label', { ns: meta.id }], t);
63
64
 
64
65
  const isCompanionNode = node?.type === PLANK_COMPANION_TYPE;
65
66
 
@@ -105,7 +106,7 @@ export const PlankHeading = memo(
105
106
 
106
107
  const handleAction = useCallback(
107
108
  (action: StackItemSigilAction) => {
108
- typeof action.data === 'function' && action.data?.({ parent: node, caller: DECK_PLUGIN });
109
+ typeof action.data === 'function' && void action.data?.({ parent: node, caller: meta.id });
109
110
  },
110
111
  [node],
111
112
  );
@@ -134,7 +135,7 @@ export const PlankHeading = memo(
134
135
  [dispatch, id, part],
135
136
  );
136
137
 
137
- const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${DECK_PLUGIN}/${node.id}` ? Popover.Anchor : Fragment;
138
+ const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${meta.id}/${node.id}` ? Popover.Anchor : Fragment;
138
139
 
139
140
  const handleTabClick = useCallback(
140
141
  (event: MouseEvent) => {
@@ -161,7 +162,8 @@ export const PlankHeading = memo(
161
162
  ? [
162
163
  hoverableControls,
163
164
  hoverableFocusedWithinControls,
164
- '*:transition-opacity *:opacity-[--controls-opacity] bg-transparent border-transparent transition-[background-color,border-color] hover-hover:hover:bg-headerSurface focus-within:bg-headerSurface hover-hover:hover:border-subduedSeparator focus-within:border-subduedSeparator',
165
+ '*:transition-opacity *:opacity-[--controls-opacity] bg-transparent border-transparent transition-[background-color,border-color]',
166
+ 'hover-hover:hover:bg-headerSurface focus-within:bg-headerSurface hover-hover:hover:border-subduedSeparator focus-within:border-subduedSeparator',
165
167
  ]
166
168
  : []),
167
169
  ]}
@@ -13,25 +13,26 @@ import React, {
13
13
  } from 'react';
14
14
 
15
15
  import { LayoutAction, Surface, createIntent, useCapability, useIntentDispatcher } from '@dxos/app-framework';
16
- import { Main, useTranslation, toLocalizedString, IconButton, type Label } from '@dxos/react-ui';
16
+ import { IconButton, type Label, Main, toLocalizedString, useTranslation } from '@dxos/react-ui';
17
17
  import { Tabs } from '@dxos/react-ui-tabs';
18
18
 
19
- import { ToggleComplementarySidebarButton } from './SidebarButton';
20
19
  import { DeckCapabilities } from '../../capabilities';
21
- import { type DeckCompanion, getCompanionId, useDeckCompanions, useBreakpoints, useHoistStatusbar } from '../../hooks';
22
- import { DECK_PLUGIN } from '../../meta';
20
+ import { type DeckCompanion, getCompanionId, useBreakpoints, useDeckCompanions, useHoistStatusbar } from '../../hooks';
21
+ import { meta } from '../../meta';
23
22
  import { getMode } from '../../types';
24
23
  import { layoutAppliesTopbar } from '../../util';
25
24
  import { PlankContentError, PlankLoading } from '../Plank';
26
25
 
27
- const label = ['complementary sidebar title', { ns: DECK_PLUGIN }] satisfies Label;
26
+ import { ToggleComplementarySidebarButton } from './SidebarButton';
27
+
28
+ const label = ['complementary sidebar title', { ns: meta.id }] satisfies Label;
28
29
 
29
30
  export type ComplementarySidebarProps = {
30
31
  current?: string;
31
32
  };
32
33
 
33
34
  export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) => {
34
- const { t } = useTranslation(DECK_PLUGIN);
35
+ const { t } = useTranslation(meta.id);
35
36
  const { dispatchPromise: dispatch } = useIntentDispatcher();
36
37
  const layout = useCapability(DeckCapabilities.MutableDeckState);
37
38
  const layoutMode = getMode(layout.deck);
@@ -129,7 +130,7 @@ export const ComplementarySidebar = ({ current }: ComplementarySidebarProps) =>
129
130
  key={getCompanionId(companion.id)}
130
131
  value={getCompanionId(companion.id)}
131
132
  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)]'
132
- {...(layout.complementarySidebarState !== 'expanded' && { inert: 'true' })}
133
+ {...(layout.complementarySidebarState !== 'expanded' && { inert: true })}
133
134
  >
134
135
  <ComplementarySidebarPanel
135
136
  companion={companion}
@@ -159,7 +160,7 @@ const ScrollArea = ({ children }: PropsWithChildren) => {
159
160
  };
160
161
 
161
162
  const ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }: ComplementarySidebarPanelProps) => {
162
- const { t } = useTranslation(DECK_PLUGIN);
163
+ const { t } = useTranslation(meta.id);
163
164
 
164
165
  if (getCompanionId(companion.id) !== activeId && !data) {
165
166
  return null;
@@ -9,11 +9,11 @@ import { type Label, Main } from '@dxos/react-ui';
9
9
 
10
10
  import { DeckCapabilities } from '../../capabilities';
11
11
  import { useBreakpoints, useHoistStatusbar } from '../../hooks';
12
- import { DECK_PLUGIN } from '../../meta';
12
+ import { meta } from '../../meta';
13
13
  import { getMode } from '../../types';
14
14
  import { layoutAppliesTopbar } from '../../util';
15
15
 
16
- const label = ['sidebar title', { ns: DECK_PLUGIN }] satisfies Label;
16
+ const label = ['sidebar title', { ns: meta.id }] satisfies Label;
17
17
 
18
18
  export const Sidebar = () => {
19
19
  const { popoverAnchorId, activeDeck: current, deck } = useCapability(DeckCapabilities.DeckState);
@@ -4,19 +4,19 @@
4
4
 
5
5
  import React, { useCallback } from 'react';
6
6
 
7
- import { createIntent, LayoutAction, useCapability, useIntentDispatcher } from '@dxos/app-framework';
7
+ import { LayoutAction, createIntent, useCapability, useIntentDispatcher } from '@dxos/app-framework';
8
8
  import { IconButton, type IconButtonProps, type ThemedClassName, useTranslation } from '@dxos/react-ui';
9
9
 
10
10
  import { DeckCapabilities } from '../../capabilities';
11
- import { useDeckCompanions, getCompanionId } from '../../hooks';
12
- import { DECK_PLUGIN } from '../../meta';
11
+ import { getCompanionId, useDeckCompanions } from '../../hooks';
12
+ import { meta } from '../../meta';
13
13
 
14
14
  export const ToggleSidebarButton = ({
15
15
  classNames,
16
16
  variant = 'ghost',
17
17
  }: ThemedClassName<Pick<IconButtonProps, 'variant'>>) => {
18
18
  const layoutContext = useCapability(DeckCapabilities.MutableDeckState);
19
- const { t } = useTranslation(DECK_PLUGIN);
19
+ const { t } = useTranslation(meta.id);
20
20
  return (
21
21
  <IconButton
22
22
  variant={variant}
@@ -34,7 +34,7 @@ export const ToggleSidebarButton = ({
34
34
 
35
35
  export const CloseSidebarButton = () => {
36
36
  const layoutContext = useCapability(DeckCapabilities.MutableDeckState);
37
- const { t } = useTranslation(DECK_PLUGIN);
37
+ const { t } = useTranslation(meta.id);
38
38
  return (
39
39
  <IconButton
40
40
  variant='ghost'
@@ -55,7 +55,7 @@ export const ToggleComplementarySidebarButton = ({
55
55
  }: ThemedClassName<{ inR0?: boolean; current?: string }>) => {
56
56
  const { dispatchPromise: dispatch } = useIntentDispatcher();
57
57
  const layoutContext = useCapability(DeckCapabilities.MutableDeckState);
58
- const { t } = useTranslation(DECK_PLUGIN);
58
+ const { t } = useTranslation(meta.id);
59
59
 
60
60
  const companions = useDeckCompanions();
61
61
  const handleClick = useCallback(async () => {
package/src/events.ts CHANGED
@@ -4,8 +4,8 @@
4
4
 
5
5
  import { Events } from '@dxos/app-framework';
6
6
 
7
- import { DECK_PLUGIN } from './meta';
7
+ import { meta } from './meta';
8
8
 
9
9
  export namespace DeckEvents {
10
- export const StateReady = Events.createStateEvent(`${DECK_PLUGIN}/state-ready`);
10
+ export const StateReady = Events.createStateEvent(`${meta.id}/state-ready`);
11
11
  }
@@ -3,8 +3,8 @@
3
3
  //
4
4
 
5
5
  import { type Label, useAppGraph } from '@dxos/app-framework';
6
- import { ROOT_ID, useConnections, type Node } from '@dxos/plugin-graph';
7
- import { byPosition, type Position } from '@dxos/util';
6
+ import { type Node, ROOT_ID, useConnections } from '@dxos/plugin-graph';
7
+ import { type Position, byPosition } from '@dxos/util';
8
8
 
9
9
  import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '../types';
10
10
 
@@ -7,13 +7,14 @@ import { useMemo } from 'react';
7
7
  import { Capabilities, useCapability } from '@dxos/app-framework';
8
8
  import { useThemeContext } from '@dxos/react-ui';
9
9
 
10
- import { DECK_PLUGIN } from '../meta';
10
+ import { meta } from '../meta';
11
11
  import type { DeckSettingsProps, LayoutMode } from '../types';
12
12
 
13
13
  export const useHoistStatusbar = (breakpoint: string, layoutMode?: LayoutMode): boolean => {
14
- const enableStatusbar = useCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)!.value
15
- .enableStatusbar;
16
14
  const { safeAreaPadding } = useThemeContext();
15
+ const enableStatusbar = useCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(meta.id)?.value
16
+ .enableStatusbar;
17
+
17
18
  return useMemo(() => {
18
19
  return (
19
20
  breakpoint === 'desktop' &&
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { useEffect } from 'react';
6
6
 
7
- import { getGraph, type Node } from '@dxos/plugin-graph';
7
+ import { type Node, getGraph } from '@dxos/plugin-graph';
8
8
 
9
9
  export const useNodeActionExpander = (node?: Node) => {
10
10
  useEffect(() => {
package/src/meta.ts CHANGED
@@ -3,11 +3,14 @@
3
3
  //
4
4
 
5
5
  import { type PluginMeta } from '@dxos/app-framework';
6
-
7
- export const DECK_PLUGIN = 'dxos.org/plugin/deck' as const;
6
+ import { trim } from '@dxos/util';
8
7
 
9
8
  export const meta: PluginMeta = {
10
- id: DECK_PLUGIN,
9
+ id: 'dxos.org/plugin/deck',
11
10
  name: 'Layout',
11
+ description: trim`
12
+ Flexible layout system for arranging workspace views in tabs, splits, and panels.
13
+ Customize your workspace organization with drag-and-drop layout management.
14
+ `,
12
15
  icon: 'ph--layout--regular',
13
16
  };
@@ -11,6 +11,7 @@ export const translations = [
11
11
  'en-US': {
12
12
  [meta.id]: {
13
13
  'plugin name': 'Deck',
14
+ 'settings title': 'Deck settings',
14
15
  'main header label': 'Main header',
15
16
  'open navigation sidebar label': 'Open sidebar',
16
17
  'collapse navigation sidebar label': 'Minimize sidebar',
@@ -58,6 +59,7 @@ export const translations = [
58
59
  'settings overscroll none label': 'None',
59
60
  'settings enable statusbar label': 'Show status bar',
60
61
  'settings enable deck label': 'Enable Deck',
62
+ 'settings encapsulated planks label': 'Encapsulated planks',
61
63
  'close current label': 'Close current plank',
62
64
  'close others label': 'Close other planks',
63
65
  'close all label': 'Close all planks',
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './schema';
@@ -2,17 +2,17 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
5
+ import * as Schema from 'effect/Schema';
6
6
 
7
7
  import { LayoutAction } from '@dxos/app-framework';
8
8
  import { type DeepReadonly } from '@dxos/util';
9
9
 
10
- import { DECK_PLUGIN } from './meta';
10
+ import { meta } from '../meta';
11
11
 
12
12
  export { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
13
13
 
14
- export const PLANK_COMPANION_TYPE = 'dxos.org/plugin/deck/plank-companion';
15
- export const DECK_COMPANION_TYPE = 'dxos.org/plugin/deck/deck-companion';
14
+ export const PLANK_COMPANION_TYPE = `${meta.id}/plank-companion`;
15
+ export const DECK_COMPANION_TYPE = `${meta.id}/deck-companion`;
16
16
 
17
17
  // TODO(Zan): In the future we should consider adding new planks adjacent to the attended plank.
18
18
  export const NewPlankPositions = ['start', 'end'] as const;
@@ -31,6 +31,8 @@ export const DeckSettingsSchema = Schema.Struct({
31
31
  enableNativeRedirect: Schema.optional(Schema.Boolean),
32
32
  newPlankPositioning: Schema.optional(Schema.Literal(...NewPlankPositions)),
33
33
  overscroll: Schema.optional(Schema.Literal(...OverscrollOptions)),
34
+ // TODO(burdon): Rename layoutMode? (e.g., bento | encapsulated?)
35
+ encapsulatedPlanks: Schema.optional(Schema.Boolean),
34
36
  }).pipe(Schema.mutable);
35
37
  export type DeckSettingsProps = Schema.Schema.Type<typeof DeckSettingsSchema>;
36
38
 
@@ -111,8 +113,6 @@ export const DeckPluginState = Schema.Struct({
111
113
 
112
114
  export type DeckPluginState = Schema.Schema.Type<typeof DeckPluginState>;
113
115
 
114
- export const DECK_ACTION = `${DECK_PLUGIN}/action`;
115
-
116
116
  export namespace DeckAction {
117
117
  const PartAdjustmentSchema = Schema.Union(
118
118
  Schema.Literal('close').annotations({ description: 'Close the plank.' }),
@@ -127,12 +127,12 @@ export namespace DeckAction {
127
127
  export type Adjustment = Schema.Schema.Type<typeof Adjustment>;
128
128
 
129
129
  // An atomic transaction to apply to the deck, describing which element to move to which location.
130
- export class Adjust extends Schema.TaggedClass<Adjust>()(`${DECK_ACTION}/adjust`, {
130
+ export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}/action/adjust`, {
131
131
  input: Adjustment,
132
132
  output: Schema.Void,
133
133
  }) {}
134
134
 
135
- export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${DECK_ACTION}/update-plank-size`, {
135
+ export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}/action/update-plank-size`, {
136
136
  input: Schema.Struct({
137
137
  id: Schema.String,
138
138
  size: Schema.Number,
@@ -140,7 +140,7 @@ export namespace DeckAction {
140
140
  output: Schema.Void,
141
141
  }) {}
142
142
 
143
- export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${DECK_ACTION}/change-companion`, {
143
+ export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}/action/change-companion`, {
144
144
  input: Schema.Struct({
145
145
  primary: Schema.String,
146
146
  companion: Schema.Union(Schema.String, Schema.Null),
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/app-graph-builder.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, contributes, createIntent, LayoutAction, type PluginContext } from '@dxos/app-framework';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { createExtension, ROOT_ID, rxFromSignal } from '@dxos/plugin-graph';\n\nimport { DeckCapabilities } from './capabilities';\nimport { DECK_PLUGIN } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: DECK_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n const state = context.getCapability(DeckCapabilities.MutableDeckState);\n\n // NOTE(Zan): This is currently disabled.\n // TODO(Zan): Fullscreen needs to know the active node and provide that to the layout part.\n const _fullscreen = {\n id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'fullscreen' } }),\n );\n },\n properties: {\n label: ['toggle fullscreen label', { ns: DECK_PLUGIN }],\n icon: 'ph--arrows-out--regular',\n keyBinding: {\n macos: 'ctrl+meta+f',\n windows: 'shift+ctrl+f',\n },\n },\n };\n\n const closeCurrent = {\n id: `${LayoutAction.Close._tag}/current`,\n data: async () => {\n const attention = context.getCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n if (attended) {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, {\n part: 'main',\n subject: [attended],\n options: { state: false },\n }),\n );\n }\n },\n properties: {\n label: ['close current label', { ns: DECK_PLUGIN }],\n icon: 'ph--x--regular',\n },\n };\n\n const closeOthers = {\n id: `${LayoutAction.Close._tag}/others`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const attention = context.getCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n const ids = state.deck.active.filter((id) => id !== attended) ?? [];\n await dispatch(\n createIntent(LayoutAction.Close, { part: 'main', subject: ids, options: { state: false } }),\n );\n },\n properties: {\n label: ['close others label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-square--regular',\n },\n };\n\n const closeAll = {\n id: `${LayoutAction.Close._tag}/all`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, {\n part: 'main',\n subject: state.deck.active,\n options: { state: false },\n }),\n );\n },\n properties: {\n label: ['close all label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-circle--regular',\n },\n };\n\n const toggleSidebar = {\n id: `${LayoutAction.UpdateSidebar._tag}/nav`,\n data: async () => {\n state.sidebarState = state.sidebarState === 'expanded' ? 'collapsed' : 'expanded';\n },\n properties: {\n label: [\n get(\n rxFromSignal(() =>\n state.sidebarState === 'expanded'\n ? 'collapse navigation sidebar label'\n : 'open navigation sidebar label',\n ),\n ),\n { ns: DECK_PLUGIN },\n ],\n icon: 'ph--sidebar--regular',\n keyBinding: {\n macos: \"meta+'\",\n },\n disposition: 'pin-end',\n position: 'hoist',\n l0Breakpoint: 'lg',\n },\n };\n\n return get(\n rxFromSignal(() =>\n !state.deck.solo ? [closeCurrent, closeOthers, closeAll, toggleSidebar] : [toggleSidebar],\n ),\n );\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
5
- "mappings": ";;;;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAcC,aAAaC,cAAcC,oBAAwC;AAC1F,SAASC,6BA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CACA,+BAAA,CAAA;UAGR;YAAEtB,IAAIhC;UAAY;;QAEpBiC,MAAM;QACNC,YAAY;UACVC,OAAO;QACT;QACAqB,aAAa;QACbC,UAAU;QACVC,cAAc;MAChB;IACF;AAEA,WAAOrD,IACLkD,aAAa,MACX,CAAC1C,MAAMmC,KAAKW,OAAO;MAACtB;MAAcS;MAAaK;MAAUC;QAAiB;MAACA;KAAc,CAAA;EAG/F,CAAA,GACA7C,OAAOqD,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
6
- "names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "createIntent", "LayoutAction", "AttentionCapabilities", "createExtension", "ROOT_ID", "rxFromSignal", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "DECK_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "ROOT_ID", "some", "none", "map", "state", "getCapability", "DeckCapabilities", "MutableDeckState", "_fullscreen", "LayoutAction", "UpdateLayout", "_tag", "data", "dispatchPromise", "dispatch", "IntentDispatcher", "createIntent", "SetLayoutMode", "part", "options", "mode", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "closeCurrent", "Close", "attention", "AttentionCapabilities", "Attention", "attended", "current", "at", "subject", "closeOthers", "ids", "deck", "active", "filter", "closeAll", "toggleSidebar", "UpdateSidebar", "sidebarState", "rxFromSignal", "disposition", "position", "l0Breakpoint", "solo", "getOrElse"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/check-app-scheme.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';\n\nimport { DECK_PLUGIN } from '../meta';\nimport { type DeckSettingsProps } from '../types';\n\nconst isSocket = !!(globalThis as any).__args;\n\n// TODO(mjamesderocher): Can we get this directly from Socket?\nconst appScheme = 'composer://';\n\n// TODO(mjamesderocher): Factor out as part of NavigationPlugin.\nconst checkAppScheme = (url: string) => {\n const iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n iframe.src = url + window.location.pathname.replace(/^\\/+/, '') + window.location.search;\n\n const timer = setTimeout(() => {\n document.body.removeChild(iframe);\n }, 3000);\n\n window.addEventListener('pagehide', (event) => {\n clearTimeout(timer);\n document.body.removeChild(iframe);\n });\n};\n\nexport default async (context: PluginContext) => {\n const settings = context.getCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;\n if (!isSocket && settings?.enableNativeRedirect) {\n checkAppScheme(appScheme);\n }\n\n return contributes(Capabilities.Null, null);\n};\n"],
5
- "mappings": ";;;;;AAIA,SAASA,cAAcC,mBAAuC;AAK9D,IAAMC,WAAW,CAAC,CAAEC,WAAmBC;AAGvC,IAAMC,YAAY;AAGlB,IAAMC,iBAAiB,CAACC,QAAAA;AACtB,QAAMC,SAASC,SAASC,cAAc,QAAA;AACtCF,SAAOG,MAAMC,UAAU;AACvBH,WAASI,KAAKC,YAAYN,MAAAA;AAE1BA,SAAOO,MAAMR,MAAMS,OAAOC,SAASC,SAASC,QAAQ,QAAQ,EAAA,IAAMH,OAAOC,SAASG;AAElF,QAAMC,QAAQC,WAAW,MAAA;AACvBb,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,GAAG,GAAA;AAEHQ,SAAOQ,iBAAiB,YAAY,CAACC,UAAAA;AACnCC,iBAAaL,KAAAA;AACbZ,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,CAAA;AACF;AAEA,IAAA,2BAAe,OAAOmB,YAAAA;AACpB,QAAMC,WAAWD,QAAQE,cAAcC,aAAaC,aAAa,EAAEC,SAA4BC,WAAAA,GAAcC;AAC7G,MAAI,CAAChC,YAAY0B,UAAUO,sBAAsB;AAC/C7B,mBAAeD,SAAAA;EACjB;AAEA,SAAO+B,YAAYN,aAAaO,MAAM,IAAA;AACxC;",
6
- "names": ["Capabilities", "contributes", "isSocket", "globalThis", "__args", "appScheme", "checkAppScheme", "url", "iframe", "document", "createElement", "style", "display", "body", "appendChild", "src", "window", "location", "pathname", "replace", "search", "timer", "setTimeout", "removeChild", "addEventListener", "event", "clearTimeout", "context", "settings", "getCapability", "Capabilities", "SettingsStore", "getStore", "DECK_PLUGIN", "value", "enableNativeRedirect", "contributes", "Null"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/hooks/useCompanions.ts", "../../../src/hooks/useBreakpoints.ts", "../../../src/hooks/useDeckCompanions.ts", "../../../src/hooks/useHoistStatusbar.ts", "../../../src/hooks/useMainSize.ts", "../../../src/hooks/useNodeActionExpander.ts", "../../../src/capabilities/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { useAppGraph } from '@dxos/app-framework';\nimport { useConnections } from '@dxos/plugin-graph';\nimport { byPosition } from '@dxos/util';\n\nimport { PLANK_COMPANION_TYPE } from '../types';\n\nexport const useCompanions = (id?: string) => {\n const { graph } = useAppGraph();\n const nodes = useConnections(graph, id);\n const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);\n return useMemo(() => companions.toSorted((a, b) => byPosition(a.properties, b.properties)), [companions]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMediaQuery } from '@dxos/react-ui';\n\nexport const useBreakpoints = () => {\n const [isNotMobile] = useMediaQuery('md');\n const [isDesktop] = useMediaQuery('lg');\n return isDesktop ? 'desktop' : isNotMobile ? 'tablet' : 'mobile';\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Label, useAppGraph } from '@dxos/app-framework';\nimport { ROOT_ID, useConnections, type Node } from '@dxos/plugin-graph';\nimport { byPosition, type Position } from '@dxos/util';\n\nimport { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '../types';\n\nexport const getCompanionId = (id: string) => {\n const [_, companionId] = id.split(ATTENDABLE_PATH_SEPARATOR);\n return companionId ?? 'never';\n};\n\nexport type DeckCompanion = Node<\n any,\n {\n label: Label;\n icon: string;\n // TODO(burdon): Scroll area should be controlled by surface.\n /** If true, the panel will not be wrapped in a scroll area. */\n fixed?: boolean;\n position?: Position;\n }\n>;\n\nexport const useDeckCompanions = (): DeckCompanion[] => {\n const { graph } = useAppGraph();\n const connections = useConnections(graph, ROOT_ID);\n const companions = connections.filter((node) => node.type === DECK_COMPANION_TYPE) as DeckCompanion[];\n return companions.toSorted((a, b) => byPosition(a.properties, b.properties));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { Capabilities, useCapability } from '@dxos/app-framework';\nimport { useThemeContext } from '@dxos/react-ui';\n\nimport { DECK_PLUGIN } from '../meta';\nimport type { DeckSettingsProps, LayoutMode } from '../types';\n\nexport const useHoistStatusbar = (breakpoint: string, layoutMode?: LayoutMode): boolean => {\n const enableStatusbar = useCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)!.value\n .enableStatusbar;\n const { safeAreaPadding } = useThemeContext();\n return useMemo(() => {\n return (\n breakpoint === 'desktop' &&\n layoutMode !== 'solo--fullscreen' &&\n !!enableStatusbar &&\n safeAreaPadding?.bottom === 0\n );\n }, [enableStatusbar, breakpoint, safeAreaPadding?.bottom, layoutMode]);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useMainContext } from '@dxos/react-ui';\n\nexport const useMainSize = () => {\n const { navigationSidebarState, complementarySidebarState } = useMainContext('DeckPluginPlank');\n return {\n 'data-sidebar-inline-start-state': navigationSidebarState,\n 'data-sidebar-inline-end-state': complementarySidebarState,\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { getGraph, type Node } from '@dxos/plugin-graph';\n\nexport const useNodeActionExpander = (node?: Node) => {\n useEffect(() => {\n if (node) {\n const frame = requestAnimationFrame(() => {\n const graph = getGraph(node);\n void graph.expand(node.id);\n });\n return () => cancelAnimationFrame(frame);\n }\n }, [node]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const CheckAppScheme = lazy(() => import('./check-app-scheme'));\nexport const DeckSettings = lazy(() => import('./settings'));\nexport const DeckState = lazy(() => import('./state'));\nexport const LayoutIntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactRoot = lazy(() => import('./react-root'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\nexport const Tools = lazy(() => import('./tools'));\nexport const UrlHandler = lazy(() => import('./url-handler'));\n\nexport * from './capabilities';\nexport * from './state';\n"],
5
- "mappings": ";;;;;;;;;;AAIA,SAASA,eAAe;AAExB,SAASC,mBAAmB;AAC5B,SAASC,sBAAsB;AAC/B,SAASC,kBAAkB;AAIpB,IAAMC,gBAAgB,CAACC,OAAAA;AAC5B,QAAM,EAAEC,MAAK,IAAKC,YAAAA;AAClB,QAAMC,QAAQC,eAAeH,OAAOD,EAAAA;AACpC,QAAMK,aAAaF,MAAMG,OAAO,CAACC,SAASA,KAAKC,SAASC,oBAAAA;AACxD,SAAOC,QAAQ,MAAML,WAAWM,SAAS,CAACC,GAAGC,MAAMC,WAAWF,EAAEG,YAAYF,EAAEE,UAAU,CAAA,GAAI;IAACV;GAAW;AAC1G;;;ACbA,SAASW,qBAAqB;AAEvB,IAAMC,iBAAiB,MAAA;AAC5B,QAAM,CAACC,WAAAA,IAAeC,cAAc,IAAA;AACpC,QAAM,CAACC,SAAAA,IAAaD,cAAc,IAAA;AAClC,SAAOC,YAAY,YAAYF,cAAc,WAAW;AAC1D;;;ACNA,SAAqBG,eAAAA,oBAAmB;AACxC,SAASC,SAASC,kBAAAA,uBAAiC;AACnD,SAASC,cAAAA,mBAAiC;AAInC,IAAMC,iBAAiB,CAACC,OAAAA;AAC7B,QAAM,CAACC,GAAGC,WAAAA,IAAeF,GAAGG,MAAMC,yBAAAA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MAAM,OAAO,kCAAA,CAAA;AAC1C,IAAMC,iBAAiBD,KAAK,MAAM,OAAO,iCAAA,CAAA;AACzC,IAAME,eAAeF,KAAK,MAAM,OAAO,yBAAA,CAAA;AACvC,IAAMG,YAAYH,KAAK,MAAM,OAAO,sBAAA,CAAA;AACpC,IAAMI,uBAAuBJ,KAAK,MAAM,OAAO,gCAAA,CAAA;AAC/C,IAAMK,YAAYL,KAAK,MAAM,OAAO,2BAAA,CAAA;AACpC,IAAMM,eAAeN,KAAK,MAAM,OAAO,8BAAA,CAAA;AACvC,IAAMO,QAAQP,KAAK,MAAM,OAAO,sBAAA,CAAA;AAChC,IAAMQ,aAAaR,KAAK,MAAM,OAAO,4BAAA,CAAA;",
6
- "names": ["useMemo", "useAppGraph", "useConnections", "byPosition", "useCompanions", "id", "graph", "useAppGraph", "nodes", "useConnections", "companions", "filter", "node", "type", "PLANK_COMPANION_TYPE", "useMemo", "toSorted", "a", "b", "byPosition", "properties", "useMediaQuery", "useBreakpoints", "isNotMobile", "useMediaQuery", "isDesktop", "useAppGraph", "ROOT_ID", "useConnections", "byPosition", "getCompanionId", "id", "_", "companionId", "split", "ATTENDABLE_PATH_SEPARATOR", "useDeckCompanions", "graph", "useAppGraph", "connections", "useConnections", "ROOT_ID", "companions", "filter", "node", "type", "DECK_COMPANION_TYPE", "toSorted", "a", "b", "byPosition", "properties", "useMemo", "Capabilities", "useCapability", "useThemeContext", "useHoistStatusbar", "breakpoint", "layoutMode", "enableStatusbar", "useCapability", "Capabilities", "SettingsStore", "getStore", "DECK_PLUGIN", "value", "safeAreaPadding", "useThemeContext", "useMemo", "bottom", "useMainContext", "useMainSize", "navigationSidebarState", "complementarySidebarState", "useMainContext", "useEffect", "getGraph", "useNodeActionExpander", "node", "useEffect", "frame", "requestAnimationFrame", "graph", "getGraph", "expand", "id", "cancelAnimationFrame", "lazy", "AppGraphBuilder", "lazy", "CheckAppScheme", "DeckSettings", "DeckState", "LayoutIntentResolver", "ReactRoot", "ReactSurface", "Tools", "UrlHandler"]
7
- }
@@ -1,16 +0,0 @@
1
- import {
2
- DECK_PLUGIN
3
- } from "./chunk-Z5KITAZW.mjs";
4
-
5
- // src/capabilities/capabilities.ts
6
- import { defineCapability } from "@dxos/app-framework";
7
- (function(DeckCapabilities2) {
8
- DeckCapabilities2.DeckState = defineCapability(`${DECK_PLUGIN}/capability/state`);
9
- DeckCapabilities2.MutableDeckState = defineCapability(`${DECK_PLUGIN}/capability/state`);
10
- })(DeckCapabilities || (DeckCapabilities = {}));
11
- var DeckCapabilities;
12
-
13
- export {
14
- DeckCapabilities
15
- };
16
- //# sourceMappingURL=chunk-M57WD3V6.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/capabilities.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type DeepReadonly } from '@dxos/util';\n\nimport { DECK_PLUGIN } from '../meta';\nimport { type DeckPluginState } from '../types';\n\nexport namespace DeckCapabilities {\n export const DeckState = defineCapability<DeepReadonly<DeckPluginState>>(`${DECK_PLUGIN}/capability/state`);\n export const MutableDeckState = defineCapability<DeckPluginState>(`${DECK_PLUGIN}/capability/state`);\n}\n"],
5
- "mappings": ";;;;;AAIA,SAASA,wBAAwB;UAMhBC,mBAAAA;oBACFC,YAAYC,iBAAgD,GAAGC,WAAAA,mBAA8B;oBAC7FC,mBAAmBF,iBAAkC,GAAGC,WAAAA,mBAA8B;AACrG,GAHiBH,qBAAAA,mBAAAA,CAAAA,EAAAA;;",
6
- "names": ["defineCapability", "DeckCapabilities", "DeckState", "defineCapability", "DECK_PLUGIN", "MutableDeckState"]
7
- }