@dxos/plugin-deck 0.8.3-staging.0fa589b → 0.8.4-main.1da679c

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 (116) hide show
  1. package/dist/lib/browser/{app-graph-builder-YCO7Y54J.mjs → app-graph-builder-DD2EJBLZ.mjs} +8 -8
  2. package/dist/lib/browser/app-graph-builder-DD2EJBLZ.mjs.map +7 -0
  3. package/dist/lib/browser/{check-app-scheme-7AXGR6UT.mjs → check-app-scheme-BKIOCWXT.mjs} +5 -5
  4. package/dist/lib/browser/{check-app-scheme-7AXGR6UT.mjs.map → check-app-scheme-BKIOCWXT.mjs.map} +2 -2
  5. package/dist/lib/browser/{chunk-TRFYUEBA.mjs → chunk-CNTGBCMK.mjs} +5 -5
  6. package/dist/lib/browser/{chunk-YN5OZEGS.mjs → chunk-F5BQOOEG.mjs} +7 -9
  7. package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +7 -0
  8. package/dist/lib/browser/{chunk-RMCRP7HV.mjs → chunk-FMGWFTHR.mjs} +231 -227
  9. package/dist/lib/browser/chunk-FMGWFTHR.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-RAZK4XT5.mjs → chunk-KCXWTPSU.mjs} +20 -20
  11. package/dist/lib/browser/{chunk-RAZK4XT5.mjs.map → chunk-KCXWTPSU.mjs.map} +3 -3
  12. package/dist/lib/browser/{chunk-KLN73CM3.mjs → chunk-M57WD3V6.mjs} +3 -3
  13. package/dist/lib/browser/{chunk-FX44YX3G.mjs → chunk-NRCPV6AV.mjs} +8 -7
  14. package/dist/lib/browser/{chunk-FX44YX3G.mjs.map → chunk-NRCPV6AV.mjs.map} +2 -2
  15. package/dist/lib/browser/{chunk-NSATFAEE.mjs → chunk-Z5KITAZW.mjs} +2 -2
  16. package/dist/lib/browser/index.mjs +24 -17
  17. package/dist/lib/browser/index.mjs.map +3 -3
  18. package/dist/lib/browser/{intent-resolver-EGLWTKJG.mjs → intent-resolver-XSCCU7JI.mjs} +13 -13
  19. package/dist/lib/browser/intent-resolver-XSCCU7JI.mjs.map +7 -0
  20. package/dist/lib/browser/meta.json +1 -1
  21. package/dist/lib/browser/{react-root-C4HIM5CI.mjs → react-root-E54PO26O.mjs} +11 -11
  22. package/dist/lib/browser/{react-root-C4HIM5CI.mjs.map → react-root-E54PO26O.mjs.map} +2 -2
  23. package/dist/lib/browser/{react-surface-RV2AZ6WZ.mjs → react-surface-DIZC3J4P.mjs} +11 -11
  24. package/dist/lib/browser/{react-surface-RV2AZ6WZ.mjs.map → react-surface-DIZC3J4P.mjs.map} +2 -2
  25. package/dist/lib/browser/{settings-7VUU3ZJ4.mjs → settings-RNPLZT5S.mjs} +6 -6
  26. package/dist/lib/browser/{settings-7VUU3ZJ4.mjs.map → settings-RNPLZT5S.mjs.map} +2 -2
  27. package/dist/lib/browser/state-CRXR7X63.mjs +12 -0
  28. package/dist/lib/browser/toolkit-HPFRHY67.mjs +61 -0
  29. package/dist/lib/browser/toolkit-HPFRHY67.mjs.map +7 -0
  30. package/dist/lib/browser/{types.mjs → types/index.mjs} +3 -5
  31. package/dist/lib/browser/{url-handler-BUGI6XRE.mjs → url-handler-6IJME37M.mjs} +8 -8
  32. package/dist/lib/browser/url-handler-6IJME37M.mjs.map +7 -0
  33. package/dist/types/src/DeckPlugin.d.ts.map +1 -1
  34. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  35. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/check-app-scheme.d.ts +1 -1
  37. package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
  38. package/dist/types/src/capabilities/index.d.ts +9 -9
  39. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  40. package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
  41. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  42. package/dist/types/src/capabilities/react-root.d.ts +2 -2
  43. package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
  44. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  45. package/dist/types/src/capabilities/settings.d.ts +1 -1
  46. package/dist/types/src/capabilities/state.d.ts +2 -2
  47. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  48. package/dist/types/src/capabilities/toolkit.d.ts +5 -0
  49. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
  50. package/dist/types/src/capabilities/tools.d.ts +1 -1
  51. package/dist/types/src/capabilities/tools.d.ts.map +1 -1
  52. package/dist/types/src/capabilities/url-handler.d.ts +1 -1
  53. package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
  54. package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
  55. package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
  56. package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
  57. package/dist/types/src/components/Plank/Plank.d.ts +1 -1
  58. package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
  59. package/dist/types/src/components/Plank/Plank.stories.d.ts +84 -4
  60. package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
  61. package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
  62. package/dist/types/src/components/Plank/PlankHeading.d.ts +1 -1
  63. package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
  64. package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
  65. package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
  66. package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
  67. package/dist/types/src/translations.d.ts +57 -56
  68. package/dist/types/src/translations.d.ts.map +1 -1
  69. package/dist/types/src/types/index.d.ts +2 -0
  70. package/dist/types/src/types/index.d.ts.map +1 -0
  71. package/dist/types/src/{types.d.ts → types/schema.d.ts} +7 -8
  72. package/dist/types/src/types/schema.d.ts.map +1 -0
  73. package/dist/types/tsconfig.tsbuildinfo +1 -1
  74. package/package.json +42 -40
  75. package/src/DeckPlugin.ts +12 -6
  76. package/src/capabilities/app-graph-builder.ts +4 -3
  77. package/src/capabilities/check-app-scheme.ts +1 -1
  78. package/src/capabilities/index.ts +2 -1
  79. package/src/capabilities/intent-resolver.ts +11 -10
  80. package/src/capabilities/react-root.tsx +2 -1
  81. package/src/capabilities/react-surface.tsx +1 -1
  82. package/src/capabilities/settings.ts +1 -1
  83. package/src/capabilities/state.ts +4 -3
  84. package/src/capabilities/toolkit.ts +55 -0
  85. package/src/capabilities/tools.ts +9 -6
  86. package/src/capabilities/url-handler.ts +3 -2
  87. package/src/components/DeckLayout/Banner.tsx +1 -1
  88. package/src/components/DeckLayout/ContentEmpty.tsx +1 -1
  89. package/src/components/DeckLayout/DeckLayout.tsx +11 -10
  90. package/src/components/DeckLayout/Popover.tsx +1 -1
  91. package/src/components/DeckSettings/DeckSettings.tsx +72 -63
  92. package/src/components/Plank/Plank.stories.tsx +9 -8
  93. package/src/components/Plank/Plank.tsx +7 -6
  94. package/src/components/Plank/PlankError.tsx +4 -6
  95. package/src/components/Plank/PlankHeading.tsx +7 -6
  96. package/src/components/Sidebar/ComplementarySidebar.tsx +4 -3
  97. package/src/components/Sidebar/SidebarButton.tsx +2 -2
  98. package/src/hooks/useDeckCompanions.ts +2 -2
  99. package/src/hooks/useNodeActionExpander.ts +1 -1
  100. package/src/translations.ts +7 -4
  101. package/src/types/index.ts +5 -0
  102. package/src/{types.ts → types/schema.ts} +4 -6
  103. package/dist/lib/browser/app-graph-builder-YCO7Y54J.mjs.map +0 -7
  104. package/dist/lib/browser/chunk-RMCRP7HV.mjs.map +0 -7
  105. package/dist/lib/browser/chunk-YN5OZEGS.mjs.map +0 -7
  106. package/dist/lib/browser/intent-resolver-EGLWTKJG.mjs.map +0 -7
  107. package/dist/lib/browser/state-VJ6E3ADY.mjs +0 -10
  108. package/dist/lib/browser/tools-N57NQ2LH.mjs +0 -88
  109. package/dist/lib/browser/tools-N57NQ2LH.mjs.map +0 -7
  110. package/dist/lib/browser/url-handler-BUGI6XRE.mjs.map +0 -7
  111. package/dist/types/src/types.d.ts.map +0 -1
  112. /package/dist/lib/browser/{chunk-TRFYUEBA.mjs.map → chunk-CNTGBCMK.mjs.map} +0 -0
  113. /package/dist/lib/browser/{chunk-KLN73CM3.mjs.map → chunk-M57WD3V6.mjs.map} +0 -0
  114. /package/dist/lib/browser/{chunk-NSATFAEE.mjs.map → chunk-Z5KITAZW.mjs.map} +0 -0
  115. /package/dist/lib/browser/{state-VJ6E3ADY.mjs.map → state-CRXR7X63.mjs.map} +0 -0
  116. /package/dist/lib/browser/{types.mjs.map → types/index.mjs.map} +0 -0
