@dxos/plugin-help 0.8.4-main.7ace549 → 0.8.4-main.8360d9e660

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 (149) hide show
  1. package/dist/lib/browser/ShortcutsDialogContent-SFEN5YKG.mjs +36 -0
  2. package/dist/lib/browser/ShortcutsDialogContent-SFEN5YKG.mjs.map +7 -0
  3. package/dist/lib/browser/ShortcutsHints-SUH2FE3T.mjs +12 -0
  4. package/dist/lib/browser/ShortcutsHints-SUH2FE3T.mjs.map +7 -0
  5. package/dist/lib/browser/ShortcutsList-4YPEJM33.mjs +12 -0
  6. package/dist/lib/browser/ShortcutsList-4YPEJM33.mjs.map +7 -0
  7. package/dist/lib/browser/app-graph-builder-5RXPFQPI.mjs +79 -0
  8. package/dist/lib/browser/app-graph-builder-5RXPFQPI.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-HMLZFBYY.mjs +58 -0
  10. package/dist/lib/browser/chunk-HMLZFBYY.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-P34WCEMS.mjs +11 -0
  12. package/dist/lib/browser/chunk-P34WCEMS.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-BCYK4LXW.mjs → chunk-TEXIV2IJ.mjs} +2 -2
  14. package/dist/lib/browser/chunk-TEXIV2IJ.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-VGW5FGD7.mjs +335 -0
  16. package/dist/lib/browser/chunk-VGW5FGD7.mjs.map +7 -0
  17. package/dist/lib/browser/index.mjs +62 -58
  18. package/dist/lib/browser/index.mjs.map +4 -4
  19. package/dist/lib/browser/meta.json +1 -1
  20. package/dist/lib/browser/meta.mjs +1 -1
  21. package/dist/lib/browser/react-root-JBHEZA5U.mjs +43 -0
  22. package/dist/lib/browser/react-root-JBHEZA5U.mjs.map +7 -0
  23. package/dist/lib/browser/react-surface-W5S45O6Y.mjs +42 -0
  24. package/dist/lib/browser/react-surface-W5S45O6Y.mjs.map +7 -0
  25. package/dist/lib/browser/state-SEPP77HO.mjs +27 -0
  26. package/dist/lib/browser/state-SEPP77HO.mjs.map +7 -0
  27. package/dist/lib/browser/types/index.mjs +8 -6
  28. package/dist/types/src/HelpPlugin.d.ts +2 -1
  29. package/dist/types/src/HelpPlugin.d.ts.map +1 -1
  30. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  31. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  32. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  33. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  34. package/dist/types/src/capabilities/index.d.ts +5 -8
  35. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/operation-resolver/index.d.ts +2 -0
  37. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  38. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  39. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  40. package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
  41. package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
  42. package/dist/types/src/capabilities/react-root/react-root.d.ts +10 -0
  43. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
  44. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  45. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  46. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  47. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  48. package/dist/types/src/capabilities/state/index.d.ts +11 -0
  49. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  50. package/dist/types/src/capabilities/state/state.d.ts +13 -0
  51. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  52. package/dist/types/src/components/Shortcuts/ShortcutsHints.d.ts.map +1 -1
  53. package/dist/types/src/components/Shortcuts/ShortcutsSection.d.ts.map +1 -1
  54. package/dist/types/src/components/Shortcuts/index.d.ts +0 -1
  55. package/dist/types/src/components/Shortcuts/index.d.ts.map +1 -1
  56. package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts.map +1 -1
  57. package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts.map +1 -1
  58. package/dist/types/src/constants.d.ts +2 -0
  59. package/dist/types/src/constants.d.ts.map +1 -0
  60. package/dist/types/src/{components/Shortcuts/ShortcutsDialog.d.ts → containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts} +1 -2
  61. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts.map +1 -0
  62. package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts +3 -0
  63. package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts.map +1 -0
  64. package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts +2 -0
  65. package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts.map +1 -0
  66. package/dist/types/src/containers/ShortcutsHints/index.d.ts +3 -0
  67. package/dist/types/src/containers/ShortcutsHints/index.d.ts.map +1 -0
  68. package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts +2 -0
  69. package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts.map +1 -0
  70. package/dist/types/src/containers/ShortcutsList/index.d.ts +3 -0
  71. package/dist/types/src/containers/ShortcutsList/index.d.ts.map +1 -0
  72. package/dist/types/src/containers/index.d.ts +5 -0
  73. package/dist/types/src/containers/index.d.ts.map +1 -0
  74. package/dist/types/src/index.d.ts +2 -1
  75. package/dist/types/src/index.d.ts.map +1 -1
  76. package/dist/types/src/meta.d.ts +2 -2
  77. package/dist/types/src/meta.d.ts.map +1 -1
  78. package/dist/types/src/types/capabilities.d.ts +21 -0
  79. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  80. package/dist/types/src/types/index.d.ts +1 -0
  81. package/dist/types/src/types/index.d.ts.map +1 -1
  82. package/dist/types/src/types/schema.d.ts +16 -12
  83. package/dist/types/src/types/schema.d.ts.map +1 -1
  84. package/dist/types/tsconfig.tsbuildinfo +1 -1
  85. package/package.json +40 -35
  86. package/src/HelpPlugin.tsx +17 -42
  87. package/src/capabilities/app-graph-builder/app-graph-builder.ts +61 -0
  88. package/src/capabilities/app-graph-builder/index.ts +7 -0
  89. package/src/capabilities/index.ts +5 -8
  90. package/src/capabilities/operation-resolver/index.ts +5 -0
  91. package/src/capabilities/operation-resolver/operation-resolver.ts +23 -0
  92. package/src/capabilities/react-root/index.ts +7 -0
  93. package/src/capabilities/react-root/react-root.tsx +36 -0
  94. package/src/capabilities/react-surface/index.ts +7 -0
  95. package/src/capabilities/react-surface/react-surface.tsx +36 -0
  96. package/src/capabilities/state/index.ts +7 -0
  97. package/src/capabilities/state/state.ts +27 -0
  98. package/src/components/Shortcuts/ShortcutsHints.tsx +3 -2
  99. package/src/components/Shortcuts/ShortcutsList.tsx +3 -3
  100. package/src/components/Shortcuts/ShortcutsSection.tsx +1 -3
  101. package/src/components/Shortcuts/index.ts +0 -1
  102. package/src/components/Shortcuts/styles.ts +3 -3
  103. package/src/components/Tooltip/Tooltip.tsx +4 -4
  104. package/src/components/WelcomeTour/WelcomeTour.stories.tsx +13 -9
  105. package/src/components/WelcomeTour/WelcomeTour.tsx +3 -2
  106. package/src/constants.ts +7 -0
  107. package/src/{components/Shortcuts/ShortcutsDialog.tsx → containers/ShortcutsDialogContent/ShortcutsDialogContent.tsx} +3 -6
  108. package/src/containers/ShortcutsDialogContent/index.ts +7 -0
  109. package/src/containers/ShortcutsHints/ShortcutsHints.tsx +5 -0
  110. package/src/containers/ShortcutsHints/index.ts +7 -0
  111. package/src/containers/ShortcutsList/ShortcutsList.tsx +5 -0
  112. package/src/containers/ShortcutsList/index.ts +7 -0
  113. package/src/containers/index.ts +9 -0
  114. package/src/index.ts +2 -1
  115. package/src/meta.ts +3 -3
  116. package/src/types/capabilities.ts +24 -0
  117. package/src/types/index.ts +1 -0
  118. package/src/types/schema.ts +11 -7
  119. package/dist/lib/browser/app-graph-builder-L6GUMAIH.mjs +0 -80
  120. package/dist/lib/browser/app-graph-builder-L6GUMAIH.mjs.map +0 -7
  121. package/dist/lib/browser/chunk-AZJJLAG7.mjs +0 -16
  122. package/dist/lib/browser/chunk-AZJJLAG7.mjs.map +0 -7
  123. package/dist/lib/browser/chunk-BCYK4LXW.mjs.map +0 -7
  124. package/dist/lib/browser/chunk-I7FKM6VC.mjs +0 -34
  125. package/dist/lib/browser/chunk-I7FKM6VC.mjs.map +0 -7
  126. package/dist/lib/browser/chunk-W4AUSEGO.mjs +0 -408
  127. package/dist/lib/browser/chunk-W4AUSEGO.mjs.map +0 -7
  128. package/dist/lib/browser/react-root-QJH33RNI.mjs +0 -35
  129. package/dist/lib/browser/react-root-QJH33RNI.mjs.map +0 -7
  130. package/dist/lib/browser/react-surface-OTMERRAV.mjs +0 -36
  131. package/dist/lib/browser/react-surface-OTMERRAV.mjs.map +0 -7
  132. package/dist/lib/browser/state-5PVJCYWJ.mjs +0 -29
  133. package/dist/lib/browser/state-5PVJCYWJ.mjs.map +0 -7
  134. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  135. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  136. package/dist/types/src/capabilities/capabilities.d.ts +0 -10
  137. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  138. package/dist/types/src/capabilities/react-root.d.ts +0 -8
  139. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  140. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  141. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  142. package/dist/types/src/capabilities/state.d.ts +0 -4
  143. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  144. package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts.map +0 -1
  145. package/src/capabilities/app-graph-builder.ts +0 -78
  146. package/src/capabilities/capabilities.ts +0 -13
  147. package/src/capabilities/react-root.tsx +0 -34
  148. package/src/capabilities/react-surface.tsx +0 -30
  149. package/src/capabilities/state.ts +0 -24
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@dxos/plugin-help",
3
- "version": "0.8.4-main.7ace549",
3
+ "version": "0.8.4-main.8360d9e660",
4
4
  "description": "Help plugin.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
