@dxos/plugin-help 0.8.3-staging.0fa589b → 0.8.4-main.3f58842
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.
- package/dist/lib/browser/{app-graph-builder-2TXP7S56.mjs → app-graph-builder-BYCMEBNG.mjs} +6 -6
- package/dist/lib/browser/{chunk-4KTRSNO5.mjs → chunk-3Y4CMOZP.mjs} +2 -2
- package/dist/lib/browser/{chunk-BZUIJQPN.mjs → chunk-J2SJSGSX.mjs} +5 -7
- package/dist/lib/browser/chunk-J2SJSGSX.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ACLT6V7I.mjs → chunk-LDRUZNSN.mjs} +3 -3
- package/dist/lib/browser/{chunk-JNDWLTUJ.mjs → chunk-MNETJXKS.mjs} +40 -39
- package/dist/lib/browser/chunk-MNETJXKS.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +16 -18
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/{react-root-PRXEQ5QF.mjs → react-root-W6ZDEGBU.mjs} +6 -6
- package/dist/lib/browser/{react-surface-IDR3XY36.mjs → react-surface-SATVEWS5.mjs} +5 -5
- package/dist/lib/browser/{state-UOKD6P5V.mjs → state-FWUZG6NL.mjs} +4 -4
- package/dist/lib/browser/types/index.mjs +10 -0
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts +1 -1
- package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +9 -9
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/{types.d.ts → types/schema.d.ts} +3 -4
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -28
- package/src/HelpPlugin.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +28 -26
- package/src/components/WelcomeTour/WelcomeTour.stories.tsx +6 -7
- package/src/translations.ts +6 -4
- package/src/types/index.ts +5 -0
- package/src/{types.ts → types/schema.ts} +2 -3
- package/dist/lib/browser/chunk-BZUIJQPN.mjs.map +0 -7
- package/dist/lib/browser/chunk-JNDWLTUJ.mjs.map +0 -7
- package/dist/lib/browser/types.mjs +0 -12
- package/dist/types/src/types.d.ts.map +0 -1
- /package/dist/lib/browser/{app-graph-builder-2TXP7S56.mjs.map → app-graph-builder-BYCMEBNG.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-4KTRSNO5.mjs.map → chunk-3Y4CMOZP.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-ACLT6V7I.mjs.map → chunk-LDRUZNSN.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-PRXEQ5QF.mjs.map → react-root-W6ZDEGBU.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-IDR3XY36.mjs.map → react-surface-SATVEWS5.mjs.map} +0 -0
- /package/dist/lib/browser/{state-UOKD6P5V.mjs.map → state-FWUZG6NL.mjs.map} +0 -0
- /package/dist/lib/browser/{types.mjs.map → types/index.mjs.map} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SHORTCUTS_DIALOG
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MNETJXKS.mjs";
|
|
4
4
|
import {
|
|
5
5
|
HelpAction
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-J2SJSGSX.mjs";
|
|
7
7
|
import {
|
|
8
8
|
HelpCapabilities
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LDRUZNSN.mjs";
|
|
10
10
|
import {
|
|
11
11
|
HELP_PLUGIN
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3Y4CMOZP.mjs";
|
|
13
13
|
|
|
14
|
-
//
|
|
14
|
+
// src/capabilities/app-graph-builder.ts
|
|
15
15
|
import { Rx } from "@effect-rx/rx-react";
|
|
16
16
|
import { Option, pipe } from "effect";
|
|
17
17
|
import { Capabilities, contributes, createIntent, LayoutAction } from "@dxos/app-framework";
|
|
@@ -76,4 +76,4 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
76
76
|
export {
|
|
77
77
|
app_graph_builder_default as default
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=app-graph-builder-
|
|
79
|
+
//# sourceMappingURL=app-graph-builder-BYCMEBNG.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// src/meta.ts
|
|
2
2
|
var HELP_PLUGIN = "dxos.org/plugin/help";
|
|
3
3
|
var meta = {
|
|
4
4
|
id: HELP_PLUGIN,
|
|
@@ -10,4 +10,4 @@ export {
|
|
|
10
10
|
HELP_PLUGIN,
|
|
11
11
|
meta
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-3Y4CMOZP.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-3Y4CMOZP.mjs";
|
|
4
4
|
|
|
5
|
-
//
|
|
5
|
+
// src/types/schema.ts
|
|
6
6
|
import { Schema } from "effect";
|
|
7
7
|
import { createContext } from "react";
|
|
8
8
|
var HelpContext = createContext({
|
|
@@ -17,9 +17,8 @@ var HelpContext = createContext({
|
|
|
17
17
|
stop: () => {
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
var HELP_ACTION = `${HELP_PLUGIN}/action`;
|
|
21
20
|
(function(HelpAction2) {
|
|
22
|
-
class Start extends Schema.TaggedClass()(`${
|
|
21
|
+
class Start extends Schema.TaggedClass()(`${meta.id}/action/start`, {
|
|
23
22
|
input: Schema.Void,
|
|
24
23
|
output: Schema.Void
|
|
25
24
|
}) {
|
|
@@ -30,7 +29,6 @@ var HelpAction;
|
|
|
30
29
|
|
|
31
30
|
export {
|
|
32
31
|
HelpContext,
|
|
33
|
-
HELP_ACTION,
|
|
34
32
|
HelpAction
|
|
35
33
|
};
|
|
36
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
//# sourceMappingURL=chunk-J2SJSGSX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/schema.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\nimport { type Context, createContext } from 'react';\nimport { type Step as BaseStep } from 'react-joyride';\n\nimport { type PluginContext } from '@dxos/app-framework';\n\nimport { meta } from '../meta';\n\nexport type Step = BaseStep & {\n before?: (context: PluginContext) => void;\n};\n\nexport type HelpContextType = {\n running: boolean;\n steps: Step[];\n setSteps: (steps: Step[]) => void;\n setIndex: (index: number) => void;\n start: () => void;\n stop: () => void;\n};\n\nexport const HelpContext: Context<HelpContextType> = createContext<HelpContextType>({\n running: false,\n steps: [],\n setSteps: () => {},\n setIndex: () => {},\n start: () => {},\n stop: () => {},\n});\n\nexport namespace HelpAction {\n export class Start extends Schema.TaggedClass<Start>()(`${meta.id}/action/start`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,cAAc;AACvB,SAAuBC,qBAAqB;AAoBrC,IAAMC,cAAwCC,cAA+B;EAClFC,SAAS;EACTC,OAAO,CAAA;EACPC,UAAU,MAAA;EAAO;EACjBC,UAAU,MAAA;EAAO;EACjBC,OAAO,MAAA;EAAO;EACdC,MAAM,MAAA;EAAO;AACf,CAAA;UAEiBC,aAAAA;EACR,MAAMC,cAAcC,OAAOC,YAAW,EAAU,GAAGC,KAAKC,EAAE,iBAAiB;IAChFC,OAAOJ,OAAOK;IACdC,QAAQN,OAAOK;EACjB,CAAA,EAAA;EAAI;cAHSN,QAAAA;AAIf,GALiBD,eAAAA,aAAAA,CAAAA,EAAAA;;",
|
|
6
|
+
"names": ["Schema", "createContext", "HelpContext", "createContext", "running", "steps", "setSteps", "setIndex", "start", "stop", "HelpAction", "Start", "Schema", "TaggedClass", "meta", "id", "input", "Void", "output"]
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HELP_PLUGIN
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3Y4CMOZP.mjs";
|
|
4
4
|
|
|
5
|
-
//
|
|
5
|
+
// src/capabilities/capabilities.ts
|
|
6
6
|
import { defineCapability } from "@dxos/app-framework";
|
|
7
7
|
(function(HelpCapabilities2) {
|
|
8
8
|
HelpCapabilities2.State = defineCapability(`${HELP_PLUGIN}/capability/state`);
|
|
@@ -13,4 +13,4 @@ var HelpCapabilities;
|
|
|
13
13
|
export {
|
|
14
14
|
HelpCapabilities
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-LDRUZNSN.mjs.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HelpContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-J2SJSGSX.mjs";
|
|
4
4
|
import {
|
|
5
5
|
HELP_PLUGIN
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3Y4CMOZP.mjs";
|
|
7
7
|
|
|
8
|
-
//
|
|
8
|
+
// src/components/Shortcuts/Key.tsx
|
|
9
9
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
10
10
|
import React from "react";
|
|
11
11
|
import { keySymbols } from "@dxos/keyboard";
|
|
12
12
|
|
|
13
|
-
//
|
|
13
|
+
// src/components/Shortcuts/styles.ts
|
|
14
14
|
import { mx } from "@dxos/react-ui-theme";
|
|
15
15
|
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");
|
|
16
16
|
|
|
17
|
-
//
|
|
17
|
+
// src/components/Shortcuts/Key.tsx
|
|
18
18
|
var Key = ({ binding }) => {
|
|
19
19
|
var _effect = _useSignals();
|
|
20
20
|
try {
|
|
@@ -32,7 +32,7 @@ var Key = ({ binding }) => {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
//
|
|
35
|
+
// src/components/Shortcuts/ShortcutsList.tsx
|
|
36
36
|
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
37
37
|
import React2, { Fragment } from "react";
|
|
38
38
|
import { Keyboard } from "@dxos/keyboard";
|
|
@@ -62,7 +62,7 @@ var ShortcutsList = () => {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
//
|
|
65
|
+
// src/components/Shortcuts/ShortcutsDialog.tsx
|
|
66
66
|
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
67
67
|
import React3 from "react";
|
|
68
68
|
import { Button, Dialog, Icon, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
@@ -93,7 +93,7 @@ var ShortcutsDialogContent = () => {
|
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
//
|
|
96
|
+
// src/components/Shortcuts/ShortcutsHints.tsx
|
|
97
97
|
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
98
98
|
import React4 from "react";
|
|
99
99
|
import { Keyboard as Keyboard2 } from "@dxos/keyboard";
|
|
@@ -143,7 +143,7 @@ var ShortcutsHints = ({ onClose }) => {
|
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
145
|
|
|
146
|
-
//
|
|
146
|
+
// src/components/Shortcuts/ShortcutsSection.tsx
|
|
147
147
|
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
148
148
|
import React5 from "react";
|
|
149
149
|
import { descriptionText } from "@dxos/react-ui-theme";
|
|
@@ -158,13 +158,11 @@ var ShortcutsSection = () => {
|
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
|
|
161
|
-
//
|
|
161
|
+
// src/components/Tooltip/Tooltip.tsx
|
|
162
162
|
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
163
163
|
import { useArrowNavigationGroup, useFocusableGroup } from "@fluentui/react-tabster";
|
|
164
|
-
import { CaretLeft, CaretRight, Circle, X } from "@phosphor-icons/react";
|
|
165
164
|
import React6, { forwardRef } from "react";
|
|
166
|
-
import { Button as Button3 } from "@dxos/react-ui";
|
|
167
|
-
import { getSize, mx as mx3 } from "@dxos/react-ui-theme";
|
|
165
|
+
import { Button as Button3, Icon as Icon3, IconButton } from "@dxos/react-ui";
|
|
168
166
|
var floaterProps = {
|
|
169
167
|
styles: {
|
|
170
168
|
// Arrow color is set by joyride.
|
|
@@ -198,61 +196,64 @@ var Tooltip = /* @__PURE__ */ forwardRef(({ step: { title, content }, index, siz
|
|
|
198
196
|
className: "flex p-2"
|
|
199
197
|
}, /* @__PURE__ */ React6.createElement("h2", {
|
|
200
198
|
className: "grow pli-2 plb-1 text-lg font-medium text-accentSurfaceText"
|
|
201
|
-
}, title), /* @__PURE__ */ React6.createElement(
|
|
199
|
+
}, title), /* @__PURE__ */ React6.createElement(IconButton, {
|
|
202
200
|
density: "fine",
|
|
203
|
-
|
|
201
|
+
icon: "ph--x--bold",
|
|
202
|
+
iconOnly: true,
|
|
203
|
+
label: closeProps["aria-label"],
|
|
204
204
|
onClick: closeProps.onClick,
|
|
205
|
-
|
|
205
|
+
size: 4,
|
|
206
|
+
variant: "primary",
|
|
206
207
|
"data-testid": "helpPlugin.tooltip.close"
|
|
207
|
-
}, /* @__PURE__ */ React6.createElement(
|
|
208
|
-
weight: "bold",
|
|
209
|
-
className: getSize(4)
|
|
210
|
-
}))), /* @__PURE__ */ React6.createElement("div", {
|
|
208
|
+
})), /* @__PURE__ */ React6.createElement("div", {
|
|
211
209
|
className: "flex grow pli-4 mlb-2"
|
|
212
210
|
}, content), /* @__PURE__ */ React6.createElement("div", {
|
|
213
211
|
className: "flex p-2 items-center justify-between",
|
|
214
212
|
...arrowNavigationAttrs
|
|
215
|
-
}, /* @__PURE__ */ React6.createElement(
|
|
216
|
-
variant: "primary",
|
|
217
|
-
onClick: backProps.onClick,
|
|
218
|
-
title: backProps["aria-label"],
|
|
213
|
+
}, /* @__PURE__ */ React6.createElement(IconButton, {
|
|
219
214
|
classNames: [
|
|
220
215
|
!(index > 0 && backProps) && "invisible"
|
|
221
216
|
],
|
|
217
|
+
icon: "ph--caret-left--regular",
|
|
218
|
+
iconOnly: true,
|
|
219
|
+
label: backProps["aria-label"],
|
|
220
|
+
onClick: backProps.onClick,
|
|
221
|
+
size: 5,
|
|
222
|
+
variant: "primary",
|
|
222
223
|
"data-testid": "helpPlugin.tooltip.back"
|
|
223
|
-
}, /* @__PURE__ */ React6.createElement(
|
|
224
|
-
className: getSize(5)
|
|
225
|
-
})), /* @__PURE__ */ React6.createElement("div", {
|
|
224
|
+
}), /* @__PURE__ */ React6.createElement("div", {
|
|
226
225
|
className: "flex grow gap-2 justify-center"
|
|
227
226
|
}, /* @__PURE__ */ React6.createElement("div", {
|
|
228
227
|
className: "flex"
|
|
229
228
|
}, Array.from({
|
|
230
229
|
length: size
|
|
231
|
-
}).map((_, i) => /* @__PURE__ */ React6.createElement(
|
|
230
|
+
}).map((_, i) => /* @__PURE__ */ React6.createElement(Icon3, {
|
|
232
231
|
key: i,
|
|
233
|
-
|
|
234
|
-
|
|
232
|
+
icon: index === i ? "ph--circle--fill" : "ph--circle--regular",
|
|
233
|
+
size: 2,
|
|
234
|
+
classNames: "mli-1 cursor-pointer"
|
|
235
235
|
})))), isLastStep ? /* @__PURE__ */ React6.createElement(Button3, {
|
|
236
236
|
variant: "primary",
|
|
237
237
|
onClick: closeProps.onClick,
|
|
238
238
|
title: closeProps["aria-label"],
|
|
239
239
|
autoFocus: true,
|
|
240
240
|
"data-testid": "helpPlugin.tooltip.finish"
|
|
241
|
-
}, "Done") : /* @__PURE__ */ React6.createElement(
|
|
242
|
-
variant: "primary",
|
|
243
|
-
onClick: primaryProps.onClick,
|
|
244
|
-
title: primaryProps["aria-label"],
|
|
241
|
+
}, "Done") : /* @__PURE__ */ React6.createElement(IconButton, {
|
|
245
242
|
autoFocus: true,
|
|
243
|
+
icon: "ph--caret-right--regular",
|
|
244
|
+
iconOnly: true,
|
|
245
|
+
label: primaryProps["aria-label"],
|
|
246
|
+
onClick: primaryProps.onClick,
|
|
247
|
+
size: 6,
|
|
248
|
+
variant: "primary",
|
|
246
249
|
"data-testid": "helpPlugin.tooltip.next"
|
|
247
|
-
}
|
|
248
|
-
className: getSize(6)
|
|
249
|
-
}))));
|
|
250
|
+
})));
|
|
250
251
|
} finally {
|
|
251
252
|
_effect.f();
|
|
252
253
|
}
|
|
253
254
|
});
|
|
254
255
|
|
|
255
|
-
//
|
|
256
|
+
// src/components/WelcomeTour/WelcomeTour.tsx
|
|
256
257
|
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
257
258
|
import React7, { useState, useEffect } from "react";
|
|
258
259
|
import Joyride, { ACTIONS, EVENTS } from "react-joyride";
|
|
@@ -405,4 +406,4 @@ export {
|
|
|
405
406
|
Tooltip,
|
|
406
407
|
WelcomeTour
|
|
407
408
|
};
|
|
408
|
-
//# sourceMappingURL=chunk-
|
|
409
|
+
//# sourceMappingURL=chunk-MNETJXKS.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/Shortcuts/Key.tsx", "../../../src/components/Shortcuts/styles.ts", "../../../src/components/Shortcuts/ShortcutsList.tsx", "../../../src/components/Shortcuts/ShortcutsDialog.tsx", "../../../src/components/Shortcuts/ShortcutsHints.tsx", "../../../src/components/Shortcuts/ShortcutsSection.tsx", "../../../src/components/Tooltip/Tooltip.tsx", "../../../src/components/WelcomeTour/WelcomeTour.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { keySymbols } from '@dxos/keyboard';\n\nimport { shortcutKey } from './styles';\n\nexport const Key = ({ binding }: { binding: string }) => {\n return (\n <span role='term' className='inline-flex gap-1' aria-label={binding} id={binding}>\n {keySymbols(binding).map((c, i) => (\n <span key={i} className={shortcutKey}>\n {c}\n </span>\n ))}\n </span>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { mx } from '@dxos/react-ui-theme';\n\nexport const shortcutKey = mx(\n 'inline-flex min-is-[24px] bs-[24px] pli-0.5 justify-center items-center text-xs',\n 'rounded bg-neutral-100 dark:bg-neutral-900',\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { Fragment } from 'react';\n\nimport { Keyboard } from '@dxos/keyboard';\nimport { toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { Key } from './Key';\nimport { HELP_PLUGIN } from '../../meta';\n\nexport const ShortcutsList = () => {\n const { t } = useTranslation(HELP_PLUGIN);\n const bindings = Keyboard.singleton.getBindings();\n\n // TODO(burdon): Get shortcuts from TextEditor.\n bindings.sort((a, b) => {\n return toLocalizedString(a.data, t)?.toLowerCase().localeCompare(toLocalizedString(b.data, t)?.toLowerCase());\n });\n\n return (\n <dl className={mx('is-fit grid grid-cols-[min-content_minmax(12rem,1fr)] gap-2 mlb-4 text-subdued select-none')}>\n {bindings.map((binding, i) => (\n <Fragment key={i}>\n <Key binding={binding.shortcut} />\n <span role='definition' className='mis-4' aria-labelledby={binding.shortcut}>\n {toLocalizedString(binding.data, t)}\n </span>\n </Fragment>\n ))}\n </dl>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';\n\nimport { ShortcutsList } from './ShortcutsList';\nimport { HELP_PLUGIN } from '../../meta';\n\nexport const SHORTCUTS_DIALOG = `${HELP_PLUGIN}/ShortcutsDialog`;\n\nexport const ShortcutsDialogContent = () => {\n const { t } = useTranslation(HELP_PLUGIN);\n\n return (\n <Dialog.Content classNames='p-0 bs-content max-bs-full md:max-is-[25rem] overflow-hidden'>\n <div role='none' className='flex justify-between mbe-1 pbs-3 pis-2 pie-3 @md:pbs-4 @md:pis-4 @md:pie-5'>\n <Dialog.Title>{t('shortcuts dialog title')}</Dialog.Title>\n\n <Dialog.Close asChild>\n <Button density='fine' variant='ghost' autoFocus>\n <Icon icon='ph--x--bold' size={3} />\n </Button>\n </Dialog.Close>\n </div>\n\n <div className='flex items-center justify-center'>\n <ShortcutsList />\n </div>\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type KeyBinding, Keyboard } from '@dxos/keyboard';\nimport { Button, Icon, toLocalizedString, useTranslation } from '@dxos/react-ui';\n\nimport { Key } from './Key';\n\nconst Shortcut = ({ binding }: { binding: KeyBinding }) => {\n const { t } = useTranslation('os');\n return (\n <div role='none' className='flex items-center gap-2 whitespace-nowrap'>\n <Key binding={binding.shortcut} />\n <span className='text-sm'>{toLocalizedString(binding.data, t)}</span>\n </div>\n );\n};\n\nexport const ShortcutsHints = ({ onClose }: { onClose?: () => void }) => {\n // TODO(burdon): Display by context/weight/cycle.\n const defaults = ['meta+k', 'meta+/', 'meta+,'];\n const bindings = Keyboard.singleton.getBindings();\n const hints = bindings.filter((binding) => defaults.includes(binding.shortcut));\n\n return (\n <div role='none' className='flex overflow-hidden px-2 gap-4'>\n {hints.map((binding) => (\n <Shortcut key={binding.shortcut} binding={binding} />\n ))}\n {onClose && (\n <Button variant='ghost' classNames='p-0 cursor-pointer' onClick={onClose}>\n <Icon icon='ph--x--regular' size={4} />\n </Button>\n )}\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { descriptionText } from '@dxos/react-ui-theme';\n\nimport { ShortcutsList } from './ShortcutsList';\n\nexport const ShortcutsSection = () => {\n return (\n <section className={descriptionText}>\n <ShortcutsList />\n </section>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useArrowNavigationGroup, useFocusableGroup } from '@fluentui/react-tabster';\nimport React, { forwardRef } from 'react';\n// TODO(thure): This needed to be imported in the package.json specifically to pacify TS2742. See if this is resolved with typescript@5.5.x.\n// eslint-disable-next-line unused-imports/no-unused-imports\nimport _floater from 'react-floater';\nimport { type TooltipRenderProps, type Props } from 'react-joyride';\n// TODO(thure): This needed to be imported in the package.json specifically to pacify TS2742. See if this is resolved with typescript@5.5.x.\n// eslint-disable-next-line unused-imports/no-unused-imports\nimport _typefest from 'type-fest';\n\nimport { Button, Icon, IconButton } from '@dxos/react-ui';\n\n// https://docs.react-joyride.com/styling\n// https://github.com/gilbarbara/react-floater\nexport const floaterProps: Props['floaterProps'] = {\n styles: {\n // Arrow color is set by joyride.\n arrow: {\n length: 8,\n spread: 16,\n },\n floater: {\n // TODO(burdon): Get tokens from theme.\n filter: 'drop-shadow(0 0 0.75rem rgba(0, 0, 0, 0.2))',\n },\n },\n};\n\n// TODO(burdon): Add info link to docs.\nexport const Tooltip = forwardRef<HTMLDivElement, TooltipRenderProps>(\n ({ step: { title, content }, index, size, isLastStep, backProps, closeProps, primaryProps }, forwardedRef) => {\n const arrowNavigationAttrs = useArrowNavigationGroup({ axis: 'horizontal' });\n const focusableGroupAttrs = useFocusableGroup({ tabBehavior: 'limited-trap-focus' });\n\n return (\n <div\n className='flex flex-col is-[15rem] min-bs-[10rem] overflow-hidden rounded-md shadow-xl bg-accentSurface text-accentSurfaceText'\n role='tooltip'\n data-testid='helpPlugin.tooltip'\n data-step={index + 1}\n {...focusableGroupAttrs}\n ref={forwardedRef}\n >\n <div className='flex p-2'>\n <h2 className='grow pli-2 plb-1 text-lg font-medium text-accentSurfaceText'>{title}</h2>\n <IconButton\n density='fine'\n icon='ph--x--bold'\n iconOnly\n label={closeProps['aria-label']}\n onClick={closeProps.onClick}\n size={4}\n variant='primary'\n data-testid='helpPlugin.tooltip.close'\n />\n </div>\n <div className='flex grow pli-4 mlb-2'>{content}</div>\n <div className='flex p-2 items-center justify-between' {...arrowNavigationAttrs}>\n {\n <IconButton\n classNames={[!(index > 0 && backProps) && 'invisible']}\n icon='ph--caret-left--regular'\n iconOnly\n label={backProps['aria-label']}\n onClick={backProps.onClick}\n size={5}\n variant='primary'\n data-testid='helpPlugin.tooltip.back'\n />\n }\n <div className='flex grow gap-2 justify-center'>\n <div className='flex'>\n {Array.from({ length: size }).map((_, i) => (\n <Icon\n key={i}\n icon={index === i ? 'ph--circle--fill' : 'ph--circle--regular'}\n size={2}\n classNames='mli-1 cursor-pointer'\n />\n ))}\n </div>\n </div>\n {isLastStep ? (\n <Button\n variant='primary'\n onClick={closeProps.onClick}\n title={closeProps['aria-label']}\n autoFocus\n data-testid='helpPlugin.tooltip.finish'\n >\n Done\n </Button>\n ) : (\n <IconButton\n autoFocus\n icon='ph--caret-right--regular'\n iconOnly\n label={primaryProps['aria-label']}\n onClick={primaryProps.onClick}\n size={6}\n variant='primary'\n data-testid='helpPlugin.tooltip.next'\n />\n )}\n </div>\n </div>\n );\n },\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useState, useEffect } from 'react';\nimport Joyride, { ACTIONS, EVENTS } from 'react-joyride';\n\nimport { usePluginManager, useLayout } from '@dxos/app-framework';\n\nimport { type Step, HelpContext } from '../../types';\nimport { floaterProps, Tooltip } from '../Tooltip';\n\nconst addStepClass = (target: string | HTMLElement) => {\n const element = typeof target === 'string' ? document.querySelector(target) : target;\n if (element) {\n element.classList.add('joyride-target');\n }\n};\n\nconst removeTargetClass = (target: string | HTMLElement) => {\n const element = typeof target === 'string' ? document.querySelector(target) : target;\n if (element) {\n element.classList.remove('joyride-target');\n }\n};\n\nconst getTarget = (step: Step) => {\n return typeof step.target === 'string' ? document.querySelector(step.target) : step.target;\n};\n\n/**\n * Wait for the target element to be in the document.\n */\nconst waitForTarget = async (step: Step) => {\n if (typeof step.target === 'string') {\n const target = step.target;\n const element = document.querySelector(target);\n if (element) {\n return;\n }\n\n await new Promise<void>((resolve) => {\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.addedNodes.length > 0) {\n const element = document.querySelector(target);\n if (element) {\n observer.disconnect();\n resolve();\n }\n }\n });\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n });\n }\n};\n\nexport type WelcomeTourProps = {\n steps: Step[];\n running?: boolean;\n onRunningChanged?: (state: boolean) => any;\n};\n\nexport const WelcomeTour = ({ steps: initialSteps, running: runningProp, onRunningChanged }: WelcomeTourProps) => {\n const manager = usePluginManager();\n const layout = useLayout();\n const [running, setRunning] = useState(!!runningProp && !!getTarget(initialSteps[0]));\n const [stepIndex, _setStepIndex] = useState(0);\n const [steps, setSteps] = useState(initialSteps);\n\n const paused = layout.dialogOpen;\n\n const setStepIndex = (index: number) => {\n if (runningProp) {\n const step = steps[index];\n step?.before?.(manager.context);\n }\n _setStepIndex(index);\n };\n\n const setRunningChanged = (state: boolean) => {\n if (typeof runningProp !== 'undefined') {\n onRunningChanged?.(state);\n } else {\n if (state) {\n setStepIndex(0);\n setRunning(true);\n } else {\n setRunning(false);\n }\n }\n };\n\n useEffect(() => {\n const timeout = setTimeout(async () => {\n if (runningProp) {\n // This handles the case when the target is not yet in the document.\n // If the target is not in the document, when the joyride is turned on, it will not show the tooltip.\n await waitForTarget(steps[stepIndex]);\n setStepIndex(0);\n setRunning(true);\n } else if (typeof runningProp !== 'undefined') {\n setRunning(false);\n }\n });\n\n return () => clearTimeout(timeout);\n }, [runningProp]);\n\n // https://docs.react-joyride.com/callback\n const callback: Joyride['callback'] = async (options) => {\n const { type, action, index, size } = options;\n switch (type) {\n case EVENTS.STEP_BEFORE:\n addStepClass(options.step.target);\n break;\n case EVENTS.TOUR_END:\n break;\n case EVENTS.STEP_AFTER:\n removeTargetClass(options.step.target);\n switch (action) {\n case ACTIONS.NEXT:\n if (index < size - 1) {\n setStepIndex(index + 1);\n }\n break;\n case ACTIONS.PREV:\n if (index > 0) {\n setStepIndex(index - 1);\n }\n break;\n case ACTIONS.CLOSE:\n setRunningChanged(false);\n setStepIndex(0);\n break;\n }\n break;\n }\n };\n\n return (\n <HelpContext.Provider\n value={{\n running: running && !paused,\n steps,\n setSteps,\n setIndex: setStepIndex,\n start: () => setRunningChanged(true),\n stop: () => setRunningChanged(false),\n }}\n >\n <style>\n {`.joyride-target {\n --controls-opacity: 1;\n }`}\n </style>\n <Joyride\n continuous={true}\n steps={steps}\n stepIndex={stepIndex}\n run={running && !paused}\n callback={callback}\n floaterProps={floaterProps}\n tooltipComponent={Tooltip}\n />\n </HelpContext.Provider>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,kBAAkB;;;ACF3B,SAASC,UAAU;AAEZ,IAAMC,cAAcC,GACzB,mFACA,4CAAA;;;ADEK,IAAMC,MAAM,CAAC,EAAEC,QAAO,MAAuB;;;AAClD,WACE,sBAAA,cAACC,QAAAA;MAAKC,MAAK;MAAOC,WAAU;MAAoBC,cAAYJ;MAASK,IAAIL;OACtEM,WAAWN,OAAAA,EAASO,IAAI,CAACC,GAAGC,MAC3B,sBAAA,cAACR,QAAAA;MAAKS,KAAKD;MAAGN,WAAWQ;OACtBH,CAAAA,CAAAA,CAAAA;;;;AAKX;;;;AEhBA,OAAOI,UAASC,gBAAgB;AAEhC,SAASC,gBAAgB;AACzB,SAASC,mBAAmBC,sBAAsB;AAClD,SAASC,MAAAA,WAAU;AAKZ,IAAMC,gBAAgB,MAAA;;;AAC3B,UAAM,EAAEC,EAAC,IAAKC,eAAeC,WAAAA;AAC7B,UAAMC,WAAWC,SA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YAAIrB,aAAa;AAGf,gBAAMnB,cAAcgB,MAAMW,SAAAA,CAAU;AACpCK,uBAAa,CAAA;AACbP,qBAAW,IAAA;QACb,WAAW,OAAON,gBAAgB,aAAa;AAC7CM,qBAAW,KAAA;QACb;MACF,CAAA;AAEA,aAAO,MAAMgB,aAAaF,OAAAA;IAC5B,GAAG;MAACpB;KAAY;AAGhB,UAAMuB,WAAgC,OAAOC,YAAAA;AAC3C,YAAM,EAAEC,MAAMC,QAAQZ,OAAOa,KAAI,IAAKH;AACtC,cAAQC,MAAAA;QACN,KAAKG,OAAOC;AACV3D,uBAAasD,QAAQ5C,KAAKT,MAAM;AAChC;QACF,KAAKyD,OAAOE;AACV;QACF,KAAKF,OAAOG;AACVtD,4BAAkB+C,QAAQ5C,KAAKT,MAAM;AACrC,kBAAQuD,QAAAA;YACN,KAAKM,QAAQC;AACX,kBAAInB,QAAQa,OAAO,GAAG;AACpBd,6BAAaC,QAAQ,CAAA;cACvB;AACA;YACF,KAAKkB,QAAQE;AACX,kBAAIpB,QAAQ,GAAG;AACbD,6BAAaC,QAAQ,CAAA;cACvB;AACA;YACF,KAAKkB,QAAQG;AACXlB,gCAAkB,KAAA;AAClBJ,2BAAa,CAAA;AACb;UACJ;AACA;MACJ;IACF;AAEA,WACE,gBAAAuB,OAAA,cAACC,YAAYC,UAAQ;MACnBC,OAAO;QACLxC,SAASA,WAAW,CAACY;QACrBd;QACAa;QACA8B,UAAU3B;QACV4B,OAAO,MAAMxB,kBAAkB,IAAA;QAC/ByB,MAAM,MAAMzB,kBAAkB,KAAA;MAChC;OAEA,gBAAAmB,OAAA,cAACO,SAAAA,MACE;;UAEC,GAEJ,gBAAAP,OAAA,cAACQ,SAAAA;MACCC,YAAY;MACZhD;MACAW;MACAsC,KAAK/C,WAAW,CAACY;MACjBY;MACAwB;MACAC,kBAAkBC;;;;;AAI1B;",
|
|
6
|
+
"names": ["React", "keySymbols", "mx", "shortcutKey", "mx", "Key", "binding", "span", "role", "className", "aria-label", "id", "keySymbols", "map", "c", "i", "key", "shortcutKey", "React", "Fragment", "Keyboard", "toLocalizedString", "useTranslation", "mx", "ShortcutsList", "t", "useTranslation", "HELP_PLUGIN", "bindings", "Keyboard", "singleton", "getBindings", "sort", "a", "b", "toLocalizedString", "data", "toLowerCase", "localeCompare", "React", "dl", "className", "mx", "map", "binding", "i", "Fragment", "key", "Key", "shortcut", "span", "role", "aria-labelledby", "React", "Button", "Dialog", "Icon", "useTranslation", "SHORTCUTS_DIALOG", "HELP_PLUGIN", "ShortcutsDialogContent", "t", "useTranslation", "React", "Dialog", "Content", "classNames", "div", "role", "className", "Title", "Close", "asChild", "Button", "density", "variant", "autoFocus", "Icon", "icon", "size", "ShortcutsList", "React", "Keyboard", "Button", "Icon", "toLocalizedString", "useTranslation", "Shortcut", "binding", "t", "useTranslation", "React", "div", "role", "className", "Key", "shortcut", "span", "toLocalizedString", "data", "ShortcutsHints", "onClose", "defaults", "bindings", "Keyboard", "singleton", "getBindings", "hints", "filter", "includes", "map", "key", "Button", "variant", "classNames", "onClick", "Icon", "icon", "size", "React", "descriptionText", "ShortcutsSection", "React", "section", "className", "descriptionText", "ShortcutsList", "useArrowNavigationGroup", "useFocusableGroup", "React", "forwardRef", "Button", "Icon", "IconButton", "floaterProps", "styles", "arrow", "length", "spread", "floater", "filter", "Tooltip", "forwardRef", "step", "title", "content", "index", "size", "isLastStep", "backProps", "closeProps", "primaryProps", "forwardedRef", "arrowNavigationAttrs", "useArrowNavigationGroup", "axis", "focusableGroupAttrs", "useFocusableGroup", "tabBehavior", "React", "div", "className", "role", "data-testid", "data-step", "ref", "h2", "IconButton", "density", "icon", "iconOnly", "label", "onClick", "variant", "classNames", "Array", "from", "map", "_", "i", "Icon", "key", "Button", "autoFocus", "React", "useState", "useEffect", "Joyride", "ACTIONS", "EVENTS", "usePluginManager", "useLayout", "addStepClass", "target", "element", "document", "querySelector", "classList", "add", "removeTargetClass", "remove", "getTarget", "step", "waitForTarget", "Promise", "resolve", "observer", "MutationObserver", "mutations", "forEach", "mutation", "addedNodes", "length", "disconnect", "observe", "body", "childList", "subtree", "WelcomeTour", "steps", "initialSteps", "running", "runningProp", "onRunningChanged", "manager", "usePluginManager", "layout", "useLayout", "setRunning", "useState", "stepIndex", "_setStepIndex", "setSteps", "paused", "dialogOpen", "setStepIndex", "index", "before", "context", "setRunningChanged", "state", "useEffect", "timeout", "setTimeout", "clearTimeout", "callback", "options", "type", "action", "size", "EVENTS", "STEP_BEFORE", "TOUR_END", "STEP_AFTER", "ACTIONS", "NEXT", "PREV", "CLOSE", "React", "HelpContext", "Provider", "value", "setIndex", "start", "stop", "style", "Joyride", "continuous", "run", "floaterProps", "tooltipComponent", "Tooltip"]
|
|
7
|
+
}
|
|
@@ -8,35 +8,34 @@ import {
|
|
|
8
8
|
Tooltip,
|
|
9
9
|
WelcomeTour,
|
|
10
10
|
floaterProps
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MNETJXKS.mjs";
|
|
12
12
|
import {
|
|
13
|
-
HELP_ACTION,
|
|
14
13
|
HelpAction,
|
|
15
14
|
HelpContext
|
|
16
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-J2SJSGSX.mjs";
|
|
17
16
|
import {
|
|
18
17
|
HelpCapabilities
|
|
19
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LDRUZNSN.mjs";
|
|
20
19
|
import {
|
|
21
20
|
HELP_PLUGIN,
|
|
22
21
|
meta
|
|
23
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-3Y4CMOZP.mjs";
|
|
24
23
|
|
|
25
|
-
//
|
|
24
|
+
// src/capabilities/index.ts
|
|
26
25
|
import { lazy } from "@dxos/app-framework";
|
|
27
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-
|
|
28
|
-
var ReactRoot = lazy(() => import("./react-root-
|
|
29
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
30
|
-
var HelpState = lazy(() => import("./state-
|
|
26
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-BYCMEBNG.mjs"));
|
|
27
|
+
var ReactRoot = lazy(() => import("./react-root-W6ZDEGBU.mjs"));
|
|
28
|
+
var ReactSurface = lazy(() => import("./react-surface-SATVEWS5.mjs"));
|
|
29
|
+
var HelpState = lazy(() => import("./state-FWUZG6NL.mjs"));
|
|
31
30
|
|
|
32
|
-
//
|
|
31
|
+
// src/HelpPlugin.tsx
|
|
33
32
|
import { createResolver, defineModule, definePlugin, Events, contributes, Capabilities } from "@dxos/app-framework";
|
|
34
33
|
|
|
35
|
-
//
|
|
36
|
-
var
|
|
34
|
+
// src/translations.ts
|
|
35
|
+
var translations = [
|
|
37
36
|
{
|
|
38
37
|
"en-US": {
|
|
39
|
-
[
|
|
38
|
+
[meta.id]: {
|
|
40
39
|
"plugin name": "Help",
|
|
41
40
|
"open help tour": "Show welcome tour",
|
|
42
41
|
"open shortcuts label": "Show shortcuts",
|
|
@@ -46,7 +45,7 @@ var translations_default = [
|
|
|
46
45
|
}
|
|
47
46
|
];
|
|
48
47
|
|
|
49
|
-
//
|
|
48
|
+
// src/HelpPlugin.tsx
|
|
50
49
|
var HelpPlugin = ({ steps = [] }) => definePlugin(meta, [
|
|
51
50
|
defineModule({
|
|
52
51
|
id: `${meta.id}/module/state`,
|
|
@@ -56,7 +55,7 @@ var HelpPlugin = ({ steps = [] }) => definePlugin(meta, [
|
|
|
56
55
|
defineModule({
|
|
57
56
|
id: `${meta.id}/module/translations`,
|
|
58
57
|
activatesOn: Events.SetupTranslations,
|
|
59
|
-
activate: () => contributes(Capabilities.Translations,
|
|
58
|
+
activate: () => contributes(Capabilities.Translations, translations)
|
|
60
59
|
}),
|
|
61
60
|
defineModule({
|
|
62
61
|
id: `${meta.id}/module/react-root`,
|
|
@@ -86,14 +85,13 @@ var HelpPlugin = ({ steps = [] }) => definePlugin(meta, [
|
|
|
86
85
|
})
|
|
87
86
|
]);
|
|
88
87
|
|
|
89
|
-
//
|
|
88
|
+
// src/hooks/useHelp.tsx
|
|
90
89
|
import { useContext } from "react";
|
|
91
90
|
import { raise } from "@dxos/debug";
|
|
92
91
|
var useHelp = () => {
|
|
93
92
|
return useContext(HelpContext) ?? raise(new Error("Missing HelpContext"));
|
|
94
93
|
};
|
|
95
94
|
export {
|
|
96
|
-
HELP_ACTION,
|
|
97
95
|
HELP_PLUGIN,
|
|
98
96
|
HelpAction,
|
|
99
97
|
HelpCapabilities,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/index.ts", "../../../src/HelpPlugin.tsx", "../../../src/translations.ts", "../../../src/hooks/useHelp.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const ReactRoot = lazy(() => import('./react-root'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\nexport const HelpState = lazy(() => import('./state'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { createResolver, defineModule, definePlugin, Events, contributes, Capabilities } from '@dxos/app-framework';\n\nimport { AppGraphBuilder, HelpState, ReactRoot, ReactSurface } from './capabilities';\nimport { HelpCapabilities } from './capabilities/capabilities';\nimport { meta } from './meta';\nimport translations from './translations';\nimport { type Step, HelpAction } from './types';\n\nexport type HelpPluginOptions = { steps?: Step[] };\n\nexport const HelpPlugin = ({ steps = [] }: HelpPluginOptions) =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/state`,\n activatesOn: Events.Startup,\n activate: HelpState,\n }),\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/react-root`,\n activatesOn: Events.Startup,\n activate: () => ReactRoot(steps),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: (context) =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: HelpAction.Start,\n resolve: () => {\n const state = context.getCapability(HelpCapabilities.MutableState);\n state.running = true;\n },\n }),\n ),\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n ]);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport {
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["lazy", "AppGraphBuilder", "lazy", "ReactRoot", "ReactSurface", "HelpState", "createResolver", "defineModule", "definePlugin", "Events", "contributes", "Capabilities", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const ReactRoot = lazy(() => import('./react-root'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\nexport const HelpState = lazy(() => import('./state'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { createResolver, defineModule, definePlugin, Events, contributes, Capabilities } from '@dxos/app-framework';\n\nimport { AppGraphBuilder, HelpState, ReactRoot, ReactSurface } from './capabilities';\nimport { HelpCapabilities } from './capabilities/capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\nimport { type Step, HelpAction } from './types';\n\nexport type HelpPluginOptions = { steps?: Step[] };\n\nexport const HelpPlugin = ({ steps = [] }: HelpPluginOptions) =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/state`,\n activatesOn: Events.Startup,\n activate: HelpState,\n }),\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/react-root`,\n activatesOn: Events.Startup,\n activate: () => ReactRoot(steps),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: (context) =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: HelpAction.Start,\n resolve: () => {\n const state = context.getCapability(HelpCapabilities.MutableState);\n state.running = true;\n },\n }),\n ),\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n ]);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'plugin name': 'Help',\n 'open help tour': 'Show welcome tour',\n 'open shortcuts label': 'Show shortcuts',\n 'shortcuts dialog title': 'Shortcuts',\n },\n },\n },\n] as const satisfies Resource[];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { HelpContext } from '../types';\n\nexport const useHelp = () => {\n return useContext(HelpContext) ?? raise(new Error('Missing HelpContext'));\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASA,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,MAAM,OAAO,kCAAA,CAAA;AAC1C,IAAMC,YAAYD,KAAK,MAAM,OAAO,2BAAA,CAAA;AACpC,IAAME,eAAeF,KAAK,MAAM,OAAO,8BAAA,CAAA;AACvC,IAAMG,YAAYH,KAAK,MAAM,OAAO,sBAAA,CAAA;;;ACL3C,SAASI,gBAAgBC,cAAcC,cAAcC,QAAQC,aAAaC,oBAAoB;;;ACIvF,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,kBAAkB;QAClB,wBAAwB;QACxB,0BAA0B;MAC5B;IACF;EACF;;;;ADJK,IAAMC,aAAa,CAAC,EAAEC,QAAQ,CAAA,EAAE,MACrCC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAUC;EACZ,CAAA;EACAN,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOI;IACpBF,UAAU,MAAMG,YAAYC,aAAaC,cAAcC,YAAAA;EACzD,CAAA;EACAX,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMO,UAAUf,KAAAA;EAC5B,CAAA;EACAG,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOU;IACpBR,UAAUS;EACZ,CAAA;EACAd,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOY;IACpBV,UAAU,CAACW,YACTR,YACEC,aAAaQ,gBACbC,eAAe;MACbC,QAAQC,WAAWC;MACnBC,SAAS,MAAA;AACP,cAAMC,QAAQP,QAAQQ,cAAcC,iBAAiBC,YAAY;AACjEH,cAAMI,UAAU;MAClB;IACF,CAAA,CAAA;EAEN,CAAA;EACA3B,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOyB;IACpBvB,UAAUwB;EACZ,CAAA;CACD;;;AEpDH,SAASC,kBAAkB;AAE3B,SAASC,aAAa;AAIf,IAAMC,UAAU,MAAA;AACrB,SAAOC,WAAWC,WAAAA,KAAgBC,MAAM,IAAIC,MAAM,qBAAA,CAAA;AACpD;",
|
|
6
|
+
"names": ["lazy", "AppGraphBuilder", "lazy", "ReactRoot", "ReactSurface", "HelpState", "createResolver", "defineModule", "definePlugin", "Events", "contributes", "Capabilities", "translations", "meta", "id", "HelpPlugin", "steps", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "Startup", "activate", "HelpState", "SetupTranslations", "contributes", "Capabilities", "Translations", "translations", "ReactRoot", "SetupReactSurface", "ReactSurface", "SetupIntentResolver", "context", "IntentResolver", "createResolver", "intent", "HelpAction", "Start", "resolve", "state", "getCapability", "HelpCapabilities", "MutableState", "running", "SetupAppGraph", "AppGraphBuilder", "useContext", "raise", "useHelp", "useContext", "HelpContext", "raise", "Error"]
|
|
7
7
|
}
|