@dxos/plugin-presenter 0.8.4-main.ae835ea → 0.8.4-main.bcb3aa67d6

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 (140) hide show
  1. package/dist/lib/browser/PresenterSettings-DSPIGNOL.mjs +32 -0
  2. package/dist/lib/browser/PresenterSettings-DSPIGNOL.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  4. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +533 -46
  6. package/dist/lib/browser/index.mjs.map +4 -4
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/operations/index.mjs +30 -0
  9. package/dist/lib/browser/operations/index.mjs.map +7 -0
  10. package/dist/types/src/PresenterPlugin.d.ts +2 -1
  11. package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
  12. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  13. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  14. package/dist/types/src/capabilities/index.d.ts +8 -3
  15. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  16. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  17. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  18. package/dist/types/src/capabilities/settings.d.ts +8 -2
  19. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  20. package/dist/types/src/components/Markdown/Panel.d.ts +8 -0
  21. package/dist/types/src/components/Markdown/Panel.d.ts.map +1 -0
  22. package/dist/types/src/components/Markdown/{Container.stories.d.ts → Panel.stories.d.ts} +1 -1
  23. package/dist/types/src/components/Markdown/Panel.stories.d.ts.map +1 -0
  24. package/dist/types/src/components/Markdown/index.d.ts +1 -1
  25. package/dist/types/src/components/Markdown/index.d.ts.map +1 -1
  26. package/dist/types/src/components/Presenter/Layout.d.ts +9 -5
  27. package/dist/types/src/components/Presenter/Layout.d.ts.map +1 -1
  28. package/dist/types/src/components/Presenter/Pager.d.ts +1 -1
  29. package/dist/types/src/components/Presenter/Pager.d.ts.map +1 -1
  30. package/dist/types/src/components/PresenterSettings/PresenterSettings.d.ts +6 -0
  31. package/dist/types/src/components/PresenterSettings/PresenterSettings.d.ts.map +1 -0
  32. package/dist/types/src/components/PresenterSettings/PresenterSettings.stories.d.ts +25 -0
  33. package/dist/types/src/components/PresenterSettings/PresenterSettings.stories.d.ts.map +1 -0
  34. package/dist/types/src/components/PresenterSettings/index.d.ts +3 -0
  35. package/dist/types/src/components/PresenterSettings/index.d.ts.map +1 -0
  36. package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts +9 -4
  37. package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
  38. package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +12 -5
  39. package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts.map +1 -1
  40. package/dist/types/src/components/index.d.ts +5 -27
  41. package/dist/types/src/components/index.d.ts.map +1 -1
  42. package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts +7 -0
  43. package/dist/types/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.d.ts.map +1 -0
  44. package/dist/types/src/containers/CollectionPresenterContainer/index.d.ts +3 -0
  45. package/dist/types/src/containers/CollectionPresenterContainer/index.d.ts.map +1 -0
  46. package/dist/types/src/{components/MarkdownSlide.d.ts → containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts} +2 -3
  47. package/dist/types/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts.map +1 -0
  48. package/dist/types/src/containers/DocumentPresenterContainer/index.d.ts +3 -0
  49. package/dist/types/src/containers/DocumentPresenterContainer/index.d.ts.map +1 -0
  50. package/dist/types/src/containers/MarkdownSlide/MarkdownSlide.d.ts +8 -0
  51. package/dist/types/src/containers/MarkdownSlide/MarkdownSlide.d.ts.map +1 -0
  52. package/dist/types/src/containers/MarkdownSlide/index.d.ts +3 -0
  53. package/dist/types/src/containers/MarkdownSlide/index.d.ts.map +1 -0
  54. package/dist/types/src/containers/index.d.ts +5 -0
  55. package/dist/types/src/containers/index.d.ts.map +1 -0
  56. package/dist/types/src/meta.d.ts +2 -2
  57. package/dist/types/src/meta.d.ts.map +1 -1
  58. package/dist/types/src/operations/definitions.d.ts +17 -0
  59. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  60. package/dist/types/src/operations/index.d.ts +2 -0
  61. package/dist/types/src/operations/index.d.ts.map +1 -0
  62. package/dist/types/src/translations.d.ts +6 -5
  63. package/dist/types/src/translations.d.ts.map +1 -1
  64. package/dist/types/src/types/Settings.d.ts +6 -0
  65. package/dist/types/src/types/Settings.d.ts.map +1 -0
  66. package/dist/types/src/types/index.d.ts +18 -0
  67. package/dist/types/src/types/index.d.ts.map +1 -0
  68. package/dist/types/src/useExitPresenter.d.ts +3 -4
  69. package/dist/types/src/useExitPresenter.d.ts.map +1 -1
  70. package/dist/types/tsconfig.tsbuildinfo +1 -1
  71. package/package.json +62 -40
  72. package/src/PresenterPlugin.tsx +12 -25
  73. package/src/capabilities/app-graph-builder.ts +91 -100
  74. package/src/capabilities/index.ts +4 -4
  75. package/src/capabilities/react-surface.tsx +57 -53
  76. package/src/capabilities/settings.ts +24 -12
  77. package/src/components/Markdown/{Container.stories.tsx → Panel.stories.tsx} +7 -7
  78. package/src/components/Markdown/{Container.tsx → Panel.tsx} +6 -6
  79. package/src/components/Markdown/Slide.stories.tsx +4 -4
  80. package/src/components/Markdown/index.ts +1 -1
  81. package/src/components/Markdown/theme.ts +5 -5
  82. package/src/components/Presenter/Layout.tsx +24 -23
  83. package/src/components/Presenter/Pager.stories.tsx +2 -2
  84. package/src/components/Presenter/Pager.tsx +53 -18
  85. package/src/components/PresenterSettings/PresenterSettings.stories.tsx +32 -0
  86. package/src/components/PresenterSettings/PresenterSettings.tsx +32 -0
  87. package/src/components/PresenterSettings/index.ts +7 -0
  88. package/src/components/RevealPlayer/RevealPlayer.stories.tsx +3 -3
  89. package/src/components/RevealPlayer/RevealPlayer.tsx +104 -93
  90. package/src/components/index.ts +5 -5
  91. package/src/containers/CollectionPresenterContainer/CollectionPresenterContainer.tsx +43 -0
  92. package/src/containers/CollectionPresenterContainer/index.ts +7 -0
  93. package/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.tsx +23 -0
  94. package/src/containers/DocumentPresenterContainer/index.ts +7 -0
  95. package/src/{components → containers/MarkdownSlide}/MarkdownSlide.tsx +9 -7
  96. package/src/containers/MarkdownSlide/index.ts +7 -0
  97. package/src/containers/index.ts +9 -0
  98. package/src/meta.ts +3 -3
  99. package/src/operations/definitions.ts +23 -0
  100. package/src/operations/index.ts +5 -0
  101. package/src/translations.ts +6 -5
  102. package/src/types/Settings.ts +15 -0
  103. package/src/types/index.ts +30 -0
  104. package/src/useExitPresenter.ts +26 -24
  105. package/dist/lib/browser/CollectionPresenterContainer-ASH2TGJR.mjs +0 -191
  106. package/dist/lib/browser/CollectionPresenterContainer-ASH2TGJR.mjs.map +0 -7
  107. package/dist/lib/browser/DocumentPresenterContainer-F42V4KAL.mjs +0 -183
  108. package/dist/lib/browser/DocumentPresenterContainer-F42V4KAL.mjs.map +0 -7
  109. package/dist/lib/browser/MarkdownSlide-BLVWTH3U.mjs +0 -223
  110. package/dist/lib/browser/MarkdownSlide-BLVWTH3U.mjs.map +0 -7
  111. package/dist/lib/browser/app-graph-builder-UGCZOBA6.mjs +0 -106
  112. package/dist/lib/browser/app-graph-builder-UGCZOBA6.mjs.map +0 -7
  113. package/dist/lib/browser/chunk-EOT6RIHJ.mjs +0 -39
  114. package/dist/lib/browser/chunk-EOT6RIHJ.mjs.map +0 -7
  115. package/dist/lib/browser/chunk-TMTUZQCK.mjs +0 -18
  116. package/dist/lib/browser/chunk-TMTUZQCK.mjs.map +0 -7
  117. package/dist/lib/browser/chunk-UVGTHJUO.mjs +0 -36
  118. package/dist/lib/browser/chunk-UVGTHJUO.mjs.map +0 -7
  119. package/dist/lib/browser/chunk-WWKBVJB3.mjs +0 -41
  120. package/dist/lib/browser/chunk-WWKBVJB3.mjs.map +0 -7
  121. package/dist/lib/browser/react-surface-UIAHN2NJ.mjs +0 -57
  122. package/dist/lib/browser/react-surface-UIAHN2NJ.mjs.map +0 -7
  123. package/dist/lib/browser/settings-RZWQTJI2.mjs +0 -22
  124. package/dist/lib/browser/settings-RZWQTJI2.mjs.map +0 -7
  125. package/dist/types/src/components/CollectionPresenterContainer.d.ts +0 -7
  126. package/dist/types/src/components/CollectionPresenterContainer.d.ts.map +0 -1
  127. package/dist/types/src/components/DocumentPresenterContainer.d.ts +0 -7
  128. package/dist/types/src/components/DocumentPresenterContainer.d.ts.map +0 -1
  129. package/dist/types/src/components/Markdown/Container.d.ts +0 -8
  130. package/dist/types/src/components/Markdown/Container.d.ts.map +0 -1
  131. package/dist/types/src/components/Markdown/Container.stories.d.ts.map +0 -1
  132. package/dist/types/src/components/MarkdownSlide.d.ts.map +0 -1
  133. package/dist/types/src/components/PresenterSettings.d.ts +0 -6
  134. package/dist/types/src/components/PresenterSettings.d.ts.map +0 -1
  135. package/dist/types/src/types.d.ts +0 -40
  136. package/dist/types/src/types.d.ts.map +0 -1
  137. package/src/components/CollectionPresenterContainer.tsx +0 -44
  138. package/src/components/DocumentPresenterContainer.tsx +0 -23
  139. package/src/components/PresenterSettings.tsx +0 -30
  140. package/src/types.ts +0 -46
