egatari 0.6.7-rc.1 → 0.6.8-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 (59) hide show
  1. package/CHANGELOG.md +92 -1
  2. package/README.ja.md +2 -2
  3. package/README.md +2 -2
  4. package/bin/egatari.mjs +2 -1
  5. package/components.lock.json +6 -3
  6. package/components2.lock.json +119 -1
  7. package/kit/check-messages.mjs +9 -0
  8. package/kit/check.mjs +12 -2
  9. package/kit/core/colab-core.mjs +1 -1
  10. package/kit/core/color-vocab.mjs +172 -0
  11. package/kit/core/layout-scan.mjs +23 -0
  12. package/kit/core/llm-fix.mjs +2 -2
  13. package/kit/core/llm-pack-data.mjs +9 -9
  14. package/kit/deck.js +18 -1
  15. package/kit/instruction-version.json +1 -1
  16. package/kit/player.json +1 -1
  17. package/kit/player.lock.json +2 -2
  18. package/package.json +3 -1
  19. package/themes/asagi/theme.json +1 -1
  20. package/themes/asagi/tokens.css +1 -0
  21. package/themes/business/theme.json +1 -1
  22. package/themes/business/tokens.css +1 -0
  23. package/themes/default/README.ja.md +12 -1
  24. package/themes/default/README.md +12 -1
  25. package/themes/default/theme.json +1 -1
  26. package/themes/default/tokens.css +1 -0
  27. package/themes/kogecha/theme.json +1 -1
  28. package/themes/kogecha/tokens.css +1 -0
  29. package/themes/kokugo/theme.json +2 -1
  30. package/themes/kokugo/tokens.css +1 -0
  31. package/themes/murasaki/theme.json +1 -1
  32. package/themes/murasaki/tokens.css +1 -0
  33. package/themes/sumi/theme.json +1 -1
  34. package/themes/sumi/tokens.css +1 -0
  35. package/themes/tokiwa/theme.json +1 -1
  36. package/themes/tokiwa/tokens.css +1 -0
  37. package/themes.lock.json +92 -24
  38. package/tools/ids-of.mjs +69 -0
  39. package/vendor/components/CATALOG.md +2 -2
  40. package/vendor/components/sha256/2e9a35ce9e289196d0b5fd24b8546cf6e0f4a6df857e69f4f78e686cabb00e61/index.js +465 -0
  41. package/vendor/components/sha256/340f7678bb19a64f9d4ed63b95d290046367a6b49c44977184f1cec1e97a7d68/index.js +916 -0
  42. package/vendor/components-2/manifest-2.5.1.json +1919 -0
  43. package/vendor/egatari-spec/SOURCE.json +2 -2
  44. package/vendor/themes/asagi/1.0.0/theme.json +14 -0
  45. package/vendor/themes/asagi/1.0.0/tokens.css +17 -0
  46. package/vendor/themes/business/1.0.1/theme.json +5 -0
  47. package/vendor/themes/business/1.0.1/tokens.css +28 -0
  48. package/vendor/themes/default/1.2.0/theme.json +4 -0
  49. package/vendor/themes/default/1.2.0/tokens.css +73 -0
  50. package/vendor/themes/kogecha/1.0.0/theme.json +10 -0
  51. package/vendor/themes/kogecha/1.0.0/tokens.css +16 -0
  52. package/vendor/themes/kokugo/1.0.0/theme.json +4 -0
  53. package/vendor/themes/kokugo/1.0.0/tokens.css +12 -0
  54. package/vendor/themes/murasaki/1.0.0/theme.json +10 -0
  55. package/vendor/themes/murasaki/1.0.0/tokens.css +12 -0
  56. package/vendor/themes/sumi/1.0.0/theme.json +10 -0
  57. package/vendor/themes/sumi/1.0.0/tokens.css +36 -0
  58. package/vendor/themes/tokiwa/1.0.0/theme.json +10 -0
  59. package/vendor/themes/tokiwa/1.0.0/tokens.css +14 -0
package/CHANGELOG.md CHANGED
@@ -8,6 +8,96 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
8
8
 
