@dxos/plugin-presenter 0.8.4-main.c1de068 → 0.8.4-main.c85a9c8dae
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-5RJIT3DA.mjs +52 -0
- package/dist/lib/browser/CollectionPresenterContainer-5RJIT3DA.mjs.map +7 -0
- package/dist/lib/browser/DocumentPresenterContainer-ISD6N5FM.mjs +28 -0
- package/dist/lib/browser/DocumentPresenterContainer-ISD6N5FM.mjs.map +7 -0
- package/dist/lib/browser/MarkdownSlide-Q2XLZTMW.mjs +23 -0
- package/dist/lib/browser/MarkdownSlide-Q2XLZTMW.mjs.map +7 -0
- package/dist/lib/browser/PresenterSettings-WGQMXH4I.mjs +31 -0
- package/dist/lib/browser/PresenterSettings-WGQMXH4I.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-LNUGLW3H.mjs +113 -0
- package/dist/lib/browser/app-graph-builder-LNUGLW3H.mjs.map +7 -0
- package/dist/lib/browser/chunk-46CHA6Y5.mjs +41 -0
- package/dist/lib/browser/chunk-46CHA6Y5.mjs.map +7 -0
- package/dist/lib/browser/chunk-BHTOR7TG.mjs +485 -0
- package/dist/lib/browser/chunk-BHTOR7TG.mjs.map +7 -0
- package/dist/lib/browser/chunk-PSOOAW44.mjs +50 -0
- package/dist/lib/browser/chunk-PSOOAW44.mjs.map +7 -0
- package/dist/lib/browser/chunk-VQVZVXPJ.mjs +18 -0
- package/dist/lib/browser/chunk-VQVZVXPJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +39 -40
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-UCM2KRSP.mjs +67 -0
- package/dist/lib/browser/react-surface-UCM2KRSP.mjs.map +7 -0
- package/dist/lib/browser/settings-GIQOCH6O.mjs +32 -0
- package/dist/lib/browser/settings-GIQOCH6O.mjs.map +7 -0
- package/dist/types/src/PresenterPlugin.d.ts +2 -1
- package/dist/types/src/PresenterPlugin.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 +3 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- 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/settings/index.d.ts +7 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +10 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/components/Markdown/Container.stories.d.ts +14 -22
- package/dist/types/src/components/Markdown/Container.stories.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Slide.d.ts +1 -3
- package/dist/types/src/components/Markdown/Slide.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Slide.stories.d.ts +11 -12
- package/dist/types/src/components/Markdown/Slide.stories.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Pager.d.ts +1 -1
- package/dist/types/src/components/Presenter/Pager.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Pager.stories.d.ts +12 -4
- 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 +18 -2
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -10
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts +7 -0
- package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts.map +1 -0
- package/dist/types/src/containers/CollectionPresenterContainer/index.d.ts +3 -0
- package/dist/types/src/containers/CollectionPresenterContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts +6 -0
- package/dist/types/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts.map +1 -0
- package/dist/types/src/containers/DocumentPresenterContainer/index.d.ts +3 -0
- package/dist/types/src/containers/DocumentPresenterContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownSlide/MarkdownSlide.d.ts +8 -0
- package/dist/types/src/containers/MarkdownSlide/MarkdownSlide.d.ts.map +1 -0
- package/dist/types/src/containers/MarkdownSlide/index.d.ts +3 -0
- package/dist/types/src/containers/MarkdownSlide/index.d.ts.map +1 -0
- package/dist/types/src/containers/PresenterSettings/PresenterSettings.d.ts +8 -0
- package/dist/types/src/containers/PresenterSettings/PresenterSettings.d.ts.map +1 -0
- package/dist/types/src/containers/PresenterSettings/index.d.ts +3 -0
- package/dist/types/src/containers/PresenterSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +6 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +36 -26
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/useExitPresenter.d.ts +2 -3
- package/dist/types/src/useExitPresenter.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +49 -41
- package/src/PresenterPlugin.tsx +9 -24
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +106 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/index.ts +3 -5
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +71 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +31 -0
- package/src/components/Markdown/Container.stories.tsx +21 -20
- package/src/components/Markdown/Container.tsx +2 -2
- package/src/components/Markdown/Slide.stories.tsx +12 -8
- package/src/components/Markdown/Slide.tsx +12 -128
- package/src/components/Markdown/styles.css +104 -0
- package/src/components/Markdown/theme.ts +5 -5
- package/src/components/Markdown/typings.d.ts +8 -0
- package/src/components/Presenter/Layout.tsx +2 -2
- package/src/components/Presenter/Pager.stories.tsx +10 -10
- package/src/components/Presenter/Pager.tsx +53 -18
- package/src/components/RevealPlayer/RevealPlayer.stories.tsx +8 -6
- package/src/components/RevealPlayer/RevealPlayer.tsx +66 -59
- package/src/components/index.ts +3 -7
- package/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.tsx +43 -0
- package/src/containers/CollectionPresenterContainer/index.ts +7 -0
- package/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.tsx +23 -0
- package/src/containers/DocumentPresenterContainer/index.ts +7 -0
- package/src/containers/MarkdownSlide/MarkdownSlide.tsx +26 -0
- package/src/containers/MarkdownSlide/index.ts +7 -0
- package/src/containers/PresenterSettings/PresenterSettings.tsx +35 -0
- package/src/containers/PresenterSettings/index.ts +7 -0
- package/src/containers/index.ts +10 -0
- package/src/meta.ts +9 -6
- package/src/translations.ts +1 -0
- package/src/types.ts +19 -11
- package/src/useExitPresenter.ts +24 -24
- package/dist/lib/browser/CollectionPresenterContainer-GH4GIA6P.mjs +0 -191
- package/dist/lib/browser/CollectionPresenterContainer-GH4GIA6P.mjs.map +0 -7
- package/dist/lib/browser/DocumentPresenterContainer-E7RGK572.mjs +0 -185
- package/dist/lib/browser/DocumentPresenterContainer-E7RGK572.mjs.map +0 -7
- package/dist/lib/browser/MarkdownSlide-QHC3GZII.mjs +0 -336
- package/dist/lib/browser/MarkdownSlide-QHC3GZII.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-2ZLAWPF2.mjs +0 -77
- package/dist/lib/browser/app-graph-builder-2ZLAWPF2.mjs.map +0 -7
- package/dist/lib/browser/chunk-SW3HIRDA.mjs +0 -39
- package/dist/lib/browser/chunk-SW3HIRDA.mjs.map +0 -7
- package/dist/lib/browser/chunk-TANLITL2.mjs +0 -36
- package/dist/lib/browser/chunk-TANLITL2.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-YYPOO6XK.mjs +0 -37
- package/dist/lib/browser/chunk-YYPOO6XK.mjs.map +0 -7
- package/dist/lib/browser/react-surface-GQSVWJBG.mjs +0 -57
- package/dist/lib/browser/react-surface-GQSVWJBG.mjs.map +0 -7
- package/dist/lib/browser/settings-X7M27QCY.mjs +0 -22
- package/dist/lib/browser/settings-X7M27QCY.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/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/components/CollectionPresenterContainer.d.ts +0 -7
- package/dist/types/src/components/CollectionPresenterContainer.d.ts.map +0 -1
- package/dist/types/src/components/DocumentPresenterContainer.d.ts +0 -7
- package/dist/types/src/components/DocumentPresenterContainer.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownSlide.d.ts +0 -7
- package/dist/types/src/components/MarkdownSlide.d.ts.map +0 -1
- package/dist/types/src/components/PresenterSettings.d.ts +0 -6
- package/dist/types/src/components/PresenterSettings.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -82
- package/src/capabilities/react-surface.tsx +0 -53
- package/src/capabilities/settings.ts +0 -19
- package/src/components/CollectionPresenterContainer.tsx +0 -43
- package/src/components/DocumentPresenterContainer.tsx +0 -22
- package/src/components/MarkdownSlide.tsx +0 -24
- package/src/components/PresenterSettings.tsx +0 -26
package/package.json
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-presenter",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.c85a9c8dae",
|
|
4
4
|
"description": "Braneframe presenter plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"sideEffects": true,
|
|
10
14
|
"type": "module",
|
|
11
15
|
"exports": {
|
|
12
16
|
".": {
|
|
13
|
-
"
|
|
14
|
-
"browser": "./dist/lib/browser/index.mjs"
|
|
17
|
+
"source": "./src/index.ts",
|
|
18
|
+
"browser": "./dist/lib/browser/index.mjs",
|
|
19
|
+
"types": "./dist/types/src/index.d.ts"
|
|
15
20
|
}
|
|
16
21
|
},
|
|
17
22
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -23,58 +28,61 @@
|
|
|
23
28
|
"src"
|
|
24
29
|
],
|
|
25
30
|
"dependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
31
|
+
"@effect-atom/atom": "^0.5.1",
|
|
32
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
28
33
|
"hastscript": "^7.1.0",
|
|
29
34
|
"highlight.js": "^11.9.0",
|
|
30
35
|
"marked": "^12.0.2",
|
|
31
|
-
"react-markdown": "^
|
|
36
|
+
"react-markdown": "^10.1.0",
|
|
32
37
|
"react-resize-detector": "^11.0.1",
|
|
33
38
|
"rehype-add-classes": "^1.0.0",
|
|
34
39
|
"rehype-highlight": "^6.0.0",
|
|
35
40
|
"remark-frontmatter": "^5.0.0",
|
|
36
41
|
"remark-parse-frontmatter": "^1.0.3",
|
|
37
42
|
"reveal.js": "^5.1.0",
|
|
38
|
-
"@dxos/app-
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/plugin-
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
47
|
-
"@dxos/plugin-markdown": "0.8.4-main.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/react-ui-
|
|
43
|
+
"@dxos/app-toolkit": "0.8.4-main.c85a9c8dae",
|
|
44
|
+
"@dxos/effect": "0.8.4-main.c85a9c8dae",
|
|
45
|
+
"@dxos/app-framework": "0.8.4-main.c85a9c8dae",
|
|
46
|
+
"@dxos/echo": "0.8.4-main.c85a9c8dae",
|
|
47
|
+
"@dxos/log": "0.8.4-main.c85a9c8dae",
|
|
48
|
+
"@dxos/plugin-client": "0.8.4-main.c85a9c8dae",
|
|
49
|
+
"@dxos/plugin-deck": "0.8.4-main.c85a9c8dae",
|
|
50
|
+
"@dxos/operation": "0.8.4-main.c85a9c8dae",
|
|
51
|
+
"@dxos/plugin-graph": "0.8.4-main.c85a9c8dae",
|
|
52
|
+
"@dxos/plugin-markdown": "0.8.4-main.c85a9c8dae",
|
|
53
|
+
"@dxos/plugin-stack": "0.8.4-main.c85a9c8dae",
|
|
54
|
+
"@dxos/react-client": "0.8.4-main.c85a9c8dae",
|
|
55
|
+
"@dxos/async": "0.8.4-main.c85a9c8dae",
|
|
56
|
+
"@dxos/schema": "0.8.4-main.c85a9c8dae",
|
|
57
|
+
"@dxos/react-ui-form": "0.8.4-main.c85a9c8dae",
|
|
58
|
+
"@dxos/react-ui-stack": "0.8.4-main.c85a9c8dae",
|
|
59
|
+
"@dxos/util": "0.8.4-main.c85a9c8dae",
|
|
60
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.c85a9c8dae",
|
|
61
|
+
"@dxos/types": "0.8.4-main.c85a9c8dae"
|
|
54
62
|
},
|
|
55
63
|
"devDependencies": {
|
|
56
|
-
"@effect-
|
|
57
|
-
"@effect/platform": "0.
|
|
58
|
-
"@types/react": "~
|
|
59
|
-
"@types/react-dom": "~
|
|
64
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
65
|
+
"@effect/platform": "0.94.4",
|
|
66
|
+
"@types/react": "~19.2.7",
|
|
67
|
+
"@types/react-dom": "~19.2.3",
|
|
60
68
|
"@types/reveal.js": "^5.0.3",
|
|
61
|
-
"effect": "3.
|
|
62
|
-
"react": "~
|
|
63
|
-
"react-dom": "~
|
|
64
|
-
"vite": "
|
|
65
|
-
"@dxos/random": "0.8.4-main.
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/react-ui
|
|
68
|
-
"@dxos/
|
|
69
|
+
"effect": "3.19.16",
|
|
70
|
+
"react": "~19.2.3",
|
|
71
|
+
"react-dom": "~19.2.3",
|
|
72
|
+
"vite": "^7.1.11",
|
|
73
|
+
"@dxos/random": "0.8.4-main.c85a9c8dae",
|
|
74
|
+
"@dxos/storybook-utils": "0.8.4-main.c85a9c8dae",
|
|
75
|
+
"@dxos/react-ui": "0.8.4-main.c85a9c8dae",
|
|
76
|
+
"@dxos/ui-theme": "0.8.4-main.c85a9c8dae"
|
|
69
77
|
},
|
|
70
78
|
"peerDependencies": {
|
|
71
|
-
"@effect-
|
|
72
|
-
"@effect/platform": "
|
|
73
|
-
"effect": "
|
|
74
|
-
"react": "~
|
|
75
|
-
"react-dom": "~
|
|
76
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
77
|
-
"@dxos/
|
|
79
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
80
|
+
"@effect/platform": "0.94.4",
|
|
81
|
+
"effect": "3.19.16",
|
|
82
|
+
"react": "~19.2.3",
|
|
83
|
+
"react-dom": "~19.2.3",
|
|
84
|
+
"@dxos/react-ui": "0.8.4-main.c85a9c8dae",
|
|
85
|
+
"@dxos/ui-theme": "0.8.4-main.c85a9c8dae"
|
|
78
86
|
},
|
|
79
87
|
"publishConfig": {
|
|
80
88
|
"access": "public"
|
package/src/PresenterPlugin.tsx
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
6
7
|
|
|
7
8
|
import { AppGraphBuilder, PresenterSettings, ReactSurface } from './capabilities';
|
|
8
9
|
import { meta } from './meta';
|
|
@@ -11,26 +12,10 @@ import { translations } from './translations';
|
|
|
11
12
|
// TODO(burdon): Only scale markdown content.
|
|
12
13
|
// TODO(burdon): Map stack content; Slide content type (e.g., markdown, sketch, IPFS image, table, etc.)
|
|
13
14
|
|
|
14
|
-
export const PresenterPlugin = ()
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
defineModule({
|
|
22
|
-
id: `${meta.id}/module/translations`,
|
|
23
|
-
activatesOn: Events.SetupTranslations,
|
|
24
|
-
activate: () => contributes(Capabilities.Translations, translations),
|
|
25
|
-
}),
|
|
26
|
-
defineModule({
|
|
27
|
-
id: `${meta.id}/module/react-surface`,
|
|
28
|
-
activatesOn: Events.SetupReactSurface,
|
|
29
|
-
activate: ReactSurface,
|
|
30
|
-
}),
|
|
31
|
-
defineModule({
|
|
32
|
-
id: `${meta.id}/module/app-graph-builder`,
|
|
33
|
-
activatesOn: Events.SetupAppGraph,
|
|
34
|
-
activate: AppGraphBuilder,
|
|
35
|
-
}),
|
|
36
|
-
]);
|
|
15
|
+
export const PresenterPlugin = Plugin.define(meta).pipe(
|
|
16
|
+
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
17
|
+
AppPlugin.addSettingsModule({ activate: PresenterSettings }),
|
|
18
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
19
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
20
|
+
Plugin.make,
|
|
21
|
+
);
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
|
|
10
|
+
import { Obj } from '@dxos/echo';
|
|
11
|
+
import { Collection } from '@dxos/echo';
|
|
12
|
+
import { Operation } from '@dxos/operation';
|
|
13
|
+
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
14
|
+
import { ATTENDABLE_PATH_SEPARATOR, DeckOperation } from '@dxos/plugin-deck/types';
|
|
15
|
+
import { GraphBuilder, type Node, NodeMatcher } from '@dxos/plugin-graph';
|
|
16
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
17
|
+
|
|
18
|
+
import { meta } from '../../meta';
|
|
19
|
+
import { PresenterCapabilities, PresenterOperation } from '../../types';
|
|
20
|
+
|
|
21
|
+
/** Match nodes that can be presented (Collection or Document). */
|
|
22
|
+
const whenPresentable = (node: Node.Node) =>
|
|
23
|
+
Option.orElse(NodeMatcher.whenEchoType(Collection.Collection)(node), () =>
|
|
24
|
+
NodeMatcher.whenEchoType(Markdown.Document)(node),
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export default Capability.makeModule(
|
|
28
|
+
Effect.fnUntraced(function* () {
|
|
29
|
+
const capabilities = yield* Capability.Service;
|
|
30
|
+
|
|
31
|
+
const extensions = yield* GraphBuilder.createExtension({
|
|
32
|
+
id: `${meta.id}/root`,
|
|
33
|
+
// TODO(wittjosiah): This is a hack to work around presenter previously relying on "variant". Remove.
|
|
34
|
+
match: whenPresentable,
|
|
35
|
+
connector: (object, get) => {
|
|
36
|
+
const settingsAtom = capabilities.get(PresenterCapabilities.Settings);
|
|
37
|
+
const settings = get(settingsAtom);
|
|
38
|
+
const isPresentable = settings?.presentCollections
|
|
39
|
+
? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)
|
|
40
|
+
: Obj.instanceOf(Markdown.Document, object);
|
|
41
|
+
if (!isPresentable) {
|
|
42
|
+
return Effect.succeed([]);
|
|
43
|
+
}
|
|
44
|
+
const id = Obj.getDXN(object).toString();
|
|
45
|
+
return Effect.succeed([
|
|
46
|
+
{
|
|
47
|
+
id: [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
48
|
+
data: { type: meta.id, object },
|
|
49
|
+
type: meta.id,
|
|
50
|
+
properties: {
|
|
51
|
+
label: 'Presenter',
|
|
52
|
+
icon: 'ph--presentation--regular',
|
|
53
|
+
disposition: 'hidden',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
]);
|
|
57
|
+
},
|
|
58
|
+
actions: (object, get) => {
|
|
59
|
+
const settingsAtom = capabilities.get(PresenterCapabilities.Settings);
|
|
60
|
+
const settings = get(settingsAtom);
|
|
61
|
+
const isPresentable = settings?.presentCollections
|
|
62
|
+
? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)
|
|
63
|
+
: Obj.instanceOf(Markdown.Document, object);
|
|
64
|
+
if (!isPresentable) {
|
|
65
|
+
return Effect.succeed([]);
|
|
66
|
+
}
|
|
67
|
+
const dxn = Obj.getDXN(object);
|
|
68
|
+
const id = dxn.toString();
|
|
69
|
+
const { spaceId } = dxn.asEchoDXN()!;
|
|
70
|
+
return Effect.succeed([
|
|
71
|
+
{
|
|
72
|
+
id: `${PresenterOperation.TogglePresentation.meta.key}/${id}`,
|
|
73
|
+
// TODO(burdon): Allow function so can generate state when activated.
|
|
74
|
+
// So can set explicit fullscreen state coordinated with current presenter state.
|
|
75
|
+
data: Effect.fnUntraced(function* () {
|
|
76
|
+
const deckState = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
77
|
+
const deck = deckState.decks[deckState.activeDeck];
|
|
78
|
+
const presenterId = [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR);
|
|
79
|
+
if (!deck?.fullscreen) {
|
|
80
|
+
yield* Operation.invoke(DeckOperation.Adjust, {
|
|
81
|
+
type: 'solo--fullscreen' as const,
|
|
82
|
+
id: presenterId,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
yield* Operation.invoke(LayoutOperation.Open, {
|
|
86
|
+
subject: [presenterId],
|
|
87
|
+
workspace: spaceId,
|
|
88
|
+
});
|
|
89
|
+
}),
|
|
90
|
+
properties: {
|
|
91
|
+
label: ['toggle presentation label', { ns: meta.id }],
|
|
92
|
+
icon: 'ph--presentation--regular',
|
|
93
|
+
disposition: 'list-item',
|
|
94
|
+
keyBinding: {
|
|
95
|
+
macos: 'shift+meta+p',
|
|
96
|
+
windows: 'shift+alt+p',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
]);
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
105
|
+
}),
|
|
106
|
+
);
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
9
|
-
export const PresenterSettings = lazy(() => import('./settings'));
|
|
5
|
+
export * from './app-graph-builder';
|
|
6
|
+
export * from './react-surface';
|
|
7
|
+
export * from './settings';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface, useSettingsState } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
11
|
+
import { Obj } from '@dxos/echo';
|
|
12
|
+
import { Collection } from '@dxos/echo';
|
|
13
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
CollectionPresenterContainer,
|
|
17
|
+
DocumentPresenterContainer,
|
|
18
|
+
MarkdownSlide,
|
|
19
|
+
PresenterSettings,
|
|
20
|
+
} from '../../containers';
|
|
21
|
+
import { meta } from '../../meta';
|
|
22
|
+
import { type PresenterSettingsProps } from '../../types';
|
|
23
|
+
|
|
24
|
+
export default Capability.makeModule(() =>
|
|
25
|
+
Effect.succeed(
|
|
26
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
27
|
+
Surface.create({
|
|
28
|
+
id: `${meta.id}/document`,
|
|
29
|
+
role: 'article',
|
|
30
|
+
position: 'hoist',
|
|
31
|
+
filter: (data): data is { subject: { type: typeof meta.id; object: Markdown.Document } } =>
|
|
32
|
+
!!data.subject &&
|
|
33
|
+
typeof data.subject === 'object' &&
|
|
34
|
+
'type' in data.subject &&
|
|
35
|
+
'object' in data.subject &&
|
|
36
|
+
data.subject.type === meta.id &&
|
|
37
|
+
Obj.instanceOf(Markdown.Document, data.subject.object),
|
|
38
|
+
component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,
|
|
39
|
+
}),
|
|
40
|
+
Surface.create({
|
|
41
|
+
id: `${meta.id}/collection`,
|
|
42
|
+
role: 'article',
|
|
43
|
+
position: 'hoist',
|
|
44
|
+
filter: (data): data is { subject: { type: typeof meta.id; object: Collection.Collection } } =>
|
|
45
|
+
!!data.subject &&
|
|
46
|
+
typeof data.subject === 'object' &&
|
|
47
|
+
'type' in data.subject &&
|
|
48
|
+
'object' in data.subject &&
|
|
49
|
+
data.subject.type === meta.id &&
|
|
50
|
+
Obj.instanceOf(Collection.Collection, data.subject.object),
|
|
51
|
+
component: ({ role, data }) => <CollectionPresenterContainer role={role} subject={data.subject.object} />,
|
|
52
|
+
}),
|
|
53
|
+
Surface.create({
|
|
54
|
+
id: `${meta.id}/slide`,
|
|
55
|
+
role: 'slide',
|
|
56
|
+
filter: (data): data is { subject: Markdown.Document } => Obj.instanceOf(Markdown.Document, data.subject),
|
|
57
|
+
component: ({ data }) => <MarkdownSlide document={data.subject} />,
|
|
58
|
+
}),
|
|
59
|
+
Surface.create({
|
|
60
|
+
id: `${meta.id}/plugin-settings`,
|
|
61
|
+
role: 'article',
|
|
62
|
+
filter: (data): data is { subject: AppCapabilities.Settings } =>
|
|
63
|
+
AppCapabilities.isSettings(data.subject) && data.subject.prefix === meta.id,
|
|
64
|
+
component: ({ data: { subject } }) => {
|
|
65
|
+
const { settings, updateSettings } = useSettingsState<PresenterSettingsProps>(subject.atom);
|
|
66
|
+
return <PresenterSettings settings={settings} onSettingsChange={updateSettings} />;
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
]),
|
|
70
|
+
),
|
|
71
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
import { createKvsStore } from '@dxos/effect';
|
|
10
|
+
|
|
11
|
+
import { meta } from '../../meta';
|
|
12
|
+
import { PresenterCapabilities, PresenterSettingsSchema } from '../../types';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(() =>
|
|
15
|
+
Effect.sync(() => {
|
|
16
|
+
const settingsAtom = createKvsStore({
|
|
17
|
+
key: meta.id,
|
|
18
|
+
schema: PresenterSettingsSchema,
|
|
19
|
+
defaultValue: () => ({}),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return [
|
|
23
|
+
Capability.contributes(PresenterCapabilities.Settings, settingsAtom),
|
|
24
|
+
Capability.contributes(AppCapabilities.Settings, {
|
|
25
|
+
prefix: meta.id,
|
|
26
|
+
schema: PresenterSettingsSchema,
|
|
27
|
+
atom: settingsAtom,
|
|
28
|
+
}),
|
|
29
|
+
];
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
|
-
import { withLayout, withTheme } from '@dxos/
|
|
8
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
9
|
+
|
|
10
|
+
import { createSlide } from '../../testing';
|
|
11
11
|
|
|
12
12
|
import { Container } from './Container';
|
|
13
13
|
import { Slide, type SlideProps } from './Slide';
|
|
14
|
-
import { createSlide } from '../../testing';
|
|
15
14
|
|
|
16
15
|
const DefaultStory = ({ content = '' }: SlideProps) => {
|
|
17
16
|
return (
|
|
@@ -21,37 +20,39 @@ const DefaultStory = ({ content = '' }: SlideProps) => {
|
|
|
21
20
|
);
|
|
22
21
|
};
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
const meta = {
|
|
24
|
+
title: 'plugins/plugin-presenter/components/Container',
|
|
25
|
+
render: DefaultStory,
|
|
26
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
27
|
+
parameters: {
|
|
28
|
+
layout: 'fullscreen',
|
|
29
|
+
},
|
|
30
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
31
|
+
|
|
32
|
+
export default meta;
|
|
33
|
+
|
|
34
|
+
type Story = StoryObj<typeof meta>;
|
|
35
|
+
|
|
36
|
+
export const Default: Story = {
|
|
25
37
|
args: {
|
|
26
38
|
content: createSlide({ number: 1 }),
|
|
27
39
|
},
|
|
28
40
|
};
|
|
29
41
|
|
|
30
|
-
export const Code = {
|
|
42
|
+
export const Code: Story = {
|
|
31
43
|
args: {
|
|
32
44
|
content: createSlide({ code: true }),
|
|
33
45
|
},
|
|
34
46
|
};
|
|
35
47
|
|
|
36
|
-
export const List = {
|
|
48
|
+
export const List: Story = {
|
|
37
49
|
args: {
|
|
38
50
|
content: createSlide({ list: 3 }),
|
|
39
51
|
},
|
|
40
52
|
};
|
|
41
53
|
|
|
42
|
-
export const Ordered = {
|
|
54
|
+
export const Ordered: Story = {
|
|
43
55
|
args: {
|
|
44
56
|
content: createSlide({ ordered: 4 }),
|
|
45
57
|
},
|
|
46
58
|
};
|
|
47
|
-
|
|
48
|
-
const meta: Meta<typeof Slide> = {
|
|
49
|
-
title: 'plugins/plugin-presenter/Container',
|
|
50
|
-
render: DefaultStory,
|
|
51
|
-
decorators: [withTheme, withLayout({ fullscreen: true })],
|
|
52
|
-
parameters: {
|
|
53
|
-
layout: 'fullscreen',
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export default meta;
|
|
@@ -6,7 +6,7 @@ import React, { type PropsWithChildren, useState } from 'react';
|
|
|
6
6
|
import { useResizeDetector } from 'react-resize-detector';
|
|
7
7
|
|
|
8
8
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
9
|
-
import { mx } from '@dxos/
|
|
9
|
+
import { mx } from '@dxos/ui-theme';
|
|
10
10
|
|
|
11
11
|
export type ContainerProps = ThemedClassName<PropsWithChildren<{}>>;
|
|
12
12
|
|
|
@@ -35,7 +35,7 @@ export const Container = ({ children, classNames }: ContainerProps) => {
|
|
|
35
35
|
// TODO(burdon): Reconcile highlight colors with markdown editor.
|
|
36
36
|
// https://www.npmjs.com/package/react-markdown
|
|
37
37
|
return (
|
|
38
|
-
<div ref={containerRef} className={mx('flex grow relative overflow-hidden bg-attention', classNames)}>
|
|
38
|
+
<div ref={containerRef} className={mx('flex grow relative overflow-hidden bg-attention-surface', classNames)}>
|
|
39
39
|
<div className={mx('flex w-full h-full overflow-hidden absolute')} style={props}>
|
|
40
40
|
{width && height && children}
|
|
41
41
|
</div>
|
|
@@ -2,30 +2,34 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
8
8
|
|
|
9
|
-
import { Slide } from './Slide';
|
|
10
9
|
import { createSlide } from '../../testing';
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
import { Slide } from './Slide';
|
|
12
|
+
|
|
13
|
+
const meta = {
|
|
14
|
+
title: 'plugins/plugin-presenter/components/Slide',
|
|
14
15
|
component: Slide,
|
|
16
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
15
17
|
parameters: {
|
|
16
18
|
layout: 'fullscreen',
|
|
17
19
|
},
|
|
18
|
-
}
|
|
20
|
+
} satisfies Meta<typeof Slide>;
|
|
19
21
|
|
|
20
22
|
export default meta;
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
type Story = StoryObj<typeof meta>;
|
|
25
|
+
|
|
26
|
+
export const Default: Story = {
|
|
23
27
|
args: {
|
|
24
28
|
content: createSlide(),
|
|
25
29
|
},
|
|
26
30
|
};
|
|
27
31
|
|
|
28
|
-
export const Code = {
|
|
32
|
+
export const Code: Story = {
|
|
29
33
|
args: {
|
|
30
34
|
content: createSlide({ code: true }),
|
|
31
35
|
},
|