package/package.json CHANGED
@@ -1,18 +1,36 @@
1
1
  {
2
2
  "name": "@dxos/plugin-presenter",
3
- "version": "0.8.4-main.ae835ea",
3
+ "version": "0.8.4-main.bcb3aa67d6",
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",
15
+ "imports": {
16
+ "#capabilities": "./src/capabilities/index.ts",
17
+ "#components": "./src/components/index.ts",
18
+ "#containers": "./src/containers/index.ts",
19
+ "#meta": "./src/meta.ts",
20
+ "#operations": "./src/operations/index.ts",
21
+ "#testing": "./src/testing.ts",
22
+ "#types": "./src/types/index.ts"
23
+ },
11
24
  "exports": {
12
25
  ".": {
13
26
  "source": "./src/index.ts",
14
- "types": "./dist/types/src/index.d.ts",
15
- "browser": "./dist/lib/browser/index.mjs"
27
+ "browser": "./dist/lib/browser/index.mjs",
28
+ "types": "./dist/types/src/index.d.ts"
29
+ },
30
+ "./operations": {
31
+ "source": "./src/operations/index.ts",
32
+ "types": "./dist/types/src/operations/index.d.ts",
33
+ "browser": "./dist/lib/browser/operations/index.mjs"
16
34
  }
17
35
  },
18
36
  "types": "dist/types/src/index.d.ts",
@@ -24,8 +42,8 @@
24
42
  "src"
25
43
  ],
