@dxos/plugin-help 0.8.4-main.7ace549 → 0.8.4-main.937b3ca
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/app-graph-builder-DX3VXARQ.mjs +79 -0
- package/dist/lib/browser/app-graph-builder-DX3VXARQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BCYK4LXW.mjs → chunk-IM2QVQOH.mjs} +1 -1
- package/dist/lib/browser/chunk-IM2QVQOH.mjs.map +7 -0
- package/dist/lib/browser/chunk-TS66J4C6.mjs +58 -0
- package/dist/lib/browser/chunk-TS66J4C6.mjs.map +7 -0
- package/dist/lib/browser/chunk-W5XAZM46.mjs +360 -0
- package/dist/lib/browser/chunk-W5XAZM46.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +58 -55
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/react-root-SZRF6EXG.mjs +43 -0
- package/dist/lib/browser/react-root-SZRF6EXG.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-OTMERRAV.mjs → react-surface-DWNTJBVM.mjs} +12 -11
- package/dist/lib/browser/react-surface-DWNTJBVM.mjs.map +7 -0
- package/dist/lib/browser/state-VRPLKT3F.mjs +27 -0
- package/dist/lib/browser/state-VRPLKT3F.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -6
- package/dist/types/src/HelpPlugin.d.ts +2 -1
- package/dist/types/src/HelpPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -8
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +2 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
- package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts +10 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +11 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +13 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/components/Shortcuts/ShortcutsHints.d.ts.map +1 -1
- package/dist/types/src/components/WelcomeTour/WelcomeTour.stories.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +21 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +16 -12
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -34
- package/src/HelpPlugin.tsx +16 -42
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +61 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/index.ts +5 -8
- package/src/capabilities/operation-resolver/index.ts +5 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +23 -0
- package/src/capabilities/react-root/index.ts +7 -0
- package/src/capabilities/react-root/react-root.tsx +36 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +34 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +27 -0
- package/src/components/Shortcuts/ShortcutsDialog.tsx +1 -1
- package/src/components/Shortcuts/ShortcutsHints.tsx +2 -1
- package/src/components/Shortcuts/ShortcutsList.tsx +1 -1
- package/src/components/Shortcuts/ShortcutsSection.tsx +1 -1
- package/src/components/Shortcuts/styles.ts +1 -1
- package/src/components/WelcomeTour/WelcomeTour.stories.tsx +8 -4
- package/src/components/WelcomeTour/WelcomeTour.tsx +1 -1
- package/src/index.ts +1 -1
- package/src/meta.ts +2 -2
- package/src/types/capabilities.ts +24 -0
- package/src/types/index.ts +1 -0
- package/src/types/schema.ts +11 -7
- package/dist/lib/browser/app-graph-builder-L6GUMAIH.mjs +0 -80
- package/dist/lib/browser/app-graph-builder-L6GUMAIH.mjs.map +0 -7
- package/dist/lib/browser/chunk-AZJJLAG7.mjs +0 -16
- package/dist/lib/browser/chunk-AZJJLAG7.mjs.map +0 -7
- package/dist/lib/browser/chunk-BCYK4LXW.mjs.map +0 -7
- package/dist/lib/browser/chunk-I7FKM6VC.mjs +0 -34
- package/dist/lib/browser/chunk-I7FKM6VC.mjs.map +0 -7
- package/dist/lib/browser/chunk-W4AUSEGO.mjs +0 -408
- package/dist/lib/browser/chunk-W4AUSEGO.mjs.map +0 -7
- package/dist/lib/browser/react-root-QJH33RNI.mjs +0 -35
- package/dist/lib/browser/react-root-QJH33RNI.mjs.map +0 -7
- package/dist/lib/browser/react-surface-OTMERRAV.mjs.map +0 -7
- package/dist/lib/browser/state-5PVJCYWJ.mjs +0 -29
- package/dist/lib/browser/state-5PVJCYWJ.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -10
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root.d.ts +0 -8
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -4
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -78
- package/src/capabilities/capabilities.ts +0 -13
- package/src/capabilities/react-root.tsx +0 -34
- package/src/capabilities/react-surface.tsx +0 -30
- package/src/capabilities/state.ts +0 -24
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
WelcomeTour
|
|
3
|
-
} from "./chunk-W4AUSEGO.mjs";
|
|
4
|
-
import "./chunk-I7FKM6VC.mjs";
|
|
5
|
-
import {
|
|
6
|
-
HelpCapabilities
|
|
7
|
-
} from "./chunk-AZJJLAG7.mjs";
|
|
8
|
-
import {
|
|
9
|
-
meta
|
|
10
|
-
} from "./chunk-BCYK4LXW.mjs";
|
|
11
|
-
|
|
12
|
-
// src/capabilities/react-root.tsx
|
|
13
|
-
import React from "react";
|
|
14
|
-
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
15
|
-
import { useCapability } from "@dxos/app-framework/react";
|
|
16
|
-
var react_root_default = ((steps) => contributes(Capabilities.ReactRoot, {
|
|
17
|
-
id: meta.id,
|
|
18
|
-
root: () => {
|
|
19
|
-
const state = useCapability(HelpCapabilities.MutableState);
|
|
20
|
-
return /* @__PURE__ */ React.createElement(WelcomeTour, {
|
|
21
|
-
steps,
|
|
22
|
-
running: state.running,
|
|
23
|
-
onRunningChanged: (newState) => {
|
|
24
|
-
state.running = newState;
|
|
25
|
-
if (!newState) {
|
|
26
|
-
state.showHints = false;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}));
|
|
32
|
-
export {
|
|
33
|
-
react_root_default as default
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=react-root-QJH33RNI.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-root.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { useCapability } from '@dxos/app-framework/react';\n\nimport { WelcomeTour } from '../components';\nimport { meta } from '../meta';\nimport { type Step } from '../types';\n\nimport { HelpCapabilities } from './capabilities';\n\nexport default (steps: Step[]) =>\n contributes(Capabilities.ReactRoot, {\n id: meta.id,\n root: () => {\n const state = useCapability(HelpCapabilities.MutableState);\n return (\n <WelcomeTour\n steps={steps}\n running={state.running}\n onRunningChanged={(newState) => {\n state.running = newState;\n if (!newState) {\n state.showHints = false;\n }\n }}\n />\n );\n },\n });\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,mBAAmB;AAC1C,SAASC,qBAAqB;AAQ9B,IAAA,sBAAe,CAACC,UACdC,YAAYC,aAAaC,WAAW;EAClCC,IAAIC,KAAKD;EACTE,MAAM,MAAA;AACJ,UAAMC,QAAQC,cAAcC,iBAAiBC,YAAY;AACzD,WACE,sBAAA,cAACC,aAAAA;MACCX;MACAY,SAASL,MAAMK;MACfC,kBAAkB,CAACC,aAAAA;AACjBP,cAAMK,UAAUE;AAChB,YAAI,CAACA,UAAU;AACbP,gBAAMQ,YAAY;QACpB;MACF;;EAGN;AACF,CAAA;",
|
|
6
|
-
"names": ["React", "Capabilities", "contributes", "useCapability", "steps", "contributes", "Capabilities", "ReactRoot", "id", "meta", "root", "state", "useCapability", "HelpCapabilities", "MutableState", "WelcomeTour", "running", "onRunningChanged", "newState", "showHints"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\n\nimport { SHORTCUTS_DIALOG, ShortcutsDialogContent, ShortcutsHints, ShortcutsList } from '../components';\nimport { meta } from '../meta';\n\nexport default () =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: `${meta.id}/hints`,\n role: 'hints',\n component: () => <ShortcutsHints />,\n }),\n createSurface({\n id: `${meta.id}/keyshortcuts`,\n role: 'keyshortcuts',\n component: () => <ShortcutsList />,\n }),\n createSurface({\n id: SHORTCUTS_DIALOG,\n role: 'dialog',\n filter: (data): data is any => data.component === SHORTCUTS_DIALOG,\n component: () => <ShortcutsDialogContent />,\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AAKzD,IAAA,yBAAe,MACbC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,WAAW,MAAM,sBAAA,cAACC,gBAAAA,IAAAA;EACpB,CAAA;EACAL,cAAc;IACZC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,WAAW,MAAM,sBAAA,cAACE,eAAAA,IAAAA;EACpB,CAAA;EACAN,cAAc;IACZC,IAAIM;IACJJ,MAAM;IACNK,QAAQ,CAACC,SAAsBA,KAAKL,cAAcG;IAClDH,WAAW,MAAM,sBAAA,cAACM,wBAAAA,IAAAA;EACpB,CAAA;CACD;",
|
|
6
|
-
"names": ["React", "Capabilities", "contributes", "createSurface", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "meta", "role", "component", "ShortcutsHints", "ShortcutsList", "SHORTCUTS_DIALOG", "filter", "data", "ShortcutsDialogContent"]
|
|
7
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HelpCapabilities
|
|
3
|
-
} from "./chunk-AZJJLAG7.mjs";
|
|
4
|
-
import {
|
|
5
|
-
meta
|
|
6
|
-
} from "./chunk-BCYK4LXW.mjs";
|
|
7
|
-
|
|
8
|
-
// src/capabilities/state.ts
|
|
9
|
-
import { contributes } from "@dxos/app-framework";
|
|
10
|
-
import { LocalStorageStore } from "@dxos/local-storage";
|
|
11
|
-
var state_default = (() => {
|
|
12
|
-
const state = new LocalStorageStore(meta.id, {
|
|
13
|
-
running: false,
|
|
14
|
-
showHints: true,
|
|
15
|
-
showWelcome: true
|
|
16
|
-
});
|
|
17
|
-
state.prop({
|
|
18
|
-
key: "showHints",
|
|
19
|
-
type: LocalStorageStore.bool()
|
|
20
|
-
}).prop({
|
|
21
|
-
key: "showWelcome",
|
|
22
|
-
type: LocalStorageStore.bool()
|
|
23
|
-
});
|
|
24
|
-
return contributes(HelpCapabilities.State, state.values);
|
|
25
|
-
});
|
|
26
|
-
export {
|
|
27
|
-
state_default as default
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=state-5PVJCYWJ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/state.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes } from '@dxos/app-framework';\nimport { LocalStorageStore } from '@dxos/local-storage';\n\nimport { meta } from '../meta';\n\nimport { HelpCapabilities } from './capabilities';\n\nexport default () => {\n const state = new LocalStorageStore<HelpCapabilities.State>(meta.id, {\n running: false,\n showHints: true,\n showWelcome: true,\n });\n\n state\n .prop({ key: 'showHints', type: LocalStorageStore.bool() })\n .prop({ key: 'showWelcome', type: LocalStorageStore.bool() });\n\n return contributes(HelpCapabilities.State, state.values);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,SAASA,mBAAmB;AAC5B,SAASC,yBAAyB;AAMlC,IAAA,iBAAe,MAAA;AACb,QAAMC,QAAQ,IAAIC,kBAA0CC,KAAKC,IAAI;IACnEC,SAAS;IACTC,WAAW;IACXC,aAAa;EACf,CAAA;AAEAN,QACGO,KAAK;IAAEC,KAAK;IAAaC,MAAMR,kBAAkBS,KAAI;EAAG,CAAA,EACxDH,KAAK;IAAEC,KAAK;IAAeC,MAAMR,kBAAkBS,KAAI;EAAG,CAAA;AAE7D,SAAOC,YAAYC,iBAAiBC,OAAOb,MAAMc,MAAM;AACzD;",
|
|
6
|
-
"names": ["contributes", "LocalStorageStore", "state", "LocalStorageStore", "meta", "id", "running", "showHints", "showWelcome", "prop", "key", "type", "bool", "contributes", "HelpCapabilities", "State", "values"]
|
|
7
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type PluginContext } from '@dxos/app-framework';
|
|
2
|
-
declare const _default: (context: PluginContext) => import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<import("@dxos/app-graph").BuilderExtensions>>;
|
|
3
|
-
export default _default;
|
|
4
|
-
//# sourceMappingURL=app-graph-builder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/app-graph-builder.ts"],"names":[],"mappings":"AAQA,OAAO,EAA8B,KAAK,aAAa,EAA6B,MAAM,qBAAqB,CAAC;yBAShG,SAAS,aAAa;AAAtC,wBA4DI"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare namespace HelpCapabilities {
|
|
2
|
-
type State = {
|
|
3
|
-
running: boolean;
|
|
4
|
-
showHints: boolean;
|
|
5
|
-
showWelcome: boolean;
|
|
6
|
-
};
|
|
7
|
-
const State: import("@dxos/app-framework").InterfaceDef<Readonly<State>>;
|
|
8
|
-
const MutableState: import("@dxos/app-framework").InterfaceDef<State>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/capabilities.ts"],"names":[],"mappings":"AAQA,yBAAiB,gBAAgB,CAAC;IAChC,KAAY,KAAK,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC;IAC5E,MAAM,KAAK,6DAAmE,CAAC;IAC/E,MAAM,YAAY,mDAAyD,CAAC;CACpF"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type Step } from '../types';
|
|
3
|
-
declare const _default: (steps: Step[]) => import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<Readonly<{
|
|
4
|
-
id: string;
|
|
5
|
-
root: React.FC<React.PropsWithChildren>;
|
|
6
|
-
}>>>;
|
|
7
|
-
export default _default;
|
|
8
|
-
//# sourceMappingURL=react-root.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-root.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-root.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,UAAU,CAAC;yBAIrB,OAAO,IAAI,EAAE;;;;AAA7B,wBAkBK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAA8B,MAAM,qBAAqB,CAAC;;AAK/E,wBAkBK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/state.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;;AAElD,wBAYE"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
|
-
import * as Option from 'effect/Option';
|
|
8
|
-
|
|
9
|
-
import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
10
|
-
import { createExtension } from '@dxos/app-graph';
|
|
11
|
-
|
|
12
|
-
import { SHORTCUTS_DIALOG } from '../components';
|
|
13
|
-
import { meta } from '../meta';
|
|
14
|
-
import { HelpAction } from '../types';
|
|
15
|
-
|
|
16
|
-
import { HelpCapabilities } from './capabilities';
|
|
17
|
-
|
|
18
|
-
export default (context: PluginContext) =>
|
|
19
|
-
contributes(
|
|
20
|
-
Capabilities.AppGraphBuilder,
|
|
21
|
-
createExtension({
|
|
22
|
-
id: meta.id,
|
|
23
|
-
actions: (node) =>
|
|
24
|
-
Atom.make((get) =>
|
|
25
|
-
Function.pipe(
|
|
26
|
-
get(node),
|
|
27
|
-
Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
|
|
28
|
-
Option.map(() => [
|
|
29
|
-
{
|
|
30
|
-
id: HelpAction.Start._tag,
|
|
31
|
-
data: async () => {
|
|
32
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
33
|
-
const state = context.getCapability(HelpCapabilities.MutableState);
|
|
34
|
-
state.showHints = true;
|
|
35
|
-
await dispatch(createIntent(HelpAction.Start));
|
|
36
|
-
},
|
|
37
|
-
properties: {
|
|
38
|
-
label: ['open help tour', { ns: meta.id }],
|
|
39
|
-
icon: 'ph--info--regular',
|
|
40
|
-
keyBinding: {
|
|
41
|
-
macos: 'shift+meta+/',
|
|
42
|
-
// TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
|
|
43
|
-
windows: 'shift+ctrl+/',
|
|
44
|
-
linux: 'shift+ctrl+?',
|
|
45
|
-
},
|
|
46
|
-
testId: 'helpPlugin.openHelp',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
id: `${meta.id}/open-shortcuts`,
|
|
51
|
-
data: async () => {
|
|
52
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
53
|
-
const state = context.getCapability(HelpCapabilities.MutableState);
|
|
54
|
-
state.showHints = true;
|
|
55
|
-
await dispatch(
|
|
56
|
-
createIntent(LayoutAction.UpdateDialog, {
|
|
57
|
-
part: 'dialog',
|
|
58
|
-
subject: SHORTCUTS_DIALOG,
|
|
59
|
-
options: {
|
|
60
|
-
blockAlign: 'center',
|
|
61
|
-
},
|
|
62
|
-
}),
|
|
63
|
-
);
|
|
64
|
-
},
|
|
65
|
-
properties: {
|
|
66
|
-
label: ['open shortcuts label', { ns: meta.id }],
|
|
67
|
-
icon: 'ph--keyboard--regular',
|
|
68
|
-
keyBinding: {
|
|
69
|
-
macos: 'meta+ctrl+/',
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
]),
|
|
74
|
-
Option.getOrElse(() => []),
|
|
75
|
-
),
|
|
76
|
-
),
|
|
77
|
-
}),
|
|
78
|
-
);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
import { meta } from '../meta';
|
|
8
|
-
|
|
9
|
-
export namespace HelpCapabilities {
|
|
10
|
-
export type State = { running: boolean; showHints: boolean; showWelcome: boolean };
|
|
11
|
-
export const State = defineCapability<Readonly<State>>(`${meta.id}/capability/state`);
|
|
12
|
-
export const MutableState = defineCapability<State>(`${meta.id}/capability/state`);
|
|
13
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
8
|
-
import { useCapability } from '@dxos/app-framework/react';
|
|
9
|
-
|
|
10
|
-
import { WelcomeTour } from '../components';
|
|
11
|
-
import { meta } from '../meta';
|
|
12
|
-
import { type Step } from '../types';
|
|
13
|
-
|
|
14
|
-
import { HelpCapabilities } from './capabilities';
|
|
15
|
-
|
|
16
|
-
export default (steps: Step[]) =>
|
|
17
|
-
contributes(Capabilities.ReactRoot, {
|
|
18
|
-
id: meta.id,
|
|
19
|
-
root: () => {
|
|
20
|
-
const state = useCapability(HelpCapabilities.MutableState);
|
|
21
|
-
return (
|
|
22
|
-
<WelcomeTour
|
|
23
|
-
steps={steps}
|
|
24
|
-
running={state.running}
|
|
25
|
-
onRunningChanged={(newState) => {
|
|
26
|
-
state.running = newState;
|
|
27
|
-
if (!newState) {
|
|
28
|
-
state.showHints = false;
|
|
29
|
-
}
|
|
30
|
-
}}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
},
|
|
34
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
-
|
|
9
|
-
import { SHORTCUTS_DIALOG, ShortcutsDialogContent, ShortcutsHints, ShortcutsList } from '../components';
|
|
10
|
-
import { meta } from '../meta';
|
|
11
|
-
|
|
12
|
-
export default () =>
|
|
13
|
-
contributes(Capabilities.ReactSurface, [
|
|
14
|
-
createSurface({
|
|
15
|
-
id: `${meta.id}/hints`,
|
|
16
|
-
role: 'hints',
|
|
17
|
-
component: () => <ShortcutsHints />,
|
|
18
|
-
}),
|
|
19
|
-
createSurface({
|
|
20
|
-
id: `${meta.id}/keyshortcuts`,
|
|
21
|
-
role: 'keyshortcuts',
|
|
22
|
-
component: () => <ShortcutsList />,
|
|
23
|
-
}),
|
|
24
|
-
createSurface({
|
|
25
|
-
id: SHORTCUTS_DIALOG,
|
|
26
|
-
role: 'dialog',
|
|
27
|
-
filter: (data): data is any => data.component === SHORTCUTS_DIALOG,
|
|
28
|
-
component: () => <ShortcutsDialogContent />,
|
|
29
|
-
}),
|
|
30
|
-
]);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { contributes } from '@dxos/app-framework';
|
|
6
|
-
import { LocalStorageStore } from '@dxos/local-storage';
|
|
7
|
-
|
|
8
|
-
import { meta } from '../meta';
|
|
9
|
-
|
|
10
|
-
import { HelpCapabilities } from './capabilities';
|
|
11
|
-
|
|
12
|
-
export default () => {
|
|
13
|
-
const state = new LocalStorageStore<HelpCapabilities.State>(meta.id, {
|
|
14
|
-
running: false,
|
|
15
|
-
showHints: true,
|
|
16
|
-
showWelcome: true,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
state
|
|
20
|
-
.prop({ key: 'showHints', type: LocalStorageStore.bool() })
|
|
21
|
-
.prop({ key: 'showWelcome', type: LocalStorageStore.bool() });
|
|
22
|
-
|
|
23
|
-
return contributes(HelpCapabilities.State, state.values);
|
|
24
|
-
};
|