@dxos/plugin-help 0.8.4-main.b97322e → 0.8.4-main.bc674ce

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.
Files changed (118) hide show
  1. package/dist/lib/browser/app-graph-builder-DX3VXARQ.mjs +79 -0
  2. package/dist/lib/browser/app-graph-builder-DX3VXARQ.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-IM2QVQOH.mjs +16 -0
  4. package/dist/lib/browser/chunk-IM2QVQOH.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-TS66J4C6.mjs +58 -0
  6. package/dist/lib/browser/chunk-TS66J4C6.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-W5XAZM46.mjs +360 -0
  8. package/dist/lib/browser/chunk-W5XAZM46.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +58 -57
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/meta.mjs +1 -3
  13. package/dist/lib/browser/react-root-SZRF6EXG.mjs +43 -0
  14. package/dist/lib/browser/react-root-SZRF6EXG.mjs.map +7 -0
  15. package/dist/lib/browser/{react-surface-SATVEWS5.mjs → react-surface-DWNTJBVM.mjs} +15 -14
  16. package/dist/lib/browser/react-surface-DWNTJBVM.mjs.map +7 -0
  17. package/dist/lib/browser/state-VRPLKT3F.mjs +27 -0
  18. package/dist/lib/browser/state-VRPLKT3F.mjs.map +7 -0
  19. package/dist/lib/browser/types/index.mjs +8 -6
  20. package/dist/types/src/HelpPlugin.d.ts +2 -1
  21. package/dist/types/src/HelpPlugin.d.ts.map +1 -1
  22. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  23. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  24. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  25. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  26. package/dist/types/src/capabilities/index.d.ts +5 -8
  27. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  28. package/dist/types/src/capabilities/operation-resolver/index.d.ts +2 -0
  29. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  30. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  31. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  32. package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
  33. package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
  34. package/dist/types/src/capabilities/react-root/react-root.d.ts +10 -0
  35. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
  36. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  37. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  38. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  39. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  40. package/dist/types/src/capabilities/state/index.d.ts +11 -0
  41. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  42. package/dist/types/src/capabilities/state/state.d.ts +13 -0
  43. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  44. package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts +1 -1
  45. package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts.map +1 -1
  46. package/dist/types/src/components/Shortcuts/ShortcutsHints.d.ts.map +1 -1
  47. package/dist/types/src/components/Shortcuts/ShortcutsList.d.ts.map +1 -1
  48. package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  49. package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts.map +1 -1
  50. package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts +9 -4
  51. package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts.map +1 -1
  52. package/dist/types/src/index.d.ts +1 -1
  53. package/dist/types/src/index.d.ts.map +1 -1
  54. package/dist/types/src/meta.d.ts +2 -3
  55. package/dist/types/src/meta.d.ts.map +1 -1
  56. package/dist/types/src/types/capabilities.d.ts +21 -0
  57. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  58. package/dist/types/src/types/index.d.ts +1 -0
  59. package/dist/types/src/types/index.d.ts.map +1 -1
  60. package/dist/types/src/types/schema.d.ts +17 -13
  61. package/dist/types/src/types/schema.d.ts.map +1 -1
  62. package/dist/types/tsconfig.tsbuildinfo +1 -1
  63. package/package.json +42 -34
  64. package/src/HelpPlugin.tsx +19 -47
  65. package/src/capabilities/app-graph-builder/app-graph-builder.ts +61 -0
  66. package/src/capabilities/app-graph-builder/index.ts +7 -0
  67. package/src/capabilities/index.ts +5 -8
  68. package/src/capabilities/operation-resolver/index.ts +5 -0
  69. package/src/capabilities/operation-resolver/operation-resolver.ts +23 -0
  70. package/src/capabilities/react-root/index.ts +7 -0
  71. package/src/capabilities/react-root/react-root.tsx +36 -0
  72. package/src/capabilities/react-surface/index.ts +7 -0
  73. package/src/capabilities/react-surface/react-surface.tsx +34 -0
  74. package/src/capabilities/state/index.ts +7 -0
  75. package/src/capabilities/state/state.ts +27 -0
  76. package/src/components/Shortcuts/ShortcutsDialog.tsx +7 -9
  77. package/src/components/Shortcuts/ShortcutsHints.tsx +14 -6
  78. package/src/components/Shortcuts/ShortcutsList.tsx +4 -3
  79. package/src/components/Shortcuts/ShortcutsSection.tsx +1 -1
  80. package/src/components/Shortcuts/styles.ts +1 -1
  81. package/src/components/Tooltip/Tooltip.tsx +1 -2
  82. package/src/components/WelcomeTour/WelcomeTour.stories.tsx +18 -12
  83. package/src/components/WelcomeTour/WelcomeTour.tsx +16 -19
  84. package/src/index.ts +1 -1
  85. package/src/meta.ts +8 -6
  86. package/src/types/capabilities.ts +24 -0
  87. package/src/types/index.ts +1 -0
  88. package/src/types/schema.ts +12 -8
  89. package/dist/lib/browser/app-graph-builder-BYCMEBNG.mjs +0 -79
  90. package/dist/lib/browser/app-graph-builder-BYCMEBNG.mjs.map +0 -7
  91. package/dist/lib/browser/chunk-3Y4CMOZP.mjs +0 -13
  92. package/dist/lib/browser/chunk-3Y4CMOZP.mjs.map +0 -7
  93. package/dist/lib/browser/chunk-J2SJSGSX.mjs +0 -34
  94. package/dist/lib/browser/chunk-J2SJSGSX.mjs.map +0 -7
  95. package/dist/lib/browser/chunk-LDRUZNSN.mjs +0 -16
  96. package/dist/lib/browser/chunk-LDRUZNSN.mjs.map +0 -7
  97. package/dist/lib/browser/chunk-MNETJXKS.mjs +0 -409
  98. package/dist/lib/browser/chunk-MNETJXKS.mjs.map +0 -7
  99. package/dist/lib/browser/react-root-W6ZDEGBU.mjs +0 -34
  100. package/dist/lib/browser/react-root-W6ZDEGBU.mjs.map +0 -7
  101. package/dist/lib/browser/react-surface-SATVEWS5.mjs.map +0 -7
  102. package/dist/lib/browser/state-FWUZG6NL.mjs +0 -29
  103. package/dist/lib/browser/state-FWUZG6NL.mjs.map +0 -7
  104. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  105. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  106. package/dist/types/src/capabilities/capabilities.d.ts +0 -10
  107. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  108. package/dist/types/src/capabilities/react-root.d.ts +0 -8
  109. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  110. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  111. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  112. package/dist/types/src/capabilities/state.d.ts +0 -4
  113. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  114. package/src/capabilities/app-graph-builder.ts +0 -76
  115. package/src/capabilities/capabilities.ts +0 -13
  116. package/src/capabilities/react-root.tsx +0 -32
  117. package/src/capabilities/react-surface.tsx +0 -30
  118. package/src/capabilities/state.ts +0 -23
