egatari 0.6.7 → 0.6.8

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 +23 -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/themes.lock.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "themes": {
3
3
  "business": {
4
- "current": "1.0.1",
4
+ "current": "1.1.0",
5
5
  "versions": [
6
6
  "1.0.0",
7
- "1.0.1"
7
+ "1.0.1",
8
+ "1.1.0"
8
9
  ],
9
10
  "sha256": {
10
11
  "1.0.0": "3d6b4175f6bbb71b24ae3b1288cacfe0fce2138dccf0eda4b6887032a062c880",
11
- "1.0.1": "ca94935076466e609eeed615e077edef0f0e8fb21994bc6614b78303846fae69"
12
+ "1.0.1": "ca94935076466e609eeed615e077edef0f0e8fb21994bc6614b78303846fae69",
13
+ "1.1.0": "e9b8da437c19f45ec0ac30d8e2db70af2c15179064d83892fd1a677ac57b4ccc"
12
14
  },
13
15
  "changes": {
14
16
  "1.0.1": {
@@ -21,20 +23,27 @@
21
23
  "to": "#BA3C05"
22
24
  }
23
25
  ]
26
+ },
27
+ "1.1.0": {
28
+ "date": "2026-11-09",
29
+ "reason": "new role --lit (light and what it lights), #F2C300, a yellow kept away from the orange --emph, for fills drawn with an outline; under colour-vision simulation it stays apart from --emph. No existing colour changes",
30
+ "tokens": []
24
31
  }
25
32
  }
26
33
  },
27
34
  "default": {
28
- "current": "1.2.0",
35
+ "current": "1.3.0",
29
36
  "versions": [
30
37
  "1.0.0",
31
38
  "1.1.0",
32
- "1.2.0"
39
+ "1.2.0",
40
+ "1.3.0"
33
41
  ],
34
42
  "sha256": {
35
43
  "1.0.0": "d5486df8f7bc6df2f31e6d155f4d22583b5e12fca45ed434e74372788a953d0b",
36
44
  "1.1.0": "afdeb965d6f6ce7d221fbe302fdcdd6414df65fcb41554600a6947994162330c",
37
- "1.2.0": "4b607693e914552cbff5143df415d98aeb00b4be229a7b6446d874f5853b7c1a"
45
+ "1.2.0": "4b607693e914552cbff5143df415d98aeb00b4be229a7b6446d874f5853b7c1a",
46
+ "1.3.0": "97537e8e5e32ec2b74df74dd4ce247e476e742d1910e08847adedeebd337b953"
38
47
  },
39
48
  "changes": {
40
49
  "1.1.0": {
@@ -63,61 +72,120 @@
63
72
  "to": "#F5F5F5"
64
73
  }
65
74
  ]
75
+ },
76
+ "1.3.0": {
77
+ "date": "2026-11-09",
78
+ "reason": "new role --lit (light and what it lights: the sun, a lamp, the lit side of the Moon), a warm yellow #F5B800 for fills drawn with an outline (1.8:1 on white, so never used alone or for text); under colour-vision simulation it stays apart from --emph (ΔE*ab ≥ 42, ΔE00 ≥ 28). No existing colour changes",
79
+ "tokens": []
66
80
  }
67
81
  }
68
82
  },
69
83
  "kokugo": {
70
- "current": "1.0.0",
84
+ "current": "1.1.0",
71
85
  "versions": [
72
- "1.0.0"
86
+ "1.0.0",
87
+ "1.1.0"
73
88
  ],
74
89
  "sha256": {
75
- "1.0.0": "b4d4f73585cf84f2de29ff28516fb9b7fac95c9a453130bb1d80b8c3306f15a2"
90
+ "1.0.0": "b4d4f73585cf84f2de29ff28516fb9b7fac95c9a453130bb1d80b8c3306f15a2",
91
+ "1.1.0": "a75451c67ac68a92021aae7b19bd0d5944c4992a5bbe4d8c64396ff87c97da46"
92
+ },
93
+ "changes": {
94
+ "1.1.0": {
95
+ "date": "2026-11-09",
96
+ "reason": "new role --lit (light and what it lights), #F8B500, yamabuki yellow, for fills drawn with an outline; under colour-vision simulation it stays apart from --emph. No existing colour changes",
97
+ "tokens": []
98
+ }
76
99
  }
77
100
  },
