@dxos/plugin-presenter 0.10.0 → 0.11.0

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 (136) hide show
  1. package/PLUGIN.mdl +5 -3
  2. package/dist/lib/PresenterPlugin.mjs +22 -0
  3. package/dist/lib/PresenterPlugin.mjs.map +1 -0
  4. package/dist/lib/PresenterPlugin.node.mjs +10 -0
  5. package/dist/lib/PresenterPlugin.node.mjs.map +1 -0
  6. package/dist/lib/PresenterPlugin.workerd.mjs +8 -0
  7. package/dist/lib/PresenterPlugin.workerd.mjs.map +1 -0
  8. package/dist/lib/capabilities.mjs +11 -0
  9. package/dist/lib/capabilities.mjs.map +1 -0
  10. package/dist/lib/chunk-CollectionArticle.mjs +49 -0
  11. package/dist/lib/chunk-CollectionArticle.mjs.map +1 -0
  12. package/dist/lib/chunk-DocumentArticle.mjs +32 -0
  13. package/dist/lib/chunk-DocumentArticle.mjs.map +1 -0
  14. package/dist/lib/chunk-SlideArticle.mjs +17 -0
  15. package/dist/lib/chunk-SlideArticle.mjs.map +1 -0
  16. package/dist/lib/chunk-app-graph-builder.mjs +57 -0
  17. package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
  18. package/dist/lib/chunk-markdown-extension.mjs +31 -0
  19. package/dist/lib/chunk-markdown-extension.mjs.map +1 -0
  20. package/dist/lib/{neutral/chunk-MSQDHOPV.mjs → chunk-meta.mjs} +19 -23
  21. package/dist/lib/chunk-meta.mjs.map +1 -0
  22. package/dist/lib/chunk-operation-handler.mjs +11 -0
  23. package/dist/lib/chunk-operation-handler.mjs.map +1 -0
  24. package/dist/lib/chunk-react-surface.mjs +42 -0
  25. package/dist/lib/chunk-react-surface.mjs.map +1 -0
  26. package/dist/lib/chunk-settings.mjs +23 -0
  27. package/dist/lib/chunk-settings.mjs.map +1 -0
  28. package/dist/lib/chunk-toggle-presentation.mjs +48 -0
  29. package/dist/lib/chunk-toggle-presentation.mjs.map +1 -0
  30. package/dist/lib/chunk-types.mjs +57 -0
  31. package/dist/lib/chunk-types.mjs.map +1 -0
  32. package/dist/lib/chunk-useExitPresenter.mjs +20 -0
  33. package/dist/lib/chunk-useExitPresenter.mjs.map +1 -0
  34. package/dist/lib/components.mjs +465 -0
  35. package/dist/lib/components.mjs.map +1 -0
  36. package/dist/lib/containers.mjs +9 -0
  37. package/dist/lib/containers.mjs.map +1 -0
  38. package/dist/lib/index.mjs +3 -0
  39. package/dist/lib/meta.mjs +2 -0
  40. package/dist/lib/operations.mjs +7 -0
  41. package/dist/lib/operations.mjs.map +1 -0
  42. package/dist/lib/plugin.mjs +8 -0
  43. package/dist/lib/plugin.mjs.map +1 -0
  44. package/dist/lib/testing.mjs +27 -0
  45. package/dist/lib/testing.mjs.map +1 -0
  46. package/dist/lib/translations.mjs +10 -0
  47. package/dist/lib/translations.mjs.map +1 -0
  48. package/dist/lib/types.mjs +2 -0
  49. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  50. package/dist/types/src/capabilities/markdown-extension.d.ts +1 -1
  51. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  52. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  53. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  54. package/dist/types/src/capabilities/settings.d.ts +1 -1
  55. package/dist/types/src/components/Presenter/Layout.d.ts +1 -1
  56. package/dist/types/src/components/Presenter/Layout.d.ts.map +1 -1
  57. package/dist/types/src/components/Presenter/PresentationShell.d.ts +1 -1
  58. package/dist/types/src/components/Presenter/PresentationShell.d.ts.map +1 -1
  59. package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts +1 -1
  60. package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
  61. package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +1 -1
  62. package/dist/types/src/containers/CollectionArticle/CollectionArticle.d.ts +4 -1
  63. package/dist/types/src/containers/CollectionArticle/CollectionArticle.d.ts.map +1 -1
  64. package/dist/types/src/containers/DocumentArticle/DocumentArticle.d.ts +4 -1
  65. package/dist/types/src/containers/DocumentArticle/DocumentArticle.d.ts.map +1 -1
  66. package/dist/types/src/containers/SlideArticle/SlideArticle.d.ts +4 -1
  67. package/dist/types/src/containers/SlideArticle/SlideArticle.d.ts.map +1 -1
  68. package/dist/types/src/operations/toggle-presentation.d.ts.map +1 -1
  69. package/dist/types/src/paths.d.ts.map +1 -1
  70. package/dist/types/src/types/PresenterCapabilities.d.ts +1 -1
  71. package/dist/types/src/types/PresenterCapabilities.d.ts.map +1 -1
  72. package/dist/types/tsconfig.tsbuildinfo +1 -1
  73. package/dx.config.ts +1 -0
  74. package/package.json +39 -39
  75. package/src/capabilities/app-graph-builder.ts +2 -3
  76. package/src/capabilities/{react-surface.tsx → react-surface.ts} +6 -4
  77. package/src/components/Markdown/Panel.tsx +1 -1
  78. package/src/components/Markdown/theme.ts +1 -1
  79. package/src/components/Presenter/Layout.tsx +1 -1
  80. package/src/components/RevealPlayer/RevealPlayer.tsx +1 -1
  81. package/src/containers/CollectionArticle/CollectionArticle.tsx +2 -0
  82. package/src/containers/DocumentArticle/DocumentArticle.tsx +2 -0
  83. package/src/containers/SlideArticle/SlideArticle.tsx +2 -0
  84. package/src/operations/toggle-presentation.ts +13 -11
  85. package/src/paths.ts +3 -2
  86. package/src/types/PresenterCapabilities.ts +1 -1
  87. package/dist/lib/neutral/CollectionArticle-7R4KJWDW.mjs +0 -47
  88. package/dist/lib/neutral/CollectionArticle-7R4KJWDW.mjs.map +0 -7
  89. package/dist/lib/neutral/DocumentArticle-YZRKVEN7.mjs +0 -32
  90. package/dist/lib/neutral/DocumentArticle-YZRKVEN7.mjs.map +0 -7
  91. package/dist/lib/neutral/PresenterPlugin.mjs +0 -42
  92. package/dist/lib/neutral/PresenterPlugin.mjs.map +0 -7
  93. package/dist/lib/neutral/PresenterPlugin.node.mjs +0 -16
  94. package/dist/lib/neutral/PresenterPlugin.node.mjs.map +0 -7
  95. package/dist/lib/neutral/PresenterPlugin.workerd.mjs +0 -12
  96. package/dist/lib/neutral/PresenterPlugin.workerd.mjs.map +0 -7
  97. package/dist/lib/neutral/SlideArticle-FE2I6KBO.mjs +0 -20
  98. package/dist/lib/neutral/SlideArticle-FE2I6KBO.mjs.map +0 -7
  99. package/dist/lib/neutral/app-graph-builder-FNDFY5L3.mjs +0 -81
  100. package/dist/lib/neutral/app-graph-builder-FNDFY5L3.mjs.map +0 -7
  101. package/dist/lib/neutral/capabilities/index.mjs +0 -17
  102. package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
  103. package/dist/lib/neutral/chunk-63IF7OXT.mjs +0 -19
  104. package/dist/lib/neutral/chunk-63IF7OXT.mjs.map +0 -7
  105. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
  106. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
  107. package/dist/lib/neutral/chunk-MSQDHOPV.mjs.map +0 -7
  108. package/dist/lib/neutral/chunk-NDZ6IIAL.mjs +0 -73
  109. package/dist/lib/neutral/chunk-NDZ6IIAL.mjs.map +0 -7
  110. package/dist/lib/neutral/components/index.mjs +0 -563
  111. package/dist/lib/neutral/components/index.mjs.map +0 -7
  112. package/dist/lib/neutral/containers/index.mjs +0 -13
  113. package/dist/lib/neutral/containers/index.mjs.map +0 -7
  114. package/dist/lib/neutral/index.mjs +0 -18
  115. package/dist/lib/neutral/index.mjs.map +0 -7
  116. package/dist/lib/neutral/markdown-extension-HGLRVZDF.mjs +0 -37
  117. package/dist/lib/neutral/markdown-extension-HGLRVZDF.mjs.map +0 -7
  118. package/dist/lib/neutral/meta.json +0 -1
  119. package/dist/lib/neutral/meta.mjs +0 -8
  120. package/dist/lib/neutral/meta.mjs.map +0 -7
  121. package/dist/lib/neutral/operation-handler-3ZESW5AK.mjs +0 -13
  122. package/dist/lib/neutral/operation-handler-3ZESW5AK.mjs.map +0 -7
  123. package/dist/lib/neutral/operations/index.mjs +0 -9
  124. package/dist/lib/neutral/operations/index.mjs.map +0 -7
  125. package/dist/lib/neutral/plugin.mjs +0 -12
  126. package/dist/lib/neutral/plugin.mjs.map +0 -7
  127. package/dist/lib/neutral/react-surface-VO4GPCLQ.mjs +0 -42
  128. package/dist/lib/neutral/react-surface-VO4GPCLQ.mjs.map +0 -7
  129. package/dist/lib/neutral/settings-DBV7N5HT.mjs +0 -28
  130. package/dist/lib/neutral/settings-DBV7N5HT.mjs.map +0 -7
  131. package/dist/lib/neutral/toggle-presentation-PH7ZJJDD.mjs +0 -60
  132. package/dist/lib/neutral/toggle-presentation-PH7ZJJDD.mjs.map +0 -7
  133. package/dist/lib/neutral/translations.mjs +0 -18
  134. package/dist/lib/neutral/translations.mjs.map +0 -7
  135. package/dist/lib/neutral/types/index.mjs +0 -14
  136. package/dist/lib/neutral/types/index.mjs.map +0 -7
