egatari 0.6.11 → 0.6.12-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 (134) hide show
  1. package/bin/egatari.mjs +4 -3
  2. package/components.lock.json +30 -15
  3. package/components2.lock.json +201 -1
  4. package/fonts/@fontsource/fraunces/400.css +29 -0
  5. package/fonts/@fontsource/fraunces/700.css +29 -0
  6. package/fonts/@fontsource/fraunces/LICENSE +93 -0
  7. package/fonts/@fontsource/fraunces/files/fraunces-latin-400-normal.woff2 +0 -0
  8. package/fonts/@fontsource/fraunces/files/fraunces-latin-700-normal.woff2 +0 -0
  9. package/fonts/@fontsource/fraunces/files/fraunces-latin-ext-400-normal.woff2 +0 -0
  10. package/fonts/@fontsource/fraunces/files/fraunces-latin-ext-700-normal.woff2 +0 -0
  11. package/fonts/@fontsource/fraunces/files/fraunces-vietnamese-400-normal.woff2 +0 -0
  12. package/fonts/@fontsource/fraunces/files/fraunces-vietnamese-700-normal.woff2 +0 -0
  13. package/fonts/@fontsource/fraunces/package.json +6 -0
  14. package/kit/check-messages.mjs +18 -7
  15. package/kit/check.mjs +12 -4
  16. package/kit/core/article-render.mjs +5 -5
  17. package/kit/core/build-core.mjs +25 -9
  18. package/kit/core/check-parity.mjs +1 -1
  19. package/kit/core/check-rules.mjs +2 -2
  20. package/kit/core/check-source.mjs +3 -0
  21. package/kit/core/colab-core.mjs +1 -1
  22. package/kit/core/kicker.mjs +42 -0
  23. package/kit/core/layout-scan.mjs +19 -7
  24. package/kit/core/llm-pack-data.mjs +8 -8
  25. package/kit/core/llm-pack.mjs +2 -2
  26. package/kit/core/theme-shapes.mjs +3 -1
  27. package/kit/core/themes-list.mjs +2 -0
  28. package/kit/instruction-version.json +1 -1
  29. package/kit/layouts.css +8 -0
  30. package/kit/player.json +1 -1
  31. package/kit/player.lock.json +2 -2
  32. package/package.json +2 -1
  33. package/themes/asagi/theme.json +1 -1
  34. package/themes/asagi/tokens.css +6 -0
  35. package/themes/bengara/theme.json +13 -0
  36. package/themes/bengara/tokens.css +66 -0
  37. package/themes/business/theme.json +1 -1
  38. package/themes/business/tokens.css +6 -0
  39. package/themes/default/theme.json +1 -1
  40. package/themes/default/tokens.css +9 -0
  41. package/themes/kogecha/theme.json +1 -1
  42. package/themes/kogecha/tokens.css +6 -0
  43. package/themes/kokugo/theme.json +1 -1
  44. package/themes/kokugo/tokens.css +6 -0
  45. package/themes/murasaki/theme.json +1 -1
  46. package/themes/murasaki/tokens.css +6 -0
  47. package/themes/sumi/theme.json +1 -1
  48. package/themes/sumi/tokens.css +8 -0
  49. package/themes/tokiwa/theme.json +1 -1
  50. package/themes/tokiwa/tokens.css +6 -0
  51. package/themes.lock.json +90 -24
  52. package/vendor/components/CATALOG.md +11 -11
  53. package/vendor/components/sha256/04626b77b3c683fd4c8e549339eca153615e021eb0e649c31291deb2dab30667/README.en.md +38 -0
  54. package/vendor/components/sha256/04626b77b3c683fd4c8e549339eca153615e021eb0e649c31291deb2dab30667/index.js +289 -0
  55. package/vendor/components/sha256/0c4eb83646ab8027d40697db161eb952425db78c42b36291626214d5064b9498/fixtures/ABCJS-ADAPTER.md +101 -0
  56. package/vendor/components/sha256/0c4eb83646ab8027d40697db161eb952425db78c42b36291626214d5064b9498/fixtures/LICENSE-abcjs.txt +21 -0
  57. package/vendor/components/sha256/0c4eb83646ab8027d40697db161eb952425db78c42b36291626214d5064b9498/fixtures/chords.json +89 -0
  58. package/vendor/components/sha256/0c4eb83646ab8027d40697db161eb952425db78c42b36291626214d5064b9498/fixtures/doremi.json +261 -0
  59. package/vendor/components/sha256/0c4eb83646ab8027d40697db161eb952425db78c42b36291626214d5064b9498/fixtures/extras.json +192 -0
  60. package/vendor/components/sha256/0c4eb83646ab8027d40697db161eb952425db78c42b36291626214d5064b9498/fixtures/kaeru.json +521 -0
  61. package/vendor/components/sha256/0c4eb83646ab8027d40697db161eb952425db78c42b36291626214d5064b9498/fixtures/rhythm.json +248 -0
  62. package/vendor/components/sha256/0c4eb83646ab8027d40697db161eb952425db78c42b36291626214d5064b9498/fixtures/ties.json +360 -0
  63. package/vendor/components/sha256/0c4eb83646ab8027d40697db161eb952425db78c42b36291626214d5064b9498/index.js +508 -0
  64. package/vendor/components/sha256/0dc2a0945e7a4004278fcc9b8f02223bbb87f6269bffe3dd3ebeb3a78ce23d34/index.js +404 -0
  65. package/vendor/components/sha256/0e2e45b024bb2f37e82c83a4d9cd9f9c16b5dc4924dde81735c268a3d49f9d7f/index.js +97 -0
  66. package/vendor/components/sha256/0ef62e33d330f8e31ccb1f480b5e3b349769a142cc2737a9e6583d5eff9f56ca/index.js +919 -0
  67. package/vendor/components/sha256/1b33a252d51091e2d8cdea176f10268f128640bed3aa46da88d7de31ced59b44/README.en.md +48 -0
  68. package/vendor/components/sha256/1b33a252d51091e2d8cdea176f10268f128640bed3aa46da88d7de31ced59b44/index.js +384 -0
  69. package/vendor/components/sha256/1b767b6cf1855156872f87981a7c99f0161013499d6c4b21785624435db92078/README.en.md +34 -0
  70. package/vendor/components/sha256/1b767b6cf1855156872f87981a7c99f0161013499d6c4b21785624435db92078/index.js +244 -0
  71. package/vendor/components/sha256/3ace61e46a4555eab46ca8053db2fb76a874d4d5409bc5891cc449f43ef7e0bd/README.en.md +44 -0
  72. package/vendor/components/sha256/3ace61e46a4555eab46ca8053db2fb76a874d4d5409bc5891cc449f43ef7e0bd/index.js +304 -0
  73. package/vendor/components/sha256/4079077e03343995edc5e34b8bda0cf200dc6d854a52486fe0a6a4ceaf0d4b6f/README.en.md +44 -0
  74. package/vendor/components/sha256/4079077e03343995edc5e34b8bda0cf200dc6d854a52486fe0a6a4ceaf0d4b6f/index.js +203 -0
  75. package/vendor/components/sha256/40aaaaf988e7c32460ffaf5f18b5690ee28fd1fe7e879d8434d58283992bc554/README.en.md +37 -0
  76. package/vendor/components/sha256/40aaaaf988e7c32460ffaf5f18b5690ee28fd1fe7e879d8434d58283992bc554/index.js +438 -0
  77. package/vendor/components/sha256/442be174439d106ef462c19d598c407e86d5de3fcd4700ed54ae4147c4b9969c/README.en.md +24 -0
  78. package/vendor/components/sha256/442be174439d106ef462c19d598c407e86d5de3fcd4700ed54ae4147c4b9969c/index.js +103 -0
  79. package/vendor/components/sha256/48a776e7683e1aba8cad5aa4067914c017681efaa74f175066e0ab081bf3d013/index.js +351 -0
  80. package/vendor/components/sha256/4a9331635c2dd28e4b46108eaffe49c6d29cf626ecb900ac6e9029552be0cf49/index.js +607 -0
  81. package/vendor/components/sha256/5458baef7a30298cf4b0029331f13233d162403e686f9c20085dd2104cad7141/README.en.md +23 -0
  82. package/vendor/components/sha256/5458baef7a30298cf4b0029331f13233d162403e686f9c20085dd2104cad7141/index.js +120 -0
  83. package/vendor/components/sha256/586063d3a4e24e2995923811b2b9466bde86dbaafb3bcf103546d3f28159205a/index.js +812 -0
  84. package/vendor/components/sha256/5acc5f87e29f1170bc35dbee08087d0d03c1023969c6c1b1367a0f559d60e5ee/index.js +198 -0
  85. package/vendor/components/sha256/5c032594230fe688f661b6ccf27070c84f8c0e38611186280fb9c56d89ac3319/README.en.md +32 -0
  86. package/vendor/components/sha256/5c032594230fe688f661b6ccf27070c84f8c0e38611186280fb9c56d89ac3319/index.js +222 -0
  87. package/vendor/components/sha256/603de10f0ee50d07ec610e21b45b9db78d69376b4dfd2baba78595c1002e27ec/README.en.md +50 -0
  88. package/vendor/components/sha256/603de10f0ee50d07ec610e21b45b9db78d69376b4dfd2baba78595c1002e27ec/index.js +171 -0
  89. package/vendor/components/sha256/609e45a826d07a54cbbcbf4ce2ad6b5474dca1d0be394eb9fad895db4a73422f/README.en.md +51 -0
  90. package/vendor/components/sha256/609e45a826d07a54cbbcbf4ce2ad6b5474dca1d0be394eb9fad895db4a73422f/index.js +228 -0
  91. package/vendor/components/sha256/6364043cb31bbd86aacb7432af1a8affef8cae5c6efdbe13fbebd116fd51b91f/index.js +233 -0
  92. package/vendor/components/sha256/6f9f7283226d3534aa1cb4a47ba258204aa286ead01b25cdbde14119260bc702/README.en.md +66 -0
  93. package/vendor/components/sha256/6f9f7283226d3534aa1cb4a47ba258204aa286ead01b25cdbde14119260bc702/index.js +920 -0
  94. package/vendor/components/sha256/72edfd6678b22be0bb3e32b0d8cb0dfee403767e1eacac354d278d7318d03826/README.en.md +35 -0
  95. package/vendor/components/sha256/72edfd6678b22be0bb3e32b0d8cb0dfee403767e1eacac354d278d7318d03826/index.js +179 -0
  96. package/vendor/components/sha256/7482c50bea5ef7d72dc5d4afaddb8c4e725b5a83fa0c6175f9a9c556f23a4e10/LICENSE-tabler.txt +21 -0
  97. package/vendor/components/sha256/7482c50bea5ef7d72dc5d4afaddb8c4e725b5a83fa0c6175f9a9c556f23a4e10/index.js +4868 -0
  98. package/vendor/components/sha256/7482c50bea5ef7d72dc5d4afaddb8c4e725b5a83fa0c6175f9a9c556f23a4e10/names.txt +4808 -0
  99. package/vendor/components/sha256/7cb8948c550b66bf4b34a62e7b61385aaa79896e09d82ccb1846c0ac499ad352/README.en.md +40 -0
  100. package/vendor/components/sha256/7cb8948c550b66bf4b34a62e7b61385aaa79896e09d82ccb1846c0ac499ad352/index.js +348 -0
  101. package/vendor/components/sha256/87cc60da38d209cda449dd7c24171e287ac8184c5036ca04548ef9e2015c2d9e/README.en.md +42 -0
  102. package/vendor/components/sha256/87cc60da38d209cda449dd7c24171e287ac8184c5036ca04548ef9e2015c2d9e/index.js +268 -0
  103. package/vendor/components/sha256/8cb367c71c002c689defddc6f075be911d5485421715119b5515181e962a2401/index.js +121 -0
  104. package/vendor/components/sha256/97bfd6e79c7278c55153bf4c2330da0432cf0ee312baa11650e07cdd7912831d/index.js +354 -0
  105. package/vendor/components/sha256/a426e6a3f8f4593403ba63ecc4a3f1f41064f4016fd9fb8d51e7876bf8c6f573/README.en.md +40 -0
  106. package/vendor/components/sha256/a426e6a3f8f4593403ba63ecc4a3f1f41064f4016fd9fb8d51e7876bf8c6f573/index.js +348 -0
  107. package/vendor/components/sha256/c108119117042cacc65a35ec73fcab95a2a92b2a2797129f66e326783f8db178/index.js +465 -0
  108. package/vendor/components/sha256/c3fad2047cec6a2bd8a5b907f752e2addeeea2f373fd8115914552dcee0b2f6f/README.en.md +23 -0
  109. package/vendor/components/sha256/c3fad2047cec6a2bd8a5b907f752e2addeeea2f373fd8115914552dcee0b2f6f/index.js +289 -0
  110. package/vendor/components/sha256/c59f1ac3132fdf6f56e8880c866570cd7443f09eb8802b6e7af32675ad358edf/README.en.md +31 -0
  111. package/vendor/components/sha256/c59f1ac3132fdf6f56e8880c866570cd7443f09eb8802b6e7af32675ad358edf/index.js +236 -0
  112. package/vendor/components/sha256/d3a75f67160490db1831aaa8ac58ebc5f7ffb6a6fd21e2bdeaa6fe979bfaff7f/README.en.md +42 -0
  113. package/vendor/components/sha256/d3a75f67160490db1831aaa8ac58ebc5f7ffb6a6fd21e2bdeaa6fe979bfaff7f/index.js +488 -0
  114. package/vendor/components/sha256/d998b5db828427505e39cdae67676dc6480c791d6037152dec222ae81cdbba1f/index.js +484 -0
  115. package/vendor/components/sha256/ea17602aaecca64b672b3bc827965ff378cb460250177f7b66f73081a48d4e81/index.js +278 -0
  116. package/vendor/components/sha256/f9cef6dd9580a4f19aa09d47f736ab2391f5f585b20b16a62bd781398cb6b8ac/README.en.md +22 -0
  117. package/vendor/components/sha256/f9cef6dd9580a4f19aa09d47f736ab2391f5f585b20b16a62bd781398cb6b8ac/index.js +145 -0
  118. package/vendor/components-2/manifest-2.8.0.json +2199 -0
  119. package/vendor/themes/asagi/1.2.0/theme.json +14 -0
  120. package/vendor/themes/asagi/1.2.0/tokens.css +30 -0
  121. package/vendor/themes/business/1.2.0/theme.json +5 -0
  122. package/vendor/themes/business/1.2.0/tokens.css +41 -0
  123. package/vendor/themes/default/1.4.0/theme.json +4 -0
  124. package/vendor/themes/default/1.4.0/tokens.css +86 -0
  125. package/vendor/themes/kogecha/1.2.0/theme.json +10 -0
  126. package/vendor/themes/kogecha/1.2.0/tokens.css +29 -0
  127. package/vendor/themes/kokugo/1.2.0/theme.json +5 -0
  128. package/vendor/themes/kokugo/1.2.0/tokens.css +25 -0
  129. package/vendor/themes/murasaki/1.2.0/theme.json +10 -0
  130. package/vendor/themes/murasaki/1.2.0/tokens.css +25 -0
  131. package/vendor/themes/sumi/1.2.0/theme.json +10 -0
  132. package/vendor/themes/sumi/1.2.0/tokens.css +49 -0
  133. package/vendor/themes/tokiwa/1.2.0/theme.json +10 -0
  134. package/vendor/themes/tokiwa/1.2.0/tokens.css +27 -0