@@ -5,7 +5,7 @@
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
10
  import { DECK_PLUGIN } from '../../meta';
11
11
  import {
@@ -22,67 +22,76 @@ export const DeckSettings = ({ settings }: { settings: DeckSettingsProps }) => {
22
22
  const { t } = useTranslation(DECK_PLUGIN);
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: DECK_PLUGIN })}>
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
  };
@@ -4,7 +4,7 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { type StoryObj, type Meta } from '@storybook/react';
7
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
8
8
  import React from 'react';
9
9
 
10
10
  import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
@@ -12,13 +12,14 @@ import { withPluginManager } from '@dxos/app-framework/testing';
12
12
  import { AttentionPlugin } from '@dxos/plugin-attention';
13
13
  import { GraphPlugin } from '@dxos/plugin-graph';
14
14
  import { Stack } from '@dxos/react-ui-stack';
15
- import { withTheme, withLayout } from '@dxos/storybook-utils';
15
+ import { withLayout, withTheme } from '@dxos/storybook-utils';
16
16
 
17
- import { Plank, type PlankProps } from './Plank';
18
- import DeckStateFactory from '../../capabilities/state';
19
- import translations from '../../translations';
17
+ import { DeckStateFactory } from '../../capabilities';
18
+ import { translations } from '../../translations';
20
19
 
