@dxos/plugin-help 0.8.4-main.4a85c3132b → 0.8.4-main.51f1e5ca51
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.
- package/dist/lib/browser/chunk-53QC3FTJ.mjs +34 -0
- package/dist/lib/browser/chunk-53QC3FTJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-RWK34XL5.mjs +31 -0
- package/dist/lib/browser/chunk-RWK34XL5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +331 -69
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +13 -3
- package/dist/lib/browser/meta.mjs.map +4 -4
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/start-JQ2LLVCT.mjs +23 -0
- package/dist/lib/browser/start-JQ2LLVCT.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +20 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +4 -6
- package/dist/types/src/HelpPlugin.d.ts +1 -1
- package/dist/types/src/HelpPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +18 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/components/Shortcuts/Key.d.ts.map +1 -1
- package/dist/types/src/components/Shortcuts/ShortcutsHints.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +9 -9
- package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts +1 -1
- package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts.map +1 -1
- package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts.map +1 -1
- package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.d.ts +25 -0
- package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts +1 -2
- package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts.map +1 -1
- package/dist/types/src/containers/ShortcutsHints/index.d.ts +1 -2
- package/dist/types/src/containers/ShortcutsHints/index.d.ts.map +1 -1
- package/dist/types/src/containers/ShortcutsList/index.d.ts +1 -2
- package/dist/types/src/containers/ShortcutsList/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useHelp.d.ts +1 -1
- package/dist/types/src/hooks/useHelp.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +4 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/start.d.ts +5 -0
- package/dist/types/src/operations/start.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +5 -6
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +1 -17
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +45 -34
- package/src/HelpPlugin.tsx +5 -5
- package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +15 -13
- package/src/capabilities/index.ts +11 -5
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +3 -3
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +7 -7
- package/src/capabilities/{state/state.ts → state.ts} +2 -2
- package/src/components/Shortcuts/ShortcutsList.tsx +1 -1
- package/src/components/WelcomeTour/WelcomeTour.stories.tsx +8 -8
- package/src/components/WelcomeTour/WelcomeTour.tsx +3 -1
- package/src/constants.ts +2 -2
- package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.tsx +39 -0
- package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.tsx +9 -10
- package/src/containers/ShortcutsDialogContent/index.ts +1 -3
- package/src/containers/ShortcutsHints/index.ts +1 -3
- package/src/containers/ShortcutsList/index.ts +1 -3
- package/src/hooks/useHelp.tsx +1 -1
- package/src/index.ts +0 -2
- package/src/meta.ts +1 -1
- package/src/operations/definitions.ts +19 -0
- package/src/operations/index.ts +9 -0
- package/src/operations/start.ts +21 -0
- package/src/translations.ts +5 -5
- package/src/types/capabilities.ts +2 -2
- package/src/types/schema.ts +1 -15
- package/dist/lib/browser/ShortcutsDialogContent-BETHLZYK.mjs +0 -36
- package/dist/lib/browser/ShortcutsDialogContent-BETHLZYK.mjs.map +0 -7
- package/dist/lib/browser/ShortcutsHints-Q4LKOCKH.mjs +0 -12
- package/dist/lib/browser/ShortcutsHints-Q4LKOCKH.mjs.map +0 -7
- package/dist/lib/browser/ShortcutsList-P334CJ7O.mjs +0 -12
- package/dist/lib/browser/ShortcutsList-P334CJ7O.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-2O2CUPGU.mjs +0 -79
- package/dist/lib/browser/app-graph-builder-2O2CUPGU.mjs.map +0 -7
- package/dist/lib/browser/chunk-IM2QVQOH.mjs +0 -16
- package/dist/lib/browser/chunk-IM2QVQOH.mjs.map +0 -7
- package/dist/lib/browser/chunk-PNXUNKZW.mjs +0 -335
- package/dist/lib/browser/chunk-PNXUNKZW.mjs.map +0 -7
- package/dist/lib/browser/chunk-TS66J4C6.mjs +0 -58
- package/dist/lib/browser/chunk-TS66J4C6.mjs.map +0 -7
- package/dist/lib/browser/chunk-XAC3AYP4.mjs +0 -11
- package/dist/lib/browser/chunk-XAC3AYP4.mjs.map +0 -7
- package/dist/lib/browser/react-root-GK7XGIBN.mjs +0 -43
- package/dist/lib/browser/react-root-GK7XGIBN.mjs.map +0 -7
- package/dist/lib/browser/react-surface-KGND4ZJD.mjs +0 -42
- package/dist/lib/browser/react-surface-KGND4ZJD.mjs.map +0 -7
- package/dist/lib/browser/state-VRPLKT3F.mjs +0 -27
- package/dist/lib/browser/state-VRPLKT3F.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -2
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
- package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -11
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -5
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -23
- package/src/capabilities/react-root/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
- /package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-help",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.51f1e5ca51",
|
|
4
4
|
"description": "Help plugin.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,6 +12,16 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
17
|
+
"#components": "./src/components/index.ts",
|
|
18
|
+
"#containers": "./src/containers/index.ts",
|
|
19
|
+
"#hooks": "./src/hooks/index.ts",
|
|
20
|
+
"#meta": "./src/meta.ts",
|
|
21
|
+
"#operations": "./src/operations/index.ts",
|
|
22
|
+
"#translations": "./src/translations.ts",
|
|
23
|
+
"#types": "./src/types/index.ts"
|
|
24
|
+
},
|
|
15
25
|
"exports": {
|
|
16
26
|
".": {
|
|
17
27
|
"source": "./src/index.ts",
|
|
@@ -23,6 +33,17 @@
|
|
|
23
33
|
"types": "./dist/types/src/meta.d.ts",
|
|
24
34
|
"browser": "./dist/lib/browser/meta.mjs"
|
|
25
35
|
},
|
|
36
|
+
"./operations": {
|
|
37
|
+
"source": "./src/operations/index.ts",
|
|
38
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
39
|
+
"browser": "./dist/lib/browser/operations/index.mjs"
|
|
40
|
+
},
|
|
41
|
+
"./translations": {
|
|
42
|
+
"source": "./src/translations.ts",
|
|
43
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
44
|
+
"browser": "./dist/lib/browser/translations.mjs",
|
|
45
|
+
"node": "./dist/lib/node-esm/translations.mjs"
|
|
46
|
+
},
|
|
26
47
|
"./types": {
|
|
27
48
|
"source": "./src/types/index.ts",
|
|
28
49
|
"types": "./dist/types/src/types/index.d.ts",
|
|
@@ -30,16 +51,6 @@
|
|
|
30
51
|
}
|
|
31
52
|
},
|
|
32
53
|
"types": "dist/types/src/index.d.ts",
|
|
33
|
-
"typesVersions": {
|
|
34
|
-
"*": {
|
|
35
|
-
"meta": [
|
|
36
|
-
"dist/types/src/meta.d.ts"
|
|
37
|
-
],
|
|
38
|
-
"types": [
|
|
39
|
-
"dist/types/src/types/index.d.ts"
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
54
|
"files": [
|
|
44
55
|
"dist",
|
|
45
56
|
"src"
|
|
@@ -48,45 +59,45 @@
|
|
|
48
59
|
"@effect-atom/atom": "^0.5.1",
|
|
49
60
|
"@fluentui/react-tabster": "9.26.11",
|
|
50
61
|
"react-joyride": "^2.7.2",
|
|
51
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/plugin-space": "0.8.4-main.
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
62
|
+
"@dxos/app-framework": "0.8.4-main.51f1e5ca51",
|
|
63
|
+
"@dxos/compute": "0.8.4-main.51f1e5ca51",
|
|
64
|
+
"@dxos/app-toolkit": "0.8.4-main.51f1e5ca51",
|
|
65
|
+
"@dxos/echo": "0.8.4-main.51f1e5ca51",
|
|
66
|
+
"@dxos/debug": "0.8.4-main.51f1e5ca51",
|
|
67
|
+
"@dxos/effect": "0.8.4-main.51f1e5ca51",
|
|
68
|
+
"@dxos/plugin-client": "0.8.4-main.51f1e5ca51",
|
|
69
|
+
"@dxos/keyboard": "0.8.4-main.51f1e5ca51",
|
|
70
|
+
"@dxos/app-graph": "0.8.4-main.51f1e5ca51",
|
|
71
|
+
"@dxos/react-client": "0.8.4-main.51f1e5ca51",
|
|
72
|
+
"@dxos/plugin-space": "0.8.4-main.51f1e5ca51",
|
|
73
|
+
"@dxos/util": "0.8.4-main.51f1e5ca51",
|
|
74
|
+
"@dxos/plugin-graph": "0.8.4-main.51f1e5ca51"
|
|
64
75
|
},
|
|
65
76
|
"devDependencies": {
|
|
66
77
|
"@effect-atom/atom-react": "^0.5.0",
|
|
67
78
|
"@effect/platform": "0.94.4",
|
|
68
79
|
"@types/react": "~19.2.7",
|
|
69
80
|
"@types/react-dom": "~19.2.3",
|
|
70
|
-
"effect": "3.
|
|
81
|
+
"effect": "3.20.0",
|
|
71
82
|
"react": "~19.2.3",
|
|
72
83
|
"react-dom": "~19.2.3",
|
|
73
84
|
"react-floater": "0.7.9",
|
|
74
85
|
"type-fest": "4.10.1",
|
|
75
|
-
"vite": "^
|
|
76
|
-
"@dxos/plugin-testing": "0.8.4-main.
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
86
|
+
"vite": "^8.0.10",
|
|
87
|
+
"@dxos/plugin-testing": "0.8.4-main.51f1e5ca51",
|
|
88
|
+
"@dxos/random": "0.8.4-main.51f1e5ca51",
|
|
89
|
+
"@dxos/react-ui": "0.8.4-main.51f1e5ca51",
|
|
90
|
+
"@dxos/storybook-utils": "0.8.4-main.51f1e5ca51",
|
|
91
|
+
"@dxos/ui-theme": "0.8.4-main.51f1e5ca51"
|
|
81
92
|
},
|
|
82
93
|
"peerDependencies": {
|
|
83
94
|
"@effect-atom/atom-react": "^0.5.0",
|
|
84
95
|
"@effect/platform": "0.94.4",
|
|
85
|
-
"effect": "3.
|
|
96
|
+
"effect": "3.20.0",
|
|
86
97
|
"react": "~19.2.3",
|
|
87
98
|
"react-dom": "~19.2.3",
|
|
88
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
89
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
99
|
+
"@dxos/react-ui": "0.8.4-main.51f1e5ca51",
|
|
100
|
+
"@dxos/ui-theme": "0.8.4-main.51f1e5ca51"
|
|
90
101
|
},
|
|
91
102
|
"publishConfig": {
|
|
92
103
|
"access": "public"
|
package/src/HelpPlugin.tsx
CHANGED
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
import { ActivationEvents, Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
7
|
|
|
8
|
-
import { AppGraphBuilder, HelpState,
|
|
9
|
-
import { meta } from '
|
|
10
|
-
import { translations } from '
|
|
11
|
-
import { type Step } from '
|
|
8
|
+
import { AppGraphBuilder, HelpState, OperationHandler, ReactRoot, ReactSurface } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { translations } from '#translations';
|
|
11
|
+
import { type Step } from '#types';
|
|
12
12
|
|
|
13
13
|
export type HelpPluginOptions = { steps?: Step[] };
|
|
14
14
|
|
|
15
15
|
export const HelpPlugin = Plugin.define<HelpPluginOptions>(meta).pipe(
|
|
16
16
|
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
17
|
-
AppPlugin.
|
|
17
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
18
18
|
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
19
19
|
AppPlugin.addTranslationsModule({ translations }),
|
|
20
20
|
Plugin.addModule({
|
|
@@ -5,29 +5,31 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
-
import { GraphBuilder, NodeMatcher } from '@dxos/app-graph';
|
|
8
|
+
import { GraphBuilder, Node, NodeMatcher } from '@dxos/app-graph';
|
|
9
9
|
import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
|
|
10
|
-
import { Operation } from '@dxos/
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { HelpCapabilities
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
import { HelpOperation } from '#operations';
|
|
14
|
+
import { HelpCapabilities } from '#types';
|
|
15
|
+
|
|
16
|
+
import { SHORTCUTS_DIALOG } from '../constants';
|
|
15
17
|
|
|
16
18
|
export default Capability.makeModule(
|
|
17
19
|
Effect.fnUntraced(function* () {
|
|
18
20
|
const extensions = yield* GraphBuilder.createExtension({
|
|
19
|
-
id:
|
|
21
|
+
id: 'root',
|
|
20
22
|
match: NodeMatcher.whenRoot,
|
|
21
23
|
actions: () =>
|
|
22
24
|
Effect.succeed([
|
|
23
|
-
{
|
|
25
|
+
Node.makeAction({
|
|
24
26
|
id: HelpOperation.Start.meta.key,
|
|
25
27
|
data: Effect.fnUntraced(function* () {
|
|
26
28
|
yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({ ...s, showHints: true }));
|
|
27
29
|
yield* Operation.invoke(HelpOperation.Start);
|
|
28
30
|
}),
|
|
29
31
|
properties: {
|
|
30
|
-
label: ['open
|
|
32
|
+
label: ['open-help-tour.message', { ns: meta.id }],
|
|
31
33
|
icon: 'ph--info--regular',
|
|
32
34
|
keyBinding: {
|
|
33
35
|
macos: 'shift+meta+/',
|
|
@@ -36,9 +38,9 @@ export default Capability.makeModule(
|
|
|
36
38
|
},
|
|
37
39
|
testId: 'helpPlugin.openHelp',
|
|
38
40
|
},
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id:
|
|
41
|
+
}),
|
|
42
|
+
Node.makeAction({
|
|
43
|
+
id: 'open-shortcuts',
|
|
42
44
|
data: Effect.fnUntraced(function* () {
|
|
43
45
|
yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({ ...s, showHints: true }));
|
|
44
46
|
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
@@ -46,13 +48,13 @@ export default Capability.makeModule(
|
|
|
46
48
|
});
|
|
47
49
|
}),
|
|
48
50
|
properties: {
|
|
49
|
-
label: ['open
|
|
51
|
+
label: ['open-shortcuts.label', { ns: meta.id }],
|
|
50
52
|
icon: 'ph--keyboard--regular',
|
|
51
53
|
keyBinding: {
|
|
52
54
|
macos: 'meta+ctrl+/',
|
|
53
55
|
},
|
|
54
56
|
},
|
|
55
|
-
},
|
|
57
|
+
}),
|
|
56
58
|
]),
|
|
57
59
|
});
|
|
58
60
|
|
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
7
|
+
|
|
8
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
9
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
10
|
+
'OperationHandler',
|
|
11
|
+
() => import('./operation-handler'),
|
|
12
|
+
);
|
|
13
|
+
export const ReactRoot = Capability.lazy('ReactRoot', () => import('./react-root'));
|
|
14
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
15
|
+
export const HelpState = Capability.lazy('HelpState', () => import('./state'));
|
|
@@ -0,0 +1,16 @@
|
|
|
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 type { OperationHandlerSet } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { HelpOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(Capabilities.OperationHandler, HelpOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
@@ -8,9 +8,9 @@ import React from 'react';
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { useAtomCapabilityState } from '@dxos/app-framework/ui';
|
|
10
10
|
|
|
11
|
-
import { WelcomeTour } from '
|
|
12
|
-
import { meta } from '
|
|
13
|
-
import { HelpCapabilities, type Step } from '
|
|
11
|
+
import { WelcomeTour } from '#components';
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
import { HelpCapabilities, type Step } from '#types';
|
|
14
14
|
|
|
15
15
|
export default Capability.makeModule(
|
|
16
16
|
Effect.fnUntraced(function* (steps?: Step[]) {
|
|
@@ -7,28 +7,28 @@ import React from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
10
11
|
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
import {
|
|
12
|
+
import { ShortcutsDialogContent, ShortcutsHints, ShortcutsList } from '#containers';
|
|
13
|
+
|
|
14
|
+
import { SHORTCUTS_DIALOG } from '../constants';
|
|
14
15
|
|
|
15
16
|
export default Capability.makeModule(() =>
|
|
16
17
|
Effect.succeed(
|
|
17
18
|
Capability.contributes(Capabilities.ReactSurface, [
|
|
18
19
|
Surface.create({
|
|
19
|
-
id:
|
|
20
|
+
id: 'hints',
|
|
20
21
|
role: 'hints',
|
|
21
22
|
component: () => <ShortcutsHints />,
|
|
22
23
|
}),
|
|
23
24
|
Surface.create({
|
|
24
|
-
id:
|
|
25
|
+
id: 'keyshortcuts',
|
|
25
26
|
role: 'keyshortcuts',
|
|
26
27
|
component: () => <ShortcutsList />,
|
|
27
28
|
}),
|
|
28
29
|
Surface.create({
|
|
29
30
|
id: SHORTCUTS_DIALOG,
|
|
30
|
-
|
|
31
|
-
filter: (data): data is { component: string } => data.component === SHORTCUTS_DIALOG,
|
|
31
|
+
filter: AppSurface.component(AppSurface.Dialog, SHORTCUTS_DIALOG),
|
|
32
32
|
component: () => <ShortcutsDialogContent />,
|
|
33
33
|
}),
|
|
34
34
|
]),
|
|
@@ -7,8 +7,8 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
8
|
import { createKvsStore } from '@dxos/effect';
|
|
9
9
|
|
|
10
|
-
import { meta } from '
|
|
11
|
-
import { HelpCapabilities } from '
|
|
10
|
+
import { meta } from '#meta';
|
|
11
|
+
import { HelpCapabilities } from '#types';
|
|
12
12
|
|
|
13
13
|
export default Capability.makeModule(() =>
|
|
14
14
|
Effect.sync(() => {
|
|
@@ -7,19 +7,19 @@ import React, { useState } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
9
9
|
import { StorybookPlugin } from '@dxos/plugin-testing';
|
|
10
|
-
import {
|
|
10
|
+
import { random } from '@dxos/random';
|
|
11
11
|
import { Button, Icon } from '@dxos/react-ui';
|
|
12
12
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
13
13
|
|
|
14
|
-
import { useHelp } from '
|
|
14
|
+
import { useHelp } from '#hooks';
|
|
15
15
|
|
|
16
16
|
import { WelcomeTour, type WelcomeTourProps } from './WelcomeTour';
|
|
17
17
|
|
|
18
18
|
const App = () => {
|
|
19
19
|
const { running, start } = useHelp();
|
|
20
|
-
const [items, setItems] = useState(() => Array.from({ length: 5 }).map(() =>
|
|
20
|
+
const [items, setItems] = useState(() => Array.from({ length: 5 }).map(() => random.lorem.sentence()));
|
|
21
21
|
const handleAdd = () => {
|
|
22
|
-
setItems((items) => [...items,
|
|
22
|
+
setItems((items) => [...items, random.lorem.sentence()]);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
return (
|
|
@@ -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:
|
|
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:
|
|
86
|
+
content: random.lorem.paragraph(),
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
target: '[data-joyride="basic/3"]',
|
|
90
90
|
title: 'plugins/Step 3',
|
|
91
|
-
content:
|
|
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:
|
|
97
|
+
content: random.lorem.paragraph(),
|
|
98
98
|
placement: 'top-end',
|
|
99
99
|
},
|
|
100
100
|
],
|
|
@@ -9,7 +9,8 @@ import { usePluginManager } from '@dxos/app-framework/ui';
|
|
|
9
9
|
import { useLayout } from '@dxos/app-toolkit/ui';
|
|
10
10
|
import { useAsyncEffect } from '@dxos/react-ui';
|
|
11
11
|
|
|
12
|
-
import { HelpContext, type Step } from '
|
|
12
|
+
import { HelpContext, type Step } from '#types';
|
|
13
|
+
|
|
13
14
|
import { Tooltip, floaterProps } from '../Tooltip';
|
|
14
15
|
|
|
15
16
|
const addStepClass = (target: string | HTMLElement) => {
|
|
@@ -162,6 +163,7 @@ export const WelcomeTour = ({ steps: initialSteps, running: runningProp, onRunni
|
|
|
162
163
|
callback={callback}
|
|
163
164
|
floaterProps={floaterProps}
|
|
164
165
|
tooltipComponent={Tooltip}
|
|
166
|
+
spotlightPadding={0}
|
|
165
167
|
/>
|
|
166
168
|
</HelpContext.Provider>
|
|
167
169
|
);
|
package/src/constants.ts
CHANGED
|
@@ -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 = {};
|
|
@@ -4,26 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { Dialog,
|
|
7
|
+
import { Dialog, useTranslation } from '@dxos/react-ui';
|
|
8
8
|
|
|
9
|
-
import { ShortcutsList } from '
|
|
10
|
-
import { meta } from '
|
|
9
|
+
import { ShortcutsList } from '#components';
|
|
10
|
+
import { meta } from '#meta';
|
|
11
11
|
|
|
12
12
|
export const ShortcutsDialogContent = () => {
|
|
13
13
|
const { t } = useTranslation(meta.id);
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
16
|
<Dialog.Content>
|
|
17
|
-
<
|
|
18
|
-
<Dialog.Title>{t('shortcuts
|
|
17
|
+
<Dialog.Header>
|
|
18
|
+
<Dialog.Title>{t('shortcuts-dialog.title')}</Dialog.Title>
|
|
19
19
|
<Dialog.Close asChild>
|
|
20
|
-
<
|
|
20
|
+
<Dialog.CloseIconButton />
|
|
21
21
|
</Dialog.Close>
|
|
22
|
-
</
|
|
23
|
-
|
|
24
|
-
<div className='flex items-center justify-center'>
|
|
22
|
+
</Dialog.Header>
|
|
23
|
+
<Dialog.Body>
|
|
25
24
|
<ShortcutsList />
|
|
26
|
-
</
|
|
25
|
+
</Dialog.Body>
|
|
27
26
|
</Dialog.Content>
|
|
28
27
|
);
|
|
29
28
|
};
|
package/src/hooks/useHelp.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { useContext } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { raise } from '@dxos/debug';
|
|
8
8
|
|
|
9
|
-
import { HelpContext } from '
|
|
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
package/src/meta.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
|
-
id: 'dxos.
|
|
9
|
+
id: 'org.dxos.plugin.help',
|
|
10
10
|
name: 'Help',
|
|
11
11
|
description: trim`
|
|
12
12
|
Built-in help system with documentation, tutorials, and contextual assistance.
|
|
@@ -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,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;
|
package/src/translations.ts
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
7
|
+
import { meta } from '#meta';
|
|
8
8
|
|
|
9
9
|
export const translations = [
|
|
10
10
|
{
|
|
11
11
|
'en-US': {
|
|
12
12
|
[meta.id]: {
|
|
13
|
-
'plugin
|
|
14
|
-
'open
|
|
15
|
-
'open
|
|
16
|
-
'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
|
},
|
|
@@ -7,7 +7,7 @@ import * as Schema from 'effect/Schema';
|
|
|
7
7
|
|
|
8
8
|
import { Capability } from '@dxos/app-framework';
|
|
9
9
|
|
|
10
|
-
import { meta } from '
|
|
10
|
+
import { meta } from '#meta';
|
|
11
11
|
|
|
12
12
|
export namespace HelpCapabilities {
|
|
13
13
|
export const StateSchema = Schema.mutable(
|
|
@@ -20,5 +20,5 @@ export namespace HelpCapabilities {
|
|
|
20
20
|
|
|
21
21
|
export type State = Schema.Schema.Type<typeof StateSchema>;
|
|
22
22
|
|
|
23
|
-
export const State = Capability.make<Atom.Writable<State>>(`${meta.id}
|
|
23
|
+
export const State = Capability.make<Atom.Writable<State>>(`${meta.id}.capability.state`);
|
|
24
24
|
}
|