package/PLUGIN.mdl CHANGED
@@ -111,13 +111,15 @@ component SlideArticle
111
111
  op TogglePresentation
112
112
  desc: |
113
113
  Toggles presentation mode for a Markdown document or Collection.
114
- Opens the presenter companion node in solo-fullscreen layout via the Deck plugin.
115
- If the deck is not already in fullscreen, switches to solo--fullscreen before opening.
114
+ Opens the presenter companion node via the Deck plugin, driving the deck's ephemeral
115
+ fullscreen state (EphemeralDeckState.fullscreen) rather than a layout mode.
116
+ If the presenter companion isn't already fullscreen, toggles it fullscreen before opening;
117
+ exiting reverts fullscreen and re-opens the source object.
116
118
  input:
117
119
  object: Markdown.Document | Collection.Collection
118
120
  state?: boolean # explicit on/off override; omit to toggle
119
121
  output: void
120
- effects: [layout:navigate, deck:solo-fullscreen]
122
+ effects: [layout:navigate, deck:fullscreen]
121
123
  requires: [DeckCapabilities.State, DeckOperation.Adjust, LayoutOperation.Open]
122
124
  note: |
123
125
  Resolves the presenter companion node path as `<objectPath>/presenter`.
@@ -0,0 +1,22 @@
1
+ import { Plugin } from "@dxos/app-framework";
2
+ import { meta } from "#meta";
3
+ import { MarkdownEvents } from "@dxos/plugin-markdown";
4
+ import { AppPlugin } from "@dxos/app-toolkit";
5
+ import { AppGraphBuilder, MarkdownExtension, OperationHandler, PresenterSettings, ReactSurface } from "#capabilities";
6
+ import { translations } from "#translations";
7
+ //#endregion
8
+ //#region src/PresenterPlugin.tsx
9
+ var PresenterPlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }), AppPlugin.addOperationHandlerModule({ activate: OperationHandler }), AppPlugin.addSettingsModule({ activate: PresenterSettings }), AppPlugin.addSurfaceModule({ activate: ReactSurface }), Plugin.addModule({
10
+ id: `${meta.profile.key}/markdown`,
11
+ activatesOn: MarkdownEvents.SetupExtensions,
12
+ activate: MarkdownExtension
13
+ }), AppPlugin.addTranslationsModule({ translations }), AppPlugin.addPluginAssetModule({ asset: {
14
+ pluginId: meta.profile.key,
15
+ path: "PLUGIN.mdl",
16
+ content: "---\nid: org.dxos.plugin.presenter\nname: PresenterPlugin\nversion: 0.1.0\n---\n\nA presentation plugin for DXOS Composer that turns existing workspace objects — markdown documents and collections — into interactive slideshows with fullscreen mode and keyboard navigation.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype PresentationTarget\n literals: document | collection\n desc: The kind of workspace object being presented.\n```\n\n```mdl\ntype SlideIndex\n fields:\n current: number # zero-based index of the active slide\n count: number # total number of slides in the presentation\n```\n\n```mdl\ntype PresentationSettings\n fields:\n presentCollections?: boolean # when true, Collections may also be presented as slideshows (experimental)\n```\n\n## Components\n\n```mdl\ncomponent DocumentArticle\n desc: |\n Full-screen Reveal.js player for a single Markdown document.\n Parses the document content into slides using horizontal/vertical `---` separators.\n Renders in a Panel that fills the available viewport.\n props:\n document: Markdown.Document\n slots:\n (none)\n actions:\n exit() # navigates back to the originating document view\n layout: |\n ┌─────────────────────────────┐\n │ │\n │ RevealPlayer │\n │ (full-screen slide canvas) │\n │ │\n └─────────────────────────────┘\n```\n\n```mdl\ncomponent CollectionArticle\n desc: |\n Slideshow player for a Collection.\n Renders one slide per object in the collection's ordered items array.\n The active slide is delegated to the AppSurface.Slide surface, so each\n item's own plugin renders it (e.g. SlideArticle for documents).\n props:\n subject: Collection.Collection\n role?: string\n state:\n slide: number # zero-based index of the current slide\n running: boolean # whether keyboard navigation is active (from PresenterContext)\n slots:\n (none)\n actions:\n setSlide(index: number)\n exit()\n layout: |\n ┌─────────────────────────────┐\n │ │\n │ Surface (slide N) │ ← AppSurface.Slide surface\n │ │\n ├────────────────┬────────────┤\n │ [Pager] │ [PageNum] │\n └────────────────┴────────────┘\n```\n\n```mdl\ncomponent SlideArticle\n desc: |\n Renders a single Markdown document as a slide panel inside a Collection presentation.\n Used as the AppSurface.Slide surface implementation for Markdown.Document objects.\n props:\n document: Markdown.Document\n layout: |\n ┌─────────────────────────────┐\n │ Panel │\n │ └─ Slide (markdown) │\n └─────────────────────────────┘\n```\n\n## Operations\n\n```mdl\nop TogglePresentation\n desc: |\n Toggles presentation mode for a Markdown document or Collection.\n Opens the presenter companion node via the Deck plugin, driving the deck's ephemeral\n fullscreen state (EphemeralDeckState.fullscreen) rather than a layout mode.\n If the presenter companion isn't already fullscreen, toggles it fullscreen before opening;\n exiting reverts fullscreen and re-opens the source object.\n input:\n object: Markdown.Document | Collection.Collection\n state?: boolean # explicit on/off override; omit to toggle\n output: void\n effects: [layout:navigate, deck:fullscreen]\n requires: [DeckCapabilities.State, DeckOperation.Adjust, LayoutOperation.Open]\n note: |\n Resolves the presenter companion node path as `<objectPath>/presenter`.\n Keyboard shortcut: Shift+Cmd+P (macOS), Shift+Alt+P (Windows/Linux).\n```\n\n## Features\n\n```mdl\nfeat F-1: Presentation Mode\n\n req F-1.1: Every Markdown document in the workspace has a companion \"Presenter\" node in the app graph.\n req F-1.2:\n when: settings.presentCollections is true\n then: every Collection also has a companion Presenter node\n req F-1.3:\n when: user activates TogglePresentation on a document or collection\n then: Composer opens the presenter node in solo-fullscreen mode\n req F-1.4:\n when: user presses Shift+Cmd+P (macOS) or Shift+Alt+P (Windows)\n then: TogglePresentation is invoked for the focused object\n```\n\n```mdl\nfeat F-2: Document Slideshow (Reveal.js)\n\n req F-2.1:\n when: DocumentArticle mounts with a Markdown.Document\n then: RevealPlayer parses the document content and renders slides\n req F-2.2: Horizontal slides are separated by `---`; vertical slides by `----`.\n req F-2.3:\n when: user presses Escape or the exit action is triggered\n then: presenter navigates back to the originating document view\n```\n\n```mdl\nfeat F-3: Collection Slideshow\n\n req F-3.1:\n when: CollectionArticle mounts with a Collection\n then: slide 0 is shown, corresponding to collection.objects[0]\n req F-3.2:\n when: user navigates to slide N via the Pager\n then: the AppSurface.Slide surface renders collection.objects[N]\n req F-3.3: PageNumber displays the current slide index and total count.\n req F-3.4:\n when: user presses Escape or the exit action is triggered\n then: presenter navigates back to the collection view\n```\n\n```mdl\nfeat F-4: Plugin Settings\n\n req F-4.1: PresenterSettings panel is registered for the plugin settings surface.\n req F-4.2:\n when: user enables \"Present collections (experimental)\"\n then: settings.presentCollections is set to true and Collection nodes gain Presenter companions\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Document presenter opens in fullscreen\n given: a Markdown document exists in the workspace\n when: user invokes TogglePresentation (keyboard or action menu)\n then:\n - Composer switches to solo-fullscreen layout\n - DocumentArticle is shown with the document content\n - RevealPlayer is visible with at least one slide\n```\n\n```mdl\ntest T-2: Slide navigation via Reveal.js\n given: a Markdown document with three `---`-separated sections\n when: DocumentArticle renders the document\n then:\n - three horizontal slides are produced\n - arrow-key navigation advances and retreats between slides\n```\n\n```mdl\ntest T-3: Exit returns to document view\n given: DocumentArticle is open in fullscreen\n when: user presses Escape\n then: Composer navigates back to the document article view\n```\n\n```mdl\ntest T-4: Collection slideshow renders per-item surfaces\n given: a Collection with two Markdown documents and settings.presentCollections = true\n when: CollectionArticle mounts\n then:\n - slide 0 shows SlideArticle for collection.objects[0]\n - Pager shows count = 2\n```\n\n```mdl\ntest T-5: Collection slide advance\n given: CollectionArticle at slide 0 with a three-item collection\n when: user clicks the next-slide control in Pager\n then:\n - slide index advances to 1\n - AppSurface.Slide renders collection.objects[1]\n - PageNumber shows \"2 / 3\"\n```\n\n```mdl\ntest T-6: Collections hidden when setting disabled\n given: settings.presentCollections is false (default)\n when: app graph is built for a Collection node\n then: no Presenter companion node is created for the collection\n```\n\n```mdl\ntest T-7: Keyboard shortcut registered\n given: a Markdown document node is focused in the app graph\n then:\n - action with key TogglePresentation is present on the node\n - keyBinding shows Shift+Cmd+P on macOS\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive — the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap\n literals?: UnionList\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap\n state?: FieldMap\n slots?: FieldMap\n actions?: ActionMap\n emits?: EventMap\n layout?: CodeBlock\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap\n output?: TypeExpr\n errors?: ErrorMap\n effects?: EffectList\n requires?: ServiceList\n note?: Prose\n```\n",
17
+ mimeType: "application/x-mdl"
18
+ } }), Plugin.make);
19
+ //#endregion
20
+ export { PresenterPlugin, PresenterPlugin as default };
21
+
22
+ //# sourceMappingURL=PresenterPlugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PresenterPlugin.mjs","names":[],"sources":["../../src/PresenterPlugin.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { MarkdownEvents } from '@dxos/plugin-markdown';\n\nimport { AppGraphBuilder, MarkdownExtension, OperationHandler, PresenterSettings, ReactSurface } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\n// TODO(burdon): Only scale markdown content.\n// TODO(burdon): Map stack content; Slide content type (e.g., markdown, sketch, IPFS image, table, etc.)\n\nexport const PresenterPlugin = Plugin.define(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSettingsModule({ activate: PresenterSettings }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n Plugin.addModule({\n id: `${meta.profile.key}/markdown`,\n activatesOn: MarkdownEvents.SetupExtensions,\n activate: MarkdownExtension,\n }),\n AppPlugin.addTranslationsModule({ translations }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default PresenterPlugin;\n"],"mappings":";;;;;;;;AAkBA,IAAa,kBAAkB,OAAO,OAAO,IAAI,CAAC,CAAC,KACjD,UAAU,kBAAkB,EAAE,UAAU,gBAAgB,CAAC,GACzD,UAAU,0BAA0B,EAAE,UAAU,iBAAiB,CAAC,GAClE,UAAU,kBAAkB,EAAE,UAAU,kBAAkB,CAAC,GAC3D,UAAU,iBAAiB,EAAE,UAAU,aAAa,CAAC,GACrD,OAAO,UAAU;CACf,IAAI,GAAG,KAAK,QAAQ,IAAI;CACxB,aAAa,eAAe;CAC5B,UAAU;AACZ,CAAC,GACD,UAAU,sBAAsB,EAAE,aAAa,CAAC,GAChD,UAAU,qBAAqB,EAC7B,OAAO;CAAE,UAAU,KAAK,QAAQ;CAAK,MAAM;CAAc,SAAS;CAAY,UAAU;AAAoB,EAC9G,CAAC,GACD,OAAO,IACT"}
@@ -0,0 +1,10 @@
1
+ import { Plugin } from "@dxos/app-framework";
2
+ import { meta } from "#meta";
3
+ import { AppPlugin } from "@dxos/app-toolkit";
4
+ import { AppGraphBuilder } from "#capabilities";
5
+ //#region src/PresenterPlugin.node.ts
6
+ var PresenterPlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }), Plugin.make);
7
+ //#endregion
8
+ export { PresenterPlugin, PresenterPlugin as default };
9
+
10
+ //# sourceMappingURL=PresenterPlugin.node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PresenterPlugin.node.mjs","names":[],"sources":["../../src/PresenterPlugin.node.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { AppGraphBuilder } from '#capabilities';\nimport { meta } from '#meta';\n\nexport const PresenterPlugin = Plugin.define(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n Plugin.make,\n);\n\nexport default PresenterPlugin;\n"],"mappings":";;;;;AAUA,IAAa,kBAAkB,OAAO,OAAO,IAAI,CAAC,CAAC,KACjD,UAAU,kBAAkB,EAAE,UAAU,gBAAgB,CAAC,GACzD,OAAO,IACT"}
@@ -0,0 +1,8 @@
1
+ import { Plugin } from "@dxos/app-framework";
2
+ import { meta } from "#meta";
3
+ //#region src/PresenterPlugin.workerd.ts
4
+ var PresenterPlugin = Plugin.define(meta).pipe(Plugin.make);
5
+ //#endregion
6
+ export { PresenterPlugin, PresenterPlugin as default };
7
+
8
+ //# sourceMappingURL=PresenterPlugin.workerd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PresenterPlugin.workerd.mjs","names":[],"sources":["../../src/PresenterPlugin.workerd.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nexport const PresenterPlugin = Plugin.define(meta).pipe(Plugin.make);\n\nexport default PresenterPlugin;\n"],"mappings":";;;AAQA,IAAa,kBAAkB,OAAO,OAAO,IAAI,CAAC,CAAC,KAAK,OAAO,IAAI"}
@@ -0,0 +1,11 @@
1
+ import { Capability } from "@dxos/app-framework";
2
+ //#region src/capabilities/index.ts
3
+ var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("./chunk-app-graph-builder.mjs"));
4
+ var MarkdownExtension = Capability.lazy("MarkdownExtension", () => import("./chunk-markdown-extension.mjs"));
5
+ var OperationHandler = Capability.lazy("OperationHandler", () => import("./chunk-operation-handler.mjs"));
6
+ var ReactSurface = Capability.lazy("ReactSurface", () => import("./chunk-react-surface.mjs"));
7
+ var PresenterSettings = Capability.lazy("PresenterSettings", () => import("./chunk-settings.mjs"));
8
+ //#endregion
9
+ export { AppGraphBuilder, MarkdownExtension, OperationHandler, PresenterSettings, ReactSurface };
10
+
11
+ //# sourceMappingURL=capabilities.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport type { OperationHandlerSet } from '@dxos/compute';\n\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\nexport const MarkdownExtension = Capability.lazy('MarkdownExtension', () => import('./markdown-extension'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\nexport const PresenterSettings = Capability.lazy('PresenterSettings', () => import('./settings'));\n"],"mappings":";;AAOA,IAAa,kBAAkB,WAAW,KAAK,yBAAyB,OAAO,gCAAsB;AACrG,IAAa,oBAAoB,WAAW,KAAK,2BAA2B,OAAO,iCAAuB;AAC1G,IAAa,mBAAmB,WAAW,KACzC,0BACM,OAAO,gCACf;AACA,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB;AAC3F,IAAa,oBAAoB,WAAW,KAAK,2BAA2B,OAAO,uBAAa"}
@@ -0,0 +1,49 @@
1
+ import { t as useExitPresenter } from "./chunk-useExitPresenter.mjs";
2
+ import { useContext, useState } from "react";
3
+ import { Obj } from "@dxos/echo";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { Panel } from "@dxos/react-ui";
6
+ import { PresenterContext } from "#types";
7
+ import { Surface } from "@dxos/app-framework/ui";
8
+ import { AppSurface } from "@dxos/app-toolkit/ui";
9
+ import { Layout, PageNumber, Pager, PresentationShell } from "#components";
10
+ //#region src/containers/CollectionArticle/CollectionArticle.tsx
11
+ var CollectionArticle = ({ role, subject: collection }) => {
12
+ const [slide, setSlide] = useState(0);
13
+ const { running } = useContext(PresenterContext);
14
+ const handleExit = useExitPresenter(collection);
15
+ return /* @__PURE__ */ jsx(Panel.Root, {
16
+ role,
17
+ classNames: "relative",
18
+ children: /* @__PURE__ */ jsx(Panel.Content, {
19
+ asChild: true,
20
+ children: /* @__PURE__ */ jsx(PresentationShell, {
21
+ onExit: handleExit,
22
+ children: /* @__PURE__ */ jsx(Layout, {
23
+ bottomRight: /* @__PURE__ */ jsx(PageNumber, {
24
+ index: slide,
25
+ count: collection.objects.length
26
+ }),
27
+ bottomLeft: /* @__PURE__ */ jsx(Pager, {
28
+ index: slide,
29
+ count: collection.objects.length,
30
+ keys: running,
31
+ onChange: setSlide
32
+ }),
33
+ children: /* @__PURE__ */ jsx(Surface.Surface, {
34
+ type: AppSurface.Slide,
35
+ data: {
36
+ subject: collection.objects[slide],
37
+ attendableId: Obj.getURI(collection)
38
+ }
39
+ })
40
+ })
41
+ })
42
+ })
43
+ });
44
+ };
45
+ CollectionArticle.displayName = "CollectionArticle";
46
+ //#endregion
47
+ export { CollectionArticle as default };
48
+
49
+ //# sourceMappingURL=chunk-CollectionArticle.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-CollectionArticle.mjs","names":[],"sources":["../../src/containers/CollectionArticle/CollectionArticle.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useContext, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { type Collection, Obj } from '@dxos/echo';\nimport { Panel } from '@dxos/react-ui';\n\nimport { PageNumber, Pager, PresentationShell, Layout as PresenterLayout } from '#components';\nimport { PresenterContext } from '#types';\n\nimport { useExitPresenter } from '../../useExitPresenter';\n\nexport type CollectionArticleProps = AppSurface.ObjectArticleProps<Collection.Collection>;\n\nexport const CollectionArticle = ({ role, subject: collection }: CollectionArticleProps) => {\n const [slide, setSlide] = useState(0);\n const { running } = useContext(PresenterContext);\n const handleExit = useExitPresenter(collection);\n\n return (\n <Panel.Root role={role} classNames='relative'>\n <Panel.Content asChild>\n <PresentationShell onExit={handleExit}>\n <PresenterLayout\n bottomRight={<PageNumber index={slide} count={collection.objects.length} />}\n bottomLeft={<Pager index={slide} count={collection.objects.length} keys={running} onChange={setSlide} />}\n >\n <Surface.Surface\n type={AppSurface.Slide}\n data={{\n subject: collection.objects[slide],\n attendableId: Obj.getURI(collection),\n }}\n />\n </PresenterLayout>\n </PresentationShell>\n </Panel.Content>\n </Panel.Root>\n );\n};\n\nCollectionArticle.displayName = 'CollectionArticle';\n"],"mappings":";;;;;;;;;;AAkBA,IAAa,qBAAqB,EAAE,MAAM,SAAS,iBAAyC;CAC1F,MAAM,CAAC,OAAO,YAAY,SAAS,CAAC;CACpC,MAAM,EAAE,YAAY,WAAW,gBAAgB;CAC/C,MAAM,aAAa,iBAAiB,UAAU;CAE9C,OACE,oBAAC,MAAM,MAAP;EAAkB;EAAM,YAAW;YACjC,oBAAC,MAAM,SAAP;GAAe,SAAA;aACb,oBAAC,mBAAD;IAAmB,QAAQ;cACzB,oBAAC,QAAD;KACE,aAAa,oBAAC,YAAD;MAAY,OAAO;MAAO,OAAO,WAAW,QAAQ;KAAS,CAAA;KAC1E,YAAY,oBAAC,OAAD;MAAO,OAAO;MAAO,OAAO,WAAW,QAAQ;MAAQ,MAAM;MAAS,UAAU;KAAW,CAAA;eAEvG,oBAAC,QAAQ,SAAT;MACE,MAAM,WAAW;MACjB,MAAM;OACJ,SAAS,WAAW,QAAQ;OAC5B,cAAc,IAAI,OAAO,UAAU;MACrC;KACD,CAAA;IACc,CAAA;GACA,CAAA;EACN,CAAA;CACL,CAAA;AAEhB;AAEA,kBAAkB,cAAc"}
@@ -0,0 +1,32 @@
1
+ import { t as useExitPresenter } from "./chunk-useExitPresenter.mjs";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { Panel } from "@dxos/react-ui";
5
+ import { useLayout } from "@dxos/app-toolkit/ui";
6
+ import { PresentationShell, RevealPlayer } from "#components";
7
+ //#region src/containers/DocumentArticle/DocumentArticle.tsx
8
+ var DocumentArticle = ({ role, subject: document }) => {
9
+ const handleExit = useExitPresenter(document);
10
+ const fullscreen = useLayout().mode === "solo--fullscreen";
11
+ const content = document.content.target?.content;
12
+ return /* @__PURE__ */ jsx(Panel.Root, {
13
+ role,
14
+ classNames: "relative",
15
+ children: /* @__PURE__ */ jsx(Panel.Content, {
16
+ asChild: true,
17
+ children: /* @__PURE__ */ jsx(PresentationShell, {
18
+ fullscreen,
19
+ onExit: handleExit,
20
+ children: content !== void 0 && /* @__PURE__ */ jsx(RevealPlayer, {
21
+ fullscreen,
22
+ content
23
+ })
24
+ })
25
+ })
26
+ });
27
+ };
28
+ DocumentArticle.displayName = "DocumentArticle";
29
+ //#endregion
30
+ export { DocumentArticle as default };
31
+
32
+ //# sourceMappingURL=chunk-DocumentArticle.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-DocumentArticle.mjs","names":[],"sources":["../../src/containers/DocumentArticle/DocumentArticle.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { AppSurface, useLayout } from '@dxos/app-toolkit/ui';\nimport { type Markdown } from '@dxos/plugin-markdown';\nimport { Panel } from '@dxos/react-ui';\n\nimport { PresentationShell, RevealPlayer } from '#components';\n\nimport { useExitPresenter } from '../../useExitPresenter';\n\nexport type DocumentArticleProps = AppSurface.ObjectArticleProps<Markdown.Document>;\n\nexport const DocumentArticle = ({ role, subject: document }: DocumentArticleProps) => {\n const handleExit = useExitPresenter(document);\n const layout = useLayout();\n const fullscreen = layout.mode === 'solo--fullscreen';\n // RevealPlayer seeds its deck once from `content` (via a `defaultValue`); wait for the markdown ref to\n // resolve so the presentation isn't initialized empty and left blank when the content arrives later.\n const content = document.content.target?.content;\n\n return (\n <Panel.Root role={role} classNames='relative'>\n <Panel.Content asChild>\n <PresentationShell fullscreen={fullscreen} onExit={handleExit}>\n {content !== undefined && <RevealPlayer fullscreen={fullscreen} content={content} />}\n </PresentationShell>\n </Panel.Content>\n </Panel.Root>\n );\n};\n\nDocumentArticle.displayName = 'DocumentArticle';\n"],"mappings":";;;;;;;AAgBA,IAAa,mBAAmB,EAAE,MAAM,SAAS,eAAqC;CACpF,MAAM,aAAa,iBAAiB,QAAQ;CAE5C,MAAM,aADS,UACI,CAAA,CAAO,SAAS;CAGnC,MAAM,UAAU,SAAS,QAAQ,QAAQ;CAEzC,OACE,oBAAC,MAAM,MAAP;EAAkB;EAAM,YAAW;YACjC,oBAAC,MAAM,SAAP;GAAe,SAAA;aACb,oBAAC,mBAAD;IAA+B;IAAY,QAAQ;cAChD,YAAY,KAAA,KAAa,oBAAC,cAAD;KAA0B;KAAqB;IAAU,CAAA;GAClE,CAAA;EACN,CAAA;CACL,CAAA;AAEhB;AAEA,gBAAgB,cAAc"}
@@ -0,0 +1,17 @@
1
+ import "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Panel, Slide } from "#components";
4
+ //#region src/containers/SlideArticle/SlideArticle.tsx
5
+ var SlideArticle = ({ subject: document }) => {
6
+ const content = document.content.target?.content;
7
+ if (!content) return null;
8
+ return /* @__PURE__ */ jsx(Panel, {
9
+ classNames: "border",
10
+ children: /* @__PURE__ */ jsx(Slide, { content })
11
+ });
12
+ };
13
+ SlideArticle.displayName = "SlideArticle";
14
+ //#endregion
15
+ export { SlideArticle as default };
16
+
17
+ //# sourceMappingURL=chunk-SlideArticle.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-SlideArticle.mjs","names":[],"sources":["../../src/containers/SlideArticle/SlideArticle.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { type Markdown } from '@dxos/plugin-markdown';\n\nimport { Panel, Slide } from '#components';\n\nexport type SlideArticleProps = AppSurface.ObjectSectionProps<Markdown.Document>;\n\nexport const SlideArticle = ({ subject: document }: SlideArticleProps) => {\n const content = document.content.target?.content;\n if (!content) {\n return null;\n }\n\n return (\n <Panel classNames='border'>\n <Slide content={content} />\n </Panel>\n );\n};\n\nSlideArticle.displayName = 'SlideArticle';\n"],"mappings":";;;;AAaA,IAAa,gBAAgB,EAAE,SAAS,eAAkC;CACxE,MAAM,UAAU,SAAS,QAAQ,QAAQ;CACzC,IAAI,CAAC,SACH,OAAO;CAGT,OACE,oBAAC,OAAD;EAAO,YAAW;YAChB,oBAAC,OAAD,EAAgB,QAAU,CAAA;CACrB,CAAA;AAEX;AAEA,aAAa,cAAc"}
@@ -0,0 +1,57 @@
1
+ import { Capability } from "@dxos/app-framework";
2
+ import { meta } from "#meta";
3
+ import { Operation } from "@dxos/compute";
4
+ import { Collection, Obj } from "@dxos/echo";
5
+ import { Markdown } from "@dxos/plugin-markdown";
6
+ import { AppCapabilities, AppNode } from "@dxos/app-toolkit";
7
+ import * as Effect from "effect/Effect";
8
+ import * as Option from "effect/Option";
9
+ import { GraphBuilder, NodeMatcher } from "@dxos/plugin-graph";
10
+ import { PresenterCapabilities, PresenterOperation } from "#types";
11
+ //#region src/capabilities/app-graph-builder.ts
12
+ /** Match nodes that can be presented (Collection or Document). */
13
+ var whenPresentable = (node, get) => Option.orElse(NodeMatcher.whenEchoType(Collection.Collection)(node, get), () => NodeMatcher.whenEchoType(Markdown.Document)(node, get));
14
+ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
15
+ const capabilities = yield* Capability.Service;
16
+ const extensions = yield* GraphBuilder.createExtension({
17
+ id: "root",
18
+ match: whenPresentable,
19
+ connector: (object, get) => {
20
+ if (!(get(capabilities.get(PresenterCapabilities.Settings))?.presentCollections ? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object) : Obj.instanceOf(Markdown.Document, object))) return Effect.succeed([]);
21
+ return Effect.succeed([AppNode.makeCompanion({
22
+ variant: "presenter",
23
+ label: "Presenter",
24
+ icon: "ph--presentation--regular",
25
+ data: {
26
+ type: meta.profile.key,
27
+ object
28
+ }
29
+ })]);
30
+ },
31
+ actions: (object, get) => {
32
+ const isPresentable = get(capabilities.get(PresenterCapabilities.Settings))?.presentCollections ? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object) : Obj.instanceOf(Markdown.Document, object);
33
+ const db = Obj.getDatabase(object);
34
+ if (!isPresentable || !db) return Effect.succeed([]);
35
+ return Effect.succeed([{
36
+ id: PresenterOperation.TogglePresentation.meta.key,
37
+ data: Effect.fnUntraced(function* () {
38
+ yield* Operation.invoke(PresenterOperation.TogglePresentation, { object });
39
+ }),
40
+ properties: {
41
+ label: ["toggle-presentation.label", { ns: meta.profile.key }],
42
+ icon: "ph--presentation--regular",
43
+ disposition: "list-item",
44
+ keyBinding: {
45
+ macos: "shift+meta+p",
46
+ windows: "shift+alt+p"
47
+ }
48
+ }
49
+ }]);
50
+ }
51
+ });
52
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
53
+ }));
54
+ //#endregion
55
+ export { app_graph_builder_default as default };
56
+
57
+ //# sourceMappingURL=chunk-app-graph-builder.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-app-graph-builder.mjs","names":[],"sources":["../../src/capabilities/app-graph-builder.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, AppNode } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { Collection, Obj } from '@dxos/echo';\nimport { GraphBuilder, type Node, NodeMatcher } from '@dxos/plugin-graph';\nimport { Markdown } from '@dxos/plugin-markdown';\n\nimport { meta } from '#meta';\nimport { PresenterOperation } from '#types';\nimport { PresenterCapabilities } from '#types';\n\n/** Match nodes that can be presented (Collection or Document). */\nconst whenPresentable = (node: Node.Node, get: Atom.Context) =>\n Option.orElse(NodeMatcher.whenEchoType(Collection.Collection)(node, get), () =>\n NodeMatcher.whenEchoType(Markdown.Document)(node, get),\n );\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const capabilities = yield* Capability.Service;\n\n const extensions = yield* GraphBuilder.createExtension({\n id: 'root',\n // TODO(wittjosiah): This is a hack to work around presenter previously relying on \"variant\". Remove.\n match: whenPresentable,\n connector: (object, get) => {\n const settingsAtom = capabilities.get(PresenterCapabilities.Settings);\n const settings = get(settingsAtom);\n const isPresentable = settings?.presentCollections\n ? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)\n : Obj.instanceOf(Markdown.Document, object);\n if (!isPresentable) {\n return Effect.succeed([]);\n }\n\n return Effect.succeed([\n AppNode.makeCompanion({\n variant: 'presenter',\n label: 'Presenter',\n icon: 'ph--presentation--regular',\n data: { type: meta.profile.key, object },\n }),\n ]);\n },\n actions: (object, get) => {\n const settingsAtom = capabilities.get(PresenterCapabilities.Settings);\n const settings = get(settingsAtom);\n const isPresentable = settings?.presentCollections\n ? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)\n : Obj.instanceOf(Markdown.Document, object);\n const db = Obj.getDatabase(object);\n if (!isPresentable || !db) {\n return Effect.succeed([]);\n }\n\n return Effect.succeed([\n {\n id: PresenterOperation.TogglePresentation.meta.key,\n data: Effect.fnUntraced(function* () {\n yield* Operation.invoke(PresenterOperation.TogglePresentation, { object });\n }),\n properties: {\n label: ['toggle-presentation.label', { ns: meta.profile.key }],\n icon: 'ph--presentation--regular',\n disposition: 'list-item',\n keyBinding: {\n macos: 'shift+meta+p',\n windows: 'shift+alt+p',\n },\n },\n },\n ]);\n },\n });\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAM,mBAAmB,MAAiB,QACxC,OAAO,OAAO,YAAY,aAAa,WAAW,UAAU,CAAC,CAAC,MAAM,GAAG,SACrE,YAAY,aAAa,SAAS,QAAQ,CAAC,CAAC,MAAM,GAAG,CACvD;AAEF,IAAA,4BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,MAAM,eAAe,OAAO,WAAW;CAEvC,MAAM,aAAa,OAAO,aAAa,gBAAgB;EACrD,IAAI;EAEJ,OAAO;EACP,YAAY,QAAQ,QAAQ;GAM1B,IAAI,EAJa,IADI,aAAa,IAAI,sBAAsB,QACvC,CACC,CAAA,EAAU,qBAC5B,IAAI,WAAW,WAAW,YAAY,MAAM,KAAK,IAAI,WAAW,SAAS,UAAU,MAAM,IACzF,IAAI,WAAW,SAAS,UAAU,MAAM,IAE1C,OAAO,OAAO,QAAQ,CAAC,CAAC;GAG1B,OAAO,OAAO,QAAQ,CACpB,QAAQ,cAAc;IACpB,SAAS;IACT,OAAO;IACP,MAAM;IACN,MAAM;KAAE,MAAM,KAAK,QAAQ;KAAK;IAAO;GACzC,CAAC,CACH,CAAC;EACH;EACA,UAAU,QAAQ,QAAQ;GAGxB,MAAM,gBADW,IADI,aAAa,IAAI,sBAAsB,QACvC,CACC,CAAA,EAAU,qBAC5B,IAAI,WAAW,WAAW,YAAY,MAAM,KAAK,IAAI,WAAW,SAAS,UAAU,MAAM,IACzF,IAAI,WAAW,SAAS,UAAU,MAAM;GAC5C,MAAM,KAAK,IAAI,YAAY,MAAM;GACjC,IAAI,CAAC,iBAAiB,CAAC,IACrB,OAAO,OAAO,QAAQ,CAAC,CAAC;GAG1B,OAAO,OAAO,QAAQ,CACpB;IACE,IAAI,mBAAmB,mBAAmB,KAAK;IAC/C,MAAM,OAAO,WAAW,aAAa;KACnC,OAAO,UAAU,OAAO,mBAAmB,oBAAoB,EAAE,OAAO,CAAC;IAC3E,CAAC;IACD,YAAY;KACV,OAAO,CAAC,6BAA6B,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;KAC7D,MAAM;KACN,aAAa;KACb,YAAY;MACV,OAAO;MACP,SAAS;KACX;IACF;GACF,CACF,CAAC;EACH;CACF,CAAC;CAED,OAAO,WAAW,YAAY,gBAAgB,iBAAiB,UAAU;AAC3E,CAAC,CACH"}
@@ -0,0 +1,31 @@
1
+ import { Capabilities, Capability } from "@dxos/app-framework";
2
+ import * as Effect from "effect/Effect";
3
+ import { PresenterOperation } from "#types";
4
+ import { Prec } from "@codemirror/state";
5
+ import { MarkdownCapabilities } from "@dxos/plugin-markdown/types";
6
+ import { keymap } from "@dxos/ui-editor";
7
+ //#region src/capabilities/markdown-extension.ts
8
+ /**
9
+ * Contributes the present shortcut (Shift+Cmd+P) to the markdown editor so presentation
10
+ * can be toggled while editing without relying on the global navtree keyboard context.
11
+ */
12
+ var markdown_extension_default = Capability.makeModule(Effect.fnUntraced(function* () {
13
+ const capabilities = yield* Capability.Service;
14
+ return Capability.contributes(MarkdownCapabilities.ExtensionProvider, [({ document }) => {
15
+ if (!document) return;
16
+ const { invokePromise } = capabilities.get(Capabilities.OperationInvoker);
17
+ return Prec.highest(keymap.of([{
18
+ key: "Shift-Mod-p",
19
+ preventDefault: true,
20
+ stopPropagation: true,
21
+ run: () => {
22
+ invokePromise(PresenterOperation.TogglePresentation, { object: document });
23
+ return true;
24
+ }
25
+ }]));
26
+ }]);
27
+ }));
28
+ //#endregion
29
+ export { markdown_extension_default as default };
30
+
31
+ //# sourceMappingURL=chunk-markdown-extension.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-markdown-extension.mjs","names":[],"sources":["../../src/capabilities/markdown-extension.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Prec } from '@codemirror/state';\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { MarkdownCapabilities } from '@dxos/plugin-markdown/types';\nimport { keymap } from '@dxos/ui-editor';\n\nimport { PresenterOperation } from '#types';\n\n/**\n * Contributes the present shortcut (Shift+Cmd+P) to the markdown editor so presentation\n * can be toggled while editing without relying on the global navtree keyboard context.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const capabilities = yield* Capability.Service;\n\n return Capability.contributes(MarkdownCapabilities.ExtensionProvider, [\n ({ document }) => {\n if (!document) {\n return undefined;\n }\n\n const { invokePromise } = capabilities.get(Capabilities.OperationInvoker);\n return Prec.highest(\n keymap.of([\n {\n key: 'Shift-Mod-p',\n preventDefault: true,\n stopPropagation: true,\n run: () => {\n void invokePromise(PresenterOperation.TogglePresentation, { object: document });\n return true;\n },\n },\n ]),\n );\n },\n ]);\n }),\n);\n"],"mappings":";;;;;;;;;;;AAiBA,IAAA,6BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,MAAM,eAAe,OAAO,WAAW;CAEvC,OAAO,WAAW,YAAY,qBAAqB,mBAAmB,EACnE,EAAE,eAAe;EAChB,IAAI,CAAC,UACH;EAGF,MAAM,EAAE,kBAAkB,aAAa,IAAI,aAAa,gBAAgB;EACxE,OAAO,KAAK,QACV,OAAO,GAAG,CACR;GACE,KAAK;GACL,gBAAgB;GAChB,iBAAiB;GACjB,WAAW;IACT,cAAmB,mBAAmB,oBAAoB,EAAE,QAAQ,SAAS,CAAC;IAC9E,OAAO;GACT;EACF,CACF,CAAC,CACH;CACF,CACF,CAAC;AACH,CAAC,CACH"}
@@ -1,15 +1,12 @@
1
- // src/meta.ts
2
1
  import { Plugin } from "@dxos/app-framework";