78
101
  "sumi": {
79
- "current": "1.0.0",
102
+ "current": "1.1.0",
80
103
  "versions": [
81
- "1.0.0"
104
+ "1.0.0",
105
+ "1.1.0"
82
106
  ],
83
107
  "sha256": {
84
- "1.0.0": "a8ec5ae630ed5d399bca109c36cab9066329f312e5b0512b20498e5e6a0db0f4"
108
+ "1.0.0": "a8ec5ae630ed5d399bca109c36cab9066329f312e5b0512b20498e5e6a0db0f4",
109
+ "1.1.0": "b6ad19b0601da495219040dff46160abd623c380cd183a19055b4203878dadf8"
110
+ },
111
+ "changes": {
112
+ "1.1.0": {
113
+ "date": "2026-11-09",
114
+ "reason": "new role --lit (light and what it lights), #F2C300, a yellow kept away from the orange --emph, for fills drawn with an outline; under colour-vision simulation it stays apart from --emph. No existing colour changes",
115
+ "tokens": []
116
+ }
85
117
  }
86
118
  },
87
119
  "tokiwa": {
88
- "current": "1.0.0",
120
+ "current": "1.1.0",
89
121
  "versions": [
90
- "1.0.0"
122
+ "1.0.0",
123
+ "1.1.0"
91
124
  ],
92
125
  "sha256": {
93
- "1.0.0": "b44963f640db4cde9b16bd7c93d01325690d1072c90922111a4774b527174579"
126
+ "1.0.0": "b44963f640db4cde9b16bd7c93d01325690d1072c90922111a4774b527174579",
127
+ "1.1.0": "73b5fe9cdfa0ce1648c73f346f72382c8945fb50f8c144626599fb27868aaeaa"
128
+ },
129
+ "changes": {
130
+ "1.1.0": {
131
+ "date": "2026-11-09",
132
+ "reason": "new role --lit (light and what it lights), #F5C000, rapeseed yellow, for fills drawn with an outline; under colour-vision simulation it stays apart from --emph. No existing colour changes",
133
+ "tokens": []
134
+ }
94
135
  }
95
136
  },
96
137
  "murasaki": {
97
- "current": "1.0.0",
138
+ "current": "1.1.0",
98
139
  "versions": [
99
- "1.0.0"
140
+ "1.0.0",
141
+ "1.1.0"
100
142
  ],
101
143
  "sha256": {
102
- "1.0.0": "e1d3ecb04a4a42808a780f3f8a3d94e849a644b1c68c5d4f410a5cde9f66ab86"
144
+ "1.0.0": "e1d3ecb04a4a42808a780f3f8a3d94e849a644b1c68c5d4f410a5cde9f66ab86",
145
+ "1.1.0": "56d9b1eb518dc05cc50ef70357e45ae361337041ebb9536cd04e408bda68aff5"
146
+ },
147
+ "changes": {
148
+ "1.1.0": {
149
+ "date": "2026-11-09",
150
+ "reason": "new role --lit (light and what it lights), #F3BE00, a yellow opposite the purple, for fills drawn with an outline; under colour-vision simulation it stays apart from --emph. No existing colour changes",
151
+ "tokens": []
152
+ }
103
153
  }
104
154
  },
