@dxos/plugin-presenter 0.8.4-main.3c1ae3b → 0.8.4-main.3eb6e50203

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.
Files changed (107) hide show
  1. package/dist/lib/browser/CollectionPresenterContainer-WE7HOMFY.mjs +176 -0
  2. package/dist/lib/browser/CollectionPresenterContainer-WE7HOMFY.mjs.map +7 -0
  3. package/dist/lib/browser/DocumentPresenterContainer-3BU2DS5E.mjs +173 -0
  4. package/dist/lib/browser/DocumentPresenterContainer-3BU2DS5E.mjs.map +7 -0
  5. package/dist/lib/browser/{MarkdownSlide-MEXR54L5.mjs → MarkdownSlide-GIYJABHE.mjs} +54 -77
  6. package/dist/lib/browser/MarkdownSlide-GIYJABHE.mjs.map +7 -0
  7. package/dist/lib/browser/app-graph-builder-OH6QU3DC.mjs +113 -0
  8. package/dist/lib/browser/app-graph-builder-OH6QU3DC.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-46CHA6Y5.mjs +41 -0
  10. package/dist/lib/browser/chunk-46CHA6Y5.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-4PZXJXBO.mjs +50 -0
  12. package/dist/lib/browser/chunk-4PZXJXBO.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-L7QYO6LF.mjs +38 -0
  14. package/dist/lib/browser/chunk-L7QYO6LF.mjs.map +7 -0
  15. package/dist/lib/browser/{chunk-TMTUZQCK.mjs → chunk-VQVZVXPJ.mjs} +1 -1
  16. package/dist/lib/browser/chunk-VQVZVXPJ.mjs.map +7 -0
  17. package/dist/lib/browser/index.mjs +24 -30
  18. package/dist/lib/browser/index.mjs.map +4 -4
  19. package/dist/lib/browser/meta.json +1 -1
  20. package/dist/lib/browser/{react-surface-S4T6X72R.mjs → react-surface-QY4ETW6S.mjs} +25 -18
  21. package/dist/lib/browser/react-surface-QY4ETW6S.mjs.map +7 -0
  22. package/dist/lib/browser/settings-OLQ7QNLC.mjs +32 -0
  23. package/dist/lib/browser/settings-OLQ7QNLC.mjs.map +7 -0
  24. package/dist/types/src/PresenterPlugin.d.ts +2 -1
  25. package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
  26. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  27. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  28. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  29. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  30. package/dist/types/src/capabilities/index.d.ts +3 -3
  31. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  32. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  33. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  34. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  35. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  36. package/dist/types/src/capabilities/settings/index.d.ts +7 -0
  37. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  38. package/dist/types/src/capabilities/settings/settings.d.ts +10 -0
  39. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  40. package/dist/types/src/components/CollectionPresenterContainer.d.ts +4 -4
  41. package/dist/types/src/components/CollectionPresenterContainer.d.ts.map +1 -1
  42. package/dist/types/src/components/MarkdownSlide.d.ts +4 -3
  43. package/dist/types/src/components/MarkdownSlide.d.ts.map +1 -1
  44. package/dist/types/src/components/Presenter/Pager.d.ts +1 -1
  45. package/dist/types/src/components/Presenter/Pager.d.ts.map +1 -1
  46. package/dist/types/src/components/PresenterSettings.d.ts +4 -2
  47. package/dist/types/src/components/PresenterSettings.d.ts.map +1 -1
  48. package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
  49. package/dist/types/src/components/index.d.ts +18 -17
  50. package/dist/types/src/components/index.d.ts.map +1 -1
  51. package/dist/types/src/meta.d.ts +2 -2
  52. package/dist/types/src/meta.d.ts.map +1 -1
  53. package/dist/types/src/types.d.ts +35 -23
  54. package/dist/types/src/types.d.ts.map +1 -1
  55. package/dist/types/src/useExitPresenter.d.ts +2 -3
  56. package/dist/types/src/useExitPresenter.d.ts.map +1 -1
  57. package/dist/types/tsconfig.tsbuildinfo +1 -1
  58. package/package.json +46 -40
  59. package/src/PresenterPlugin.tsx +9 -23
  60. package/src/capabilities/app-graph-builder/app-graph-builder.ts +106 -0
  61. package/src/capabilities/app-graph-builder/index.ts +7 -0
  62. package/src/capabilities/index.ts +3 -5
  63. package/src/capabilities/react-surface/index.ts +7 -0
  64. package/src/capabilities/react-surface/react-surface.tsx +71 -0
  65. package/src/capabilities/settings/index.ts +7 -0
  66. package/src/capabilities/settings/settings.ts +31 -0
  67. package/src/components/CollectionPresenterContainer.tsx +13 -13
  68. package/src/components/DocumentPresenterContainer.tsx +3 -3
  69. package/src/components/Markdown/Container.stories.tsx +1 -1
  70. package/src/components/Markdown/Container.tsx +1 -1
  71. package/src/components/Markdown/Slide.stories.tsx +1 -1
  72. package/src/components/MarkdownSlide.tsx +6 -2
  73. package/src/components/Presenter/Layout.tsx +1 -1
  74. package/src/components/Presenter/Pager.stories.tsx +1 -1
  75. package/src/components/Presenter/Pager.tsx +2 -2
  76. package/src/components/PresenterSettings.tsx +16 -11
  77. package/src/components/RevealPlayer/RevealPlayer.stories.tsx +1 -1
  78. package/src/components/RevealPlayer/RevealPlayer.tsx +4 -1
  79. package/src/meta.ts +2 -2
  80. package/src/types.ts +14 -6
  81. package/src/useExitPresenter.ts +22 -24
  82. package/dist/lib/browser/CollectionPresenterContainer-4JFW3EKV.mjs +0 -199
  83. package/dist/lib/browser/CollectionPresenterContainer-4JFW3EKV.mjs.map +0 -7
  84. package/dist/lib/browser/DocumentPresenterContainer-SX32NAEH.mjs +0 -183
  85. package/dist/lib/browser/DocumentPresenterContainer-SX32NAEH.mjs.map +0 -7
  86. package/dist/lib/browser/MarkdownSlide-MEXR54L5.mjs.map +0 -7
  87. package/dist/lib/browser/app-graph-builder-UJEKUKAP.mjs +0 -106
  88. package/dist/lib/browser/app-graph-builder-UJEKUKAP.mjs.map +0 -7
  89. package/dist/lib/browser/chunk-BJWK5GQV.mjs +0 -38
  90. package/dist/lib/browser/chunk-BJWK5GQV.mjs.map +0 -7
  91. package/dist/lib/browser/chunk-Q3H4KEFB.mjs +0 -41
  92. package/dist/lib/browser/chunk-Q3H4KEFB.mjs.map +0 -7
  93. package/dist/lib/browser/chunk-TMTUZQCK.mjs.map +0 -7
  94. package/dist/lib/browser/chunk-VRRPVTKA.mjs +0 -39
  95. package/dist/lib/browser/chunk-VRRPVTKA.mjs.map +0 -7
  96. package/dist/lib/browser/react-surface-S4T6X72R.mjs.map +0 -7
  97. package/dist/lib/browser/settings-57TUVRW3.mjs +0 -22
  98. package/dist/lib/browser/settings-57TUVRW3.mjs.map +0 -7
  99. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  100. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  101. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  102. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  103. package/dist/types/src/capabilities/settings.d.ts +0 -4
  104. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  105. package/src/capabilities/app-graph-builder.ts +0 -117
  106. package/src/capabilities/react-surface.tsx +0 -63
  107. 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.3c1ae3b",
