@dxos/plugin-help 0.8.4-main.3f58842 → 0.8.4-main.3fbcb4aa9b

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 (185) hide show
  1. package/dist/lib/neutral/HelpPlugin.mjs +30 -0
  2. package/dist/lib/neutral/HelpPlugin.mjs.map +7 -0
  3. package/dist/lib/neutral/ShortcutsDialogContent-TB5PZWVY.mjs +17 -0
  4. package/dist/lib/neutral/ShortcutsDialogContent-TB5PZWVY.mjs.map +7 -0
  5. package/dist/lib/neutral/ShortcutsHints-P4SUBCY7.mjs +8 -0
  6. package/dist/lib/neutral/ShortcutsList-MZHWIVDH.mjs +8 -0
  7. package/dist/lib/neutral/app-graph-builder-BJYIYNMN.mjs +75 -0
  8. package/dist/lib/neutral/app-graph-builder-BJYIYNMN.mjs.map +7 -0
  9. package/dist/lib/neutral/capabilities/index.mjs +17 -0
  10. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  11. package/dist/lib/neutral/chunk-BI3HKFKB.mjs +63 -0
  12. package/dist/lib/neutral/chunk-BI3HKFKB.mjs.map +7 -0
  13. package/dist/lib/neutral/chunk-GZL2J55W.mjs +8 -0
  14. package/dist/lib/neutral/chunk-GZL2J55W.mjs.map +7 -0
  15. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  16. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
  17. package/dist/lib/neutral/chunk-MQQNHGDV.mjs +8 -0
  18. package/dist/lib/neutral/chunk-MQQNHGDV.mjs.map +7 -0
  19. package/dist/lib/neutral/chunk-NHTI7NEQ.mjs +19 -0
  20. package/dist/lib/neutral/chunk-NHTI7NEQ.mjs.map +7 -0
  21. package/dist/lib/neutral/chunk-NJCLRR5U.mjs +331 -0
  22. package/dist/lib/neutral/chunk-NJCLRR5U.mjs.map +7 -0
  23. package/dist/lib/neutral/components/index.mjs +20 -0
  24. package/dist/lib/neutral/components/index.mjs.map +7 -0
  25. package/dist/lib/neutral/containers/index.mjs +13 -0
  26. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  27. package/dist/lib/neutral/hooks/index.mjs +13 -0
  28. package/dist/lib/neutral/hooks/index.mjs.map +7 -0
  29. package/dist/lib/neutral/index.mjs +24 -0
  30. package/dist/lib/neutral/index.mjs.map +7 -0
  31. package/dist/lib/neutral/meta.json +1 -0
  32. package/dist/lib/{browser → neutral}/meta.mjs +2 -3
  33. package/dist/lib/neutral/meta.mjs.map +7 -0
  34. package/dist/lib/neutral/operation-handler-F2JU4V62.mjs +13 -0
  35. package/dist/lib/neutral/operation-handler-F2JU4V62.mjs.map +7 -0
  36. package/dist/lib/neutral/operations/index.mjs +8 -0
  37. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  38. package/dist/lib/neutral/plugin.mjs +16 -0
  39. package/dist/lib/neutral/plugin.mjs.map +7 -0
  40. package/dist/lib/neutral/react-root-PYPAXETF.mjs +38 -0
  41. package/dist/lib/neutral/react-root-PYPAXETF.mjs.map +7 -0
  42. package/dist/lib/neutral/react-surface-SNS4QQMR.mjs +33 -0
  43. package/dist/lib/neutral/react-surface-SNS4QQMR.mjs.map +7 -0
  44. package/dist/lib/neutral/start-XYUDZGXJ.mjs +21 -0
  45. package/dist/lib/neutral/start-XYUDZGXJ.mjs.map +7 -0
  46. package/dist/lib/neutral/state-5HQJG3KW.mjs +24 -0
  47. package/dist/lib/neutral/state-5HQJG3KW.mjs.map +7 -0
  48. package/dist/lib/neutral/translations.mjs +20 -0
  49. package/dist/lib/neutral/translations.mjs.map +7 -0
  50. package/dist/lib/neutral/types/index.mjs +12 -0
  51. package/dist/lib/neutral/types/index.mjs.map +7 -0
  52. package/dist/types/src/HelpPlugin.d.ts +4 -2
  53. package/dist/types/src/HelpPlugin.d.ts.map +1 -1
  54. package/dist/types/src/HelpPlugin.test.d.ts +2 -0
  55. package/dist/types/src/HelpPlugin.test.d.ts.map +1 -0
  56. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  57. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  58. package/dist/types/src/capabilities/index.d.ts +16 -6
  59. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  60. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  61. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  62. package/dist/types/src/capabilities/react-root.d.ts +5 -3
  63. package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
  64. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  65. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  66. package/dist/types/src/capabilities/state.d.ts +11 -2
  67. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  68. package/dist/types/src/components/Shortcuts/Key.d.ts.map +1 -1
  69. package/dist/types/src/components/Shortcuts/ShortcutsHints.d.ts.map +1 -1
  70. package/dist/types/src/components/Shortcuts/ShortcutsList.d.ts.map +1 -1
  71. package/dist/types/src/components/Shortcuts/ShortcutsSection.d.ts.map +1 -1
  72. package/dist/types/src/components/Shortcuts/index.d.ts +0 -1
  73. package/dist/types/src/components/Shortcuts/index.d.ts.map +1 -1
  74. package/dist/types/src/components/Tooltip/Tooltip.d.ts +9 -9
  75. package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  76. package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts +1 -1
  77. package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts.map +1 -1
  78. package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts +9 -4
  79. package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts.map +1 -1
  80. package/dist/types/src/constants.d.ts +2 -0
  81. package/dist/types/src/constants.d.ts.map +1 -0
  82. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts +3 -0
  83. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts.map +1 -0
  84. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.d.ts +25 -0
  85. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.d.ts.map +1 -0
  86. package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts +2 -0
  87. package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts.map +1 -0
  88. package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts +2 -0
  89. package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts.map +1 -0
  90. package/dist/types/src/containers/ShortcutsHints/index.d.ts +2 -0
  91. package/dist/types/src/containers/ShortcutsHints/index.d.ts.map +1 -0
  92. package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts +2 -0
  93. package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts.map +1 -0
  94. package/dist/types/src/containers/ShortcutsList/index.d.ts +2 -0
  95. package/dist/types/src/containers/ShortcutsList/index.d.ts.map +1 -0
  96. package/dist/types/src/containers/index.d.ts +5 -0
  97. package/dist/types/src/containers/index.d.ts.map +1 -0
  98. package/dist/types/src/hooks/useHelp.d.ts +1 -1
  99. package/dist/types/src/hooks/useHelp.d.ts.map +1 -1
  100. package/dist/types/src/index.d.ts +2 -4
  101. package/dist/types/src/index.d.ts.map +1 -1
  102. package/dist/types/src/meta.d.ts +2 -3
  103. package/dist/types/src/meta.d.ts.map +1 -1
  104. package/dist/types/src/operations/index.d.ts +3 -0
  105. package/dist/types/src/operations/index.d.ts.map +1 -0
  106. package/dist/types/src/operations/start.d.ts +5 -0
  107. package/dist/types/src/operations/start.d.ts.map +1 -0
  108. package/dist/types/src/plugin.d.ts +5 -0
  109. package/dist/types/src/plugin.d.ts.map +1 -0
  110. package/dist/types/src/translations.d.ts +5 -6
  111. package/dist/types/src/translations.d.ts.map +1 -1
  112. package/dist/types/src/types/HelpCapabilities.d.ts +19 -0
  113. package/dist/types/src/types/HelpCapabilities.d.ts.map +1 -0
  114. package/dist/types/src/types/HelpOperation.d.ts +4 -0
  115. package/dist/types/src/types/HelpOperation.d.ts.map +1 -0
  116. package/dist/types/src/types/index.d.ts +2 -0
  117. package/dist/types/src/types/index.d.ts.map +1 -1
  118. package/dist/types/src/types/schema.d.ts +2 -14
  119. package/dist/types/src/types/schema.d.ts.map +1 -1
  120. package/dist/types/tsconfig.tsbuildinfo +1 -1
  121. package/package.json +97 -51
  122. package/src/HelpPlugin.test.ts +30 -0
  123. package/src/HelpPlugin.tsx +24 -49
  124. package/src/capabilities/app-graph-builder.ts +53 -67
  125. package/src/capabilities/index.ts +10 -7
  126. package/src/capabilities/operation-handler.ts +16 -0
  127. package/src/capabilities/react-root.tsx +28 -24
  128. package/src/capabilities/react-surface.tsx +28 -22
  129. package/src/capabilities/state.ts +19 -15
  130. package/src/components/Shortcuts/ShortcutsHints.tsx +15 -7
  131. package/src/components/Shortcuts/ShortcutsList.tsx +6 -5
  132. package/src/components/Shortcuts/ShortcutsSection.tsx +1 -3
  133. package/src/components/Shortcuts/index.ts +0 -1
  134. package/src/components/Shortcuts/styles.ts +3 -3
  135. package/src/components/Tooltip/Tooltip.tsx +5 -6
  136. package/src/components/WelcomeTour/WelcomeTour.stories.tsx +22 -16
  137. package/src/components/WelcomeTour/WelcomeTour.tsx +19 -19
  138. package/src/constants.ts +7 -0
  139. package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.tsx +39 -0
  140. package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.tsx +28 -0
  141. package/src/containers/ShortcutsDialogContent/index.ts +5 -0
  142. package/src/containers/ShortcutsHints/ShortcutsHints.tsx +5 -0
  143. package/src/containers/ShortcutsHints/index.ts +5 -0
  144. package/src/containers/ShortcutsList/ShortcutsList.tsx +5 -0
  145. package/src/containers/ShortcutsList/index.ts +5 -0
  146. package/src/containers/index.ts +9 -0
  147. package/src/hooks/useHelp.tsx +1 -1
  148. package/src/index.ts +2 -4
  149. package/src/meta.ts +9 -6
  150. package/src/operations/index.ts +7 -0
  151. package/src/operations/start.ts +20 -0
  152. package/src/plugin.ts +12 -0
  153. package/src/translations.ts +5 -5
  154. package/src/types/HelpCapabilities.ts +24 -0
  155. package/src/types/HelpOperation.ts +21 -0
  156. package/src/types/index.ts +2 -0
  157. package/src/types/schema.ts +2 -12
  158. package/dist/lib/browser/app-graph-builder-BYCMEBNG.mjs +0 -79
  159. package/dist/lib/browser/app-graph-builder-BYCMEBNG.mjs.map +0 -7
  160. package/dist/lib/browser/chunk-3Y4CMOZP.mjs +0 -13
  161. package/dist/lib/browser/chunk-3Y4CMOZP.mjs.map +0 -7
  162. package/dist/lib/browser/chunk-J2SJSGSX.mjs +0 -34
  163. package/dist/lib/browser/chunk-J2SJSGSX.mjs.map +0 -7
  164. package/dist/lib/browser/chunk-LDRUZNSN.mjs +0 -16
  165. package/dist/lib/browser/chunk-LDRUZNSN.mjs.map +0 -7
  166. package/dist/lib/browser/chunk-MNETJXKS.mjs +0 -409
  167. package/dist/lib/browser/chunk-MNETJXKS.mjs.map +0 -7
  168. package/dist/lib/browser/index.mjs +0 -112
  169. package/dist/lib/browser/index.mjs.map +0 -7
  170. package/dist/lib/browser/meta.json +0 -1
  171. package/dist/lib/browser/react-root-W6ZDEGBU.mjs +0 -34
  172. package/dist/lib/browser/react-root-W6ZDEGBU.mjs.map +0 -7
  173. package/dist/lib/browser/react-surface-SATVEWS5.mjs +0 -36
  174. package/dist/lib/browser/react-surface-SATVEWS5.mjs.map +0 -7
  175. package/dist/lib/browser/state-FWUZG6NL.mjs +0 -29
  176. package/dist/lib/browser/state-FWUZG6NL.mjs.map +0 -7
  177. package/dist/lib/browser/types/index.mjs +0 -10
  178. package/dist/types/src/capabilities/capabilities.d.ts +0 -10
  179. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  180. package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts +0 -4
  181. package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts.map +0 -1
  182. package/src/capabilities/capabilities.ts +0 -13
  183. package/src/components/Shortcuts/ShortcutsDialog.tsx +0 -34
  184. /package/dist/lib/{browser/meta.mjs.map → neutral/ShortcutsHints-P4SUBCY7.mjs.map} +0 -0
  185. /package/dist/lib/{browser/types/index.mjs.map → neutral/ShortcutsList-MZHWIVDH.mjs.map} +0 -0