105
155
  "kogecha": {
106
- "current": "1.0.0",
156
+ "current": "1.1.0",
107
157
  "versions": [
108
- "1.0.0"
158
+ "1.0.0",
159
+ "1.1.0"
109
160
  ],
110
161
  "sha256": {
111
- "1.0.0": "e364c687acb0ae78aa560ae2b785fcf8b4aed4392fc3a8c113a517391e9f3258"
162
+ "1.0.0": "e364c687acb0ae78aa560ae2b785fcf8b4aed4392fc3a8c113a517391e9f3258",
163
+ "1.1.0": "74158847f3ce64db3a94202705f9cd6c416e3f1b0331da234e28a39e79a62f83"
164
+ },
165
+ "changes": {
166
+ "1.1.0": {
167
+ "date": "2026-11-09",
168
+ "reason": "new role --lit (light and what it lights), #EDB91A, a subdued golden yellow, for fills drawn with an outline; under colour-vision simulation it stays apart from --emph. No existing colour changes",
169
+ "tokens": []
170
+ }
112
171
  }
113
172
  },
114
173
  "asagi": {
115
- "current": "1.0.0",
174
+ "current": "1.1.0",
116
175
  "versions": [
117
- "1.0.0"
176
+ "1.0.0",
177
+ "1.1.0"
118
178
  ],
119
179
  "sha256": {
120
- "1.0.0": "e35712155c3d2122e8e2f149899e555d83ea6de0b9659facbd32b498d30f4511"
180
+ "1.0.0": "e35712155c3d2122e8e2f149899e555d83ea6de0b9659facbd32b498d30f4511",
181
+ "1.1.0": "65cadb2e52800d4dd8ead1eee9eead8987255386a330faf5c0122c827c33256a"
182
+ },
183
+ "changes": {
184
+ "1.1.0": {
185
+ "date": "2026-11-09",
186
+ "reason": "new role --lit (light and what it lights), #FFCE3A, a bright yellow, for fills drawn with an outline; under colour-vision simulation it stays apart from --emph. No existing colour changes",
187
+ "tokens": []
188
+ }
121
189
  }
122
190
  }
123
191
  }
