@dxos/plugin-help 0.7.4 → 0.7.5-labs.5f04cf6
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-24E4WRKH.mjs +36 -0
- package/dist/lib/browser/chunk-24E4WRKH.mjs.map +7 -0
- package/dist/lib/browser/chunk-76XWX6N3.mjs +13 -0
- 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 +71 -503
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +3 -5
- 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 +12 -0
- package/dist/lib/browser/types.mjs.map +7 -0
- 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/components/Shortcuts/ShortcutsDialog.d.ts +1 -0
- package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts.map +1 -1
- 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 -5
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +15 -6
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +23 -23
- package/src/HelpPlugin.tsx +45 -121
- 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/components/Shortcuts/ShortcutsDialog.tsx +2 -0
- package/src/index.ts +4 -9
- package/src/meta.ts +1 -6
- package/src/types.ts +12 -9
- package/dist/lib/browser/chunk-2EMBCGD5.mjs +0 -19
- package/dist/lib/browser/chunk-2EMBCGD5.mjs.map +0 -7
package/src/HelpPlugin.tsx
CHANGED
|
@@ -2,129 +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
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { LocalStorageStore } from '@dxos/local-storage';
|
|
11
|
-
|
|
12
|
-
import { HelpContextProvider, ShortcutsDialogContent, ShortcutsHints, ShortcutsList } from './components';
|
|
13
|
-
import meta, { HelpAction, HELP_PLUGIN } from './meta';
|
|
7
|
+
import { AppGraphBuilder, HelpState, ReactContext, ReactSurface } from './capabilities';
|
|
8
|
+
import { HelpCapabilities } from './capabilities/capabilities';
|
|
9
|
+
import { meta } from './meta';
|
|
14
10
|
import translations from './translations';
|
|
15
|
-
import { type Step,
|
|
16
|
-
|
|
17
|
-
export type HelpSettingsProps = { showHints?: boolean; showWelcome?: boolean };
|
|
11
|
+
import { type Step, HelpAction } from './types';
|
|
18
12
|
|
|
19
13
|
export type HelpPluginOptions = { steps?: Step[] };
|
|
20
14
|
|
|
21
|
-
export const HelpPlugin = ({ steps = [] }: HelpPluginOptions)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
await intentPlugin?.provides.intent.dispatch({
|
|
62
|
-
plugin: HELP_PLUGIN,
|
|
63
|
-
action: HelpAction.START,
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
properties: {
|
|
67
|
-
label: ['open help tour', { ns: HELP_PLUGIN }],
|
|
68
|
-
icon: 'ph--info--regular',
|
|
69
|
-
keyBinding: {
|
|
70
|
-
macos: 'shift+meta+/',
|
|
71
|
-
// TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
|
|
72
|
-
windows: 'shift+ctrl+/',
|
|
73
|
-
linux: 'shift+ctrl+?',
|
|
74
|
-
},
|
|
75
|
-
testId: 'helpPlugin.openHelp',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: 'dxos.org/plugin/help/open-shortcuts',
|
|
80
|
-
data: async () => {
|
|
81
|
-
settings.values.showHints = true;
|
|
82
|
-
await intentPlugin?.provides.intent.dispatch({
|
|
83
|
-
action: LayoutAction.SET_LAYOUT,
|
|
84
|
-
data: {
|
|
85
|
-
element: 'dialog',
|
|
86
|
-
component: `${HELP_PLUGIN}/Shortcuts`,
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
},
|
|
90
|
-
properties: {
|
|
91
|
-
label: ['open shortcuts label', { ns: HELP_PLUGIN }],
|
|
92
|
-
icon: 'ph--keyboard--regular',
|
|
93
|
-
keyBinding: {
|
|
94
|
-
macos: 'meta+ctrl+/',
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
});
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
surface: {
|
|
103
|
-
component: ({ data, role }) => {
|
|
104
|
-
switch (role) {
|
|
105
|
-
case 'hints':
|
|
106
|
-
return <ShortcutsHints />;
|
|
107
|
-
case 'keyshortcuts':
|
|
108
|
-
return <ShortcutsList />;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
switch (data.component) {
|
|
112
|
-
case `${HELP_PLUGIN}/Shortcuts`:
|
|
113
|
-
return <ShortcutsDialogContent />;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return null;
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
intent: {
|
|
120
|
-
resolver: async (intent) => {
|
|
121
|
-
switch (intent.action) {
|
|
122
|
-
case HelpAction.START:
|
|
123
|
-
state.running = true;
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
|
-
};
|
|
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,
|
|
43
|
+
createResolver(HelpAction.Start, () => {
|
|
44
|
+
const state = context.requestCapability(HelpCapabilities.MutableState);
|
|
45
|
+
state.running = true;
|
|
46
|
+
}),
|
|
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
|
};
|
|
@@ -9,6 +9,8 @@ import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
|
9
9
|
import { ShortcutsList } from './ShortcutsList';
|
|
10
10
|
import { HELP_PLUGIN } from '../../meta';
|
|
11
11
|
|
|
12
|
+
export const SHORTCUTS_DIALOG = `${HELP_PLUGIN}/ShortcutsDialog`;
|
|
13
|
+
|
|
12
14
|
export const ShortcutsDialogContent = () => {
|
|
13
15
|
const { t } = useTranslation(HELP_PLUGIN);
|
|
14
16
|
|
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
|
@@ -7,13 +7,8 @@ import { type PluginMeta } from '@dxos/app-framework';
|
|
|
7
7
|
// TODO(burdon): Rename Guide? Help?
|
|
8
8
|
export const HELP_PLUGIN = 'dxos.org/plugin/help';
|
|
9
9
|
|
|
10
|
-
export
|
|
10
|
+
export const meta = {
|
|
11
11
|
id: HELP_PLUGIN,
|
|
12
12
|
name: 'Help',
|
|
13
13
|
icon: 'ph--info--regular',
|
|
14
14
|
} satisfies PluginMeta;
|
|
15
|
-
|
|
16
|
-
const HELP_ACTION = `${HELP_PLUGIN}/action`;
|
|
17
|
-
export enum HelpAction {
|
|
18
|
-
START = `${HELP_ACTION}/start`,
|
|
19
|
-
}
|
package/src/types.ts
CHANGED
|
@@ -5,16 +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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
type SurfaceProvides,
|
|
13
|
-
type TranslationsProvides,
|
|
14
|
-
} from '@dxos/app-framework';
|
|
8
|
+
import { type PluginsContext } from '@dxos/app-framework';
|
|
9
|
+
import { S } from '@dxos/echo-schema';
|
|
10
|
+
|
|
11
|
+
import { HELP_PLUGIN } from './meta';
|
|
15
12
|
|
|
16
13
|
export type Step = BaseStep & {
|
|
17
|
-
before?: (context:
|
|
14
|
+
before?: (context: PluginsContext) => void;
|
|
18
15
|
};
|
|
19
16
|
|
|
20
17
|
export type HelpContextType = {
|
|
@@ -35,4 +32,10 @@ export const HelpContext: Context<HelpContextType> = createContext<HelpContextTy
|
|
|
35
32
|
stop: () => {},
|
|
36
33
|
});
|
|
37
34
|
|
|
38
|
-
export
|
|
35
|
+
export const HELP_ACTION = `${HELP_PLUGIN}/action`;
|
|
36
|
+
export namespace HelpAction {
|
|
37
|
+
export class Start extends S.TaggedClass<Start>()(`${HELP_ACTION}/start`, {
|
|
38
|
+
input: S.Void,
|
|
39
|
+
output: S.Void,
|
|
40
|
+
}) {}
|
|
41
|
+
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// packages/plugins/plugin-help/src/meta.ts
|
|
2
|
-
var HELP_PLUGIN = "dxos.org/plugin/help";
|
|
3
|
-
var meta_default = {
|
|
4
|
-
id: HELP_PLUGIN,
|
|
5
|
-
name: "Help",
|
|
6
|
-
icon: "ph--info--regular"
|
|
7
|
-
};
|
|
8
|
-
var HELP_ACTION = `${HELP_PLUGIN}/action`;
|
|
9
|
-
var HelpAction;
|
|
10
|
-
(function(HelpAction2) {
|
|
11
|
-
HelpAction2[HelpAction2["START"] = `${HELP_ACTION}/start`] = "START";
|
|
12
|
-
})(HelpAction || (HelpAction = {}));
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
HELP_PLUGIN,
|
|
16
|
-
meta_default,
|
|
17
|
-
HelpAction
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=chunk-2EMBCGD5.mjs.map
|
|
@@ -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\nconst HELP_ACTION = `${HELP_PLUGIN}/action`;\nexport enum HelpAction {\n START = `${HELP_ACTION}/start`,\n}\n"],
|
|
5
|
-
"mappings": ";AAOO,IAAMA,cAAc;AAE3B,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;EACNC,MAAM;AACR;AAEA,IAAMC,cAAc,GAAGJ,WAAAA;;UACXK,aAAAA;qCACF,GAAGD,WAAAA,QAAmB,IAAA;GADpBC,eAAAA,aAAAA,CAAAA,EAAAA;",
|
|
6
|
-
"names": ["HELP_PLUGIN", "id", "name", "icon", "HELP_ACTION", "HelpAction"]
|
|
7
|
-
}
|