26
44
  "dependencies": {
27
- "@preact-signals/safe-react": "^0.9.0",
28
- "@preact/signals-core": "^1.12.1",
45
+ "@effect-atom/atom": "^0.5.1",
46
+ "@effect-atom/atom-react": "^0.5.0",
29
47
  "hastscript": "^7.1.0",
30
48
  "highlight.js": "^11.9.0",
31
49
  "marked": "^12.0.2",
@@ -36,46 +54,50 @@
36
54
  "remark-frontmatter": "^5.0.0",
37
55
  "remark-parse-frontmatter": "^1.0.3",
38
56
  "reveal.js": "^5.1.0",
39
- "@dxos/app-framework": "0.8.4-main.ae835ea",
40
- "@dxos/async": "0.8.4-main.ae835ea",
41
- "@dxos/live-object": "0.8.4-main.ae835ea",
42
- "@dxos/local-storage": "0.8.4-main.ae835ea",
43
- "@dxos/log": "0.8.4-main.ae835ea",
44
- "@dxos/echo": "0.8.4-main.ae835ea",
45
- "@dxos/plugin-client": "0.8.4-main.ae835ea",
46
- "@dxos/plugin-deck": "0.8.4-main.ae835ea",
47
- "@dxos/plugin-markdown": "0.8.4-main.ae835ea",
48
- "@dxos/plugin-stack": "0.8.4-main.ae835ea",
49
- "@dxos/react-client": "0.8.4-main.ae835ea",
50
- "@dxos/react-ui-form": "0.8.4-main.ae835ea",
51
- "@dxos/plugin-graph": "0.8.4-main.ae835ea",
52
- "@dxos/react-ui-stack": "0.8.4-main.ae835ea",
53
- "@dxos/util": "0.8.4-main.ae835ea",
54
- "@dxos/schema": "0.8.4-main.ae835ea"
57
+ "@dxos/app-framework": "0.8.4-main.bcb3aa67d6",
58
+ "@dxos/async": "0.8.4-main.bcb3aa67d6",
59
+ "@dxos/echo": "0.8.4-main.bcb3aa67d6",
60
+ "@dxos/operation": "0.8.4-main.bcb3aa67d6",
61
+ "@dxos/log": "0.8.4-main.bcb3aa67d6",
62
+ "@dxos/effect": "0.8.4-main.bcb3aa67d6",
63
+ "@dxos/plugin-client": "0.8.4-main.bcb3aa67d6",
64
+ "@dxos/plugin-deck": "0.8.4-main.bcb3aa67d6",
65
+ "@dxos/plugin-markdown": "0.8.4-main.bcb3aa67d6",
66
+ "@dxos/plugin-stack": "0.8.4-main.bcb3aa67d6",
67
+ "@dxos/plugin-graph": "0.8.4-main.bcb3aa67d6",
68
+ "@dxos/react-client": "0.8.4-main.bcb3aa67d6",
69
+ "@dxos/react-ui-attention": "0.8.4-main.bcb3aa67d6",
70
+ "@dxos/react-ui-form": "0.8.4-main.bcb3aa67d6",
71
+ "@dxos/react-ui-mosaic": "0.8.4-main.bcb3aa67d6",
72
+ "@dxos/react-ui-stack": "0.8.4-main.bcb3aa67d6",
73
+ "@dxos/schema": "0.8.4-main.bcb3aa67d6",
74
+ "@dxos/types": "0.8.4-main.bcb3aa67d6",
75
+ "@dxos/util": "0.8.4-main.bcb3aa67d6",
76
+ "@dxos/app-toolkit": "0.8.4-main.bcb3aa67d6"
55
77
  },
