egatari 0.6.14 → 0.6.16

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 (270) hide show
  1. package/CHANGELOG.md +62 -1
  2. package/README.ja.md +65 -64
  3. package/README.md +40 -39
  4. package/bin/egatari.mjs +3 -3
  5. package/components.lock.json +507 -153
  6. package/components2.lock.json +1710 -33
  7. package/kit/check-messages.mjs +105 -71
  8. package/kit/check.mjs +17 -11
  9. package/kit/core/article-messages.mjs +15 -15
  10. package/kit/core/article-render.mjs +1 -1
  11. package/kit/core/article-text.mjs +3 -1
  12. package/kit/core/build-core.mjs +23 -1
  13. package/kit/core/check-parity.mjs +2 -2
  14. package/kit/core/check-rules.mjs +12 -7
  15. package/kit/core/colab-core.mjs +2 -2
  16. package/kit/core/comment-core.mjs +6 -0
  17. package/kit/core/export-name.mjs +2 -2
  18. package/kit/core/geometry-check.mjs +363 -25
  19. package/kit/core/layout-scan.mjs +75 -5
  20. package/kit/core/live-policy.mjs +2 -2
  21. package/kit/core/live.mjs +2 -2
  22. package/kit/core/llm-fix.mjs +24 -13
  23. package/kit/core/llm-insert.mjs +11 -11
  24. package/kit/core/llm-outline.mjs +7 -7
  25. package/kit/core/llm-pack-assemble.mjs +5 -2
  26. package/kit/core/llm-pack-data.mjs +225 -39
  27. package/kit/core/llm-pack.mjs +3 -3
  28. package/kit/core/new-deck.mjs +17 -3
  29. package/kit/core/part-labels.mjs +6 -0
  30. package/kit/core/parts2.mjs +5 -5
  31. package/kit/core/player.mjs +18 -0
  32. package/kit/core/portable.mjs +26 -8
  33. package/kit/core/purposes.mjs +2 -2
  34. package/kit/core/ref-voice.mjs +1 -1
  35. package/kit/core/scorm.mjs +1 -1
  36. package/kit/core/sound-preferences.mjs +1 -1
  37. package/kit/core/theme-derive.mjs +209 -0
  38. package/kit/core/themes-list.mjs +1 -1
  39. package/kit/core/themes-lock.mjs +1 -1
  40. package/kit/core/tier-a.mjs +20 -8
  41. package/kit/deck.js +7 -4
  42. package/kit/instruction-version.json +1 -1
  43. package/kit/live.js +20 -20
  44. package/kit/player.json +1 -1
  45. package/kit/player.lock.json +2 -2
  46. package/kit/presenter.js +5 -3
  47. package/kit/templates/new-deck.mjs +6 -6
  48. package/kit/tools.js +13 -6
  49. package/kit/track.js +1 -1
  50. package/package.json +4 -2
  51. package/server/dev.mjs +3 -2
  52. package/server/editor-ui.js +28 -20
  53. package/server/hints.js +22 -2
  54. package/tts/yomi.yaml +8 -0
  55. package/vendor/components/CATALOG.md +21 -14
  56. package/vendor/components/sha256/000cc8b85d22854d93587d53fe07585e0d9f0abee86d863c5ed1f6c53967912b/README.en.md +40 -0
  57. package/vendor/components/sha256/000cc8b85d22854d93587d53fe07585e0d9f0abee86d863c5ed1f6c53967912b/index.js +408 -0
  58. package/vendor/components/sha256/0396a1895978803ae342b7f598f187b17ead47800e8f8317a5cb041111349813/index.js +278 -0
  59. package/vendor/components/sha256/07b8bfd9240585ee76082632c6f9483017d46ad3c74e509e715c27294970606c/README.en.md +26 -0
  60. package/vendor/components/sha256/07b8bfd9240585ee76082632c6f9483017d46ad3c74e509e715c27294970606c/index.js +322 -0
  61. package/vendor/components/sha256/08778858e2fb42765077b50e08f848089b1d11ea394909a4f611557b94b3acf2/README.en.md +54 -0
  62. package/vendor/components/sha256/08778858e2fb42765077b50e08f848089b1d11ea394909a4f611557b94b3acf2/index.js +470 -0
  63. package/vendor/components/sha256/0a08eb254e59cb306adb32c940ffe54e88efa3c9b7ef05ee021c38995996e742/README.en.md +18 -0
  64. package/vendor/components/sha256/0a08eb254e59cb306adb32c940ffe54e88efa3c9b7ef05ee021c38995996e742/index.js +279 -0
  65. package/vendor/components/sha256/1001b3cfcd3fbc34370accbb37aa550c8cadbb54bf8e8155d417219de3797be9/README.en.md +31 -0
  66. package/vendor/components/sha256/1001b3cfcd3fbc34370accbb37aa550c8cadbb54bf8e8155d417219de3797be9/index.js +267 -0
  67. package/vendor/components/sha256/109c302247e0c62720872be35392a73bea72804b0ed421ef8ced3f030f72e537/README.en.md +53 -0
  68. package/vendor/components/sha256/109c302247e0c62720872be35392a73bea72804b0ed421ef8ced3f030f72e537/index.js +171 -0
  69. package/vendor/components/sha256/1117758820dc561f41cf9d1cc0bab8cf3173cde7771ac10a12b94c96007c0f55/index.js +268 -0
  70. package/vendor/components/sha256/137017ad452afe209bdff81bc02ffae99c6b60a1c4aed2383515974f65511ff2/index.js +205 -0
  71. package/vendor/components/sha256/1a1471ba5f68e54304825a64e736afeda421e3763cdcbcdab2e45509562a0291/index.js +607 -0
  72. package/vendor/components/sha256/1b15fcc12b2fa43821e6299e87aae31aa69dbbc5a0d1b80088a5d7c5f8b8f7f5/index.js +429 -0
  73. package/vendor/components/sha256/1cc1732d052e58f7913ee50c0fc834d896db6b00ba779164de11b442347863db/README.en.md +23 -0
  74. package/vendor/components/sha256/1cc1732d052e58f7913ee50c0fc834d896db6b00ba779164de11b442347863db/index.js +147 -0
  75. package/vendor/components/sha256/21c099461befc0d382ddfe982f2a6cd8eeb6dd731252164ac619525e4bacdf0d/index.js +242 -0
  76. package/vendor/components/sha256/2352e0e22460f4a3c46dca6cef27cd9c63f161a411f1cf56c75c585e9124503c/index.js +315 -0
  77. package/vendor/components/sha256/2564dd8096be4cb3ba43703dc76029c1ba3965b831e430597c754865df4b67f4/README.en.md +53 -0
  78. package/vendor/components/sha256/2564dd8096be4cb3ba43703dc76029c1ba3965b831e430597c754865df4b67f4/index.js +171 -0
  79. package/vendor/components/sha256/2bae0f89ba91574c6ffb654e246365acd9aaf16a7aae92d95e1bad045671fbd2/README.en.md +38 -0
  80. package/vendor/components/sha256/2bae0f89ba91574c6ffb654e246365acd9aaf16a7aae92d95e1bad045671fbd2/index.js +414 -0
  81. package/vendor/components/sha256/2c68c355d60fdc879728c39245b7cf964b193628b63e9ab87df09c6bc2bfa7d3/README.en.md +45 -0
  82. package/vendor/components/sha256/2c68c355d60fdc879728c39245b7cf964b193628b63e9ab87df09c6bc2bfa7d3/index.js +211 -0
  83. package/vendor/components/sha256/2f111b900898579b3ec1611c2110db336a46d9133171a0cbb125ee37bd1f24f8/index.js +592 -0
  84. package/vendor/components/sha256/2fd81df4107ecb28c0dcecfdb3fd8fb9a474b5a7e0aeb16d8c0c6b1275c3a178/README.en.md +45 -0
  85. package/vendor/components/sha256/2fd81df4107ecb28c0dcecfdb3fd8fb9a474b5a7e0aeb16d8c0c6b1275c3a178/index.js +211 -0
  86. package/vendor/components/sha256/337febae1374670413653c453feee7cec169892e130248617c6642a91678564e/README.en.md +20 -0
  87. package/vendor/components/sha256/337febae1374670413653c453feee7cec169892e130248617c6642a91678564e/index.js +310 -0
  88. package/vendor/components/sha256/38f6385118112c679b520909d677935176e0c7aa2183a877324eeb5108606eae/README.en.md +35 -0
  89. package/vendor/components/sha256/38f6385118112c679b520909d677935176e0c7aa2183a877324eeb5108606eae/index.js +179 -0
  90. package/vendor/components/sha256/3af0b84b1799fc64ec74d6da9cbd343eccd89e8a11c81bfb444562c911284442/index.js +342 -0
  91. package/vendor/components/sha256/3c69bf3b3c6b9f76048fbc0839b3aa9699723570086d3d44bac799230ed6de5b/index.js +121 -0
  92. package/vendor/components/sha256/3f2f66da34496213cf6140ae041122c31f13c77e5ee18ad11a3390fbc4a6ecca/README.en.md +37 -0
  93. package/vendor/components/sha256/3f2f66da34496213cf6140ae041122c31f13c77e5ee18ad11a3390fbc4a6ecca/index.js +501 -0
  94. package/vendor/components/sha256/41b82d13037c4597e560cf2b3adebea4495ebb4711a8bb82b1a84495839b8fc8/README.en.md +38 -0
  95. package/vendor/components/sha256/41b82d13037c4597e560cf2b3adebea4495ebb4711a8bb82b1a84495839b8fc8/index.js +414 -0
  96. package/vendor/components/sha256/4220949efd68ff86e73ee6a0920b9f5b53f445cfcd657db72ecb2b55da1cc019/README.en.md +30 -0
  97. package/vendor/components/sha256/4220949efd68ff86e73ee6a0920b9f5b53f445cfcd657db72ecb2b55da1cc019/index.js +305 -0
  98. package/vendor/components/sha256/47f7ea3e2551abb250a9f5883716791026f0f54ae9cca6d82fabdb92478c69ae/README.en.md +31 -0
  99. package/vendor/components/sha256/47f7ea3e2551abb250a9f5883716791026f0f54ae9cca6d82fabdb92478c69ae/index.js +236 -0
  100. package/vendor/components/sha256/4b515bfb3a39a6c1e2b04f235affc5bc84e74d80bfd7f9e6d9b5d84d0a9eeb57/README.en.md +21 -0
  101. package/vendor/components/sha256/4b515bfb3a39a6c1e2b04f235affc5bc84e74d80bfd7f9e6d9b5d84d0a9eeb57/index.js +108 -0
  102. package/vendor/components/sha256/4e7ba7759ddebfa5432b733e5f10abfd336ef7d6cc4d46305d5ff7d00ed3a423/README.en.md +28 -0
  103. package/vendor/components/sha256/4e7ba7759ddebfa5432b733e5f10abfd336ef7d6cc4d46305d5ff7d00ed3a423/index.js +213 -0
  104. package/vendor/components/sha256/52149f061935e65502b8353cf70285bba93ab24451d2daac26b994d3901d3864/README.en.md +35 -0
  105. package/vendor/components/sha256/52149f061935e65502b8353cf70285bba93ab24451d2daac26b994d3901d3864/index.js +179 -0
  106. package/vendor/components/sha256/5644e63364f46ee53d5f8623355149753147cdc4720e4c66fc9b8a32627e68a5/README.en.md +53 -0
  107. package/vendor/components/sha256/5644e63364f46ee53d5f8623355149753147cdc4720e4c66fc9b8a32627e68a5/index.js +171 -0
  108. package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/ABCJS-ADAPTER.md +101 -0
  109. package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/LICENSE-abcjs.txt +21 -0
  110. package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/chords.json +89 -0
  111. package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/doremi.json +261 -0
  112. package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/extras.json +192 -0
  113. package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/kaeru.json +521 -0
  114. package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/rhythm.json +248 -0
  115. package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/ties.json +360 -0
  116. package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/index.js +508 -0
  117. package/vendor/components/sha256/59996a56df462b36e24a928d4397c9308d9e39ad8224ebd19fb5c981608ef458/index.js +521 -0
  118. package/vendor/components/sha256/5afcaf27e9209a32a8a8e6667b637ea434326b76f563689552716de953c94a98/README.en.md +30 -0
  119. package/vendor/components/sha256/5afcaf27e9209a32a8a8e6667b637ea434326b76f563689552716de953c94a98/index.js +305 -0
  120. package/vendor/components/sha256/5cf9baec12bac716d9218d6fbc4f95446adf31658da62564aa403bb5bdee542e/README.en.md +30 -0
  121. package/vendor/components/sha256/5cf9baec12bac716d9218d6fbc4f95446adf31658da62564aa403bb5bdee542e/index.js +192 -0
  122. package/vendor/components/sha256/5ffac218340cc51ce842a530f6021fc916090376b243e2ad5d4c0ef48a040ce9/README.en.md +20 -0
  123. package/vendor/components/sha256/5ffac218340cc51ce842a530f6021fc916090376b243e2ad5d4c0ef48a040ce9/index.js +307 -0
  124. package/vendor/components/sha256/6084fd3102b7d450db3804120ac27aa585ab44937734d980fb50c51f39fc98a7/README.en.md +24 -0
  125. package/vendor/components/sha256/6084fd3102b7d450db3804120ac27aa585ab44937734d980fb50c51f39fc98a7/index.js +554 -0
  126. package/vendor/components/sha256/60e3e41c34034e16f9f7ee9ce6c8d669ebb753614989fc2e5e181ef295e83631/README.en.md +25 -0
  127. package/vendor/components/sha256/60e3e41c34034e16f9f7ee9ce6c8d669ebb753614989fc2e5e181ef295e83631/index.js +316 -0
  128. package/vendor/components/sha256/6156a8a03235e1ed92d3cd3ba1f40df86667059003d82e47297bd3917ef562b8/README.en.md +18 -0
  129. package/vendor/components/sha256/6156a8a03235e1ed92d3cd3ba1f40df86667059003d82e47297bd3917ef562b8/index.js +279 -0
  130. package/vendor/components/sha256/624acb997c4975ace65570b529b3ba00baa421c80ecb7fc80f392a64e8c573a7/index.js +107 -0
  131. package/vendor/components/sha256/62602488ee33dd4bdef8516de16da5ab27d7f7265d5041681beab80e08f1d482/index.js +97 -0
  132. package/vendor/components/sha256/67eaf344bddac79b74ed03fdcd70285c7b52b160e6c5ffbd6897848179aa5230/index.js +818 -0
  133. package/vendor/components/sha256/682c9c8871eccd19ff1264e0323a2e4c5798b0488b612ba0339c6fe85aab5914/index.js +926 -0
  134. package/vendor/components/sha256/6937967bbf62098aca7cef99f14f97fa11c861a12da6a1d8fe5fa55a6b4551f2/README.en.md +51 -0
  135. package/vendor/components/sha256/6937967bbf62098aca7cef99f14f97fa11c861a12da6a1d8fe5fa55a6b4551f2/index.js +230 -0
  136. package/vendor/components/sha256/72138936ed0b8fd3cb0214ae7ed250ae3f1f8b21ed6fd593544947774064ba0d/index.js +250 -0
  137. package/vendor/components/sha256/74c1a0f3ed1370c5003aa5770ee28cea2ce994d415680116a92fdbcd5854ba62/index.js +198 -0
  138. package/vendor/components/sha256/76125035eb153b98befa9c735bcd9fc4f99f774dc1d082fdae40acaadfe7d95b/index.js +818 -0
  139. package/vendor/components/sha256/7728cf7dde88a6688aba0ed70f23f7e21362a147beac09c1fa1a4b773e08e93b/index.js +354 -0
  140. package/vendor/components/sha256/7822f137d446604a83c1dbc3b40fdb455001dc55da12276ff3e7079d270dd143/README.en.md +23 -0
  141. package/vendor/components/sha256/7822f137d446604a83c1dbc3b40fdb455001dc55da12276ff3e7079d270dd143/index.js +289 -0
  142. package/vendor/components/sha256/7c2b93508a09a5dd36639ab1329ca6d00487b326c53db436b14295174dc03369/README.en.md +31 -0
  143. package/vendor/components/sha256/7c2b93508a09a5dd36639ab1329ca6d00487b326c53db436b14295174dc03369/index.js +236 -0
  144. package/vendor/components/sha256/7d50e50fbb6c5ec636b62509bd88ddaac1870e0522cf11bcc293ce924d48072d/index.js +312 -0
  145. package/vendor/components/sha256/82ffee434e7f2213031190f832f3a75a8cdf59554fdbc092c0b079d6b0753cad/README.en.md +42 -0
  146. package/vendor/components/sha256/82ffee434e7f2213031190f832f3a75a8cdf59554fdbc092c0b079d6b0753cad/index.js +549 -0
  147. package/vendor/components/sha256/87fc302c41b2bfeea88951ed689ec01b4dc79218c4bc69b310dc2228dfa2e153/index.js +926 -0
  148. package/vendor/components/sha256/8886ccd82d68dc1bbf5b7ffcef746074ce8a3d26414d55691dc5e691e4976ded/README.en.md +24 -0
  149. package/vendor/components/sha256/8886ccd82d68dc1bbf5b7ffcef746074ce8a3d26414d55691dc5e691e4976ded/index.js +103 -0
  150. package/vendor/components/sha256/89c8c16788e24df17920542ed6eb6557dea4a10e835de8fe839e439ccbba8014/index.js +69 -0
  151. package/vendor/components/sha256/8beed7e471fa0d6b801b5c540f69ab77220e228c58ff16b0bc2b1a6eef30800e/README.en.md +44 -0
  152. package/vendor/components/sha256/8beed7e471fa0d6b801b5c540f69ab77220e228c58ff16b0bc2b1a6eef30800e/index.js +304 -0
  153. package/vendor/components/sha256/8d9af78aef44ad2f98101c67d32473373d39725a09c923969aa621d5f5b124bb/index.js +121 -0
  154. package/vendor/components/sha256/8f861d71df72a82be86a3e63abf7d69bbab5aac6fa68be6e077c4e19c3519ed8/index.js +312 -0
  155. package/vendor/components/sha256/90415da5ad04e1944258e29c929c5de65c8152c829414e911ba55a84ac89f348/README.en.md +54 -0
  156. package/vendor/components/sha256/90415da5ad04e1944258e29c929c5de65c8152c829414e911ba55a84ac89f348/index.js +470 -0
  157. package/vendor/components/sha256/91a1e0e48e20cac705cbe6e33e66a24a2851b1dc88c5164ed906bcecba4d943f/README.en.md +24 -0
  158. package/vendor/components/sha256/91a1e0e48e20cac705cbe6e33e66a24a2851b1dc88c5164ed906bcecba4d943f/index.js +214 -0
  159. package/vendor/components/sha256/91a9353a0c3b3744765944783aa1537b3f6ff1677c67caede643cdf2f52289cf/README.en.md +33 -0
  160. package/vendor/components/sha256/91a9353a0c3b3744765944783aa1537b3f6ff1677c67caede643cdf2f52289cf/index.js +390 -0
  161. package/vendor/components/sha256/9289efef4a75afe011e54a17e34db08cfb16a450b2e0653e6a98525495cfba99/index.js +315 -0
  162. package/vendor/components/sha256/93256a923199ea51108cdb7491c3c96f376dbef15b64cbf1a1aa7cc5726b4970/index.js +429 -0
  163. package/vendor/components/sha256/94f4891971b26f5bc157ef9f7f630b1528fc7e2a4c63e84e01951a5a3f94cedc/README.en.md +24 -0
  164. package/vendor/components/sha256/94f4891971b26f5bc157ef9f7f630b1528fc7e2a4c63e84e01951a5a3f94cedc/index.js +550 -0
  165. package/vendor/components/sha256/94f4f798fdd070fc1693494e772ff479d3e694a07a0c97b6e97c3b3895cad478/README.en.md +28 -0
  166. package/vendor/components/sha256/94f4f798fdd070fc1693494e772ff479d3e694a07a0c97b6e97c3b3895cad478/index.js +213 -0
  167. package/vendor/components/sha256/95583538da2982ec5f508217a8f2821796e6a34cf755baa66f2aaeb1c6dae814/README.en.md +40 -0
  168. package/vendor/components/sha256/95583538da2982ec5f508217a8f2821796e6a34cf755baa66f2aaeb1c6dae814/index.js +348 -0
  169. package/vendor/components/sha256/97c074a5473618c65f4c23263f056870a0b7940e73475f2a1f32f68c08d8eb0f/index.js +198 -0
  170. package/vendor/components/sha256/98e1957b1fac2d55d9bfa6a0990ead6a2730d571c988055ca280df05a0e9ea37/README.en.md +66 -0
  171. package/vendor/components/sha256/98e1957b1fac2d55d9bfa6a0990ead6a2730d571c988055ca280df05a0e9ea37/index.js +984 -0
  172. package/vendor/components/sha256/99a26795f8b351ade4a4cbbea845aeb149c96b09fe96151edda57128082185fa/README.en.md +34 -0
  173. package/vendor/components/sha256/99a26795f8b351ade4a4cbbea845aeb149c96b09fe96151edda57128082185fa/index.js +244 -0
  174. package/vendor/components/sha256/a18b2b15d00c76462a43823b5c270c7ddd7c31794da9c236f74f20f80ec2ffdb/index.js +354 -0
  175. package/vendor/components/sha256/a744049fc56e0a5d5b1638bef597a4e65f99d0776a35d830a389f216f314f1bc/README.en.md +32 -0
  176. package/vendor/components/sha256/a744049fc56e0a5d5b1638bef597a4e65f99d0776a35d830a389f216f314f1bc/index.js +222 -0
  177. package/vendor/components/sha256/a979207c60fbd2a12cb557297eb0217eb098d660de684530a0f43d0d9c64e6ef/index.js +312 -0
  178. package/vendor/components/sha256/aba898152e40ca44e1e7bea22242bd6897a31e0254cbfd70e426907b65379af2/README.en.md +34 -0
  179. package/vendor/components/sha256/aba898152e40ca44e1e7bea22242bd6897a31e0254cbfd70e426907b65379af2/index.js +244 -0
  180. package/vendor/components/sha256/af7ed69b8969f6da14784b6e9d26e4dfd20147772ea172a99bd936a71be10fcd/index.js +278 -0
  181. package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/ABCJS-ADAPTER.md +101 -0
  182. package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/LICENSE-abcjs.txt +21 -0
  183. package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/chords.json +89 -0
  184. package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/doremi.json +261 -0
  185. package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/extras.json +192 -0
  186. package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/kaeru.json +521 -0
  187. package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/rhythm.json +248 -0
  188. package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/ties.json +360 -0
  189. package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/index.js +508 -0
  190. package/vendor/components/sha256/b28d136dffb03a3e855b2ff959712a143da9a84c3a4fd13a1126d7711083a2d6/README.en.md +66 -0
  191. package/vendor/components/sha256/b28d136dffb03a3e855b2ff959712a143da9a84c3a4fd13a1126d7711083a2d6/index.js +990 -0
  192. package/vendor/components/sha256/b2d9c417f258745c56c04e05dc9463a412a4978d46c3ffff2556f0b0fafbbfc2/README.en.md +24 -0
  193. package/vendor/components/sha256/b2d9c417f258745c56c04e05dc9463a412a4978d46c3ffff2556f0b0fafbbfc2/index.js +550 -0
  194. package/vendor/components/sha256/b8096d7a60609520981273673761a110e40e3bdf52a7ab5548363b20e16f6e93/index.js +404 -0
  195. package/vendor/components/sha256/b9e27e84b2c534b87d6da5da30ee808d7863cbd1b818082b4c11d1f8b7129b1a/README.en.md +32 -0
  196. package/vendor/components/sha256/b9e27e84b2c534b87d6da5da30ee808d7863cbd1b818082b4c11d1f8b7129b1a/index.js +222 -0
  197. package/vendor/components/sha256/bd8e3893df02411deccc1d6d7b02292ca0d59dfeddfafcf99419430981572c82/index.js +351 -0
  198. package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/ABCJS-ADAPTER.md +101 -0
  199. package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/LICENSE-abcjs.txt +21 -0
  200. package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/chords.json +89 -0
  201. package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/doremi.json +261 -0
  202. package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/extras.json +192 -0
  203. package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/kaeru.json +521 -0
  204. package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/rhythm.json +248 -0
  205. package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/ties.json +360 -0
  206. package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/index.js +508 -0
  207. package/vendor/components/sha256/c5226220649a5854d56ceeaea16722fe54a79b4197f71c51c4e1523bf22bec32/README.en.md +31 -0
  208. package/vendor/components/sha256/c5226220649a5854d56ceeaea16722fe54a79b4197f71c51c4e1523bf22bec32/index.js +267 -0
  209. package/vendor/components/sha256/c691f9c83d06502bf20f86df02ee5a516063d6af1e9ee8204aad8fd8c1a44a71/LICENSE-strokesvg.txt +115 -0
  210. package/vendor/components/sha256/c691f9c83d06502bf20f86df02ee5a516063d6af1e9ee8204aad8fd8c1a44a71/OFL.txt +93 -0
  211. package/vendor/components/sha256/c691f9c83d06502bf20f86df02ee5a516063d6af1e9ee8204aad8fd8c1a44a71/index.js +749 -0
  212. package/vendor/components/sha256/c691f9c83d06502bf20f86df02ee5a516063d6af1e9ee8204aad8fd8c1a44a71/strokes-CHANGES.md +20 -0
  213. package/vendor/components/sha256/c791e69e722f64146242f97acb29a341160d0c327cfe1d76307954d80e70db85/index.js +268 -0
  214. package/vendor/components/sha256/c8c0de41d603b61c6ec4dc1da5b50559e213dd1f3693ee5019df858016fd6daf/index.js +747 -0
  215. package/vendor/components/sha256/c99d4f2ab443484b9f462e405c72ea4794838b88f8823f27c606d12cbbedb996/index.js +404 -0
  216. package/vendor/components/sha256/cbde046e30c35db60259911a88e2ae0bedaf545e29b1da8b8ce13bc602a33c19/index.js +465 -0
  217. package/vendor/components/sha256/ccdd16ed76838ac9d6abb4ee695769bfecb802ae490ac91914ed68131ad04434/README.en.md +51 -0
  218. package/vendor/components/sha256/ccdd16ed76838ac9d6abb4ee695769bfecb802ae490ac91914ed68131ad04434/index.js +228 -0
  219. package/vendor/components/sha256/ce0a52fa13ae579020d1172845647daee9ba78e070736e47740f2d2feabffe7e/README.en.md +35 -0
  220. package/vendor/components/sha256/ce0a52fa13ae579020d1172845647daee9ba78e070736e47740f2d2feabffe7e/index.js +179 -0
  221. package/vendor/components/sha256/cf0985ffcd8e7cbe2175ddb9a4342b2a4aa3f322794188fc99af8789b494460d/index.js +521 -0
  222. package/vendor/components/sha256/cff7ed8a0e0708bcef2e13105b28810bda867251a9f205ad9c2f1a5b4f759866/LICENSE-strokesvg.txt +115 -0
  223. package/vendor/components/sha256/cff7ed8a0e0708bcef2e13105b28810bda867251a9f205ad9c2f1a5b4f759866/OFL.txt +93 -0
  224. package/vendor/components/sha256/cff7ed8a0e0708bcef2e13105b28810bda867251a9f205ad9c2f1a5b4f759866/index.js +749 -0
  225. package/vendor/components/sha256/cff7ed8a0e0708bcef2e13105b28810bda867251a9f205ad9c2f1a5b4f759866/strokes-CHANGES.md +20 -0
  226. package/vendor/components/sha256/d01dc7fd78d08dd720ed86b39d7877dc0913d72e914036088a86af2df2faee52/index.js +484 -0
  227. package/vendor/components/sha256/d448fec2aeb436f187875c493b1592b373c6a18274ffc64231dbe3f1b54f8cbc/README.en.md +24 -0
  228. package/vendor/components/sha256/d448fec2aeb436f187875c493b1592b373c6a18274ffc64231dbe3f1b54f8cbc/index.js +214 -0
  229. package/vendor/components/sha256/d4aa3ffb394d5db7f47081b1818958547fe164bb968df03131f9400c103b97c4/README.en.md +31 -0
  230. package/vendor/components/sha256/d4aa3ffb394d5db7f47081b1818958547fe164bb968df03131f9400c103b97c4/index.js +271 -0
  231. package/vendor/components/sha256/d582d02ceeaf1ec4d94115b806852ddb66c009788e67728ae0e08cb8d29ca546/README.en.md +25 -0
  232. package/vendor/components/sha256/d582d02ceeaf1ec4d94115b806852ddb66c009788e67728ae0e08cb8d29ca546/index.js +316 -0
  233. package/vendor/components/sha256/d75ab2c8f6c01082bfcaeaba44290367d6b49654e2bf538422b7b3e499de9acf/README.en.md +23 -0
  234. package/vendor/components/sha256/d75ab2c8f6c01082bfcaeaba44290367d6b49654e2bf538422b7b3e499de9acf/index.js +120 -0
  235. package/vendor/components/sha256/d8f5272dac33066a04ecefa9a828ca11d18dec581866899f55433573ba4472d6/README.en.md +40 -0
  236. package/vendor/components/sha256/d8f5272dac33066a04ecefa9a828ca11d18dec581866899f55433573ba4472d6/index.js +405 -0
  237. package/vendor/components/sha256/dd1ff8de877573e30635928e9abce0b1fba8dfc95a079eca86703a884d3c3d59/README.en.md +66 -0
  238. package/vendor/components/sha256/dd1ff8de877573e30635928e9abce0b1fba8dfc95a079eca86703a884d3c3d59/index.js +984 -0
  239. package/vendor/components/sha256/ddd4b9cbbc282cbb3117ff662e1a14ecdb3cc7c16072a574418ec6a6eecef4d8/index.js +107 -0
  240. package/vendor/components/sha256/e24a4235a661bfda4049e1c72b6c376066fcc65e27a2bdfe77942a3394726c81/README.en.md +22 -0
  241. package/vendor/components/sha256/e24a4235a661bfda4049e1c72b6c376066fcc65e27a2bdfe77942a3394726c81/index.js +145 -0
  242. package/vendor/components/sha256/e2da948daac7bfac158857877b5a6932dbd2369e73901abcef118c92dd20b725/index.js +747 -0
  243. package/vendor/components/sha256/e40201a655bf5c556d70fbf45b5052dd48c33fc8030b331a9d9cbc96913d02a6/README.en.md +42 -0
  244. package/vendor/components/sha256/e40201a655bf5c556d70fbf45b5052dd48c33fc8030b331a9d9cbc96913d02a6/index.js +268 -0
  245. package/vendor/components/sha256/e653a4da80f7761442dc5b504ea5b0700fd0acf1979beeff56122cfdb3d4654c/index.js +607 -0
  246. package/vendor/components/sha256/ea217c6821e931b2d8474bf56d38f2dcc89ec705fe1d276f313e1c7e8db2b98a/index.js +233 -0
  247. package/vendor/components/sha256/ea2e4e24838574f607879c7d05556281258c018331e4da3e6f3a5263173f2e99/index.js +75 -0
  248. package/vendor/components/sha256/eb0b402dc4738b2dca2918c7f64a4d6fc3c27b4ba419270bbe8240a3c8a77f0c/README.en.md +42 -0
  249. package/vendor/components/sha256/eb0b402dc4738b2dca2918c7f64a4d6fc3c27b4ba419270bbe8240a3c8a77f0c/index.js +549 -0
  250. package/vendor/components/sha256/f219b47f32b0a78e8f8f5dac83596acfed24dd6e8bfe3f05f8ebfb9582d64485/README.en.md +44 -0
  251. package/vendor/components/sha256/f219b47f32b0a78e8f8f5dac83596acfed24dd6e8bfe3f05f8ebfb9582d64485/index.js +203 -0
  252. package/vendor/components/sha256/f4204773037ae296786e3614b5bfd7487b0f5ba6d5cf92ce20262bb7613e1b6b/README.en.md +34 -0
  253. package/vendor/components/sha256/f4204773037ae296786e3614b5bfd7487b0f5ba6d5cf92ce20262bb7613e1b6b/index.js +244 -0
  254. package/vendor/components/sha256/fa1a09c10181456143d125d68dbbdcacde6bab2e4a2b3e573367103ce28ebf55/index.js +228 -0
  255. package/vendor/components/sha256/fa9c9f63d74a514636961bcb8af75063e00e39bdf85655ecf5d4d7bbc05a831a/README.en.md +51 -0
  256. package/vendor/components/sha256/fa9c9f63d74a514636961bcb8af75063e00e39bdf85655ecf5d4d7bbc05a831a/index.js +228 -0
  257. package/vendor/components/sha256/facebe095849528396ee91d7d6856cb6945ba89ca8b1f34dce488dccb29e9d40/README.en.md +23 -0
  258. package/vendor/components/sha256/facebe095849528396ee91d7d6856cb6945ba89ca8b1f34dce488dccb29e9d40/index.js +147 -0
  259. package/vendor/components/sha256/fb0a77a344098c53cc90215685cee32b0d31362a1de5b5ac0eee422ed2c3c430/README.en.md +20 -0
  260. package/vendor/components/sha256/fb0a77a344098c53cc90215685cee32b0d31362a1de5b5ac0eee422ed2c3c430/index.js +307 -0
  261. package/vendor/components/sha256/fc48e703adab4715157f8dbb0e33c8b5c00099358ae522484290a7098fda2910/README.en.md +26 -0
  262. package/vendor/components/sha256/fc48e703adab4715157f8dbb0e33c8b5c00099358ae522484290a7098fda2910/index.js +322 -0
  263. package/vendor/components-2/manifest-2.12.0.json +2348 -0
  264. package/vendor/components-2/manifest-2.13.0.json +2477 -0
  265. package/vendor/components-2/manifest-2.14.0.json +2460 -0
  266. package/vendor/components-2/manifest-2.14.1.json +2460 -0
  267. package/vendor/components-2/manifest-2.15.0.json +2460 -0
  268. package/vendor/egatari-spec/SOURCE.json +3 -3
  269. package/vendor/egatari-spec/schema/deck-meta.schema.json +16 -1
  270. package/vendor/egatari-spec/schema/egatari-metadata.schema.json +17 -2