3
+ "version": "0.8.4-main.3eb6e50203",
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
  ".": {
17
+ "browser": "./dist/lib/browser/index.mjs",
13
18
  "source": "./src/index.ts",
14
- "types": "./dist/types/src/index.d.ts",
15
- "browser": "./dist/lib/browser/index.mjs"
19
+ "types": "./dist/types/src/index.d.ts"
16
20
  }
17
21
  },
18
22
  "types": "dist/types/src/index.d.ts",
@@ -24,8 +28,8 @@
24
28
  "src"
25
29
  ],
26
30
  "dependencies": {
27
- "@preact-signals/safe-react": "^0.9.0",
28
- "@preact/signals-core": "^1.12.1",
31
+ "@effect-atom/atom": "^0.5.1",
32
+ "@effect-atom/atom-react": "^0.5.0",
29
33
  "hastscript": "^7.1.0",
30
34
  "highlight.js": "^11.9.0",
31
35
  "marked": "^12.0.2",
@@ -36,47 +40,49 @@
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.3c1ae3b",
40
- "@dxos/async": "0.8.4-main.3c1ae3b",
41
- "@dxos/log": "0.8.4-main.3c1ae3b",
42
- "@dxos/live-object": "0.8.4-main.3c1ae3b",
43
- "@dxos/local-storage": "0.8.4-main.3c1ae3b",
44
- "@dxos/plugin-client": "0.8.4-main.3c1ae3b",
45
- "@dxos/echo": "0.8.4-main.3c1ae3b",
46
- "@dxos/plugin-deck": "0.8.4-main.3c1ae3b",
47
- "@dxos/plugin-graph": "0.8.4-main.3c1ae3b",
48
- "@dxos/plugin-stack": "0.8.4-main.3c1ae3b",
49
- "@dxos/react-client": "0.8.4-main.3c1ae3b",
50
- "@dxos/plugin-markdown": "0.8.4-main.3c1ae3b",
51
- "@dxos/react-ui-form": "0.8.4-main.3c1ae3b",
52
- "@dxos/react-ui-stack": "0.8.4-main.3c1ae3b",
53
- "@dxos/schema": "0.8.4-main.3c1ae3b",
54
- "@dxos/util": "0.8.4-main.3c1ae3b",
55
- "@dxos/types": "0.8.4-main.3c1ae3b"
43
+ "@dxos/app-toolkit": "0.8.4-main.3eb6e50203",
44
+ "@dxos/echo": "0.8.4-main.3eb6e50203",
45
+ "@dxos/effect": "0.8.4-main.3eb6e50203",
46
+ "@dxos/log": "0.8.4-main.3eb6e50203",
47
+ "@dxos/app-framework": "0.8.4-main.3eb6e50203",
48
+ "@dxos/operation": "0.8.4-main.3eb6e50203",
49
+ "@dxos/plugin-deck": "0.8.4-main.3eb6e50203",
50
+ "@dxos/plugin-markdown": "0.8.4-main.3eb6e50203",
51
+ "@dxos/plugin-client": "0.8.4-main.3eb6e50203",
52
+ "@dxos/plugin-graph": "0.8.4-main.3eb6e50203",
53
+ "@dxos/react-client": "0.8.4-main.3eb6e50203",
54
+ "@dxos/plugin-stack": "0.8.4-main.3eb6e50203",
55
+ "@dxos/react-ui-form": "0.8.4-main.3eb6e50203",
56
+ "@dxos/react-ui-stack": "0.8.4-main.3eb6e50203",
57
+ "@dxos/react-ui-mosaic": "0.8.4-main.3eb6e50203",
58
+ "@dxos/async": "0.8.4-main.3eb6e50203",
59
+ "@dxos/types": "0.8.4-main.3eb6e50203",
60
+ "@dxos/schema": "0.8.4-main.3eb6e50203",
61
+ "@dxos/util": "0.8.4-main.3eb6e50203"
56
62
  },
