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
@@ -0,0 +1,305 @@
1
+ // m-trace:コードの実行を 1 行ずつ追う。左にコード(今の行に印)、右に変数(変わった変数に印)と、その時点までの出力。
2
+ // 値はトレーサー(tools/trace.py、sys.settrace)が書いた JSON だけを描く。パーツはコードを実行しない。
3
+ // <m-trace style="height:440px"><script type="application/json">
4
+ // {"lang": "python", "code": "xs = [3, 1, 2]\ntotal = 0\nfor x in xs:\n total += x\nprint(total)",
5
+ // "source": {"tool": "egatari-trace 0.1", "python": "3.13.1", "sha256": "…", "truncated": false},
6
+ // "steps": [{"line": 1, "vars": {"xs": [3, 1, 2]}}, …, {"line": 5, "vars": {…}, "out": "6\n"}]}
7
+ // (JSON の終わり)</m-trace>
8
+ // steps[i]:line(または lines: [a, b])、vars(その行を実行した後の、見せる変数すべての値。差分ではない)、out(その行の出力)、note。
9
+ // ステップ:k = 0 はコードと空の変数、k = i + 1 はトレースの i 番目(by="time" なら 1 つのステップの中で rate 個/秒で進む)。
10
+ // 色:今の行 --emph の地と行番号、変わった変数 --emph の字と地と太字(色だけに頼らない)。
11
+ egatariParts.define({name: "trace", version: "2.0.0", requires: {base: "1.2.0", "code-core": "1.0.0"}, element: "m-trace"}, function(deps){
12
+ "use strict";
13
+ var base = deps.base, C = deps["code-core"], MONO = C.MONO, set = C.set, monoWidth = C.monoWidth, cut = C.cut;
14
+ var CAP = {lines: 16, steps: 60, show: 6, str: 40, list: 12, grid: 6, dict: 8, out: 8};
15
+ var TEXT = {
16
+ ja: {vars: "変数", output: "出力", readable: "コードと出力", final: "最後の変数", name: "変数", value: "値", more: function(n){ return "⋮(ほか " + n + " 行)"; }, older: function(n){ return "…(前の " + n + " 行)"; },
17
+ line: function(a, b){ return (a === b ? a : a + "–" + b) + " 行目"; }, summary: function(lang, n, m){ return lang + " のコード " + n + " 行の実行を " + m + " ステップで追う"; }},
18
+ en: {vars: "Variables", output: "Output", readable: "Code and output", final: "Final variables", name: "Variable", value: "Value", more: function(n){ return "⋮ (" + n + " more line" + (n === 1 ? "" : "s") + ")"; }, older: function(n){ return "… (" + n + " earlier)"; },
19
+ line: function(a, b){ return a === b ? "line " + a : "lines " + a + "–" + b; }, summary: function(lang, n, m){ return lang + ": " + n + " lines of code traced in " + m + " steps"; }}
20
+ };
21
+ // 値の文法:数・文字(40 字まで)・真偽・null、リスト(12 個まで、2 次元なら 6 × 6 まで)、辞書(8 個まで)、入れ子は 2 段まで、ほかは {"repr": "…"}
22
+ function grammar(v, depth){
23
+ if (v === null || typeof v === "boolean") return "";
24
+ if (typeof v === "number") return isFinite(v) ? "" : "a number that is not finite";
25
+ if (typeof v === "string") return [...v].length <= CAP.str ? "" : "a string over " + CAP.str + " characters (write {\"repr\": …})";
26
+ if (depth >= 2) return "values nested deeper than 2 levels (write {\"repr\": …})";
27
+ if (Array.isArray(v)){
28
+ if (v.length && v.every(Array.isArray)){ if (v.length > CAP.grid || v.some(function(r){ return r.length > CAP.grid; })) return "a 2-D list over " + CAP.grid + " × " + CAP.grid; }
29
+ else if (v.length > CAP.list) return "a list over " + CAP.list + " items";
30
+ for (var i = 0; i < v.length; i++){ var e = grammar(v[i], depth + 1); if (e) return e; }
31
+ return "";
32
+ }
33
+ if (typeof v === "object"){
34
+ var ks = Object.keys(v);
35
+ if ("repr" in v) return ks.length === 1 && typeof v.repr === "string" ? "" : "{\"repr\"} takes one string and nothing else";
36
+ if (ks.length > CAP.dict) return "a dict over " + CAP.dict + " keys";
37
+ for (var j = 0; j < ks.length; j++){ var e2 = grammar(v[ks[j]], depth + 1); if (e2) return e2; }
38
+ return "";
39
+ }
40
+ return "an unknown value";
41
+ }
42
+ // 値の字(Python なら Python の書き方:'a'・True・None)。2 次元のリストは 1 行ずつ
43
+ function fmt(v, py){
44
+ if (v === null) return py ? "None" : "null";
45
+ if (typeof v === "boolean") return py ? (v ? "True" : "False") : String(v);
46
+ if (typeof v === "number") return String(v);
47
+ if (typeof v === "string") return py ? "'" + v.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, "\\n") + "'" : JSON.stringify(v);
48
+ if (Array.isArray(v)) return "[" + v.map(function(x){ return fmt(x, py); }).join(", ") + "]";
49
+ if (v && typeof v === "object"){
50
+ if ("repr" in v) return String(v.repr);
51
+ return "{" + Object.keys(v).map(function(k){ return fmt(k, py) + ": " + fmt(v[k], py); }).join(", ") + "}";
52
+ }
53
+ return String(v);
54
+ }
55
+ function rowsOf(v, py){
56
+ if (Array.isArray(v) && v.length > 1 && v.every(Array.isArray)) return v.map(function(r, i){ return (i ? " " : "[") + fmt(r, py) + (i < v.length - 1 ? "," : "]"); });
57
+ return [fmt(v, py)];
58
+ }
59
+ function outLines(s){ var L = s.replace(/\r\n?/g, "\n").split("\n"); if (L[L.length - 1] === "") L.pop(); return L; }
60
+ return class extends base.MotionElement {
61
+ static partName = "trace";
62
+ static preview = "none";
63
+ static shape = {schema: {type: "object", additionalProperties: false, required: ["code", "steps"], properties: {
64
+ lang: {type: "string"}, code: {type: "string"},
65
+ source: {type: "object", additionalProperties: false, properties: {tool: {type: "string"}, python: {type: "string"}, sha256: {type: "string"}, truncated: {type: "boolean"}}},
66
+ show: {type: "array", minItems: 1, maxItems: 6, items: {type: "string"}},
67
+ steps: {type: "array", minItems: 1, maxItems: 60, items: {type: "object", additionalProperties: false, required: ["vars"], anyOf: [{required: ["line"]}, {required: ["lines"]}], properties: {
68
+ line: {type: "integer"}, lines: {type: "array", minItems: 2, maxItems: 2, items: {type: "integer"}}, vars: {type: "object"}, out: {type: "string"}, note: {type: "string"}
69
+ }}}
70
+ }}, example: /*@egatari-block example*/{"lang":"python","code":"total = 0\nfor x in [3, 1]:\n total += x\nprint(total)","source":{"tool":"egatari-trace 0.1","python":"3.13.1","sha256":"","truncated":false},"steps":[{"line":1,"vars":{"total":0}},{"line":2,"vars":{"total":0,"x":3}},{"line":3,"vars":{"total":3,"x":3}},{"line":2,"vars":{"total":3,"x":1}},{"line":3,"vars":{"total":4,"x":1}},{"line":2,"vars":{"total":4,"x":1}},{"line":4,"vars":{"total":4,"x":1},"out":"4\n"}]}/*@egatari-block-end*/};
71
+ static props = {
72
+ dur: {type: "number", default: 0.5, doc: "1 ステップの秒数"},
73
+ by: {type: "enum", values: ["step", "time"], default: "step", doc: "step はトレースの 1 行を 1 ステップに、time は全体を 1 ステップの中で流す"},
74
+ rate: {type: "number", default: 2, doc: "by=\"time\" のとき 1 秒に進む行の数"},
75
+ size: {type: "number", default: 0, doc: "文字 px(0 は既定)"}
76
+ };
77
+ get steps(){ var n = ((this.data || {}).steps || []).length; return this.props.by === "time" ? (n ? 1 : 0) : n; }
78
+ duration(k){ var n = this.data.steps.length; return this.props.by === "time" ? (k === 1 ? n / this.props.rate : 0) : (k >= 1 && k <= n ? this.props.dur : 0); }
79
+ cues(k){ var r = this.props.rate; return this.props.by === "time" && k === 1 ? this.data.steps.map(function(_, i){ return i / r; }) : null; }
80
+ label(g, x, y, s, fs, color, mono){
81
+ var e = base.el("text", {x: x, y: y, "font-size": fs, fill: color || "var(--fg)"}, g);
82
+ if (mono) e.setAttribute("style", "font-family:" + MONO + ";white-space:pre;");
83
+ e.textContent = s; return e;
84
+ }
85
+ mount(ctx){
86
+ var self = this, d = this.data, P = this.props, T = /^ja\b/i.test(ctx.lang || "") ? TEXT.ja : TEXT.en;
87
+ if (!(Number.isFinite(P.dur) && P.dur > 0)){ ctx.report("attr", "[trace] dur must be positive; using 0.5"); P.dur = 0.5; }
88
+ if (!(Number.isFinite(P.rate) && P.rate > 0)){ ctx.report("attr", "[trace] rate must be positive; using 2"); P.rate = 2; }
89
+ if (!(P.size === 0 || Number.isFinite(P.size) && P.size >= 24)){ ctx.report("attr", "[trace] size must be 0 or at least 24; using defaults"); P.size = 0; }
90
+ this.style.display = "block"; this.style.position = "relative"; this.style.writingMode = "horizontal-tb";
91
+ var lang = d.lang || "", py = /^python/i.test(lang), program = C.lines(d.code), marks = C.spans(program, lang.toLowerCase()), N = d.steps.length;
92
+ this.T = T; this.py = py;
93
+ // ---- データの確かめ(形は shape、ここでは欄どうしの関係と値の文法)
94
+ var bad = function(s){ ctx.report("data", "[trace] " + s); };
95
+ if (program.length > CAP.lines) bad("code has " + program.length + " lines; at most " + CAP.lines + " (trace a shorter program or one function)");
96
+ var st = d.steps.map(function(s, i){
97
+ var a = s.line !== undefined ? s.line : s.lines[0], b = s.line !== undefined ? s.line : s.lines[1];
98
+ if (!(a >= 1 && b >= a && b <= program.length)){ bad("steps[" + i + "]: line " + (a === b ? a : a + "–" + b) + " is outside 1–" + program.length); a = b = 0; }
99
+ Object.keys(s.vars).forEach(function(k){ var e = grammar(s.vars[k], 0); if (e) bad("steps[" + i + "].vars." + k + ": " + e); });
100
+ return {a: a, b: b, vars: s.vars, out: s.out || "", note: s.note || ""};
101
+ });
102
+ var seen = []; st.forEach(function(s){ Object.keys(s.vars).forEach(function(k){ if (seen.indexOf(k) < 0) seen.push(k); }); });
103
+ var names = d.show ? d.show.slice() : seen.slice(0, CAP.show);
104
+ if (!d.show && seen.length > CAP.show) bad(seen.length + " variables (" + seen.join(", ") + "); at most " + CAP.show + " are shown: choose them with show");
105
+ if (d.show) d.show.forEach(function(k){ if (seen.indexOf(k) < 0) bad("show: \"" + k + "\" is in no step's vars"); });
106
+ var acc = [], all = "";
107
+ st.forEach(function(s, i){
108
+ all += s.out; acc.push(outLines(all));
109
+ var prev = i ? st[i - 1].vars : {};
110
+ s.changed = names.filter(function(k){ return (k in s.vars) && JSON.stringify(s.vars[k]) !== JSON.stringify(prev[k]); });
111
+ });
112
+ var outTotal = acc.length ? acc[acc.length - 1].length : 0;
113
+ if (outTotal > CAP.out) bad("the output has " + outTotal + " lines; at most " + CAP.out + " (print less, or trace a shorter run)");
114
+ this.st = st; this.names = names; this.acc = acc;
115
+ // ---- 読める層:コードと出力(pre)、最後の変数(table)
116
+ this.setAttribute("role", "figure");
117
+ var langName = py ? "Python" : lang || (T === TEXT.ja ? "プログラム" : "Program");
118
+ if (!this.getAttribute("aria-label")) this.setAttribute("aria-label", T.summary(langName, program.length, N) + (st.some(function(s){ return s.note; }) ? "; " + st.map(function(s){ return s.note; }).filter(Boolean).join("; ") : ""));
119
+ var hide = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);border:0;";
120
+ var pre = document.createElement("pre"); pre.className = "sr-only"; pre.setAttribute("style", hide + "white-space:pre"); pre.setAttribute("aria-label", T.readable); pre.setAttribute("data-readable", "");
121
+ pre.textContent = d.code + (all ? "\n\n" + T.output + "\n" + all.replace(/\n$/, "") : ""); this.appendChild(pre);
122
+ var tbl = document.createElement("table"); tbl.className = "sr-only"; tbl.setAttribute("style", hide); tbl.setAttribute("data-readable", ""); tbl.setAttribute("aria-label", T.final);
123
+ var last = st[N - 1].vars, head = document.createElement("tr");
124
+ [T.name, T.value].forEach(function(h){ var th = document.createElement("th"); th.textContent = h; head.appendChild(th); }); tbl.appendChild(head);
125
+ names.filter(function(k){ return k in last; }).forEach(function(k){
126
+ var tr = document.createElement("tr"), th = document.createElement("th"), td = document.createElement("td");
127
+ th.textContent = k; td.textContent = fmt(last[k], py); tr.appendChild(th); tr.appendChild(td); tbl.appendChild(tr);
128
+ });
129
+ this.appendChild(tbl);
130
+ // ---- 配置:左にコードと説明の帯、右に変数と出力
131
+ var W = Math.max(1, this.clientWidth), H = Math.max(1, this.clientHeight);
132
+ var fs = P.size || 24, nf = P.size || 26, row = Math.ceil(fs * 1.4), noteRow = Math.ceil(nf * 1.45 + 4), pad = 16, gap = 24, header = row + 16;
133
+ var expanded = program.map(function(s){ return s.replace(/\t/g, " "); });
134
+ var numW = monoWidth(String(program.length), fs) + 16, textX = pad + numW;
135
+ var codeNatural = textX + Math.max(160, Math.max.apply(null, expanded.map(function(s){ return monoWidth(s, fs); }))) + pad;
136
+ var nameW = Math.max(0, Math.max.apply(null, names.map(function(k){ return monoWidth(k + " = ", fs); })));
137
+ var valueW = 0, varRows = 1;
138
+ st.forEach(function(s){
139
+ var r = 0;
140
+ names.forEach(function(k){ if (k in s.vars){ var R = rowsOf(s.vars[k], py); r += R.length; R.forEach(function(t){ valueW = Math.max(valueW, monoWidth(t, fs)); }); } });
141
+ varRows = Math.max(varRows, r);
142
+ });
143
+ var hasOut = all.length > 0, outW = hasOut ? Math.max.apply(null, acc[N - 1].map(function(s){ return monoWidth(s.replace(/\t/g, " "), fs); }).concat([0])) : 0;
144
+ var counterW = monoWidth(N + " / " + N, fs);
145
+ var rightNatural = Math.max(240, 2 * pad + nameW + valueW, 2 * pad + outW, 2 * pad + base.textWidth(T.vars, fs, {font: this}) + 16 + counterW);
146
+ var codeW, rightW;
147
+ if (codeNatural + gap + rightNatural <= W){ codeW = Math.max(codeNatural, Math.min(W * 0.5, W - gap - rightNatural)); }
148
+ else codeW = Math.max(Math.min(codeNatural, W * 0.45), W - gap - rightNatural);
149
+ codeW = Math.max(1, Math.min(codeW, W - gap - 120)); rightW = Math.max(1, W - codeW - gap);
150
+ var rx = codeW + gap;
151
+ // 説明の帯(コードの下、2 行まで)
152
+ var noteLines = st.map(function(s, i){
153
+ if (!s.note) return [];
154
+ var w = C.wrap(s.note.replace(/\s*\n\s*/g, " "), codeW - 24, nf, self);
155
+ if (w.length > 2){ ctx.report("layout", "[trace] note of step " + (i + 1) + " needs " + w.length + " rows in the band (2 fit); shorten it"); w = [w[0], proseCut(w.slice(1).join(""), codeW - 24, nf)]; }
156
+ return w;
157
+ });
158
+ function proseCut(s, width, f){
159
+ if (base.textWidth(s, f, {font: self}) <= width) return s;
160
+ var ch = [...s]; while (ch.length && base.textWidth(ch.join("") + "…", f, {font: self}) > width) ch.pop();
161
+ return width >= f ? ch.join("") + "…" : "";
162
+ }
163
+ var nr = Math.max(0, Math.max.apply(null, noteLines.map(function(w){ return w.length; }))), bandH = nr ? nr * noteRow + 16 : 0;
164
+ var codeH = H - (bandH ? bandH + 8 : 0);
165
+ // コードの見た目の行(長い行は折り返し、続きの行は番号の欄に ↪)
166
+ var textW = Math.max(fs, codeW - textX - pad), vrows = [], rowsOfLine = [];
167
+ program.forEach(function(line, i){
168
+ var ex = expanded[i], chars = [...ex], at = function(m){ return [...line.slice(0, m).replace(/\t/g, " ")].length; }, mine = [];
169
+ C.softWrap(ex, textW, fs).forEach(function(g, j){
170
+ var sp = marks[i].map(function(m){ return [Math.max(at(m[0]), g.from) - g.from, Math.min(at(m[1]), g.to) - g.from, m[2]]; }).filter(function(m){ return m[1] > m[0]; });
171
+ mine.push(vrows.length); vrows.push({line: i + 1, cont: j > 0, text: chars.slice(g.from, g.to).join(""), spans: sp});
172
+ });
173
+ rowsOfLine.push(mine);
174
+ });
175
+ var slots = Math.floor((codeH - header - pad) / row);
176
+ if (slots < 3) ctx.report("size", "[trace] element is " + W + " × " + H + " px; the code needs at least " + Math.ceil(header + pad + 3 * row + (bandH ? bandH + 8 : 0)) + " px height for 3 rows and the notes");
177
+ var shown = Math.max(1, Math.min(slots, vrows.length));
178
+ var span = function(s){ if (!s || !s.a) return null; var r = [].concat.apply([], rowsOfLine.slice(s.a - 1, s.b)); return [Math.min.apply(null, r), Math.max.apply(null, r)]; };
179
+ this.window0 = C.windowFor(vrows.length, shown, 0, 0);
180
+ this.windows = st.map(function(s){ var r = span(s); return r ? C.windowFor(vrows.length, shown, r[0], r[1]) : self.window0; });
181
+ this.spans = st.map(span);
182
+ // 右:変数のパネルと出力のパネル
183
+ var varsH = hasOut ? Math.min(H, header + varRows * row + pad) : H, outY = varsH + 8, outSlots = hasOut ? Math.floor((H - outY - header - pad) / row) : 0;
184
+ if (hasOut && outSlots < 1) ctx.report("size", "[trace] element is " + W + " × " + H + " px; the variables and the output need about " + Math.ceil(header + varRows * row + pad + 8 + header + row + pad) + " px height");
185
+ if (header + varRows * row + pad > H) ctx.report("size", "[trace] the variables need " + varRows + " rows (" + Math.ceil(header + varRows * row + pad) + " px); the element is " + H + " px high");
186
+ var cutValue = false;
187
+ st.forEach(function(s){ names.forEach(function(k){ if (k in s.vars) rowsOf(s.vars[k], py).forEach(function(t){ if (monoWidth(t, fs) > rightW - 2 * pad - nameW) cutValue = true; }); }); });
188
+ if (cutValue) ctx.report("layout", "[trace] a value is wider than the variables panel (" + Math.floor(rightW - 2 * pad - nameW) + " px); it is cut with …");
189
+ this.geo = {W: W, H: H, fs: fs, row: row, pad: pad, header: header, firstY: header + fs, codeW: codeW, codeH: codeH, rx: rx, rightW: rightW, varsH: varsH, outY: outY, outSlots: Math.max(0, outSlots), nameW: nameW, slots: shown, rows: vrows.length, bandH: bandH, varRows: varRows};
190
+ this.geometry = {codeW: codeW, codeH: codeH, rightW: rightW, varsH: varsH, outSlots: Math.max(0, outSlots), slots: shown, rows: vrows.length, windowed: vrows.length > shown, bandRows: nr};
191
+ this.svg = base.el("svg", {viewBox: "0 0 " + W + " " + H, width: W, height: H, "aria-hidden": "true", style: "overflow:hidden"}, this);
192
+ var panel = function(x, y, w, h){ base.el("rect", {x: x + 1, y: y + 1, width: Math.max(1, w - 2), height: Math.max(1, h - 2), rx: 12, fill: "var(--term-tint, color-mix(in srgb, var(--fg) 5%, var(--bg)))", stroke: "var(--line)", "stroke-width": 2}, self.svg); };
193
+ var tint = "var(--emph-tint, color-mix(in srgb, var(--emph) 12%, var(--bg)))";
194
+ // コード
195
+ panel(0, 0, codeW, codeH);
196
+ var tag = cut(lang, Math.max(1, codeW - 2 * pad), fs);
197
+ this.label(this.svg, codeW - pad - monoWidth(tag, fs), pad + fs, tag, fs, "var(--muted)", true);
198
+ this.band = base.el("rect", {x: 4, y: header, width: Math.max(1, codeW - 8), height: row, rx: 4, fill: tint, opacity: 0}, this.svg);
199
+ this.vrows = vrows.map(function(r){
200
+ var num = self.label(self.svg, pad, header + fs, r.cont ? "↪" : String(r.line), fs, "var(--muted)", true);
201
+ var e = self.label(self.svg, textX, header + fs, "", fs, "var(--fg)", true), pos = 0, ch = [...r.text];
202
+ var put = function(a, b, role){ if (b > a) base.el("tspan", role ? {fill: "var(--" + role + ")"} : {}, e).textContent = ch.slice(a, b).join(""); };
203
+ r.spans.forEach(function(m){ put(pos, m[0]); put(m[0], m[1], m[2]); pos = m[1]; });
204
+ put(pos, ch.length);
205
+ return {num: num, text: e, line: r.line};
206
+ });
207
+ this.markTop = this.label(this.svg, pad, header + fs, "", fs, "var(--muted)", true);
208
+ this.markBottom = this.label(this.svg, pad, header + fs, "", fs, "var(--muted)", true);
209
+ // 説明の帯
210
+ this.notes = noteLines.map(function(w){
211
+ var g = base.el("g", {opacity: 0}, self.svg);
212
+ if (w.length){
213
+ base.el("rect", {x: 1, y: codeH + 8, width: Math.max(1, codeW - 2), height: bandH, rx: 8, fill: "var(--bg)", stroke: "var(--line)", "stroke-width": 2}, g);
214
+ w.forEach(function(t, i){ self.label(g, 12, codeH + 8 + 8 + nf + i * noteRow, t, nf); });
215
+ }
216
+ return g;
217
+ });
218
+ // 変数
219
+ panel(rx, 0, rightW, varsH);
220
+ this.label(this.svg, rx + pad, pad + fs, T.vars, fs);
221
+ this.counter = this.label(this.svg, rx + rightW - pad, pad + fs, "", fs, "var(--muted)", true); this.counter.setAttribute("text-anchor", "end");
222
+ var vRoom = Math.max(1, Math.floor((varsH - header - pad) / row));
223
+ this.varSlots = [];
224
+ for (var i = 0; i < Math.min(varRows, vRoom); i++){
225
+ var y = header + fs + i * row;
226
+ this.varSlots.push({
227
+ bg: base.el("rect", {x: rx + 6, y: header + i * row, width: Math.max(1, rightW - 12), height: row, rx: 4, fill: tint, opacity: 0}, this.svg),
228
+ name: this.label(this.svg, rx + pad, y, "", fs, "var(--fg)", true),
229
+ value: this.label(this.svg, rx + pad + nameW, y, "", fs, "var(--fg)", true)
230
+ });
231
+ }
232
+ // 出力
233
+ this.outLabels = [];
234
+ if (hasOut && outSlots >= 1){
235
+ panel(rx, outY, rightW, H - outY);
236
+ this.label(this.svg, rx + pad, outY + pad + fs, T.output, fs);
237
+ for (var j = 0; j < outSlots; j++) this.outLabels.push(this.label(this.svg, rx + pad, outY + header + fs + j * row, "", fs, "var(--fg)", true));
238
+ }
239
+ }
240
+ // (k, t) → トレースの何番目(-1 はまだ何も実行していない)と、その中の進み具合 e(0〜1)
241
+ at(k, t){
242
+ var n = this.st.length, P = this.props;
243
+ if (k < 1) return {i: -1, e: 1};
244
+ if (P.by === "time"){
245
+ if (k > 1 || t === Infinity) return {i: n - 1, e: 1};
246
+ var x = Math.max(0, t) * P.rate, i = Math.min(n - 1, Math.floor(x));
247
+ return {i: i, e: i === n - 1 && x >= n ? 1 : Math.min(1, (x - i) * 2.5)};
248
+ }
249
+ if (k > n) return {i: n - 1, e: 1};
250
+ return {i: k - 1, e: base.prog(t, 0, P.dur)};
251
+ }
252
+ render(k, t, ctx){
253
+ if (!this.svg) return;
254
+ var self = this, G = this.geo, T = this.T, py = this.py, s = this.at(k, t), i = s.i, e = s.e, st = this.st;
255
+ var cur = i >= 0 ? st[i] : null, win = function(j){ return j < 0 ? self.window0 : self.windows[j]; };
256
+ // 表示する範囲:変わるときは前半で消えて後半で新しい位置に出る
257
+ var w0 = win(i - 1), w1 = win(i), moving = w0.f !== w1.f || w0.l !== w1.l, w = moving && e < 0.5 ? w0 : w1, fade = moving ? (e < 0.5 ? 1 - 2 * e : 2 * e - 1) : 1;
258
+ var slotY = function(r, ww){ ww = ww || w; return G.firstY + (r - ww.f + (ww.top ? 1 : 0)) * G.row; };
259
+ this.vrows.forEach(function(o, r){
260
+ var vis = r >= w.f && r <= w.l, y = vis ? slotY(r) : G.firstY, lit = cur && o.line >= cur.a && o.line <= cur.b;
261
+ set(o.num, "y", y); set(o.text, "y", y);
262
+ set(o.num, "opacity", vis ? fade.toFixed(3) : 0); set(o.text, "opacity", vis ? fade.toFixed(3) : 0);
263
+ set(o.num, "style", "font-family:" + MONO + ";white-space:pre;fill:var(--" + (lit ? "emph" : "muted") + ")" + (lit ? ";font-weight:700" : ""));
264
+ });
265
+ var vr = this.vrows, linesIn = function(a, b){ var seen = {}; for (var r = a; r <= b; r++) if (vr[r]) seen[vr[r].line] = 1; return Object.keys(seen).length; };
266
+ this.markTop.textContent = w.top ? T.more(Math.max(1, linesIn(0, w.f - 1))) : ""; set(this.markTop, "y", G.firstY); set(this.markTop, "opacity", w.top ? fade.toFixed(3) : 0);
267
+ this.markBottom.textContent = w.bottom ? T.more(Math.max(1, linesIn(w.l + 1, vr.length - 1))) : ""; set(this.markBottom, "y", slotY(w.l + 1)); set(this.markBottom, "opacity", w.bottom ? fade.toFixed(3) : 0);
268
+ // 今の行の地:同じ表示する範囲の中なら前の行から滑らせる
269
+ var sp1 = i >= 0 ? this.spans[i] : null, sp0 = i >= 1 ? this.spans[i - 1] : null;
270
+ if (sp1){
271
+ var top1 = slotY(sp1[0], w1) - G.fs, h1 = (sp1[1] - sp1[0] + 1) * G.row, top = top1, h = h1, op = 1;
272
+ if (!moving && sp0){ var top0 = slotY(sp0[0], w0) - G.fs, h0 = (sp0[1] - sp0[0] + 1) * G.row; top = base.lerp(top0, top1, e); h = base.lerp(h0, h1, e); }
273
+ else if (moving) op = e < 0.5 ? 0 : fade;
274
+ else op = e;
275
+ set(this.band, "y", +top.toFixed(1)); set(this.band, "height", +h.toFixed(1)); set(this.band, "opacity", op.toFixed(3));
276
+ } else { set(this.band, "y", G.header); set(this.band, "height", G.row); set(this.band, "opacity", 0); }
277
+ this.notes.forEach(function(g, j){ set(g, "opacity", j === i ? (i >= 1 && st[i - 1].note === st[i].note ? 1 : e).toFixed(3) : 0); });
278
+ this.counter.textContent = (i + 1) + " / " + st.length;
279
+ // 変数:その時点の値。変わった変数は字と地と太字で
280
+ var slot = 0, vars = cur ? cur.vars : {};
281
+ this.names.forEach(function(k){
282
+ if (!(k in vars)) return;
283
+ var ch = cur.changed.indexOf(k) >= 0, vx = monoWidth(k + " = ", G.fs);
284
+ rowsOf(vars[k], py).forEach(function(txt, r){
285
+ var o = self.varSlots[slot++]; if (!o) return;
286
+ o.name.textContent = r ? "" : k + " = ";
287
+ set(o.value, "x", +(G.rx + G.pad + vx).toFixed(1));
288
+ o.value.textContent = cut(txt, G.rightW - 2 * G.pad - vx, G.fs);
289
+ set(o.value, "style", "font-family:" + MONO + ";white-space:pre;fill:var(--" + (ch ? "emph" : "fg") + ")" + (ch ? ";font-weight:700" : ""));
290
+ set(o.bg, "opacity", ch ? e.toFixed(3) : 0);
291
+ });
292
+ });
293
+ for (; slot < this.varSlots.length; slot++){ var o = this.varSlots[slot]; o.name.textContent = ""; o.value.textContent = ""; set(o.value, "x", G.rx + G.pad + G.nameW); set(o.value, "style", "font-family:" + MONO + ";white-space:pre;fill:var(--fg)"); set(o.bg, "opacity", 0); }
294
+ // 出力:その時点までの出力。入らなければ新しい行を残し、上に「…(前の n 行)」
295
+ var L = i >= 0 ? this.acc[i] : [], n = this.outLabels.length, from = L.length > n ? L.length - n + 1 : 0;
296
+ var newFrom = i >= 1 ? this.acc[i - 1].length : 0;
297
+ this.outLabels.forEach(function(lab, j){
298
+ var idx = from ? from + j - 1 : j, txt = from && j === 0 ? T.older(from) : idx < L.length ? cut(L[idx].replace(/\t/g, " "), G.rightW - 2 * G.pad, G.fs) : "";
299
+ lab.textContent = txt;
300
+ set(lab, "opacity", !(from && j === 0) && idx >= newFrom && idx < L.length ? e.toFixed(3) : 1);
301
+ set(lab, "style", "font-family:" + MONO + ";white-space:pre;fill:var(--" + (from && j === 0 ? "muted" : "fg") + ")");
302
+ });
303
+ }
304
+ };
305
+ });
@@ -0,0 +1,31 @@
1
+ ---
2
+ summary: 2-axis positioning map (4 quadrants); points one per step
3
+ steps: largest step / to.step (1 point = 1 step)
4
+ props:
5
+ fade: point appear (s)
6
+ move: to move (s)
7
+ size: label px
8
+ quads-step: quadrant-name step (0 = start)
9
+ example: {"x": {"lo": "Manual", "hi": "Auto"}, "y": {"lo": "Costly", "hi": "Cheap"}, "items": [{"label": "Co. A", "x": 0.25, "y": 0.7}, {"label": "Us", "x": 0.8, "y": 0.82, "self": true}]}
10
+ ---
11
+
12
+ Positioning, effect×effort, SWOT: show the empty space.
13
+
14
+ Child JSON: `{"x": {"lo", "hi"}, "y": {"lo", "hi"}, "quads": {"tr", "tl", "bl", "br", "fill"}, "items": [...]}`.
15
+
16
+ - `x` `y`: axis end words (step 0)
17
+ - `quads`: names (tr = top-right, tl, bl, br); `fill: "tr"` tints one; names at `quads-step`
18
+ - item: `label`, `x` `y` (0–1; 0.5 = axis cross), `step` (default next), `at`, `tone` (`term`/`fg`; default muted), `anchor` (`right`, `left`, `above`, `below`), `r`
19
+ - `self: true`: big `--emph` point, ring pulse
20
+ - `to: {"x", "y", "label", "step", "at"}`: slides at `to.step` (default next), dashed trail; `label` on arrival
21
+ - `cues(k)`: start times of 2nd+ points in a step, for `{cue}`
22
+
23
+ The demo is `demo.html`. Names and positions are fictional.
24
+
25
+ Notes
26
+
27
+ <!-- llm: omit -->
28
+ - Labels crossing an axis move: opposite side → above → below (start and `to`; even with `anchor`). Axis lines have `class="axis"`; `tools/test-components.mjs` flags crossings
29
+ <!-- llm: end -->
30
+ - Quadrant names avoid points and labels (else labels move, or `ctx.report`)
31
+ - Label overlaps not fixed: change `anchor` or shift
@@ -0,0 +1,236 @@
1
+ // m-quad:2 軸の位置づけ(ポジショニングマップ・SWOT 風の 4 象限)。点を段階ごとに 1 つずつ置く
2
+ // <m-quad style="height:420px"><script type="application/json">
3
+ // {"x": {"lo": "手作業", "hi": "自動"}, "y": {"lo": "高い", "hi": "安い"},
4
+ // "quads": {"tr": "狙う場所", "tl": "", "bl": "", "br": ""},
5
+ // "items": [{"label": "A 社", "x": 0.25, "y": 0.7}, {"label": "自社", "x": 0.8, "y": 0.82, "self": true, "to": {"x": 0.9, "y": 0.9, "label": "3 年後"}}]}
6
+ // (JSON の終わり)</m-quad>
7
+ // 座標は 0〜1(0.5 が軸の交わるところ)。軸と両端の言葉は段階 0 から見える。象限の名前は quads-step(既定 0)で出る
8
+ // 点は既定で 1 つ = 1 段階(step で直接、at で段階の中の開始秒)。self の点は強調の色で大きく、着いたときに輪が広がる
9
+ // to は移動先:to.step(既定は点の次の段階)に、点が破線の跡を引きながら滑る
10
+ // 2.0(Egatari spec §6.1 の部品):base の MotionElement・el・prog・lerp・clamp・previewOpacity を使い、プレイヤーのグローバルは使わない
11
+ egatariParts.define({name: "quad", version: "2.1.2", requires: {base: "1.3.0"}, element: "m-quad"}, function(deps){
12
+ "use strict";
13
+ var base = deps.base;
14
+ return class extends base.MotionElement {
15
+ static partName = "quad"; // the registry name (define meta name), for report prefixes
16
+ // データの形(kit/shape.js)。x・y は 0〜1(0.5 が軸の交わるところ)
17
+ static shape = {
18
+ schema: {type: "object", additionalProperties: false, required: ["items"], properties: {
19
+ x: {type: "object", properties: {lo: {type: "string"}, hi: {type: "string"}}}, y: {type: "object", properties: {lo: {type: "string"}, hi: {type: "string"}}},
20
+ quads: {type: "object", properties: {tr: {type: "string"}, tl: {type: "string"}, bl: {type: "string"}, br: {type: "string"}, fill: {type: "string"}}},
21
+ items: {type: "array", minItems: 1, items: {type: "object", required: ["x", "y"], properties: {
22
+ label: {type: "string"}, x: {type: "number"}, y: {type: "number"}, step: {type: "integer"}, at: {type: "number"}, tone: {type: "string"}, anchor: {enum: ["right", "left", "above", "below"]},
23
+ r: {type: "number"}, self: {type: "boolean"}, to: {type: "object", required: ["x", "y"], properties: {x: {type: "number"}, y: {type: "number"}, label: {type: "string"}, step: {type: "integer"}, at: {type: "number"}}}}}}}},
24
+ example: {x: {lo: "手作業", hi: "自動"}, y: {lo: "高い", hi: "安い"}, items: [{label: "A 社", x: 0.25, y: 0.7}, {label: "自社", x: 0.8, y: 0.82, self: true}]},
25
+ };
26
+ static props = {
27
+ fade: {type: "number", default: 0.5, doc: "点が現れる秒数"},
28
+ move: {type: "number", default: 1.2, doc: "to の移動の秒数"},
29
+ size: {type: "number", default: 26, doc: "点の名前の字の大きさ(px)"},
30
+ "quads-step": {type: "number", default: 0, doc: "象限の名前を出すステップ(0 = 初めから)"},
31
+ };
32
+ get steps(){
33
+ if (this.getAttribute("steps") !== null) return +this.getAttribute("steps");
34
+ var m = this.props["quads-step"];
35
+ this.plan().forEach(function(o){ m = Math.max(m, o.step, o.to ? o.to.step : 0); });
36
+ return m;
37
+ }
38
+ // 点の段階と開始時刻(データだけから決める)
39
+ plan(){
40
+ if (this._plan) return this._plan;
41
+ var d = this.data || {}, q0 = this.props["quads-step"], n = 0, seen = {};
42
+ return (this._plan = (d.items || []).map(function(it){
43
+ var step = it.step !== undefined ? it.step : q0 + (++n);
44
+ n = Math.max(n, step - q0);
45
+ var j = seen[step] = (seen[step] || 0) + 1;
46
+ var to = it.to ? {x: it.to.x, y: it.to.y, label: it.to.label || "", step: it.to.step !== undefined ? it.to.step : step + 1, at: it.to.at || 0} : null;
47
+ return {it: it, step: step, at: it.at !== undefined ? it.at : (j - 1) * 0.6, to: to};
48
+ }));
49
+ }
50
+ mount(ctx){
51
+ var P = this.props, D = base, self = this, d = this.data || {};
52
+ this.style.display = "block"; this.style.position = "relative";
53
+ var W = this.clientWidth, H = this.clientHeight;
54
+ var svg = D.el("svg", {viewBox: "0 0 " + W + " " + H, width: W, height: H, "aria-hidden": "true", style: "display:block;overflow:visible"}, this);
55
+ // 読み上げ:最後の形(点はすべて置かれ、to の点は行き先にいる)を 1 文で。作者の aria-label があればそれを使う(上書きしない)
56
+ if (this._aria === undefined) this._aria = this.getAttribute("aria-label");
57
+ this.setAttribute("role", "img");
58
+ if (!this._aria) this.setAttribute("aria-label", this.summary(/^ja\b/i.test(ctx.lang || "ja")));
59
+ // 図の枠:両端の言葉の分だけ上下と左右に余白
60
+ var m = {l: 12, r: 12, t: 40, b: 40};
61
+ var x0 = m.l, x1 = W - m.r, y0 = m.t, y1 = H - m.b, cx = (x0 + x1) / 2, cy = (y0 + y1) / 2;
62
+ this.X = function(v){ return x0 + v * (x1 - x0); };
63
+ this.Y = function(v){ return y1 - v * (y1 - y0); };
64
+ // 象限の地(右上だけ淡く塗れる:quads.fill = "tr" など)と名前
65
+ var q = d.quads || {}, xa0 = d.x || {}, gQ = D.el("g", {}, svg);
66
+ this.quadG = D.el("g", {}, svg);
67
+ var corner = {tr: [cx, y0, x1 - cx, cy - y0, x1 - 16, y0 + 34, "end"], tl: [x0, y0, cx - x0, cy - y0, x0 + 16, y0 + 34, "start"],
68
+ bl: [x0, cy, cx - x0, y1 - cy, x0 + 16, y1 - 16, "start"], br: [cx, cy, x1 - cx, y1 - cy, x1 - 16, y1 - 16, "end"]};
69
+ ["tr", "tl", "bl", "br"].forEach(function(key){
70
+ var c = corner[key];
71
+ if (q.fill === key) D.el("rect", {x: c[0], y: c[1], width: Math.max(0, c[2]), height: Math.max(0, c[3]), fill: "var(--term-tint)"}, gQ);
72
+ });
73
+ // 軸(両向きの矢印)と両端の言葉。横軸の言葉は軸の下、縦軸の言葉は軸の上端・下端の外
74
+ var ax = D.el("g", {}, svg), K = "var(--fg)";
75
+ D.el("line", {x1: x0, y1: cy, x2: x1, y2: cy, stroke: K, "stroke-width": 2, class: "axis"}, ax);
76
+ D.el("line", {x1: cx, y1: y0, x2: cx, y2: y1, stroke: K, "stroke-width": 2, class: "axis"}, ax);
77
+ [[x1, cy, 0], [x0, cy, 180], [cx, y0, -90], [cx, y1, 90]].forEach(function(a){
78
+ D.el("path", {d: "M0,0L-14,-7L-14,7Z", fill: K, transform: "translate(" + a[0] + " " + a[1] + ") rotate(" + a[2] + ")"}, ax);
79
+ });
80
+ var xa = xa0, ya = d.y || {};
81
+ if (xa.lo) D.mtext(ax, x0 + 4, cy + 34, xa.lo, {"text-anchor": "start", "font-size": 24});
82
+ if (xa.hi) D.mtext(ax, x1 - 4, cy + 34, xa.hi, {"text-anchor": "end", "font-size": 24});
83
+ if (ya.hi) D.mtext(ax, cx, y0 - 14, ya.hi, {"text-anchor": "middle", "font-size": 24});
84
+ if (ya.lo) D.mtext(ax, cx, y1 + 32, ya.lo, {"text-anchor": "middle", "font-size": 24});
85
+ // 点の名前の置き場所(既定は右。anchor で left / above / below)。
86
+ // 名前が軸の線を横切るなら、丸の反対の側 → 上 → 下の順に置き直す(点の始めの位置と to の位置の両方で確かめる)。
87
+ // 象限の名前を置いたあとは、その名前にかかる置き場所も避ける。幅は字から見積もる(base の textWidth:テーマの字で測った幅。mtext の *_^ は数えない)
88
+ var est = function(s, z){ return D.textWidth(s || "", z, {font: self, mark: true}); };
89
+ var meet = function(a, b, gp){ return a[0] < b[2] + gp && a[2] > b[0] - gp && a[1] < b[3] + gp && a[3] > b[1] - gp; };
90
+ var items = this.plan().map(function(o){
91
+ var it = o.it, me = !!it.self, r = it.r || (me ? 14 : 11), off = r + 10, w = est(it.label, P.size);
92
+ var place = function(an){ return an === "left" ? [-off, 9, "end"] : an === "above" ? [0, -off - 4, "middle"] : an === "below" ? [0, off + 22, "middle"] : [off, 9, "start"]; };
93
+ var boxAt = function(an, px, py){
94
+ var lp = place(an), lx = px + lp[0], ly = py + lp[1], a0 = lp[2] === "start" ? lx : lp[2] === "end" ? lx - w : lx - w / 2;
95
+ return [a0, ly - P.size * 0.88, a0 + w, ly + P.size * 0.22];
96
+ };
97
+ var crosses = function(an, px, py){
98
+ var b = boxAt(an, px, py);
99
+ return (b[0] - 6 < cx && b[2] + 6 > cx && b[1] < y1 && b[3] > y0) || (b[1] - 6 < cy && b[3] + 6 > cy && b[0] < x1 && b[2] > x0);
100
+ };
101
+ var pts = [[self.X(it.x), self.Y(it.y)]].concat(o.to ? [[self.X(o.to.x), self.Y(o.to.y)]] : []);
102
+ var pref = it.anchor || "right", order = [pref, pref === "left" ? "right" : pref === "right" ? "left" : pref === "above" ? "below" : "above", "above", "below", "left", "right"];
103
+ var pick = function(names){
104
+ return order.filter(function(a){ return !pts.some(function(q){ return crosses(a, q[0], q[1]) || names.some(function(nb){ return meet(boxAt(a, q[0], q[1]), nb, 6); }); }); })[0];
105
+ };
106
+ var an = pick([]) || pref;
107
+ return {o: o, it: it, me: me, r: r, pts: pts, place: place, boxAt: boxAt, pick: pick, an: an,
108
+ // 丸と名前が占める箱(点の始めと to の位置)
109
+ boxes: function(a){ return [].concat.apply([], pts.map(function(q){ return [[q[0] - r, q[1] - r, q[0] + r, q[1] + r], boxAt(a, q[0], q[1])]; })); }};
110
+ });
111
+ // 象限の名前:隅(外側の角)に置く。点や点の名前、軸の言葉にかかるなら、同じ象限の残りの 3 つの隅を順に試す。
112
+ // どこもかかるなら外側の角に置き、点の名前のほうを動かす(上の pick)。動かせなければ知らせる(layout)
113
+ var axisBoxes = [];
114
+ if (xa0.lo) axisBoxes.push([x0 + 4, cy + 34 - 24 * 0.88, x0 + 4 + est(xa0.lo, 24), cy + 34 + 24 * 0.22]);
115
+ if (xa0.hi) axisBoxes.push([x1 - 4 - est(xa0.hi, 24), cy + 34 - 24 * 0.88, x1 - 4, cy + 34 + 24 * 0.22]);
116
+ var names = [];
117
+ ["tr", "tl", "bl", "br"].forEach(function(key){
118
+ if (!q[key]) return;
119
+ var c = corner[key], top = key[0] === "t", right = key[1] === "r", w = est(q[key], 26);
120
+ var ins = [c[0] + 16, c[0] + c[2] - 16], ys = top ? [y0 + 34, cy - 16] : [y1 - 16, cy + 42];
121
+ var cand = [[right ? ins[1] : ins[0], ys[0], right ? "end" : "start"], [right ? ins[0] : ins[1], ys[0], right ? "start" : "end"],
122
+ [right ? ins[1] : ins[0], ys[1], right ? "end" : "start"], [right ? ins[0] : ins[1], ys[1], right ? "start" : "end"]];
123
+ var boxOf = function(k){ var x = k[2] === "end" ? k[0] - w : k[0]; return [x, k[1] - 26 * 0.88, x + w, k[1] + 26 * 0.22]; };
124
+ var busy = function(b){ return axisBoxes.some(function(a){ return meet(b, a, 6); }) || items.some(function(m){ return m.boxes(m.an).some(function(a){ return meet(b, a, 6); }); }); };
125
+ var k = cand.filter(function(k){ return !busy(boxOf(k)); })[0] || cand[0];
126
+ D.mtext(self.quadG, k[0], k[1], q[key], {"text-anchor": k[2], "font-size": 26, "font-weight": 700, fill: q.fill === key ? "var(--term)" : "var(--muted)"});
127
+ names.push({key: key, box: boxOf(k)});
128
+ });
129
+ items.forEach(function(m){
130
+ if (!names.length || !m.boxes(m.an).some(function(a){ return names.some(function(nm){ return meet(a, nm.box, 6); }); })) return;
131
+ var a = m.pick(names.map(function(nm){ return nm.box; }));
132
+ if (a) m.an = a;
133
+ else ctx.report("layout", "[quad] the label " + JSON.stringify(m.it.label || "") + " overlaps a quadrant name and has no free side; move the point or shorten a name");
134
+ });
135
+ // 点:丸と名前
136
+ var gT = D.el("g", {}, svg), gP = D.el("g", {}, svg);
137
+ // data-part:Studio の形の検査(geometry check)が測る印。点の丸は mark(id は items の並びで p1, p2 …)、点の名前と行き先の名前は
138
+ // その点の label(箱の外の字)、動いた跡は p<n> から @moved への edge(破線が data-part-line、矢じりは端)
139
+ this.pts = items.map(function(m, i){
140
+ var o = m.o, it = m.it, me = m.me, r = m.r, col = me ? "var(--emph)" : it.tone === "term" ? "var(--term)" : it.tone === "fg" ? "var(--fg)" : "var(--muted)";
141
+ var pid = "p" + (i + 1), lb = {"data-part": "label", "data-part-id": pid, "data-part-of": "mark", "data-part-at": "outside"};
142
+ var gM = o.to ? D.el("g", {"data-part": "edge", "data-part-id": pid + "\u2192@moved", "data-part-from": pid, "data-part-to": "@moved"}, gT) : null;
143
+ var trail = o.to ? D.el("line", {stroke: col, "stroke-width": 2.5, "stroke-dasharray": "7 6", opacity: 0, "data-part-line": ""}, gM) : null;
144
+ // 動いた跡の印(最後の形にも残す):出発点の白抜きの丸と、行き先へ向く矢じり(丸の手前)
145
+ var from = o.to ? D.el("circle", {cx: self.X(it.x).toFixed(2), cy: self.Y(it.y).toFixed(2), r: (r * 0.8).toFixed(1), fill: "var(--bg)", stroke: col, "stroke-width": 2.5, opacity: 0}, gT) : null;
146
+ var head = o.to ? D.el("path", {d: "M0,0L-14,-7L-14,7Z", fill: col, opacity: 0}, gM) : null;
147
+ var ring = me ? D.el("circle", {r: r, fill: "none", stroke: col, "stroke-width": 3, opacity: 0}, gP) : null;
148
+ var g = D.el("g", {opacity: 0}, gP);
149
+ D.el("circle", {cx: 0, cy: 0, r: r, fill: col, stroke: "var(--bg)", "stroke-width": 2.5, "data-part": "mark", "data-part-id": pid}, g);
150
+ var lp = m.place(m.an);
151
+ D.mtext(g, lp[0], lp[1], it.label || "", Object.assign({"text-anchor": lp[2], "font-size": P.size, "font-weight": me ? 700 : 400, fill: me ? col : "var(--fg)"}, lb));
152
+ var lab2 = o.to && o.to.label ? D.mtext(gP, 0, 0, o.to.label, Object.assign({"text-anchor": "middle", "font-size": 24, fill: col, opacity: 0}, lb)) : null;
153
+ return {o: o, g: g, ring: ring, r: r, trail: trail, from: from, head: head, lab2: lab2};
154
+ });
155
+ }
156
+ // 最後の形を 1 文で(読み上げの名前):象限の名前と、点ごとの最後の位置(右上・左下など。to の点は出発点から行き先へ)
157
+ summary(ja){
158
+ var d = this.data || {}, q = d.quads || {}, xa = d.x || {}, ya = d.y || {};
159
+ var where = function(x, y, bare){
160
+ var h = x > 0.5 ? (ja ? "右" : "right") : x < 0.5 ? (ja ? "左" : "left") : "", v = y > 0.5 ? (ja ? "上" : "upper") : y < 0.5 ? (ja ? "下" : "lower") : "";
161
+ var key = (y > 0.5 ? "t" : "b") + (x > 0.5 ? "r" : "l");
162
+ var s = ja ? (h + v || "中央") : ([v, h].filter(Boolean).join(" ") || "centre");
163
+ return s + (h && v && q[key] && !bare ? (ja ? "(" + q[key] + ")" : " (" + q[key] + ")") : "");
164
+ };
165
+ var axis = function(a, n){ return a.lo || a.hi ? (ja ? n + ":" + (a.lo || "") + "→" + (a.hi || "") : n + ": " + (a.lo || "") + " to " + (a.hi || "")) : ""; };
166
+ var ax = [axis(xa, ja ? "横" : "x"), axis(ya, ja ? "縦" : "y")].filter(Boolean).join(ja ? "、" : "; ");
167
+ var pts = this.plan().map(function(o){
168
+ var it = o.it, nm = it.label || (ja ? "点" : "a point");
169
+ if (!o.to) return ja ? nm + "は" + where(it.x, it.y) : nm + " is " + where(it.x, it.y);
170
+ var lb = o.to.label ? (ja ? "(" + o.to.label + ")" : " (" + o.to.label + ")") : "", w0 = where(it.x, it.y), w1 = where(o.to.x, o.to.y, true);
171
+ // 同じ象限の中の移動なら、行き先に象限の名前を繰り返さない
172
+ if (w1 !== where(it.x, it.y, true)) w1 = where(o.to.x, o.to.y);
173
+ return ja ? nm + "は" + w0 + "から" + w1 + "へ" + lb : nm + " moves from " + w0 + " to " + w1 + lb;
174
+ });
175
+ return (ja ? "4 象限" : "Four quadrants") + (ax ? (ja ? "(" + ax + ")" : " (" + ax + ")") : "") + (ja ? ":" : ": ") + pts.join(ja ? "、" : ", ");
176
+ }
177
+ duration(k){
178
+ var P = this.props, d = k === P["quads-step"] && k > 0 ? P.fade : 0;
179
+ this.plan().forEach(function(o){
180
+ if (o.step === k) d = Math.max(d, o.at + P.fade + (o.it.self ? 0.6 : 0));
181
+ if (o.to && o.to.step === k) d = Math.max(d, o.to.at + P.move + 0.3);
182
+ });
183
+ return d;
184
+ }
185
+ // 同じ段階に 2 つ以上の点があれば、2 つ目からの開始時刻を口述原稿の {cue} に合わせられる
186
+ cues(k){
187
+ var c = [];
188
+ this.plan().forEach(function(o){ if (o.step === k && o.at > 0) c.push(o.at); });
189
+ return c.length ? c.sort(function(a, b){ return a - b; }) : null;
190
+ }
191
+ render(k, t, ctx){
192
+ var P = this.props, D = base, self = this;
193
+ // 先の段階を薄く見せる表示(授業の表示):後の段階の点(動いた後の位置)・動く跡・行き先の名前・象限の名前を、
194
+ // テーマの --preview-opacity の濃さに。今の段階に出ている点は元の位置のまま
195
+ var preview = !!ctx.preview, PV = preview ? base.previewOpacity(this) : 1;
196
+ var pr = function(step, at, dur){ return step < k ? 1 : step > k ? 0 : D.prog(t, at, dur); };
197
+ var qs = P["quads-step"];
198
+ this.quadG.setAttribute("opacity", (qs === 0 ? 1 : preview && qs > k ? PV : pr(qs, 0, P.fade)).toFixed(3));
199
+ this.pts.forEach(function(p){
200
+ var o = p.o, e = pr(o.step, o.at, P.fade), fp = preview && o.step > k, fm = preview && o.to && o.to.step > k;
201
+ var m = o.to ? (fp ? 1 : pr(o.to.step, o.to.at, P.move)) : 0;
202
+ if (fp) e = 1;
203
+ var x0 = self.X(o.it.x), y0 = self.Y(o.it.y);
204
+ var x = o.to ? D.lerp(x0, self.X(o.to.x), m) : x0, y = o.to ? D.lerp(y0, self.Y(o.to.y), m) : y0;
205
+ var s = D.lerp(0.6, 1, e);
206
+ p.g.setAttribute("opacity", fp ? PV.toFixed(3) : e.toFixed(3));
207
+ p.g.setAttribute("transform", "translate(" + x.toFixed(2) + " " + y.toFixed(2) + ") scale(" + s.toFixed(4) + ")");
208
+ // 自社の点:着いたときに輪が 1 回広がって消える(最終状態では出さない)
209
+ if (p.ring){
210
+ var rt = !fp && o.step === k && t !== Infinity ? D.clamp((t - o.at - P.fade * 0.6) / 0.8) : 1;
211
+ p.ring.setAttribute("cx", x.toFixed(2)); p.ring.setAttribute("cy", y.toFixed(2));
212
+ p.ring.setAttribute("r", (p.r * (1 + 1.6 * rt)).toFixed(2));
213
+ p.ring.setAttribute("opacity", (rt > 0 && rt < 1 ? 0.8 * (1 - rt) : 0).toFixed(3));
214
+ }
215
+ if (p.trail){
216
+ p.trail.setAttribute("x1", x0.toFixed(2)); p.trail.setAttribute("y1", y0.toFixed(2));
217
+ p.trail.setAttribute("x2", x.toFixed(2)); p.trail.setAttribute("y2", y.toFixed(2));
218
+ if (fm){ p.trail.setAttribute("x2", self.X(o.to.x).toFixed(2)); p.trail.setAttribute("y2", self.Y(o.to.y).toFixed(2)); }
219
+ p.trail.setAttribute("opacity", fm ? PV : m > 0 ? 0.9 : 0);
220
+ // 出発点の丸は跡と同じ濃さ。矢じりは今の点の丸の手前(丸の縁から 3px)に、跡が丸と出発点の丸の外に出ている長さがあるときだけ
221
+ var hx = fm ? self.X(o.to.x) : x, hy = fm ? self.Y(o.to.y) : y, len = Math.hypot(hx - x0, hy - y0), ho = fm ? PV : m > 0 ? 0.9 : 0;
222
+ p.from.setAttribute("opacity", ho);
223
+ if (len > p.r * 1.8 + 3 + 14 + 4){
224
+ var ux = (hx - x0) / len, uy = (hy - y0) / len, tip = p.r * s + 3;
225
+ p.head.setAttribute("transform", "translate(" + (hx - ux * tip).toFixed(2) + " " + (hy - uy * tip).toFixed(2) + ") rotate(" + (Math.atan2(uy, ux) * 180 / Math.PI).toFixed(1) + ")");
226
+ p.head.setAttribute("opacity", ho);
227
+ } else { p.head.removeAttribute("transform"); p.head.setAttribute("opacity", 0); } // 作った直後と同じ(呼ぶ順で DOM が変わらない)
228
+ }
229
+ if (p.lab2){
230
+ p.lab2.setAttribute("x", self.X(o.to.x).toFixed(2)); p.lab2.setAttribute("y", (self.Y(o.to.y) - p.r - 14).toFixed(2));
231
+ p.lab2.setAttribute("opacity", fm ? PV.toFixed(3) : pr(o.to.step, o.to.at + P.move * 0.8, 0.3).toFixed(3));
232
+ }
233
+ });
234
+ }
235
+ };
236
+ });
@@ -0,0 +1,21 @@
1
+ ---
2
+ summary: A checklist: items listed, one mark (✓ or ×) drawn per step. The marks are slide content; nothing a viewer does is stored
3
+ steps: max item step (default 1 item = 1 step)
4
+ props:
5
+ reveal: items appear with their step
6
+ per-step: items per step (0 = all)
7
+ dur: mark-drawing seconds
8
+ stagger: mark offset (s)
9
+ size: label px (≥ 24)
10
+ example: {"items": [{"label": "Name badge on"}, {"label": "Hands washed", "note": "30 s"}]}
11
+ ---
12
+
13
+ For checks done one at a time: training steps, checks before work, what to bring.
14
+
15
+ Child JSON: `{"items": [...]}`.
16
+
17
+ - item: `label` (`\n` = 2 lines), `note`, `mark` (`check`, `cross`, `none`), `step`, `at`
18
+ - The marks are the author's; a viewer cannot tick them and nothing is stored.
19
+ <!-- llm: omit -->
20
+ - ✓ is `--term`, × is `--emph`, drawn stroke by stroke. Items that do not fit are reported as size.
21
+ <!-- llm: end -->