@dxos/plugin-help 0.8.4-main.1068cf700f → 0.8.4-main.1c7ec43d41

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 (152) hide show
  1. package/dist/lib/browser/chunk-53QC3FTJ.mjs +34 -0
  2. package/dist/lib/browser/chunk-53QC3FTJ.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  4. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-IM2QVQOH.mjs → chunk-NHTI7NEQ.mjs} +6 -3
  6. package/dist/lib/browser/{chunk-IM2QVQOH.mjs.map → chunk-NHTI7NEQ.mjs.map} +3 -3
  7. package/dist/lib/browser/chunk-RWK34XL5.mjs +31 -0
  8. package/dist/lib/browser/chunk-RWK34XL5.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +13 -101
  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 +2 -1
  13. package/dist/lib/browser/operations/index.mjs +13 -0
  14. package/dist/lib/browser/operations/index.mjs.map +7 -0
  15. package/dist/lib/browser/start-JQ2LLVCT.mjs +23 -0
  16. package/dist/lib/browser/start-JQ2LLVCT.mjs.map +7 -0
  17. package/dist/lib/browser/translations.mjs +20 -0
  18. package/dist/lib/browser/translations.mjs.map +7 -0
  19. package/dist/lib/browser/types/index.mjs +4 -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/HelpPlugin.test.d.ts +2 -0
  23. package/dist/types/src/HelpPlugin.test.d.ts.map +1 -0
  24. package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
  25. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  26. package/dist/types/src/capabilities/index.d.ts +18 -5
  27. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  28. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  29. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  30. package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +2 -2
  31. package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
  32. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  33. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  34. package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +1 -1
  35. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  36. package/dist/types/src/components/Shortcuts/Key.d.ts.map +1 -1
  37. package/dist/types/src/components/Shortcuts/ShortcutsHints.d.ts.map +1 -1
  38. package/dist/types/src/components/Shortcuts/ShortcutsSection.d.ts.map +1 -1
  39. package/dist/types/src/components/Shortcuts/index.d.ts +0 -1
  40. package/dist/types/src/components/Shortcuts/index.d.ts.map +1 -1
  41. package/dist/types/src/components/Tooltip/Tooltip.d.ts +9 -9
  42. package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts +1 -1
  43. package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts.map +1 -1
  44. package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts.map +1 -1
  45. package/dist/types/src/constants.d.ts +2 -0
  46. package/dist/types/src/constants.d.ts.map +1 -0
  47. package/dist/types/src/{components/Shortcuts/ShortcutsDialog.d.ts → containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts} +1 -2
  48. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts.map +1 -0
  49. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.d.ts +25 -0
  50. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.d.ts.map +1 -0
  51. package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts +2 -0
  52. package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts.map +1 -0
  53. package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts +2 -0
  54. package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts.map +1 -0
  55. package/dist/types/src/containers/ShortcutsHints/index.d.ts +2 -0
  56. package/dist/types/src/containers/ShortcutsHints/index.d.ts.map +1 -0
  57. package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts +2 -0
  58. package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts.map +1 -0
  59. package/dist/types/src/containers/ShortcutsList/index.d.ts +2 -0
  60. package/dist/types/src/containers/ShortcutsList/index.d.ts.map +1 -0
  61. package/dist/types/src/containers/index.d.ts +5 -0
  62. package/dist/types/src/containers/index.d.ts.map +1 -0
  63. package/dist/types/src/hooks/useHelp.d.ts +1 -1
  64. package/dist/types/src/hooks/useHelp.d.ts.map +1 -1
  65. package/dist/types/src/index.d.ts +4 -3
  66. package/dist/types/src/index.d.ts.map +1 -1
  67. package/dist/types/src/meta.d.ts.map +1 -1
  68. package/dist/types/src/operations/definitions.d.ts +4 -0
  69. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  70. package/dist/types/src/operations/index.d.ts +4 -0
  71. package/dist/types/src/operations/index.d.ts.map +1 -0
  72. package/dist/types/src/operations/start.d.ts +5 -0
  73. package/dist/types/src/operations/start.d.ts.map +1 -0
  74. package/dist/types/src/translations.d.ts +5 -6
  75. package/dist/types/src/translations.d.ts.map +1 -1
  76. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  77. package/dist/types/src/types/schema.d.ts +1 -17
  78. package/dist/types/src/types/schema.d.ts.map +1 -1
  79. package/dist/types/tsconfig.tsbuildinfo +1 -1
  80. package/package.json +46 -34
  81. package/src/HelpPlugin.test.ts +30 -0
  82. package/src/HelpPlugin.tsx +7 -5
  83. package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +15 -14
  84. package/src/capabilities/index.ts +11 -5
  85. package/src/capabilities/operation-handler.ts +16 -0
  86. package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +3 -3
  87. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +7 -6
  88. package/src/capabilities/{state/state.ts → state.ts} +2 -2
  89. package/src/components/Shortcuts/ShortcutsHints.tsx +1 -1
  90. package/src/components/Shortcuts/ShortcutsList.tsx +3 -3
  91. package/src/components/Shortcuts/ShortcutsSection.tsx +1 -3
  92. package/src/components/Shortcuts/index.ts +0 -1
  93. package/src/components/Shortcuts/styles.ts +2 -2
  94. package/src/components/Tooltip/Tooltip.tsx +4 -4
  95. package/src/components/WelcomeTour/WelcomeTour.stories.tsx +13 -13
  96. package/src/components/WelcomeTour/WelcomeTour.tsx +3 -1
  97. package/src/constants.ts +7 -0
  98. package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.tsx +39 -0
  99. package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.tsx +28 -0
  100. package/src/containers/ShortcutsDialogContent/index.ts +5 -0
  101. package/src/containers/ShortcutsHints/ShortcutsHints.tsx +5 -0
  102. package/src/containers/ShortcutsHints/index.ts +5 -0
  103. package/src/containers/ShortcutsList/ShortcutsList.tsx +5 -0
  104. package/src/containers/ShortcutsList/index.ts +5 -0
  105. package/src/containers/index.ts +9 -0
  106. package/src/hooks/useHelp.tsx +1 -1
  107. package/src/index.ts +8 -3
  108. package/src/meta.ts +2 -1
  109. package/src/operations/definitions.ts +19 -0
  110. package/src/operations/index.ts +9 -0
  111. package/src/operations/start.ts +21 -0
  112. package/src/translations.ts +5 -5
  113. package/src/types/capabilities.ts +2 -2
  114. package/src/types/schema.ts +1 -15
  115. package/dist/lib/browser/app-graph-builder-QSESB5XF.mjs +0 -80
  116. package/dist/lib/browser/app-graph-builder-QSESB5XF.mjs.map +0 -7
  117. package/dist/lib/browser/chunk-M5LBB7IY.mjs +0 -361
  118. package/dist/lib/browser/chunk-M5LBB7IY.mjs.map +0 -7
  119. package/dist/lib/browser/chunk-TS66J4C6.mjs +0 -58
  120. package/dist/lib/browser/chunk-TS66J4C6.mjs.map +0 -7
  121. package/dist/lib/browser/react-root-DTKS5AAE.mjs +0 -43
  122. package/dist/lib/browser/react-root-DTKS5AAE.mjs.map +0 -7
  123. package/dist/lib/browser/react-surface-2BPMM4KB.mjs +0 -38
  124. package/dist/lib/browser/react-surface-2BPMM4KB.mjs.map +0 -7
  125. package/dist/lib/browser/state-VRPLKT3F.mjs +0 -27
  126. package/dist/lib/browser/state-VRPLKT3F.mjs.map +0 -7
  127. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
  128. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  129. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  130. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  131. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -2
  132. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  133. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  134. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  135. package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
  136. package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
  137. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
  138. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  139. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  140. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  141. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  142. package/dist/types/src/capabilities/state/index.d.ts +0 -11
  143. package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
  144. package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
  145. package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts.map +0 -1
  146. package/src/capabilities/app-graph-builder/index.ts +0 -7
  147. package/src/capabilities/operation-resolver/index.ts +0 -5
  148. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -23
  149. package/src/capabilities/react-root/index.ts +0 -7
  150. package/src/capabilities/react-surface/index.ts +0 -7
  151. package/src/capabilities/state/index.ts +0 -7
  152. package/src/components/Shortcuts/ShortcutsDialog.tsx +0 -32
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ export { ShortcutsHints } from '../../components';
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ export { ShortcutsHints as default } from './ShortcutsHints';
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export { ShortcutsList } from '../../components';
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export { ShortcutsList as default } from './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'));
@@ -6,7 +6,7 @@ import { useContext } from 'react';
6
6
 
