@dxos/plugin-help 0.8.4-main.f9ba587 → 0.8.4-main.fcc0d83b33

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 (166) hide show
  1. package/dist/lib/browser/chunk-53QC3FTJ.mjs +34 -0
  2. package/dist/lib/browser/chunk-53QC3FTJ.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  4. package/dist/lib/browser/chunk-RWK34XL5.mjs +31 -0
  5. package/dist/lib/browser/chunk-RWK34XL5.mjs.map +7 -0
  6. package/dist/lib/browser/index.mjs +347 -85
  7. package/dist/lib/browser/index.mjs.map +4 -4
  8. package/dist/lib/browser/meta.json +1 -1
  9. package/dist/lib/browser/meta.mjs +13 -5
  10. package/dist/lib/browser/meta.mjs.map +4 -4
  11. package/dist/lib/browser/operations/index.mjs +13 -0
  12. package/dist/lib/browser/operations/index.mjs.map +7 -0
  13. package/dist/lib/browser/start-JQ2LLVCT.mjs +23 -0
  14. package/dist/lib/browser/start-JQ2LLVCT.mjs.map +7 -0
  15. package/dist/lib/browser/translations.mjs +20 -0
  16. package/dist/lib/browser/translations.mjs.map +7 -0
  17. package/dist/lib/browser/types/index.mjs +10 -0
  18. package/dist/types/src/HelpPlugin.d.ts +3 -2
  19. package/dist/types/src/HelpPlugin.d.ts.map +1 -1
  20. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  21. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  22. package/dist/types/src/capabilities/index.d.ts +16 -6
  23. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  25. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  26. package/dist/types/src/capabilities/react-root.d.ts +5 -3
  27. package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
  28. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  29. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  30. package/dist/types/src/capabilities/state.d.ts +11 -2
  31. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  32. package/dist/types/src/components/Shortcuts/Key.d.ts.map +1 -1
  33. package/dist/types/src/components/Shortcuts/ShortcutsHints.d.ts.map +1 -1
  34. package/dist/types/src/components/Shortcuts/ShortcutsList.d.ts.map +1 -1
  35. package/dist/types/src/components/Shortcuts/ShortcutsSection.d.ts.map +1 -1
  36. package/dist/types/src/components/Shortcuts/index.d.ts +0 -1
  37. package/dist/types/src/components/Shortcuts/index.d.ts.map +1 -1
  38. package/dist/types/src/components/Tooltip/Tooltip.d.ts +9 -9
  39. package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  40. package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts +1 -1
  41. package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts.map +1 -1
  42. package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts +9 -4
  43. package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts.map +1 -1
  44. package/dist/types/src/constants.d.ts +2 -0
  45. package/dist/types/src/constants.d.ts.map +1 -0
  46. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts +3 -0
  47. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts.map +1 -0
  48. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.d.ts +25 -0
  49. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.d.ts.map +1 -0
  50. package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts +2 -0
  51. package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts.map +1 -0
  52. package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts +2 -0
  53. package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts.map +1 -0
  54. package/dist/types/src/containers/ShortcutsHints/index.d.ts +2 -0
  55. package/dist/types/src/containers/ShortcutsHints/index.d.ts.map +1 -0
  56. package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts +2 -0
  57. package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts.map +1 -0
  58. package/dist/types/src/containers/ShortcutsList/index.d.ts +2 -0
  59. package/dist/types/src/containers/ShortcutsList/index.d.ts.map +1 -0
  60. package/dist/types/src/containers/index.d.ts +5 -0
  61. package/dist/types/src/containers/index.d.ts.map +1 -0
  62. package/dist/types/src/hooks/useHelp.d.ts +1 -1
  63. package/dist/types/src/hooks/useHelp.d.ts.map +1 -1
  64. package/dist/types/src/index.d.ts +2 -3
  65. package/dist/types/src/index.d.ts.map +1 -1
  66. package/dist/types/src/meta.d.ts +2 -3
  67. package/dist/types/src/meta.d.ts.map +1 -1
  68. package/dist/types/src/operations/definitions.d.ts +4 -0
  69. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  70. package/dist/types/src/operations/index.d.ts +4 -0
  71. package/dist/types/src/operations/index.d.ts.map +1 -0
  72. package/dist/types/src/operations/start.d.ts +5 -0
  73. package/dist/types/src/operations/start.d.ts.map +1 -0
  74. package/dist/types/src/translations.d.ts +5 -6
  75. package/dist/types/src/translations.d.ts.map +1 -1
  76. package/dist/types/src/types/capabilities.d.ts +21 -0
  77. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  78. package/dist/types/src/types/index.d.ts +3 -0
  79. package/dist/types/src/types/index.d.ts.map +1 -0
  80. package/dist/types/src/types/schema.d.ts +16 -0
  81. package/dist/types/src/types/schema.d.ts.map +1 -0
  82. package/dist/types/tsconfig.tsbuildinfo +1 -1
  83. package/package.json +66 -48
  84. package/src/HelpPlugin.tsx +22 -49
  85. package/src/capabilities/app-graph-builder.ts +54 -67
  86. package/src/capabilities/index.ts +10 -7
  87. package/src/capabilities/operation-handler.ts +16 -0
  88. package/src/capabilities/react-root.tsx +28 -24
  89. package/src/capabilities/react-surface.tsx +28 -22
  90. package/src/capabilities/state.ts +19 -15
  91. package/src/components/Shortcuts/ShortcutsHints.tsx +13 -5
  92. package/src/components/Shortcuts/ShortcutsList.tsx +6 -5
  93. package/src/components/Shortcuts/ShortcutsSection.tsx +1 -3
  94. package/src/components/Shortcuts/index.ts +0 -1
  95. package/src/components/Shortcuts/styles.ts +3 -3
  96. package/src/components/Tooltip/Tooltip.tsx +31 -30
  97. package/src/components/WelcomeTour/WelcomeTour.stories.tsx +27 -22
  98. package/src/components/WelcomeTour/WelcomeTour.tsx +19 -19
  99. package/src/constants.ts +7 -0
  100. package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.tsx +39 -0
  101. package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.tsx +28 -0
  102. package/src/containers/ShortcutsDialogContent/index.ts +5 -0
  103. package/src/containers/ShortcutsHints/ShortcutsHints.tsx +5 -0
  104. package/src/containers/ShortcutsHints/index.ts +5 -0
  105. package/src/containers/ShortcutsList/ShortcutsList.tsx +5 -0
  106. package/src/containers/ShortcutsList/index.ts +5 -0
  107. package/src/containers/index.ts +9 -0
  108. package/src/hooks/useHelp.tsx +1 -1
  109. package/src/index.ts +2 -3
  110. package/src/meta.ts +8 -6
  111. package/src/operations/definitions.ts +19 -0
  112. package/src/operations/index.ts +9 -0
  113. package/src/operations/start.ts +21 -0
  114. package/src/translations.ts +5 -5
  115. package/src/types/capabilities.ts +24 -0
  116. package/src/types/index.ts +6 -0
  117. package/src/{types.ts → types/schema.ts} +2 -13
  118. package/dist/lib/browser/app-graph-builder-IXCF4ZDE.mjs +0 -79
  119. package/dist/lib/browser/app-graph-builder-IXCF4ZDE.mjs.map +0 -7
  120. package/dist/lib/browser/chunk-27RZVOIE.mjs +0 -408
  121. package/dist/lib/browser/chunk-27RZVOIE.mjs.map +0 -7
  122. package/dist/lib/browser/chunk-3Y4CMOZP.mjs +0 -13
  123. package/dist/lib/browser/chunk-3Y4CMOZP.mjs.map +0 -7
  124. package/dist/lib/browser/chunk-LDRUZNSN.mjs +0 -16
  125. package/dist/lib/browser/chunk-LDRUZNSN.mjs.map +0 -7
  126. package/dist/lib/browser/chunk-WAN2NFYE.mjs +0 -36
  127. package/dist/lib/browser/chunk-WAN2NFYE.mjs.map +0 -7
  128. package/dist/lib/browser/react-root-A32LXEU4.mjs +0 -34
  129. package/dist/lib/browser/react-root-A32LXEU4.mjs.map +0 -7
  130. package/dist/lib/browser/react-surface-DIIOUUMT.mjs +0 -36
  131. package/dist/lib/browser/react-surface-DIIOUUMT.mjs.map +0 -7
  132. package/dist/lib/browser/state-FWUZG6NL.mjs +0 -29
  133. package/dist/lib/browser/state-FWUZG6NL.mjs.map +0 -7
  134. package/dist/lib/browser/types.mjs +0 -12
  135. package/dist/lib/node-esm/app-graph-builder-5QQRWRWG.mjs +0 -80
  136. package/dist/lib/node-esm/app-graph-builder-5QQRWRWG.mjs.map +0 -7
  137. package/dist/lib/node-esm/chunk-6JMO5FFN.mjs +0 -37
  138. package/dist/lib/node-esm/chunk-6JMO5FFN.mjs.map +0 -7
  139. package/dist/lib/node-esm/chunk-CXQ5LKQI.mjs +0 -17
  140. package/dist/lib/node-esm/chunk-CXQ5LKQI.mjs.map +0 -7
  141. package/dist/lib/node-esm/chunk-PU7X4MJO.mjs +0 -409
  142. package/dist/lib/node-esm/chunk-PU7X4MJO.mjs.map +0 -7
  143. package/dist/lib/node-esm/chunk-T523OGIV.mjs +0 -15
  144. package/dist/lib/node-esm/chunk-T523OGIV.mjs.map +0 -7
  145. package/dist/lib/node-esm/index.mjs +0 -115
  146. package/dist/lib/node-esm/index.mjs.map +0 -7
  147. package/dist/lib/node-esm/meta.json +0 -1
  148. package/dist/lib/node-esm/meta.mjs +0 -10
  149. package/dist/lib/node-esm/react-root-Q6PGYYYP.mjs +0 -35
  150. package/dist/lib/node-esm/react-root-Q6PGYYYP.mjs.map +0 -7
  151. package/dist/lib/node-esm/react-surface-QEIKNNW3.mjs +0 -37
  152. package/dist/lib/node-esm/react-surface-QEIKNNW3.mjs.map +0 -7
  153. package/dist/lib/node-esm/state-Y476FGII.mjs +0 -30
  154. package/dist/lib/node-esm/state-Y476FGII.mjs.map +0 -7
  155. package/dist/lib/node-esm/types.mjs +0 -13
  156. package/dist/lib/node-esm/types.mjs.map +0 -7
  157. package/dist/types/src/capabilities/capabilities.d.ts +0 -10
  158. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  159. package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts +0 -4
  160. package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts.map +0 -1
  161. package/dist/types/src/types.d.ts +0 -29
  162. package/dist/types/src/types.d.ts.map +0 -1
  163. package/src/capabilities/capabilities.ts +0 -13
  164. package/src/components/Shortcuts/ShortcutsDialog.tsx +0 -34
  165. /package/dist/lib/browser/{types.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  166. /package/dist/lib/{node-esm/meta.mjs.map → browser/types/index.mjs.map} +0 -0
@@ -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
  );