3
-
4
- // dx.config.ts
5
2
  import { Config2 } from "@dxos/app-framework/config";
6
3
  import { trim } from "@dxos/util";
7
- var dx_config_default = Config2.make({
8
- plugin: {
9
- key: "org.dxos.plugin.presenter",
10
- name: "Presenter",
11
- author: "DXOS",
12
- description: trim`
4
+ //#region dx.config.ts
5
+ var dx_config_default = Config2.make({ plugin: {
6
+ key: "org.dxos.plugin.presenter",
7
+ name: "Presenter",
8
+ author: "DXOS",
9
+ description: trim`
13
10
  Transform existing workspace objects into interactive presentation slideshows without
14
11
  duplicating content. Markdown documents are split into slides on horizontal \`---\`
15
12
  separators and rendered with Reveal.js, giving authors a familiar authoring surface
@@ -29,19 +26,18 @@ var dx_config_default = Config2.make({
29
26
  by any peer in the workspace are immediately reflected in an open presentation without
30
27
  any manual refresh.
31
28
  `,
32
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-presenter",
33
- icon: {
34
- key: "ph--presentation--regular",
35
- hue: "indigo"
36
- },
37
- spec: "PLUGIN.mdl"
38
- }
39
- });
40
-
41
- // src/meta.ts
29
+ source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-presenter",
30
+ icon: {
31
+ key: "ph--presentation--regular",
32
+ hue: "indigo"
33
+ },
34
+ spec: "PLUGIN.mdl",
35
+ tags: ["alpha"]
36
+ } });
37
+ //#endregion
38
+ //#region src/meta.ts
42
39
  var meta = Plugin.getMetaFromConfig(dx_config_default);
