@dxos/plugin-help 0.8.4-main.c1de068 → 0.8.4-main.c85a9c8dae

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 (155) hide show
  1. package/dist/lib/browser/ShortcutsDialogContent-BETHLZYK.mjs +36 -0
  2. package/dist/lib/browser/ShortcutsDialogContent-BETHLZYK.mjs.map +7 -0
  3. package/dist/lib/browser/ShortcutsHints-Q4LKOCKH.mjs +12 -0
  4. package/dist/lib/browser/ShortcutsHints-Q4LKOCKH.mjs.map +7 -0
  5. package/dist/lib/browser/ShortcutsList-P334CJ7O.mjs +12 -0
  6. package/dist/lib/browser/ShortcutsList-P334CJ7O.mjs.map +7 -0
  7. package/dist/lib/browser/app-graph-builder-2O2CUPGU.mjs +79 -0
  8. package/dist/lib/browser/app-graph-builder-2O2CUPGU.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-IM2QVQOH.mjs +16 -0
  10. package/dist/lib/browser/chunk-IM2QVQOH.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-PNXUNKZW.mjs +335 -0
  12. package/dist/lib/browser/chunk-PNXUNKZW.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-TS66J4C6.mjs +58 -0
  14. package/dist/lib/browser/chunk-TS66J4C6.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-XAC3AYP4.mjs +11 -0
  16. package/dist/lib/browser/chunk-XAC3AYP4.mjs.map +7 -0
  17. package/dist/lib/browser/index.mjs +62 -60
  18. package/dist/lib/browser/index.mjs.map +4 -4
  19. package/dist/lib/browser/meta.json +1 -1
  20. package/dist/lib/browser/meta.mjs +1 -3
  21. package/dist/lib/browser/react-root-GK7XGIBN.mjs +43 -0
  22. package/dist/lib/browser/react-root-GK7XGIBN.mjs.map +7 -0
  23. package/dist/lib/browser/react-surface-KGND4ZJD.mjs +42 -0
  24. package/dist/lib/browser/react-surface-KGND4ZJD.mjs.map +7 -0
  25. package/dist/lib/browser/state-VRPLKT3F.mjs +27 -0
  26. package/dist/lib/browser/state-VRPLKT3F.mjs.map +7 -0
  27. package/dist/lib/browser/types/index.mjs +8 -6
  28. package/dist/types/src/HelpPlugin.d.ts +2 -1
  29. package/dist/types/src/HelpPlugin.d.ts.map +1 -1
  30. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  31. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  32. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  33. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  34. package/dist/types/src/capabilities/index.d.ts +5 -8
  35. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/operation-resolver/index.d.ts +2 -0
  37. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  38. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  39. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  40. package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
  41. package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
  42. package/dist/types/src/capabilities/react-root/react-root.d.ts +10 -0
  43. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
  44. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  45. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  46. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  47. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  48. package/dist/types/src/capabilities/state/index.d.ts +11 -0
  49. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  50. package/dist/types/src/capabilities/state/state.d.ts +13 -0
  51. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  52. package/dist/types/src/components/Shortcuts/ShortcutsHints.d.ts.map +1 -1
  53. package/dist/types/src/components/Shortcuts/ShortcutsList.d.ts.map +1 -1
  54. package/dist/types/src/components/Shortcuts/ShortcutsSection.d.ts.map +1 -1
  55. package/dist/types/src/components/Shortcuts/index.d.ts +0 -1
  56. package/dist/types/src/components/Shortcuts/index.d.ts.map +1 -1
  57. package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  58. package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts.map +1 -1
  59. package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts +9 -4
  60. package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts.map +1 -1
  61. package/dist/types/src/constants.d.ts +2 -0
  62. package/dist/types/src/constants.d.ts.map +1 -0
  63. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts +3 -0
  64. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts.map +1 -0
  65. package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts +3 -0
  66. package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts.map +1 -0
  67. package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts +2 -0
  68. package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts.map +1 -0
  69. package/dist/types/src/containers/ShortcutsHints/index.d.ts +3 -0
  70. package/dist/types/src/containers/ShortcutsHints/index.d.ts.map +1 -0
  71. package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts +2 -0
  72. package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts.map +1 -0
  73. package/dist/types/src/containers/ShortcutsList/index.d.ts +3 -0
  74. package/dist/types/src/containers/ShortcutsList/index.d.ts.map +1 -0
  75. package/dist/types/src/containers/index.d.ts +5 -0
  76. package/dist/types/src/containers/index.d.ts.map +1 -0
  77. package/dist/types/src/index.d.ts +2 -1
  78. package/dist/types/src/index.d.ts.map +1 -1
  79. package/dist/types/src/meta.d.ts +2 -3
  80. package/dist/types/src/meta.d.ts.map +1 -1
  81. package/dist/types/src/types/capabilities.d.ts +21 -0
  82. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  83. package/dist/types/src/types/index.d.ts +1 -0
  84. package/dist/types/src/types/index.d.ts.map +1 -1
  85. package/dist/types/src/types/schema.d.ts +17 -13
  86. package/dist/types/src/types/schema.d.ts.map +1 -1
  87. package/dist/types/tsconfig.tsbuildinfo +1 -1
  88. package/package.json +43 -34
  89. package/src/HelpPlugin.tsx +20 -47
  90. package/src/capabilities/app-graph-builder/app-graph-builder.ts +61 -0
  91. package/src/capabilities/app-graph-builder/index.ts +7 -0
  92. package/src/capabilities/index.ts +5 -8
  93. package/src/capabilities/operation-resolver/index.ts +5 -0
  94. package/src/capabilities/operation-resolver/operation-resolver.ts +23 -0
  95. package/src/capabilities/react-root/index.ts +7 -0
  96. package/src/capabilities/react-root/react-root.tsx +36 -0
  97. package/src/capabilities/react-surface/index.ts +7 -0
  98. package/src/capabilities/react-surface/react-surface.tsx +36 -0
  99. package/src/capabilities/state/index.ts +7 -0
  100. package/src/capabilities/state/state.ts +27 -0
  101. package/src/components/Shortcuts/ShortcutsHints.tsx +13 -5
  102. package/src/components/Shortcuts/ShortcutsList.tsx +6 -5
  103. package/src/components/Shortcuts/ShortcutsSection.tsx +1 -3
  104. package/src/components/Shortcuts/index.ts +0 -1
  105. package/src/components/Shortcuts/styles.ts +3 -3
  106. package/src/components/Tooltip/Tooltip.tsx +5 -6
  107. package/src/components/WelcomeTour/WelcomeTour.stories.tsx +15 -9
  108. package/src/components/WelcomeTour/WelcomeTour.tsx +17 -19
  109. package/src/constants.ts +7 -0
  110. package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.tsx +29 -0
  111. package/src/containers/ShortcutsDialogContent/index.ts +7 -0
  112. package/src/containers/ShortcutsHints/ShortcutsHints.tsx +5 -0
  113. package/src/containers/ShortcutsHints/index.ts +7 -0
  114. package/src/containers/ShortcutsList/ShortcutsList.tsx +5 -0
  115. package/src/containers/ShortcutsList/index.ts +7 -0
  116. package/src/containers/index.ts +9 -0
  117. package/src/index.ts +2 -1
  118. package/src/meta.ts +8 -6
  119. package/src/types/capabilities.ts +24 -0
  120. package/src/types/index.ts +1 -0
  121. package/src/types/schema.ts +12 -8
  122. package/dist/lib/browser/app-graph-builder-BYCMEBNG.mjs +0 -79
  123. package/dist/lib/browser/app-graph-builder-BYCMEBNG.mjs.map +0 -7
  124. package/dist/lib/browser/chunk-3Y4CMOZP.mjs +0 -13
  125. package/dist/lib/browser/chunk-3Y4CMOZP.mjs.map +0 -7
  126. package/dist/lib/browser/chunk-J2SJSGSX.mjs +0 -34
  127. package/dist/lib/browser/chunk-J2SJSGSX.mjs.map +0 -7
  128. package/dist/lib/browser/chunk-LDRUZNSN.mjs +0 -16
  129. package/dist/lib/browser/chunk-LDRUZNSN.mjs.map +0 -7
  130. package/dist/lib/browser/chunk-MNETJXKS.mjs +0 -409
  131. package/dist/lib/browser/chunk-MNETJXKS.mjs.map +0 -7
  132. package/dist/lib/browser/react-root-W6ZDEGBU.mjs +0 -34
  133. package/dist/lib/browser/react-root-W6ZDEGBU.mjs.map +0 -7
  134. package/dist/lib/browser/react-surface-SATVEWS5.mjs +0 -36
  135. package/dist/lib/browser/react-surface-SATVEWS5.mjs.map +0 -7
  136. package/dist/lib/browser/state-FWUZG6NL.mjs +0 -29
  137. package/dist/lib/browser/state-FWUZG6NL.mjs.map +0 -7
  138. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  139. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  140. package/dist/types/src/capabilities/capabilities.d.ts +0 -10
  141. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  142. package/dist/types/src/capabilities/react-root.d.ts +0 -8
  143. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  144. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  145. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  146. package/dist/types/src/capabilities/state.d.ts +0 -4
  147. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  148. package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts +0 -4
  149. package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts.map +0 -1
  150. package/src/capabilities/app-graph-builder.ts +0 -76
  151. package/src/capabilities/capabilities.ts +0 -13
  152. package/src/capabilities/react-root.tsx +0 -32
  153. package/src/capabilities/react-surface.tsx +0 -30
  154. package/src/capabilities/state.ts +0 -23
  155. package/src/components/Shortcuts/ShortcutsDialog.tsx +0 -34