56
78
  "devDependencies": {
57
- "@effect-rx/rx-react": "0.42.4",
58
- "@effect/platform": "0.92.1",
59
- "@types/react": "~19.2.2",
60
- "@types/react-dom": "~19.2.2",
79
+ "@effect-atom/atom-react": "^0.5.0",
80
+ "@effect/platform": "0.94.4",
81
+ "@types/react": "~19.2.7",
82
+ "@types/react-dom": "~19.2.3",
61
83
  "@types/reveal.js": "^5.0.3",
62
- "effect": "3.18.3",
63
- "react": "~19.2.0",
64
- "react-dom": "~19.2.0",
65
- "vite": "7.1.9",
66
- "@dxos/react-ui": "0.8.4-main.ae835ea",
67
- "@dxos/random": "0.8.4-main.ae835ea",
68
- "@dxos/storybook-utils": "0.8.4-main.ae835ea",
69
- "@dxos/react-ui-theme": "0.8.4-main.ae835ea"
84
+ "effect": "3.20.0",
85
+ "react": "~19.2.3",
86
+ "react-dom": "~19.2.3",
87
+ "vite": "^7.1.11",
88
+ "@dxos/random": "0.8.4-main.bcb3aa67d6",
89
+ "@dxos/react-ui": "0.8.4-main.bcb3aa67d6",
90
+ "@dxos/storybook-utils": "0.8.4-main.bcb3aa67d6",
91
+ "@dxos/ui-theme": "0.8.4-main.bcb3aa67d6"
70
92
  },
71
93
  "peerDependencies": {
72
- "@effect-rx/rx-react": "^0.34.1",
73
- "@effect/platform": "^0.80.12",
74
- "effect": "^3.13.3",
75
- "react": "^19.0.0",
76
- "react-dom": "^19.0.0",
77
- "@dxos/react-ui": "0.8.4-main.ae835ea",
78
- "@dxos/react-ui-theme": "0.8.4-main.ae835ea"
94
+ "@effect-atom/atom-react": "^0.5.0",
95
+ "@effect/platform": "0.94.4",
96
+ "effect": "3.20.0",
97
+ "react": "~19.2.3",
98
+ "react-dom": "~19.2.3",
99
+ "@dxos/react-ui": "0.8.4-main.bcb3aa67d6",
100
+ "@dxos/ui-theme": "0.8.4-main.bcb3aa67d6"
79
101
  },
