@steamfield/decks 0.0.0-stage → 1.0.0-rc.1

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 (117) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +28 -2
  3. package/dist/cli.d.ts +1 -0
  4. package/dist/cli.js +5 -0
  5. package/dist/index-B2n69xrC.d.ts +75 -0
  6. package/dist/index-BURtH7IB.d.ts +182 -0
  7. package/dist/index-BV_-6L5L.d.ts +136 -0
  8. package/dist/index.d.ts +3 -0
  9. package/dist/index.js +6 -0
  10. package/dist/kit/chrome/od-byline.css +7 -0
  11. package/dist/kit/chrome/od-cover-head.css +10 -0
  12. package/dist/kit/chrome/od-eyebrow.css +13 -0
  13. package/dist/kit/chrome/od-logo.css +167 -0
  14. package/dist/kit/chrome/od-qr-card.css +30 -0
  15. package/dist/kit/ink/code-ink.css +83 -0
  16. package/dist/kit/ink/graph-3d.css +29 -0
  17. package/dist/kit/ink/ink-bars.css +7 -0
  18. package/dist/kit/ink/ink-card-rect.css +6 -0
  19. package/dist/kit/ink/ink-chip.css +62 -0
  20. package/dist/kit/ink/ink-line.css +7 -0
  21. package/dist/kit/ink/ink-number.css +22 -0
  22. package/dist/kit/ink/ink-ping.css +4 -0
  23. package/dist/kit/ink/ink-rule.css +4 -0
  24. package/dist/kit/ink/ink-timeline-cursor.css +3 -0
  25. package/dist/kit/ink/ink-timeline.css +9 -0
  26. package/dist/kit/ink/underline.css +12 -0
  27. package/dist/kit/ink/unit-grid.css +3 -0
  28. package/dist/kit/story/story-card.css +19 -0
  29. package/dist/kit/story/story-link.css +13 -0
  30. package/dist/kit/story/story-stage.css +59 -0
  31. package/dist/kit/styles/base.css +82 -0
  32. package/dist/kit/styles/compat.css +78 -0
  33. package/dist/kit/styles/components.css +224 -0
  34. package/dist/kit/styles/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
  35. package/dist/kit/styles/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
  36. package/dist/kit/styles/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
  37. package/dist/kit/styles/fonts/inter-greek-wght-normal.woff2 +0 -0
  38. package/dist/kit/styles/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
  39. package/dist/kit/styles/fonts/inter-latin-wght-normal.woff2 +0 -0
  40. package/dist/kit/styles/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
  41. package/dist/kit/styles/fonts.css +73 -0
  42. package/dist/kit/styles/index.css +36 -0
  43. package/dist/kit/styles/layout.css +181 -0
  44. package/dist/kit/styles/stats.css +92 -0
  45. package/dist/kit/styles/story-frame.css +179 -0
  46. package/dist/kit/styles/story-marks.css +115 -0
  47. package/dist/kit/styles/story-transition.css +182 -0
  48. package/dist/kit/styles.css +1 -0
  49. package/dist/kit.d.ts +880 -0
  50. package/dist/kit.js +3475 -0
  51. package/dist/layers.css +60 -0
  52. package/dist/layouts.css +58 -0
  53. package/dist/lint/ai-rhetoric-patterns.tsv +110 -0
  54. package/dist/lint/deck-writing-reminder.md +9 -0
  55. package/dist/motion.css +215 -0
  56. package/dist/motion.d.ts +2 -0
  57. package/dist/motion.js +1 -0
  58. package/dist/node.d.ts +63 -0
  59. package/dist/node.js +1 -0
  60. package/dist/overview-view.css +58 -0
  61. package/dist/play-view.css +29 -0
  62. package/dist/plugin/skills/building-a-deck/SKILL.md +22 -0
  63. package/dist/plugin/skills/building-a-deck/references/workflow.md +86 -0
  64. package/dist/plugin/skills/deck-data/SKILL.md +27 -0
  65. package/dist/plugin/skills/deck-data/references/fact-check.md +59 -0
  66. package/dist/plugin/skills/deck-data/references/provenance.md +61 -0
  67. package/dist/plugin/skills/deck-design/SKILL.md +31 -0
  68. package/dist/plugin/skills/deck-design/references/layout.md +55 -0
  69. package/dist/plugin/skills/deck-motion/SKILL.md +34 -0
  70. package/dist/plugin/skills/deck-motion/references/motion.md +66 -0
  71. package/dist/plugin/skills/visualization/SKILL.md +34 -0
  72. package/dist/plugin/skills/visualization/references/VENDORED.md +25 -0
  73. package/dist/plugin/skills/visualization/references/annotations.md +27 -0
  74. package/dist/plugin/skills/visualization/references/chart-selection.md +29 -0
  75. package/dist/plugin/skills/visualization/references/color-strategy.md +22 -0
  76. package/dist/plugin/skills/visualization/references/encoding-channels.md +44 -0
  77. package/dist/plugin/skills/visualization/references/ink.md +38 -0
  78. package/dist/plugin/skills/visualization/references/marks.md +33 -0
  79. package/dist/plugin/skills/visualization/references/presentation.md +43 -0
  80. package/dist/plugin/skills/working-with-decks/SKILL.md +34 -0
  81. package/dist/plugin/skills/working-with-decks/references/project.md +59 -0
  82. package/dist/plugin/skills/writing-slides/SKILL.md +45 -0
  83. package/dist/plugin/skills/writing-slides/references/lint.md +11 -0
  84. package/dist/plugin/skills/writing-slides/references/prose-patterns.md +48 -0
  85. package/dist/presenter-view.css +113 -0
  86. package/dist/print-view.module.css +32 -0
  87. package/dist/prose-patterns-DPqjGBFu.js +76 -0
  88. package/dist/prose-scan-BrWZ7gxZ.js +233 -0
  89. package/dist/src-C-OfT72W.js +396 -0
  90. package/dist/src-CmQgaG1b.js +2469 -0
  91. package/dist/src-DizFoqYt.js +1508 -0
  92. package/dist/templates/conventional/deck.config.ts +7 -0
  93. package/dist/templates/conventional/setup.ts +3 -0
  94. package/dist/templates/conventional/slides/01-cover.mdx +9 -0
  95. package/dist/templates/conventional/slides/02-first-point.mdx +12 -0
  96. package/dist/templates/conventional/styles/index.css +1 -0
  97. package/dist/templates/story/components/FirstStage.tsx +34 -0
  98. package/dist/templates/story/data/01-first.ts +8 -0
  99. package/dist/templates/story/data-sources.md +7 -0
  100. package/dist/templates/story/deck.config.ts +8 -0
  101. package/dist/templates/story/setup.ts +3 -0
  102. package/dist/templates/story/slides/01-cover.mdx +9 -0
  103. package/dist/templates/story/slides/02-first-point.mdx +6 -0
  104. package/dist/templates/story/styles/index.css +1 -0
  105. package/dist/transition.css +87 -0
  106. package/docs/README.md +28 -0
  107. package/docs/canvas.md +134 -0
  108. package/docs/cli.md +49 -0
  109. package/docs/code-blocks.md +132 -0
  110. package/docs/config.md +183 -0
  111. package/docs/getting-started.md +204 -0
  112. package/docs/kit.md +371 -0
  113. package/docs/migrating-from-slidev.md +45 -0
  114. package/docs/motion.md +396 -0
  115. package/docs/presenting.md +99 -0
  116. package/docs/slides.md +246 -0
  117. package/package.json +108 -4
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,29 @@
1
- # Temporary Holding Version
1
+ # @steamfield/decks
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ React slide decks for animated, data-driven talks, written in MDX and built with coding agents. A deck is a directory of MDX slides plus React components; `decks dev` serves it with live updates, presenter view and two-window sync, and `decks build` writes a static site. Slides are drawn on a 1920x1080 canvas that scales to any window, clicks step through motion inside a slide, and a story stage pins one visualization per slide and advances it in beats.
4
+
5
+ Requires Node 22.12 or later and React 19.
6
+
7
+ ```sh
8
+ bun add @steamfield/decks react react-dom
9
+ bunx -p @steamfield/decks decks new talk --story
10
+ bunx -p @steamfield/decks decks dev talk
11
+ ```
12
+
13
+ With npm, `npm i @steamfield/decks react react-dom` and `npx -p @steamfield/decks decks …`. The `-p` form matters: the bare `decks` name on npm is an unrelated package.
14
+
15
+ | Import | What it has |
16
+ | --- | --- |
17
+ | `@steamfield/decks` | Hooks (`useDeck`, `useSlide`), layouts, views, deck types |
18
+ | `@steamfield/decks/motion` | `Step`, `Steps`, `Stagger`, `TextReveal`, `Highlight`, `CountUp`, `Draw`, `Morph`, `CodeBlock`, `useTween`, `useTimeline` |
19
+ | `@steamfield/decks/kit` | The theme, story stages (`StoryStage`, `StoryCard`, `useStage`), Ink marks, `OpenChart`, `Graph3D` |
20
+ | `@steamfield/decks/kit/styles.css` | The kit stylesheet and self-hosted Inter |
21
+ | `@steamfield/decks/node` | `defineDeck` for `deck.config.ts`, and the programmatic `dev` and `build` |
22
+
23
+ The `decks` command: `dev`, `build`, `new`, `check`, `lint`, `export` (PDF), `shot` (PNG), `hook` and `init`. `decks init` sets a project up for coding agents: it enables the Decks Claude Code plugin (skills, a deck-author agent and prose hooks) and copies the same skills to `.agents/skills/` for Codex.
24
+
25
+ The guide for this version is installed with the package in `node_modules/@steamfield/decks/docs/`; start with `docs/README.md`. Source, issues and the changelog: https://github.com/steamfield/decks.
26
+
27
+ Decks replaces `slidev-addon-decks`, a Slidev addon. A Slidev deck moves over by rewriting each `pages/NN-slug.md` as `slides/NN-slug.mdx` and each Vue component as a React one; `docs/migrating-from-slidev.md` has the mapping.
28
+
29
+ Apache-2.0.
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {}
package/dist/cli.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { t as runCli } from "./src-CmQgaG1b.js";
3
+ // src/cli.ts
4
+ await runCli();
5
+ export {};
@@ -0,0 +1,75 @@
1
+ import { v as StepState } from "./index-BV_-6L5L.js";
2
+ import { ComponentProps, DependencyList, ReactElement, ReactNode } from "react";
3
+ import { gsap as gsap$1 } from "gsap";
4
+ declare function CodeBlock(props: ComponentProps<"pre">): import("react").JSX.Element;
5
+ declare function CountUp({ at, from, to, format }: {
6
+ at: number;
7
+ from?: number;
8
+ to: number;
9
+ format?: (value: number) => string;
10
+ }): import("react").JSX.Element;
11
+ declare function Morph({ name, as: Element, className, children }: {
12
+ name: string;
13
+ as?: "div" | "span" | "h1" | "h2" | "h3" | "p" | "figure" | "g";
14
+ className?: string;
15
+ children?: ReactNode;
16
+ }): ReactElement;
17
+ type StepPreset = "fade" | "rise" | "drop" | "scale" | "blur" | "wipe";
18
+ type StepElement = "div" | "span" | "li" | "p" | "g";
19
+ declare function useStepState(at: number, until?: number): StepState;
20
+ declare function Step({ at, until, enter, exit, as: Element, className, children }: {
21
+ at: number;
22
+ until?: number;
23
+ enter?: StepPreset;
24
+ exit?: StepPreset;
25
+ as?: StepElement;
26
+ className?: string;
27
+ children?: ReactNode;
28
+ }): import("react").JSX.Element;
29
+ declare function Steps({ from, enter, as: Element, className, children }: {
30
+ from: number;
31
+ enter?: StepPreset;
32
+ as?: "div" | "ul" | "ol";
33
+ className?: string;
34
+ children?: ReactNode;
35
+ }): import("react").JSX.Element;
36
+ declare function Stagger({ at, until, enter, as: Element, className, children }: {
37
+ at: number;
38
+ until?: number;
39
+ enter?: StepPreset;
40
+ as?: "div" | "ul" | "ol";
41
+ className?: string;
42
+ children?: ReactNode;
43
+ }): import("react").JSX.Element;
44
+ declare function TextReveal({ at, by, enter, children }: {
45
+ at: number;
46
+ by?: "word" | "char";
47
+ enter?: StepPreset;
48
+ children: string;
49
+ }): import("react").JSX.Element;
50
+ declare function Highlight({ at, until, children }: {
51
+ at: number;
52
+ until?: number;
53
+ children?: ReactNode;
54
+ }): import("react").JSX.Element;
55
+ declare function Draw({ at, until, children }: {
56
+ at: number;
57
+ until?: number;
58
+ children?: ReactNode;
59
+ }): import("react").JSX.Element;
60
+ declare const duration: {
61
+ readonly quick: 0.14;
62
+ readonly base: 0.3;
63
+ readonly slow: 0.6;
64
+ };
65
+ declare const ease: {
66
+ readonly enter: "deckEnter";
67
+ readonly exit: "deckExit";
68
+ readonly settle: "deckSettle";
69
+ readonly draw: "deckDraw";
70
+ };
71
+ declare const stagger = 0.06;
72
+ declare function motionMode(): "live" | "instant";
73
+ declare function useTimeline(build: (tl: gsap.core.Timeline, beat: (n: number) => void) => void, deps?: DependencyList): void;
74
+ declare function useTween<T extends Record<string, number>>(initial: T): T;
75
+ export { CountUp as _, gsap$1 as a, Draw as c, Step as d, StepPreset as f, Morph as g, useStepState as h, ease as i, Highlight as l, TextReveal as m, useTimeline as n, motionMode as o, Steps as p, duration as r, stagger as s, useTween as t, Stagger as u, CodeBlock as v };
@@ -0,0 +1,182 @@
1
+ import { C as NavState, O as DeckManifest, h as DeckView, k as SlideMeta, s as Transport, x as NavAction } from "./index-BV_-6L5L.js";
2
+ import { ComponentType, ReactElement, ReactNode } from "react";
3
+ import { MDXComponents } from "mdx/types";
4
+ declare function SlideFrame({ main, children }: {
5
+ main?: boolean;
6
+ children: ReactNode;
7
+ }): ReactElement;
8
+ type SlideLoader = () => Promise<{
9
+ default: ComponentType<{
10
+ components?: MDXComponents;
11
+ }>;
12
+ }>;
13
+ /** One note segment after rendering: the click it belongs to and its HTML. */
14
+ interface NoteHtml {
15
+ readonly click: number;
16
+ readonly html: string;
17
+ }
18
+ interface DeckSource {
19
+ readonly manifest: DeckManifest;
20
+ readonly slides: Readonly<Record<string, SlideLoader>>;
21
+ readonly frontmatter: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
22
+ readonly components: MDXComponents;
23
+ /** `credit` replaces the built-in corner credit; `false` removes it. */
24
+ readonly layers?: {
25
+ above?: ComponentType;
26
+ below?: ComponentType;
27
+ credit?: ComponentType | false;
28
+ };
29
+ /** Rendered notes keyed by slide id, one entry per segment. */
30
+ readonly loadNotes?: () => Promise<Readonly<Record<string, readonly NoteHtml[]>>>;
31
+ }
32
+ interface DeckState {
33
+ readonly nav: NavState;
34
+ readonly view: DeckView;
35
+ readonly embedded: boolean;
36
+ readonly bridge: boolean;
37
+ readonly audienceAspect?: number;
38
+ }
39
+ interface DeckStore {
40
+ getState(): DeckState;
41
+ subscribe(listener: () => void): () => void;
42
+ dispatch(action: NavAction): void;
43
+ setView(view: DeckView, nav?: NavState): void;
44
+ destroy(): void;
45
+ }
46
+ declare function createDeckStore(manifest: DeckManifest, options?: {
47
+ transport?: Transport;
48
+ present?: (change: {
49
+ from: DeckState;
50
+ to: DeckState;
51
+ }, apply: () => void) => void;
52
+ }): DeckStore;
53
+ declare function Deck({ source, store }: {
54
+ source: DeckSource;
55
+ store: DeckStore;
56
+ }): ReactElement;
57
+ /** Registers the active story card's plain text. Returns its cleanup. */
58
+ declare function registerCaptionProvider(provider: () => {
59
+ lead: string;
60
+ body: string;
61
+ } | undefined): () => void;
62
+ /** Lets a same-origin embed host decide how to handle a stage's arrow key. */
63
+ declare function routeEmbedNavigation(event: KeyboardEvent): boolean;
64
+ type EmbedCommand = {
65
+ requestId?: number;
66
+ } & ({
67
+ type: "decks:cmd";
68
+ cmd: "next" | "prev" | "nextSlide" | "prevSlide";
69
+ } | {
70
+ type: "decks:cmd";
71
+ cmd: "go";
72
+ slide: number;
73
+ beat: number;
74
+ });
75
+ type EmbedDirection = "forward" | "backward" | null;
76
+ type EmbedState = {
77
+ requestId?: number;
78
+ /** 1-based slide number. */
79
+ slide: number;
80
+ slides: number;
81
+ /** 0-based beat within the slide. */
82
+ beat: number;
83
+ /** The slide's last beat index: 0 without clicks, 2 for three cards. */
84
+ beats: number;
85
+ /** The story card's text; empty on a slide without a card. */
86
+ lead: string;
87
+ body: string;
88
+ settled: boolean;
89
+ direction: EmbedDirection;
90
+ };
91
+ type EmbedMeta = {
92
+ title: string;
93
+ slides: number;
94
+ slideTitles: string[];
95
+ };
96
+ type EmbedMessage = {
97
+ type: "decks:ready";
98
+ } | {
99
+ type: "decks:navigate";
100
+ cmd: Exclude<EmbedCommand["cmd"], "go">;
101
+ } | {
102
+ type: "decks:interaction";
103
+ } | {
104
+ type: "decks:error";
105
+ message: string;
106
+ } | ({
107
+ type: "decks:meta";
108
+ } & EmbedMeta) | ({
109
+ type: "decks:state";
110
+ } & EmbedState);
111
+ interface DeckApi {
112
+ readonly slide: number;
113
+ readonly total: number;
114
+ readonly clicks: number;
115
+ readonly clicksTotal: number;
116
+ readonly slides: readonly SlideMeta[];
117
+ readonly view: DeckView;
118
+ readonly isPrint: boolean;
119
+ /** True when the deck was opened with `?embedded`, inside another page. */
120
+ readonly embedded: boolean;
121
+ next(): void;
122
+ prev(): void;
123
+ nextSlide(): void;
124
+ prevSlide(): void;
125
+ go(slide: number, click?: number): void;
126
+ }
127
+ declare function useDeck(): DeckApi;
128
+ type RenderContext = "slide" | "presenter" | "preview" | "overview" | "print";
129
+ interface SlideApi {
130
+ readonly no: number;
131
+ readonly id: string;
132
+ readonly clicks: number;
133
+ readonly clicksTotal: number;
134
+ readonly isActive: boolean;
135
+ readonly renderContext: RenderContext;
136
+ readonly frontmatter: Readonly<Record<string, unknown>>;
137
+ }
138
+ declare function useSlide(): SlideApi;
139
+ declare function useSlideScale(): number;
140
+ declare function Center({ children }: {
141
+ children?: ReactNode;
142
+ }): ReactElement;
143
+ declare function Cover({ children }: {
144
+ children?: ReactNode;
145
+ }): ReactElement;
146
+ declare function Section({ children }: {
147
+ children?: ReactNode;
148
+ }): ReactElement;
149
+ declare function TwoCol({ ratio, align, children }: {
150
+ ratio?: "1:1" | "2:1" | "1:2" | "3:2" | "2:3";
151
+ align?: "start" | "center" | "end";
152
+ children?: ReactNode;
153
+ }): ReactElement;
154
+ declare function ImageSide({ src, alt, side, ratio, children }: {
155
+ src: string;
156
+ alt: string;
157
+ side?: "left" | "right";
158
+ ratio?: "1:1" | "2:1" | "1:2";
159
+ children?: ReactNode;
160
+ }): ReactElement;
161
+ declare function mountDeck(source: DeckSource, root?: HTMLElement): () => void;
162
+ declare function Notes(_props: {
163
+ children?: ReactNode;
164
+ }): null;
165
+ declare function registerSettleProbe(isBusy: () => boolean): () => void;
166
+ declare global {
167
+ interface Window {
168
+ __deck?: {
169
+ settled(): Promise<void>;
170
+ };
171
+ }
172
+ }
173
+ declare function SlideHost({ no, context, clicks }: {
174
+ no: number;
175
+ context: RenderContext;
176
+ clicks?: number;
177
+ }): ReactElement;
178
+ declare function createBroadcastTransport(channelId: string): Transport;
179
+ declare function OverviewView(): ReactElement;
180
+ declare function PlayView(): ReactElement;
181
+ declare function PresenterView(): ReactElement;
182
+ export { createDeckStore as A, EmbedMeta as C, Deck as D, registerCaptionProvider as E, NoteHtml as M, SlideLoader as N, DeckState as O, SlideFrame as P, EmbedMessage as S, routeEmbedNavigation as T, useDeck as _, SlideHost as a, EmbedCommand as b, mountDeck as c, ImageSide as d, Section as f, SlideApi as g, RenderContext as h, createBroadcastTransport as i, DeckSource as j, DeckStore as k, Center as l, DeckApi as m, PlayView as n, registerSettleProbe as o, TwoCol as p, OverviewView as r, Notes as s, PresenterView as t, Cover as u, useSlide as v, EmbedState as w, EmbedDirection as x, useSlideScale as y };
@@ -0,0 +1,136 @@
1
+ interface CanvasFit {
2
+ /** Factor to transform-scale the frame by. */
3
+ readonly scale: number;
4
+ /** Logical size of the frame in design pixels, before scaling. */
5
+ readonly width: number;
6
+ readonly height: number;
7
+ }
8
+ declare function fitCanvas(containerWidth: number, containerHeight: number, designWidth: number, designHeight: number): CanvasFit;
9
+ interface SlideMeta {
10
+ /** 1-based position among visible slides. */
11
+ readonly no: number;
12
+ /** Filename without extension, e.g. "03-outcome-ladder". Stable across reorders. */
13
+ readonly id: string;
14
+ /** Path relative to the deck directory, e.g. "slides/03-outcome-ladder.mdx". */
15
+ readonly file: string;
16
+ readonly title: string;
17
+ /** Number of clicks after the initial state. 0 means the slide has no steps. */
18
+ readonly clicks: number;
19
+ /** Name of the transition into the following slide; undefined uses the deck default. */
20
+ readonly transition?: string;
21
+ /** True when a click on this slide commits through a view transition. */
22
+ readonly morphSteps?: boolean;
23
+ }
24
+ interface CanvasSize {
25
+ readonly width: number;
26
+ readonly height: number;
27
+ }
28
+ interface DeckManifest {
29
+ /** Registry alias; also part of the sync channel id. */
30
+ readonly name: string;
31
+ readonly title: string;
32
+ readonly canvas: CanvasSize;
33
+ /** The deck's default slide transition; undefined means fade. */
34
+ readonly transition?: string;
35
+ readonly slides: readonly SlideMeta[];
36
+ }
37
+ /** Throws an Error naming the first problem. Returns the same object when valid. */
38
+ declare function assertManifest(manifest: DeckManifest): DeckManifest;
39
+ interface NavState {
40
+ readonly slide: number;
41
+ readonly click: number;
42
+ }
43
+ type NavAction = {
44
+ readonly type: "next";
45
+ } | {
46
+ readonly type: "prev";
47
+ } | {
48
+ readonly type: "nextSlide";
49
+ } | {
50
+ readonly type: "prevSlide";
51
+ } | {
52
+ readonly type: "go";
53
+ readonly slide: number;
54
+ readonly click?: number;
55
+ };
56
+ type NavDirection = "forward" | "backward" | "none";
57
+ declare function clampNav(state: NavState, manifest: DeckManifest): NavState;
58
+ declare function navigate(state: NavState, action: NavAction, manifest: DeckManifest): NavState;
59
+ declare function navDirection(from: NavState, to: NavState): NavDirection;
60
+ declare function clicksForSlide(slideNo: number, nav: NavState, manifest: DeckManifest): number;
61
+ type StepState = "before" | "current" | "after" | "gone";
62
+ declare function stepState(clicks: number, at: number, until?: number): StepState;
63
+ type DeckView = "play" | "presenter" | "overview" | "print";
64
+ interface DeckLocation {
65
+ readonly view: DeckView;
66
+ readonly slide: number;
67
+ readonly click: number;
68
+ readonly embedded: boolean;
69
+ readonly bridge: boolean;
70
+ }
71
+ declare function parseLocation(hash: string, search: string): DeckLocation;
72
+ declare function formatHash(location: Pick<DeckLocation, "view" | "slide" | "click">): string;
73
+ interface NoteSegment {
74
+ /** The click this text belongs to. Text before the first marker belongs to click 0. */
75
+ readonly click: number;
76
+ /** Markdown source of the segment, trimmed. */
77
+ readonly markdown: string;
78
+ }
79
+ /** Splits a slide's notes, as markdown source, at its click markers. */
80
+ declare function segmentNotes(markdown: string): NoteSegment[];
81
+ /** The click of the last marker; 0 when there are none. */
82
+ declare function noteClickCount(markdown: string): number;
83
+ interface SyncState {
84
+ readonly nav: NavState;
85
+ /** Width / height of the audience window, when the sender is an audience view. */
86
+ readonly aspect?: number;
87
+ }
88
+ /** Orders states by sequence, then earlier start, then origin as strings. */
89
+ interface SyncStamp {
90
+ readonly seq: number;
91
+ /** `startedAt` of the session that published this state. */
92
+ readonly started: number;
93
+ /** Id of the session that published this state. */
94
+ readonly origin: string;
95
+ }
96
+ type SyncMessage = {
97
+ readonly type: "hello";
98
+ readonly from: string;
99
+ } | {
100
+ readonly type: "state";
101
+ readonly from: string;
102
+ readonly stamp: SyncStamp;
103
+ readonly state: SyncState;
104
+ };
105
+ interface Transport {
106
+ post(message: SyncMessage): void;
107
+ /** Returns an unsubscribe function. */
108
+ subscribe(listener: (message: SyncMessage) => void): () => void;
109
+ close(): void;
110
+ }
111
+ interface MemoryHub {
112
+ /** Each call returns a transport for one participant. */
113
+ connect(): Transport;
114
+ }
115
+ declare function createMemoryHub(): MemoryHub;
116
+ interface SyncSessionOptions {
117
+ /** Unique per tab. */
118
+ readonly id: string;
119
+ /** When this tab's session began, in milliseconds since the epoch. The caller supplies it. */
120
+ readonly startedAt: number;
121
+ readonly transport: Transport;
122
+ /** The session's current local state; used to answer a newcomer. */
123
+ readonly current: () => SyncState;
124
+ /** Called when a newer state from another participant should be applied locally. */
125
+ readonly onRemote: (state: SyncState) => void;
126
+ }
127
+ interface SyncSession {
128
+ /** Tell the other participants about a local change. */
129
+ publish(state: SyncState): void;
130
+ /** Stops listening and closes the transport. Later publishes do nothing. */
131
+ close(): void;
132
+ }
133
+ declare function createSyncSession(options: SyncSessionOptions): SyncSession;
134
+ /** Stable channel name for a deck served at a base path. */
135
+ declare function syncChannelId(deckName: string, base: string): string;
136
+ export { assertManifest as A, NavState as C, CanvasSize as D, navigate as E, fitCanvas as M, DeckManifest as O, NavDirection as S, navDirection as T, parseLocation as _, SyncStamp as a, stepState as b, createMemoryHub as c, NoteSegment as d, noteClickCount as f, formatHash as g, DeckView as h, SyncSessionOptions as i, CanvasFit as j, SlideMeta as k, createSyncSession as l, DeckLocation as m, SyncMessage as n, SyncState as o, segmentNotes as p, SyncSession as r, Transport as s, MemoryHub as t, syncChannelId as u, StepState as v, clampNav as w, NavAction as x, clicksForSlide as y };
@@ -0,0 +1,3 @@
1
+ import { A as assertManifest, C as NavState, D as CanvasSize, E as navigate, M as fitCanvas, O as DeckManifest, S as NavDirection, T as navDirection, _ as parseLocation, a as SyncStamp, b as stepState, c as createMemoryHub, d as NoteSegment, f as noteClickCount, g as formatHash, h as DeckView, i as SyncSessionOptions, j as CanvasFit, k as SlideMeta, l as createSyncSession, m as DeckLocation, n as SyncMessage, o as SyncState, p as segmentNotes, r as SyncSession, s as Transport, t as MemoryHub, u as syncChannelId, v as StepState, w as clampNav, x as NavAction, y as clicksForSlide } from "./index-BV_-6L5L.js";
2
+ import { A as createDeckStore, C as EmbedMeta, D as Deck, E as registerCaptionProvider, M as NoteHtml, N as SlideLoader, O as DeckState, P as SlideFrame, S as EmbedMessage, T as routeEmbedNavigation, _ as useDeck, a as SlideHost, b as EmbedCommand, c as mountDeck, d as ImageSide, f as Section, g as SlideApi, h as RenderContext, i as createBroadcastTransport, j as DeckSource, k as DeckStore, l as Center, m as DeckApi, n as PlayView, o as registerSettleProbe, p as TwoCol, r as OverviewView, s as Notes, t as PresenterView, u as Cover, v as useSlide, w as EmbedState, x as EmbedDirection, y as useSlideScale } from "./index-BURtH7IB.js";
3
+ export { type CanvasFit, type CanvasSize, Center, Cover, Deck, type DeckApi, type DeckLocation, type DeckManifest, type DeckSource, type DeckState, type DeckStore, type DeckView, type EmbedCommand, type EmbedDirection, type EmbedMessage, type EmbedMeta, type EmbedState, ImageSide, type MemoryHub, type NavAction, type NavDirection, type NavState, type NoteHtml, type NoteSegment, Notes, OverviewView, PlayView, PresenterView, type RenderContext, Section, type SlideApi, SlideFrame, SlideHost, type SlideLoader, type SlideMeta, type StepState, type SyncMessage, type SyncSession, type SyncSessionOptions, type SyncStamp, type SyncState, type Transport, TwoCol, type assertManifest, type clampNav, type clicksForSlide, createBroadcastTransport, createDeckStore, type createMemoryHub, type createSyncSession, type fitCanvas, type formatHash, mountDeck, type navDirection, type navigate, type noteClickCount, type parseLocation, registerCaptionProvider, registerSettleProbe, routeEmbedNavigation, type segmentNotes, type stepState, type syncChannelId, useDeck, useSlide, useSlideScale };
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import { _ as SlideFrame, a as Cover, b as useSlideScale, c as TwoCol, d as Deck, f as PresenterView, g as registerSettleProbe, h as SlideHost, i as Center, l as routeEmbedNavigation, m as OverviewView, n as createDeckStore, o as ImageSide, p as PlayView, r as createBroadcastTransport, s as Section, t as mountDeck, u as registerCaptionProvider, v as useDeck, y as useSlide } from "./src-DizFoqYt.js";
2
+ // ../runtime/src/notes.ts
3
+ function Notes(_props) {
4
+ return null;
5
+ }
6
+ export { Center, Cover, Deck, ImageSide, Notes, OverviewView, PlayView, PresenterView, Section, SlideFrame, SlideHost, TwoCol, createBroadcastTransport, createDeckStore, mountDeck, registerCaptionProvider, registerSettleProbe, routeEmbedNavigation, useDeck, useSlide, useSlideScale };
@@ -0,0 +1,7 @@
1
+ .od-byline {
2
+ display: flex;
3
+ align-items: center;
4
+ gap: 1.5rem;
5
+ font-size: calc(0.95rem * var(--deck-text-scale, 1));
6
+ color: var(--od-text-faint);
7
+ }
@@ -0,0 +1,10 @@
1
+ .od-cover-head {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ }
6
+ .od-cover-url {
7
+ font-size: calc(1rem * var(--deck-text-scale, 1));
8
+ color: var(--od-text-dim);
9
+ letter-spacing: 0.02em;
10
+ }