@@ -26,7 +26,7 @@
26
26
  // assemble(data, {sets, lang, plan}) buildPack の本体(材料を渡す。tools/make-llm-guide.mjs が作りたての材料で使う)
27
27
  // TIERS パーツの段と束(パーツライブラリ 2.0 の manifest から。{catalogue, parts: {タグ: {tier, set?, purposes}}, purposes}。
28
28
  // 新規作成 ④ のパーツの一覧:kit/core/new-deck.mjs)
29
- // loadedParts(sets) その束で組み立てに入る部品(標準と、選んだ束の部品)
29
+ // loadedParts(sets, plan) その束で組み立てに入る部品(標準と、選んだ束の部品。有料のプランでは paidOnly の部品も)
30
30
  // trimCandidates・fitPlan・fitPack 無料のプランの目安に収める(中核の 4 つを短く → 専門のパーツを外す候補に)。fitSample は「このサンプルを参考に作る」の収め方。編集アプリ(kit/core/new-deck.mjs が出し直す)と
31
31
  // コマンド(kit/llm-pack.mjs)が同じ関数を使う
32
32
  // partsPackOpts(tags, plan, {short, full}) 選んだパーツだけの指示の組み立ての引数 {sets, exclude, plan, short?, full?}(buildPack・packWithRequest に渡す。
