@dxos/plugin-presenter 0.8.4-main.e098934 → 0.8.4-main.e8ec1fe
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/{CollectionPresenterContainer-U7D57ZVN.mjs → CollectionPresenterContainer-4JFW3EKV.mjs} +31 -23
- package/dist/lib/browser/CollectionPresenterContainer-4JFW3EKV.mjs.map +7 -0
- package/dist/lib/browser/{DocumentPresenterContainer-F42V4KAL.mjs → DocumentPresenterContainer-SX32NAEH.mjs} +5 -5
- package/dist/lib/browser/{DocumentPresenterContainer-F42V4KAL.mjs.map → DocumentPresenterContainer-SX32NAEH.mjs.map} +2 -2
- package/dist/lib/browser/{MarkdownSlide-ZUPODCSC.mjs → MarkdownSlide-MEXR54L5.mjs} +5 -5
- package/dist/lib/browser/MarkdownSlide-MEXR54L5.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-5LNLRZBN.mjs → app-graph-builder-UJEKUKAP.mjs} +24 -23
- package/dist/lib/browser/app-graph-builder-UJEKUKAP.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UVGTHJUO.mjs → chunk-BJWK5GQV.mjs} +6 -4
- package/dist/lib/browser/chunk-BJWK5GQV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ENIFUI47.mjs → chunk-Q3H4KEFB.mjs} +8 -8
- package/dist/lib/browser/chunk-Q3H4KEFB.mjs.map +7 -0
- package/dist/lib/browser/chunk-TMTUZQCK.mjs +18 -0
- package/dist/lib/browser/chunk-TMTUZQCK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-W4IR3DJE.mjs → chunk-VRRPVTKA.mjs} +7 -7
- package/dist/lib/browser/chunk-VRRPVTKA.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -8
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-UAXR5ZP3.mjs → react-surface-S4T6X72R.mjs} +14 -14
- package/dist/lib/browser/react-surface-S4T6X72R.mjs.map +7 -0
- package/dist/lib/browser/{settings-VQVVDAGY.mjs → settings-57TUVRW3.mjs} +5 -5
- package/dist/lib/browser/{settings-VQVVDAGY.mjs.map → settings-57TUVRW3.mjs.map} +1 -1
- package/dist/types/src/PresenterPlugin.d.ts +1 -1
- package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/components/CollectionPresenterContainer.d.ts +2 -2
- package/dist/types/src/components/CollectionPresenterContainer.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Container.stories.d.ts +0 -1
- package/dist/types/src/components/Markdown/Container.stories.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Slide.stories.d.ts +1 -1
- package/dist/types/src/components/Markdown/Slide.stories.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Pager.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Pager.stories.d.ts +0 -1
- package/dist/types/src/components/Presenter/Pager.stories.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +8 -6
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +4 -3
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/useExitPresenter.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +37 -36
- package/src/PresenterPlugin.tsx +22 -23
- package/src/capabilities/app-graph-builder.ts +21 -20
- package/src/capabilities/react-surface.tsx +12 -12
- package/src/components/CollectionPresenterContainer.tsx +3 -3
- package/src/components/Markdown/Container.stories.tsx +2 -4
- package/src/components/Markdown/Container.tsx +1 -1
- package/src/components/Markdown/Slide.stories.tsx +3 -2
- package/src/components/Markdown/theme.ts +2 -2
- package/src/components/Presenter/Pager.stories.tsx +1 -3
- package/src/components/Presenter/Pager.tsx +51 -16
- package/src/components/PresenterSettings.tsx +3 -3
- package/src/components/RevealPlayer/RevealPlayer.stories.tsx +3 -2
- package/src/components/RevealPlayer/RevealPlayer.tsx +11 -4
- package/src/meta.ts +7 -4
- package/src/types.ts +5 -5
- package/src/useExitPresenter.ts +5 -3
- package/dist/lib/browser/CollectionPresenterContainer-U7D57ZVN.mjs.map +0 -7
- package/dist/lib/browser/MarkdownSlide-ZUPODCSC.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-5LNLRZBN.mjs.map +0 -7
- package/dist/lib/browser/chunk-ENIFUI47.mjs.map +0 -7
- package/dist/lib/browser/chunk-UVGTHJUO.mjs.map +0 -7
- package/dist/lib/browser/chunk-VSD5LSE5.mjs +0 -15
- package/dist/lib/browser/chunk-VSD5LSE5.mjs.map +0 -7
- package/dist/lib/browser/chunk-W4IR3DJE.mjs.map +0 -7
- package/dist/lib/browser/react-surface-UAXR5ZP3.mjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-presenter",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.e8ec1fe",
|
|
4
4
|
"description": "Braneframe presenter plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -25,57 +25,58 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@preact-signals/safe-react": "^0.9.0",
|
|
28
|
-
"@preact/signals-core": "^1.
|
|
28
|
+
"@preact/signals-core": "^1.12.1",
|
|
29
29
|
"hastscript": "^7.1.0",
|
|
30
30
|
"highlight.js": "^11.9.0",
|
|
31
31
|
"marked": "^12.0.2",
|
|
32
|
-
"react-markdown": "^
|
|
32
|
+
"react-markdown": "^10.1.0",
|
|
33
33
|
"react-resize-detector": "^11.0.1",
|
|
34
34
|
"rehype-add-classes": "^1.0.0",
|
|
35
35
|
"rehype-highlight": "^6.0.0",
|
|
36
36
|
"remark-frontmatter": "^5.0.0",
|
|
37
37
|
"remark-parse-frontmatter": "^1.0.3",
|
|
38
38
|
"reveal.js": "^5.1.0",
|
|
39
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
40
|
-
"@dxos/async": "0.8.4-main.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/echo
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/plugin-deck": "0.8.4-main.
|
|
47
|
-
"@dxos/plugin-
|
|
48
|
-
"@dxos/plugin-
|
|
49
|
-
"@dxos/plugin-
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/react-client": "0.8.4-main.
|
|
52
|
-
"@dxos/react-ui-
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/schema": "0.8.4-main.
|
|
39
|
+
"@dxos/app-framework": "0.8.4-main.e8ec1fe",
|
|
40
|
+
"@dxos/async": "0.8.4-main.e8ec1fe",
|
|
41
|
+
"@dxos/live-object": "0.8.4-main.e8ec1fe",
|
|
42
|
+
"@dxos/echo": "0.8.4-main.e8ec1fe",
|
|
43
|
+
"@dxos/local-storage": "0.8.4-main.e8ec1fe",
|
|
44
|
+
"@dxos/log": "0.8.4-main.e8ec1fe",
|
|
45
|
+
"@dxos/plugin-client": "0.8.4-main.e8ec1fe",
|
|
46
|
+
"@dxos/plugin-deck": "0.8.4-main.e8ec1fe",
|
|
47
|
+
"@dxos/plugin-markdown": "0.8.4-main.e8ec1fe",
|
|
48
|
+
"@dxos/plugin-graph": "0.8.4-main.e8ec1fe",
|
|
49
|
+
"@dxos/plugin-stack": "0.8.4-main.e8ec1fe",
|
|
50
|
+
"@dxos/react-ui-form": "0.8.4-main.e8ec1fe",
|
|
51
|
+
"@dxos/react-client": "0.8.4-main.e8ec1fe",
|
|
52
|
+
"@dxos/react-ui-stack": "0.8.4-main.e8ec1fe",
|
|
53
|
+
"@dxos/types": "0.8.4-main.e8ec1fe",
|
|
54
|
+
"@dxos/schema": "0.8.4-main.e8ec1fe",
|
|
55
|
+
"@dxos/util": "0.8.4-main.e8ec1fe"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
|
-
"@effect-
|
|
58
|
-
"@effect/platform": "0.
|
|
59
|
-
"@types/react": "~
|
|
60
|
-
"@types/react-dom": "~
|
|
58
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
59
|
+
"@effect/platform": "0.92.1",
|
|
60
|
+
"@types/react": "~19.2.2",
|
|
61
|
+
"@types/react-dom": "~19.2.2",
|
|
61
62
|
"@types/reveal.js": "^5.0.3",
|
|
62
|
-
"effect": "3.
|
|
63
|
-
"react": "~
|
|
64
|
-
"react-dom": "~
|
|
65
|
-
"vite": "7.1.
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
69
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
63
|
+
"effect": "3.18.3",
|
|
64
|
+
"react": "~19.2.0",
|
|
65
|
+
"react-dom": "~19.2.0",
|
|
66
|
+
"vite": "7.1.9",
|
|
67
|
+
"@dxos/random": "0.8.4-main.e8ec1fe",
|
|
68
|
+
"@dxos/react-ui": "0.8.4-main.e8ec1fe",
|
|
69
|
+
"@dxos/react-ui-theme": "0.8.4-main.e8ec1fe",
|
|
70
|
+
"@dxos/storybook-utils": "0.8.4-main.e8ec1fe"
|
|
70
71
|
},
|
|
71
72
|
"peerDependencies": {
|
|
72
|
-
"@effect-
|
|
73
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
73
74
|
"@effect/platform": "^0.80.12",
|
|
74
75
|
"effect": "^3.13.3",
|
|
75
|
-
"react": "
|
|
76
|
-
"react-dom": "
|
|
77
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
78
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
76
|
+
"react": "^19.0.0",
|
|
77
|
+
"react-dom": "^19.0.0",
|
|
78
|
+
"@dxos/react-ui": "0.8.4-main.e8ec1fe",
|
|
79
|
+
"@dxos/react-ui-theme": "0.8.4-main.e8ec1fe"
|
|
79
80
|
},
|
|
80
81
|
"publishConfig": {
|
|
81
82
|
"access": "public"
|
package/src/PresenterPlugin.tsx
CHANGED
|
@@ -11,26 +11,25 @@ import { translations } from './translations';
|
|
|
11
11
|
// TODO(burdon): Only scale markdown content.
|
|
12
12
|
// TODO(burdon): Map stack content; Slide content type (e.g., markdown, sketch, IPFS image, table, etc.)
|
|
13
13
|
|
|
14
|
-
export const PresenterPlugin = () =>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
]);
|
|
14
|
+
export const PresenterPlugin = definePlugin(meta, () => [
|
|
15
|
+
defineModule({
|
|
16
|
+
id: `${meta.id}/module/settings`,
|
|
17
|
+
activatesOn: Events.SetupSettings,
|
|
18
|
+
activate: PresenterSettings,
|
|
19
|
+
}),
|
|
20
|
+
defineModule({
|
|
21
|
+
id: `${meta.id}/module/translations`,
|
|
22
|
+
activatesOn: Events.SetupTranslations,
|
|
23
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
24
|
+
}),
|
|
25
|
+
defineModule({
|
|
26
|
+
id: `${meta.id}/module/react-surface`,
|
|
27
|
+
activatesOn: Events.SetupReactSurface,
|
|
28
|
+
activate: ReactSurface,
|
|
29
|
+
}),
|
|
30
|
+
defineModule({
|
|
31
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
32
|
+
activatesOn: Events.SetupAppGraph,
|
|
33
|
+
activate: AppGraphBuilder,
|
|
34
|
+
}),
|
|
35
|
+
]);
|
|
@@ -2,48 +2,49 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
7
8
|
|
|
8
9
|
import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
|
|
9
10
|
import { Obj } from '@dxos/echo';
|
|
10
11
|
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
11
12
|
import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
|
|
12
|
-
import {
|
|
13
|
+
import { atomFromSignal, createExtension } from '@dxos/plugin-graph';
|
|
13
14
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
15
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
16
|
+
import { Collection } from '@dxos/schema';
|
|
16
17
|
|
|
17
|
-
import {
|
|
18
|
+
import { meta } from '../meta';
|
|
18
19
|
import { PresenterAction, type PresenterSettingsProps } from '../types';
|
|
19
20
|
|
|
20
21
|
export default (context: PluginContext) =>
|
|
21
22
|
contributes(
|
|
22
23
|
Capabilities.AppGraphBuilder,
|
|
23
24
|
createExtension({
|
|
24
|
-
id:
|
|
25
|
+
id: `${meta.id}/root`,
|
|
25
26
|
// TODO(wittjosiah): This is a hack to work around presenter previously relying on "variant". Remove.
|
|
26
27
|
connector: (node) =>
|
|
27
|
-
|
|
28
|
-
pipe(
|
|
28
|
+
Atom.make((get) =>
|
|
29
|
+
Function.pipe(
|
|
29
30
|
get(node),
|
|
30
31
|
Option.flatMap((node) => {
|
|
31
32
|
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
32
33
|
const settings = get(
|
|
33
|
-
|
|
34
|
+
atomFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value),
|
|
34
35
|
);
|
|
35
36
|
const isPresentable = settings?.presentCollections
|
|
36
|
-
? Obj.instanceOf(
|
|
37
|
+
? Obj.instanceOf(Collection.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
|
|
37
38
|
: Obj.instanceOf(Markdown.Document, node.data);
|
|
38
39
|
return isPresentable ? Option.some(node.data) : Option.none();
|
|
39
40
|
}),
|
|
40
41
|
Option.map((object) => {
|
|
41
|
-
const id =
|
|
42
|
+
const id = Obj.getDXN(object).toString();
|
|
42
43
|
return [
|
|
43
44
|
{
|
|
44
45
|
id: [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
45
|
-
data: { type:
|
|
46
|
-
type:
|
|
46
|
+
data: { type: meta.id, object },
|
|
47
|
+
type: meta.id,
|
|
47
48
|
properties: {
|
|
48
49
|
label: 'Presenter',
|
|
49
50
|
icon: 'ph--presentation--regular',
|
|
@@ -56,21 +57,21 @@ export default (context: PluginContext) =>
|
|
|
56
57
|
),
|
|
57
58
|
),
|
|
58
59
|
actions: (node) =>
|
|
59
|
-
|
|
60
|
-
pipe(
|
|
60
|
+
Atom.make((get) =>
|
|
61
|
+
Function.pipe(
|
|
61
62
|
get(node),
|
|
62
63
|
Option.flatMap((node) => {
|
|
63
64
|
const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
|
|
64
65
|
const settings = get(
|
|
65
|
-
|
|
66
|
+
atomFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value),
|
|
66
67
|
);
|
|
67
68
|
const isPresentable = settings?.presentCollections
|
|
68
|
-
? Obj.instanceOf(
|
|
69
|
+
? Obj.instanceOf(Collection.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
|
|
69
70
|
: Obj.instanceOf(Markdown.Document, node.data);
|
|
70
71
|
return isPresentable ? Option.some(node.data) : Option.none();
|
|
71
72
|
}),
|
|
72
73
|
Option.map((object) => {
|
|
73
|
-
const id =
|
|
74
|
+
const id = Obj.getDXN(object).toString();
|
|
74
75
|
const spaceId = getSpace(object)?.id;
|
|
75
76
|
return [
|
|
76
77
|
{
|
|
@@ -98,7 +99,7 @@ export default (context: PluginContext) =>
|
|
|
98
99
|
);
|
|
99
100
|
},
|
|
100
101
|
properties: {
|
|
101
|
-
label: ['toggle presentation label', { ns:
|
|
102
|
+
label: ['toggle presentation label', { ns: meta.id }],
|
|
102
103
|
icon: 'ph--presentation--regular',
|
|
103
104
|
disposition: 'list-item',
|
|
104
105
|
keyBinding: {
|
|
@@ -8,7 +8,7 @@ import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
9
|
import { SettingsStore } from '@dxos/local-storage';
|
|
10
10
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
|
-
import {
|
|
11
|
+
import { Collection } from '@dxos/schema';
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
CollectionPresenterContainer,
|
|
@@ -16,48 +16,48 @@ import {
|
|
|
16
16
|
MarkdownSlide,
|
|
17
17
|
PresenterSettings,
|
|
18
18
|
} from '../components';
|
|
19
|
-
import {
|
|
19
|
+
import { meta } from '../meta';
|
|
20
20
|
import { type PresenterSettingsProps } from '../types';
|
|
21
21
|
|
|
22
22
|
export default () =>
|
|
23
23
|
contributes(Capabilities.ReactSurface, [
|
|
24
24
|
createSurface({
|
|
25
|
-
id: `${
|
|
25
|
+
id: `${meta.id}/document`,
|
|
26
26
|
role: 'article',
|
|
27
27
|
position: 'hoist',
|
|
28
|
-
filter: (data): data is { subject: { type: typeof
|
|
28
|
+
filter: (data): data is { subject: { type: typeof meta.id; object: Markdown.Document } } =>
|
|
29
29
|
!!data.subject &&
|
|
30
30
|
typeof data.subject === 'object' &&
|
|
31
31
|
'type' in data.subject &&
|
|
32
32
|
'object' in data.subject &&
|
|
33
|
-
data.subject.type ===
|
|
33
|
+
data.subject.type === meta.id &&
|
|
34
34
|
Obj.instanceOf(Markdown.Document, data.subject.object),
|
|
35
35
|
component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,
|
|
36
36
|
}),
|
|
37
37
|
createSurface({
|
|
38
|
-
id: `${
|
|
38
|
+
id: `${meta.id}/collection`,
|
|
39
39
|
role: 'article',
|
|
40
40
|
position: 'hoist',
|
|
41
|
-
filter: (data): data is { subject: { type: typeof
|
|
41
|
+
filter: (data): data is { subject: { type: typeof meta.id; object: Collection.Collection } } =>
|
|
42
42
|
!!data.subject &&
|
|
43
43
|
typeof data.subject === 'object' &&
|
|
44
44
|
'type' in data.subject &&
|
|
45
45
|
'object' in data.subject &&
|
|
46
|
-
data.subject.type ===
|
|
47
|
-
Obj.instanceOf(
|
|
46
|
+
data.subject.type === meta.id &&
|
|
47
|
+
Obj.instanceOf(Collection.Collection, data.subject.object),
|
|
48
48
|
component: ({ data }) => <CollectionPresenterContainer collection={data.subject.object} />,
|
|
49
49
|
}),
|
|
50
50
|
createSurface({
|
|
51
|
-
id: `${
|
|
51
|
+
id: `${meta.id}/slide`,
|
|
52
52
|
role: 'slide',
|
|
53
53
|
filter: (data): data is { subject: Markdown.Document } => Obj.instanceOf(Markdown.Document, data.subject),
|
|
54
54
|
component: ({ data }) => <MarkdownSlide document={data.subject} />,
|
|
55
55
|
}),
|
|
56
56
|
createSurface({
|
|
57
|
-
id: `${
|
|
57
|
+
id: `${meta.id}/plugin-settings`,
|
|
58
58
|
role: 'article',
|
|
59
59
|
filter: (data): data is { subject: SettingsStore<PresenterSettingsProps> } =>
|
|
60
|
-
data.subject instanceof SettingsStore && data.subject.prefix ===
|
|
60
|
+
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
61
61
|
component: ({ data: { subject } }) => <PresenterSettings settings={subject.value} />,
|
|
62
62
|
}),
|
|
63
63
|
]);
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type FC, useContext, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface } from '@dxos/app-framework';
|
|
7
|
+
import { Surface } from '@dxos/app-framework/react';
|
|
8
8
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
9
|
-
import { type
|
|
9
|
+
import { type Collection } from '@dxos/schema';
|
|
10
10
|
|
|
11
11
|
import { PresenterContext } from '../types';
|
|
12
12
|
import { useExitPresenter } from '../useExitPresenter';
|
|
13
13
|
|
|
14
14
|
import { Layout, PageNumber, Pager } from './Presenter';
|
|
15
15
|
|
|
16
|
-
const CollectionPresenterContainer: FC<{ collection:
|
|
16
|
+
const CollectionPresenterContainer: FC<{ collection: Collection.Collection }> = ({ collection }) => {
|
|
17
17
|
const [slide, setSlide] = useState(0);
|
|
18
18
|
|
|
19
19
|
const { running } = useContext(PresenterContext);
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
|
-
import {
|
|
8
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
11
9
|
|
|
12
10
|
import { createSlide } from '../../testing';
|
|
13
11
|
|
|
@@ -25,7 +23,7 @@ const DefaultStory = ({ content = '' }: SlideProps) => {
|
|
|
25
23
|
const meta = {
|
|
26
24
|
title: 'plugins/plugin-presenter/Container',
|
|
27
25
|
render: DefaultStory,
|
|
28
|
-
decorators: [withTheme
|
|
26
|
+
decorators: [withTheme],
|
|
29
27
|
parameters: {
|
|
30
28
|
layout: 'fullscreen',
|
|
31
29
|
},
|
|
@@ -36,7 +36,7 @@ export const Container = ({ children, classNames }: ContainerProps) => {
|
|
|
36
36
|
// https://www.npmjs.com/package/react-markdown
|
|
37
37
|
return (
|
|
38
38
|
<div ref={containerRef} className={mx('flex grow relative overflow-hidden bg-attention', classNames)}>
|
|
39
|
-
<div className={mx('flex
|
|
39
|
+
<div className={mx('flex is-full bs-full overflow-hidden absolute')} style={props}>
|
|
40
40
|
{width && height && children}
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
|
|
7
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
8
|
+
|
|
9
9
|
import { createSlide } from '../../testing';
|
|
10
10
|
|
|
11
11
|
import { Slide } from './Slide';
|
|
@@ -13,6 +13,7 @@ import { Slide } from './Slide';
|
|
|
13
13
|
const meta = {
|
|
14
14
|
title: 'plugins/plugin-presenter/Slide',
|
|
15
15
|
component: Slide,
|
|
16
|
+
decorators: [withTheme],
|
|
16
17
|
parameters: {
|
|
17
18
|
layout: 'fullscreen',
|
|
18
19
|
},
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
export const theme = {
|
|
8
8
|
root: 'bg-attention leading-relaxed font-mono',
|
|
9
9
|
|
|
10
|
-
padding: '
|
|
10
|
+
padding: 'pli-40 plb-16 gap-8',
|
|
11
11
|
|
|
12
12
|
nodes: {
|
|
13
13
|
h1: 'text-[80px] text-accentText',
|
|
@@ -20,7 +20,7 @@ export const theme = {
|
|
|
20
20
|
ol: 'my-[16px] ml-24 leading-relaxed list-decimal',
|
|
21
21
|
li: 'pl-6 text-[48px]',
|
|
22
22
|
|
|
23
|
-
pre: '
|
|
23
|
+
pre: 'is-full mx-0 my-[32px] p-0 __border-l-[16px] bg-inputSurface p-4 __whitespace-pre-line',
|
|
24
24
|
code: 'p-0 text-[40px]',
|
|
25
25
|
},
|
|
26
26
|
};
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useState } from 'react';
|
|
9
7
|
|
|
10
|
-
import { withTheme } from '@dxos/
|
|
8
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
11
9
|
|
|
12
10
|
import { PageNumber, Pager, type PagerProps, StartButton } from './Pager';
|
|
13
11
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useEffect } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { IconButton, useControlledState } from '@dxos/react-ui';
|
|
8
8
|
|
|
9
9
|
export type PagerProps = {
|
|
10
10
|
index?: number;
|
|
@@ -76,18 +76,46 @@ export const Pager = ({ index: indexParam = 0, count = 0, keys, onChange, onExit
|
|
|
76
76
|
|
|
77
77
|
return (
|
|
78
78
|
<div className='flex items-center text-neutral-500'>
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
79
|
+
<IconButton
|
|
80
|
+
icon='ph--caret-double-left--regular'
|
|
81
|
+
size={6}
|
|
82
|
+
label='Jump to first'
|
|
83
|
+
iconOnly
|
|
84
|
+
noTooltip
|
|
85
|
+
variant='ghost'
|
|
86
|
+
classNames='p-0'
|
|
87
|
+
onClick={() => onChange?.(0)}
|
|
88
|
+
/>
|
|
89
|
+
<IconButton
|
|
90
|
+
icon='ph--caret-left--regular'
|
|
91
|
+
size={6}
|
|
92
|
+
label='Previous'
|
|
93
|
+
iconOnly
|
|
94
|
+
noTooltip
|
|
95
|
+
variant='ghost'
|
|
96
|
+
classNames='p-0'
|
|
97
|
+
onClick={() => handleChangeIndex(-1)}
|
|
98
|
+
/>
|
|
99
|
+
<IconButton
|
|
100
|
+
icon='ph--caret-right--regular'
|
|
101
|
+
size={6}
|
|
102
|
+
label='Next'
|
|
103
|
+
iconOnly
|
|
104
|
+
noTooltip
|
|
105
|
+
variant='ghost'
|
|
106
|
+
classNames='p-0'
|
|
107
|
+
onClick={() => handleChangeIndex(1)}
|
|
108
|
+
/>
|
|
109
|
+
<IconButton
|
|
110
|
+
icon='ph--caret-double-right--regular'
|
|
111
|
+
size={6}
|
|
112
|
+
label='Jump to last'
|
|
113
|
+
iconOnly
|
|
114
|
+
noTooltip
|
|
115
|
+
variant='ghost'
|
|
116
|
+
classNames='p-0'
|
|
117
|
+
onClick={() => onChange?.(count - 1)}
|
|
118
|
+
/>
|
|
91
119
|
</div>
|
|
92
120
|
);
|
|
93
121
|
};
|
|
@@ -113,8 +141,15 @@ export const PageNumber = ({ index = 0, count = 1 }: PageNumberProps) => {
|
|
|
113
141
|
|
|
114
142
|
export const StartButton = ({ running, onClick }: { running?: boolean; onClick?: (start: boolean) => void }) => {
|
|
115
143
|
return (
|
|
116
|
-
<
|
|
117
|
-
{
|
|
118
|
-
|
|
144
|
+
<IconButton
|
|
145
|
+
icon={running ? 'ph--x--regular' : 'ph--play--regular'}
|
|
146
|
+
size={6}
|
|
147
|
+
label={running ? 'Stop' : 'Play'}
|
|
148
|
+
iconOnly
|
|
149
|
+
noTooltip
|
|
150
|
+
variant='ghost'
|
|
151
|
+
classNames='p-0'
|
|
152
|
+
onClick={() => onClick?.(!running)}
|
|
153
|
+
/>
|
|
119
154
|
);
|
|
120
155
|
};
|
|
@@ -7,15 +7,15 @@ import React from 'react';
|
|
|
7
7
|
import { Input, useTranslation } from '@dxos/react-ui';
|
|
8
8
|
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../meta';
|
|
11
11
|
import { type PresenterSettingsProps } from '../types';
|
|
12
12
|
|
|
13
13
|
export const PresenterSettings = ({ settings }: { settings: PresenterSettingsProps }) => {
|
|
14
|
-
const { t } = useTranslation(
|
|
14
|
+
const { t } = useTranslation(meta.id);
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
17
|
<ControlPage>
|
|
18
|
-
<ControlSection title={t('settings title', { ns:
|
|
18
|
+
<ControlSection title={t('settings title', { ns: meta.id })}>
|
|
19
19
|
<ControlGroup>
|
|
20
20
|
<ControlItemInput title={t('present collections label')}>
|
|
21
21
|
<Input.Switch
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta } from '@storybook/react-vite';
|
|
8
6
|
|
|
7
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
8
|
+
|
|
9
9
|
import CONTENT from '../../../testing/deck.md?raw';
|
|
10
10
|
import { translations } from '../../translations';
|
|
11
11
|
|
|
@@ -22,6 +22,7 @@ import { RevealPlayer } from './RevealPlayer';
|
|
|
22
22
|
const meta = {
|
|
23
23
|
title: 'plugins/plugin-presenter/RevealPlayer',
|
|
24
24
|
component: RevealPlayer,
|
|
25
|
+
decorators: [withTheme],
|
|
25
26
|
parameters: {
|
|
26
27
|
layout: 'fullscreen',
|
|
27
28
|
translations,
|
|
@@ -142,11 +142,18 @@ export const RevealPlayer = ({ classNames, content, slide, fullscreen = true, on
|
|
|
142
142
|
};
|
|
143
143
|
});
|
|
144
144
|
|
|
145
|
+
// TOOD(burdon): Trap cursor keys (otherwise tabster grabs focus.)
|
|
145
146
|
return (
|
|
146
|
-
<div
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
<div
|
|
148
|
+
className={mx(
|
|
149
|
+
'grid place-items-center is-full bs-full overflow-hidden bg-black',
|
|
150
|
+
fullscreen && 'absolute inset-0',
|
|
151
|
+
classNames,
|
|
152
|
+
)}
|
|
153
|
+
>
|
|
154
|
+
<div className='relative aspect-video is-full bs-full bs-auto max-bs-full overflow-hidden'>
|
|
155
|
+
<div ref={deckDivRef} className='absolute inset-0 reveal'>
|
|
156
|
+
{/* NOTE: Must be in head. */}
|
|
150
157
|
<style>
|
|
151
158
|
<link rel='preconnect' href='https://fonts.googleapis.com' />
|
|
152
159
|
<link rel='preconnect' href='https://fonts.gstatic.com' {...{ crossOrigin: '' }} />
|
package/src/meta.ts
CHANGED
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
export const PRESENTER_PLUGIN = 'dxos.org/plugin/presenter';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
8
7
|
|
|
9
8
|
export const meta: PluginMeta = {
|
|
10
|
-
id:
|
|
9
|
+
id: 'dxos.org/plugin/presenter',
|
|
11
10
|
name: 'Presenter',
|
|
12
|
-
description:
|
|
11
|
+
description: trim`
|
|
12
|
+
Transform markdown documents into interactive presentation slideshows.
|
|
13
|
+
Navigate between slides with keyboard controls and present content in full-screen mode.
|
|
14
|
+
`,
|
|
13
15
|
icon: 'ph--presentation--regular',
|
|
16
|
+
iconHue: 'indigo',
|
|
14
17
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-presenter',
|
|
15
18
|
};
|
package/src/types.ts
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
import { type Context, createContext } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
9
|
-
import {
|
|
9
|
+
import { Collection } from '@dxos/schema';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { meta } from './meta';
|
|
12
12
|
|
|
13
13
|
export namespace PresenterAction {
|
|
14
|
-
const PRESENTER_ACTION = `${
|
|
14
|
+
const PRESENTER_ACTION = `${meta.id}/action`;
|
|
15
15
|
|
|
16
16
|
export class TogglePresentation extends Schema.TaggedClass<TogglePresentation>()(
|
|
17
17
|
`${PRESENTER_ACTION}/toggle-presentation`,
|
|
18
18
|
{
|
|
19
19
|
input: Schema.Struct({
|
|
20
|
-
object: Schema.Union(Markdown.Document,
|
|
20
|
+
object: Schema.Union(Markdown.Document, Collection.Collection),
|
|
21
21
|
state: Schema.optional(Schema.Boolean),
|
|
22
22
|
}),
|
|
23
23
|
output: Schema.Void,
|