@dxos/plugin-deck 0.8.4-main.67995b8 → 0.8.4-main.a4bbb77

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 (130) hide show
  1. package/dist/lib/browser/{app-graph-builder-JTFSDT2I.mjs → app-graph-builder-7SR53CCK.mjs} +14 -14
  2. package/dist/lib/browser/app-graph-builder-7SR53CCK.mjs.map +7 -0
  3. package/dist/lib/browser/{check-app-scheme-57U62A3A.mjs → check-app-scheme-GCOL6YDT.mjs} +6 -6
  4. package/dist/lib/browser/check-app-scheme-GCOL6YDT.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-QDZO4AJ4.mjs → chunk-7CL25AYA.mjs} +15 -15
  6. package/dist/lib/browser/chunk-7CL25AYA.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-HUWUYTOI.mjs +16 -0
  8. package/dist/lib/browser/chunk-HUWUYTOI.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-MHP4GPX5.mjs +11 -0
  10. package/dist/lib/browser/chunk-MHP4GPX5.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-D7KTFCUV.mjs → chunk-QHJ7N7BF.mjs} +217 -213
  12. package/dist/lib/browser/chunk-QHJ7N7BF.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-F5BQOOEG.mjs → chunk-VSJ7FFQS.mjs} +4 -4
  14. package/dist/lib/browser/chunk-VSJ7FFQS.mjs.map +7 -0
  15. package/dist/lib/browser/{chunk-JFTXENFN.mjs → chunk-WOCUNO27.mjs} +9 -9
  16. package/dist/lib/browser/chunk-WOCUNO27.mjs.map +7 -0
  17. package/dist/lib/browser/index.mjs +19 -14
  18. package/dist/lib/browser/index.mjs.map +3 -3
  19. package/dist/lib/browser/{intent-resolver-P2OBK5HK.mjs → intent-resolver-Y5YOA4NR.mjs} +16 -16
  20. package/dist/lib/browser/intent-resolver-Y5YOA4NR.mjs.map +7 -0
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/{react-root-PO64J7ML.mjs → react-root-A537NMT6.mjs} +11 -11
  23. package/dist/lib/browser/react-root-A537NMT6.mjs.map +7 -0
  24. package/dist/lib/browser/{react-surface-E45YOVF5.mjs → react-surface-DAS4HS3Y.mjs} +13 -13
  25. package/dist/lib/browser/react-surface-DAS4HS3Y.mjs.map +7 -0
  26. package/dist/lib/browser/{settings-6AJZPZPM.mjs → settings-3642GPOR.mjs} +5 -5
  27. package/dist/lib/browser/{settings-6AJZPZPM.mjs.map → settings-3642GPOR.mjs.map} +2 -2
  28. package/dist/lib/browser/state-MKKK3WGD.mjs +12 -0
  29. package/dist/lib/browser/toolkit-UPUBQIYU.mjs +61 -0
  30. package/dist/lib/browser/toolkit-UPUBQIYU.mjs.map +7 -0
  31. package/dist/lib/browser/types/index.mjs +2 -2
  32. package/dist/lib/browser/{url-handler-7L7M6IKH.mjs → url-handler-354LL74P.mjs} +7 -7
  33. package/dist/lib/browser/url-handler-354LL74P.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/state.d.ts +2 -2
  50. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  51. package/dist/types/src/capabilities/toolkit.d.ts +5 -0
  52. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
  53. package/dist/types/src/capabilities/tools.d.ts +1 -1
  54. package/dist/types/src/capabilities/tools.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/url-handler.d.ts +1 -1
  56. package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
  57. package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
  58. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  59. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
  60. package/dist/types/src/components/Plank/Plank.d.ts +1 -1
  61. package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
  62. package/dist/types/src/components/Plank/Plank.stories.d.ts +85 -5
  63. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
  64. package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
  65. package/dist/types/src/components/Plank/PlankHeading.d.ts +1 -1
  66. package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
  67. package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
  68. package/dist/types/src/events.d.ts.map +1 -1
  69. package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
  70. package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
  71. package/dist/types/src/meta.d.ts +0 -1
  72. package/dist/types/src/meta.d.ts.map +1 -1
  73. package/dist/types/src/translations.d.ts +1 -0
  74. package/dist/types/src/translations.d.ts.map +1 -1
  75. package/dist/types/src/types/schema.d.ts +2 -2
  76. package/dist/types/src/types/schema.d.ts.map +1 -1
  77. package/dist/types/tsconfig.tsbuildinfo +1 -1
  78. package/package.json +48 -45
  79. package/src/DeckPlugin.ts +64 -59
  80. package/src/capabilities/app-graph-builder.ts +10 -9
  81. package/src/capabilities/capabilities.ts +3 -3
  82. package/src/capabilities/check-app-scheme.ts +3 -3
  83. package/src/capabilities/index.ts +2 -1
  84. package/src/capabilities/intent-resolver.ts +16 -15
  85. package/src/capabilities/react-root.tsx +4 -3
  86. package/src/capabilities/react-surface.tsx +5 -5
  87. package/src/capabilities/settings.ts +1 -1
  88. package/src/capabilities/state.ts +6 -5
  89. package/src/capabilities/toolkit.ts +55 -0
  90. package/src/capabilities/tools.ts +9 -6
  91. package/src/capabilities/url-handler.ts +3 -2
  92. package/src/components/DeckLayout/Banner.tsx +3 -3
  93. package/src/components/DeckLayout/ContentEmpty.tsx +1 -1
  94. package/src/components/DeckLayout/DeckLayout.tsx +15 -14
  95. package/src/components/DeckLayout/Fallback.tsx +2 -2
  96. package/src/components/DeckLayout/Toast.tsx +2 -2
  97. package/src/components/DeckSettings/DeckSettings.tsx +74 -65
  98. package/src/components/Plank/Plank.stories.tsx +9 -10
  99. package/src/components/Plank/Plank.tsx +7 -6
  100. package/src/components/Plank/PlankControls.tsx +3 -3
  101. package/src/components/Plank/PlankError.tsx +3 -2
  102. package/src/components/Plank/PlankHeading.tsx +10 -9
  103. package/src/components/Sidebar/ComplementarySidebar.tsx +9 -8
  104. package/src/components/Sidebar/Sidebar.tsx +2 -2
  105. package/src/components/Sidebar/SidebarButton.tsx +6 -6
  106. package/src/events.ts +2 -2
  107. package/src/hooks/useDeckCompanions.ts +2 -2
  108. package/src/hooks/useHoistStatusbar.ts +2 -2
  109. package/src/hooks/useNodeActionExpander.ts +1 -1
  110. package/src/meta.ts +1 -3
  111. package/src/translations.ts +1 -0
  112. package/src/types/schema.ts +2 -2
  113. package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs.map +0 -7
  114. package/dist/lib/browser/check-app-scheme-57U62A3A.mjs.map +0 -7
  115. package/dist/lib/browser/chunk-D7KTFCUV.mjs.map +0 -7
  116. package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +0 -7
  117. package/dist/lib/browser/chunk-JFTXENFN.mjs.map +0 -7
  118. package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
  119. package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
  120. package/dist/lib/browser/chunk-QDZO4AJ4.mjs.map +0 -7
  121. package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
  122. package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
  123. package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs.map +0 -7
  124. package/dist/lib/browser/react-root-PO64J7ML.mjs.map +0 -7
  125. package/dist/lib/browser/react-surface-E45YOVF5.mjs.map +0 -7
  126. package/dist/lib/browser/state-MVDYX77Y.mjs +0 -12
  127. package/dist/lib/browser/tools-TKQDPCHJ.mjs +0 -88
  128. package/dist/lib/browser/tools-TKQDPCHJ.mjs.map +0 -7
  129. package/dist/lib/browser/url-handler-7L7M6IKH.mjs.map +0 -7
  130. /package/dist/lib/browser/{state-MVDYX77Y.mjs.map → state-MKKK3WGD.mjs.map} +0 -0