7
11
  "license": "MIT",
8
12
  "author": "DXOS.org",
9
13
  "sideEffects": true,
@@ -41,47 +45,48 @@
41
45
  "src"
42
46
  ],
43
47
  "dependencies": {
44
- "@fluentui/react-tabster": "^9.24.2",
45
- "@preact-signals/safe-react": "^0.9.0",
48
+ "@effect-atom/atom": "^0.5.1",
49
+ "@fluentui/react-tabster": "9.26.11",
46
50
  "react-joyride": "^2.7.2",
47
- "@dxos/app-framework": "0.8.4-main.7ace549",
48
- "@dxos/app-graph": "0.8.4-main.7ace549",
49
- "@dxos/echo": "0.8.4-main.7ace549",
50
- "@dxos/keyboard": "0.8.4-main.7ace549",
51
- "@dxos/debug": "0.8.4-main.7ace549",
52
- "@dxos/live-object": "0.8.4-main.7ace549",
53
- "@dxos/local-storage": "0.8.4-main.7ace549",
54
- "@dxos/plugin-client": "0.8.4-main.7ace549",
55
- "@dxos/plugin-graph": "0.8.4-main.7ace549",
56
- "@dxos/plugin-space": "0.8.4-main.7ace549",
57
- "@dxos/react-client": "0.8.4-main.7ace549",
58
- "@dxos/util": "0.8.4-main.7ace549"
51
+ "@dxos/app-framework": "0.8.4-main.8360d9e660",
52
+ "@dxos/app-graph": "0.8.4-main.8360d9e660",
53
+ "@dxos/debug": "0.8.4-main.8360d9e660",
54
+ "@dxos/keyboard": "0.8.4-main.8360d9e660",
55
+ "@dxos/app-toolkit": "0.8.4-main.8360d9e660",
56
+ "@dxos/effect": "0.8.4-main.8360d9e660",
57
+ "@dxos/operation": "0.8.4-main.8360d9e660",
58
+ "@dxos/plugin-client": "0.8.4-main.8360d9e660",
59
+ "@dxos/echo": "0.8.4-main.8360d9e660",
60
+ "@dxos/plugin-graph": "0.8.4-main.8360d9e660",
61
+ "@dxos/plugin-space": "0.8.4-main.8360d9e660",
62
+ "@dxos/react-client": "0.8.4-main.8360d9e660",
63
+ "@dxos/util": "0.8.4-main.8360d9e660"
59
64
  },