40
+ //#endregion
41
+ export { meta as t };
43
42
 
44
- export {
45
- meta
46
- };
47
- //# sourceMappingURL=chunk-MSQDHOPV.mjs.map
43
+ //# sourceMappingURL=chunk-meta.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-meta.mjs","names":[],"sources":["../../dx.config.ts","../../src/meta.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.presenter',\n name: 'Presenter',\n author: 'DXOS',\n description: trim`\n Transform existing workspace objects into interactive presentation slideshows without\n duplicating content. Markdown documents are split into slides on horizontal \\`---\\`\n separators and rendered with Reveal.js, giving authors a familiar authoring surface\n with full Markdown syntax. Collections can optionally be presented slide-by-slide,\n with each member object rendered by its own plugin surface.\n\n Activate presentation mode for any supported object via the action menu or the\n Shift+Cmd+P (macOS) / Shift+Alt+P (Windows/Linux) keyboard shortcut. The presenter\n opens in a solo fullscreen layout managed by the Deck plugin, keeping the rest of the\n workspace undisturbed.\n\n Navigation controls and a page-number indicator are shown during collection\n slideshows. Pressing Escape exits fullscreen and returns to the originating document\n or collection view. All navigation is keyboard-accessible.\n\n Collaboration is inherent: because slides are backed by live ECHO objects, edits made\n by any peer in the workspace are immediately reflected in an open presentation without\n any manual refresh.\n `,\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-presenter',\n icon: { key: 'ph--presentation--regular', hue: 'indigo' },\n spec: 'PLUGIN.mdl',\n tags: ['alpha'],\n },\n});\n","//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport config from '../dx.config';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n"],"mappings":";;;;AAOA,IAAA,oBAAe,QAAQ,KAAK,EAC1B,QAAQ;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,aAAa,IAAI;;;;;;;;;;;;;;;;;;;;CAoBjB,QAAQ;CACR,MAAM;EAAE,KAAK;EAA6B,KAAK;CAAS;CACxD,MAAM;CACN,MAAM,CAAC,OAAO;AAChB,EACF,CAAC;;;AC7BD,IAAa,OAAO,OAAO,kBAAkB,iBAAM"}
@@ -0,0 +1,11 @@
1
+ import { Capabilities, Capability } from "@dxos/app-framework";
2
+ import * as Effect from "effect/Effect";
3
+ import { PresenterOperationHandlerSet } from "#operations";
4
+ //#region src/capabilities/operation-handler.ts
5
+ var operation_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
6
+ return Capability.contributes(Capabilities.OperationHandler, PresenterOperationHandlerSet);
7
+ }));
8
+ //#endregion
9
+ export { operation_handler_default as default };
10
+
11
+ //# sourceMappingURL=chunk-operation-handler.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-operation-handler.mjs","names":[],"sources":["../../src/capabilities/operation-handler.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport type { OperationHandlerSet } from '@dxos/compute';\n\nimport { PresenterOperationHandlerSet } from '#operations';\n\nexport default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Capabilities.OperationHandler, PresenterOperationHandlerSet);\n }),\n);\n"],"mappings":";;;;AAWA,IAAA,4BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,OAAO,WAAW,YAAY,aAAa,kBAAkB,4BAA4B;AAC3F,CAAC,CACH"}
@@ -0,0 +1,42 @@
1
+ import { Capabilities, Capability } from "@dxos/app-framework";
2
+ import { Position } from "@dxos/util";
3
+ import { meta } from "#meta";
4
+ import { Collection, Obj } from "@dxos/echo";
5
+ import { Markdown } from "@dxos/plugin-markdown";
6
+ import * as Effect from "effect/Effect";
7
+ import { Surface } from "@dxos/app-framework/ui";
8
+ import { AppSurface } from "@dxos/app-toolkit/ui";
9
+ import { CollectionArticle, DocumentArticle, SlideArticle } from "#containers";
10
+ //#region src/capabilities/react-surface.ts
11
+ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
12
+ Surface.create({
13
+ id: "document",
14
+ position: Position.first,
15
+ filter: Surface.makeFilter(AppSurface.Article, (data) => !!data.subject && typeof data.subject === "object" && "type" in data.subject && "object" in data.subject && data.subject.type === meta.profile.key && Obj.instanceOf(Markdown.Document, data.subject.object)),
16
+ component: DocumentArticle,
17
+ props: ({ role, data: { subject } }) => ({
18
+ role,
19
+ subject: subject.object
20
+ })
21
+ }),
22
+ Surface.create({
23
+ id: "collection",
24
+ position: Position.first,
25
+ filter: Surface.makeFilter(AppSurface.Article, (data) => !!data.subject && typeof data.subject === "object" && "type" in data.subject && "object" in data.subject && data.subject.type === meta.profile.key && Obj.instanceOf(Collection.Collection, data.subject.object)),
26
+ component: CollectionArticle,
27
+ props: ({ role, data: { subject } }) => ({
28
+ role,
29
+ subject: subject.object
30
+ })
31
+ }),
32
+ Surface.create({
33
+ id: "slide",
34
+ filter: AppSurface.object(AppSurface.Slide, Markdown.Document),
35
+ component: SlideArticle,
36
+ props: ({ data }) => ({ ...data })
37
+ })
38
+ ])));
39
+ //#endregion
40
+ export { react_surface_default as default };
41
+
42
+ //# sourceMappingURL=chunk-react-surface.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { Collection, Obj } from '@dxos/echo';\nimport { Markdown } from '@dxos/plugin-markdown';\nimport { Position } from '@dxos/util';\n\nimport { CollectionArticle, DocumentArticle, SlideArticle } from '#containers';\nimport { meta } from '#meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: 'document',\n position: Position.first,\n filter: Surface.makeFilter(\n AppSurface.Article,\n (data): data is AppSurface.ArticleData<{ type: typeof meta.profile.key; object: Markdown.Document }> =>\n !!data.subject &&\n typeof data.subject === 'object' &&\n 'type' in data.subject &&\n 'object' in data.subject &&\n data.subject.type === meta.profile.key &&\n Obj.instanceOf(Markdown.Document, data.subject.object),\n ),\n component: DocumentArticle,\n props: ({ role, data: { subject } }) => ({ role, subject: subject.object }),\n }),\n Surface.create({\n id: 'collection',\n position: Position.first,\n filter: Surface.makeFilter(\n AppSurface.Article,\n (data): data is AppSurface.ArticleData<{ type: typeof meta.profile.key; object: Collection.Collection }> =>\n !!data.subject &&\n typeof data.subject === 'object' &&\n 'type' in data.subject &&\n 'object' in data.subject &&\n data.subject.type === meta.profile.key &&\n Obj.instanceOf(Collection.Collection, data.subject.object),\n ),\n component: CollectionArticle,\n props: ({ role, data: { subject } }) => ({ role, subject: subject.object }),\n }),\n Surface.create({\n id: 'slide',\n filter: AppSurface.object(AppSurface.Slide, Markdown.Document),\n component: SlideArticle,\n props: ({ data }) => ({ ...data }),\n }),\n ]),\n ),\n);\n"],"mappings":";;;;;;;;;;AAgBA,IAAA,wBAAe,WAAW,iBACxB,OAAO,QACL,WAAW,YAAY,aAAa,cAAc;CAChD,QAAQ,OAAO;EACb,IAAI;EACJ,UAAU,SAAS;EACnB,QAAQ,QAAQ,WACd,WAAW,UACV,SACC,CAAC,CAAC,KAAK,WACP,OAAO,KAAK,YAAY,YACxB,UAAU,KAAK,WACf,YAAY,KAAK,WACjB,KAAK,QAAQ,SAAS,KAAK,QAAQ,OACnC,IAAI,WAAW,SAAS,UAAU,KAAK,QAAQ,MAAM,CACzD;EACA,WAAW;EACX,QAAQ,EAAE,MAAM,MAAM,EAAE,iBAAiB;GAAE;GAAM,SAAS,QAAQ;EAAO;CAC3E,CAAC;CACD,QAAQ,OAAO;EACb,IAAI;EACJ,UAAU,SAAS;EACnB,QAAQ,QAAQ,WACd,WAAW,UACV,SACC,CAAC,CAAC,KAAK,WACP,OAAO,KAAK,YAAY,YACxB,UAAU,KAAK,WACf,YAAY,KAAK,WACjB,KAAK,QAAQ,SAAS,KAAK,QAAQ,OACnC,IAAI,WAAW,WAAW,YAAY,KAAK,QAAQ,MAAM,CAC7D;EACA,WAAW;EACX,QAAQ,EAAE,MAAM,MAAM,EAAE,iBAAiB;GAAE;GAAM,SAAS,QAAQ;EAAO;CAC3E,CAAC;CACD,QAAQ,OAAO;EACb,IAAI;EACJ,QAAQ,WAAW,OAAO,WAAW,OAAO,SAAS,QAAQ;EAC7D,WAAW;EACX,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK;CAClC,CAAC;AACH,CAAC,CACH,CACF"}
@@ -0,0 +1,23 @@
1
+ import { Capability } from "@dxos/app-framework";
2
+ import { meta } from "#meta";
3
+ import { AppCapabilities } from "@dxos/app-toolkit";
4
+ import * as Effect from "effect/Effect";
5
+ import { PresenterCapabilities, Settings } from "#types";
6
+ import { createKvsStore } from "@dxos/effect";
7
+ //#region src/capabilities/settings.ts
8
+ var settings_default = Capability.makeModule(() => Effect.sync(() => {
9
+ const settingsAtom = createKvsStore({
10
+ key: meta.profile.key,
11
+ schema: Settings.Settings,
12
+ defaultValue: () => ({})
13
+ });
14
+ return [Capability.contributes(PresenterCapabilities.Settings, settingsAtom), Capability.contributes(AppCapabilities.Settings, {
15
+ prefix: meta.profile.key,
16
+ schema: Settings.Settings,
17
+ atom: settingsAtom
18
+ })];
19
+ }));
20
+ //#endregion
21
+ export { settings_default as default };
22
+
23
+ //# sourceMappingURL=chunk-settings.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-settings.mjs","names":[],"sources":["../../src/capabilities/settings.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { createKvsStore } from '@dxos/effect';\n\nimport { meta } from '#meta';\nimport { PresenterCapabilities, Settings } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.sync(() => {\n const settingsAtom = createKvsStore({\n key: meta.profile.key,\n schema: Settings.Settings,\n defaultValue: () => ({}),\n });\n\n return [\n Capability.contributes(PresenterCapabilities.Settings, settingsAtom),\n Capability.contributes(AppCapabilities.Settings, {\n prefix: meta.profile.key,\n schema: Settings.Settings,\n atom: settingsAtom,\n }),\n ];\n }),\n);\n"],"mappings":";;;;;;;AAaA,IAAA,mBAAe,WAAW,iBACxB,OAAO,WAAW;CAChB,MAAM,eAAe,eAAe;EAClC,KAAK,KAAK,QAAQ;EAClB,QAAQ,SAAS;EACjB,qBAAqB,CAAC;CACxB,CAAC;CAED,OAAO,CACL,WAAW,YAAY,sBAAsB,UAAU,YAAY,GACnE,WAAW,YAAY,gBAAgB,UAAU;EAC/C,QAAQ,KAAK,QAAQ;EACrB,QAAQ,SAAS;EACjB,MAAM;CACR,CAAC,CACH;AACF,CAAC,CACH"}
@@ -0,0 +1,48 @@
1
+ import { Capabilities } from "@dxos/app-framework";
2
+ import { Operation } from "@dxos/compute";
3
+ import { Obj } from "@dxos/echo";
4
+ import { GraphPath, LayoutOperation } from "@dxos/app-toolkit";
5
+ import * as Effect from "effect/Effect";
6
+ import { PresenterOperation } from "#types";
7
+ import { DeckCapabilities, DeckOperation } from "@dxos/plugin-deck";
8
+ import { Attention } from "@dxos/react-ui-attention";
9
+ //#region src/paths.ts
10
+ /** Canonical qualified path to the presentation companion node for an object. */
11
+ var getPresentationPath = (objectPath) => `${objectPath}/${Attention.linkedSegment("presenter")}`;
12
+ //#endregion
13
+ //#region src/operations/toggle-presentation.ts
14
+ /**
15
+ * Enters or exits presentation for the given object. When `state` is omitted the
16
+ * current presentation state is toggled. Entering fullscreens the presenter companion;
17
+ * exiting reverts fullscreen and re-opens the source object.
18
+ */
19
+ var handler = PresenterOperation.TogglePresentation.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ object, state }) {
20
+ const db = Obj.getDatabase(object);
21
+ if (!db) return;
22
+ const objectPath = GraphPath.getObjectPathFromObject(object);
23
+ const presenterId = getPresentationPath(objectPath);
24
+ const presenting = (yield* Capabilities.getAtomValue(DeckCapabilities.EphemeralState)).fullscreen === presenterId;
25
+ if (state ?? !presenting) {
26
+ if (!presenting) yield* Operation.invoke(DeckOperation.Adjust, {
27
+ type: "fullscreen",
28
+ id: presenterId
29
+ });
30
+ yield* Operation.invoke(LayoutOperation.Open, {
31
+ subject: [presenterId],
32
+ workspace: GraphPath.getSpacePath(db.spaceId)
33
+ });
34
+ } else {
35
+ if (presenting) yield* Operation.invoke(DeckOperation.Adjust, {
36
+ type: "fullscreen",
37
+ id: presenterId
38
+ });
39
+ yield* Operation.invoke(LayoutOperation.Open, {
40
+ subject: [objectPath],
41
+ workspace: GraphPath.getSpacePath(db.spaceId)
42
+ });
43
+ }
44
+ })));
45
+ //#endregion
46
+ export { handler as default };
47
+
48
+ //# sourceMappingURL=chunk-toggle-presentation.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-toggle-presentation.mjs","names":[],"sources":["../../src/paths.ts","../../src/operations/toggle-presentation.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Attention } from '@dxos/react-ui-attention';\n\n/** Canonical qualified path to the presentation companion node for an object. */\nexport const getPresentationPath = (objectPath: string): string =>\n `${objectPath}/${Attention.linkedSegment('presenter')}`;\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities } from '@dxos/app-framework';\nimport { GraphPath, LayoutOperation } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { Obj } from '@dxos/echo';\nimport { DeckCapabilities, DeckOperation } from '@dxos/plugin-deck';\n\nimport { PresenterOperation } from '#types';\n\nimport { getPresentationPath } from '../paths';\n\n/**\n * Enters or exits presentation for the given object. When `state` is omitted the\n * current presentation state is toggled. Entering fullscreens the presenter companion;\n * exiting reverts fullscreen and re-opens the source object.\n */\nconst handler: Operation.WithHandler<typeof PresenterOperation.TogglePresentation> =\n PresenterOperation.TogglePresentation.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ object, state }) {\n const db = Obj.getDatabase(object);\n if (!db) {\n return;\n }\n\n const objectPath = GraphPath.getObjectPathFromObject(object);\n const presenterId = getPresentationPath(objectPath);\n const ephemeral = yield* Capabilities.getAtomValue(DeckCapabilities.EphemeralState);\n const presenting = ephemeral.fullscreen === presenterId;\n const next = state ?? !presenting;\n\n if (next) {\n if (!presenting) {\n // Toggles ephemeral fullscreen from undefined to `presenterId`.\n yield* Operation.invoke(DeckOperation.Adjust, { type: 'fullscreen' as const, id: presenterId });\n }\n yield* Operation.invoke(LayoutOperation.Open, {\n subject: [presenterId],\n workspace: GraphPath.getSpacePath(db.spaceId),\n });\n } else {\n if (presenting) {\n // Toggles ephemeral fullscreen back to undefined; `id` must match the currently-fullscreen\n // plank for the toggle in `adjust.ts` to clear it rather than switching it.\n yield* Operation.invoke(DeckOperation.Adjust, { type: 'fullscreen' as const, id: presenterId });\n }\n yield* Operation.invoke(LayoutOperation.Open, {\n subject: [objectPath],\n workspace: GraphPath.getSpacePath(db.spaceId),\n });\n }\n }),\n ),\n );\n\nexport default handler;\n"],"mappings":";;;;;;;;;;AAOA,IAAa,uBAAuB,eAClC,GAAG,WAAW,GAAG,UAAU,cAAc,WAAW;;;;;;;;ACatD,IAAM,UACJ,mBAAmB,mBAAmB,KACpC,UAAU,YACR,OAAO,WAAW,WAAW,EAAE,QAAQ,SAAS;CAC9C,MAAM,KAAK,IAAI,YAAY,MAAM;CACjC,IAAI,CAAC,IACH;CAGF,MAAM,aAAa,UAAU,wBAAwB,MAAM;CAC3D,MAAM,cAAc,oBAAoB,UAAU;CAElD,MAAM,cAAa,OADM,aAAa,aAAa,iBAAiB,cAAc,EAAA,CACrD,eAAe;CAG5C,IAFa,SAAS,CAAC,YAEb;EACR,IAAI,CAAC,YAEH,OAAO,UAAU,OAAO,cAAc,QAAQ;GAAE,MAAM;GAAuB,IAAI;EAAY,CAAC;EAEhG,OAAO,UAAU,OAAO,gBAAgB,MAAM;GAC5C,SAAS,CAAC,WAAW;GACrB,WAAW,UAAU,aAAa,GAAG,OAAO;EAC9C,CAAC;CACH,OAAO;EACL,IAAI,YAGF,OAAO,UAAU,OAAO,cAAc,QAAQ;GAAE,MAAM;GAAuB,IAAI;EAAY,CAAC;EAEhG,OAAO,UAAU,OAAO,gBAAgB,MAAM;GAC5C,SAAS,CAAC,UAAU;GACpB,WAAW,UAAU,aAAa,GAAG,OAAO;EAC9C,CAAC;CACH;AACF,CAAC,CACH,CACF"}