@dxos/plugin-help 0.8.4-main.d05673bc65 → 0.8.4-main.dfabb4ec29
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/neutral/HelpPlugin.mjs +30 -0
- package/dist/lib/neutral/HelpPlugin.mjs.map +7 -0
- package/dist/lib/neutral/ShortcutsDialogContent-TB5PZWVY.mjs +17 -0
- package/dist/lib/neutral/ShortcutsDialogContent-TB5PZWVY.mjs.map +7 -0
- package/dist/lib/neutral/ShortcutsHints-P4SUBCY7.mjs +8 -0
- package/dist/lib/neutral/ShortcutsList-MZHWIVDH.mjs +8 -0
- package/dist/lib/{browser/app-graph-builder-5RXPFQPI.mjs → neutral/app-graph-builder-BJYIYNMN.mjs} +16 -20
- package/dist/lib/neutral/app-graph-builder-BJYIYNMN.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +17 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-BI3HKFKB.mjs +63 -0
- package/dist/lib/neutral/chunk-BI3HKFKB.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GZL2J55W.mjs +8 -0
- package/dist/lib/neutral/chunk-GZL2J55W.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/{browser/chunk-P34WCEMS.mjs → neutral/chunk-MQQNHGDV.mjs} +2 -5
- package/dist/lib/neutral/chunk-MQQNHGDV.mjs.map +7 -0
- package/dist/lib/{browser/chunk-TEXIV2IJ.mjs → neutral/chunk-NHTI7NEQ.mjs} +5 -2
- package/dist/lib/{browser/chunk-TEXIV2IJ.mjs.map → neutral/chunk-NHTI7NEQ.mjs.map} +3 -3
- package/dist/lib/{browser/chunk-VGW5FGD7.mjs → neutral/chunk-NJCLRR5U.mjs} +10 -14
- package/dist/lib/neutral/chunk-NJCLRR5U.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +20 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +13 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +13 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +24 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/{browser → neutral}/meta.mjs +2 -1
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-F2JU4V62.mjs +13 -0
- package/dist/lib/neutral/operation-handler-F2JU4V62.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/react-root-JBHEZA5U.mjs → neutral/react-root-PYPAXETF.mjs} +6 -11
- package/dist/lib/neutral/react-root-PYPAXETF.mjs.map +7 -0
- package/dist/lib/{browser/react-surface-W5S45O6Y.mjs → neutral/react-surface-SNS4QQMR.mjs} +9 -18
- package/dist/lib/neutral/react-surface-SNS4QQMR.mjs.map +7 -0
- package/dist/lib/neutral/start-XYUDZGXJ.mjs +21 -0
- package/dist/lib/neutral/start-XYUDZGXJ.mjs.map +7 -0
- package/dist/lib/{browser/state-SEPP77HO.mjs → neutral/state-5HQJG3KW.mjs} +5 -8
- package/dist/lib/neutral/state-5HQJG3KW.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +20 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +12 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/HelpPlugin.d.ts +2 -1
- package/dist/types/src/HelpPlugin.d.ts.map +1 -1
- package/dist/types/src/HelpPlugin.test.d.ts +2 -0
- package/dist/types/src/HelpPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +18 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/components/Shortcuts/Key.d.ts.map +1 -1
- package/dist/types/src/components/Shortcuts/ShortcutsHints.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +9 -9
- package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts +1 -1
- package/dist/types/src/components/WelcomeTour/WelcomeTour.d.ts.map +1 -1
- package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.d.ts.map +1 -1
- package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.d.ts +25 -0
- package/dist/types/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.d.ts.map +1 -0
- package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts +1 -2
- package/dist/types/src/containers/ShortcutsDialogContent/index.d.ts.map +1 -1
- package/dist/types/src/containers/ShortcutsHints/index.d.ts +1 -2
- package/dist/types/src/containers/ShortcutsHints/index.d.ts.map +1 -1
- package/dist/types/src/containers/ShortcutsList/index.d.ts +1 -2
- package/dist/types/src/containers/ShortcutsList/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useHelp.d.ts +1 -1
- package/dist/types/src/hooks/useHelp.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/start.d.ts +5 -0
- package/dist/types/src/operations/start.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +5 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +5 -6
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/HelpCapabilities.d.ts +19 -0
- package/dist/types/src/types/HelpCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/HelpOperation.d.ts +4 -0
- package/dist/types/src/types/HelpOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +1 -17
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +79 -42
- package/src/HelpPlugin.test.ts +30 -0
- package/src/HelpPlugin.tsx +7 -5
- package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +14 -13
- package/src/capabilities/index.ts +11 -5
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +3 -3
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +7 -7
- package/src/capabilities/{state/state.ts → state.ts} +2 -2
- package/src/components/Shortcuts/ShortcutsHints.tsx +2 -2
- package/src/components/Shortcuts/ShortcutsList.tsx +1 -1
- package/src/components/WelcomeTour/WelcomeTour.stories.tsx +8 -8
- package/src/components/WelcomeTour/WelcomeTour.tsx +3 -1
- package/src/constants.ts +1 -1
- package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.stories.tsx +39 -0
- package/src/containers/ShortcutsDialogContent/ShortcutsDialogContent.tsx +9 -10
- package/src/containers/ShortcutsDialogContent/index.ts +1 -3
- package/src/containers/ShortcutsHints/index.ts +1 -3
- package/src/containers/ShortcutsList/index.ts +1 -3
- package/src/hooks/useHelp.tsx +1 -1
- package/src/index.ts +1 -4
- package/src/meta.ts +1 -0
- package/src/operations/index.ts +7 -0
- package/src/operations/start.ts +20 -0
- package/src/plugin.ts +12 -0
- package/src/translations.ts +5 -5
- package/src/types/HelpCapabilities.ts +24 -0
- package/src/types/HelpOperation.ts +21 -0
- package/src/types/index.ts +2 -1
- package/src/types/schema.ts +1 -15
- package/dist/lib/browser/ShortcutsDialogContent-SFEN5YKG.mjs +0 -36
- package/dist/lib/browser/ShortcutsDialogContent-SFEN5YKG.mjs.map +0 -7
- package/dist/lib/browser/ShortcutsHints-SUH2FE3T.mjs +0 -12
- package/dist/lib/browser/ShortcutsHints-SUH2FE3T.mjs.map +0 -7
- package/dist/lib/browser/ShortcutsList-4YPEJM33.mjs +0 -12
- package/dist/lib/browser/ShortcutsList-4YPEJM33.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-5RXPFQPI.mjs.map +0 -7
- package/dist/lib/browser/chunk-HMLZFBYY.mjs +0 -58
- package/dist/lib/browser/chunk-HMLZFBYY.mjs.map +0 -7
- package/dist/lib/browser/chunk-P34WCEMS.mjs.map +0 -7
- package/dist/lib/browser/chunk-VGW5FGD7.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -114
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-root-JBHEZA5U.mjs.map +0 -7
- package/dist/lib/browser/react-surface-W5S45O6Y.mjs.map +0 -7
- package/dist/lib/browser/state-SEPP77HO.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -12
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -2
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
- package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -11
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -21
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -5
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -23
- package/src/capabilities/react-root/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -7
- package/src/types/capabilities.ts +0 -24
- /package/dist/lib/{browser/meta.mjs.map → neutral/ShortcutsHints-P4SUBCY7.mjs.map} +0 -0
- /package/dist/lib/{browser/types/index.mjs.map → neutral/ShortcutsList-MZHWIVDH.mjs.map} +0 -0
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
- /package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { HelpCapabilities, HelpOperation } from '../types';
|
|
11
|
+
|
|
12
|
+
const handler: Operation.WithHandler<typeof HelpOperation.Start> = HelpOperation.Start.pipe(
|
|
13
|
+
Operation.withHandler(
|
|
14
|
+
Effect.fnUntraced(function* () {
|
|
15
|
+
yield* Capabilities.updateAtomValue(HelpCapabilities.State, (state) => ({ ...state, running: true }));
|
|
16
|
+
}),
|
|
17
|
+
),
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export default handler;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const HelpPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
export type { HelpPluginOptions } from '#plugin';
|
|
11
|
+
|
|
12
|
+
export { HelpOperationHandlerSet } from './operations';
|
package/src/translations.ts
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
7
|
+
import { meta } from '#meta';
|
|
8
8
|
|
|
9
9
|
export const translations = [
|
|
10
10
|
{
|
|
11
11
|
'en-US': {
|
|
12
12
|
[meta.id]: {
|
|
13
|
-
'plugin
|
|
14
|
-
'open
|
|
15
|
-
'open
|
|
16
|
-
'shortcuts
|
|
13
|
+
'plugin.name': 'Help',
|
|
14
|
+
'open-help-tour.message': 'Show welcome tour',
|
|
15
|
+
'open-shortcuts.label': 'Show shortcuts',
|
|
16
|
+
'shortcuts-dialog.title': 'Shortcuts',
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
},
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
8
|
+
import * as Schema from 'effect/Schema';
|
|
9
|
+
|
|
10
|
+
import { Capability } from '@dxos/app-framework';
|
|
11
|
+
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
|
|
14
|
+
export const StateSchema = Schema.mutable(
|
|
15
|
+
Schema.Struct({
|
|
16
|
+
running: Schema.Boolean,
|
|
17
|
+
showHints: Schema.Boolean,
|
|
18
|
+
showWelcome: Schema.Boolean,
|
|
19
|
+
}),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export type State = Schema.Schema.Type<typeof StateSchema>;
|
|
23
|
+
|
|
24
|
+
export const State = Capability.make<Atom.Writable<State>>(`${meta.id}.capability.state`);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
import { Capability } from '@dxos/app-framework';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
11
|
+
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
|
|
14
|
+
const HELP_OPERATION = `${meta.id}.operation`;
|
|
15
|
+
|
|
16
|
+
export const Start = Operation.make({
|
|
17
|
+
meta: { key: `${HELP_OPERATION}.start`, name: 'Start Help' },
|
|
18
|
+
services: [Capability.Service],
|
|
19
|
+
input: Schema.Void,
|
|
20
|
+
output: Schema.Void,
|
|
21
|
+
});
|
package/src/types/index.ts
CHANGED
package/src/types/schema.ts
CHANGED
|
@@ -2,14 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Schema from 'effect/Schema';
|
|
6
5
|
import { type Context, createContext } from 'react';
|
|
7
6
|
import { type Step as BaseStep } from 'react-joyride';
|
|
8
7
|
|
|
9
|
-
import {
|
|
10
|
-
import { Operation } from '@dxos/operation';
|
|
11
|
-
|
|
12
|
-
import { meta } from '../meta';
|
|
8
|
+
import { type CapabilityManager } from '@dxos/app-framework';
|
|
13
9
|
|
|
14
10
|
export type Step = BaseStep & {
|
|
15
11
|
before?: (capabilities: CapabilityManager.CapabilityManager) => void;
|
|
@@ -32,13 +28,3 @@ export const HelpContext: Context<HelpContextType> = createContext<HelpContextTy
|
|
|
32
28
|
start: () => {},
|
|
33
29
|
stop: () => {},
|
|
34
30
|
});
|
|
35
|
-
|
|
36
|
-
const HELP_OPERATION = `${meta.id}.operation`;
|
|
37
|
-
|
|
38
|
-
export namespace HelpOperation {
|
|
39
|
-
export const Start = Operation.make({
|
|
40
|
-
meta: { key: `${HELP_OPERATION}.start`, name: 'Start Help' },
|
|
41
|
-
services: [Capability.Service],
|
|
42
|
-
schema: { input: Schema.Void, output: Schema.Void },
|
|
43
|
-
});
|
|
44
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ShortcutsList
|
|
3
|
-
} from "./chunk-VGW5FGD7.mjs";
|
|
4
|
-
import "./chunk-HMLZFBYY.mjs";
|
|
5
|
-
import {
|
|
6
|
-
meta
|
|
7
|
-
} from "./chunk-TEXIV2IJ.mjs";
|
|
8
|
-
|
|
9
|
-
// src/containers/ShortcutsDialogContent/ShortcutsDialogContent.tsx
|
|
10
|
-
import React from "react";
|
|
11
|
-
import { Dialog, IconButton, useTranslation } from "@dxos/react-ui";
|
|
12
|
-
var ShortcutsDialogContent = () => {
|
|
13
|
-
const { t } = useTranslation(meta.id);
|
|
14
|
-
return /* @__PURE__ */ React.createElement(Dialog.Content, null, /* @__PURE__ */ React.createElement("div", {
|
|
15
|
-
role: "none",
|
|
16
|
-
className: "flex justify-between mb-1 pt-3 ps-2 pe-3 @md:pt-4 @md:ps-4 @md:pe-5"
|
|
17
|
-
}, /* @__PURE__ */ React.createElement(Dialog.Title, null, t("shortcuts dialog title")), /* @__PURE__ */ React.createElement(Dialog.Close, {
|
|
18
|
-
asChild: true
|
|
19
|
-
}, /* @__PURE__ */ React.createElement(IconButton, {
|
|
20
|
-
icon: "ph--x--bold",
|
|
21
|
-
iconOnly: true,
|
|
22
|
-
size: 3,
|
|
23
|
-
label: "Close",
|
|
24
|
-
variant: "ghost",
|
|
25
|
-
autoFocus: true
|
|
26
|
-
}))), /* @__PURE__ */ React.createElement("div", {
|
|
27
|
-
className: "flex items-center justify-center"
|
|
28
|
-
}, /* @__PURE__ */ React.createElement(ShortcutsList, null)));
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// src/containers/ShortcutsDialogContent/index.ts
|
|
32
|
-
var ShortcutsDialogContent_default = ShortcutsDialogContent;
|
|
33
|
-
export {
|
|
34
|
-
ShortcutsDialogContent_default as default
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=ShortcutsDialogContent-SFEN5YKG.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/ShortcutsDialogContent/ShortcutsDialogContent.tsx", "../../../src/containers/ShortcutsDialogContent/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Dialog, IconButton, useTranslation } from '@dxos/react-ui';\n\nimport { ShortcutsList } from '../../components';\nimport { meta } from '../../meta';\n\nexport const ShortcutsDialogContent = () => {\n const { t } = useTranslation(meta.id);\n\n return (\n <Dialog.Content>\n <div role='none' className='flex justify-between mb-1 pt-3 ps-2 pe-3 @md:pt-4 @md:ps-4 @md:pe-5'>\n <Dialog.Title>{t('shortcuts dialog title')}</Dialog.Title>\n <Dialog.Close asChild>\n <IconButton icon='ph--x--bold' iconOnly size={3} label='Close' variant='ghost' autoFocus />\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 { ShortcutsDialogContent } from './ShortcutsDialogContent';\n\nexport default ShortcutsDialogContent;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,QAAQC,YAAYC,sBAAsB;AAK5C,IAAMC,yBAAyB,MAAA;AACpC,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AAEpC,SACE,sBAAA,cAACC,OAAOC,SAAO,MACb,sBAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACzB,sBAAA,cAACJ,OAAOK,OAAK,MAAET,EAAE,wBAAA,CAAA,GACjB,sBAAA,cAACI,OAAOM,OAAK;IAACC,SAAAA;KACZ,sBAAA,cAACC,YAAAA;IAAWC,MAAK;IAAcC,UAAAA;IAASC,MAAM;IAAGC,OAAM;IAAQC,SAAQ;IAAQC,WAAAA;QAInF,sBAAA,cAACZ,OAAAA;IAAIE,WAAU;KACb,sBAAA,cAACW,eAAAA,IAAAA,CAAAA,CAAAA;AAIT;;;ACtBA,IAAA,iCAAeC;",
|
|
6
|
-
"names": ["React", "Dialog", "IconButton", "useTranslation", "ShortcutsDialogContent", "t", "useTranslation", "meta", "id", "Dialog", "Content", "div", "role", "className", "Title", "Close", "asChild", "IconButton", "icon", "iconOnly", "size", "label", "variant", "autoFocus", "ShortcutsList", "ShortcutsDialogContent"]
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ShortcutsHints
|
|
3
|
-
} from "./chunk-VGW5FGD7.mjs";
|
|
4
|
-
import "./chunk-HMLZFBYY.mjs";
|
|
5
|
-
import "./chunk-TEXIV2IJ.mjs";
|
|
6
|
-
|
|
7
|
-
// src/containers/ShortcutsHints/index.ts
|
|
8
|
-
var ShortcutsHints_default = ShortcutsHints;
|
|
9
|
-
export {
|
|
10
|
-
ShortcutsHints_default as default
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=ShortcutsHints-SUH2FE3T.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/ShortcutsHints/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { ShortcutsHints } from './ShortcutsHints';\n\nexport default ShortcutsHints;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAMA,IAAA,yBAAeA;",
|
|
6
|
-
"names": ["ShortcutsHints"]
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ShortcutsList
|
|
3
|
-
} from "./chunk-VGW5FGD7.mjs";
|
|
4
|
-
import "./chunk-HMLZFBYY.mjs";
|
|
5
|
-
import "./chunk-TEXIV2IJ.mjs";
|
|
6
|
-
|
|
7
|
-
// src/containers/ShortcutsList/index.ts
|
|
8
|
-
var ShortcutsList_default = ShortcutsList;
|
|
9
|
-
export {
|
|
10
|
-
ShortcutsList_default as default
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=ShortcutsList-4YPEJM33.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/ShortcutsList/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { ShortcutsList } from './ShortcutsList';\n\nexport default ShortcutsList;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAMA,IAAA,wBAAeA;",
|
|
6
|
-
"names": ["ShortcutsList"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { GraphBuilder, NodeMatcher } from '@dxos/app-graph';\nimport { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\n\nimport { SHORTCUTS_DIALOG } from '../../constants';\nimport { meta } from '../../meta';\nimport { HelpCapabilities, HelpOperation } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* GraphBuilder.createExtension({\n id: meta.id,\n match: NodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n {\n id: HelpOperation.Start.meta.key,\n data: Effect.fnUntraced(function* () {\n yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({ ...s, showHints: true }));\n yield* Operation.invoke(HelpOperation.Start);\n }),\n properties: {\n label: ['open help tour', { ns: meta.id }],\n icon: 'ph--info--regular',\n keyBinding: {\n macos: 'shift+meta+/',\n windows: 'shift+ctrl+/',\n linux: 'shift+ctrl+?',\n },\n testId: 'helpPlugin.openHelp',\n },\n },\n {\n id: `${meta.id}.open-shortcuts`,\n data: Effect.fnUntraced(function* () {\n yield* Capabilities.updateAtomValue(HelpCapabilities.State, (s) => ({ ...s, showHints: true }));\n yield* Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: SHORTCUTS_DIALOG,\n });\n }),\n properties: {\n label: ['open shortcuts label', { ns: meta.id }],\n icon: 'ph--keyboard--regular',\n keyBinding: {\n macos: 'meta+ctrl+/',\n },\n },\n },\n ]),\n });\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,cAAcC,mBAAmB;AAC1C,SAASC,iBAAiBC,uBAAuB;AACjD,SAASC,iBAAiB;AAM1B,IAAA,4BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAOC,aAAaC,gBAAgB;IACrDC,IAAIC,KAAKD;IACTE,OAAOC,YAAYC;IACnBC,SAAS,MACAC,eAAQ;MACb;QACEN,IAAIO,cAAcC,MAAMP,KAAKQ;QAC7BC,MAAad,kBAAW,aAAA;AACtB,iBAAOe,aAAaC,gBAAgBC,iBAAiBC,OAAO,CAACC,OAAO;YAAE,GAAGA;YAAGC,WAAW;UAAK,EAAA;AAC5F,iBAAOC,UAAUC,OAAOX,cAAcC,KAAK;QAC7C,CAAA;QACAW,YAAY;UACVC,OAAO;YAAC;YAAkB;cAAEC,IAAIpB,KAAKD;YAAG;;UACxCsB,MAAM;UACNC,YAAY;YACVC,OAAO;YACPC,SAAS;YACTC,OAAO;UACT;UACAC,QAAQ;QACV;MACF;MACA;QACE3B,IAAI,GAAGC,KAAKD,EAAE;QACdU,MAAad,kBAAW,aAAA;AACtB,iBAAOe,aAAaC,gBAAgBC,iBAAiBC,OAAO,CAACC,OAAO;YAAE,GAAGA;YAAGC,WAAW;UAAK,EAAA;AAC5F,iBAAOC,UAAUC,OAAOU,gBAAgBC,cAAc;YACpDC,SAASC;UACX,CAAA;QACF,CAAA;QACAZ,YAAY;UACVC,OAAO;YAAC;YAAwB;cAAEC,IAAIpB,KAAKD;YAAG;;UAC9CsB,MAAM;UACNC,YAAY;YACVC,OAAO;UACT;QACF;MACF;KACD;EACL,CAAA;AAEA,SAAO9B,WAAWsC,YAAYC,gBAAgBC,iBAAiBrC,UAAAA;AACjE,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capabilities", "Capability", "GraphBuilder", "NodeMatcher", "AppCapabilities", "LayoutOperation", "Operation", "Capability", "makeModule", "fnUntraced", "extensions", "GraphBuilder", "createExtension", "id", "meta", "match", "NodeMatcher", "whenRoot", "actions", "succeed", "HelpOperation", "Start", "key", "data", "Capabilities", "updateAtomValue", "HelpCapabilities", "State", "s", "showHints", "Operation", "invoke", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "testId", "LayoutOperation", "UpdateDialog", "subject", "SHORTCUTS_DIALOG", "contributes", "AppCapabilities", "AppGraphBuilder"]
|
|
7
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-TEXIV2IJ.mjs";
|
|
4
|
-
|
|
5
|
-
// src/types/capabilities.ts
|
|
6
|
-
import * as Schema from "effect/Schema";
|
|
7
|
-
import { Capability } from "@dxos/app-framework";
|
|
8
|
-
(function(HelpCapabilities2) {
|
|
9
|
-
HelpCapabilities2.StateSchema = Schema.mutable(Schema.Struct({
|
|
10
|
-
running: Schema.Boolean,
|
|
11
|
-
showHints: Schema.Boolean,
|
|
12
|
-
showWelcome: Schema.Boolean
|
|
13
|
-
}));
|
|
14
|
-
HelpCapabilities2.State = Capability.make(`${meta.id}.capability.state`);
|
|
15
|
-
})(HelpCapabilities || (HelpCapabilities = {}));
|
|
16
|
-
var HelpCapabilities;
|
|
17
|
-
|
|
18
|
-
// src/types/schema.ts
|
|
19
|
-
import * as Schema2 from "effect/Schema";
|
|
20
|
-
import { createContext } from "react";
|
|
21
|
-
import { Capability as Capability2 } from "@dxos/app-framework";
|
|
22
|
-
import { Operation } from "@dxos/operation";
|
|
23
|
-
var HelpContext = createContext({
|
|
24
|
-
running: false,
|
|
25
|
-
steps: [],
|
|
26
|
-
setSteps: () => {
|
|
27
|
-
},
|
|
28
|
-
setIndex: () => {
|
|
29
|
-
},
|
|
30
|
-
start: () => {
|
|
31
|
-
},
|
|
32
|
-
stop: () => {
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
var HELP_OPERATION = `${meta.id}.operation`;
|
|
36
|
-
(function(HelpOperation2) {
|
|
37
|
-
HelpOperation2.Start = Operation.make({
|
|
38
|
-
meta: {
|
|
39
|
-
key: `${HELP_OPERATION}.start`,
|
|
40
|
-
name: "Start Help"
|
|
41
|
-
},
|
|
42
|
-
services: [
|
|
43
|
-
Capability2.Service
|
|
44
|
-
],
|
|
45
|
-
schema: {
|
|
46
|
-
input: Schema2.Void,
|
|
47
|
-
output: Schema2.Void
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
})(HelpOperation || (HelpOperation = {}));
|
|
51
|
-
var HelpOperation;
|
|
52
|
-
|
|
53
|
-
export {
|
|
54
|
-
HelpCapabilities,
|
|
55
|
-
HelpContext,
|
|
56
|
-
HelpOperation
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=chunk-HMLZFBYY.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
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 * as Schema from 'effect/Schema';\nimport { type Context, createContext } from 'react';\nimport { type Step as BaseStep } from 'react-joyride';\n\nimport { Capability, type CapabilityManager } from '@dxos/app-framework';\nimport { Operation } from '@dxos/operation';\n\nimport { meta } from '../meta';\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\nconst HELP_OPERATION = `${meta.id}.operation`;\n\nexport namespace HelpOperation {\n export const Start = Operation.make({\n meta: { key: `${HELP_OPERATION}.start`, name: 'Start Help' },\n services: [Capability.Service],\n schema: { input: Schema.Void, output: Schema.Void },\n });\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAKA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;UAIVC,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,YAAYa,aAAY;AACxB,SAAuBC,qBAAqB;AAG5C,SAASC,cAAAA,mBAA0C;AACnD,SAASC,iBAAiB;AAiBnB,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;AAEA,IAAMC,iBAAiB,GAAGC,KAAKC,EAAE;UAEhBC,gBAAAA;iBACFC,QAAQC,UAAUC,KAAK;IAClCL,MAAM;MAAEM,KAAK,GAAGP,cAAAA;MAAwBQ,MAAM;IAAa;IAC3DC,UAAU;MAACC,YAAWC;;IACtBC,QAAQ;MAAEC,OAAcC;MAAMC,QAAeD;IAAK;EACpD,CAAA;AACF,GANiBX,kBAAAA,gBAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["Schema", "Capability", "HelpCapabilities", "StateSchema", "mutable", "Struct", "running", "Boolean", "showHints", "showWelcome", "State", "Capability", "make", "meta", "id", "Schema", "createContext", "Capability", "Operation", "HelpContext", "createContext", "running", "steps", "setSteps", "setIndex", "start", "stop", "HELP_OPERATION", "meta", "id", "HelpOperation", "Start", "Operation", "make", "key", "name", "services", "Capability", "Service", "schema", "input", "Void", "output"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/constants.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { meta } from './meta';\n\nexport const SHORTCUTS_DIALOG = `${meta.id}.ShortcutsDialog`;\n"],
|
|
5
|
-
"mappings": ";;;;;AAMO,IAAMA,mBAAmB,GAAGC,KAAKC,EAAE;",
|
|
6
|
-
"names": ["SHORTCUTS_DIALOG", "meta", "id"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/Shortcuts/Key.tsx", "../../../src/components/Shortcuts/styles.ts", "../../../src/components/Shortcuts/ShortcutsHints.tsx", "../../../src/components/Shortcuts/ShortcutsList.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/ui-theme';\n\nexport const shortcutKey = mx(\n 'inline-flex min-w-[24px] h-[24px] px-0.5 justify-center items-center text-xs',\n 'rounded-sm bg-neutral-100 dark:bg-neutral-900',\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type KeyBinding, Keyboard } from '@dxos/keyboard';\nimport { IconButton, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { osTranslations } from '@dxos/ui-theme';\n\nimport { Key } from './Key';\n\nconst Shortcut = ({ binding }: { binding: KeyBinding }) => {\n const { t } = useTranslation(osTranslations);\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 <IconButton\n icon='ph--x--regular'\n size={4}\n label='Close'\n iconOnly\n noTooltip\n variant='ghost'\n classNames='p-0 cursor-pointer'\n onClick={onClose}\n />\n )}\n </div>\n );\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/ui-theme';\n\nimport { meta } from '../../meta';\n\nimport { Key } from './Key';\n\nexport const ShortcutsList = () => {\n const { t } = useTranslation(meta.id);\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('w-fit grid grid-cols-[min-content_minmax(12rem,1fr)] gap-2 my-4 text-subdued select-none')}>\n {bindings.map((binding, i) => (\n <Fragment key={i}>\n <Key binding={binding.shortcut} />\n <span role='definition' className='ms-4' aria-labelledby={binding.shortcut}>\n {toLocalizedString(binding.data, t)}\n </span>\n </Fragment>\n ))}\n </dl>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { ShortcutsList } from './ShortcutsList';\n\nexport const ShortcutsSection = () => {\n return (\n <section className='text-description'>\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 Props, type TooltipRenderProps } 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 w-[15rem] min-h-[10rem] overflow-hidden rounded-md shadow-xl bg-accent-surface text-accent-surface-text'\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 px-2 py-1 text-lg font-medium text-accent-surface-text'>{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 px-4 my-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 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='mx-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 } from 'react';\nimport Joyride, { ACTIONS, EVENTS } from 'react-joyride';\n\nimport { usePluginManager } from '@dxos/app-framework/ui';\nimport { useLayout } from '@dxos/app-toolkit/ui';\nimport { useAsyncEffect } from '@dxos/react-ui';\n\nimport { HelpContext, type Step } from '../../types';\nimport { Tooltip, floaterProps } 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.capabilities);\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 useAsyncEffect(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 }, [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,gFACA,+CAAA;;;ADEK,IAAMC,MAAM,CAAC,EAAEC,QAAO,MAAuB;AAClD,SACE,sBAAA,cAACC,QAAAA;IAAKC,MAAK;IAAOC,WAAU;IAAoBC,cAAYJ;IAASK,IAAIL;KACtEM,WAAWN,OAAAA,EAASO,IAAI,CAACC,GAAGC,MAC3B,sBAAA,cAACR,QAAAA;IAAKS,KAAKD;IAAGN,WAAWQ;KACtBH,CAAAA,CAAAA,CAAAA;AAKX;;;AEhBA,OAAOI,YAAW;AAElB,SAA0BC,gBAAgB;AAC1C,SAASC,YAAYC,mBAAmBC,sBAAsB;AAC9D,SAASC,sBAAsB;AAI/B,IAAMC,WAAW,CAAC,EAAEC,QAAO,MAA2B;AACpD,QAAM,EAAEC,EAAC,IAAK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,gBAAAoB,OAAA,cAACC,YAAYC,UAAQ;IACnBC,OAAO;MACLrC,SAASA,WAAW,CAACY;MACrBd;MACAa;MACA2B,UAAUxB;MACVyB,OAAO,MAAMrB,kBAAkB,IAAA;MAC/BsB,MAAM,MAAMtB,kBAAkB,KAAA;IAChC;KAEA,gBAAAgB,OAAA,cAACO,SAAAA,MACE;;UAEC,GAEJ,gBAAAP,OAAA,cAACQ,SAAAA;IACCC,YAAY;IACZ7C;IACAW;IACAmC,KAAK5C,WAAW,CAACY;IACjBS;IACAwB;IACAC,kBAAkBC;;AAI1B;",
|
|
6
|
-
"names": ["React", "keySymbols", "mx", "shortcutKey", "mx", "Key", "binding", "span", "role", "className", "aria-label", "id", "keySymbols", "map", "c", "i", "key", "shortcutKey", "React", "Keyboard", "IconButton", "toLocalizedString", "useTranslation", "osTranslations", "Shortcut", "binding", "t", "useTranslation", "osTranslations", "React", "div", "role", "className", "Key", "shortcut", "span", "toLocalizedString", "data", "ShortcutsHints", "onClose", "defaults", "bindings", "Keyboard", "singleton", "getBindings", "hints", "filter", "includes", "map", "key", "IconButton", "icon", "size", "label", "iconOnly", "noTooltip", "variant", "classNames", "onClick", "React", "Fragment", "Keyboard", "toLocalizedString", "useTranslation", "mx", "ShortcutsList", "t", "useTranslation", "meta", "id", "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", "ShortcutsSection", "React", "section", "className", "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", "Joyride", "ACTIONS", "EVENTS", "usePluginManager", "useLayout", "useAsyncEffect", "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", "capabilities", "setRunningChanged", "state", "useAsyncEffect", "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
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SHORTCUTS_DIALOG
|
|
3
|
-
} from "./chunk-P34WCEMS.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Key,
|
|
6
|
-
ShortcutsHints,
|
|
7
|
-
ShortcutsList,
|
|
8
|
-
ShortcutsSection,
|
|
9
|
-
Tooltip,
|
|
10
|
-
WelcomeTour,
|
|
11
|
-
floaterProps
|
|
12
|
-
} from "./chunk-VGW5FGD7.mjs";
|
|
13
|
-
import {
|
|
14
|
-
HelpCapabilities,
|
|
15
|
-
HelpContext,
|
|
16
|
-
HelpOperation
|
|
17
|
-
} from "./chunk-HMLZFBYY.mjs";
|
|
18
|
-
import {
|
|
19
|
-
meta
|
|
20
|
-
} from "./chunk-TEXIV2IJ.mjs";
|
|
21
|
-
|
|
22
|
-
// src/HelpPlugin.tsx
|
|
23
|
-
import { ActivationEvents, Plugin } from "@dxos/app-framework";
|
|
24
|
-
import { AppPlugin } from "@dxos/app-toolkit";
|
|
25
|
-
|
|
26
|
-
// src/capabilities/app-graph-builder/index.ts
|
|
27
|
-
import { Capability } from "@dxos/app-framework";
|
|
28
|
-
var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("./app-graph-builder-5RXPFQPI.mjs"));
|
|
29
|
-
|
|
30
|
-
// src/capabilities/operation-resolver/operation-resolver.ts
|
|
31
|
-
import * as Effect from "effect/Effect";
|
|
32
|
-
import { Capabilities, Capability as Capability2 } from "@dxos/app-framework";
|
|
33
|
-
import { OperationResolver } from "@dxos/operation";
|
|
34
|
-
var operation_resolver_default = Capability2.makeModule(Effect.fnUntraced(function* () {
|
|
35
|
-
return Capability2.contributes(Capabilities.OperationResolver, [
|
|
36
|
-
OperationResolver.make({
|
|
37
|
-
operation: HelpOperation.Start,
|
|
38
|
-
handler: Effect.fnUntraced(function* () {
|
|
39
|
-
yield* Capabilities.updateAtomValue(HelpCapabilities.State, (state) => ({
|
|
40
|
-
...state,
|
|
41
|
-
running: true
|
|
42
|
-
}));
|
|
43
|
-
})
|
|
44
|
-
})
|
|
45
|
-
]);
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
// src/capabilities/react-root/index.ts
|
|
49
|
-
import { Capability as Capability3 } from "@dxos/app-framework";
|
|
50
|
-
var ReactRoot = Capability3.lazy("ReactRoot", () => import("./react-root-JBHEZA5U.mjs"));
|
|
51
|
-
|
|
52
|
-
// src/capabilities/react-surface/index.ts
|
|
53
|
-
import { Capability as Capability4 } from "@dxos/app-framework";
|
|
54
|
-
var ReactSurface = Capability4.lazy("ReactSurface", () => import("./react-surface-W5S45O6Y.mjs"));
|
|
55
|
-
|
|
56
|
-
// src/capabilities/state/index.ts
|
|
57
|
-
import { Capability as Capability5 } from "@dxos/app-framework";
|
|
58
|
-
var HelpState = Capability5.lazy("HelpState", () => import("./state-SEPP77HO.mjs"));
|
|
59
|
-
|
|
60
|
-
// src/translations.ts
|
|
61
|
-
var translations = [
|
|
62
|
-
{
|
|
63
|
-
"en-US": {
|
|
64
|
-
[meta.id]: {
|
|
65
|
-
"plugin name": "Help",
|
|
66
|
-
"open help tour": "Show welcome tour",
|
|
67
|
-
"open shortcuts label": "Show shortcuts",
|
|
68
|
-
"shortcuts dialog title": "Shortcuts"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
];
|
|
73
|
-
|
|
74
|
-
// src/HelpPlugin.tsx
|
|
75
|
-
var HelpPlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
|
|
76
|
-
activate: AppGraphBuilder
|
|
77
|
-
}), AppPlugin.addOperationResolverModule({
|
|
78
|
-
activate: operation_resolver_default
|
|
79
|
-
}), AppPlugin.addSurfaceModule({
|
|
80
|
-
activate: ReactSurface
|
|
81
|
-
}), AppPlugin.addTranslationsModule({
|
|
82
|
-
translations
|
|
83
|
-
}), Plugin.addModule({
|
|
84
|
-
activatesOn: ActivationEvents.Startup,
|
|
85
|
-
activate: HelpState
|
|
86
|
-
}), Plugin.addModule(({ steps = [] }) => ({
|
|
87
|
-
id: "react-root",
|
|
88
|
-
activatesOn: ActivationEvents.Startup,
|
|
89
|
-
activate: () => ReactRoot(steps)
|
|
90
|
-
})), Plugin.make);
|
|
91
|
-
|
|
92
|
-
// src/hooks/useHelp.tsx
|
|
93
|
-
import { useContext } from "react";
|
|
94
|
-
import { raise } from "@dxos/debug";
|
|
95
|
-
var useHelp = () => {
|
|
96
|
-
return useContext(HelpContext) ?? raise(new Error("Missing HelpContext"));
|
|
97
|
-
};
|
|
98
|
-
export {
|
|
99
|
-
HelpCapabilities,
|
|
100
|
-
HelpContext,
|
|
101
|
-
HelpOperation,
|
|
102
|
-
HelpPlugin,
|
|
103
|
-
Key,
|
|
104
|
-
SHORTCUTS_DIALOG,
|
|
105
|
-
ShortcutsHints,
|
|
106
|
-
ShortcutsList,
|
|
107
|
-
ShortcutsSection,
|
|
108
|
-
Tooltip,
|
|
109
|
-
WelcomeTour,
|
|
110
|
-
floaterProps,
|
|
111
|
-
meta,
|
|
112
|
-
useHelp
|
|
113
|
-
};
|
|
114
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/HelpPlugin.tsx", "../../../src/capabilities/app-graph-builder/index.ts", "../../../src/capabilities/operation-resolver/operation-resolver.ts", "../../../src/capabilities/react-root/index.ts", "../../../src/capabilities/react-surface/index.ts", "../../../src/capabilities/state/index.ts", "../../../src/translations.ts", "../../../src/hooks/useHelp.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { ActivationEvents, Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { AppGraphBuilder, HelpState, OperationResolver, ReactRoot, ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\nimport { type Step } from './types';\n\nexport type HelpPluginOptions = { steps?: Step[] };\n\nexport const HelpPlugin = Plugin.define<HelpPluginOptions>(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addOperationResolverModule({ activate: OperationResolver }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule({\n activatesOn: ActivationEvents.Startup,\n activate: HelpState,\n }),\n Plugin.addModule(({ steps = [] }) => ({\n id: 'react-root',\n activatesOn: ActivationEvents.Startup,\n activate: () => ReactRoot(steps),\n })),\n Plugin.make,\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { OperationResolver } from '@dxos/operation';\n\nimport { HelpCapabilities, HelpOperation } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Capabilities.OperationResolver, [\n OperationResolver.make({\n operation: HelpOperation.Start,\n handler: Effect.fnUntraced(function* () {\n yield* Capabilities.updateAtomValue(HelpCapabilities.State, (state) => ({ ...state, running: true }));\n }),\n }),\n ]);\n }),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ReactRoot = Capability.lazy('ReactRoot', () => import('./react-root'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const HelpState = Capability.lazy('HelpState', () => import('./state'));\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,kBAAkBC,cAAc;AACzC,SAASC,iBAAiB;;;ACD1B,SAASC,kBAAkB;AAEpB,IAAMC,kBAAkBC,WAAWC,KAAK,mBAAmB,MAAM,OAAO,kCAAA,CAAA;;;ACF/E,YAAYC,YAAY;AAExB,SAASC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AUF,KAAAA;AAC5B,EAAA,GACAnB,OAAOsB,IAAI;;;AOxBb,SAASC,kBAAkB;AAE3B,SAASC,aAAa;AAIf,IAAMC,UAAU,MAAA;AACrB,SAAOC,WAAWC,WAAAA,KAAgBC,MAAM,IAAIC,MAAM,qBAAA,CAAA;AACpD;",
|
|
6
|
-
"names": ["ActivationEvents", "Plugin", "AppPlugin", "Capability", "AppGraphBuilder", "Capability", "lazy", "Effect", "Capabilities", "Capability", "OperationResolver", "Capability", "makeModule", "fnUntraced", "contributes", "Capabilities", "OperationResolver", "make", "operation", "HelpOperation", "Start", "handler", "updateAtomValue", "HelpCapabilities", "State", "state", "running", "Capability", "ReactRoot", "Capability", "lazy", "Capability", "ReactSurface", "Capability", "lazy", "Capability", "HelpState", "Capability", "lazy", "translations", "meta", "id", "HelpPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addAppGraphModule", "activate", "AppGraphBuilder", "addOperationResolverModule", "OperationResolver", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "addModule", "activatesOn", "ActivationEvents", "Startup", "HelpState", "steps", "id", "ReactRoot", "make", "useContext", "raise", "useHelp", "useContext", "HelpContext", "raise", "Error"]
|
|
7
|
-
}
|