60
65
  "devDependencies": {
61
- "@effect-atom/atom-react": "^0.3.4",
62
- "@effect/platform": "0.92.1",
63
- "@types/react": "~19.2.2",
64
- "@types/react-dom": "~19.2.2",
65
- "effect": "3.18.3",
66
- "react": "~19.2.0",
67
- "react-dom": "~19.2.0",
66
+ "@effect-atom/atom-react": "^0.5.0",
67
+ "@effect/platform": "0.94.4",
68
+ "@types/react": "~19.2.7",
69
+ "@types/react-dom": "~19.2.3",
70
+ "effect": "3.19.16",
71
+ "react": "~19.2.3",
72
+ "react-dom": "~19.2.3",
68
73
  "react-floater": "0.7.9",
69
74
  "type-fest": "4.10.1",
70
- "vite": "7.1.9",
71
- "@dxos/random": "0.8.4-main.7ace549",
72
- "@dxos/react-ui": "0.8.4-main.7ace549",
73
- "@dxos/react-ui-theme": "0.8.4-main.7ace549",
74
- "@dxos/plugin-storybook-layout": "0.8.4-main.7ace549",
75
- "@dxos/storybook-utils": "0.8.4-main.7ace549"
75
+ "vite": "^7.1.11",
76
+ "@dxos/plugin-testing": "0.8.4-main.8360d9e660",
77
+ "@dxos/storybook-utils": "0.8.4-main.8360d9e660",
78
+ "@dxos/ui-theme": "0.8.4-main.8360d9e660",
79
+ "@dxos/react-ui": "0.8.4-main.8360d9e660",
80
+ "@dxos/random": "0.8.4-main.8360d9e660"
76
81
  },