80
102
  "publishConfig": {
81
103
  "access": "public"
@@ -2,34 +2,21 @@
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
- import { AppGraphBuilder, PresenterSettings, ReactSurface } from './capabilities';
8
- import { meta } from './meta';
8
+ import { meta } from '#meta';
9
9
  import { translations } from './translations';
10
10
 
11
+ import { AppGraphBuilder, PresenterSettings, ReactSurface } from '#capabilities';
12
+
11
13
  // TODO(burdon): Only scale markdown content.
12
14
  // TODO(burdon): Map stack content; Slide content type (e.g., markdown, sketch, IPFS image, table, etc.)
13
15
 
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
- ]);
16
+ export const PresenterPlugin = Plugin.define(meta).pipe(
17
+ AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
18
+ AppPlugin.addSettingsModule({ activate: PresenterSettings }),
19
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
20
+ AppPlugin.addTranslationsModule({ translations }),
21
+ Plugin.make,
22
+ );
@@ -2,112 +2,103 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Rx } from '@effect-rx/rx-react';
6
- import * as Function from 'effect/Function';
5
+ import * as Effect from 'effect/Effect';
7
6
  import * as Option from 'effect/Option';
8
7
 
9
- import { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { AppCapabilities, AppNode, LayoutOperation, getObjectPathFromObject, getSpacePath } from '@dxos/app-toolkit';
10
+ import { linkedSegment } from '@dxos/react-ui-attention';
10
11
  import { Obj } from '@dxos/echo';
12
+ import { Collection } from '@dxos/echo';
13
+ import { Operation } from '@dxos/operation';
11
14
  import { DeckCapabilities } from '@dxos/plugin-deck';
12
- import { ATTENDABLE_PATH_SEPARATOR, DeckAction } from '@dxos/plugin-deck/types';
13
- import { createExtension, rxFromSignal } from '@dxos/plugin-graph';
15
+ import { DeckOperation } from '@dxos/plugin-deck/operations';
16
+ import { GraphBuilder, type Node, NodeMatcher } from '@dxos/plugin-graph';
14
17
  import { Markdown } from '@dxos/plugin-markdown/types';
15
- import { fullyQualifiedId, getSpace } from '@dxos/react-client/echo';
16
- import { DataType } from '@dxos/schema';
17
18
 
18
- import { meta } from '../meta';
19
- import { PresenterAction, type PresenterSettingsProps } from '../types';
19
+ import { meta } from '#meta';
20
+ import { PresenterCapabilities } from '#types';
21
+ import { PresenterOperation } from '#operations';
20
22
 
21
- export default (context: PluginContext) =>
22
- contributes(
23
- Capabilities.AppGraphBuilder,
24
- createExtension({
25
- id: `${meta.id}/root`,
23
+ /** Match nodes that can be presented (Collection or Document). */
24
+ const whenPresentable = (node: Node.Node) =>
25
+ Option.orElse(NodeMatcher.whenEchoType(Collection.Collection)(node), () =>
26
+ NodeMatcher.whenEchoType(Markdown.Document)(node),
27
+ );
28
+
29
+ export default Capability.makeModule(
30
+ Effect.fnUntraced(function* () {
31
+ const capabilities = yield* Capability.Service;
32
+
33
+ const extensions = yield* GraphBuilder.createExtension({
34
+ id: `${meta.id}.root`,
26
35
  // TODO(wittjosiah): This is a hack to work around presenter previously relying on "variant". Remove.
27
- connector: (node) =>
28
- Rx.make((get) =>
29
- Function.pipe(
30
- get(node),
31
- Option.flatMap((node) => {
32
- const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
33
- const settings = get(rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value));
34
- const isPresentable = settings?.presentCollections
35
- ? Obj.instanceOf(DataType.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
36
- : Obj.instanceOf(Markdown.Document, node.data);
37
- return isPresentable ? Option.some(node.data) : Option.none();
38
- }),
39
- Option.map((object) => {
40
- const id = fullyQualifiedId(object);
41
- return [
42
- {
43
- id: [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR),
44
- data: { type: meta.id, object },
45
- type: meta.id,
46
- properties: {
47
- label: 'Presenter',
48
- icon: 'ph--presentation--regular',
49
- disposition: 'hidden',
50
- },
51
- },
52
- ];
53
- }),
54
- Option.getOrElse(() => []),
55
- ),
56
- ),
57
- actions: (node) =>
58
- Rx.make((get) =>
59
- Function.pipe(
60
- get(node),
61
- Option.flatMap((node) => {
62
- const [settingsStore] = get(context.capabilities(Capabilities.SettingsStore));
63
- const settings = get(rxFromSignal(() => settingsStore?.getStore<PresenterSettingsProps>(meta.id)?.value));
64
- const isPresentable = settings?.presentCollections
65
- ? Obj.instanceOf(DataType.Collection, node.data) || Obj.instanceOf(Markdown.Document, node.data)
66
- : Obj.instanceOf(Markdown.Document, node.data);
67
- return isPresentable ? Option.some(node.data) : Option.none();
68
- }),
69
- Option.map((object) => {
70
- const id = fullyQualifiedId(object);
71
- const spaceId = getSpace(object)?.id;
72
- return [
73
- {
74
- id: `${PresenterAction.TogglePresentation._tag}/${id}`,
75
- // TODO(burdon): Allow function so can generate state when activated.
76
- // So can set explicit fullscreen state coordinated with current presenter state.
77
- data: async () => {
78
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
79
- const layout = context.getCapability(DeckCapabilities.MutableDeckState);
80
- const presenterId = [id, 'presenter'].join(ATTENDABLE_PATH_SEPARATOR);
81
- if (!layout.deck.fullscreen) {
82
- void dispatch(
83
- createIntent(DeckAction.Adjust, {
84
- type: 'solo--fullscreen',
85
- id: presenterId,
86
- }),
87
- );
88
- }
89
- await dispatch(
90
- createIntent(LayoutAction.Open, {
91
- part: 'main',
92
- subject: [presenterId],
93
- options: { workspace: spaceId },
94
- }),
95
- );
96
- },
97
- properties: {
98
- label: ['toggle presentation label', { ns: meta.id }],
99
- icon: 'ph--presentation--regular',
100
- disposition: 'list-item',
101
- keyBinding: {
102
- macos: 'shift+meta+p',
103
- windows: 'shift+alt+p',
104
- },
105
- },
106
- },
107
- ];
36
+ match: whenPresentable,
37
+ connector: (object, get) => {
38
+ const settingsAtom = capabilities.get(PresenterCapabilities.Settings);
39
+ const settings = get(settingsAtom);
40
+ const isPresentable = settings?.presentCollections
41
+ ? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)
42
+ : Obj.instanceOf(Markdown.Document, object);
43
+ if (!isPresentable) {
44
+ return Effect.succeed([]);
45
+ }
46
+
47
+ return Effect.succeed([
48
+ AppNode.makeCompanion({
49
+ id: linkedSegment('presenter'),
50
+ label: 'Presenter',
51
+ icon: 'ph--presentation--regular',
52
+ data: { type: meta.id, object },
53
+ }),
54
+ ]);
55
+ },
56
+ actions: (object, get) => {
57
+ const settingsAtom = capabilities.get(PresenterCapabilities.Settings);
58
+ const settings = get(settingsAtom);
59
+ const isPresentable = settings?.presentCollections
60
+ ? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)
61
+ : Obj.instanceOf(Markdown.Document, object);
62
+ const db = Obj.getDatabase(object);
63
+ if (!isPresentable || !db) {
64
+ return Effect.succeed([]);
65
+ }
66
+ const objectPath = getObjectPathFromObject(object);
67
+
68
+ return Effect.succeed([
69
+ {
70
+ id: PresenterOperation.TogglePresentation.meta.key,
71
+ // TODO(burdon): Allow function so can generate state when activated.
72
+ // So can set explicit fullscreen state coordinated with current presenter state.
73
+ data: Effect.fnUntraced(function* () {
74
+ const deckState = yield* Capabilities.getAtomValue(DeckCapabilities.State);
75
+ const deck = deckState.decks[deckState.activeDeck];
76
+ const presenterId = `${objectPath}/${linkedSegment('presenter')}`;
77
+ if (!deck?.fullscreen) {
78
+ yield* Operation.invoke(DeckOperation.Adjust, {
79
+ type: 'solo--fullscreen' as const,
80
+ id: presenterId,
81
+ });
82
+ }
83
+ yield* Operation.invoke(LayoutOperation.Open, {
84
+ subject: [presenterId],
85
+ workspace: getSpacePath(db.spaceId),
86
+ });
108
87
  }),
109
- Option.getOrElse(() => []),
110
- ),
111
- ),
112
- }),
113
- );
88
+ properties: {
89
+ label: ['toggle-presentation.label', { ns: meta.id }],
90
+ icon: 'ph--presentation--regular',
91
+ disposition: 'list-item',
92
+ keyBinding: {
93
+ macos: 'shift+meta+p',
94
+ windows: 'shift+alt+p',
95
+ },
96
+ },
97
+ },
98
+ ]);
99
+ },
100
+ });
101
+
102
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
103
+ }),
104
+ );
@@ -2,8 +2,8 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from '@dxos/app-framework';
5
+ import { Capability } from '@dxos/app-framework';
6
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'));
7
+ export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
8
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
9
+ export const PresenterSettings = Capability.lazy('PresenterSettings', () => import('./settings'));
@@ -2,62 +2,66 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import * as Effect from 'effect/Effect';
5
6
  import React from 'react';
6
7
 
7
- import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface, useSettingsState } from '@dxos/app-framework/ui';
10
+ import { AppCapabilities } from '@dxos/app-toolkit';
8
11
  import { Obj } from '@dxos/echo';
