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

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 (141) hide show
  1. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  2. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-K4LQ2TR7.mjs +34 -0
  4. package/dist/lib/browser/chunk-K4LQ2TR7.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-KUUIRJG5.mjs +31 -0
  6. package/dist/lib/browser/chunk-KUUIRJG5.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-IM2QVQOH.mjs → chunk-TEXIV2IJ.mjs} +2 -2
  8. package/dist/lib/browser/{chunk-IM2QVQOH.mjs.map → chunk-TEXIV2IJ.mjs.map} +1 -1
  9. package/dist/lib/browser/index.mjs +351 -67
  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-YZBO346C.mjs +23 -0
  16. package/dist/lib/browser/start-YZBO346C.mjs.map +7 -0
  17. package/dist/lib/browser/types/index.mjs +4 -6
  18. package/dist/types/src/HelpPlugin.d.ts +1 -1
  19. package/dist/types/src/HelpPlugin.d.ts.map +1 -1
  20. package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
  21. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  22. package/dist/types/src/capabilities/index.d.ts +18 -5
  23. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  25. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  26. package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +2 -2
  27. package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
  28. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  29. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  30. package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +1 -1
  31. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  32. package/dist/types/src/components/Shortcuts/ShortcutsSection.d.ts.map +1 -1
  33. package/dist/types/src/components/Shortcuts/index.d.ts +0 -1
  34. package/dist/types/src/components/Shortcuts/index.d.ts.map +1 -1
  35. package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts +1 -1
  36. package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts.map +1 -1
  37. package/dist/types/src/constants.d.ts +2 -0
  38. package/dist/types/src/constants.d.ts.map +1 -0
  39. package/dist/types/src/{components/Shortcuts/ShortcutsDialog.d.ts → containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts} +1 -2
  40. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts.map +1 -0
  41. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.d.ts +25 -0
  42. package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.d.ts.map +1 -0
  43. package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts +3 -0
  44. package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts.map +1 -0
  45. package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts +2 -0
  46. package/dist/types/src/containers/ShortcutsHints/ShortcutsHints.d.ts.map +1 -0
  47. package/dist/types/src/containers/ShortcutsHints/index.d.ts +3 -0
  48. package/dist/types/src/containers/ShortcutsHints/index.d.ts.map +1 -0
  49. package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts +2 -0
  50. package/dist/types/src/containers/ShortcutsList/ShortcutsList.d.ts.map +1 -0
  51. package/dist/types/src/containers/ShortcutsList/index.d.ts +3 -0
  52. package/dist/types/src/containers/ShortcutsList/index.d.ts.map +1 -0
  53. package/dist/types/src/containers/index.d.ts +5 -0
  54. package/dist/types/src/containers/index.d.ts.map +1 -0
  55. package/dist/types/src/hooks/useHelp.d.ts +1 -1
  56. package/dist/types/src/hooks/useHelp.d.ts.map +1 -1
  57. package/dist/types/src/index.d.ts +1 -0
  58. package/dist/types/src/index.d.ts.map +1 -1
  59. package/dist/types/src/operations/definitions.d.ts +4 -0
  60. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  61. package/dist/types/src/operations/index.d.ts +4 -0
  62. package/dist/types/src/operations/index.d.ts.map +1 -0
  63. package/dist/types/src/operations/start.d.ts +5 -0
  64. package/dist/types/src/operations/start.d.ts.map +1 -0
  65. package/dist/types/src/translations.d.ts +5 -5
  66. package/dist/types/src/translations.d.ts.map +1 -1
  67. package/dist/types/src/types/schema.d.ts +1 -17
  68. package/dist/types/src/types/schema.d.ts.map +1 -1
  69. package/dist/types/tsconfig.tsbuildinfo +1 -1
  70. package/package.json +46 -28
  71. package/src/HelpPlugin.tsx +12 -10
  72. package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +13 -12
  73. package/src/capabilities/index.ts +11 -5
  74. package/src/capabilities/operation-handler.ts +16 -0
  75. package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +6 -6
  76. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +11 -9
  77. package/src/capabilities/{state/state.ts → state.ts} +2 -2
  78. package/src/components/Shortcuts/ShortcutsHints.tsx +1 -1
  79. package/src/components/Shortcuts/ShortcutsList.tsx +3 -3
  80. package/src/components/Shortcuts/ShortcutsSection.tsx +1 -3
  81. package/src/components/Shortcuts/index.ts +0 -1
  82. package/src/components/Shortcuts/styles.ts +2 -2
  83. package/src/components/Tooltip/Tooltip.tsx +4 -4
  84. package/src/components/WelcomeTour/WelcomeTour.stories.tsx +7 -7
  85. package/src/components/WelcomeTour/WelcomeTour.tsx +3 -2
  86. package/src/constants.ts +7 -0
  87. package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.tsx +39 -0
  88. package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.tsx +28 -0
  89. package/src/containers/ShortcutsDialogContent/index.ts +7 -0
  90. package/src/containers/ShortcutsHints/ShortcutsHints.tsx +5 -0
  91. package/src/containers/ShortcutsHints/index.ts +7 -0
  92. package/src/containers/ShortcutsList/ShortcutsList.tsx +5 -0
  93. package/src/containers/ShortcutsList/index.ts +7 -0
  94. package/src/containers/index.ts +9 -0
  95. package/src/hooks/useHelp.tsx +1 -1
  96. package/src/index.ts +1 -0
  97. package/src/meta.ts +1 -1
  98. package/src/operations/definitions.ts +19 -0
  99. package/src/operations/index.ts +9 -0
  100. package/src/operations/start.ts +21 -0
  101. package/src/translations.ts +5 -5
  102. package/src/types/capabilities.ts +2 -2
  103. package/src/types/schema.ts +1 -15
  104. package/dist/lib/browser/app-graph-builder-DX3VXARQ.mjs +0 -79
  105. package/dist/lib/browser/app-graph-builder-DX3VXARQ.mjs.map +0 -7
  106. package/dist/lib/browser/chunk-TS66J4C6.mjs +0 -58
  107. package/dist/lib/browser/chunk-TS66J4C6.mjs.map +0 -7
  108. package/dist/lib/browser/chunk-W5XAZM46.mjs +0 -360
  109. package/dist/lib/browser/chunk-W5XAZM46.mjs.map +0 -7
  110. package/dist/lib/browser/react-root-SZRF6EXG.mjs +0 -43
  111. package/dist/lib/browser/react-root-SZRF6EXG.mjs.map +0 -7
  112. package/dist/lib/browser/react-surface-DWNTJBVM.mjs +0 -37
  113. package/dist/lib/browser/react-surface-DWNTJBVM.mjs.map +0 -7
  114. package/dist/lib/browser/state-VRPLKT3F.mjs +0 -27
  115. package/dist/lib/browser/state-VRPLKT3F.mjs.map +0 -7
  116. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
  117. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  118. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  119. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  120. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -2
  121. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  122. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  123. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  124. package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
  125. package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
  126. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
  127. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  128. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  129. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  130. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  131. package/dist/types/src/capabilities/state/index.d.ts +0 -11
  132. package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
  133. package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
  134. package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts.map +0 -1
  135. package/src/capabilities/app-graph-builder/index.ts +0 -7
  136. package/src/capabilities/operation-resolver/index.ts +0 -5
  137. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -23
  138. package/src/capabilities/react-root/index.ts +0 -7
  139. package/src/capabilities/react-surface/index.ts +0 -7
  140. package/src/capabilities/state/index.ts +0 -7
  141. package/src/components/Shortcuts/ShortcutsDialog.tsx +0 -32
