@dxos/plugin-help 0.8.4-main.84f28bd → 0.8.4-main.937b3ca

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 (145) hide show
  1. package/dist/lib/browser/app-graph-builder-DX3VXARQ.mjs +79 -0
  2. package/dist/lib/browser/app-graph-builder-DX3VXARQ.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-IM2QVQOH.mjs +16 -0
  4. package/dist/lib/browser/chunk-IM2QVQOH.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-TS66J4C6.mjs +58 -0
  6. package/dist/lib/browser/chunk-TS66J4C6.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-W5XAZM46.mjs +360 -0
  8. package/dist/lib/browser/chunk-W5XAZM46.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +58 -59
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/meta.mjs +1 -3
  13. package/dist/lib/browser/react-root-SZRF6EXG.mjs +43 -0
  14. package/dist/lib/browser/react-root-SZRF6EXG.mjs.map +7 -0
  15. package/dist/lib/browser/{react-surface-DIIOUUMT.mjs → react-surface-DWNTJBVM.mjs} +15 -14
  16. package/dist/lib/browser/react-surface-DWNTJBVM.mjs.map +7 -0
  17. package/dist/lib/browser/state-VRPLKT3F.mjs +27 -0
  18. package/dist/lib/browser/state-VRPLKT3F.mjs.map +7 -0
  19. package/dist/lib/browser/types/index.mjs +12 -0
  20. package/dist/types/src/HelpPlugin.d.ts +2 -1
  21. package/dist/types/src/HelpPlugin.d.ts.map +1 -1
  22. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  23. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  24. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  25. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  26. package/dist/types/src/capabilities/index.d.ts +5 -8
  27. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  28. package/dist/types/src/capabilities/operation-resolver/index.d.ts +2 -0
  29. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  30. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  31. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  32. package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
  33. package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
  34. package/dist/types/src/capabilities/react-root/react-root.d.ts +10 -0
  35. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
  36. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  37. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  38. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  39. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  40. package/dist/types/src/capabilities/state/index.d.ts +11 -0
  41. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  42. package/dist/types/src/capabilities/state/state.d.ts +13 -0
  43. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  44. package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts +1 -1
  45. package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts.map +1 -1
  46. package/dist/types/src/components/Shortcuts/ShortcutsHints.d.ts.map +1 -1
  47. package/dist/types/src/components/Shortcuts/ShortcutsList.d.ts.map +1 -1
  48. package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  49. package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts.map +1 -1
  50. package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts +9 -4
  51. package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts.map +1 -1
  52. package/dist/types/src/index.d.ts +1 -1
  53. package/dist/types/src/index.d.ts.map +1 -1
  54. package/dist/types/src/meta.d.ts +2 -3
  55. package/dist/types/src/meta.d.ts.map +1 -1
  56. package/dist/types/src/types/capabilities.d.ts +21 -0
  57. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  58. package/dist/types/src/types/index.d.ts +3 -0
  59. package/dist/types/src/types/index.d.ts.map +1 -0
  60. package/dist/types/src/types/schema.d.ts +32 -0
  61. package/dist/types/src/types/schema.d.ts.map +1 -0
  62. package/dist/types/tsconfig.tsbuildinfo +1 -1
  63. package/package.json +45 -39
  64. package/src/HelpPlugin.tsx +19 -47
  65. package/src/capabilities/app-graph-builder/app-graph-builder.ts +61 -0
  66. package/src/capabilities/app-graph-builder/index.ts +7 -0
  67. package/src/capabilities/index.ts +5 -8
  68. package/src/capabilities/operation-resolver/index.ts +5 -0
  69. package/src/capabilities/operation-resolver/operation-resolver.ts +23 -0
  70. package/src/capabilities/react-root/index.ts +7 -0
  71. package/src/capabilities/react-root/react-root.tsx +36 -0
  72. package/src/capabilities/react-surface/index.ts +7 -0
  73. package/src/capabilities/react-surface/react-surface.tsx +34 -0
  74. package/src/capabilities/state/index.ts +7 -0
  75. package/src/capabilities/state/state.ts +27 -0
  76. package/src/components/Shortcuts/ShortcutsDialog.tsx +7 -9
  77. package/src/components/Shortcuts/ShortcutsHints.tsx +14 -6
  78. package/src/components/Shortcuts/ShortcutsList.tsx +4 -3
  79. package/src/components/Shortcuts/ShortcutsSection.tsx +1 -1
  80. package/src/components/Shortcuts/styles.ts +1 -1
  81. package/src/components/Tooltip/Tooltip.tsx +28 -27
  82. package/src/components/WelcomeTour/WelcomeTour.stories.tsx +23 -18
  83. package/src/components/WelcomeTour/WelcomeTour.tsx +16 -19
  84. package/src/index.ts +1 -1
  85. package/src/meta.ts +8 -6
  86. package/src/types/capabilities.ts +24 -0
  87. package/src/types/index.ts +6 -0
  88. package/src/{types.ts → types/schema.ts} +13 -10
  89. package/dist/lib/browser/app-graph-builder-IXCF4ZDE.mjs +0 -79
  90. package/dist/lib/browser/app-graph-builder-IXCF4ZDE.mjs.map +0 -7
  91. package/dist/lib/browser/chunk-27RZVOIE.mjs +0 -408
  92. package/dist/lib/browser/chunk-27RZVOIE.mjs.map +0 -7
  93. package/dist/lib/browser/chunk-3Y4CMOZP.mjs +0 -13
  94. package/dist/lib/browser/chunk-3Y4CMOZP.mjs.map +0 -7
  95. package/dist/lib/browser/chunk-LDRUZNSN.mjs +0 -16
  96. package/dist/lib/browser/chunk-LDRUZNSN.mjs.map +0 -7
  97. package/dist/lib/browser/chunk-WAN2NFYE.mjs +0 -36
  98. package/dist/lib/browser/chunk-WAN2NFYE.mjs.map +0 -7
  99. package/dist/lib/browser/react-root-A32LXEU4.mjs +0 -34
  100. package/dist/lib/browser/react-root-A32LXEU4.mjs.map +0 -7
  101. package/dist/lib/browser/react-surface-DIIOUUMT.mjs.map +0 -7
  102. package/dist/lib/browser/state-FWUZG6NL.mjs +0 -29
  103. package/dist/lib/browser/state-FWUZG6NL.mjs.map +0 -7
  104. package/dist/lib/browser/types.mjs +0 -12
  105. package/dist/lib/node-esm/app-graph-builder-5QQRWRWG.mjs +0 -80
  106. package/dist/lib/node-esm/app-graph-builder-5QQRWRWG.mjs.map +0 -7
  107. package/dist/lib/node-esm/chunk-6JMO5FFN.mjs +0 -37
  108. package/dist/lib/node-esm/chunk-6JMO5FFN.mjs.map +0 -7
  109. package/dist/lib/node-esm/chunk-CXQ5LKQI.mjs +0 -17
  110. package/dist/lib/node-esm/chunk-CXQ5LKQI.mjs.map +0 -7
  111. package/dist/lib/node-esm/chunk-PU7X4MJO.mjs +0 -409
  112. package/dist/lib/node-esm/chunk-PU7X4MJO.mjs.map +0 -7
  113. package/dist/lib/node-esm/chunk-T523OGIV.mjs +0 -15
  114. package/dist/lib/node-esm/chunk-T523OGIV.mjs.map +0 -7
  115. package/dist/lib/node-esm/index.mjs +0 -115
  116. package/dist/lib/node-esm/index.mjs.map +0 -7
  117. package/dist/lib/node-esm/meta.json +0 -1
  118. package/dist/lib/node-esm/meta.mjs +0 -10
  119. package/dist/lib/node-esm/meta.mjs.map +0 -7
  120. package/dist/lib/node-esm/react-root-Q6PGYYYP.mjs +0 -35
  121. package/dist/lib/node-esm/react-root-Q6PGYYYP.mjs.map +0 -7
  122. package/dist/lib/node-esm/react-surface-QEIKNNW3.mjs +0 -37
  123. package/dist/lib/node-esm/react-surface-QEIKNNW3.mjs.map +0 -7
  124. package/dist/lib/node-esm/state-Y476FGII.mjs +0 -30
  125. package/dist/lib/node-esm/state-Y476FGII.mjs.map +0 -7
  126. package/dist/lib/node-esm/types.mjs +0 -13
  127. package/dist/lib/node-esm/types.mjs.map +0 -7
  128. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  129. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  130. package/dist/types/src/capabilities/capabilities.d.ts +0 -10
  131. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  132. package/dist/types/src/capabilities/react-root.d.ts +0 -8
  133. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  134. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  135. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  136. package/dist/types/src/capabilities/state.d.ts +0 -4
  137. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  138. package/dist/types/src/types.d.ts +0 -29
  139. package/dist/types/src/types.d.ts.map +0 -1
  140. package/src/capabilities/app-graph-builder.ts +0 -76
  141. package/src/capabilities/capabilities.ts +0 -13
  142. package/src/capabilities/react-root.tsx +0 -32
  143. package/src/capabilities/react-surface.tsx +0 -30
  144. package/src/capabilities/state.ts +0 -23
  145. /package/dist/lib/browser/{types.mjs.map → types/index.mjs.map} +0 -0
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/state.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes } from '@dxos/app-framework';\nimport { LocalStorageStore } from '@dxos/local-storage';\n\nimport { HelpCapabilities } from './capabilities';\nimport { HELP_PLUGIN } from '../meta';\n\nexport default () => {\n const state = new LocalStorageStore<HelpCapabilities.State>(HELP_PLUGIN, {\n running: false,\n showHints: true,\n showWelcome: true,\n });\n\n state\n .prop({ key: 'showHints', type: LocalStorageStore.bool() })\n .prop({ key: 'showWelcome', type: LocalStorageStore.bool() });\n\n return contributes(HelpCapabilities.State, state.values);\n};\n"],
5
- "mappings": ";;;;;;;;AAIA,SAASA,mBAAmB;AAC5B,SAASC,yBAAyB;AAKlC,IAAA,gBAAe,MAAA;AACb,QAAMC,QAAQ,IAAIC,kBAA0CC,aAAa;IACvEC,SAAS;IACTC,WAAW;IACXC,aAAa;EACf,CAAA;AAEAL,QACGM,KAAK;IAAEC,KAAK;IAAaC,MAAMP,kBAAkBQ,KAAI;EAAG,CAAA,EACxDH,KAAK;IAAEC,KAAK;IAAeC,MAAMP,kBAAkBQ,KAAI;EAAG,CAAA;AAE7D,SAAOC,YAAYC,iBAAiBC,OAAOZ,MAAMa,MAAM;AACzD;",
6
- "names": ["contributes", "LocalStorageStore", "state", "LocalStorageStore", "HELP_PLUGIN", "running", "showHints", "showWelcome", "prop", "key", "type", "bool", "contributes", "HelpCapabilities", "State", "values"]
7
- }
@@ -1,12 +0,0 @@
1
- import {
2
- HELP_ACTION,
3
- HelpAction,
4
- HelpContext
5
- } from "./chunk-WAN2NFYE.mjs";
6
- import "./chunk-3Y4CMOZP.mjs";
7
- export {
8
- HELP_ACTION,
9
- HelpAction,
10
- HelpContext
11
- };
12
- //# sourceMappingURL=types.mjs.map
@@ -1,80 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- SHORTCUTS_DIALOG
4
- } from "./chunk-PU7X4MJO.mjs";
5
- import {
6
- HelpAction
7
- } from "./chunk-6JMO5FFN.mjs";
8
- import {
9
- HelpCapabilities
10
- } from "./chunk-CXQ5LKQI.mjs";
11
- import {
12
- HELP_PLUGIN
13
- } from "./chunk-T523OGIV.mjs";
14
-
15
- // src/capabilities/app-graph-builder.ts
16
- import { Rx } from "@effect-rx/rx-react";
17
- import { Option, pipe } from "effect";
18
- import { Capabilities, contributes, createIntent, LayoutAction } from "@dxos/app-framework";
19
- import { createExtension } from "@dxos/app-graph";
20
- var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
21
- id: HELP_PLUGIN,
22
- actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === "root" ? Option.some(node2) : Option.none()), Option.map(() => [
23
- {
24
- id: HelpAction.Start._tag,
25
- data: async () => {
26
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
27
- const state = context.getCapability(HelpCapabilities.MutableState);
28
- state.showHints = true;
29
- await dispatch(createIntent(HelpAction.Start));
30
- },
31
- properties: {
32
- label: [
33
- "open help tour",
34
- {
35
- ns: HELP_PLUGIN
36
- }
37
- ],
38
- icon: "ph--info--regular",
39
- keyBinding: {
40
- macos: "shift+meta+/",
41
- // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
42
- windows: "shift+ctrl+/",
43
- linux: "shift+ctrl+?"
44
- },
45
- testId: "helpPlugin.openHelp"
46
- }
47
- },
48
- {
49
- id: "dxos.org/plugin/help/open-shortcuts",
50
- data: async () => {
51
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
52
- const state = context.getCapability(HelpCapabilities.MutableState);
53
- state.showHints = true;
54
- await dispatch(createIntent(LayoutAction.UpdateDialog, {
55
- part: "dialog",
56
- subject: SHORTCUTS_DIALOG,
57
- options: {
58
- blockAlign: "center"
59
- }
60
- }));
61
- },
62
- properties: {
63
- label: [
64
- "open shortcuts label",
65
- {
66
- ns: HELP_PLUGIN
67
- }
68
- ],
69
- icon: "ph--keyboard--regular",
70
- keyBinding: {
71
- macos: "meta+ctrl+/"
72
- }
73
- }
74
- }
75
- ]), Option.getOrElse(() => [])))
76
- }));
77
- export {
78
- app_graph_builder_default as default
79
- };
80
- //# sourceMappingURL=app-graph-builder-5QQRWRWG.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,37 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- HELP_PLUGIN
4
- } from "./chunk-T523OGIV.mjs";
5
-
6
- // src/types.ts
7
- import { Schema } from "effect";
8
- import { createContext } from "react";
9
- var HelpContext = createContext({
10
- running: false,
11
- steps: [],
12
- setSteps: () => {
13
- },
14
- setIndex: () => {
15
- },
16
- start: () => {
17
- },
18
- stop: () => {
19
- }
20
- });
21
- var HELP_ACTION = `${HELP_PLUGIN}/action`;
22
- (function(HelpAction2) {
23
- class Start extends Schema.TaggedClass()(`${HELP_ACTION}/start`, {
24
- input: Schema.Void,
25
- output: Schema.Void
26
- }) {
27
- }
28
- HelpAction2.Start = Start;
29
- })(HelpAction || (HelpAction = {}));
30
- var HelpAction;
31
-
32
- export {
33
- HelpContext,
34
- HELP_ACTION,
35
- HelpAction
36
- };
37
- //# sourceMappingURL=chunk-6JMO5FFN.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types.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 { HELP_PLUGIN } 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 const HELP_ACTION = `${HELP_PLUGIN}/action`;\nexport namespace HelpAction {\n export class Start extends Schema.TaggedClass<Start>()(`${HELP_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;AAEO,IAAMC,cAAc,GAAGC,WAAAA;UACbC,aAAAA;EACR,MAAMC,cAAcC,OAAOC,YAAW,EAAU,GAAGL,WAAAA,UAAqB;IAC7EM,OAAOF,OAAOG;IACdC,QAAQJ,OAAOG;EACjB,CAAA,EAAA;EAAI;cAHSJ,QAAAA;AAIf,GALiBD,eAAAA,aAAAA,CAAAA,EAAAA;;",
6
- "names": ["Schema", "createContext", "HelpContext", "createContext", "running", "steps", "setSteps", "setIndex", "start", "stop", "HELP_ACTION", "HELP_PLUGIN", "HelpAction", "Start", "Schema", "TaggedClass", "input", "Void", "output"]
7
- }
@@ -1,17 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- HELP_PLUGIN
4
- } from "./chunk-T523OGIV.mjs";
5
-
6
- // src/capabilities/capabilities.ts
7
- import { defineCapability } from "@dxos/app-framework";
8
- (function(HelpCapabilities2) {
9
- HelpCapabilities2.State = defineCapability(`${HELP_PLUGIN}/capability/state`);
10
- HelpCapabilities2.MutableState = defineCapability(`${HELP_PLUGIN}/capability/state`);
11
- })(HelpCapabilities || (HelpCapabilities = {}));
12
- var HelpCapabilities;
13
-
14
- export {
15
- HelpCapabilities
16
- };
17
- //# sourceMappingURL=chunk-CXQ5LKQI.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
- }
@@ -1,409 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- HelpContext
4
- } from "./chunk-6JMO5FFN.mjs";
5
- import {
6
- HELP_PLUGIN
7
- } from "./chunk-T523OGIV.mjs";
8
-
9
- // src/components/Shortcuts/Key.tsx
10
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
11
- import React from "react";
12
- import { keySymbols } from "@dxos/keyboard";
13
-
14
- // src/components/Shortcuts/styles.ts
15
- import { mx } from "@dxos/react-ui-theme";
16
- 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");
17
-
18
- // src/components/Shortcuts/Key.tsx
19
- var Key = ({ binding }) => {
20
- var _effect = _useSignals();
21
- try {
22
- return /* @__PURE__ */ React.createElement("span", {
23
- role: "term",
24
- className: "inline-flex gap-1",
25
- "aria-label": binding,
26
- id: binding
27
- }, keySymbols(binding).map((c, i) => /* @__PURE__ */ React.createElement("span", {
28
- key: i,
29
- className: shortcutKey
30
- }, c)));
31
- } finally {
32
- _effect.f();
33
- }
34
- };
35
-
36
- // src/components/Shortcuts/ShortcutsList.tsx
37
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
38
- import React2, { Fragment } from "react";
39
- import { Keyboard } from "@dxos/keyboard";
40
- import { toLocalizedString, useTranslation } from "@dxos/react-ui";
41
- import { mx as mx2 } from "@dxos/react-ui-theme";
42
- var ShortcutsList = () => {
43
- var _effect = _useSignals2();
44
- try {
45
- const { t } = useTranslation(HELP_PLUGIN);
46
- const bindings = Keyboard.singleton.getBindings();
47
- bindings.sort((a, b) => {
48
- return toLocalizedString(a.data, t)?.toLowerCase().localeCompare(toLocalizedString(b.data, t)?.toLowerCase());
49
- });
50
- return /* @__PURE__ */ React2.createElement("dl", {
51
- className: mx2("is-fit grid grid-cols-[min-content_minmax(12rem,1fr)] gap-2 mlb-4 text-subdued select-none")
52
- }, bindings.map((binding, i) => /* @__PURE__ */ React2.createElement(Fragment, {
53
- key: i
54
- }, /* @__PURE__ */ React2.createElement(Key, {
55
- binding: binding.shortcut
56
- }), /* @__PURE__ */ React2.createElement("span", {
57
- role: "definition",
58
- className: "mis-4",
59
- "aria-labelledby": binding.shortcut
60
- }, toLocalizedString(binding.data, t)))));
61
- } finally {
62
- _effect.f();
63
- }
64
- };
65
-
66
- // src/components/Shortcuts/ShortcutsDialog.tsx
67
- import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
68
- import React3 from "react";
69
- import { Button, Dialog, Icon, useTranslation as useTranslation2 } from "@dxos/react-ui";
70
- var SHORTCUTS_DIALOG = `${HELP_PLUGIN}/ShortcutsDialog`;
71
- var ShortcutsDialogContent = () => {
72
- var _effect = _useSignals3();
73
- try {
74
- const { t } = useTranslation2(HELP_PLUGIN);
75
- return /* @__PURE__ */ React3.createElement(Dialog.Content, {
76
- classNames: "p-0 bs-content max-bs-full md:max-is-[25rem] overflow-hidden"
77
- }, /* @__PURE__ */ React3.createElement("div", {
78
- role: "none",
79
- className: "flex justify-between mbe-1 pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5"
80
- }, /* @__PURE__ */ React3.createElement(Dialog.Title, null, t("shortcuts dialog title")), /* @__PURE__ */ React3.createElement(Dialog.Close, {
81
- asChild: true
82
- }, /* @__PURE__ */ React3.createElement(Button, {
83
- density: "fine",
84
- variant: "ghost",
85
- autoFocus: true
86
- }, /* @__PURE__ */ React3.createElement(Icon, {
87
- icon: "ph--x--bold",
88
- size: 3
89
- })))), /* @__PURE__ */ React3.createElement("div", {
90
- className: "flex items-center justify-center"
91
- }, /* @__PURE__ */ React3.createElement(ShortcutsList, null)));
92
- } finally {
93
- _effect.f();
94
- }
95
- };
96
-
97
- // src/components/Shortcuts/ShortcutsHints.tsx
98
- import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
99
- import React4 from "react";
100
- import { Keyboard as Keyboard2 } from "@dxos/keyboard";
101
- import { Button as Button2, Icon as Icon2, toLocalizedString as toLocalizedString2, useTranslation as useTranslation3 } from "@dxos/react-ui";
102
- var Shortcut = ({ binding }) => {
103
- var _effect = _useSignals4();
104
- try {
105
- const { t } = useTranslation3("os");
106
- return /* @__PURE__ */ React4.createElement("div", {
107
- role: "none",
108
- className: "flex items-center gap-2 whitespace-nowrap"
109
- }, /* @__PURE__ */ React4.createElement(Key, {
110
- binding: binding.shortcut
111
- }), /* @__PURE__ */ React4.createElement("span", {
112
- className: "text-sm"
113
- }, toLocalizedString2(binding.data, t)));
114
- } finally {
115
- _effect.f();
116
- }
117
- };
118
- var ShortcutsHints = ({ onClose }) => {
119
- var _effect = _useSignals4();
120
- try {
121
- const defaults = [
122
- "meta+k",
123
- "meta+/",
124
- "meta+,"
125
- ];
126
- const bindings = Keyboard2.singleton.getBindings();
127
- const hints = bindings.filter((binding) => defaults.includes(binding.shortcut));
128
- return /* @__PURE__ */ React4.createElement("div", {
129
- role: "none",
130
- className: "flex overflow-hidden px-2 gap-4"
131
- }, hints.map((binding) => /* @__PURE__ */ React4.createElement(Shortcut, {
132
- key: binding.shortcut,
133
- binding
134
- })), onClose && /* @__PURE__ */ React4.createElement(Button2, {
135
- variant: "ghost",
136
- classNames: "p-0 cursor-pointer",
137
- onClick: onClose
138
- }, /* @__PURE__ */ React4.createElement(Icon2, {
139
- icon: "ph--x--regular",
140
- size: 4
141
- })));
142
- } finally {
143
- _effect.f();
144
- }
145
- };
146
-
147
- // src/components/Shortcuts/ShortcutsSection.tsx
148
- import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
149
- import React5 from "react";
150
- import { descriptionText } from "@dxos/react-ui-theme";
151
- var ShortcutsSection = () => {
152
- var _effect = _useSignals5();
153
- try {
154
- return /* @__PURE__ */ React5.createElement("section", {
155
- className: descriptionText
156
- }, /* @__PURE__ */ React5.createElement(ShortcutsList, null));
157
- } finally {
158
- _effect.f();
159
- }
160
- };
161
-
162
- // src/components/Tooltip/Tooltip.tsx
163
- import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
164
- import { useArrowNavigationGroup, useFocusableGroup } from "@fluentui/react-tabster";
165
- import { CaretLeft, CaretRight, Circle, X } from "@phosphor-icons/react";
166
- import React6, { forwardRef } from "react";
167
- import { Button as Button3 } from "@dxos/react-ui";
168
- import { getSize, mx as mx3 } from "@dxos/react-ui-theme";
169
- var floaterProps = {
170
- styles: {
171
- // Arrow color is set by joyride.
172
- arrow: {
173
- length: 8,
174
- spread: 16
175
- },
176
- floater: {
177
- // TODO(burdon): Get tokens from theme.
178
- filter: "drop-shadow(0 0 0.75rem rgba(0, 0, 0, 0.2))"
179
- }
180
- }
181
- };
182
- var Tooltip = /* @__PURE__ */ forwardRef(({ step: { title, content }, index, size, isLastStep, backProps, closeProps, primaryProps }, forwardedRef) => {
183
- var _effect = _useSignals6();
184
- try {
185
- const arrowNavigationAttrs = useArrowNavigationGroup({
186
- axis: "horizontal"
187
- });
188
- const focusableGroupAttrs = useFocusableGroup({
189
- tabBehavior: "limited-trap-focus"
190
- });
191
- return /* @__PURE__ */ React6.createElement("div", {
192
- className: "flex flex-col is-[15rem] min-bs-[10rem] overflow-hidden rounded-md shadow-xl bg-accentSurface text-accentSurfaceText",
193
- role: "tooltip",
194
- "data-testid": "helpPlugin.tooltip",
195
- "data-step": index + 1,
196
- ...focusableGroupAttrs,
197
- ref: forwardedRef
198
- }, /* @__PURE__ */ React6.createElement("div", {
199
- className: "flex p-2"
200
- }, /* @__PURE__ */ React6.createElement("h2", {
201
- className: "grow pli-2 plb-1 text-lg font-medium text-accentSurfaceText"
202
- }, title), /* @__PURE__ */ React6.createElement(Button3, {
203
- density: "fine",
204
- variant: "primary",
205
- onClick: closeProps.onClick,
206
- title: closeProps["aria-label"],
207
- "data-testid": "helpPlugin.tooltip.close"
208
- }, /* @__PURE__ */ React6.createElement(X, {
209
- weight: "bold",
210
- className: getSize(4)
211
- }))), /* @__PURE__ */ React6.createElement("div", {
212
- className: "flex grow pli-4 mlb-2"
213
- }, content), /* @__PURE__ */ React6.createElement("div", {
214
- className: "flex p-2 items-center justify-between",
215
- ...arrowNavigationAttrs
216
- }, /* @__PURE__ */ React6.createElement(Button3, {
217
- variant: "primary",
218
- onClick: backProps.onClick,
219
- title: backProps["aria-label"],
220
- classNames: [
221
- !(index > 0 && backProps) && "invisible"
222
- ],
223
- "data-testid": "helpPlugin.tooltip.back"
224
- }, /* @__PURE__ */ React6.createElement(CaretLeft, {
225
- className: getSize(5)
226
- })), /* @__PURE__ */ React6.createElement("div", {
227
- className: "flex grow gap-2 justify-center"
228
- }, /* @__PURE__ */ React6.createElement("div", {
229
- className: "flex"
230
- }, Array.from({
231
- length: size
232
- }).map((_, i) => /* @__PURE__ */ React6.createElement(Circle, {
233
- key: i,
234
- weight: index === i ? "fill" : "regular",
235
- className: mx3(getSize(2), "mli-1 cursor-pointer")
236
- })))), isLastStep ? /* @__PURE__ */ React6.createElement(Button3, {
237
- variant: "primary",
238
- onClick: closeProps.onClick,
239
- title: closeProps["aria-label"],
240
- autoFocus: true,
241
- "data-testid": "helpPlugin.tooltip.finish"
242
- }, "Done") : /* @__PURE__ */ React6.createElement(Button3, {
243
- variant: "primary",
244
- onClick: primaryProps.onClick,
245
- title: primaryProps["aria-label"],
246
- autoFocus: true,
247
- "data-testid": "helpPlugin.tooltip.next"
248
- }, /* @__PURE__ */ React6.createElement(CaretRight, {
249
- className: getSize(6)
250
- }))));
251
- } finally {
252
- _effect.f();
253
- }
254
- });
255
-
256
- // src/components/WelcomeTour/WelcomeTour.tsx
257
- import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
258
- import React7, { useState, useEffect } from "react";
259
- import Joyride, { ACTIONS, EVENTS } from "react-joyride";
260
- import { usePluginManager, useLayout } from "@dxos/app-framework";
261
- var addStepClass = (target) => {
262
- const element = typeof target === "string" ? document.querySelector(target) : target;
263
- if (element) {
264
- element.classList.add("joyride-target");
265
- }
266
- };
267
- var removeTargetClass = (target) => {
268
- const element = typeof target === "string" ? document.querySelector(target) : target;
269
- if (element) {
270
- element.classList.remove("joyride-target");
271
- }
272
- };
273
- var getTarget = (step) => {
274
- return typeof step.target === "string" ? document.querySelector(step.target) : step.target;
275
- };
276
- var waitForTarget = async (step) => {
277
- if (typeof step.target === "string") {
278
- const target = step.target;
279
- const element = document.querySelector(target);
280
- if (element) {
281
- return;
282
- }
283
- await new Promise((resolve) => {
284
- const observer = new MutationObserver((mutations) => {
285
- mutations.forEach((mutation) => {
286
- if (mutation.addedNodes.length > 0) {
287
- const element2 = document.querySelector(target);
288
- if (element2) {
289
- observer.disconnect();
290
- resolve();
291
- }
292
- }
293
- });
294
- });
295
- observer.observe(document.body, {
296
- childList: true,
297
- subtree: true
298
- });
299
- });
300
- }
301
- };
302
- var WelcomeTour = ({ steps: initialSteps, running: runningProp, onRunningChanged }) => {
303
- var _effect = _useSignals7();
304
- try {
305
- const manager = usePluginManager();
306
- const layout = useLayout();
307
- const [running, setRunning] = useState(!!runningProp && !!getTarget(initialSteps[0]));
308
- const [stepIndex, _setStepIndex] = useState(0);
309
- const [steps, setSteps] = useState(initialSteps);
310
- const paused = layout.dialogOpen;
311
- const setStepIndex = (index) => {
312
- if (runningProp) {
313
- const step = steps[index];
314
- step?.before?.(manager.context);
315
- }
316
- _setStepIndex(index);
317
- };
318
- const setRunningChanged = (state) => {
319
- if (typeof runningProp !== "undefined") {
320
- onRunningChanged?.(state);
321
- } else {
322
- if (state) {
323
- setStepIndex(0);
324
- setRunning(true);
325
- } else {
326
- setRunning(false);
327
- }
328
- }
329
- };
330
- useEffect(() => {
331
- const timeout = setTimeout(async () => {
332
- if (runningProp) {
333
- await waitForTarget(steps[stepIndex]);
334
- setStepIndex(0);
335
- setRunning(true);
336
- } else if (typeof runningProp !== "undefined") {
337
- setRunning(false);
338
- }
339
- });
340
- return () => clearTimeout(timeout);
341
- }, [
342
- runningProp
343
- ]);
344
- const callback = async (options) => {
345
- const { type, action, index, size } = options;
346
- switch (type) {
347
- case EVENTS.STEP_BEFORE:
348
- addStepClass(options.step.target);
349
- break;
350
- case EVENTS.TOUR_END:
351
- break;
352
- case EVENTS.STEP_AFTER:
353
- removeTargetClass(options.step.target);
354
- switch (action) {
355
- case ACTIONS.NEXT:
356
- if (index < size - 1) {
357
- setStepIndex(index + 1);
358
- }
359
- break;
360
- case ACTIONS.PREV:
361
- if (index > 0) {
362
- setStepIndex(index - 1);
363
- }
364
- break;
365
- case ACTIONS.CLOSE:
366
- setRunningChanged(false);
367
- setStepIndex(0);
368
- break;
369
- }
370
- break;
371
- }
372
- };
373
- return /* @__PURE__ */ React7.createElement(HelpContext.Provider, {
374
- value: {
375
- running: running && !paused,
376
- steps,
377
- setSteps,
378
- setIndex: setStepIndex,
379
- start: () => setRunningChanged(true),
380
- stop: () => setRunningChanged(false)
381
- }
382
- }, /* @__PURE__ */ React7.createElement("style", null, `.joyride-target {
383
- --controls-opacity: 1;
384
- }`), /* @__PURE__ */ React7.createElement(Joyride, {
385
- continuous: true,
386
- steps,
387
- stepIndex,
388
- run: running && !paused,
389
- callback,
390
- floaterProps,
391
- tooltipComponent: Tooltip
392
- }));
393
- } finally {
394
- _effect.f();
395
- }
396
- };
397
-
398
- export {
399
- Key,
400
- ShortcutsList,
401
- SHORTCUTS_DIALOG,
402
- ShortcutsDialogContent,
403
- ShortcutsHints,
404
- ShortcutsSection,
405
- floaterProps,
406
- Tooltip,
407
- WelcomeTour
408
- };
409
- //# sourceMappingURL=chunk-PU7X4MJO.mjs.map