@dxos/plugin-presenter 0.9.0 → 0.9.1-main.c7dcc2e112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/lib/neutral/{CollectionPresenterArticle-DFREOQTG.mjs → CollectionPresenterArticle-ZRYWBX2H.mjs} +7 -6
  2. package/dist/lib/neutral/CollectionPresenterArticle-ZRYWBX2H.mjs.map +7 -0
  3. package/dist/lib/neutral/{DocumentPresenterContainer-KCDZ2O2C.mjs → DocumentPresenterContainer-5QF4P736.mjs} +7 -6
  4. package/dist/lib/neutral/DocumentPresenterContainer-5QF4P736.mjs.map +7 -0
  5. package/dist/lib/neutral/PresenterPlugin.mjs +10 -3
  6. package/dist/lib/neutral/PresenterPlugin.mjs.map +4 -4
  7. package/dist/lib/neutral/{PresenterSettings-2G4XD4QY.mjs → PresenterSettings-4YFP4K5G.mjs} +3 -3
  8. package/dist/lib/neutral/{PresenterSettings-2G4XD4QY.mjs.map → PresenterSettings-4YFP4K5G.mjs.map} +3 -3
  9. package/dist/lib/neutral/{app-graph-builder-DIEDSRPX.mjs → app-graph-builder-JMQVBFG2.mjs} +7 -23
  10. package/dist/lib/neutral/app-graph-builder-JMQVBFG2.mjs.map +7 -0
  11. package/dist/lib/neutral/capabilities/index.mjs +7 -3
  12. package/dist/lib/neutral/capabilities/index.mjs.map +3 -3
  13. package/dist/lib/neutral/chunk-63IF7OXT.mjs +19 -0
  14. package/dist/lib/neutral/chunk-63IF7OXT.mjs.map +7 -0
  15. package/dist/lib/neutral/{chunk-VVALMI52.mjs → chunk-H5JLSLAO.mjs} +7 -3
  16. package/dist/lib/neutral/chunk-H5JLSLAO.mjs.map +7 -0
  17. package/dist/lib/neutral/chunk-MSQDHOPV.mjs +47 -0
  18. package/dist/lib/neutral/chunk-MSQDHOPV.mjs.map +7 -0
  19. package/dist/lib/neutral/components/index.mjs +87 -18
  20. package/dist/lib/neutral/components/index.mjs.map +4 -4
  21. package/dist/lib/neutral/containers/index.mjs +2 -2
  22. package/dist/lib/neutral/index.mjs +2 -2
  23. package/dist/lib/neutral/markdown-extension-HGLRVZDF.mjs +37 -0
  24. package/dist/lib/neutral/markdown-extension-HGLRVZDF.mjs.map +7 -0
  25. package/dist/lib/neutral/meta.json +1 -1
  26. package/dist/lib/neutral/meta.mjs +1 -1
  27. package/dist/lib/neutral/operation-handler-3ZESW5AK.mjs +13 -0
  28. package/dist/lib/neutral/operation-handler-3ZESW5AK.mjs.map +7 -0
  29. package/dist/lib/neutral/operations/index.mjs +9 -0
  30. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  31. package/dist/lib/neutral/plugin.mjs +1 -1
  32. package/dist/lib/neutral/{react-surface-SPJGAJIF.mjs → react-surface-YGBE3TDK.mjs} +4 -4
  33. package/dist/lib/neutral/react-surface-YGBE3TDK.mjs.map +7 -0
  34. package/dist/lib/neutral/{settings-R6LRDAAK.mjs → settings-DBV7N5HT.mjs} +3 -3
  35. package/dist/lib/neutral/{settings-R6LRDAAK.mjs.map → settings-DBV7N5HT.mjs.map} +3 -3
  36. package/dist/lib/neutral/toggle-presentation-PH7ZJJDD.mjs +60 -0
  37. package/dist/lib/neutral/toggle-presentation-PH7ZJJDD.mjs.map +7 -0
  38. package/dist/lib/neutral/translations.mjs +1 -1
  39. package/dist/lib/neutral/translations.mjs.map +3 -3
  40. package/dist/lib/neutral/types/index.mjs +1 -1
  41. package/dist/types/dx.config.d.ts +28 -0
  42. package/dist/types/dx.config.d.ts.map +1 -0
  43. package/dist/types/src/PresenterPlugin.d.ts.map +1 -1
  44. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  45. package/dist/types/src/capabilities/index.d.ts +6 -3
  46. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  47. package/dist/types/src/capabilities/markdown-extension.d.ts +9 -0
  48. package/dist/types/src/capabilities/markdown-extension.d.ts.map +1 -0
  49. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  50. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  51. package/dist/types/src/capabilities/react-surface.d.ts +2 -2
  52. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  53. package/dist/types/src/components/Presenter/PresentationShell.d.ts +18 -0
  54. package/dist/types/src/components/Presenter/PresentationShell.d.ts.map +1 -0
  55. package/dist/types/src/components/Presenter/index.d.ts +1 -0
  56. package/dist/types/src/components/Presenter/index.d.ts.map +1 -1
  57. package/dist/types/src/containers/CollectionPresenterArticle/CollectionPresenterArticle.d.ts.map +1 -1
  58. package/dist/types/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.d.ts.map +1 -1
  59. package/dist/types/src/meta.d.ts +28 -2
  60. package/dist/types/src/meta.d.ts.map +1 -1
  61. package/dist/types/src/operations/index.d.ts +3 -0
  62. package/dist/types/src/operations/index.d.ts.map +1 -0
  63. package/dist/types/src/operations/toggle-presentation.d.ts +10 -0
  64. package/dist/types/src/operations/toggle-presentation.d.ts.map +1 -0
  65. package/dist/types/src/paths.d.ts +3 -0
  66. package/dist/types/src/paths.d.ts.map +1 -0
  67. package/dist/types/src/types/PresenterCapabilities.d.ts.map +1 -1
  68. package/dist/types/src/types/PresenterOperation.d.ts +2 -1
  69. package/dist/types/src/types/PresenterOperation.d.ts.map +1 -1
  70. package/dist/types/src/useExitPresenter.d.ts +6 -1
  71. package/dist/types/src/useExitPresenter.d.ts.map +1 -1
  72. package/dist/types/tsconfig.tsbuildinfo +1 -1
  73. package/dx.config.ts +37 -0
  74. package/package.json +30 -22
  75. package/src/PresenterPlugin.test.ts +1 -1
  76. package/src/PresenterPlugin.tsx +9 -2
  77. package/src/capabilities/app-graph-builder.ts +5 -21
  78. package/src/capabilities/index.ts +6 -0
  79. package/src/capabilities/markdown-extension.ts +45 -0
  80. package/src/capabilities/operation-handler.ts +16 -0
  81. package/src/capabilities/react-surface.tsx +7 -7
  82. package/src/capabilities/settings.ts +2 -2
  83. package/src/components/Presenter/PresentationShell.tsx +96 -0
  84. package/src/components/Presenter/index.ts +1 -0
  85. package/src/components/PresenterSettings/PresenterSettings.tsx +2 -2
  86. package/src/containers/CollectionPresenterArticle/CollectionPresenterArticle.tsx +14 -20
  87. package/src/containers/DocumentPresenterContainer/DocumentPresenterContainer.tsx +4 -2
  88. package/src/meta.ts +2 -30
  89. package/src/operations/index.ts +7 -0
  90. package/src/operations/toggle-presentation.ts +59 -0
  91. package/src/paths.ts +8 -0
  92. package/src/translations.ts +1 -1
  93. package/src/types/PresenterCapabilities.ts +3 -1
  94. package/src/types/PresenterOperation.ts +3 -2
  95. package/src/useExitPresenter.ts +13 -26
  96. package/dist/lib/neutral/CollectionPresenterArticle-DFREOQTG.mjs.map +0 -7
  97. package/dist/lib/neutral/DocumentPresenterContainer-KCDZ2O2C.mjs.map +0 -7
  98. package/dist/lib/neutral/app-graph-builder-DIEDSRPX.mjs.map +0 -7
  99. package/dist/lib/neutral/chunk-PPL2FF6R.mjs +0 -38
  100. package/dist/lib/neutral/chunk-PPL2FF6R.mjs.map +0 -7
  101. package/dist/lib/neutral/chunk-V323QBC3.mjs +0 -41
  102. package/dist/lib/neutral/chunk-V323QBC3.mjs.map +0 -7
  103. package/dist/lib/neutral/chunk-VVALMI52.mjs.map +0 -7
  104. package/dist/lib/neutral/react-surface-SPJGAJIF.mjs.map +0 -7