@@ -0,0 +1,10 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ export {
8
+ __export
9
+ };
10
+ //# sourceMappingURL=chunk-J5LGTIGS.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,34 @@
1
+ // src/types/capabilities.ts
2
+ import * as Schema from "effect/Schema";
3
+ import { Capability } from "@dxos/app-framework";
4
+ import { meta } from "#meta";
5
+ (function(HelpCapabilities2) {
6
+ HelpCapabilities2.StateSchema = Schema.mutable(Schema.Struct({
7
+ running: Schema.Boolean,
8
+ showHints: Schema.Boolean,
9
+ showWelcome: Schema.Boolean
10
+ }));
11
+ HelpCapabilities2.State = Capability.make(`${meta.id}.capability.state`);
12
+ })(HelpCapabilities || (HelpCapabilities = {}));
13
+ var HelpCapabilities;
14
+
15
+ // src/types/schema.ts
16
+ import { createContext } from "react";
17
+ var HelpContext = createContext({
18
+ running: false,
19
+ steps: [],
20
+ setSteps: () => {
21
+ },
22
+ setIndex: () => {
23
+ },
24
+ start: () => {
25
+ },
26
+ stop: () => {
27
+ }
28
+ });
29
+
30
+ export {
31
+ HelpCapabilities,
32
+ HelpContext
33
+ };
34
+ //# sourceMappingURL=chunk-K4LQ2TR7.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/capabilities.ts", "../../../src/types/schema.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nexport namespace HelpCapabilities {\n export const StateSchema = Schema.mutable(\n Schema.Struct({\n running: Schema.Boolean,\n showHints: Schema.Boolean,\n showWelcome: Schema.Boolean,\n }),\n );\n\n export type State = Schema.Schema.Type<typeof StateSchema>;\n\n export const State = Capability.make<Atom.Writable<State>>(`${meta.id}.capability.state`);\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Context, createContext } from 'react';\nimport { type Step as BaseStep } from 'react-joyride';\n\nimport { type CapabilityManager } from '@dxos/app-framework';\n\nexport type Step = BaseStep & {\n before?: (capabilities: CapabilityManager.CapabilityManager) => 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"],
5
+ "mappings": ";AAKA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAE3B,SAASC,YAAY;UAEJC,mBAAAA;oBACFC,cAAqBC,eACzBC,cAAO;IACZC,SAAgBC;IAChBC,WAAkBD;IAClBE,aAAoBF;EACtB,CAAA,CAAA;oBAKWG,QAAQC,WAAWC,KAA2B,GAAGC,KAAKC,EAAE,mBAAmB;AAC1F,GAZiBZ,qBAAAA,mBAAAA,CAAAA,EAAAA;;;;ACPjB,SAAuBa,qBAAqB;AAkBrC,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;",
6
+ "names": ["Schema", "Capability", "meta", "HelpCapabilities", "StateSchema", "mutable", "Struct", "running", "Boolean", "showHints", "showWelcome", "State", "Capability", "make", "meta", "id", "createContext", "HelpContext", "createContext", "running", "steps", "setSteps", "setIndex", "start", "stop"]
7
+ }
@@ -0,0 +1,31 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-J5LGTIGS.mjs";
4
+
5
+ // src/operations/definitions.ts
6
+ var definitions_exports = {};
7
+ __export(definitions_exports, {
8
+ Start: () => Start
9
+ });
10
+ import * as Schema from "effect/Schema";
11
+ import { Capability } from "@dxos/app-framework";
12
+ import { Operation } from "@dxos/operation";
13
+ import { meta } from "#meta";
14
+ var HELP_OPERATION = `${meta.id}.operation`;
15
+ var Start = Operation.make({
16
+ meta: {
17
+ key: `${HELP_OPERATION}.start`,
18
+ name: "Start Help"
19
+ },
20
+ services: [
21
+ Capability.Service
22
+ ],
23
+ input: Schema.Void,
24
+ output: Schema.Void
25
+ });
26
+
27
+ export {
28
+ Start,
29
+ definitions_exports
30
+ };
31
+ //# sourceMappingURL=chunk-KUUIRJG5.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/definitions.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/operation';\n\nimport { meta } from '#meta';\n\nconst HELP_OPERATION = `${meta.id}.operation`;\n\nexport const Start = Operation.make({\n meta: { key: `${HELP_OPERATION}.start`, name: 'Start Help' },\n services: [Capability.Service],\n input: Schema.Void,\n output: Schema.Void,\n});\n"],
5
+ "mappings": ";;;;;AAAA;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAE1B,SAASC,YAAY;AAErB,IAAMC,iBAAiB,GAAGC,KAAKC,EAAE;AAE1B,IAAMC,QAAQC,UAAUC,KAAK;EAClCJ,MAAM;IAAEK,KAAK,GAAGN,cAAAA;IAAwBO,MAAM;EAAa;EAC3DC,UAAU;IAACC,WAAWC;;EACtBC,OAAcC;EACdC,QAAeD;AACjB,CAAA;",
6
+ "names": ["Schema", "Capability", "Operation", "meta", "HELP_OPERATION", "meta", "id", "Start", "Operation", "make", "key", "name", "services", "Capability", "Service", "input", "Void", "output"]
7
+ }
@@ -1,7 +1,7 @@
1
1
  // src/meta.ts
