@dxos/plugin-presenter 0.8.4-main.74a063c4e0 → 0.8.4-main.765dc60934
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/LICENSE +102 -5
- package/dist/lib/neutral/CollectionPresenterArticle-WWHFJYZA.mjs +46 -0
- package/dist/lib/neutral/CollectionPresenterArticle-WWHFJYZA.mjs.map +7 -0
- package/dist/lib/neutral/DocumentPresenterContainer-KCDZ2O2C.mjs +24 -0
- package/dist/lib/neutral/DocumentPresenterContainer-KCDZ2O2C.mjs.map +7 -0
- package/dist/lib/neutral/MarkdownSlide-WXILOIBE.mjs +18 -0
- package/dist/lib/neutral/MarkdownSlide-WXILOIBE.mjs.map +7 -0
- package/dist/lib/neutral/PresenterPlugin.mjs +23 -0
- package/dist/lib/neutral/PresenterPlugin.mjs.map +7 -0
- package/dist/lib/neutral/PresenterPlugin.node.mjs +16 -0
- package/dist/lib/neutral/PresenterPlugin.node.mjs.map +7 -0
- package/dist/lib/{browser/PresenterSettings-DZO2DC53.mjs → neutral/PresenterSettings-2G4XD4QY.mjs} +9 -13
- package/dist/lib/neutral/PresenterSettings-2G4XD4QY.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-DIEDSRPX.mjs +97 -0
- package/dist/lib/neutral/app-graph-builder-DIEDSRPX.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +13 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4XSSDLGN.mjs +18 -0
- package/dist/lib/neutral/chunk-4XSSDLGN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-DCPA267T.mjs +68 -0
- package/dist/lib/neutral/chunk-DCPA267T.mjs.map +7 -0
- package/dist/lib/neutral/chunk-V323QBC3.mjs +41 -0
- package/dist/lib/neutral/chunk-V323QBC3.mjs.map +7 -0
- package/dist/lib/{browser → neutral/components}/index.mjs +3 -53
- package/dist/lib/{browser → neutral/components}/index.mjs.map +4 -4
- package/dist/lib/neutral/containers/index.mjs +13 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +18 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +12 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-RVWL2ZKQ.mjs +54 -0
- package/dist/lib/neutral/react-surface-RVWL2ZKQ.mjs.map +7 -0
- package/dist/lib/neutral/settings-R6LRDAAK.mjs +28 -0
- package/dist/lib/neutral/settings-R6LRDAAK.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +19 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +14 -0
- package/dist/lib/neutral/types/index.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.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +2 -5
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Panel.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Panel.stories.d.ts.map +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/theme.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Layout.d.ts +1 -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 +1 -1
- package/dist/types/src/components/PresenterSettings/PresenterSettings.d.ts.map +1 -1
- package/dist/types/src/components/PresenterSettings/PresenterSettings.stories.d.ts +4 -6
- package/dist/types/src/components/PresenterSettings/PresenterSettings.stories.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts +1 -5
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +5 -11
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/CollectionPresenterArticle/CollectionPresenterArticle.d.ts +6 -0
- package/dist/types/src/containers/CollectionPresenterArticle/CollectionPresenterArticle.d.ts.map +1 -0
- package/dist/types/src/containers/CollectionPresenterArticle/index.d.ts +2 -0
- package/dist/types/src/containers/CollectionPresenterArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts +1 -1
- package/dist/types/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts.map +1 -1
- package/dist/types/src/containers/MarkdownSlide/MarkdownSlide.d.ts +1 -1
- package/dist/types/src/containers/MarkdownSlide/MarkdownSlide.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -7
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/PresenterCapabilities.d.ts +4 -0
- package/dist/types/src/types/PresenterCapabilities.d.ts.map +1 -0
- package/dist/types/src/{operations/definitions.d.ts → types/PresenterOperation.d.ts} +5 -5
- package/dist/types/src/types/PresenterOperation.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +3 -2
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -9
- package/dist/types/src/types/index.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 +80 -44
- package/src/PresenterPlugin.node.ts +16 -0
- package/src/PresenterPlugin.test.ts +23 -0
- package/src/PresenterPlugin.tsx +3 -2
- package/src/capabilities/app-graph-builder.ts +5 -7
- package/src/capabilities/react-surface.tsx +26 -25
- package/src/components/PresenterSettings/PresenterSettings.stories.tsx +2 -1
- package/src/components/PresenterSettings/PresenterSettings.tsx +8 -9
- package/src/components/RevealPlayer/RevealPlayer.stories.tsx +2 -1
- package/src/components/RevealPlayer/RevealPlayer.tsx +1 -1
- package/src/containers/{CollectionPresenterContainer/CollectionPresenterContainer.tsx → CollectionPresenterArticle/CollectionPresenterArticle.tsx} +11 -5
- package/src/containers/CollectionPresenterArticle/index.ts +5 -0
- package/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.tsx +1 -1
- package/src/containers/MarkdownSlide/MarkdownSlide.tsx +1 -1
- package/src/containers/index.ts +1 -1
- package/src/index.ts +1 -3
- package/src/plugin.ts +9 -0
- package/src/translations.ts +0 -2
- package/src/types/PresenterCapabilities.ts +15 -0
- package/src/{operations/definitions.ts → types/PresenterOperation.ts} +4 -2
- package/src/types/Settings.ts +7 -2
- package/src/types/index.ts +2 -11
- package/src/useExitPresenter.ts +1 -2
- package/dist/lib/browser/PresenterSettings-DZO2DC53.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operations/index.mjs +0 -30
- package/dist/lib/browser/operations/index.mjs.map +0 -7
- package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts +0 -6
- package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts.map +0 -1
- package/dist/types/src/containers/CollectionPresenterContainer/index.d.ts +0 -2
- package/dist/types/src/containers/CollectionPresenterContainer/index.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/dist/types/src/operations/index.d.ts +0 -2
- package/dist/types/src/operations/index.d.ts.map +0 -1
- package/src/containers/CollectionPresenterContainer/index.ts +0 -5
- package/src/operations/index.ts +0 -5
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
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.765dc60934",
|
|
4
4
|
"description": "Braneframe presenter plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -8,35 +8,70 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/dxos/dxos"
|
|
10
10
|
},
|
|
11
|
-
"license": "
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
15
|
"imports": {
|
|
16
|
-
"#capabilities":
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
"#capabilities": {
|
|
17
|
+
"source": "./src/capabilities/index.ts",
|
|
18
|
+
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
19
|
+
"default": "./dist/lib/neutral/capabilities/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"#components": {
|
|
22
|
+
"source": "./src/components/index.ts",
|
|
23
|
+
"types": "./dist/types/src/components/index.d.ts",
|
|
24
|
+
"default": "./dist/lib/neutral/components/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"#containers": {
|
|
27
|
+
"source": "./src/containers/index.ts",
|
|
28
|
+
"types": "./dist/types/src/containers/index.d.ts",
|
|
29
|
+
"default": "./dist/lib/neutral/containers/index.mjs"
|
|
30
|
+
},
|
|
31
|
+
"#meta": {
|
|
32
|
+
"source": "./src/meta.ts",
|
|
33
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
34
|
+
"default": "./dist/lib/neutral/meta.mjs"
|
|
35
|
+
},
|
|
36
|
+
"#plugin": {
|
|
37
|
+
"source": {
|
|
38
|
+
"node": "./src/PresenterPlugin.node.ts",
|
|
39
|
+
"default": "./src/PresenterPlugin.tsx"
|
|
40
|
+
},
|
|
41
|
+
"types": "./dist/types/src/PresenterPlugin.d.ts",
|
|
42
|
+
"node": "./dist/lib/neutral/PresenterPlugin.node.mjs",
|
|
43
|
+
"default": "./dist/lib/neutral/PresenterPlugin.mjs"
|
|
44
|
+
},
|
|
21
45
|
"#testing": "./src/testing.ts",
|
|
22
|
-
"#
|
|
46
|
+
"#translations": {
|
|
47
|
+
"source": "./src/translations.ts",
|
|
48
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
49
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
50
|
+
},
|
|
51
|
+
"#types": {
|
|
52
|
+
"source": "./src/types/index.ts",
|
|
53
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
54
|
+
"default": "./dist/lib/neutral/types/index.mjs"
|
|
55
|
+
}
|
|
23
56
|
},
|
|
24
57
|
"exports": {
|
|
25
58
|
".": {
|
|
26
59
|
"source": "./src/index.ts",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
60
|
+
"types": "./dist/types/src/index.d.ts",
|
|
61
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
29
62
|
},
|
|
30
|
-
"./
|
|
31
|
-
"source": "./src/
|
|
32
|
-
"types": "./dist/types/src/
|
|
33
|
-
"
|
|
63
|
+
"./plugin": {
|
|
64
|
+
"source": "./src/plugin.ts",
|
|
65
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
66
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
67
|
+
},
|
|
68
|
+
"./translations": {
|
|
69
|
+
"source": "./src/translations.ts",
|
|
70
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
71
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
34
72
|
}
|
|
35
73
|
},
|
|
36
74
|
"types": "dist/types/src/index.d.ts",
|
|
37
|
-
"typesVersions": {
|
|
38
|
-
"*": {}
|
|
39
|
-
},
|
|
40
75
|
"files": [
|
|
41
76
|
"dist",
|
|
42
77
|
"src"
|
|
@@ -54,26 +89,26 @@
|
|
|
54
89
|
"remark-frontmatter": "^5.0.0",
|
|
55
90
|
"remark-parse-frontmatter": "^1.0.3",
|
|
56
91
|
"reveal.js": "^5.1.0",
|
|
57
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/async": "0.8.4-main.
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/effect": "0.8.4-main.
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/plugin-
|
|
65
|
-
"@dxos/plugin-
|
|
66
|
-
"@dxos/plugin-
|
|
67
|
-
"@dxos/plugin-stack": "0.8.4-main.
|
|
68
|
-
"@dxos/react-client": "0.8.4-main.
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/react-ui-attention": "0.8.4-main.
|
|
71
|
-
"@dxos/react-ui-
|
|
72
|
-
"@dxos/react-ui-mosaic": "0.8.4-main.
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
92
|
+
"@dxos/app-framework": "0.8.4-main.765dc60934",
|
|
93
|
+
"@dxos/echo": "0.8.4-main.765dc60934",
|
|
94
|
+
"@dxos/async": "0.8.4-main.765dc60934",
|
|
95
|
+
"@dxos/compute": "0.8.4-main.765dc60934",
|
|
96
|
+
"@dxos/effect": "0.8.4-main.765dc60934",
|
|
97
|
+
"@dxos/app-toolkit": "0.8.4-main.765dc60934",
|
|
98
|
+
"@dxos/log": "0.8.4-main.765dc60934",
|
|
99
|
+
"@dxos/plugin-deck": "0.8.4-main.765dc60934",
|
|
100
|
+
"@dxos/plugin-client": "0.8.4-main.765dc60934",
|
|
101
|
+
"@dxos/plugin-markdown": "0.8.4-main.765dc60934",
|
|
102
|
+
"@dxos/plugin-stack": "0.8.4-main.765dc60934",
|
|
103
|
+
"@dxos/react-client": "0.8.4-main.765dc60934",
|
|
104
|
+
"@dxos/react-ui-form": "0.8.4-main.765dc60934",
|
|
105
|
+
"@dxos/react-ui-attention": "0.8.4-main.765dc60934",
|
|
106
|
+
"@dxos/react-ui-stack": "0.8.4-main.765dc60934",
|
|
107
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.765dc60934",
|
|
108
|
+
"@dxos/plugin-graph": "0.8.4-main.765dc60934",
|
|
109
|
+
"@dxos/schema": "0.8.4-main.765dc60934",
|
|
110
|
+
"@dxos/util": "0.8.4-main.765dc60934",
|
|
111
|
+
"@dxos/types": "0.8.4-main.765dc60934"
|
|
77
112
|
},
|
|
78
113
|
"devDependencies": {
|
|
79
114
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -84,11 +119,12 @@
|
|
|
84
119
|
"effect": "3.20.0",
|
|
85
120
|
"react": "~19.2.3",
|
|
86
121
|
"react-dom": "~19.2.3",
|
|
87
|
-
"vite": "^
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/ui
|
|
91
|
-
"@dxos/
|
|
122
|
+
"vite": "^8.0.13",
|
|
123
|
+
"@dxos/plugin-testing": "0.8.4-main.765dc60934",
|
|
124
|
+
"@dxos/random": "0.8.4-main.765dc60934",
|
|
125
|
+
"@dxos/react-ui": "0.8.4-main.765dc60934",
|
|
126
|
+
"@dxos/ui-theme": "0.8.4-main.765dc60934",
|
|
127
|
+
"@dxos/storybook-utils": "0.8.4-main.765dc60934"
|
|
92
128
|
},
|
|
93
129
|
"peerDependencies": {
|
|
94
130
|
"@effect-atom/atom-react": "^0.5.0",
|
|
@@ -96,8 +132,8 @@
|
|
|
96
132
|
"effect": "3.20.0",
|
|
97
133
|
"react": "~19.2.3",
|
|
98
134
|
"react-dom": "~19.2.3",
|
|
99
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
100
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
135
|
+
"@dxos/react-ui": "0.8.4-main.765dc60934",
|
|
136
|
+
"@dxos/ui-theme": "0.8.4-main.765dc60934"
|
|
101
137
|
},
|
|
102
138
|
"publishConfig": {
|
|
103
139
|
"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
|
@@ -7,8 +7,7 @@ import { AppPlugin } from '@dxos/app-toolkit';
|
|
|
7
7
|
|
|
8
8
|
import { AppGraphBuilder, PresenterSettings, ReactSurface } from '#capabilities';
|
|
9
9
|
import { meta } from '#meta';
|
|
10
|
-
|
|
11
|
-
import { translations } from './translations';
|
|
10
|
+
import { translations } from '#translations';
|
|
12
11
|
|
|
13
12
|
// TODO(burdon): Only scale markdown content.
|
|
14
13
|
// TODO(burdon): Map stack content; Slide content type (e.g., markdown, sketch, IPFS image, table, etc.)
|
|
@@ -20,3 +19,5 @@ export const PresenterPlugin = Plugin.define(meta).pipe(
|
|
|
20
19
|
AppPlugin.addTranslationsModule({ translations }),
|
|
21
20
|
Plugin.make,
|
|
22
21
|
);
|
|
22
|
+
|
|
23
|
+
export default PresenterPlugin;
|
|
@@ -7,17 +7,15 @@ import * as Option from 'effect/Option';
|
|
|
7
7
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { AppCapabilities, AppNode, LayoutOperation, getObjectPathFromObject, getSpacePath } from '@dxos/app-toolkit';
|
|
10
|
-
import {
|
|
11
|
-
import { Collection } from '@dxos/echo';
|
|
12
|
-
import {
|
|
13
|
-
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
14
|
-
import { DeckOperation } from '@dxos/plugin-deck/operations';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
11
|
+
import { Collection, Obj } from '@dxos/echo';
|
|
12
|
+
import { DeckCapabilities, DeckOperation } from '@dxos/plugin-deck';
|
|
15
13
|
import { GraphBuilder, type Node, NodeMatcher } from '@dxos/plugin-graph';
|
|
16
|
-
import { Markdown } from '@dxos/plugin-markdown
|
|
14
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
17
15
|
import { linkedSegment } from '@dxos/react-ui-attention';
|
|
18
16
|
|
|
19
17
|
import { meta } from '#meta';
|
|
20
|
-
import { PresenterOperation } from '#
|
|
18
|
+
import { PresenterOperation } from '#types';
|
|
21
19
|
import { PresenterCapabilities } from '#types';
|
|
22
20
|
|
|
23
21
|
/** Match nodes that can be presented (Collection or Document). */
|
|
@@ -8,12 +8,11 @@ import React from 'react';
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { Surface, useSettingsState } from '@dxos/app-framework/ui';
|
|
10
10
|
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
11
|
-
import { Obj } from '@dxos/echo';
|
|
12
|
-
import {
|
|
13
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
|
+
import { Collection, Obj } from '@dxos/echo';
|
|
12
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
14
13
|
|
|
15
14
|
import { PresenterSettings } from '#components';
|
|
16
|
-
import {
|
|
15
|
+
import { CollectionPresenterArticle, DocumentPresenterContainer, MarkdownSlide } from '#containers';
|
|
17
16
|
import { meta } from '#meta';
|
|
18
17
|
import { type Settings } from '#types';
|
|
19
18
|
|
|
@@ -22,40 +21,42 @@ export default Capability.makeModule(() =>
|
|
|
22
21
|
Capability.contributes(Capabilities.ReactSurface, [
|
|
23
22
|
Surface.create({
|
|
24
23
|
id: 'document',
|
|
25
|
-
role: 'article',
|
|
26
24
|
position: 'hoist',
|
|
27
|
-
filter: (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
filter: AppSurface.predicate(
|
|
26
|
+
AppSurface.Article,
|
|
27
|
+
(data): data is AppSurface.ArticleData<{ type: typeof meta.id; object: Markdown.Document }> =>
|
|
28
|
+
!!data.subject &&
|
|
29
|
+
typeof data.subject === 'object' &&
|
|
30
|
+
'type' in data.subject &&
|
|
31
|
+
'object' in data.subject &&
|
|
32
|
+
data.subject.type === meta.id &&
|
|
33
|
+
Obj.instanceOf(Markdown.Document, data.subject.object),
|
|
34
|
+
),
|
|
34
35
|
component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,
|
|
35
36
|
}),
|
|
36
37
|
Surface.create({
|
|
37
38
|
id: 'collection',
|
|
38
|
-
role: 'article',
|
|
39
39
|
position: 'hoist',
|
|
40
|
-
filter: (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
filter: AppSurface.predicate(
|
|
41
|
+
AppSurface.Article,
|
|
42
|
+
(data): data is AppSurface.ArticleData<{ type: typeof meta.id; object: Collection.Collection }> =>
|
|
43
|
+
!!data.subject &&
|
|
44
|
+
typeof data.subject === 'object' &&
|
|
45
|
+
'type' in data.subject &&
|
|
46
|
+
'object' in data.subject &&
|
|
47
|
+
data.subject.type === meta.id &&
|
|
48
|
+
Obj.instanceOf(Collection.Collection, data.subject.object),
|
|
49
|
+
),
|
|
50
|
+
component: ({ role, data }) => <CollectionPresenterArticle role={role} subject={data.subject.object} />,
|
|
48
51
|
}),
|
|
49
52
|
Surface.create({
|
|
50
53
|
id: 'slide',
|
|
51
|
-
|
|
52
|
-
filter: AppSurface.objectSection(Markdown.Document),
|
|
54
|
+
filter: AppSurface.object(AppSurface.Slide, Markdown.Document),
|
|
53
55
|
component: ({ data }) => <MarkdownSlide document={data.subject} />,
|
|
54
56
|
}),
|
|
55
57
|
Surface.create({
|
|
56
58
|
id: 'plugin-settings',
|
|
57
|
-
|
|
58
|
-
filter: AppSurface.settingsArticle(meta.id),
|
|
59
|
+
filter: AppSurface.settings(AppSurface.Article, meta.id),
|
|
59
60
|
component: ({ data: { subject } }) => {
|
|
60
61
|
const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
|
|
61
62
|
return <PresenterSettings settings={settings} onSettingsChange={updateSettings} />;
|
|
@@ -6,7 +6,8 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
|
|
7
7
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
8
8
|
|
|
9
|
-
import { translations } from '
|
|
9
|
+
import { translations } from '#translations';
|
|
10
|
+
|
|
10
11
|
import { PresenterSettings } from './PresenterSettings';
|
|
11
12
|
|
|
12
13
|
const meta = {
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
-
import {
|
|
8
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { Settings as SettingsForm } from '@dxos/react-ui-form';
|
|
10
10
|
|
|
11
11
|
import { meta } from '#meta';
|
|
12
|
-
import {
|
|
12
|
+
import { Settings } from '#types';
|
|
13
13
|
|
|
14
14
|
export type PresenterSettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;
|
|
15
15
|
|
|
@@ -19,13 +19,12 @@ export const PresenterSettings = ({ settings, onSettingsChange }: PresenterSetti
|
|
|
19
19
|
return (
|
|
20
20
|
<SettingsForm.Viewport>
|
|
21
21
|
<SettingsForm.Section title={t('settings.title', { ns: meta.id })}>
|
|
22
|
-
<SettingsForm.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</SettingsForm.Item>
|
|
22
|
+
<SettingsForm.FieldSet
|
|
23
|
+
readonly={!onSettingsChange}
|
|
24
|
+
schema={Settings.Settings}
|
|
25
|
+
values={settings}
|
|
26
|
+
onValuesChanged={(values) => onSettingsChange?.(() => values)}
|
|
27
|
+
/>
|
|
29
28
|
</SettingsForm.Section>
|
|
30
29
|
</SettingsForm.Viewport>
|
|
31
30
|
);
|
|
@@ -6,8 +6,9 @@ import { type Meta } from '@storybook/react-vite';
|
|
|
6
6
|
|
|
7
7
|
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
8
8
|
|
|
9
|
+
import { translations } from '#translations';
|
|
10
|
+
|
|
9
11
|
import CONTENT from '../../../testing/deck.md?raw';
|
|
10
|
-
import { translations } from '../../translations';
|
|
11
12
|
import { RevealPlayer } from './RevealPlayer';
|
|
12
13
|
|
|
13
14
|
// https://revealjs.com/markdown
|
|
@@ -152,7 +152,7 @@ export const RevealPlayer = composable<HTMLDivElement, RevealProps>(
|
|
|
152
152
|
})}
|
|
153
153
|
ref={forwardedRef}
|
|
154
154
|
>
|
|
155
|
-
<div
|
|
155
|
+
<div className='relative aspect-video h-full w-full h-auto max-h-full overflow-hidden'>
|
|
156
156
|
<div ref={deckDivRef} className='absolute inset-0 reveal'>
|
|
157
157
|
{/* NOTE: Must be in head. */}
|
|
158
158
|
<style>
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import React, { useContext, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Surface } from '@dxos/app-framework/ui';
|
|
8
|
-
import {
|
|
9
|
-
import { type Collection } from '@dxos/echo';
|
|
8
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
9
|
+
import { type Collection, Obj } from '@dxos/echo';
|
|
10
10
|
import { Panel } from '@dxos/react-ui';
|
|
11
11
|
|
|
12
12
|
import { PageNumber, Pager, Layout as PresenterLayout } from '#components';
|
|
@@ -14,9 +14,9 @@ import { PresenterContext } from '#types';
|
|
|
14
14
|
|
|
15
15
|
import { useExitPresenter } from '../../useExitPresenter';
|
|
16
16
|
|
|
17
|
-
export type
|
|
17
|
+
export type CollectionPresenterArticleProps = AppSurface.ObjectArticleProps<Collection.Collection>;
|
|
18
18
|
|
|
19
|
-
export const
|
|
19
|
+
export const CollectionPresenterArticle = ({ role, subject: collection }: CollectionPresenterArticleProps) => {
|
|
20
20
|
const [slide, setSlide] = useState(0);
|
|
21
21
|
const { running } = useContext(PresenterContext);
|
|
22
22
|
const handleExit = useExitPresenter(collection);
|
|
@@ -36,7 +36,13 @@ export const CollectionPresenterContainer = ({ role, subject: collection }: Coll
|
|
|
36
36
|
/>
|
|
37
37
|
}
|
|
38
38
|
>
|
|
39
|
-
<Surface.Surface
|
|
39
|
+
<Surface.Surface
|
|
40
|
+
type={AppSurface.Slide}
|
|
41
|
+
data={{
|
|
42
|
+
subject: collection.objects[slide],
|
|
43
|
+
attendableId: Obj.getDXN(collection).toString(),
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
40
46
|
</PresenterLayout>
|
|
41
47
|
</Panel.Content>
|
|
42
48
|
</Panel.Root>
|
package/src/containers/index.ts
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const CollectionPresenterArticle: ComponentType<any> = lazy(() => import('./CollectionPresenterArticle'));
|
|
8
8
|
export const DocumentPresenterContainer: ComponentType<any> = lazy(() => import('./DocumentPresenterContainer'));
|
|
9
9
|
export const MarkdownSlide: ComponentType<any> = lazy(() => import('./MarkdownSlide'));
|
package/src/index.ts
CHANGED
package/src/plugin.ts
ADDED
package/src/translations.ts
CHANGED
|
@@ -13,8 +13,6 @@ export const translations = [
|
|
|
13
13
|
'plugin.name': 'Presenter',
|
|
14
14
|
'settings.title': 'Presenter settings',
|
|
15
15
|
'toggle-presentation.label': 'Present',
|
|
16
|
-
'present-collections.label': 'Present collections (experimental)',
|
|
17
|
-
'present-collections.description': 'Enable presenting collections of documents as a slideshow.',
|
|
18
16
|
},
|
|
19
17
|
},
|
|
20
18
|
},
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
8
|
+
|
|
9
|
+
import { Capability } from '@dxos/app-framework';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
|
|
13
|
+
// Inline import to avoid `Settings` namespace alias colliding with the
|
|
14
|
+
// `Settings` capability export below.
|
|
15
|
+
export const Settings = Capability.make<Atom.Writable<import('./Settings').Settings>>(`${meta.id}.capability.settings`);
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
5
7
|
import * as Schema from 'effect/Schema';
|
|
6
8
|
|
|
9
|
+
import { Operation } from '@dxos/compute';
|
|
7
10
|
import { Collection } from '@dxos/echo';
|
|
8
|
-
import {
|
|
9
|
-
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
10
12
|
|
|
11
13
|
import { meta } from '#meta';
|
|
12
14
|
|
package/src/types/Settings.ts
CHANGED
|
@@ -8,8 +8,13 @@ import * as Schema from 'effect/Schema';
|
|
|
8
8
|
|
|
9
9
|
export const Settings = Schema.mutable(
|
|
10
10
|
Schema.Struct({
|
|
11
|
-
presentCollections: Schema.optional(
|
|
11
|
+
presentCollections: Schema.optional(
|
|
12
|
+
Schema.Boolean.annotations({
|
|
13
|
+
title: 'Present collections (experimental)',
|
|
14
|
+
description: 'Enable presenting collections of documents as a slideshow.',
|
|
15
|
+
}),
|
|
16
|
+
),
|
|
12
17
|
}),
|
|
13
18
|
);
|
|
14
19
|
|
|
15
|
-
export
|
|
20
|
+
export interface Settings extends Schema.Schema.Type<typeof Settings> {}
|
package/src/types/index.ts
CHANGED
|
@@ -2,15 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Atom } from '@effect-atom/atom-react';
|
|
6
5
|
import { type Context, createContext } from 'react';
|
|
7
6
|
|
|
8
|
-
import { Capability } from '@dxos/app-framework';
|
|
9
|
-
|
|
10
|
-
import { meta } from '#meta';
|
|
11
|
-
|
|
12
|
-
import * as Settings from './Settings';
|
|
13
|
-
|
|
14
7
|
export type PresenterContextType = {
|
|
15
8
|
running: boolean;
|
|
16
9
|
start: () => void;
|
|
@@ -23,8 +16,6 @@ export const PresenterContext: Context<PresenterContextType> = createContext<Pre
|
|
|
23
16
|
stop: () => {},
|
|
24
17
|
});
|
|
25
18
|
|
|
19
|
+
export * as PresenterCapabilities from './PresenterCapabilities';
|
|
20
|
+
export * as PresenterOperation from './PresenterOperation';
|
|
26
21
|
export * as Settings from './Settings';
|
|
27
|
-
|
|
28
|
-
export namespace PresenterCapabilities {
|
|
29
|
-
export const Settings = Capability.make<Atom.Writable<Settings.Settings>>(`${meta.id}.capability.settings`);
|
|
30
|
-
}
|
package/src/useExitPresenter.ts
CHANGED
|
@@ -8,8 +8,7 @@ import { useCallback, useMemo } from 'react';
|
|
|
8
8
|
import { useCapability, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
9
9
|
import { LayoutOperation, getObjectPathFromObject, getSpacePath } from '@dxos/app-toolkit';
|
|
10
10
|
import { Obj } from '@dxos/echo';
|
|
11
|
-
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
12
|
-
import { DeckOperation } from '@dxos/plugin-deck/operations';
|
|
11
|
+
import { DeckCapabilities, DeckOperation } from '@dxos/plugin-deck';
|
|
13
12
|
|
|
14
13
|
export const useExitPresenter = (object: any) => {
|
|
15
14
|
const { invokePromise } = useOperationInvoker();
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/PresenterSettings/PresenterSettings.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { Settings as SettingsForm } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { type Settings } from '#types';\n\nexport type PresenterSettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;\n\nexport const PresenterSettings = ({ settings, onSettingsChange }: PresenterSettingsProps) => {\n const { t } = useTranslation(meta.id);\n\n return (\n <SettingsForm.Viewport>\n <SettingsForm.Section title={t('settings.title', { ns: meta.id })}>\n <SettingsForm.Item title={t('present-collections.label')} description={t('present-collections.description')}>\n <Input.Switch\n disabled={!onSettingsChange}\n checked={settings.presentCollections}\n onCheckedChange={(checked) => onSettingsChange?.((s) => ({ ...s, presentCollections: !!checked }))}\n />\n </SettingsForm.Item>\n </SettingsForm.Section>\n </SettingsForm.Viewport>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,OAAOA,WAAW;AAGlB,SAASC,OAAOC,sBAAsB;AACtC,SAASC,YAAYC,oBAAoB;AAEzC,SAASC,YAAY;AAKd,IAAMC,oBAAoB,CAAC,EAAEC,UAAUC,iBAAgB,MAA0B;AACtF,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AAEpC,SACE,sBAAA,cAACC,aAAaC,UAAQ,MACpB,sBAAA,cAACD,aAAaE,SAAO;IAACC,OAAOP,EAAE,kBAAkB;MAAEQ,IAAIN,KAAKC;IAAG,CAAA;KAC7D,sBAAA,cAACC,aAAaK,MAAI;IAACF,OAAOP,EAAE,2BAAA;IAA8BU,aAAaV,EAAE,iCAAA;KACvE,sBAAA,cAACW,MAAMC,QAAM;IACXC,UAAU,CAACd;IACXe,SAAShB,SAASiB;IAClBC,iBAAiB,CAACF,YAAYf,mBAAmB,CAACkB,OAAO;MAAE,GAAGA;MAAGF,oBAAoB,CAAC,CAACD;IAAQ,EAAA;;AAM3G;",
|
|
6
|
-
"names": ["React", "Input", "useTranslation", "Settings", "SettingsForm", "meta", "PresenterSettings", "settings", "onSettingsChange", "t", "useTranslation", "meta", "id", "SettingsForm", "Viewport", "Section", "title", "ns", "Item", "description", "Input", "Switch", "disabled", "checked", "presentCollections", "onCheckedChange", "s"]
|
|
7
|
-
}
|