@@ -5,14 +5,15 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { type KeyBinding, Keyboard } from '@dxos/keyboard';
8
- import { Button, Icon, toLocalizedString, useTranslation } from '@dxos/react-ui';
8
+ import { IconButton, toLocalizedString, useTranslation } from '@dxos/react-ui';
9
+ import { osTranslations } from '@dxos/ui-theme';
9
10
 
10
11
  import { Key } from './Key';
11
12
 
12
13
  const Shortcut = ({ binding }: { binding: KeyBinding }) => {
13
- const { t } = useTranslation('os');
14
+ const { t } = useTranslation(osTranslations);
14
15
  return (
15
- <div role='none' className='flex items-center gap-2 whitespace-nowrap'>
16
+ <div className='flex items-center gap-2 whitespace-nowrap'>
16
17
  <Key binding={binding.shortcut} />
17
18
  <span className='text-sm'>{toLocalizedString(binding.data, t)}</span>
18
19
  </div>
@@ -26,14 +27,21 @@ export const ShortcutsHints = ({ onClose }: { onClose?: () => void }) => {
26
27
  const hints = bindings.filter((binding) => defaults.includes(binding.shortcut));
27
28
 
28
29
  return (
29
- <div role='none' className='flex overflow-hidden px-2 gap-4'>
30
+ <div className='flex overflow-hidden px-2 gap-4'>
30
31
  {hints.map((binding) => (
31
32
  <Shortcut key={binding.shortcut} binding={binding} />
32
33
  ))}
33
34
  {onClose && (
34
- <Button variant='ghost' classNames='p-0 cursor-pointer' onClick={onClose}>
35
- <Icon icon='ph--x--regular' size={4} />
36
- </Button>
35
+ <IconButton
36
+ icon='ph--x--regular'
37
+ size={4}
38
+ label='Close'
39
+ iconOnly
40
+ noTooltip
41
+ variant='ghost'
42
+ classNames='p-0 cursor-pointer'
43
+ onClick={onClose}
44
+ />
37
45
  )}
38
46
  </div>
39
47
  );
@@ -6,13 +6,14 @@ import React, { Fragment } from 'react';
6
6
 
7
7
  import { Keyboard } from '@dxos/keyboard';
8
8
  import { toLocalizedString, useTranslation } from '@dxos/react-ui';
9
- import { mx } from '@dxos/react-ui-theme';
9
+ import { mx } from '@dxos/ui-theme';
10
+
11
+ import { meta } from '#meta';
10
12
 
11
13
  import { Key } from './Key';
12
- import { HELP_PLUGIN } from '../../meta';
13
14
 
14
15
  export const ShortcutsList = () => {
15
- const { t } = useTranslation(HELP_PLUGIN);
16
+ const { t } = useTranslation(meta.id);
16
17
  const bindings = Keyboard.singleton.getBindings();
17
18
 
18
19
  // TODO(burdon): Get shortcuts from TextEditor.
@@ -21,11 +22,11 @@ export const ShortcutsList = () => {
21
22
  });
22
23
 
23
24
  return (
24
- <dl className={mx('is-fit grid grid-cols-[min-content_minmax(12rem,1fr)] gap-2 mlb-4 text-subdued select-none')}>
25
+ <dl className={mx('w-fit grid grid-cols-[min-content_minmax(12rem,1fr)] gap-2 my-4 text-subdued select-none')}>
25
26
  {bindings.map((binding, i) => (
26
27
  <Fragment key={i}>
27
28
  <Key binding={binding.shortcut} />
28
- <span role='definition' className='mis-4' aria-labelledby={binding.shortcut}>
29
+ <span role='definition' className='ms-4' aria-labelledby={binding.shortcut}>
29
30
  {toLocalizedString(binding.data, t)}
30
31
  </span>
31
32
  </Fragment>
@@ -4,13 +4,11 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
- import { descriptionText } from '@dxos/react-ui-theme';
8
-
9
7
  import { ShortcutsList } from './ShortcutsList';
10
8
 
11
9
  export const ShortcutsSection = () => {
12
10
  return (
13
- <section className={descriptionText}>
11
+ <section className='text-description'>
14
12
  <ShortcutsList />
15
13
  </section>
16
14
  );
@@ -2,7 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export * from './ShortcutsDialog';
6
5
  export * from './ShortcutsHints';
7
6
  export * from './ShortcutsList';
8
7
  export * from './ShortcutsSection';
@@ -2,9 +2,9 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { mx } from '@dxos/react-ui-theme';
5
+ import { mx } from '@dxos/ui-theme';
6
6
 
7
7
  export const shortcutKey = mx(
8
- 'inline-flex min-is-[24px] bs-[24px] pli-0.5 justify-center items-center text-xs',
9
- 'rounded bg-neutral-100 dark:bg-neutral-900',
8
+ 'inline-flex min-w-[24px] h-[24px] px-0.5 justify-center items-center text-xs',
9
+ 'rounded-sm bg-neutral-100 dark:bg-neutral-900',
10
10
  );
@@ -7,7 +7,7 @@ import React, { forwardRef } from 'react';
7
7
  // TODO(thure): This needed to be imported in the package.json specifically to pacify TS2742. See if this is resolved with typescript@5.5.x.
8
8
  // eslint-disable-next-line unused-imports/no-unused-imports
9
9
  import _floater from 'react-floater';
10
- import { type TooltipRenderProps, type Props } from 'react-joyride';
10
+ import { type Props, type TooltipRenderProps } from 'react-joyride';
11
11
  // TODO(thure): This needed to be imported in the package.json specifically to pacify TS2742. See if this is resolved with typescript@5.5.x.
12
12
  // eslint-disable-next-line unused-imports/no-unused-imports
13
13
  import _typefest from 'type-fest';
@@ -38,7 +38,7 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipRenderProps>(
38
38
 
39
39
  return (
40
40
  <div
41
- className='flex flex-col is-[15rem] min-bs-[10rem] overflow-hidden rounded-md shadow-xl bg-accentSurface text-accentSurfaceText'
41
+ className='flex flex-col w-[15rem] min-h-[10rem] overflow-hidden rounded-md shadow-xl bg-accent-surface text-accent-surface-text'
42
42
  role='tooltip'
43
43
  data-testid='helpPlugin.tooltip'
44
44
  data-step={index + 1}
@@ -46,7 +46,7 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipRenderProps>(
46
46
  ref={forwardedRef}
47
47
  >
48
48
  <div className='flex p-2'>
49
- <h2 className='grow pli-2 plb-1 text-lg font-medium text-accentSurfaceText'>{title}</h2>
49
+ <h2 className='grow px-2 py-1 text-lg font-medium text-accent-surface-text'>{title}</h2>
50
50
  <IconButton
51
51
  density='fine'
52
52
  icon='ph--x--bold'
@@ -58,7 +58,7 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipRenderProps>(
58
58
  data-testid='helpPlugin.tooltip.close'
59
59
  />
60
60
  </div>
61
- <div className='flex grow pli-4 mlb-2'>{content}</div>
61
+ <div className='flex grow px-4 my-2'>{content}</div>
62
62
  <div className='flex p-2 items-center justify-between' {...arrowNavigationAttrs}>
63
63
  {
64
64
  <IconButton
@@ -67,7 +67,6 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipRenderProps>(
67
67
  iconOnly
68
68
  label={backProps['aria-label']}
69
69
  onClick={backProps.onClick}
70
- size={5}
71
70
  variant='primary'
72
71
  data-testid='helpPlugin.tooltip.back'
73
72
  />
@@ -79,7 +78,7 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipRenderProps>(
79
78
  key={i}
80
79
  icon={index === i ? 'ph--circle--fill' : 'ph--circle--regular'}
81
80
  size={2}
82
- classNames='mli-1 cursor-pointer'
81
+ classNames='mx-1 cursor-pointer'
83
82
  />
84
83
  ))}
85
84
  </div>
@@ -2,23 +2,24 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React, { useState } from 'react';
9
7
 
10
- import { faker } from '@dxos/random';
8
+ import { withPluginManager } from '@dxos/app-framework/testing';
9
+ import { StorybookPlugin } from '@dxos/plugin-testing';
10
+ import { random } from '@dxos/random';
11
11
  import { Button, Icon } from '@dxos/react-ui';
12
- import { withTheme } from '@dxos/storybook-utils';
12
+ import { withTheme } from '@dxos/react-ui/testing';
13
+
14
+ import { useHelp } from '#hooks';
13
15
 
14
16
  import { WelcomeTour, type WelcomeTourProps } from './WelcomeTour';
15
- import { useHelp } from '../../hooks';
16
17
 
17
18
  const App = () => {
18
19
  const { running, start } = useHelp();
19
- const [items, setItems] = useState(() => Array.from({ length: 5 }).map(() => faker.lorem.sentence()));
20
+ const [items, setItems] = useState(() => Array.from({ length: 5 }).map(() => random.lorem.sentence()));
20
21
  const handleAdd = () => {
21
- setItems((items) => [...items, faker.lorem.sentence()]);
22
+ setItems((items) => [...items, random.lorem.sentence()]);
22
23
  };
23
24
 
24
25
  return (
@@ -31,7 +32,7 @@ const App = () => {
31
32
  <div>{String(running)}</div>
32
33
  </div>
33
34
  <div>
34
- <ul className='p-2 border border-blue-500 rounded-md' data-joyride='basic/2'>
35
+ <ul className='p-2 border border-primary-500 rounded-md' data-joyride='basic/2'>
35
36
  {items.map((item, i) => (
36
37
  <li key={i} className='flex items-center gap-2'>
37
38
  <Icon icon='ph--circle--regular' />
@@ -75,25 +76,25 @@ export const Default: StoryObj<typeof WelcomeTour> = {
75
76
  {
76
77
  target: '[data-joyride="basic/1"]',
77
78
  title: 'plugins/Step 1',
78
- content: faker.lorem.paragraph(),
79
+ content: random.lorem.paragraph(),
79
80
  disableBeacon: true,
80
81
  placement: 'right',
81
82
  },
82
83
  {
83
84
  target: '[data-joyride="basic/2"]',
84
85
  title: 'plugins/Step 2',
85
- content: faker.lorem.paragraph(),
86
+ content: random.lorem.paragraph(),
86
87
  },
87
88
  {
88
89
  target: '[data-joyride="basic/3"]',
89
90
  title: 'plugins/Step 3',
90
- content: faker.lorem.paragraph(),
91
+ content: random.lorem.paragraph(),
91
92
  placement: 'right',
92
93
  },
93
94
  {
94
95
  target: '[data-joyride="basic/4"]',
95
96
  title: 'plugins/Step 4',
96
- content: faker.lorem.paragraph(),
97
+ content: random.lorem.paragraph(),
97
98
  placement: 'top-end',
98
99
  },
99
100
  ],
@@ -103,11 +104,16 @@ export const Default: StoryObj<typeof WelcomeTour> = {
103
104
  /**
104
105
  * IMPORTANT: Run in separate tab.
105
106
  */
106
- const meta: Meta<typeof WelcomeTour> = {
107
- title: 'plugins/plugin-help/WelcomeTour',
107
+ const meta = {
108
+ title: 'plugins/plugin-help/components/WelcomeTour',
108
109
  component: WelcomeTour,
109
110
  render: DefaultStory,
110
- decorators: [withTheme],
111
- };
111
+ decorators: [
112
+ withTheme(),
113
+ withPluginManager({
114
+ plugins: [StorybookPlugin({})],
115
+ }),
116
+ ],
117
+ } satisfies Meta<typeof WelcomeTour>;
112
118
 
113
119
  export default meta;
@@ -2,13 +2,16 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import React, { useState, useEffect } from 'react';
5
+ import React, { useState } from 'react';
6
6
  import Joyride, { ACTIONS, EVENTS } from 'react-joyride';
7
7
 
8
- import { usePluginManager, useLayout } from '@dxos/app-framework';
8
+ import { usePluginManager } from '@dxos/app-framework/ui';
9
+ import { useLayout } from '@dxos/app-toolkit/ui';
10
+ import { useAsyncEffect } from '@dxos/react-ui';
9
11
 
10
- import { type Step, HelpContext } from '../../types';
11
- import { floaterProps, Tooltip } from '../Tooltip';
12
+ import { HelpContext, type Step } from '#types';
13
+
14
+ import { Tooltip, floaterProps } from '../Tooltip';
12
15
 
13
16
  const addStepClass = (target: string | HTMLElement) => {
14
17
  const element = typeof target === 'string' ? document.querySelector(target) : target;
@@ -75,7 +78,7 @@ export const WelcomeTour = ({ steps: initialSteps, running: runningProp, onRunni
75
78
  const setStepIndex = (index: number) => {
76
79
  if (runningProp) {
77
80
  const step = steps[index];
78
- step?.before?.(manager.context);
81
+ step?.before?.(manager.capabilities);
79
82
  }
80
83
  _setStepIndex(index);
81
84
  };
@@ -93,20 +96,16 @@ export const WelcomeTour = ({ steps: initialSteps, running: runningProp, onRunni
93
96
  }
94
97
  };
95
98
 
96
- useEffect(() => {
97
- const timeout = setTimeout(async () => {
98
- if (runningProp) {
99
- // This handles the case when the target is not yet in the document.
100
- // If the target is not in the document, when the joyride is turned on, it will not show the tooltip.
101
- await waitForTarget(steps[stepIndex]);
102
- setStepIndex(0);
103
- setRunning(true);
104
- } else if (typeof runningProp !== 'undefined') {
105
- setRunning(false);
106
- }
107
- });
108
-
109
- return () => clearTimeout(timeout);
99
+ useAsyncEffect(async () => {
100
+ if (runningProp) {
101
+ // This handles the case when the target is not yet in the document.
102
+ // If the target is not in the document, when the joyride is turned on, it will not show the tooltip.
103
+ await waitForTarget(steps[stepIndex]);
104
+ setStepIndex(0);
105
+ setRunning(true);
106
+ } else if (typeof runningProp !== 'undefined') {
107
+ setRunning(false);
108
+ }
110
109
  }, [runningProp]);
111
110
 
112
111
  // https://docs.react-joyride.com/callback
@@ -164,6 +163,7 @@ export const WelcomeTour = ({ steps: initialSteps, running: runningProp, onRunni
164
163
  callback={callback}
165
164
  floaterProps={floaterProps}
166
165
  tooltipComponent={Tooltip}
166
+ spotlightPadding={0}
167
167
  />
168
168
  </HelpContext.Provider>
169
169
  );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { meta } from '#meta';
6
+
7
+ export const SHORTCUTS_DIALOG = `${meta.id}.ShortcutsDialog`;
@@ -0,0 +1,39 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import React from 'react';
7
+
8
+ import { withPluginManager } from '@dxos/app-framework/testing';
9
+ import { Dialog } from '@dxos/react-ui';
10
+ import { withTheme } from '@dxos/react-ui/testing';
11
+
12
+ import { translations } from '#translations';
13
+
14
+ import { ShortcutsDialogContent } from './ShortcutsDialogContent';
15
+
16
+ const DefaultStory = () => (
17
+ <Dialog.Root defaultOpen>
18
+ <Dialog.Overlay>
19
+ <ShortcutsDialogContent />
20
+ </Dialog.Overlay>
21
+ </Dialog.Root>
22
+ );
23
+
24
+ const meta = {
25
+ title: 'plugins/plugin-help/containers/ShortcutsDialogContent',
26
+ component: ShortcutsDialogContent,
27
+ render: DefaultStory,
28
+ decorators: [withTheme(), withPluginManager()],
29
+ parameters: {
30
+ layout: 'fullscreen',
31
+ translations,
32
+ },
33
+ } satisfies Meta<typeof ShortcutsDialogContent>;
34
+
35
+ export default meta;
36
+
37
+ type Story = StoryObj<typeof meta>;
38
+
39
+ export const Default: Story = {};
@@ -0,0 +1,28 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { Dialog, useTranslation } from '@dxos/react-ui';
8
+
9
+ import { ShortcutsList } from '#components';
10
+ import { meta } from '#meta';
11
+
12
+ export const ShortcutsDialogContent = () => {
13
+ const { t } = useTranslation(meta.id);
14
+
15
+ return (
16
+ <Dialog.Content>
17
+ <Dialog.Header>
18
+ <Dialog.Title>{t('shortcuts-dialog.title')}</Dialog.Title>
19
+ <Dialog.Close asChild>
20
+ <Dialog.CloseIconButton />
21
+ </Dialog.Close>
22
+ </Dialog.Header>
23
+ <Dialog.Body>
24
+ <ShortcutsList />
25
+ </Dialog.Body>
26
+ </Dialog.Content>
27
+ );
28
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ export { ShortcutsDialogContent as default } from './ShortcutsDialogContent';
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ export { ShortcutsHints } from '../../components';
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ export { ShortcutsHints as default } from './ShortcutsHints';
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export { ShortcutsList } from '../../components';
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export { ShortcutsList as default } from './ShortcutsList';
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { type ComponentType, lazy } from 'react';
6
+
7
+ export const ShortcutsDialogContent: ComponentType<any> = lazy(() => import('./ShortcutsDialogContent'));
8
+ export const ShortcutsHints: ComponentType<any> = lazy(() => import('./ShortcutsHints'));
9
+ export const ShortcutsList: ComponentType<any> = lazy(() => import('./ShortcutsList'));
@@ -6,7 +6,7 @@ import { useContext } from 'react';
6
6
 
7
7
  import { raise } from '@dxos/debug';
8
8
 
9
- import { HelpContext } from '../types';
9
+ import { HelpContext } from '#types';
10
10
 
11
11
  export const useHelp = () => {
12
12
  return useContext(HelpContext) ?? raise(new Error('Missing HelpContext'));
package/src/index.ts CHANGED
@@ -2,9 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export { HelpCapabilities } from './capabilities';
6
- export * from './components';
5
+ export * from './constants';
7
6
  export * from './meta';
8
- export * from './HelpPlugin';
9
- export * from './hooks';
7
+ export * from './operations';
10
8
  export * from './types';
package/src/meta.ts CHANGED
@@ -2,13 +2,16 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginMeta } from '@dxos/app-framework';
5
+ import { type Plugin } from '@dxos/app-framework';
6
+ import { trim } from '@dxos/util';
6
7
 
7
- // TODO(burdon): Rename Guide? Help?
8
- export const HELP_PLUGIN = 'dxos.org/plugin/help';
9
-
10
- export const meta: PluginMeta = {
11
- id: HELP_PLUGIN,
8
+ export const meta: Plugin.Meta = {
9
+ id: 'org.dxos.plugin.help',
12
10
  name: 'Help',
11
+ description: trim`
12
+ Built-in help system with documentation, tutorials, and contextual assistance.
13
+ Access keyboard shortcuts, feature guides, and support resources.
14
+ `,
13
15
  icon: 'ph--info--regular',
16
+ tags: ['system'],
14
17
  };
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { OperationHandlerSet } from '@dxos/compute';
6
+
7
+ export const HelpOperationHandlerSet = OperationHandlerSet.lazy(() => import('./start'));
@@ -0,0 +1,20 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities } from '@dxos/app-framework';
8
+ import { Operation } from '@dxos/compute';
9
+
10
+ import { HelpCapabilities, HelpOperation } from '../types';
11
+
12
+ const handler: Operation.WithHandler<typeof HelpOperation.Start> = HelpOperation.Start.pipe(
13
+ Operation.withHandler(
14
+ Effect.fnUntraced(function* () {
15
+ yield* Capabilities.updateAtomValue(HelpCapabilities.State, (state) => ({ ...state, running: true }));
16
+ }),
17
+ ),
18
+ );
19
+
20
+ export default handler;
package/src/plugin.ts ADDED
@@ -0,0 +1,12 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
9
+ export const HelpPlugin = Plugin.lazy(meta, () => import('#plugin'));
10
+ export type { HelpPluginOptions } from '#plugin';
11
+
12
+ export { HelpOperationHandlerSet } from './operations';
@@ -4,16 +4,16 @@
4
4
 
5
5
  import { type Resource } from '@dxos/react-ui';
6
6
 
7
- import { meta } from './meta';
7
+ import { meta } from '#meta';
8
8
 
9
9
  export const translations = [
10
10
  {
11
11
  'en-US': {
12
12
  [meta.id]: {
13
- 'plugin name': 'Help',
14
- 'open help tour': 'Show welcome tour',
15
- 'open shortcuts label': 'Show shortcuts',
16
- 'shortcuts dialog title': 'Shortcuts',
13
+ 'plugin.name': 'Help',
14
+ 'open-help-tour.message': 'Show welcome tour',
15
+ 'open-shortcuts.label': 'Show shortcuts',
16
+ 'shortcuts-dialog.title': 'Shortcuts',
17
17
  },
18
18
  },
19
19
  },
@@ -0,0 +1,24 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ // @import-as-namespace
6
+
7
+ import { type Atom } from '@effect-atom/atom-react';
8
+ import * as Schema from 'effect/Schema';
9
+
10
+ import { Capability } from '@dxos/app-framework';
11
+
12
+ import { meta } from '#meta';
13
+
14
+ export const StateSchema = Schema.mutable(
15
+ Schema.Struct({
16
+ running: Schema.Boolean,
17
+ showHints: Schema.Boolean,
18
+ showWelcome: Schema.Boolean,
19
+ }),
20
+ );
21
+
22
+ export type State = Schema.Schema.Type<typeof StateSchema>;
23
+
24
+ export const State = Capability.make<Atom.Writable<State>>(`${meta.id}.capability.state`);
@@ -0,0 +1,21 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ // @import-as-namespace
6
+
7
+ import * as Schema from 'effect/Schema';
8
+
9
+ import { Capability } from '@dxos/app-framework';
10
+ import { Operation } from '@dxos/compute';
11
+
12
+ import { meta } from '#meta';
13
+
14
+ const HELP_OPERATION = `${meta.id}.operation`;
15
+
16
+ export const Start = Operation.make({
17
+ meta: { key: `${HELP_OPERATION}.start`, name: 'Start Help' },
18
+ services: [Capability.Service],
19
+ input: Schema.Void,
20
+ output: Schema.Void,
21
+ });
@@ -2,4 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ export * as HelpCapabilities from './HelpCapabilities';
6
+ export * as HelpOperation from './HelpOperation';
5
7
  export * from './schema';
@@ -2,16 +2,13 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import { type Context, createContext } from 'react';
7
6
  import { type Step as BaseStep } from 'react-joyride';
8
7
 
9
- import { type PluginContext } from '@dxos/app-framework';
10
-
11
- import { meta } from '../meta';
8
+ import { type CapabilityManager } from '@dxos/app-framework';
12
9
 
13
10
  export type Step = BaseStep & {
14
- before?: (context: PluginContext) => void;
11
+ before?: (capabilities: CapabilityManager.CapabilityManager) => void;
15
12
  };
16
13
 
17
14
  export type HelpContextType = {
@@ -31,10 +28,3 @@ export const HelpContext: Context<HelpContextType> = createContext<HelpContextTy
31
28
  start: () => {},
32
29
  stop: () => {},
33
30
  });
34
-
35
- export namespace HelpAction {
36
- export class Start extends Schema.TaggedClass<Start>()(`${meta.id}/action/start`, {
37
- input: Schema.Void,
38
- output: Schema.Void,
39
- }) {}
40
- }