2
2
  import { trim } from "@dxos/util";
3
3
  var meta = {
4
- id: "dxos.org/plugin/help",
4
+ id: "org.dxos.plugin.help",
5
5
  name: "Help",
6
6
  description: trim`
7
7
  Built-in help system with documentation, tutorials, and contextual assistance.
@@ -13,4 +13,4 @@ var meta = {
13
13
  export {
14
14
  meta
15
15
  };
16
- //# sourceMappingURL=chunk-IM2QVQOH.mjs.map
16
+ //# sourceMappingURL=chunk-TEXIV2IJ.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/help',\n name: 'Help',\n description: trim`\n Built-in help system with documentation, tutorials, and contextual assistance.\n Access keyboard shortcuts, feature guides, and support resources.\n `,\n icon: 'ph--info--regular',\n};\n"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.help',\n name: 'Help',\n description: trim`\n Built-in help system with documentation, tutorials, and contextual assistance.\n Access keyboard shortcuts, feature guides, and support resources.\n `,\n icon: 'ph--info--regular',\n};\n"],
5
5
  "mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;AACR;",
6
6
  "names": ["trim", "meta", "id", "name", "description", "trim", "icon"]
7
7
  }
@@ -1,106 +1,390 @@
1
1
  import {
2
- Key,
3
- SHORTCUTS_DIALOG,
4
- ShortcutsDialogContent,
5
- ShortcutsHints,
6
- ShortcutsList,
7
- ShortcutsSection,
8
- Tooltip,
9
- WelcomeTour,
10
- floaterProps
11
- } from "./chunk-W5XAZM46.mjs";
2
+ meta
3
+ } from "./chunk-TEXIV2IJ.mjs";
12
4
  import {
13
5
  HelpCapabilities,
14
- HelpContext,
15
- HelpOperation
16
- } from "./chunk-TS66J4C6.mjs";
17
- import {
18
- meta
19
- } from "./chunk-IM2QVQOH.mjs";
6
+ HelpContext
7
+ } from "./chunk-K4LQ2TR7.mjs";
8
+ import "./chunk-J5LGTIGS.mjs";
20
9
 
21
- // src/HelpPlugin.tsx
22
- import { Common as Common2, Plugin } from "@dxos/app-framework";
10
+ // src/components/Shortcuts/ShortcutsHints.tsx
11
+ import React2 from "react";
12
+ import { Keyboard } from "@dxos/keyboard";
13
+ import { IconButton, toLocalizedString, useTranslation } from "@dxos/react-ui";
14
+ import { osTranslations } from "@dxos/ui-theme";
23
15
 
24
- // src/capabilities/app-graph-builder/index.ts
25
- import { Capability } from "@dxos/app-framework";
26
- var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("./app-graph-builder-DX3VXARQ.mjs"));
16
+ // src/components/Shortcuts/Key.tsx
17
+ import React from "react";
18
+ import { keySymbols } from "@dxos/keyboard";
27
19
 
28
- // src/capabilities/operation-resolver/operation-resolver.ts
29
- import * as Effect from "effect/Effect";
30
- import { Capability as Capability2, Common } from "@dxos/app-framework";
31
- import { OperationResolver } from "@dxos/operation";
32
- var operation_resolver_default = Capability2.makeModule(Effect.fnUntraced(function* () {
33
- return Capability2.contributes(Common.Capability.OperationResolver, [
34
- OperationResolver.make({
35
- operation: HelpOperation.Start,
36
- handler: Effect.fnUntraced(function* () {
37
- yield* Common.Capability.updateAtomValue(HelpCapabilities.State, (state) => ({
38
- ...state,
39
- running: true
40
- }));
41
- })
42
- })
43
- ]);
44
- }));
20
+ // src/components/Shortcuts/styles.ts
21
+ import { mx } from "@dxos/ui-theme";
22
+ var shortcutKey = mx("inline-flex min-w-[24px] h-[24px] px-0.5 justify-center items-center text-xs", "rounded-sm bg-neutral-100 dark:bg-neutral-900");
45
23
 
46
- // src/capabilities/react-root/index.ts
47
- import { Capability as Capability3 } from "@dxos/app-framework";
48
- var ReactRoot = Capability3.lazy("ReactRoot", () => import("./react-root-SZRF6EXG.mjs"));
24
+ // src/components/Shortcuts/Key.tsx
25
+ var Key = ({ binding }) => {
26
+ return /* @__PURE__ */ React.createElement("span", {
27
+ role: "term",
28
+ className: "inline-flex gap-1",
29
+ "aria-label": binding,
30
+ id: binding
31
+ }, keySymbols(binding).map((c, i) => /* @__PURE__ */ React.createElement("span", {
32
+ key: i,
33
+ className: shortcutKey
34
+ }, c)));
35
+ };
36
+
37
+ // src/components/Shortcuts/ShortcutsHints.tsx
38
+ var Shortcut = ({ binding }) => {
39
+ const { t } = useTranslation(osTranslations);
40
+ return /* @__PURE__ */ React2.createElement("div", {
41
+ role: "none",
42
+ className: "flex items-center gap-2 whitespace-nowrap"
43
+ }, /* @__PURE__ */ React2.createElement(Key, {
44
+ binding: binding.shortcut
45
+ }), /* @__PURE__ */ React2.createElement("span", {
46
+ className: "text-sm"
47
+ }, toLocalizedString(binding.data, t)));
48
+ };
49
+ var ShortcutsHints = ({ onClose }) => {
50
+ const defaults = [
51
+ "meta+k",
52
+ "meta+/",
53
+ "meta+,"
54
+ ];
55
+ const bindings = Keyboard.singleton.getBindings();
56
+ const hints = bindings.filter((binding) => defaults.includes(binding.shortcut));
57
+ return /* @__PURE__ */ React2.createElement("div", {
58
+ role: "none",
59
+ className: "flex overflow-hidden px-2 gap-4"
60
+ }, hints.map((binding) => /* @__PURE__ */ React2.createElement(Shortcut, {
61
+ key: binding.shortcut,
62
+ binding
63
+ })), onClose && /* @__PURE__ */ React2.createElement(IconButton, {
64
+ icon: "ph--x--regular",
65
+ size: 4,
66
+ label: "Close",
67
+ iconOnly: true,
68
+ noTooltip: true,
69
+ variant: "ghost",
70
+ classNames: "p-0 cursor-pointer",
71
+ onClick: onClose
72
+ }));
73
+ };
74
+
75
+ // src/components/Shortcuts/ShortcutsList.tsx
76
+ import React3, { Fragment } from "react";
77
+ import { Keyboard as Keyboard2 } from "@dxos/keyboard";
78
+ import { toLocalizedString as toLocalizedString2, useTranslation as useTranslation2 } from "@dxos/react-ui";
79
+ import { mx as mx2 } from "@dxos/ui-theme";
80
+ import { meta as meta2 } from "#meta";
81
+ var ShortcutsList = () => {
82
+ const { t } = useTranslation2(meta2.id);
83
+ const bindings = Keyboard2.singleton.getBindings();
84
+ bindings.sort((a, b) => {
85
+ return toLocalizedString2(a.data, t)?.toLowerCase().localeCompare(toLocalizedString2(b.data, t)?.toLowerCase());
86
+ });
87
+ return /* @__PURE__ */ React3.createElement("dl", {
88
+ className: mx2("w-fit grid grid-cols-[min-content_minmax(12rem,1fr)] gap-2 my-4 text-subdued select-none")
89
+ }, bindings.map((binding, i) => /* @__PURE__ */ React3.createElement(Fragment, {
90
+ key: i
91
+ }, /* @__PURE__ */ React3.createElement(Key, {
92
+ binding: binding.shortcut
93
+ }), /* @__PURE__ */ React3.createElement("span", {
94
+ role: "definition",
95
+ className: "ms-4",
96
+ "aria-labelledby": binding.shortcut
97
+ }, toLocalizedString2(binding.data, t)))));
98
+ };
49
99
 
50
- // src/capabilities/react-surface/index.ts
51
- import { Capability as Capability4 } from "@dxos/app-framework";
52
- var ReactSurface = Capability4.lazy("ReactSurface", () => import("./react-surface-DWNTJBVM.mjs"));
100
+ // src/components/Shortcuts/ShortcutsSection.tsx
101
+ import React4 from "react";
102
+ var ShortcutsSection = () => {
103
+ return /* @__PURE__ */ React4.createElement("section", {
104
+ className: "text-description"
105
+ }, /* @__PURE__ */ React4.createElement(ShortcutsList, null));
106
+ };
53
107
 
54
- // src/capabilities/state/index.ts
55
- import { Capability as Capability5 } from "@dxos/app-framework";
56
- var HelpState = Capability5.lazy("HelpState", () => import("./state-VRPLKT3F.mjs"));
108
+ // src/components/Tooltip/Tooltip.tsx
109
+ import { useArrowNavigationGroup, useFocusableGroup } from "@fluentui/react-tabster";
110
+ import React5, { forwardRef } from "react";
111
+ import { Button, Icon, IconButton as IconButton2 } from "@dxos/react-ui";
112
+ var floaterProps = {
113
+ styles: {
114
+ // Arrow color is set by joyride.
115
+ arrow: {
116
+ length: 8,
117
+ spread: 16
118
+ },
119
+ floater: {
120
+ // TODO(burdon): Get tokens from theme.
121
+ filter: "drop-shadow(0 0 0.75rem rgba(0, 0, 0, 0.2))"
122
+ }
123
+ }
124
+ };
125
+ var Tooltip = /* @__PURE__ */ forwardRef(({ step: { title, content }, index, size, isLastStep, backProps, closeProps, primaryProps }, forwardedRef) => {
126
+ const arrowNavigationAttrs = useArrowNavigationGroup({
127
+ axis: "horizontal"
128
+ });
129
+ const focusableGroupAttrs = useFocusableGroup({
130
+ tabBehavior: "limited-trap-focus"
131
+ });
132
+ return /* @__PURE__ */ React5.createElement("div", {
133
+ className: "flex flex-col w-[15rem] min-h-[10rem] overflow-hidden rounded-md shadow-xl bg-accent-surface text-accent-surface-text",
134
+ role: "tooltip",
135
+ "data-testid": "helpPlugin.tooltip",
136
+ "data-step": index + 1,
137
+ ...focusableGroupAttrs,
138
+ ref: forwardedRef
139
+ }, /* @__PURE__ */ React5.createElement("div", {
140
+ className: "flex p-2"
141
+ }, /* @__PURE__ */ React5.createElement("h2", {
142
+ className: "grow px-2 py-1 text-lg font-medium text-accent-surface-text"
143
+ }, title), /* @__PURE__ */ React5.createElement(IconButton2, {
144
+ density: "fine",
145
+ icon: "ph--x--bold",
146
+ iconOnly: true,
147
+ label: closeProps["aria-label"],
148
+ onClick: closeProps.onClick,
149
+ size: 4,
150
+ variant: "primary",
151
+ "data-testid": "helpPlugin.tooltip.close"
152
+ })), /* @__PURE__ */ React5.createElement("div", {
153
+ className: "flex grow px-4 my-2"
154
+ }, content), /* @__PURE__ */ React5.createElement("div", {
155
+ className: "flex p-2 items-center justify-between",
156
+ ...arrowNavigationAttrs
157
+ }, /* @__PURE__ */ React5.createElement(IconButton2, {
158
+ classNames: [
159
+ !(index > 0 && backProps) && "invisible"
160
+ ],
161
+ icon: "ph--caret-left--regular",
162
+ iconOnly: true,
163
+ label: backProps["aria-label"],
164
+ onClick: backProps.onClick,
165
+ variant: "primary",
166
+ "data-testid": "helpPlugin.tooltip.back"
167
+ }), /* @__PURE__ */ React5.createElement("div", {
168
+ className: "flex grow gap-2 justify-center"
169
+ }, /* @__PURE__ */ React5.createElement("div", {
170
+ className: "flex"
171
+ }, Array.from({
172
+ length: size
173
+ }).map((_, i) => /* @__PURE__ */ React5.createElement(Icon, {
174
+ key: i,
175
+ icon: index === i ? "ph--circle--fill" : "ph--circle--regular",
176
+ size: 2,
177
+ classNames: "mx-1 cursor-pointer"
178
+ })))), isLastStep ? /* @__PURE__ */ React5.createElement(Button, {
179
+ variant: "primary",
180
+ onClick: closeProps.onClick,
181
+ title: closeProps["aria-label"],
182
+ autoFocus: true,
183
+ "data-testid": "helpPlugin.tooltip.finish"
184
+ }, "Done") : /* @__PURE__ */ React5.createElement(IconButton2, {
185
+ autoFocus: true,
186
+ icon: "ph--caret-right--regular",
187
+ iconOnly: true,
188
+ label: primaryProps["aria-label"],
189
+ onClick: primaryProps.onClick,
190
+ size: 6,
191
+ variant: "primary",
192
+ "data-testid": "helpPlugin.tooltip.next"
193
+ })));
194
+ });
195
+
196
+ // src/components/WelcomeTour/WelcomeTour.tsx
197
+ import React6, { useState } from "react";
198
+ import Joyride, { ACTIONS, EVENTS } from "react-joyride";
199
+ import { usePluginManager } from "@dxos/app-framework/ui";
200
+ import { useLayout } from "@dxos/app-toolkit/ui";
201
+ import { useAsyncEffect } from "@dxos/react-ui";
202
+ import { HelpContext as HelpContext2 } from "#types";
203
+ var addStepClass = (target) => {
204
+ const element = typeof target === "string" ? document.querySelector(target) : target;
205
+ if (element) {
206
+ element.classList.add("joyride-target");
207
+ }
208
+ };
209
+ var removeTargetClass = (target) => {
210
+ const element = typeof target === "string" ? document.querySelector(target) : target;
211
+ if (element) {
212
+ element.classList.remove("joyride-target");
213
+ }
214
+ };
215
+ var getTarget = (step) => {
216
+ return typeof step.target === "string" ? document.querySelector(step.target) : step.target;
217
+ };
218
+ var waitForTarget = async (step) => {
219
+ if (typeof step.target === "string") {
220
+ const target = step.target;
221
+ const element = document.querySelector(target);
222
+ if (element) {
223
+ return;
224
+ }
225
+ await new Promise((resolve) => {
226
+ const observer = new MutationObserver((mutations) => {
227
+ mutations.forEach((mutation) => {
228
+ if (mutation.addedNodes.length > 0) {
229
+ const element2 = document.querySelector(target);
230
+ if (element2) {
231
+ observer.disconnect();
232
+ resolve();
233
+ }
234
+ }
235
+ });
236
+ });
237
+ observer.observe(document.body, {
238
+ childList: true,
239
+ subtree: true
240
+ });
241
+ });
242
+ }
243
+ };
244
+ var WelcomeTour = ({ steps: initialSteps, running: runningProp, onRunningChanged }) => {
245
+ const manager = usePluginManager();
246
+ const layout = useLayout();
247
+ const [running, setRunning] = useState(!!runningProp && !!getTarget(initialSteps[0]));
248
+ const [stepIndex, _setStepIndex] = useState(0);
249
+ const [steps, setSteps] = useState(initialSteps);
250
+ const paused = layout.dialogOpen;
251
+ const setStepIndex = (index) => {
252
+ if (runningProp) {
253
+ const step = steps[index];
254
+ step?.before?.(manager.capabilities);
255
+ }
256
+ _setStepIndex(index);
257
+ };
258
+ const setRunningChanged = (state) => {
259
+ if (typeof runningProp !== "undefined") {
260
+ onRunningChanged?.(state);
261
+ } else {
262
+ if (state) {
263
+ setStepIndex(0);
264
+ setRunning(true);
265
+ } else {
266
+ setRunning(false);
267
+ }
268
+ }
269
+ };
270
+ useAsyncEffect(async () => {
271
+ if (runningProp) {
272
+ await waitForTarget(steps[stepIndex]);
273
+ setStepIndex(0);
274
+ setRunning(true);
275
+ } else if (typeof runningProp !== "undefined") {
276
+ setRunning(false);
277
+ }
278
+ }, [
279
+ runningProp
280
+ ]);
281
+ const callback = async (options) => {
282
+ const { type, action, index, size } = options;
283
+ switch (type) {
284
+ case EVENTS.STEP_BEFORE:
285
+ addStepClass(options.step.target);
286
+ break;
287
+ case EVENTS.TOUR_END:
288
+ break;
289
+ case EVENTS.STEP_AFTER:
290
+ removeTargetClass(options.step.target);
291
+ switch (action) {
292
+ case ACTIONS.NEXT:
293
+ if (index < size - 1) {
294
+ setStepIndex(index + 1);
295
+ }
296
+ break;
297
+ case ACTIONS.PREV:
298
+ if (index > 0) {
299
+ setStepIndex(index - 1);
300
+ }
301
+ break;
302
+ case ACTIONS.CLOSE:
303
+ setRunningChanged(false);
304
+ setStepIndex(0);
305
+ break;
306
+ }
307
+ break;
308
+ }
309
+ };
310
+ return /* @__PURE__ */ React6.createElement(HelpContext2.Provider, {
311
+ value: {
312
+ running: running && !paused,
313
+ steps,
314
+ setSteps,
315
+ setIndex: setStepIndex,
316
+ start: () => setRunningChanged(true),
317
+ stop: () => setRunningChanged(false)
318
+ }
319
+ }, /* @__PURE__ */ React6.createElement("style", null, `.joyride-target {
320
+ --controls-opacity: 1;
321
+ }`), /* @__PURE__ */ React6.createElement(Joyride, {
322
+ continuous: true,
323
+ steps,
324
+ stepIndex,
325
+ run: running && !paused,
326
+ callback,
327
+ floaterProps,
328
+ tooltipComponent: Tooltip
329
+ }));
330
+ };
331
+
332
+ // src/constants.ts
333
+ import { meta as meta3 } from "#meta";
334
+ var SHORTCUTS_DIALOG = `${meta3.id}.ShortcutsDialog`;
335
+
336
+ // src/HelpPlugin.tsx
337
+ import { ActivationEvents, Plugin } from "@dxos/app-framework";
338
+ import { AppPlugin } from "@dxos/app-toolkit";
339
+ import { meta as meta5 } from "#meta";
57
340
 
58
341
  // src/translations.ts
342
+ import { meta as meta4 } from "#meta";
59
343
  var translations = [
60
344
  {
61
345
  "en-US": {
62
- [meta.id]: {
63
- "plugin name": "Help",
64
- "open help tour": "Show welcome tour",
65
- "open shortcuts label": "Show shortcuts",
66
- "shortcuts dialog title": "Shortcuts"
346
+ [meta4.id]: {
347
+ "plugin.name": "Help",
348
+ "open-help-tour.message": "Show welcome tour",
349
+ "open-shortcuts.label": "Show shortcuts",
350
+ "shortcuts-dialog.title": "Shortcuts"
67
351
  }
68
352
  }
69
353
  }
70
354
  ];
71
355
 
72
356
  // src/HelpPlugin.tsx
73
- var HelpPlugin = Plugin.define(meta).pipe(Plugin.addModule({
74
- activatesOn: Common2.ActivationEvent.Startup,
75
- activate: HelpState
76
- }), Common2.Plugin.addTranslationsModule({
357
+ import { AppGraphBuilder, HelpState, OperationHandler, ReactRoot, ReactSurface } from "#capabilities";
358
+ var HelpPlugin = Plugin.define(meta5).pipe(AppPlugin.addAppGraphModule({
359
+ activate: AppGraphBuilder
360
+ }), AppPlugin.addOperationHandlerModule({
361
+ activate: OperationHandler
362
+ }), AppPlugin.addSurfaceModule({
363
+ activate: ReactSurface
364
+ }), AppPlugin.addTranslationsModule({
77
365
  translations
366
+ }), Plugin.addModule({
367
+ activatesOn: ActivationEvents.Startup,
368
+ activate: HelpState
78
369
  }), Plugin.addModule(({ steps = [] }) => ({
79
370
  id: "react-root",
80
- activatesOn: Common2.ActivationEvent.Startup,
371
+ activatesOn: ActivationEvents.Startup,
81
372
  activate: () => ReactRoot(steps)
82
- })), Common2.Plugin.addSurfaceModule({
83
- activate: ReactSurface
84
- }), Common2.Plugin.addOperationResolverModule({
85
- activate: operation_resolver_default
86
- }), Common2.Plugin.addAppGraphModule({
87
- activate: AppGraphBuilder
88
- }), Plugin.make);
373
+ })), Plugin.make);
89
374
 
90
375
  // src/hooks/useHelp.tsx
91
376
  import { useContext } from "react";
92
377
  import { raise } from "@dxos/debug";
378
+ import { HelpContext as HelpContext3 } from "#types";
93
379
  var useHelp = () => {
94
- return useContext(HelpContext) ?? raise(new Error("Missing HelpContext"));
380
+ return useContext(HelpContext3) ?? raise(new Error("Missing HelpContext"));
95
381
  };
96
382
  export {
97
383
  HelpCapabilities,
98
384
  HelpContext,
99
- HelpOperation,
100
385
  HelpPlugin,
101
386
  Key,
102
387
  SHORTCUTS_DIALOG,
103
- ShortcutsDialogContent,
104
388
  ShortcutsHints,
105
389
  ShortcutsList,
106
390
  ShortcutsSection,