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,228 @@
1
+ // m-tape:テープ図・線分図。行の長さは全部の行で同じ尺度。全体や部分を括る括弧と名前、行から行への「2 倍」の矢印
2
+ // <m-tape style="height:360px">
3
+ // <script type="application/json">{"rows": [{"label": "みかん", "segs": [{"v": 8, "label": "食べた 8 こ"}, {"v": 15, "label": "のこり 15 こ"}]}],
4
+ // "brace": [{"row": 0, "from": 0, "to": 1, "label": "はじめ □ こ", "side": "above"}]}
5
+ // (JSON の終わり)</m-tape>
6
+ // 段階:build="steps"(既定)は 行を 1 つずつ → 括弧を 1 つずつ → 倍の矢印を 1 つずつ。build="rows" は行を 1 つずつ(括弧と矢印はその行と)、
7
+ // build="whole" は全部を 1 段階で。項目の show で段階を指定できる
8
+ // kind="tape"(既定、テープ図)か "line"(線分図)
9
+ // 見せ方(docs/conventions.md §1):fade(フェード、既定)・grow(テープが左から伸び、括弧と矢印は線を引く)
10
+ // 2.0(Egatari spec §6.1 の部品):base の MotionElement・el・mtext・prog・variant・previewOpacity を使い、プレイヤーのグローバルは使わない。
11
+ // データや大きさの問題は ctx.report で知らせる(1.x の console.warn の代わり)
12
+ egatariParts.define({name: "tape", version: "2.0.5", requires: {base: "1.3.0"}, element: "m-tape"}, function(deps){
13
+ "use strict";
14
+ var base = deps.base;
15
+ // 字の幅(base の textWidth:font の要素の字で測った幅。字は mtext で書くので *_^ は数えない)
16
+ var est = function(s, size, font){ return base.textWidth(s, size, {font: font, mark: true}); };
17
+ var TONES = /^(term|emph|muted|accent2|fg|series-[1-4])$/;
18
+ var UNK = ["?", "□"];
19
+ return class extends base.MotionElement {
20
+ static partName = "tape"; // the registry name (define meta name), for report prefixes
21
+ static variants = ["fade", "grow"];
22
+ static shape = {
23
+ schema: {type: "object", additionalProperties: false, required: ["rows"], properties: {
24
+ rows: {type: "array", minItems: 1, items: {type: "object", additionalProperties: false, required: ["segs"], properties: {
25
+ label: {type: "string"}, tone: {type: "string"}, show: {type: "integer"},
26
+ segs: {type: "array", minItems: 1, items: {type: "object", additionalProperties: false, required: ["v"], properties: {
27
+ v: {type: "number"}, label: {type: "string"}, unknown: {type: "string"}}}}}}},
28
+ brace: {type: "array", items: {type: "object", additionalProperties: false, required: ["row", "from", "to"], properties: {
29
+ row: {type: "integer"}, from: {type: "integer"}, to: {type: "integer"}, label: {type: "string"}, side: {type: "string", enum: ["above", "below"]}, show: {type: "integer"}}}},
30
+ times: {type: "array", items: {type: "object", additionalProperties: false, required: ["from", "to"], properties: {
31
+ from: {type: "integer"}, to: {type: "integer"}, label: {type: "string"}, show: {type: "integer"}}}}}},
32
+ example: {rows: [{label: "みかん", segs: [{v: 8, label: "食べた 8 こ"}, {v: 15, label: "のこり 15 こ"}]}], brace: [{row: 0, from: 0, to: 1, label: "はじめ □ こ", side: "above"}]},
33
+ note: {en: "rows [{label, segs: [{v, label, unknown: \"?\" | \"□\"}]}]; brace [{row, from, to, label, side: above|below}] (from/to are segment numbers from 0); times [{from, to, label}] (row numbers)",
34
+ ja: "rows [{label, segs: [{v, label, unknown: \"?\" か \"□\"}]}]、brace [{row, from, to, label, side: above|below}](from・to は 0 から数えた区切りの番号)、times [{from, to, label}](行の番号)"},
35
+ };
36
+ static props = {
37
+ kind: {type: "string", default: "tape", doc: "tape(テープ図)か line(線分図)"},
38
+ build: {type: "string", default: "steps", doc: "steps(行・括弧・矢印を 1 つずつ)・rows(行を 1 つずつ。括弧と矢印はその行と)・whole(全部を 1 ステップで)"},
39
+ dur: {type: "number", default: 0.8, doc: "1 ステップの動きの秒数"},
40
+ };
41
+ get steps(){
42
+ if (this.getAttribute("steps") !== null) return +this.getAttribute("steps");
43
+ return this.plan().steps;
44
+ }
45
+ plan(){
46
+ if (this._plan) return this._plan;
47
+ var d = this.data || {}, P = this.props, notes = [];
48
+ var rows = d.rows.map(function(r, i){
49
+ r.segs.forEach(function(s){ if (s.unknown !== undefined && UNK.indexOf(s.unknown) < 0) notes.push('[tape] unknown "' + s.unknown + '" is not "?" or "□" ("?" is used)'); if (!(s.v > 0)) throw new Error("m-tape: a segment's v must be a positive number (" + s.v + ")"); });
50
+ return {i: i, o: r};
51
+ });
52
+ var R = rows.length;
53
+ var braces = (d.brace || []).filter(function(b){
54
+ if (b.row < 0 || b.row >= R){ notes.push("[tape] brace row " + b.row + " does not exist (ignored)"); return false; }
55
+ var n = rows[b.row].o.segs.length;
56
+ if (b.from < 0 || b.to >= n || b.from > b.to){ notes.push("[tape] brace from " + b.from + " to " + b.to + " is not a segment range of row " + b.row + " (0 to " + (n - 1) + ")"); return false; }
57
+ if (b.side !== undefined && b.side !== "above" && b.side !== "below"){ notes.push('[tape] brace side "' + b.side + '" is not above or below'); }
58
+ return true;
59
+ }).map(function(b){ return {o: b, row: b.row, side: b.side === "below" ? "below" : "above"}; });
60
+ var times = (d.times || []).filter(function(x){
61
+ var ok = x.from >= 0 && x.from < R && x.to >= 0 && x.to < R && x.from !== x.to;
62
+ if (!ok) notes.push("[tape] times from " + x.from + " to " + x.to + " needs two different rows (ignored)");
63
+ return ok;
64
+ }).map(function(x){ return {o: x}; });
65
+ var build = P.build;
66
+ if (["steps", "rows", "whole"].indexOf(build) < 0){ notes.push('[tape] build="' + build + '" is not steps, rows or whole (steps is used)'); build = "steps"; }
67
+ var sh = function(o){ return Number.isInteger(o.show) && o.show >= 1 ? o.show : null; };
68
+ var k = 0;
69
+ rows.forEach(function(r){ r.st = sh(r.o) || (build === "whole" ? 1 : ++k); });
70
+ braces.forEach(function(b){ b.st = sh(b.o) || (build === "whole" ? 1 : build === "rows" ? rows[b.row].st : ++k); });
71
+ times.forEach(function(x){ x.st = sh(x.o) || (build === "whole" ? 1 : build === "rows" ? Math.max(rows[x.o.from].st, rows[x.o.to].st) : ++k); });
72
+ var steps = Math.max.apply(null, [1].concat(rows.map(function(r){ return r.st; }), braces.map(function(b){ return b.st; }), times.map(function(x){ return x.st; })));
73
+ return (this._plan = {rows: rows, braces: braces, times: times, steps: steps, notes: notes});
74
+ }
75
+ duration(k){ return k >= 1 && k <= this.plan().steps ? this.props.dur : 0; }
76
+ // 最後の形を 1 文で(読み上げの名前):「テープ図:A 12 m、B 12 m+5 m、B 全体 □ m」。区切りは図に書く字(? □ と名前)を+でつなぎ、
77
+ // 字のない区切りは書かない。括弧は行の名前と括弧の名前、倍の矢印は「A→B 2 倍」
78
+ summary(ja, line){
79
+ var pl = this.plan(), rows = pl.rows, sep = ja ? "、" : ", ";
80
+ var segText = function(s){ return [s.unknown !== undefined ? (UNK.indexOf(s.unknown) >= 0 ? s.unknown : "?") : "", s.label || ""].filter(Boolean).join(" "); };
81
+ var name = function(i){ return rows[i].o.label || (ja ? (i + 1) + " 行目" : "row " + (i + 1)); };
82
+ var out = rows.map(function(r, i){
83
+ var segs = r.o.segs.map(segText).filter(Boolean);
84
+ return [r.o.label || (rows.length > 1 || !segs.length ? name(i) : ""), segs.join(ja ? "+" : " + ")].filter(Boolean).join(" ");
85
+ });
86
+ pl.braces.forEach(function(b){ if (b.o.label) out.push((rows[b.row].o.label || rows.length > 1 ? name(b.row) + " " : "") + b.o.label); });
87
+ pl.times.forEach(function(x){ out.push(name(x.o.from) + "→" + name(x.o.to) + (x.o.label ? " " + x.o.label : "")); });
88
+ return (line ? (ja ? "線分図" : "Line diagram") : (ja ? "テープ図" : "Tape diagram")) + (ja ? ":" : ": ") + out.join(sep);
89
+ }
90
+ mount(ctx){
91
+ var P = this.props, D = base, self = this, pl = this.plan();
92
+ this.variant = base.variant(this);
93
+ pl.notes.forEach(function(n){ ctx.report("data", n); });
94
+ var line = P.kind === "line";
95
+ if (P.kind !== "tape" && P.kind !== "line") ctx.report("data", '[tape] kind="' + P.kind + '" is not tape or line (tape is used)');
96
+ this.style.display = "block";
97
+ var W = this.clientWidth, H = this.clientHeight, dur = P.dur, grow = this.variant === "grow";
98
+ var svg = D.el("svg", {viewBox: "0 0 " + W + " " + H, width: W, height: H, "aria-hidden": "true", style: "display:block;overflow:visible"}, this);
99
+ // 読み上げ:最後の形(行ごとの区切り、括弧、倍の矢印)を 1 文で。作者の aria-label があればそれを使う(上書きしない)
100
+ if (this._aria === undefined) this._aria = this.getAttribute("aria-label");
101
+ this.setAttribute("role", "img");
102
+ if (!this._aria) this.setAttribute("aria-label", this.summary(/^ja\b/i.test(ctx.lang || "ja"), line));
103
+ var items = this.items = [];
104
+ var add = function(el, o){ o.el = el; items.push(o); return el; };
105
+ var FS = 24, ROW = 34, BR = 16, BLV = BR + 6 + ROW + 6;
106
+ var rows = pl.rows, labW = Math.max.apply(null, [0].concat(rows.map(function(r){ return r.o.label ? est(r.o.label, 26, self) : 0; })));
107
+ // 倍の矢印は行の左の端(どの行もそろう)を結ぶ。名前はその左に
108
+ var tW = pl.times.length ? Math.max.apply(null, pl.times.map(function(x){ return x.o.label ? est(x.o.label, 26, self) + 14 : 0; })) + 52 : 0;
109
+ var x0 = (labW ? labW + 28 : 8) + tW, labX = tW ? labW + 8 : x0 - 18; // 矢印があれば行の名前は左の列に
110
+ var mR = 10;
111
+ var maxT = Math.max.apply(null, rows.map(function(r){ return r.o.segs.reduce(function(a, s){ return a + s.v; }, 0); }));
112
+ var sc = (W - x0 - mR) / maxT;
113
+ // 区切りの中身(□ の枠・?・名前)と幅
114
+ var content = function(s){
115
+ var parts = [];
116
+ if (s.unknown !== undefined) parts.push(s.unknown === "□" ? {box: true, w: 30} : {t: "?", w: est("?", 28, self), q: true});
117
+ if (s.label) parts.push({t: s.label, w: est(s.label, FS, self)});
118
+ return {parts: parts, w: parts.reduce(function(a, p){ return a + p.w; }, 0) + 8 * Math.max(0, parts.length - 1)};
119
+ };
120
+ // 行ごとの寸法
121
+ rows.forEach(function(r){
122
+ var x = x0;
123
+ r.segs = r.o.segs.map(function(s){ var o = {s: s, x: x, w: s.v * sc, c: content(s)}; x += o.w; return o; });
124
+ r.end = x;
125
+ r.tapeH = line ? 24 : 52;
126
+ r.out = line ? r.segs.some(function(g){ return g.c.parts.length; }) : r.segs.some(function(g){ return g.c.parts.length && g.c.w + 14 > g.w; });
127
+ r.segs.forEach(function(g){ g.outside = line || g.c.w + 14 > g.w; });
128
+ var lv = function(side){
129
+ var bs = pl.braces.filter(function(b){ return b.row === r.i && b.side === side; });
130
+ bs.sort(function(a, b){ return (a.o.to - a.o.from) - (b.o.to - b.o.from); });
131
+ var placed = [];
132
+ bs.forEach(function(b){
133
+ var l = 0;
134
+ while (placed.some(function(p){ return p.lv === l && p.o.from <= b.o.to && b.o.from <= p.o.to; })) l++;
135
+ b.lv = l; placed.push(b);
136
+ });
137
+ return bs.length ? Math.max.apply(null, bs.map(function(b){ return b.lv; })) + 1 : 0;
138
+ };
139
+ r.upN = lv("above"); r.downN = lv("below");
140
+ r.above = (r.out ? ROW + 8 : 0) + r.upN * BLV;
141
+ r.below = r.downN * BLV;
142
+ r.h = r.above + r.tapeH + r.below;
143
+ });
144
+ var need = rows.reduce(function(a, r){ return a + r.h; }, 0) + 24 * (rows.length - 1) + 8;
145
+ if (need > H + 1) ctx.report("size", "[tape] the element (" + W + "×" + H + " px) is too small; it needs about " + Math.ceil(need) + " px of height");
146
+ var gap = rows.length > 1 ? Math.min(60, 24 + Math.max(0, H - need) / (rows.length + 1)) : 0;
147
+ var total = rows.reduce(function(a, r){ return a + r.h; }, 0) + gap * (rows.length - 1);
148
+ var y = Math.max(4, (H - total) / 2);
149
+ rows.forEach(function(r){ r.top = y + r.above; r.cy = r.top + r.tapeH / 2; y += r.h + gap; });
150
+ var gT = D.el("g", {}, svg), gS = D.el("g", {}, svg), gA = D.el("g", {}, svg), gX = D.el("g", {}, svg);
151
+ var drawContent = function(par, cx, base, c){
152
+ var x = cx - c.w / 2;
153
+ c.parts.forEach(function(p){
154
+ if (p.box) D.el("rect", {x: x.toFixed(1), y: (base - 25).toFixed(1), width: 30, height: 30, rx: 2, fill: "var(--bg)", stroke: "var(--fg)", "stroke-width": 2.5}, par);
155
+ else D.mtext(par, x + p.w / 2, base, p.t, {"text-anchor": "middle", "font-size": p.q ? 28 : FS, "font-weight": p.q ? 700 : 400, fill: "var(--fg)"});
156
+ x += p.w + 8;
157
+ });
158
+ };
159
+ rows.forEach(function(r, ri){
160
+ var col = TONES.test(r.o.tone || "") ? "var(--" + r.o.tone + ")" : "var(--series-" + (ri % 4 + 1) + ")", st = r.st, n = r.segs.length;
161
+ if (r.o.label) add(D.mtext(gX, labX, r.cy + 9, r.o.label, {"text-anchor": "end", "font-size": 26, "font-weight": 700, fill: "var(--fg)", opacity: 0}), {st: st, at: 0, len: dur * 0.5, kind: "fade"});
162
+ r.segs.forEach(function(g, j){
163
+ var at = grow ? dur * 0.75 * j / n : 0, len = grow ? dur * 0.75 / n : dur * 0.7;
164
+ if (!line){
165
+ var rect = D.el("rect", {x: g.x.toFixed(1), y: r.top.toFixed(1), width: Math.max(0, g.w).toFixed(1), height: r.tapeH, fill: col, "fill-opacity": 0.14, stroke: "var(--fg)", "stroke-width": 2.5, opacity: 0}, gS);
166
+ add(rect, {st: st, at: at, len: len, kind: "seg", w: g.w});
167
+ } else {
168
+ add(D.el("line", {x1: g.x.toFixed(1), x2: (g.x + g.w).toFixed(1), y1: r.cy.toFixed(1), y2: r.cy.toFixed(1), stroke: col, "stroke-width": 4, opacity: 0}, gS), {st: st, at: at, len: len, kind: "line"});
169
+ [g.x, g.x + g.w].forEach(function(x, e){
170
+ if (e === 0 && j > 0) return;
171
+ add(D.el("line", {x1: x.toFixed(1), x2: x.toFixed(1), y1: (r.cy - 12).toFixed(1), y2: (r.cy + 12).toFixed(1), stroke: "var(--fg)", "stroke-width": 3, opacity: 0}, gS), {st: st, at: grow ? (e ? at + len * 0.8 : at) : 0, len: grow ? dur * 0.15 : dur * 0.7, kind: "fade"});
172
+ });
173
+ }
174
+ if (g.c.parts.length){
175
+ var cg = D.el("g", {opacity: 0}, gT), base = g.outside ? r.top - 8 - ROW + 25 : r.cy + 9;
176
+ var cx = Math.max(x0 + g.c.w / 2, Math.min(W - g.c.w / 2 - 2, g.x + g.w / 2));
177
+ drawContent(cg, cx, base, g.c);
178
+ add(cg, {st: st, at: grow ? at + len * 0.6 : dur * 0.2, len: grow ? Math.max(0.15, dur * 0.25) : dur * 0.5, kind: "fade"});
179
+ }
180
+ });
181
+ // 括弧
182
+ pl.braces.filter(function(b){ return b.row === ri; }).forEach(function(b){
183
+ var xa = r.segs[b.o.from].x + 2, xb = r.segs[b.o.to].x + r.segs[b.o.to].w - 2, up = b.side === "above", dsg = up ? -1 : 1;
184
+ var yb = up ? r.top - (r.out ? ROW + 8 : 0) - 6 - b.lv * BLV : r.top + r.tapeH + 6 + b.lv * BLV;
185
+ var xm = (xa + xb) / 2, q = BR, rr = Math.min(12, (xb - xa) / 4), f = function(v){ return v.toFixed(1); };
186
+ var d = "M" + f(xa) + "," + f(yb) + "Q" + f(xa) + "," + f(yb + dsg * q / 2) + " " + f(xa + rr) + "," + f(yb + dsg * q / 2) + "L" + f(xm - rr) + "," + f(yb + dsg * q / 2) +
187
+ "Q" + f(xm) + "," + f(yb + dsg * q / 2) + " " + f(xm) + "," + f(yb + dsg * q) + "Q" + f(xm) + "," + f(yb + dsg * q / 2) + " " + f(xm + rr) + "," + f(yb + dsg * q / 2) +
188
+ "L" + f(xb - rr) + "," + f(yb + dsg * q / 2) + "Q" + f(xb) + "," + f(yb + dsg * q / 2) + " " + f(xb) + "," + f(yb);
189
+ add(D.el("path", {d: d, fill: "none", stroke: "var(--fg)", "stroke-width": 2.5, "stroke-linejoin": "round", opacity: 0}, gA), {st: b.st, at: 0, len: dur * 0.6, kind: "line"});
190
+ if (b.o.label){
191
+ var c = content({label: b.o.label}), cx = Math.max(c.w / 2 + 2, Math.min(W - c.w / 2 - 2, xm)), base = up ? yb - q - 6 - ROW + 25 : yb + q + 6 + 25;
192
+ var cg = D.el("g", {opacity: 0}, gT);
193
+ drawContent(cg, cx, base, c);
194
+ add(cg, {st: b.st, at: dur * 0.3, len: dur * 0.5, kind: "fade"});
195
+ }
196
+ });
197
+ });
198
+ // 倍の矢印:行の左の端から端へ、左にふくらむ弧
199
+ pl.times.forEach(function(x){
200
+ var a = rows[x.o.from], b = rows[x.o.to], xs = x0 - 8, xc = x0 - 44, ya = a.cy, yb = b.cy;
201
+ add(D.el("path", {d: "M" + xs.toFixed(1) + "," + ya.toFixed(1) + "C" + xc.toFixed(1) + "," + ya.toFixed(1) + " " + xc.toFixed(1) + "," + yb.toFixed(1) + " " + (xs - 10).toFixed(1) + "," + yb.toFixed(1),
202
+ fill: "none", stroke: "var(--emph)", "stroke-width": 3, "stroke-linecap": "round", opacity: 0}, gA), {st: x.st, at: 0, len: dur * 0.6, kind: "line"});
203
+ add(D.el("path", {d: "M" + xs.toFixed(1) + "," + yb.toFixed(1) + "l-14,-7v14Z", fill: "var(--emph)", opacity: 0}, gA), {st: x.st, at: dur * 0.5, len: dur * 0.2, kind: "fade"});
204
+ if (x.o.label){
205
+ var lx = 0.75 * xc + 0.125 * (xs + xs - 10) - 12;
206
+ add(D.mtext(gT, lx, (ya + yb) / 2 + 9, x.o.label, {"text-anchor": "end", "font-size": 26, "font-weight": 700, fill: "var(--fg)", opacity: 0}), {st: x.st, at: dur * 0.3, len: dur * 0.5, kind: "fade"});
207
+ }
208
+ });
209
+ if (grow) items.forEach(function(it){ if (it.kind === "line") it.el.setAttribute("pathLength", 1); });
210
+ }
211
+ render(k, t, ctx){
212
+ var D = base, lecture = !!ctx.preview, grow = this.variant === "grow", FAINT = 0.45;
213
+ if (lecture) FAINT = base.previewOpacity(this); // 先の段階の薄さ:テーマの --preview-opacity(ないときは 0.45)
214
+ this.items.forEach(function(it){
215
+ var e = it.st < k ? 1 : it.st > k ? (lecture ? -1 : 0) : D.prog(t, it.at, it.len), op;
216
+ if (e < 0){ op = FAINT; e = 1; } else op = e;
217
+ if (grow && it.kind === "seg"){
218
+ it.el.setAttribute("width", Math.max(0, it.w * e).toFixed(1));
219
+ op = e > 0 ? (op === FAINT && it.st > k ? FAINT : 1) : 0;
220
+ } else if (grow && it.kind === "line"){
221
+ it.el.setAttribute("stroke-dasharray", e >= 1 ? "none" : e.toFixed(4) + " 2");
222
+ op = e > 0 ? (op === FAINT && it.st > k ? FAINT : 1) : 0;
223
+ }
224
+ it.el.setAttribute("opacity", op.toFixed(3));
225
+ });
226
+ }
227
+ };
228
+ });
@@ -0,0 +1,51 @@
1
+ ---
2
+ summary: Icon cards in a row or 2 rows, by step; arrows for order
3
+ steps: largest card step (default 1 card = 1 step)
4
+ props:
5
+ layout: row, or grid (2×2; 3×2 for 5–6)
6
+ arrows: order arrows (grid: Z order)
7
+ nums: number circles
8
+ hilite: last or a number (from 1)
9
+ per-step: cards per step (0 = all)
10
+ stagger: card offset (s)
11
+ dur: appear seconds
12
+ example: {"cards": [{"icon": "user", "title": "Listen", "text": "Hear the problem"}, {"icon": "bulb", "title": "Think", "text": "Find 3 ideas"}, {"icon": "rocket", "title": "Try", "text": "Build small, show"}]}
13
+ ---
14
+
15
+ 3–4 short equal points or a 2×2: try cards over bullets; short steps: cards with arrows. Long or unequal items: bullets.
16
+
17
+ Child JSON: `{"cards": [{"n", "icon", "title", "text", "step", "tone"}, …]}` (2–6 cards).
18
+
19
+ - `title`: required, ≤ 2 lines. `text`: wraps; overflow cut with …, reported
20
+ - `icon`: Tabler name (below); unknown = dashed box, reported
21
+ - `n`: circle text (`"A"`, `"1"`); `nums` numbers the rest 1, 2, 3 …
22
+ - `tone`: circle and icon colour (`term`, `emph`, `accent2`, `series-1..4`)
23
+ - `arrows`; `hilite="last"` or `"3"`: `--emph` frame and fill
24
+ - `variant`: `rise` (default), `fade`, `draw`
25
+
26
+ Icons:
27
+
28
+ - People: user users user-check user-plus user-circle friends mood-smile man woman id-badge
29
+ - Data: chart-bar chart-line chart-pie chart-dots trending-up trending-down table database filter adjustments percentage sum
30
+ - Money: coin cash credit-card wallet receipt pig-money building-bank report-money shopping-cart tag
31
+ - Time: clock calendar calendar-event calendar-time hourglass history alarm stopwatch
32
+ - Place: map-pin map world home building building-factory building-store route truck
33
+ - Flow: arrow-right arrows-right-left refresh repeat circle-check checklist list-numbers git-branch target flag rocket hand-click
34
+ - Talk: message messages mail phone bell speakerphone share world-www microphone presentation
35
+ - Docs: file file-text files notebook book clipboard-list folder news certificate award
36
+ - Tools: tool settings hammer bulb puzzle cpu device-laptop device-mobile robot code scale
37
+ - Nature: leaf tree plant sun moon cloud cloud-rain droplet flame snowflake
38
+ - Safety: shield shield-check lock key alert-triangle first-aid-kit heart heart-rate-monitor eye
39
+ - Learning: school pencil ruler math-function atom flask microscope palette music language
40
+
41
+ The demo is `demo.html`. Companies and numbers are fictional.
42
+
43
+ <!-- llm: omit -->
44
+ Notes for authors of parts
45
+
46
+ - Icons come by name from the library part `icons` (Tabler outline, MIT); a build keeps only the names a lesson uses. Colour: `currentColor`
47
+ - Sizes: icon 32–64 px, title 26–34 px, text 24 px
48
+ - Overflow is cut with … and reported once (`layout`)
49
+ - Screen readers: svg `role="list"`, cards `role="listitem"` with number, title and text; icons and arrows `aria-hidden`
50
+ - Show later steps faintly: later cards at `--preview-opacity`; print and video show the last step
51
+ <!-- llm: end -->
@@ -0,0 +1,228 @@
1
+ // m-cards:カードを横一列(row)か 2 段(grid:2×2、5〜6 枚なら 3×2)に並べ、段階ごとに出す。カードは番号の丸・アイコン・見出し・説明
2
+ // <m-cards arrows style="height:320px"><script type="application/json">
3
+ // {"cards": [{"icon": "user", "title": "聞く", "text": "相手の困りごとを聞く"}, {"icon": "bulb", "title": "考える"}]}
4
+ // (JSON の終わり)</m-cards>
5
+ // 段階:既定はカード 1 枚 = 1 段階(per-step で n 枚ずつ、カードの step で直接)
6
+ // アイコンは名前で引く(ライブラリ部品 icons、Tabler Icons outline)。組み立てはレッスンに書かれた名前のアイコンだけを残す
7
+ // 説明は和文を文節の切れ目らしい所(平仮名の後ろで平仮名でない字の前、読点・空白の後ろ)で折り返し、入らなければ … で切って ctx.report
8
+ // 見せ方(docs/conventions.md §1):rise(下から、既定)・fade(その場で)・draw(枠と矢印を描いてから中身)。段階の数・長さ・最後の中身はどれも同じ
9
+ // 2.0(Egatari spec §6.1 の部品):base の MotionElement・el・mtext・prog・clamp・variant・previewOpacity と icons の svg を使い、プレイヤーのグローバルは使わない
10
+ egatariParts.define({name: "cards", version: "2.0.4", requires: {base: "1.2.0", icons: "1.0.0"}, element: "m-cards"}, function(deps){
11
+ "use strict";
12
+ var base = deps.base, icons = deps.icons;
13
+ var TONES = /^(term|emph|accent2|series-[1-4])$/;
14
+ // 字の幅の見積もり(字の大きさ 1 あたり。base の textWidth:font の要素の字で測った幅。mtext で書くので *_^ は数えない)
15
+ function est(s, font){ return base.textWidth(s, 1, {font: font, mark: true}); }
16
+ // 折ってよい所:空白・読点の後ろ、平仮名の後ろで平仮名でない字の前、欧文と和文の境(数と単位の間は除く)。行の頭に置かない字(小さい仮名・長音・句読点・閉じ括弧)の前では折らない
17
+ var HEADLESS = /[ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮー、。,.・)」』】〕!?!?,.)]/, HIRA = /[ぁ-ゖ]/, LATIN = /[\u0000-ɏ]/;
18
+ function breaks(ch){
19
+ var ok = [];
20
+ for (var i = 1; i < ch.length; i++){
21
+ var a = ch[i - 1], b = ch[i];
22
+ // 数と単位(「5 分」「1 枚」)の間では折らない
23
+ if (/[0-9]/.test(a) && (b === " " || !LATIN.test(b)) || a === " " && /[0-9]/.test(ch[i - 2] || "") && !LATIN.test(b)){ ok[i] = false; continue; }
24
+ ok[i] = !HEADLESS.test(b) && !/[(「『【〔(]/.test(a) &&
25
+ (a === " " || /[、。,.]/.test(a) || (HIRA.test(a) && !HIRA.test(b)) || (LATIN.test(a) !== LATIN.test(b) && b !== " "));
26
+ }
27
+ return ok;
28
+ }
29
+ // s を幅 w(字の大きさ size、字は要素 font のもの)の行に折る。行の数が max を超えれば最後の行を … で切る。{lines, cut}
30
+ function wrap(s, w, size, max, font){
31
+ var out = [], paras = String(s).split("\n"), cut = false;
32
+ paras.forEach(function(p){
33
+ var ch = [...p], ok = breaks(ch), start = 0, last = -1;
34
+ for (var i = 0; i <= ch.length; i++){
35
+ if (i > start && est(ch.slice(start, i).join(""), font) * size > w){
36
+ // 入らない:最後の折ってよい所で折る(なければ字の所で。行の頭に置かない字は前の行に残す)
37
+ var at = last > start ? last : i - 1;
38
+ if (at <= start) at = start + 1;
39
+ while (last <= start && at < ch.length && HEADLESS.test(ch[at]) && at - start > 1) at--;
40
+ out.push(ch.slice(start, at).join("").replace(/ +$/, ""));
41
+ start = at; while (ch[start] === " ") start++;
42
+ last = -1; i = start;
43
+ continue;
44
+ }
45
+ if (i < ch.length && ok[i]) last = i;
46
+ }
47
+ out.push(ch.slice(start).join(""));
48
+ });
49
+ if (out.length > max){
50
+ cut = true; out = out.slice(0, max);
51
+ var l = [...out[max - 1]];
52
+ while (l.length && est(l.join("") + "…", font) * size > w) l.pop();
53
+ out[max - 1] = l.join("").replace(/[、。 ]$/, "") + "…";
54
+ }
55
+ return {lines: out, cut: cut};
56
+ }
57
+ return class extends base.MotionElement {
58
+ static partName = "cards"; // the registry name (define meta name), for report prefixes
59
+ static variants = ["rise", "fade", "draw"];
60
+ // データの形(kit/shape.js)
61
+ static shape = {
62
+ schema: {type: "object", additionalProperties: false, required: ["cards"], properties: {
63
+ cards: {type: "array", minItems: 2, maxItems: 6, items: {type: "object", additionalProperties: false, required: ["title"], properties: {
64
+ n: {type: "string"}, icon: {type: "string"}, title: {type: "string"}, text: {type: "string"}, step: {type: "integer"}, tone: {type: "string"}}}}}},
65
+ example: {cards: [{icon: "user", title: "聞く", text: "相手の困りごとを聞く"}, {icon: "bulb", title: "考える", text: "案を 3 つ出す"}, {icon: "rocket", title: "試す", text: "小さく作って見せる"}]},
66
+ };
67
+ static props = {
68
+ layout: {type: "enum", values: ["row", "grid"], default: "row", doc: "row:横一列。grid:2 段(4 枚までは 2×2、5〜6 枚は 3×2)"},
69
+ arrows: {type: "bool", default: false, doc: "カードの間に順の矢印(grid では 1→2→3→4 の Z の順)"},
70
+ nums: {type: "bool", default: false, doc: "番号の丸を出す(カードの n が優先。n だけ書いたカードはそれを出す)"},
71
+ hilite: {type: "string", default: "", doc: "強調するカード:last か番号(1 から)。--emph の枠と地"},
72
+ "per-step": {type: "number", default: 1, doc: "1 ステップに出すカードの数(0 = 全部をステップ 1 で)"},
73
+ stagger: {type: "number", default: 0.25, doc: "同じステップのカードの出だしのずれ(秒)"},
74
+ dur: {type: "number", default: 0.5, doc: "1 枚が出る秒数"},
75
+ };
76
+ get steps(){
77
+ if (this.getAttribute("steps") !== null) return +this.getAttribute("steps");
78
+ var m = 0;
79
+ this.plan().forEach(function(o){ m = Math.max(m, o.step); });
80
+ return m;
81
+ }
82
+ plan(){
83
+ if (this._plan) return this._plan;
84
+ var P = this.props, per = P["per-step"], seen = {};
85
+ return (this._plan = ((this.data || {}).cards || []).slice(0, 6).map(function(c, i){
86
+ var step = c.step !== undefined ? c.step : per > 0 ? Math.floor(i / per) + 1 : 1;
87
+ var j = seen[step] = (seen[step] || 0) + 1;
88
+ return {c: c, i: i, step: step, at: +((j - 1) * P.stagger).toFixed(3)};
89
+ }));
90
+ }
91
+ mount(ctx){
92
+ var P = this.props, D = base, self = this, pl = this.plan(), n = pl.length;
93
+ this.variant = base.variant(this);
94
+ this.style.display = "block"; this.style.position = "relative";
95
+ var W = this.clientWidth, H = this.clientHeight;
96
+ var grid = P.layout === "grid" && n > 2, cols = grid ? (n <= 4 ? 2 : 3) : n, rows = grid ? 2 : 1;
97
+ var gap = P.arrows ? 60 : 24, vgap = P.arrows ? 48 : 24;
98
+ var cw = (W - gap * (cols - 1)) / cols, ch = (H - vgap * (rows - 1)) / rows;
99
+ this.cards = []; this.arrows = [];
100
+ // 高さ(幅)のない要素:カードの枠が負の大きさになる。描かずに知らせる
101
+ if (!(cw > 0 && ch > 0)){
102
+ ctx.report("size", "[cards] the element is " + W + "×" + H + "px, too small for " + n + " card" + (n === 1 ? "" : "s") + "; give it a height (e.g. style=\"height:320px\")");
103
+ return;
104
+ }
105
+ // 読み上げの名前:作者の aria-label、なければカードの数と見出し
106
+ var ja = /^ja\b/i.test(ctx.lang || "ja");
107
+ var name = this.getAttribute("aria-label") || (ja ? "カード " + n + " 枚:" : n + " cards: ") + pl.map(function(o){ return o.c.title; }).join(ja ? "、" : ", ");
108
+ var svg = D.el("svg", {viewBox: "0 0 " + W + " " + H, width: W, height: H, role: "list", "aria-label": name, style: "display:block;overflow:visible"}, this);
109
+ var hl = P.hilite === "last" ? n - 1 : /^\d+$/.test(P.hilite) ? +P.hilite - 1 : -1;
110
+ if (P.hilite && (hl < 0 || hl >= n)) ctx.report("attr", '[cards] hilite="' + P.hilite + '" is not last or a card number 1–' + n);
111
+ // カードの中:横に広いカード(幅が高さの 1.6 倍以上)は 番号・アイコン・見出しを 1 行に、ほかは縦に積む
112
+ var pad = 20, wide = cw >= ch * 1.6;
113
+ var isz = Math.round(Math.max(32, Math.min(64, cw * 0.22, ch * 0.24)));
114
+ var tsz = Math.round(Math.max(26, Math.min(34, cw * 0.11))), xsz = 24, lh = 34, bd = 44;
115
+ var missing = function(m){ ctx.report("data", "[cards] " + m); };
116
+ var unfit = [];
117
+ this.cards = pl.map(function(o, i){
118
+ var c = o.c, col = i % cols, row = Math.floor(i / cols);
119
+ var x = col * (cw + gap), y = row * (ch + vgap);
120
+ var tone = TONES.test(c.tone || "") ? c.tone : "term", hi = i === hl;
121
+ var g = D.el("g", {opacity: 0, role: "listitem", "aria-label": [c.n || (P.nums ? String(i + 1) : ""), c.title, c.text || ""].filter(Boolean).join(" ")}, svg);
122
+ var frame = D.el("rect", {x: x + 1, y: y + 1, width: cw - 2, height: ch - 2, rx: 14, fill: hi ? "var(--emph-tint)" : "var(--term-tint)", stroke: hi ? "var(--emph)" : "var(--line)", "stroke-width": hi ? 4 : 2}, g);
123
+ var body = D.el("g", {}, g);
124
+ var badge = c.n !== undefined ? String(c.n) : P.nums ? String(i + 1) : "";
125
+ var cy = y + pad, textW = cw - 2 * pad, hx = x + pad, corner = null;
126
+ if (wide){
127
+ // 1 行目:番号・アイコン・見出し(左から)
128
+ var lineH = Math.max(bd, isz * 0.8);
129
+ if (badge){ self.badge(body, hx + bd / 2, cy + lineH / 2, badge, tone); hx += bd + 14; }
130
+ if (c.icon){ self.icon(body, c.icon, hx, cy + lineH / 2 - isz * 0.4, isz * 0.8, tone, missing); hx += isz * 0.8 + 14; }
131
+ var tw = wrap(c.title, x + cw - pad - hx, tsz, 2, self);
132
+ tw.lines.forEach(function(s, j){ D.mtext(body, hx, cy + lineH / 2 + tsz * 0.36 + (j - (tw.lines.length - 1) / 2) * (tsz + 6), s, {"font-size": tsz, "font-weight": 700}); });
133
+ if (tw.cut) unfit.push(i + 1 + " (title)");
134
+ cy += Math.max(lineH, tw.lines.length * (tsz + 6)) + 16;
135
+ } else {
136
+ // 縦:番号は左上、アイコンは上の真ん中、その下に見出し(真ん中)
137
+ corner = badge ? D.el("g", {}, body) : null; // 番号は左上の角に固定(中身を縦の真ん中へ寄せても動かない)
138
+ if (badge) self.badge(corner, x + pad + bd / 2, y + pad + bd / 2, badge, tone);
139
+ if (c.icon){ self.icon(body, c.icon, x + cw / 2 - isz / 2, cy, isz, tone, missing); cy += isz + 14; }
140
+ else if (badge) cy += bd + 8;
141
+ var tw2 = wrap(c.title, textW, tsz, 2, self);
142
+ tw2.lines.forEach(function(s){ cy += tsz; D.mtext(body, x + cw / 2, cy, s, {"text-anchor": "middle", "font-size": tsz, "font-weight": 700}); cy += 6; });
143
+ if (tw2.cut) unfit.push(i + 1 + " (title)");
144
+ cy += 12;
145
+ }
146
+ var end = cy - 12;
147
+ if (c.text){
148
+ var room = Math.max(0, Math.floor((y + ch - pad - cy + (lh - xsz)) / lh));
149
+ var tx = wrap(c.text, textW, xsz, Math.max(1, room), self);
150
+ var center = !wide && tx.lines.length === 1;
151
+ tx.lines.forEach(function(s, j){ D.mtext(body, center ? x + cw / 2 : x + pad, cy + xsz + j * lh, s, center ? {"text-anchor": "middle", "font-size": xsz} : {"font-size": xsz}); });
152
+ if (tx.cut || room < 1) unfit.push(String(i + 1));
153
+ end = cy + xsz + (tx.lines.length - 1) * lh + 8;
154
+ }
155
+ // 高さが余るカード:中身(アイコン・見出し・説明)を縦の真ん中へ。上の余白は pad のまま、余りの半分だけ下げる(2.5.0)
156
+ var spare = y + ch - pad - end;
157
+ if (spare > 2){
158
+ body.setAttribute("transform", "translate(0 " + (spare / 2).toFixed(1) + ")");
159
+ if (!wide && corner) corner.setAttribute("transform", "translate(0 " + (-spare / 2).toFixed(1) + ")");
160
+ }
161
+ // 前のカードからの矢印(この カードと一緒に出る)
162
+ var arrow = null;
163
+ if (P.arrows && i > 0){
164
+ var pc = (i - 1) % cols, pr = Math.floor((i - 1) / cols);
165
+ var ax, ay, d, alen = 60;
166
+ if (pr === row){ ax = pc * (cw + gap) + cw + gap / 2; ay = y + ch / 2; d = "M" + (ax - 10) + "," + (ay - 16) + "L" + (ax + 8) + "," + ay + "L" + (ax - 10) + "," + (ay + 16); }
167
+ else {
168
+ // 段が変わる(grid の 2→3、3→4):前の段の最後のカードの下から出て、段の間を左へ、次の段の最初のカードへ下りる
169
+ var bx = pc * (cw + gap) + cw / 2, ex = col * (cw + gap) + cw / 2, y0 = pr * (ch + vgap) + ch + 6, ym = y0 - 6 + vgap / 2, y1 = y - 6;
170
+ d = "M" + bx + "," + y0 + "V" + ym + "H" + ex + "V" + y1 + "L" + (ex - 10) + "," + (y1 - 9) + "L" + ex + "," + y1 + "L" + (ex + 10) + "," + (y1 - 9);
171
+ alen = (ym - y0) + Math.abs(bx - ex) + (y1 - ym) + 42; // 1 本の道(破線で描くとき矢じりが最後に出る)
172
+ }
173
+ arrow = D.el("path", {d: d, fill: "none", stroke: "var(--muted)", "stroke-width": 5, "stroke-linecap": "round", "stroke-linejoin": "round", opacity: 0, "aria-hidden": "true"}, svg);
174
+ arrow._len = alen;
175
+ self.arrows.push(arrow);
176
+ }
177
+ return {o: o, g: g, body: body, frame: frame, arrow: arrow, per: 2 * (cw + ch)};
178
+ });
179
+ if (unfit.length) ctx.report("layout", "[cards] the text of card " + unfit.join(", ") + " does not fit; it is cut with …. Shorten it, or give the element more height");
180
+ }
181
+ badge(parent, cx, cy, s, tone){
182
+ var D = base;
183
+ D.el("circle", {cx: cx, cy: cy, r: 22, fill: "var(--" + tone + ")"}, parent);
184
+ D.mtext(parent, cx, cy + 9, s, {"text-anchor": "middle", "font-size": 26, "font-weight": 700, fill: "var(--bg)"});
185
+ }
186
+ icon(parent, name, x, y, size, tone, missing){
187
+ var wrapG = base.el("g", {style: "color:var(--" + tone + ");"}, parent);
188
+ wrapG.appendChild(icons.svg(name, {x: x, y: y, size: size, missing: missing}));
189
+ }
190
+ duration(k){
191
+ var P = this.props, d = 0, dr = this.variant === "draw" ? 0.4 : 0;
192
+ this.plan().forEach(function(o){ if (o.step === k) d = Math.max(d, o.at + dr + P.dur); });
193
+ return d;
194
+ }
195
+ cues(k){
196
+ var c = [];
197
+ this.plan().forEach(function(o){ if (o.step === k && o.at > 0) c.push(o.at); });
198
+ return c.length ? c.sort(function(a, b){ return a - b; }) : null;
199
+ }
200
+ render(k, t, ctx){
201
+ var P = this.props, D = base, vr = this.variant;
202
+ // 先の段階を薄く見せる表示(授業の表示):後の段階のカードを最後の形で、テーマの --preview-opacity の濃さに
203
+ var preview = !!ctx.preview, PV = preview ? base.previewOpacity(this) : 1;
204
+ this.cards.forEach(function(o){
205
+ var s = o.o.step, at = o.o.at, ahead = preview && s > k;
206
+ var tt = s < k || ahead ? Infinity : s > k ? -1 : t; // このカードの段階の中の時刻(-1 = まだ)
207
+ var dr = vr === "draw" ? 0.4 : 0;
208
+ var e = tt < 0 ? 0 : D.prog(tt, at + dr, P.dur);
209
+ if (vr === "draw"){
210
+ // 枠を描いてから中身
211
+ var f = tt < 0 ? 0 : D.prog(tt, at, dr + P.dur * 0.3);
212
+ o.g.setAttribute("opacity", ahead ? PV.toFixed(3) : tt < 0 ? "0" : "1");
213
+ o.frame.setAttribute("stroke-dasharray", f >= 1 ? "" : (o.per * f).toFixed(1) + " " + o.per.toFixed(1));
214
+ o.frame.setAttribute("fill-opacity", f >= 1 ? "1" : "0");
215
+ o.body.setAttribute("opacity", e.toFixed(3));
216
+ } else {
217
+ o.g.setAttribute("opacity", ahead ? PV.toFixed(3) : e.toFixed(3));
218
+ o.g.setAttribute("transform", vr === "rise" && e < 1 ? "translate(0 " + ((1 - e) * 16).toFixed(2) + ")" : "");
219
+ }
220
+ if (o.arrow){
221
+ var a = tt < 0 ? 0 : D.prog(tt, at, vr === "draw" ? dr : P.dur * 0.6);
222
+ o.arrow.setAttribute("opacity", ahead ? PV.toFixed(3) : vr === "draw" ? (a > 0 ? "1" : "0") : a.toFixed(3));
223
+ o.arrow.setAttribute("stroke-dasharray", vr === "draw" && a < 1 ? (o.arrow._len * a).toFixed(1) + " " + o.arrow._len.toFixed(1) : "");
224
+ }
225
+ });
226
+ }
227
+ };
228
+ });
@@ -0,0 +1,23 @@
1
+ ---
2
+ summary: Screen steps: numbered circles on a screenshot, joined by leader lines to labels beside it, one per step
3
+ steps: max callout step (default 1 callout = 1 step)
4
+ props:
5
+ side: labels on right, left or both
6
+ label-width: label column (share of width)
7
+ per-step: callouts per step (0 = all)
8
+ dur: seconds per callout
9
+ size: label px (≥ 24)
10
+ example: {"callouts": [{"x": 0.12, "y": 0.08, "text": "Open the menu"}, {"x": 0.7, "y": 0.62, "text": "Press Send"}]}
11
+ ---
12
+
13
+ For training and how-to guides: where to click, in order.
14
+
15
+ The screenshot is a child `<img src alt width height>` (the build inlines it).
16
+
17
+ - **Never show real personal data on a screenshot** (names, ID numbers, resident or patient records). Use made-up data, or blur it.
18
+ - `alt`, `width` and `height` (px) are required (else data); an image over 1 MiB is size.
19
+
20
+ Child JSON: `{"callouts": [...]}`; callout: `x`, `y` (0–1 of the image), `text`, `box` (`[x, y, w, h]`, highlighted during its step), `step`, `at`.
21
+ <!-- llm: omit -->
22
+ - Labels follow the circles' vertical order, so leader lines never cross.
23
+ <!-- llm: end -->