77
82
  "peerDependencies": {
78
- "@effect-atom/atom-react": "^0.3.4",
79
- "@effect/platform": "^0.80.12",
80
- "effect": "^3.13.3",
81
- "react": "^19.0.0",
82
- "react-dom": "^19.0.0",
83
- "@dxos/react-ui-theme": "0.8.4-main.7ace549",
84
- "@dxos/react-ui": "0.8.4-main.7ace549"
83
+ "@effect-atom/atom-react": "^0.5.0",
84
+ "@effect/platform": "0.94.4",
85
+ "effect": "3.19.16",
86
+ "react": "~19.2.3",
87
+ "react-dom": "~19.2.3",
88
+ "@dxos/react-ui": "0.8.4-main.8360d9e660",
89
+ "@dxos/ui-theme": "0.8.4-main.8360d9e660"
85
90
  },
86
91
  "publishConfig": {
87
92
  "access": "public"
@@ -2,54 +2,29 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, Events, contributes, createResolver, defineModule, definePlugin } from '@dxos/app-framework';
5
+ import { ActivationEvents, Plugin } from '@dxos/app-framework';
6
+ import { AppPlugin } from '@dxos/app-toolkit';
6
7
 
7
- import { AppGraphBuilder, HelpCapabilities, HelpState, ReactRoot, ReactSurface } from './capabilities';
8
+ import { AppGraphBuilder, HelpState, OperationResolver, ReactRoot, ReactSurface } from './capabilities';
8
9
  import { meta } from './meta';
9
10
  import { translations } from './translations';
10
- import { HelpAction, type Step } from './types';
11
+ import { type Step } from './types';
11
12
 
12
13
  export type HelpPluginOptions = { steps?: Step[] };
13
14
 