9
- import { SettingsStore } from '@dxos/local-storage';
12
+ import { Collection } from '@dxos/echo';
10
13
  import { Markdown } from '@dxos/plugin-markdown/types';
11
- import { DataType } from '@dxos/schema';
12
14
 
13
- import {
14
- CollectionPresenterContainer,
15
- DocumentPresenterContainer,
16
- MarkdownSlide,
17
- PresenterSettings,
18
- } from '../components';
19
- import { meta } from '../meta';
20
- import { type PresenterSettingsProps } from '../types';
15
+ import { PresenterSettings } from '#components';
16
+ import { CollectionPresenterContainer, DocumentPresenterContainer, MarkdownSlide } from '#containers';
17
+ import { meta } from '#meta';
18
+ import { type Settings } from '#types';
21
19
 
22
- export default () =>
23
- contributes(Capabilities.ReactSurface, [
24
- createSurface({
25
- id: `${meta.id}/document`,
26
- role: 'article',
27
- position: 'hoist',
28
- filter: (data): data is { subject: { type: typeof meta.id; object: Markdown.Document } } =>
29
- !!data.subject &&
30
- typeof data.subject === 'object' &&
31
- 'type' in data.subject &&
32
- 'object' in data.subject &&
33
- data.subject.type === meta.id &&
34
- Obj.instanceOf(Markdown.Document, data.subject.object),
35
- component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,
36
- }),
37
- createSurface({
38
- id: `${meta.id}/collection`,
39
- role: 'article',
40
- position: 'hoist',
41
- filter: (data): data is { subject: { type: typeof meta.id; object: DataType.Collection } } =>
42
- !!data.subject &&
43
- typeof data.subject === 'object' &&
44
- 'type' in data.subject &&
45
- 'object' in data.subject &&
46
- data.subject.type === meta.id &&
47
- Obj.instanceOf(DataType.Collection, data.subject.object),
48
- component: ({ data }) => <CollectionPresenterContainer collection={data.subject.object} />,
49
- }),
50
- createSurface({
51
- id: `${meta.id}/slide`,
52
- role: 'slide',
53
- filter: (data): data is { subject: Markdown.Document } => Obj.instanceOf(Markdown.Document, data.subject),
54
- component: ({ data }) => <MarkdownSlide document={data.subject} />,
55
- }),
56
- createSurface({
57
- id: `${meta.id}/plugin-settings`,
58
- role: 'article',
59
- filter: (data): data is { subject: SettingsStore<PresenterSettingsProps> } =>
60
- data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
61
- component: ({ data: { subject } }) => <PresenterSettings settings={subject.value} />,
62
- }),
63
- ]);
20
+ export default Capability.makeModule(() =>
21
+ Effect.succeed(
22
+ Capability.contributes(Capabilities.ReactSurface, [
23
+ Surface.create({
24
+ id: `${meta.id}.document`,
25
+ role: 'article',
26
+ position: 'hoist',
27
+ filter: (data): data is { subject: { type: typeof meta.id; object: Markdown.Document } } =>
28
+ !!data.subject &&
29
+ typeof data.subject === 'object' &&
30
+ 'type' in data.subject &&
31
+ 'object' in data.subject &&
32
+ data.subject.type === meta.id &&
33
+ Obj.instanceOf(Markdown.Document, data.subject.object),
34
+ component: ({ data }) => <DocumentPresenterContainer document={data.subject.object} />,
35
+ }),
36
+ Surface.create({
37
+ id: `${meta.id}.collection`,
38
+ role: 'article',
39
+ position: 'hoist',
40
+ filter: (data): data is { subject: { type: typeof meta.id; object: Collection.Collection } } =>
41
+ !!data.subject &&
42
+ typeof data.subject === 'object' &&
43
+ 'type' in data.subject &&
44
+ 'object' in data.subject &&
45
+ data.subject.type === meta.id &&
46
+ Obj.instanceOf(Collection.Collection, data.subject.object),
47
+ component: ({ role, data }) => <CollectionPresenterContainer role={role} subject={data.subject.object} />,
48
+ }),
49
+ Surface.create({
50
+ id: `${meta.id}.slide`,
51
+ role: 'slide',
52
+ filter: (data): data is { subject: Markdown.Document } => Obj.instanceOf(Markdown.Document, data.subject),
53
+ component: ({ data }) => <MarkdownSlide document={data.subject} />,
54
+ }),
55
+ Surface.create({
56
+ id: `${meta.id}.plugin-settings`,
57
+ role: 'article',
58
+ filter: (data): data is { subject: AppCapabilities.Settings } =>
59
+ AppCapabilities.isSettings(data.subject) && data.subject.prefix === meta.id,
60
+ component: ({ data: { subject } }) => {
61
+ const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
62
+ return <PresenterSettings settings={settings} onSettingsChange={updateSettings} />;
63
+ },
64
+ }),
65
+ ]),
66
+ ),
67
+ );
@@ -2,18 +2,30 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, contributes } from '@dxos/app-framework';
6
- import { live } from '@dxos/live-object';
5
+ import * as Effect from 'effect/Effect';
7
6
 