9
9
  <!-- Unreleased changes are fragments in changes/*.md (see CONTRIBUTING.md "Changelog"); node tools/changelog.mjs --release X.Y.Z moves them here. -->
10
10
 
11
+ ## [0.6.7] - 2026-11-09
12
+
13
+ ### Added
14
+
15
+ - Editor app: **File ▾ → Export ▸ → Make a video (MP4)…** (backlog #131). A short dialog says videos are made in Google Colab, asks you to upload this lesson's file (`<name>.ega.html`) there,
16
+ and that the Egatari file plays without making a video. **Open Colab** opens the video notebook (`colab/egatari-video.ipynb`) in a new tab; with unsaved changes the button is **Save and open Colab**,
17
+ in a working folder not exported yet **Save as Egatari file and open Colab** (save or export first, then open). If steps need their audio updated, one line gives the count.
18
+ When the new tab is blocked, a link to the notebook
19
+ - `colabVideoUrl()` and `COLAB.videoNotebook` (`kit/core/colab-core.mjs`)
20
+ - Video: optional background music, `tools/video.mjs … --music <file>` (`render.mjs --music`): one track under the whole video, 12 dB quieter while the script is spoken, faded out at the end. Nothing to set (no seconds, no beat sync); the levels come from the script windows, so the same input gives the same audio (#131)
21
+ - Colab: a video notebook `colab/egatari-video.ipynb` (CPU runtime, generated by `tools/make-colab-notebook.mjs`): upload the lesson's `.ega.html` (and, optionally, the background music), it runs `tools/video.mjs` and downloads `full.mp4` (and the chapters as a ZIP) (#131)
22
+ - SCORM 1.2 package for LMSs ([binding](https://github.com/egatari/egatari-spec/blob/main/bindings/scorm12.md), backlog #182):
23
+ `egatari build <working folder> --scorm` writes `<lesson title>.scorm.zip`, and the editor has **File ▾ → Export ▸ For an LMS
24
+ (SCORM)…** with a dialog that says what the LMS records and when the lesson counts as completed (`metadata.completion` in plain
25
+ words), then **Download**. The zip holds `imsmanifest.xml` (one SCO, `egatari-<docId>`, the lesson title) and the play-only copy as
26
+ `index.html`, byte for byte what `--play-only` writes. Fixed order and times, no compression: the same lesson gives the same bytes.
27
+ No masteryscore: the player reports completed by `metadata.completion` and sends no score. Refused when `deck-meta.tracking` has no
28
+ `scorm12` or the resume data could exceed 4096 characters (`kit/core/scorm.mjs`)
29
+ - A small dependency-free ZIP writer shared by the CLI and the editor (`kit/core/zip-write.mjs`); the AI instructions' skill zip now
30
+ uses it too (same bytes as before)
31
+ - Tests: `tools/test-scorm.mjs` (zip layout and determinism, the manifest against the binding's rules, refusals, and the package
32
+ launched in a frame under a parent page with a fake SCORM 1.2 API for each completion rule) and `tools/test-app-scorm.mjs` (the
33
+ export dialog in ja and en, Cancel, the downloaded zip, unsaved changes)
34
+ - Quality check: `balance` (R-balance, phase 1, info only). On each slide's final step the body (`.body`) is rasterised and the pixels that differ from the slide background are measured: the vertical offset of their centre of mass from the optical centre (45% from the top), the horizontal offset from the middle, and the one-sided empty band (the largest difference between opposite margins) with its side. A slide is reported only when its body has a visual (an `m-*` part, `svg`, `img`, `table` or `.katex-display`) with the empty band right below the lowest one (the figure could be taller); text-only slides are not reported, since lessons start at the top. The content must also sit high (centre of mass more than 10% of the body height above the optical centre) and the band below is more than 25% larger than the band above (`layout-tate`: content to the right and the left empty, also only with a visual). Even margins all round score about 0. The message gives the numbers only. Cover, section divider and `static` slides are skipped; the conclusion line is outside the body and not measured. The finding never counts as an error or warning and is left out of fix requests (`kit/core/fill-measure.mjs`, `kit/fill-scan.mjs`)
35
+ - `node tools/fill-report.mjs <deck.html | folder …> [--json]` prints whether the slide has a visual, the vertical and horizontal offsets, the one-sided band and its side and whether the slide is flagged, per slide, for tuning the thresholds on a set of lessons
36
+ - Font subsetting keeps the characters each part used declares it draws itself (`glyphs`: in the parts library record, the `egatariParts.define` meta or `static glyphs`; a string, or per language `{ja, en}` of which the lesson's language is used), such as the island names of m-map-japan.
37
+ - The quality checker reports `fontNotCovered` (info) when visible characters are in no embedded font (they show in the device's font); `node tools/font-coverage.mjs <built.html>` lists them.
38
+ - Editor, New…: a third entry on its first screen, next to **Paste the AI’s output**: **Make one based on this sample**
39
+ (このサンプルを参考に作る), with “Keeps its structure, theme and parts; the content is new, from your topic.” under it. It opens a picker with
40
+ the same samples as the first screen (**Choose** on each) and then New… from that sample, exactly as the sample window’s button does
41
+ - Build: `metadata.offer` in `egatari.json` (format spec §1.2) is copied into `deck-meta.offer` by every build (the working
42
+ folder's `out/deck.html`, the Egatari file and its play-only copy) and into the index's `metadata.offer`, together with
43
+ `metadata.primary`; a former `learn` is written as `talk`, unknown values are dropped. Reading a file accepts the former `learn`
44
+
45
+ ### Changed
46
+
47
+ - Components 2.0 lessons use egatari/components **v2.4.4** by default. `m-map-japan` and `m-map-world` 2.0.3: in an English lesson (`ctx.lang` not `ja`) name and value chips are as tall as the English font's text box (Source Sans 3: 1.43 em), fixing a 3 px `svgTextBox` overflow; `m-map-japan` also writes its built-in island names and inset captions in English (Takeshima, Senkaku Islands, Okinotorishima, Minamitorishima, Chichijima, Iwo To, Nansei Islands, Ogasawara Islands) instead of overflowing their label boxes in the English font. Both parts now declare `static glyphs` so a built lesson keeps those built-in characters (including the English names) when it subsets its fonts. Japanese lessons draw as before. No other part changes version. The AI instructions are unchanged apart from their version line
48
+ - Components 2.0 lessons use egatari/components **v2.5.0** by default. `m-cards` 2.0.3: the card frames stay where they were and each card's content is centred vertically in the spare height of the card; the cards README gains guidance on using cards instead of bullets (short steps as cards with arrows). `m-map-japan` 2.0.4: prefecture and region names, the legend, the readable summary and the default `aria-label` are written in English when `ctx.lang` is not `ja` (romanisation after MLIT/GSI; data keys unchanged). `m-fishbone` and `m-tree` 2.0.3: their note for the AI instructions has English and Japanese text, so the English instructions no longer carry Japanese lines. `m-compare` stays 2.0.2 (top-aligned). Japanese lessons draw as before apart from the cards. No other part changes version
49
+ - Embedded fonts are subset to the characters the lesson uses (#178): each `@fontsource` chunk the lesson needs is cut down with harfbuzz (wasm, `harfbuzzjs` 1.6.4) and re-encoded as woff2 (`wawoff2` 2.0.1), with `unicode-range` set to exactly the characters the subset font maps. This applies to `build`, `--portable`, `--play-only`, the bundled examples and the editor's save and export (the editor loads the subsetter, `font-subset.js`, on the first export; its fonts are byte-identical to the command line). The output is byte-stable across runs and operating systems. The rashomon example goes from 12.2 MB to 2.4 MB. Fonts with a Reserved Font Name (Source Sans 3, Source Serif 4, Source Code Pro) are embedded unchanged. `EGATARI_FONT_SUBSET=0` turns it off.
50
+ - Editor, tier A saves: new characters in the script or the book get a font supplement in every embedded font (BIZ UDPMincho and the chosen Japanese fonts too, not only BIZ UDPGothic and Source Sans 3), cut down to those characters. Without the font files (the offline `editor.html` has no Mincho) the editor saves anyway and names the characters that will show in the device's font, instead of refusing.
51
+ - Components 2.0 lessons use egatari/components **v2.4.3** by default: the 16 standard parts (bars, curves, cards, flow, compare, fishbone, menu, pie, cycle, predict, scatter, venn, tree, quad, kpi, timeline) gain English docs (`README.en.md`); no part's code or version changes
52
+ - English AI instructions now describe those 16 parts from their English docs (summary, steps, prop meanings, example data, notes) instead of the Japanese README; each part's English text is checked to be no longer than its Japanese one, and the English example data must have the same shape as the part's own example.
53
+ English packs get smaller in bytes (free standard 35.4 → 29.5 KB, paid standard 71.0 → 47.7 KB, paid every set 131.0 → 106.9 KB)
54
+ - On the free plan, some English single-set instructions now leave out one more standard part to fit the paste length: math also leaves out `m-pie`, maps `m-fishbone`, kokugo `m-cycle`, science `m-tree` (stats is unchanged).
55
+ The Japanese instructions are unchanged apart from their version line and the parts' docs link (v2.4.3)
56
+ - `?from-sample=<name>` (the names in `examples.json`, e.g. `kokugo-kanbun`; combines with `?lang=`) with an unknown name now opens New…
57
+ as usual with one line at the top, “Sample “…” not found. New… is open.”, instead of a notice on the first screen. The sample list is built
58
+ into each version, so the link opens that version’s samples at the site root, inside a frozen copy (`/vX.Y.Z/`) and in the offline editor
59
+ - Editor, New… step 4: the question no longer asks for the chat AI's plan (free or paid); it asks **Choose the instructions for the AI**
60
+ (AI に渡す指示を選んでください): **Light (any AI)**, marked “If unsure” (the default), or **Detailed (for paid AI plans)**, each with a
61
+ line saying what it is (owner's decision, 2026-11-07). The line “Egatari is free. This asks about your chat AI's plan.” is gone
62
+ - The answered line, the shortening notice and the size hint name the instructions (“Instructions: Light · 15 parts · copied”, “To fit the
63
+ light instructions, …”); the attach-as-a-file line reads “Gemini may cut a copy-and-paste at about 30,000 characters”. The internal names
64
+ (`plan: free | paid`, `--plan`, `studio.newDeck.plan`) and the instructions themselves are byte for byte unchanged
65
+ - Glossary: light instructions (軽量の指示) and detailed instructions (詳細の指示) replace free plan and paid plan; 無料のプラン, 有料のプラン
66
+ and 無制限 (the detailed instructions have a 150 KB cap) are avoid words. README, the editor docs, the AI-instruction docs' preamble and size
67
+ table, the make skill and `node kit/llm-pack.mjs --help` use the new words
68
+ - Editor app: the preview always passes the chosen mode (`?mode=talk` or `video`), so a lesson's `offer.open` does not change
69
+ what the preview shows; a former `learn` preview mode is read as the slide show
70
+ - Docs: reference, contract and editor describe playback in the slide show and the offered modes and faces instead of the
71
+ `learn` mode; the termbase replaces the undecided self-study row with Play / Pause and Playback speed
72
+ - Egatari Player 1.4.0 (the bundled player that files carry, `player` in the index and `deck-meta`): minor release. Self-study is
73
+ the slide show with playback, for a file opened directly or in an LMS: the toolbar starts with previous, **Play** / **Pause**,
74
+ next and **Playback speed** (0.75–2×, pitch kept; `<` / `>`), and keeps the presenter tools. Pausing resumes from the same point;
75
+ while playing, the toolbar's previous / next, digits + Enter and the overview keep playing, while the presenter's step keys pause
76
+ - Egatari Player 1.4.0: `deck-meta.offer` (format §1.2, Player P1) is applied. The lesson opens in `offer.open` {mode, face}
77
+ (order: `?mode` / `?layout` / embedding, the viewer's remembered layout, `offer.open`, `metadata.primary`, `<html data-mode>`,
78
+ defaults), and faces not in `offer.faces` are left out of View, `r` and Read in the book. Embedding answers `{egatari:"mode"}`
79
+ - Egatari Player 1.4.0: `video` opened by a person (through `offer.open.mode` or `?mode=video` outside the export) shows one
80
+ **Play** button; pressing it plays the lesson along the timeline to the end with no other controls (Player P1, spec 609e145).
81
+ The video export runs in an automated browser and is unchanged (same clips, byte for byte)
82
+ - Egatari Player 1.4.0: in an LMS with SCORM 1.2, every commit also writes `cmi.core.session_time` and `cmi.core.exit`, and the
83
+ player commits on `beforeunload` too, so resume and time spent reach LMSs that store with synchronous requests (ILIAS) (`kit/track.js`)
84
+
85
+ ### Removed
86
+
87
+ - Egatari Player 1.4.0: the `learn` mode (Player P1, spec 60eda15). A `?mode=learn`, a `learn` in `deck-meta.offer`, in
88
+ `<html data-mode>` or in an embedding `{egatari:"mode"}` command is read as `talk`; parts get `ctx.mode` `talk` or `video` only
89
+
90
+ ### Fixed
91
+
92
+ - Video export (`render/render.mjs`): the audio is now one continuous 48 kHz track for the whole lesson, with each step's audio at its exact sample position on the cumulative timeline. `--full` used to join the clips' AAC audio and encode it again, so each seam was off by up to ±8 ms (the clips' lengths are rounded to frames) and could click, and the whole track was 1024 samples (23 ms) late; the video of `full.mp4` was also 21 ms late. Now the seams are exact (within 1 sample in the new test), and `full.mp4` and `chapter_NN.mp4` are in sync with the timeline within 1 ms. A clip's audio is the slice of the same track between its frames. Checked by `tools/test-render-audio.mjs` (CI tier2)
93
+ - SCORM 1.2 resume and time spent on LMSs that store with synchronous requests (seen on ILIAS): the player now writes
94
+ `cmi.core.session_time` and `cmi.core.exit` (`suspend`, or `""` once completed) with every commit, and also commits on
95
+ `beforeunload`, not only on `pagehide`. Chrome and Safari block synchronous requests while a page goes away, so the final
96
+ commit in `pagehide` never reached ILIAS: `exit` stayed unset (the next launch started from the first slide) and the time spent
97
+ stayed 0. `session_time` is counted in whole hundredths of a second, so it never reads `:60.00`. `tools/test-scorm.mjs` closes and
98
+ reopens the package under a strict SCORM 1.2 model (value formats, read-only elements, `entry` from the stored `exit`, stores
99
+ lost while the page goes away) (`kit/track.js`)
100
+
11
101
  ## [0.6.6] - 2026-11-08
12
102
 
13
103
  ### Added
@@ -1301,7 +1391,8 @@ First public release.
1301
1391
  - Docs: README (English and Japanese), the contract (`docs/contract.md`), a reference of every option, syntax and key (`docs/reference.md`, `docs/reference.ja.md`), guides for the dev server and video, CONTRIBUTING, SECURITY, issue forms
1302
1392
  - Tests (`npm test`) and GitHub Actions running them on Node 22 and 24, plus a TTS dry-run through video export
1303
1393
 
1304
- [Unreleased]: https://github.com/egatari/egatari-studio/compare/v0.6.6...HEAD
1394
+ [Unreleased]: https://github.com/egatari/egatari-studio/compare/v0.6.7...HEAD
1395
+ [0.6.7]: https://github.com/egatari/egatari-studio/compare/v0.6.6...v0.6.7
1305
1396
  [0.6.6]: https://github.com/egatari/egatari-studio/compare/v0.6.5...v0.6.6
1306
1397
  [0.6.5]: https://github.com/egatari/egatari-studio/compare/v0.6.4...v0.6.5
1307
1398
  [0.6.4]: https://github.com/egatari/egatari-studio/compare/v0.6.3...v0.6.4
package/README.ja.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- i18n: pair=README.md sha256=30fe3a81805be834 -->
1
+ <!-- i18n: pair=README.md sha256=0d671e51a6da4638 -->
2
2
  <p align="center">
3
3
  <picture>
4
4
  <source media="(prefers-color-scheme: dark)" srcset="assets/logo/egatari-dark.svg">
@@ -130,7 +130,7 @@ npx egatari doctor # Node・uv・ffmpeg・ブラウザ・部
130
130
 
131
131
  Bun(`bunx egatari`)でも動きます。
132
132
 
133
- ほかのコマンド(`ids`・`sheet`・`comment-shots`・`portable`・`video`・`tts`)は `npx egatari --help` に出る。`npx egatari video <作業フォルダ | .ega.html>` は組んでから、今ある音声のまま動画にする(ffmpeg が要る)。相対パスは今いるフォルダから解く。組み立てが埋め込む既定の字体は包みに入っている(`get-fonts` は要らない)。同梱のテーマの字体(`asagi` の Zen Maru Gothic)も入っているので、同梱のテーマはどれも `npx egatari` だけで組める。教材の CSS や自分のテーマだけが名指せるほかの選べる字体(Klee One など)は、別の包み `@egatari/fonts-extra` にある(`npm i -D @egatari/fonts-extra`、または `npx -p egatari -p @egatari/fonts-extra egatari …`。要る教材なら `egatari build` と `check` が知らせる)。パーツライブラリの写しは、組み立てが読む `index.js` と使用条件だけを入れる(README・見本・変更の記録は入れない。`egatari doctor` が `index.js` を `components.lock.json` と manifest のファイルごとの sha256 で確かめる)。TTS の既定の声は初めての `egatari tts` で取り寄せる(上の「要るもの」)。`egatari tts` は uv で `tts/synth.py` を動かし、Python の環境を利用者のキャッシュのフォルダに作る(別の場所にするには `UV_PROJECT_ENVIRONMENT`)。
133
+ ほかのコマンド(`ids`・`ids-of`・`sheet`・`comment-shots`・`portable`・`video`・`tts`)は `npx egatari --help` に出る。`npx egatari ids-of <file.ega.html> […]` は、ファイルごとに 1 行で(タブ区切り。`--json` で JSON)、`docId`、ファイルの原稿から計算し直した `sourceSha256`(原稿の版。音声と組んだ部分は含まない。ファイルに書かれた値と違えば stderr に警告)、ファイル全体の SHA-256(ファイルそのものを表す。配布や LMS への登録の照合用)を出す。誰が公開したかは署名(形式 §10、まだ実装していない)の役目。`npx egatari video <作業フォルダ | .ega.html>` は組んでから、今ある音声のまま動画にする(ffmpeg が要る)。相対パスは今いるフォルダから解く。組み立てが埋め込む既定の字体は包みに入っている(`get-fonts` は要らない)。同梱のテーマの字体(`asagi` の Zen Maru Gothic)も入っているので、同梱のテーマはどれも `npx egatari` だけで組める。教材の CSS や自分のテーマだけが名指せるほかの選べる字体(Klee One など)は、別の包み `@egatari/fonts-extra` にある(`npm i -D @egatari/fonts-extra`、または `npx -p egatari -p @egatari/fonts-extra egatari …`。要る教材なら `egatari build` と `check` が知らせる)。パーツライブラリの写しは、組み立てが読む `index.js` と使用条件だけを入れる(README・見本・変更の記録は入れない。`egatari doctor` が `index.js` を `components.lock.json` と manifest のファイルごとの sha256 で確かめる)。TTS の既定の声は初めての `egatari tts` で取り寄せる(上の「要るもの」)。`egatari tts` は uv で `tts/synth.py` を動かし、Python の環境を利用者のキャッシュのフォルダに作る(別の場所にするには `UV_PROJECT_ENVIRONMENT`)。
134
134
 
135
135
  ## ブラウザで直す(開発サーバー)
136
136
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- i18n: pair=README.ja.md sha256=d08585b93be5e250 -->
1
+ <!-- i18n: pair=README.ja.md sha256=eb2c3d4dbdd4d423 -->
2
2
  <p align="center">
3
3
  <picture>
4
4
  <source media="(prefers-color-scheme: dark)" srcset="assets/logo/egatari-dark.svg">
@@ -130,7 +130,7 @@ npx egatari doctor # Node, uv, ffmpeg, a browser and the part
130
130
 
131
131
  Also runs with Bun (`bunx egatari`).
132
132
 
133
- `npx egatari --help` lists the other commands (`ids`, `sheet`, `comment-shots`, `portable`, `video`, `tts`). `npx egatari video <working folder | .ega.html>` builds and exports a lesson with its existing audio to video (needs ffmpeg). Relative paths are resolved from the current folder. The package carries the default fonts the build embeds (no `get-fonts`) and the fonts of the bundled themes (Zen Maru Gothic of `asagi`), so every bundled theme works from `npx egatari` alone. The other optional fonts, which only a lesson's own CSS or theme can name (such as Klee One), are in the separate package `@egatari/fonts-extra` (`npm i -D @egatari/fonts-extra`, or `npx -p egatari -p @egatari/fonts-extra egatari …`; `egatari build` and `check` say so when a lesson needs it). Of each vendored part, the package carries the `index.js` the build reads and its licence (not its README, demo or changelog; `egatari doctor` checks every `index.js` against `components.lock.json` and the manifests' per-file sha256). The default TTS voices are downloaded on the first `egatari tts` (see Requirements above). `egatari tts` runs `tts/synth.py` with uv and keeps its Python environment in your cache folder (set `UV_PROJECT_ENVIRONMENT` to put it elsewhere).
133
+ `npx egatari --help` lists the other commands (`ids`, `ids-of`, `sheet`, `comment-shots`, `portable`, `video`, `tts`). `npx egatari ids-of <file.ega.html> […]` prints, one line per file (tab-separated; `--json` for JSON), the `docId`, the `sourceSha256` recomputed from the file's source (the version of the source: it leaves out audio and built parts; a warning on stderr if it differs from the value written in the file) and the SHA-256 of the whole file (identifies the file itself, for checking at distribution or LMS upload). Who released it is a matter for signatures (format §10, not implemented yet). `npx egatari video <working folder | .ega.html>` builds and exports a lesson with its existing audio to video (needs ffmpeg). Relative paths are resolved from the current folder. The package carries the default fonts the build embeds (no `get-fonts`) and the fonts of the bundled themes (Zen Maru Gothic of `asagi`), so every bundled theme works from `npx egatari` alone. The other optional fonts, which only a lesson's own CSS or theme can name (such as Klee One), are in the separate package `@egatari/fonts-extra` (`npm i -D @egatari/fonts-extra`, or `npx -p egatari -p @egatari/fonts-extra egatari …`; `egatari build` and `check` say so when a lesson needs it). Of each vendored part, the package carries the `index.js` the build reads and its licence (not its README, demo or changelog; `egatari doctor` checks every `index.js` against `components.lock.json` and the manifests' per-file sha256). The default TTS voices are downloaded on the first `egatari tts` (see Requirements above). `egatari tts` runs `tts/synth.py` with uv and keeps its Python environment in your cache folder (set `UV_PROJECT_ENVIRONMENT` to put it elsewhere).
134
134
 
135
135
  ## Editing in the browser (dev server)
136
136
 
package/bin/egatari.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  // egatari コマンド(npm の包み egatari の bin。npx egatari …):各スクリプトに振り分けるだけ
3
- // egatari new|ids|check|build|dev|sheet|comment-shots|portable|video|tts|doctor|skills update [引数…]、egatari --version、egatari --help
3
+ // egatari new|ids|ids-of|check|build|dev|sheet|comment-shots|portable|video|tts|doctor|skills update [引数…]、egatari --version、egatari --help
4
4
  // 引数はそのままスクリプトに渡す。相対パスは呼び出した場所(cwd)から解く(INIT_CWD も cwd にそろえる)
5
5
  import fs from 'node:fs';
6
6
  import os from 'node:os';
@@ -22,6 +22,7 @@ const SCRIPTS = {
22
22
  sheet: ['tools/sheet.mjs', '全スライドの最終段階を 1 枚の画像に / contact sheet of every slide\'s last step', '<folder | deck.html | .ega.html> [out.png] [--steps] [--tiles] [--cols 4]'],
23
23
  'comment-shots': ['tools/comment-shots.mjs', '開発サーバーのコメントの画面を撮る / screenshots of open dev-server comments', '<folder | deck.html> [id …] [--all]'],
24
24
  ids: ['tools/ids.mjs', 'スライドに安定した id を付ける / give slides stable ids', '<folder | deck.html> [--dry-run]'],
25
+ 'ids-of': ['tools/ids-of.mjs', 'Egatari ファイルの docId・sourceSha256・ファイル全体の SHA-256 を 1 行ずつ出す / print docId, sourceSha256 and the whole-file SHA-256 of Egatari files', '<file.ega.html> [<file> …] [--json]'],
25
26
  portable: ['tools/portable.mjs', '1 ファイル(.ega.html)と作業フォルダの行き来 / single file (.ega.html) <-> working folder', 'unpack|pack|attach|compare …'],
26
27
  video: ['render/render.mjs', '音声の入った教材を動画に(ffmpeg が要る。音声は作らない)/ export a lesson with its audio to video (needs ffmpeg; makes no audio)', '<folder | .ega.html> または / or <out/deck.html> --out <dir> [--full] [--only key,…]'],
27
28
  };
@@ -3141,19 +3141,22 @@
3141
3141
  "2.0.0",
3142
3142
  "2.0.1",
3143
3143
  "2.0.2",
3144
- "2.0.3"
3144
+ "2.0.3",
3145
+ "2.0.4"
3145
3146
  ],
3146
3147
  "sha256": {
3147
3148
  "2.0.0": "6440523fdf4b08fe23bda918d6db8c4656a58a74bb81d4de8b205113483316a8",
3148
3149
  "2.0.1": "dbbd262ab28045a0f5e0cbec09b6068a0343668bf21e61bb02f8d0c4c1bc2ea7",
3149
3150
  "2.0.2": "7dbbb3852a77a1a3dcfba8c69574d2a87e6b87adbfa84f30c0359e2bae0afb2b",
3150
- "2.0.3": "d93729f39a0753001c9eef8ad2c12827aff99ff1807cb6891afb9e29b5c3491d"
3151
+ "2.0.3": "d93729f39a0753001c9eef8ad2c12827aff99ff1807cb6891afb9e29b5c3491d",
3152
+ "2.0.4": "b52d8e779ee991153bb3143733e4e2a4b72d08adda31c927992617ddf2097b0b"
3151
3153
  },
3152
3154
  "content": {
3153
3155
  "2.0.0": "41fb94497e0230488b8eb37688bd07109cdd5a03948b892ba621345a1a6314dd",
3154
3156
  "2.0.1": "b3ebd4ffde8bc39c7f9100642307cd83b9d32e072f1f894e7c4d6996a6cc0d21",
3155
3157
  "2.0.2": "6177d9adeb09f8c72c4105e521f723202623d8887ee9e03e53aec51073d33123",
3156
- "2.0.3": "37ea0051e8a1f2d7c2fa2d38e57730e5a3b1afabe9037a74fcad6e6f05356c09"
3158
+ "2.0.3": "37ea0051e8a1f2d7c2fa2d38e57730e5a3b1afabe9037a74fcad6e6f05356c09",
3159
+ "2.0.4": "2e9a35ce9e289196d0b5fd24b8546cf6e0f4a6df857e69f4f78e686cabb00e61"
3157
3160
  },
3158
3161
  "catalogue": "2"
3159
3162
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "source": "https://github.com/egatari/components",
3
- "default": "2.5.0",
3
+ "default": "2.5.1",
4
4
  "catalogues": {
5
5
  "2.0.0": {
6
6
  "tag": "v2.0.0",
@@ -1392,6 +1392,115 @@
1392
1392
  "tree": "554ed56e1ec963627be86ba1f573099ff57cf4cb22e8e10ce00e2128e30d39e2",
1393
1393
  "venn": "e1a0240f83e1925ee59ef2752662e2b0ec27f69251c012f8bab682aadcd8695f"
1394
1394
  }
1395
+ },
1396
+ "2.5.1": {
1397
+ "tag": "v2.5.1",
1398
+ "tarballSha256": "23c9f8ffb4324883089bf24d575cedead60875a148c42cba43e17a9460bce846",
1399
+ "manifestSha256": "d60e3c03b1ecd0e18ad52f538eb63a260cb2676ee78cdd252a0080b6edefdf7a",
1400
+ "parts": {
1401
+ "bars": "2.0.2",
1402
+ "base": "1.1.0",
1403
+ "boxplot": "2.0.4",
1404
+ "boxplot-core": "1.0.0",
1405
+ "cards": "2.0.3",
1406
+ "codetree": "2.0.4",
1407
+ "codetree-core": "1.0.0",
1408
+ "collect": "2.0.2",
1409
+ "compare": "2.0.2",
1410
+ "curves": "2.1.1",
1411
+ "cycle": "2.0.3",
1412
+ "expr": "1.0.0",
1413
+ "fishbone": "2.0.3",
1414
+ "flow": "2.0.3",
1415
+ "gendai": "2.0.2",
1416
+ "heatmap": "2.0.2",
1417
+ "heatmap-core": "1.0.0",
1418
+ "hissan": "2.0.2",
1419
+ "hist": "2.0.4",
1420
+ "hist-core": "1.0.0",
1421
+ "icons": "1.0.0",
1422
+ "kakijun": "2.0.1",
1423
+ "kanbun": "2.0.2",
1424
+ "kanbun-core": "1.0.0",
1425
+ "keyboard": "2.0.3",
1426
+ "kobun": "2.0.2",
1427
+ "kpi": "2.0.2",
1428
+ "map-japan": "2.0.4",
1429
+ "map-world": "2.0.3",
1430
+ "market": "2.0.2",
1431
+ "markup-reader": "1.0.1",
1432
+ "menu": "2.0.2",
1433
+ "numberline": "2.0.2",
1434
+ "orbit": "2.0.4",
1435
+ "particles": "2.0.0",
1436
+ "pie": "2.0.2",
1437
+ "plot": "1.1.1",
1438
+ "predict": "2.0.3",
1439
+ "quad": "2.0.3",
1440
+ "scatter": "2.0.4",
1441
+ "score": "2.1.0",
1442
+ "seq": "2.0.4",
1443
+ "shape": "1.0.0",
1444
+ "sweep": "2.1.1",
1445
+ "syntax": "2.0.2",
1446
+ "tape": "2.0.2",
1447
+ "timeline": "2.0.2",
1448
+ "timer": "2.0.3",
1449
+ "tree": "2.0.3",
1450
+ "venn": "2.0.2"
1451
+ },
1452
+ "content": {
1453
+ "bars": "520606a746b0d38fdc1aa380e665a1b95eead2487b11f389d2ebac4abe8f07cb",
1454
+ "base": "577008a069e7eb08057705a0800d975e82c8dfe0d0ba5fbf4f8974af7b298a7f",
1455
+ "boxplot": "2af8f6248ebd499dd036bffcac49b3e43fd8c74a0435bd256e2b1dbd8141b4d5",
1456
+ "boxplot-core": "fadd24868e2730ec14b8f3f1e9cb75b8577a48b8d71beaa12ef089f7a3ba0a7d",
1457
+ "cards": "f3d5b6ce53f40c5f355a67538ff11b9cd28297da6292125ccb6e055aeddef906",
1458
+ "codetree": "4f96929f3b539c459bb78196251009a5f80e607eebccfae641cec60e979efe0e",
1459
+ "codetree-core": "bb139fb1c2e4d010aa82a2c50db120f95f12a0a251cded3130a71dd57dec0274",
1460
+ "collect": "e6bbe784ee452d52d534b8fb3a0924e65c49bbb5926139ef5eabd9193500b357",
1461
+ "compare": "0cab77d128c5f304c2d2ba32841b0bc5adc54b4e72f6681e0a0dda68c96b5d7e",
1462
+ "curves": "96ad8eaf0ea7c23a31b72657964f23a02165765845991cafc41ee2835b97e40f",
1463
+ "cycle": "0787c5bbf2e61801398aeefc39a3674b1fc0e556173c450b85cafa4201cb44a6",
1464
+ "expr": "faf6a2f0b5df589639de624e75c5b20594f517e4426f6415d152809249b00b92",
1465
+ "fishbone": "782ae2154247b00451fc30aa140bf386d3a7a56ac4ad9ee04916f4bd1d29dda0",
1466
+ "flow": "28238c4fa50a377b96ce8a130ce5bdbf7bfc0536ed9c331499ea22377c43adb6",
1467
+ "gendai": "3c36a26fd78dffdfa114bd7c9ca5cae494117bbcdda14bee5c2a01351e5f2eb2",
1468
+ "heatmap": "2a6b20b93f1169ef2435cdf3bfca57d24c9111fe9aaf8e61f0d049cf8a70e9df",
1469
+ "heatmap-core": "de9607f86221006e7bad43f1f661c751d9a6f8f9c62da5c7e0d7f1249b9afcd6",
1470
+ "hissan": "328a440e91684524068076e96cba5771cdceaa274d4b90033656259f05467135",
1471
+ "hist": "f0ac8d6498c1f51ea963f6c0776937f9dc6d2a9f2ac0fdbe6243d94cc3bbc06d",
1472
+ "hist-core": "07013c263cc595382dbcfd4931ca8b016f9dfb673440adf28911c95bd465cf9d",
1473
+ "icons": "b2dfb4fa290d240024c95e2d24fda887db9fbc5b94f99b5be00c74c488fcfddb",
1474
+ "kakijun": "8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8",
1475
+ "kanbun": "556e7d45a761c4fa749cde186fb53f6c526ba6ede0b8f0f0bba5ac9e25e0d6f4",
1476
+ "kanbun-core": "f268cf809438c8af63a42f9c9121110fc7263e4d705c40c6206ce46cf7ec167b",
1477
+ "keyboard": "3dba49cbbf7853212a6e5c393de030430d02b8b1a2ba4c8b722db2bb8afad12f",
1478
+ "kobun": "de611e2477042b14eb9c04bb98ad0bbe6d7b44ca829213dd1a7a2b94d8f946ae",
1479
+ "kpi": "ef9c8c77ddf2b3953376a2db700c1277f550ea2606eab11cd8e18056dcba84c1",
1480
+ "map-japan": "340f7678bb19a64f9d4ed63b95d290046367a6b49c44977184f1cec1e97a7d68",
1481
+ "map-world": "bec04685638f8fc1217c380d361fd9a425ffeade0291a4f2b2d4e41a5628e0ef",
1482
+ "market": "5b44b272b917246219d2709f1b001964f87a3e07786cc9950087bbb8add3c721",
1483
+ "markup-reader": "03550bb20d425aa926258bab18b03bbc0cee292072e01bb6c78c429b3ae92c34",
1484
+ "menu": "e2181655ed2050668133e08eb14b5683cda48d6af8d76fd7b551c58798c95287",
1485
+ "numberline": "4e0e5eb48fc20ffc554786a7db66c4f5cee0c42eb0554bdc8c98323cdb168eb4",
1486
+ "orbit": "2e9a35ce9e289196d0b5fd24b8546cf6e0f4a6df857e69f4f78e686cabb00e61",
1487
+ "particles": "ec132caf4b4fd019fab20f9e9d6bc86266e30eb80a4fb8d2de4ca440ad45a098",
1488
+ "pie": "2f1c797ecd028d04ce12b3d55d8ef9d5a4180d564aa99afb492d0bfc9cd39c94",
1489
+ "plot": "80bf0ca9b592205315d09e2041df5aeb9e123e4129ada03cb4c7e0fd914a3bd7",
1490
+ "predict": "40571cbc11cd649c447da73ede0f89937da344b05d4386abeb4afeecedfe7d3e",
1491
+ "quad": "4dd7e6a02f4128e90d4e2a86cccd9bf267a02cebcff1cdf36e0aaff8848af66e",
1492
+ "scatter": "808f748e76833742bb12a80482b37cb3dedaf3dcd592ee477d611cb40e95b094",
1493
+ "score": "abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f",
1494
+ "seq": "7ad71dad059fd45a875a68e177335e7c13c550edb4e7746f9410a76f5015bc5a",
1495
+ "shape": "d92842c606795528d1246ddb050ac275e1b72659629185750a6e9ac7fdb763a3",
1496
+ "sweep": "7ef95fd3156f83c48e0961765bae7155607393e16485184fd60fb80cb8a63a16",
1497
+ "syntax": "0eca723150eb30db0b3d3fdbd35b973d5344ac0d0e2ea8ab89d143a0870ab4fd",
1498
+ "tape": "693e2aa59e822d38c48eca7271cc020f8e0a6f6189f2409895318ed2a3f0b809",
1499
+ "timeline": "3df7d0ec0c3ed4a6b06fbe3befec78b65a2202e5571580d8b28700a14b7b4321",
1500
+ "timer": "9043427ed434c76fba5b11ddd863c40d99b6157e194cfc729895cbaa4940496c",
1501
+ "tree": "554ed56e1ec963627be86ba1f573099ff57cf4cb22e8e10ce00e2128e30d39e2",
1502
+ "venn": "e1a0240f83e1925ee59ef2752662e2b0ec27f69251c012f8bab682aadcd8695f"
1503
+ }
1395
1504
  }
1396
1505
  },
1397
1506
  "parts": {
@@ -2610,6 +2719,15 @@
2610
2719
  "base": "1.1.0"
2611
2720
  },
2612
2721
  "license": "MIT"
2722
+ },
2723
+ "2.0.4": {
2724
+ "sha256": "b52d8e779ee991153bb3143733e4e2a4b72d08adda31c927992617ddf2097b0b",
2725
+ "kind": "element",
2726
+ "tag": "m-orbit",
2727
+ "requires": {
2728
+ "base": "1.1.0"
2729
+ },
2730
+ "license": "MIT"
2613
2731
  }
2614
2732
  },
2615
2733
  "particles": {
@@ -102,6 +102,13 @@ export const MESSAGES = {
102
102
  en: (a) => `the class “${a.what}” names a colour and is not in the 1.0 vocabulary (${a.n} place(s), first on line ${a.line}): use the meaning class “${a.to}” (term for terms and questions, emph for conclusions and problems, muted for known results)` },
103
103
  legacyStepAttr: { ja: (a) => `${a.what} は 1.0 の語彙にない(${a.n} か所、最初は ${a.line} 行目):ステップの数と動きは要素の data-step と data-at、線の class="draw"、パーツの steps から決まる(format spec §8.0)。${a.what} を外す`,
104
104
  en: (a) => `${a.what} is not in the 1.0 vocabulary (${a.n} place(s), first on line ${a.line}): the number of steps and the motion come from data-step and data-at on elements, class="draw" on strokes and the steps of parts (format spec §8.0); remove ${a.what}` },
105
+ // テーマの色の語彙の外の色(format spec §8.4。kit/core/color-vocab.mjs):じかに書いた色(literal)と、相対色で色相を変えた色(hue)。情報だけ(教材は組める。修正依頼には入らない)
106
+ colorOutside: { rule: 'R-colors', ja: (a) => (a.kind === 'hue'
107
+ ? `相対色の構文で色相を変えた色は、役割のない新しい色になる(${a.n} か所、最初は ${a.line} 行目:${a.list})。テーマの色に揃えるなら、役割の色 var(--emph) などをそのまま使う(淡くするなら color-mix() で役割と --bg を混ぜ、明るさ・不透明度だけを変えるなら色相は h のまま)`
108
+ : `色をじかに書いている(${a.n} か所、最初は ${a.line} 行目:${a.list})。テーマの色に揃えるなら、テーマの class(term・emph・muted)か変数 var(--fg) var(--term) var(--emph) var(--muted) var(--accent2) var(--line) var(--lit) を使う`),
109
+ en: (a) => (a.kind === 'hue'
110
+ ? `a colour derived by changing the hue (relative colour syntax) is a new colour without a role (${a.n} place(s), first on line ${a.line}: ${a.list}); to follow the theme, use the role colour as it is (var(--emph) …); to make it lighter, mix the role with --bg in color-mix(), and when only lightness or opacity changes keep the hue h`
111
+ : `colours are written directly (${a.n} place(s), first on line ${a.line}: ${a.list}); to follow the theme, use its classes (term, emph, muted) or variables var(--fg) var(--term) var(--emph) var(--muted) var(--accent2) var(--line) var(--lit)`) },
105
112
  legacyLectureMode: { ja: (a) => `<html data-mode="lecture"> は 1.0 の語彙にない(${a.line} 行目):見せ方は再生の設定の「先のステップを薄く見せる」で選ぶ。原稿からは外す`,
106
113
  en: (a) => `<html data-mode="lecture"> is not in the 1.0 vocabulary (line ${a.line}): the participant chooses “Show later steps faintly” in the player; remove it from the source` },
107
114
  narrHeadingDiffers: { rule: 'R-headings', ja: (a) => `narration.md ${a.line} 行目の見出し${quoteJa(a.heading)}がスライドの見出し${quoteJa(a.slide)}と違う({#${a.id}} で対応しているので動きは変わらない)`, en: (a) => `the narration heading “${a.heading}” (narration.md line ${a.line}) differs from the slide heading “${a.slide}” (matched by {#${a.id}}, so nothing breaks)` },
@@ -218,6 +225,8 @@ export const MESSAGES = {
218
225
  desuMasu: { rule: 'R-style', ja: (a) => `スライドの字に です・ます がある(「${a.t}」):スライドは常体(だ・である、体言止め)で書く。です・ます は口述原稿だけ`, en: (a) => `the slide text uses です・ます (“${a.t}”): write slides in plain style (だ・である or a noun ending); keep です・ます for the narration` },
219
226
  rawMath: { rule: 'R-math', ja: (a) => `数式が KaTeX で組まれずに残っている(「${a.t}」):\\( … \\) か \\[ … \\] で囲み、$ … $ は使わない`, en: (a) => `math was left unrendered (“${a.t}”): wrap it in \\( … \\) or \\[ … \\], not $ … $` },
220
227
  katexError: { rule: 'R-math', ja: (a) => `KaTeX が式を組めない(「${a.t}」):式の書き方を直す(< は \\lt、使えるマクロは \\hlE \\hlT \\hlM \\htmlId \\htmlData \\morph)`, en: (a) => `KaTeX cannot render an equation (“${a.t}”): fix its syntax (write < as \\lt; allowed macros are \\hlE \\hlT \\hlM \\htmlId \\htmlData \\morph)` },
228
+ // 同じ重さの短い要点だけの本文(kit/core/layout-scan.mjs、backlog #189。情報だけ:直すかは作成者が決める)
229
+ cardsHint: { rule: 'R-purpose', ja: () => '同じ重さの短い要点なら、カード(m-cards)にすると見やすいことがあります', en: () => 'Short, equal points may read better as cards (m-cards)' },
221
230
  // 本文の釣り合い(R-balance の段 1、情報。kit/core/fill-measure.mjs):数だけを言う。直し方は段 2 で足す(字で埋めさせない)
222
231
  // 横組み:重心は光学的な中心(上から 45%)に対して、空きは下 − 上。縦組み:重心は左右の真ん中に対して、空きは左 − 右
223
232
  balance: { rule: 'R-balance',
package/kit/check.mjs CHANGED
@@ -54,6 +54,7 @@ import { scanBalance } from './fill-scan.mjs';
54
54
  import { layoutScan, metricsProbe, metricsFonts, CLIP_ATTR, ANNOT_ATTR, OVERLAP_ATTR } from './core/layout-scan.mjs';
55
55
  import { placeholderSteps, templateTextIn } from './core/template-text.mjs';
56
56
  import { legacyVocabulary } from './core/legacy-vocab.mjs';
57
+ import { colorsOutsideVocabulary } from './core/color-vocab.mjs';
57
58
  import { FONTS_EXTRA_WARN, FONTS_EXTRA_PKG, FONTS_EXTRA_INSTALL } from './core/build-core.mjs';
58
59
  import { uncoveredGlyphs } from './core/font-coverage.mjs';
59
60
 
@@ -157,6 +158,12 @@ if (extraMissing.length) report(null, 'error', 'fontsExtraMissing', { fonts: ext
157
158
  }
158
159
  // 1.0 の語彙にない書き方(format spec §8.0):色のクラス blue・red・gray、data-steps・data-anim、<html data-mode="lecture">。警告だけ(教材は組める)
159
160
  for (const x of legacyVocabulary(readRegular(src, { max: READ_LIMITS.source }).toString('utf8'))) report(null, 'warn', x.code, x);
161
+ // テーマの色の語彙の外の色(format spec §8.4、R-colors):じかに書いた色と、相対色の構文で色相を変えた色。種類ごとに 1 つの情報(値は 6 つまで並べる)。
162
+ // 情報なので修正依頼(kit/core/llm-fix.mjs)には入らない(規格の担当の判断、2026-11-09)。
163
+ // var(--役割)・color-mix() で役割どうし・役割と --bg を混ぜた色・色相を保って明るさや不透明度だけを変えた相対色は知らせない(kit/core/color-vocab.mjs)
164
+ for (const x of colorsOutsideVocabulary(readRegular(src, { max: READ_LIMITS.source }).toString('utf8'))) {
165
+ report(null, 'info', 'colorOutside', { kind: x.kind, n: x.n, line: x.line, items: x.items, list: x.items.slice(0, 6).map((i) => i.what).join(', ') + (x.items.length > 6 ? ', …' : '') });
166
+ }
160
167
  // {#id} で指したスライドの見出しと、narration.md の見出しの文字列が違う(id が勝つので、知らせるだけ)
161
168
  const byKey = new Map(built.slides.map((s, i) => [s.key, { ...s, i }]));
162
169
  for (const sec of built.segs.sections || []) {
@@ -439,7 +446,7 @@ const aOut = await page.evaluate(([metaList, JA, CLIP, ANNOT, OVERLAP, METRICS])
439
446
  const issues = [], warns = [];
440
447
  const body = s.querySelector('.body');
441
448
  // はみ出し・切れ・字の大きさ・字数(kit/core/layout-scan.mjs。編集アプリの品質チェックと同じ関数)
442
- for (const f of window.__layoutScan(s, { JA, refRe: '文献', clip: CLIP, annot: ANNOT, overlap: OVERLAP, metrics: METRICS })) (f.sev === 'error' ? issues : warns).push([f.code, f.a]);
449
+ for (const f of window.__layoutScan(s, { JA, refRe: '文献', clip: CLIP, annot: ANNOT, overlap: OVERLAP, metrics: METRICS })) (f.sev === 'error' ? issues : warns).push([f.code, f.a, f.sev]);
443
450
  if (body) {
444
451
  const txt = (() => { const c = body.cloneNode(true); c.querySelectorAll('.katex-mathml').forEach((x) => x.remove()); document.body.appendChild(c); c.style.cssText = 'position:absolute;left:-99999px;width:' + body.clientWidth + 'px'; const r = c.innerText; c.remove(); return r; })();
445
452
  // 句読点はデッキの中でそろっていればよい(どちらにするかは元の原稿に合わせる)。数えて後で比べる
@@ -470,7 +477,10 @@ if (foreign.length) report(null, 'warn', 'fontNotEmbedded', { fonts: foreign });
470
477
  if (probe.items.length) report(null, 'warn', 'themeMetricsDrift', { theme: themeInfo.name, declared: !!themeInfo.declared, items: probe.items });
471
478
  for (const { i, text } of aOut.step0) report(i, 'info', 'step0', { t: text }, '0');
472
479
  for (const { i, issues } of aOut.style) for (const [code, a] of issues) report(i, 'error', code, a);
473
- for (const { i, issues } of aOut.soft) for (const [code, a] of issues) report(i, 'warn', code, a);
480
+ // cardsHint は 1 つの教材で最大 a.cap 個(長さのそろい方 a.ratio の小さい順、同じなら前のスライド)。残りは出さない(kit/core/layout-scan.mjs の CH.cap)
481
+ const cardsHints = [];
482
+ for (const { i, issues } of aOut.soft) for (const [code, a, sev] of issues) { if (code === 'cardsHint') cardsHints.push({ i, a }); else report(i, sev === 'info' ? 'info' : 'warn', code, a); }
483
+ cardsHints.map((h, k) => ({ ...h, k })).sort((x, y) => x.a.ratio - y.a.ratio || x.k - y.k).slice(0, cardsHints[0] ? cardsHints[0].a.cap : 0).sort((x, y) => x.k - y.k).forEach((h) => report(h.i, 'info', 'cardsHint', h.a));
474
484
  await collectPartReports();
475
485
  {
476
486
  const tot = aOut.punct.reduce((a, p) => ({ jp: a.jp + p.jp, en: a.en + p.en }), { jp: 0, en: 0 });
@@ -45,7 +45,7 @@ export const JOB = Object.freeze({ tag: 'tts-job', recordsTag: 'tts-records', v:
45
45
  export const COLAB = Object.freeze({
46
46
  repo: 'egatari/egatari-studio', notebook: 'colab/egatari-tts.ipynb',
47
47
  videoNotebook: 'colab/egatari-video.ipynb', // 動画(MP4)を作るノート(CPU のランタイム。#131)
48
- ref: 'v0.6.7', // バッジの URL は版のタグに固定する(リリースの手順で替える。RELEASING.md)
48
+ ref: 'v0.6.8', // バッジの URL は版のタグに固定する(リリースの手順で替える。RELEASING.md)
49
49
  pause: 0.35,
50
50
  models: Object.freeze({ irodori: 'irodori-tts-500m-v3', kokoro: 'kokoro-82m-v1.0' }),
51
51
  // 後処理の版(records の recipe.processing は PROCESSING に '+colab<ノートブックの版>' を付けたもの):ノートブック(colab/egatari_tts.py)の後処理は audio-core.mjs と同じ数。数を変えたら名前も変える
@@ -0,0 +1,172 @@
1
+ // テーマの色の語彙の外の色(format spec §8.4「Theme colours」)を原稿(deck.html)から探す。品質チェック(kit/check.mjs)が情報として知らせる(R-colors。修正依頼には入れない。
2
+ // 教材は組める:スライドは SHOULD)。Node にもブラウザにも依存しない
3
+ // colorsOutsideVocabulary(src) → [{kind, items: [{what, n, line}], n, line}](見つかった kind だけ。items は値ごとに 1 つ、出た順。n は数、line は最初の行)
4
+ // kind 'literal':色をじかに書いたもの。16 進(#rgb #rgba #rrggbb #rrggbbaa)、色の関数(rgb() rgba() hsl() hsla() hwb() lab() lch() oklab() oklch() color())、
5
+ // 色の名前(red・white など。色を取るプロパティと属性の中だけ)。var(--x, …) の予備の値の中のものも(§8.4:予備は役割から作る)
6
+ // kind 'hue' :相対色の構文(rgb(from …) hsl(from …) oklch(from …) color(from …) など)で、色相を変えたもの。役割のない新しい色になる(§8.4)
7
+ // 見るところ:<style> の宣言の値、style 属性、SVG と HTML の色の属性(fill・stroke・stop-color・flood-color・lighting-color・color・bgcolor)。
8
+ // <script> の中は見ない(部品の JavaScript の文字列は色かどうか分からない)。url(…) と文字列("…" '…')とコメントは飛ばす。
9
+ // 許すもの:var(--役割)(どの名前でも。var() は色をじかに書いたものではない。--lit も)、transparent・currentColor・none・inherit など、color-mix()
10
+ // (中の色が許すものだけなら。役割どうし・役割と --bg を混ぜた色は役割を保つ:§8.4)。
11
+ // 相対色の決まり(保守的な読み:既定のテーマが --title を oklch(from var(--base) min(l, 0.32) c h) で作り、淡色を color-mix で作るのと同じく、
12
+ // 色相を保って明るさ・鮮やかさ・不透明度を変えた色は役割を保つ。§8.4 が知らせると言うのは色相を変えたものだけ):
13
+ // 色相のある空間(hsl hwb lch oklch):色相の成分が `h` そのもの以外(calc(h + 30)・数・ほかの成分の名前・none)なら 'hue'。ほかの成分(明るさ・鮮やかさ・白・黒)と
14
+ // 不透明度(/ の後)は変えてよい
15
+ // 色相のない空間(rgb lab oklab color()):rgb と color() の srgb などの 3 成分は、どれか 1 つでも元の名前そのもの(r g b、color() は r g b か x y z)でなければ 'hue'
16
+ // (成分ごとに変えると色相が変わる。等しく変えたかどうかは見分けない)。lab・oklab は a・b が元のまま(a b)なら明るさ l だけを変えてよい。不透明度は変えてよい
17
+ // 元の色(from の後)がじかに書いた色なら、その色を 'literal' として知らせ、相対色としては重ねて知らせない
18
+ import { parse } from 'parse5';
19
+
20
+ // CSS の色の名前(CSS Color 4。transparent と currentcolor は除く:色を足さない)
21
+ const NAMED = new Set(('aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse '
22
+ + 'chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen '
23
+ + 'darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray '
24
+ + 'dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred '
25
+ + 'indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey '
26
+ + 'lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon '
27
+ + 'mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue '
28
+ + 'mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred '
29
+ + 'papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna '
30
+ + 'silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen').split(' '));
31
+ const COLOR_FN = new Set(['rgb', 'rgba', 'hsl', 'hsla', 'hwb', 'lab', 'lch', 'oklab', 'oklch', 'color']);
32
+ // 相対色の成分の名前(空間ごと)と、色相の成分の位置(なければ -1)
33
+ const CHANNELS = { rgb: ['r', 'g', 'b'], rgba: ['r', 'g', 'b'], hsl: ['h', 's', 'l'], hsla: ['h', 's', 'l'], hwb: ['h', 'w', 'b'], lab: ['l', 'a', 'b'], oklab: ['l', 'a', 'b'], lch: ['l', 'c', 'h'], oklch: ['l', 'c', 'h'] };
34
+ // 色の名前を色として読むプロパティ(16 進と色の関数はどのプロパティでも色)
35
+ const COLOR_PROP = /^(?:--|color$|background|border|outline|fill$|stroke$|stop-color$|flood-color$|lighting-color$|text-decoration|text-emphasis|box-shadow$|text-shadow$|caret-color$|accent-color$|column-rule|-webkit-text-(?:stroke|fill)|filter$|scrollbar-color$)/i;
36
+ const COLOR_ATTR = new Set(['fill', 'stroke', 'stop-color', 'flood-color', 'lighting-color', 'color', 'bgcolor']);
37
+ const HEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
38
+
39
+ // 値を字句に分ける:{t: 'fn', name, args: [字句…]} | {t: 'id', s} | {t: 'hex', s} | {t: 'op', s}(, / など)| {t: 'num', s}
40
+ function tokenize(s) {
41
+ let i = 0;
42
+ const read = (close) => {
43
+ const out = [];
44
+ while (i < s.length) {
45
+ const c = s[i];
46
+ if (close && c === ')') { i++; return out; }
47
+ if (/\s/.test(c)) { i++; continue; }
48
+ if (c === '"' || c === "'") { const q = c; i++; while (i < s.length && s[i] !== q) i += s[i] === '\\' ? 2 : 1; i++; continue; }
49
+ if (c === '#') { const m = /^#[0-9a-zA-Z_-]*/.exec(s.slice(i)); out.push({ t: 'hex', s: m[0] }); i += m[0].length; continue; }
50
+ const id = /^-?-?[A-Za-z_][\w-]*/.exec(s.slice(i));
51
+ if (id) {
52
+ i += id[0].length;
53
+ if (s[i] === '(') {
54
+ i++;
55
+ const name = id[0].toLowerCase();
56
+ if (name === 'url') { while (i < s.length && s[i] !== ')') i += s[i] === '\\' ? 2 : 1; i++; continue; }
57
+ const start = i;
58
+ const args = read(true);
59
+ out.push({ t: 'fn', name, args, text: `${id[0]}(${s.slice(start, i - 1)})` });
60
+ } else out.push({ t: 'id', s: id[0] });
61
+ continue;
62
+ }
63
+ if (c === '(') { i++; out.push({ t: 'fn', name: '', args: read(true), text: '' }); continue; }
64
+ const num = /^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?(?:%|[a-z]+)?/i.exec(s.slice(i));
65
+ if (num) { out.push({ t: 'num', s: num[0] }); i += num[0].length; continue; }
66
+ out.push({ t: 'op', s: c }); i++;
67
+ }
68
+ return out;
69
+ };
70
+ return read(false);
71
+ }
72
+ const isLiteralFn = (x) => x.t === 'fn' && COLOR_FN.has(x.name) && !(x.args[0] && x.args[0].t === 'id' && x.args[0].s.toLowerCase() === 'from');
73
+ const isRelativeFn = (x) => x.t === 'fn' && COLOR_FN.has(x.name) && x.args[0] && x.args[0].t === 'id' && x.args[0].s.toLowerCase() === 'from';
74
+ const short = (s) => { const t = String(s).replace(/\s+/g, ' ').trim(); return t.length > 60 ? t.slice(0, 57) + '…' : t; };
75
+
76
+ // 相対色が色相を変えるか。args は from の後ろ([元の色, 成分…, / 不透明度])
77
+ function relativeChangesHue(fn) {
78
+ let args = fn.args.slice(2);
79
+ let space = fn.name;
80
+ if (space === 'color') { // color(from <色> <空間> c1 c2 c3 [/ a])
81
+ const sp = args[0] && args[0].t === 'id' ? args[0].s.toLowerCase() : '';
82
+ args = args.slice(1);
83
+ const names = /^xyz/.test(sp) ? ['x', 'y', 'z'] : ['r', 'g', 'b'];
84
+ const ch = args.slice(0, args.findIndex((x) => x.t === 'op' && x.s === '/') >= 0 ? args.findIndex((x) => x.t === 'op' && x.s === '/') : args.length);
85
+ return ch.length !== 3 || ch.some((x, k) => !(x.t === 'id' && x.s.toLowerCase() === names[k]));
86
+ }
87
+ const names = CHANNELS[space];
88
+ const slash = args.findIndex((x) => x.t === 'op' && (x.s === '/' || x.s === ','));
89
+ const ch = slash >= 0 ? args.slice(0, slash) : args;
90
+ if (ch.length !== 3) return true; // 読めない形は保守的に知らせる
91
+ const same = (k) => ch[k].t === 'id' && ch[k].s.toLowerCase() === names[k];
92
+ if (space === 'rgb' || space === 'rgba') return ![0, 1, 2].every(same);
93
+ if (space === 'lab' || space === 'oklab') return !(same(1) && same(2));
94
+ return !same(names.indexOf('h'));
95
+ }
96
+
97
+ // 字句の並びを調べる。colorCtx:色の名前を色として読むか
98
+ function scan(tokens, colorCtx, add) {
99
+ for (const x of tokens) {
100
+ if (x.t === 'hex') { if (HEX.test(x.s)) add('literal', x.s); continue; }
101
+ if (x.t === 'id') { if (colorCtx && NAMED.has(x.s.toLowerCase())) add('literal', x.s); continue; }
102
+ if (x.t !== 'fn') continue;
103
+ if (isLiteralFn(x)) { add('literal', x.text); continue; }
104
+ if (isRelativeFn(x)) {
105
+ const origin = x.args[1];
106
+ let lit = false;
107
+ const sub = (k, w) => { if (k === 'literal') lit = true; add(k, w); };
108
+ if (origin) scan([origin], true, sub);
109
+ if (!lit && relativeChangesHue(x)) add('hue', x.text);
110
+ continue;
111
+ }
112
+ if (x.name === 'var') { // var(--x, 予備):名前は飛ばし、予備の値だけを見る
113
+ const comma = x.args.findIndex((a) => a.t === 'op' && a.s === ',');
114
+ if (comma >= 0) scan(x.args.slice(comma + 1), true, add);
115
+ continue;
116
+ }
117
+ scan(x.args, colorCtx || x.name === 'color-mix' || /gradient$/.test(x.name) || x.name === 'light-dark' || x.name === 'drop-shadow', add);
118
+ }
119
+ }
120
+ export function colorsInValue(value, { colorCtx = true } = {}) {
121
+ const out = [];
122
+ scan(tokenize(String(value)), colorCtx, (kind, what) => out.push({ kind, what: short(what) }));
123
+ return out;
124
+ }
125
+ // CSS の文字(<style> の中身・style 属性)の宣言:[{prop, value, at}](at は文字の中の位置)
126
+ export function declarations(css, { inline = false } = {}) {
127
+ const text = String(css).replace(/\/\*[\s\S]*?\*\//g, (m) => ' '.repeat(m.length));
128
+ const out = [];
129
+ const re = inline ? /(^|;)\s*(--[\w-]+|-?[A-Za-z][\w-]*)\s*:([^;]*)/g : /(^|[;{])\s*(--[\w-]+|-?[A-Za-z][\w-]*)\s*:([^;{}]*)(?=[;}])/g;
130
+ for (const m of text.matchAll(re)) out.push({ prop: m[2], value: m[3], at: m.index + m[1].length });
131
+ return out;
132
+ }
133
+
134
+ function walk(n, fn) {
135
+ fn(n);
136
+ if (n.tagName === 'script') return;
137
+ for (const c of n.childNodes || []) walk(c, fn);
138
+ if (n.content) walk(n.content, fn);
139
+ }
140
+ export function colorsOutsideVocabulary(src) {
141
+ const text = String(src);
142
+ const doc = parse(text, { sourceCodeLocationInfo: true });
143
+ const lineOf = (off) => text.slice(0, off).split('\n').length;
144
+ const kinds = new Map();
145
+ const add = (kind, what, at) => {
146
+ if (!kinds.has(kind)) kinds.set(kind, new Map());
147
+ const m = kinds.get(kind), k = what.toLowerCase();
148
+ if (!m.has(k)) m.set(k, { what, n: 0, line: lineOf(at) });
149
+ m.get(k).n++;
150
+ };
151
+ const ofDecls = (css, base, inline) => {
152
+ for (const d of declarations(css, { inline })) for (const f of colorsInValue(d.value, { colorCtx: COLOR_PROP.test(d.prop) })) add(f.kind, f.what, base + d.at);
153
+ };
154
+ walk(doc, (n) => {
155
+ if (!n.tagName || !n.sourceCodeLocation) return;
156
+ const loc = n.sourceCodeLocation;
157
+ if (n.tagName === 'style') {
158
+ const body = (n.childNodes || []).map((c) => c.value || '').join('');
159
+ const start = loc.startTag ? loc.startTag.endOffset : loc.startOffset;
160
+ ofDecls(body, start, false);
161
+ }
162
+ for (const a of n.attrs || []) {
163
+ const at = (loc.attrs && loc.attrs[a.name] ? loc.attrs[a.name].startOffset : loc.startOffset);
164
+ if (a.name === 'style') ofDecls(a.value, at, true);
165
+ else if (COLOR_ATTR.has(a.name.toLowerCase())) for (const f of colorsInValue(a.value)) add(f.kind, f.what, at);
166
+ }
167
+ });
168
+ return ['literal', 'hue'].filter((k) => kinds.has(k)).map((kind) => {
169
+ const items = [...kinds.get(kind).values()];
170
+ return { kind, items, n: items.reduce((s, x) => s + x.n, 0), line: Math.min(...items.map((x) => x.line)) };
171
+ });
172
+ }