react-cheminfo 0.8.0 → 0.9.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/README.md +60 -2
- package/bin/check-tokens.mjs +105 -0
- package/lib/about/core/about.d.ts +95 -0
- package/lib/about/core/about.d.ts.map +1 -0
- package/lib/about/core/about.js +78 -0
- package/lib/about/core/about.js.map +1 -0
- package/lib/about/core/index.d.ts +3 -0
- package/lib/about/core/index.d.ts.map +1 -0
- package/lib/about/core/index.js +2 -0
- package/lib/about/core/index.js.map +1 -0
- package/lib/about/ui/AboutCitations.d.ts +14 -0
- package/lib/about/ui/AboutCitations.d.ts.map +1 -0
- package/lib/about/ui/AboutCitations.js +40 -0
- package/lib/about/ui/AboutCitations.js.map +1 -0
- package/lib/about/ui/AboutPage.d.ts +32 -0
- package/lib/about/ui/AboutPage.d.ts.map +1 -0
- package/lib/about/ui/AboutPage.js +70 -0
- package/lib/about/ui/AboutPage.js.map +1 -0
- package/lib/about/ui/AboutSection.d.ts +23 -0
- package/lib/about/ui/AboutSection.d.ts.map +1 -0
- package/lib/about/ui/AboutSection.js +28 -0
- package/lib/about/ui/AboutSection.js.map +1 -0
- package/lib/about/ui/index.d.ts +7 -0
- package/lib/about/ui/index.d.ts.map +1 -0
- package/lib/about/ui/index.js +4 -0
- package/lib/about/ui/index.js.map +1 -0
- package/lib/chrome/ui/index.d.ts +1 -0
- package/lib/chrome/ui/index.d.ts.map +1 -1
- package/lib/chrome/ui/index.js +3 -0
- package/lib/chrome/ui/index.js.map +1 -1
- package/lib/clipboard/ui/CodeBlock.d.ts.map +1 -1
- package/lib/clipboard/ui/CodeBlock.js +4 -1
- package/lib/clipboard/ui/CodeBlock.js.map +1 -1
- package/lib/color/ui/ColorScaleLegend.js +1 -1
- package/lib/color/ui/ColorScaleLegend.js.map +1 -1
- package/lib/core.d.ts +3 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +5 -0
- package/lib/core.js.map +1 -1
- package/lib/credits/core/credits.d.ts +36 -0
- package/lib/credits/core/credits.d.ts.map +1 -1
- package/lib/credits/core/credits.js +42 -0
- package/lib/credits/core/credits.js.map +1 -1
- package/lib/credits/ui/CreditsList.js +1 -1
- package/lib/credits/ui/CreditsList.js.map +1 -1
- package/lib/delimited/ui/DelimitedTextPanel.js +1 -1
- package/lib/delimited/ui/DelimitedTextPanel.js.map +1 -1
- package/lib/ecosystem/core/sites.d.ts +1 -1
- package/lib/ecosystem/core/sites.d.ts.map +1 -1
- package/lib/ecosystem/core/sites.js +10 -0
- package/lib/ecosystem/core/sites.js.map +1 -1
- package/lib/ecosystem/core/tokens.d.ts.map +1 -1
- package/lib/ecosystem/core/tokens.js +1 -0
- package/lib/ecosystem/core/tokens.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemLinks.js +2 -2
- package/lib/ecosystem/ui/EcosystemLinks.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemMenu.js +1 -1
- package/lib/ecosystem/ui/EcosystemMenu.js.map +1 -1
- package/lib/ecosystem/ui/SiteTile.d.ts.map +1 -1
- package/lib/ecosystem/ui/SiteTile.js +5 -5
- package/lib/ecosystem/ui/SiteTile.js.map +1 -1
- package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
- package/lib/ecosystem/ui/glyphs.js +3 -0
- package/lib/ecosystem/ui/glyphs.js.map +1 -1
- package/lib/orbital/core/index.d.ts +1 -1
- package/lib/orbital/core/index.d.ts.map +1 -1
- package/lib/orbital/core/index.js +1 -1
- package/lib/orbital/core/index.js.map +1 -1
- package/lib/orbital/core/realHarmonics.d.ts +5 -2
- package/lib/orbital/core/realHarmonics.d.ts.map +1 -1
- package/lib/orbital/core/realHarmonics.js.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts +18 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalCanvas.js +84 -7
- package/lib/orbital/ui/AtomicOrbitalCanvas.js.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalViewer.d.ts +13 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.d.ts.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalViewer.js +1 -1
- package/lib/orbital/ui/AtomicOrbitalViewer.js.map +1 -1
- package/lib/orbital/ui/camera.d.ts +15 -0
- package/lib/orbital/ui/camera.d.ts.map +1 -1
- package/lib/orbital/ui/camera.js +68 -0
- package/lib/orbital/ui/camera.js.map +1 -1
- package/lib/orbital/ui/renderVolume.d.ts.map +1 -1
- package/lib/orbital/ui/renderVolume.js +8 -1
- package/lib/orbital/ui/renderVolume.js.map +1 -1
- package/lib/orbital/ui/serial.d.ts +25 -0
- package/lib/orbital/ui/serial.d.ts.map +1 -0
- package/lib/orbital/ui/serial.js +25 -0
- package/lib/orbital/ui/serial.js.map +1 -0
- package/lib/orbital/ui/viewer.d.ts +23 -0
- package/lib/orbital/ui/viewer.d.ts.map +1 -1
- package/lib/orbital/ui/viewer.js +70 -17
- package/lib/orbital/ui/viewer.js.map +1 -1
- package/lib/pedagogy/ui/ExerciseProgressHeader.js +1 -1
- package/lib/pedagogy/ui/ExerciseProgressHeader.js.map +1 -1
- package/lib/pedagogy/ui/GlossaryText.js +2 -2
- package/lib/pedagogy/ui/GlossaryText.js.map +1 -1
- package/lib/pedagogy/ui/ReferenceSectionBlock.js +5 -2
- package/lib/pedagogy/ui/ReferenceSectionBlock.js.map +1 -1
- package/lib/pedagogy/ui/SyntaxTooltip.js +2 -2
- package/lib/pedagogy/ui/SyntaxTooltip.js.map +1 -1
- package/lib/pedagogy/ui/TutorialStepStrip.js +4 -1
- package/lib/pedagogy/ui/TutorialStepStrip.js.map +1 -1
- package/lib/periodic/ui/CategoryLegend.js +1 -1
- package/lib/periodic/ui/CategoryLegend.js.map +1 -1
- package/lib/periodic/ui/PeriodicTableChrome.js +2 -2
- package/lib/periodic/ui/PeriodicTableChrome.js.map +1 -1
- package/lib/seo/vite/ogCard.d.ts.map +1 -1
- package/lib/seo/vite/ogCard.js +1 -0
- package/lib/seo/vite/ogCard.js.map +1 -1
- package/lib/share/ui/ShareDialogContent.d.ts.map +1 -1
- package/lib/share/ui/ShareDialogContent.js +5 -2
- package/lib/share/ui/ShareDialogContent.js.map +1 -1
- package/lib/share/ui/SharePartOptions.js +1 -1
- package/lib/share/ui/SharePartOptions.js.map +1 -1
- package/lib/slides/core/demoLinks.d.ts +43 -0
- package/lib/slides/core/demoLinks.d.ts.map +1 -0
- package/lib/slides/core/demoLinks.js +104 -0
- package/lib/slides/core/demoLinks.js.map +1 -0
- package/lib/slides/core/index.d.ts +13 -0
- package/lib/slides/core/index.d.ts.map +1 -0
- package/lib/slides/core/index.js +7 -0
- package/lib/slides/core/index.js.map +1 -0
- package/lib/slides/core/sectionHeading.d.ts +19 -0
- package/lib/slides/core/sectionHeading.d.ts.map +1 -0
- package/lib/slides/core/sectionHeading.js +19 -0
- package/lib/slides/core/sectionHeading.js.map +1 -0
- package/lib/slides/core/slideNavigation.d.ts +38 -0
- package/lib/slides/core/slideNavigation.d.ts.map +1 -0
- package/lib/slides/core/slideNavigation.js +65 -0
- package/lib/slides/core/slideNavigation.js.map +1 -0
- package/lib/slides/core/talk.d.ts +82 -0
- package/lib/slides/core/talk.d.ts.map +1 -0
- package/lib/slides/core/talk.js +134 -0
- package/lib/slides/core/talk.js.map +1 -0
- package/lib/slides/core/talkManifest.d.ts +90 -0
- package/lib/slides/core/talkManifest.d.ts.map +1 -0
- package/lib/slides/core/talkManifest.js +109 -0
- package/lib/slides/core/talkManifest.js.map +1 -0
- package/lib/slides/core/talkOrigin.d.ts +50 -0
- package/lib/slides/core/talkOrigin.d.ts.map +1 -0
- package/lib/slides/core/talkOrigin.js +62 -0
- package/lib/slides/core/talkOrigin.js.map +1 -0
- package/lib/slides/ui/BackToSlides.d.ts +26 -0
- package/lib/slides/ui/BackToSlides.d.ts.map +1 -0
- package/lib/slides/ui/BackToSlides.js +24 -0
- package/lib/slides/ui/BackToSlides.js.map +1 -0
- package/lib/slides/ui/DemoLink.d.ts +42 -0
- package/lib/slides/ui/DemoLink.d.ts.map +1 -0
- package/lib/slides/ui/DemoLink.js +17 -0
- package/lib/slides/ui/DemoLink.js.map +1 -0
- package/lib/slides/ui/EmbedSlide.d.ts +19 -0
- package/lib/slides/ui/EmbedSlide.d.ts.map +1 -0
- package/lib/slides/ui/EmbedSlide.js +56 -0
- package/lib/slides/ui/EmbedSlide.js.map +1 -0
- package/lib/slides/ui/SectionSlide.d.ts +18 -0
- package/lib/slides/ui/SectionSlide.d.ts.map +1 -0
- package/lib/slides/ui/SectionSlide.js +18 -0
- package/lib/slides/ui/SectionSlide.js.map +1 -0
- package/lib/slides/ui/Slide.d.ts +52 -0
- package/lib/slides/ui/Slide.d.ts.map +1 -0
- package/lib/slides/ui/Slide.js +58 -0
- package/lib/slides/ui/Slide.js.map +1 -0
- package/lib/slides/ui/SlideBody.d.ts +32 -0
- package/lib/slides/ui/SlideBody.d.ts.map +1 -0
- package/lib/slides/ui/SlideBody.js +27 -0
- package/lib/slides/ui/SlideBody.js.map +1 -0
- package/lib/slides/ui/Slideshow.d.ts +93 -0
- package/lib/slides/ui/Slideshow.d.ts.map +1 -0
- package/lib/slides/ui/Slideshow.js +122 -0
- package/lib/slides/ui/Slideshow.js.map +1 -0
- package/lib/slides/ui/SlideshowBar.d.ts +33 -0
- package/lib/slides/ui/SlideshowBar.d.ts.map +1 -0
- package/lib/slides/ui/SlideshowBar.js +20 -0
- package/lib/slides/ui/SlideshowBar.js.map +1 -0
- package/lib/slides/ui/TalkList.d.ts +37 -0
- package/lib/slides/ui/TalkList.d.ts.map +1 -0
- package/lib/slides/ui/TalkList.js +68 -0
- package/lib/slides/ui/TalkList.js.map +1 -0
- package/lib/slides/ui/index.d.ts +19 -0
- package/lib/slides/ui/index.d.ts.map +1 -0
- package/lib/slides/ui/index.js +10 -0
- package/lib/slides/ui/index.js.map +1 -0
- package/lib/slides/vite/index.d.ts +3 -0
- package/lib/slides/vite/index.d.ts.map +1 -0
- package/lib/slides/vite/index.js +2 -0
- package/lib/slides/vite/index.js.map +1 -0
- package/lib/slides/vite/talks.d.ts +50 -0
- package/lib/slides/vite/talks.d.ts.map +1 -0
- package/lib/slides/vite/talks.js +87 -0
- package/lib/slides/vite/talks.js.map +1 -0
- package/lib/slides.d.ts +3 -0
- package/lib/slides.d.ts.map +1 -0
- package/lib/slides.js +3 -0
- package/lib/slides.js.map +1 -0
- package/lib/structure/ui/StructureEditor.js +2 -2
- package/lib/structure/ui/StructureEditor.js.map +1 -1
- package/lib/structure/ui/StructurePlaceholder.js +1 -1
- package/lib/structure/ui/StructurePlaceholder.js.map +1 -1
- package/lib/tokens/core/checkTokens.d.ts +51 -0
- package/lib/tokens/core/checkTokens.d.ts.map +1 -0
- package/lib/tokens/core/checkTokens.js +188 -0
- package/lib/tokens/core/checkTokens.js.map +1 -0
- package/lib/tokens/core/colors.d.ts +42 -0
- package/lib/tokens/core/colors.d.ts.map +1 -0
- package/lib/tokens/core/colors.js +119 -0
- package/lib/tokens/core/colors.js.map +1 -0
- package/lib/tokens/core/index.d.ts +3 -0
- package/lib/tokens/core/index.d.ts.map +1 -0
- package/lib/tokens/core/index.js +2 -0
- package/lib/tokens/core/index.js.map +1 -0
- package/lib/tokens/core/rules.d.ts +23 -0
- package/lib/tokens/core/rules.d.ts.map +1 -0
- package/lib/tokens/core/rules.js +90 -0
- package/lib/tokens/core/rules.js.map +1 -0
- package/lib/ui.d.ts +1 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +1 -0
- package/lib/ui.js.map +1 -1
- package/lib/vite.d.ts +1 -0
- package/lib/vite.d.ts.map +1 -1
- package/lib/vite.js +1 -0
- package/lib/vite.js.map +1 -1
- package/package.json +11 -3
- package/src/about/core/about.ts +176 -0
- package/src/about/core/index.ts +2 -0
- package/src/about/ui/AboutCitations.tsx +79 -0
- package/src/about/ui/AboutPage.tsx +177 -0
- package/src/about/ui/AboutSection.tsx +56 -0
- package/src/about/ui/index.ts +6 -0
- package/src/chrome/ui/index.ts +3 -0
- package/src/clipboard/ui/CodeBlock.tsx +4 -1
- package/src/color/ui/ColorScaleLegend.tsx +1 -1
- package/src/core.ts +5 -0
- package/src/credits/core/credits.ts +42 -0
- package/src/credits/ui/CreditsList.tsx +1 -1
- package/src/delimited/ui/DelimitedTextPanel.tsx +1 -1
- package/src/ecosystem/core/sites.ts +12 -0
- package/src/ecosystem/core/tokens.ts +1 -0
- package/src/ecosystem/ui/EcosystemLinks.tsx +2 -2
- package/src/ecosystem/ui/EcosystemMenu.tsx +1 -1
- package/src/ecosystem/ui/SiteTile.tsx +7 -5
- package/src/ecosystem/ui/glyphs.tsx +40 -0
- package/src/orbital/core/index.ts +4 -1
- package/src/orbital/core/realHarmonics.ts +5 -2
- package/src/orbital/ui/AtomicOrbitalCanvas.tsx +126 -4
- package/src/orbital/ui/AtomicOrbitalViewer.tsx +14 -1
- package/src/orbital/ui/camera.ts +81 -0
- package/src/orbital/ui/renderVolume.ts +8 -1
- package/src/orbital/ui/serial.ts +35 -0
- package/src/orbital/ui/viewer.ts +72 -13
- package/src/pedagogy/ui/ExerciseProgressHeader.tsx +1 -1
- package/src/pedagogy/ui/GlossaryText.tsx +2 -2
- package/src/pedagogy/ui/ReferenceSectionBlock.tsx +5 -2
- package/src/pedagogy/ui/SyntaxTooltip.tsx +2 -2
- package/src/pedagogy/ui/TutorialStepStrip.tsx +4 -1
- package/src/periodic/ui/CategoryLegend.tsx +1 -1
- package/src/periodic/ui/PeriodicTableChrome.tsx +2 -2
- package/src/seo/vite/ogCard.ts +1 -0
- package/src/share/ui/ShareDialogContent.tsx +5 -2
- package/src/share/ui/SharePartOptions.tsx +1 -1
- package/src/slides/core/demoLinks.ts +113 -0
- package/src/slides/core/index.ts +22 -0
- package/src/slides/core/sectionHeading.ts +29 -0
- package/src/slides/core/slideNavigation.ts +77 -0
- package/src/slides/core/talk.ts +203 -0
- package/src/slides/core/talkManifest.ts +158 -0
- package/src/slides/core/talkOrigin.ts +83 -0
- package/src/slides/ui/BackToSlides.tsx +49 -0
- package/src/slides/ui/DemoLink.tsx +67 -0
- package/src/slides/ui/EmbedSlide.tsx +85 -0
- package/src/slides/ui/SectionSlide.tsx +44 -0
- package/src/slides/ui/Slide.tsx +143 -0
- package/src/slides/ui/SlideBody.tsx +64 -0
- package/src/slides/ui/Slideshow.tsx +282 -0
- package/src/slides/ui/SlideshowBar.tsx +83 -0
- package/src/slides/ui/TalkList.tsx +146 -0
- package/src/slides/ui/index.ts +18 -0
- package/src/slides/vite/index.ts +2 -0
- package/src/slides/vite/talks.ts +126 -0
- package/src/slides.ts +2 -0
- package/src/structure/ui/StructureEditor.tsx +2 -2
- package/src/structure/ui/StructurePlaceholder.tsx +1 -1
- package/src/tokens/core/checkTokens.ts +242 -0
- package/src/tokens/core/colors.ts +122 -0
- package/src/tokens/core/index.ts +6 -0
- package/src/tokens/core/rules.ts +103 -0
- package/src/ui.ts +1 -0
- package/src/vite.ts +1 -0
- package/styles/chrome.css +1 -0
- package/styles/slides.css +667 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type { DemoLinkSpec } from './demoLinks.ts';
|
|
2
|
+
export { demoLabel, parseSingleLink, splitDemoLinks } from './demoLinks.ts';
|
|
3
|
+
export type { SectionHeading } from './sectionHeading.ts';
|
|
4
|
+
export { parseSectionHeading } from './sectionHeading.ts';
|
|
5
|
+
export type { SlideAction } from './slideNavigation.ts';
|
|
6
|
+
export { clampSlideIndex, slideActionForKey } from './slideNavigation.ts';
|
|
7
|
+
export type { Slide, Talk, TalkMeta } from './talk.ts';
|
|
8
|
+
export { parseTalk } from './talk.ts';
|
|
9
|
+
export type { TalkManifest, TalkSummary } from './talkManifest.ts';
|
|
10
|
+
export { buildTalkManifest, parseTalkManifest, talkSourceUrl, talkSummary, } from './talkManifest.ts';
|
|
11
|
+
export type { TalkOrigin } from './talkOrigin.ts';
|
|
12
|
+
export { TALK_ORIGIN_PARAM, formatTalkOrigin, parseTalkOrigin, withTalkOrigin, } from './talkOrigin.ts';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/slides/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC5E,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,cAAc,GACf,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { demoLabel, parseSingleLink, splitDemoLinks } from "./demoLinks.js";
|
|
2
|
+
export { parseSectionHeading } from "./sectionHeading.js";
|
|
3
|
+
export { clampSlideIndex, slideActionForKey } from "./slideNavigation.js";
|
|
4
|
+
export { parseTalk } from "./talk.js";
|
|
5
|
+
export { buildTalkManifest, parseTalkManifest, talkSourceUrl, talkSummary, } from "./talkManifest.js";
|
|
6
|
+
export { TALK_ORIGIN_PARAM, formatTalkOrigin, parseTalkOrigin, withTalkOrigin, } from "./talkOrigin.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/slides/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,cAAc,GACf,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** The parts of a section divider's heading. */
|
|
2
|
+
export interface SectionHeading {
|
|
3
|
+
/** The section number, as written; empty when the heading carries none. */
|
|
4
|
+
number: string;
|
|
5
|
+
/** The section title, without its number; empty when the heading carries none. */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Whatever the body holds besides that heading. */
|
|
8
|
+
rest: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Split a section-divider body into its leading number, its title and the rest
|
|
12
|
+
* of the Markdown, so a template can set the number apart from the title.
|
|
13
|
+
* `·`, `.`, `:`, `—` and `-` all separate the two.
|
|
14
|
+
* @param body - Markdown body, normally starting with `# N · Title`.
|
|
15
|
+
* @returns The parsed heading; a body with no numbered heading keeps all of
|
|
16
|
+
* itself in `rest`, leaving `number` and `title` empty.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseSectionHeading(body: string): SectionHeading;
|
|
19
|
+
//# sourceMappingURL=sectionHeading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sectionHeading.d.ts","sourceRoot":"","sources":["../../../src/slides/core/sectionHeading.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAQhE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split a section-divider body into its leading number, its title and the rest
|
|
3
|
+
* of the Markdown, so a template can set the number apart from the title.
|
|
4
|
+
* `·`, `.`, `:`, `—` and `-` all separate the two.
|
|
5
|
+
* @param body - Markdown body, normally starting with `# N · Title`.
|
|
6
|
+
* @returns The parsed heading; a body with no numbered heading keeps all of
|
|
7
|
+
* itself in `rest`, leaving `number` and `title` empty.
|
|
8
|
+
*/
|
|
9
|
+
export function parseSectionHeading(body) {
|
|
10
|
+
const match = HEAD_RE.exec(body);
|
|
11
|
+
const number = match?.groups?.number;
|
|
12
|
+
const title = match?.groups?.title;
|
|
13
|
+
if (match === null || number === undefined || title === undefined) {
|
|
14
|
+
return { number: '', title: '', rest: body.trim() };
|
|
15
|
+
}
|
|
16
|
+
return { number, title, rest: body.replace(match[0], '').trim() };
|
|
17
|
+
}
|
|
18
|
+
const HEAD_RE = /^#\s+(?<number>\d+)\s*[.:·—-]\s*(?<title>.+?)\s*$/m;
|
|
19
|
+
//# sourceMappingURL=sectionHeading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sectionHeading.js","sourceRoot":"","sources":["../../../src/slides/core/sectionHeading.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IACrC,MAAM,KAAK,GAAG,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;IACnC,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAClE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;IACtD,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;AACpE,CAAC;AAED,MAAM,OAAO,GAAG,oDAAoD,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a key does during a presentation, decided without a DOM.
|
|
3
|
+
*
|
|
4
|
+
* The current slide lives in the address, so it arrives as whatever a link
|
|
5
|
+
* carried — a missing number, a negative one, one past the end of a talk that
|
|
6
|
+
* has since been shortened. Every move is therefore clamped here rather than
|
|
7
|
+
* trusted, and the player only ever renders a slide that exists.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The slide a requested index resolves to.
|
|
11
|
+
* @param index - The index asked for, from a link or a keystroke.
|
|
12
|
+
* @param total - How many slides the talk holds.
|
|
13
|
+
* @returns A zero-based index that exists, or `0` for a talk with no slides.
|
|
14
|
+
*/
|
|
15
|
+
export declare function clampSlideIndex(index: number, total: number): number;
|
|
16
|
+
/** What a key press asks the player to do. */
|
|
17
|
+
export type SlideAction = {
|
|
18
|
+
kind: 'go';
|
|
19
|
+
index: number;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'blank';
|
|
22
|
+
color: 'black' | 'white';
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'fullscreen';
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'notes';
|
|
27
|
+
} | null;
|
|
28
|
+
/**
|
|
29
|
+
* The action a key press means, with every move already clamped: stepping past
|
|
30
|
+
* the last slide, or back from the first, stays on the slide it is on rather
|
|
31
|
+
* than leaving the talk.
|
|
32
|
+
* @param key - The `key` of the keyboard event.
|
|
33
|
+
* @param index - Which slide is showing.
|
|
34
|
+
* @param total - How many slides the talk holds.
|
|
35
|
+
* @returns The action, or `null` when the key means nothing here.
|
|
36
|
+
*/
|
|
37
|
+
export declare function slideActionForKey(key: string, index: number, total: number): SlideAction;
|
|
38
|
+
//# sourceMappingURL=slideNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slideNavigation.d.ts","sourceRoot":"","sources":["../../../src/slides/core/slideNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAKpE;AAED,8CAA8C;AAC9C,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB,IAAI,CAAC;AAET;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,WAAW,CAkBb"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a key does during a presentation, decided without a DOM.
|
|
3
|
+
*
|
|
4
|
+
* The current slide lives in the address, so it arrives as whatever a link
|
|
5
|
+
* carried — a missing number, a negative one, one past the end of a talk that
|
|
6
|
+
* has since been shortened. Every move is therefore clamped here rather than
|
|
7
|
+
* trusted, and the player only ever renders a slide that exists.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The slide a requested index resolves to.
|
|
11
|
+
* @param index - The index asked for, from a link or a keystroke.
|
|
12
|
+
* @param total - How many slides the talk holds.
|
|
13
|
+
* @returns A zero-based index that exists, or `0` for a talk with no slides.
|
|
14
|
+
*/
|
|
15
|
+
export function clampSlideIndex(index, total) {
|
|
16
|
+
if (!Number.isFinite(total) || total < 1)
|
|
17
|
+
return 0;
|
|
18
|
+
if (Number.isNaN(index) || index < 0)
|
|
19
|
+
return 0;
|
|
20
|
+
const last = total - 1;
|
|
21
|
+
return index > last ? last : Math.trunc(index);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The action a key press means, with every move already clamped: stepping past
|
|
25
|
+
* the last slide, or back from the first, stays on the slide it is on rather
|
|
26
|
+
* than leaving the talk.
|
|
27
|
+
* @param key - The `key` of the keyboard event.
|
|
28
|
+
* @param index - Which slide is showing.
|
|
29
|
+
* @param total - How many slides the talk holds.
|
|
30
|
+
* @returns The action, or `null` when the key means nothing here.
|
|
31
|
+
*/
|
|
32
|
+
export function slideActionForKey(key, index, total) {
|
|
33
|
+
switch (key) {
|
|
34
|
+
case 'ArrowRight':
|
|
35
|
+
case 'ArrowDown':
|
|
36
|
+
case 'PageDown':
|
|
37
|
+
case ' ':
|
|
38
|
+
return { kind: 'go', index: clampSlideIndex(index + 1, total) };
|
|
39
|
+
case 'ArrowLeft':
|
|
40
|
+
case 'ArrowUp':
|
|
41
|
+
case 'PageUp':
|
|
42
|
+
return { kind: 'go', index: clampSlideIndex(index - 1, total) };
|
|
43
|
+
case 'Home':
|
|
44
|
+
return { kind: 'go', index: 0 };
|
|
45
|
+
case 'End':
|
|
46
|
+
return { kind: 'go', index: clampSlideIndex(total - 1, total) };
|
|
47
|
+
default:
|
|
48
|
+
return letterAction(key);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function letterAction(key) {
|
|
52
|
+
switch (key.toLowerCase()) {
|
|
53
|
+
case 'f':
|
|
54
|
+
return { kind: 'fullscreen' };
|
|
55
|
+
case 'b':
|
|
56
|
+
return { kind: 'blank', color: 'black' };
|
|
57
|
+
case 'w':
|
|
58
|
+
return { kind: 'blank', color: 'white' };
|
|
59
|
+
case 'n':
|
|
60
|
+
return { kind: 'notes' };
|
|
61
|
+
default:
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=slideNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slideNavigation.js","sourceRoot":"","sources":["../../../src/slides/core/slideNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,KAAa;IAC1D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC;IACnD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC;IACvB,OAAO,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC;AAUD;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAAW,EACX,KAAa,EACb,KAAa;IAEb,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,YAAY,CAAC;QAClB,KAAK,WAAW,CAAC;QACjB,KAAK,UAAU,CAAC;QAChB,KAAK,GAAG;YACN,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAClE,KAAK,WAAW,CAAC;QACjB,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAClE,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAClC,KAAK,KAAK;YACR,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAClE;YACE,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,GAAW;IAC/B,QAAQ,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC;QAC1B,KAAK,GAAG;YACN,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;QAChC,KAAK,GAAG;YACN,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAC3C,KAAK,GAAG;YACN,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAC3C,KAAK,GAAG;YACN,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC3B;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The talk format: one Markdown file is one talk, and this reads it.
|
|
3
|
+
*
|
|
4
|
+
* A talk is authored as prose rather than as data — an optional front-matter
|
|
5
|
+
* block, then slides separated by a `---` line. Which template draws a slide is
|
|
6
|
+
* a comment the author writes, and the name is deliberately not a closed list:
|
|
7
|
+
* every site registers the layouts it knows how to draw.
|
|
8
|
+
*/
|
|
9
|
+
/** Talk-level metadata, read from the front-matter block. */
|
|
10
|
+
export interface TalkMeta {
|
|
11
|
+
/** Talk title, shown on the title slide and in a talk index. */
|
|
12
|
+
title: string;
|
|
13
|
+
/**
|
|
14
|
+
* A second line under the title.
|
|
15
|
+
* @default undefined
|
|
16
|
+
*/
|
|
17
|
+
subtitle?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Conference or event the talk was given at.
|
|
20
|
+
* @default undefined
|
|
21
|
+
*/
|
|
22
|
+
event?: string;
|
|
23
|
+
/**
|
|
24
|
+
* When it was given, as an ISO date (`YYYY-MM-DD`).
|
|
25
|
+
* @default undefined
|
|
26
|
+
*/
|
|
27
|
+
date?: string;
|
|
28
|
+
/**
|
|
29
|
+
* City or venue.
|
|
30
|
+
* @default undefined
|
|
31
|
+
*/
|
|
32
|
+
location?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Who presented it.
|
|
35
|
+
* @default undefined
|
|
36
|
+
*/
|
|
37
|
+
author?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Logo image URLs shown on the title slide, written comma-separated in the
|
|
40
|
+
* front-matter.
|
|
41
|
+
* @default undefined
|
|
42
|
+
*/
|
|
43
|
+
logos?: string[];
|
|
44
|
+
/**
|
|
45
|
+
* One sentence about the talk, for a listing or a page description.
|
|
46
|
+
* @default undefined
|
|
47
|
+
*/
|
|
48
|
+
description?: string;
|
|
49
|
+
}
|
|
50
|
+
/** One slide of a talk. */
|
|
51
|
+
export interface Slide {
|
|
52
|
+
/**
|
|
53
|
+
* Which template draws the body. A site maps these names to its own
|
|
54
|
+
* components, so any lowercase identifier is accepted here.
|
|
55
|
+
*/
|
|
56
|
+
layout: string;
|
|
57
|
+
/** The Markdown body, with the layout marker and the notes comment removed. */
|
|
58
|
+
body: string;
|
|
59
|
+
/**
|
|
60
|
+
* What the presenter says over this slide, never drawn on it.
|
|
61
|
+
* @default undefined
|
|
62
|
+
*/
|
|
63
|
+
notes?: string;
|
|
64
|
+
}
|
|
65
|
+
/** A whole talk: its metadata and its slides, in order. */
|
|
66
|
+
export interface Talk {
|
|
67
|
+
/** What the front-matter said about the talk. */
|
|
68
|
+
meta: TalkMeta;
|
|
69
|
+
/** The slides, in the order they are presented. */
|
|
70
|
+
slides: Slide[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Parse a talk written in Markdown into its metadata and its slides.
|
|
74
|
+
*
|
|
75
|
+
* The source is read defensively: CRLF endings, a missing front-matter block,
|
|
76
|
+
* an empty file and a slide holding nothing but whitespace all resolve to
|
|
77
|
+
* something a player can render rather than to an error.
|
|
78
|
+
* @param source - The raw Markdown talk source.
|
|
79
|
+
* @returns The parsed talk; an empty source yields an untitled talk with no slides.
|
|
80
|
+
*/
|
|
81
|
+
export declare function parseTalk(source: string): Talk;
|
|
82
|
+
//# sourceMappingURL=talk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"talk.d.ts","sourceRoot":"","sources":["../../../src/slides/core/talk.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,6DAA6D;AAC7D,MAAM,WAAW,QAAQ;IACvB,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,2BAA2B;AAC3B,MAAM,WAAW,KAAK;IACpB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,2DAA2D;AAC3D,MAAM,WAAW,IAAI;IACnB,iDAAiD;IACjD,IAAI,EAAE,QAAQ,CAAC;IACf,mDAAmD;IACnD,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAQ9C"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The talk format: one Markdown file is one talk, and this reads it.
|
|
3
|
+
*
|
|
4
|
+
* A talk is authored as prose rather than as data — an optional front-matter
|
|
5
|
+
* block, then slides separated by a `---` line. Which template draws a slide is
|
|
6
|
+
* a comment the author writes, and the name is deliberately not a closed list:
|
|
7
|
+
* every site registers the layouts it knows how to draw.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Parse a talk written in Markdown into its metadata and its slides.
|
|
11
|
+
*
|
|
12
|
+
* The source is read defensively: CRLF endings, a missing front-matter block,
|
|
13
|
+
* an empty file and a slide holding nothing but whitespace all resolve to
|
|
14
|
+
* something a player can render rather than to an error.
|
|
15
|
+
* @param source - The raw Markdown talk source.
|
|
16
|
+
* @returns The parsed talk; an empty source yields an untitled talk with no slides.
|
|
17
|
+
*/
|
|
18
|
+
export function parseTalk(source) {
|
|
19
|
+
const normalized = source.replaceAll(/\r\n?/g, '\n');
|
|
20
|
+
const { meta, body } = extractFrontMatter(normalized);
|
|
21
|
+
const slides = [];
|
|
22
|
+
for (const chunk of splitSlides(body)) {
|
|
23
|
+
slides.push(toSlide(chunk));
|
|
24
|
+
}
|
|
25
|
+
return { meta, slides };
|
|
26
|
+
}
|
|
27
|
+
function extractFrontMatter(source) {
|
|
28
|
+
const lines = source.split('\n');
|
|
29
|
+
let index = 0;
|
|
30
|
+
while (index < lines.length && lines[index]?.trim() === '')
|
|
31
|
+
index++;
|
|
32
|
+
if (lines[index]?.trim() !== '---') {
|
|
33
|
+
return { meta: { title: '' }, body: source };
|
|
34
|
+
}
|
|
35
|
+
index++;
|
|
36
|
+
const metaLines = [];
|
|
37
|
+
while (index < lines.length && lines[index]?.trim() !== '---') {
|
|
38
|
+
metaLines.push(lines[index] ?? '');
|
|
39
|
+
index++;
|
|
40
|
+
}
|
|
41
|
+
index++;
|
|
42
|
+
return { meta: parseMeta(metaLines), body: lines.slice(index).join('\n') };
|
|
43
|
+
}
|
|
44
|
+
function parseMeta(metaLines) {
|
|
45
|
+
const meta = { title: '' };
|
|
46
|
+
for (const line of metaLines) {
|
|
47
|
+
const match = META_RE.exec(line);
|
|
48
|
+
const key = match?.groups?.key?.toLowerCase();
|
|
49
|
+
const value = match?.groups?.value?.trim();
|
|
50
|
+
if (key === undefined || value === undefined)
|
|
51
|
+
continue;
|
|
52
|
+
if (key === 'logos') {
|
|
53
|
+
meta.logos = splitLogos(value);
|
|
54
|
+
}
|
|
55
|
+
else if (TEXT_KEYS.has(key)) {
|
|
56
|
+
meta[key] = value;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return meta;
|
|
60
|
+
}
|
|
61
|
+
function splitLogos(value) {
|
|
62
|
+
const logos = [];
|
|
63
|
+
for (const logo of value.split(',')) {
|
|
64
|
+
const trimmed = logo.trim();
|
|
65
|
+
if (trimmed !== '')
|
|
66
|
+
logos.push(trimmed);
|
|
67
|
+
}
|
|
68
|
+
return logos;
|
|
69
|
+
}
|
|
70
|
+
function splitSlides(body) {
|
|
71
|
+
const chunks = [[]];
|
|
72
|
+
for (const line of body.split('\n')) {
|
|
73
|
+
if (SEPARATOR_RE.test(line)) {
|
|
74
|
+
chunks.push([]);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
chunks.at(-1)?.push(line);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const slides = [];
|
|
81
|
+
for (const chunk of chunks) {
|
|
82
|
+
const text = chunk.join('\n').trim();
|
|
83
|
+
if (text !== '')
|
|
84
|
+
slides.push(text);
|
|
85
|
+
}
|
|
86
|
+
return slides;
|
|
87
|
+
}
|
|
88
|
+
function toSlide(chunk) {
|
|
89
|
+
const layoutMatch = LAYOUT_RE.exec(chunk);
|
|
90
|
+
const { body, notes } = extractNotes(chunk.replace(LAYOUT_RE, ''));
|
|
91
|
+
const layout = layoutMatch?.groups?.layout?.toLowerCase() ?? detectLayout(body);
|
|
92
|
+
const slide = { layout, body };
|
|
93
|
+
if (notes !== '')
|
|
94
|
+
slide.notes = notes;
|
|
95
|
+
return slide;
|
|
96
|
+
}
|
|
97
|
+
function extractNotes(chunk) {
|
|
98
|
+
const notes = [];
|
|
99
|
+
for (const match of chunk.matchAll(NOTES_RE)) {
|
|
100
|
+
const text = match.groups?.notes?.trim();
|
|
101
|
+
if (text !== undefined && text !== '')
|
|
102
|
+
notes.push(text);
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
body: chunk.replaceAll(NOTES_RE, '').trim(),
|
|
106
|
+
notes: notes.join('\n\n'),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function detectLayout(body) {
|
|
110
|
+
let headings = 0;
|
|
111
|
+
for (const line of body.split('\n')) {
|
|
112
|
+
const trimmed = line.trim();
|
|
113
|
+
if (trimmed === '')
|
|
114
|
+
continue;
|
|
115
|
+
if (!trimmed.startsWith('#'))
|
|
116
|
+
return 'content';
|
|
117
|
+
headings++;
|
|
118
|
+
}
|
|
119
|
+
return headings > 0 ? 'title' : 'content';
|
|
120
|
+
}
|
|
121
|
+
const TEXT_KEYS = new Set([
|
|
122
|
+
'title',
|
|
123
|
+
'subtitle',
|
|
124
|
+
'event',
|
|
125
|
+
'date',
|
|
126
|
+
'location',
|
|
127
|
+
'author',
|
|
128
|
+
'description',
|
|
129
|
+
]);
|
|
130
|
+
const LAYOUT_RE = /<!--\s*layout:\s*(?<layout>[a-z][\da-z-]*)\s*-->/i;
|
|
131
|
+
const NOTES_RE = /<!--\s*notes:\s*(?<notes>.*?)-->/gis;
|
|
132
|
+
const SEPARATOR_RE = /^---[\t ]*$/;
|
|
133
|
+
const META_RE = /^(?<key>[a-z]+)\s*:\s*(?<value>.+)$/i;
|
|
134
|
+
//# sourceMappingURL=talk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"talk.js","sourceRoot":"","sources":["../../../src/slides/core/talk.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAoEH;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACrD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACtD,MAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QACtC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAc;IACxC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,OAAO,KAAK,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE;QAAE,KAAK,EAAE,CAAC;IACpE,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,KAAK,EAAE,CAAC;QACnC,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,IAA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AAC5C,CAAC;AAKD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAS;IAChC,OAAO;IACP,UAAU;IACV,OAAO;IACP,MAAM;IACN,UAAU;IACV,QAAQ;IACR,aAAa;CACd,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,mDAAmD,CAAC;AACtE,MAAM,QAAQ,GAAG,qCAAqC,CAAC;AACvD,MAAM,YAAY,GAAG,aAAa,CAAC;AACnC,MAAM,OAAO,GAAG,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Talk } from './talk.ts';
|
|
2
|
+
/**
|
|
3
|
+
* How one site publishes its talks so another can list them.
|
|
4
|
+
*
|
|
5
|
+
* The talks themselves are Markdown files served by the site that gave them;
|
|
6
|
+
* a manifest is the small JSON index a sibling site fetches to show them
|
|
7
|
+
* without holding a copy. It is read tolerantly, because the site fetching it
|
|
8
|
+
* has no control over the version of the file it gets.
|
|
9
|
+
*/
|
|
10
|
+
/** One talk, as a listing shows it. */
|
|
11
|
+
export interface TalkSummary {
|
|
12
|
+
/** How the publishing site names the talk in its addresses. */
|
|
13
|
+
id: string;
|
|
14
|
+
/** The talk title. */
|
|
15
|
+
title: string;
|
|
16
|
+
/**
|
|
17
|
+
* A second line under the title.
|
|
18
|
+
* @default undefined
|
|
19
|
+
*/
|
|
20
|
+
subtitle?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Conference or event it was given at.
|
|
23
|
+
* @default undefined
|
|
24
|
+
*/
|
|
25
|
+
event?: string;
|
|
26
|
+
/**
|
|
27
|
+
* When it was given, as an ISO date (`YYYY-MM-DD`).
|
|
28
|
+
* @default undefined
|
|
29
|
+
*/
|
|
30
|
+
date?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Who presented it.
|
|
33
|
+
* @default undefined
|
|
34
|
+
*/
|
|
35
|
+
author?: string;
|
|
36
|
+
/** How many slides it holds. */
|
|
37
|
+
slideCount: number;
|
|
38
|
+
}
|
|
39
|
+
/** Every talk one site publishes. */
|
|
40
|
+
export interface TalkManifest {
|
|
41
|
+
/** The `ECOSYSTEM_SITES` id of the site that gave the talks. */
|
|
42
|
+
site: string;
|
|
43
|
+
/** Where that site is served from, as `https://host`. */
|
|
44
|
+
origin: string;
|
|
45
|
+
/** The talks, in the order the site lists them. */
|
|
46
|
+
talks: TalkSummary[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The listing entry for one parsed talk.
|
|
50
|
+
* @param id - How the site names the talk in its addresses.
|
|
51
|
+
* @param talk - The parsed talk.
|
|
52
|
+
* @returns Its summary, carrying only the metadata a listing shows.
|
|
53
|
+
*/
|
|
54
|
+
export declare function talkSummary(id: string, talk: Talk): TalkSummary;
|
|
55
|
+
/**
|
|
56
|
+
* Build the manifest a site publishes.
|
|
57
|
+
* @param input - The site, where it is served from, and its parsed talks.
|
|
58
|
+
* @param input.site - The `ECOSYSTEM_SITES` id of the publishing site.
|
|
59
|
+
* @param input.origin - Where that site is served from, as `https://host`.
|
|
60
|
+
* @param input.talks - The talks, each with the id the site names it by.
|
|
61
|
+
* @returns The manifest, ready to be written as JSON.
|
|
62
|
+
*/
|
|
63
|
+
export declare function buildTalkManifest(input: {
|
|
64
|
+
/** The `ECOSYSTEM_SITES` id of the publishing site. */
|
|
65
|
+
site: string;
|
|
66
|
+
/** Where that site is served from, as `https://host`. */
|
|
67
|
+
origin: string;
|
|
68
|
+
/** The talks, each with the id the site names it by. */
|
|
69
|
+
talks: ReadonlyArray<{
|
|
70
|
+
id: string;
|
|
71
|
+
} & Talk>;
|
|
72
|
+
}): TalkManifest;
|
|
73
|
+
/**
|
|
74
|
+
* Read a manifest a sibling site published.
|
|
75
|
+
*
|
|
76
|
+
* Unknown keys are ignored and an entry missing what a listing needs is
|
|
77
|
+
* dropped, so a site running an older or newer version of the format still
|
|
78
|
+
* lists whatever it can understand instead of showing nothing.
|
|
79
|
+
* @param value - The parsed JSON, of unknown shape.
|
|
80
|
+
* @returns The manifest, or `null` when the value is not one.
|
|
81
|
+
*/
|
|
82
|
+
export declare function parseTalkManifest(value: unknown): TalkManifest | null;
|
|
83
|
+
/**
|
|
84
|
+
* Where the Markdown source of one talk of a manifest is served.
|
|
85
|
+
* @param manifest - The manifest naming the publishing site.
|
|
86
|
+
* @param id - Which talk.
|
|
87
|
+
* @returns The absolute URL of the talk source.
|
|
88
|
+
*/
|
|
89
|
+
export declare function talkSourceUrl(manifest: TalkManifest, id: string): string;
|
|
90
|
+
//# sourceMappingURL=talkManifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"talkManifest.d.ts","sourceRoot":"","sources":["../../../src/slides/core/talkManifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;;GAOG;AAEH,uCAAuC;AACvC,MAAM,WAAW,WAAW;IAC1B,+DAA+D;IAC/D,EAAE,EAAE,MAAM,CAAC;IACX,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qCAAqC;AACrC,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,WAAW,CAW/D;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,KAAK,EAAE,aAAa,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;CAC7C,GAAG,YAAY,CAMf;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI,CAarE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAExE"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The listing entry for one parsed talk.
|
|
3
|
+
* @param id - How the site names the talk in its addresses.
|
|
4
|
+
* @param talk - The parsed talk.
|
|
5
|
+
* @returns Its summary, carrying only the metadata a listing shows.
|
|
6
|
+
*/
|
|
7
|
+
export function talkSummary(id, talk) {
|
|
8
|
+
const summary = {
|
|
9
|
+
id,
|
|
10
|
+
title: talk.meta.title,
|
|
11
|
+
slideCount: talk.slides.length,
|
|
12
|
+
};
|
|
13
|
+
if (talk.meta.subtitle !== undefined)
|
|
14
|
+
summary.subtitle = talk.meta.subtitle;
|
|
15
|
+
if (talk.meta.event !== undefined)
|
|
16
|
+
summary.event = talk.meta.event;
|
|
17
|
+
if (talk.meta.date !== undefined)
|
|
18
|
+
summary.date = talk.meta.date;
|
|
19
|
+
if (talk.meta.author !== undefined)
|
|
20
|
+
summary.author = talk.meta.author;
|
|
21
|
+
return summary;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Build the manifest a site publishes.
|
|
25
|
+
* @param input - The site, where it is served from, and its parsed talks.
|
|
26
|
+
* @param input.site - The `ECOSYSTEM_SITES` id of the publishing site.
|
|
27
|
+
* @param input.origin - Where that site is served from, as `https://host`.
|
|
28
|
+
* @param input.talks - The talks, each with the id the site names it by.
|
|
29
|
+
* @returns The manifest, ready to be written as JSON.
|
|
30
|
+
*/
|
|
31
|
+
export function buildTalkManifest(input) {
|
|
32
|
+
const talks = [];
|
|
33
|
+
for (const talk of input.talks) {
|
|
34
|
+
talks.push(talkSummary(talk.id, talk));
|
|
35
|
+
}
|
|
36
|
+
return { site: input.site, origin: input.origin, talks };
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Read a manifest a sibling site published.
|
|
40
|
+
*
|
|
41
|
+
* Unknown keys are ignored and an entry missing what a listing needs is
|
|
42
|
+
* dropped, so a site running an older or newer version of the format still
|
|
43
|
+
* lists whatever it can understand instead of showing nothing.
|
|
44
|
+
* @param value - The parsed JSON, of unknown shape.
|
|
45
|
+
* @returns The manifest, or `null` when the value is not one.
|
|
46
|
+
*/
|
|
47
|
+
export function parseTalkManifest(value) {
|
|
48
|
+
if (typeof value !== 'object' || value === null)
|
|
49
|
+
return null;
|
|
50
|
+
const record = value;
|
|
51
|
+
const site = text(record.site);
|
|
52
|
+
const origin = text(record.origin);
|
|
53
|
+
if (site === undefined || origin === undefined)
|
|
54
|
+
return null;
|
|
55
|
+
if (!Array.isArray(record.talks))
|
|
56
|
+
return null;
|
|
57
|
+
const talks = [];
|
|
58
|
+
for (const entry of record.talks) {
|
|
59
|
+
const summary = parseSummary(entry);
|
|
60
|
+
if (summary !== null)
|
|
61
|
+
talks.push(summary);
|
|
62
|
+
}
|
|
63
|
+
return { site, origin, talks };
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Where the Markdown source of one talk of a manifest is served.
|
|
67
|
+
* @param manifest - The manifest naming the publishing site.
|
|
68
|
+
* @param id - Which talk.
|
|
69
|
+
* @returns The absolute URL of the talk source.
|
|
70
|
+
*/
|
|
71
|
+
export function talkSourceUrl(manifest, id) {
|
|
72
|
+
return `${manifest.origin.replace(TRAILING_SLASHES, '')}/talks/${id}.md`;
|
|
73
|
+
}
|
|
74
|
+
function parseSummary(value) {
|
|
75
|
+
if (typeof value !== 'object' || value === null)
|
|
76
|
+
return null;
|
|
77
|
+
const record = value;
|
|
78
|
+
const id = text(record.id);
|
|
79
|
+
const title = text(record.title);
|
|
80
|
+
const slideCount = record.slideCount;
|
|
81
|
+
if (id === undefined || title === undefined)
|
|
82
|
+
return null;
|
|
83
|
+
if (typeof slideCount !== 'number' || !Number.isFinite(slideCount)) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const summary = {
|
|
87
|
+
id,
|
|
88
|
+
title,
|
|
89
|
+
slideCount: Math.max(Math.trunc(slideCount), 0),
|
|
90
|
+
};
|
|
91
|
+
const subtitle = text(record.subtitle);
|
|
92
|
+
const event = text(record.event);
|
|
93
|
+
const date = text(record.date);
|
|
94
|
+
const author = text(record.author);
|
|
95
|
+
if (subtitle !== undefined)
|
|
96
|
+
summary.subtitle = subtitle;
|
|
97
|
+
if (event !== undefined)
|
|
98
|
+
summary.event = event;
|
|
99
|
+
if (date !== undefined)
|
|
100
|
+
summary.date = date;
|
|
101
|
+
if (author !== undefined)
|
|
102
|
+
summary.author = author;
|
|
103
|
+
return summary;
|
|
104
|
+
}
|
|
105
|
+
function text(value) {
|
|
106
|
+
return typeof value === 'string' && value !== '' ? value : undefined;
|
|
107
|
+
}
|
|
108
|
+
const TRAILING_SLASHES = /\/+$/;
|
|
109
|
+
//# sourceMappingURL=talkManifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"talkManifest.js","sourceRoot":"","sources":["../../../src/slides/core/talkManifest.ts"],"names":[],"mappings":"AAmDA;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAAU,EAAE,IAAU;IAChD,MAAM,OAAO,GAAgB;QAC3B,EAAE;QACF,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK;QACtB,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;KAC/B,CAAC;IACF,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS;QA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