57
63
  "devDependencies": {
58
- "@effect-atom/atom-react": "^0.3.4",
59
- "@effect/platform": "0.92.1",
60
- "@types/react": "~19.2.2",
61
- "@types/react-dom": "~19.2.2",
64
+ "@effect-atom/atom-react": "^0.5.0",
65
+ "@effect/platform": "0.94.4",
66
+ "@types/react": "~19.2.7",
67
+ "@types/react-dom": "~19.2.3",
62
68
  "@types/reveal.js": "^5.0.3",
63
- "effect": "3.18.3",
64
- "react": "~19.2.0",
65
- "react-dom": "~19.2.0",
69
+ "effect": "3.19.16",
70
+ "react": "~19.2.3",
71
+ "react-dom": "~19.2.3",
66
72
  "vite": "7.1.9",
67
- "@dxos/random": "0.8.4-main.3c1ae3b",
68
- "@dxos/react-ui-theme": "0.8.4-main.3c1ae3b",
69
- "@dxos/storybook-utils": "0.8.4-main.3c1ae3b",
70
- "@dxos/react-ui": "0.8.4-main.3c1ae3b"
73
+ "@dxos/random": "0.8.4-main.3eb6e50203",
74
+ "@dxos/react-ui": "0.8.4-main.3eb6e50203",
75
+ "@dxos/storybook-utils": "0.8.4-main.3eb6e50203",
76
+ "@dxos/ui-theme": "0.8.4-main.3eb6e50203"
71
77
  },
