@dxos/plugin-presenter 0.11.1 → 0.12.0-next-bbabc02363f18d7643ea4160e3a7a7809870fd0d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/Presenter.mjs +13 -0
- package/dist/lib/Presenter.mjs.map +1 -0
- package/dist/lib/PresenterCapabilities.mjs +10 -0
- package/dist/lib/PresenterCapabilities.mjs.map +1 -0
- package/dist/lib/PresenterEvents.mjs +15 -0
- package/dist/lib/PresenterEvents.mjs.map +1 -0
- package/dist/lib/PresenterOperation.mjs +27 -0
- package/dist/lib/PresenterOperation.mjs.map +1 -0
- package/dist/lib/PresenterPlugin.mjs +4 -9
- package/dist/lib/PresenterPlugin.mjs.map +1 -1
- package/dist/lib/PresenterPlugin.node.mjs +2 -3
- package/dist/lib/PresenterPlugin.node.mjs.map +1 -1
- package/dist/lib/PresenterPlugin.workerd.mjs +1 -1
- package/dist/lib/PresenterPlugin.workerd.mjs.map +1 -1
- package/dist/lib/Settings.mjs +12 -0
- package/dist/lib/Settings.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +17 -6
- package/dist/lib/capabilities.mjs.map +1 -1
- package/dist/lib/chunk-CollectionArticle.mjs +1 -1
- package/dist/lib/chunk-CollectionArticle.mjs.map +1 -1
- package/dist/lib/chunk-DocumentArticle.mjs.map +1 -1
- package/dist/lib/chunk-SlideArticle.mjs.map +1 -1
- package/dist/lib/chunk-app-graph-builder.mjs +17 -12
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -1
- package/dist/lib/chunk-markdown-extension.mjs +6 -5
- package/dist/lib/chunk-markdown-extension.mjs.map +1 -1
- package/dist/lib/chunk-meta.mjs +1 -1
- package/dist/lib/chunk-meta.mjs.map +1 -1
- package/dist/lib/chunk-operation-handler.mjs +3 -2
- package/dist/lib/chunk-operation-handler.mjs.map +1 -1
- package/dist/lib/chunk-react-surface.mjs +5 -4
- package/dist/lib/chunk-react-surface.mjs.map +1 -1
- package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
- package/dist/lib/chunk-settings.mjs +7 -6
- package/dist/lib/chunk-settings.mjs.map +1 -1
- package/dist/lib/chunk-toggle-presentation.mjs +8 -6
- package/dist/lib/chunk-toggle-presentation.mjs.map +1 -1
- package/dist/lib/chunk-useExitPresenter.mjs +2 -2
- package/dist/lib/chunk-useExitPresenter.mjs.map +1 -1
- package/dist/lib/index.mjs +6 -2
- package/dist/lib/operations.mjs +4 -2
- package/dist/lib/operations.mjs.map +1 -1
- package/dist/lib/plugin.mjs +1 -1
- package/dist/lib/plugin.mjs.map +1 -1
- package/dist/types/src/PresenterPlugin.d.ts +1 -1
- package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
- package/dist/types/src/PresenterPlugin.node.d.ts +1 -1
- package/dist/types/src/PresenterPlugin.node.d.ts.map +1 -1
- package/dist/types/src/PresenterPlugin.workerd.d.ts +1 -1
- package/dist/types/src/PresenterPlugin.workerd.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +6 -7
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown-extension.d.ts +2 -2
- package/dist/types/src/capabilities/markdown-extension.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +2 -3
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +2 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/components/Markdown/Panel.stories.d.ts +1 -1
- package/dist/types/src/components/Markdown/Slide.stories.d.ts +1 -1
- package/dist/types/src/components/Presenter/Pager.stories.d.ts +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +1 -1
- package/dist/types/src/containers/DocumentArticle/DocumentArticle.d.ts +1 -1
- package/dist/types/src/containers/DocumentArticle/DocumentArticle.d.ts.map +1 -1
- package/dist/types/src/containers/SlideArticle/SlideArticle.d.ts +1 -1
- package/dist/types/src/containers/SlideArticle/SlideArticle.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +5 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/toggle-presentation.d.ts +2 -2
- package/dist/types/src/operations/toggle-presentation.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +1 -1
- package/dist/types/src/plugin.d.ts.map +1 -1
- package/dist/types/src/types/{index.d.ts → Presenter.d.ts} +1 -4
- package/dist/types/src/types/Presenter.d.ts.map +1 -0
- package/dist/types/src/types/PresenterCapabilities.d.ts +2 -2
- package/dist/types/src/types/PresenterCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/PresenterEvents.d.ts +8 -0
- package/dist/types/src/types/PresenterEvents.d.ts.map +1 -0
- package/dist/types/src/types/PresenterOperation.d.ts +3 -3
- package/dist/types/src/types/PresenterOperation.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +64 -28
- package/src/PresenterPlugin.node.ts +2 -6
- package/src/PresenterPlugin.tsx +16 -16
- package/src/PresenterPlugin.workerd.ts +1 -1
- package/src/capabilities/app-graph-builder.ts +22 -20
- package/src/capabilities/index.ts +22 -9
- package/src/capabilities/markdown-extension.ts +5 -4
- package/src/capabilities/operation-handler.ts +4 -4
- package/src/capabilities/react-surface.ts +4 -3
- package/src/capabilities/settings.ts +7 -5
- package/src/containers/CollectionArticle/CollectionArticle.tsx +2 -2
- package/src/containers/DocumentArticle/DocumentArticle.tsx +1 -1
- package/src/containers/SlideArticle/SlideArticle.tsx +1 -1
- package/src/index.ts +5 -1
- package/src/meta.ts +1 -1
- package/src/operations/index.ts +7 -2
- package/src/operations/toggle-presentation.ts +7 -6
- package/src/plugin.ts +1 -1
- package/src/types/{index.ts → Presenter.ts} +0 -4
- package/src/types/PresenterCapabilities.ts +2 -2
- package/src/types/PresenterEvents.ts +16 -0
- package/src/types/PresenterOperation.ts +3 -3
- package/src/useExitPresenter.ts +1 -1
- package/dist/lib/chunk-types.mjs +0 -57
- package/dist/lib/chunk-types.mjs.map +0 -1
- package/dist/lib/types.mjs +0 -2
- package/dist/types/src/types/index.d.ts.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
//#region src/types/Presenter.ts
|
|
4
|
+
var Presenter_exports = /* @__PURE__ */ __exportAll({ PresenterContext: () => PresenterContext });
|
|
5
|
+
var PresenterContext = createContext({
|
|
6
|
+
running: false,
|
|
7
|
+
start: () => {},
|
|
8
|
+
stop: () => {}
|
|
9
|
+
});
|
|
10
|
+
//#endregion
|
|
11
|
+
export { PresenterContext, Presenter_exports as t };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=Presenter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Presenter.mjs","names":[],"sources":["../../src/types/Presenter.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Context, createContext } from 'react';\n\nexport type PresenterContextType = {\n running: boolean;\n start: () => void;\n stop: () => void;\n};\n\nexport const PresenterContext: Context<PresenterContextType> = createContext<PresenterContextType>({\n running: false,\n start: () => {},\n stop: () => {},\n});\n"],"mappings":";;;;AAYA,IAAa,mBAAkD,cAAoC;CACjG,SAAS;CACT,aAAa,CAAC;CACd,YAAY,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
3
|
+
import { meta } from "#meta";
|
|
4
|
+
//#region src/types/PresenterCapabilities.ts
|
|
5
|
+
var PresenterCapabilities_exports = /* @__PURE__ */ __exportAll({ Settings: () => Settings });
|
|
6
|
+
var Settings = Capability.makeSingleton()(`${meta.profile.key}.capability.settings`);
|
|
7
|
+
//#endregion
|
|
8
|
+
export { Settings, PresenterCapabilities_exports as t };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=PresenterCapabilities.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresenterCapabilities.mjs","names":[],"sources":["../../src/types/PresenterCapabilities.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { type Atom } from '@effect-atom/atom';\n\nimport * as Capability from '@dxos/app-framework/Capability';\n\nimport { meta } from '#meta';\n\n// Inline import to avoid `Settings` namespace alias colliding with the\n// `Settings` capability export below.\nexport const Settings = Capability.makeSingleton<Atom.Writable<import('./Settings').Settings>>()(\n `${meta.profile.key}.capability.settings`,\n);\n"],"mappings":";;;;;AAcA,IAAa,WAAW,WAAW,cAA4D,CAAC,CAC9F,GAAG,KAAK,QAAQ,IAAI,qBACtB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import { meta } from "#meta";
|
|
3
|
+
import * as ActivationEvent from "@dxos/app-framework/ActivationEvent";
|
|
4
|
+
//#region src/types/PresenterEvents.ts
|
|
5
|
+
var PresenterEvents_exports = /* @__PURE__ */ __exportAll({ Start: () => Start });
|
|
6
|
+
/**
|
|
7
|
+
* The feature's start event: the plugin's start-gated modules (and cross-plugin
|
|
8
|
+
* contributions consumed by this feature) activate here. Fired on demand and by the
|
|
9
|
+
* host's idle trickle.
|
|
10
|
+
*/
|
|
11
|
+
var Start = ActivationEvent.pluginStart(meta.profile.key);
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Start, PresenterEvents_exports as t };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=PresenterEvents.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresenterEvents.mjs","names":[],"sources":["../../src/types/PresenterEvents.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as ActivationEvent from '@dxos/app-framework/ActivationEvent';\n\nimport { meta } from '#meta';\n\n/**\n * The feature's start event: the plugin's start-gated modules (and cross-plugin\n * contributions consumed by this feature) activate here. Fired on demand and by the\n * host's idle trickle.\n */\nexport const Start = ActivationEvent.pluginStart(meta.profile.key);\n"],"mappings":";;;;;;;;;;AAeA,IAAa,QAAQ,gBAAgB,YAAY,KAAK,QAAQ,GAAG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
3
|
+
import { meta } from "#meta";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import * as Operation from "@dxos/compute/Operation";
|
|
6
|
+
import { Collection, DXN, Type } from "@dxos/echo";
|
|
7
|
+
import * as Markdown from "@dxos/plugin-markdown/Markdown";
|
|
8
|
+
//#region src/types/PresenterOperation.ts
|
|
9
|
+
var PresenterOperation_exports = /* @__PURE__ */ __exportAll({ TogglePresentation: () => TogglePresentation });
|
|
10
|
+
var makeKey = (name) => DXN.make(`${meta.profile.key}.operation.${name}`);
|
|
11
|
+
var TogglePresentation = Operation.make({
|
|
12
|
+
meta: {
|
|
13
|
+
key: makeKey("togglePresentation"),
|
|
14
|
+
name: "Toggle Presentation",
|
|
15
|
+
icon: "ph--presentation--regular"
|
|
16
|
+
},
|
|
17
|
+
services: [Capability.Service],
|
|
18
|
+
input: Schema.Struct({
|
|
19
|
+
object: Schema.Union(Type.getSchema(Markdown.Document), Type.getSchema(Collection.Collection)),
|
|
20
|
+
state: Schema.optional(Schema.Boolean)
|
|
21
|
+
}),
|
|
22
|
+
output: Schema.Void
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { TogglePresentation, PresenterOperation_exports as t };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=PresenterOperation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresenterOperation.mjs","names":[],"sources":["../../src/types/PresenterOperation.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Operation from '@dxos/compute/Operation';\nimport { Collection, DXN, Type } from '@dxos/echo';\nimport * as Markdown from '@dxos/plugin-markdown/Markdown';\n\nimport { meta } from '#meta';\n\nconst makeKey = (name: string) => DXN.make(`${meta.profile.key}.operation.${name}`);\n\nexport const TogglePresentation = Operation.make({\n meta: {\n key: makeKey('togglePresentation'),\n name: 'Toggle Presentation',\n icon: 'ph--presentation--regular',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n object: Schema.Union(Type.getSchema(Markdown.Document), Type.getSchema(Collection.Collection)),\n state: Schema.optional(Schema.Boolean),\n }),\n output: Schema.Void,\n});\n"],"mappings":";;;;;;;;;AAeA,IAAM,WAAW,SAAiB,IAAI,KAAK,GAAG,KAAK,QAAQ,IAAI,aAAa,MAAM;AAElF,IAAa,qBAAqB,UAAU,KAAK;CAC/C,MAAM;EACJ,KAAK,QAAQ,oBAAoB;EACjC,MAAM;EACN,MAAM;CACR;CACA,UAAU,CAAC,WAAW,OAAO;CAC7B,OAAO,OAAO,OAAO;EACnB,QAAQ,OAAO,MAAM,KAAK,UAAU,SAAS,QAAQ,GAAG,KAAK,UAAU,WAAW,UAAU,CAAC;EAC7F,OAAO,OAAO,SAAS,OAAO,OAAO;CACvC,CAAC;CACD,QAAQ,OAAO;AACjB,CAAC"}
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import { Plugin } from "@dxos/app-framework";
|
|
2
1
|
import { meta } from "#meta";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import * as Plugin from "@dxos/app-framework/Plugin";
|
|
3
|
+
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
5
4
|
import { AppGraphBuilder, MarkdownExtension, OperationHandler, PresenterSettings, ReactSurface } from "#capabilities";
|
|
6
5
|
import { translations } from "#translations";
|
|
7
6
|
//#endregion
|
|
8
7
|
//#region src/PresenterPlugin.tsx
|
|
9
|
-
var PresenterPlugin = Plugin.define(meta).pipe(
|
|
10
|
-
id: `${meta.profile.key}/markdown`,
|
|
11
|
-
activatesOn: MarkdownEvents.SetupExtensions,
|
|
12
|
-
activate: MarkdownExtension
|
|
13
|
-
}), AppPlugin.addTranslationsModule({ translations }), AppPlugin.addPluginAssetModule({ asset: {
|
|
8
|
+
var PresenterPlugin = Plugin.define(meta).pipe(Plugin.addModule(AppGraphBuilder), Plugin.addModule(OperationHandler), Plugin.addModule(PresenterSettings), Plugin.addModule(ReactSurface), Plugin.addModule(MarkdownExtension), Plugin.addModule(AppCapability.translations(translations)), Plugin.addModule(AppCapability.pluginAsset({
|
|
14
9
|
pluginId: meta.profile.key,
|
|
15
10
|
path: "PLUGIN.mdl",
|
|
16
11
|
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
12
|
mimeType: "application/x-mdl"
|
|
18
|
-
}
|
|
13
|
+
})), Plugin.make);
|
|
19
14
|
//#endregion
|
|
20
15
|
export { PresenterPlugin, PresenterPlugin as default };
|
|
21
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresenterPlugin.mjs","names":[],"sources":["../../src/PresenterPlugin.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport
|
|
1
|
+
{"version":3,"file":"PresenterPlugin.mjs","names":[],"sources":["../../src/PresenterPlugin.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\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 Plugin.addModule(AppGraphBuilder),\n Plugin.addModule(OperationHandler),\n Plugin.addModule(PresenterSettings),\n Plugin.addModule(ReactSurface),\n Plugin.addModule(MarkdownExtension),\n Plugin.addModule(AppCapability.translations(translations)),\n Plugin.addModule(\n AppCapability.pluginAsset({\n pluginId: meta.profile.key,\n path: 'PLUGIN.mdl',\n content: pluginSpec,\n mimeType: 'application/x-mdl',\n }),\n ),\n Plugin.make,\n);\n\nexport default PresenterPlugin;\n"],"mappings":";;;;;;;AAiBA,IAAa,kBAAkB,OAAO,OAAO,IAAI,CAAC,CAAC,KACjD,OAAO,UAAU,eAAe,GAChC,OAAO,UAAU,gBAAgB,GACjC,OAAO,UAAU,iBAAiB,GAClC,OAAO,UAAU,YAAY,GAC7B,OAAO,UAAU,iBAAiB,GAClC,OAAO,UAAU,cAAc,aAAa,YAAY,CAAC,GACzD,OAAO,UACL,cAAc,YAAY;CACxB,UAAU,KAAK,QAAQ;CACvB,MAAM;CACN,SAAS;CACT,UAAU;AACZ,CAAC,CACH,GACA,OAAO,IACT"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Plugin } from "@dxos/app-framework";
|
|
2
1
|
import { meta } from "#meta";
|
|
3
|
-
import
|
|
2
|
+
import * as Plugin from "@dxos/app-framework/Plugin";
|
|
4
3
|
import { AppGraphBuilder } from "#capabilities";
|
|
5
4
|
//#region src/PresenterPlugin.node.ts
|
|
6
|
-
var PresenterPlugin = Plugin.define(meta).pipe(
|
|
5
|
+
var PresenterPlugin = Plugin.define(meta).pipe(Plugin.addModule(AppGraphBuilder), Plugin.make);
|
|
7
6
|
//#endregion
|
|
8
7
|
export { PresenterPlugin, PresenterPlugin as default };
|
|
9
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresenterPlugin.node.mjs","names":[],"sources":["../../src/PresenterPlugin.node.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport
|
|
1
|
+
{"version":3,"file":"PresenterPlugin.node.mjs","names":[],"sources":["../../src/PresenterPlugin.node.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\n\nimport { AppGraphBuilder } from '#capabilities';\nimport { meta } from '#meta';\n\nexport const PresenterPlugin = Plugin.define(meta).pipe(Plugin.addModule(AppGraphBuilder), Plugin.make);\n\nexport default PresenterPlugin;\n"],"mappings":";;;;AASA,IAAa,kBAAkB,OAAO,OAAO,IAAI,CAAC,CAAC,KAAK,OAAO,UAAU,eAAe,GAAG,OAAO,IAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresenterPlugin.workerd.mjs","names":[],"sources":["../../src/PresenterPlugin.workerd.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport
|
|
1
|
+
{"version":3,"file":"PresenterPlugin.workerd.mjs","names":[],"sources":["../../src/PresenterPlugin.workerd.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\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,12 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
//#region src/types/Settings.ts
|
|
4
|
+
var Settings_exports = /* @__PURE__ */ __exportAll({ Settings: () => Settings });
|
|
5
|
+
var Settings = Schema.mutable(Schema.Struct({ presentCollections: Schema.optional(Schema.Boolean.annotations({
|
|
6
|
+
title: "Present collections (experimental)",
|
|
7
|
+
description: "Enable presenting collections of documents as a slideshow."
|
|
8
|
+
})) }));
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Settings, Settings_exports as t };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=Settings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Settings.mjs","names":[],"sources":["../../src/types/Settings.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nexport const Settings = Schema.mutable(\n Schema.Struct({\n presentCollections: Schema.optional(\n Schema.Boolean.annotations({\n title: 'Present collections (experimental)',\n description: 'Enable presenting collections of documents as a slideshow.',\n }),\n ),\n }),\n);\n\nexport interface Settings extends Schema.Schema.Type<typeof Settings> {}\n"],"mappings":";;;;AAQA,IAAa,WAAW,OAAO,QAC7B,OAAO,OAAO,EACZ,oBAAoB,OAAO,SACzB,OAAO,QAAQ,YAAY;CACzB,OAAO;CACP,aAAa;AACf,CAAC,CACH,EACF,CAAC,CACH"}
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Settings } from "./PresenterCapabilities.mjs";
|
|
2
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
3
|
+
import * as AppCapability from "@dxos/app-toolkit/AppCapability";
|
|
4
|
+
import * as ActivationEvents from "@dxos/app-framework/ActivationEvents";
|
|
5
|
+
import * as MarkdownCapabilities from "@dxos/plugin-markdown/MarkdownCapabilities";
|
|
6
|
+
import * as MarkdownEvents from "@dxos/plugin-markdown/MarkdownEvents";
|
|
2
7
|
//#region src/capabilities/index.ts
|
|
3
|
-
var AppGraphBuilder =
|
|
4
|
-
var MarkdownExtension = Capability.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"));
|
|
9
|
+
var MarkdownExtension = Capability.lazyModule("MarkdownExtension", {
|
|
10
|
+
provides: [MarkdownCapabilities.ExtensionProvider],
|
|
11
|
+
activatesOn: MarkdownEvents.Start
|
|
12
|
+
}, () => import("./chunk-markdown-extension.mjs"));
|
|
13
|
+
var OperationHandler = AppCapability.operationHandler(() => import("./chunk-operation-handler.mjs"), { activatesOn: ActivationEvents.Idle });
|
|
14
|
+
var ReactSurface = AppCapability.surface(() => import("./chunk-react-surface.mjs"), { roles: ["org.dxos.role.article", "org.dxos.role.slide"] });
|
|
15
|
+
var PresenterSettings = AppCapability.settings(() => import("./chunk-settings.mjs"), {
|
|
16
|
+
activatesOn: ActivationEvents.Idle,
|
|
17
|
+
provides: [Settings]
|
|
18
|
+
});
|
|
8
19
|
//#endregion
|
|
9
20
|
export { AppGraphBuilder, MarkdownExtension, OperationHandler, PresenterSettings, ReactSurface };
|
|
10
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport
|
|
1
|
+
{"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as ActivationEvents from '@dxos/app-framework/ActivationEvents';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as MarkdownCapabilities from '@dxos/plugin-markdown/MarkdownCapabilities';\nimport * as MarkdownEvents from '@dxos/plugin-markdown/MarkdownEvents';\n\nimport * as PresenterCapabilities from '../types/PresenterCapabilities';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('./app-graph-builder'));\nexport const MarkdownExtension = Capability.lazyModule(\n 'MarkdownExtension',\n { provides: [MarkdownCapabilities.ExtensionProvider], activatesOn: MarkdownEvents.Start },\n () => import('./markdown-extension'),\n);\nexport const OperationHandler = AppCapability.operationHandler(() => import('./operation-handler'), {\n activatesOn: ActivationEvents.Idle,\n});\nexport const ReactSurface = AppCapability.surface(() => import('./react-surface'), {\n roles: ['org.dxos.role.article', 'org.dxos.role.slide'],\n});\nexport const PresenterSettings = AppCapability.settings(() => import('./settings'), {\n activatesOn: ActivationEvents.Idle,\n provides: [PresenterCapabilities.Settings],\n});\n"],"mappings":";;;;;;;AAYA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,gCAAsB;AAChG,IAAa,oBAAoB,WAAW,WAC1C,qBACA;CAAE,UAAU,CAAC,qBAAqB,iBAAiB;CAAG,aAAa,eAAe;AAAM,SAClF,OAAO,iCACf;AACA,IAAa,mBAAmB,cAAc,uBAAuB,OAAO,kCAAwB,EAClG,aAAa,iBAAiB,KAChC,CAAC;AACD,IAAa,eAAe,cAAc,cAAc,OAAO,8BAAoB,EACjF,OAAO,CAAC,yBAAyB,qBAAqB,EACxD,CAAC;AACD,IAAa,oBAAoB,cAAc,eAAe,OAAO,yBAAe;CAClF,aAAa,iBAAiB;CAC9B,UAAU,CAAC,QAA8B;AAC3C,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { PresenterContext } from "./Presenter.mjs";
|
|
1
2
|
import { t as useExitPresenter } from "./chunk-useExitPresenter.mjs";
|
|
2
3
|
import { useContext, useState } from "react";
|
|
3
4
|
import { Obj } from "@dxos/echo";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
import { Panel } from "@dxos/react-ui";
|
|
6
|
-
import { PresenterContext } from "#types";
|
|
7
7
|
import { Surface } from "@dxos/app-framework/ui";
|
|
8
8
|
import { AppSurface } from "@dxos/app-toolkit/ui";
|
|
9
9
|
import { Layout, PageNumber, Pager, PresentationShell } from "#components";
|
|
@@ -1 +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
|
|
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';\n\nimport * as Presenter from '../../types/Presenter';\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(Presenter.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,gBAA0B;CACzD,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"}
|
|
@@ -1 +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
|
|
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 * as Markdown from '@dxos/plugin-markdown/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"}
|
|
@@ -1 +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
|
|
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 * as Markdown from '@dxos/plugin-markdown/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"}
|
|
@@ -1,23 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Settings } from "./PresenterCapabilities.mjs";
|
|
2
|
+
import { TogglePresentation } from "./PresenterOperation.mjs";
|
|
3
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
2
4
|
import { meta } from "#meta";
|
|
3
|
-
import
|
|
5
|
+
import * as Operation from "@dxos/compute/Operation";
|
|
4
6
|
import { Collection, Obj } from "@dxos/echo";
|
|
5
|
-
import
|
|
6
|
-
import { AppCapabilities, AppNode } from "@dxos/app-toolkit";
|
|
7
|
+
import * as Markdown from "@dxos/plugin-markdown/Markdown";
|
|
7
8
|
import * as Effect from "effect/Effect";
|
|
8
9
|
import * as Option from "effect/Option";
|
|
10
|
+
import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
|
|
11
|
+
import * as AppNode from "@dxos/app-toolkit/AppNode";
|
|
9
12
|
import { GraphBuilder, NodeMatcher } from "@dxos/plugin-graph";
|
|
10
|
-
import { PresenterCapabilities, PresenterOperation } from "#types";
|
|
11
13
|
//#region src/capabilities/app-graph-builder.ts
|
|
12
14
|
/** Match nodes that can be presented (Collection or Document). */
|
|
13
15
|
var whenPresentable = (node, get) => Option.orElse(NodeMatcher.whenEchoType(Collection.Collection)(node, get), () => NodeMatcher.whenEchoType(Markdown.Document)(node, get));
|
|
14
16
|
var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
15
|
-
const
|
|
17
|
+
const settingsCapabilityAtom = yield* Capability.atom(Settings);
|
|
18
|
+
const isPresentable = (object, get) => {
|
|
19
|
+
const [settingsAtom] = get(settingsCapabilityAtom);
|
|
20
|
+
return (settingsAtom ? get(settingsAtom) : void 0)?.presentCollections ? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object) : Obj.instanceOf(Markdown.Document, object);
|
|
21
|
+
};
|
|
16
22
|
const extensions = yield* GraphBuilder.createExtension({
|
|
17
23
|
id: "root",
|
|
18
24
|
match: whenPresentable,
|
|
19
25
|
connector: (object, get) => {
|
|
20
|
-
if (!(
|
|
26
|
+
if (!isPresentable(object, get)) return Effect.succeed([]);
|
|
21
27
|
return Effect.succeed([AppNode.makeCompanion({
|
|
22
28
|
variant: "presenter",
|
|
23
29
|
label: "Presenter",
|
|
@@ -29,13 +35,12 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
|
|
|
29
35
|
})]);
|
|
30
36
|
},
|
|
31
37
|
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
38
|
const db = Obj.getDatabase(object);
|
|
34
|
-
if (!isPresentable || !db) return Effect.succeed([]);
|
|
39
|
+
if (!isPresentable(object, get) || !db) return Effect.succeed([]);
|
|
35
40
|
return Effect.succeed([{
|
|
36
|
-
id:
|
|
41
|
+
id: TogglePresentation.meta.key,
|
|
37
42
|
data: Effect.fnUntraced(function* () {
|
|
38
|
-
yield* Operation.invoke(
|
|
43
|
+
yield* Operation.invoke(TogglePresentation, { object });
|
|
39
44
|
}),
|
|
40
45
|
properties: {
|
|
41
46
|
label: ["toggle-presentation.label", { ns: meta.profile.key }],
|
|
@@ -49,7 +54,7 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
|
|
|
49
54
|
}]);
|
|
50
55
|
}
|
|
51
56
|
});
|
|
52
|
-
return Capability.
|
|
57
|
+
return Capability.contribute(AppCapabilities.AppGraphBuilder, extensions);
|
|
53
58
|
}));
|
|
54
59
|
//#endregion
|
|
55
60
|
export { app_graph_builder_default as default };
|
|
@@ -1 +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
|
|
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 * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppNode from '@dxos/app-toolkit/AppNode';\nimport * as Operation from '@dxos/compute/Operation';\nimport { Collection, Obj } from '@dxos/echo';\nimport { GraphBuilder, type Node, NodeMatcher } from '@dxos/plugin-graph';\nimport * as Markdown from '@dxos/plugin-markdown/Markdown';\n\nimport { meta } from '#meta';\n\nimport * as PresenterCapabilities from '../types/PresenterCapabilities';\nimport * as PresenterOperation from '../types/PresenterOperation';\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 // Read reactively so the extension establishes a dependency and heals once this\n // capability lands (dependency modules contribute individually, not batched per wave).\n const settingsCapabilityAtom = yield* Capability.atom(PresenterCapabilities.Settings);\n\n const isPresentable = (object: Obj.Any, get: Atom.Context) => {\n const [settingsAtom] = get(settingsCapabilityAtom);\n const settings = settingsAtom ? get(settingsAtom) : undefined;\n return settings?.presentCollections\n ? Obj.instanceOf(Collection.Collection, object) || Obj.instanceOf(Markdown.Document, object)\n : Obj.instanceOf(Markdown.Document, object);\n };\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 if (!isPresentable(object, get)) {\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 db = Obj.getDatabase(object);\n if (!isPresentable(object, get) || !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.contribute(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;AAsBA,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;CAG7B,MAAM,yBAAyB,OAAO,WAAW,KAAK,QAA8B;CAEpF,MAAM,iBAAiB,QAAiB,QAAsB;EAC5D,MAAM,CAAC,gBAAgB,IAAI,sBAAsB;EAEjD,QADiB,eAAe,IAAI,YAAY,IAAI,KAAA,EAAA,EACnC,qBACb,IAAI,WAAW,WAAW,YAAY,MAAM,KAAK,IAAI,WAAW,SAAS,UAAU,MAAM,IACzF,IAAI,WAAW,SAAS,UAAU,MAAM;CAC9C;CAEA,MAAM,aAAa,OAAO,aAAa,gBAAgB;EACrD,IAAI;EAEJ,OAAO;EACP,YAAY,QAAQ,QAAQ;GAC1B,IAAI,CAAC,cAAc,QAAQ,GAAG,GAC5B,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;GACxB,MAAM,KAAK,IAAI,YAAY,MAAM;GACjC,IAAI,CAAC,cAAc,QAAQ,GAAG,KAAK,CAAC,IAClC,OAAO,OAAO,QAAQ,CAAC,CAAC;GAG1B,OAAO,OAAO,QAAQ,CACpB;IACE,IAAA,mBAA0C,KAAK;IAC/C,MAAM,OAAO,WAAW,aAAa;KACnC,OAAO,UAAU,OAAO,oBAAuC,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,WAAW,gBAAgB,iBAAiB,UAAU;AAC1E,CAAC,CACH"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TogglePresentation } from "./PresenterOperation.mjs";
|
|
2
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
3
|
+
import * as MarkdownCapabilities from "@dxos/plugin-markdown/MarkdownCapabilities";
|
|
2
4
|
import * as Effect from "effect/Effect";
|
|
3
|
-
import { PresenterOperation } from "#types";
|
|
4
5
|
import { Prec } from "@codemirror/state";
|
|
5
|
-
import
|
|
6
|
+
import * as Capabilities from "@dxos/app-framework/Capabilities";
|
|
6
7
|
import { keymap } from "@dxos/ui-editor";
|
|
7
8
|
//#region src/capabilities/markdown-extension.ts
|
|
8
9
|
/**
|
|
@@ -11,7 +12,7 @@ import { keymap } from "@dxos/ui-editor";
|
|
|
11
12
|
*/
|
|
12
13
|
var markdown_extension_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
13
14
|
const capabilities = yield* Capability.Service;
|
|
14
|
-
return Capability.
|
|
15
|
+
return Capability.contribute(MarkdownCapabilities.ExtensionProvider, [({ document }) => {
|
|
15
16
|
if (!document) return;
|
|
16
17
|
const { invokePromise } = capabilities.get(Capabilities.OperationInvoker);
|
|
17
18
|
return Prec.highest(keymap.of([{
|
|
@@ -19,7 +20,7 @@ var markdown_extension_default = Capability.makeModule(Effect.fnUntraced(functio
|
|
|
19
20
|
preventDefault: true,
|
|
20
21
|
stopPropagation: true,
|
|
21
22
|
run: () => {
|
|
22
|
-
invokePromise(
|
|
23
|
+
invokePromise(TogglePresentation, { object: document });
|
|
23
24
|
return true;
|
|
24
25
|
}
|
|
25
26
|
}]));
|
|
@@ -1 +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
|
|
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 * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as MarkdownCapabilities from '@dxos/plugin-markdown/MarkdownCapabilities';\nimport { keymap } from '@dxos/ui-editor';\n\nimport * as PresenterOperation from '../types/PresenterOperation';\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.contribute(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":";;;;;;;;;;;;AAkBA,IAAA,6BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,MAAM,eAAe,OAAO,WAAW;CAEvC,OAAO,WAAW,WAAW,qBAAqB,mBAAmB,EAClE,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,oBAAuC,EAAE,QAAQ,SAAS,CAAC;IAC9E,OAAO;GACT;EACF,CACF,CAAC,CACH;CACF,CACF,CAAC;AACH,CAAC,CACH"}
|
package/dist/lib/chunk-meta.mjs
CHANGED
|
@@ -1 +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
|
|
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 * as Plugin from '@dxos/app-framework/Plugin';\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"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Capabilities from "@dxos/app-framework/Capabilities";
|
|
3
4
|
import { PresenterOperationHandlerSet } from "#operations";
|
|
4
5
|
//#region src/capabilities/operation-handler.ts
|
|
5
6
|
var operation_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
6
|
-
return Capability.
|
|
7
|
+
return Capability.contribute(Capabilities.OperationHandler, PresenterOperationHandlerSet);
|
|
7
8
|
}));
|
|
8
9
|
//#endregion
|
|
9
10
|
export { operation_handler_default as default };
|
|
@@ -1 +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
|
|
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 * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\n\nimport { PresenterOperationHandlerSet } from '#operations';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contribute(Capabilities.OperationHandler, PresenterOperationHandlerSet);\n }),\n);\n"],"mappings":";;;;;AAWA,IAAA,4BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,OAAO,WAAW,WAAW,aAAa,kBAAkB,4BAA4B;AAC1F,CAAC,CACH"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Position } from "@dxos/util";
|
|
1
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
3
2
|
import { meta } from "#meta";
|
|
4
3
|
import { Collection, Obj } from "@dxos/echo";
|
|
5
|
-
import
|
|
4
|
+
import * as Markdown from "@dxos/plugin-markdown/Markdown";
|
|
5
|
+
import { Position } from "@dxos/util";
|
|
6
6
|
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as Capabilities from "@dxos/app-framework/Capabilities";
|
|
7
8
|
import { Surface } from "@dxos/app-framework/ui";
|
|
8
9
|
import { AppSurface } from "@dxos/app-toolkit/ui";
|
|
9
10
|
import { CollectionArticle, DocumentArticle, SlideArticle } from "#containers";
|
|
10
11
|
//#region src/capabilities/react-surface.ts
|
|
11
|
-
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.
|
|
12
|
+
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contribute(Capabilities.ReactSurface, [
|
|
12
13
|
Surface.create({
|
|
13
14
|
id: "document",
|
|
14
15
|
position: Position.first,
|
|
@@ -1 +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
|
|
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 * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { Collection, Obj } from '@dxos/echo';\nimport * as Markdown from '@dxos/plugin-markdown/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.contribute(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":";;;;;;;;;;;AAiBA,IAAA,wBAAe,WAAW,iBACxB,OAAO,QACL,WAAW,WAAW,aAAa,cAAc;CAC/C,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,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll as t };
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Settings } from "./PresenterCapabilities.mjs";
|
|
2
|
+
import { Settings as Settings$1 } from "./Settings.mjs";
|
|
3
|
+
import * as Capability from "@dxos/app-framework/Capability";
|
|
2
4
|
import { meta } from "#meta";
|
|
3
|
-
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
4
5
|
import * as Effect from "effect/Effect";
|
|
5
|
-
import
|
|
6
|
+
import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
|
|
6
7
|
import { createKvsStore } from "@dxos/effect";
|
|
7
8
|
//#region src/capabilities/settings.ts
|
|
8
9
|
var settings_default = Capability.makeModule(() => Effect.sync(() => {
|
|
9
10
|
const settingsAtom = createKvsStore({
|
|
10
11
|
key: meta.profile.key,
|
|
11
|
-
schema: Settings
|
|
12
|
+
schema: Settings$1,
|
|
12
13
|
defaultValue: () => ({})
|
|
13
14
|
});
|
|
14
|
-
return [Capability.
|
|
15
|
+
return [Capability.contribute(Settings, settingsAtom), Capability.contribute(AppCapabilities.Settings, {
|
|
15
16
|
prefix: meta.profile.key,
|
|
16
|
-
schema: Settings
|
|
17
|
+
schema: Settings$1,
|
|
17
18
|
atom: settingsAtom
|
|
18
19
|
})];
|
|
19
20
|
}));
|
|
@@ -1 +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
|
|
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 * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport { createKvsStore } from '@dxos/effect';\n\nimport { meta } from '#meta';\n\nimport * as PresenterCapabilities from '../types/PresenterCapabilities';\nimport * as Settings from '../types/Settings';\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.contribute(PresenterCapabilities.Settings, settingsAtom),\n Capability.contribute(AppCapabilities.Settings, {\n prefix: meta.profile.key,\n schema: Settings.Settings,\n atom: settingsAtom,\n }),\n ];\n }),\n);\n"],"mappings":";;;;;;;;AAeA,IAAA,mBAAe,WAAW,iBACxB,OAAO,WAAW;CAChB,MAAM,eAAe,eAAe;EAClC,KAAK,KAAK,QAAQ;EAClB,QAAQ;EACR,qBAAqB,CAAC;CACxB,CAAC;CAED,OAAO,CACL,WAAW,WAAW,UAAgC,YAAY,GAClE,WAAW,WAAW,gBAAgB,UAAU;EAC9C,QAAQ,KAAK,QAAQ;EACrB,QAAQ;EACR,MAAM;CACR,CAAC,CACH;AACF,CAAC,CACH"}
|