@@ -56,7 +56,7 @@ import rehypeHighlight from "rehype-highlight";
56
56
  import remarkFrontmatter from "remark-frontmatter";
57
57
  import remarkParseFrontmatter from "remark-parse-frontmatter";
58
58
 
59
- // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-presenter/src/components/Markdown/styles.css?raw
59
+ // raw-loader:/__w/dxos/dxos/packages/plugins/plugin-presenter/src/components/Markdown/styles.css
60
60
  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";
61
61
 
62
62
  // src/components/Markdown/theme.ts
@@ -331,18 +331,86 @@ var StartButton = ({ running, onClick }) => {
331
331
  });
332
332
  };
333
333
 
334
+ // src/components/Presenter/PresentationShell.tsx
335
+ import React5, { useCallback, useEffect as useEffect2, useRef, useState as useState2 } from "react";
336
+ import { composable as composable2, composableProps as composableProps2 } from "@dxos/react-ui";
337
+ import { mx as mx2 } from "@dxos/ui-theme";
338
+ var PresentationShell = composable2(({ children, onExit, fadeDuration = 300, hintDuration = 3e3, ...props }, forwardedRef) => {
339
+ const [visible, setVisible] = useState2(false);
340
+ const [exiting, setExiting] = useState2(false);
341
+ const [showHint, setShowHint] = useState2(true);
342
+ const exitTimeout = useRef(void 0);
343
+ const exitingRef = useRef(false);
344
+ useEffect2(() => {
345
+ const frame = requestAnimationFrame(() => setVisible(true));
346
+ return () => cancelAnimationFrame(frame);
347
+ }, []);
348
+ useEffect2(() => {
349
+ const timer = setTimeout(() => setShowHint(false), hintDuration);
350
+ return () => clearTimeout(timer);
351
+ }, [
352
+ hintDuration
353
+ ]);
354
+ const handleExit = useCallback(() => {
355
+ if (exitingRef.current) {
356
+ return;
357
+ }
358
+ exitingRef.current = true;
359
+ setExiting(true);
360
+ setVisible(false);
361
+ exitTimeout.current = setTimeout(() => onExit?.(), fadeDuration);
362
+ }, [
363
+ onExit,
364
+ fadeDuration
365
+ ]);
366
+ useEffect2(() => () => clearTimeout(exitTimeout.current), []);
367
+ useEffect2(() => {
368
+ const handler = (event) => {
369
+ if (event.key === "Escape") {
370
+ event.preventDefault();
371
+ event.stopImmediatePropagation();
372
+ handleExit();
373
+ }
374
+ };
375
+ document.addEventListener("keydown", handler, {
376
+ capture: true
377
+ });
378
+ return () => document.removeEventListener("keydown", handler, {
379
+ capture: true
380
+ });
381
+ }, [
382
+ handleExit
383
+ ]);
384
+ return /* @__PURE__ */ React5.createElement("div", {
385
+ ...composableProps2(props, {
386
+ classNames: [
387
+ "relative grow overflow-hidden bg-black transition-opacity",
388
+ visible && !exiting ? "opacity-100" : "opacity-0"
389
+ ],
390
+ style: {
391
+ transitionDuration: `${fadeDuration}ms`
392
+ }
393
+ }),
394
+ ref: forwardedRef
395
+ }, children, /* @__PURE__ */ React5.createElement("div", {
396
+ className: mx2("absolute top-4 left-4 z-[300] transition-opacity duration-500", showHint && !exiting ? "opacity-100" : "opacity-0")
397
+ }, /* @__PURE__ */ React5.createElement("span", {
398
+ className: "rounded-sm bg-white/10 px-2 py-1 font-mono text-sm text-white/70"
399
+ }, "[ESC]")));
400
+ });
401
+
334
402
  // src/components/RevealPlayer/RevealPlayer.tsx