@@ -3,18 +3,16 @@
3
3
  //
4
4
 
5
5
  import { useArrowNavigationGroup, useFocusableGroup } from '@fluentui/react-tabster';
6
- import { CaretLeft, CaretRight, Circle, X } from '@phosphor-icons/react';
7
6
  import React, { forwardRef } from 'react';
8
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.
9
8
  // eslint-disable-next-line unused-imports/no-unused-imports
10
9
  import _floater from 'react-floater';
11
- import { type TooltipRenderProps, type Props } from 'react-joyride';
10
+ import { type Props, type TooltipRenderProps } from 'react-joyride';
12
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.
13
12
  // eslint-disable-next-line unused-imports/no-unused-imports
14
13
  import _typefest from 'type-fest';
15
14
 
16
- import { Button } from '@dxos/react-ui';
17
- import { getSize, mx } from '@dxos/react-ui-theme';
15
+ import { Button, Icon, IconButton } from '@dxos/react-ui';
18
16
 
19
17
  // https://docs.react-joyride.com/styling
20
18
  // https://github.com/gilbarbara/react-floater
@@ -40,7 +38,7 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipRenderProps>(
40
38
 
41
39
  return (
42
40
  <div
43
- 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'
44
42
  role='tooltip'
45
43
  data-testid='helpPlugin.tooltip'
46
44
  data-step={index + 1}
@@ -48,37 +46,39 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipRenderProps>(
48
46
  ref={forwardedRef}
49
47
  >
50
48
  <div className='flex p-2'>
51
- <h2 className='grow pli-2 plb-1 text-lg font-medium text-accentSurfaceText'>{title}</h2>
52
- <Button
49
+ <h2 className='grow px-2 py-1 text-lg font-medium text-accent-surface-text'>{title}</h2>
50
+ <IconButton
53
51
  density='fine'
54
- variant='primary'
52
+ icon='ph--x--bold'
53
+ iconOnly
54
+ label={closeProps['aria-label']}
55
55
  onClick={closeProps.onClick}
56
- title={closeProps['aria-label']}
56
+ size={4}
57
+ variant='primary'
57
58
  data-testid='helpPlugin.tooltip.close'
58
- >
59
- <X weight='bold' className={getSize(4)} />
60
- </Button>
59
+ />
61
60
  </div>
62
- <div className='flex grow pli-4 mlb-2'>{content}</div>
61
+ <div className='flex grow px-4 my-2'>{content}</div>
63
62
  <div className='flex p-2 items-center justify-between' {...arrowNavigationAttrs}>
64
63
  {
65
- <Button
66
- variant='primary'
67
- onClick={backProps.onClick}
68
- title={backProps['aria-label']}
64
+ <IconButton
69
65
  classNames={[!(index > 0 && backProps) && 'invisible']}
66
+ icon='ph--caret-left--regular'
67
+ iconOnly
68
+ label={backProps['aria-label']}
69
+ onClick={backProps.onClick}
70
+ variant='primary'
70
71
  data-testid='helpPlugin.tooltip.back'
71
- >
72
- <CaretLeft className={getSize(5)} />
73
- </Button>
72
+ />
74
73
  }
75
74
  <div className='flex grow gap-2 justify-center'>
76
75
  <div className='flex'>
77
76
  {Array.from({ length: size }).map((_, i) => (
78
- <Circle
77
+ <Icon
79
78
  key={i}
80
- weight={index === i ? 'fill' : 'regular'}
81
- className={mx(getSize(2), 'mli-1 cursor-pointer')}
79
+ icon={index === i ? 'ph--circle--fill' : 'ph--circle--regular'}
80
+ size={2}
81
+ classNames='mx-1 cursor-pointer'
82
82
  />
83
83
  ))}
84
84
  </div>
@@ -94,15 +94,16 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipRenderProps>(
94
94
  Done
95
95
  </Button>
96
96
  ) : (
97
- <Button
98
- variant='primary'
99
- onClick={primaryProps.onClick}
100
- title={primaryProps['aria-label']}
97
+ <IconButton
101
98
  autoFocus
99
+ icon='ph--caret-right--regular'
100
+ iconOnly
101
+ label={primaryProps['aria-label']}
102
+ onClick={primaryProps.onClick}
103
+ size={6}
104
+ variant='primary'
102
105
  data-testid='helpPlugin.tooltip.next'
103
- >
104
- <CaretRight className={getSize(6)} />
105
- </Button>
106
+ />
106
107
  )}
107
108
  </div>
108
109
  </div>
@@ -2,24 +2,24 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
- import { Circle } from '@phosphor-icons/react';
8
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
9
6
  import React, { useState } from 'react';
10
7
 
11
- import { faker } from '@dxos/random';
12
- import { Button } from '@dxos/react-ui';
13
- import { withTheme } from '@dxos/storybook-utils';
8
+ import { withPluginManager } from '@dxos/app-framework/testing';
9
+ import { StorybookPlugin } from '@dxos/plugin-testing';
10
+ import { random } from '@dxos/random';
11
+ import { Button, Icon } from '@dxos/react-ui';
12
+ import { withTheme } from '@dxos/react-ui/testing';
13
+
14
+ import { useHelp } from '#hooks';
14
15
 
15
16
  import { WelcomeTour, type WelcomeTourProps } from './WelcomeTour';
16
- import { useHelp } from '../../hooks';
17
17
 
18
18
  const App = () => {
19
19
  const { running, start } = useHelp();
20
- 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()));
21
21
  const handleAdd = () => {
22
- setItems((items) => [...items, faker.lorem.sentence()]);
22
+ setItems((items) => [...items, random.lorem.sentence()]);
23
23
  };
24
24
 
25
25
  return (
@@ -32,10 +32,10 @@ const App = () => {
32
32
  <div>{String(running)}</div>
33
33
  </div>
34
34
  <div>
35
- <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'>
36
36
  {items.map((item, i) => (
37
37
  <li key={i} className='flex items-center gap-2'>
38
- <Circle />
38
+ <Icon icon='ph--circle--regular' />
39
39
  <span>{item}</span>
40
40
  </li>
41
41
  ))}
@@ -49,9 +49,9 @@ const App = () => {
49
49
  <div className='flex grow' />
50
50
  <div className='flex items-center py-2'>
51
51
  <div className='grow' />
52
- <Circle data-joyride='basic/4' />
53
- <Circle />
54
- <Circle />
52
+ <Icon icon='ph--circle--regular' data-joyride='basic/4' />
53
+ <Icon icon='ph--circle--regular' />
54
+ <Icon icon='ph--circle--regular' />
55
55
  </div>
56
56
  </div>
57
57
  );
@@ -76,25 +76,25 @@ export const Default: StoryObj<typeof WelcomeTour> = {
76
76
  {
77
77
  target: '[data-joyride="basic/1"]',
78
78
  title: 'plugins/Step 1',
79
- content: faker.lorem.paragraph(),
79
+ content: random.lorem.paragraph(),
80
80
  disableBeacon: true,
81
81
  placement: 'right',
82
82
  },
83
83
  {
84
84
  target: '[data-joyride="basic/2"]',
85
85
  title: 'plugins/Step 2',
86
- content: faker.lorem.paragraph(),
86
+ content: random.lorem.paragraph(),
87
87
  },
88
88
  {
89
89
  target: '[data-joyride="basic/3"]',
90
90
  title: 'plugins/Step 3',
91
- content: faker.lorem.paragraph(),
91
+ content: random.lorem.paragraph(),
92
92
  placement: 'right',
93
93
  },
94
94
  {
95
95
  target: '[data-joyride="basic/4"]',
96
96
  title: 'plugins/Step 4',
97
- content: faker.lorem.paragraph(),
97
+ content: random.lorem.paragraph(),
98
98
  placement: 'top-end',
99
99
  },
100
100
  ],
@@ -104,11 +104,16 @@ export const Default: StoryObj<typeof WelcomeTour> = {
104
104
  /**
105
105
  * IMPORTANT: Run in separate tab.
106
106
  */
107
- const meta: Meta<typeof WelcomeTour> = {
108
- title: 'plugins/plugin-help/WelcomeTour',
107
+ const meta = {
108
+ title: 'plugins/plugin-help/components/WelcomeTour',
109
109
  component: WelcomeTour,
110
110
  render: DefaultStory,
111
- decorators: [withTheme],
112
- };
111
+ decorators: [
112
+ withTheme(),
113
+ withPluginManager({
114
+ plugins: [StorybookPlugin({})],
115
+ }),
116
+ ],
117
+ } satisfies Meta<typeof WelcomeTour>;
113
118
 
114
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,8 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export { HelpCapabilities } from './capabilities';
5
+ export { HelpCapabilities } from './types';
6
6
  export * from './components';
7
- export * from './meta';
7
+ export * from './constants';
8
8
  export * from './HelpPlugin';
9
9
  export * from './hooks';
10
- export * from './types';
package/src/meta.ts CHANGED
@@ -2,13 +2,15 @@
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',
14
16
  };
@@ -0,0 +1,19 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Schema from 'effect/Schema';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { Operation } from '@dxos/compute';
9
+
10
+ import { meta } from '#meta';
11
+
12
+ const HELP_OPERATION = `${meta.id}.operation`;
13
+
14
+ export const Start = Operation.make({
15
+ meta: { key: `${HELP_OPERATION}.start`, name: 'Start Help' },
16
+ services: [Capability.Service],
17
+ input: Schema.Void,
18
+ output: Schema.Void,
19
+ });
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { OperationHandlerSet } from '@dxos/compute';
6
+
7
+ export * as HelpOperation from './definitions';
8
+
9
+ export const HelpOperationHandlerSet = OperationHandlerSet.lazy(() => import('./start'));
@@ -0,0 +1,21 @@
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 } from '../types';
11
+ import { Start } from './definitions';
12
+
13
+ const handler: Operation.WithHandler<typeof Start> = Start.pipe(
14
+ Operation.withHandler(
15
+ Effect.fnUntraced(function* () {
16
+ yield* Capabilities.updateAtomValue(HelpCapabilities.State, (state) => ({ ...state, running: true }));
17
+ }),
18
+ ),
19
+ );
20
+
21
+ export default handler;
@@ -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 { type Atom } from '@effect-atom/atom-react';
6
+ import * as Schema from 'effect/Schema';
7
+
8
+ import { Capability } from '@dxos/app-framework';
9
+
10
+ import { meta } from '#meta';
11
+
12
+ export namespace HelpCapabilities {
13
+ export const StateSchema = Schema.mutable(
14
+ Schema.Struct({
15
+ running: Schema.Boolean,
16
+ showHints: Schema.Boolean,
17
+ showWelcome: Schema.Boolean,
18
+ }),
19
+ );
20
+
21
+ export type State = Schema.Schema.Type<typeof StateSchema>;
22
+
23
+ export const State = Capability.make<Atom.Writable<State>>(`${meta.id}.capability.state`);
24
+ }
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './capabilities';
6
+ 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 { HELP_PLUGIN } 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,11 +28,3 @@ export const HelpContext: Context<HelpContextType> = createContext<HelpContextTy
31
28
  start: () => {},
32
29
  stop: () => {},
33
30
  });
34
-
35
- export const HELP_ACTION = `${HELP_PLUGIN}/action`;
36
- export namespace HelpAction {
37
- export class Start extends Schema.TaggedClass<Start>()(`${HELP_ACTION}/start`, {
38
- input: Schema.Void,
39
- output: Schema.Void,
40
- }) {}
41
- }