@flipbook-md/core 0.14.1 → 0.16.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 CHANGED
@@ -1,12 +1,14 @@
1
1
  # @flipbook-md/core
2
2
 
3
- The shared library behind [Flipbook MD](https://github.com/uminocelo/flipbook-md). It loads Markdown decks, applies templates, groups, themes and blueprints, serves the slide player, and exports PNG carousels and MP4 videos.
3
+ ![Flipbook Core](docs/logo.svg)
4
+
5
+ The shared library behind [Flipbook MD](https://github.com/FlipbookMD-HQ/flipbook-md). It loads Markdown decks, applies templates, groups, themes and blueprints, serves the slide player, and exports PNG carousels and MP4 videos.
4
6
 
5
7
  It is one of three Flipbook MD projects:
6
8
 
7
9
  | Project | What it is |
8
10
  | --- | --- |
9
- | [`flipbook-md`](https://github.com/uminocelo/flipbook-md) | The `flipbook` command: present, check and export decks. |
11
+ | [`flipbook-md`](https://github.com/FlipbookMD-HQ/flipbook-md) | The `flipbook` command: present, check and export decks. |
10
12
  | `@flipbook-md/core` (this package) | The library both apps build on: loading, rendering, blueprints, export and document import. |
11
13
  | Flipbook Studio | A self-hosted editor for the same deck files, with optional AI from a model running on your machine. **Coming soon.** |
12
14
 
@@ -235,7 +237,7 @@ const result = await importDeck("./decks", {
235
237
 
236
238
  Only the package entry is public. Deep imports such as `@flipbook-md/core/src/…` are blocked. Type declarations ship in `index.d.ts`.
237
239
 
238
- The deck file format (slides, `presentation.yml`, `templates.yml`, `blueprint.yml`, groups and themes) is documented in the [Flipbook MD README](https://github.com/uminocelo/flipbook-md#write-a-presentation).
240
+ The deck file format (slides, `presentation.yml`, `templates.yml`, `blueprint.yml`, groups and themes) is documented in the [Flipbook MD README](https://github.com/FlipbookMD-HQ/flipbook-md#write-a-presentation).
239
241
 
240
242
  ## Develop
241
243
 
package/index.d.ts CHANGED
@@ -664,3 +664,17 @@ export class ReservedNameError extends Error {
664
664
  code: "RESERVED_NAME";
665
665
  field: "name";
666
666
  }
667
+
668
+ // Source map extraction (US-38).
669
+ export type SourceMapBlockKind = "heading" | "paragraph" | "list_item" | "blockquote" | "code";
670
+ export interface SourceMapBlock {
671
+ line: number;
672
+ endLine: number;
673
+ kind: SourceMapBlockKind;
674
+ text: string;
675
+ }
676
+ export interface ExtractSlideSourceMapOptions {
677
+ lineOffset?: number;
678
+ slideIndex?: number;
679
+ }
680
+ export function extractSlideSourceMap(markdown: string, options?: ExtractSlideSourceMapOptions): SourceMapBlock[];
package/index.js CHANGED
@@ -15,6 +15,7 @@ export * from "./src/group-ops.js";
15
15
  export * from "./src/presentation.js";
16
16
  export * from "./src/server.js";
17
17
  export * from "./src/slides.js";
18
+ export * from "./src/sourcemap.js";
18
19
  export * from "./src/templates.js";
19
20
  export * from "./src/theme.js";
20
21
  export * from "./src/writer.js";
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@flipbook-md/core",
3
- "version": "0.14.1",
3
+ "version": "0.16.0",
4
4
  "description": "Load, render, check and export Flipbook MD decks. Shared by the flipbook CLI and Flipbook Studio.",
5
5
  "license": "MIT",
6
6
  "author": "Celo (https://github.com/uminocelo)",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/uminocelo/flipbook-md-core.git"
9
+ "url": "git+https://github.com/FlipbookMD-HQ/flipbook-md-core.git"
10
10
  },
11
11
  "type": "module",
12
12
  "main": "./index.js",
@@ -36,13 +36,13 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "gray-matter": "^4.0.3",
39
- "marked": "^15.0.7",
39
+ "marked": "^18.2.1",
40
40
  "playwright": "^1.55.0",
41
41
  "sanitize-html": "^2.14.0",
42
42
  "yaml": "^2.7.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@types/node": "^20.17.6",
46
- "typescript": "^5.6.3"
45
+ "@types/node": "^26.6.6",
46
+ "typescript": "^7.0.2"
47
47
  }
48
48
  }
@@ -4,30 +4,75 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <meta name="color-scheme" content="dark">
7
- <title>Flipbook MD · Announcer</title>
7
+ <title>Flipbook MD · Presenter</title>
8
8
  <link rel="stylesheet" href="/styles.css">
9
9
  <script src="/app.js" defer></script>
10
10
  </head>
11
11
  <body class="announcer">
12
12
  <header class="topbar">
13
- <a class="brand" href="/" target="_blank" rel="noopener noreferrer" aria-label="Flipbook MD home">FLIPBOOK <span>MD</span></a>
14
- <div class="topbar-right"><span id="deck-title">Loading presentation…</span><a class="view-link" href="/" target="_blank" rel="noopener noreferrer">Deck</a><button id="fullscreen" class="icon-button" title="Toggle fullscreen (F)" aria-label="Toggle fullscreen">⛶</button></div>
13
+ <div class="topbar-left">
14
+ <a class="brand" href="/" target="_blank" rel="noopener noreferrer" aria-label="Flipbook MD home">FLIPBOOK <span>MD</span></a>
15
+ <span id="deck-title" class="deck-title">Loading presentation…</span>
16
+ </div>
17
+ <div class="presenter-clock-group">
18
+ <div class="timer-widget" aria-label="Speaker timer">
19
+ <span id="speaker-timer" class="timer-display">00:00</span>
20
+ <button id="timer-toggle" class="hud-button timer-button" type="button" aria-pressed="false">Start</button>
21
+ <button id="timer-reset" class="hud-button timer-button" type="button">Reset</button>
22
+ </div>
23
+ <span id="wall-clock" class="wall-clock" aria-label="Current time">--:--</span>
24
+ </div>
25
+ <div class="topbar-right">
26
+ <button id="laser-toggle" class="hud-button" type="button" aria-pressed="false" aria-label="Toggle laser pointer" title="Laser pointer (L)">● <span>Laser</span></button>
27
+ <a class="view-link" href="/" target="_blank" rel="noopener noreferrer">Deck</a>
28
+ <button id="fullscreen" class="icon-button" type="button" title="Toggle fullscreen (F)" aria-label="Toggle fullscreen">⛶</button>
29
+ </div>
15
30
  </header>
16
- <main>
17
- <section id="slide" class="slide" aria-live="polite" aria-label="Current slide">
18
- <p class="loading">Loading your slides…</p>
31
+
32
+ <main class="presenter-main">
33
+ <section class="presenter-stage" aria-label="Current slide">
34
+ <div class="panel-label">Current slide</div>
35
+ <section id="slide" class="slide" aria-live="polite" aria-label="Current slide">
36
+ <p class="loading">Loading your slides…</p>
37
+ </section>
19
38
  </section>
20
- <aside class="notes-panel" aria-label="Speaker notes">
21
- <h2>Notes</h2>
22
- <div id="notes" class="notes-body" aria-live="polite"><p class="notes-empty">No notes for this slide.</p></div>
39
+
40
+ <aside class="presenter-sidebar" aria-label="Up next and speaker notes">
41
+ <section class="up-next-panel" aria-label="Up next slide">
42
+ <div class="panel-label">Up next</div>
43
+ <div class="up-next-frame">
44
+ <div id="up-next-slide" class="up-next-slide" aria-live="polite"></div>
45
+ </div>
46
+ </section>
47
+
48
+ <section class="notes-panel" aria-label="Speaker notes and Q&amp;A">
49
+ <div class="notes-header">
50
+ <div class="sidebar-tabs" role="tablist" aria-label="Presenter sidebar tabs">
51
+ <button id="tab-notes" class="sidebar-tab" type="button" role="tab" aria-selected="true" aria-controls="notes">Notes</button>
52
+ <button id="tab-qa" class="sidebar-tab" type="button" role="tab" aria-selected="false" aria-controls="qa-panel">Q&amp;A <span id="qa-badge" class="qa-badge" hidden>0</span></button>
53
+ </div>
54
+ <div id="notes-scale-controls" class="notes-scale-controls" role="group" aria-label="Notes font size">
55
+ <button id="notes-scale-down" class="hud-button scale-button" type="button" aria-label="Decrease notes font size" title="Decrease notes font size">A-</button>
56
+ <button id="notes-scale-up" class="hud-button scale-button" type="button" aria-label="Increase notes font size" title="Increase notes font size">A+</button>
57
+ </div>
58
+ </div>
59
+ <div id="notes" class="notes-body" role="tabpanel" aria-labelledby="tab-notes" aria-live="polite"><p class="notes-empty">No notes for this slide.</p></div>
60
+ <div id="qa-panel" class="qa-panel" role="tabpanel" aria-labelledby="tab-qa" hidden>
61
+ <div id="qa-list" class="qa-list" aria-live="polite"></div>
62
+ <p id="qa-empty" class="qa-empty">No audience questions yet.</p>
63
+ </div>
64
+ </section>
23
65
  </aside>
24
- <nav class="controls" aria-label="Slide navigation">
25
- <button id="previous" class="nav-button" type="button" aria-label="Previous slide">← <span>Previous</span></button>
26
- <button id="play" class="nav-button primary" type="button" aria-pressed="false" aria-label="Play">▶ <span>Play</span></button>
27
- <div class="slide-meta"><span id="counter">— / —</span><div class="progress"><div id="progress-bar"></div></div></div>
28
- <button id="next" class="nav-button" type="button" aria-label="Next slide"><span>Next</span> →</button>
29
- </nav>
66
+
67
+ <section class="presenter-bottom" aria-label="Slide navigation and jump strip">
68
+ <div id="slide-strip" class="slide-strip" role="navigation" aria-label="Slide jump strip"></div>
69
+ <nav class="controls" aria-label="Slide navigation">
70
+ <button id="previous" class="nav-button" type="button" aria-label="Previous slide">← <span>Previous</span></button>
71
+ <button id="play" class="nav-button primary" type="button" aria-pressed="false" aria-label="Play">▶ <span>Play</span></button>
72
+ <div class="slide-meta"><span id="counter">— / —</span><div class="progress"><div id="progress-bar"></div></div></div>
73
+ <button id="next" class="nav-button" type="button" aria-label="Next slide"><span>Next</span> →</button>
74
+ </nav>
75
+ </section>
30
76
  </main>
31
- <footer><span>Made with <strong>Flipbook MD</strong></span><span>Speaker notes · ← / → or Space · P play</span></footer>
32
77
  </body>
33
78
  </html>