@@ -1,76 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Rx } from '@effect-rx/rx-react';
6
- import { Option, pipe } from 'effect';
7
-
8
- import { Capabilities, contributes, createIntent, LayoutAction, type PluginContext } from '@dxos/app-framework';
9
- import { createExtension } from '@dxos/app-graph';
10
-
11
- import { HelpCapabilities } from './capabilities';
12
- import { SHORTCUTS_DIALOG } from '../components';
13
- import { HELP_PLUGIN } from '../meta';
14
- import { HelpAction } from '../types';
15
-
16
- export default (context: PluginContext) =>
17
- contributes(
18
- Capabilities.AppGraphBuilder,
19
- createExtension({
20
- id: HELP_PLUGIN,
21
- actions: (node) =>
22
- Rx.make((get) =>
23
- pipe(
24
- get(node),
25
- Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
26
- Option.map(() => [
27
- {
28
- id: HelpAction.Start._tag,
29
- data: async () => {
30
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
31
- const state = context.getCapability(HelpCapabilities.MutableState);
32
- state.showHints = true;
33
- await dispatch(createIntent(HelpAction.Start));
34
- },
35
- properties: {
36
- label: ['open help tour', { ns: HELP_PLUGIN }],
37
- icon: 'ph--info--regular',
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
- },
46
- },
47
- {
48
- id: 'dxos.org/plugin/help/open-shortcuts',
49
- data: async () => {
50
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
51
- const state = context.getCapability(HelpCapabilities.MutableState);
52
- state.showHints = true;
53
- await dispatch(
54
- createIntent(LayoutAction.UpdateDialog, {
55
- part: 'dialog',
56
- subject: SHORTCUTS_DIALOG,
57
- options: {
58
- blockAlign: 'center',
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
- },
70
- },
71
- ]),
72
- Option.getOrElse(() => []),
73
- ),
74
- ),
75
- }),
76
- );
@@ -1,13 +0,0 @@
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
- }
@@ -1,32 +0,0 @@
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 { WelcomeTour } from '../components';
11
- import { HELP_PLUGIN } from '../meta';
12
- import { type Step } from '../types';
13
-
14
- export default (steps: Step[]) =>
15
- contributes(Capabilities.ReactRoot, {
16
- id: HELP_PLUGIN,
17
- root: () => {
18
- const state = useCapability(HelpCapabilities.MutableState);
19
- return (
20
- <WelcomeTour
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
- );
31
- },
32
- });
@@ -1,30 +0,0 @@
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
- ]);
@@ -1,23 +0,0 @@
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
- };