@@ -2,12 +2,13 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, contributes, createIntent, LayoutAction, type PluginContext } from '@dxos/app-framework';
5
+ import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
6
6
  import { scheduledEffect } from '@dxos/echo-signals/core';
7
7
 
8
- import { DeckCapabilities } from './capabilities';
9
8
  import { defaultDeck } from '../types';
10
9
 
10
+ import { DeckCapabilities } from './capabilities';
11
+
11
12
  // TODO(wittjosiah): Cleanup the url handling. May justify introducing routing capabilities.
12
13
  export default async (context: PluginContext) => {
13
14
  const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
@@ -5,14 +5,14 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { Surface } from '@dxos/app-framework';
8
- import { useTranslation, type ThemedClassName } from '@dxos/react-ui';
8
+ import { type ThemedClassName, useTranslation } from '@dxos/react-ui';
9
9
  import { mx } from '@dxos/react-ui-theme';
10
10
 
11
- import { DECK_PLUGIN } from '../../meta';
11
+ import { meta } from '../../meta';
12
12
  import { CloseSidebarButton, ToggleSidebarButton } from '../Sidebar';
13
13
 
14
14
  export const Banner = ({ variant, classNames }: ThemedClassName<{ variant?: 'topbar' | 'sidebar' }>) => {
15
- const { t } = useTranslation(DECK_PLUGIN);
15
+ const { t } = useTranslation(meta.id);
16
16
  return (
17
17
  <header
18
18
  className={mx(
@@ -10,8 +10,8 @@ import { DeckCapabilities } from '../../capabilities';
10
10
  import { useBreakpoints } from '../../hooks';
11
11
  import { getMode } from '../../types';
12
12
  import { layoutAppliesTopbar } from '../../util';
13
- import { ToggleSidebarButton } from '../Sidebar';
14
13
  import { fixedSidebarToggleStyles } from '../fragments';
14
+ import { ToggleSidebarButton } from '../Sidebar';
15
15
 
16
16
  export const ContentEmpty = () => {
17
17
  const breakpoint = useBreakpoints();
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  import { untracked } from '@preact/signals-core';
6
- import React, { useCallback, useEffect, useMemo, useRef, type UIEvent, Fragment } from 'react';
6
+ import React, { Fragment, type UIEvent, useCallback, useEffect, useMemo, useRef } from 'react';
7
7
 
8
8
  import {
9
9
  Capabilities,
@@ -15,9 +15,18 @@ import {
15
15
  } from '@dxos/app-framework';
16
16
  import { AttentionCapabilities } from '@dxos/plugin-attention';
17
17
  import { Main, type MainProps, useMediaQuery, useOnTransition } from '@dxos/react-ui';
18
- import { Stack, StackContext, DEFAULT_HORIZONTAL_SIZE } from '@dxos/react-ui-stack';
18
+ import { DEFAULT_HORIZONTAL_SIZE, Stack, StackContext } from '@dxos/react-ui-stack';
19
19
  import { mainPaddingTransitions } from '@dxos/react-ui-theme';
20
20
 
21
+ import { DeckCapabilities } from '../../capabilities';
22
+ import { useBreakpoints, useHoistStatusbar } from '../../hooks';
23
+ import { meta } from '../../meta';
24
+ import { type DeckSettingsProps, getMode } from '../../types';
25
+ import { calculateOverscroll, layoutAppliesTopbar } from '../../util';
26
+ import { fixedComplementarySidebarToggleStyles, fixedSidebarToggleStyles } from '../fragments';
27
+ import { Plank } from '../Plank';
28
+ import { ComplementarySidebar, Sidebar, ToggleComplementarySidebarButton, ToggleSidebarButton } from '../Sidebar';
29
+
21
30
  import { ActiveNode } from './ActiveNode';
22
31
  import { ContentEmpty } from './ContentEmpty';
23
32
  import { Dialog } from './Dialog';
@@ -25,14 +34,6 @@ import { PopoverContent, PopoverRoot } from './Popover';
25
34
  import { StatusBar } from './StatusBar';
26
35
  import { Toast } from './Toast';
27
36
  import { Topbar } from './Topbar';
28
- import { DeckCapabilities } from '../../capabilities';
29
- import { useBreakpoints, useHoistStatusbar } from '../../hooks';
30
- import { DECK_PLUGIN } from '../../meta';
31
- import { type DeckSettingsProps, getMode } from '../../types';
32
- import { calculateOverscroll, layoutAppliesTopbar } from '../../util';
33
- import { Plank } from '../Plank';
34
- import { ComplementarySidebar, Sidebar, ToggleComplementarySidebarButton, ToggleSidebarButton } from '../Sidebar';
35
- import { fixedComplementarySidebarToggleStyles, fixedSidebarToggleStyles } from '../fragments';
36
37
 
37
38
  export type DeckLayoutProps = {
38
39
  onDismissToast: (id: string) => void;
@@ -43,7 +44,7 @@ const PlankSeparator = ({ order }: { order: number }) =>
43
44
 
44
45
  export const DeckLayout = ({ onDismissToast }: DeckLayoutProps) => {
45
46
  const { dispatchPromise: dispatch } = useIntentDispatcher();
46
- const settings = useCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)!.value;
47
+ const settings = useCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(meta.id)!.value;
47
48
  const context = useCapability(DeckCapabilities.MutableDeckState);
48
49
  const { sidebarState, complementarySidebarState, complementarySidebarPanel, deck, toasts } = context;
49
50
  const { active, activeCompanions, fullscreen, solo, plankSizing } = deck;
@@ -53,7 +54,7 @@ export const DeckLayout = ({ onDismissToast }: DeckLayoutProps) => {
53
54
  const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
54
55
  const pluginManager = usePluginManager();
55
56
 
56
- const scrollLeftRef = useRef<number | null>();
57
+ const scrollLeftRef = useRef<number>(null);
57
58
  const deckRef = useRef<HTMLDivElement>(null);
58
59
 
59
60
  // Ensure the first plank is attended when the deck is first rendered.
@@ -216,7 +217,7 @@ export const DeckLayout = ({ onDismissToast }: DeckLayoutProps) => {
216
217
  <div
217
218
  role='none'
218
219
  className={!solo ? 'relative bg-deckSurface overflow-hidden' : 'sr-only'}
219
- {...(solo && { inert: '' })}
220
+ {...(solo && { inert: true })}
220
221
  >
221
222
  {!topbar && !fullscreen && <ToggleSidebarButton classNames={fixedSidebarToggleStyles} />}
222
223
  {!topbar && !fullscreen && (
@@ -250,7 +251,7 @@ export const DeckLayout = ({ onDismissToast }: DeckLayoutProps) => {
250
251
  <div
251
252
  role='none'
252
253
  className={solo ? 'relative bg-deckSurface overflow-hidden' : 'sr-only'}
253
- {...(!solo && { inert: '' })}
254
+ {...(!solo && { inert: true })}
254
255
  >
255
256
  {!topbar && !fullscreen && <ToggleSidebarButton classNames={fixedSidebarToggleStyles} />}
256
257
  {!topbar && !fullscreen && (
@@ -7,10 +7,10 @@ import React from 'react';
7
7
  import { useTranslation } from '@dxos/react-ui';
8
8
  import { errorText, mx } from '@dxos/react-ui-theme';
9
9
 
10
- import { DECK_PLUGIN } from '../../meta';
10
+ import { meta } from '../../meta';
11
11
 
12
12
  export const Fallback = () => {
13
- const { t } = useTranslation(DECK_PLUGIN);
13
+ const { t } = useTranslation(meta.id);
14
14
 
15
15
  return (
16
16
  <div role='none' className='min-bs-screen is-full flex items-center justify-center p-8'>
@@ -14,7 +14,7 @@ import {
14
14
  useTranslation,
15
15
  } from '@dxos/react-ui';
16
16
 
17
- import { DECK_PLUGIN } from '../../meta';
17
+ import { meta } from '../../meta';
18
18
 
19
19
  // TODO(wittjosiah): Render remaining duration as a progress bar within the toast.
20
20
  export const Toast = ({
@@ -29,7 +29,7 @@ export const Toast = ({
29
29
  onAction,
30
30
  onOpenChange,
31
31
  }: LayoutAction.Toast & Pick<ToastRootProps, 'onOpenChange'>) => {
32
- const { t } = useTranslation(DECK_PLUGIN);
32
+ const { t } = useTranslation(meta.id);
33
33
 
34
34
  return (
35
35
  <NaturalToast.Root data-testid={id} defaultOpen duration={duration} onOpenChange={onOpenChange}>
@@ -5,9 +5,9 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { Input, Select, useTranslation } from '@dxos/react-ui';
8
- import { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';
8
+ import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
9
9
 
10
- import { DECK_PLUGIN } from '../../meta';
10
+ import { meta } from '../../meta';
11
11
  import {
12
12
  type DeckSettingsProps,
13
13
  type NewPlankPositioning,
@@ -19,70 +19,79 @@ import {
19
19
  const isSocket = !!(globalThis as any).__args;
20
20
 
21
21
  export const DeckSettings = ({ settings }: { settings: DeckSettingsProps }) => {
22
- const { t } = useTranslation(DECK_PLUGIN);
22
+ const { t } = useTranslation(meta.id);
23
23
 
24
24
  return (
25
- <DeprecatedFormContainer>
26
- <DeprecatedFormInput label={t('settings enable deck label')}>
27
- <Input.Switch checked={settings.enableDeck} onCheckedChange={(checked) => (settings.enableDeck = checked)} />
28
- </DeprecatedFormInput>
29
- <DeprecatedFormInput label={t('select new plank positioning label')}>
30
- <Select.Root
31
- disabled={!settings.enableDeck}
32
- value={settings.newPlankPositioning ?? 'start'}
33
- onValueChange={(value) => (settings.newPlankPositioning = value as NewPlankPositioning)}
34
- >
35
- <Select.TriggerButton placeholder={t('select new plank positioning placeholder')} />
36
- <Select.Portal>
37
- <Select.Content>
38
- <Select.Viewport>
39
- {NewPlankPositions.map((position) => (
40
- <Select.Option key={position} value={position}>
41
- {t(`settings new plank position ${position} label`)}
42
- </Select.Option>
43
- ))}
44
- </Select.Viewport>
45
- </Select.Content>
46
- </Select.Portal>
47
- </Select.Root>
48
- </DeprecatedFormInput>
49
- <DeprecatedFormInput label={t('settings overscroll label')}>
50
- <Select.Root
51
- disabled={!settings.enableDeck}
52
- value={settings.overscroll ?? 'none'}
53
- onValueChange={(value) => (settings.overscroll = value as Overscroll)}
54
- >
55
- <Select.TriggerButton placeholder={t('select overscroll placeholder')} />
56
- <Select.Portal>
57
- <Select.Content>
58
- <Select.Viewport>
59
- {OverscrollOptions.map((option) => (
60
- <Select.Option key={option} value={option}>
61
- {t(`settings overscroll ${option} label`)}
62
- </Select.Option>
63
- ))}
64
- </Select.Viewport>
65
- </Select.Content>
66
- </Select.Portal>
67
- </Select.Root>
68
- </DeprecatedFormInput>
69
- <DeprecatedFormInput label={t('settings enable statusbar label')}>
70
- <Input.Switch
71
- checked={settings.enableStatusbar}
72
- onCheckedChange={(checked) => (settings.enableStatusbar = checked)}
73
- />
74
- </DeprecatedFormInput>
75
- <DeprecatedFormInput label={t('settings show hints label')}>
76
- <Input.Switch checked={settings.showHints} onCheckedChange={(checked) => (settings.showHints = checked)} />
77
- </DeprecatedFormInput>
78
- {!isSocket && (
79
- <DeprecatedFormInput label={t('settings native redirect label')}>
80
- <Input.Switch
81
- checked={settings.enableNativeRedirect}
82
- onCheckedChange={(checked) => (settings.enableNativeRedirect = checked)}
83
- />
84
- </DeprecatedFormInput>
85
- )}
86
- </DeprecatedFormContainer>
25
+ <ControlPage>
26
+ <ControlSection title={t('settings title', { ns: meta.id })}>
27
+ <ControlGroup>
28
+ <ControlItemInput title={t('settings enable deck label')}>
29
+ <Input.Switch
30
+ checked={settings.enableDeck}
31
+ onCheckedChange={(checked) => (settings.enableDeck = checked)}
32
+ />
33
+ </ControlItemInput>
34
+ <ControlItemInput title={t('select new plank positioning label')}>
35
+ <Select.Root
36
+ disabled={!settings.enableDeck}
37
+ value={settings.newPlankPositioning ?? 'start'}
38
+ onValueChange={(value) => (settings.newPlankPositioning = value as NewPlankPositioning)}
39
+ >
40
+ <Select.TriggerButton placeholder={t('select new plank positioning placeholder')} />
41
+ <Select.Portal>
42
+ <Select.Content>
43
+ <Select.Viewport>
44
+ {NewPlankPositions.map((position) => (
45
+ <Select.Option key={position} value={position}>
46
+ {t(`settings new plank position ${position} label`)}
47
+ </Select.Option>
48
+ ))}
49
+ </Select.Viewport>
50
+ <Select.Arrow />
51
+ </Select.Content>
52
+ </Select.Portal>
53
+ </Select.Root>
54
+ </ControlItemInput>
55
+ <ControlItemInput title={t('settings overscroll label')}>
56
+ <Select.Root
57
+ disabled={!settings.enableDeck}
58
+ value={settings.overscroll ?? 'none'}
59
+ onValueChange={(value) => (settings.overscroll = value as Overscroll)}
60
+ >
61
+ <Select.TriggerButton placeholder={t('select overscroll placeholder')} />
62
+ <Select.Portal>
63
+ <Select.Content>
64
+ <Select.Viewport>
65
+ {OverscrollOptions.map((option) => (
66
+ <Select.Option key={option} value={option}>
67
+ {t(`settings overscroll ${option} label`)}
68
+ </Select.Option>
69
+ ))}
70
+ </Select.Viewport>
71
+ <Select.Arrow />
72
+ </Select.Content>
73
+ </Select.Portal>
74
+ </Select.Root>
75
+ </ControlItemInput>
76
+ <ControlItemInput title={t('settings enable statusbar label')}>
77
+ <Input.Switch
78
+ checked={settings.enableStatusbar}
79
+ onCheckedChange={(checked) => (settings.enableStatusbar = checked)}
80
+ />
81
+ </ControlItemInput>
82
+ <ControlItemInput title={t('settings show hints label')}>
83
+ <Input.Switch checked={settings.showHints} onCheckedChange={(checked) => (settings.showHints = checked)} />
84
+ </ControlItemInput>
85
+ {!isSocket && (
86
+ <ControlItemInput title={t('settings native redirect label')}>
87
+ <Input.Switch
88
+ checked={settings.enableNativeRedirect}
89
+ onCheckedChange={(checked) => (settings.enableNativeRedirect = checked)}
90
+ />
91
+ </ControlItemInput>
92
+ )}
93
+ </ControlGroup>
94
+ </ControlSection>
95
+ </ControlPage>
87
96
  );
88
97
  };
@@ -2,23 +2,22 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
- import { type StoryObj, type Meta } from '@storybook/react-vite';
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
10
8
  import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
11
9
  import { withPluginManager } from '@dxos/app-framework/testing';
12
10
  import { AttentionPlugin } from '@dxos/plugin-attention';
13
11
  import { GraphPlugin } from '@dxos/plugin-graph';
12
+ import { withTheme } from '@dxos/react-ui/testing';
14
13
  import { Stack } from '@dxos/react-ui-stack';
15
- import { withTheme, withLayout } from '@dxos/storybook-utils';
16
14
 
17
- import { Plank, type PlankProps } from './Plank';
18
15
  import { DeckStateFactory } from '../../capabilities';
19
16
  import { translations } from '../../translations';
20
17
 
21
- const meta: Meta<PlankProps> = {
18
+ import { Plank } from './Plank';
19
+
20
+ const meta = {
22
21
  title: 'plugins/plugin-deck/Plank',
23
22
  component: Plank,
24
23
  render: (args) => {
@@ -29,21 +28,21 @@ const meta: Meta<PlankProps> = {
29
28
  );
30
29
  },
31
30
  decorators: [
31
+ withTheme,
32
32
  withPluginManager({
33
33
  plugins: [AttentionPlugin(), SettingsPlugin(), IntentPlugin(), GraphPlugin()],
34
34
  capabilities: () => DeckStateFactory(),
35
35
  }),
36
- withTheme,
37
- withLayout({ fullscreen: true }),
38
36
  ],
39
37
  parameters: {
38
+ layout: 'fullscreen',
40
39
  translations,
41
40
  },
42
- };
41
+ } satisfies Meta<typeof Plank>;
43
42
 
44
43
  export default meta;
45
44
 
46
- type Story = StoryObj<PlankProps>;
45
+ type Story = StoryObj<typeof meta>;
47
46
 
48
47
  // TODO(burdon): Need to define surface provider?
49
48
  export const Default: Story = {
@@ -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
 
@@ -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,12 +8,13 @@ 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
20
  <div role='none' className='overflow-y-auto p-8 attention-surface grid place-items-center'>
@@ -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' && void 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) => {
@@ -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