@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.
- package/PLUGIN.mdl +5 -3
- package/dist/lib/PresenterPlugin.mjs +22 -0
- package/dist/lib/PresenterPlugin.mjs.map +1 -0
- package/dist/lib/PresenterPlugin.node.mjs +10 -0
- package/dist/lib/PresenterPlugin.node.mjs.map +1 -0
- package/dist/lib/PresenterPlugin.workerd.mjs +8 -0
- package/dist/lib/PresenterPlugin.workerd.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +11 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/chunk-CollectionArticle.mjs +49 -0
- package/dist/lib/chunk-CollectionArticle.mjs.map +1 -0
- package/dist/lib/chunk-DocumentArticle.mjs +32 -0
- package/dist/lib/chunk-DocumentArticle.mjs.map +1 -0
- package/dist/lib/chunk-SlideArticle.mjs +17 -0
- package/dist/lib/chunk-SlideArticle.mjs.map +1 -0
- package/dist/lib/chunk-app-graph-builder.mjs +57 -0
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
- package/dist/lib/chunk-markdown-extension.mjs +31 -0
- package/dist/lib/chunk-markdown-extension.mjs.map +1 -0
- package/dist/lib/{neutral/chunk-MSQDHOPV.mjs → chunk-meta.mjs} +19 -23
- package/dist/lib/chunk-meta.mjs.map +1 -0
- package/dist/lib/chunk-operation-handler.mjs +11 -0
- package/dist/lib/chunk-operation-handler.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +42 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-settings.mjs +23 -0
- package/dist/lib/chunk-settings.mjs.map +1 -0
- package/dist/lib/chunk-toggle-presentation.mjs +48 -0
- package/dist/lib/chunk-toggle-presentation.mjs.map +1 -0
- package/dist/lib/chunk-types.mjs +57 -0
- package/dist/lib/chunk-types.mjs.map +1 -0
- package/dist/lib/chunk-useExitPresenter.mjs +20 -0
- package/dist/lib/chunk-useExitPresenter.mjs.map +1 -0
- package/dist/lib/components.mjs +465 -0
- package/dist/lib/components.mjs.map +1 -0
- package/dist/lib/containers.mjs +9 -0
- package/dist/lib/containers.mjs.map +1 -0
- package/dist/lib/index.mjs +3 -0
- package/dist/lib/meta.mjs +2 -0
- package/dist/lib/operations.mjs +7 -0
- package/dist/lib/operations.mjs.map +1 -0
- package/dist/lib/plugin.mjs +8 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/testing.mjs +27 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/lib/translations.mjs +10 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +2 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/markdown-extension.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/components/Presenter/Layout.d.ts +1 -1
- package/dist/types/src/components/Presenter/Layout.d.ts.map +1 -1
- package/dist/types/src/components/Presenter/PresentationShell.d.ts +1 -1
- package/dist/types/src/components/Presenter/PresentationShell.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.d.ts.map +1 -1
- package/dist/types/src/components/RevealPlayer/RevealPlayer.stories.d.ts +1 -1
- package/dist/types/src/containers/CollectionArticle/CollectionArticle.d.ts +4 -1
- package/dist/types/src/containers/CollectionArticle/CollectionArticle.d.ts.map +1 -1
- package/dist/types/src/containers/DocumentArticle/DocumentArticle.d.ts +4 -1
- package/dist/types/src/containers/DocumentArticle/DocumentArticle.d.ts.map +1 -1
- package/dist/types/src/containers/SlideArticle/SlideArticle.d.ts +4 -1
- package/dist/types/src/containers/SlideArticle/SlideArticle.d.ts.map +1 -1
- package/dist/types/src/operations/toggle-presentation.d.ts.map +1 -1
- package/dist/types/src/paths.d.ts.map +1 -1
- package/dist/types/src/types/PresenterCapabilities.d.ts +1 -1
- package/dist/types/src/types/PresenterCapabilities.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +1 -0
- package/package.json +39 -39
- package/src/capabilities/app-graph-builder.ts +2 -3
- package/src/capabilities/{react-surface.tsx → react-surface.ts} +6 -4
- package/src/components/Markdown/Panel.tsx +1 -1
- package/src/components/Markdown/theme.ts +1 -1
- package/src/components/Presenter/Layout.tsx +1 -1
- package/src/components/RevealPlayer/RevealPlayer.tsx +1 -1
- package/src/containers/CollectionArticle/CollectionArticle.tsx +2 -0
- package/src/containers/DocumentArticle/DocumentArticle.tsx +2 -0
- package/src/containers/SlideArticle/SlideArticle.tsx +2 -0
- package/src/operations/toggle-presentation.ts +13 -11
- package/src/paths.ts +3 -2
- package/src/types/PresenterCapabilities.ts +1 -1
- package/dist/lib/neutral/CollectionArticle-7R4KJWDW.mjs +0 -47
- package/dist/lib/neutral/CollectionArticle-7R4KJWDW.mjs.map +0 -7
- package/dist/lib/neutral/DocumentArticle-YZRKVEN7.mjs +0 -32
- package/dist/lib/neutral/DocumentArticle-YZRKVEN7.mjs.map +0 -7
- package/dist/lib/neutral/PresenterPlugin.mjs +0 -42
- package/dist/lib/neutral/PresenterPlugin.mjs.map +0 -7
- package/dist/lib/neutral/PresenterPlugin.node.mjs +0 -16
- package/dist/lib/neutral/PresenterPlugin.node.mjs.map +0 -7
- package/dist/lib/neutral/PresenterPlugin.workerd.mjs +0 -12
- package/dist/lib/neutral/PresenterPlugin.workerd.mjs.map +0 -7
- package/dist/lib/neutral/SlideArticle-FE2I6KBO.mjs +0 -20
- package/dist/lib/neutral/SlideArticle-FE2I6KBO.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-FNDFY5L3.mjs +0 -81
- package/dist/lib/neutral/app-graph-builder-FNDFY5L3.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/index.mjs +0 -17
- package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
- package/dist/lib/neutral/chunk-63IF7OXT.mjs +0 -19
- package/dist/lib/neutral/chunk-63IF7OXT.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-MSQDHOPV.mjs.map +0 -7
- package/dist/lib/neutral/chunk-NDZ6IIAL.mjs +0 -73
- package/dist/lib/neutral/chunk-NDZ6IIAL.mjs.map +0 -7
- package/dist/lib/neutral/components/index.mjs +0 -563
- package/dist/lib/neutral/components/index.mjs.map +0 -7
- package/dist/lib/neutral/containers/index.mjs +0 -13
- package/dist/lib/neutral/containers/index.mjs.map +0 -7
- package/dist/lib/neutral/index.mjs +0 -18
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/markdown-extension-HGLRVZDF.mjs +0 -37
- package/dist/lib/neutral/markdown-extension-HGLRVZDF.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
- package/dist/lib/neutral/meta.mjs +0 -8
- package/dist/lib/neutral/meta.mjs.map +0 -7
- package/dist/lib/neutral/operation-handler-3ZESW5AK.mjs +0 -13
- package/dist/lib/neutral/operation-handler-3ZESW5AK.mjs.map +0 -7
- package/dist/lib/neutral/operations/index.mjs +0 -9
- package/dist/lib/neutral/operations/index.mjs.map +0 -7
- package/dist/lib/neutral/plugin.mjs +0 -12
- package/dist/lib/neutral/plugin.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-VO4GPCLQ.mjs +0 -42
- package/dist/lib/neutral/react-surface-VO4GPCLQ.mjs.map +0 -7
- package/dist/lib/neutral/settings-DBV7N5HT.mjs +0 -28
- package/dist/lib/neutral/settings-DBV7N5HT.mjs.map +0 -7
- package/dist/lib/neutral/toggle-presentation-PH7ZJJDD.mjs +0 -60
- package/dist/lib/neutral/toggle-presentation-PH7ZJJDD.mjs.map +0 -7
- package/dist/lib/neutral/translations.mjs +0 -18
- package/dist/lib/neutral/translations.mjs.map +0 -7
- package/dist/lib/neutral/types/index.mjs +0 -14
- package/dist/lib/neutral/types/index.mjs.map +0 -7
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Capability } from "@dxos/app-framework";
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
import { meta } from "#meta";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import { Operation } from "@dxos/compute";
|
|
6
|
+
import { Collection, DXN, Type } from "@dxos/echo";
|
|
7
|
+
import { Markdown } from "@dxos/plugin-markdown";
|
|
8
|
+
//#region \0rolldown/runtime.js
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __exportAll = (all, no_symbols) => {
|
|
11
|
+
let target = {};
|
|
12
|
+
for (var name in all) __defProp(target, name, {
|
|
13
|
+
get: all[name],
|
|
14
|
+
enumerable: true
|
|
15
|
+
});
|
|
16
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/types/PresenterCapabilities.ts
|
|
21
|
+
var PresenterCapabilities_exports = /* @__PURE__ */ __exportAll({ Settings: () => Settings$1 });
|
|
22
|
+
var Settings$1 = Capability.make(`${meta.profile.key}.capability.settings`);
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/types/PresenterOperation.ts
|
|
25
|
+
var PresenterOperation_exports = /* @__PURE__ */ __exportAll({ TogglePresentation: () => TogglePresentation });
|
|
26
|
+
var makeKey = (name) => DXN.make(`${meta.profile.key}.operation.${name}`);
|
|
27
|
+
var TogglePresentation = Operation.make({
|
|
28
|
+
meta: {
|
|
29
|
+
key: makeKey("togglePresentation"),
|
|
30
|
+
name: "Toggle Presentation",
|
|
31
|
+
icon: "ph--presentation--regular"
|
|
32
|
+
},
|
|
33
|
+
services: [Capability.Service],
|
|
34
|
+
input: Schema.Struct({
|
|
35
|
+
object: Schema.Union(Type.getSchema(Markdown.Document), Type.getSchema(Collection.Collection)),
|
|
36
|
+
state: Schema.optional(Schema.Boolean)
|
|
37
|
+
}),
|
|
38
|
+
output: Schema.Void
|
|
39
|
+
});
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/types/Settings.ts
|
|
42
|
+
var Settings_exports = /* @__PURE__ */ __exportAll({ Settings: () => Settings });
|
|
43
|
+
var Settings = Schema.mutable(Schema.Struct({ presentCollections: Schema.optional(Schema.Boolean.annotations({
|
|
44
|
+
title: "Present collections (experimental)",
|
|
45
|
+
description: "Enable presenting collections of documents as a slideshow."
|
|
46
|
+
})) }));
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/types/index.ts
|
|
49
|
+
var PresenterContext = createContext({
|
|
50
|
+
running: false,
|
|
51
|
+
start: () => {},
|
|
52
|
+
stop: () => {}
|
|
53
|
+
});
|
|
54
|
+
//#endregion
|
|
55
|
+
export { PresenterCapabilities_exports as i, Settings_exports as n, PresenterOperation_exports as r, PresenterContext as t };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=chunk-types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-types.mjs","names":[],"sources":["../../src/types/PresenterCapabilities.ts","../../src/types/PresenterOperation.ts","../../src/types/Settings.ts","../../src/types/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { type Atom } from '@effect-atom/atom';\n\nimport { Capability } from '@dxos/app-framework';\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.make<Atom.Writable<import('./Settings').Settings>>(\n `${meta.profile.key}.capability.settings`,\n);\n","//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Collection, DXN, Type } from '@dxos/echo';\nimport { Markdown } from '@dxos/plugin-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","//\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","//\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\nexport * as PresenterCapabilities from './PresenterCapabilities';\nexport * as PresenterOperation from './PresenterOperation';\nexport * as Settings from './Settings';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAcA,IAAa,aAAW,WAAW,KACjC,GAAG,KAAK,QAAQ,IAAI,qBACtB;;;;ACDA,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;;;;ACrBD,IAAa,WAAW,OAAO,QAC7B,OAAO,OAAO,EACZ,oBAAoB,OAAO,SACzB,OAAO,QAAQ,YAAY;CACzB,OAAO;CACP,aAAa;AACf,CAAC,CACH,EACF,CAAC,CACH;;;ACLA,IAAa,mBAAkD,cAAoC;CACjG,SAAS;CACT,aAAa,CAAC;CACd,YAAY,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { PresenterOperation } from "#types";
|
|
3
|
+
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
4
|
+
//#region src/useExitPresenter.ts
|
|
5
|
+
/**
|
|
6
|
+
* Exits presentation for the given object. Delegates to the toggle operation so the
|
|
7
|
+
* fullscreen-revert and re-open run sequentially in a single handler — invoking them
|
|
8
|
+
* separately races, leaving the deck stuck in fullscreen.
|
|
9
|
+
*/
|
|
10
|
+
var useExitPresenter = (object) => {
|
|
11
|
+
const { invokePromise } = useOperationInvoker();
|
|
12
|
+
return useCallback(() => invokePromise(PresenterOperation.TogglePresentation, {
|
|
13
|
+
object,
|
|
14
|
+
state: false
|
|
15
|
+
}), [invokePromise, object]);
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { useExitPresenter as t };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=chunk-useExitPresenter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-useExitPresenter.mjs","names":[],"sources":["../../src/useExitPresenter.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\n\nimport { PresenterOperation } from '#types';\n\n/**\n * Exits presentation for the given object. Delegates to the toggle operation so the\n * fullscreen-revert and re-open run sequentially in a single handler — invoking them\n * separately races, leaving the deck stuck in fullscreen.\n */\nexport const useExitPresenter = (object: any) => {\n const { invokePromise } = useOperationInvoker();\n\n return useCallback(\n () => invokePromise(PresenterOperation.TogglePresentation, { object, state: false }),\n [invokePromise, object],\n );\n};\n"],"mappings":";;;;;;;;;AAeA,IAAa,oBAAoB,WAAgB;CAC/C,MAAM,EAAE,kBAAkB,oBAAoB;CAE9C,OAAO,kBACC,cAAc,mBAAmB,oBAAoB;EAAE;EAAQ,OAAO;CAAM,CAAC,GACnF,CAAC,eAAe,MAAM,CACxB;AACF"}
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { useResizeDetector } from "react-resize-detector";
|
|
3
|
+
import { mx } from "@dxos/ui-theme";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import "highlight.js/styles/github.css";
|
|
6
|
+
import { h } from "hastscript";
|
|
7
|
+
import ReactMarkdown from "react-markdown";
|
|
8
|
+
import rehypeAddClasses from "rehype-add-classes";
|
|
9
|
+
import rehypeHighlight from "rehype-highlight";
|
|
10
|
+
import remarkFrontmatter from "remark-frontmatter";
|
|
11
|
+
import remarkParseFrontmatter from "remark-parse-frontmatter";
|
|
12
|
+
import { IconButton, composable, composableProps, useAsyncEffect, useControlledState } from "@dxos/react-ui";
|
|
13
|
+
import "reveal.js/dist/reveal.css";
|
|
14
|
+
import "reveal.js/dist/theme/black.css";
|
|
15
|
+
import "highlight.js/styles/tokyo-night-dark.css";
|
|
16
|
+
import hljs from "highlight.js";
|
|
17
|
+
import typescript from "highlight.js/lib/languages/typescript";
|
|
18
|
+
import Reveal from "reveal.js";
|
|
19
|
+
import RevealHighlight from "reveal.js/plugin/highlight/highlight";
|
|
20
|
+
import RevealMarkdown from "reveal.js/plugin/markdown/plugin.js";
|
|
21
|
+
//#region src/components/Markdown/Panel.tsx
|
|
22
|
+
/**
|
|
23
|
+
* Scaled markdown panel.
|
|
24
|
+
*/
|
|
25
|
+
var Panel = ({ children, classNames }) => {
|
|
26
|
+
const [props, setProps] = useState({});
|
|
27
|
+
const { ref: containerRef, width, height } = useResizeDetector({
|
|
28
|
+
refreshMode: "debounce",
|
|
29
|
+
refreshRate: 200,
|
|
30
|
+
refreshOptions: { leading: true },
|
|
31
|
+
onResize: ({ width, height }) => {
|
|
32
|
+
if (width && height) setProps(createLayoutProps({
|
|
33
|
+
width,
|
|
34
|
+
height
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return /* @__PURE__ */ jsx("div", {
|
|
39
|
+
ref: containerRef,
|
|
40
|
+
className: mx("flex grow relative overflow-hidden dx-attention-surface", classNames),
|
|
41
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
42
|
+
className: mx("dx-container absolute"),
|
|
43
|
+
style: props,
|
|
44
|
+
children: width && height && children
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Compute CSS properties to transform DIV to be full screen.
|
|
50
|
+
*
|
|
51
|
+
* Display resolutions:
|
|
52
|
+
* window.screen.{availWidth, availHeight}
|
|
53
|
+
* 5K Studio 16.2-inch Macbook Pro
|
|
54
|
+
* Max 5120 x 2880 3456 x 2234
|
|
55
|
+
* Default 2560 x 1440 1728 x 1117 (Actual height 1080 - 37 pixel notch)
|
|
56
|
+
* Aspect 1.77 (16/9) 1.54
|
|
57
|
+
*/
|
|
58
|
+
var createLayoutProps = ({ width, height }) => {
|
|
59
|
+
const aspectRatio = 16 / 9;
|
|
60
|
+
const nominalWidth = 2560;
|
|
61
|
+
const nominalHeight = nominalWidth / aspectRatio;
|
|
62
|
+
const scale = Math.min(width / nominalWidth, height / nominalHeight);
|
|
63
|
+
return {
|
|
64
|
+
left: (width - nominalWidth) / 2,
|
|
65
|
+
top: (height - nominalHeight) / 2,
|
|
66
|
+
width: nominalWidth,
|
|
67
|
+
height: nominalHeight,
|
|
68
|
+
transform: `scale(${scale})`
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/components/Markdown/styles.css?raw
|
|
73
|
+
var styles_default = "/*!\n Theme: GitHub Dark\n Description: Dark theme as seen on github.com\n Author: github.com\n Maintainer: @Hirse\n Updated: 2021-05-15\n Outdated base version: https://github.com/primer/github-syntax-dark\n Current colors taken from GitHub's CSS\n*/\n/* TODO(burdon): Use tokens. */\n.dark pre code.hljs {\n display: block;\n overflow-x: auto;\n padding: 1em;\n}\n.dark code.hljs {\n padding: 3px 5px;\n}\n.dark .hljs {\n color: #c9d1d9;\n background: #0d1117;\n}\n.dark .hljs-doctag,\n.dark .hljs-keyword,\n.dark .hljs-meta .hljs-keyword,\n.dark .hljs-template-tag,\n.dark .hljs-template-variable,\n.dark .hljs-type,\n.dark .hljs-variable.language_ {\n color: #ff7b72;\n}\n.dark .hljs-title,\n.dark .hljs-title.class_,\n.dark .hljs-title.class_.inherited__,\n.dark .hljs-title.function_ {\n color: #d2a8ff;\n}\n.dark .hljs-attr,\n.dark .hljs-attribute,\n.dark .hljs-literal,\n.dark .hljs-meta,\n.dark .hljs-number,\n.dark .hljs-operator,\n.dark .hljs-variable,\n.dark .hljs-selector-attr,\n.dark .hljs-selector-class,\n.dark .hljs-selector-id {\n color: #79c0ff;\n}\n.dark .hljs-regexp,\n.dark .hljs-string,\n.dark .hljs-meta .hljs-string {\n color: #a5d6ff;\n}\n.dark .hljs-built_in,\n.dark .hljs-symbol {\n color: #ffa657;\n}\n.dark .hljs-comment,\n.dark .hljs-code,\n.dark .hljs-formula {\n color: #8b949e;\n}\n.dark .hljs-name,\n.dark .hljs-quote,\n.dark .hljs-selector-tag,\n.dark .hljs-selector-pseudo {\n color: #7ee787;\n}\n.dark .hljs-subst {\n color: #c9d1d9;\n}\n.dark .hljs-section {\n color: #1f6feb;\n font-weight: bold;\n}\n.dark .hljs-bullet {\n color: #f2cc60;\n}\n.dark .hljs-emphasis {\n color: #c9d1d9;\n font-style: italic;\n}\n.dark .hljs-strong {\n color: #c9d1d9;\n font-weight: bold;\n}\n.dark .hljs-addition {\n color: #aff5b4;\n background-color: #033a16;\n}\n.dark .hljs-deletion {\n color: #ffdcd7;\n background-color: #67060c;\n}\n.dark .hljs-char.escape_,\n.dark .hljs-link,\n.dark .hljs-params,\n.dark .hljs-property,\n.dark .hljs-punctuation,\n.dark .hljs-tag {\n /* purposely ignored */\n all: unset;\n}\n";
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/components/Markdown/theme.ts
|
|
76
|
+
var theme = {
|
|
77
|
+
root: "dx-attention-surface leading-relaxed font-mono",
|
|
78
|
+
padding: "px-40 py-16 gap-8",
|
|
79
|
+
nodes: {
|
|
80
|
+
h1: "text-[80px] text-accent-text",
|
|
81
|
+
h2: "text-[60px] text-accent-text",
|
|
82
|
+
h3: "text-[48px] text-accent-text",
|
|
83
|
+
p: "text-[48px]",
|
|
84
|
+
ul: "my-[16px] ml-12 leading-relaxed list-disc",
|
|
85
|
+
ol: "my-[16px] ml-24 leading-relaxed list-decimal",
|
|
86
|
+
li: "pl-6 text-[48px]",
|
|
87
|
+
pre: "w-full mx-0 my-[32px] p-4 bg-input-surface",
|
|
88
|
+
code: "p-0 text-[40px]"
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/components/Markdown/Slide.tsx
|
|
93
|
+
var Slide = ({ content = "", classes = theme.nodes }) => {
|
|
94
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("style", { children: styles_default }), /* @__PURE__ */ jsx(ReactMarkdown, {
|
|
95
|
+
components,
|
|
96
|
+
remarkPlugins: [[remarkFrontmatter, "yaml"], remarkParseFrontmatter],
|
|
97
|
+
rehypePlugins: [
|
|
98
|
+
[rehypeAddClasses, classes],
|
|
99
|
+
rehypeHighlight,
|
|
100
|
+
slideLayout
|
|
101
|
+
],
|
|
102
|
+
children: content
|
|
103
|
+
})] });
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Rehype plugin to format DOM based on frontmatter.
|
|
107
|
+
* https://github.com/unifiedjs/unified#plugin
|
|
108
|
+
* TODO(burdon): See tools/presenter: remarkPluginLayout
|
|
109
|
+
* E.g., layout image from front-matter.
|
|
110
|
+
*/
|
|
111
|
+
var slideLayout = (_options = {}) => (tree, file) => {
|
|
112
|
+
const { data: { frontmatter = {} } } = file;
|
|
113
|
+
let content = tree.children;
|
|
114
|
+
const { layout, image } = frontmatter;
|
|
115
|
+
if (image) {
|
|
116
|
+
const img = h("div", {
|
|
117
|
+
class: "flex grow shrink-0 bg-cover bg-center bg-no-repeat",
|
|
118
|
+
style: { backgroundImage: `url(${image})` }
|
|
119
|
+
});
|
|
120
|
+
switch (layout) {
|
|
121
|
+
case "fullscreen":
|
|
122
|
+
content = img;
|
|
123
|
+
break;
|
|
124
|
+
case "columns":
|
|
125
|
+
content = h("div", { class: "flex grow grid grid-cols-2" }, [h("div", { class: theme.padding }, [content]), img]);
|
|
126
|
+
break;
|
|
127
|
+
case "rows":
|
|
128
|
+
content = h("div", { class: "flex grow flex-col" }, [h("div", { class: theme.padding }, [content]), h("div", { class: ["flex grow pt-0", theme.padding] }, [img])]);
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
} else content = h("div", { class: ["flex grow flex-col", theme.padding] }, [content]);
|
|
132
|
+
tree.children = [h("div", { class: ["flex flex-col grow", theme.root] }, [content])];
|
|
133
|
+
};
|
|
134
|
+
var ImageWrapper = ({ node: _, ...props }) => {
|
|
135
|
+
const { alt = "", src } = props;
|
|
136
|
+
return /* @__PURE__ */ jsx("img", {
|
|
137
|
+
alt,
|
|
138
|
+
src
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
var components = { img: ({ node, ...props }) => /* @__PURE__ */ jsx(ImageWrapper, {
|
|
142
|
+
node,
|
|
143
|
+
...props
|
|
144
|
+
}) };
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/components/Presenter/Layout.tsx
|
|
147
|
+
var Layout = composable(({ children, topLeft, topRight, bottomLeft, bottomRight, ...props }, forwardedRef) => {
|
|
148
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
149
|
+
...composableProps(props, { classNames: "flex grow relative overflow-hidden dx-attention-surface" }),
|
|
150
|
+
ref: forwardedRef,
|
|
151
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
152
|
+
className: "flex flex-col grow overflow-hidden",
|
|
153
|
+
children
|
|
154
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
155
|
+
className: "z-[200]",
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ jsx("div", {
|
|
158
|
+
className: "absolute top-4 left-4",
|
|
159
|
+
children: topLeft
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ jsx("div", {
|
|
162
|
+
className: "absolute top-4 right-4",
|
|
163
|
+
children: topRight
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ jsx("div", {
|
|
166
|
+
className: "absolute bottom-4 left-4",
|
|
167
|
+
children: bottomLeft
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ jsx("div", {
|
|
170
|
+
className: "absolute bottom-4 right-4",
|
|
171
|
+
children: bottomRight
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
})]
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/components/Presenter/Pager.tsx
|
|
179
|
+
var Pager = ({ index: indexProp = 0, count = 0, keys, onChange, onExit }) => {
|
|
180
|
+
const [index, setIndex] = useControlledState(indexProp);
|
|
181
|
+
useEffect(() => {
|
|
182
|
+
onChange?.(index);
|
|
183
|
+
}, [index]);
|
|
184
|
+
const handleChangeIndex = (dir) => {
|
|
185
|
+
setIndex((index) => {
|
|
186
|
+
const next = index + dir;
|
|
187
|
+
return next >= 0 && next < count ? next : index;
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
if (!keys) return;
|
|
192
|
+
const keydownHandler = (event) => {
|
|
193
|
+
switch (event.key) {
|
|
194
|
+
case "Escape":
|
|
195
|
+
onExit?.();
|
|
196
|
+
break;
|
|
197
|
+
case "ArrowLeft":
|
|
198
|
+
if (event.shiftKey) onChange?.(0);
|
|
199
|
+
else handleChangeIndex(-1);
|
|
200
|
+
break;
|
|
201
|
+
case "ArrowRight":
|
|
202
|
+
if (event.shiftKey) onChange?.(count - 1);
|
|
203
|
+
else handleChangeIndex(1);
|
|
204
|
+
break;
|
|
205
|
+
case "ArrowUp":
|
|
206
|
+
onChange?.(0);
|
|
207
|
+
break;
|
|
208
|
+
case "ArrowDown":
|
|
209
|
+
onChange?.(count - 1);
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
window.addEventListener("keydown", keydownHandler);
|
|
214
|
+
return () => window.removeEventListener("keydown", keydownHandler);
|
|
215
|
+
}, [keys, count]);
|
|
216
|
+
if (index === void 0 || !count) return null;
|
|
217
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
218
|
+
className: "flex items-center text-neutral-500",
|
|
219
|
+
children: [
|
|
220
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
221
|
+
icon: "ph--caret-double-left--regular",
|
|
222
|
+
size: 6,
|
|
223
|
+
label: "Jump to first",
|
|
224
|
+
iconOnly: true,
|
|
225
|
+
noTooltip: true,
|
|
226
|
+
variant: "ghost",
|
|
227
|
+
classNames: "p-0",
|
|
228
|
+
onClick: () => onChange?.(0)
|
|
229
|
+
}),
|
|
230
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
231
|
+
icon: "ph--caret-left--regular",
|
|
232
|
+
size: 6,
|
|
233
|
+
label: "Previous",
|
|
234
|
+
iconOnly: true,
|
|
235
|
+
noTooltip: true,
|
|
236
|
+
variant: "ghost",
|
|
237
|
+
classNames: "p-0",
|
|
238
|
+
onClick: () => handleChangeIndex(-1)
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
241
|
+
icon: "ph--caret-right--regular",
|
|
242
|
+
size: 6,
|
|
243
|
+
label: "Next",
|
|
244
|
+
iconOnly: true,
|
|
245
|
+
noTooltip: true,
|
|
246
|
+
variant: "ghost",
|
|
247
|
+
classNames: "p-0",
|
|
248
|
+
onClick: () => handleChangeIndex(1)
|
|
249
|
+
}),
|
|
250
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
251
|
+
icon: "ph--caret-double-right--regular",
|
|
252
|
+
size: 6,
|
|
253
|
+
label: "Jump to last",
|
|
254
|
+
iconOnly: true,
|
|
255
|
+
noTooltip: true,
|
|
256
|
+
variant: "ghost",
|
|
257
|
+
classNames: "p-0",
|
|
258
|
+
onClick: () => onChange?.(count - 1)
|
|
259
|
+
})
|
|
260
|
+
]
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
var PageNumber = ({ index = 0, count = 1 }) => {
|
|
264
|
+
if (index === void 0 || !count) return null;
|
|
265
|
+
return /* @__PURE__ */ jsx("div", {
|
|
266
|
+
className: "flex items-center text-neutral-500 text-2xl",
|
|
267
|
+
children: /* @__PURE__ */ jsxs("div", { children: [
|
|
268
|
+
index + 1,
|
|
269
|
+
" / ",
|
|
270
|
+
count
|
|
271
|
+
] })
|
|
272
|
+
});
|
|
273
|
+
};
|
|
274
|
+
var StartButton = ({ running, onClick }) => {
|
|
275
|
+
return /* @__PURE__ */ jsx(IconButton, {
|
|
276
|
+
icon: running ? "ph--x--regular" : "ph--play--regular",
|
|
277
|
+
size: 6,
|
|
278
|
+
label: running ? "Stop" : "Play",
|
|
279
|
+
iconOnly: true,
|
|
280
|
+
noTooltip: true,
|
|
281
|
+
variant: "ghost",
|
|
282
|
+
classNames: "p-0",
|
|
283
|
+
onClick: () => onClick?.(!running)
|
|
284
|
+
});
|
|
285
|
+
};
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region src/components/Presenter/PresentationShell.tsx
|
|
288
|
+
/**
|
|
289
|
+
* Wraps presentation content with a fade-in/out transition, an ESC handler that exits in a
|
|
290
|
+
* single keypress (intercepting before the deck's fullscreen handler), and a transient [ESC]
|
|
291
|
+
* caption shown on enter.
|
|
292
|
+
*/
|
|
293
|
+
var PresentationShell = composable(({ children, fadeDuration = 300, hintDuration = 3e3, fullscreen = true, onExit, ...props }, forwardedRef) => {
|
|
294
|
+
const [visible, setVisible] = useState(false);
|
|
295
|
+
const [exiting, setExiting] = useState(false);
|
|
296
|
+
const [showHint, setShowHint] = useState(true);
|
|
297
|
+
const exitTimeout = useRef(void 0);
|
|
298
|
+
const exitingRef = useRef(false);
|
|
299
|
+
useEffect(() => {
|
|
300
|
+
const frame = requestAnimationFrame(() => setVisible(true));
|
|
301
|
+
return () => cancelAnimationFrame(frame);
|
|
302
|
+
}, []);
|
|
303
|
+
useEffect(() => {
|
|
304
|
+
const timer = setTimeout(() => setShowHint(false), hintDuration);
|
|
305
|
+
return () => clearTimeout(timer);
|
|
306
|
+
}, [hintDuration]);
|
|
307
|
+
const handleExit = useCallback(() => {
|
|
308
|
+
if (exitingRef.current) return;
|
|
309
|
+
exitingRef.current = true;
|
|
310
|
+
setExiting(true);
|
|
311
|
+
setVisible(false);
|
|
312
|
+
exitTimeout.current = setTimeout(() => onExit?.(), fadeDuration);
|
|
313
|
+
}, [onExit, fadeDuration]);
|
|
314
|
+
useEffect(() => () => clearTimeout(exitTimeout.current), []);
|
|
315
|
+
useEffect(() => {
|
|
316
|
+
const handler = (event) => {
|
|
317
|
+
if (event.key === "Escape") {
|
|
318
|
+
event.preventDefault();
|
|
319
|
+
event.stopImmediatePropagation();
|
|
320
|
+
handleExit();
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
document.addEventListener("keydown", handler, { capture: true });
|
|
324
|
+
return () => document.removeEventListener("keydown", handler, { capture: true });
|
|
325
|
+
}, [handleExit]);
|
|
326
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
327
|
+
...composableProps(props, {
|
|
328
|
+
classNames: ["relative grow overflow-hidden bg-black transition-opacity", visible && !exiting ? "opacity-100" : "opacity-0"],
|
|
329
|
+
style: { transitionDuration: `${fadeDuration}ms` }
|
|
330
|
+
}),
|
|
331
|
+
ref: forwardedRef,
|
|
332
|
+
children: [children, fullscreen && /* @__PURE__ */ jsx("div", {
|
|
333
|
+
className: mx("absolute top-4 left-4 z-[300] transition-opacity duration-500", showHint && !exiting ? "opacity-100" : "opacity-0"),
|
|
334
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
335
|
+
className: "rounded-sm bg-white/10 px-2 py-1 font-mono text-sm text-white/70",
|
|
336
|
+
children: "[ESC]"
|
|
337
|
+
})
|
|
338
|
+
})]
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
//#endregion
|
|
342
|
+
//#region src/components/RevealPlayer/RevealPlayer.tsx
|
|
343
|
+
var styles = `
|
|
344
|
+
<style type="text/css">
|
|
345
|
+
.reveal h1 {
|
|
346
|
+
font-weight: 100;
|
|
347
|
+
font-size: 60px;
|
|
348
|
+
opacity: 0.5;
|
|
349
|
+
}
|
|
350
|
+
.reveal h2 {
|
|
351
|
+
font-weight: 100;
|
|
352
|
+
padding-top: 60px;
|
|
353
|
+
padding-left: 40px;
|
|
354
|
+
font-size: 48px;
|
|
355
|
+
opacity: 0.3;
|
|
356
|
+
}
|
|
357
|
+
.reveal h1, h2, p {
|
|
358
|
+
font-family: "Raleway", sans-serif;
|
|
359
|
+
text-align: left;
|
|
360
|
+
font-weight: 200;
|
|
361
|
+
}
|
|
362
|
+
.reveal ul {
|
|
363
|
+
font-family: "Raleway", sans-serif;
|
|
364
|
+
display: block;
|
|
365
|
+
list-style: "- ";
|
|
366
|
+
}
|
|
367
|
+
.reveal blockquote p {
|
|
368
|
+
text-align: center;
|
|
369
|
+
font-weight: 100;
|
|
370
|
+
padding: 32px;
|
|
371
|
+
}
|
|
372
|
+
.reveal pre {
|
|
373
|
+
margin-left: 0;
|
|
374
|
+
}
|
|
375
|
+
.reveal code {
|
|
376
|
+
font-size: 20px;
|
|
377
|
+
background: #111111;
|
|
378
|
+
color: #eeeeee;
|
|
379
|
+
max-height: unset !important;
|
|
380
|
+
}
|
|
381
|
+
</style>
|
|
382
|
+
`;
|
|
383
|
+
var RevealPlayer = composable(({ content, slide, fullscreen = true, onExit, children, ...props }, forwardedRef) => {
|
|
384
|
+
const deckDivRef = useRef(null);
|
|
385
|
+
const deckRef = useRef(null);
|
|
386
|
+
useAsyncEffect(async () => {
|
|
387
|
+
if (deckRef.current) return;
|
|
388
|
+
hljs.registerLanguage("typescript", typescript);
|
|
389
|
+
deckRef.current = new Reveal(deckDivRef.current, {
|
|
390
|
+
progress: false,
|
|
391
|
+
transition: "none",
|
|
392
|
+
slideNumber: false,
|
|
393
|
+
embedded: true,
|
|
394
|
+
autoPlayMedia: false,
|
|
395
|
+
showNotes: false,
|
|
396
|
+
margin: .1,
|
|
397
|
+
plugins: [RevealMarkdown, RevealHighlight],
|
|
398
|
+
markdown: {
|
|
399
|
+
gfm: true,
|
|
400
|
+
smartypants: true,
|
|
401
|
+
highlight: (code, language) => {
|
|
402
|
+
if (language) return hljs.highlight(code, { language }).value;
|
|
403
|
+
return hljs.highlightAuto(code).value;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
await deckRef.current.initialize();
|
|
408
|
+
if (slide !== void 0) deckRef.current.slide(slide < 0 ? deckRef.current?.getTotalSlides() + slide : slide - 1);
|
|
409
|
+
deckRef.current.addKeyBinding({
|
|
410
|
+
keyCode: 27,
|
|
411
|
+
key: "Escape",
|
|
412
|
+
description: "Exit full screen"
|
|
413
|
+
}, () => {
|
|
414
|
+
onExit?.();
|
|
415
|
+
});
|
|
416
|
+
return () => {
|
|
417
|
+
try {
|
|
418
|
+
if (deckRef.current) {
|
|
419
|
+
deckRef.current.destroy();
|
|
420
|
+
deckRef.current = null;
|
|
421
|
+
}
|
|
422
|
+
} catch {}
|
|
423
|
+
};
|
|
424
|
+
});
|
|
425
|
+
return /* @__PURE__ */ jsx("div", {
|
|
426
|
+
...composableProps(props, { classNames: ["dx-container grid place-items-center bg-scrim-surface", fullscreen && "absolute inset-0"] }),
|
|
427
|
+
ref: forwardedRef,
|
|
428
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
429
|
+
className: "relative aspect-video h-full w-full h-auto max-h-full overflow-hidden",
|
|
430
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
431
|
+
ref: deckDivRef,
|
|
432
|
+
className: "absolute inset-0 reveal",
|
|
433
|
+
children: [
|
|
434
|
+
/* @__PURE__ */ jsx("link", {
|
|
435
|
+
rel: "preconnect",
|
|
436
|
+
href: "https://fonts.gstatic.com",
|
|
437
|
+
crossOrigin: ""
|
|
438
|
+
}),
|
|
439
|
+
/* @__PURE__ */ jsx("link", {
|
|
440
|
+
rel: "preconnect",
|
|
441
|
+
href: "https://fonts.googleapis.com"
|
|
442
|
+
}),
|
|
443
|
+
/* @__PURE__ */ jsx("link", {
|
|
444
|
+
rel: "stylesheet",
|
|
445
|
+
href: "https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap"
|
|
446
|
+
}),
|
|
447
|
+
/* @__PURE__ */ jsxs("div", {
|
|
448
|
+
className: mx("slides", !fullscreen && "dx-base-surface p-8"),
|
|
449
|
+
children: [/* @__PURE__ */ jsx("div", {}), /* @__PURE__ */ jsx("section", {
|
|
450
|
+
"data-markdown": [],
|
|
451
|
+
children: /* @__PURE__ */ jsx("textarea", {
|
|
452
|
+
"data-template": true,
|
|
453
|
+
defaultValue: [styles, content].join("\n")
|
|
454
|
+
})
|
|
455
|
+
})]
|
|
456
|
+
})
|
|
457
|
+
]
|
|
458
|
+
})
|
|
459
|
+
})
|
|
460
|
+
});
|
|
461
|
+
});
|
|
462
|
+
//#endregion
|
|
463
|
+
export { Layout, PageNumber, Pager, Panel, PresentationShell, RevealPlayer, Slide, StartButton };
|
|
464
|
+
|
|
465
|
+
//# sourceMappingURL=components.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.mjs","names":[],"sources":["../../src/components/Markdown/Panel.tsx","../../src/components/Markdown/theme.ts","../../src/components/Markdown/Slide.tsx","../../src/components/Presenter/Layout.tsx","../../src/components/Presenter/Pager.tsx","../../src/components/Presenter/PresentationShell.tsx","../../src/components/RevealPlayer/RevealPlayer.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type PropsWithChildren, useState } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nexport type PanelProps = ThemedClassName<PropsWithChildren<{}>>;\n\n/**\n * Scaled markdown panel.\n */\nexport const Panel = ({ children, classNames }: PanelProps) => {\n const [props, setProps] = useState({});\n const {\n ref: containerRef,\n width,\n height,\n } = useResizeDetector({\n refreshMode: 'debounce',\n refreshRate: 200,\n refreshOptions: {\n leading: true,\n },\n onResize: ({ width, height }) => {\n if (width && height) {\n setProps(createLayoutProps({ width, height }));\n }\n },\n });\n\n // TODO(burdon): Reconcile highlight colors with markdown editor.\n // https://www.npmjs.com/package/react-markdown\n return (\n <div ref={containerRef} className={mx('flex grow relative overflow-hidden dx-attention-surface', classNames)}>\n <div className={mx('dx-container absolute')} style={props}>\n {width && height && children}\n </div>\n </div>\n );\n};\n\n/**\n * Compute CSS properties to transform DIV to be full screen.\n *\n * Display resolutions:\n * window.screen.{availWidth, availHeight}\n * 5K Studio 16.2-inch Macbook Pro\n * Max 5120 x 2880 3456 x 2234\n * Default 2560 x 1440 1728 x 1117 (Actual height 1080 - 37 pixel notch)\n * Aspect 1.77 (16/9) 1.54\n */\nconst createLayoutProps = ({ width, height }: { width: number; height: number }) => {\n // Config.\n const aspectRatio = 16 / 9;\n const nominalWidth = 2560;\n const nominalHeight = nominalWidth / aspectRatio;\n\n // NOTE: Hack to detect full height on Macbook Pro due to notch.\n // const macIntelNotch = 1117 - 1080;\n // const fullscreen =\n // height === screen.availHeight ||\n // (window.navigator.platform === 'MacIntel' && height === screen.availHeight - macIntelNotch);\n\n // If not fullscreen then make scale slightly smaller so there's a natural border.\n // const scaleFactor = fullscreen ? 1 : 0.95;\n\n // Compute scaling factor required.\n const scale = Math.min(width / nominalWidth, height / nominalHeight);\n\n return {\n left: (width - nominalWidth) / 2,\n top: (height - nominalHeight) / 2,\n width: nominalWidth,\n height: nominalHeight,\n transform: `scale(${scale})`,\n };\n};\n","//\n// Copyright 2023 DXOS.org\n//\n\n// TODO(burdon): Create theme type and picker.\n\nexport const theme = {\n root: 'dx-attention-surface leading-relaxed font-mono',\n\n padding: 'px-40 py-16 gap-8',\n\n nodes: {\n h1: 'text-[80px] text-accent-text',\n h2: 'text-[60px] text-accent-text',\n h3: 'text-[48px] text-accent-text',\n\n p: 'text-[48px]',\n\n ul: 'my-[16px] ml-12 leading-relaxed list-disc',\n ol: 'my-[16px] ml-24 leading-relaxed list-decimal',\n li: 'pl-6 text-[48px]',\n\n pre: 'w-full mx-0 my-[32px] p-4 bg-input-surface',\n code: 'p-0 text-[40px]',\n },\n};\n","//\n// Copyright 2023 DXOS.org\n//\n\nimport 'highlight.js/styles/github.css';\n\nimport { h } from 'hastscript';\nimport React from 'react';\nimport ReactMarkdown, { type Options as ReactMarkdownOptions } from 'react-markdown';\nimport rehypeAddClasses from 'rehype-add-classes';\nimport rehypeHighlight from 'rehype-highlight';\nimport remarkFrontmatter from 'remark-frontmatter';\nimport remarkParseFrontmatter from 'remark-parse-frontmatter';\n\nimport styles from './styles.css?raw';\nimport { theme } from './theme';\n\nexport type SlideProps = {\n content?: string;\n classes?: Record<string, string>;\n};\n\nexport const Slide = ({ content = '', classes = theme.nodes }: SlideProps) => {\n // TODO(thure): `rehype-highlight` ends up using `github.css` from `highlight.js`, but this does not appear to be\n // configurable. Find a way to remove the literal stylesheet here.\n return (\n <>\n <style>{styles}</style>\n <ReactMarkdown\n components={components}\n // Markdown to HTML.\n remarkPlugins={[[remarkFrontmatter, 'yaml'], remarkParseFrontmatter as any]}\n // HTML processing.\n rehypePlugins={[[rehypeAddClasses, classes], rehypeHighlight as any, slideLayout]}\n >\n {content}\n </ReactMarkdown>\n </>\n );\n};\n\n/**\n * Rehype plugin to format DOM based on frontmatter.\n * https://github.com/unifiedjs/unified#plugin\n * TODO(burdon): See tools/presenter: remarkPluginLayout\n * E.g., layout image from front-matter.\n */\nconst slideLayout =\n (_options = {}) =>\n (tree: any, file: any) => {\n const {\n data: { frontmatter = {} },\n } = file;\n\n let content = tree.children;\n const { layout, image } = frontmatter;\n if (image) {\n const img = h('div', {\n class: 'flex grow shrink-0 bg-cover bg-center bg-no-repeat',\n style: {\n backgroundImage: `url(${image})`,\n },\n });\n\n switch (layout) {\n case 'fullscreen': {\n content = img;\n break;\n }\n\n case 'columns': {\n content = h('div', { class: 'flex grow grid grid-cols-2' }, [\n h('div', { class: theme.padding }, [content]),\n img,\n ]);\n break;\n }\n\n case 'rows': {\n content = h('div', { class: 'flex grow flex-col' }, [\n h('div', { class: theme.padding }, [content]),\n h('div', { class: ['flex grow pt-0', theme.padding] }, [img]),\n ]);\n break;\n }\n }\n } else {\n content = h('div', { class: ['flex grow flex-col', theme.padding] }, [content]);\n }\n\n const root = h('div', { class: ['flex flex-col grow', theme.root] }, [content]);\n tree.children = [root];\n };\n\nconst ImageWrapper = ({ node: _, ...props }: { node: any }) => {\n const { alt = '', src } = props as { alt: string; src: string };\n return <img alt={alt} src={src} />;\n};\n\nconst components: ReactMarkdownOptions['components'] = {\n img: ({ node, ...props }) => <ImageWrapper node={node} {...props} />,\n};\n","//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type PropsWithChildren, type ReactNode } from 'react';\n\nimport { composable, composableProps } from '@dxos/react-ui';\n\nexport type LayoutProps = PropsWithChildren<{\n topLeft?: ReactNode;\n topRight?: ReactNode;\n bottomLeft?: ReactNode;\n bottomRight?: ReactNode;\n}>;\n\nexport const Layout = composable<HTMLDivElement, LayoutProps>(\n ({ children, topLeft, topRight, bottomLeft, bottomRight, ...props }, forwardedRef) => {\n return (\n <div\n {...composableProps(props, { classNames: 'flex grow relative overflow-hidden dx-attention-surface' })}\n ref={forwardedRef}\n >\n <div className='flex flex-col grow overflow-hidden'>{children}</div>\n\n <div className='z-[200]'>\n <div className='absolute top-4 left-4'>{topLeft}</div>\n <div className='absolute top-4 right-4'>{topRight}</div>\n <div className='absolute bottom-4 left-4'>{bottomLeft}</div>\n <div className='absolute bottom-4 right-4'>{bottomRight}</div>\n </div>\n </div>\n );\n },\n);\n","//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useEffect } from 'react';\n\nimport { IconButton, useControlledState } from '@dxos/react-ui';\n\nexport type PagerProps = {\n index?: number;\n count?: number;\n keys?: boolean; // TODO(burdon): Rename.\n onChange?: (index: number) => void;\n onExit?: () => void;\n};\n\nexport const Pager = ({ index: indexProp = 0, count = 0, keys, onChange, onExit }: PagerProps) => {\n const [index, setIndex] = useControlledState(indexProp);\n useEffect(() => {\n onChange?.(index);\n }, [index]);\n\n const handleChangeIndex = (dir: number) => {\n setIndex((index) => {\n const next = index + dir;\n return next >= 0 && next < count ? next : index;\n });\n };\n\n // TODO(burdon): Standardize via system key binding.\n useEffect(() => {\n if (!keys) {\n return;\n }\n\n const keydownHandler = (event: KeyboardEvent) => {\n switch (event.key) {\n case 'Escape': {\n onExit?.();\n break;\n }\n case 'ArrowLeft': {\n if (event.shiftKey) {\n onChange?.(0);\n } else {\n handleChangeIndex(-1);\n }\n break;\n }\n case 'ArrowRight': {\n if (event.shiftKey) {\n onChange?.(count - 1);\n } else {\n handleChangeIndex(1);\n }\n break;\n }\n case 'ArrowUp': {\n onChange?.(0);\n break;\n }\n case 'ArrowDown': {\n onChange?.(count - 1);\n break;\n }\n }\n };\n\n window.addEventListener('keydown', keydownHandler);\n return () => window.removeEventListener('keydown', keydownHandler);\n }, [keys, count]);\n\n if (index === undefined || !count) {\n return null;\n }\n\n return (\n <div className='flex items-center text-neutral-500'>\n <IconButton\n icon='ph--caret-double-left--regular'\n size={6}\n label='Jump to first'\n iconOnly\n noTooltip\n variant='ghost'\n classNames='p-0'\n onClick={() => onChange?.(0)}\n />\n <IconButton\n icon='ph--caret-left--regular'\n size={6}\n label='Previous'\n iconOnly\n noTooltip\n variant='ghost'\n classNames='p-0'\n onClick={() => handleChangeIndex(-1)}\n />\n <IconButton\n icon='ph--caret-right--regular'\n size={6}\n label='Next'\n iconOnly\n noTooltip\n variant='ghost'\n classNames='p-0'\n onClick={() => handleChangeIndex(1)}\n />\n <IconButton\n icon='ph--caret-double-right--regular'\n size={6}\n label='Jump to last'\n iconOnly\n noTooltip\n variant='ghost'\n classNames='p-0'\n onClick={() => onChange?.(count - 1)}\n />\n </div>\n );\n};\n\nexport type PageNumberProps = {\n index?: number;\n count?: number;\n};\n\nexport const PageNumber = ({ index = 0, count = 1 }: PageNumberProps) => {\n if (index === undefined || !count) {\n return null;\n }\n\n return (\n <div className='flex items-center text-neutral-500 text-2xl'>\n <div>\n {index + 1} / {count}\n </div>\n </div>\n );\n};\n\nexport const StartButton = ({ running, onClick }: { running?: boolean; onClick?: (start: boolean) => void }) => {\n return (\n <IconButton\n icon={running ? 'ph--x--regular' : 'ph--play--regular'}\n size={6}\n label={running ? 'Stop' : 'Play'}\n iconOnly\n noTooltip\n variant='ghost'\n classNames='p-0'\n onClick={() => onClick?.(!running)}\n />\n );\n};\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { composable, composableProps } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nexport type PresentationShellProps = PropsWithChildren<{\n /** Fade-in/out duration (ms). */\n fadeDuration?: number;\n /** Duration the [ESC] hint remains visible (ms). */\n hintDuration?: number;\n /** Whether the presentation is fullscreen. */\n fullscreen?: boolean;\n /** Invoked once the exit fade-out has completed. */\n onExit?: () => void;\n}>;\n\n/**\n * Wraps presentation content with a fade-in/out transition, an ESC handler that exits in a\n * single keypress (intercepting before the deck's fullscreen handler), and a transient [ESC]\n * caption shown on enter.\n */\nexport const PresentationShell = composable<HTMLDivElement, PresentationShellProps>(\n ({ children, fadeDuration = 300, hintDuration = 3000, fullscreen = true, onExit, ...props }, forwardedRef) => {\n const [visible, setVisible] = useState(false);\n const [exiting, setExiting] = useState(false);\n const [showHint, setShowHint] = useState(true);\n const exitTimeout = useRef<ReturnType<typeof setTimeout>>(undefined);\n // Guards against exiting twice; a state updater can't gate this since React double-invokes\n // updaters in dev, which would schedule the exit (and its side effects) more than once.\n const exitingRef = useRef(false);\n\n // Fade in once mounted.\n useEffect(() => {\n const frame = requestAnimationFrame(() => setVisible(true));\n return () => cancelAnimationFrame(frame);\n }, []);\n\n // Hide the hint after the configured duration.\n useEffect(() => {\n const timer = setTimeout(() => setShowHint(false), hintDuration);\n return () => clearTimeout(timer);\n }, [hintDuration]);\n\n const handleExit = useCallback(() => {\n if (exitingRef.current) {\n return;\n }\n exitingRef.current = true;\n setExiting(true);\n setVisible(false);\n exitTimeout.current = setTimeout(() => onExit?.(), fadeDuration);\n }, [onExit, fadeDuration]);\n\n useEffect(() => () => clearTimeout(exitTimeout.current), []);\n\n // Capture ESC before the deck/reveal handlers so a single keypress exits directly.\n useEffect(() => {\n const handler = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopImmediatePropagation();\n handleExit();\n }\n };\n\n document.addEventListener('keydown', handler, { capture: true });\n return () => document.removeEventListener('keydown', handler, { capture: true });\n }, [handleExit]);\n\n return (\n <div\n {...composableProps(props, {\n classNames: [\n 'relative grow overflow-hidden bg-black transition-opacity',\n visible && !exiting ? 'opacity-100' : 'opacity-0',\n ],\n style: { transitionDuration: `${fadeDuration}ms` },\n })}\n ref={forwardedRef}\n >\n {children}\n {fullscreen && (\n <div\n className={mx(\n 'absolute top-4 left-4 z-[300] transition-opacity duration-500',\n showHint && !exiting ? 'opacity-100' : 'opacity-0',\n )}\n >\n <span className='rounded-sm bg-white/10 px-2 py-1 font-mono text-sm text-white/70'>[ESC]</span>\n </div>\n )}\n </div>\n );\n },\n);\n","//\n// Copyright 2024 DXOS.org\n//\n\nimport 'reveal.js/dist/reveal.css';\nimport 'reveal.js/dist/theme/black.css';\n// https://github.com/highlightjs/highlight.js/tree/main/src/styles\n// import 'highlight.js/styles/github-dark.css';\nimport 'highlight.js/styles/tokyo-night-dark.css';\n\nimport hljs from 'highlight.js';\nimport typescript from 'highlight.js/lib/languages/typescript';\nimport React, { useRef } from 'react';\nimport Reveal from 'reveal.js';\nimport RevealHighlight from 'reveal.js/plugin/highlight/highlight';\nimport RevealMarkdown from 'reveal.js/plugin/markdown/plugin.js';\n\nimport { useAsyncEffect } from '@dxos/react-ui';\nimport { composable, composableProps } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nconst styles = `\n<style type=\"text/css\">\n .reveal h1 {\n font-weight: 100;\n font-size: 60px;\n opacity: 0.5;\n }\n .reveal h2 {\n font-weight: 100;\n padding-top: 60px;\n padding-left: 40px;\n font-size: 48px;\n opacity: 0.3;\n }\n .reveal h1, h2, p {\n font-family: \"Raleway\", sans-serif;\n text-align: left;\n font-weight: 200;\n }\n .reveal ul {\n font-family: \"Raleway\", sans-serif;\n display: block;\n list-style: \"- \";\n }\n .reveal blockquote p {\n text-align: center;\n font-weight: 100;\n padding: 32px;\n }\n .reveal pre {\n margin-left: 0;\n }\n .reveal code {\n font-size: 20px;\n background: #111111;\n color: #eeeeee;\n max-height: unset !important;\n }\n</style>\n`;\n\nexport type RevealProps = {\n content: string;\n slide?: number;\n fullscreen?: boolean;\n onExit?: () => void;\n};\n\nexport const RevealPlayer = composable<HTMLDivElement, RevealProps>(\n ({ content, slide, fullscreen = true, onExit, children, ...props }, forwardedRef) => {\n const deckDivRef = useRef<HTMLDivElement>(null);\n const deckRef = useRef<Reveal.Api | null>(null);\n\n useAsyncEffect(async () => {\n if (deckRef.current) {\n return;\n }\n\n // Required for syntax highlighting.\n hljs.registerLanguage('typescript', typescript);\n\n // https://revealjs.com/react\n // https://revealjs.com/config\n // https://github.com/hakimel/reveal.js\n // TODO(burdon): Fragments and scroll view steps 2 at a time (safe mode?)\n deckRef.current = new Reveal(deckDivRef.current!, {\n // view: 'scroll',\n progress: false,\n transition: 'none',\n slideNumber: false,\n embedded: true,\n\n // Disable autoplay to prevent errors in headless environments (e.g., CI).\n autoPlayMedia: false,\n\n // TODO(burdon): Speaker view requires server to serve popout window.\n // https://revealjs.com/speaker-view\n showNotes: false,\n\n // width: 1600,\n // height: 900,\n margin: 0.1,\n // center: false,\n // minScale: 0.1,\n // maxScale: 1.4,\n\n // https://revealjs.com/markdown\n // TODO(burdon): Requires server to serve popout window.\n plugins: [RevealMarkdown, RevealHighlight],\n\n // See https://marked.js.org/using_advanced#options\n markdown: {\n gfm: true,\n smartypants: true,\n highlight: (code, language) => {\n if (language) {\n return hljs.highlight(code, { language }).value;\n }\n\n return hljs.highlightAuto(code).value;\n },\n },\n });\n\n await deckRef.current.initialize();\n\n if (slide !== undefined) {\n deckRef.current.slide(slide < 0 ? deckRef.current?.getTotalSlides() + slide : slide - 1);\n }\n\n deckRef.current.addKeyBinding({ keyCode: 27, key: 'Escape', description: 'Exit full screen' }, () => {\n onExit?.();\n });\n\n return () => {\n try {\n if (deckRef.current) {\n deckRef.current.destroy();\n deckRef.current = null;\n }\n } catch {\n // Ignore.\n }\n };\n });\n\n // TOOD(burdon): Trap cursor keys (otherwise tabster grabs focus.)\n return (\n <div\n {...composableProps(props, {\n classNames: ['dx-container grid place-items-center bg-scrim-surface', fullscreen && 'absolute inset-0'],\n })}\n ref={forwardedRef}\n >\n <div className='relative aspect-video h-full w-full h-auto max-h-full overflow-hidden'>\n <div ref={deckDivRef} className='absolute inset-0 reveal'>\n {/* React hoists these to <head>; they must not be wrapped in <style> (which only renders CSS text). */}\n <link rel='preconnect' href='https://fonts.gstatic.com' {...{ crossOrigin: '' }} />\n <link rel='preconnect' href='https://fonts.googleapis.com' />\n <link\n rel='stylesheet'\n href='https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap'\n />\n <div className={mx('slides', !fullscreen && 'dx-base-surface p-8')}>\n <div />\n <section {...{ 'data-markdown': [] }}>\n <textarea {...{ 'data-template': true }} defaultValue={[styles, content].join('\\n')}></textarea>\n </section>\n </div>\n </div>\n </div>\n </div>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAeA,IAAa,SAAS,EAAE,UAAU,iBAA6B;CAC7D,MAAM,CAAC,OAAO,YAAY,SAAS,CAAC,CAAC;CACrC,MAAM,EACJ,KAAK,cACL,OACA,WACE,kBAAkB;EACpB,aAAa;EACb,aAAa;EACb,gBAAgB,EACd,SAAS,KACX;EACA,WAAW,EAAE,OAAO,aAAa;GAC/B,IAAI,SAAS,QACX,SAAS,kBAAkB;IAAE;IAAO;GAAO,CAAC,CAAC;EAEjD;CACF,CAAC;CAID,OACE,oBAAC,OAAD;EAAK,KAAK;EAAc,WAAW,GAAG,2DAA2D,UAAU;YACzG,oBAAC,OAAD;GAAK,WAAW,GAAG,uBAAuB;GAAG,OAAO;aACjD,SAAS,UAAU;EACjB,CAAA;CACF,CAAA;AAET;;;;;;;;;;;AAYA,IAAM,qBAAqB,EAAE,OAAO,aAAgD;CAElF,MAAM,cAAc,KAAK;CACzB,MAAM,eAAe;CACrB,MAAM,gBAAgB,eAAe;CAYrC,MAAM,QAAQ,KAAK,IAAI,QAAQ,cAAc,SAAS,aAAa;CAEnE,OAAO;EACL,OAAO,QAAQ,gBAAgB;EAC/B,MAAM,SAAS,iBAAiB;EAChC,OAAO;EACP,QAAQ;EACR,WAAW,SAAS,MAAM;CAC5B;AACF;;;;;;AC1EA,IAAa,QAAQ;CACnB,MAAM;CAEN,SAAS;CAET,OAAO;EACL,IAAI;E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;EAGzF,QAAQ,QAAQ,cAAc;GAAE,SAAS;GAAI,KAAK;GAAU,aAAa;EAAmB,SAAS;GACnG,SAAS;EACX,CAAC;EAED,aAAa;GACX,IAAI;IACF,IAAI,QAAQ,SAAS;KACnB,QAAQ,QAAQ,QAAQ;KACxB,QAAQ,UAAU;IACpB;GACF,QAAQ,CAER;EACF;CACF,CAAC;CAGD,OACE,oBAAC,OAAD;EACE,GAAI,gBAAgB,OAAO,EACzB,YAAY,CAAC,yDAAyD,cAAc,kBAAkB,EACxG,CAAC;EACD,KAAK;YAEL,oBAAC,OAAD;GAAK,WAAU;aACb,qBAAC,OAAD;IAAK,KAAK;IAAY,WAAU;cAAhC;KAEE,oBAAC,QAAD;MAAM,KAAI;MAAa,MAAK;MAAkC,aAAa;KAAO,CAAA;KAClF,oBAAC,QAAD;MAAM,KAAI;MAAa,MAAK;KAAgC,CAAA;KAC5D,oBAAC,QAAD;MACE,KAAI;MACJ,MAAK;KACN,CAAA;KACD,qBAAC,OAAD;MAAK,WAAW,GAAG,UAAU,CAAC,cAAc,qBAAqB;gBAAjE,CACE,oBAAC,OAAD,CAAM,CAAA,GACN,oBAAC,WAAD;OAAe,iBAAiB,CAAC;iBAC/B,oBAAC,YAAD;QAAgB,iBAAiB;QAAQ,cAAc,CAAC,QAAQ,OAAO,CAAC,CAAC,KAAK,IAAI;OAAa,CAAA;MACxF,CAAA,CACN;;IACF;;EACF,CAAA;CACF,CAAA;AAET,CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { lazy } from "react";
|
|
2
|
+
//#region src/containers/index.ts
|
|
3
|
+
var CollectionArticle = lazy(() => import("./chunk-CollectionArticle.mjs"));
|
|
4
|
+
var DocumentArticle = lazy(() => import("./chunk-DocumentArticle.mjs"));
|
|
5
|
+
var SlideArticle = lazy(() => import("./chunk-SlideArticle.mjs"));
|
|
6
|
+
//#endregion
|
|
7
|
+
export { CollectionArticle, DocumentArticle, SlideArticle };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=containers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containers.mjs","names":[],"sources":["../../src/containers/index.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const CollectionArticle: ComponentType<any> = lazy(() => import('./CollectionArticle'));\nexport const DocumentArticle: ComponentType<any> = lazy(() => import('./DocumentArticle'));\nexport const SlideArticle: ComponentType<any> = lazy(() => import('./SlideArticle'));\n"],"mappings":";;AAMA,IAAa,oBAAwC,WAAW,OAAO,gCAAsB;AAC7F,IAAa,kBAAsC,WAAW,OAAO,8BAAoB;AACzF,IAAa,eAAmC,WAAW,OAAO,2BAAiB"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { i as PresenterCapabilities_exports, n as Settings_exports, r as PresenterOperation_exports, t as PresenterContext } from "./chunk-types.mjs";
|
|
2
|
+
import { t as meta } from "./chunk-meta.mjs";
|
|
3
|
+
export { PresenterCapabilities_exports as PresenterCapabilities, PresenterContext, PresenterOperation_exports as PresenterOperation, Settings_exports as Settings, meta };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OperationHandlerSet } from "@dxos/compute";
|
|
2
|
+
//#region src/operations/index.ts
|
|
3
|
+
var PresenterOperationHandlerSet = OperationHandlerSet.lazy(() => import("./chunk-toggle-presentation.mjs"));
|
|
4
|
+
//#endregion
|
|
5
|
+
export { PresenterOperationHandlerSet };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=operations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.mjs","names":[],"sources":["../../src/operations/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const PresenterOperationHandlerSet = OperationHandlerSet.lazy(() => import('./toggle-presentation'));\n"],"mappings":";;AAMA,IAAa,+BAA+B,oBAAoB,WAAW,OAAO,kCAAwB"}
|