@@ -0,0 +1,69 @@
1
+ // Egatari ファイル(.ega.html)の身元を 1 行ずつ出す(egatari ids-of、npm run ids-of)。版を管理する組織向け。
2
+ // node tools/ids-of.mjs <file.ega.html> [<file> …] [--json]
3
+ // 既定は TSV(タブ区切り)で ファイルごとに 1 行:docId、sourceSha256、ファイル全体の SHA-256。
4
+ // docId 教材の id(索引の docId。再生専用の派生は deck-meta の docId)
5
+ // sourceSha256 原稿から計算し直した値(format spec §3.4。音声と組んだ部分を含まない)。再生専用は原稿がないので「-」(--json では null)
6
+ // ファイル全体 ファイルのバイト列の SHA-256(配布・LMS への登録の照合用)
7
+ // --json は ファイルごとに 1 行の JSON:{file, docId, sourceSha256, fileSha256}。
8
+ // 計算し直した sourceSha256 が、ファイルに書かれた値(索引・deck-meta)と違えば stderr に警告する(終了コードは変えない)。
9
+ // 読めない・Egatari ファイルでないものは stderr にわけを書き、終了コードは 1(ほかのファイルは続ける)。署名(§10)は扱わない。
10
+ import path from 'node:path';
11
+ import { fileURLToPath } from 'node:url';
12
+ import { readRegular } from '../kit/bounded-read.mjs';
13
+ import { readPortable, readDeckMeta, scanDocument, sourceKind, sha256Hex, sourceSha256, LIMITS, FormatError } from '../kit/core/portable.mjs';
14
+
15
+ const fail = (m) => { throw new FormatError('not-egatari', m); };
16
+
17
+ // 1 ファイルの身元:{docId, sourceSha256 (| null), fileSha256, warnings}
18
+ export async function idsOf(file) {
19
+ let buf;
20
+ try { buf = readRegular(file, { max: LIMITS.fileBytes }); } catch (e) {
21
+ if (e && e.code === 'read-over') fail(`file is larger than ${LIMITS.fileBytes} bytes`);
22
+ if (e && e.code === 'build-not-a-file') fail('not a regular file');
23
+ throw e;
24
+ }
25
+ const bytes = new Uint8Array(buf.buffer, buf.byteOffset, buf.length);
26
+ const fileSha256 = await sha256Hex(bytes);
27
+ try {
28
+ const r = await readPortable(bytes);
29
+ const shas = {};
30
+ for (const p of Object.keys(r.files)) shas[p] = await sha256Hex(r.files[p]);
31
+ const computed = await sourceSha256(shas);
32
+ const warnings = [];
33
+ if (computed !== r.index.sourceSha256) warnings.push(`sourceSha256 differs from the index value (${r.index.sourceSha256}): the source was changed or the file was edited by hand`);
34
+ if (r.deckMeta && r.deckMeta.sourceSha256 !== undefined && r.deckMeta.sourceSha256 !== computed) warnings.push(`sourceSha256 differs from the deck-meta value (${r.deckMeta.sourceSha256})`);
35
+ return { docId: r.docId, sourceSha256: computed, fileSha256, warnings };
36
+ } catch (e) {
37
+ if (!(e instanceof FormatError) || e.code !== 'no-source' || e.details?.kind !== 'play-only') throw e;
38
+ // 再生専用の派生:原稿がない。docId だけ deck-meta から
39
+ const text = new TextDecoder().decode(bytes);
40
+ const meta = readDeckMeta(scanDocument(text));
41
+ if (!meta || typeof meta.docId !== 'string') fail('play-only file without a docId');
42
+ return { docId: meta.docId, sourceSha256: null, fileSha256, warnings: [] };
43
+ }
44
+ }
45
+
46
+ async function main(argv) {
47
+ const json = argv.includes('--json');
48
+ const files = argv.filter((a) => a !== '--json');
49
+ if (!files.length || files.some((a) => a.startsWith('-') && a !== '--json')) {
50
+ console.error('使い方 / usage: egatari ids-of <file.ega.html> [<file> …] [--json]');
51
+ return 1;
52
+ }
53
+ let bad = 0;
54
+ for (const f of files) {
55
+ try {
56
+ const r = await idsOf(f);
57
+ for (const w of r.warnings) console.error(`warning: ${f}: ${w}`);
58
+ console.log(json ? JSON.stringify({ file: f, docId: r.docId, sourceSha256: r.sourceSha256, fileSha256: r.fileSha256 })
59
+ : [r.docId, r.sourceSha256 ?? '-', r.fileSha256].join('\t'));
60
+ } catch (e) {
61
+ bad++;
62
+ const msg = e instanceof FormatError ? `not an Egatari file (${e.code}): ${e.message}` : e.code === 'ENOENT' ? 'file not found' : e.message;
63
+ console.error(`error: ${f}: ${msg}`);
64
+ }
65
+ }
66
+ return bad ? 1 : 0;
67
+ }
68
+
69
+ if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) process.exit(await main(process.argv.slice(2)));
@@ -41,7 +41,7 @@
41
41
  | [`<m-tree>`](sha256/e0daed8338f51de7e86b5980a098394298455972218370ee65331ca48f7f9696/README.md) | 1.13.1 | 階層・分類の木(組織図、生物の分類など)を、根から 1 段ずつ組み立てる。座標は書かず、配置は部品が決める | 節の深さの数(by="level"、既定)か節の数(by="node")。節と edges の step があればその最大 | orient, by, link, size, fade, draw | [demo](sha256/e0daed8338f51de7e86b5980a098394298455972218370ee65331ca48f7f9696/demo.html) |
42
42
  | [`<m-venn>`](sha256/82b2dbc925a4ae4511bb48ccb1777a3932313ac7e18cb91572371d272a930980/README.md) | 1.13.1 | 2 つか 3 つの集合の円(ベン図)。集合を 1 つずつ出し、最後に重なりを強めてその中の項目を出す | 集合の数 + 1(overlaps="each" なら 集合の数 + 項目のある重なりの数) | size, dur, spread, overlaps | [demo](sha256/82b2dbc925a4ae4511bb48ccb1777a3932313ac7e18cb91572371d272a930980/demo.html) |
