@dxos/plugin-presenter 0.8.4-main.9735255 → 0.8.4-main.abd8ff62ef
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/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +18 -50
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +30 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +19 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/types/src/PresenterPlugin.d.ts +1 -0
- package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
- package/dist/types/src/PresenterPlugin.node.d.ts +4 -0
- package/dist/types/src/PresenterPlugin.node.d.ts.map +1 -0
- package/dist/types/src/PresenterPlugin.test.d.ts +2 -0
- package/dist/types/src/PresenterPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +4 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +7 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/components/Markdown/Panel.d.ts +8 -0
- package/dist/types/src/components/Markdown/Panel.d.ts.map +1 -0
- package/dist/types/src/components/Markdown/{Container.stories.d.ts → Panel.stories.d.ts} +1 -1
- package/dist/types/src/components/Markdown/Panel.stories.d.ts.map +1 -0
- package/dist/types/src/components/Markdown/Slide.d.ts +1 -1
- package/dist/types/src/components/Markdown/Slide.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Slide.stories.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/index.d.ts +1 -1
- package/dist/types/src/components/Markdown/index.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/theme.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Layout.d.ts +5 -5
- package/dist/types/src/components/Presenter/Layout.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.map +1 -1
- package/dist/types/src/components/PresenterSettings/PresenterSettings.d.ts +6 -0
- package/dist/types/src/components/PresenterSettings/PresenterSettings.d.ts.map +1 -0
- package/dist/types/src/components/PresenterSettings/PresenterSettings.stories.d.ts +23 -0
- package/dist/types/src/components/PresenterSettings/PresenterSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/PresenterSettings/index.d.ts +2 -0
- package/dist/types/src/components/PresenterSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts +5 -4
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +7 -6
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -28
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts +6 -0
- package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts.map +1 -0
- package/dist/types/src/containers/CollectionPresenterContainer/index.d.ts +2 -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 +2 -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 +2 -0
- package/dist/types/src/containers/MarkdownSlide/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +5 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +17 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +2 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -6
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +7 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +15 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/useExitPresenter.d.ts +1 -1
- package/dist/types/src/useExitPresenter.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +64 -38
- package/src/PresenterPlugin.node.ts +16 -0
- package/src/PresenterPlugin.test.ts +23 -0
- package/src/PresenterPlugin.tsx +11 -8
- package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +27 -28
- package/src/capabilities/index.ts +5 -3
- package/src/capabilities/react-surface.tsx +68 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +7 -6
- package/src/components/Markdown/{Container.stories.tsx → Panel.stories.tsx} +7 -7
- package/src/components/Markdown/{Container.tsx → Panel.tsx} +5 -5
- package/src/components/Markdown/Slide.stories.tsx +4 -4
- package/src/components/Markdown/Slide.tsx +2 -2
- package/src/components/Markdown/index.ts +1 -1
- package/src/components/Markdown/theme.ts +6 -6
- package/src/components/Presenter/Layout.tsx +24 -23
- package/src/components/Presenter/Pager.stories.tsx +2 -2
- package/src/components/PresenterSettings/PresenterSettings.stories.tsx +32 -0
- package/src/components/PresenterSettings/PresenterSettings.tsx +31 -0
- package/src/components/PresenterSettings/index.ts +5 -0
- package/src/components/RevealPlayer/RevealPlayer.stories.tsx +5 -5
- package/src/components/RevealPlayer/RevealPlayer.tsx +104 -105
- package/src/components/index.ts +5 -5
- package/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.tsx +50 -0
- package/src/containers/CollectionPresenterContainer/index.ts +5 -0
- package/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.tsx +24 -0
- package/src/containers/DocumentPresenterContainer/index.ts +5 -0
- package/src/{components → containers/MarkdownSlide}/MarkdownSlide.tsx +4 -6
- package/src/containers/MarkdownSlide/index.ts +5 -0
- package/src/containers/index.ts +9 -0
- package/src/index.ts +5 -2
- package/src/meta.ts +1 -1
- package/src/operations/definitions.ts +23 -0
- package/src/operations/index.ts +5 -0
- package/src/testing.ts +6 -6
- package/src/translations.ts +4 -5
- package/src/types/Settings.ts +20 -0
- package/src/types/index.ts +30 -0
- package/src/useExitPresenter.ts +11 -9
- package/dist/lib/browser/CollectionPresenterContainer-IHDZWP3U.mjs +0 -176
- package/dist/lib/browser/CollectionPresenterContainer-IHDZWP3U.mjs.map +0 -7
- package/dist/lib/browser/DocumentPresenterContainer-74M6XAAI.mjs +0 -173
- package/dist/lib/browser/DocumentPresenterContainer-74M6XAAI.mjs.map +0 -7
- package/dist/lib/browser/MarkdownSlide-GIYJABHE.mjs +0 -200
- package/dist/lib/browser/MarkdownSlide-GIYJABHE.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-2QAQR34J.mjs +0 -112
- package/dist/lib/browser/app-graph-builder-2QAQR34J.mjs.map +0 -7
- package/dist/lib/browser/chunk-4PZXJXBO.mjs +0 -50
- package/dist/lib/browser/chunk-4PZXJXBO.mjs.map +0 -7
- package/dist/lib/browser/chunk-5MC4V23G.mjs +0 -38
- package/dist/lib/browser/chunk-5MC4V23G.mjs.map +0 -7
- package/dist/lib/browser/chunk-GM4KOXJY.mjs +0 -41
- package/dist/lib/browser/chunk-GM4KOXJY.mjs.map +0 -7
- package/dist/lib/browser/chunk-VQVZVXPJ.mjs +0 -18
- package/dist/lib/browser/chunk-VQVZVXPJ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-2VP2M4Z7.mjs +0 -63
- package/dist/lib/browser/react-surface-2VP2M4Z7.mjs.map +0 -7
- package/dist/lib/browser/settings-RDHXCCT4.mjs +0 -31
- package/dist/lib/browser/settings-RDHXCCT4.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -7
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +0 -9
- package/dist/types/src/capabilities/settings/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/Markdown/Container.d.ts +0 -8
- package/dist/types/src/components/Markdown/Container.d.ts.map +0 -1
- package/dist/types/src/components/Markdown/Container.stories.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownSlide.d.ts +0 -8
- package/dist/types/src/components/MarkdownSlide.d.ts.map +0 -1
- package/dist/types/src/components/PresenterSettings.d.ts +0 -8
- package/dist/types/src/components/PresenterSettings.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -49
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -70
- package/src/capabilities/settings/index.ts +0 -7
- package/src/components/CollectionPresenterContainer.tsx +0 -43
- package/src/components/DocumentPresenterContainer.tsx +0 -23
- package/src/components/PresenterSettings.tsx +0 -35
- package/src/types.ts +0 -54
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.abd8ff62ef",
|
|
4
4
|
"description": "Braneframe presenter plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,24 +12,47 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#plugin": {
|
|
17
|
+
"browser": "./src/PresenterPlugin.tsx",
|
|
18
|
+
"node": "./src/PresenterPlugin.node.ts",
|
|
19
|
+
"default": "./src/PresenterPlugin.tsx"
|
|
20
|
+
},
|
|
21
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
22
|
+
"#components": "./src/components/index.ts",
|
|
23
|
+
"#containers": "./src/containers/index.ts",
|
|
24
|
+
"#meta": "./src/meta.ts",
|
|
25
|
+
"#operations": "./src/operations/index.ts",
|
|
26
|
+
"#testing": "./src/testing.ts",
|
|
27
|
+
"#translations": "./src/translations.ts",
|
|
28
|
+
"#types": "./src/types/index.ts"
|
|
29
|
+
},
|
|
15
30
|
"exports": {
|
|
16
31
|
".": {
|
|
17
|
-
"browser": "./dist/lib/browser/index.mjs",
|
|
18
32
|
"source": "./src/index.ts",
|
|
33
|
+
"browser": "./dist/lib/browser/index.mjs",
|
|
19
34
|
"types": "./dist/types/src/index.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./operations": {
|
|
37
|
+
"source": "./src/operations/index.ts",
|
|
38
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
39
|
+
"browser": "./dist/lib/browser/operations/index.mjs"
|
|
40
|
+
},
|
|
41
|
+
"./translations": {
|
|
42
|
+
"source": "./src/translations.ts",
|
|
43
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
44
|
+
"browser": "./dist/lib/browser/translations.mjs",
|
|
45
|
+
"node": "./dist/lib/node-esm/translations.mjs"
|
|
20
46
|
}
|
|
21
47
|
},
|
|
22
48
|
"types": "dist/types/src/index.d.ts",
|
|
23
|
-
"typesVersions": {
|
|
24
|
-
"*": {}
|
|
25
|
-
},
|
|
26
49
|
"files": [
|
|
27
50
|
"dist",
|
|
28
51
|
"src"
|
|
29
52
|
],
|
|
30
53
|
"dependencies": {
|
|
31
|
-
"@effect-atom/atom": "^0.
|
|
32
|
-
"@effect-atom/atom-react": "^0.
|
|
54
|
+
"@effect-atom/atom": "^0.5.1",
|
|
55
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
33
56
|
"hastscript": "^7.1.0",
|
|
34
57
|
"highlight.js": "^11.9.0",
|
|
35
58
|
"marked": "^12.0.2",
|
|
@@ -40,48 +63,51 @@
|
|
|
40
63
|
"remark-frontmatter": "^5.0.0",
|
|
41
64
|
"remark-parse-frontmatter": "^1.0.3",
|
|
42
65
|
"reveal.js": "^5.1.0",
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/log": "0.8.4-main.
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/plugin-
|
|
51
|
-
"@dxos/plugin-
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/plugin-
|
|
55
|
-
"@dxos/react-ui-
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/react-ui-
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
66
|
+
"@dxos/async": "0.8.4-main.abd8ff62ef",
|
|
67
|
+
"@dxos/app-framework": "0.8.4-main.abd8ff62ef",
|
|
68
|
+
"@dxos/app-toolkit": "0.8.4-main.abd8ff62ef",
|
|
69
|
+
"@dxos/compute": "0.8.4-main.abd8ff62ef",
|
|
70
|
+
"@dxos/echo": "0.8.4-main.abd8ff62ef",
|
|
71
|
+
"@dxos/log": "0.8.4-main.abd8ff62ef",
|
|
72
|
+
"@dxos/effect": "0.8.4-main.abd8ff62ef",
|
|
73
|
+
"@dxos/plugin-client": "0.8.4-main.abd8ff62ef",
|
|
74
|
+
"@dxos/plugin-deck": "0.8.4-main.abd8ff62ef",
|
|
75
|
+
"@dxos/plugin-markdown": "0.8.4-main.abd8ff62ef",
|
|
76
|
+
"@dxos/react-client": "0.8.4-main.abd8ff62ef",
|
|
77
|
+
"@dxos/plugin-graph": "0.8.4-main.abd8ff62ef",
|
|
78
|
+
"@dxos/react-ui-attention": "0.8.4-main.abd8ff62ef",
|
|
79
|
+
"@dxos/plugin-stack": "0.8.4-main.abd8ff62ef",
|
|
80
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.abd8ff62ef",
|
|
81
|
+
"@dxos/react-ui-form": "0.8.4-main.abd8ff62ef",
|
|
82
|
+
"@dxos/react-ui-stack": "0.8.4-main.abd8ff62ef",
|
|
83
|
+
"@dxos/schema": "0.8.4-main.abd8ff62ef",
|
|
84
|
+
"@dxos/types": "0.8.4-main.abd8ff62ef",
|
|
85
|
+
"@dxos/util": "0.8.4-main.abd8ff62ef"
|
|
61
86
|
},
|
|
62
87
|
"devDependencies": {
|
|
63
|
-
"@effect-atom/atom-react": "^0.
|
|
64
|
-
"@effect/platform": "0.
|
|
88
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
89
|
+
"@effect/platform": "0.94.4",
|
|
65
90
|
"@types/react": "~19.2.7",
|
|
66
91
|
"@types/react-dom": "~19.2.3",
|
|
67
92
|
"@types/reveal.js": "^5.0.3",
|
|
68
|
-
"effect": "3.
|
|
93
|
+
"effect": "3.20.0",
|
|
69
94
|
"react": "~19.2.3",
|
|
70
95
|
"react-dom": "~19.2.3",
|
|
71
|
-
"vite": "
|
|
72
|
-
"@dxos/random": "0.8.4-main.
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/ui
|
|
75
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
96
|
+
"vite": "^8.0.10",
|
|
97
|
+
"@dxos/random": "0.8.4-main.abd8ff62ef",
|
|
98
|
+
"@dxos/plugin-testing": "0.8.4-main.abd8ff62ef",
|
|
99
|
+
"@dxos/react-ui": "0.8.4-main.abd8ff62ef",
|
|
100
|
+
"@dxos/storybook-utils": "0.8.4-main.abd8ff62ef",
|
|
101
|
+
"@dxos/ui-theme": "0.8.4-main.abd8ff62ef"
|
|
76
102
|
},
|
|
77
103
|
"peerDependencies": {
|
|
78
|
-
"@effect-atom/atom-react": "^0.
|
|
79
|
-
"@effect/platform": "0.
|
|
80
|
-
"effect": "3.
|
|
104
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
105
|
+
"@effect/platform": "0.94.4",
|
|
106
|
+
"effect": "3.20.0",
|
|
81
107
|
"react": "~19.2.3",
|
|
82
108
|
"react-dom": "~19.2.3",
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/ui
|
|
109
|
+
"@dxos/ui-theme": "0.8.4-main.abd8ff62ef",
|
|
110
|
+
"@dxos/react-ui": "0.8.4-main.abd8ff62ef"
|
|
85
111
|
},
|
|
86
112
|
"publishConfig": {
|
|
87
113
|
"access": "public"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
|
|
8
|
+
import { AppGraphBuilder } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
|
|
11
|
+
export const PresenterPlugin = Plugin.define(meta).pipe(
|
|
12
|
+
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
13
|
+
Plugin.make,
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export default PresenterPlugin;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { createComposerTestApp } from '@dxos/plugin-testing/harness';
|
|
8
|
+
|
|
9
|
+
import { PresenterPlugin } from '#plugin';
|
|
10
|
+
|
|
11
|
+
import { meta } from './meta';
|
|
12
|
+
|
|
13
|
+
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
14
|
+
|
|
15
|
+
describe('PresenterPlugin', () => {
|
|
16
|
+
test('modules activate on the expected events', async ({ expect }) => {
|
|
17
|
+
await using harness = await createComposerTestApp({
|
|
18
|
+
plugins: [PresenterPlugin()],
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
expect(harness.manager.getActive()).toContain(moduleId('AppGraphBuilder'));
|
|
22
|
+
});
|
|
23
|
+
});
|
package/src/PresenterPlugin.tsx
CHANGED
|
@@ -2,19 +2,22 @@
|
|
|
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
|
-
import { AppGraphBuilder, PresenterSettings, ReactSurface } from '
|
|
8
|
-
import { meta } from '
|
|
9
|
-
import { translations } from '
|
|
8
|
+
import { AppGraphBuilder, PresenterSettings, ReactSurface } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { translations } from '#translations';
|
|
10
11
|
|
|
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
15
|
export const PresenterPlugin = Plugin.define(meta).pipe(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
17
|
+
AppPlugin.addSettingsModule({ activate: PresenterSettings }),
|
|
18
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
19
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
19
20
|
Plugin.make,
|
|
20
21
|
);
|
|
22
|
+
|
|
23
|
+
export default PresenterPlugin;
|
|
@@ -5,17 +5,20 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import * as Option from 'effect/Option';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { AppCapabilities, AppNode, LayoutOperation, getObjectPathFromObject, getSpacePath } from '@dxos/app-toolkit';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
9
11
|
import { Obj } from '@dxos/echo';
|
|
10
|
-
import {
|
|
12
|
+
import { Collection } from '@dxos/echo';
|
|
11
13
|
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
12
|
-
import {
|
|
14
|
+
import { DeckOperation } from '@dxos/plugin-deck/operations';
|
|
13
15
|
import { GraphBuilder, type Node, NodeMatcher } from '@dxos/plugin-graph';
|
|
14
16
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
15
|
-
import {
|
|
17
|
+
import { linkedSegment } from '@dxos/react-ui-attention';
|
|
16
18
|
|
|
17
|
-
import { meta } from '
|
|
18
|
-
import {
|
|
19
|
+
import { meta } from '#meta';
|
|
20
|
+
import { PresenterOperation } from '#operations';
|
|
21
|
+
import { PresenterCapabilities } from '#types';
|
|
19
22
|
|
|
20
23
|
/** Match nodes that can be presented (Collection or Document). */
|
|
21
24
|
const whenPresentable = (node: Node.Node) =>
|
|
@@ -28,7 +31,7 @@ export default Capability.makeModule(
|
|
|
28
31
|
const capabilities = yield* Capability.Service;
|
|
29
32
|
|
|
30
33
|
const extensions = yield* GraphBuilder.createExtension({
|
|
31
|
-
id:
|
|
34
|
+
id: 'root',
|
|
32
35
|
// TODO(wittjosiah): This is a hack to work around presenter previously relying on "variant". Remove.
|
|
33
36
|
match: whenPresentable,
|
|
34
37
|
connector: (object, get) => {
|
|
@@ -40,18 +43,14 @@ export default Capability.makeModule(
|
|
|
40
43
|
if (!isPresentable) {
|
|
41
44
|
return Effect.succeed([]);
|
|
42
45
|
}
|
|
43
|
-
|
|
46
|
+
|
|
44
47
|
return Effect.succeed([
|
|
45
|
-
{
|
|
46
|
-
id:
|
|
48
|
+
AppNode.makeCompanion({
|
|
49
|
+
id: linkedSegment('presenter'),
|
|
50
|
+
label: 'Presenter',
|
|
51
|
+
icon: 'ph--presentation--regular',
|
|
47
52
|
data: { type: meta.id, object },
|
|
48
|
-
|
|
49
|
-
properties: {
|
|
50
|
-
label: 'Presenter',
|
|
51
|
-
icon: 'ph--presentation--regular',
|
|
52
|
-
disposition: 'hidden',
|
|
53
|
-
},
|
|
54
|
-
},
|
|
53
|
+
}),
|
|
55
54
|
]);
|
|
56
55
|
},
|
|
57
56
|
actions: (object, get) => {
|
|
@@ -60,34 +59,34 @@ export default Capability.makeModule(
|
|
|
60
59
|
const isPresentable = settings?.presentCollections
|
|
61
60
|
? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)
|
|
62
61
|
: Obj.instanceOf(Markdown.Document, object);
|
|
63
|
-
|
|
62
|
+
const db = Obj.getDatabase(object);
|
|
63
|
+
if (!isPresentable || !db) {
|
|
64
64
|
return Effect.succeed([]);
|
|
65
65
|
}
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
const { spaceId } = dxn.asEchoDXN()!;
|
|
66
|
+
const objectPath = getObjectPathFromObject(object);
|
|
67
|
+
|
|
69
68
|
return Effect.succeed([
|
|
70
69
|
{
|
|
71
|
-
id:
|
|
70
|
+
id: PresenterOperation.TogglePresentation.meta.key,
|
|
72
71
|
// TODO(burdon): Allow function so can generate state when activated.
|
|
73
72
|
// So can set explicit fullscreen state coordinated with current presenter state.
|
|
74
73
|
data: Effect.fnUntraced(function* () {
|
|
75
|
-
const deckState = yield*
|
|
74
|
+
const deckState = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
76
75
|
const deck = deckState.decks[deckState.activeDeck];
|
|
77
|
-
const presenterId =
|
|
76
|
+
const presenterId = `${objectPath}/${linkedSegment('presenter')}`;
|
|
78
77
|
if (!deck?.fullscreen) {
|
|
79
78
|
yield* Operation.invoke(DeckOperation.Adjust, {
|
|
80
79
|
type: 'solo--fullscreen' as const,
|
|
81
80
|
id: presenterId,
|
|
82
81
|
});
|
|
83
82
|
}
|
|
84
|
-
yield* Operation.invoke(
|
|
83
|
+
yield* Operation.invoke(LayoutOperation.Open, {
|
|
85
84
|
subject: [presenterId],
|
|
86
|
-
workspace: spaceId,
|
|
85
|
+
workspace: getSpacePath(db.spaceId),
|
|
87
86
|
});
|
|
88
87
|
}),
|
|
89
88
|
properties: {
|
|
90
|
-
label: ['toggle
|
|
89
|
+
label: ['toggle-presentation.label', { ns: meta.id }],
|
|
91
90
|
icon: 'ph--presentation--regular',
|
|
92
91
|
disposition: 'list-item',
|
|
93
92
|
keyBinding: {
|
|
@@ -100,6 +99,6 @@ export default Capability.makeModule(
|
|
|
100
99
|
},
|
|
101
100
|
});
|
|
102
101
|
|
|
103
|
-
return Capability.contributes(
|
|
102
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
104
103
|
}),
|
|
105
104
|
);
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
8
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
9
|
+
export const PresenterSettings = Capability.lazy('PresenterSettings', () => import('./settings'));
|
|
@@ -0,0 +1,68 @@
|
|
|
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 { AppSurface } from '@dxos/app-toolkit/ui';
|
|
11
|
+
import { Obj } from '@dxos/echo';
|
|
12
|
+
import { Collection } from '@dxos/echo';
|
|
13
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
14
|
+
|
|
15
|
+
import { PresenterSettings } from '#components';
|
|
16
|
+
import { CollectionPresenterContainer, DocumentPresenterContainer, MarkdownSlide } from '#containers';
|
|
17
|
+
import { meta } from '#meta';
|
|
18
|
+
import { type Settings } from '#types';
|
|
19
|
+
|
|
20
|
+
export default Capability.makeModule(() =>
|
|
21
|
+
Effect.succeed(
|
|
22
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
23
|
+
Surface.create({
|
|
24
|
+
id: 'document',
|
|
25
|
+
position: 'hoist',
|
|
26
|
+
filter: AppSurface.predicate(
|
|
27
|
+
AppSurface.Article,
|
|
28
|
+
(data): data is AppSurface.ArticleData<{ type: typeof meta.id; object: Markdown.Document }> =>
|
|
29
|
+
!!data.subject &&
|
|
30
|
+
typeof data.subject === 'object' &&
|
|
31
|
+
'type' in data.subject &&
|
|
32
|
+
'object' in data.subject &&
|
|
33
|
+
data.subject.type === meta.id &&
|
|
34
|
+
Obj.instanceOf(Markdown.Document, data.subject.object),
|
|
35
|
+
),
|
|
36
|
+
component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,
|
|
37
|
+
}),
|
|
38
|
+
Surface.create({
|
|
39
|
+
id: 'collection',
|
|
40
|
+
position: 'hoist',
|
|
41
|
+
filter: AppSurface.predicate(
|
|
42
|
+
AppSurface.Article,
|
|
43
|
+
(data): data is AppSurface.ArticleData<{ type: typeof meta.id; object: Collection.Collection }> =>
|
|
44
|
+
!!data.subject &&
|
|
45
|
+
typeof data.subject === 'object' &&
|
|
46
|
+
'type' in data.subject &&
|
|
47
|
+
'object' in data.subject &&
|
|
48
|
+
data.subject.type === meta.id &&
|
|
49
|
+
Obj.instanceOf(Collection.Collection, data.subject.object),
|
|
50
|
+
),
|
|
51
|
+
component: ({ role, data }) => <CollectionPresenterContainer role={role} subject={data.subject.object} />,
|
|
52
|
+
}),
|
|
53
|
+
Surface.create({
|
|
54
|
+
id: 'slide',
|
|
55
|
+
filter: AppSurface.object(AppSurface.Slide, Markdown.Document),
|
|
56
|
+
component: ({ data }) => <MarkdownSlide document={data.subject} />,
|
|
57
|
+
}),
|
|
58
|
+
Surface.create({
|
|
59
|
+
id: 'plugin-settings',
|
|
60
|
+
filter: AppSurface.settings(AppSurface.Article, meta.id),
|
|
61
|
+
component: ({ data: { subject } }) => {
|
|
62
|
+
const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
|
|
63
|
+
return <PresenterSettings settings={settings} onSettingsChange={updateSettings} />;
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
]),
|
|
67
|
+
),
|
|
68
|
+
);
|
|
@@ -4,25 +4,26 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { Capability
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
8
9
|
import { createKvsStore } from '@dxos/effect';
|
|
9
10
|
|
|
10
|
-
import { meta } from '
|
|
11
|
-
import { PresenterCapabilities,
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { PresenterCapabilities, Settings } from '#types';
|
|
12
13
|
|
|
13
14
|
export default Capability.makeModule(() =>
|
|
14
15
|
Effect.sync(() => {
|
|
15
16
|
const settingsAtom = createKvsStore({
|
|
16
17
|
key: meta.id,
|
|
17
|
-
schema:
|
|
18
|
+
schema: Settings.Settings,
|
|
18
19
|
defaultValue: () => ({}),
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
return [
|
|
22
23
|
Capability.contributes(PresenterCapabilities.Settings, settingsAtom),
|
|
23
|
-
Capability.contributes(
|
|
24
|
+
Capability.contributes(AppCapabilities.Settings, {
|
|
24
25
|
prefix: meta.id,
|
|
25
|
-
schema:
|
|
26
|
+
schema: Settings.Settings,
|
|
26
27
|
atom: settingsAtom,
|
|
27
28
|
}),
|
|
28
29
|
];
|
|
@@ -5,25 +5,25 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
8
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
9
9
|
|
|
10
|
-
import { createSlide } from '
|
|
10
|
+
import { createSlide } from '#testing';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { Panel } from './Panel';
|
|
13
13
|
import { Slide, type SlideProps } from './Slide';
|
|
14
14
|
|
|
15
15
|
const DefaultStory = ({ content = '' }: SlideProps) => {
|
|
16
16
|
return (
|
|
17
|
-
<
|
|
17
|
+
<Panel classNames='bg-neutral-200'>
|
|
18
18
|
<Slide content={content} />
|
|
19
|
-
</
|
|
19
|
+
</Panel>
|
|
20
20
|
);
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const meta = {
|
|
24
|
-
title: 'plugins/plugin-presenter/
|
|
24
|
+
title: 'plugins/plugin-presenter/components/Panel',
|
|
25
25
|
render: DefaultStory,
|
|
26
|
-
decorators: [withTheme],
|
|
26
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
27
27
|
parameters: {
|
|
28
28
|
layout: 'fullscreen',
|
|
29
29
|
},
|
|
@@ -8,12 +8,12 @@ import { useResizeDetector } from 'react-resize-detector';
|
|
|
8
8
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
9
9
|
import { mx } from '@dxos/ui-theme';
|
|
10
10
|
|
|
11
|
-
export type
|
|
11
|
+
export type PanelProps = ThemedClassName<PropsWithChildren<{}>>;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Scaled markdown
|
|
14
|
+
* Scaled markdown panel.
|
|
15
15
|
*/
|
|
16
|
-
export const
|
|
16
|
+
export const Panel = ({ children, classNames }: PanelProps) => {
|
|
17
17
|
const [props, setProps] = useState({});
|
|
18
18
|
const {
|
|
19
19
|
ref: containerRef,
|
|
@@ -35,8 +35,8 @@ 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)}>
|
|
39
|
-
<div className={mx('
|
|
38
|
+
<div ref={containerRef} className={mx('flex grow relative overflow-hidden bg-attention-surface', classNames)}>
|
|
39
|
+
<div className={mx('dx-container absolute')} style={props}>
|
|
40
40
|
{width && height && children}
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
|
|
7
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
7
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
8
8
|
|
|
9
|
-
import { createSlide } from '
|
|
9
|
+
import { createSlide } from '#testing';
|
|
10
10
|
|
|
11
11
|
import { Slide } from './Slide';
|
|
12
12
|
|
|
13
13
|
const meta = {
|
|
14
|
-
title: 'plugins/plugin-presenter/Slide',
|
|
14
|
+
title: 'plugins/plugin-presenter/components/Slide',
|
|
15
15
|
component: Slide,
|
|
16
|
-
decorators: [withTheme],
|
|
16
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
17
17
|
parameters: {
|
|
18
18
|
layout: 'fullscreen',
|
|
19
19
|
},
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import 'highlight.js/styles/github.css';
|
|
6
|
+
|
|
5
7
|
import { h } from 'hastscript';
|
|
6
8
|
import React from 'react';
|
|
7
9
|
import ReactMarkdown, { type Options as ReactMarkdownOptions } from 'react-markdown';
|
|
@@ -10,8 +12,6 @@ import rehypeHighlight from 'rehype-highlight';
|
|
|
10
12
|
import remarkFrontmatter from 'remark-frontmatter';
|
|
11
13
|
import remarkParseFrontmatter from 'remark-parse-frontmatter';
|
|
12
14
|
|
|
13
|
-
import 'highlight.js/styles/github.css';
|
|
14
|
-
|
|
15
15
|
import styles from './styles.css?raw';
|
|
16
16
|
import { theme } from './theme';
|
|
17
17
|
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
// TODO(burdon): Create theme type and picker.
|
|
6
6
|
|
|
7
7
|
export const theme = {
|
|
8
|
-
root: 'bg-attention leading-relaxed font-mono',
|
|
8
|
+
root: 'bg-attention-surface leading-relaxed font-mono',
|
|
9
9
|
|
|
10
|
-
padding: '
|
|
10
|
+
padding: 'px-40 py-16 gap-8',
|
|
11
11
|
|
|
12
12
|
nodes: {
|
|
13
|
-
h1: 'text-[80px] text-
|
|
14
|
-
h2: 'text-[60px] text-
|
|
15
|
-
h3: 'text-[48px] text-
|
|
13
|
+
h1: 'text-[80px] text-accent-text',
|
|
14
|
+
h2: 'text-[60px] text-accent-text',
|
|
15
|
+
h3: 'text-[48px] text-accent-text',
|
|
16
16
|
|
|
17
17
|
p: 'text-[48px]',
|
|
18
18
|
|
|
@@ -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: 'w-full mx-0 my-[32px] p-4 bg-input-surface',
|
|
24
24
|
code: 'p-0 text-[40px]',
|
|
25
25
|
},
|
|
26
26
|
};
|
|
@@ -4,30 +4,31 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { type PropsWithChildren, type ReactNode } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { mx } from '@dxos/ui-theme';
|
|
7
|
+
import { composable, composableProps } from '@dxos/ui-theme';
|
|
9
8
|
|
|
10
|
-
export type LayoutProps =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
bottomRight?: ReactNode;
|
|
17
|
-
}>
|
|
18
|
-
>;
|
|
9
|
+
export type LayoutProps = PropsWithChildren<{
|
|
10
|
+
topLeft?: ReactNode;
|
|
11
|
+
topRight?: ReactNode;
|
|
12
|
+
bottomLeft?: ReactNode;
|
|
13
|
+
bottomRight?: ReactNode;
|
|
14
|
+
}>;
|
|
19
15
|
|
|
20
|
-
export const Layout =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<div
|
|
16
|
+
export const Layout = composable<HTMLDivElement, LayoutProps>(
|
|
17
|
+
({ children, topLeft, topRight, bottomLeft, bottomRight, ...props }, forwardedRef) => {
|
|
18
|
+
return (
|
|
19
|
+
<div
|
|
20
|
+
{...composableProps(props, { classNames: 'flex grow relative overflow-hidden bg-attention-surface' })}
|
|
21
|
+
ref={forwardedRef}
|
|
22
|
+
>
|
|
23
|
+
<div className='flex flex-col grow overflow-hidden'>{children}</div>
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
<div className='z-[200]'>
|
|
26
|
+
<div className='absolute top-4 left-4'>{topLeft}</div>
|
|
27
|
+
<div className='absolute top-4 right-4'>{topRight}</div>
|
|
28
|
+
<div className='absolute bottom-4 left-4'>{bottomLeft}</div>
|
|
29
|
+
<div className='absolute bottom-4 right-4'>{bottomRight}</div>
|
|
30
|
+
</div>
|
|
30
31
|
</div>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
);
|