storyink 0.4.0 → 0.5.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/CHANGELOG.md +126 -0
- package/README.md +1182 -147
- package/THIRD_PARTY_NOTICES.md +7 -0
- package/dist/chunks/index-ac6c756n.js +16813 -0
- package/dist/chunks/index-rgqxg226.js +1022 -0
- package/dist/cli.js +8144 -1147
- package/dist/core/index.js +88 -2
- package/dist/index.js +230 -11
- package/dist/node/index.js +24 -4
- package/dist/types/core/anchor.d.ts +6 -1
- package/dist/types/core/diff/coverage.d.ts +46 -0
- package/dist/types/core/diff/index.d.ts +8 -0
- package/dist/types/core/diff/lang.d.ts +7 -0
- package/dist/types/core/diff/parse.d.ts +20 -0
- package/dist/types/core/diff/resolve.d.ts +24 -0
- package/dist/types/core/diff/rows.d.ts +46 -0
- package/dist/types/core/diff/select.d.ts +35 -0
- package/dist/types/core/diff/types.d.ts +49 -0
- package/dist/types/core/index.d.ts +5 -1
- package/dist/types/core/layout/delta.d.ts +40 -0
- package/dist/types/core/layout/diffnode.d.ts +44 -0
- package/dist/types/core/page/blocks.d.ts +28 -0
- package/dist/types/core/page/css-story.d.ts +10 -0
- package/dist/types/core/page/css.d.ts +5 -0
- package/dist/types/core/page/index.d.ts +6 -0
- package/dist/types/core/page/prose.d.ts +31 -0
- package/dist/types/core/page/render.d.ts +30 -0
- package/dist/types/core/page/resolve.d.ts +15 -0
- package/dist/types/core/page/slides.d.ts +37 -0
- package/dist/types/core/page/targets.d.ts +32 -0
- package/dist/types/core/page/types.d.ts +241 -0
- package/dist/types/core/page/validate.d.ts +12 -0
- package/dist/types/core/render/App.d.ts +46 -1
- package/dist/types/core/render/Diagram.d.ts +8 -1
- package/dist/types/core/render/DiffView.d.ts +27 -0
- package/dist/types/core/render/Drawer.d.ts +47 -0
- package/dist/types/core/render/Narration.d.ts +25 -0
- package/dist/types/core/render/Story.d.ts +4 -0
- package/dist/types/core/render/css.d.ts +10 -4
- package/dist/types/core/render/figure.d.ts +17 -0
- package/dist/types/core/render/index.d.ts +4 -0
- package/dist/types/core/render/smil.d.ts +1 -1
- package/dist/types/core/scene.d.ts +74 -1
- package/dist/types/core/spec.d.ts +108 -5
- package/dist/types/core/story/changes.d.ts +33 -0
- package/dist/types/core/story/content-state.d.ts +6 -0
- package/dist/types/core/story/content.d.ts +12 -1
- package/dist/types/core/story/narrate.d.ts +40 -0
- package/dist/types/core/story/types.d.ts +46 -2
- package/dist/types/generated/meta.d.ts +1 -1
- package/dist/types/generated/viewer.d.ts +1 -1
- package/dist/types/node/git.d.ts +33 -0
- package/dist/types/node/index.d.ts +2 -0
- package/dist/types/node/page.d.ts +26 -0
- package/dist/types/node/snapshot.d.ts +41 -0
- package/dist/types/theme/tokens.d.ts +80 -5
- package/docs/spec.md +535 -4
- package/examples/changes/auth-session-to-jwt.changes.sequence.json +35 -0
- package/examples/changes/auth-session-to-jwt.sequence.json +48 -0
- package/examples/changes/batch-email.changes.dataflow.json +83 -0
- package/examples/changes/batch-email.dataflow.json +97 -0
- package/examples/changes/cache-layer.architecture.json +47 -0
- package/examples/changes/etl-dedupe.dataflow.json +41 -0
- package/examples/changes/payment-retry.architecture.json +52 -0
- package/examples/changes/rate-limit-plugin.architecture.json +79 -0
- package/examples/changes/storyink-0.4.0.changes.json +8737 -0
- package/examples/changes/storyink-0.4.0.pr.json +417 -0
- package/examples/changes/storyink-core.architecture.json +57 -0
- package/examples/checkout-recovery.architecture.json +96 -0
- package/examples/pages/cache-plan.page.json +136 -0
- package/examples/pages/payment-retry.scrolly.page.json +32 -0
- package/examples/pages/pr-review.deck.page.json +98 -0
- package/examples/pages/pr-review.page.json +115 -0
- package/examples/pages/storyink-0.4.0.page.json +77 -0
- package/examples/pages/storyink-0.4.0.scrolly.page.json +32 -0
- package/examples/pages/storyink-recap.page.json +105 -0
- package/package.json +7 -2
- package/schema/storyink.schema.json +1341 -146
- package/skill/SKILL.md +126 -2
- package/dist/chunks/index-e919a5xm.js +0 -10375
- package/dist/chunks/index-p76hjvyg.js +0 -557
- /package/dist/chunks/{index-ygm89806.js → index-ak40qeya.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,131 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
- **Scrollytelling and slides: viewer** — figure API `beats()` and `moveTo({ beat } | { t },
|
|
6
|
+
{ animate })` (forward plays, 2.5× across two or more beats; backward rewinds like ←; reduced
|
|
7
|
+
motion / `animate: false` jump to the settled state with a pure follow camera). Scrolly
|
|
8
|
+
controller: `sp-scrolly-live`, the step crossing a 55 % trigger line is `.is-active` and moves
|
|
9
|
+
the figure; figure transport / gate / rail hidden in scrolly (zoom, Fit, Expand stay); cite hover
|
|
10
|
+
highlights and file cites open the drawer; `#scrolly=<id>&step=<n>` (settled, for snapshots).
|
|
11
|
+
Deck (present mode): `html.sp-presenting`, `.is-current` slide in a 1280×720 frame scaled to fit
|
|
12
|
+
(`--sp-slide-scale`), builds from page data (entry forward = start, backward = end), keys →
|
|
13
|
+
Space PgDn Enter / ← PgUp Backspace / Home End / O outline / ? help / Esc / P, Present button,
|
|
14
|
+
chrome (progress, `n / N`, prev / next), figure keys off while presenting, `#present=1|0`,
|
|
15
|
+
`#slide=n`, `#build=k`, `layout: "slides"` opens presenting; `slide-overflow` lint (content
|
|
16
|
+
needing a scale under 0.7). `__storyink.deck = { present, exit, next, prev, state }`. Snapshot
|
|
17
|
+
`--slides [--builds]`, `--scrolly <id|all>` (plugin `slides`, `builds`, `scrolly`): frames +
|
|
18
|
+
labelled sheets per theme, gates ready / lint / deterministic, `--preview`.
|
|
19
|
+
`scripts/deck-verify.ts` (`bun run verify:deck`).
|
|
20
|
+
- **Scrollytelling and slides (pages)**: `scrolly` block (a figure pinned beside prose step
|
|
21
|
+
cards; each step's `at` names a story step id, chapter stop, beat number, `start` or `end`;
|
|
22
|
+
`steps: "auto"` from narrated steps or stops; cites; decreasing targets warn), static / no-JS /
|
|
23
|
+
print fallback and live CSS (sticky graphic, `.is-active` steps, narrow stacking). Slides from
|
|
24
|
+
the same DOM: `layout: "slides"`, `present`, section `slide: { layout }`, `break` blocks, figure
|
|
25
|
+
`builds`; title slide + one slide per section, layouts `title` / `full` / `split` / `center` /
|
|
26
|
+
`flow` (auto inferred; `data-fig-shape="tall|wide"` gives tall figures the full slide height),
|
|
27
|
+
slide content CSS inside the viewer's 1280×720 frame, Present button. Figure `spec` paths may be
|
|
28
|
+
relative, absolute, `file://` or `~/`. Page data gains
|
|
29
|
+
`scrolly` and `slides` (targets `{ beat, t }` resolved from the figure timelines). Pages markup
|
|
30
|
+
gains `.sp-slide` wrappers (`display: contents` in the article) and `data-layout` /
|
|
31
|
+
`data-present`. Examples: `payment-retry.scrolly`, `storyink-0.4.0.scrolly`, `pr-review.deck`.
|
|
32
|
+
- **Pages** (`"type": "page"`): offline single-file explainer documents (PR / diff reviews, plan
|
|
33
|
+
reviews, recaps) rendered from JSON: header (eyebrow, title, subtitle, `change` meta, summary,
|
|
34
|
+
theme toggle), sticky contents sidebar with scroll-spy (auto at ≥ 4 sections; a top list on
|
|
35
|
+
narrow screens / without JS), sections of blocks: `prose` (safe Markdown subset, no raw HTML),
|
|
36
|
+
`figure` (an embedded storyink diagram, spec object or path, with a `claim` caption), `kpis`,
|
|
37
|
+
`table`, `cards`, `callout`, `filemap` (tree with status, +/− and bars; collapses past 16
|
|
38
|
+
files), `diff` (from `--changes` or hunk text), `code`, `risks`, `decisions`, `evidence`,
|
|
39
|
+
`timeline`, `checklist`, `details`, `columns`. Serif reading measure, wide figures / tables /
|
|
40
|
+
diffs, semantic tones on the delta palette (`pagePalettes` / `page` tokens), both themes, print
|
|
41
|
+
stylesheet. Core: `isPageSpec`, `validatePage` (figure diagnostics prefixed with the figure
|
|
42
|
+
path), `renderPageHtml`, `resolvePageChanges`, `layoutPage`; Node: `loadPage`, `writePage`.
|
|
43
|
+
CLI `render` / `validate` and the plugin's `storyink_render` / `storyink_validate` (new `path`
|
|
44
|
+
param on render) detect pages and resolve figure paths; `--svg` / `--animated-svg` on a page are
|
|
45
|
+
errors. Schema: root `type: "page"` alternative. The drawer's HTML diff is now a shared
|
|
46
|
+
`DiffView` (`src/core/render/DiffView.tsx`, same markup). Diagram `validate()` points pages at
|
|
47
|
+
`validatePage`. Examples in `examples/pages/`. Single-diagram output unchanged.
|
|
48
|
+
- **Pages: viewer** — page figures are the interactive viewer embedded (`renderFigure` →
|
|
49
|
+
server-rendered App in embedded mode): captions above an aspect-sized stage, compact toolbar (no
|
|
50
|
+
theme button, Expand), transport, gate, pan / zoom (wheel zoom needs Ctrl / ⌘ unless expanded so
|
|
51
|
+
the page scrolls), story playback, follow camera, narration rail beside the stage when the figure
|
|
52
|
+
is wide (container query) else below, drawer as a page overlay, Expand (fills the window; Esc
|
|
53
|
+
returns). The viewer bundle detects `#storyink-page-data` and hydrates every `[data-si-fig]` root:
|
|
54
|
+
keys act only on the focused figure (tabindex, click focuses), `#fig=<id>` scopes `t` / `camera`
|
|
55
|
+
/ `motion` / `pace` / `drawer` / `rail` / `autoplay` / `static` to a figure (page-wide: `theme`,
|
|
56
|
+
`static=1`), unrelated hash changes (TOC anchors) don't refit, exports / counters / lint are
|
|
57
|
+
per figure, `__storyink = { page: true, figures: { id: api }, ready, whenReady, lint }`.
|
|
58
|
+
`#fig=<id>&solo=1` shows only that figure with the standalone chrome and contract. `idPrefix`
|
|
59
|
+
on `Diagram` / `renderSvg` (every def id and `url(#…)`), default empty. Snapshot detects page
|
|
60
|
+
HTML: full-page PNG per theme (width 1280; figures at their final frame), gates ready / lint
|
|
61
|
+
(figures + page text overflow) / deterministic, `--preview` split into ≤ 3 parts;
|
|
62
|
+
`--figure <id>` (tool param `figure`) runs the single-diagram pipeline on one figure.
|
|
63
|
+
`scripts/page-verify.ts` (`bun run verify:page`). Single-diagram output unchanged.
|
|
64
|
+
- **Change stories**: story step `change` (before look until the step: removed = plain, added =
|
|
65
|
+
absent, modified = plain; then removed edges retract and ghost, removed nodes strike and fade,
|
|
66
|
+
added ones reveal / draw on, modified ones flash and turn gold, diff nodes apply; badges, strikes
|
|
67
|
+
and legend items follow); `story: "changes"` / `{ steps: "changes" }` / `--story changes` /
|
|
68
|
+
tool `story: "changes"` derive the walkthrough (data-flow order, edges and attached diff nodes
|
|
69
|
+
per beat, hero pulse trains, overview, `narrate` from `summary`); `focus` takes a list (union
|
|
70
|
+
box); `spotlight: "veil"` (soft rounded cutout around the step's focus, gliding, gone at the
|
|
71
|
+
end; HTML and animated SVG). Animated SVG: diff rows settle exactly (tighter keyframe tolerance).
|
|
72
|
+
- **Narration rail and change drawer** (HTML viewer): story step `narrate: { heading?, body,
|
|
73
|
+
cites? }` (cites link body text to element ids, `node#row` or `path#L12-20`; validated in order,
|
|
74
|
+
refs must resolve). A narrated step without a caption captions with its heading (or the body's
|
|
75
|
+
first sentence) at compile time, so the animated SVG and beat tiles agree; narrated beats hold
|
|
76
|
+
for their body. The viewer shows a rail ("02 / 06", heading, body with cites) that tracks the
|
|
77
|
+
header caption's beat through playback, the scrubber, → / ← and the gate; side column on wide
|
|
78
|
+
screens, bottom sheet below 760 px; toolbar toggle and `N`. Clicking (not dragging) an element
|
|
79
|
+
with `summary` / `files` / a delta opens a drawer with its badge, stat, summary and file refs,
|
|
80
|
+
and with `--changes` the selected hunks as an HTML diff (gutter, tints, syntax colours,
|
|
81
|
+
intra-line marks); Esc / × close it. `#drawer=<id|path>`, `#rail=0|1`,
|
|
82
|
+
`__storyink.openDrawer(id)` / `closeDrawer()` / `drawer()`, `steps[i].narrate`. The scene carries
|
|
83
|
+
embedded `changes` for the drawer. `storyink snapshot --rail --drawer <id>` (tool params `rail`,
|
|
84
|
+
`drawer`; captures the 16:9 page viewport, gates compare the same configuration). The drawer
|
|
85
|
+
takes the rail's column while open. `scripts/narrate-verify.ts` (`bun run verify:narrate`). Example:
|
|
86
|
+
`examples/changes/storyink-0.4.0.pr.json` (commit b526d50). Specs without these fields render
|
|
87
|
+
byte-identically.
|
|
88
|
+
- **Diff code nodes**: `code` nodes take `diff` (unified hunk text, `{ file, lines?, context?,
|
|
89
|
+
max? }` resolved by `--changes`, or resolved `{ file, hunks }`): gutter with old | new numbers,
|
|
90
|
+
`+` / `−` markers, sage / rose row tints (`diffAddBg` / `diffDelBg` tokens) with stronger
|
|
91
|
+
intra-line marks (token-level LCS), muted `@@` hunk headers with their section, per-language
|
|
92
|
+
syntax colours, a `… N more lines` fold (`max`, default 24) and long lines cut at 72 columns.
|
|
93
|
+
Anchors `node#+14` (head line) / `node#-13` (base line); `line` takes them and `{ id, hunk }`.
|
|
94
|
+
Story step `apply` (`"id"` or `{ id, hunk?, cps? }`): the node shows the base version until
|
|
95
|
+
then, removed rows tint and strike, added rows open (rows below slide) and type in, gutter
|
|
96
|
+
numbers fade in; HTML and animated SVG. Validation for diff shapes (an unresolved `{ file }`
|
|
97
|
+
without `--changes` is an error with a hint), anchors, `apply` and set / clear / type on diff
|
|
98
|
+
nodes. `diffRows(hunks, lang, { max?, headers? })` row model in `storyink/core`. Animated SVG:
|
|
99
|
+
wired dashed edges and the labels of wired edges now fade with their draw (as in the HTML).
|
|
100
|
+
Change scenes: `unchanged` nodes use the neutral accent. Examples: `payment-retry`,
|
|
101
|
+
`etl-dedupe` (Python + SQL), `storyink-core` (rendered with `--changes`).
|
|
102
|
+
- **Change diagrams**: `delta` (`added` / `modified` / `removed` / `unchanged`) on nodes, groups,
|
|
103
|
+
edges, participants and messages; `emphasis` (`hero` / `muted`) on edges and messages; `stat`
|
|
104
|
+
(`+38 −12`), `summary` and `files` (paths or `{ path, lines, revision }`); root `change`
|
|
105
|
+
(`base → head` shown above the diagram) and `style.legend`. Added = sage + `NEW` badge,
|
|
106
|
+
modified = gold + `CHANGED`, removed = rose dashed ghost with a struck label + `REMOVED`,
|
|
107
|
+
unchanged = receded context; hero edges are thicker with a soft glow. Layout reserves badge room
|
|
108
|
+
(header strip, top strip, right slot or a centred row by shape) and a legend band listing the
|
|
109
|
+
deltas present. Static SVG, HTML and animated SVG (change scenes use the union SMIL mode; removed
|
|
110
|
+
edges draw on by opacity so they keep their dash); composes with story levels and rich nodes.
|
|
111
|
+
Validation with JSON paths and hints (enums, file refs, negative stats, added edges to removed
|
|
112
|
+
nodes, more than 2 hero edges). New palette `deltaPalettes` and `delta` geometry tokens, emitted
|
|
113
|
+
only when a scene uses them: specs without the new fields render byte-identically. Examples in
|
|
114
|
+
`examples/changes/` (`batch-email` ported from PR Lens, `auth-session-to-jwt` sequence,
|
|
115
|
+
`rate-limit-plugin` with panel / code / chip deltas).
|
|
116
|
+
- **Diff ingestion**: `storyink diff [<range>|<base> [<head>]] [--staged] [--patch file|-] [-o
|
|
117
|
+
changes.json] [--json] [-- <pathspec>…]` parses `git diff` (default: working tree vs the merge
|
|
118
|
+
base with main/master) into a `DiffSet` and prints a per-file summary; `render --changes
|
|
119
|
+
<changes.json|.diff|.patch>` resolves the spec first. Core (browser-safe): `parseUnifiedDiff`,
|
|
120
|
+
`parseHunks`, `selectHunks`, `statFor`, `langForPath`, `normalizeLang`, `coverage`,
|
|
121
|
+
`resolveChanges` (fills `stat` from `files`, resolves `diff: { file, lines }` code nodes,
|
|
122
|
+
embeds the referenced hunks as `changes`, capped at 400 lines per file, and warns about
|
|
123
|
+
uncovered files / hunks and refs that miss the diff). Node: `gitDiff`, `diffSetFrom`.
|
|
124
|
+
Plugin: `storyink_diff` tool and `changes` on `storyink_render`.
|
|
125
|
+
- **Code languages**: `py`, `go`, `rust`, `sql`, `yaml`, `sh` lexers; `lang` aliases (`python`,
|
|
126
|
+
`golang`, `rs`, `yml`, `bash`/`shell`/`zsh`, `typescript`/`tsx`, `javascript`/`jsx`) are
|
|
127
|
+
accepted and normalized. TS / JS / JSON colouring is unchanged.
|
|
128
|
+
|
|
3
129
|
## 0.4.0
|
|
4
130
|
|
|
5
131
|
- **Rich nodes** (architecture, dataflow, workflow): `panel` (window with rows: `tag`, `icon`,
|