@dxos/plugin-help 0.8.4-main.f9ba587 → 0.8.4-main.fcfe5033a5
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-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-TEXIV2IJ.mjs +16 -0
- package/dist/lib/browser/chunk-TEXIV2IJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +358 -75
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +2 -3
- 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 +10 -0
- package/dist/types/src/HelpPlugin.d.ts +3 -2
- package/dist/types/src/HelpPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +16 -6
- 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.d.ts +5 -3
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +11 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/Shortcuts/ShortcutsHints.d.ts.map +1 -1
- package/dist/types/src/components/Shortcuts/ShortcutsList.d.ts.map +1 -1
- 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/Tooltip/Tooltip.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/components/WelcomeTour/WelcomeTour.stories.d.ts +9 -4
- package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.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/containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts +3 -0
- 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 +2 -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 +2 -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 +2 -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 +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.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/capabilities.d.ts +21 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/schema.d.ts +16 -0
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +63 -39
- package/src/HelpPlugin.tsx +22 -48
- package/src/capabilities/app-graph-builder.ts +54 -67
- package/src/capabilities/index.ts +10 -7
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-root.tsx +28 -24
- package/src/capabilities/react-surface.tsx +28 -22
- package/src/capabilities/state.ts +19 -15
- package/src/components/Shortcuts/ShortcutsHints.tsx +13 -5
- package/src/components/Shortcuts/ShortcutsList.tsx +6 -5
- package/src/components/Shortcuts/ShortcutsSection.tsx +1 -3
- package/src/components/Shortcuts/index.ts +0 -1
- package/src/components/Shortcuts/styles.ts +3 -3
- package/src/components/Tooltip/Tooltip.tsx +31 -30
- package/src/components/WelcomeTour/WelcomeTour.stories.tsx +27 -22
- package/src/components/WelcomeTour/WelcomeTour.tsx +18 -19
- package/src/constants.ts +7 -0
- package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.tsx +38 -0
- package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.tsx +28 -0
- package/src/containers/ShortcutsDialogContent/index.ts +5 -0
- package/src/containers/ShortcutsHints/ShortcutsHints.tsx +5 -0
- package/src/containers/ShortcutsHints/index.ts +5 -0
- package/src/containers/ShortcutsList/ShortcutsList.tsx +5 -0
- package/src/containers/ShortcutsList/index.ts +5 -0
- package/src/containers/index.ts +9 -0
- package/src/hooks/useHelp.tsx +1 -1
- package/src/index.ts +2 -1
- package/src/meta.ts +8 -6
- 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 +24 -0
- package/src/types/index.ts +6 -0
- package/src/{types.ts → types/schema.ts} +2 -13
- package/dist/lib/browser/app-graph-builder-IXCF4ZDE.mjs +0 -79
- package/dist/lib/browser/app-graph-builder-IXCF4ZDE.mjs.map +0 -7
- package/dist/lib/browser/chunk-27RZVOIE.mjs +0 -408
- package/dist/lib/browser/chunk-27RZVOIE.mjs.map +0 -7
- package/dist/lib/browser/chunk-3Y4CMOZP.mjs +0 -13
- package/dist/lib/browser/chunk-3Y4CMOZP.mjs.map +0 -7
- package/dist/lib/browser/chunk-LDRUZNSN.mjs +0 -16
- package/dist/lib/browser/chunk-LDRUZNSN.mjs.map +0 -7
- package/dist/lib/browser/chunk-WAN2NFYE.mjs +0 -36
- package/dist/lib/browser/chunk-WAN2NFYE.mjs.map +0 -7
- package/dist/lib/browser/react-root-A32LXEU4.mjs +0 -34
- package/dist/lib/browser/react-root-A32LXEU4.mjs.map +0 -7
- package/dist/lib/browser/react-surface-DIIOUUMT.mjs +0 -36
- package/dist/lib/browser/react-surface-DIIOUUMT.mjs.map +0 -7
- package/dist/lib/browser/state-FWUZG6NL.mjs +0 -29
- package/dist/lib/browser/state-FWUZG6NL.mjs.map +0 -7
- package/dist/lib/browser/types.mjs +0 -12
- package/dist/lib/node-esm/app-graph-builder-5QQRWRWG.mjs +0 -80
- package/dist/lib/node-esm/app-graph-builder-5QQRWRWG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6JMO5FFN.mjs +0 -37
- package/dist/lib/node-esm/chunk-6JMO5FFN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CXQ5LKQI.mjs +0 -17
- package/dist/lib/node-esm/chunk-CXQ5LKQI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PU7X4MJO.mjs +0 -409
- package/dist/lib/node-esm/chunk-PU7X4MJO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-T523OGIV.mjs +0 -15
- package/dist/lib/node-esm/chunk-T523OGIV.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -115
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/lib/node-esm/react-root-Q6PGYYYP.mjs +0 -35
- package/dist/lib/node-esm/react-root-Q6PGYYYP.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-QEIKNNW3.mjs +0 -37
- package/dist/lib/node-esm/react-surface-QEIKNNW3.mjs.map +0 -7
- package/dist/lib/node-esm/state-Y476FGII.mjs +0 -30
- package/dist/lib/node-esm/state-Y476FGII.mjs.map +0 -7
- package/dist/lib/node-esm/types.mjs +0 -13
- package/dist/lib/node-esm/types.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts +0 -10
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts +0 -4
- package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -29
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -13
- package/src/components/Shortcuts/ShortcutsDialog.tsx +0 -34
- /package/dist/lib/browser/{types.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/meta.mjs.map → browser/types/index.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,25 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-help",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.fcfe5033a5",
|
|
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,
|
|
10
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
|
+
},
|
|
11
24
|
"exports": {
|
|
12
25
|
".": {
|
|
26
|
+
"source": "./src/index.ts",
|
|
13
27
|
"types": "./dist/types/src/index.d.ts",
|
|
14
28
|
"browser": "./dist/lib/browser/index.mjs"
|
|
15
29
|
},
|
|
16
30
|
"./meta": {
|
|
31
|
+
"source": "./src/meta.ts",
|
|
17
32
|
"types": "./dist/types/src/meta.d.ts",
|
|
18
33
|
"browser": "./dist/lib/browser/meta.mjs"
|
|
19
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
|
+
},
|
|
20
40
|
"./types": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
41
|
+
"source": "./src/types/index.ts",
|
|
42
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
43
|
+
"browser": "./dist/lib/browser/types/index.mjs"
|
|
23
44
|
}
|
|
24
45
|
},
|
|
25
46
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -29,7 +50,10 @@
|
|
|
29
50
|
"dist/types/src/meta.d.ts"
|
|
30
51
|
],
|
|
31
52
|
"types": [
|
|
32
|
-
"dist/types/src/types.d.ts"
|
|
53
|
+
"dist/types/src/types/index.d.ts"
|
|
54
|
+
],
|
|
55
|
+
"operations": [
|
|
56
|
+
"dist/types/src/operations/index.d.ts"
|
|
33
57
|
]
|
|
34
58
|
}
|
|
35
59
|
},
|
|
@@ -38,48 +62,48 @@
|
|
|
38
62
|
"src"
|
|
39
63
|
],
|
|
40
64
|
"dependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
65
|
+
"@effect-atom/atom": "^0.5.1",
|
|
66
|
+
"@fluentui/react-tabster": "9.26.11",
|
|
43
67
|
"react-joyride": "^2.7.2",
|
|
44
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
45
|
-
"@dxos/app-graph": "0.8.4-main.
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/debug": "0.8.4-main.
|
|
48
|
-
"@dxos/echo
|
|
49
|
-
"@dxos/keyboard": "0.8.4-main.
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/plugin-
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
68
|
+
"@dxos/app-framework": "0.8.4-main.fcfe5033a5",
|
|
69
|
+
"@dxos/app-graph": "0.8.4-main.fcfe5033a5",
|
|
70
|
+
"@dxos/app-toolkit": "0.8.4-main.fcfe5033a5",
|
|
71
|
+
"@dxos/debug": "0.8.4-main.fcfe5033a5",
|
|
72
|
+
"@dxos/echo": "0.8.4-main.fcfe5033a5",
|
|
73
|
+
"@dxos/keyboard": "0.8.4-main.fcfe5033a5",
|
|
74
|
+
"@dxos/operation": "0.8.4-main.fcfe5033a5",
|
|
75
|
+
"@dxos/plugin-client": "0.8.4-main.fcfe5033a5",
|
|
76
|
+
"@dxos/plugin-graph": "0.8.4-main.fcfe5033a5",
|
|
77
|
+
"@dxos/effect": "0.8.4-main.fcfe5033a5",
|
|
78
|
+
"@dxos/react-client": "0.8.4-main.fcfe5033a5",
|
|
79
|
+
"@dxos/util": "0.8.4-main.fcfe5033a5",
|
|
80
|
+
"@dxos/plugin-space": "0.8.4-main.fcfe5033a5"
|
|
56
81
|
},
|
|
57
82
|
"devDependencies": {
|
|
58
|
-
"@effect-
|
|
59
|
-
"@effect/platform": "0.
|
|
60
|
-
"@
|
|
61
|
-
"@types/react": "~
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"react": "~
|
|
65
|
-
"react-dom": "~18.2.0",
|
|
83
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
84
|
+
"@effect/platform": "0.94.4",
|
|
85
|
+
"@types/react": "~19.2.7",
|
|
86
|
+
"@types/react-dom": "~19.2.3",
|
|
87
|
+
"effect": "3.20.0",
|
|
88
|
+
"react": "~19.2.3",
|
|
89
|
+
"react-dom": "~19.2.3",
|
|
66
90
|
"react-floater": "0.7.9",
|
|
67
91
|
"type-fest": "4.10.1",
|
|
68
|
-
"vite": "
|
|
69
|
-
"@dxos/random": "0.8.4-main.
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/react-ui
|
|
72
|
-
"@dxos/
|
|
92
|
+
"vite": "^7.1.11",
|
|
93
|
+
"@dxos/random": "0.8.4-main.fcfe5033a5",
|
|
94
|
+
"@dxos/plugin-testing": "0.8.4-main.fcfe5033a5",
|
|
95
|
+
"@dxos/react-ui": "0.8.4-main.fcfe5033a5",
|
|
96
|
+
"@dxos/ui-theme": "0.8.4-main.fcfe5033a5",
|
|
97
|
+
"@dxos/storybook-utils": "0.8.4-main.fcfe5033a5"
|
|
73
98
|
},
|
|
74
99
|
"peerDependencies": {
|
|
75
|
-
"@effect-
|
|
76
|
-
"@effect/platform": "
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"react": "~
|
|
80
|
-
"
|
|
81
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
82
|
-
"@dxos/react-ui-theme": "0.8.4-main.f9ba587"
|
|
100
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
101
|
+
"@effect/platform": "0.94.4",
|
|
102
|
+
"effect": "3.20.0",
|
|
103
|
+
"react": "~19.2.3",
|
|
104
|
+
"react-dom": "~19.2.3",
|
|
105
|
+
"@dxos/ui-theme": "0.8.4-main.fcfe5033a5",
|
|
106
|
+
"@dxos/react-ui": "0.8.4-main.fcfe5033a5"
|
|
83
107
|
},
|
|
84
108
|
"publishConfig": {
|
|
85
109
|
"access": "public"
|
package/src/HelpPlugin.tsx
CHANGED
|
@@ -2,56 +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';
|
|
7
|
+
|
|
8
|
+
import { AppGraphBuilder, HelpState, OperationHandler, ReactRoot, ReactSurface } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { type Step } from '#types';
|
|
6
11
|
|
|
7
|
-
import { AppGraphBuilder, HelpState, ReactRoot, ReactSurface } from './capabilities';
|
|
8
|
-
import { HelpCapabilities } from './capabilities/capabilities';
|
|
9
|
-
import { meta } from './meta';
|
|
10
12
|
import { translations } from './translations';
|
|
11
|
-
import { type Step, HelpAction } from './types';
|
|
12
13
|
|
|
13
14
|
export type HelpPluginOptions = { steps?: Step[] };
|
|
14
15
|
|
|
15
|
-
export const HelpPlugin = (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}),
|
|
32
|
-
defineModule({
|
|
33
|
-
id: `${meta.id}/module/react-surface`,
|
|
34
|
-
activatesOn: Events.SetupReactSurface,
|
|
35
|
-
activate: ReactSurface,
|
|
36
|
-
}),
|
|
37
|
-
defineModule({
|
|
38
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
39
|
-
activatesOn: Events.SetupIntentResolver,
|
|
40
|
-
activate: (context) =>
|
|
41
|
-
contributes(
|
|
42
|
-
Capabilities.IntentResolver,
|
|
43
|
-
createResolver({
|
|
44
|
-
intent: HelpAction.Start,
|
|
45
|
-
resolve: () => {
|
|
46
|
-
const state = context.getCapability(HelpCapabilities.MutableState);
|
|
47
|
-
state.running = true;
|
|
48
|
-
},
|
|
49
|
-
}),
|
|
50
|
-
),
|
|
51
|
-
}),
|
|
52
|
-
defineModule({
|
|
53
|
-
id: `${meta.id}/module/app-graph-builder`,
|
|
54
|
-
activatesOn: Events.SetupAppGraph,
|
|
55
|
-
activate: AppGraphBuilder,
|
|
56
|
-
}),
|
|
57
|
-
]);
|
|
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 }),
|
|
21
|
+
Plugin.addModule({
|
|
22
|
+
activatesOn: ActivationEvents.Startup,
|
|
23
|
+
activate: HelpState,
|
|
24
|
+
}),
|
|
25
|
+
Plugin.addModule(({ steps = [] }) => ({
|
|
26
|
+
id: 'react-root',
|
|
27
|
+
activatesOn: ActivationEvents.Startup,
|
|
28
|
+
activate: () => ReactRoot(steps),
|
|
29
|
+
})),
|
|
30
|
+
Plugin.make,
|
|
31
|
+
);
|
|
@@ -2,75 +2,62 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { Option, pipe } from 'effect';
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
7
6
|
|
|
8
|
-
import { Capabilities,
|
|
9
|
-
import {
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { GraphBuilder, Node, NodeMatcher } from '@dxos/app-graph';
|
|
9
|
+
import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
|
|
10
|
+
import { Operation } from '@dxos/operation';
|
|
10
11
|
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { HelpAction } from '../types';
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
import { HelpOperation } from '#operations';
|
|
14
|
+
import { HelpCapabilities } from '#types';
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
keyBinding: {
|
|
39
|
-
macos: 'shift+meta+/',
|
|
40
|
-
// TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
|
|
41
|
-
windows: 'shift+ctrl+/',
|
|
42
|
-
linux: 'shift+ctrl+?',
|
|
43
|
-
},
|
|
44
|
-
testId: 'helpPlugin.openHelp',
|
|
45
|
-
},
|
|
16
|
+
import { SHORTCUTS_DIALOG } from '../constants';
|
|
17
|
+
|
|
18
|
+
export default Capability.makeModule(
|
|
19
|
+
Effect.fnUntraced(function* () {
|
|
20
|
+
const extensions = yield* GraphBuilder.createExtension({
|
|
21
|
+
id: 'root',
|
|
22
|
+
match: NodeMatcher.whenRoot,
|
|
23
|
+
actions: () =>
|
|
24
|
+
Effect.succeed([
|
|
25
|
+
Node.makeAction({
|
|
26
|
+
id: HelpOperation.Start.meta.key,
|
|
27
|
+
data: Effect.fnUntraced(function* () {
|
|
28
|
+
yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({ ...s, showHints: true }));
|
|
29
|
+
yield* Operation.invoke(HelpOperation.Start);
|
|
30
|
+
}),
|
|
31
|
+
properties: {
|
|
32
|
+
label: ['open-help-tour.message', { ns: meta.id }],
|
|
33
|
+
icon: 'ph--info--regular',
|
|
34
|
+
keyBinding: {
|
|
35
|
+
macos: 'shift+meta+/',
|
|
36
|
+
windows: 'shift+ctrl+/',
|
|
37
|
+
linux: 'shift+ctrl+?',
|
|
46
38
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
properties: {
|
|
64
|
-
label: ['open shortcuts label', { ns: HELP_PLUGIN }],
|
|
65
|
-
icon: 'ph--keyboard--regular',
|
|
66
|
-
keyBinding: {
|
|
67
|
-
macos: 'meta+ctrl+/',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
39
|
+
testId: 'helpPlugin.openHelp',
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
Node.makeAction({
|
|
43
|
+
id: 'open-shortcuts',
|
|
44
|
+
data: Effect.fnUntraced(function* () {
|
|
45
|
+
yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({ ...s, showHints: true }));
|
|
46
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
47
|
+
subject: SHORTCUTS_DIALOG,
|
|
48
|
+
});
|
|
49
|
+
}),
|
|
50
|
+
properties: {
|
|
51
|
+
label: ['open-shortcuts.label', { ns: meta.id }],
|
|
52
|
+
icon: 'ph--keyboard--regular',
|
|
53
|
+
keyBinding: {
|
|
54
|
+
macos: 'meta+ctrl+/',
|
|
70
55
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
56
|
+
},
|
|
57
|
+
}),
|
|
58
|
+
]),
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
62
|
+
}),
|
|
63
|
+
);
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
6
7
|
|
|
7
|
-
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
8
|
-
export const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
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
|
+
);
|
|
@@ -2,31 +2,35 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
|
|
7
|
-
import { Capabilities,
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { useAtomCapabilityState } from '@dxos/app-framework/ui';
|
|
8
10
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { type Step } from '../types';
|
|
11
|
+
import { WelcomeTour } from '#components';
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
import { HelpCapabilities, type Step } from '#types';
|
|
13
14
|
|
|
14
|
-
export default (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
+
);
|
|
@@ -2,29 +2,35 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
|
|
7
|
-
import { Capabilities,
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
11
|
|
|
9
|
-
import {
|
|
10
|
-
import { HELP_PLUGIN } from '../meta';
|
|
12
|
+
import { ShortcutsDialogContent, ShortcutsHints, ShortcutsList } from '#containers';
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
14
|
+
import { SHORTCUTS_DIALOG } from '../constants';
|
|
15
|
+
|
|
16
|
+
export default Capability.makeModule(() =>
|
|
17
|
+
Effect.succeed(
|
|
18
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
19
|
+
Surface.create({
|
|
20
|
+
id: 'hints',
|
|
21
|
+
role: 'hints',
|
|
22
|
+
component: () => <ShortcutsHints />,
|
|
23
|
+
}),
|
|
24
|
+
Surface.create({
|
|
25
|
+
id: 'keyshortcuts',
|
|
26
|
+
role: 'keyshortcuts',
|
|
27
|
+
component: () => <ShortcutsList />,
|
|
28
|
+
}),
|
|
29
|
+
Surface.create({
|
|
30
|
+
id: SHORTCUTS_DIALOG,
|
|
31
|
+
filter: AppSurface.component(AppSurface.Dialog, SHORTCUTS_DIALOG),
|
|
32
|
+
component: () => <ShortcutsDialogContent />,
|
|
33
|
+
}),
|
|
34
|
+
]),
|
|
35
|
+
),
|
|
36
|
+
);
|
|
@@ -2,22 +2,26 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { LocalStorageStore } from '@dxos/local-storage';
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
7
6
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { createKvsStore } from '@dxos/effect';
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
running: false,
|
|
14
|
-
showHints: true,
|
|
15
|
-
showWelcome: true,
|
|
16
|
-
});
|
|
10
|
+
import { meta } from '#meta';
|
|
11
|
+
import { HelpCapabilities } from '#types';
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
+
});
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
}
|
|
25
|
+
return Capability.contributes(HelpCapabilities.State, stateAtom);
|
|
26
|
+
}),
|
|
27
|
+
);
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { type KeyBinding, Keyboard } from '@dxos/keyboard';
|
|
8
|
-
import {
|
|
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(
|
|
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} />
|
|
@@ -31,9 +32,16 @@ export const ShortcutsHints = ({ onClose }: { onClose?: () => void }) => {
|
|
|
31
32
|
<Shortcut key={binding.shortcut} binding={binding} />
|
|
32
33
|
))}
|
|
33
34
|
{onClose && (
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
<IconButton
|
|
36
|
+
icon='ph--x--regular'
|
|
37
|
+
size={4}
|
|
38
|
+
label='Close'
|
|
39
|
+
iconOnly
|
|
40
|
+
noTooltip
|
|
41
|
+
variant='ghost'
|
|
42
|
+
classNames='p-0 cursor-pointer'
|
|
43
|
+
onClick={onClose}
|
|
44
|
+
/>
|
|
37
45
|
)}
|
|
38
46
|
</div>
|
|
39
47
|
);
|
|
@@ -6,13 +6,14 @@ import React, { Fragment } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Keyboard } from '@dxos/keyboard';
|
|
8
8
|
import { toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { mx } from '@dxos/
|
|
9
|
+
import { mx } from '@dxos/ui-theme';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
10
12
|
|
|
11
13
|
import { Key } from './Key';
|
|
12
|
-
import { HELP_PLUGIN } from '../../meta';
|
|
13
14
|
|
|
14
15
|
export const ShortcutsList = () => {
|
|
15
|
-
const { t } = useTranslation(
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
16
17
|
const bindings = Keyboard.singleton.getBindings();
|
|
17
18
|
|
|
18
19
|
// TODO(burdon): Get shortcuts from TextEditor.
|
|
@@ -21,11 +22,11 @@ export const ShortcutsList = () => {
|
|
|
21
22
|
});
|
|
22
23
|
|
|
23
24
|
return (
|
|
24
|
-
<dl className={mx('
|
|
25
|
+
<dl className={mx('w-fit grid grid-cols-[min-content_minmax(12rem,1fr)] gap-2 my-4 text-subdued select-none')}>
|
|
25
26
|
{bindings.map((binding, i) => (
|
|
26
27
|
<Fragment key={i}>
|
|
27
28
|
<Key binding={binding.shortcut} />
|
|
28
|
-
<span role='definition' className='
|
|
29
|
+
<span role='definition' className='ms-4' aria-labelledby={binding.shortcut}>
|
|
29
30
|
{toLocalizedString(binding.data, t)}
|
|
30
31
|
</span>
|
|
31
32
|
</Fragment>
|
|
@@ -4,13 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { descriptionText } from '@dxos/react-ui-theme';
|
|
8
|
-
|
|
9
7
|
import { ShortcutsList } from './ShortcutsList';
|
|
10
8
|
|
|
11
9
|
export const ShortcutsSection = () => {
|
|
12
10
|
return (
|
|
13
|
-
<section className=
|
|
11
|
+
<section className='text-description'>
|
|
14
12
|
<ShortcutsList />
|
|
15
13
|
</section>
|
|
16
14
|
);
|