7
7
  import { raise } from '@dxos/debug';
8
8
 
9
- import { HelpContext } from '../types';
9
+ import { HelpContext } from '#types';
10
10
 
11
11
  export const useHelp = () => {
12
12
  return useContext(HelpContext) ?? raise(new Error('Missing HelpContext'));
package/src/index.ts CHANGED
@@ -2,9 +2,14 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
5
9
  export { HelpCapabilities } from './types';
6
- export * from './components';
10
+ export * from './constants';
7
11
  export * from './meta';
8
- export * from './HelpPlugin';
9
- export * from './hooks';
10
12
  export * from './types';
13
+
14
+ export const HelpPlugin = Plugin.lazy(meta, () => import('#plugin'));
15
+ export type { HelpPluginOptions } from '#plugin';
package/src/meta.ts CHANGED
@@ -6,11 +6,12 @@ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
8
  export const meta: Plugin.Meta = {
9
- id: 'dxos.org/plugin/help',
9
+ id: 'org.dxos.plugin.help',
10
10
  name: 'Help',
11
11
  description: trim`
12
12
  Built-in help system with documentation, tutorials, and contextual assistance.
13
13
  Access keyboard shortcuts, feature guides, and support resources.
14
14
  `,
15
15
  icon: 'ph--info--regular',
16
+ tags: ['system'],
16
17
  };
@@ -0,0 +1,19 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Schema from 'effect/Schema';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { Operation } from '@dxos/compute';
9
+
10
+ import { meta } from '#meta';
11
+
12
+ const HELP_OPERATION = `${meta.id}.operation`;
13
+
14
+ export const Start = Operation.make({
15
+ meta: { key: `${HELP_OPERATION}.start`, name: 'Start Help' },
16
+ services: [Capability.Service],
17
+ input: Schema.Void,
18
+ output: Schema.Void,
19
+ });
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { OperationHandlerSet } from '@dxos/compute';
6
+
7
+ export * as HelpOperation from './definitions';
8
+
9
+ export const HelpOperationHandlerSet = OperationHandlerSet.lazy(() => import('./start'));
@@ -0,0 +1,21 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities } from '@dxos/app-framework';
8
+ import { Operation } from '@dxos/compute';
9
+
10
+ import { HelpCapabilities } from '../types';
11
+ import { Start } from './definitions';
12
+
13
+ const handler: Operation.WithHandler<typeof Start> = Start.pipe(
14
+ Operation.withHandler(
15
+ Effect.fnUntraced(function* () {
16
+ yield* Capabilities.updateAtomValue(HelpCapabilities.State, (state) => ({ ...state, running: true }));
17
+ }),
18
+ ),
19
+ );
20
+
21
+ export default handler;
@@ -4,16 +4,16 @@
4
4
 
