@dxos/plugin-help 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6
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-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-K4LQ2TR7.mjs +34 -0
- package/dist/lib/browser/chunk-K4LQ2TR7.mjs.map +7 -0
- package/dist/lib/browser/chunk-KUUIRJG5.mjs +31 -0
- package/dist/lib/browser/chunk-KUUIRJG5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-IM2QVQOH.mjs → chunk-TEXIV2IJ.mjs} +2 -2
- package/dist/lib/browser/{chunk-IM2QVQOH.mjs.map → chunk-TEXIV2IJ.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +351 -67
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +2 -1
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/start-YZBO346C.mjs +23 -0
- package/dist/lib/browser/start-YZBO346C.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 +6 -0
- 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} +2 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/components/Shortcuts/ShortcutsSection.d.ts.map +1 -1
- package/dist/types/src/components/Shortcuts/index.d.ts +0 -1
- package/dist/types/src/components/Shortcuts/index.d.ts.map +1 -1
- 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/constants.d.ts +2 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/{components/Shortcuts/ShortcutsDialog.d.ts → containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts} +1 -2
- package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts.map +1 -0
- 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 +3 -0
- package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts.map +1 -0
- package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts +2 -0
- package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts.map +1 -0
- package/dist/types/src/containers/ShortcutsHints/index.d.ts +3 -0
- package/dist/types/src/containers/ShortcutsHints/index.d.ts.map +1 -0
- package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts +2 -0
- package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts.map +1 -0
- package/dist/types/src/containers/ShortcutsList/index.d.ts +3 -0
- package/dist/types/src/containers/ShortcutsList/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +5 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- 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 +1 -0
- 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 -5
- package/dist/types/src/translations.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 +46 -28
- package/src/HelpPlugin.tsx +12 -10
- package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +13 -12
- 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} +6 -6
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +11 -9
- package/src/capabilities/{state/state.ts → state.ts} +2 -2
- package/src/components/Shortcuts/ShortcutsHints.tsx +1 -1
- package/src/components/Shortcuts/ShortcutsList.tsx +3 -3
- package/src/components/Shortcuts/ShortcutsSection.tsx +1 -3
- package/src/components/Shortcuts/index.ts +0 -1
- package/src/components/Shortcuts/styles.ts +2 -2
- package/src/components/Tooltip/Tooltip.tsx +4 -4
- package/src/components/WelcomeTour/WelcomeTour.stories.tsx +7 -7
- package/src/components/WelcomeTour/WelcomeTour.tsx +3 -2
- package/src/constants.ts +7 -0
- package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.tsx +39 -0
- package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.tsx +28 -0
- package/src/containers/ShortcutsDialogContent/index.ts +7 -0
- package/src/containers/ShortcutsHints/ShortcutsHints.tsx +5 -0
- package/src/containers/ShortcutsHints/index.ts +7 -0
- package/src/containers/ShortcutsList/ShortcutsList.tsx +5 -0
- package/src/containers/ShortcutsList/index.ts +7 -0
- package/src/containers/index.ts +9 -0
- package/src/hooks/useHelp.tsx +1 -1
- package/src/index.ts +1 -0
- 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/app-graph-builder-DX3VXARQ.mjs +0 -79
- package/dist/lib/browser/app-graph-builder-DX3VXARQ.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-W5XAZM46.mjs +0 -360
- package/dist/lib/browser/chunk-W5XAZM46.mjs.map +0 -7
- package/dist/lib/browser/react-root-SZRF6EXG.mjs +0 -43
- package/dist/lib/browser/react-root-SZRF6EXG.mjs.map +0 -7
- package/dist/lib/browser/react-surface-DWNTJBVM.mjs +0 -37
- package/dist/lib/browser/react-surface-DWNTJBVM.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 +0 -6
- 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 +0 -5
- 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/dist/types/src/components/Shortcuts/ShortcutsDialog.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/src/components/Shortcuts/ShortcutsDialog.tsx +0 -32
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.bcb3aa67d6",
|
|
4
4
|
"description": "Help plugin.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,6 +12,15 @@
|
|
|
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
|
+
"#types": "./src/types/index.ts"
|
|
23
|
+
},
|
|
15
24
|
"exports": {
|
|
16
25
|
".": {
|
|
17
26
|
"source": "./src/index.ts",
|
|
@@ -23,6 +32,11 @@
|
|
|
23
32
|
"types": "./dist/types/src/meta.d.ts",
|
|
24
33
|
"browser": "./dist/lib/browser/meta.mjs"
|
|
25
34
|
},
|
|
35
|
+
"./operations": {
|
|
36
|
+
"source": "./src/operations/index.ts",
|
|
37
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
38
|
+
"browser": "./dist/lib/browser/operations/index.mjs"
|
|
39
|
+
},
|
|
26
40
|
"./types": {
|
|
27
41
|
"source": "./src/types/index.ts",
|
|
28
42
|
"types": "./dist/types/src/types/index.d.ts",
|
|
@@ -37,6 +51,9 @@
|
|
|
37
51
|
],
|
|
38
52
|
"types": [
|
|
39
53
|
"dist/types/src/types/index.d.ts"
|
|
54
|
+
],
|
|
55
|
+
"operations": [
|
|
56
|
+
"dist/types/src/operations/index.d.ts"
|
|
40
57
|
]
|
|
41
58
|
}
|
|
42
59
|
},
|
|
@@ -45,47 +62,48 @@
|
|
|
45
62
|
"src"
|
|
46
63
|
],
|
|
47
64
|
"dependencies": {
|
|
48
|
-
"@effect-atom/atom": "^0.
|
|
65
|
+
"@effect-atom/atom": "^0.5.1",
|
|
49
66
|
"@fluentui/react-tabster": "9.26.11",
|
|
50
67
|
"react-joyride": "^2.7.2",
|
|
51
|
-
"@dxos/app-
|
|
52
|
-
"@dxos/app-
|
|
53
|
-
"@dxos/debug": "0.8.4-main.
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/operation": "0.8.4-main.
|
|
58
|
-
"@dxos/plugin-
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/plugin-space": "0.8.4-main.
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
68
|
+
"@dxos/app-toolkit": "0.8.4-main.bcb3aa67d6",
|
|
69
|
+
"@dxos/app-framework": "0.8.4-main.bcb3aa67d6",
|
|
70
|
+
"@dxos/debug": "0.8.4-main.bcb3aa67d6",
|
|
71
|
+
"@dxos/app-graph": "0.8.4-main.bcb3aa67d6",
|
|
72
|
+
"@dxos/keyboard": "0.8.4-main.bcb3aa67d6",
|
|
73
|
+
"@dxos/echo": "0.8.4-main.bcb3aa67d6",
|
|
74
|
+
"@dxos/operation": "0.8.4-main.bcb3aa67d6",
|
|
75
|
+
"@dxos/plugin-client": "0.8.4-main.bcb3aa67d6",
|
|
76
|
+
"@dxos/plugin-graph": "0.8.4-main.bcb3aa67d6",
|
|
77
|
+
"@dxos/plugin-space": "0.8.4-main.bcb3aa67d6",
|
|
78
|
+
"@dxos/react-client": "0.8.4-main.bcb3aa67d6",
|
|
79
|
+
"@dxos/util": "0.8.4-main.bcb3aa67d6",
|
|
80
|
+
"@dxos/effect": "0.8.4-main.bcb3aa67d6"
|
|
63
81
|
},
|
|
64
82
|
"devDependencies": {
|
|
65
|
-
"@effect-atom/atom-react": "^0.
|
|
66
|
-
"@effect/platform": "0.
|
|
83
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
84
|
+
"@effect/platform": "0.94.4",
|
|
67
85
|
"@types/react": "~19.2.7",
|
|
68
86
|
"@types/react-dom": "~19.2.3",
|
|
69
|
-
"effect": "3.
|
|
87
|
+
"effect": "3.20.0",
|
|
70
88
|
"react": "~19.2.3",
|
|
71
89
|
"react-dom": "~19.2.3",
|
|
72
90
|
"react-floater": "0.7.9",
|
|
73
91
|
"type-fest": "4.10.1",
|
|
74
|
-
"vite": "7.1.
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/ui
|
|
92
|
+
"vite": "^7.1.11",
|
|
93
|
+
"@dxos/plugin-testing": "0.8.4-main.bcb3aa67d6",
|
|
94
|
+
"@dxos/random": "0.8.4-main.bcb3aa67d6",
|
|
95
|
+
"@dxos/storybook-utils": "0.8.4-main.bcb3aa67d6",
|
|
96
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6",
|
|
97
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6"
|
|
80
98
|
},
|
|
81
99
|
"peerDependencies": {
|
|
82
|
-
"@effect-atom/atom-react": "^0.
|
|
83
|
-
"@effect/platform": "0.
|
|
84
|
-
"effect": "3.
|
|
100
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
101
|
+
"@effect/platform": "0.94.4",
|
|
102
|
+
"effect": "3.20.0",
|
|
85
103
|
"react": "~19.2.3",
|
|
86
104
|
"react-dom": "~19.2.3",
|
|
87
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
88
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
105
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6",
|
|
106
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6"
|
|
89
107
|
},
|
|
90
108
|
"publishConfig": {
|
|
91
109
|
"access": "public"
|
package/src/HelpPlugin.tsx
CHANGED
|
@@ -2,28 +2,30 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { ActivationEvents, Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import { meta } from './meta';
|
|
8
|
+
import { meta } from '#meta';
|
|
9
9
|
import { translations } from './translations';
|
|
10
|
-
import { type Step } from '
|
|
10
|
+
import { type Step } from '#types';
|
|
11
|
+
|
|
12
|
+
import { AppGraphBuilder, HelpState, OperationHandler, ReactRoot, ReactSurface } from '#capabilities';
|
|
11
13
|
|
|
12
14
|
export type HelpPluginOptions = { steps?: Step[] };
|
|
13
15
|
|
|
14
16
|
export const HelpPlugin = Plugin.define<HelpPluginOptions>(meta).pipe(
|
|
17
|
+
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
18
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
19
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
20
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
15
21
|
Plugin.addModule({
|
|
16
|
-
activatesOn:
|
|
22
|
+
activatesOn: ActivationEvents.Startup,
|
|
17
23
|
activate: HelpState,
|
|
18
24
|
}),
|
|
19
|
-
Common.Plugin.addTranslationsModule({ translations }),
|
|
20
25
|
Plugin.addModule(({ steps = [] }) => ({
|
|
21
26
|
id: 'react-root',
|
|
22
|
-
activatesOn:
|
|
27
|
+
activatesOn: ActivationEvents.Startup,
|
|
23
28
|
activate: () => ReactRoot(steps),
|
|
24
29
|
})),
|
|
25
|
-
Common.Plugin.addSurfaceModule({ activate: ReactSurface }),
|
|
26
|
-
Common.Plugin.addOperationResolverModule({ activate: OperationResolver }),
|
|
27
|
-
Common.Plugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
28
30
|
Plugin.make,
|
|
29
31
|
);
|
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
8
|
import { GraphBuilder, NodeMatcher } from '@dxos/app-graph';
|
|
9
|
+
import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
|
|
9
10
|
import { Operation } from '@dxos/operation';
|
|
10
11
|
|
|
11
|
-
import { SHORTCUTS_DIALOG } from '
|
|
12
|
-
import { meta } from '
|
|
13
|
-
import { HelpCapabilities
|
|
12
|
+
import { SHORTCUTS_DIALOG } from '../constants';
|
|
13
|
+
import { meta } from '#meta';
|
|
14
|
+
import { HelpCapabilities } from '#types';
|
|
15
|
+
import { HelpOperation } from '#operations';
|
|
14
16
|
|
|
15
17
|
export default Capability.makeModule(
|
|
16
18
|
Effect.fnUntraced(function* () {
|
|
@@ -22,11 +24,11 @@ export default Capability.makeModule(
|
|
|
22
24
|
{
|
|
23
25
|
id: HelpOperation.Start.meta.key,
|
|
24
26
|
data: Effect.fnUntraced(function* () {
|
|
25
|
-
yield*
|
|
27
|
+
yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({ ...s, showHints: true }));
|
|
26
28
|
yield* Operation.invoke(HelpOperation.Start);
|
|
27
29
|
}),
|
|
28
30
|
properties: {
|
|
29
|
-
label: ['open
|
|
31
|
+
label: ['open-help-tour.message', { ns: meta.id }],
|
|
30
32
|
icon: 'ph--info--regular',
|
|
31
33
|
keyBinding: {
|
|
32
34
|
macos: 'shift+meta+/',
|
|
@@ -37,16 +39,15 @@ export default Capability.makeModule(
|
|
|
37
39
|
},
|
|
38
40
|
},
|
|
39
41
|
{
|
|
40
|
-
id: `${meta.id}
|
|
42
|
+
id: `${meta.id}.open-shortcuts`,
|
|
41
43
|
data: Effect.fnUntraced(function* () {
|
|
42
|
-
yield*
|
|
43
|
-
yield* Operation.invoke(
|
|
44
|
+
yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({ ...s, showHints: true }));
|
|
45
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
44
46
|
subject: SHORTCUTS_DIALOG,
|
|
45
|
-
blockAlign: 'center',
|
|
46
47
|
});
|
|
47
48
|
}),
|
|
48
49
|
properties: {
|
|
49
|
-
label: ['open
|
|
50
|
+
label: ['open-shortcuts.label', { ns: meta.id }],
|
|
50
51
|
icon: 'ph--keyboard--regular',
|
|
51
52
|
keyBinding: {
|
|
52
53
|
macos: 'meta+ctrl+/',
|
|
@@ -56,6 +57,6 @@ export default Capability.makeModule(
|
|
|
56
57
|
]),
|
|
57
58
|
});
|
|
58
59
|
|
|
59
|
-
return Capability.contributes(
|
|
60
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
60
61
|
}),
|
|
61
62
|
);
|
|
@@ -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/operation';
|
|
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/operation';
|
|
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
|
+
);
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { useAtomCapabilityState } from '@dxos/app-framework/
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
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[]) {
|
|
17
|
-
return Capability.contributes(
|
|
17
|
+
return Capability.contributes(Capabilities.ReactRoot, {
|
|
18
18
|
id: meta.id,
|
|
19
19
|
root: () => {
|
|
20
20
|
const [state, updateState] = useAtomCapabilityState(HelpCapabilities.State);
|
|
@@ -5,25 +5,27 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
9
10
|
|
|
10
|
-
import { SHORTCUTS_DIALOG
|
|
11
|
-
import {
|
|
11
|
+
import { SHORTCUTS_DIALOG } from '../constants';
|
|
12
|
+
import { ShortcutsDialogContent, ShortcutsHints, ShortcutsList } from '#containers';
|
|
13
|
+
import { meta } from '#meta';
|
|
12
14
|
|
|
13
15
|
export default Capability.makeModule(() =>
|
|
14
16
|
Effect.succeed(
|
|
15
|
-
Capability.contributes(
|
|
16
|
-
|
|
17
|
-
id: `${meta.id}
|
|
17
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
18
|
+
Surface.create({
|
|
19
|
+
id: `${meta.id}.hints`,
|
|
18
20
|
role: 'hints',
|
|
19
21
|
component: () => <ShortcutsHints />,
|
|
20
22
|
}),
|
|
21
|
-
|
|
22
|
-
id: `${meta.id}
|
|
23
|
+
Surface.create({
|
|
24
|
+
id: `${meta.id}.keyshortcuts`,
|
|
23
25
|
role: 'keyshortcuts',
|
|
24
26
|
component: () => <ShortcutsList />,
|
|
25
27
|
}),
|
|
26
|
-
|
|
28
|
+
Surface.create({
|
|
27
29
|
id: SHORTCUTS_DIALOG,
|
|
28
30
|
role: 'dialog',
|
|
29
31
|
filter: (data): data is { component: string } => data.component === SHORTCUTS_DIALOG,
|
|
@@ -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(() => {
|
|
@@ -27,7 +27,7 @@ export const ShortcutsHints = ({ onClose }: { onClose?: () => void }) => {
|
|
|
27
27
|
const hints = bindings.filter((binding) => defaults.includes(binding.shortcut));
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
|
-
<div role='none' className='flex overflow-hidden
|
|
30
|
+
<div role='none' className='flex overflow-hidden px-2 gap-4'>
|
|
31
31
|
{hints.map((binding) => (
|
|
32
32
|
<Shortcut key={binding.shortcut} binding={binding} />
|
|
33
33
|
))}
|
|
@@ -8,7 +8,7 @@ import { Keyboard } from '@dxos/keyboard';
|
|
|
8
8
|
import { toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { mx } from '@dxos/ui-theme';
|
|
10
10
|
|
|
11
|
-
import { meta } from '
|
|
11
|
+
import { meta } from '#meta';
|
|
12
12
|
|
|
13
13
|
import { Key } from './Key';
|
|
14
14
|
|
|
@@ -22,11 +22,11 @@ export const ShortcutsList = () => {
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
|
-
<dl className={mx('
|
|
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='
|
|
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/ui-theme';
|
|
8
|
-
|
|
9
7
|
import { ShortcutsList } from './ShortcutsList';
|
|
10
8
|
|
|
11
9
|
export const ShortcutsSection = () => {
|
|
12
10
|
return (
|
|
13
|
-
<section className=
|
|
11
|
+
<section className='text-description'>
|
|
14
12
|
<ShortcutsList />
|
|
15
13
|
</section>
|
|
16
14
|
);
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
import { mx } from '@dxos/ui-theme';
|
|
6
6
|
|
|
7
7
|
export const shortcutKey = mx(
|
|
8
|
-
'inline-flex min-
|
|
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
|
|
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
|
|
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
|
|
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='
|
|
81
|
+
classNames='mx-1 cursor-pointer'
|
|
82
82
|
/>
|
|
83
83
|
))}
|
|
84
84
|
</div>
|
|
@@ -11,7 +11,7 @@ import { faker } 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
|
|
|
@@ -23,8 +23,8 @@ const App = () => {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
|
-
<div className='flex flex-col
|
|
27
|
-
<div className='flex items-center gap-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>
|
|
@@ -41,13 +41,13 @@ const App = () => {
|
|
|
41
41
|
))}
|
|
42
42
|
</ul>
|
|
43
43
|
</div>
|
|
44
|
-
<div className='flex items-center gap-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
|
|
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,11 @@ 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
111
|
decorators: [
|
|
112
|
-
withTheme,
|
|
112
|
+
withTheme(),
|
|
113
113
|
withPluginManager({
|
|
114
114
|
plugins: [StorybookPlugin({})],
|
|
115
115
|
}),
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
import React, { useState } from 'react';
|
|
6
6
|
import Joyride, { ACTIONS, EVENTS } from 'react-joyride';
|
|
7
7
|
|
|
8
|
-
import {
|
|
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
|
-
import { HelpContext, type Step } from '
|
|
12
|
+
import { HelpContext, type Step } from '#types';
|
|
12
13
|
import { Tooltip, floaterProps } from '../Tooltip';
|
|
13
14
|
|
|
14
15
|
const addStepClass = (target: string | HTMLElement) => {
|
package/src/constants.ts
ADDED
|
@@ -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,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'));
|
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'));
|