8
- import { meta } from '../meta';
9
- import { type PresenterSettingsProps, PresenterSettingsSchema } from '../types';
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities } from '@dxos/app-toolkit';
9
+ import { createKvsStore } from '@dxos/effect';
10
10
 
11
- export default () => {
12
- const settings = live<PresenterSettingsProps>({});
11
+ import { meta } from '#meta';
12
+ import { PresenterCapabilities, Settings } from '#types';
13
13
 
14
- return contributes(Capabilities.Settings, {
15
- prefix: meta.id,
16
- schema: PresenterSettingsSchema,
17
- value: settings,
18
- });
19
- };
14
+ export default Capability.makeModule(() =>
15
+ Effect.sync(() => {
16
+ const settingsAtom = createKvsStore({
17
+ key: meta.id,
18
+ schema: Settings.Settings,
19
+ defaultValue: () => ({}),
20
+ });
21
+
22
+ return [
23
+ Capability.contributes(PresenterCapabilities.Settings, settingsAtom),
24
+ Capability.contributes(AppCapabilities.Settings, {
25
+ prefix: meta.id,
26
+ schema: Settings.Settings,
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
- import { createSlide } from '../../testing';
10
+ import { createSlide } from '#testing';
11
11
 
12
- import { Container } from './Container';
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
- <Container classNames='bg-neutral-200'>
17
+ <Panel classNames='bg-neutral-200'>
18
18
  <Slide content={content} />
19
- </Container>
19
+ </Panel>
20
20
  );
21
21
  };
22
22
 
23
23
  const meta = {
24
- title: 'plugins/plugin-presenter/Container',
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/react-ui-theme';
9
+ import { mx } from '@dxos/ui-theme';
10
10
 
11
- export type ContainerProps = ThemedClassName<PropsWithChildren<{}>>;
11
+ export type PanelProps = ThemedClassName<PropsWithChildren<{}>>;
12
12
 
13
13
  /**
14
- * Scaled markdown container.
14
+ * Scaled markdown panel.
15
15
  */
16
- export const Container = ({ children, classNames }: ContainerProps) => {
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('flex w-full h-full overflow-hidden absolute')} style={props}>
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>