@dxos/plugin-help 0.7.5-main.9cb18ac → 0.7.5-main.9d2a38b
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/app-graph-builder-G3FCDRBG.mjs +75 -0
- package/dist/lib/browser/app-graph-builder-G3FCDRBG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RHSC3EWO.mjs → chunk-24E4WRKH.mjs} +2 -2
- package/dist/lib/browser/chunk-24E4WRKH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-STC3ORFI.mjs → chunk-76XWX6N3.mjs} +3 -3
- package/dist/lib/browser/chunk-76XWX6N3.mjs.map +7 -0
- package/dist/lib/browser/chunk-GJTAQWB6.mjs +16 -0
- package/dist/lib/browser/chunk-GJTAQWB6.mjs.map +7 -0
- package/dist/lib/browser/chunk-VNAN5GRY.mjs +361 -0
- package/dist/lib/browser/chunk-VNAN5GRY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +67 -484
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +3 -3
- package/dist/lib/browser/react-context-SIW6XKOC.mjs +34 -0
- package/dist/lib/browser/react-context-SIW6XKOC.mjs.map +7 -0
- package/dist/lib/browser/react-surface-TZZUXIVX.mjs +36 -0
- package/dist/lib/browser/react-surface-TZZUXIVX.mjs.map +7 -0
- package/dist/lib/browser/state-SLKOTRHH.mjs +29 -0
- package/dist/lib/browser/state-SLKOTRHH.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +2 -2
- package/dist/types/src/HelpPlugin.d.ts +2 -7
- package/dist/types/src/HelpPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +10 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +186 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context.d.ts +9 -0
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +4 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +2 -6
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -25
- package/src/HelpPlugin.tsx +42 -125
- package/src/capabilities/app-graph-builder.ts +58 -0
- package/src/capabilities/capabilities.ts +13 -0
- package/src/capabilities/index.ts +12 -0
- package/src/capabilities/react-context.tsx +34 -0
- package/src/capabilities/react-surface.tsx +30 -0
- package/src/capabilities/state.ts +23 -0
- package/src/components/HelpContextProvider/HelpContextProvider.tsx +5 -5
- package/src/index.ts +4 -9
- package/src/meta.ts +1 -1
- package/src/types.ts +2 -10
- package/dist/lib/browser/chunk-RHSC3EWO.mjs.map +0 -7
- package/dist/lib/browser/chunk-STC3ORFI.mjs.map +0 -7
package/src/HelpPlugin.tsx
CHANGED
|
@@ -2,136 +2,53 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { createResolver, defineModule, definePlugin, Events, contributes, Capabilities } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
parseIntentPlugin,
|
|
11
|
-
LayoutAction,
|
|
12
|
-
createSurface,
|
|
13
|
-
createResolver,
|
|
14
|
-
createIntent,
|
|
15
|
-
} from '@dxos/app-framework';
|
|
16
|
-
import { createExtension, type Node } from '@dxos/app-graph';
|
|
17
|
-
import { create } from '@dxos/live-object';
|
|
18
|
-
import { LocalStorageStore } from '@dxos/local-storage';
|
|
19
|
-
|
|
20
|
-
import {
|
|
21
|
-
HelpContextProvider,
|
|
22
|
-
SHORTCUTS_DIALOG,
|
|
23
|
-
ShortcutsDialogContent,
|
|
24
|
-
ShortcutsHints,
|
|
25
|
-
ShortcutsList,
|
|
26
|
-
} from './components';
|
|
27
|
-
import meta, { HELP_PLUGIN } from './meta';
|
|
7
|
+
import { AppGraphBuilder, HelpState, ReactContext, ReactSurface } from './capabilities';
|
|
8
|
+
import { HelpCapabilities } from './capabilities/capabilities';
|
|
9
|
+
import { meta } from './meta';
|
|
28
10
|
import translations from './translations';
|
|
29
|
-
import { type Step,
|
|
30
|
-
|
|
31
|
-
export type HelpSettingsProps = { showHints?: boolean; showWelcome?: boolean };
|
|
11
|
+
import { type Step, HelpAction } from './types';
|
|
32
12
|
|
|
33
13
|
export type HelpPluginOptions = { steps?: Step[] };
|
|
34
14
|
|
|
35
|
-
export const HelpPlugin = ({ steps = [] }: HelpPluginOptions)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
graph: {
|
|
64
|
-
builder: (plugins) => {
|
|
65
|
-
const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatchPromise;
|
|
66
|
-
|
|
67
|
-
return createExtension({
|
|
68
|
-
id: HELP_PLUGIN,
|
|
69
|
-
filter: (node): node is Node<null> => node.id === 'root',
|
|
70
|
-
actions: () => [
|
|
71
|
-
{
|
|
72
|
-
id: HelpAction.Start._tag,
|
|
73
|
-
data: async () => {
|
|
74
|
-
settings.values.showHints = true;
|
|
75
|
-
await dispatch?.(createIntent(HelpAction.Start));
|
|
76
|
-
},
|
|
77
|
-
properties: {
|
|
78
|
-
label: ['open help tour', { ns: HELP_PLUGIN }],
|
|
79
|
-
icon: 'ph--info--regular',
|
|
80
|
-
keyBinding: {
|
|
81
|
-
macos: 'shift+meta+/',
|
|
82
|
-
// TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
|
|
83
|
-
windows: 'shift+ctrl+/',
|
|
84
|
-
linux: 'shift+ctrl+?',
|
|
85
|
-
},
|
|
86
|
-
testId: 'helpPlugin.openHelp',
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
id: 'dxos.org/plugin/help/open-shortcuts',
|
|
91
|
-
data: async () => {
|
|
92
|
-
settings.values.showHints = true;
|
|
93
|
-
await dispatch?.(
|
|
94
|
-
createIntent(LayoutAction.SetLayout, { element: 'dialog', component: SHORTCUTS_DIALOG }),
|
|
95
|
-
);
|
|
96
|
-
},
|
|
97
|
-
properties: {
|
|
98
|
-
label: ['open shortcuts label', { ns: HELP_PLUGIN }],
|
|
99
|
-
icon: 'ph--keyboard--regular',
|
|
100
|
-
keyBinding: {
|
|
101
|
-
macos: 'meta+ctrl+/',
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
});
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
surface: {
|
|
110
|
-
definitions: () => [
|
|
111
|
-
createSurface({
|
|
112
|
-
id: `${HELP_PLUGIN}/hints`,
|
|
113
|
-
role: 'hints',
|
|
114
|
-
component: () => <ShortcutsHints />,
|
|
115
|
-
}),
|
|
116
|
-
createSurface({
|
|
117
|
-
id: `${HELP_PLUGIN}/keyshortcuts`,
|
|
118
|
-
role: 'keyshortcuts',
|
|
119
|
-
component: () => <ShortcutsList />,
|
|
120
|
-
}),
|
|
121
|
-
createSurface({
|
|
122
|
-
id: SHORTCUTS_DIALOG,
|
|
123
|
-
role: 'dialog',
|
|
124
|
-
filter: (data): data is any => data.component === SHORTCUTS_DIALOG,
|
|
125
|
-
component: () => <ShortcutsDialogContent />,
|
|
126
|
-
}),
|
|
127
|
-
],
|
|
128
|
-
},
|
|
129
|
-
intent: {
|
|
130
|
-
resolvers: () =>
|
|
15
|
+
export const HelpPlugin = ({ steps = [] }: HelpPluginOptions) =>
|
|
16
|
+
definePlugin(meta, [
|
|
17
|
+
defineModule({
|
|
18
|
+
id: `${meta.id}/module/state`,
|
|
19
|
+
activatesOn: Events.Startup,
|
|
20
|
+
activate: HelpState,
|
|
21
|
+
}),
|
|
22
|
+
defineModule({
|
|
23
|
+
id: `${meta.id}/module/translations`,
|
|
24
|
+
activatesOn: Events.SetupTranslations,
|
|
25
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
26
|
+
}),
|
|
27
|
+
defineModule({
|
|
28
|
+
id: `${meta.id}/module/react-context`,
|
|
29
|
+
activatesOn: Events.Startup,
|
|
30
|
+
activate: () => ReactContext(steps),
|
|
31
|
+
}),
|
|
32
|
+
defineModule({
|
|
33
|
+
id: `${meta.id}/module/react-surface`,
|
|
34
|
+
activatesOn: Events.Startup,
|
|
35
|
+
activate: ReactSurface,
|
|
36
|
+
}),
|
|
37
|
+
defineModule({
|
|
38
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
39
|
+
activatesOn: Events.SetupIntents,
|
|
40
|
+
activate: (context) =>
|
|
41
|
+
contributes(
|
|
42
|
+
Capabilities.IntentResolver,
|
|
131
43
|
createResolver(HelpAction.Start, () => {
|
|
44
|
+
const state = context.requestCapability(HelpCapabilities.MutableState);
|
|
132
45
|
state.running = true;
|
|
133
46
|
}),
|
|
134
|
-
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
}
|
|
47
|
+
),
|
|
48
|
+
}),
|
|
49
|
+
defineModule({
|
|
50
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
51
|
+
activatesOn: Events.SetupAppGraph,
|
|
52
|
+
activate: AppGraphBuilder,
|
|
53
|
+
}),
|
|
54
|
+
]);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, contributes, createIntent, LayoutAction, type PluginsContext } from '@dxos/app-framework';
|
|
6
|
+
import { createExtension, type Node } from '@dxos/app-graph';
|
|
7
|
+
|
|
8
|
+
import { HelpCapabilities } from './capabilities';
|
|
9
|
+
import { SHORTCUTS_DIALOG } from '../components';
|
|
10
|
+
import { HELP_PLUGIN } from '../meta';
|
|
11
|
+
import { HelpAction } from '../types';
|
|
12
|
+
|
|
13
|
+
export default (context: PluginsContext) =>
|
|
14
|
+
contributes(
|
|
15
|
+
Capabilities.AppGraphBuilder,
|
|
16
|
+
createExtension({
|
|
17
|
+
id: HELP_PLUGIN,
|
|
18
|
+
filter: (node): node is Node<null> => node.id === 'root',
|
|
19
|
+
actions: () => [
|
|
20
|
+
{
|
|
21
|
+
id: HelpAction.Start._tag,
|
|
22
|
+
data: async () => {
|
|
23
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
24
|
+
const state = context.requestCapability(HelpCapabilities.MutableState);
|
|
25
|
+
state.showHints = true;
|
|
26
|
+
await dispatch(createIntent(HelpAction.Start));
|
|
27
|
+
},
|
|
28
|
+
properties: {
|
|
29
|
+
label: ['open help tour', { ns: HELP_PLUGIN }],
|
|
30
|
+
icon: 'ph--info--regular',
|
|
31
|
+
keyBinding: {
|
|
32
|
+
macos: 'shift+meta+/',
|
|
33
|
+
// TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
|
|
34
|
+
windows: 'shift+ctrl+/',
|
|
35
|
+
linux: 'shift+ctrl+?',
|
|
36
|
+
},
|
|
37
|
+
testId: 'helpPlugin.openHelp',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'dxos.org/plugin/help/open-shortcuts',
|
|
42
|
+
data: async () => {
|
|
43
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
44
|
+
const state = context.requestCapability(HelpCapabilities.MutableState);
|
|
45
|
+
state.showHints = true;
|
|
46
|
+
await dispatch?.(createIntent(LayoutAction.SetLayout, { element: 'dialog', component: SHORTCUTS_DIALOG }));
|
|
47
|
+
},
|
|
48
|
+
properties: {
|
|
49
|
+
label: ['open shortcuts label', { ns: HELP_PLUGIN }],
|
|
50
|
+
icon: 'ph--keyboard--regular',
|
|
51
|
+
keyBinding: {
|
|
52
|
+
macos: 'meta+ctrl+/',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
}),
|
|
58
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { HELP_PLUGIN } from '../meta';
|
|
8
|
+
|
|
9
|
+
export namespace HelpCapabilities {
|
|
10
|
+
export type State = { running: boolean; showHints: boolean; showWelcome: boolean };
|
|
11
|
+
export const State = defineCapability<Readonly<State>>(`${HELP_PLUGIN}/capability/state`);
|
|
12
|
+
export const MutableState = defineCapability<State>(`${HELP_PLUGIN}/capability/state`);
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { lazy } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
8
|
+
export const ReactContext = lazy(() => import('./react-context'));
|
|
9
|
+
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
10
|
+
export const HelpState = lazy(() => import('./state'));
|
|
11
|
+
|
|
12
|
+
export * from './capabilities';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, contributes, useCapability } from '@dxos/app-framework';
|
|
8
|
+
|
|
9
|
+
import { HelpCapabilities } from './capabilities';
|
|
10
|
+
import { HelpContextProvider } from '../components';
|
|
11
|
+
import { HELP_PLUGIN } from '../meta';
|
|
12
|
+
import { type Step } from '../types';
|
|
13
|
+
|
|
14
|
+
export default (steps: Step[]) =>
|
|
15
|
+
contributes(Capabilities.ReactContext, {
|
|
16
|
+
id: HELP_PLUGIN,
|
|
17
|
+
context: ({ children }) => {
|
|
18
|
+
const state = useCapability(HelpCapabilities.MutableState);
|
|
19
|
+
return (
|
|
20
|
+
<HelpContextProvider
|
|
21
|
+
steps={steps}
|
|
22
|
+
running={state.running}
|
|
23
|
+
onRunningChanged={(newState) => {
|
|
24
|
+
state.running = newState;
|
|
25
|
+
if (!newState) {
|
|
26
|
+
state.showHints = false;
|
|
27
|
+
}
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
{children}
|
|
31
|
+
</HelpContextProvider>
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
+
|
|
9
|
+
import { SHORTCUTS_DIALOG, ShortcutsDialogContent, ShortcutsHints, ShortcutsList } from '../components';
|
|
10
|
+
import { HELP_PLUGIN } from '../meta';
|
|
11
|
+
|
|
12
|
+
export default () =>
|
|
13
|
+
contributes(Capabilities.ReactSurface, [
|
|
14
|
+
createSurface({
|
|
15
|
+
id: `${HELP_PLUGIN}/hints`,
|
|
16
|
+
role: 'hints',
|
|
17
|
+
component: () => <ShortcutsHints />,
|
|
18
|
+
}),
|
|
19
|
+
createSurface({
|
|
20
|
+
id: `${HELP_PLUGIN}/keyshortcuts`,
|
|
21
|
+
role: 'keyshortcuts',
|
|
22
|
+
component: () => <ShortcutsList />,
|
|
23
|
+
}),
|
|
24
|
+
createSurface({
|
|
25
|
+
id: SHORTCUTS_DIALOG,
|
|
26
|
+
role: 'dialog',
|
|
27
|
+
filter: (data): data is any => data.component === SHORTCUTS_DIALOG,
|
|
28
|
+
component: () => <ShortcutsDialogContent />,
|
|
29
|
+
}),
|
|
30
|
+
]);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { contributes } from '@dxos/app-framework';
|
|
6
|
+
import { LocalStorageStore } from '@dxos/local-storage';
|
|
7
|
+
|
|
8
|
+
import { HelpCapabilities } from './capabilities';
|
|
9
|
+
import { HELP_PLUGIN } from '../meta';
|
|
10
|
+
|
|
11
|
+
export default () => {
|
|
12
|
+
const state = new LocalStorageStore<HelpCapabilities.State>(HELP_PLUGIN, {
|
|
13
|
+
running: false,
|
|
14
|
+
showHints: true,
|
|
15
|
+
showWelcome: true,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
state
|
|
19
|
+
.prop({ key: 'showHints', type: LocalStorageStore.bool() })
|
|
20
|
+
.prop({ key: 'showWelcome', type: LocalStorageStore.bool() });
|
|
21
|
+
|
|
22
|
+
return contributes(HelpCapabilities.State, state.values);
|
|
23
|
+
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React, { type PropsWithChildren, useState, useEffect } from 'react';
|
|
6
6
|
import Joyride, { ACTIONS, EVENTS } from 'react-joyride';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { usePluginManager, useCapability, Capabilities } from '@dxos/app-framework';
|
|
9
9
|
|
|
10
10
|
import { type Step, HelpContext } from '../../types';
|
|
11
11
|
import { floaterProps, Tooltip } from '../Tooltip';
|
|
@@ -69,18 +69,18 @@ export const HelpContextProvider = ({
|
|
|
69
69
|
running: runningProp,
|
|
70
70
|
onRunningChanged,
|
|
71
71
|
}: HelpContextProviderProps) => {
|
|
72
|
-
const
|
|
73
|
-
const
|
|
72
|
+
const manager = usePluginManager();
|
|
73
|
+
const layout = useCapability(Capabilities.Layout);
|
|
74
74
|
const [running, setRunning] = useState(!!runningProp && !!getTarget(initialSteps[0]));
|
|
75
75
|
const [stepIndex, _setStepIndex] = useState(0);
|
|
76
76
|
const [steps, setSteps] = useState(initialSteps);
|
|
77
77
|
|
|
78
|
-
const paused =
|
|
78
|
+
const paused = layout.dialogOpen;
|
|
79
79
|
|
|
80
80
|
const setStepIndex = (index: number) => {
|
|
81
81
|
if (runningProp) {
|
|
82
82
|
const step = steps[index];
|
|
83
|
-
step?.before?.(
|
|
83
|
+
step?.before?.(manager.context);
|
|
84
84
|
}
|
|
85
85
|
_setStepIndex(index);
|
|
86
86
|
};
|
package/src/index.ts
CHANGED
|
@@ -2,14 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import { type Step } from './types';
|
|
7
|
-
|
|
8
|
-
export type { Step };
|
|
9
|
-
|
|
5
|
+
export { HelpCapabilities } from './capabilities';
|
|
10
6
|
export * from './components';
|
|
11
|
-
export * from './
|
|
12
|
-
|
|
7
|
+
export * from './meta';
|
|
13
8
|
export * from './HelpPlugin';
|
|
14
|
-
|
|
15
|
-
export
|
|
9
|
+
export * from './hooks';
|
|
10
|
+
export * from './types';
|
package/src/meta.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -5,19 +5,13 @@
|
|
|
5
5
|
import { type Context, createContext } from 'react';
|
|
6
6
|
import { type Step as BaseStep } from 'react-joyride';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
type Plugin,
|
|
10
|
-
type GraphBuilderProvides,
|
|
11
|
-
type IntentResolverProvides,
|
|
12
|
-
type SurfaceProvides,
|
|
13
|
-
type TranslationsProvides,
|
|
14
|
-
} from '@dxos/app-framework';
|
|
8
|
+
import { type PluginsContext } from '@dxos/app-framework';
|
|
15
9
|
import { S } from '@dxos/echo-schema';
|
|
16
10
|
|
|
17
11
|
import { HELP_PLUGIN } from './meta';
|
|
18
12
|
|
|
19
13
|
export type Step = BaseStep & {
|
|
20
|
-
before?: (context:
|
|
14
|
+
before?: (context: PluginsContext) => void;
|
|
21
15
|
};
|
|
22
16
|
|
|
23
17
|
export type HelpContextType = {
|
|
@@ -38,8 +32,6 @@ export const HelpContext: Context<HelpContextType> = createContext<HelpContextTy
|
|
|
38
32
|
stop: () => {},
|
|
39
33
|
});
|
|
40
34
|
|
|
41
|
-
export type HelpPluginProvides = GraphBuilderProvides & IntentResolverProvides & SurfaceProvides & TranslationsProvides;
|
|
42
|
-
|
|
43
35
|
export const HELP_ACTION = `${HELP_PLUGIN}/action`;
|
|
44
36
|
export namespace HelpAction {
|
|
45
37
|
export class Start extends S.TaggedClass<Start>()(`${HELP_ACTION}/start`, {
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Context, createContext } from 'react';\nimport { type Step as BaseStep } from 'react-joyride';\n\nimport {\n type Plugin,\n type GraphBuilderProvides,\n type IntentResolverProvides,\n type SurfaceProvides,\n type TranslationsProvides,\n} from '@dxos/app-framework';\nimport { S } from '@dxos/echo-schema';\n\nimport { HELP_PLUGIN } from './meta';\n\nexport type Step = BaseStep & {\n before?: (context: { plugins: Plugin[]; step: Step }) => void;\n};\n\nexport type HelpContextType = {\n running: boolean;\n steps: Step[];\n setSteps: (steps: Step[]) => void;\n setIndex: (index: number) => void;\n start: () => void;\n stop: () => void;\n};\n\nexport const HelpContext: Context<HelpContextType> = createContext<HelpContextType>({\n running: false,\n steps: [],\n setSteps: () => {},\n setIndex: () => {},\n start: () => {},\n stop: () => {},\n});\n\nexport type HelpPluginProvides = GraphBuilderProvides & IntentResolverProvides & SurfaceProvides & TranslationsProvides;\n\nexport const HELP_ACTION = `${HELP_PLUGIN}/action`;\nexport namespace HelpAction {\n export class Start extends S.TaggedClass<Start>()(`${HELP_ACTION}/start`, {\n input: S.Void,\n output: S.Void,\n }) {}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAAuBA,qBAAqB;AAU5C,SAASC,SAAS;AAiBX,IAAMC,cAAwCC,cAA+B;EAClFC,SAAS;EACTC,OAAO,CAAA;EACPC,UAAU,MAAA;EAAO;EACjBC,UAAU,MAAA;EAAO;EACjBC,OAAO,MAAA;EAAO;EACdC,MAAM,MAAA;EAAO;AACf,CAAA;AAIO,IAAMC,cAAc,GAAGC,WAAAA;;UACbC,aAAAA;EACR,MAAMC,cAAcC,EAAEC,YAAW,EAAU,GAAGL,WAAAA,UAAqB;IACxEM,OAAOF,EAAEG;IACTC,QAAQJ,EAAEG;EACZ,CAAA,EAAA;EAAI;cAHSJ,QAAAA;AAIf,GALiBD,eAAAA,aAAAA,CAAAA,EAAAA;",
|
|
6
|
-
"names": ["createContext", "S", "HelpContext", "createContext", "running", "steps", "setSteps", "setIndex", "start", "stop", "HELP_ACTION", "HELP_PLUGIN", "HelpAction", "Start", "S", "TaggedClass", "input", "Void", "output"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\n// TODO(burdon): Rename Guide? Help?\nexport const HELP_PLUGIN = 'dxos.org/plugin/help';\n\nexport default {\n id: HELP_PLUGIN,\n name: 'Help',\n icon: 'ph--info--regular',\n} satisfies PluginMeta;\n"],
|
|
5
|
-
"mappings": ";AAOO,IAAMA,cAAc;AAE3B,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;EACNC,MAAM;AACR;",
|
|
6
|
-
"names": ["HELP_PLUGIN", "id", "name", "icon"]
|
|
7
|
-
}
|