21
- const meta: Meta<PlankProps> = {
20
+ import { Plank } from './Plank';
21
+
22
+ const meta = {
22
23
  title: 'plugins/plugin-deck/Plank',
23
24
  component: Plank,
24
25
  render: (args) => {
@@ -39,11 +40,11 @@ const meta: Meta<PlankProps> = {
39
40
  parameters: {
40
41
  translations,
41
42
  },
42
- };
43
+ } satisfies Meta<typeof Plank>;
43
44
 
44
45
  export default meta;
45
46
 
46
- type Story = StoryObj<PlankProps>;
47
+ type Story = StoryObj<typeof meta>;
47
48
 
48
49
  // TODO(burdon): Need to define surface provider?
49
50
  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,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 { DECK_PLUGIN } 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
17
  const { t } = useTranslation(DECK_PLUGIN);
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
16
  import { DECK_PLUGIN } from '../../meta';
18
- import { PLANK_COMPANION_TYPE, DeckAction, type ResolvedPart, type LayoutMode } from '../../types';
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 = {
@@ -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: DECK_PLUGIN });
109
110
  },
110
111
  [node],
111
112
  );
@@ -155,7 +156,7 @@ export const PlankHeading = memo(
155
156
  return (
156
157
  <StackItem.Heading
157
158
  classNames={[
158
- 'plb-1 items-stretch gap-1 sticky inline-start-12 app-drag min-is-0 contain-layout',
159
+ 'plb-1 items-stretch gap-1 sticky inline-start-12 app-drag min-is-0 contain-layout density-coarse',
159
160
  part === 'solo' ? soloInlinePadding : 'pli-1',
160
161
  ...(layoutMode === 'solo--fullscreen'
161
162
  ? [
@@ -13,17 +13,18 @@ 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';
20
+ import { type DeckCompanion, getCompanionId, useBreakpoints, useDeckCompanions, useHoistStatusbar } from '../../hooks';
22
21
  import { DECK_PLUGIN } from '../../meta';
23
22
  import { getMode } from '../../types';
24
23
  import { layoutAppliesTopbar } from '../../util';
25
24
  import { PlankContentError, PlankLoading } from '../Plank';
26
25
 
26
+ import { ToggleComplementarySidebarButton } from './SidebarButton';
27
+
27
28
  const label = ['complementary sidebar title', { ns: DECK_PLUGIN }] satisfies Label;
28
29
 
29
30
  export type ComplementarySidebarProps = {
@@ -4,11 +4,11 @@
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';
11
+ import { getCompanionId, useDeckCompanions } from '../../hooks';
12
12
  import { DECK_PLUGIN } from '../../meta';
13
13
 
14
14
  export const ToggleSidebarButton = ({
@@ -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
 
@@ -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(() => {
@@ -2,13 +2,16 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { DECK_PLUGIN } from './meta';
5
+ import { type Resource } from '@dxos/react-ui';
6
6
 
7
- export default [
7
+ import { meta } from './meta';
8
+
9
+ export const translations = [
8
10
  {
9
11
  'en-US': {
10
- [DECK_PLUGIN]: {
12
+ [meta.id]: {
11
13
  'plugin name': 'Deck',
14
+ 'settings title': 'Deck settings',
12
15
  'main header label': 'Main header',
13
16
  'open navigation sidebar label': 'Open sidebar',
14
17
  'collapse navigation sidebar label': 'Minimize sidebar',
@@ -63,4 +66,4 @@ export default [
63
66
  },
64
67
  },
65
68
  },
66
- ];
69
+ ] as const satisfies Resource[];
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './schema';
@@ -7,7 +7,7 @@ import { Schema } from 'effect';
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
 
@@ -111,8 +111,6 @@ export const DeckPluginState = Schema.Struct({
111
111
 
112
112
  export type DeckPluginState = Schema.Schema.Type<typeof DeckPluginState>;
113
113
 
114
- export const DECK_ACTION = `${DECK_PLUGIN}/action`;
115
-
116
114
  export namespace DeckAction {
117
115
  const PartAdjustmentSchema = Schema.Union(
118
116
  Schema.Literal('close').annotations({ description: 'Close the plank.' }),
@@ -127,12 +125,12 @@ export namespace DeckAction {
127
125
  export type Adjustment = Schema.Schema.Type<typeof Adjustment>;
128
126
 
129
127
  // 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`, {
128
+ export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}/action/adjust`, {
131
129
  input: Adjustment,
132
130
  output: Schema.Void,
133
131
  }) {}
134
132
 
135
- export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${DECK_ACTION}/update-plank-size`, {
133
+ export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}/action/update-plank-size`, {
136
134
  input: Schema.Struct({
137
135
  id: Schema.String,
138
136
  size: Schema.Number,
@@ -140,7 +138,7 @@ export namespace DeckAction {
140
138
  output: Schema.Void,
141
139
  }) {}
142
140
 
143
- export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${DECK_ACTION}/change-companion`, {
141
+ export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}/action/change-companion`, {
144
142
  input: Schema.Struct({
145
143
  primary: Schema.String,
146
144
  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,6BAA6B;AACtC,SAASC,iBAAiBC,SAASC,oBAAoB;AAKvD,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,SAAS,CAACC,SACRC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKH,OAAOU,UAAUF,OAAOG,KAAKR,KAAAA,IAAQK,OAAOI,KAAI,CAAA,GAC/EJ,OAAOK,IAAI,MAAA;AACT,UAAMC,QAAQnB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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
- }