5
5
  import { type Resource } from '@dxos/react-ui';
6
6
 
7
- import { meta } from './meta';
7
+ import { meta } from '#meta';
8
8
 
9
9
  export const translations = [
10
10
  {
11
11
  'en-US': {
12
12
  [meta.id]: {
13
- 'plugin name': 'Help',
14
- 'open help tour': 'Show welcome tour',
15
- 'open shortcuts label': 'Show shortcuts',
16
- 'shortcuts dialog title': 'Shortcuts',
13
+ 'plugin.name': 'Help',
14
+ 'open-help-tour.message': 'Show welcome tour',
15
+ 'open-shortcuts.label': 'Show shortcuts',
16
+ 'shortcuts-dialog.title': 'Shortcuts',
17
17
  },
18
18
  },
19
19
  },
@@ -7,7 +7,7 @@ import * as Schema from 'effect/Schema';
7
7
 
8
8
  import { Capability } from '@dxos/app-framework';
9
9
 
10
- import { meta } from '../meta';
10
+ import { meta } from '#meta';
11
11
 
12
12
  export namespace HelpCapabilities {
13
13
  export const StateSchema = Schema.mutable(
@@ -20,5 +20,5 @@ export namespace HelpCapabilities {
20
20
 
21
21
  export type State = Schema.Schema.Type<typeof StateSchema>;
22
22
 
23
- export const State = Capability.make<Atom.Writable<State>>(`${meta.id}/capability/state`);
23
+ export const State = Capability.make<Atom.Writable<State>>(`${meta.id}.capability.state`);
24
24
  }
@@ -2,14 +2,10 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import * as Schema from 'effect/Schema';
6
5
  import { type Context, createContext } from 'react';
7
6
  import { type Step as BaseStep } from 'react-joyride';
8
7
 
9
- import { Capability, type CapabilityManager } from '@dxos/app-framework';
10
- import { Operation } from '@dxos/operation';
11
-
12
- import { meta } from '../meta';
8
+ import { type CapabilityManager } from '@dxos/app-framework';
13
9
 
14
10
  export type Step = BaseStep & {
15
11
  before?: (capabilities: CapabilityManager.CapabilityManager) => void;
@@ -32,13 +28,3 @@ export const HelpContext: Context<HelpContextType> = createContext<HelpContextTy
32
28
  start: () => {},
33
29
  stop: () => {},
34
30
  });
35
-
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
- });
44
- }
@@ -1,80 +0,0 @@
1
- import {
2
- SHORTCUTS_DIALOG
3
- } from "./chunk-M5LBB7IY.mjs";
4
- import {
5
- HelpCapabilities,
6
- HelpOperation
7
- } from "./chunk-TS66J4C6.mjs";
8
- import {
9
- meta
10
- } from "./chunk-IM2QVQOH.mjs";
11
-
12
- // src/capabilities/app-graph-builder/app-graph-builder.ts
13
- import * as Effect from "effect/Effect";
14
- import { Capabilities, Capability } from "@dxos/app-framework";
15
- import { GraphBuilder, NodeMatcher } from "@dxos/app-graph";
16
- import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
17
- import { Operation } from "@dxos/operation";
18
- var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
19
- const extensions = yield* GraphBuilder.createExtension({
20
- id: meta.id,
21
- match: NodeMatcher.whenRoot,
22
- actions: () => Effect.succeed([
23
- {
24
- id: HelpOperation.Start.meta.key,
25
- data: Effect.fnUntraced(function* () {
26
- yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({
27
- ...s,
28
- showHints: true
29
- }));
30
- yield* Operation.invoke(HelpOperation.Start);
31
- }),
32
- properties: {
33
- label: [
34
- "open help tour",
35
- {
36
- ns: meta.id
37
- }
38
- ],
39
- icon: "ph--info--regular",
40
- keyBinding: {
41
- macos: "shift+meta+/",
42
- windows: "shift+ctrl+/",
43
- linux: "shift+ctrl+?"
44
- },
45
- testId: "helpPlugin.openHelp"
46
- }
47
- },
48
- {
49
- id: `${meta.id}/open-shortcuts`,
50
- data: Effect.fnUntraced(function* () {
51
- yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({
52
- ...s,
53
- showHints: true
54
- }));
55
- yield* Operation.invoke(LayoutOperation.UpdateDialog, {
56
- subject: SHORTCUTS_DIALOG,
57
- blockAlign: "center"
58
- });
59
- }),
60
- properties: {
61
- label: [
62
- "open shortcuts label",
63
- {
64
- ns: meta.id
65
- }
66
- ],
67
- icon: "ph--keyboard--regular",
68
- keyBinding: {
69
- macos: "meta+ctrl+/"
70
- }
71
- }
72
- }
73
- ])
74
- });
75
- return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
76
- }));
77
- export {
78
- app_graph_builder_default as default
79
- };
80
- //# sourceMappingURL=app-graph-builder-QSESB5XF.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { GraphBuilder, NodeMatcher } from '@dxos/app-graph';\nimport { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\n\nimport { SHORTCUTS_DIALOG } from '../../components';\nimport { meta } from '../../meta';\nimport { HelpCapabilities, HelpOperation } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* GraphBuilder.createExtension({\n id: meta.id,\n match: NodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n {\n id: HelpOperation.Start.meta.key,\n data: Effect.fnUntraced(function* () {\n yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({ ...s, showHints: true }));\n yield* Operation.invoke(HelpOperation.Start);\n }),\n properties: {\n label: ['open help tour', { ns: meta.id }],\n icon: 'ph--info--regular',\n keyBinding: {\n macos: 'shift+meta+/',\n windows: 'shift+ctrl+/',\n linux: 'shift+ctrl+?',\n },\n testId: 'helpPlugin.openHelp',\n },\n },\n {\n id: `${meta.id}/open-shortcuts`,\n data: Effect.fnUntraced(function* () {\n yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({ ...s, showHints: true }));\n yield* Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: SHORTCUTS_DIALOG,\n blockAlign: 'center',\n });\n }),\n properties: {\n label: ['open shortcuts label', { ns: meta.id }],\n icon: 'ph--keyboard--regular',\n keyBinding: {\n macos: 'meta+ctrl+/',\n },\n },\n },\n ]),\n });\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
5
- "mappings": ";;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,cAAcC,mBAAmB;AAC1C,SAASC,iBAAiBC,uBAAuB;AACjD,SAASC,iBAAiB;AAM1B,IAAA,4BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAOC,aAAaC,gBAAgB;IACrDC,IAAIC,KAAKD;IACTE,OAAOC,YAAYC;IACnBC,SAAS,MACAC,eAAQ;MACb;QACEN,IAAIO,cAAcC,MAAMP,KAAKQ;QAC7BC,MAAad,kBAAW,aAAA;AACtB,iBAAOe,aAAaC,gBAAgBC,iBAAiBC,OAAO,CAACC,OAAO;YAAE,GAAGA;YAAGC,WAAW;UAAK,EAAA;AAC5F,iBAAOC,UAAUC,OAAOX,cAAcC,KAAK;QAC7C,CAAA;QACAW,YAAY;UACVC,OAAO;YAAC;YAAkB;cAAEC,IAAIpB,KAAKD;YAAG;;UACxCsB,MAAM;UACNC,YAAY;YACVC,OAAO;YACPC,SAAS;YACTC,OAAO;UACT;UACAC,QAAQ;QACV;MACF;MACA;QACE3B,IAAI,GAAGC,KAAKD,EAAE;QACdU,MAAad,kBAAW,aAAA;AACtB,iBAAOe,aAAaC,gBAAgBC,iBAAiBC,OAAO,CAACC,OAAO;YAAE,GAAGA;YAAGC,WAAW;UAAK,EAAA;AAC5F,iBAAOC,UAAUC,OAAOU,gBAAgBC,cAAc;YACpDC,SAASC;YACTC,YAAY;UACd,CAAA;QACF,CAAA;QACAb,YAAY;UACVC,OAAO;YAAC;YAAwB;cAAEC,IAAIpB,KAAKD;YAAG;;UAC9CsB,MAAM;UACNC,YAAY;YACVC,OAAO;UACT;QACF;MACF;KACD;EACL,CAAA;AAEA,SAAO9B,WAAWuC,YAAYC,gBAAgBC,iBAAiBtC,UAAAA;AACjE,CAAA,CAAA;",
6
- "names": ["Effect", "Capabilities", "Capability", "GraphBuilder", "NodeMatcher", "AppCapabilities", "LayoutOperation", "Operation", "Capability", "makeModule", "fnUntraced", "extensions", "GraphBuilder", "createExtension", "id", "meta", "match", "NodeMatcher", "whenRoot", "actions", "succeed", "HelpOperation", "Start", "key", "data", "Capabilities", "updateAtomValue", "HelpCapabilities", "State", "s", "showHints", "Operation", "invoke", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "testId", "LayoutOperation", "UpdateDialog", "subject", "SHORTCUTS_DIALOG", "blockAlign", "contributes", "AppCapabilities", "AppGraphBuilder"]
7
- }
@@ -1,361 +0,0 @@
1
- import {
2
- HelpContext
3
- } from "./chunk-TS66J4C6.mjs";
4
- import {
5
- meta
6
- } from "./chunk-IM2QVQOH.mjs";
7
-
8
- // src/components/Shortcuts/Key.tsx
9
- import React from "react";
10
- import { keySymbols } from "@dxos/keyboard";
11
-
12
- // src/components/Shortcuts/styles.ts
13
- import { mx } from "@dxos/ui-theme";
14
- var shortcutKey = mx("inline-flex min-is-[24px] bs-[24px] pli-0.5 justify-center items-center text-xs", "rounded bg-neutral-100 dark:bg-neutral-900");
15
-
16
- // src/components/Shortcuts/Key.tsx
17
- var Key = ({ binding }) => {
18
- return /* @__PURE__ */ React.createElement("span", {
19
- role: "term",
20
- className: "inline-flex gap-1",
21
- "aria-label": binding,
22
- id: binding
23
- }, keySymbols(binding).map((c, i) => /* @__PURE__ */ React.createElement("span", {
24
- key: i,
25
- className: shortcutKey
26
- }, c)));
27
- };
28
-
29
- // src/components/Shortcuts/ShortcutsList.tsx
30
- import React2, { Fragment } from "react";
31
- import { Keyboard } from "@dxos/keyboard";
32
- import { toLocalizedString, useTranslation } from "@dxos/react-ui";
33
- import { mx as mx2 } from "@dxos/ui-theme";
34
- var ShortcutsList = () => {
35
- const { t } = useTranslation(meta.id);
36
- const bindings = Keyboard.singleton.getBindings();
37
- bindings.sort((a, b) => {
38
- return toLocalizedString(a.data, t)?.toLowerCase().localeCompare(toLocalizedString(b.data, t)?.toLowerCase());
39
- });
40
- return /* @__PURE__ */ React2.createElement("dl", {
41
- className: mx2("is-fit grid grid-cols-[min-content_minmax(12rem,1fr)] gap-2 mlb-4 text-subdued select-none")
42
- }, bindings.map((binding, i) => /* @__PURE__ */ React2.createElement(Fragment, {
43
- key: i
44
- }, /* @__PURE__ */ React2.createElement(Key, {
45
- binding: binding.shortcut
46
- }), /* @__PURE__ */ React2.createElement("span", {
47
- role: "definition",
48
- className: "mis-4",
49
- "aria-labelledby": binding.shortcut
50
- }, toLocalizedString(binding.data, t)))));
51
- };
52
-
53
- // src/components/Shortcuts/ShortcutsDialog.tsx
54
- import React3 from "react";
55
- import { Dialog, IconButton, useTranslation as useTranslation2 } from "@dxos/react-ui";
56
- var SHORTCUTS_DIALOG = `${meta.id}/ShortcutsDialog`;
57
- var ShortcutsDialogContent = () => {
58
- const { t } = useTranslation2(meta.id);
59
- return /* @__PURE__ */ React3.createElement(Dialog.Content, null, /* @__PURE__ */ React3.createElement("div", {
60
- role: "none",
61
- className: "flex justify-between mbe-1 pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5"
62
- }, /* @__PURE__ */ React3.createElement(Dialog.Title, null, t("shortcuts dialog title")), /* @__PURE__ */ React3.createElement(Dialog.Close, {
63
- asChild: true
64
- }, /* @__PURE__ */ React3.createElement(IconButton, {
65
- icon: "ph--x--bold",
66
- iconOnly: true,
67
- size: 3,
68
- label: "Close",
69
- variant: "ghost",
70
- autoFocus: true
71
- }))), /* @__PURE__ */ React3.createElement("div", {
72
- className: "flex items-center justify-center"
73
- }, /* @__PURE__ */ React3.createElement(ShortcutsList, null)));
74
- };
75
-
76
- // src/components/Shortcuts/ShortcutsHints.tsx
77
- import React4 from "react";
78
- import { Keyboard as Keyboard2 } from "@dxos/keyboard";
79
- import { IconButton as IconButton2, toLocalizedString as toLocalizedString2, useTranslation as useTranslation3 } from "@dxos/react-ui";
80
- import { osTranslations } from "@dxos/ui-theme";
81
- var Shortcut = ({ binding }) => {
82
- const { t } = useTranslation3(osTranslations);
83
- return /* @__PURE__ */ React4.createElement("div", {
84
- role: "none",
85
- className: "flex items-center gap-2 whitespace-nowrap"
86
- }, /* @__PURE__ */ React4.createElement(Key, {
87
- binding: binding.shortcut
88
- }), /* @__PURE__ */ React4.createElement("span", {
89
- className: "text-sm"
90
- }, toLocalizedString2(binding.data, t)));
91
- };
92
- var ShortcutsHints = ({ onClose }) => {
93
- const defaults = [
94
- "meta+k",
95
- "meta+/",
96
- "meta+,"
97
- ];
98
- const bindings = Keyboard2.singleton.getBindings();
99
- const hints = bindings.filter((binding) => defaults.includes(binding.shortcut));
100
- return /* @__PURE__ */ React4.createElement("div", {
101
- role: "none",
102
- className: "flex overflow-hidden pli-2 gap-4"
103
- }, hints.map((binding) => /* @__PURE__ */ React4.createElement(Shortcut, {
104
- key: binding.shortcut,
105
- binding
106
- })), onClose && /* @__PURE__ */ React4.createElement(IconButton2, {
107
- icon: "ph--x--regular",
108
- size: 4,
109
- label: "Close",
110
- iconOnly: true,
111
- noTooltip: true,
112
- variant: "ghost",
113
- classNames: "p-0 cursor-pointer",
114
- onClick: onClose
115
- }));
116
- };
117
-
118
- // src/components/Shortcuts/ShortcutsSection.tsx
119
- import React5 from "react";
120
- import { descriptionText } from "@dxos/ui-theme";
121
- var ShortcutsSection = () => {
122
- return /* @__PURE__ */ React5.createElement("section", {
123
- className: descriptionText
124
- }, /* @__PURE__ */ React5.createElement(ShortcutsList, null));
125
- };
126
-
127
- // src/components/Tooltip/Tooltip.tsx
128
- import { useArrowNavigationGroup, useFocusableGroup } from "@fluentui/react-tabster";
129
- import React6, { forwardRef } from "react";
130
- import { Button, Icon, IconButton as IconButton3 } from "@dxos/react-ui";
131
- var floaterProps = {
132
- styles: {
133
- // Arrow color is set by joyride.
134
- arrow: {
135
- length: 8,
136
- spread: 16
137
- },
138
- floater: {
139
- // TODO(burdon): Get tokens from theme.
140
- filter: "drop-shadow(0 0 0.75rem rgba(0, 0, 0, 0.2))"
141
- }
142
- }
143
- };
144
- var Tooltip = /* @__PURE__ */ forwardRef(({ step: { title, content }, index, size, isLastStep, backProps, closeProps, primaryProps }, forwardedRef) => {
145
- const arrowNavigationAttrs = useArrowNavigationGroup({
146
- axis: "horizontal"
147
- });
148
- const focusableGroupAttrs = useFocusableGroup({
149
- tabBehavior: "limited-trap-focus"
150
- });
151
- return /* @__PURE__ */ React6.createElement("div", {
152
- className: "flex flex-col is-[15rem] min-bs-[10rem] overflow-hidden rounded-md shadow-xl bg-accentSurface text-accentSurfaceText",
153
- role: "tooltip",
154
- "data-testid": "helpPlugin.tooltip",
155
- "data-step": index + 1,
156
- ...focusableGroupAttrs,
157
- ref: forwardedRef
158
- }, /* @__PURE__ */ React6.createElement("div", {
159
- className: "flex p-2"
160
- }, /* @__PURE__ */ React6.createElement("h2", {
161
- className: "grow pli-2 plb-1 text-lg font-medium text-accentSurfaceText"
162
- }, title), /* @__PURE__ */ React6.createElement(IconButton3, {
163
- density: "fine",
164
- icon: "ph--x--bold",
165
- iconOnly: true,
166
- label: closeProps["aria-label"],
167
- onClick: closeProps.onClick,
168
- size: 4,
169
- variant: "primary",
170
- "data-testid": "helpPlugin.tooltip.close"
171
- })), /* @__PURE__ */ React6.createElement("div", {
172
- className: "flex grow pli-4 mlb-2"
173
- }, content), /* @__PURE__ */ React6.createElement("div", {
174
- className: "flex p-2 items-center justify-between",
175
- ...arrowNavigationAttrs
176
- }, /* @__PURE__ */ React6.createElement(IconButton3, {
177
- classNames: [
178
- !(index > 0 && backProps) && "invisible"
179
- ],
180
- icon: "ph--caret-left--regular",
181
- iconOnly: true,
182
- label: backProps["aria-label"],
183
- onClick: backProps.onClick,
184
- variant: "primary",
185
- "data-testid": "helpPlugin.tooltip.back"
186
- }), /* @__PURE__ */ React6.createElement("div", {
187
- className: "flex grow gap-2 justify-center"
188
- }, /* @__PURE__ */ React6.createElement("div", {
189
- className: "flex"
190
- }, Array.from({
191
- length: size
192
- }).map((_, i) => /* @__PURE__ */ React6.createElement(Icon, {
193
- key: i,
194
- icon: index === i ? "ph--circle--fill" : "ph--circle--regular",
195
- size: 2,
196
- classNames: "mli-1 cursor-pointer"
197
- })))), isLastStep ? /* @__PURE__ */ React6.createElement(Button, {
198
- variant: "primary",
199
- onClick: closeProps.onClick,
200
- title: closeProps["aria-label"],
201
- autoFocus: true,
202
- "data-testid": "helpPlugin.tooltip.finish"
203
- }, "Done") : /* @__PURE__ */ React6.createElement(IconButton3, {
204
- autoFocus: true,
205
- icon: "ph--caret-right--regular",
206
- iconOnly: true,
207
- label: primaryProps["aria-label"],
208
- onClick: primaryProps.onClick,
209
- size: 6,
210
- variant: "primary",
211
- "data-testid": "helpPlugin.tooltip.next"
212
- })));
213
- });
214
-
215
- // src/components/WelcomeTour/WelcomeTour.tsx
216
- import React7, { useState } from "react";
217
- import Joyride, { ACTIONS, EVENTS } from "react-joyride";
218
- import { usePluginManager } from "@dxos/app-framework/ui";
219
- import { useLayout } from "@dxos/app-toolkit/ui";
220
- import { useAsyncEffect } from "@dxos/react-ui";
221
- var addStepClass = (target) => {
222
- const element = typeof target === "string" ? document.querySelector(target) : target;
223
- if (element) {
224
- element.classList.add("joyride-target");
225
- }
226
- };
227
- var removeTargetClass = (target) => {
228
- const element = typeof target === "string" ? document.querySelector(target) : target;
229
- if (element) {
230
- element.classList.remove("joyride-target");
231
- }
232
- };
233
- var getTarget = (step) => {
234
- return typeof step.target === "string" ? document.querySelector(step.target) : step.target;
235
- };
236
- var waitForTarget = async (step) => {
237
- if (typeof step.target === "string") {
238
- const target = step.target;
239
- const element = document.querySelector(target);
240
- if (element) {
241
- return;
242
- }
243
- await new Promise((resolve) => {
244
- const observer = new MutationObserver((mutations) => {
245
- mutations.forEach((mutation) => {
246
- if (mutation.addedNodes.length > 0) {
247
- const element2 = document.querySelector(target);
248
- if (element2) {
249
- observer.disconnect();
250
- resolve();
251
- }
252
- }
253
- });
254
- });
255
- observer.observe(document.body, {
256
- childList: true,
257
- subtree: true
258
- });
259
- });
260
- }
261
- };
262
- var WelcomeTour = ({ steps: initialSteps, running: runningProp, onRunningChanged }) => {
263
- const manager = usePluginManager();
264
- const layout = useLayout();
265
- const [running, setRunning] = useState(!!runningProp && !!getTarget(initialSteps[0]));
266
- const [stepIndex, _setStepIndex] = useState(0);
267
- const [steps, setSteps] = useState(initialSteps);
268
- const paused = layout.dialogOpen;
269
- const setStepIndex = (index) => {
270
- if (runningProp) {
271
- const step = steps[index];
272
- step?.before?.(manager.capabilities);
273
- }
274
- _setStepIndex(index);
275
- };
276
- const setRunningChanged = (state) => {
277
- if (typeof runningProp !== "undefined") {
278
- onRunningChanged?.(state);
279
- } else {
280
- if (state) {
281
- setStepIndex(0);
282
- setRunning(true);
283
- } else {
284
- setRunning(false);
285
- }
286
- }
287
- };
288
- useAsyncEffect(async () => {
289
- if (runningProp) {
290
- await waitForTarget(steps[stepIndex]);
291
- setStepIndex(0);
292
- setRunning(true);
293
- } else if (typeof runningProp !== "undefined") {
294
- setRunning(false);
295
- }
296
- }, [
297
- runningProp
298
- ]);
299
- const callback = async (options) => {
300
- const { type, action, index, size } = options;
301
- switch (type) {
302
- case EVENTS.STEP_BEFORE:
303
- addStepClass(options.step.target);
304
- break;
305
- case EVENTS.TOUR_END:
306
- break;
307
- case EVENTS.STEP_AFTER:
308
- removeTargetClass(options.step.target);
309
- switch (action) {
310
- case ACTIONS.NEXT:
311
- if (index < size - 1) {
312
- setStepIndex(index + 1);
313
- }
314
- break;
315
- case ACTIONS.PREV:
316
- if (index > 0) {
317
- setStepIndex(index - 1);
318
- }
319
- break;
320
- case ACTIONS.CLOSE:
321
- setRunningChanged(false);
322
- setStepIndex(0);
323
- break;
324
- }
325
- break;
326
- }
327
- };
328
- return /* @__PURE__ */ React7.createElement(HelpContext.Provider, {
329
- value: {
330
- running: running && !paused,
331
- steps,
332
- setSteps,
333
- setIndex: setStepIndex,
334
- start: () => setRunningChanged(true),
335
- stop: () => setRunningChanged(false)
336
- }
337
- }, /* @__PURE__ */ React7.createElement("style", null, `.joyride-target {
338
- --controls-opacity: 1;
339
- }`), /* @__PURE__ */ React7.createElement(Joyride, {
340
- continuous: true,
341
- steps,
342
- stepIndex,
343
- run: running && !paused,
344
- callback,
345
- floaterProps,
346
- tooltipComponent: Tooltip
347
- }));
348
- };
349
-
350
- export {
351
- Key,
352
- ShortcutsList,
353
- SHORTCUTS_DIALOG,
354
- ShortcutsDialogContent,
355
- ShortcutsHints,
356
- ShortcutsSection,
357
- floaterProps,
358
- Tooltip,
359
- WelcomeTour
360
- };
361
- //# sourceMappingURL=chunk-M5LBB7IY.mjs.map