72
78
  "peerDependencies": {
73
- "@effect-atom/atom-react": "^0.3.4",
74
- "@effect/platform": "^0.80.12",
75
- "effect": "^3.13.3",
76
- "react": "^19.0.0",
77
- "react-dom": "^19.0.0",
78
- "@dxos/react-ui": "0.8.4-main.3c1ae3b",
79
- "@dxos/react-ui-theme": "0.8.4-main.3c1ae3b"
79
+ "@effect-atom/atom-react": "^0.5.0",
80
+ "@effect/platform": "0.94.4",
81
+ "effect": "3.19.16",
82
+ "react": "~19.2.3",
83
+ "react-dom": "~19.2.3",
84
+ "@dxos/react-ui": "0.8.4-main.3eb6e50203",
85
+ "@dxos/ui-theme": "0.8.4-main.3eb6e50203"
80
86
  },
81
87
  "publishConfig": {
82
88
  "access": "public"
@@ -2,7 +2,8 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';
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 = definePlugin(meta, () => [
15
- defineModule({
16
- id: `${meta.id}/module/settings`,
17
- activatesOn: Events.SetupSettings,
18
- activate: PresenterSettings,
19
- }),
20
- defineModule({
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,106 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import * as Option from 'effect/Option';
7
+
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
10
+ import { Obj } from '@dxos/echo';
11
+ import { Operation } from '@dxos/operation';
12
+ import { DeckCapabilities } from '@dxos/plugin-deck';
13
+ import { ATTENDABLE_PATH_SEPARATOR, DeckOperation } from '@dxos/plugin-deck/types';
14
+ import { GraphBuilder, type Node, NodeMatcher } from '@dxos/plugin-graph';
15
+ import { Markdown } from '@dxos/plugin-markdown/types';
16
+ import { Collection } from '@dxos/schema';
17
+
18
+ import { meta } from '../../meta';
19
+ import { PresenterCapabilities, PresenterOperation } from '../../types';
20
+
21
+ /** Match nodes that can be presented (Collection or Document). */
22
+ const whenPresentable = (node: Node.Node) =>
23
+ Option.orElse(NodeMatcher.whenEchoType(Collection.Collection)(node), () =>
24
+ NodeMatcher.whenEchoType(Markdown.Document)(node),
25
+ );
26
+
27
+ export default Capability.makeModule(
28
+ Effect.fnUntraced(function* () {
29
+ const capabilities = yield* Capability.Service;
30
+
31
+ const extensions = yield* GraphBuilder.createExtension({
32
+ id: `${meta.id}/root`,
33
+ // TODO(wittjosiah): This is a hack to work around presenter previously relying on "variant". Remove.
34
+ match: whenPresentable,
35
+ connector: (object, get) => {
36
+ const settingsAtom = capabilities.get(PresenterCapabilities.Settings);
37
+ const settings = get(settingsAtom);
38
+ const isPresentable = settings?.presentCollections
39
+ ? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)
40
+ : Obj.instanceOf(Markdown.Document, object);
41
+ if (!isPresentable) {
42
+ return Effect.succeed([]);
43
+ }
44
+ const id = Obj.getDXN(object).toString();
45
+ return Effect.succeed([
46
+ {
47
+ id: [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR),
48
+ data: { type: meta.id, object },
49
+ type: meta.id,
50
+ properties: {
51
+ label: 'Presenter',
52
+ icon: 'ph--presentation--regular',
53
+ disposition: 'hidden',
54
+ },
55
+ },
56
+ ]);
57
+ },
58
+ actions: (object, get) => {
59
+ const settingsAtom = capabilities.get(PresenterCapabilities.Settings);
60
+ const settings = get(settingsAtom);
61
+ const isPresentable = settings?.presentCollections
62
+ ? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)
63
+ : Obj.instanceOf(Markdown.Document, object);
64
+ if (!isPresentable) {
65
+ return Effect.succeed([]);
66
+ }
67
+ const dxn = Obj.getDXN(object);
68
+ const id = dxn.toString();
69
+ const { spaceId } = dxn.asEchoDXN()!;
70
+ return Effect.succeed([
71
+ {
72
+ id: `${PresenterOperation.TogglePresentation.meta.key}/${id}`,
73
+ // TODO(burdon): Allow function so can generate state when activated.
74
+ // So can set explicit fullscreen state coordinated with current presenter state.
75
+ data: Effect.fnUntraced(function* () {
76
+ const deckState = yield* Capabilities.getAtomValue(DeckCapabilities.State);
77
+ const deck = deckState.decks[deckState.activeDeck];
78
+ const presenterId = [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR);
79
+ if (!deck?.fullscreen) {
80
+ yield* Operation.invoke(DeckOperation.Adjust, {
81
+ type: 'solo--fullscreen' as const,
82
+ id: presenterId,
83
+ });
84
+ }
85
+ yield* Operation.invoke(LayoutOperation.Open, {
86
+ subject: [presenterId],
87
+ workspace: spaceId,
88
+ });
89
+ }),
90
+ properties: {
91
+ label: ['toggle presentation label', { ns: meta.id }],
92
+ icon: 'ph--presentation--regular',
93
+ disposition: 'list-item',
94
+ keyBinding: {
95
+ macos: 'shift+meta+p',
96
+ windows: 'shift+alt+p',
97
+ },
98
+ },
99
+ },
100
+ ]);
101
+ },
102
+ });
103
+
104
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
105
+ }),
106
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
@@ -2,8 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from '@dxos/app-framework';
6
-
7
- export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
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,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -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 { Markdown } from '@dxos/plugin-markdown/types';
13
+ import { Collection } from '@dxos/schema';
14
+
15
+ import {
16
+ CollectionPresenterContainer,
17
+ DocumentPresenterContainer,
18
+ MarkdownSlide,
19
+ PresenterSettings,
20
+ } from '../../components';
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,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const PresenterSettings = Capability.lazy('PresenterSettings', () => import('./settings'));
@@ -0,0 +1,31 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities } from '@dxos/app-toolkit';
9
+ import { createKvsStore } from '@dxos/effect';
10
+
11
+ import { meta } from '../../meta';
12
+ import { PresenterCapabilities, PresenterSettingsSchema } from '../../types';
13
+
14
+ export default Capability.makeModule(() =>
15
+ Effect.sync(() => {
16
+ const settingsAtom = createKvsStore({
17
+ key: meta.id,
18
+ schema: PresenterSettingsSchema,
19
+ defaultValue: () => ({}),
20
+ });
21
+
22
+ return [
23
+ Capability.contributes(PresenterCapabilities.Settings, settingsAtom),
24
+ Capability.contributes(AppCapabilities.Settings, {
25
+ prefix: meta.id,
26
+ schema: PresenterSettingsSchema,
27
+ atom: settingsAtom,
28
+ }),
29
+ ];
30
+ }),
31
+ );
@@ -2,27 +2,28 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import React, { type FC, useContext, useState } from 'react';
5
+ import React, { useContext, useState } from 'react';
6
6
 
7
- import { Surface } from '@dxos/app-framework/react';
8
- import { StackItem } from '@dxos/react-ui-stack';
7
+ import { Surface } from '@dxos/app-framework/ui';
8
+ import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
9
+ import { Layout } from '@dxos/react-ui';
9
10
  import { type Collection } from '@dxos/schema';
10
11
 
11
12
  import { PresenterContext } from '../types';
12
13
  import { useExitPresenter } from '../useExitPresenter';
13
14
 
14
- import { Layout, PageNumber, Pager } from './Presenter';
15
+ import { PageNumber, Pager, Layout as PresenterLayout } from './Presenter';
15
16
 
16
- const CollectionPresenterContainer: FC<{ collection: Collection.Collection }> = ({ collection }) => {
17
- const [slide, setSlide] = useState(0);
17
+ type CollectionPresenterContainerProps = SurfaceComponentProps<Collection.Collection>;
18
18
 
19
+ const CollectionPresenterContainer = ({ role, subject: collection }: CollectionPresenterContainerProps) => {
20
+ const [slide, setSlide] = useState(0);
19
21
  const { running } = useContext(PresenterContext);
20
-
21
22
  const handleExit = useExitPresenter(collection);
22
23
 
23
24
  return (
24
- <StackItem.Content classNames='relative'>
25
- <Layout
25
+ <Layout.Main role={role} classNames='relative'>
26
+ <PresenterLayout
26
27
  bottomRight={<PageNumber index={slide} count={collection.objects.length} />}
27
28
  bottomLeft={
28
29
  <Pager
@@ -34,10 +35,9 @@ const CollectionPresenterContainer: FC<{ collection: Collection.Collection }> =
34
35
  />
35
36
  }
36
37
  >
37
- {/* TODO(wittjosiah): Better slide placeholder. */}
38
- <Surface role='slide' data={{ subject: collection.objects[slide] }} placeholder={<></>} />
39
- </Layout>
40
- </StackItem.Content>
38
+ <Surface.Surface role='slide' data={{ subject: collection.objects[slide] }} />
39
+ </PresenterLayout>
40
+ </Layout.Main>
41
41
  );
42
42
  };
43
43
 
@@ -4,7 +4,7 @@
4
4
  import React, { type FC } from 'react';
5
5
 
6
6
  import { type Markdown } from '@dxos/plugin-markdown/types';
7
- import { StackItem } from '@dxos/react-ui-stack';
7
+ import { Layout } from '@dxos/react-ui';
8
8
 
9
9
  import { useExitPresenter } from '../useExitPresenter';
10
10
 
@@ -14,9 +14,9 @@ const DocumentPresenterContainer: FC<{ document: Markdown.Document }> = ({ docum
14
14
  const handleExit = useExitPresenter(document);
15
15
 
16
16
  return (
17
- <StackItem.Content classNames='relative'>
17
+ <Layout.Main classNames='relative'>
18
18
  <RevealPlayer content={document.content.target?.content ?? ''} onExit={handleExit} />
19
- </StackItem.Content>
19
+ </Layout.Main>
20
20
  );
21
21
  };
22
22
 
@@ -23,7 +23,7 @@ const DefaultStory = ({ content = '' }: SlideProps) => {
23
23
  const meta = {
24
24
  title: 'plugins/plugin-presenter/Container',
25
25
  render: DefaultStory,
26
- decorators: [withTheme],
26
+ decorators: [withTheme()],
27
27
  parameters: {
28
28
  layout: 'fullscreen',
29
29
  },
@@ -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/react-ui-theme';
9
+ import { mx } from '@dxos/ui-theme';
10
10
 
11
11
  export type ContainerProps = ThemedClassName<PropsWithChildren<{}>>;
12
12
 
@@ -13,7 +13,7 @@ import { Slide } from './Slide';
13
13
  const meta = {
14
14
  title: 'plugins/plugin-presenter/Slide',
15
15
  component: Slide,
16
- decorators: [withTheme],
16
+ decorators: [withTheme()],
17
17
  parameters: {
18
18
  layout: 'fullscreen',
19
19
  },
@@ -2,13 +2,17 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import React, { type FC } from 'react';
5
+ import React from 'react';
6
6
 
7
7
  import { type Markdown } from '@dxos/plugin-markdown/types';
8
8
 
9
9
  import { Container, Slide } from './Markdown';
10
10
 
11
- const MarkdownSlide: FC<{ document: Markdown.Document }> = ({ document }) => {
11
+ type MarkdownSlideProps = {
12
+ document: Markdown.Document;
13
+ };
14
+
15
+ const MarkdownSlide = ({ document }: MarkdownSlideProps) => {
12
16
  const content = document.content.target?.content;
13
17
  if (!content) {
14
18
  return null;
@@ -5,7 +5,7 @@
5
5
  import React, { type PropsWithChildren, type ReactNode } from 'react';
6
6
 
7
7
  import { type ThemedClassName } from '@dxos/react-ui';
8
- import { mx } from '@dxos/react-ui-theme';
8
+ import { mx } from '@dxos/ui-theme';
9
9
 
10
10
  export type LayoutProps = ThemedClassName<
11
11
  PropsWithChildren<{
@@ -25,7 +25,7 @@ const DefaultStory = ({ count = 20 }: PagerProps) => {
25
25
  const meta = {
26
26
  title: 'plugins/plugin-presenter/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: indexParam = 0, count = 0, keys, onChange, onExit }: PagerProps) => {
18
- const [index, setIndex] = useControlledState(indexParam);
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]);
@@ -5,26 +5,31 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { Input, useTranslation } from '@dxos/react-ui';
8
- import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
8
+ import { Settings } from '@dxos/react-ui-form';
9
9
 
10
10
  import { meta } from '../meta';
11
11
  import { type PresenterSettingsProps } from '../types';
12
12
 
13
- export const PresenterSettings = ({ settings }: { settings: PresenterSettingsProps }) => {
13
+ export type PresenterSettingsComponentProps = {
14
+ settings: PresenterSettingsProps;
15
+ onSettingsChange: (fn: (current: PresenterSettingsProps) => PresenterSettingsProps) => void;
16
+ };
17
+
18
+ export const PresenterSettings = ({ settings, onSettingsChange }: PresenterSettingsComponentProps) => {
14
19
  const { t } = useTranslation(meta.id);
15
20
 
16
21
  return (
17
- <ControlPage>
18
- <ControlSection title={t('settings title', { ns: meta.id })}>
19
- <ControlGroup>
20
- <ControlItemInput title={t('present collections label')}>
22
+ <Settings.Root>
23
+ <Settings.Section title={t('settings title', { ns: meta.id })}>
24
+ <Settings.Group>
25
+ <Settings.ItemInput title={t('present collections label')}>
21
26
  <Input.Switch
22
27
  checked={settings.presentCollections}
23
- onCheckedChange={(checked) => (settings.presentCollections = !!checked)}
28
+ onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, presentCollections: !!checked }))}
24
29
  />
25
- </ControlItemInput>
26
- </ControlGroup>
27
- </ControlSection>
28
- </ControlPage>
30
+ </Settings.ItemInput>
31
+ </Settings.Group>
32
+ </Settings.Section>
33
+ </Settings.Root>
29
34
  );
30
35
  };
@@ -22,7 +22,7 @@ import { RevealPlayer } from './RevealPlayer';
22
22
  const meta = {
23
23
  title: 'plugins/plugin-presenter/RevealPlayer',
24
24
  component: RevealPlayer,
25
- decorators: [withTheme],
25
+ decorators: [withTheme()],
26
26
  parameters: {
27
27
  layout: 'fullscreen',
28
28
  translations,
@@ -18,7 +18,7 @@ import RevealHighlight from 'reveal.js/plugin/highlight/highlight';
18
18
  import RevealMarkdown from 'reveal.js/plugin/markdown/plugin.js';
19
19
 
20
20
  import { type ThemedClassName, useAsyncEffect } from '@dxos/react-ui';
21
- import { mx } from '@dxos/react-ui-theme';
21
+ import { mx } from '@dxos/ui-theme';
22
22
 
23
23
  const styles = `
24
24
  <style type="text/css">
@@ -91,6 +91,9 @@ export const RevealPlayer = ({ classNames, content, slide, fullscreen = true, on
91
91
  slideNumber: false,
92
92
  embedded: true,
93
93
 
94
+ // Disable autoplay to prevent errors in headless environments (e.g., CI).
95
+ autoPlayMedia: false,
96
+
94
97
  // TODO(burdon): Speaker view requires server to serve popout window.
95
98
  // https://revealjs.com/speaker-view
96
99
  showNotes: false,