@dxos/plugin-presenter 0.8.4-main.72ec0f3 → 0.8.4-main.7996785055
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-JXB7MHRE.mjs +53 -0
- package/dist/lib/browser/CollectionPresenterContainer-JXB7MHRE.mjs.map +7 -0
- package/dist/lib/browser/DocumentPresenterContainer-ZGA4OUSU.mjs +29 -0
- package/dist/lib/browser/DocumentPresenterContainer-ZGA4OUSU.mjs.map +7 -0
- package/dist/lib/browser/MarkdownSlide-JW66CKQF.mjs +24 -0
- package/dist/lib/browser/MarkdownSlide-JW66CKQF.mjs.map +7 -0
- package/dist/lib/browser/PresenterSettings-XNHQGQTS.mjs +32 -0
- package/dist/lib/browser/PresenterSettings-XNHQGQTS.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-N6HFHTXF.mjs +109 -0
- package/dist/lib/browser/app-graph-builder-N6HFHTXF.mjs.map +7 -0
- package/dist/lib/browser/chunk-2HIBOSEH.mjs +29 -0
- package/dist/lib/browser/chunk-2HIBOSEH.mjs.map +7 -0
- package/dist/lib/browser/chunk-GK6SUI2J.mjs +42 -0
- package/dist/lib/browser/chunk-GK6SUI2J.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-JIHV5GLM.mjs +33 -0
- package/dist/lib/browser/chunk-JIHV5GLM.mjs.map +7 -0
- package/dist/lib/browser/chunk-NPELNO5W.mjs +495 -0
- package/dist/lib/browser/chunk-NPELNO5W.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TMTUZQCK.mjs → chunk-PYBNNNNK.mjs} +2 -2
- package/dist/lib/browser/chunk-PYBNNNNK.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +39 -38
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +9 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/react-surface-6H73FBMG.mjs +68 -0
- package/dist/lib/browser/react-surface-6H73FBMG.mjs.map +7 -0
- package/dist/lib/browser/settings-NWPZKMSH.mjs +33 -0
- package/dist/lib/browser/settings-NWPZKMSH.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/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/index.d.ts +1 -1
- package/dist/types/src/components/Markdown/index.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/Layout.d.ts +9 -5
- package/dist/types/src/components/Presenter/Layout.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/RevealPlayer/RevealPlayer.d.ts +9 -4
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +7 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -27
- 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/{components/MarkdownSlide.d.ts → containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts} +2 -3
- 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 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +16 -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/types.d.ts +9 -27
- 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 +52 -41
- package/src/PresenterPlugin.tsx +9 -23
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +115 -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 → Panel.stories.tsx} +6 -6
- package/src/components/Markdown/{Container.tsx → Panel.tsx} +6 -6
- package/src/components/Markdown/Slide.stories.tsx +3 -3
- 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/Presenter/Pager.tsx +2 -2
- package/src/components/RevealPlayer/RevealPlayer.stories.tsx +3 -3
- package/src/components/RevealPlayer/RevealPlayer.tsx +104 -100
- 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/{components → containers/MarkdownSlide}/MarkdownSlide.tsx +9 -7
- 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 +3 -3
- package/src/operations/definitions.ts +23 -0
- package/src/operations/index.ts +5 -0
- package/src/types.ts +6 -17
- package/src/useExitPresenter.ts +25 -25
- package/dist/lib/browser/CollectionPresenterContainer-4JFW3EKV.mjs +0 -199
- package/dist/lib/browser/CollectionPresenterContainer-4JFW3EKV.mjs.map +0 -7
- package/dist/lib/browser/DocumentPresenterContainer-SX32NAEH.mjs +0 -183
- package/dist/lib/browser/DocumentPresenterContainer-SX32NAEH.mjs.map +0 -7
- package/dist/lib/browser/MarkdownSlide-MEXR54L5.mjs +0 -223
- package/dist/lib/browser/MarkdownSlide-MEXR54L5.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-UJEKUKAP.mjs +0 -106
- package/dist/lib/browser/app-graph-builder-UJEKUKAP.mjs.map +0 -7
- package/dist/lib/browser/chunk-BJWK5GQV.mjs +0 -38
- package/dist/lib/browser/chunk-BJWK5GQV.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q3H4KEFB.mjs +0 -41
- package/dist/lib/browser/chunk-Q3H4KEFB.mjs.map +0 -7
- package/dist/lib/browser/chunk-TMTUZQCK.mjs.map +0 -7
- package/dist/lib/browser/chunk-VRRPVTKA.mjs +0 -39
- package/dist/lib/browser/chunk-VRRPVTKA.mjs.map +0 -7
- package/dist/lib/browser/react-surface-S4T6X72R.mjs +0 -57
- package/dist/lib/browser/react-surface-S4T6X72R.mjs.map +0 -7
- package/dist/lib/browser/settings-57TUVRW3.mjs +0 -22
- package/dist/lib/browser/settings-57TUVRW3.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/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.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 -117
- package/src/capabilities/react-surface.tsx +0 -63
- package/src/capabilities/settings.ts +0 -19
- package/src/components/CollectionPresenterContainer.tsx +0 -44
- package/src/components/DocumentPresenterContainer.tsx +0 -23
- package/src/components/PresenterSettings.tsx +0 -30
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-presenter",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.7996785055",
|
|
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,
|
|
@@ -11,8 +15,13 @@
|
|
|
11
15
|
"exports": {
|
|
12
16
|
".": {
|
|
13
17
|
"source": "./src/index.ts",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
18
|
+
"browser": "./dist/lib/browser/index.mjs",
|
|
19
|
+
"types": "./dist/types/src/index.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./operations": {
|
|
22
|
+
"source": "./src/operations/index.ts",
|
|
23
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
24
|
+
"browser": "./dist/lib/browser/operations/index.mjs"
|
|
16
25
|
}
|
|
17
26
|
},
|
|
18
27
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -24,8 +33,8 @@
|
|
|
24
33
|
"src"
|
|
25
34
|
],
|
|
26
35
|
"dependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
36
|
+
"@effect-atom/atom": "^0.5.1",
|
|
37
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
29
38
|
"hastscript": "^7.1.0",
|
|
30
39
|
"highlight.js": "^11.9.0",
|
|
31
40
|
"marked": "^12.0.2",
|
|
@@ -36,47 +45,49 @@
|
|
|
36
45
|
"remark-frontmatter": "^5.0.0",
|
|
37
46
|
"remark-parse-frontmatter": "^1.0.3",
|
|
38
47
|
"reveal.js": "^5.1.0",
|
|
39
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/log": "0.8.4-main.
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/plugin-
|
|
46
|
-
"@dxos/plugin-
|
|
47
|
-
"@dxos/plugin-
|
|
48
|
-
"@dxos/plugin-markdown": "0.8.4-main.
|
|
49
|
-
"@dxos/plugin-stack": "0.8.4-main.
|
|
50
|
-
"@dxos/react-client": "0.8.4-main.
|
|
51
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
48
|
+
"@dxos/app-framework": "0.8.4-main.7996785055",
|
|
49
|
+
"@dxos/app-toolkit": "0.8.4-main.7996785055",
|
|
50
|
+
"@dxos/async": "0.8.4-main.7996785055",
|
|
51
|
+
"@dxos/log": "0.8.4-main.7996785055",
|
|
52
|
+
"@dxos/echo": "0.8.4-main.7996785055",
|
|
53
|
+
"@dxos/operation": "0.8.4-main.7996785055",
|
|
54
|
+
"@dxos/plugin-client": "0.8.4-main.7996785055",
|
|
55
|
+
"@dxos/plugin-graph": "0.8.4-main.7996785055",
|
|
56
|
+
"@dxos/plugin-deck": "0.8.4-main.7996785055",
|
|
57
|
+
"@dxos/plugin-markdown": "0.8.4-main.7996785055",
|
|
58
|
+
"@dxos/plugin-stack": "0.8.4-main.7996785055",
|
|
59
|
+
"@dxos/react-client": "0.8.4-main.7996785055",
|
|
60
|
+
"@dxos/react-ui-form": "0.8.4-main.7996785055",
|
|
61
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.7996785055",
|
|
62
|
+
"@dxos/types": "0.8.4-main.7996785055",
|
|
63
|
+
"@dxos/schema": "0.8.4-main.7996785055",
|
|
64
|
+
"@dxos/react-ui-stack": "0.8.4-main.7996785055",
|
|
65
|
+
"@dxos/util": "0.8.4-main.7996785055",
|
|
66
|
+
"@dxos/effect": "0.8.4-main.7996785055"
|
|
56
67
|
},
|
|
57
68
|
"devDependencies": {
|
|
58
|
-
"@effect-atom/atom-react": "^0.
|
|
59
|
-
"@effect/platform": "0.
|
|
60
|
-
"@types/react": "~19.2.
|
|
61
|
-
"@types/react-dom": "~19.2.
|
|
69
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
70
|
+
"@effect/platform": "0.94.4",
|
|
71
|
+
"@types/react": "~19.2.7",
|
|
72
|
+
"@types/react-dom": "~19.2.3",
|
|
62
73
|
"@types/reveal.js": "^5.0.3",
|
|
63
|
-
"effect": "3.
|
|
64
|
-
"react": "~19.2.
|
|
65
|
-
"react-dom": "~19.2.
|
|
66
|
-
"vite": "7.1.
|
|
67
|
-
"@dxos/random": "0.8.4-main.
|
|
68
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
69
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
70
|
-
"@dxos/
|
|
74
|
+
"effect": "3.20.0",
|
|
75
|
+
"react": "~19.2.3",
|
|
76
|
+
"react-dom": "~19.2.3",
|
|
77
|
+
"vite": "^7.1.11",
|
|
78
|
+
"@dxos/random": "0.8.4-main.7996785055",
|
|
79
|
+
"@dxos/react-ui": "0.8.4-main.7996785055",
|
|
80
|
+
"@dxos/storybook-utils": "0.8.4-main.7996785055",
|
|
81
|
+
"@dxos/ui-theme": "0.8.4-main.7996785055"
|
|
71
82
|
},
|
|
72
83
|
"peerDependencies": {
|
|
73
|
-
"@effect-atom/atom-react": "^0.
|
|
74
|
-
"@effect/platform": "
|
|
75
|
-
"effect": "
|
|
76
|
-
"react": "
|
|
77
|
-
"react-dom": "
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/react-ui
|
|
84
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
85
|
+
"@effect/platform": "0.94.4",
|
|
86
|
+
"effect": "3.20.0",
|
|
87
|
+
"react": "~19.2.3",
|
|
88
|
+
"react-dom": "~19.2.3",
|
|
89
|
+
"@dxos/ui-theme": "0.8.4-main.7996785055",
|
|
90
|
+
"@dxos/react-ui": "0.8.4-main.7996785055"
|
|
80
91
|
},
|
|
81
92
|
"publishConfig": {
|
|
82
93
|
"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,25 +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
|
-
id: `${meta.id}/module/translations`,
|
|
22
|
-
activatesOn: Events.SetupTranslations,
|
|
23
|
-
activate: () => contributes(Capabilities.Translations, translations),
|
|
24
|
-
}),
|
|
25
|
-
defineModule({
|
|
26
|
-
id: `${meta.id}/module/react-surface`,
|
|
27
|
-
activatesOn: Events.SetupReactSurface,
|
|
28
|
-
activate: ReactSurface,
|
|
29
|
-
}),
|
|
30
|
-
defineModule({
|
|
31
|
-
id: `${meta.id}/module/app-graph-builder`,
|
|
32
|
-
activatesOn: Events.SetupAppGraph,
|
|
33
|
-
activate: AppGraphBuilder,
|
|
34
|
-
}),
|
|
35
|
-
]);
|
|
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,115 @@
|
|
|
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 {
|
|
10
|
+
AppCapabilities,
|
|
11
|
+
LayoutOperation,
|
|
12
|
+
companionId,
|
|
13
|
+
companionSegment,
|
|
14
|
+
getObjectPathFromObject,
|
|
15
|
+
getSpacePath,
|
|
16
|
+
} from '@dxos/app-toolkit';
|
|
17
|
+
import { Obj } from '@dxos/echo';
|
|
18
|
+
import { Collection } from '@dxos/echo';
|
|
19
|
+
import { Operation } from '@dxos/operation';
|
|
20
|
+
import { DeckCapabilities } from '@dxos/plugin-deck';
|
|
21
|
+
import { PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
22
|
+
import { DeckOperation } from '@dxos/plugin-deck/operations';
|
|
23
|
+
import { GraphBuilder, type Node, NodeMatcher } from '@dxos/plugin-graph';
|
|
24
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
25
|
+
|
|
26
|
+
import { meta } from '../../meta';
|
|
27
|
+
import { PresenterCapabilities } from '../../types';
|
|
28
|
+
import { PresenterOperation } from '../../operations';
|
|
29
|
+
|
|
30
|
+
/** Match nodes that can be presented (Collection or Document). */
|
|
31
|
+
const whenPresentable = (node: Node.Node) =>
|
|
32
|
+
Option.orElse(NodeMatcher.whenEchoType(Collection.Collection)(node), () =>
|
|
33
|
+
NodeMatcher.whenEchoType(Markdown.Document)(node),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export default Capability.makeModule(
|
|
37
|
+
Effect.fnUntraced(function* () {
|
|
38
|
+
const capabilities = yield* Capability.Service;
|
|
39
|
+
|
|
40
|
+
const extensions = yield* GraphBuilder.createExtension({
|
|
41
|
+
id: `${meta.id}.root`,
|
|
42
|
+
// TODO(wittjosiah): This is a hack to work around presenter previously relying on "variant". Remove.
|
|
43
|
+
match: whenPresentable,
|
|
44
|
+
connector: (object, get) => {
|
|
45
|
+
const settingsAtom = capabilities.get(PresenterCapabilities.Settings);
|
|
46
|
+
const settings = get(settingsAtom);
|
|
47
|
+
const isPresentable = settings?.presentCollections
|
|
48
|
+
? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)
|
|
49
|
+
: Obj.instanceOf(Markdown.Document, object);
|
|
50
|
+
if (!isPresentable) {
|
|
51
|
+
return Effect.succeed([]);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return Effect.succeed([
|
|
55
|
+
{
|
|
56
|
+
id: companionSegment('presenter'),
|
|
57
|
+
data: { type: meta.id, object },
|
|
58
|
+
type: PLANK_COMPANION_TYPE,
|
|
59
|
+
properties: {
|
|
60
|
+
label: 'Presenter',
|
|
61
|
+
icon: 'ph--presentation--regular',
|
|
62
|
+
disposition: 'hidden',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
]);
|
|
66
|
+
},
|
|
67
|
+
actions: (object, get) => {
|
|
68
|
+
const settingsAtom = capabilities.get(PresenterCapabilities.Settings);
|
|
69
|
+
const settings = get(settingsAtom);
|
|
70
|
+
const isPresentable = settings?.presentCollections
|
|
71
|
+
? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)
|
|
72
|
+
: Obj.instanceOf(Markdown.Document, object);
|
|
73
|
+
const db = Obj.getDatabase(object);
|
|
74
|
+
if (!isPresentable || !db) {
|
|
75
|
+
return Effect.succeed([]);
|
|
76
|
+
}
|
|
77
|
+
const objectPath = getObjectPathFromObject(object);
|
|
78
|
+
|
|
79
|
+
return Effect.succeed([
|
|
80
|
+
{
|
|
81
|
+
id: PresenterOperation.TogglePresentation.meta.key,
|
|
82
|
+
// TODO(burdon): Allow function so can generate state when activated.
|
|
83
|
+
// So can set explicit fullscreen state coordinated with current presenter state.
|
|
84
|
+
data: Effect.fnUntraced(function* () {
|
|
85
|
+
const deckState = yield* Capabilities.getAtomValue(DeckCapabilities.State);
|
|
86
|
+
const deck = deckState.decks[deckState.activeDeck];
|
|
87
|
+
const presenterId = companionId(objectPath, 'presenter');
|
|
88
|
+
if (!deck?.fullscreen) {
|
|
89
|
+
yield* Operation.invoke(DeckOperation.Adjust, {
|
|
90
|
+
type: 'solo--fullscreen' as const,
|
|
91
|
+
id: presenterId,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
yield* Operation.invoke(LayoutOperation.Open, {
|
|
95
|
+
subject: [presenterId],
|
|
96
|
+
workspace: getSpacePath(db.spaceId),
|
|
97
|
+
});
|
|
98
|
+
}),
|
|
99
|
+
properties: {
|
|
100
|
+
label: ['toggle presentation label', { ns: meta.id }],
|
|
101
|
+
icon: 'ph--presentation--regular',
|
|
102
|
+
disposition: 'list-item',
|
|
103
|
+
keyBinding: {
|
|
104
|
+
macos: 'shift+meta+p',
|
|
105
|
+
windows: 'shift+alt+p',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
]);
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
114
|
+
}),
|
|
115
|
+
);
|
|
@@ -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
|
+
);
|
|
@@ -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
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
|
},
|
|
@@ -6,14 +6,14 @@ 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
|
-
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
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
|
},
|
|
@@ -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/react-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
|
+
);
|
|
@@ -23,9 +23,9 @@ const DefaultStory = ({ count = 20 }: PagerProps) => {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const meta = {
|
|
26
|
-
title: 'plugins/plugin-presenter/Pager',
|
|
26
|
+
title: 'plugins/plugin-presenter/components/Pager',
|
|
27
27
|
render: DefaultStory,
|
|
28
|
-
decorators: [withTheme],
|
|
28
|
+
decorators: [withTheme()],
|
|
29
29
|
parameters: {
|
|
30
30
|
layout: 'centered',
|
|
31
31
|
},
|
|
@@ -14,8 +14,8 @@ export type PagerProps = {
|
|
|
14
14
|
onExit?: () => void;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export const Pager = ({ index:
|
|
18
|
-
const [index, setIndex] = useControlledState(
|
|
17
|
+
export const Pager = ({ index: indexProp = 0, count = 0, keys, onChange, onExit }: PagerProps) => {
|
|
18
|
+
const [index, setIndex] = useControlledState(indexProp);
|
|
19
19
|
useEffect(() => {
|
|
20
20
|
onChange?.(index);
|
|
21
21
|
}, [index]);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Meta } 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
9
|
import CONTENT from '../../../testing/deck.md?raw';
|
|
10
10
|
import { translations } from '../../translations';
|
|
@@ -20,9 +20,9 @@ import { RevealPlayer } from './RevealPlayer';
|
|
|
20
20
|
// https://fonts.google.com
|
|
21
21
|
|
|
22
22
|
const meta = {
|
|
23
|
-
title: 'plugins/plugin-presenter/RevealPlayer',
|
|
23
|
+
title: 'plugins/plugin-presenter/components/RevealPlayer',
|
|
24
24
|
component: RevealPlayer,
|
|
25
|
-
decorators: [withTheme],
|
|
25
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
26
26
|
parameters: {
|
|
27
27
|
layout: 'fullscreen',
|
|
28
28
|
translations,
|