@@ -182,6 +182,9 @@ export const MESSAGES = {
182
182
  attachCount: { ja: (a) => `添付が多すぎる(${a.max} 個まで):「${a.path}」は Egatari ファイルに入らない`, en: (a) => `too many attachments (at most ${a.max}): “${a.path}” is not packed into the Egatari file` },
183
183
  attachList: { ja: (a) => `添付:${a.n} 個(${a.size}。読み手の一覧に ${a.listed} 個)。Egatari ファイル(.ega.html)の再生ではダウンロードだけで、再生専用(--play-only)には入らない`, en: (a) => `attachments: ${a.n} (${a.size}; ${a.listed} listed for readers). In the Egatari file (.ega.html) they are download-only; play-only files (--play-only) do not carry them` },
184
184
  // ---------------------------------------------------------------- 体裁(はみ出し・字数・表記)
185
+ kickerLong: { rule: 'R-headings', ja: (a) => `肩見出しが長い(${a.n} ${a.latin ? '文字' : '字分'}。${a.latin ? 'ラテン文字は 40 文字まで' : '24 字分まで。全角 1・半角 0.5'}):${quoteJa(a.t)}を短くする`, en: (a) => `the kicker has ${a.n} ${a.latin ? 'characters' : 'units'}, over ${a.max} (${a.latin ? 'Latin script' : 'full-width 1, ASCII 0.5'}): shorten “${a.t}”` },
186
+ kickerPlace: { rule: 'R-headings', ja: () => '肩見出し(.kicker)はスライドに 1 つだけ、見出しの直前に置く', en: () => 'place just one kicker (.kicker) per slide, immediately before the heading' },
187
+ kickerSlide: { rule: 'R-headings', ja: () => '表紙・章の扉・縦書きのスライド(layout-tate)には肩見出し(.kicker)を置かない', en: () => 'do not use a kicker (.kicker) on a cover, chapter divider or vertical slide (layout-tate)' },
185
188
  titleLong: { rule: 'R-title', ja: (a) => `見出しが ${a.n} 字で長い(26 字まで。全角 1・半角 0.5):${quoteJa(a.t)}を短くするか、要点を結論の行に移す`, en: (a) => `the heading has ${a.n} units, over 26 (full-width 1, ASCII 0.5): shorten “${a.t}” or move the point to the conclusion line` },
186
189
  titleLongEn: { rule: 'R-title', ja: (a) => `見出しが ${a.n} 文字で長い(英文は 60 文字まで):${quoteJa(a.t)}を短くする`, en: (a) => `the heading has ${a.n} characters, over 60: shorten “${a.t}”` },
187
190
  titleColon: { rule: 'R-title', ja: (a) => `見出し${quoteJa(a.t)}がコロンで終わっている:コロンを取り、見出しだけで言い切る`, en: (a) => `the heading “${a.t}” ends with a colon: remove it and let the heading stand on its own` },
@@ -191,12 +194,12 @@ export const MESSAGES = {
191
194
  conclOverflow: { rule: 'R-concl', ja: () => '結論の行が枠からはみ出す:結論の行を短くして 1 行に収める', en: () => 'the conclusion line overflows its box: shorten it to one line' },
192
195
  // 結論の行の上端(conclTop)・1 行の高さ(line)・右の限り(bodyRight の lim)はテーマの寸法(metrics)が既定と違うときだけ値にある(なければ既定の値)
193
196
  bodyBottom: { rule: 'R-fit',
194
- ja: (a) => { const L = a.line || DEF_LINE, o = Math.ceil(a.px - a.lim), n = Math.max(1, Math.ceil(o / L)); return `本文が下に ${o} px はみ出す(${a.px}px > ${a.lim}px${a.concl ? `、結論の行の上端は ${a.conclTop ?? DEF_CONCL_TOP}px` : ''}):本文をおよそ ${n} 行(1 行 ${L} px)減らすか、パーツを ${o} px 低くするか、スライドを 2 枚に分ける(字は縮めない)`; },
195
- en: (a) => { const L = a.line || DEF_LINE, o = Math.ceil(a.px - a.lim), n = Math.max(1, Math.ceil(o / L)); return `the body overflows at the bottom by ${o} px (${a.px}px > ${a.lim}px${a.concl ? `; the conclusion line starts at ${a.conclTop ?? DEF_CONCL_TOP}px` : ''}): cut about ${n} line${n > 1 ? 's' : ''} (${L} px each), make the part ${o} px lower, or split the slide in two (do not shrink text)`; } },
196
- bodyRight: { rule: 'R-fit', ja: (a) => `本文が右にはみ出す(${a.px}px > ${a.lim ?? DEF_RIGHT}px):長い式や表を分けるか、横並び(.cols)の幅を見直す`, en: (a) => `the body overflows to the right (${a.px}px > ${a.lim ?? DEF_RIGHT}px): break the long equation or table, or rebalance the .cols widths` },
197
- tateBodyHead: { rule: 'R-fit', ja: (a) => `本文が見出しの列に重なる(${a.px}px > ${a.lim}px):縦書きの本文を減らすか、スライドを分ける`, en: (a) => `the body runs into the heading column (${a.px}px > ${a.lim}px): cut the vertical text or split the slide` },
198
- bodyConclCol: { rule: 'R-fit', ja: (a) => `本文が結論の列に重なる(${a.px}px < ${a.lim}px):縦書きの本文を減らすか、スライドを分ける`, en: (a) => `the body runs into the conclusion column (${a.px}px < ${a.lim}px): cut the vertical text or split the slide` },
199
- bodyLeft: { rule: 'R-fit', ja: (a) => `本文が左にはみ出す(${a.px}px < ${a.lim}px):縦書きの本文を減らすか、スライドを分ける`, en: (a) => `the body overflows to the left (${a.px}px < ${a.lim}px): cut the vertical text or split the slide` },
197
+ ja: (a) => { const L = a.line || DEF_LINE, o = Math.ceil(a.px - a.lim), n = Math.max(1, Math.ceil(o / L)); return `本文が下に ${o} px はみ出す(${a.px}px > ${a.lim}px${a.concl ? `、結論の行の上端は ${a.conclTop ?? DEF_CONCL_TOP}px` : ''})${partNote(a, true)}:本文をおよそ ${n} 行(1 行 ${L} px)減らすか、パーツを ${o} px 低くするか、スライドを 2 枚に分ける(字は縮めない)`; },
198
+ en: (a) => { const L = a.line || DEF_LINE, o = Math.ceil(a.px - a.lim), n = Math.max(1, Math.ceil(o / L)); return `the body overflows at the bottom by ${o} px (${a.px}px > ${a.lim}px${a.concl ? `; the conclusion line starts at ${a.conclTop ?? DEF_CONCL_TOP}px` : ''})${partNote(a, false)}: cut about ${n} line${n > 1 ? 's' : ''} (${L} px each), make the part ${o} px lower, or split the slide in two (do not shrink text)`; } },
199
+ bodyRight: { rule: 'R-fit', ja: (a) => `本文が右にはみ出す(${a.px}px > ${a.lim ?? DEF_RIGHT}px)${partNote(a, true)}:長い式や表を分けるか、横並び(.cols)の幅を見直す`, en: (a) => `the body overflows to the right (${a.px}px > ${a.lim ?? DEF_RIGHT}px)${partNote(a, false)}: break the long equation or table, or rebalance the .cols widths` },
200
+ tateBodyHead: { rule: 'R-fit', ja: (a) => `本文が見出しの列に重なる(${a.px}px > ${a.lim}px)${partNote(a, true)}:縦書きの本文を減らすか、スライドを分ける`, en: (a) => `the body runs into the heading column (${a.px}px > ${a.lim}px)${partNote(a, false)}: cut the vertical text or split the slide` },
201
+ bodyConclCol: { rule: 'R-fit', ja: (a) => `本文が結論の列に重なる(${a.px}px < ${a.lim}px)${partNote(a, true)}:縦書きの本文を減らすか、スライドを分ける`, en: (a) => `the body runs into the conclusion column (${a.px}px < ${a.lim}px)${partNote(a, false)}: cut the vertical text or split the slide` },
202
+ bodyLeft: { rule: 'R-fit', ja: (a) => `本文が左にはみ出す(${a.px}px < ${a.lim}px)${partNote(a, true)}:縦書きの本文を減らすか、スライドを分ける`, en: (a) => `the body overflows to the left (${a.px}px < ${a.lim}px)${partNote(a, false)}: cut the vertical text or split the slide` },
200
203
  // テーマの寸法の宣言(theme.json の metrics。docs/contract.md §12)。教材に 1 回。テーマの知らせなので規格の名前はない
201
204
  themeMetricsDrift: {
202
205
  ja: (a) => `テーマ「${a.theme}」の${a.declared ? '寸法の宣言(theme.json の metrics)と描いた体裁の箱が違う' : '体裁の箱が既定の位置から動いているのに、寸法の宣言(theme.json の metrics)がない'}(${driftList(a.items, 'ja')})。本文の場所の限りは${a.declared ? '宣言' : '既定'}の値で決めるので、はみ出しの指摘がずれる:${driftHow(a, 'ja')}`,
@@ -326,7 +329,6 @@ export const MESSAGES = {
326
329
  palette: { ja: (a) => `パレット:${a.v} ${a.css} = rgb(${a.rgb})${a.ratio ? ` vs --bg → コントラスト ${a.ratio}:1` : ''}`, en: (a) => `palette: ${a.v} ${a.css} = rgb(${a.rgb})${a.ratio ? ` vs --bg → contrast ${a.ratio}:1` : ''}` },
327
330
  contrastLow: { rule: 'R-colors', ja: (a) => `${a.v} と --bg のコントラストが低い(${a.ratio}:1 < ${a.min}:1):テーマの色を直す(教材の中で色を書いていれば消し、テーマの class と変数だけを使う)`, en: (a) => `low contrast between ${a.v} and --bg (${a.ratio}:1 < ${a.min}:1): fix the theme colors (remove any colors written in the lesson; use only theme classes and variables)` },
328
331
  compOrder: { ja: (a) => `パーツの描画が呼び出し順に依存している(ステップ ${a.k}):render(k, t) が前の呼び出しの状態に頼らないようにパーツを直す(docs/contract.md §3)`, en: (a) => `the part draws differently depending on call order (step ${a.k}): make render(k, t) independent of previous calls (docs/contract.md §3)` },
329
- compOrderNoise: { ja: (a) => `パーツの描画の揺れを許した(ステップ ${a.k}):2 回の描画でパーツの DOM はバイトまで同じで、違う画素 ${a.n} 個は${a.faint ? `、縁から遠いわずかな違いの ${a.faint} 個(ばらばらで、各チャンネル 24/255 以下)のほかは` : ''}どれも図形の縁にあり、上限 ${a.cap} 以下(描き方のアンチエイリアスの揺れで、呼び出し順への依存ではない。kit/render-compare.mjs)`, en: (a) => `renderer noise accepted (step ${a.k}): the part DOM was byte-identical in both renders and the ${a.n} differing ${plural(a.n, 'pixel')} all lie on shape edges${a.faint ? ` except ${a.faint} isolated faint ${plural(a.faint, 'pixel')} (each channel ≤ 24/255)` : ''}, within the cap of ${a.cap} (anti-aliasing noise, not call-order dependence; kit/render-compare.mjs)` },
330
332
  compOrderDetail: { ja: (a) => `品質チェック(呼び出し順)の詳しい結果(ステップ ${a.k}):${a.note}`, en: (a) => `quality check details (call order, step ${a.k}): ${a.note}` },
331
333
  markMissing: { rule: 'R-marks', ja: (a) => `強調 {mark:${a.id}} の目印がこのスライドにない:目印の要素に id="${a.id}" か data-mark="${a.id}" を付ける(式の一部は \\htmlId{${a.id}}{…})か、{mark:…} を消す`, en: (a) => `the emphasis {mark:${a.id}} has no target on this slide: put id="${a.id}" or data-mark="${a.id}" on the element (\\htmlId{${a.id}}{…} in math), or remove the {mark:…}` },
332
334
  marks: { ja: (a) => `強調:${a.list}`, en: (a) => `emphasis: ${a.list}` },
@@ -397,6 +399,11 @@ function compHow(a, ja) {
397
399
  if (a.shape) return ja ? `データの形は ${a.shape}${ex ? `。${ex}` : ''}` : `the data is ${a.shape}${ex ? `; ${ex}` : ''}`;
398
400
  return ex;
399
401
  }
402
+ // 本文のはみ出しの原因がパーツのとき(a.part。kit/core/layout-scan.mjs)、そのパーツを言う(backlog #196)
403
+ function partNote(a, ja) {
404
+ if (!a.part) return '';
405
+ return ja ? `。はみ出しているのは${compName(a.part, true)}` : `; ${compName(a.part, false)} sticks out`;
406
+ }
400
407
  function compName(a, ja) {
401
408
  const n = a.index > 0 ? (ja ? `(${a.index + 1} 個目)` : ` (#${a.index + 1})`) : '';
402
409
  return ja ? `パーツ <${a.tag}>${n}${a.label ? `「${a.label}」` : ''}` : `the part <${a.tag}>${n}${a.label ? ` “${a.label}”` : ''}`;
@@ -409,6 +416,10 @@ export function ruleOf(code, a = {}) {
409
416
  return r || null;
410
417
  }
411
418
 
419
+ // 描き方の揺れとして通した描き比べの説明(指摘ではない。kit/check.mjs の --json の renderNoise。backlog #210)
420
+ const RENDER_NOISE = { ja: (a) => `パーツの描画の揺れを許した(ステップ ${a.k}):2 回の描画でパーツの DOM はバイトまで同じで、違う画素 ${a.n} 個は${a.faint ? `、縁から遠いわずかな違いの ${a.faint} 個(ばらばらで、各チャンネル 24/255 以下)のほかは` : ''}どれも図形の縁にあり、上限 ${a.cap} 以下(描き方のアンチエイリアスの揺れで、呼び出し順への依存ではない。kit/render-compare.mjs)`, en: (a) => `renderer noise accepted (step ${a.k}): the part DOM was byte-identical in both renders and the ${a.n} differing ${plural(a.n, 'pixel')} all lie on shape edges${a.faint ? ` except ${a.faint} isolated faint ${plural(a.faint, 'pixel')} (each channel ≤ 24/255)` : ''}, within the cap of ${a.cap} (anti-aliasing noise, not call-order dependence; kit/render-compare.mjs)` };
421
+ export const renderNoiseMessage = (lang, a = {}) => (lang === 'en' ? RENDER_NOISE.en : RENDER_NOISE.ja)(a);
422
+
412
423
  export function message(lang, code, a = {}) {
413
424
  const m = MESSAGES[code];
414
425
  if (!m) return code;
package/kit/check.mjs CHANGED
@@ -49,7 +49,7 @@ import { planAttachments, inspectAttachment, ATTACH_LIMITS } from './core/attach
49
49
  import { normalizeKey, noteProblems } from './narration.mjs';
50
50
  import { readingProblems, readingGaps, orphanSteps, orphanDetail, formulaLike, formulaText, narrationLang, textLang } from './core/narration-lint.mjs';
51
51
  import { cleanErrorText, componentError } from './core/error-text.mjs';
52
- import { partReportFinding, message, where, ruleOf } from './check-messages.mjs';
52
+ import { partReportFinding, message, where, ruleOf, renderNoiseMessage } from './check-messages.mjs';
53
53
  import { account, ruleSetText, factsFromSource } from './core/check-rules.mjs';
54
54
  import { createHash } from 'node:crypto';
55
55
  import { readRegular, readHead, READ_LIMITS } from './bounded-read.mjs';
@@ -61,6 +61,7 @@ import { TEXT_BANDS, DEFAULT_BAND } from './core/text-band.mjs';
61
61
  import { placeholderSteps, templateTextIn } from './core/template-text.mjs';
62
62
  import { legacyVocabulary } from './core/legacy-vocab.mjs';
63
63
  import { colorsOutsideVocabulary } from './core/color-vocab.mjs';
64
+ import { kickerFindings } from './core/kicker.mjs';
64
65
  import { predictStepProblems } from './core/predict-steps.mjs';
65
66
  import { FONTS_EXTRA_WARN, FONTS_EXTRA_PKG, FONTS_EXTRA_INSTALL } from './core/build-core.mjs';
66
67
  import { uncoveredGlyphs } from './core/font-coverage.mjs';
@@ -93,6 +94,7 @@ try { src = resolveDeckArg(arg0); } catch (e) { console.error(`check: ${e.messag
93
94
  const results = [];
94
95
  // code:kit/check-messages.mjs の知らせ。a:その値。step:段階の鍵(0・1・…・concl)か null。言葉は最後に作る(どこか+何が違うか+どう直すか)
95
96
  function report(slide, sev, code, a = {}, step = null) { results.push({ slide, sev, code, a, step }); }
97
+ const renderNoise = []; // 描き方の揺れとして通した比べ(指摘ではない。--json の renderNoise)
96
98
  const SEV_RANK = { error: 0, warn: 1, info: 2 };
97
99
 
98
100
  // ---------------------------------------------------------------- 字数(全角 1・半角 0.5)
@@ -186,6 +188,8 @@ if (extraMissing.length) report(null, 'error', 'fontsExtraMissing', { fonts: ext
186
188
  // 予想(m-predict)の段階(R-steps):答えが数の棒と同時(predictAnswerWithCount。数える前に答えが見える)、steps が答えの段階より小さい(predictAnswerNeverShown。答えが出ない)。
187
189
  // 編集アプリも同じ関数(kit/core/check-source.mjs)
188
190
  for (const { code, slide, ...x } of predictStepProblems(readRegular(src, { max: READ_LIMITS.source }).toString('utf8'))) report(slide, 'warn', code, x);
191
+ // 肩見出し:置き場所・字数・使えない種類のスライド(編集アプリも同じ関数)
192
+ for (const f of kickerFindings(readRegular(src, { max: READ_LIMITS.source }).toString('utf8'))) report(f.i, f.sev, f.code, f.a);
189
193
  // {#id} で指したスライドの見出しと、narration.md の見出しの文字列が違う(id が勝つので、知らせるだけ)
190
194
  const byKey = new Map(built.slides.map((s, i) => [s.key, { ...s, i }]));
191
195
  for (const sec of built.segs.sections || []) {
@@ -667,7 +671,7 @@ const settle = () => page.evaluate(() => Promise.all([...document.fonts].map((f)
667
671
  // 操作の帯(kit/tools.js の #dt-cb)は開いたときに一度出て SHOW_MS(2.5 秒)で消えるので、撮る時刻で写ったり写らなかったりする。
668
672
  // 遅い機械では A(開いてすぐ)にだけ写り、B(飛び回った後)では消えていて、部品と関係なく「呼び出し順に依存」になっていた。部品の絵だけを比べるため、
669
673
  // 舞台の上に重なる時刻依存の飾り(操作の帯・短い知らせ)は撮る前に消しておく
670
- const HIDE_CHROME = '#dt-cb,#deck-toast{display:none!important}';
674
+ const HIDE_CHROME = '#dt-cb,#dt-hint,#deck-toast{display:none!important}';
671
675
  async function orderDiffers(m, k) {
672
676
  await collectPartReports();
673
677
  await page.goto(url);
@@ -689,7 +693,9 @@ async function orderDiffers(m, k) {
689
693
  // (kit/render-compare.mjs。tools/test-components.mjs の決定性と同じ基準)
690
694
  if (bufA.equals(bufB)) return false;
691
695
  const r = await compareRenders(page, bufA, bufB, domA, await domSnapshot(page, m.i));
692
- if (r.same && r.kind === 'noise') report(m.i, 'info', 'compOrderNoise', { k, n: r.n, cap: r.cap, faint: r.faint || 0 }, String(k)); // 揺れとして通したものは必ず記録する
696
+ // 揺れとして通したものは renderNoise に記録する(指摘ではない:出るかどうかが実行ごとに変わり、同じ教材の指摘の数を揺らしていた。backlog #210)。
697
+ // 違う画素が 0 個(PNG のバイトだけが違い、画素は同じ)は揺れでもないので記録しない
698
+ if (r.same && r.kind === 'noise' && r.n > 0) renderNoise.push({ slide: m.i, step: String(k), a: { k, n: r.n, cap: r.cap, faint: r.faint || 0 } });
693
699
  lastOrderNote = r.note;
694
700
  return !r.same;
695
701
  }
@@ -828,7 +834,9 @@ if (asJson) {
828
834
  data: r.a,
829
835
  msg: cliHints(r.msg),
830
836
  }));
831
- console.log(JSON.stringify({ ok, status: acc.status, lang: ML, counts, results: out, ruleSet, rules: acc.rules, summary: acc.summary, ...(acc.status === 'incomplete' ? { unset: acc.unset, problems: acc.problems } : {}) }, null, 2));
837
+ // renderNoise:呼び出し順の比べで、描き方の揺れ(アンチエイリアス)として通したもの。指摘ではなく、数えない(backlog #210)
838
+ const noiseOut = renderNoise.map((x) => ({ slide: x.slide + 1, id: (meta[x.slide] && meta[x.slide].id) || null, step: x.step, data: x.a, msg: where(ML, placeOf({ slide: x.slide, step: x.step })) + sep + renderNoiseMessage(ML, x.a) }));
839
+ console.log(JSON.stringify({ ok, status: acc.status, lang: ML, counts, results: out, renderNoise: noiseOut, ruleSet, rules: acc.rules, summary: acc.summary, ...(acc.status === 'incomplete' ? { unset: acc.unset, problems: acc.problems } : {}) }, null, 2));
832
840
  } else {
833
841
  // スライド番号順(null=デッキ全体は先頭)にグループ化し、各グループ内は error → warn → info。見出しの行にスライドがあるので、行には段階と言葉だけ
834
842
  const groups = new Map();
@@ -149,9 +149,9 @@ export function renderArticle(article, opts = {}) {
149
149
  const block = (ns) => (ns || []).map(node).filter((x) => x !== '').join('\n');
150
150
  const num = (n) => info.nodes.get(n) || {};
151
151
  const math = (tex, display) => {
152
- if (!opts.katex) return `<code class="egatari-tex">${esc(tex)}</code>`;
153
- try { return opts.katex.renderToString(tex, { displayMode: display, throwOnError: true, strict: 'ignore', output: 'htmlAndMathml', macros: { ...(opts.macros || {}) }, trust: false }); }
154
- catch (e) { warnings.push(`${f.path}: KaTeX: ${String(e.message).split('\n')[0]} in: ${tex.slice(0, 60)}`); return `<span class="katex-error">${esc(tex)}</span>`; }
152
+ if (!opts.katex) return `<code class="egatari-tex" translate="no">${esc(tex)}</code>`;
153
+ try { return opts.katex.renderToString(tex, { displayMode: display, throwOnError: true, strict: 'ignore', output: 'htmlAndMathml', macros: { ...(opts.macros || {}) }, trust: false }).replace(/^<span class="(katex(?:-display)?)"/, '<span translate="no" class="$1"'); } // spec §8.0 Browser translation
154
+ catch (e) { warnings.push(`${f.path}: KaTeX: ${String(e.message).split('\n')[0]} in: ${tex.slice(0, 60)}`); return `<span class="katex-error" translate="no">${esc(tex)}</span>`; }
155
155
  };
156
156
  const img = (n) => {
157
157
  const src = opts.image ? opts.image(String(n.url || '')) : null;
@@ -177,7 +177,7 @@ export function renderArticle(article, opts = {}) {
177
177
  case 'break': return '<br>';
178
178
  case 'emphasis': return `<em>${inline(n.children)}</em>`;
179
179
  case 'strong': return `<strong>${inline(n.children)}</strong>`;
180
- case 'inlineCode': return `<code>${esc(n.value)}</code>`;
180
+ case 'inlineCode': return `<code translate="no">${esc(n.value)}</code>`;
181
181
  case 'subscript': return `<sub>${inline(n.children)}</sub>`;
182
182
  case 'superscript': return `<sup>${inline(n.children)}</sup>`;
183
183
  case 'paragraph': return `<p>${inline(n.children)}</p>`;
@@ -193,7 +193,7 @@ export function renderArticle(article, opts = {}) {
193
193
  const start = n.ordered && Number.isInteger(n.start) && n.start !== 1 ? ` start="${n.start}"` : '';
194
194
  return `<${tag}${start}>${(n.children || []).map((li) => `<li>${n.spread ? block(li.children) : (li.children || []).map((c) => (c.type === 'paragraph' ? inline(c.children) : node(c))).join('\n')}</li>`).join('')}</${tag}>`;
195
195
  }
196
- case 'code': return `<pre><code${n.lang ? ` class="language-${esc(String(n.lang).replace(/[^\w+-]/g, ''))}"` : ''}>${esc(n.value)}</code></pre>`;
196
+ case 'code': return `<pre translate="no"><code${n.lang ? ` class="language-${esc(String(n.lang).replace(/[^\w+-]/g, ''))}"` : ''}>${esc(n.value)}</code></pre>`;
197
197
  case 'link': {
198
198
  const url = String(n.url || '');
199
199
  if (url.startsWith('#')) {
@@ -37,6 +37,20 @@ import { NotRegularFileError, ReadOverError, utf8Length } from './bounded-read-c
37
37
  import { normalizeKey, parseNarration, narrationMap, marksMap, MARK_EFFECTS, isSlideId, headingText } from './narration-core.mjs';
38
38
 
39
39
  // 設定のファイルの metadata から deck-meta に写す権利の項目(format spec §4 の deck-meta の表。schema/deck-meta.schema.json)。1 ファイル(portable.mjs)も作業フォルダの組み立ても同じものを写す
40
+
41
+ // spec §8.0 Browser translation:ブラウザのページ翻訳で崩れるもの(組んだ数式・コード・パーツの描画)に translate="no" を付ける。
42
+ // 見出し・本文・結論の行・字幕・本は訳せるまま。すでに translate を書いたものは作者の指定のまま
43
+ export function noTranslateMath(h) { return h.replace(/^<span class="(katex(?:-display)?)"/, '<span translate="no" class="$1"'); }
44
+ export function noTranslateTags(h) { return h.replace(/<(code|pre|m-[a-z0-9]+(?:-[a-z0-9]+)*)(?=[\s>\/])(?![^>]*\btranslate\s*=)/gi, '<$1 translate="no"'); }
45
+ // 作業フォルダのパーツのファイル(backlog #197、d5 2026-11-10):components/<タグから m- を除いた名前>/index.js と components/<タグ>/index.js の
46
+ // どちらも受ける。同じタグで両方あれば、黙って片方を選ばずに組み立てを止める(2 つのパスを言う)。どちらもなければ、期待する形のパス(m- を除いた方)を返す
47
+ export function localPartFile(env, P, deckDir, tag) {
48
+ const short = P.join(deckDir, 'components', tag.slice(2), 'index.js'), full = P.join(deckDir, 'components', tag, 'index.js');
49
+ const hs = env.exists(short), hf = env.exists(full);
50
+ if (hs && hf) throw Object.assign(new Error(`part ${tag}: both components/${tag.slice(2)}/index.js and components/${tag}/index.js exist in the work folder; keep one (パーツ ${tag} のフォルダが 2 つある:どちらか 1 つにする)`), { code: 'component-folder-twice', paths: [`components/${tag.slice(2)}/index.js`, `components/${tag}/index.js`] });
51
+ return hf ? full : short;
52
+ }
53
+
40
54
  export const DECK_META_RIGHTS = ['license', 'copyright', 'attribution', 'creators'];
41
55
  // metadata.offer(format spec §1.2:作者が見せるモードと見え方、開くときの {mode, face})を書く形にする。deck-meta.offer と索引の metadata.offer に使う。
42
56
  // 前の版の learn は talk と読む(Player P1)。知らない値・重なりは捨て、空になった modes・faces は書かない。open は offer の中にあるものだけ。
@@ -223,6 +237,7 @@ export const FONT_LIST = Object.freeze([
223
237
  { family: 'Zen Maru Gothic', pkg: '@fontsource/zen-maru-gothic', group: 'ja', weights: [400, 700] },
224
238
  { family: 'Klee One', pkg: '@fontsource/klee-one', group: 'ja', weights: [400, 600], extra: true },
225
239
  { family: 'Source Sans 3', pkg: '@fontsource/source-sans-3', group: 'en', weights: [400, 700], italic: true, default: true },
240
+ { family: 'Fraunces', pkg: '@fontsource/fraunces', group: 'en', weights: [400, 700] },
226
241
  { family: 'Source Serif 4', pkg: '@fontsource/source-serif-4', group: 'en', weights: [400, 700], italic: true, extra: true },
227
242
  { family: 'Andika', pkg: '@fontsource/andika', group: 'en', weights: [400, 700], italic: true, extra: true },
228
243
  { family: 'Atkinson Hyperlegible Next', pkg: '@fontsource/atkinson-hyperlegible-next', group: 'en', weights: [400, 700], italic: true, extra: true },
@@ -914,12 +929,12 @@ export function build(env0, srcPath, opts = {}) {
914
929
  let count = 0;
915
930
  const render = (tex, display) => {
916
931
  if (++count > LIM.math) throw new BuildLimitError('formulas', count, LIM.math);
917
- try { return env.katex.renderToString(tex, { displayMode: display, throwOnError: true, strict: 'ignore', output: 'htmlAndMathml', macros: { ...macros }, trust: (c) => TRUSTED.has(c.command) }); }
918
- catch (e) { warn.push(`KaTeX: ${e.message.split('\n')[0]} in: ${tex.slice(0, 60)}`); return `<span class="katex-error" title="${escAttr(e.message)}">${escAttr(tex)}</span>`; }
932
+ try { return noTranslateMath(env.katex.renderToString(tex, { displayMode: display, throwOnError: true, strict: 'ignore', output: 'htmlAndMathml', macros: { ...macros }, trust: (c) => TRUSTED.has(c.command) })); }
933
+ catch (e) { warn.push(`KaTeX: ${e.message.split('\n')[0]} in: ${tex.slice(0, 60)}`); return `<span class="katex-error" translate="no" title="${escAttr(e.message)}">${escAttr(tex)}</span>`; }
919
934
  };
920
935
  const parts = html.split(/(<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<svg[\s\S]*?<\/svg>|<textarea[\s\S]*?<\/textarea>|<!--[\s\S]*?-->)/);
921
936
  for (let i = 0; i < parts.length; i += 2) {
922
- parts[i] = parts[i].replace(/\\\[([\s\S]+?)\\\]/g, (_, t) => render(t, true)).replace(/\\\(([\s\S]+?)\\\)/g, (_, t) => render(t, false));
937
+ parts[i] = parts[i].replace(/\\\[([\s\S]+?)\\\]/g, (_, t) => render(t, true)).replace(/\\\(([\s\S]+?)\\\)/g, (_, t) => render(t, false)); parts[i] = noTranslateTags(parts[i]); // spec §8.0 Browser translation:コードとパーツはブラウザの翻訳にかけない
923
938
  }
924
939
  html = parts.join('');
925
940
  if (html.length > LIM.bundledChars) throw new BuildLimitError('document with formulas', html.length, LIM.bundledChars);
@@ -966,7 +981,7 @@ export function build(env0, srcPath, opts = {}) {
966
981
  if (deckUse.defined.has(t)) continue; // 原稿の <script> が定義する
967
982
  const h = catalogueHint(readLock(env, ROOT), lock2, t, pc.catalogue);
968
983
  if (h.hint !== 'unknown' && deckUse.elements.has(t)) notInCatalogue.push(h);
969
- else warn.push(`component not found: ${t} (not in the components ${pc.catalogue} catalogue)`);
984
+ else warn.push(`component not found: ${t} (not in the components ${pc.catalogue} catalogue; a lesson's own part goes in components/${t.slice(2)}/index.js or components/${t}/index.js in the work folder)`);
970
985
  }
971
986
  html = parts2.html;
972
987
  compJs = parts2.js;
@@ -995,7 +1010,8 @@ export function build(env0, srcPath, opts = {}) {
995
1010
  const name = tag.slice(2);
996
1011
  // 読む前に、原稿のフォルダの部品は原稿のフォルダの中に、部品庫の部品は vendor/components/ の中にあること(実体のパスで。外を指すリンクは読まない。
997
1012
  // 原稿のフォルダにあって外を指すものは、部品庫のものに替えずに使わない)
998
- const local = P.join(deckDir, 'components', name, 'index.js');
1013
+ const local = localPartFile(env, P, deckDir, tag);
1014
+ const localRel = P.relative(deckDir, local).split(P.sep).join('/');
999
1015
  const pick = pickVersion(lock, name, Object.prototype.hasOwnProperty.call(pins, name) ? pins[name] : undefined);
1000
1016
  const resolved = pick.version ? resolveComponent(P, ROOT, lock, name, pick.version) : null;
1001
1017
  const lib = resolved ? P.join(resolved, 'index.js') : null;
@@ -1014,7 +1030,7 @@ export function build(env0, srcPath, opts = {}) {
1014
1030
  }
1015
1031
  if (env.exists(local)) {
1016
1032
  if (env.within(local, deckDir)) file = local;
1017
- else { warn.push(`refused: パーツ ${tag} の components/${name}/index.js が作業フォルダの外を指している(シンボリックリンクなど。読まない)`); continue; }
1033
+ else { warn.push(`refused: パーツ ${tag} の ${localRel} が作業フォルダの外を指している(シンボリックリンクなど。読まない)`); continue; }
1018
1034
  } else if (lib && env.exists(lib)) {
1019
1035
  if (pick.note) warn.push(pick.note);
1020
1036
  const y = yankedInfo(lock, pick.version);
@@ -1027,7 +1043,7 @@ export function build(env0, srcPath, opts = {}) {
1027
1043
  if (env.within(lib, compRoot)) { file = lib; componentVersions[name] = pick.version; }
1028
1044
  else { warn.push(`refused: パーツライブラリのパーツ ${tag} が vendor/components/ の外を指している(読まない)`); continue; }
1029
1045
  }
1030
- if (!file) { warn.push(`component not found: ${tag}`); continue; }
1046
+ if (!file) { warn.push(`component not found: ${tag} (a lesson's own part goes in components/${name}/index.js or components/${tag}/index.js in the work folder)`); continue; }
1031
1047
  // 注釈の場所は、原稿のフォルダの部品ならそこから、部品庫ならリポジトリから(端末ごとのパスを出力に書かない)
1032
1048
  const where = env.within(file, deckDir) ? P.relative(deckDir, file)
1033
1049
  : componentVersions[name] ? `vendor/components/${name}/${componentVersions[name]}/index.js` : P.relative(ROOT, file);
@@ -1264,9 +1280,9 @@ export function defaultOut(P, srcPath) {
1264
1280
  function buildParts2(env, { P, ROOT, deckDir, html, used, lock2, catalogue, pins, warn, macros, lessonSources }) {
1265
1281
  const local = {}, legacy = [], localFiles = [], refused = new Set();
1266
1282
  for (const tag of used) {
1267
- const lf = P.join(deckDir, 'components', tag.slice(2), 'index.js');
1283
+ const lf = localPartFile(env, P, deckDir, tag);
1268
1284
  if (!env.exists(lf)) continue;
1269
- if (!env.within(lf, deckDir)) { warn.push(`refused: パーツ ${tag} の components/${tag.slice(2)}/index.js が作業フォルダの外を指している(シンボリックリンクなど。読まない)`); refused.add(tag); continue; }
1285
+ if (!env.within(lf, deckDir)) { warn.push(`refused: パーツ ${tag} の ${P.relative(deckDir, lf).split(P.sep).join('/')} が作業フォルダの外を指している(シンボリックリンクなど。読まない)`); refused.add(tag); continue; }
1270
1286
  const code = env.readText(lf), rd = readDefineMeta(code), where = P.relative(deckDir, lf).split(P.sep).join('/');
1271
1287
  if (!rd) { legacy.push(tag); continue; } // egatariParts.define がない:1.x の部品(DECK.define)
1272
1288
  // meta は字のまま読めなければ書かない(§6.1:組み立ては動かさずに name・version・requires・element を読み、索引に記録する)
@@ -11,6 +11,7 @@
11
11
  export const IN_EDITOR = Object.freeze([
12
12
  // 原稿の文字列から(kit/core/check-source.mjs)
13
13
  'slideId', 'legacyDataKey', 'legacyIndex', 'legacyColorClass', 'legacyStepAttr', 'legacyLectureMode', 'colorOutside', 'narrHeadingDiffers',
14
+ 'kickerLong', 'kickerPlace', 'kickerSlide',
14
15
  'narrNote', 'narrFormula', 'turnLong', 'narrLang', 'predictAnswerWithCount', 'predictAnswerNeverShown',
15
16
  // app/main.js・app/llm.js(作業場所の原稿と台本から)
16
17
  'refVoice', 'audioStale', 'narrPlaceholder', 'templateText', 'readingExpr', 'readingSeveral', 'readingGap',
@@ -30,7 +31,6 @@ export const CLI_ONLY = Object.freeze({
30
31
  balance: 'needs screenshots: it rasterizes the slide body to find the centre of mass (kit/fill-scan.mjs)',
31
32
  compOrder: 'needs screenshots: reopens the deck and compares renders of every component step in two orders (slow)',
32
33
  compOrderDetail: 'detail line of compOrder (screenshots)',
33
- compOrderNoise: 'detail line of compOrder (screenshots)',
34
34
  step0: 'info listing of what each slide shows at step 0, for reviewers; not a problem to fix',
35
35
  palette: 'info listing of the colour roles; the contrast findings themselves run in the editor (contrast)',
36
36
  marks: 'info listing of the marks per step; markMissing runs in the editor',
@@ -43,7 +43,7 @@ export const RULES = Object.freeze([
43
43
  { id: 'R-fit', kind: 'authoring', phase: 'A 体裁', codes: ['bodyBottom', 'bodyRight', 'tateBodyHead', 'bodyConclCol', 'bodyLeft', 'smallText', 'smallSvgText', 'textClipped', 'svgTextOut', 'svgTextBox', 'outsideBody', 'textOffSlide', 'textOverlap', 'cellWordBreak', 'compLayout'] },
44
44
  { id: 'R-title', kind: 'authoring', phase: 'A 体裁', codes: ['titleLong', 'titleLongEn', 'titleColon', 'tateTitle'] },
45
45
  { id: 'R-concl', kind: 'authoring', phase: 'A 体裁', codes: ['conclLong', 'conclLongEn', 'conclOverflow'] },
46
- { id: 'R-headings', kind: 'authoring', phase: 'A 体裁', codes: ['secHeading', 'narrHeadingDiffers'] },
46
+ { id: 'R-headings', kind: 'authoring', phase: 'A 体裁', codes: ['secHeading', 'narrHeadingDiffers', 'kickerLong', 'kickerPlace', 'kickerSlide'] },
47
47
  { id: 'R-style', kind: 'authoring', phase: 'A 体裁', codes: ['desuMasu', 'punctMixed'], applies: (f) => (f.lang === 'ja' ? null : 'lang') },
48
48
  { id: 'R-math', kind: 'authoring', phase: 'A 体裁', codes: ['rawMath', 'katexError'] },
49
49
  { id: 'R-purpose', kind: 'authoring', phase: 'A 体裁', codes: ['cardsHint'] },
@@ -73,7 +73,7 @@ export const RULES = Object.freeze([
73
73
  { id: 'C-book', kind: 'checker', phase: 'M 本文', codes: ARTICLE, applies: needs('book', 'noBook') },
74
74
  { id: 'C-a11y', kind: 'checker', phase: 'H 読み上げ', codes: ['imgAlt', 'svgName', 'compName'] },
75
75
  { id: 'C-morph', kind: 'checker', phase: 'G モーフ', codes: ['morphNoSrc', 'morphNoIds', 'morphPairs', 'morphLater', 'morphDupSrc', 'morphDupDst'], applies: needs('morphs', 'noMorphs') },
76
- { id: 'C-repro', kind: 'checker', phase: 'D 再現性', codes: ['compOrder', 'compOrderNoise', 'compOrderDetail'], applies: (f) => ((f.parts || []).length ? null : 'noParts') },
76
+ { id: 'C-repro', kind: 'checker', phase: 'D 再現性', codes: ['compOrder', 'compOrderDetail'], applies: (f) => ((f.parts || []).length ? null : 'noParts') },
77
77
  { id: 'C-listing', kind: 'checker', phase: 'E タイムライン', codes: ['step0', 'palette', 'marks', 'timelineTotal', 'slideLength'] },
78
78
  ].map((r) => Object.freeze({ ...r, codes: Object.freeze(r.codes) })));
79
79
 
@@ -4,11 +4,13 @@
4
4
  // I:id の書式・重なり(slideId)、旧来の鍵(legacyDataKey・legacyIndex)、1.0 の語彙にない書き方(legacyColorClass・legacyStepAttr・legacyLectureMode)、
5
5
  // 予想(m-predict)の答えが数の棒と同時(predictAnswerWithCount)・steps が小さく答えが出ない(predictAnswerNeverShown)、
6
6
  // テーマの色の語彙の外の色(colorOutside、情報)、{#id} の見出しとスライドの見出しの違い(narrHeadingDiffers、情報)
7
+ // 肩見出しの長さ・置き場所・スライドの種類(kickerLong・kickerPlace・kickerSlide)
7
8
  // B:{note:} の書き損じ(narrNote)、式らしい台本(narrFormula)、長すぎる 1 ターン(turnLong、情報)、台本の言語がスライドと違う(narrLang、情報)
8
9
  // コマンド版は台本の段階を実行系(DECK.NARRATION)から取る。ここは narration.md から取り、どのスライドにも合わない節は見ない(それは組み立ての知らせ)
9
10
  import { analyzeSlideIds, isJapanese } from './build-core.mjs';
10
11
  import { legacyVocabulary } from './legacy-vocab.mjs';
11
12
  import { colorsOutsideVocabulary } from './color-vocab.mjs';
13
+ import { kickerFindings } from './kicker.mjs';
12
14
  import { predictStepProblems } from './predict-steps.mjs';
13
15
  import { parseNarration, normalizeKey, noteProblems } from './narration-parse.mjs';
14
16
  import { narrationLang, textLang, formulaLike, formulaText } from './narration-lint.mjs';
@@ -17,6 +19,7 @@ export function sourceFindings({ deck, narration = '', voiceLang } = {}) {
17
19
  const out = [];
18
20
  const add = (i, sev, code, a, step = null) => out.push({ i, sev, code, a, step });
19
21
  if (typeof deck !== 'string' || !deck) return out;
22
+ for (const f of kickerFindings(deck)) add(f.i, f.sev, f.code, f.a);
20
23
  const ids = analyzeSlideIds(deck);
21
24
  for (const p of ids.problems) add(p.slide, p.sev, 'slideId', { msg: p.msg });
22
25
  for (const s of ids.slides) {
@@ -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.11', // バッジの URL は版のタグに固定する(リリースの手順で替える。RELEASING.md)
48
+ ref: 'v0.6.12', // バッジの 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,42 @@
1
+ // 肩見出し(kicker、見出しの上の短い言葉。format spec §8.0)の品質チェック。原稿の文字列だけで決まり、コマンド版と編集アプリが同じ関数を使う
2
+ import { parse } from 'parse5';
3
+
4
+ const hasClass = (n, c) => (n.attrs || []).some((a) => a.name === 'class' && a.value.split(/\s+/).includes(c));
5
+ // 字数は layout-scan.mjs と同じ全角 1・半角 0.5。ラテン文字の肩見出しは教材の言語によらず 40 文字まで
6
+ const units = (t) => [...t].reduce((n, ch) => n + (/[\u0000-ÿ]/.test(ch) ? 0.5 : 1), 0);
7
+ const textOf = (n) => n.nodeName === '#text' ? n.value : ['script', 'style', 'rt'].includes(n.tagName) ? '' : (n.childNodes || []).map(textOf).join('');
8
+
9
+ export function kickerFindings(src) {
10
+ const out = [];
11
+ let index = 0;
12
+ const walk = (n) => {
13
+ if (n.tagName === 'section' && hasClass(n, 'slide')) {
14
+ const i = index++, nodes = [];
15
+ const collect = (x) => {
16
+ for (const c of x.childNodes || []) {
17
+ if (c.tagName === 'section' && hasClass(c, 'slide')) continue;
18
+ if (c.tagName) nodes.push(c);
19
+ collect(c);
20
+ }
21
+ };
22
+ collect(n);
23
+ const heading = nodes.find((x) => x.tagName === 'h2' || x.tagName === 'h1'), kickers = nodes.filter((x) => hasClass(x, 'kicker'));
24
+ const add = (sev, code, a = {}) => out.push({ i, sev, code, a });
25
+ if (kickers.length) {
26
+ const next = (e) => { const siblings = e.parentNode.childNodes.filter((x) => x.tagName); return siblings[siblings.indexOf(e) + 1]; };
27
+ if (!heading || kickers.length > 1 || kickers.some((e) => next(e) !== heading)) add('warn', 'kickerPlace');
28
+ if (['cover', 'sec', 'layout-tate'].some((c) => hasClass(n, c))) add('info', 'kickerSlide');
29
+ for (const e of kickers) {
30
+ const t = textOf(e).replace(/\s+/g, ' ').trim();
31
+ const latin = /^[\p{Script=Latin}\p{Script=Common}\p{Script=Inherited}]*$/u.test(t);
32
+ const n = latin ? [...t].length : units(t), max = latin ? 40 : 24;
33
+ if (n > max) add('warn', 'kickerLong', { n, max, latin, t });
34
+ }
35
+ }
36
+ }
37
+ for (const c of n.childNodes || []) walk(c);
38
+ if (n.content) walk(n.content);
39
+ };
40
+ walk(parse(String(src)));
41
+ return out;
42
+ }
@@ -149,7 +149,7 @@ export function layoutScan(s, o) {
149
149
  const noconcl = s.classList.contains('noconcl');
150
150
  const lim = tate ? M.tate.floor : noconcl ? M.body.floor : M.concl.top - 6;
151
151
  const limR = tate ? M.tate.rule - 4 : 1280 - M.body.right + 4, limL = tate ? (c ? M.tate.conclRight + 4 : M.tate.left - 4) : -Infinity;
152
- let maxB = 0, maxR = 0, minL = Infinity;
152
+ let maxB = 0, maxR = 0, minL = Infinity, elB = null, elR = null, elL = null;
153
153
  body.querySelectorAll('*').forEach((el) => {
154
154
  if (el.closest('svg') && el.tagName !== 'svg') return;
155
155
  if (el.closest('.katex') && !el.classList.contains('katex')) return;
@@ -158,23 +158,35 @@ export function layoutScan(s, o) {
158
158
  // 祖先が切った後に見える部分だけ(読み上げ用の隠し方の中・切られて何も残らない箱は数えない。本文の箱より上の祖先は見ない)
159
159
  const { v } = seen(box(r), el, true, body);
160
160
  if (!v) return;
161
- maxB = Math.max(maxB, v.b);
162
- maxR = Math.max(maxR, v.r);
163
- minL = Math.min(minL, v.l);
161
+ if (v.b > maxB) { maxB = v.b; elB = el; }
162
+ if (v.r > maxR) { maxR = v.r; elR = el; }
163
+ if (v.l < minL) { minL = v.l; elL = el; }
164
164
  });
165
165
  // はみ出しの大きさは整数の px に丸めてから比べる(知らせと同じ丸め):丸めて 0 px(1 px に満たない)なら知らせない。知らせる px は限り ± 丸めた量なので、
166
166
  // 「0 px はみ出す」は出ない(結論の行の上の余裕と同じ考え。下・右・左・縦組みの見出しの列と結論の列で同じ決まり)
167
167
  const overB = Math.round(maxB - lim), overR = Math.round(maxR - limR), overL = Math.round(limL - minL);
168
+ // はみ出した箱がパーツ(m-*)かその中なら、知らせにパーツのタグと名前を入れる(compLayout と同じ形。backlog #196)
169
+ const partOf = (el) => {
170
+ for (let e = el; e && e !== body; e = e.parentElement) {
171
+ if (/^m-/.test(e.localName)) {
172
+ const same = [...s.querySelectorAll(e.localName)];
173
+ const label = (e.getAttribute('aria-label') || '').trim();
174
+ return { tag: e.localName, ...(same.length > 1 ? { index: same.indexOf(e) } : {}), ...(label ? { label: label.slice(0, 40) } : {}) };
175
+ }
176
+ }
177
+ return null;
178
+ };
179
+ const withPart = (a, el) => { const p = partOf(el); return p ? { ...a, part: p } : a; };
168
180
  // 知らせの値:結論の行の上端(conclTop)・1 行の高さ(line)・右の限り(bodyRight の lim)は、既定と違うときだけ添える(既定のテーマの結果は前と同じ)
169
181
  if (overB >= 1) {
170
182
  bodyOver = true;
171
183
  const a = { px: lim + overB, lim, concl: !tate && !noconcl };
172
184
  if (a.concl && M.concl.top !== DM.concl.top) a.conclTop = M.concl.top;
173
185
  if (M.body.line !== DM.body.line) a.line = M.body.line;
174
- add('error', 'bodyBottom', a);
186
+ add('error', 'bodyBottom', withPart(a, elB));
175
187
  }
176
- if (overR >= 1) add('error', tate ? 'tateBodyHead' : 'bodyRight', tate ? { px: limR + overR, lim: limR } : limR !== 1280 - DM.body.right + 4 ? { px: limR + overR, lim: limR } : { px: limR + overR });
177
- if (overL >= 1) add('error', c ? 'bodyConclCol' : 'bodyLeft', { px: limL - overL, lim: limL });
188
+ if (overR >= 1) add('error', tate ? 'tateBodyHead' : 'bodyRight', withPart(tate ? { px: limR + overR, lim: limR } : limR !== 1280 - DM.body.right + 4 ? { px: limR + overR, lim: limR } : { px: limR + overR }, elR));
189
+ if (overL >= 1) add('error', c ? 'bodyConclCol' : 'bodyLeft', withPart({ px: limL - overL, lim: limL }, elL));
178
190
  // 文字の大きさ:本文 27px(20pt)以上,図・表 24px(18pt)以上。出典・ページ番号・図キャプションは除く
179
191
  if (!refRe.test(h2 ? h2.textContent : '')) {
180
192
  const tw = document.createTreeWalker(body, NodeFilter.SHOW_TEXT);