storyink 0.3.0 → 0.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1
4
+
5
+ - **Fix: Play did nothing under reduced motion.** With Reduce Motion on (OS or `#motion=reduced`),
6
+ Play now walks the story step by step ("Play steps"): each step's settled state at once (reveals,
7
+ landed pulses, counters, the whole caption), held for its reading time (caption read time or
8
+ 1.5 s), then the next, ending on the final frame. No pulses, trails, glows or tweens. Pause, ←/→,
9
+ Shift+←/→, R (restart from step 1, no rewind) and the scrubber work on settled steps. The page
10
+ loads on the final frame with a static play button; `autoplay` is ignored.
11
+ - **`story.motion`: `"full"` (default) | `"reduced"` | `"system"`.** Full motion is the default and
12
+ **ignores the reader's OS reduced-motion setting**; `"system"` restores the 0.3.0 behaviour
13
+ (follow `prefers-reduced-motion`), `"reduced"` always steps. Auto stories:
14
+ `{ "steps": "auto", "motion": … }`, `render --motion …`, tool `storyink_render` `motion`.
15
+ Precedence: `#motion=` > the reader's toolbar choice > `story.motion` > OS (only for `"system"`).
16
+ - Viewer toolbar: **Motion: full / reduced** toggle (`aria-pressed`, shortcut `M`), saved in
17
+ `localStorage`; `#motion=` still wins. Switching mid-playback continues from the current step.
18
+ - Core: `steppedSchedule`, `steppedTime`, `steppedIndex`, `steppedStop`, `STEP_BEAT` and
19
+ `storyState(…, { stepped: true })`.
20
+ - Snapshot: `--motion reduced` (tool `motion`) captures stepped `at` frames; new gate `reduced=stepped`.
21
+ - Fix: live counter reels were placed at the node-local position (top-left of the diagram) and
22
+ shown before their node was revealed; they now sit on their node and follow its reveal.
23
+ `bun run verify:viewer` checks this in headless Chrome (full play, reduced → full, reload,
24
+ resize, theme toggle) along with stepped playback.
25
+
3
26
  ## 0.3.0
4
27
 
5
28
  - **Animated SVG (SMIL):** the story plays inside a plain `<img>`, so in GitHub READMEs and PR
package/README.md CHANGED
@@ -52,7 +52,7 @@ storyink render <in.json|in.mmd|-> [-o out.html] [--svg out.svg] [--theme light|
52
52
  storyink mermaid <in.mmd> [-o out.json]
53
53
  storyink validate <in> [--json]
54
54
  storyink snapshot <out.html> [--theme light,dark] [--width N] [--sheet [themes|beats]|--no-sheet] [--at 0.5,1.2,end] [--scale 2] [-o dir] [--json]
55
- [--preview out.jpg [--preview-size 1024]]
55
+ [--preview out.jpg [--preview-size 1024]] [--motion reduced]
56
56
  storyink skill
57
57
  ```
58
58
 
@@ -122,7 +122,15 @@ Add a `story` to play a diagram as a sequence of beats in the HTML viewer:
122
122
 
123
123
  `"story": "auto"` (or `--story auto`) derives the beats from the graph or message order. Playback
124
124
  has a click-to-play gate, play/pause, a tape-rewind replay and a scrubber with step and chapter
125
- ticks. Space, ←/→ and R control it. When reduced motion is on, the viewer jumps to the final frame.
125
+ ticks. Space, ←/→ and R control it.
126
+
127
+ Motion is **full by default, even when the reader's system asks for reduced motion**. Authors can
128
+ set `"story": { "motion": "reduced" }` (always step by step) or `"motion": "system"` (follow
129
+ `prefers-reduced-motion`); `--motion full|reduced|system` on `render` does the same, including
130
+ for auto stories. Readers switch with the toolbar's **Motion** toggle (`M`, remembered), and
131
+ `#motion=full|reduced` overrides everything. In reduced mode Play walks the story step by step:
132
+ each step's settled state shown at once and held for its reading time, with no travelling pulses
133
+ or tweens, and the page opens on the final frame.
126
134
 
127
135
  The final frame is always the static diagram. Every frame is a pure function of time
128
136
  (`storyState(scene, timeline, t)`), so `#t=2.5` seeks exactly and