14
- export const HelpPlugin = definePlugin<HelpPluginOptions>(meta, ({ steps = [] }) => [
15
- defineModule({
16
- id: `${meta.id}/module/state`,
17
- activatesOn: Events.Startup,
15
+ export const HelpPlugin = Plugin.define<HelpPluginOptions>(meta).pipe(
16
+ AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
17
+ AppPlugin.addOperationResolverModule({ activate: OperationResolver }),
18
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
19
+ AppPlugin.addTranslationsModule({ translations }),
20
+ Plugin.addModule({
21
+ activatesOn: ActivationEvents.Startup,
18
22
  activate: HelpState,
19
23
  }),
20
- defineModule({
21
- id: `${meta.id}/module/translations`,
22
- activatesOn: Events.SetupTranslations,
23
- activate: () => contributes(Capabilities.Translations, translations),
24
- }),
25
- defineModule({
26
- id: `${meta.id}/module/react-root`,
27
- activatesOn: Events.Startup,
24
+ Plugin.addModule(({ steps = [] }) => ({
25
+ id: 'react-root',
26
+ activatesOn: ActivationEvents.Startup,
28
27
  activate: () => ReactRoot(steps),
29
- }),
30
- defineModule({
31
- id: `${meta.id}/module/react-surface`,
32
- activatesOn: Events.SetupReactSurface,
33
- activate: ReactSurface,
34
- }),
35
- defineModule({
36
- id: `${meta.id}/module/intent-resolver`,
37
- activatesOn: Events.SetupIntentResolver,
38
- activate: (context) =>
39
- contributes(
40
- Capabilities.IntentResolver,
41
- createResolver({
42
- intent: HelpAction.Start,
43
- resolve: () => {
44
- const state = context.getCapability(HelpCapabilities.MutableState);
45
- state.running = true;
46
- },
47
- }),
48
- ),
49
- }),
50
- defineModule({
51
- id: `${meta.id}/module/app-graph-builder`,
52
- activatesOn: Events.SetupAppGraph,
53
- activate: AppGraphBuilder,
54
- }),
55
- ]);
28
+ })),
29
+ Plugin.make,
30
+ );
@@ -0,0 +1,61 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import { GraphBuilder, NodeMatcher } from '@dxos/app-graph';
9
+ import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
10
+ import { Operation } from '@dxos/operation';
11
+
12
+ import { SHORTCUTS_DIALOG } from '../../constants';
13
+ import { meta } from '../../meta';
14
+ import { HelpCapabilities, HelpOperation } from '../../types';
15
+
16
+ export default Capability.makeModule(
17
+ Effect.fnUntraced(function* () {
18
+ const extensions = yield* GraphBuilder.createExtension({
19
+ id: meta.id,
20
+ match: NodeMatcher.whenRoot,
21
+ actions: () =>
22
+ Effect.succeed([
23
+ {
24
+ id: HelpOperation.Start.meta.key,
25
+ data: Effect.fnUntraced(function* () {
26
+ yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({ ...s, showHints: true }));
27
+ yield* Operation.invoke(HelpOperation.Start);
28
+ }),
29
+ properties: {
30
+ label: ['open help tour', { ns: meta.id }],
31
+ icon: 'ph--info--regular',
32
+ keyBinding: {
33
+ macos: 'shift+meta+/',
34
+ windows: 'shift+ctrl+/',
35
+ linux: 'shift+ctrl+?',
36
+ },
37
+ testId: 'helpPlugin.openHelp',
38
+ },
39
+ },
40
+ {
41
+ id: `${meta.id}.open-shortcuts`,
42
+ data: Effect.fnUntraced(function* () {
43
+ yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({ ...s, showHints: true }));
44
+ yield* Operation.invoke(LayoutOperation.UpdateDialog, {
45
+ subject: SHORTCUTS_DIALOG,
46
+ });
47
+ }),
48
+ properties: {
49
+ label: ['open shortcuts label', { ns: meta.id }],
50
+ icon: 'ph--keyboard--regular',
51
+ keyBinding: {
52
+ macos: 'meta+ctrl+/',
53
+ },
54
+ },
55
+ },
56
+ ]),
57
+ });
58
+
59
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
60
+ }),
61
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
@@ -2,11 +2,8 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from '@dxos/app-framework';
6
-
7
- export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
8
- export const ReactRoot = lazy(() => import('./react-root'));
9
- export const ReactSurface = lazy(() => import('./react-surface'));
10
- export const HelpState = lazy(() => import('./state'));
11
-
12
- export * from './capabilities';
5
+ export * from './app-graph-builder';
6
+ export * from './operation-resolver';
7
+ export * from './react-root';
8
+ export * from './react-surface';
9
+ export * from './state';
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { default as OperationResolver } from './operation-resolver';
@@ -0,0 +1,23 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import { OperationResolver } from '@dxos/operation';
9
+
10
+ import { HelpCapabilities, HelpOperation } from '../../types';
11
+
12
+ export default Capability.makeModule(
13
+ Effect.fnUntraced(function* () {
14
+ return Capability.contributes(Capabilities.OperationResolver, [
15
+ OperationResolver.make({
16
+ operation: HelpOperation.Start,
17
+ handler: Effect.fnUntraced(function* () {
18
+ yield* Capabilities.updateAtomValue(HelpCapabilities.State, (state) => ({ ...state, running: true }));
19
+ }),
20
+ }),
21
+ ]);
22
+ }),
23
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ReactRoot = Capability.lazy('ReactRoot', () => import('./react-root'));
@@ -0,0 +1,36 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import React from 'react';
7
+
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { useAtomCapabilityState } from '@dxos/app-framework/ui';
10
+
11
+ import { WelcomeTour } from '../../components';
12
+ import { meta } from '../../meta';
13
+ import { HelpCapabilities, type Step } from '../../types';
14
+
15
+ export default Capability.makeModule(
16
+ Effect.fnUntraced(function* (steps?: Step[]) {
17
+ return Capability.contributes(Capabilities.ReactRoot, {
18
+ id: meta.id,
19
+ root: () => {
20
+ const [state, updateState] = useAtomCapabilityState(HelpCapabilities.State);
21
+ return (
22
+ <WelcomeTour
23
+ steps={steps ?? []}
24
+ running={state.running}
25
+ onRunningChanged={(newState) => {
26
+ updateState((s) => ({ ...s, running: newState }));
27
+ if (!newState) {
28
+ updateState((s) => ({ ...s, showHints: false }));
29
+ }
30
+ }}
31
+ />
32
+ );
33
+ },
34
+ });
35
+ }),
36
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -0,0 +1,36 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import React from 'react';
7
+
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface } from '@dxos/app-framework/ui';
10
+
11
+ import { SHORTCUTS_DIALOG } from '../../constants';
12
+ import { ShortcutsDialogContent, ShortcutsHints, ShortcutsList } from '../../containers';
13
+ import { meta } from '../../meta';
14
+
15
+ export default Capability.makeModule(() =>
16
+ Effect.succeed(
17
+ Capability.contributes(Capabilities.ReactSurface, [
18
+ Surface.create({
19
+ id: `${meta.id}.hints`,
20
+ role: 'hints',
21
+ component: () => <ShortcutsHints />,
22
+ }),
23
+ Surface.create({
24
+ id: `${meta.id}.keyshortcuts`,
25
+ role: 'keyshortcuts',
26
+ component: () => <ShortcutsList />,
27
+ }),
28
+ Surface.create({
29
+ id: SHORTCUTS_DIALOG,
30
+ role: 'dialog',
31
+ filter: (data): data is { component: string } => data.component === SHORTCUTS_DIALOG,
32
+ component: () => <ShortcutsDialogContent />,
33
+ }),
34
+ ]),
35
+ ),
36
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const HelpState = Capability.lazy('HelpState', () => import('./state'));
@@ -0,0 +1,27 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { createKvsStore } from '@dxos/effect';
9
+
10
+ import { meta } from '../../meta';
11
+ import { HelpCapabilities } from '../../types';
12
+
13
+ export default Capability.makeModule(() =>
14
+ Effect.sync(() => {
15
+ const stateAtom = createKvsStore({
16
+ key: meta.id,
17
+ schema: HelpCapabilities.StateSchema,
18
+ defaultValue: () => ({
19
+ running: false,
20
+ showHints: true,
21
+ showWelcome: true,
22
+ }),
23
+ });
24
+
25
+ return Capability.contributes(HelpCapabilities.State, stateAtom);
26
+ }),
27
+ );
@@ -6,11 +6,12 @@ import React from 'react';
6
6
 
7
7
  import { type KeyBinding, Keyboard } from '@dxos/keyboard';
8
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
16
  <div role='none' className='flex items-center gap-2 whitespace-nowrap'>
16
17
  <Key binding={binding.shortcut} />
@@ -26,7 +27,7 @@ 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 pli-2 gap-4'>
30
+ <div role='none' className='flex overflow-hidden px-2 gap-4'>
30
31
  {hints.map((binding) => (
31
32
  <Shortcut key={binding.shortcut} binding={binding} />
32
33
  ))}
@@ -6,7 +6,7 @@ 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
10
 
11
11
  import { meta } from '../../meta';
12
12
 
@@ -22,11 +22,11 @@ export const ShortcutsList = () => {
22
22
  });
23
23
 
24
24
  return (
25
- <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')}>
26
26
  {bindings.map((binding, i) => (
27
27
  <Fragment key={i}>
28
28
  <Key binding={binding.shortcut} />
29
- <span role='definition' className='mis-4' aria-labelledby={binding.shortcut}>
29
+ <span role='definition' className='ms-4' aria-labelledby={binding.shortcut}>
30
30
  {toLocalizedString(binding.data, t)}
31
31
  </span>
32
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
  );
@@ -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
@@ -78,7 +78,7 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipRenderProps>(
78
78
  key={i}
79
79
  icon={index === i ? 'ph--circle--fill' : 'ph--circle--regular'}
80
80
  size={2}
81
- classNames='mli-1 cursor-pointer'
81
+ classNames='mx-1 cursor-pointer'
82
82
  />
83
83
  ))}
84
84
  </div>
@@ -6,7 +6,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useState } from 'react';
7
7
 
8
8
  import { withPluginManager } from '@dxos/app-framework/testing';
9
- import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
9
+ import { StorybookPlugin } from '@dxos/plugin-testing';
10
10
  import { faker } from '@dxos/random';
11
11
  import { Button, Icon } from '@dxos/react-ui';
12
12
  import { withTheme } from '@dxos/react-ui/testing';
@@ -23,8 +23,8 @@ const App = () => {
23
23
  };
24
24
 
25
25
  return (
26
- <div className='flex flex-col bs-full p-4 space-y-8'>
27
- <div className='flex items-center gap-2 plb-2'>
26
+ <div className='flex flex-col h-full p-4 space-y-8'>
27
+ <div className='flex items-center gap-2 py-2'>
28
28
  <Button data-joyride='basic/1' onClick={() => start()}>
29
29
  Start
30
30
  </Button>
@@ -32,7 +32,7 @@ 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
38
  <Icon icon='ph--circle--regular' />
@@ -41,13 +41,13 @@ const App = () => {
41
41
  ))}
42
42
  </ul>
43
43
  </div>
44
- <div className='flex items-center gap-2 plb-2'>
44
+ <div className='flex items-center gap-2 py-2'>
45
45
  <Button data-joyride='basic/3' onClick={handleAdd}>
46
46
  Add
47
47
  </Button>
48
48
  </div>
49
49
  <div className='flex grow' />
50
- <div className='flex items-center plb-2'>
50
+ <div className='flex items-center py-2'>
51
51
  <div className='grow' />
52
52
  <Icon icon='ph--circle--regular' data-joyride='basic/4' />
53
53
  <Icon icon='ph--circle--regular' />
@@ -105,11 +105,15 @@ export const Default: StoryObj<typeof WelcomeTour> = {
105
105
  * IMPORTANT: Run in separate tab.
106
106
  */
107
107
  const meta = {
108
- title: 'plugins/plugin-help/WelcomeTour',
108
+ title: 'plugins/plugin-help/components/WelcomeTour',
109
109
  component: WelcomeTour,
110
110
  render: DefaultStory,
111
- // TODO(wittjosiah): Try to write story which does not depend on plugin manager.
112
- decorators: [withTheme, withPluginManager({ plugins: [StorybookLayoutPlugin({})] })],
111
+ decorators: [
112
+ withTheme(),
113
+ withPluginManager({
114
+ plugins: [StorybookPlugin({})],
115
+ }),
116
+ ],
113
117
  } satisfies Meta<typeof WelcomeTour>;
114
118
 
115
119
  export default meta;
@@ -5,7 +5,8 @@
5
5
  import React, { useState } from 'react';
6
6
  import Joyride, { ACTIONS, EVENTS } from 'react-joyride';
7
7
 
8
- import { useLayout, usePluginManager } from '@dxos/app-framework/react';
8
+ import { usePluginManager } from '@dxos/app-framework/ui';
9
+ import { useLayout } from '@dxos/app-toolkit/ui';
9
10
  import { useAsyncEffect } from '@dxos/react-ui';
10
11
 
11
12
  import { HelpContext, type Step } from '../../types';
@@ -76,7 +77,7 @@ export const WelcomeTour = ({ steps: initialSteps, running: runningProp, onRunni
76
77
  const setStepIndex = (index: number) => {
77
78
  if (runningProp) {
78
79
  const step = steps[index];
79
- step?.before?.(manager.context);
80
+ step?.before?.(manager.capabilities);
80
81
  }
81
82
  _setStepIndex(index);
82
83
  };
@@ -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`;