@@ -2,13 +2,15 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import React, { useState, useEffect } from 'react';
5
+ import React, { useState } from 'react';
6
6
  import Joyride, { ACTIONS, EVENTS } from 'react-joyride';
7
7
 
8
- import { usePluginManager, useLayout } from '@dxos/app-framework';
8
+ import { usePluginManager } from '@dxos/app-framework/ui';
9
+ import { useLayout } from '@dxos/app-toolkit/ui';
10
+ import { useAsyncEffect } from '@dxos/react-ui';
9
11
 
10
- import { type Step, HelpContext } from '../../types';
11
- import { floaterProps, Tooltip } from '../Tooltip';
12
+ import { HelpContext, type Step } from '../../types';
13
+ import { Tooltip, floaterProps } from '../Tooltip';
12
14
 
13
15
  const addStepClass = (target: string | HTMLElement) => {
14
16
  const element = typeof target === 'string' ? document.querySelector(target) : target;
@@ -75,7 +77,7 @@ export const WelcomeTour = ({ steps: initialSteps, running: runningProp, onRunni
75
77
  const setStepIndex = (index: number) => {
76
78
  if (runningProp) {
77
79
  const step = steps[index];
78
- step?.before?.(manager.context);
80
+ step?.before?.(manager.capabilities);
79
81
  }
80
82
  _setStepIndex(index);
81
83
  };
@@ -93,20 +95,16 @@ export const WelcomeTour = ({ steps: initialSteps, running: runningProp, onRunni
93
95
  }
94
96
  };
95
97
 
96
- useEffect(() => {
97
- const timeout = setTimeout(async () => {
98
- if (runningProp) {
99
- // This handles the case when the target is not yet in the document.
100
- // If the target is not in the document, when the joyride is turned on, it will not show the tooltip.
101
- await waitForTarget(steps[stepIndex]);
102
- setStepIndex(0);
103
- setRunning(true);
104
- } else if (typeof runningProp !== 'undefined') {
105
- setRunning(false);
106
- }
107
- });
108
-
109
- return () => clearTimeout(timeout);
98
+ useAsyncEffect(async () => {
99
+ if (runningProp) {
100
+ // This handles the case when the target is not yet in the document.
101
+ // If the target is not in the document, when the joyride is turned on, it will not show the tooltip.
102
+ await waitForTarget(steps[stepIndex]);
103
+ setStepIndex(0);
104
+ setRunning(true);
105
+ } else if (typeof runningProp !== 'undefined') {
106
+ setRunning(false);
107
+ }
110
108
  }, [runningProp]);
111
109
 
112
110
  // https://docs.react-joyride.com/callback
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { meta } from './meta';
6
+
7
+ export const SHORTCUTS_DIALOG = `${meta.id}/ShortcutsDialog`;
@@ -0,0 +1,29 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { Dialog, IconButton, 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
+ <div role='none' className='flex justify-between mb-1 pt-3 ps-2 pe-3 @md:pt-4 @md:ps-4 @md:pe-5'>
18
+ <Dialog.Title>{t('shortcuts dialog title')}</Dialog.Title>
19
+ <Dialog.Close asChild>
20
+ <IconButton icon='ph--x--bold' iconOnly size={3} label='Close' variant='ghost' autoFocus />
21
+ </Dialog.Close>
22
+ </div>
23
+
24
+ <div className='flex items-center justify-center'>
25
+ <ShortcutsList />
26
+ </div>
27
+ </Dialog.Content>
28
+ );
29
+ };
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { ShortcutsDialogContent } from './ShortcutsDialogContent';
6
+
7
+ export default ShortcutsDialogContent;
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ export { ShortcutsHints } from '../../components';
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { ShortcutsHints } from './ShortcutsHints';
6
+
7
+ export default ShortcutsHints;
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export { ShortcutsList } from '../../components';
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { ShortcutsList } from './ShortcutsList';
6
+
7
+ export default ShortcutsList;
@@ -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/index.ts CHANGED
@@ -2,8 +2,9 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export { HelpCapabilities } from './capabilities';
5
+ export { HelpCapabilities } from './types';
6
6
  export * from './components';
7
+ export * from './constants';
7
8
  export * from './meta';
8
9
  export * from './HelpPlugin';
9
10
  export * from './hooks';
package/src/meta.ts CHANGED
@@ -2,13 +2,15 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginMeta } from '@dxos/app-framework';
5
+ import { type Plugin } from '@dxos/app-framework';
6
+ import { trim } from '@dxos/util';
6
7
 
7
- // TODO(burdon): Rename Guide? Help?
8
- export const HELP_PLUGIN = 'dxos.org/plugin/help';
9
-
10
- export const meta: PluginMeta = {
11
- id: HELP_PLUGIN,
8
+ export const meta: Plugin.Meta = {
9
+ id: 'dxos.org/plugin/help',
12
10
  name: 'Help',
11
+ description: trim`
12
+ Built-in help system with documentation, tutorials, and contextual assistance.
13
+ Access keyboard shortcuts, feature guides, and support resources.
14
+ `,
13
15
  icon: 'ph--info--regular',
14
16
  };
@@ -0,0 +1,24 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type Atom } from '@effect-atom/atom-react';
6
+ import * as Schema from 'effect/Schema';
7
+
8
+ import { Capability } from '@dxos/app-framework';
9
+
10
+ import { meta } from '../meta';
11
+
12
+ export namespace HelpCapabilities {
13
+ export const StateSchema = Schema.mutable(
14
+ Schema.Struct({
15
+ running: Schema.Boolean,
16
+ showHints: Schema.Boolean,
17
+ showWelcome: Schema.Boolean,
18
+ }),
19
+ );
20
+
21
+ export type State = Schema.Schema.Type<typeof StateSchema>;
22
+
23
+ export const State = Capability.make<Atom.Writable<State>>(`${meta.id}/capability/state`);
24
+ }
@@ -2,4 +2,5 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ export * from './capabilities';
5
6
  export * from './schema';
@@ -2,16 +2,17 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
5
+ import * as Schema from 'effect/Schema';
6
6
  import { type Context, createContext } from 'react';
7
7
  import { type Step as BaseStep } from 'react-joyride';
8
8
 
9
- import { type PluginContext } from '@dxos/app-framework';
9
+ import { Capability, type CapabilityManager } from '@dxos/app-framework';
10
+ import { Operation } from '@dxos/operation';
10
11
 
11
12
  import { meta } from '../meta';
12
13
 
13
14
  export type Step = BaseStep & {
14
- before?: (context: PluginContext) => void;
15
+ before?: (capabilities: CapabilityManager.CapabilityManager) => void;
15
16
  };
16
17
 
17
18
  export type HelpContextType = {
@@ -32,9 +33,12 @@ export const HelpContext: Context<HelpContextType> = createContext<HelpContextTy
32
33
  stop: () => {},
33
34
  });
34
35
 
35
- export namespace HelpAction {
36
- export class Start extends Schema.TaggedClass<Start>()(`${meta.id}/action/start`, {
37
- input: Schema.Void,
38
- output: Schema.Void,
39
- }) {}
36
+ const HELP_OPERATION = `${meta.id}/operation`;
37
+
38
+ export namespace HelpOperation {
39
+ export const Start = Operation.make({
40
+ meta: { key: `${HELP_OPERATION}/start`, name: 'Start Help' },
41
+ services: [Capability.Service],
42
+ schema: { input: Schema.Void, output: Schema.Void },
43
+ });
40
44
  }
@@ -1,79 +0,0 @@
1
- import {
2
- SHORTCUTS_DIALOG
3
- } from "./chunk-MNETJXKS.mjs";
4
- import {
5
- HelpAction
6
- } from "./chunk-J2SJSGSX.mjs";
7
- import {
8
- HelpCapabilities
9
- } from "./chunk-LDRUZNSN.mjs";
10
- import {
11
- HELP_PLUGIN
12
- } from "./chunk-3Y4CMOZP.mjs";
13
-
14
- // src/capabilities/app-graph-builder.ts
15
- import { Rx } from "@effect-rx/rx-react";
16
- import { Option, pipe } from "effect";
17
- import { Capabilities, contributes, createIntent, LayoutAction } from "@dxos/app-framework";
18
- import { createExtension } from "@dxos/app-graph";
19
- var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
20
- id: HELP_PLUGIN,
21
- actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === "root" ? Option.some(node2) : Option.none()), Option.map(() => [
22
- {
23
- id: HelpAction.Start._tag,
24
- data: async () => {
25
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
26
- const state = context.getCapability(HelpCapabilities.MutableState);
27
- state.showHints = true;
28
- await dispatch(createIntent(HelpAction.Start));
29
- },
30
- properties: {
31
- label: [
32
- "open help tour",
33
- {
34
- ns: HELP_PLUGIN
35
- }
36
- ],
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(createIntent(LayoutAction.UpdateDialog, {
54
- part: "dialog",
55
- subject: SHORTCUTS_DIALOG,
56
- options: {
57
- blockAlign: "center"
58
- }
59
- }));
60
- },
61
- properties: {
62
- label: [
63
- "open shortcuts label",
64
- {
65
- ns: HELP_PLUGIN
66
- }
67
- ],
68
- icon: "ph--keyboard--regular",
69
- keyBinding: {
70
- macos: "meta+ctrl+/"
71
- }
72
- }
73
- }
74
- ]), Option.getOrElse(() => [])))
75
- }));
76
- export {
77
- app_graph_builder_default as default
78
- };
79
- //# sourceMappingURL=app-graph-builder-BYCMEBNG.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/app-graph-builder.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, contributes, createIntent, LayoutAction, type PluginContext } from '@dxos/app-framework';\nimport { createExtension } from '@dxos/app-graph';\n\nimport { HelpCapabilities } from './capabilities';\nimport { SHORTCUTS_DIALOG } from '../components';\nimport { HELP_PLUGIN } from '../meta';\nimport { HelpAction } from '../types';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: HELP_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),\n Option.map(() => [\n {\n id: HelpAction.Start._tag,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const state = context.getCapability(HelpCapabilities.MutableState);\n state.showHints = true;\n await dispatch(createIntent(HelpAction.Start));\n },\n properties: {\n label: ['open help tour', { ns: HELP_PLUGIN }],\n icon: 'ph--info--regular',\n keyBinding: {\n macos: 'shift+meta+/',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'shift+ctrl+/',\n linux: 'shift+ctrl+?',\n },\n testId: 'helpPlugin.openHelp',\n },\n },\n {\n id: 'dxos.org/plugin/help/open-shortcuts',\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const state = context.getCapability(HelpCapabilities.MutableState);\n state.showHints = true;\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: SHORTCUTS_DIALOG,\n options: {\n blockAlign: 'center',\n },\n }),\n );\n },\n properties: {\n label: ['open shortcuts label', { ns: HELP_PLUGIN }],\n icon: 'ph--keyboard--regular',\n keyBinding: {\n macos: 'meta+ctrl+/',\n },\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAcC,aAAaC,cAAcC,oBAAwC;AAC1F,SAASC,uBAAuB;AAOhC,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,SAAS,CAACC,SACRC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKH,OAAO,SAASQ,OAAOE,KAAKP,KAAAA,IAAQK,OAAOG,KAAI,CAAA,GAC9EH,OAAOI,IAAI,MAAM;IACf;MACEZ,IAAIa,WAAWC,MAAMC;MACrBC,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKvB,QAAQwB,cAActB,aAAauB,gBAAgB;AACzF,cAAMC,QAAQ1B,QAAQwB,cAAcG,iBAAiBC,YAAY;AACjEF,cAAMG,YAAY;AAClB,cAAMN,SAASO,aAAaZ,WAAWC,KAAK,CAAA;MAC9C;MACAY,YAAY;QACVC,OAAO;UAAC;UAAkB;YAAEC,IAAI3B;UAAY;;QAC5C4B,MAAM;QACNC,YAAY;UACVC,OAAO;;UAEPC,SAAS;UACTC,OAAO;QACT;QACAC,QAAQ;MACV;IACF;IACA;MACElC,IAAI;MACJgB,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKvB,QAAQwB,cAActB,aAAauB,gBAAgB;AACzF,cAAMC,QAAQ1B,QAAQwB,cAAcG,iBAAiBC,YAAY;AACjEF,cAAMG,YAAY;AAClB,cAAMN,SACJO,aAAaU,aAAaC,cAAc;UACtCC,MAAM;UACNC,SAASC;UACTC,SAAS;YACPC,YAAY;UACd;QACF,CAAA,CAAA;MAEJ;MACAf,YAAY;QACVC,OAAO;UAAC;UAAwB;YAAEC,IAAI3B;UAAY;;QAClD4B,MAAM;QACNC,YAAY;UACVC,OAAO;QACT;MACF;IACF;GACD,GACDvB,OAAOkC,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
6
- "names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "createIntent", "LayoutAction", "createExtension", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "HELP_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "some", "none", "map", "HelpAction", "Start", "_tag", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "state", "HelpCapabilities", "MutableState", "showHints", "createIntent", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "testId", "LayoutAction", "UpdateDialog", "part", "subject", "SHORTCUTS_DIALOG", "options", "blockAlign", "getOrElse"]
7
- }
@@ -1,13 +0,0 @@
1
- // src/meta.ts
2
- var HELP_PLUGIN = "dxos.org/plugin/help";
3
- var meta = {
4
- id: HELP_PLUGIN,
5
- name: "Help",
6
- icon: "ph--info--regular"
7
- };
8
-
9
- export {
10
- HELP_PLUGIN,
11
- meta
12
- };
13
- //# sourceMappingURL=chunk-3Y4CMOZP.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 const meta: PluginMeta = {\n id: HELP_PLUGIN,\n name: 'Help',\n icon: 'ph--info--regular',\n};\n"],
5
- "mappings": ";AAOO,IAAMA,cAAc;AAEpB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,MAAM;AACR;",
6
- "names": ["HELP_PLUGIN", "meta", "id", "name", "icon"]
7
- }
@@ -1,34 +0,0 @@
1
- import {
2
- meta
3
- } from "./chunk-3Y4CMOZP.mjs";
4
-
5
- // src/types/schema.ts
6
- import { Schema } from "effect";
7
- import { createContext } from "react";
8
- var HelpContext = createContext({
9
- running: false,
10
- steps: [],
11
- setSteps: () => {
12
- },
13
- setIndex: () => {
14
- },
15
- start: () => {
16
- },
17
- stop: () => {
18
- }
19
- });
20
- (function(HelpAction2) {
21
- class Start extends Schema.TaggedClass()(`${meta.id}/action/start`, {
22
- input: Schema.Void,
23
- output: Schema.Void
24
- }) {
25
- }
26
- HelpAction2.Start = Start;
27
- })(HelpAction || (HelpAction = {}));
28
- var HelpAction;
29
-
30
- export {
31
- HelpContext,
32
- HelpAction
33
- };
34
- //# sourceMappingURL=chunk-J2SJSGSX.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/schema.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\nimport { type Context, createContext } from 'react';\nimport { type Step as BaseStep } from 'react-joyride';\n\nimport { type PluginContext } from '@dxos/app-framework';\n\nimport { meta } from '../meta';\n\nexport type Step = BaseStep & {\n before?: (context: PluginContext) => 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 namespace HelpAction {\n export class Start extends Schema.TaggedClass<Start>()(`${meta.id}/action/start`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n}\n"],
5
- "mappings": ";;;;;AAIA,SAASA,cAAc;AACvB,SAAuBC,qBAAqB;AAoBrC,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;UAEiBC,aAAAA;EACR,MAAMC,cAAcC,OAAOC,YAAW,EAAU,GAAGC,KAAKC,EAAE,iBAAiB;IAChFC,OAAOJ,OAAOK;IACdC,QAAQN,OAAOK;EACjB,CAAA,EAAA;EAAI;cAHSN,QAAAA;AAIf,GALiBD,eAAAA,aAAAA,CAAAA,EAAAA;;",
6
- "names": ["Schema", "createContext", "HelpContext", "createContext", "running", "steps", "setSteps", "setIndex", "start", "stop", "HelpAction", "Start", "Schema", "TaggedClass", "meta", "id", "input", "Void", "output"]
7
- }
@@ -1,16 +0,0 @@
1
- import {
2
- HELP_PLUGIN
3
- } from "./chunk-3Y4CMOZP.mjs";
4
-
5
- // src/capabilities/capabilities.ts
6
- import { defineCapability } from "@dxos/app-framework";
7
- (function(HelpCapabilities2) {
8
- HelpCapabilities2.State = defineCapability(`${HELP_PLUGIN}/capability/state`);
9
- HelpCapabilities2.MutableState = defineCapability(`${HELP_PLUGIN}/capability/state`);
10
- })(HelpCapabilities || (HelpCapabilities = {}));
11
- var HelpCapabilities;
12
-
13
- export {
14
- HelpCapabilities
15
- };
16
- //# sourceMappingURL=chunk-LDRUZNSN.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/capabilities.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\n\nimport { HELP_PLUGIN } from '../meta';\n\nexport namespace HelpCapabilities {\n export type State = { running: boolean; showHints: boolean; showWelcome: boolean };\n export const State = defineCapability<Readonly<State>>(`${HELP_PLUGIN}/capability/state`);\n export const MutableState = defineCapability<State>(`${HELP_PLUGIN}/capability/state`);\n}\n"],
5
- "mappings": ";;;;;AAIA,SAASA,wBAAwB;UAIhBC,mBAAAA;oBAEFC,QAAQC,iBAAkC,GAAGC,WAAAA,mBAA8B;oBAC3EC,eAAeF,iBAAwB,GAAGC,WAAAA,mBAA8B;AACvF,GAJiBH,qBAAAA,mBAAAA,CAAAA,EAAAA;;",
6
- "names": ["defineCapability", "HelpCapabilities", "State", "defineCapability", "HELP_PLUGIN", "MutableState"]
7
- }