@dxos/plugin-help 0.8.4-main.f9ba587 → 0.8.4-main.fd6878d
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-IXCF4ZDE.mjs → app-graph-builder-TUTK2ONB.mjs} +4 -4
- package/dist/lib/browser/app-graph-builder-TUTK2ONB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-27RZVOIE.mjs → chunk-GIDPSFGY.mjs} +32 -31
- package/dist/lib/browser/chunk-GIDPSFGY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WAN2NFYE.mjs → chunk-J2SJSGSX.mjs} +4 -6
- package/dist/lib/browser/chunk-J2SJSGSX.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +7 -9
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-A32LXEU4.mjs → react-root-5GSVXKQD.mjs} +3 -3
- package/dist/lib/browser/react-root-5GSVXKQD.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-DIIOUUMT.mjs → react-surface-V7U4IDJV.mjs} +3 -3
- package/dist/lib/browser/{state-FWUZG6NL.mjs → state-IXBTB3WH.mjs} +1 -1
- package/dist/lib/browser/{state-FWUZG6NL.mjs.map → state-IXBTB3WH.mjs.map} +2 -2
- package/dist/lib/browser/types/index.mjs +10 -0
- package/dist/types/src/HelpPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/Shortcuts/ShortcutsDialog.d.ts.map +1 -1
- package/dist/types/src/components/Shortcuts/ShortcutsList.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +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/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 +27 -26
- package/src/HelpPlugin.tsx +2 -2
- package/src/capabilities/app-graph-builder.ts +3 -2
- package/src/capabilities/react-root.tsx +2 -1
- package/src/capabilities/state.ts +2 -1
- package/src/components/Shortcuts/ShortcutsDialog.tsx +2 -1
- package/src/components/Shortcuts/ShortcutsList.tsx +2 -1
- package/src/components/Tooltip/Tooltip.tsx +29 -27
- package/src/components/WelcomeTour/WelcomeTour.stories.tsx +7 -7
- package/src/components/WelcomeTour/WelcomeTour.tsx +4 -4
- package/src/types/index.ts +5 -0
- package/src/{types.ts → types/schema.ts} +2 -3
- package/dist/lib/browser/app-graph-builder-IXCF4ZDE.mjs.map +0 -7
- package/dist/lib/browser/chunk-27RZVOIE.mjs.map +0 -7
- package/dist/lib/browser/chunk-WAN2NFYE.mjs.map +0 -7
- package/dist/lib/browser/react-root-A32LXEU4.mjs.map +0 -7
- package/dist/lib/browser/types.mjs +0 -12
- package/dist/lib/node-esm/app-graph-builder-5QQRWRWG.mjs +0 -80
- package/dist/lib/node-esm/app-graph-builder-5QQRWRWG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6JMO5FFN.mjs +0 -37
- package/dist/lib/node-esm/chunk-6JMO5FFN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CXQ5LKQI.mjs +0 -17
- package/dist/lib/node-esm/chunk-CXQ5LKQI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PU7X4MJO.mjs +0 -409
- package/dist/lib/node-esm/chunk-PU7X4MJO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-T523OGIV.mjs +0 -15
- package/dist/lib/node-esm/chunk-T523OGIV.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -115
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-Q6PGYYYP.mjs +0 -35
- package/dist/lib/node-esm/react-root-Q6PGYYYP.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-QEIKNNW3.mjs +0 -37
- package/dist/lib/node-esm/react-surface-QEIKNNW3.mjs.map +0 -7
- package/dist/lib/node-esm/state-Y476FGII.mjs +0 -30
- package/dist/lib/node-esm/state-Y476FGII.mjs.map +0 -7
- package/dist/lib/node-esm/types.mjs +0 -13
- package/dist/lib/node-esm/types.mjs.map +0 -7
- package/dist/types/src/types.d.ts.map +0 -1
- /package/dist/lib/browser/{react-surface-DIIOUUMT.mjs.map → react-surface-V7U4IDJV.mjs.map} +0 -0
- /package/dist/lib/browser/{types.mjs.map → types/index.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-help",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.fd6878d",
|
|
4
4
|
"description": "Help plugin.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,16 +10,19 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs"
|
|
15
16
|
},
|
|
16
17
|
"./meta": {
|
|
18
|
+
"source": "./src/meta.ts",
|
|
17
19
|
"types": "./dist/types/src/meta.d.ts",
|
|
18
20
|
"browser": "./dist/lib/browser/meta.mjs"
|
|
19
21
|
},
|
|
20
22
|
"./types": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
+
"source": "./src/types/index.ts",
|
|
24
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
25
|
+
"browser": "./dist/lib/browser/types/index.mjs"
|
|
23
26
|
}
|
|
24
27
|
},
|
|
25
28
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -29,7 +32,7 @@
|
|
|
29
32
|
"dist/types/src/meta.d.ts"
|
|
30
33
|
],
|
|
31
34
|
"types": [
|
|
32
|
-
"dist/types/src/types.d.ts"
|
|
35
|
+
"dist/types/src/types/index.d.ts"
|
|
33
36
|
]
|
|
34
37
|
}
|
|
35
38
|
},
|
|
@@ -41,45 +44,43 @@
|
|
|
41
44
|
"@fluentui/react-tabster": "^9.24.2",
|
|
42
45
|
"@preact-signals/safe-react": "^0.9.0",
|
|
43
46
|
"react-joyride": "^2.7.2",
|
|
44
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
45
|
-
"@dxos/app-graph": "0.8.4-main.
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/plugin-
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
47
|
+
"@dxos/app-framework": "0.8.4-main.fd6878d",
|
|
48
|
+
"@dxos/app-graph": "0.8.4-main.fd6878d",
|
|
49
|
+
"@dxos/debug": "0.8.4-main.fd6878d",
|
|
50
|
+
"@dxos/echo-schema": "0.8.4-main.fd6878d",
|
|
51
|
+
"@dxos/live-object": "0.8.4-main.fd6878d",
|
|
52
|
+
"@dxos/local-storage": "0.8.4-main.fd6878d",
|
|
53
|
+
"@dxos/plugin-graph": "0.8.4-main.fd6878d",
|
|
54
|
+
"@dxos/plugin-client": "0.8.4-main.fd6878d",
|
|
55
|
+
"@dxos/keyboard": "0.8.4-main.fd6878d",
|
|
56
|
+
"@dxos/plugin-space": "0.8.4-main.fd6878d",
|
|
57
|
+
"@dxos/react-client": "0.8.4-main.fd6878d",
|
|
58
|
+
"@dxos/echo": "0.8.4-main.fd6878d"
|
|
56
59
|
},
|
|
57
60
|
"devDependencies": {
|
|
58
61
|
"@effect-rx/rx-react": "0.38.0",
|
|
59
|
-
"@effect/platform": "0.
|
|
60
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
62
|
+
"@effect/platform": "0.90.2",
|
|
61
63
|
"@types/react": "~18.2.0",
|
|
62
64
|
"@types/react-dom": "~18.2.0",
|
|
63
|
-
"effect": "3.
|
|
65
|
+
"effect": "3.17.7",
|
|
64
66
|
"react": "~18.2.0",
|
|
65
67
|
"react-dom": "~18.2.0",
|
|
66
68
|
"react-floater": "0.7.9",
|
|
67
69
|
"type-fest": "4.10.1",
|
|
68
70
|
"vite": "5.4.7",
|
|
69
|
-
"@dxos/random": "0.8.4-main.
|
|
70
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
71
|
-
"@dxos/react-ui
|
|
72
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
71
|
+
"@dxos/random": "0.8.4-main.fd6878d",
|
|
72
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d",
|
|
73
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
74
|
+
"@dxos/storybook-utils": "0.8.4-main.fd6878d"
|
|
73
75
|
},
|
|
74
76
|
"peerDependencies": {
|
|
75
77
|
"@effect-rx/rx-react": "^0.34.1",
|
|
76
78
|
"@effect/platform": "^0.80.12",
|
|
77
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
78
79
|
"effect": "^3.13.3",
|
|
79
80
|
"react": "~18.2.0",
|
|
80
81
|
"react-dom": "~18.2.0",
|
|
81
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
82
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
82
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
83
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d"
|
|
83
84
|
},
|
|
84
85
|
"publishConfig": {
|
|
85
86
|
"access": "public"
|
package/src/HelpPlugin.tsx
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capabilities, Events, contributes, createResolver, defineModule, definePlugin } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
import { AppGraphBuilder, HelpState, ReactRoot, ReactSurface } from './capabilities';
|
|
8
8
|
import { HelpCapabilities } from './capabilities/capabilities';
|
|
9
9
|
import { meta } from './meta';
|
|
10
10
|
import { translations } from './translations';
|
|
11
|
-
import { type Step
|
|
11
|
+
import { HelpAction, type Step } from './types';
|
|
12
12
|
|
|
13
13
|
export type HelpPluginOptions = { steps?: Step[] };
|
|
14
14
|
|
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
import { Rx } from '@effect-rx/rx-react';
|
|
6
6
|
import { Option, pipe } from 'effect';
|
|
7
7
|
|
|
8
|
-
import { Capabilities,
|
|
8
|
+
import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
9
9
|
import { createExtension } from '@dxos/app-graph';
|
|
10
10
|
|
|
11
|
-
import { HelpCapabilities } from './capabilities';
|
|
12
11
|
import { SHORTCUTS_DIALOG } from '../components';
|
|
13
12
|
import { HELP_PLUGIN } from '../meta';
|
|
14
13
|
import { HelpAction } from '../types';
|
|
15
14
|
|
|
15
|
+
import { HelpCapabilities } from './capabilities';
|
|
16
|
+
|
|
16
17
|
export default (context: PluginContext) =>
|
|
17
18
|
contributes(
|
|
18
19
|
Capabilities.AppGraphBuilder,
|
|
@@ -6,11 +6,12 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, useCapability } from '@dxos/app-framework';
|
|
8
8
|
|
|
9
|
-
import { HelpCapabilities } from './capabilities';
|
|
10
9
|
import { WelcomeTour } from '../components';
|
|
11
10
|
import { HELP_PLUGIN } from '../meta';
|
|
12
11
|
import { type Step } from '../types';
|
|
13
12
|
|
|
13
|
+
import { HelpCapabilities } from './capabilities';
|
|
14
|
+
|
|
14
15
|
export default (steps: Step[]) =>
|
|
15
16
|
contributes(Capabilities.ReactRoot, {
|
|
16
17
|
id: HELP_PLUGIN,
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
import { contributes } from '@dxos/app-framework';
|
|
6
6
|
import { LocalStorageStore } from '@dxos/local-storage';
|
|
7
7
|
|
|
8
|
-
import { HelpCapabilities } from './capabilities';
|
|
9
8
|
import { HELP_PLUGIN } from '../meta';
|
|
10
9
|
|
|
10
|
+
import { HelpCapabilities } from './capabilities';
|
|
11
|
+
|
|
11
12
|
export default () => {
|
|
12
13
|
const state = new LocalStorageStore<HelpCapabilities.State>(HELP_PLUGIN, {
|
|
13
14
|
running: false,
|
|
@@ -6,9 +6,10 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
|
|
8
8
|
|
|
9
|
-
import { ShortcutsList } from './ShortcutsList';
|
|
10
9
|
import { HELP_PLUGIN } from '../../meta';
|
|
11
10
|
|
|
11
|
+
import { ShortcutsList } from './ShortcutsList';
|
|
12
|
+
|
|
12
13
|
export const SHORTCUTS_DIALOG = `${HELP_PLUGIN}/ShortcutsDialog`;
|
|
13
14
|
|
|
14
15
|
export const ShortcutsDialogContent = () => {
|
|
@@ -8,9 +8,10 @@ import { Keyboard } from '@dxos/keyboard';
|
|
|
8
8
|
import { toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { mx } from '@dxos/react-ui-theme';
|
|
10
10
|
|
|
11
|
-
import { Key } from './Key';
|
|
12
11
|
import { HELP_PLUGIN } from '../../meta';
|
|
13
12
|
|
|
13
|
+
import { Key } from './Key';
|
|
14
|
+
|
|
14
15
|
export const ShortcutsList = () => {
|
|
15
16
|
const { t } = useTranslation(HELP_PLUGIN);
|
|
16
17
|
const bindings = Keyboard.singleton.getBindings();
|
|
@@ -3,18 +3,16 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { useArrowNavigationGroup, useFocusableGroup } from '@fluentui/react-tabster';
|
|
6
|
-
import { CaretLeft, CaretRight, Circle, X } from '@phosphor-icons/react';
|
|
7
6
|
import React, { forwardRef } from 'react';
|
|
8
7
|
// 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.
|
|
9
8
|
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
10
9
|
import _floater from 'react-floater';
|
|
11
|
-
import { type
|
|
10
|
+
import { type Props, type TooltipRenderProps } from 'react-joyride';
|
|
12
11
|
// 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.
|
|
13
12
|
// eslint-disable-next-line unused-imports/no-unused-imports
|
|
14
13
|
import _typefest from 'type-fest';
|
|
15
14
|
|
|
16
|
-
import { Button } from '@dxos/react-ui';
|
|
17
|
-
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
15
|
+
import { Button, Icon, IconButton } from '@dxos/react-ui';
|
|
18
16
|
|
|
19
17
|
// https://docs.react-joyride.com/styling
|
|
20
18
|
// https://github.com/gilbarbara/react-floater
|
|
@@ -49,36 +47,39 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipRenderProps>(
|
|
|
49
47
|
>
|
|
50
48
|
<div className='flex p-2'>
|
|
51
49
|
<h2 className='grow pli-2 plb-1 text-lg font-medium text-accentSurfaceText'>{title}</h2>
|
|
52
|
-
<
|
|
50
|
+
<IconButton
|
|
53
51
|
density='fine'
|
|
54
|
-
|
|
52
|
+
icon='ph--x--bold'
|
|
53
|
+
iconOnly
|
|
54
|
+
label={closeProps['aria-label']}
|
|
55
55
|
onClick={closeProps.onClick}
|
|
56
|
-
|
|
56
|
+
size={4}
|
|
57
|
+
variant='primary'
|
|
57
58
|
data-testid='helpPlugin.tooltip.close'
|
|
58
|
-
|
|
59
|
-
<X weight='bold' className={getSize(4)} />
|
|
60
|
-
</Button>
|
|
59
|
+
/>
|
|
61
60
|
</div>
|
|
62
61
|
<div className='flex grow pli-4 mlb-2'>{content}</div>
|
|
63
62
|
<div className='flex p-2 items-center justify-between' {...arrowNavigationAttrs}>
|
|
64
63
|
{
|
|
65
|
-
<
|
|
66
|
-
variant='primary'
|
|
67
|
-
onClick={backProps.onClick}
|
|
68
|
-
title={backProps['aria-label']}
|
|
64
|
+
<IconButton
|
|
69
65
|
classNames={[!(index > 0 && backProps) && 'invisible']}
|
|
66
|
+
icon='ph--caret-left--regular'
|
|
67
|
+
iconOnly
|
|
68
|
+
label={backProps['aria-label']}
|
|
69
|
+
onClick={backProps.onClick}
|
|
70
|
+
size={5}
|
|
71
|
+
variant='primary'
|
|
70
72
|
data-testid='helpPlugin.tooltip.back'
|
|
71
|
-
|
|
72
|
-
<CaretLeft className={getSize(5)} />
|
|
73
|
-
</Button>
|
|
73
|
+
/>
|
|
74
74
|
}
|
|
75
75
|
<div className='flex grow gap-2 justify-center'>
|
|
76
76
|
<div className='flex'>
|
|
77
77
|
{Array.from({ length: size }).map((_, i) => (
|
|
78
|
-
<
|
|
78
|
+
<Icon
|
|
79
79
|
key={i}
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
icon={index === i ? 'ph--circle--fill' : 'ph--circle--regular'}
|
|
81
|
+
size={2}
|
|
82
|
+
classNames='mli-1 cursor-pointer'
|
|
82
83
|
/>
|
|
83
84
|
))}
|
|
84
85
|
</div>
|
|
@@ -94,15 +95,16 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipRenderProps>(
|
|
|
94
95
|
Done
|
|
95
96
|
</Button>
|
|
96
97
|
) : (
|
|
97
|
-
<
|
|
98
|
-
variant='primary'
|
|
99
|
-
onClick={primaryProps.onClick}
|
|
100
|
-
title={primaryProps['aria-label']}
|
|
98
|
+
<IconButton
|
|
101
99
|
autoFocus
|
|
100
|
+
icon='ph--caret-right--regular'
|
|
101
|
+
iconOnly
|
|
102
|
+
label={primaryProps['aria-label']}
|
|
103
|
+
onClick={primaryProps.onClick}
|
|
104
|
+
size={6}
|
|
105
|
+
variant='primary'
|
|
102
106
|
data-testid='helpPlugin.tooltip.next'
|
|
103
|
-
|
|
104
|
-
<CaretRight className={getSize(6)} />
|
|
105
|
-
</Button>
|
|
107
|
+
/>
|
|
106
108
|
)}
|
|
107
109
|
</div>
|
|
108
110
|
</div>
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { Circle } from '@phosphor-icons/react';
|
|
8
7
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
9
8
|
import React, { useState } from 'react';
|
|
10
9
|
|
|
11
10
|
import { faker } from '@dxos/random';
|
|
12
|
-
import { Button } from '@dxos/react-ui';
|
|
11
|
+
import { Button, Icon } from '@dxos/react-ui';
|
|
13
12
|
import { withTheme } from '@dxos/storybook-utils';
|
|
14
13
|
|
|
15
|
-
import { WelcomeTour, type WelcomeTourProps } from './WelcomeTour';
|
|
16
14
|
import { useHelp } from '../../hooks';
|
|
17
15
|
|
|
16
|
+
import { WelcomeTour, type WelcomeTourProps } from './WelcomeTour';
|
|
17
|
+
|
|
18
18
|
const App = () => {
|
|
19
19
|
const { running, start } = useHelp();
|
|
20
20
|
const [items, setItems] = useState(() => Array.from({ length: 5 }).map(() => faker.lorem.sentence()));
|
|
@@ -35,7 +35,7 @@ const App = () => {
|
|
|
35
35
|
<ul className='p-2 border border-blue-500 rounded-md' data-joyride='basic/2'>
|
|
36
36
|
{items.map((item, i) => (
|
|
37
37
|
<li key={i} className='flex items-center gap-2'>
|
|
38
|
-
<
|
|
38
|
+
<Icon icon='ph--circle--regular' />
|
|
39
39
|
<span>{item}</span>
|
|
40
40
|
</li>
|
|
41
41
|
))}
|
|
@@ -49,9 +49,9 @@ const App = () => {
|
|
|
49
49
|
<div className='flex grow' />
|
|
50
50
|
<div className='flex items-center py-2'>
|
|
51
51
|
<div className='grow' />
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
<
|
|
52
|
+
<Icon icon='ph--circle--regular' data-joyride='basic/4' />
|
|
53
|
+
<Icon icon='ph--circle--regular' />
|
|
54
|
+
<Icon icon='ph--circle--regular' />
|
|
55
55
|
</div>
|
|
56
56
|
</div>
|
|
57
57
|
);
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { useEffect, useState } from 'react';
|
|
6
6
|
import Joyride, { ACTIONS, EVENTS } from 'react-joyride';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { useLayout, usePluginManager } from '@dxos/app-framework';
|
|
9
9
|
|
|
10
|
-
import { type Step
|
|
11
|
-
import {
|
|
10
|
+
import { HelpContext, type Step } from '../../types';
|
|
11
|
+
import { Tooltip, floaterProps } from '../Tooltip';
|
|
12
12
|
|
|
13
13
|
const addStepClass = (target: string | HTMLElement) => {
|
|
14
14
|
const element = typeof target === 'string' ? document.querySelector(target) : target;
|
|
@@ -8,7 +8,7 @@ import { type Step as BaseStep } from 'react-joyride';
|
|
|
8
8
|
|
|
9
9
|
import { type PluginContext } from '@dxos/app-framework';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { meta } from '../meta';
|
|
12
12
|
|
|
13
13
|
export type Step = BaseStep & {
|
|
14
14
|
before?: (context: PluginContext) => void;
|
|
@@ -32,9 +32,8 @@ export const HelpContext: Context<HelpContextType> = createContext<HelpContextTy
|
|
|
32
32
|
stop: () => {},
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
export const HELP_ACTION = `${HELP_PLUGIN}/action`;
|
|
36
35
|
export namespace HelpAction {
|
|
37
|
-
export class Start extends Schema.TaggedClass<Start>()(`${
|
|
36
|
+
export class Start extends Schema.TaggedClass<Start>()(`${meta.id}/action/start`, {
|
|
38
37
|
input: Schema.Void,
|
|
39
38
|
output: Schema.Void,
|
|
40
39
|
}) {}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, contributes, createIntent, LayoutAction, type PluginContext } from '@dxos/app-framework';\nimport { createExtension } from '@dxos/app-graph';\n\nimport { HelpCapabilities } from './capabilities';\nimport { SHORTCUTS_DIALOG } from '../components';\nimport { HELP_PLUGIN } from '../meta';\nimport { HelpAction } from '../types';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: HELP_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),\n Option.map(() => [\n {\n id: HelpAction.Start._tag,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const state = context.getCapability(HelpCapabilities.MutableState);\n state.showHints = true;\n await dispatch(createIntent(HelpAction.Start));\n },\n properties: {\n label: ['open help tour', { ns: HELP_PLUGIN }],\n icon: 'ph--info--regular',\n keyBinding: {\n macos: 'shift+meta+/',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'shift+ctrl+/',\n linux: 'shift+ctrl+?',\n },\n testId: 'helpPlugin.openHelp',\n },\n },\n {\n id: 'dxos.org/plugin/help/open-shortcuts',\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const state = context.getCapability(HelpCapabilities.MutableState);\n state.showHints = true;\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: SHORTCUTS_DIALOG,\n options: {\n blockAlign: 'center',\n },\n }),\n );\n },\n properties: {\n label: ['open shortcuts label', { ns: HELP_PLUGIN }],\n icon: 'ph--keyboard--regular',\n keyBinding: {\n macos: 'meta+ctrl+/',\n },\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAcC,aAAaC,cAAcC,oBAAwC;AAC1F,SAASC,uBAAuB;AAOhC,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,SAAS,CAACC,SACRC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKH,OAAO,SAASQ,OAAOE,KAAKP,KAAAA,IAAQK,OAAOG,KAAI,CAAA,GAC9EH,OAAOI,IAAI,MAAM;IACf;MACEZ,IAAIa,WAAWC,MAAMC;MACrBC,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKvB,QAAQwB,cAActB,aAAauB,gBAAgB;AACzF,cAAMC,QAAQ1B,QAAQwB,cAAcG,iBAAiBC,YAAY;AACjEF,cAAMG,YAAY;AAClB,cAAMN,SAASO,aAAaZ,WAAWC,KAAK,CAAA;MAC9C;MACAY,YAAY;QACVC,OAAO;UAAC;UAAkB;YAAEC,IAAI3B;UAAY;;QAC5C4B,MAAM;QACNC,YAAY;UACVC,OAAO;;UAEPC,SAAS;UACTC,OAAO;QACT;QACAC,QAAQ;MACV;IACF;IACA;MACElC,IAAI;MACJgB,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKvB,QAAQwB,cAActB,aAAauB,gBAAgB;AACzF,cAAMC,QAAQ1B,QAAQwB,cAAcG,iBAAiBC,YAAY;AACjEF,cAAMG,YAAY;AAClB,cAAMN,SACJO,aAAaU,aAAaC,cAAc;UACtCC,MAAM;UACNC,SAASC;UACTC,SAAS;YACPC,YAAY;UACd;QACF,CAAA,CAAA;MAEJ;MACAf,YAAY;QACVC,OAAO;UAAC;UAAwB;YAAEC,IAAI3B;UAAY;;QAClD4B,MAAM;QACNC,YAAY;UACVC,OAAO;QACT;MACF;IACF;GACD,GACDvB,OAAOkC,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
|
|
6
|
-
"names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "createIntent", "LayoutAction", "createExtension", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "HELP_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "some", "none", "map", "HelpAction", "Start", "_tag", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "state", "HelpCapabilities", "MutableState", "showHints", "createIntent", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "testId", "LayoutAction", "UpdateDialog", "part", "subject", "SHORTCUTS_DIALOG", "options", "blockAlign", "getOrElse"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { CaretLeft, CaretRight, Circle, X } from '@phosphor-icons/react';\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 } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\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 <Button\n density='fine'\n variant='primary'\n onClick={closeProps.onClick}\n title={closeProps['aria-label']}\n data-testid='helpPlugin.tooltip.close'\n >\n <X weight='bold' className={getSize(4)} />\n </Button>\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 <Button\n variant='primary'\n onClick={backProps.onClick}\n title={backProps['aria-label']}\n classNames={[!(index > 0 && backProps) && 'invisible']}\n data-testid='helpPlugin.tooltip.back'\n >\n <CaretLeft className={getSize(5)} />\n </Button>\n }\n <div className='flex grow gap-2 justify-center'>\n <div className='flex'>\n {Array.from({ length: size }).map((_, i) => (\n <Circle\n key={i}\n weight={index === i ? 'fill' : 'regular'}\n className={mx(getSize(2), '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 <Button\n variant='primary'\n onClick={primaryProps.onClick}\n title={primaryProps['aria-label']}\n autoFocus\n data-testid='helpPlugin.tooltip.next'\n >\n <CaretRight className={getSize(6)} />\n </Button>\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,SAASC,UAAUC,YAAW;AAG/CH,aAASI,KAAK,CAACC,GAAGC,MAAAA;AAChB,aAAOC,kBAAkBF,EAAEG,MAAMX,CAAAA,GAAIY,YAAAA,EAAcC,cAAcH,kBAAkBD,EAAEE,MAAMX,CAAAA,GAAIY,YAAAA,CAAAA;IACjG,CAAA;AAEA,WACE,gBAAAE,OAA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BAAa,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", "CaretLeft", "CaretRight", "Circle", "X", "React", "forwardRef", "Button", "getSize", "mx", "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", "Button", "density", "variant", "onClick", "X", "weight", "getSize", "classNames", "CaretLeft", "Array", "from", "map", "_", "i", "Circle", "key", "mx", "autoFocus", "CaretRight", "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
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\nimport { type Context, createContext } from 'react';\nimport { type Step as BaseStep } from 'react-joyride';\n\nimport { type PluginContext } from '@dxos/app-framework';\n\nimport { HELP_PLUGIN } from './meta';\n\nexport type Step = BaseStep & {\n before?: (context: PluginContext) => void;\n};\n\nexport type HelpContextType = {\n running: boolean;\n steps: Step[];\n setSteps: (steps: Step[]) => void;\n setIndex: (index: number) => void;\n start: () => void;\n stop: () => void;\n};\n\nexport const HelpContext: Context<HelpContextType> = createContext<HelpContextType>({\n running: false,\n steps: [],\n setSteps: () => {},\n setIndex: () => {},\n start: () => {},\n stop: () => {},\n});\n\nexport const HELP_ACTION = `${HELP_PLUGIN}/action`;\nexport namespace HelpAction {\n export class Start extends Schema.TaggedClass<Start>()(`${HELP_ACTION}/start`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,cAAc;AACvB,SAAuBC,qBAAqB;AAoBrC,IAAMC,cAAwCC,cAA+B;EAClFC,SAAS;EACTC,OAAO,CAAA;EACPC,UAAU,MAAA;EAAO;EACjBC,UAAU,MAAA;EAAO;EACjBC,OAAO,MAAA;EAAO;EACdC,MAAM,MAAA;EAAO;AACf,CAAA;AAEO,IAAMC,cAAc,GAAGC,WAAAA;UACbC,aAAAA;EACR,MAAMC,cAAcC,OAAOC,YAAW,EAAU,GAAGL,WAAAA,UAAqB;IAC7EM,OAAOF,OAAOG;IACdC,QAAQJ,OAAOG;EACjB,CAAA,EAAA;EAAI;cAHSJ,QAAAA;AAIf,GALiBD,eAAAA,aAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["Schema", "createContext", "HelpContext", "createContext", "running", "steps", "setSteps", "setIndex", "start", "stop", "HELP_ACTION", "HELP_PLUGIN", "HelpAction", "Start", "Schema", "TaggedClass", "input", "Void", "output"]
|
|
7
|
-
}
|
|
@@ -1,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, useCapability } from '@dxos/app-framework';\n\nimport { HelpCapabilities } from './capabilities';\nimport { WelcomeTour } from '../components';\nimport { HELP_PLUGIN } from '../meta';\nimport { type Step } from '../types';\n\nexport default (steps: Step[]) =>\n contributes(Capabilities.ReactRoot, {\n id: HELP_PLUGIN,\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,aAAaC,qBAAqB;AAOzD,IAAA,qBAAe,CAACC,UACdC,YAAYC,aAAaC,WAAW;EAClCC,IAAIC;EACJC,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", "HELP_PLUGIN", "root", "state", "useCapability", "HelpCapabilities", "MutableState", "WelcomeTour", "running", "onRunningChanged", "newState", "showHints"]
|
|
7
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
SHORTCUTS_DIALOG
|
|
4
|
-
} from "./chunk-PU7X4MJO.mjs";
|
|
5
|
-
import {
|
|
6
|
-
HelpAction
|
|
7
|
-
} from "./chunk-6JMO5FFN.mjs";
|
|
8
|
-
import {
|
|
9
|
-
HelpCapabilities
|
|
10
|
-
} from "./chunk-CXQ5LKQI.mjs";
|
|
11
|
-
import {
|
|
12
|
-
HELP_PLUGIN
|
|
13
|
-
} from "./chunk-T523OGIV.mjs";
|
|
14
|
-
|
|
15
|
-
// src/capabilities/app-graph-builder.ts
|
|
16
|
-
import { Rx } from "@effect-rx/rx-react";
|
|
17
|
-
import { Option, pipe } from "effect";
|
|
18
|
-
import { Capabilities, contributes, createIntent, LayoutAction } from "@dxos/app-framework";
|
|
19
|
-
import { createExtension } from "@dxos/app-graph";
|
|
20
|
-
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
21
|
-
id: HELP_PLUGIN,
|
|
22
|
-
actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === "root" ? Option.some(node2) : Option.none()), Option.map(() => [
|
|
23
|
-
{
|
|
24
|
-
id: HelpAction.Start._tag,
|
|
25
|
-
data: async () => {
|
|
26
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
27
|
-
const state = context.getCapability(HelpCapabilities.MutableState);
|
|
28
|
-
state.showHints = true;
|
|
29
|
-
await dispatch(createIntent(HelpAction.Start));
|
|
30
|
-
},
|
|
31
|
-
properties: {
|
|
32
|
-
label: [
|
|
33
|
-
"open help tour",
|
|
34
|
-
{
|
|
35
|
-
ns: HELP_PLUGIN
|
|
36
|
-
}
|
|
37
|
-
],
|
|
38
|
-
icon: "ph--info--regular",
|
|
39
|
-
keyBinding: {
|
|
40
|
-
macos: "shift+meta+/",
|
|
41
|
-
// TODO(wittjosiah): Test on windows to see if it behaves the same as linux.
|
|
42
|
-
windows: "shift+ctrl+/",
|
|
43
|
-
linux: "shift+ctrl+?"
|
|
44
|
-
},
|
|
45
|
-
testId: "helpPlugin.openHelp"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
id: "dxos.org/plugin/help/open-shortcuts",
|
|
50
|
-
data: async () => {
|
|
51
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
52
|
-
const state = context.getCapability(HelpCapabilities.MutableState);
|
|
53
|
-
state.showHints = true;
|
|
54
|
-
await dispatch(createIntent(LayoutAction.UpdateDialog, {
|
|
55
|
-
part: "dialog",
|
|
56
|
-
subject: SHORTCUTS_DIALOG,
|
|
57
|
-
options: {
|
|
58
|
-
blockAlign: "center"
|
|
59
|
-
}
|
|
60
|
-
}));
|
|
61
|
-
},
|
|
62
|
-
properties: {
|
|
63
|
-
label: [
|
|
64
|
-
"open shortcuts label",
|
|
65
|
-
{
|
|
66
|
-
ns: HELP_PLUGIN
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
icon: "ph--keyboard--regular",
|
|
70
|
-
keyBinding: {
|
|
71
|
-
macos: "meta+ctrl+/"
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
]), Option.getOrElse(() => [])))
|
|
76
|
-
}));
|
|
77
|
-
export {
|
|
78
|
-
app_graph_builder_default as default
|
|
79
|
-
};
|
|
80
|
-
//# sourceMappingURL=app-graph-builder-5QQRWRWG.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, contributes, createIntent, LayoutAction, type PluginContext } from '@dxos/app-framework';\nimport { createExtension } from '@dxos/app-graph';\n\nimport { HelpCapabilities } from './capabilities';\nimport { SHORTCUTS_DIALOG } from '../components';\nimport { HELP_PLUGIN } from '../meta';\nimport { HelpAction } from '../types';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: HELP_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),\n Option.map(() => [\n {\n id: HelpAction.Start._tag,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const state = context.getCapability(HelpCapabilities.MutableState);\n state.showHints = true;\n await dispatch(createIntent(HelpAction.Start));\n },\n properties: {\n label: ['open help tour', { ns: HELP_PLUGIN }],\n icon: 'ph--info--regular',\n keyBinding: {\n macos: 'shift+meta+/',\n // TODO(wittjosiah): Test on windows to see if it behaves the same as linux.\n windows: 'shift+ctrl+/',\n linux: 'shift+ctrl+?',\n },\n testId: 'helpPlugin.openHelp',\n },\n },\n {\n id: 'dxos.org/plugin/help/open-shortcuts',\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const state = context.getCapability(HelpCapabilities.MutableState);\n state.showHints = true;\n await dispatch(\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: SHORTCUTS_DIALOG,\n options: {\n blockAlign: 'center',\n },\n }),\n );\n },\n properties: {\n label: ['open shortcuts label', { ns: HELP_PLUGIN }],\n icon: 'ph--keyboard--regular',\n keyBinding: {\n macos: 'meta+ctrl+/',\n },\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAcC,aAAaC,cAAcC,oBAAwC;AAC1F,SAASC,uBAAuB;AAOhC,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,SAAS,CAACC,SACRC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKH,OAAO,SAASQ,OAAOE,KAAKP,KAAAA,IAAQK,OAAOG,KAAI,CAAA,GAC9EH,OAAOI,IAAI,MAAM;IACf;MACEZ,IAAIa,WAAWC,MAAMC;MACrBC,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKvB,QAAQwB,cAActB,aAAauB,gBAAgB;AACzF,cAAMC,QAAQ1B,QAAQwB,cAAcG,iBAAiBC,YAAY;AACjEF,cAAMG,YAAY;AAClB,cAAMN,SAASO,aAAaZ,WAAWC,KAAK,CAAA;MAC9C;MACAY,YAAY;QACVC,OAAO;UAAC;UAAkB;YAAEC,IAAI3B;UAAY;;QAC5C4B,MAAM;QACNC,YAAY;UACVC,OAAO;;UAEPC,SAAS;UACTC,OAAO;QACT;QACAC,QAAQ;MACV;IACF;IACA;MACElC,IAAI;MACJgB,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKvB,QAAQwB,cAActB,aAAauB,gBAAgB;AACzF,cAAMC,QAAQ1B,QAAQwB,cAAcG,iBAAiBC,YAAY;AACjEF,cAAMG,YAAY;AAClB,cAAMN,SACJO,aAAaU,aAAaC,cAAc;UACtCC,MAAM;UACNC,SAASC;UACTC,SAAS;YACPC,YAAY;UACd;QACF,CAAA,CAAA;MAEJ;MACAf,YAAY;QACVC,OAAO;UAAC;UAAwB;YAAEC,IAAI3B;UAAY;;QAClD4B,MAAM;QACNC,YAAY;UACVC,OAAO;QACT;MACF;IACF;GACD,GACDvB,OAAOkC,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
|
|
6
|
-
"names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "createIntent", "LayoutAction", "createExtension", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "HELP_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "some", "none", "map", "HelpAction", "Start", "_tag", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "state", "HelpCapabilities", "MutableState", "showHints", "createIntent", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "linux", "testId", "LayoutAction", "UpdateDialog", "part", "subject", "SHORTCUTS_DIALOG", "options", "blockAlign", "getOrElse"]
|
|
7
|
-
}
|