43
43
 
44
- ## 2.x のパーツ(components2.lock.json の既定の版 2.5.0)
44
+ ## 2.x のパーツ(components2.lock.json の既定の版 2.5.1)
45
45
 
46
46
  1.x の目録にない、2.x 専用の要素パーツ(`kind: "element"`)。土台パーツ(`kind: "library"`:base・boxplot-core・codetree-core・
47
47
  expr・heatmap-core・hist-core・icons・kanbun-core・markup-reader・plot・shape)は教材の作者が直接書かないので一覧には出さない。
@@ -49,7 +49,7 @@ expr・heatmap-core・hist-core・icons・kanbun-core・markup-reader・plot・s
49
49
  | 部品 | 版 | 内容 | 段階の数 | 受け取る値 | 見本 |
50
50
  |---|---|---|---|---|---|
51
51
  | [`<m-cards>`](sha256/f3d5b6ce53f40c5f355a67538ff11b9cd28297da6292125ccb6e055aeddef906/README.md) | 2.0.3 | カード(番号の丸・アイコン・見出し・説明)を横一列か 2 段に並べ、段階ごとに出す。矢印で順を、枠の色で強調を見せる | カードの step の最大(既定はカード 1 枚 = 1 段階。per-step で n 枚ずつ) | layout, arrows, nums, hilite, per-step, stagger, dur | [demo](sha256/f3d5b6ce53f40c5f355a67538ff11b9cd28297da6292125ccb6e055aeddef906/demo.html) |
52
- | [`<m-orbit>`](sha256/37ea0051e8a1f2d7c2fa2d38e57730e5a3b1afabe9037a74fcad6e6f05356c09/README.md) | 2.0.3 | 月の満ち欠け(金星の満ち欠け)。北極の上から見た図と地球から見た形を並べ、月を位置から位置へ動かす。形は位置から計算する | 動く先の数(既定は 8 つの位置を新月から 1 周 = 8 段階。visit で決める) | mode, hemisphere, sun, earth, moon, observer, size, dur | [demo](sha256/37ea0051e8a1f2d7c2fa2d38e57730e5a3b1afabe9037a74fcad6e6f05356c09/demo.html) |
52
+ | [`<m-orbit>`](sha256/2e9a35ce9e289196d0b5fd24b8546cf6e0f4a6df857e69f4f78e686cabb00e61/README.md) | 2.0.4 | 月の満ち欠け(金星の満ち欠け)。北極の上から見た図と地球から見た形を並べ、月を位置から位置へ動かす。形は位置から計算する | 動く先の数(既定は 8 つの位置を新月から 1 周 = 8 段階。visit で決める) | mode, hemisphere, sun, earth, moon, observer, size, dur | [demo](sha256/2e9a35ce9e289196d0b5fd24b8546cf6e0f4a6df857e69f4f78e686cabb00e61/demo.html) |
53
53
  | [`<m-particles>`](sha256/ec132caf4b4fd019fab20f9e9d6bc86266e30eb80a4fb8d2de4ca440ad45a098/README.md) | 2.0.0 | 状態変化の粒子の並び方と間隔、化学変化で保存される原子の数を見せる | state は states の数 − 1(既定 2)。reaction は反応前→原子に分かれる→反応後の 3 段階 | mode, count, size, dur, volume, motion | [demo](sha256/ec132caf4b4fd019fab20f9e9d6bc86266e30eb80a4fb8d2de4ca440ad45a098/demo.html) |
54
54
  | [`<m-score>`](sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/README.md) | 2.1.0 | 楽譜(五線譜)を 1 音・和音ずつ、または 1 小節ずつ出して音も鳴らす。ABC 記譜法で書く | 音符・和音・休符 1 つ=1 段階。by="measure" なら 1 小節=1 段階(per-step="N" なら N 小節。弱起の小節は次の段階に入る) | by, names, per-step | [demo](sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/demo.html) |
55
55