@@ -40,9 +40,9 @@ export const SETS = PACK.sets;
40
40
  export const TIERS = PACK.tiers;
41
41
  export const normalizeSets = (sets) => norm(sets, PACK);
42
42
  // その束で組み立てに入る部品(標準と、選んだ束の部品。どちらのプランでも同じ。無料のプランの BRIEF も一覧に入る)
43
- export function loadedParts(sets = []) {
43
+ export function loadedParts(sets = [], plan = 'free') {
44
44
  const ss = norm(sets, PACK);
45
- return Object.keys(PACK.en.components).sort().filter((t) => { const s = PACK.en.components[t].set; return s === STANDARD || ss.includes(s); });
45
+ return Object.keys(PACK.en.components).sort().filter((t) => { const c = PACK.en.components[t]; return (c.set === STANDARD && (!c.paidOnly || plan === 'paid')) || ss.includes(c.set); });
46
46
  }
47
47
  export const partsPackOpts = (tags, plan = 'free', opts = {}) => packOptsOf(PACK, tags, plan, opts);
48
48
  // 目安に収める(本体は kit/core/llm-pack-assemble.mjs。材料はこの指示の PACK)
@@ -13,7 +13,9 @@
13
13
  // SUBJECT_SETS 教科の形の束(この順に並べる)
14
14
  // SUB_SETS 小分類 → おすすめの束(§2.3)
15
15
  // WORDS {ja|en: {束: [言葉]}}(§2.4。英語の画面では英語の表)
16
- // partsList(sub) → [{id, label: {ja, en}, parts: [タグ]}](④ の並び。id は伝えたいことの id か 'subject')
16
+ // partsList(sub, plan) → [{id, label: {ja, en}, parts: [タグ]}](④ の並び。id は伝えたいことの id か 'subject')。
17
+ // plan が 'free' なら、有料のプランの指示にだけ入るパーツ(paidOnly)を出さない(plan なしは全部)
18
+ // paidOnly(tag) → 有料のプランの指示にだけ入るパーツか(受け皿のない束のパーツ。tools/make-llm-guide.mjs の hasReceiver)
17
19
  // recommend({sub, text, lang}) → [{set, sub?, word?}](おすすめの束と理由。小分類が先、それから言葉。束ごとに 1 つ)
18
20
  // initialParts(rec) → 初めに選んでおくパーツ(標準の全部とおすすめの束のパーツ。一覧の順)
19
21
  // partsOfSet(set) → 束のパーツ(一覧に出るものだけ)
@@ -34,6 +36,7 @@
34
36
  // 見せ方(variant。format spec §8.4)は名前だけで選ぶ。教材のシード値(data-egatari-seed)はなくなった:書かない。前の原稿にあれば、そのまま残す(誰も読まない)
35
37
  import { updateConfig, merge, configObject } from './config-file.mjs';
36
38
  import { TIERS, PACK_CAP_KB } from './llm-pack.mjs';
39
+ import { PACK } from './llm-pack-data.mjs';
37
40
  import { partOrder } from './part-labels.mjs';
38
41
  import { componentsOff } from './purposes.mjs';
39
42
 
@@ -95,6 +98,8 @@ export const CATEGORIES = [
95
98
  export const SET_LABELS = [
96
99
  { set: 'stats', label: { ja: '統計の図', en: 'Statistics charts' }, inside: { ja: 'ヒストグラム・箱ひげ図・ヒートマップ', en: 'Histograms, box plots, heatmaps' } },
97
100
  { set: 'data', label: { ja: '情報・データサイエンス', en: 'Data science and code' }, inside: { ja: '標本抽出・信頼区間・交差検証・コードの解説', en: 'Sampling, confidence intervals, cross-validation, code walkthroughs' } },
101
+ { set: 'algo', label: { ja: 'アルゴリズム', en: 'Algorithms' }, inside: { ja: 'グラフの探索・最短経路・巡回セールスマン・グラフィカルモデル', en: 'Graph search, shortest paths, the traveling salesman, graphical models' } },
102
+ { set: 'ml', label: { ja: '機械学習', en: 'Machine learning' }, inside: { ja: 'ニューラルネット・2 次元の分類・等高線と勾配降下法', en: 'Neural networks, 2-D classification, contours and gradient descent' } },
98
103
  { set: 'math', label: { ja: '算数・数学', en: 'Arithmetic and mathematics' }, inside: { ja: '筆算・数直線・テープ図・関数', en: 'Column arithmetic, number lines, tape diagrams, functions' } },
99
104
  { set: 'maps', label: { ja: '地図', en: 'Maps' }, inside: { ja: '日本地図・世界地図', en: 'Maps of Japan and the world' } },
100
105
  { set: 'kokugo', label: { ja: '国語', en: 'Japanese language arts' }, inside: { ja: '漢文・古文・現代文・縦書き', en: 'Kanbun, kobun, modern texts, vertical writing' } },
@@ -129,6 +134,11 @@ export const WORDS = Object.freeze({
129
134
  music: ['音階', '和音', { w: 'コード', not: ['ソースコード', 'バーコード', 'QRコード', 'コーディング'] }, '鍵盤', '楽譜'],
130
135
  business: ['市場', 'KPI', '売上', '事業', 'ピッチ'],
131
136
  tools: ['タイマー', 'ワークショップ', '演習時間', 'グループワーク'],
137
+ // 束 algo(部品庫 2.10.0、d5 11/15):「グラフ」単独は棒グラフ・円グラフに当たるので入れない。小分類からは推さない(SUB_SETS にない)
138
+ // 部品庫 2.12 の m-network 2.1.0(グラフィカルモデル・パス図・HMM のトレリス)も束 algo。統計・機械学習の授業でも言葉ですすめる(d5 11/15)
139
+ algo: ['探索', '最短経路', '巡回セールスマン', 'グラフ理論', 'グラフの探索', 'アルゴリズム', '幅優先', 'ダイクストラ', 'グラフィカルモデル', 'パス図', '構造方程式', 'ベイジアンネットワーク', '隠れマルコフ', 'HMM', 'マルコフ連鎖', '因果ダイアグラム'],
140
+ // 束 ml(部品庫 2.12・2.13:m-nnet・m-classify2d・m-contour、backlog #219)。小分類からは推さない。「等高線」は地図にも当たるので入れない
141
+ ml: ['機械学習', 'ニューラルネット', 'パーセプトロン', '深層学習', 'ディープラーニング', '活性化関数', '勾配降下', 'ロジスティック回帰', 'サポートベクター', 'SVM', '決定木', 'k 平均', 'k平均', 'k-means', '近傍法', '損失関数', '分類器', 'scikit-learn'],
132
142
  },
133
143
  en: {
134
144
  stats: ['distribution', 'distributions', 'statistics', 'statistical', 'data', 'histogram', 'histograms', 'box plot', 'box plots', 'correlation', 'Bayes', 'Bayesian', 'estimation', 'hypothesis test', 'hypothesis testing'],
@@ -140,6 +150,8 @@ export const WORDS = Object.freeze({
140
150
  music: ['musical scale', 'major scale', 'minor scale', 'chord', 'chords', 'keyboard', 'piano', 'sheet music', 'musical score'],
141
151
  business: ['market', 'markets', 'KPI', 'KPIs', 'sales', 'revenue', 'business', 'pitch'],
142
152
  tools: ['timer', 'workshop', 'exercise time', 'group work'],
153
+ algo: ['graph search', 'graph theory', 'breadth-first search', 'BFS', 'shortest path', 'traveling salesman', 'TSP', 'algorithm', 'algorithms', 'Dijkstra', 'graphical model', 'path diagram', 'structural equation', 'Bayesian network', 'hidden Markov', 'HMM', 'Markov chain', 'causal diagram'],
154
+ ml: ['machine learning', 'neural network', 'neural networks', 'perceptron', 'deep learning', 'activation function', 'gradient descent', 'logistic regression', 'support vector', 'SVM', 'decision tree', 'decision trees', 'k-means', 'nearest neighbor', 'nearest neighbors', 'loss function', 'classifier', 'classifiers', 'scikit-learn'],
143
155
  },
144
156
  });
145
157
 
@@ -154,8 +166,10 @@ const groupOf = (t) => {
154
166
  return p && TIERS.purposes.some((x) => x.id === intoOf(p)) ? intoOf(p) : 'other';
155
167
  };
156
168
  const byTier = (a, b) => (PARTS[a].tier === 'standard' ? 0 : 1) - (PARTS[b].tier === 'standard' ? 0 : 1);
157
- export function partsList(sub) {
158
- const tags = partOrder(Object.keys(PARTS).filter(shown));
169
+ // 有料のプランの指示にだけ入るパーツ(材料の paidOnly)。無料のプランの ④ には出さない(印を付けても指示に入らないので)
170
+ export const paidOnly = (t) => !!(PACK.en.components[t] && PACK.en.components[t].paidOnly);
171
+ export function partsList(sub, plan) {
172
+ const tags = partOrder(Object.keys(PARTS).filter((t) => shown(t) && !(plan === 'free' && paidOnly(t))));
159
173
  const groups = TIERS.purposes.filter((p) => !p.into).map((p) => ({ id: p.id, label: p.label, parts: tags.filter((t) => groupOf(t) === p.id).sort(byTier) }));
160
174
  const other = { ...OTHER_GROUP, parts: tags.filter((t) => groupOf(t) === 'other').sort(byTier) };
161
175
  const subject = { ...SUBJECT_GROUP, parts: SUBJECT_SETS.flatMap((s) => tags.filter((t) => groupOf(t) === 'subject' && PARTS[t].set === s)) };
@@ -67,6 +67,12 @@ const LOCAL = {
67
67
  'm-checklist': { icon: 'checklist', desc: { ja: '確かめる項目に 1 つずつ ✓ を付ける', en: 'Items to check, ticked one at a time' } },
68
68
  'm-diverge': { icon: 'waterfall', desc: { ja: '基準から増減を積み上げ、合計まで見せる', en: 'Increases and decreases stacked from a baseline to the total' } },
69
69
  'm-code': { icon: 'syntax', desc: { ja: '短いコードを行ごとに説明し、出力を見せる', en: 'Explains short code line by line, then shows the output' } },
70
+ 'm-network': { icon: 'tree', desc: { ja: 'グラフの探索や最短経路を、頂点と辺の上で 1 ステップずつ', en: 'Graph search and shortest paths, one step at a time on nodes and edges' } },
71
+ 'm-nnet': { icon: 'flow', desc: { ja: 'ニューラルネットの順伝播を層ごとに計算して見せる', en: 'A neural network’s forward pass, computed layer by layer' } },
72
+ 'm-classify2d': { icon: 'scatter', desc: { ja: '2 次元の点と、分類の領域・境界をモデルの出力どおりに', en: 'Points in 2-D with a classifier’s regions and boundaries, as the model output them' } },
73
+ 'm-contour': { icon: 'heatmap', desc: { ja: '2 変数の関数の等高線と勾配、勾配降下法の道', en: 'Contours of a two-variable function, its gradient and a descent path' } },
74
+ 'm-ctable': { icon: 'compare', desc: { ja: '分散分析表・分割表を計算のステップごとに埋める', en: 'ANOVA and contingency tables, filled in step by step' } },
75
+ 'm-vector': { icon: 'matrix', desc: { ja: '平面のベクトルと 2 × 2 の行列の変換を 1 ステップずつ', en: 'Plane vectors and 2 × 2 matrix maps, one step at a time' } },
70
76
  };
71
77
  // 名前は manifest の display を先に。display だけあって表にない部品も名前を出す(絵は汎用)
72
78
  export const PART_LABELS = Object.freeze(Object.fromEntries([...Object.keys(LOCAL), ...Object.keys(MANIFEST_NAMES).filter((t) => !LOCAL[t])]
@@ -311,15 +311,15 @@ export function catalogueMessage(lang, a) {
311
311
  const key = `"componentsCatalogue": "${a.value}"`;
312
312
  switch (a.hint) {
313
313
  case 'select2': return a.catalogue === '1.x'
314
- ? (ja ? `<${a.tag}> は、この教材が使う${cat}にないパーツです(パーツライブラリ 2.x のパーツ)。egatari.json に ${key} と書いて、パーツライブラリ 2.x を選んでください`
315
- : `<${a.tag}> is not in ${cat}, which this lesson uses; it is a parts library 2.x part. Select parts library 2.x: set ${key} in egatari.json.`)
314
+ ? (ja ? `<${a.tag}> は、このファイルが使う${cat}にないパーツです(パーツライブラリ 2.x のパーツ)。egatari.json に ${key} と書いて、パーツライブラリ 2.x を選んでください`
315
+ : `<${a.tag}> is not in ${cat}, which this file uses; it is a parts library 2.x part. Select parts library 2.x: set ${key} in egatari.json.`)
316
316
  : (ja ? `<${a.tag}> は、egatari.json で選んだ${cat}にないパーツです。egatari.json に ${key} と書いてください`
317
317
  : `<${a.tag}> is not in ${cat}, which egatari.json selects. Set ${key} in egatari.json.`);
318
318
  case 'pin': return ja
319
- ? `<${a.tag}> は egatari.json の components で ${a.pin}(パーツライブラリ 2.x のバージョン)に固定されていますが、この教材は${cat}を使います。egatari.json に ${key} と書くか、"${a.part}" の固定を外してください`
320
- : `<${a.tag}> is pinned to ${a.pin} (a parts library 2.x version) under components in egatari.json, but this lesson uses ${cat}. Set ${key} in egatari.json, or remove the "${a.part}" pin.`;
319
+ ? `<${a.tag}> は egatari.json の components で ${a.pin}(パーツライブラリ 2.x のバージョン)に固定されていますが、このファイルは${cat}を使います。egatari.json に ${key} と書くか、"${a.part}" の固定を解除してください`
320
+ : `<${a.tag}> is pinned to ${a.pin} (a parts library 2.x version) under components in egatari.json, but this file uses ${cat}. Set ${key} in egatari.json, or remove the "${a.part}" pin.`;
321
321
  case 'select1': return ja
322
- ? `<${a.tag}> は、egatari.json で選んだ${cat}にないパーツです(パーツライブラリ 1.x のパーツ)。1.x を使うには egatari.json から "componentsCatalogue" を外してください`
322
+ ? `<${a.tag}> は、egatari.json で選んだ${cat}にないパーツです(パーツライブラリ 1.x のパーツ)。1.x を使うには egatari.json から "componentsCatalogue" を削除してください`
323
323
  : `<${a.tag}> is not in ${cat}, which egatari.json selects; it is a parts library 1.x part. Remove "componentsCatalogue" from egatari.json to use parts library 1.x.`;
324
324
  case 'library': return ja
325
325
  ? `<${a.tag}> は要素ではありません:${a.part} はほかのパーツが使うライブラリのパーツで、<${a.tag}> を定義しません。パーツの一覧にある要素を使うか、<${a.tag}> を外してください`
@@ -10,6 +10,10 @@
10
10
  // ファイルに書く版:中身が出した版と同じ(sha256 と版が lock と同じ)なら json.version、
11
11
  // 違えば json.version + "+dev." + commit(commit がなければ "+dev")
12
12
  // resolvePlayer(env) env(組み立ての env:path・ROOT・readText・exists、任意の commit)から {name, version, title, released, sha256}
13
+ // EDITS_SHOWN_SINCE 編集の記録(metadata.edits、format spec §3.6.1)を再生のときに表示する最初の再生器の版("1.9.0"。ここだけに書く)
14
+ // compareVersions(a, b) X.Y.Z(後ろの "+dev…" などの build の印は見ない)の大小:-1 | 0 | 1。読めなければ null
15
+ // playerShowsEdits(player) 索引の player {name, version} の再生器が edits を表示するか。Egatari Player の EDITS_SHOWN_SINCE 以上だけ true
16
+ // (ほかの再生器・player がない・版が読めないものは、表示するか分からないので false)
13
17
  import { RUNTIME_MODULES, RUNTIME_NAMESPACES } from './build-core.mjs';
14
18
  import { normalizeEol } from './identity-hash.mjs';
15
19
 
@@ -79,6 +83,20 @@ export function playerVersion(json, lock, sha256, commit) {
79
83
  return `${json.version}+dev${c}`;
80
84
  }
81
85
 
86
+ export const EDITS_SHOWN_SINCE = '1.9.0';
87
+ const CORE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:\+[0-9A-Za-z.-]+)?$/;
88
+ export function compareVersions(a, b) {
89
+ const x = CORE.exec(String(a ?? '')), y = CORE.exec(String(b ?? ''));
90
+ if (!x || !y) return null;
91
+ for (let i = 1; i <= 3; i++) { const d = Number(x[i]) - Number(y[i]); if (d) return d < 0 ? -1 : 1; }
92
+ return 0;
93
+ }
94
+ export function playerShowsEdits(player) {
95
+ if (!isObj(player) || player.name !== PLAYER.name) return false;
96
+ const c = compareVersions(player.version, EDITS_SHOWN_SINCE);
97
+ return c !== null && c >= 0;
98
+ }
99
+
82
100
  export async function resolvePlayer(env) {
83
101
  // kit/ の下は組み立てが実行系を読むところ(env.KIT)から、ほかはリポジトリの根から
84
102
  const P = env.path, at = (rel) => (rel.startsWith('kit/') && env.KIT ? P.join(env.KIT, ...rel.slice(4).split('/')) : P.join(env.ROOT, ...rel.split('/')));
@@ -13,7 +13,7 @@
13
13
  import { boundedParse, PARSE_LIMITS } from './bounded-html.mjs';
14
14
  import { plural } from './plural.mjs';
15
15
  import { codeReasons } from './code-scan.mjs';
16
- import { build as coreBuild, jsonScript, MIME, buildBudget, chargedEnv, BuildLimitError, DECK_META_RIGHTS, normalizeOffer, OFFER_MODES, OFFER_FACES } from './build-core.mjs';
16
+ import { build as coreBuild, jsonScript, MIME, buildBudget, chargedEnv, BuildLimitError, DECK_META_RIGHTS, normalizeOffer, OFFER_MODES, OFFER_FACES, normalizeEdits, editsDroppedWarning } from './build-core.mjs';
17
17
  import { parseNarration } from './narration-core.mjs';
18
18
  import { FORMAT } from './format.mjs';
19
19
  import { readLock, vendorDir, resolveComponent, pinsForIndex, versionForSha, VERSION_RE } from './components-lock.mjs';
@@ -270,7 +270,7 @@ export function validateIndex(ix) {
270
270
  if (!isObj(ix)) return ['index: not an object'];
271
271
  // entry と article(§9C.1):少なくともどちらか(記事だけの教材は entry なし。§4「Lessons without slides」)
272
272
  need(ix, ['format', 'version', 'profile', 'requires', 'contracts', 'player', 'generator', 'docId', 'sourceSha256', 'files', 'blobs', 'metadata'], 'index');
273
- if (!own(ix, 'entry') && !own(ix, 'article')) e.push('index: missing "entry" (or "article": a lesson has slides, an article, or both)');
273
+ if (!own(ix, 'entry') && !own(ix, 'article')) e.push('index: missing "entry" (or "article": a file has slides, an article, or both)');
274
274
  if (own(ix, 'format') && ix.format !== FID) e.push(`format: not "${FID}"`);
275
275
  if (own(ix, 'version')) versionCheck(ix.version, 'version', e);
276
276
  if (own(ix, 'profile') && !['core', 'extended'].includes(ix.profile)) e.push('profile: not core or extended');
@@ -492,12 +492,21 @@ function audioRecordCheck(r, w, e) {
492
492
  }
493
493
  }
494
494
  const strArr = (a) => Array.isArray(a) && a.every((x) => typeof x === 'string');
495
+ // metadata.edits・deck-meta.edits(§3.6.1):[{by?, note?}](文字の値だけ。ほかの項目は持たない)
496
+ function editsCheck(v, w, e) {
497
+ if (!Array.isArray(v)) { e.push(`${w}: not an array`); return; }
498
+ v.forEach((x, i) => {
499
+ if (!isObj(x)) { e.push(`${w}[${i}]: not an object`); return; }
500
+ for (const k of Object.keys(x)) if (k !== 'by' && k !== 'note') e.push(`${w}[${i}]: unknown member "${k}"`); else if (typeof x[k] !== 'string') e.push(`${w}[${i}].${k}: not a string`);
501
+ });
502
+ }
495
503
  function metadataCheck(m, w, e) {
496
504
  if (!isObj(m)) { e.push(`${w}: not an object`); return; }
497
505
  if (!(typeof m.title === 'string' && m.title.length)) e.push(`${w}.title: not a non-empty string`);
498
506
  if (!(typeof m.lang === 'string' && m.lang.length <= 64 && RE.lang.test(m.lang))) e.push(`${w}.lang: not a BCP 47 tag`);
499
507
  for (const k of ['description', 'license', 'copyright', 'attribution']) if (own(m, k) && typeof m[k] !== 'string') e.push(`${w}.${k}: not a string`);
500
508
  for (const k of ['creators', 'curriculum']) if (own(m, k) && !strArr(m[k])) e.push(`${w}.${k}: not an array of strings`);
509
+ if (own(m, 'edits')) editsCheck(m.edits, `${w}.edits`, e);
501
510
  for (const k of ['created', 'modified', 'email']) if (own(m, k)) e.push(`${w}: must not contain "${k}"`);
502
511
  if (own(m, 'accessibility')) {
503
512
  const a = m.accessibility;
@@ -591,6 +600,7 @@ export function validateDeckMeta(m, opts = {}) {
591
600
  if (own(m, 'completion')) completionCheck(m.completion, 'deck-meta.completion', e);
592
601
  for (const k of ['license', 'copyright', 'attribution']) if (own(m, k) && typeof m[k] !== 'string') e.push(`deck-meta.${k}: not a string`);
593
602
  if (own(m, 'creators') && !strArr(m.creators)) e.push('deck-meta.creators: not an array of strings');
603
+ if (own(m, 'edits')) editsCheck(m.edits, 'deck-meta.edits', e);
594
604
  if (own(m, 'offer')) offerCheck(m.offer, 'deck-meta.offer', e);
595
605
  return e;
596
606
  }
@@ -688,7 +698,7 @@ const escAttr = (s) => escText(s).replace(/"/g, '&quot;');
688
698
  const plain = (s) => String(s).replace(/<br\s*\/?>/gi, ' ').replace(/<[^>]*>/g, '').replace(/\\\(|\\\)/g, '').replace(/&nbsp;/g, ' ').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#39;|&apos;/g, "'").replace(/&amp;/g, '&').replace(/\s+/g, ' ').trim();
689
699
  const stepOrder = (k) => (k === 'concl' ? Infinity : +k);
690
700
  // 書き出す metadata:設定のファイル(FORMAT.CONFIG_FILE)の metadata のうち仕様の項目だけ(時刻・メールなどは入れない)
691
- const META_KEYS = ['description', 'license', 'copyright', 'attribution', 'creators', 'accessibility', 'curriculum', 'completion', 'derivedFrom', 'authorship', 'audience', 'citations', 'series', 'primary', 'offer'];
701
+ const META_KEYS = ['description', 'license', 'copyright', 'attribution', 'creators', 'edits', 'accessibility', 'curriculum', 'completion', 'derivedFrom', 'authorship', 'audience', 'citations', 'series', 'primary', 'offer'];
692
702
 
693
703
  // この書き手が意味を知っている索引の項目(ほかは知らない項目として、作り直しても残す)
694
704
  const KNOWN_INDEX = new Set(['format', 'version', 'profile', 'requires', 'contracts', 'player', 'generator', 'docId', 'entry', 'sourceSha256', 'files', 'blobs', 'audio', 'components', 'themes', 'metadata', 'excluded', 'extensions', FORMAT.ATTACH_KEY, 'exportedFrom', 'article', 'articleLinks']);
@@ -709,7 +719,7 @@ export function configAttachmentsMatch(conf, index) {
709
719
  }
710
720
  // 1 ファイルを作業フォルダに出すときの設定のファイル(§3.3・§3.8):docId を残し、索引の権利の表示を写し、index.attachments を書く
711
721
  // (書き直す要がなければ null)。text:今の設定のファイルの文字列(なければ null)。ほかの項目はバイトのまま(kit/core/config-file.mjs)
712
- const RIGHTS = ['license', 'copyright', 'attribution', 'creators'];
722
+ const RIGHTS = ['license', 'copyright', 'attribution', 'creators', 'edits'];
713
723
  export function folderConfig(index, text) {
714
724
  const meta = isObj(index.metadata) ? index.metadata : {};
715
725
  const list = Array.isArray(index[FORMAT.ATTACH_KEY]) ? index[FORMAT.ATTACH_KEY] : null;
@@ -807,7 +817,7 @@ function sectionTags(html) { return (html.match(/<section\b[^>]*>/gi) || []).fil
807
817
  export async function exportPortable(env0, srcPath, opts = {}) {
808
818
  const P = env0.path;
809
819
  // 記事(§9C)のある教材は、本文の道具(env.articleTools)を持たない書き手では作り直さない(作り直すと記事が落ちる:§7.2)
810
- if (isObj(opts.carry) && own(opts.carry, 'article') && typeof env0.articleTools !== 'function') fail('article-unsupported', 'the lesson has an article (§9C), which this editor does not implement: only tier A edits are possible');
820
+ if (isObj(opts.carry) && own(opts.carry, 'article') && typeof env0.articleTools !== 'function') fail('article-unsupported', 'the file has an article (§9C), which this editor does not implement: only tier A edits are possible');
811
821
  const deckDir = P.dirname(P.resolve(srcPath));
812
822
  const rel = (p) => P.relative(deckDir, p).split(P.sep).join('/');
813
823
  const warnings = [], writes = dict();
@@ -1019,7 +1029,7 @@ export async function exportPortable(env0, srcPath, opts = {}) {
1019
1029
  // 授業の部屋の設定(extensions.live。format spec の extensions/live.md):教材には鍵を残さない(鍵は書き出す再生専用の派生にだけ入る。kit/core/live.mjs)
1020
1030
  if (isObj(econf.extensions) && own(econf.extensions, 'live')) {
1021
1031
  if (!isObj(econf.extensions.live)) fail('bad-config', `${CFG}: extensions.live is not an object`);
1022
- if (econf.extensions.live.v === 1 && own(econf.extensions.live, 'key')) fail('bad-config', `${CFG}: extensions.live.key must not be stored in the lesson (the key goes only into the exported play-only file); remove it`);
1032
+ if (econf.extensions.live.v === 1 && own(econf.extensions.live, 'key')) fail('bad-config', `${CFG}: extensions.live.key must not be stored in the file (the key goes only into the exported play-only file); remove it`);
1023
1033
  }
1024
1034
  // 新しい教材として保存(§7.3):新しい docId と derivedFrom(§3.6.1)。原稿のフォルダの設定のファイルも書き換える(writes)
1025
1035
  if (opts.identity) {
@@ -1310,6 +1320,12 @@ export async function exportPortable(env0, srcPath, opts = {}) {
1310
1320
  if (own(metadata, 'offer')) { const o = normalizeOffer(metadata.offer); if (o) metadata.offer = o; else delete metadata.offer; }
1311
1321
  if (own(metadata, 'primary') && !OFFER_FACES.includes(metadata.primary)) delete metadata.primary;
1312
1322
  if (own(em, 'title') && typeof em.title === 'string' && em.title) metadata.title = em.title;
1323
+ // 編集の記録(§3.6.1):形の合わない項目は捨てて知らせる(ほかの項目は捨てない)
1324
+ if (own(metadata, 'edits')) {
1325
+ const ed = normalizeEdits(metadata.edits);
1326
+ if (ed.edits) metadata.edits = ed.edits; else delete metadata.edits;
1327
+ if (ed.dropped) warnings.push(`${LOG}: ${editsDroppedWarning(ed.dropped)}`);
1328
+ }
1313
1329
  // player:同梱の再生器(§4.1。kit/core/player.mjs。出した版と中身が同じでなければ "+dev.<commit>")。generator:書いたソフト(Egatari Studio)
1314
1330
  const pl = await resolvePlayer(env0);
1315
1331
  // title:人に見せる名前(spec §3.1・§4.1。name は変わらない識別子)
@@ -1353,6 +1369,8 @@ export async function exportPortable(env0, srcPath, opts = {}) {
1353
1369
  ...(metadata.completion ? { completion: metadata.completion } : {}),
1354
1370
  // 権利の表示と作成者(format spec §4・§7.3):再生専用の派生は索引を持たないので、ここに写したものだけが残る
1355
1371
  ...Object.fromEntries(DECK_META_RIGHTS.filter((k) => own(metadata, k)).map((k) => [k, k === 'creators' ? [...metadata[k]] : metadata[k]])),
1372
+ // 編集の記録(§3.6.1・§7.3):再生専用の派生にも「編集」が残るように
1373
+ ...(metadata.edits ? { edits: metadata.edits.map((x) => ({ ...x })) } : {}),
1356
1374
  // 見せるモードと見え方(§1.2):再生専用の派生にも残るように deck-meta に写す(Player P1 が読む)
1357
1375
  ...(metadata.offer ? { offer: JSON.parse(JSON.stringify(metadata.offer)) } : {}),
1358
1376
  };
@@ -1787,12 +1805,12 @@ export async function readPortable(input, opts = {}) {
1787
1805
  for (const p of paths) shas[p] = ix.blobs[ix.files[p]].sha256;
1788
1806
  const computed = await sourceSha256(shas);
1789
1807
  // §3.4:索引の値・計算し直した値・deck-meta の値のどれか 2 つが違えば「組んだ教材と原稿が食い違う」(段 A の編集はしない)
1790
- if (computed !== ix.sourceSha256) warnings.push('the compiled lesson and its source disagree (the index sourceSha256 does not match its files): tier A edits are not allowed');
1808
+ if (computed !== ix.sourceSha256) warnings.push('the built slides and their source disagree (the index sourceSha256 does not match its files): tier A edits are not allowed');
1791
1809
  const sourceMatches = !!deckMeta && deckMeta.sourceSha256 === ix.sourceSha256 && computed === ix.sourceSha256;
1792
1810
  if (!deckMeta) warnings.push('no deck-meta in the runtime layer');
1793
1811
  else {
1794
1812
  for (const e of validateDeckMeta(deckMeta, { preDraft })) warnings.push(e);
1795
- if (deckMeta.sourceSha256 !== ix.sourceSha256) warnings.push('the compiled lesson and its source disagree (deck-meta.sourceSha256 differs from the index): tier A edits are not allowed');
1813
+ if (deckMeta.sourceSha256 !== ix.sourceSha256) warnings.push('the built slides and their source disagree (deck-meta.sourceSha256 differs from the index): tier A edits are not allowed');
1796
1814
  if (deckMeta.docId !== ix.docId) warnings.push('deck-meta.docId differs from the index docId');
1797
1815
  }
1798
1816
  // ファイルの決まり(§4.2):置き場所と中身(基準と、実行系が宣言した拡張の行き先だけ)。合わなければ知らせる(再生はできる。前の草案には決まりがない)
@@ -177,8 +177,8 @@ export function purposesTable(P, parts, lang, src, { exclude = [], sets = null,
177
177
  const head = L === 'ja' ? '| 言いたいこと | パーツ | ステップ |\n|---|---|---|' : '| purpose | parts | steps |\n|---|---|---|';
178
178
  // 入っていない束:あることだけ(束・部品・言いたいことの名前を出さない。d5 2026-11-15。説明のない部品の属性を AI に推させない)
179
179
  const other = elsewhere.length ? '\n\n' + (L === 'ja'
180
- ? `この指示に入っていないパーツもある。使わない。合いそうなら、何を見せたいかを 1 行のメモで伝える(作る人が新規作成でパーツを足せる)`
181
- : `Some parts are not included in these instructions. Do not use them; if one would fit, say in a one-line note what you would show (the author can add parts when making a new lesson).`) : '';
180
+ ? `この指示に入っていないパーツもある。使わない。合いそうなら、何を見せたいかを 1 行のメモで伝える(作成者が新規作成でパーツを追加できる)`
181
+ : `Some parts are not included in these instructions. Do not use them; if one would fit, say in a one-line note what you would show (the author can add parts when making a new file).`) : '';
182
182
  const url = src ? '\n\n' + (L === 'ja' ? `各パーツの説明(バージョンを固定):${src}<名前>/README.md(名前は \`m-\` を除いたもの)` : `Each part's description (pinned version): ${src}<name>/README.md (the name without \`m-\`)`) : '';
183
183
  return head + '\n' + rows.join('\n') + other + url;
184
184
  }
@@ -9,7 +9,7 @@
9
9
  // matchReference(refs, rel, bytes?) → 当たった参照音声(場所が同じか、中身のバイトが同じ)か null
10
10
  // REFERENCE_VOICE_RULE 知らせに添える決まりの言葉(英語。画面は app/i18n.js・kit/check-messages.mjs)
11
11
 
12
- export const REFERENCE_VOICE_RULE = 'a lesson does not carry the reference recording a voice was cloned from, only the narration audio made with it (Egatari §5, recipe)';
12
+ export const REFERENCE_VOICE_RULE = 'an Egatari file does not carry the reference recording a voice was cloned from, only the narration audio made with it (Egatari §5, recipe)';
13
13
  const DEFAULT_NAMES = Object.freeze({ expert: 'bob', novice: 'alice' });
14
14
  const isPathForm = (v) => /[\\/]/.test(v) || /\.wav$/i.test(v);
15
15
  const fold = (p) => p.normalize('NFC').toLowerCase();
@@ -88,7 +88,7 @@ export function scormPackage(html) {
88
88
  if (scan.byId.has(FORMAT.INDEX_ID)) fail('scorm-not-play-only', `the file still carries its editable source (${FORMAT.INDEX_ID}); package the play-only copy`);
89
89
  if (!Array.isArray(meta.tracking) || !meta.tracking.includes('scorm12')) fail('scorm-no-tracking', 'the player in this file does not report progress through SCORM 1.2 (deck-meta.tracking has no "scorm12")');
90
90
  if (typeof meta.docId !== 'string' || !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(meta.docId)) fail('scorm-no-docid', 'deck-meta.docId is not a UUID');
91
- const title = typeof meta.title === 'string' && meta.title.trim() ? meta.title : 'Lesson';
91
+ const title = typeof meta.title === 'string' && meta.title.trim() ? meta.title : 'Untitled';
92
92
  const steps = stepCount(html);
93
93
  if (suspendLength(steps) > SUSPEND_MAX) fail('scorm-too-many-steps', `${steps} steps: the resume data (cmi.suspend_data) could exceed ${SUSPEND_MAX} characters (SCORM 1.2 binding §2.2)`);
94
94
  const manifest = scormManifest({ docId: meta.docId, title });
@@ -2,7 +2,7 @@
2
2
  // 保存先は関数で受けるので、localStorage 自体へのアクセスが断られる場合もメモリだけで使える。
3
3
  // 音源(sounds.mjs)からは読み込まない。設定の保存は音の計算の外に置く。
4
4
  export const MUTE_KEY = 'deck-mute-sounds';
5
- export const MUTE_LABEL = Object.freeze({ ja: '効果音を消す', en: 'Mute sound effects' });
5
+ export const MUTE_LABEL = Object.freeze({ ja: '効果音をミュート', en: 'Mute sound effects' });
6
6
  export function createMuteSetting(storage = () => globalThis.localStorage) {
7
7
  let muted = false;
8
8
  try { muted = storage()?.getItem(MUTE_KEY) === '1'; } catch { /* 保存できない端末 */ }
@@ -0,0 +1,209 @@
1
+ // テーマを作る画面(新規作成の ③ の「オリジナル」。#58・handoff/theme-builder-v2-2026-10-27.md)の計算:
2
+ // 基調色 1 つからほかの色を導き、裏で色を確かめ、通らないときは通るいちばん近い色を探し、テーマのファイル(tokens.css・theme.json)を書く。
3
+ // 外の名前を使わない(ブラウザでも Node でも動く。app/theme-workshop.js と tools/test-theme-derive.mjs が使う)。色の計算は kit/core/color-check.mjs
4
+ //
5
+ // deriveTheme(base, overrides) → {base, title, term, rule, complement, accent2, 'base-tint', 'base-wash', 'comp-tint', emph, fg, muted, bg, 'concl-bg', 'sec-bg', 'sec-fg', 'ramp-1'…'ramp-5'}
6
+ // 式は themes/default/tokens.css の @supports の式と同じ(--title は明るさ 0.32 まで、補色は色相 +180°、淡色は OKLCH で白と混ぜる)。
7
+ // overrides(「詳しく」で替えた色。名前は上の鍵)はそのまま勝つ
8
+ // checkTheme(t, {coverBg}) → [{id, level: 'fail' | 'warn', token, value, need, kind?}] 通らなかったものだけ(全部通れば [])
9
+ // token:直すときに替える入力('base' か「詳しく」の鍵)。coverBg:表紙の背景画像の平均の色(あれば表紙のタイトルと比べる)
10
+ // fixFor(input, token, opts) → '#RRGGBB' | null その入力の fail がなくなる、元の色にいちばん近い色(CIEDE2000)
11
+ // pickColours(rgba, {max}) → ['#RRGGBB', …] ロゴの画素(RGBA の並び)から、目立つ有彩の色を 1〜3 つ(多い順)
12
+ // themeFiles(input, {name, title, font, coverImage, at}) → {'tokens.css': 文字列, 'theme.json': 文字列}
13
+ // readBuilder(themeJson) → 画面の入力 | null(このテーマを作る画面が書いた theme.json の builder)
14
+ //
15
+ // 基準(tools/test-themes.mjs が同梱のテーマに求めるものと同じ線):
16
+ // コントラスト(WCAG 2.x):用語・タイトル・補色・結論の色・本文と地 4.5:1、結論の行の字と地 4.5:1、章の扉の字と地 4.5:1、表紙のタイトルと背景画像 4.5:1
17
+ // 色覚(Machado ほか 2009):結論の色と用語の色の差が 3 色型・1 型・2 型で ΔE*ab 35 以上と CIEDE2000 20 以上、3 型は CIEDE2000 20(足りなければ warn)
18
+ // 基調色の色相が結論の赤に近い(OKLCH で 25° 未満、鮮やかさ 0.05 以上):fail
19
+ // 白黒(印刷・白黒の投影):用語の色と本文の黒の CIEDE2000(明るさだけの差)4 未満は fail、8 未満は warn(墨・焦茶・弁柄の基調色は 5〜6 で warn)
20
+ // 白飛び(明るい部屋の投影。周りの光 15%):用語の色と地のコントラスト 3:1 以上(fail)
21
+ // 印刷:書き出す tokens.css が章の扉と表紙に print-color-adjust:exact を書くので、背景のグラフィックを印刷しない設定でも地が消えない(検査は要らない)
22
+ import { contrast, de76, de2000, simulate, hex2rgb, rgb2hex, relLum } from './color-check.mjs';
23
+ import { FONT_LIST } from './build-core.mjs';
24
+
25
+ // ---------------------------------------------------------------- OKLab / OKLCH(Björn Ottosson 2020)
26
+ const R = Math.PI / 180;
27
+ const lin1 = (v) => (v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4));
28
+ const delin1 = (v) => { v = Math.min(1, Math.max(0, v)); return v <= 0.0031308 ? 12.92 * v : 1.055 * Math.pow(v, 1 / 2.4) - 0.055; };
29
+ function oklab(c) {
30
+ const [r, g, b] = hex2rgb(c).map(lin1);
31
+ const L = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b), M = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b), S = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
32
+ return [0.2104542553 * L + 0.7936177850 * M - 0.0040720468 * S, 1.9779984951 * L - 2.4285922050 * M + 0.4505937099 * S, 0.0259040371 * L + 0.7827717662 * M - 0.8086757660 * S];
33
+ }
34
+ function oklabToLin([l, a, b]) {
35
+ const L = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3, M = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3, S = (l - 0.0894841775 * a - 1.2914855480 * b) ** 3;
36
+ return [4.0767416621 * L - 3.3077115913 * M + 0.2309699292 * S, -1.2684380046 * L + 2.6097574011 * M - 0.3413193965 * S, -0.0041960863 * L - 0.7034186147 * M + 1.7076147010 * S];
37
+ }
38
+ export function oklch(c) { const [L, a, b] = oklab(c), C = Math.hypot(a, b); return [L, C, C < 1e-4 ? NaN : ((Math.atan2(b, a) / R) % 360 + 360) % 360]; }
39
+ // 色域の外なら鮮やかさを下げて入れる(ブラウザの色域の写し方と 1 段ずれることがある)
40
+ export function fromOklch(L, C, h) {
41
+ if (Number.isNaN(h)) { h = 0; C = 0; }
42
+ L = Math.min(1, Math.max(0, L));
43
+ for (let i = 0; i < 60; i++) {
44
+ const l = oklabToLin([L, C * Math.cos(h * R), C * Math.sin(h * R)]);
45
+ if (l.every((v) => v >= -1e-4 && v <= 1 + 1e-4)) return rgb2hex(l.map(delin1));
46
+ C *= 0.94;
47
+ }
48
+ return rgb2hex(oklabToLin([L, 0, 0]).map(delin1));
49
+ }
50
+ // color-mix(in oklch, c p, white)
51
+ function mixWhite(c, p) {
52
+ const [L, C, h] = oklch(c);
53
+ return fromOklch(p * L + (1 - p), p * C, h);
54
+ }
55
+ const hueGap = (a, b) => { const d = Math.abs(a - b) % 360; return d > 180 ? 360 - d : d; };
56
+ export const isHex = (s) => /^#?[0-9a-f]{6}$/i.test(String(s || '').trim());
57
+ export const normHex = (s) => '#' + String(s).trim().replace(/^#/, '').toUpperCase();
58
+ const grey = (c) => { const y = delin1(relLum(c)); return [y, y, y]; };
59
+ const washout = (c, a = 0.15) => hex2rgb(c).map(lin1).map((v) => delin1(a + (1 - a) * v));
60
+
61
+ // ---------------------------------------------------------------- 導く
62
+ // 基調色に依らない色(themes/default/tokens.css と同じ値)
63
+ export const FIXED = Object.freeze({ emph: '#BE3012', fg: '#222222', muted: '#5C5853', bg: '#FFFFFF', 'concl-bg': '#F5F5F5', 'sec-fg': '#FFFFFF' });
64
+ // 「詳しく」で替えられる色(画面の並び)
65
+ export const EDITABLE = Object.freeze(['title', 'term', 'emph', 'accent2', 'base-tint', 'base-wash']);
66
+ export function deriveTheme(base, overrides = {}) {
67
+ base = normHex(base);
68
+ const [L, C, h] = oklch(base);
69
+ const comp = fromOklch(L, C, Number.isNaN(h) ? h : (h + 180) % 360);
70
+ const [cL, cC, ch] = oklch(comp);
71
+ const t = {
72
+ base, rule: base, term: base, 'sec-bg': base,
73
+ title: fromOklch(Math.min(L, 0.32), C, h),
74
+ complement: comp, accent2: fromOklch(Math.min(cL, 0.55), cC, ch),
75
+ 'base-tint': mixWhite(base, 0.22), 'base-wash': mixWhite(base, 0.07), 'comp-tint': mixWhite(comp, 0.22),
76
+ ...FIXED,
77
+ };
78
+ // 量の色の段(format spec §8.4):基調色の色相で、明るさが単調に下がる 5 段(--ramp-5 は地と 3:1 以上)
79
+ const cc = Math.min(Number.isNaN(h) ? 0 : C, 0.14);
80
+ [0.94, 0.82, 0.68, 0.54, 0.40].forEach((l, i) => { t[`ramp-${i + 1}`] = fromOklch(l, cc * [0.25, 0.5, 0.75, 0.9, 1][i], h); });
81
+ for (const [k, v] of Object.entries(overrides || {})) if (EDITABLE.includes(k) && isHex(v)) t[k] = normHex(v);
82
+ return t;
83
+ }
84
+
85
+ // ---------------------------------------------------------------- 確かめる
86
+ export const NEED = Object.freeze({ text: 4.5, washout: 3, de76: 35, de2000: 20, grey: 8, greyFail: 4, redHue: 25 });
87
+ // input:{base, overrides}。返すのは通らなかったものだけ
88
+ export function checkTheme(t, { coverBg = null, overrides = {} } = {}) {
89
+ const out = [];
90
+ const who = (k) => (overrides && overrides[k] ? k : 'base'); // 直すときに替える入力
91
+ const text = (id, fg, bg, token) => { const v = contrast(fg, bg); if (v < NEED.text) out.push({ id, level: 'fail', token, value: v, need: NEED.text }); };
92
+ text('term-contrast', t.term, t.bg, who('term'));
93
+ text('title-contrast', t.title, t.bg, who('title'));
94
+ text('accent2-contrast', t.accent2, t.bg, who('accent2'));
95
+ text('sec-contrast', t['sec-fg'], t['sec-bg'], 'base');
96
+ if (overrides && overrides.emph) { text('emph-contrast', t.emph, t.bg, 'emph'); text('concl-contrast', t.emph, t['concl-bg'], 'emph'); }
97
+ if (coverBg) text('cover-title', t.title, coverBg, 'cover');
98
+ // 色覚:結論の色と用語の色
99
+ const ct = overrides && overrides.term ? 'term' : overrides && overrides.emph ? 'emph' : 'base';
100
+ let worst = null;
101
+ for (const kind of ['normal', 'protan', 'deutan']) {
102
+ const a = simulate(t.emph, kind), b = simulate(t.term, kind), d00 = de2000(a, b), d76 = de76(a, b);
103
+ if (d00 < NEED.de2000 || d76 < NEED.de76) { const v = d00 < NEED.de2000 ? d00 : d76, need = d00 < NEED.de2000 ? NEED.de2000 : NEED.de76; if (!worst || v / need < worst.value / worst.need) worst = { kind, value: v, need, metric: d00 < NEED.de2000 ? 'de2000' : 'de76' }; }
104
+ }
105
+ if (worst) out.push({ id: 'cvd', level: 'fail', token: ct, ...worst });
106
+ else { const d = de2000(simulate(t.emph, 'tritan'), simulate(t.term, 'tritan')); if (d < NEED.de2000) out.push({ id: 'cvd', level: 'warn', token: ct, kind: 'tritan', value: d, need: NEED.de2000, metric: 'de2000' }); }
107
+ // 基調色の色相が結論の赤に近い
108
+ const [, bc, bh] = oklch(t.base), [, , eh] = oklch(t.emph);
109
+ if (!Number.isNaN(bh) && !Number.isNaN(eh) && bc >= 0.05 && hueGap(bh, eh) < NEED.redHue) out.push({ id: 'red-hue', level: 'fail', token: 'base', value: hueGap(bh, eh), need: NEED.redHue });
110
+ // 白黒
111
+ const g = de2000(grey(t.term), grey(t.fg));
112
+ if (g < NEED.grey) out.push({ id: 'grey', level: g < NEED.greyFail ? 'fail' : 'warn', token: who('term'), value: g, need: NEED.grey });
113
+ // 白飛び
114
+ const w = contrast(washout(t.term), washout(t.bg));
115
+ if (w < NEED.washout) out.push({ id: 'washout', level: 'fail', token: who('term'), value: w, need: NEED.washout });
116
+ return out;
117
+ }
118
+ export const checkInput = (input, opts = {}) => checkTheme(deriveTheme(input.base, input.overrides), { ...opts, overrides: input.overrides || {} });
119
+
120
+ // ---------------------------------------------------------------- 直す色を探す
121
+ // token の fail がなくなる色のうち、元の色にいちばん近いもの(CIEDE2000)。OKLCH の明るさを動かし、色相も ±90° まで回して探す
122
+ export function fixFor(input, token, opts = {}) {
123
+ const now = token === 'base' ? input.base : (input.overrides || {})[token];
124
+ if (!isHex(now)) return null;
125
+ const [L, C, h] = oklch(now);
126
+ const at = (hex) => (token === 'base' ? { ...input, base: hex } : { ...input, overrides: { ...input.overrides, [token]: hex } });
127
+ const ok = (hex) => !checkInput(at(hex), opts).some((x) => x.level === 'fail' && x.token === token);
128
+ let best = null, bestD = Infinity;
129
+ for (const dh of [0, 10, -10, 20, -20, 30, -30, 45, -45, 60, -60, 90, -90]) {
130
+ if (dh && Number.isNaN(h)) break;
131
+ for (let l = 0.2; l <= 0.9001; l += 0.01) {
132
+ const hex = fromOklch(l, C, Number.isNaN(h) ? h : (h + dh + 360) % 360);
133
+ if (hex === normHex(now) || !ok(hex)) continue;
134
+ const d = de2000(hex, now);
135
+ if (d < bestD) { best = hex; bestD = d; }
136
+ }
137
+ }
138
+ return best;
139
+ }
140
+
141
+ // ---------------------------------------------------------------- ロゴから色を拾う
142
+ // rgba:Uint8ClampedArray か数の並び(canvas の getImageData の data)。透けた画素・白・黒・灰(鮮やかさ 0.04 未満)は数えない。
143
+ // 色相 30° × 明るさ 3 段の箱で数え、多い箱から(同じ色相の箱は 1 つだけ)、箱の平均の色
144
+ export function pickColours(rgba, { max = 3 } = {}) {
145
+ const bins = new Map();
146
+ for (let i = 0; i + 3 < rgba.length; i += 4) {
147
+ if (rgba[i + 3] < 128) continue;
148
+ const hex = rgb2hex([rgba[i], rgba[i + 1], rgba[i + 2]].map((v) => v / 255));
149
+ const [L, C, h] = oklch(hex);
150
+ if (C < 0.04 || L > 0.95 || L < 0.12 || Number.isNaN(h)) continue;
151
+ const k = `${Math.floor(h / 30)}:${Math.min(2, Math.floor(L * 3))}`;
152
+ const b = bins.get(k) || { n: 0, r: 0, g: 0, b: 0, hue: Math.floor(h / 30) };
153
+ b.n++; b.r += rgba[i]; b.g += rgba[i + 1]; b.b += rgba[i + 2];
154
+ bins.set(k, b);
155
+ }
156
+ const total = [...bins.values()].reduce((s, b) => s + b.n, 0), seen = new Set(), out = [];
157
+ for (const b of [...bins.values()].sort((x, y) => y.n - x.n)) {
158
+ if (out.length >= max || b.n < total * 0.04 || seen.has(b.hue)) continue;
159
+ seen.add(b.hue);
160
+ out.push(rgb2hex([b.r, b.g, b.b].map((v) => v / b.n / 255)));
161
+ }
162
+ return out;
163
+ }
164
+
165
+ // ---------------------------------------------------------------- 書き出す
166
+ export const FONT_CHOICES = Object.freeze(FONT_LIST.filter((f) => f.group !== 'mono'));
167
+ const FALLBACK = { ja: '"Hiragino Sans", "Yu Gothic", sans-serif', en: '"Helvetica Neue", Arial, sans-serif' };
168
+ const SERIF = /Mincho|Serif|Fraunces/i;
169
+ export const fontStack = (family) => {
170
+ const f = FONT_CHOICES.find((x) => x.family === family) || FONT_CHOICES[0];
171
+ return `"${f.family}", ${SERIF.test(f.family) ? (f.group === 'ja' ? '"Hiragino Mincho ProN", "Yu Mincho", serif' : 'Georgia, serif') : FALLBACK[f.group] || 'sans-serif'}`;
172
+ };
173
+ const TOKEN_ORDER = ['base', 'title', 'complement', 'accent2', 'base-tint', 'base-wash', 'comp-tint', 'term', 'emph', 'ramp-1', 'ramp-2', 'ramp-3', 'ramp-4', 'ramp-5'];
174
+ // input:{base, overrides, font}。coverImage:'data:image/…;base64,…'(そのまま tokens.css に入る。テーマの hash と 1 ファイルに入る。#171(b))
175
+ export function themeFiles(input, { name, title = '', coverImage = '', results = null } = {}) {
176
+ const t = deriveTheme(input.base, input.overrides);
177
+ const res = results || checkInput(input);
178
+ const head = [`/* ${title || name}: made with the theme builder in Egatari Studio (New…, step 3, Custom).`,
179
+ ` Main colour ${t.base}. The other colours are worked out from it${Object.keys(input.overrides || {}).length ? '; changed by hand: ' + Object.keys(input.overrides).join(', ') : ''}.`,
180
+ ` Checks: ${res.length ? res.map((x) => `${x.level} ${x.id}`).join(', ') : 'all passed'}. */`];
181
+ const lines = TOKEN_ORDER.map((k) => ` --${k}: ${t[k]};`);
182
+ lines.push(` --font-sans: ${fontStack(input.font)};`);
183
+ if (coverImage) lines.push(` --cover-bg: url("${coverImage}") center / cover no-repeat var(--bg);`);
184
+ const css = [...head, ':root{', ...lines, '}',
185
+ '/* print the section divider and cover backgrounds even when the browser does not print background graphics */',
186
+ '@media print{.slide.sec,.slide.cover{-webkit-print-color-adjust:exact;print-color-adjust:exact}}', ''].join('\n');
187
+ const f = FONT_CHOICES.find((x) => x.family === input.font);
188
+ const json = { name, ...(title ? { title } : {}), extends: 'default', version: '1.0.0',
189
+ ...(f && !f.default ? { fonts: { body: f.family } } : {}),
190
+ builder: { base: t.base, font: input.font || '', ...(Object.keys(input.overrides || {}).length ? { overrides: input.overrides } : {}) } };
191
+ return { 'tokens.css': css, 'theme.json': JSON.stringify(json, null, 2) + '\n' };
192
+ }
193
+ export function readBuilder(themeJson) {
194
+ let j;
195
+ try { j = typeof themeJson === 'string' ? JSON.parse(themeJson) : themeJson; } catch { return null; }
196
+ const b = j && j.builder;
197
+ if (!b || !isHex(b.base)) return null;
198
+ const overrides = {};
199
+ for (const [k, v] of Object.entries(b.overrides || {})) if (EDITABLE.includes(k) && isHex(v)) overrides[k] = normHex(v);
200
+ return { base: normHex(b.base), font: FONT_CHOICES.some((f) => f.family === b.font) ? b.font : '', overrides };
201
+ }
202
+ // 同梱のテーマの tokens.css から始める値(最後の --base と --font-sans の最初の名前)
203
+ export function startFrom(tokensCss) {
204
+ const c = String(tokensCss || '').replace(/\/\*[\s\S]*?\*\//g, '');
205
+ const b = [...c.matchAll(/--base\s*:\s*(#[0-9a-fA-F]{6})\b/g)].pop();
206
+ const f = [...c.matchAll(/--font-sans\s*:\s*([^;}]+)/g)].pop();
207
+ const fam = f ? f[1].split(',')[0].trim().replace(/^["']|["']$/g, '') : '';
208
+ return { base: b ? normHex(b[1]) : null, font: FONT_CHOICES.some((x) => x.family === fam) ? fam : '' };
209
+ }
@@ -15,7 +15,7 @@ export const CHOOSABLE = Object.freeze([
15
15
  export const RETIRED = Object.freeze(['business']);
16
16
  // 選べなくしたテーマの見せる名前(その教材を開いたときの「テーマを変更…」の今のテーマ)
17
17
  export const RETIRED_LABEL = Object.freeze({ business: { ja: 'ビジネス', en: 'Business' } });
18
- export const RETIRED_NOTE = Object.freeze({ ja: '新しくは選べない', en: 'No longer offered for new lessons' });
18
+ export const RETIRED_NOTE = Object.freeze({ ja: '新しくは選べない', en: 'No longer offered for new files' });
19
19
  // 同梱のテーマの名前の並び(have:同梱のテーマの名前)→ 選べるものを画面の順に。同梱にあって一覧にないもの(RETIRED を除く)は後ろに名前の順
20
20
  export function choosableOf(have) {
21
21
  const set = new Set(have);
@@ -162,5 +162,5 @@ export function themeUpdate(lock, name, from) {
162
162
  // 知らせの 1 行(CLI と編集アプリの警告の板)
163
163
  export function themePinnedWarning(u) {
164
164
  const list = u.tokens.map((x) => `${x.token} ${x.from} → ${x.to}`).join(', ');
165
- return `theme pinned: ${u.name} ${u.from} is the version this lesson recorded; the current ${u.name} is ${u.to}${list ? ` (${list})` : ''}. It is built with ${u.from}, never restyled silently. To update: in the editor press 「テーマを更新」 / Update theme; on the command line rebuild with --update-themes, or set "${u.name}": "${u.to}" under themes in egatari.json / 記録したバージョンのテーマで組む。黙って新しい色にしない`;
165
+ return `theme pinned: ${u.name} ${u.from} is the version this file recorded; the current ${u.name} is ${u.to}${list ? ` (${list})` : ''}. It is built with ${u.from}, never restyled silently. To update: in the editor press 「テーマを更新」 / Update theme; on the command line rebuild with --update-themes, or set "${u.name}": "${u.to}" under themes in egatari.json / 記録したバージョンのテーマでビルドする。自動では新しい色に変えない`;
166
166
  }