335
403
  import "reveal.js/dist/reveal.css";
336
404
  import "reveal.js/dist/theme/black.css";
337
405
  import "highlight.js/styles/tokyo-night-dark.css";
338
406
  import hljs from "highlight.js";
339
407
  import typescript from "highlight.js/lib/languages/typescript";
340
- import React5, { useRef } from "react";
408
+ import React6, { useRef as useRef2 } from "react";
341
409
  import Reveal from "reveal.js";
342
410
  import RevealHighlight from "reveal.js/plugin/highlight/highlight";
343
411
  import RevealMarkdown from "reveal.js/plugin/markdown/plugin.js";
344
412
  import { useAsyncEffect } from "@dxos/react-ui";
345
- import { composable as composable2, composableProps as composableProps2 } from "@dxos/react-ui";
413
+ import { composable as composable3, composableProps as composableProps3 } from "@dxos/react-ui";
346
414
  var styles = `
347
415
  <style type="text/css">
348
416
  .reveal h1 {
@@ -383,9 +451,9 @@ var styles = `
383
451
  }
384
452
  </style>
385
453
  `;
386
- var RevealPlayer = composable2(({ content, slide, fullscreen = true, onExit, children, ...props }, forwardedRef) => {
387
- const deckDivRef = useRef(null);
388
- const deckRef = useRef(null);
454
+ var RevealPlayer = composable3(({ content, slide, fullscreen = true, onExit, children, ...props }, forwardedRef) => {
455
+ const deckDivRef = useRef2(null);
456
+ const deckRef = useRef2(null);
389
457
  useAsyncEffect(async () => {
390
458
  if (deckRef.current) {
391
459
  return;
@@ -449,36 +517,36 @@ var RevealPlayer = composable2(({ content, slide, fullscreen = true, onExit, chi
449
517
  }
450
518
  };
451
519
  });
452
- return /* @__PURE__ */ React5.createElement("div", {
453
- ...composableProps2(props, {
520
+ return /* @__PURE__ */ React6.createElement("div", {
521
+ ...composableProps3(props, {
454
522
  classNames: [
455
523
  "dx-container grid place-items-center bg-black",
456
524
  fullscreen && "absolute inset-0"
457
525
  ]
458
526
  }),
459
527
  ref: forwardedRef
460
- }, /* @__PURE__ */ React5.createElement("div", {
528
+ }, /* @__PURE__ */ React6.createElement("div", {
461
529
  className: "relative aspect-video h-full w-full h-auto max-h-full overflow-hidden"
462
- }, /* @__PURE__ */ React5.createElement("div", {
530
+ }, /* @__PURE__ */ React6.createElement("div", {
463
531
  ref: deckDivRef,
464
532
  className: "absolute inset-0 reveal"
465
- }, /* @__PURE__ */ React5.createElement("style", null, /* @__PURE__ */ React5.createElement("link", {
533
+ }, /* @__PURE__ */ React6.createElement("style", null, /* @__PURE__ */ React6.createElement("link", {
466
534
  rel: "preconnect",
467
535
  href: "https://fonts.googleapis.com"
468
- }), /* @__PURE__ */ React5.createElement("link", {
536
+ }), /* @__PURE__ */ React6.createElement("link", {
469
537
  rel: "preconnect",
470
538
  href: "https://fonts.gstatic.com",
471
539
  crossOrigin: ""
472
- }), /* @__PURE__ */ React5.createElement("link", {
540
+ }), /* @__PURE__ */ React6.createElement("link", {
473
541
  rel: "stylesheet",
474
542
  href: "https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap"
475
- })), /* @__PURE__ */ React5.createElement("div", {
543
+ })), /* @__PURE__ */ React6.createElement("div", {
476
544
  className: "slides"
477
- }, /* @__PURE__ */ React5.createElement("div", {
545
+ }, /* @__PURE__ */ React6.createElement("div", {
478
546
  className: "text-center!"
479
- }), /* @__PURE__ */ React5.createElement("section", {
547
+ }), /* @__PURE__ */ React6.createElement("section", {
480
548
  "data-markdown": []
481
- }, /* @__PURE__ */ React5.createElement("textarea", {
549
+ }, /* @__PURE__ */ React6.createElement("textarea", {
482
550
  "data-template": true,
483
551
  defaultValue: [
484
552
  styles,
@@ -488,12 +556,13 @@ var RevealPlayer = composable2(({ content, slide, fullscreen = true, onExit, chi
488
556
  });
489
557
 
490
558
  // src/components/index.ts
491
- var PresenterSettings = lazy(() => import("../PresenterSettings-2G4XD4QY.mjs"));
559
+ var PresenterSettings = lazy(() => import("../PresenterSettings-4YFP4K5G.mjs"));
492
560
  export {
493
561
  Layout,
494
562
  PageNumber,
495
563
  Pager,
496
564
  Panel,
565
+ PresentationShell,
497
566
  PresenterSettings,
498
567
  RevealPlayer,
499
568
  Slide,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/components/index.ts", "../../../../src/components/Markdown/Panel.tsx", "../../../../src/components/Markdown/Slide.tsx", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-presenter/src/components/Markdown/styles.css?raw", "../../../../src/components/Markdown/theme.ts", "../../../../src/components/Presenter/Layout.tsx", "../../../../src/components/Presenter/Pager.tsx", "../../../../src/components/RevealPlayer/RevealPlayer.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport * from './Markdown';\nexport * from './Presenter';\nexport * from './RevealPlayer';\n\nexport const PresenterSettings: ComponentType<any> = lazy(() => import('./PresenterSettings'));\n", "//\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 bg-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\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 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", "//\n// Copyright 2023 DXOS.org\n//\n\n// TODO(burdon): Create theme type and picker.\n\nexport const theme = {\n root: 'bg-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 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 bg-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 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';\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-black', 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 {/* NOTE: Must be in head. */}\n <style>\n <link rel='preconnect' href='https://fonts.googleapis.com' />\n <link rel='preconnect' href='https://fonts.gstatic.com' {...{ crossOrigin: '' }} />\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 </style>\n <div className='slides'>\n <div className='text-center!' />\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"],
5
- "mappings": ";;;AAIA,SAA6BA,YAAY;;;ACAzC,OAAOC,SAAiCC,gBAAgB;AACxD,SAASC,yBAAyB;AAGlC,SAASC,UAAU;AAOZ,IAAMC,QAAQ,CAAC,EAAEC,UAAUC,WAAU,MAAc;AACxD,QAAM,CAACC,OAAOC,QAAAA,IAAYP,SAAS,CAAC,CAAA;AACpC,QAAM,EACJQ,KAAKC,cACLC,OACAC,OAAM,IACJV,kBAAkB;IACpBW,aAAa;IACbC,aAAa;IACbC,gBAAgB;MACdC,SAAS;IACX;IACAC,UAAU,CAAC,EAAEN,OAAAA,QAAOC,QAAAA,QAAM,MAAE;AAC1B,UAAID,UAASC,SAAQ;AACnBJ,iBAASU,kBAAkB;UAAEP,OAAAA;UAAOC,QAAAA;QAAO,CAAA,CAAA;MAC7C;IACF;EACF,CAAA;AAIA,SACE,sBAAA,cAACO,OAAAA;IAAIV,KAAKC;IAAcU,WAAWjB,GAAG,2DAA2DG,UAAAA;KAC/F,sBAAA,cAACa,OAAAA;IAAIC,WAAWjB,GAAG,uBAAA;IAA0BkB,OAAOd;KACjDI,SAASC,UAAUP,QAAAA,CAAAA;AAI5B;AA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AU;MACf,gBAAAhD,OAAA,cAACsD,WAAY;IAAE,iBAAiB,CAAA;EAAG,GACjC,gBAAAtD,OAAA,cAACuD,YAAAA;IAAe,iBAAiB;IAAQC,cAAc;MAAChD;MAAQE;MAAS+C,KAAK,IAAA;;AAO5F,CAAA;;;APrKK,IAAMC,oBAAwCC,KAAK,MAAM,OAAO,mCAAA,CAAA;",
6
- "names": ["lazy", "React", "useState", "useResizeDetector", "mx", "Panel", "children", "classNames", "props", "setProps", "ref", "containerRef", "width", "height", "refreshMode", "refreshRate", "refreshOptions", "leading", "onResize", "createLayoutProps", "div", "className", "style", "aspectRatio", "nominalWidth", "nominalHeight", "scale", "Math", "min", "left", "top", "transform", "h", "React", "ReactMarkdown", "rehypeAddClasses", "rehypeHighlight", "remarkFrontmatter", "remarkParseFrontmatter", "theme", "root", "padding", "nodes", "h1", "h2", "h3", "p", "ul", "ol", "li", "pre", "code", "Slide", "content", "classes", "theme", "nodes", "React", "style", "styles", "ReactMarkdown", "components", "remarkPlugins", "remarkFrontmatter", "remarkParseFrontmatter", "rehypePlugins", "rehypeAddClasses", "rehypeHighlight", "slideLayout", "_options", "tree", "file", "data", "frontmatter", "children", "layout", "image", "img", "h", "class", "backgroundImage", "padding", "root", "ImageWrapper", "node", "_", "props", "alt", "src", "React", "composable", "composableProps", "Layout", "children", "topLeft", "topRight", "bottomLeft", "bottomRight", "props", "forwardedRef", "div", "classNames", "ref", "className", "React", "useEffect", "IconButton", "useControlledState", "Pager", "index", "indexProp", "count", "keys", "onChange", "onExit", "setIndex", "handleChangeIndex", "dir", "next", "keydownHandler", "event", "key", "shiftKey", "window", "addEventListener", "removeEventListener", "undefined", "div", "className", "icon", "size", "label", "iconOnly", "noTooltip", "variant", "classNames", "onClick", "PageNumber", "StartButton", "running", "hljs", "typescript", "React", "useRef", "Reveal", "RevealHighlight", "RevealMarkdown", "useAsyncEffect", "composable", "composableProps", "styles", "RevealPlayer", "content", "slide", "fullscreen", "onExit", "children", "props", "forwardedRef", "deckDivRef", "deckRef", "current", "registerLanguage", "progress", "transition", "slideNumber", "embedded", "autoPlayMedia", "showNotes", "margin", "plugins", "markdown", "gfm", "smartypants", "highlight", "code", "language", "value", "highlightAuto", "initialize", "undefined", "getTotalSlides", "addKeyBinding", "keyCode", "key", "description", "destroy", "div", "classNames", "ref", "className", "style", "link", "rel", "href", "crossOrigin", "section", "textarea", "defaultValue", "join", "PresenterSettings", "lazy"]
3
+ "sources": ["../../../../src/components/index.ts", "../../../../src/components/Markdown/Panel.tsx", "../../../../src/components/Markdown/Slide.tsx", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-presenter/src/components/Markdown/styles.css", "../../../../src/components/Markdown/theme.ts", "../../../../src/components/Presenter/Layout.tsx", "../../../../src/components/Presenter/Pager.tsx", "../../../../src/components/Presenter/PresentationShell.tsx", "../../../../src/components/RevealPlayer/RevealPlayer.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport * from './Markdown';\nexport * from './Presenter';\nexport * from './RevealPlayer';\n\nexport const PresenterSettings: ComponentType<any> = lazy(() => import('./PresenterSettings'));\n", "//\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 bg-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\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 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", "//\n// Copyright 2023 DXOS.org\n//\n\n// TODO(burdon): Create theme type and picker.\n\nexport const theme = {\n root: 'bg-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 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 bg-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 /** Invoked once the exit fade-out has completed. */\n onExit?: () => void;\n /** Fade-in/out duration (ms). */\n fadeDuration?: number;\n /** Duration the [ESC] hint remains visible (ms). */\n hintDuration?: number;\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, onExit, fadeDuration = 300, hintDuration = 3000, ...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\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 </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';\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-black', 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 {/* NOTE: Must be in head. */}\n <style>\n <link rel='preconnect' href='https://fonts.googleapis.com' />\n <link rel='preconnect' href='https://fonts.gstatic.com' {...{ crossOrigin: '' }} />\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 </style>\n <div className='slides'>\n <div className='text-center!' />\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"],
5
+ "mappings": ";;;AAIA,SAA6BA,YAAY;;;ACAzC,OAAOC,SAAiCC,gBAAgB;AACxD,SAASC,yBAAyB;AAGlC,SAASC,UAAU;AAOZ,IAAMC,QAAQ,CAAC,EAAEC,UAAUC,WAAU,MAAc;AACxD,QAAM,CAACC,OAAOC,QAAAA,IAAYP,SAAS,CAAC,CAAA;AACpC,QAAM,EACJQ,KAAKC,cACLC,OACAC,OAAM,IACJV,kBAAkB;IACpBW,aAAa;IACbC,aAAa;IACbC,gBAAgB;MACdC,SAAS;IACX;IACAC,UAAU,CAAC,EAAEN,OAAAA,QAAOC,QAAAA,QAAM,MAAE;AAC1B,UAAID,UAASC,SAAQ;AACnBJ,iBAASU,kBAA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C,QAAQqB,cAAc;MAAEC,SAAS;MAAIC,KAAK;MAAUC,aAAa;IAAmB,GAAG,MAAA;AAC7F9B,eAAAA;IACF,CAAA;AAEA,WAAO,MAAA;AACL,UAAI;AACF,YAAIK,QAAQC,SAAS;AACnBD,kBAAQC,QAAQyB,QAAO;AACvB1B,kBAAQC,UAAU;QACpB;MACF,QAAQ;MAER;IACF;EACF,CAAA;AAGA,SACE,gBAAAnB,OAAA,cAAC6C,OAAAA;IACE,GAAGtC,iBAAgBQ,OAAO;MACzB+B,YAAY;QAAC;QAAiDlC,cAAc;;IAC9E,CAAA;IACAmC,KAAK/B;KAEL,gBAAAhB,OAAA,cAAC6C,OAAAA;IAAIG,WAAU;KACb,gBAAAhD,OAAA,cAAC6C,OAAAA;IAAIE,KAAK9B;IAAY+B,WAAU;KAE9B,gBAAAhD,OAAA,cAACiD,SAAAA,MACC,gBAAAjD,OAAA,cAACkD,QAAAA;IAAKC,KAAI;IAAaC,MAAK;MAC5B,gBAAApD,OAAA,cAACkD,QAAAA;IAAKC,KAAI;IAAaC,MAAK;IAAkCC,aAAa;MAC3E,gBAAArD,OAAA,cAACkD,QAAAA;IACCC,KAAI;IACJC,MAAK;OAGT,gBAAApD,OAAA,cAAC6C,OAAAA;IAAIG,WAAU;KACb,gBAAAhD,OAAA,cAAC6C,OAAAA;IAAIG,WAAU;MACf,gBAAAhD,OAAA,cAACsD,WAAY;IAAE,iBAAiB,CAAA;EAAG,GACjC,gBAAAtD,OAAA,cAACuD,YAAAA;IAAe,iBAAiB;IAAQC,cAAc;MAAChD;MAAQE;MAAS+C,KAAK,IAAA;;AAO5F,CAAA;;;ARrKK,IAAMC,oBAAwCC,KAAK,MAAM,OAAO,mCAAA,CAAA;",
6
+ "names": ["lazy", "React", "useState", "useResizeDetector", "mx", "Panel", "children", "classNames", "props", "setProps", "ref", "containerRef", "width", "height", "refreshMode", "refreshRate", "refreshOptions", "leading", "onResize", "createLayoutProps", "div", "className", "style", "aspectRatio", "nominalWidth", "nominalHeight", "scale", "Math", "min", "left", "top", "transform", "h", "React", "ReactMarkdown", "rehypeAddClasses", "rehypeHighlight", "remarkFrontmatter", "remarkParseFrontmatter", "theme", "root", "padding", "nodes", "h1", "h2", "h3", "p", "ul", "ol", "li", "pre", "code", "Slide", "content", "classes", "theme", "nodes", "React", "style", "styles", "ReactMarkdown", "components", "remarkPlugins", "remarkFrontmatter", "remarkParseFrontmatter", "rehypePlugins", "rehypeAddClasses", "rehypeHighlight", "slideLayout", "_options", "tree", "file", "data", "frontmatter", "children", "layout", "image", "img", "h", "class", "backgroundImage", "padding", "root", "ImageWrapper", "node", "_", "props", "alt", "src", "React", "composable", "composableProps", "Layout", "children", "topLeft", "topRight", "bottomLeft", "bottomRight", "props", "forwardedRef", "div", "classNames", "ref", "className", "React", "useEffect", "IconButton", "useControlledState", "Pager", "index", "indexProp", "count", "keys", "onChange", "onExit", "setIndex", "handleChangeIndex", "dir", "next", "keydownHandler", "event", "key", "shiftKey", "window", "addEventListener", "removeEventListener", "undefined", "div", "className", "icon", "size", "label", "iconOnly", "noTooltip", "variant", "classNames", "onClick", "PageNumber", "StartButton", "running", "React", "useCallback", "useEffect", "useRef", "useState", "composable", "composableProps", "mx", "PresentationShell", "children", "onExit", "fadeDuration", "hintDuration", "props", "forwardedRef", "visible", "setVisible", "exiting", "setExiting", "showHint", "setShowHint", "exitTimeout", "undefined", "exitingRef", "frame", "requestAnimationFrame", "cancelAnimationFrame", "timer", "setTimeout", "clearTimeout", "handleExit", "current", "handler", "event", "key", "preventDefault", "stopImmediatePropagation", "document", "addEventListener", "capture", "removeEventListener", "div", "classNames", "style", "transitionDuration", "ref", "className", "span", "hljs", "typescript", "React", "useRef", "Reveal", "RevealHighlight", "RevealMarkdown", "useAsyncEffect", "composable", "composableProps", "styles", "RevealPlayer", "content", "slide", "fullscreen", "onExit", "children", "props", "forwardedRef", "deckDivRef", "deckRef", "current", "registerLanguage", "progress", "transition", "slideNumber", "embedded", "autoPlayMedia", "showNotes", "margin", "plugins", "markdown", "gfm", "smartypants", "highlight", "code", "language", "value", "highlightAuto", "initialize", "undefined", "getTotalSlides", "addKeyBinding", "keyCode", "key", "description", "destroy", "div", "classNames", "ref", "className", "style", "link", "rel", "href", "crossOrigin", "section", "textarea", "defaultValue", "join", "PresenterSettings", "lazy"]
7
7
  }
@@ -2,8 +2,8 @@ import "../chunk-J5LGTIGS.mjs";
2
2
 
3
3
  // src/containers/index.ts
4
4
  import { lazy } from "react";
5
- var CollectionPresenterArticle = lazy(() => import("../CollectionPresenterArticle-DFREOQTG.mjs"));
6
- var DocumentPresenterContainer = lazy(() => import("../DocumentPresenterContainer-KCDZ2O2C.mjs"));
5
+ var CollectionPresenterArticle = lazy(() => import("../CollectionPresenterArticle-ZRYWBX2H.mjs"));
6
+ var DocumentPresenterContainer = lazy(() => import("../DocumentPresenterContainer-5QF4P736.mjs"));
7
7
  var MarkdownSlide = lazy(() => import("../MarkdownSlide-WXILOIBE.mjs"));
8
8
  export {
9
9
  CollectionPresenterArticle,
@@ -3,10 +3,10 @@ import {
3
3
  PresenterContext,
4
4
  PresenterOperation_exports,
5
5
  Settings_exports
6
- } from "./chunk-VVALMI52.mjs";
6
+ } from "./chunk-H5JLSLAO.mjs";
7
7
  import {
8
8
  meta
9
- } from "./chunk-PPL2FF6R.mjs";
9
+ } from "./chunk-MSQDHOPV.mjs";
10
10
  import "./chunk-J5LGTIGS.mjs";
11
11
  export {
12
12
  PresenterCapabilities_exports as PresenterCapabilities,
@@ -0,0 +1,37 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
3
+ // src/capabilities/markdown-extension.ts
4
+ import { Prec } from "@codemirror/state";
5
+ import * as Effect from "effect/Effect";
6
+ import { Capabilities, Capability } from "@dxos/app-framework";
7
+ import { MarkdownCapabilities } from "@dxos/plugin-markdown/types";
8
+ import { keymap } from "@dxos/ui-editor";
9
+ import { PresenterOperation } from "#types";
10
+ var markdown_extension_default = Capability.makeModule(Effect.fnUntraced(function* () {
11
+ const capabilities = yield* Capability.Service;
12
+ return Capability.contributes(MarkdownCapabilities.ExtensionProvider, [
13
+ ({ document }) => {
14
+ if (!document) {
15
+ return void 0;
16
+ }
17
+ const { invokePromise } = capabilities.get(Capabilities.OperationInvoker);
18
+ return Prec.highest(keymap.of([
19
+ {
20
+ key: "Shift-Mod-p",
21
+ preventDefault: true,
22
+ stopPropagation: true,
23
+ run: () => {
24
+ void invokePromise(PresenterOperation.TogglePresentation, {
25
+ object: document
26
+ });
27
+ return true;
28
+ }
29
+ }
30
+ ]));
31
+ }
32
+ ]);
33
+ }));
34
+ export {
35
+ markdown_extension_default as default
36
+ };
37
+ //# sourceMappingURL=markdown-extension-HGLRVZDF.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/markdown-extension.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Prec } from '@codemirror/state';\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { MarkdownCapabilities } from '@dxos/plugin-markdown/types';\nimport { keymap } from '@dxos/ui-editor';\n\nimport { PresenterOperation } from '#types';\n\n/**\n * Contributes the present shortcut (Shift+Cmd+P) to the markdown editor so presentation\n * can be toggled while editing without relying on the global navtree keyboard context.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const capabilities = yield* Capability.Service;\n\n return Capability.contributes(MarkdownCapabilities.ExtensionProvider, [\n ({ document }) => {\n if (!document) {\n return undefined;\n }\n\n const { invokePromise } = capabilities.get(Capabilities.OperationInvoker);\n return Prec.highest(\n keymap.of([\n {\n key: 'Shift-Mod-p',\n preventDefault: true,\n stopPropagation: true,\n run: () => {\n void invokePromise(PresenterOperation.TogglePresentation, { object: document });\n return true;\n },\n },\n ]),\n );\n },\n ]);\n }),\n);\n"],
5
+ "mappings": ";;;AAIA,SAASA,YAAY;AACrB,YAAYC,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,4BAA4B;AACrC,SAASC,cAAc;AAEvB,SAASC,0BAA0B;AAMnC,IAAA,6BAAeH,WAAWI,WACjBC,kBAAW,aAAA;AAChB,QAAMC,eAAe,OAAON,WAAWO;AAEvC,SAAOP,WAAWQ,YAAYP,qBAAqBQ,mBAAmB;IACpE,CAAC,EAAEC,SAAQ,MAAE;AACX,UAAI,CAACA,UAAU;AACb,eAAOC;MACT;AAEA,YAAM,EAAEC,cAAa,IAAKN,aAAaO,IAAId,aAAae,gBAAgB;AACxE,aAAOjB,KAAKkB,QACVb,OAAOc,GAAG;QACR;UACEC,KAAK;UACLC,gBAAgB;UAChBC,iBAAiB;UACjBC,KAAK,MAAA;AACH,iBAAKR,cAAcT,mBAAmBkB,oBAAoB;cAAEC,QAAQZ;YAAS,CAAA;AAC7E,mBAAO;UACT;QACF;OACD,CAAA;IAEL;GACD;AACH,CAAA,CAAA;",
6
+ "names": ["Prec", "Effect", "Capabilities", "Capability", "MarkdownCapabilities", "keymap", "PresenterOperation", "makeModule", "fnUntraced", "capabilities", "Service", "contributes", "ExtensionProvider", "document", "undefined", "invokePromise", "get", "OperationInvoker", "highest", "of", "key", "preventDefault", "stopPropagation", "run", "TogglePresentation", "object"]
7
+ }