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