egatari 0.6.4 → 0.6.5-rc.2

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 (385) hide show
  1. package/NOTICE +36 -0
  2. package/README.ja.md +18 -4
  3. package/README.md +18 -4
  4. package/SECURITY.md +18 -0
  5. package/bin/egatari.mjs +86 -3
  6. package/components.lock.json +246 -123
  7. package/components2.lock.json +824 -1
  8. package/kit/article-steps.mjs +27 -0
  9. package/kit/browser.mjs +14 -2
  10. package/kit/build.mjs +50 -1
  11. package/kit/check-messages.mjs +15 -7
  12. package/kit/check.mjs +46 -9
  13. package/kit/cli-hint.mjs +27 -0
  14. package/kit/core/article-cite.mjs +188 -0
  15. package/kit/core/article-links.mjs +174 -0
  16. package/kit/core/article-messages.mjs +119 -0
  17. package/kit/core/article-page.mjs +183 -0
  18. package/kit/core/article-render.mjs +410 -0
  19. package/kit/core/article-text.mjs +559 -0
  20. package/kit/core/article.mjs +267 -0
  21. package/kit/core/build-core.mjs +49 -9
  22. package/kit/core/citeproc-credit.mjs +3 -0
  23. package/kit/core/colab-core.mjs +1 -1
  24. package/kit/core/components-lock.mjs +18 -0
  25. package/kit/core/llm-fix.mjs +2 -1
  26. package/kit/core/llm-pack-assemble.mjs +5 -3
  27. package/kit/core/llm-pack-data.mjs +63 -80
  28. package/kit/core/new-deck.mjs +1 -1
  29. package/kit/core/part-labels.mjs +17 -5
  30. package/kit/core/parts2.mjs +11 -1
  31. package/kit/core/player.mjs +1 -1
  32. package/kit/core/portable.mjs +132 -16
  33. package/kit/core/quote-ja.mjs +5 -0
  34. package/kit/core/themes-lock.mjs +16 -0
  35. package/kit/core/tier-a.mjs +47 -3
  36. package/kit/deck.js +195 -45
  37. package/kit/instruction-version.json +3 -0
  38. package/kit/layouts.css +11 -10
  39. package/kit/panes.js +1288 -0
  40. package/kit/player.json +1 -1
  41. package/kit/player.lock.json +2 -2
  42. package/kit/tools.js +81 -20
  43. package/kit/track.js +308 -0
  44. package/package.json +20 -3
  45. package/render/only.mjs +21 -0
  46. package/render/render.mjs +11 -8
  47. package/tools/ids.mjs +77 -9
  48. package/tools/portable.mjs +2 -0
  49. package/tools/sheet.mjs +5 -3
  50. package/vendor/components/CATALOG.md +4 -4
  51. package/vendor/components/sha256/00e4bdbb7b9964c92809177fe7bb574e7184ed603dbc5008a485d82603d9a7bf/CHANGELOG.md +37 -0
  52. package/vendor/components/sha256/00e4bdbb7b9964c92809177fe7bb574e7184ed603dbc5008a485d82603d9a7bf/README.md +58 -0
  53. package/vendor/components/sha256/00e4bdbb7b9964c92809177fe7bb574e7184ed603dbc5008a485d82603d9a7bf/demo.html +121 -0
  54. package/vendor/components/sha256/00e4bdbb7b9964c92809177fe7bb574e7184ed603dbc5008a485d82603d9a7bf/index.js +894 -0
  55. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/CHANGELOG.md +44 -0
  56. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/README.md +32 -0
  57. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/demo.html +57 -0
  58. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/ABCJS-ADAPTER.md +101 -0
  59. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/LICENSE-abcjs.txt +21 -0
  60. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/chords.json +89 -0
  61. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/doremi.json +261 -0
  62. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/extras.json +192 -0
  63. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/kaeru.json +521 -0
  64. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/rhythm.json +248 -0
  65. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/ties.json +360 -0
  66. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/index.js +474 -0
  67. package/vendor/components/sha256/027a8fea4060337ccc0a926c1488066f1ae7a6c102a15032eae974304e12cb3b/CHANGELOG.md +28 -0
  68. package/vendor/components/sha256/027a8fea4060337ccc0a926c1488066f1ae7a6c102a15032eae974304e12cb3b/README.md +21 -0
  69. package/vendor/components/sha256/027a8fea4060337ccc0a926c1488066f1ae7a6c102a15032eae974304e12cb3b/demo.html +32 -0
  70. package/vendor/components/sha256/027a8fea4060337ccc0a926c1488066f1ae7a6c102a15032eae974304e12cb3b/index.js +139 -0
  71. package/vendor/components/sha256/03550bb20d425aa926258bab18b03bbc0cee292072e01bb6c78c429b3ae92c34/README.md +42 -0
  72. package/vendor/components/sha256/03550bb20d425aa926258bab18b03bbc0cee292072e01bb6c78c429b3ae92c34/index.js +250 -0
  73. package/vendor/components/sha256/07013c263cc595382dbcfd4931ca8b016f9dfb673440adf28911c95bd465cf9d/README.md +22 -0
  74. package/vendor/components/sha256/07013c263cc595382dbcfd4931ca8b016f9dfb673440adf28911c95bd465cf9d/index.js +41 -0
  75. package/vendor/components/sha256/0703ec58997237fceda0008c28dfa3e3370c21cdcb6d0cc99c29a83e4b9d0f11/CHANGELOG.md +25 -0
  76. package/vendor/components/sha256/0703ec58997237fceda0008c28dfa3e3370c21cdcb6d0cc99c29a83e4b9d0f11/README.md +35 -0
  77. package/vendor/components/sha256/0703ec58997237fceda0008c28dfa3e3370c21cdcb6d0cc99c29a83e4b9d0f11/demo.html +40 -0
  78. package/vendor/components/sha256/0703ec58997237fceda0008c28dfa3e3370c21cdcb6d0cc99c29a83e4b9d0f11/index.js +731 -0
  79. package/vendor/components/sha256/0b85af3a688ca012d7d1df082dab1f405048589dce78d411d4cffc1fb3a81998/CHANGELOG.md +19 -0
  80. package/vendor/components/sha256/0b85af3a688ca012d7d1df082dab1f405048589dce78d411d4cffc1fb3a81998/README.md +21 -0
  81. package/vendor/components/sha256/0b85af3a688ca012d7d1df082dab1f405048589dce78d411d4cffc1fb3a81998/demo.html +33 -0
  82. package/vendor/components/sha256/0b85af3a688ca012d7d1df082dab1f405048589dce78d411d4cffc1fb3a81998/index.js +106 -0
  83. package/vendor/components/sha256/0cf00baed0da1bc3ce5460eb1eff0a8dd5f7789168e83aaef751135cd3f8af89/CHANGELOG.md +21 -0
  84. package/vendor/components/sha256/0cf00baed0da1bc3ce5460eb1eff0a8dd5f7789168e83aaef751135cd3f8af89/README.md +34 -0
  85. package/vendor/components/sha256/0cf00baed0da1bc3ce5460eb1eff0a8dd5f7789168e83aaef751135cd3f8af89/demo.html +77 -0
  86. package/vendor/components/sha256/0cf00baed0da1bc3ce5460eb1eff0a8dd5f7789168e83aaef751135cd3f8af89/index.js +200 -0
  87. package/vendor/components/sha256/0eca723150eb30db0b3d3fdbd35b973d5344ac0d0e2ea8ab89d143a0870ab4fd/CHANGELOG.md +31 -0
  88. package/vendor/components/sha256/0eca723150eb30db0b3d3fdbd35b973d5344ac0d0e2ea8ab89d143a0870ab4fd/README.md +43 -0
  89. package/vendor/components/sha256/0eca723150eb30db0b3d3fdbd35b973d5344ac0d0e2ea8ab89d143a0870ab4fd/demo.html +47 -0
  90. package/vendor/components/sha256/0eca723150eb30db0b3d3fdbd35b973d5344ac0d0e2ea8ab89d143a0870ab4fd/index.js +484 -0
  91. package/vendor/components/sha256/0f47d93b78df1c0661a91d5fc46d6f7f5d1c45349065aab6bd3e659e07e317dd/CHANGELOG.md +23 -0
  92. package/vendor/components/sha256/0f47d93b78df1c0661a91d5fc46d6f7f5d1c45349065aab6bd3e659e07e317dd/README.md +44 -0
  93. package/vendor/components/sha256/0f47d93b78df1c0661a91d5fc46d6f7f5d1c45349065aab6bd3e659e07e317dd/demo.html +43 -0
  94. package/vendor/components/sha256/0f47d93b78df1c0661a91d5fc46d6f7f5d1c45349065aab6bd3e659e07e317dd/index.js +266 -0
  95. package/vendor/components/sha256/12704ccb92a1f864a18cce824a2400e8e3141e8dba7db34805cb1d8522aae08e/CHANGELOG.md +34 -0
  96. package/vendor/components/sha256/12704ccb92a1f864a18cce824a2400e8e3141e8dba7db34805cb1d8522aae08e/README.md +44 -0
  97. package/vendor/components/sha256/12704ccb92a1f864a18cce824a2400e8e3141e8dba7db34805cb1d8522aae08e/demo.html +56 -0
  98. package/vendor/components/sha256/12704ccb92a1f864a18cce824a2400e8e3141e8dba7db34805cb1d8522aae08e/index.js +429 -0
  99. package/vendor/components/sha256/149e8ddefbc384aafa8b961d48f8f56ad68ff75cc2429bd8c1ad6d8da661f5f6/CHANGELOG.md +25 -0
  100. package/vendor/components/sha256/149e8ddefbc384aafa8b961d48f8f56ad68ff75cc2429bd8c1ad6d8da661f5f6/README.md +42 -0
  101. package/vendor/components/sha256/149e8ddefbc384aafa8b961d48f8f56ad68ff75cc2429bd8c1ad6d8da661f5f6/demo.html +115 -0
  102. package/vendor/components/sha256/149e8ddefbc384aafa8b961d48f8f56ad68ff75cc2429bd8c1ad6d8da661f5f6/index.js +384 -0
  103. package/vendor/components/sha256/1ccdd24c9e0e7ca2661450c52eb6dcf9dbc2fb48d05fed2d01e2b9cfd5df1365/CHANGELOG.md +19 -0
  104. package/vendor/components/sha256/1ccdd24c9e0e7ca2661450c52eb6dcf9dbc2fb48d05fed2d01e2b9cfd5df1365/README.md +38 -0
  105. package/vendor/components/sha256/1ccdd24c9e0e7ca2661450c52eb6dcf9dbc2fb48d05fed2d01e2b9cfd5df1365/demo.html +72 -0
  106. package/vendor/components/sha256/1ccdd24c9e0e7ca2661450c52eb6dcf9dbc2fb48d05fed2d01e2b9cfd5df1365/index.js +248 -0
  107. package/vendor/components/sha256/240bd2ff9a1707c557f0a1af7f278a3f7661a8e680d3b932e367d4b337a3ad13/CHANGELOG.md +19 -0
  108. package/vendor/components/sha256/240bd2ff9a1707c557f0a1af7f278a3f7661a8e680d3b932e367d4b337a3ad13/README.md +36 -0
  109. package/vendor/components/sha256/240bd2ff9a1707c557f0a1af7f278a3f7661a8e680d3b932e367d4b337a3ad13/demo.html +70 -0
  110. package/vendor/components/sha256/240bd2ff9a1707c557f0a1af7f278a3f7661a8e680d3b932e367d4b337a3ad13/index.js +167 -0
  111. package/vendor/components/sha256/2a6b20b93f1169ef2435cdf3bfca57d24c9111fe9aaf8e61f0d049cf8a70e9df/CHANGELOG.md +34 -0
  112. package/vendor/components/sha256/2a6b20b93f1169ef2435cdf3bfca57d24c9111fe9aaf8e61f0d049cf8a70e9df/README.md +32 -0
  113. package/vendor/components/sha256/2a6b20b93f1169ef2435cdf3bfca57d24c9111fe9aaf8e61f0d049cf8a70e9df/demo.html +51 -0
  114. package/vendor/components/sha256/2a6b20b93f1169ef2435cdf3bfca57d24c9111fe9aaf8e61f0d049cf8a70e9df/index.js +302 -0
  115. package/vendor/components/sha256/2c9490ac960a5bb04ebc0c8fa0622392775f85ef8b8ebe93065991ce40afc097/CHANGELOG.md +41 -0
  116. package/vendor/components/sha256/2c9490ac960a5bb04ebc0c8fa0622392775f85ef8b8ebe93065991ce40afc097/README.md +35 -0
  117. package/vendor/components/sha256/2c9490ac960a5bb04ebc0c8fa0622392775f85ef8b8ebe93065991ce40afc097/demo.html +66 -0
  118. package/vendor/components/sha256/2c9490ac960a5bb04ebc0c8fa0622392775f85ef8b8ebe93065991ce40afc097/index.js +352 -0
  119. package/vendor/components/sha256/328a440e91684524068076e96cba5771cdceaa274d4b90033656259f05467135/CHANGELOG.md +35 -0
  120. package/vendor/components/sha256/328a440e91684524068076e96cba5771cdceaa274d4b90033656259f05467135/README.md +35 -0
  121. package/vendor/components/sha256/328a440e91684524068076e96cba5771cdceaa274d4b90033656259f05467135/demo.html +40 -0
  122. package/vendor/components/sha256/328a440e91684524068076e96cba5771cdceaa274d4b90033656259f05467135/index.js +747 -0
  123. package/vendor/components/sha256/3395706f819e0e70b4047da33486a4b59e65118faf8f918677061e397dae408c/CHANGELOG.md +35 -0
  124. package/vendor/components/sha256/3395706f819e0e70b4047da33486a4b59e65118faf8f918677061e397dae408c/README.md +43 -0
  125. package/vendor/components/sha256/3395706f819e0e70b4047da33486a4b59e65118faf8f918677061e397dae408c/demo.html +89 -0
  126. package/vendor/components/sha256/3395706f819e0e70b4047da33486a4b59e65118faf8f918677061e397dae408c/index.js +323 -0
  127. package/vendor/components/sha256/34b1375b0897f881b8d43e5dbaa928485cfab240e87c53a5868e714879a20f79/CHANGELOG.md +24 -0
  128. package/vendor/components/sha256/34b1375b0897f881b8d43e5dbaa928485cfab240e87c53a5868e714879a20f79/README.md +40 -0
  129. package/vendor/components/sha256/34b1375b0897f881b8d43e5dbaa928485cfab240e87c53a5868e714879a20f79/demo.html +70 -0
  130. package/vendor/components/sha256/34b1375b0897f881b8d43e5dbaa928485cfab240e87c53a5868e714879a20f79/index.js +561 -0
  131. package/vendor/components/sha256/37ea0051e8a1f2d7c2fa2d38e57730e5a3b1afabe9037a74fcad6e6f05356c09/CHANGELOG.md +27 -0
  132. package/vendor/components/sha256/37ea0051e8a1f2d7c2fa2d38e57730e5a3b1afabe9037a74fcad6e6f05356c09/README.md +50 -0
  133. package/vendor/components/sha256/37ea0051e8a1f2d7c2fa2d38e57730e5a3b1afabe9037a74fcad6e6f05356c09/demo.html +44 -0
  134. package/vendor/components/sha256/37ea0051e8a1f2d7c2fa2d38e57730e5a3b1afabe9037a74fcad6e6f05356c09/index.js +464 -0
  135. package/vendor/components/sha256/39c84138e7e4c6040eeb3d82d1c7fc801f513b2c26ac431ac8cc121a01f81698/CHANGELOG.md +23 -0
  136. package/vendor/components/sha256/39c84138e7e4c6040eeb3d82d1c7fc801f513b2c26ac431ac8cc121a01f81698/README.md +44 -0
  137. package/vendor/components/sha256/39c84138e7e4c6040eeb3d82d1c7fc801f513b2c26ac431ac8cc121a01f81698/demo.html +56 -0
  138. package/vendor/components/sha256/39c84138e7e4c6040eeb3d82d1c7fc801f513b2c26ac431ac8cc121a01f81698/index.js +402 -0
  139. package/vendor/components/sha256/3c36a26fd78dffdfa114bd7c9ca5cae494117bbcdda14bee5c2a01351e5f2eb2/CHANGELOG.md +27 -0
  140. package/vendor/components/sha256/3c36a26fd78dffdfa114bd7c9ca5cae494117bbcdda14bee5c2a01351e5f2eb2/README.md +49 -0
  141. package/vendor/components/sha256/3c36a26fd78dffdfa114bd7c9ca5cae494117bbcdda14bee5c2a01351e5f2eb2/demo.html +44 -0
  142. package/vendor/components/sha256/3c36a26fd78dffdfa114bd7c9ca5cae494117bbcdda14bee5c2a01351e5f2eb2/index.js +354 -0
  143. package/vendor/components/sha256/3c60c8e63279b8ee86957a5874c80f86a44f9ed92c1f615eace4a9dea1789da5/CHANGELOG.md +20 -0
  144. package/vendor/components/sha256/3c60c8e63279b8ee86957a5874c80f86a44f9ed92c1f615eace4a9dea1789da5/README.md +50 -0
  145. package/vendor/components/sha256/3c60c8e63279b8ee86957a5874c80f86a44f9ed92c1f615eace4a9dea1789da5/demo.html +61 -0
  146. package/vendor/components/sha256/3c60c8e63279b8ee86957a5874c80f86a44f9ed92c1f615eace4a9dea1789da5/index.js +141 -0
  147. package/vendor/components/sha256/3dba49cbbf7853212a6e5c393de030430d02b8b1a2ba4c8b722db2bb8afad12f/CHANGELOG.md +42 -0
  148. package/vendor/components/sha256/3dba49cbbf7853212a6e5c393de030430d02b8b1a2ba4c8b722db2bb8afad12f/README.md +32 -0
  149. package/vendor/components/sha256/3dba49cbbf7853212a6e5c393de030430d02b8b1a2ba4c8b722db2bb8afad12f/demo.html +54 -0
  150. package/vendor/components/sha256/3dba49cbbf7853212a6e5c393de030430d02b8b1a2ba4c8b722db2bb8afad12f/index.js +315 -0
  151. package/vendor/components/sha256/40452368224bdcd8c4910222285e6af9e120df17dbd1c3177c0abe9cb69075d1/CHANGELOG.md +30 -0
  152. package/vendor/components/sha256/40452368224bdcd8c4910222285e6af9e120df17dbd1c3177c0abe9cb69075d1/README.md +38 -0
  153. package/vendor/components/sha256/40452368224bdcd8c4910222285e6af9e120df17dbd1c3177c0abe9cb69075d1/demo.html +72 -0
  154. package/vendor/components/sha256/40452368224bdcd8c4910222285e6af9e120df17dbd1c3177c0abe9cb69075d1/index.js +267 -0
  155. package/vendor/components/sha256/4a5971c1f83efc1f57c444ce7d3fbf242b2bcca65c5c6e4b0b0d75eeb2751150/CHANGELOG.md +16 -0
  156. package/vendor/components/sha256/4a5971c1f83efc1f57c444ce7d3fbf242b2bcca65c5c6e4b0b0d75eeb2751150/README.md +27 -0
  157. package/vendor/components/sha256/4a5971c1f83efc1f57c444ce7d3fbf242b2bcca65c5c6e4b0b0d75eeb2751150/demo.html +42 -0
  158. package/vendor/components/sha256/4a5971c1f83efc1f57c444ce7d3fbf242b2bcca65c5c6e4b0b0d75eeb2751150/index.js +121 -0
  159. package/vendor/components/sha256/4e0e5eb48fc20ffc554786a7db66c4f5cee0c42eb0554bdc8c98323cdb168eb4/CHANGELOG.md +33 -0
  160. package/vendor/components/sha256/4e0e5eb48fc20ffc554786a7db66c4f5cee0c42eb0554bdc8c98323cdb168eb4/README.md +41 -0
  161. package/vendor/components/sha256/4e0e5eb48fc20ffc554786a7db66c4f5cee0c42eb0554bdc8c98323cdb168eb4/demo.html +70 -0
  162. package/vendor/components/sha256/4e0e5eb48fc20ffc554786a7db66c4f5cee0c42eb0554bdc8c98323cdb168eb4/index.js +592 -0
  163. package/vendor/components/sha256/50db2d3b84ee33b36c09a9a216ef6b337d2e5da2154e8aa62e790b0e63401796/CHANGELOG.md +23 -0
  164. package/vendor/components/sha256/50db2d3b84ee33b36c09a9a216ef6b337d2e5da2154e8aa62e790b0e63401796/README.md +43 -0
  165. package/vendor/components/sha256/50db2d3b84ee33b36c09a9a216ef6b337d2e5da2154e8aa62e790b0e63401796/demo.html +47 -0
  166. package/vendor/components/sha256/50db2d3b84ee33b36c09a9a216ef6b337d2e5da2154e8aa62e790b0e63401796/index.js +483 -0
  167. package/vendor/components/sha256/546ec63feccdc65569b7167e58b2e36a85be52f2538743dd2ecc3fc29ed6b883/CHANGELOG.md +19 -0
  168. package/vendor/components/sha256/546ec63feccdc65569b7167e58b2e36a85be52f2538743dd2ecc3fc29ed6b883/README.md +34 -0
  169. package/vendor/components/sha256/546ec63feccdc65569b7167e58b2e36a85be52f2538743dd2ecc3fc29ed6b883/demo.html +60 -0
  170. package/vendor/components/sha256/546ec63feccdc65569b7167e58b2e36a85be52f2538743dd2ecc3fc29ed6b883/index.js +209 -0
  171. package/vendor/components/sha256/556e7d45a761c4fa749cde186fb53f6c526ba6ede0b8f0f0bba5ac9e25e0d6f4/CHANGELOG.md +30 -0
  172. package/vendor/components/sha256/556e7d45a761c4fa749cde186fb53f6c526ba6ede0b8f0f0bba5ac9e25e0d6f4/README.md +79 -0
  173. package/vendor/components/sha256/556e7d45a761c4fa749cde186fb53f6c526ba6ede0b8f0f0bba5ac9e25e0d6f4/demo.html +50 -0
  174. package/vendor/components/sha256/556e7d45a761c4fa749cde186fb53f6c526ba6ede0b8f0f0bba5ac9e25e0d6f4/index.js +351 -0
  175. package/vendor/components/sha256/577008a069e7eb08057705a0800d975e82c8dfe0d0ba5fbf4f8974af7b298a7f/README.md +53 -0
  176. package/vendor/components/sha256/577008a069e7eb08057705a0800d975e82c8dfe0d0ba5fbf4f8974af7b298a7f/index.js +310 -0
  177. package/vendor/components/sha256/5a9959f8626f2c5280d0954c476baeadf03fecebda2443c3e83b8203ad554167/CHANGELOG.md +20 -0
  178. package/vendor/components/sha256/5a9959f8626f2c5280d0954c476baeadf03fecebda2443c3e83b8203ad554167/README.md +75 -0
  179. package/vendor/components/sha256/5a9959f8626f2c5280d0954c476baeadf03fecebda2443c3e83b8203ad554167/demo.html +50 -0
  180. package/vendor/components/sha256/5a9959f8626f2c5280d0954c476baeadf03fecebda2443c3e83b8203ad554167/index.js +342 -0
  181. package/vendor/components/sha256/5b44b272b917246219d2709f1b001964f87a3e07786cc9950087bbb8add3c721/CHANGELOG.md +24 -0
  182. package/vendor/components/sha256/5b44b272b917246219d2709f1b001964f87a3e07786cc9950087bbb8add3c721/README.md +26 -0
  183. package/vendor/components/sha256/5b44b272b917246219d2709f1b001964f87a3e07786cc9950087bbb8add3c721/demo.html +48 -0
  184. package/vendor/components/sha256/5b44b272b917246219d2709f1b001964f87a3e07786cc9950087bbb8add3c721/index.js +97 -0
  185. package/vendor/components/sha256/5c8ae7714fd8243c9b37539a5f0f8488d3ba20316ba81179e97b6160116d13c2/CHANGELOG.md +22 -0
  186. package/vendor/components/sha256/5c8ae7714fd8243c9b37539a5f0f8488d3ba20316ba81179e97b6160116d13c2/README.md +64 -0
  187. package/vendor/components/sha256/5c8ae7714fd8243c9b37539a5f0f8488d3ba20316ba81179e97b6160116d13c2/demo.html +97 -0
  188. package/vendor/components/sha256/5c8ae7714fd8243c9b37539a5f0f8488d3ba20316ba81179e97b6160116d13c2/index.js +875 -0
  189. package/vendor/components/sha256/68c9e866e3cd3e2f8179ede44a005c7f31cef0ed07fd5770ec33f0cc3aa80a41/CHANGELOG.md +21 -0
  190. package/vendor/components/sha256/68c9e866e3cd3e2f8179ede44a005c7f31cef0ed07fd5770ec33f0cc3aa80a41/README.md +50 -0
  191. package/vendor/components/sha256/68c9e866e3cd3e2f8179ede44a005c7f31cef0ed07fd5770ec33f0cc3aa80a41/demo.html +63 -0
  192. package/vendor/components/sha256/68c9e866e3cd3e2f8179ede44a005c7f31cef0ed07fd5770ec33f0cc3aa80a41/index.js +219 -0
  193. package/vendor/components/sha256/693e2aa59e822d38c48eca7271cc020f8e0a6f6189f2409895318ed2a3f0b809/CHANGELOG.md +28 -0
  194. package/vendor/components/sha256/693e2aa59e822d38c48eca7271cc020f8e0a6f6189f2409895318ed2a3f0b809/README.md +35 -0
  195. package/vendor/components/sha256/693e2aa59e822d38c48eca7271cc020f8e0a6f6189f2409895318ed2a3f0b809/demo.html +73 -0
  196. package/vendor/components/sha256/693e2aa59e822d38c48eca7271cc020f8e0a6f6189f2409895318ed2a3f0b809/index.js +228 -0
  197. package/vendor/components/sha256/6b24ab9b90b4f2275af9f61073fe9d65b8b9d16573d639ae07352f29b8b067a1/CHANGELOG.md +34 -0
  198. package/vendor/components/sha256/6b24ab9b90b4f2275af9f61073fe9d65b8b9d16573d639ae07352f29b8b067a1/README.md +65 -0
  199. package/vendor/components/sha256/6b24ab9b90b4f2275af9f61073fe9d65b8b9d16573d639ae07352f29b8b067a1/demo.html +97 -0
  200. package/vendor/components/sha256/6b24ab9b90b4f2275af9f61073fe9d65b8b9d16573d639ae07352f29b8b067a1/index.js +920 -0
  201. package/vendor/components/sha256/6c25dc07f75697e7388564ad689303c370d49142aab9e6672baec15a0313a2fa/CHANGELOG.md +31 -0
  202. package/vendor/components/sha256/6c25dc07f75697e7388564ad689303c370d49142aab9e6672baec15a0313a2fa/README.md +39 -0
  203. package/vendor/components/sha256/6c25dc07f75697e7388564ad689303c370d49142aab9e6672baec15a0313a2fa/demo.html +66 -0
  204. package/vendor/components/sha256/6c25dc07f75697e7388564ad689303c370d49142aab9e6672baec15a0313a2fa/index.js +304 -0
  205. package/vendor/components/sha256/75a20673474b3104da24a7cb0d0483394bed380ff1c108a9a529bcdd1de0f1fb/CHANGELOG.md +31 -0
  206. package/vendor/components/sha256/75a20673474b3104da24a7cb0d0483394bed380ff1c108a9a529bcdd1de0f1fb/README.md +40 -0
  207. package/vendor/components/sha256/75a20673474b3104da24a7cb0d0483394bed380ff1c108a9a529bcdd1de0f1fb/demo.html +92 -0
  208. package/vendor/components/sha256/75a20673474b3104da24a7cb0d0483394bed380ff1c108a9a529bcdd1de0f1fb/index.js +424 -0
  209. package/vendor/components/sha256/8534966fead40ce56110b49bd8cabcd3fb703665e7c164abdfcc9aa29f3ce018/CHANGELOG.md +26 -0
  210. package/vendor/components/sha256/8534966fead40ce56110b49bd8cabcd3fb703665e7c164abdfcc9aa29f3ce018/README.md +57 -0
  211. package/vendor/components/sha256/8534966fead40ce56110b49bd8cabcd3fb703665e7c164abdfcc9aa29f3ce018/demo.html +121 -0
  212. package/vendor/components/sha256/8534966fead40ce56110b49bd8cabcd3fb703665e7c164abdfcc9aa29f3ce018/index.js +875 -0
  213. package/vendor/components/sha256/85f2da6dbed2b9beedaf3ffdea237f3f7940f9b1d4c0d056caa67e937d2dad8d/CHANGELOG.md +20 -0
  214. package/vendor/components/sha256/85f2da6dbed2b9beedaf3ffdea237f3f7940f9b1d4c0d056caa67e937d2dad8d/README.md +46 -0
  215. package/vendor/components/sha256/85f2da6dbed2b9beedaf3ffdea237f3f7940f9b1d4c0d056caa67e937d2dad8d/demo.html +112 -0
  216. package/vendor/components/sha256/85f2da6dbed2b9beedaf3ffdea237f3f7940f9b1d4c0d056caa67e937d2dad8d/index.js +443 -0
  217. package/vendor/components/sha256/87ca8b6a8995a8fe11206e2def2d6df54075092d15f2f900b25767dbe9bf998e/CHANGELOG.md +22 -0
  218. package/vendor/components/sha256/87ca8b6a8995a8fe11206e2def2d6df54075092d15f2f900b25767dbe9bf998e/README.md +35 -0
  219. package/vendor/components/sha256/87ca8b6a8995a8fe11206e2def2d6df54075092d15f2f900b25767dbe9bf998e/demo.html +69 -0
  220. package/vendor/components/sha256/87ca8b6a8995a8fe11206e2def2d6df54075092d15f2f900b25767dbe9bf998e/index.js +217 -0
  221. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/CHANGELOG.md +46 -0
  222. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/LICENSE-strokesvg.txt +115 -0
  223. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/OFL.txt +93 -0
  224. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/README.md +30 -0
  225. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/demo.html +40 -0
  226. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/index.js +749 -0
  227. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/strokes-CHANGES.md +20 -0
  228. package/vendor/components/sha256/9043427ed434c76fba5b11ddd863c40d99b6157e194cfc729895cbaa4940496c/CHANGELOG.md +40 -0
  229. package/vendor/components/sha256/9043427ed434c76fba5b11ddd863c40d99b6157e194cfc729895cbaa4940496c/README.md +36 -0
  230. package/vendor/components/sha256/9043427ed434c76fba5b11ddd863c40d99b6157e194cfc729895cbaa4940496c/demo.html +52 -0
  231. package/vendor/components/sha256/9043427ed434c76fba5b11ddd863c40d99b6157e194cfc729895cbaa4940496c/index.js +268 -0
  232. package/vendor/components/sha256/9bec862c19d5442f80a2a548a5c24911219469332a6b7fc63689a56f1f3209f4/CHANGELOG.md +31 -0
  233. package/vendor/components/sha256/9bec862c19d5442f80a2a548a5c24911219469332a6b7fc63689a56f1f3209f4/README.md +46 -0
  234. package/vendor/components/sha256/9bec862c19d5442f80a2a548a5c24911219469332a6b7fc63689a56f1f3209f4/demo.html +112 -0
  235. package/vendor/components/sha256/9bec862c19d5442f80a2a548a5c24911219469332a6b7fc63689a56f1f3209f4/index.js +481 -0
  236. package/vendor/components/sha256/9cf9789f26ceaae205d48bb083e823e768413e3b2227f87de09e3cde2105a68b/CHANGELOG.md +36 -0
  237. package/vendor/components/sha256/9cf9789f26ceaae205d48bb083e823e768413e3b2227f87de09e3cde2105a68b/README.md +73 -0
  238. package/vendor/components/sha256/9cf9789f26ceaae205d48bb083e823e768413e3b2227f87de09e3cde2105a68b/demo.html +76 -0
  239. package/vendor/components/sha256/9cf9789f26ceaae205d48bb083e823e768413e3b2227f87de09e3cde2105a68b/index.js +805 -0
  240. package/vendor/components/sha256/a034214e470de8f6fa3032f65c8534c87862859525105bdfe94e347ad6a33587/CHANGELOG.md +24 -0
  241. package/vendor/components/sha256/a034214e470de8f6fa3032f65c8534c87862859525105bdfe94e347ad6a33587/README.md +35 -0
  242. package/vendor/components/sha256/a034214e470de8f6fa3032f65c8534c87862859525105bdfe94e347ad6a33587/demo.html +53 -0
  243. package/vendor/components/sha256/a034214e470de8f6fa3032f65c8534c87862859525105bdfe94e347ad6a33587/index.js +481 -0
  244. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/CHANGELOG.md +41 -0
  245. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/LICENSE-strokesvg.txt +115 -0
  246. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/OFL.txt +93 -0
  247. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/README.md +33 -0
  248. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/demo.html +40 -0
  249. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/index.js +749 -0
  250. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/strokes-CHANGES.md +20 -0
  251. package/vendor/components/sha256/a6486154cbfe25c500a64cbb2128be45c2e2365e848c34d4c5c10e9a93f6e73c/CHANGELOG.md +35 -0
  252. package/vendor/components/sha256/a6486154cbfe25c500a64cbb2128be45c2e2365e848c34d4c5c10e9a93f6e73c/README.md +35 -0
  253. package/vendor/components/sha256/a6486154cbfe25c500a64cbb2128be45c2e2365e848c34d4c5c10e9a93f6e73c/demo.html +53 -0
  254. package/vendor/components/sha256/a6486154cbfe25c500a64cbb2128be45c2e2365e848c34d4c5c10e9a93f6e73c/index.js +521 -0
  255. package/vendor/components/sha256/a6ad6867e21b4ffab426919d62f4293cbb447c7307f8f92e4a8c8d7c285fca6a/CHANGELOG.md +32 -0
  256. package/vendor/components/sha256/a6ad6867e21b4ffab426919d62f4293cbb447c7307f8f92e4a8c8d7c285fca6a/README.md +39 -0
  257. package/vendor/components/sha256/a6ad6867e21b4ffab426919d62f4293cbb447c7307f8f92e4a8c8d7c285fca6a/demo.html +70 -0
  258. package/vendor/components/sha256/a6ad6867e21b4ffab426919d62f4293cbb447c7307f8f92e4a8c8d7c285fca6a/index.js +166 -0
  259. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/CHANGELOG.md +56 -0
  260. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/README.md +35 -0
  261. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/demo.html +57 -0
  262. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/ABCJS-ADAPTER.md +101 -0
  263. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/LICENSE-abcjs.txt +21 -0
  264. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/chords.json +89 -0
  265. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/doremi.json +261 -0
  266. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/extras.json +192 -0
  267. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/kaeru.json +521 -0
  268. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/rhythm.json +248 -0
  269. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/ties.json +360 -0
  270. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/index.js +508 -0
  271. package/vendor/components/sha256/ae4f864445dff17a19df30c528cb44741558217080f8e6563e0c364025a4d0a6/CHANGELOG.md +31 -0
  272. package/vendor/components/sha256/ae4f864445dff17a19df30c528cb44741558217080f8e6563e0c364025a4d0a6/README.md +34 -0
  273. package/vendor/components/sha256/ae4f864445dff17a19df30c528cb44741558217080f8e6563e0c364025a4d0a6/demo.html +77 -0
  274. package/vendor/components/sha256/ae4f864445dff17a19df30c528cb44741558217080f8e6563e0c364025a4d0a6/index.js +222 -0
  275. package/vendor/components/sha256/b9ee9d0f48ab61977d3aa618e6155ccc3453dbf452235f438fa15db6f554f961/CHANGELOG.md +30 -0
  276. package/vendor/components/sha256/b9ee9d0f48ab61977d3aa618e6155ccc3453dbf452235f438fa15db6f554f961/README.md +50 -0
  277. package/vendor/components/sha256/b9ee9d0f48ab61977d3aa618e6155ccc3453dbf452235f438fa15db6f554f961/demo.html +61 -0
  278. package/vendor/components/sha256/b9ee9d0f48ab61977d3aa618e6155ccc3453dbf452235f438fa15db6f554f961/index.js +171 -0
  279. package/vendor/components/sha256/bd590a6619f80d659299e4e558f770e75244360450939d504a4eaf7989b0eb97/README.md +21 -0
  280. package/vendor/components/sha256/bd590a6619f80d659299e4e558f770e75244360450939d504a4eaf7989b0eb97/index.js +93 -0
  281. package/vendor/components/sha256/bd79435195d9657ad2cb690b49da192bbd20bf1fe25088ba63988dbacafa6f3d/CHANGELOG.md +18 -0
  282. package/vendor/components/sha256/bd79435195d9657ad2cb690b49da192bbd20bf1fe25088ba63988dbacafa6f3d/README.md +21 -0
  283. package/vendor/components/sha256/bd79435195d9657ad2cb690b49da192bbd20bf1fe25088ba63988dbacafa6f3d/demo.html +32 -0
  284. package/vendor/components/sha256/bd79435195d9657ad2cb690b49da192bbd20bf1fe25088ba63988dbacafa6f3d/index.js +53 -0
  285. package/vendor/components/sha256/be709cea3ba3d0a69138d4c55796f59f6322d97ad0bb8c3a75c3e9fcae5a0419/CHANGELOG.md +20 -0
  286. package/vendor/components/sha256/be709cea3ba3d0a69138d4c55796f59f6322d97ad0bb8c3a75c3e9fcae5a0419/README.md +40 -0
  287. package/vendor/components/sha256/be709cea3ba3d0a69138d4c55796f59f6322d97ad0bb8c3a75c3e9fcae5a0419/demo.html +92 -0
  288. package/vendor/components/sha256/be709cea3ba3d0a69138d4c55796f59f6322d97ad0bb8c3a75c3e9fcae5a0419/index.js +399 -0
  289. package/vendor/components/sha256/c252d5ceed6735b7ca8095ac8ef035dfc79f8492b2624d7d2eb94d2a27fafe2b/CHANGELOG.md +28 -0
  290. package/vendor/components/sha256/c252d5ceed6735b7ca8095ac8ef035dfc79f8492b2624d7d2eb94d2a27fafe2b/README.md +36 -0
  291. package/vendor/components/sha256/c252d5ceed6735b7ca8095ac8ef035dfc79f8492b2624d7d2eb94d2a27fafe2b/demo.html +70 -0
  292. package/vendor/components/sha256/c252d5ceed6735b7ca8095ac8ef035dfc79f8492b2624d7d2eb94d2a27fafe2b/index.js +179 -0
  293. package/vendor/components/sha256/c882093b0dc9215cf79d8f42afc5db46dce07c8b677f85148a3efa7355d7221b/CHANGELOG.md +25 -0
  294. package/vendor/components/sha256/c882093b0dc9215cf79d8f42afc5db46dce07c8b677f85148a3efa7355d7221b/README.md +32 -0
  295. package/vendor/components/sha256/c882093b0dc9215cf79d8f42afc5db46dce07c8b677f85148a3efa7355d7221b/demo.html +54 -0
  296. package/vendor/components/sha256/c882093b0dc9215cf79d8f42afc5db46dce07c8b677f85148a3efa7355d7221b/index.js +251 -0
  297. package/vendor/components/sha256/cd714d22f82d64c80db8fdef33ca03aa618803e8114662ee2692fc7c6ac7168c/CHANGELOG.md +34 -0
  298. package/vendor/components/sha256/cd714d22f82d64c80db8fdef33ca03aa618803e8114662ee2692fc7c6ac7168c/README.md +35 -0
  299. package/vendor/components/sha256/cd714d22f82d64c80db8fdef33ca03aa618803e8114662ee2692fc7c6ac7168c/demo.html +69 -0
  300. package/vendor/components/sha256/cd714d22f82d64c80db8fdef33ca03aa618803e8114662ee2692fc7c6ac7168c/index.js +244 -0
  301. package/vendor/components/sha256/d0fbcd5e36c0f38c2d8352acee060e783b58cd2ab1ff0f9e7a60da4b2a6e3232/CHANGELOG.md +19 -0
  302. package/vendor/components/sha256/d0fbcd5e36c0f38c2d8352acee060e783b58cd2ab1ff0f9e7a60da4b2a6e3232/README.md +44 -0
  303. package/vendor/components/sha256/d0fbcd5e36c0f38c2d8352acee060e783b58cd2ab1ff0f9e7a60da4b2a6e3232/demo.html +44 -0
  304. package/vendor/components/sha256/d0fbcd5e36c0f38c2d8352acee060e783b58cd2ab1ff0f9e7a60da4b2a6e3232/index.js +334 -0
  305. package/vendor/components/sha256/d159f55bb5a72bc67c4ffa856bf9e1735d3c37f5cad9673accffc1e1953182e0/CHANGELOG.md +37 -0
  306. package/vendor/components/sha256/d159f55bb5a72bc67c4ffa856bf9e1735d3c37f5cad9673accffc1e1953182e0/README.md +43 -0
  307. package/vendor/components/sha256/d159f55bb5a72bc67c4ffa856bf9e1735d3c37f5cad9673accffc1e1953182e0/demo.html +75 -0
  308. package/vendor/components/sha256/d159f55bb5a72bc67c4ffa856bf9e1735d3c37f5cad9673accffc1e1953182e0/index.js +348 -0
  309. package/vendor/components/sha256/d29e8fbfd371edf4dea02996c8b43028af511a5f1c212e3b5d89fff68a54e55e/CHANGELOG.md +20 -0
  310. package/vendor/components/sha256/d29e8fbfd371edf4dea02996c8b43028af511a5f1c212e3b5d89fff68a54e55e/README.md +39 -0
  311. package/vendor/components/sha256/d29e8fbfd371edf4dea02996c8b43028af511a5f1c212e3b5d89fff68a54e55e/demo.html +70 -0
  312. package/vendor/components/sha256/d29e8fbfd371edf4dea02996c8b43028af511a5f1c212e3b5d89fff68a54e55e/index.js +134 -0
  313. package/vendor/components/sha256/d4159ba1206d094364b7735750e5e2532aeabbc299e0d6858e3a0edb84495e11/README.md +22 -0
  314. package/vendor/components/sha256/d4159ba1206d094364b7735750e5e2532aeabbc299e0d6858e3a0edb84495e11/index.js +59 -0
  315. package/vendor/components/sha256/d92842c606795528d1246ddb050ac275e1b72659629185750a6e9ac7fdb763a3/README.md +20 -0
  316. package/vendor/components/sha256/d92842c606795528d1246ddb050ac275e1b72659629185750a6e9ac7fdb763a3/index.js +162 -0
  317. package/vendor/components/sha256/de611e2477042b14eb9c04bb98ad0bbe6d7b44ca829213dd1a7a2b94d8f946ae/CHANGELOG.md +33 -0
  318. package/vendor/components/sha256/de611e2477042b14eb9c04bb98ad0bbe6d7b44ca829213dd1a7a2b94d8f946ae/README.md +46 -0
  319. package/vendor/components/sha256/de611e2477042b14eb9c04bb98ad0bbe6d7b44ca829213dd1a7a2b94d8f946ae/demo.html +43 -0
  320. package/vendor/components/sha256/de611e2477042b14eb9c04bb98ad0bbe6d7b44ca829213dd1a7a2b94d8f946ae/index.js +278 -0
  321. package/vendor/components/sha256/de90044c2961a30c88570e41d0c41bfc5037fe691f6f81e12d8e9d3545cd6ec4/CHANGELOG.md +15 -0
  322. package/vendor/components/sha256/de90044c2961a30c88570e41d0c41bfc5037fe691f6f81e12d8e9d3545cd6ec4/README.md +25 -0
  323. package/vendor/components/sha256/de90044c2961a30c88570e41d0c41bfc5037fe691f6f81e12d8e9d3545cd6ec4/demo.html +48 -0
  324. package/vendor/components/sha256/de90044c2961a30c88570e41d0c41bfc5037fe691f6f81e12d8e9d3545cd6ec4/index.js +88 -0
  325. package/vendor/components/sha256/de9607f86221006e7bad43f1f661c751d9a6f8f9c62da5c7e0d7f1249b9afcd6/README.md +25 -0
  326. package/vendor/components/sha256/de9607f86221006e7bad43f1f661c751d9a6f8f9c62da5c7e0d7f1249b9afcd6/index.js +122 -0
  327. package/vendor/components/sha256/e6b022135d0a0bd85a508404f46005986b14d0d175af7ca54b4d024b1e490318/CHANGELOG.md +20 -0
  328. package/vendor/components/sha256/e6b022135d0a0bd85a508404f46005986b14d0d175af7ca54b4d024b1e490318/README.md +23 -0
  329. package/vendor/components/sha256/e6b022135d0a0bd85a508404f46005986b14d0d175af7ca54b4d024b1e490318/demo.html +236 -0
  330. package/vendor/components/sha256/e6b022135d0a0bd85a508404f46005986b14d0d175af7ca54b4d024b1e490318/index.js +572 -0
  331. package/vendor/components/sha256/e6bbe784ee452d52d534b8fb3a0924e65c49bbb5926139ef5eabd9193500b357/CHANGELOG.md +29 -0
  332. package/vendor/components/sha256/e6bbe784ee452d52d534b8fb3a0924e65c49bbb5926139ef5eabd9193500b357/README.md +23 -0
  333. package/vendor/components/sha256/e6bbe784ee452d52d534b8fb3a0924e65c49bbb5926139ef5eabd9193500b357/demo.html +33 -0
  334. package/vendor/components/sha256/e6bbe784ee452d52d534b8fb3a0924e65c49bbb5926139ef5eabd9193500b357/index.js +121 -0
  335. package/vendor/components/sha256/eb5efa15920d9883af15d105cc0f7a9b2c781d792faae34a43d44738138b219f/CHANGELOG.md +29 -0
  336. package/vendor/components/sha256/eb5efa15920d9883af15d105cc0f7a9b2c781d792faae34a43d44738138b219f/README.md +32 -0
  337. package/vendor/components/sha256/eb5efa15920d9883af15d105cc0f7a9b2c781d792faae34a43d44738138b219f/demo.html +56 -0
  338. package/vendor/components/sha256/eb5efa15920d9883af15d105cc0f7a9b2c781d792faae34a43d44738138b219f/index.js +232 -0
  339. package/vendor/components/sha256/ebded96e5827ecf359b73ac0d50a807227d9a06294bd5dabc84263e32c0eeebe/CHANGELOG.md +25 -0
  340. package/vendor/components/sha256/ebded96e5827ecf359b73ac0d50a807227d9a06294bd5dabc84263e32c0eeebe/README.md +71 -0
  341. package/vendor/components/sha256/ebded96e5827ecf359b73ac0d50a807227d9a06294bd5dabc84263e32c0eeebe/demo.html +76 -0
  342. package/vendor/components/sha256/ebded96e5827ecf359b73ac0d50a807227d9a06294bd5dabc84263e32c0eeebe/index.js +777 -0
  343. package/vendor/components/sha256/ed44804fc14b2755a82960d94cb0322858732ad789fd9a46704ee88955bd65e6/CHANGELOG.md +33 -0
  344. package/vendor/components/sha256/ed44804fc14b2755a82960d94cb0322858732ad789fd9a46704ee88955bd65e6/README.md +28 -0
  345. package/vendor/components/sha256/ed44804fc14b2755a82960d94cb0322858732ad789fd9a46704ee88955bd65e6/demo.html +236 -0
  346. package/vendor/components/sha256/ed44804fc14b2755a82960d94cb0322858732ad789fd9a46704ee88955bd65e6/index.js +600 -0
  347. package/vendor/components/sha256/ee8519d664179e6b6bb6d2f8cc5b1c07a0ebf3871a8681d28ddd08fecd5f3388/CHANGELOG.md +16 -0
  348. package/vendor/components/sha256/ee8519d664179e6b6bb6d2f8cc5b1c07a0ebf3871a8681d28ddd08fecd5f3388/README.md +38 -0
  349. package/vendor/components/sha256/ee8519d664179e6b6bb6d2f8cc5b1c07a0ebf3871a8681d28ddd08fecd5f3388/demo.html +115 -0
  350. package/vendor/components/sha256/ee8519d664179e6b6bb6d2f8cc5b1c07a0ebf3871a8681d28ddd08fecd5f3388/index.js +361 -0
  351. package/vendor/components/sha256/ef969fa27f1e11aa52a174874292366c7c8201c7c0d8236a7aef7d7eacf6a177/CHANGELOG.md +27 -0
  352. package/vendor/components/sha256/ef969fa27f1e11aa52a174874292366c7c8201c7c0d8236a7aef7d7eacf6a177/README.md +27 -0
  353. package/vendor/components/sha256/ef969fa27f1e11aa52a174874292366c7c8201c7c0d8236a7aef7d7eacf6a177/demo.html +42 -0
  354. package/vendor/components/sha256/ef969fa27f1e11aa52a174874292366c7c8201c7c0d8236a7aef7d7eacf6a177/index.js +233 -0
  355. package/vendor/components/sha256/f268cf809438c8af63a42f9c9121110fc7263e4d705c40c6206ce46cf7ec167b/README.md +23 -0
  356. package/vendor/components/sha256/f268cf809438c8af63a42f9c9121110fc7263e4d705c40c6206ce46cf7ec167b/index.js +180 -0
  357. package/vendor/components/sha256/f3f55f5ee11ebc66656ca40ff23cd2df6a48f09a2380469f96f8f48033ddf2f7/CHANGELOG.md +31 -0
  358. package/vendor/components/sha256/f3f55f5ee11ebc66656ca40ff23cd2df6a48f09a2380469f96f8f48033ddf2f7/README.md +36 -0
  359. package/vendor/components/sha256/f3f55f5ee11ebc66656ca40ff23cd2df6a48f09a2380469f96f8f48033ddf2f7/demo.html +50 -0
  360. package/vendor/components/sha256/f3f55f5ee11ebc66656ca40ff23cd2df6a48f09a2380469f96f8f48033ddf2f7/index.js +263 -0
  361. package/vendor/components/sha256/fa8c1e548234bdbfa401bb4b085c5ef24d607a006c377c8c1cf3bcfc52427a5e/CHANGELOG.md +20 -0
  362. package/vendor/components/sha256/fa8c1e548234bdbfa401bb4b085c5ef24d607a006c377c8c1cf3bcfc52427a5e/README.md +39 -0
  363. package/vendor/components/sha256/fa8c1e548234bdbfa401bb4b085c5ef24d607a006c377c8c1cf3bcfc52427a5e/demo.html +66 -0
  364. package/vendor/components/sha256/fa8c1e548234bdbfa401bb4b085c5ef24d607a006c377c8c1cf3bcfc52427a5e/index.js +258 -0
  365. package/vendor/components/sha256/fadd24868e2730ec14b8f3f1e9cb75b8577a48b8d71beaa12ef089f7a3ba0a7d/README.md +22 -0
  366. package/vendor/components/sha256/fadd24868e2730ec14b8f3f1e9cb75b8577a48b8d71beaa12ef089f7a3ba0a7d/index.js +37 -0
  367. package/vendor/components/sha256/faf6a2f0b5df589639de624e75c5b20594f517e4426f6415d152809249b00b92/README.md +19 -0
  368. package/vendor/components/sha256/faf6a2f0b5df589639de624e75c5b20594f517e4426f6415d152809249b00b92/index.js +200 -0
  369. package/vendor/components/sha256/fd07adeb4b775e139092dd69a3fcbca4528d08e67be6b9e9cf53d4fd06be775b/CHANGELOG.md +25 -0
  370. package/vendor/components/sha256/fd07adeb4b775e139092dd69a3fcbca4528d08e67be6b9e9cf53d4fd06be775b/README.md +32 -0
  371. package/vendor/components/sha256/fd07adeb4b775e139092dd69a3fcbca4528d08e67be6b9e9cf53d4fd06be775b/demo.html +51 -0
  372. package/vendor/components/sha256/fd07adeb4b775e139092dd69a3fcbca4528d08e67be6b9e9cf53d4fd06be775b/index.js +270 -0
  373. package/vendor/components/sha256/ffac8bd95044aeb032b20dc8412ced70d09759d993955ef66697d4f2aa7f97a5/CHANGELOG.md +19 -0
  374. package/vendor/components/sha256/ffac8bd95044aeb032b20dc8412ced70d09759d993955ef66697d4f2aa7f97a5/README.md +34 -0
  375. package/vendor/components/sha256/ffac8bd95044aeb032b20dc8412ced70d09759d993955ef66697d4f2aa7f97a5/demo.html +60 -0
  376. package/vendor/components/sha256/ffac8bd95044aeb032b20dc8412ced70d09759d993955ef66697d4f2aa7f97a5/index.js +209 -0
  377. package/vendor/components-2/manifest-2.2.0.json +1868 -0
  378. package/vendor/csl/SOURCE.json +17 -0
  379. package/vendor/csl/locales/locales-en-US.xml +864 -0
  380. package/vendor/csl/locales/locales-ja-JP.xml +676 -0
  381. package/vendor/csl/styles/apa.csl +2278 -0
  382. package/vendor/csl/styles/ieee.csl +519 -0
  383. package/vendor/csl/styles/sist02.csl +273 -0
  384. package/vendor/egatari-spec/SOURCE.json +3 -3
  385. package/vendor/egatari-spec/schema/deck-meta.schema.json +6 -0
@@ -0,0 +1,174 @@
1
+ // スライドと本文の節のつながりと、その古さ(format spec §9C.5・§9C.7)。
2
+ // つながっている組(linked pair):スライドの data-article がその節を挙げる、または節の原稿にそのスライドへの {step} のリンクがある。
3
+ // 記録:egatari.json と index の articleLinks[スライドの鍵][節の id] = {article, slide}(つないだ・確かめたときの 2 つの hash。SHA-256 の 16 進の小文字)
4
+ // article:節の原稿の字(節の見出しの行から、同じかより上の段の次の見出しの前まで。次の見出しの (…)= の行は除く)
5
+ // slide:JSON.stringify([deck.html のそのスライドの <section>…</section>, narration.md のそのスライドの「## 」の行から次の「## 」の前まで])
6
+ // どれも NFC・LF にして前後の空白を除く。描いた字(番号)は使わない(ほかの図の番号が変わっただけで古くならないように)
7
+ // 状態:ok(記録と今が同じ)・article(節が変わった:スライドが古いかもしれない)・slide(スライドが変わった:節が古いかもしれない)・
8
+ // both・unconfirmed(記録がない)。編集アプリは「スライドと本が合っていないかもしれません」と出す。どちらの字も自動では直さない(§9C.7)
9
+ // 組み立て(1 ファイルへの書き出し)は、もうつながっていない組の記録を外す。記録を足すのは npm run ids(つないだ組)と、確かめたとき
10
+ // 編集アプリと共有する(node: の読み込み・fs を使わない。hash は crypto.subtle)。
11
+ import { visit } from './article-text.mjs';
12
+ import { parseStep } from './article.mjs';
13
+ import { parseHeading } from './narration-parse.mjs';
14
+
15
+ const own = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
16
+ const isObj = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
17
+ const HEX64 = /^[0-9a-f]{64}$/;
18
+ const norm = (s) => String(s).normalize('NFC').replace(/\r\n?/g, '\n').trim();
19
+
20
+ // つながっている組:[{slide, section}](本文の順、その中はスライドの data-article・{step} の順。重ねない)。
21
+ // article:readArticle の結果。dataArticle:kit/core/article.mjs の dataArticleOf の結果([{slide, ids}])
22
+ export function linkedPairs(article, dataArticle = []) {
23
+ const sections = new Set(), out = [], seen = new Set();
24
+ const add = (slide, section) => { const k = `${slide}\u0000${section}`; if (!seen.has(k)) { seen.add(k); out.push({ slide, section }); } };
25
+ for (const f of article.files) for (const top of f.tree.children || []) if (top.type === 'heading' && top.depth === 2 && top.label) sections.add(String(top.label));
26
+ for (const f of article.files) {
27
+ let section = null;
28
+ for (const top of f.tree.children || []) {
29
+ if (top.type === 'heading' && top.depth === 2) section = top.label ? String(top.label) : null;
30
+ if (!section) continue;
31
+ visit(top, (n) => { if (n.type === 'mystRole' && n.name === 'step') { const s = parseStep(n.value); if (s) add(s.slideKey, section); } });
32
+ }
33
+ }
34
+ for (const d of dataArticle) for (const id of d.ids) if (sections.has(id)) add(d.slide, id);
35
+ return out;
36
+ }
37
+
38
+ // 節の原稿の字(§9C.7 の article)。返すもの:{節の id → 字}
39
+ export function sectionSources(article) {
40
+ const out = {};
41
+ for (const f of article.files) {
42
+ const lines = String(f.source || '').replace(/^/, '').split(/\r?\n/);
43
+ const off = f.lineOffset || 0;
44
+ const heads = (f.tree.children || []).filter((n) => n.type === 'heading' && n.position);
45
+ heads.forEach((h, j) => {
46
+ if (h.depth !== 2 || !h.label) return;
47
+ const start = h.position.start.line + off; // 1 から
48
+ const next = heads.slice(j + 1).find((x) => x.depth <= h.depth);
49
+ let end = next ? next.position.start.line + off - 1 : lines.length; // 含まない(1 から数えた行の番号のひとつ前まで)
50
+ if (next && next.label && end > start && /^\s*\([^()\s]+\)=\s*$/.test(lines[end - 1])) end--;
51
+ out[String(h.label)] = norm(lines.slice(start - 1, end).join('\n'));
52
+ });
53
+ }
54
+ return out;
55
+ }
56
+
57
+ // スライドの原稿の字(§9C.7 の slide の材料):deck.html のそのスライドの要素(<section から対応する </section> まで)。なければ null
58
+ export function slideElementText(deckHtml, slideKey) {
59
+ const src = String(deckHtml);
60
+ const tagRe = /<(\/?)section\b[^>]*>/gi;
61
+ let m, start = -1, depth = 0;
62
+ while ((m = tagRe.exec(src))) {
63
+ if (start < 0) {
64
+ if (m[1]) continue;
65
+ const t = m[0];
66
+ if (!/\bclass\s*=\s*["']?[^"'>]*\bslide\b/i.test(t)) continue;
67
+ const id = (t.match(/\sid\s*=\s*["']([^"']*)["']/i) || t.match(/\sid\s*=\s*([^\s>"']+)/i) || [])[1];
68
+ const key = (t.match(/\sdata-key\s*=\s*["']([^"']*)["']/i) || [])[1];
69
+ if (id !== slideKey && key !== slideKey) continue;
70
+ start = m.index; depth = 1;
71
+ } else if (m[1]) { if (--depth === 0) return src.slice(start, m.index + m[0].length); }
72
+ else depth++;
73
+ }
74
+ return null;
75
+ }
76
+ // narration.md のそのスライドの段(「## 」の見出しの行から次の「## 」の前まで)。なければ ''
77
+ export function narrationBlockText(narration, slideKey) {
78
+ const lines = String(narration || '').split(/\r?\n/);
79
+ let from = -1;
80
+ for (let i = 0; i < lines.length; i++) {
81
+ const h = lines[i].match(/^##\s+(.+?)\s*$/);
82
+ if (!h) continue;
83
+ if (from >= 0) return lines.slice(from, i).join('\n');
84
+ const p = parseHeading(h[1]);
85
+ if (p.key === slideKey || p.id === slideKey) from = i;
86
+ }
87
+ return from >= 0 ? lines.slice(from).join('\n') : '';
88
+ }
89
+
90
+ export async function sha256HexText(s) {
91
+ const d = await globalThis.crypto.subtle.digest('SHA-256', new TextEncoder().encode(s));
92
+ return [...new Uint8Array(d)].map((b) => b.toString(16).padStart(2, '0')).join('');
93
+ }
94
+ // 今の hash:{スライドの鍵: {節の id: {article, slide}}}(つながっている組だけ。スライドの要素が見つからなければ slide は null)
95
+ export async function currentLinkHashes(article, pairs, deckHtml, narration) {
96
+ const secs = sectionSources(article);
97
+ const slideHash = new Map(), out = {};
98
+ for (const { slide, section } of pairs) {
99
+ if (!own(secs, section)) continue;
100
+ if (!slideHash.has(slide)) {
101
+ const el = slideElementText(deckHtml, slide);
102
+ slideHash.set(slide, el === null ? null : await sha256HexText(JSON.stringify([norm(el), norm(narrationBlockText(narration, slide))])));
103
+ }
104
+ if (!own(out, slide)) out[slide] = {};
105
+ out[slide][section] = { article: await sha256HexText(secs[section]), slide: slideHash.get(slide) };
106
+ }
107
+ return out;
108
+ }
109
+
110
+ // 記録の形(egatari.json・index の articleLinks)が正しいか。返すもの:誤りの字の配列
111
+ export function articleLinksProblems(links) {
112
+ const e = [];
113
+ if (!isObj(links)) return ['articleLinks: not an object'];
114
+ for (const [s, m] of Object.entries(links)) {
115
+ if (!isObj(m)) { e.push(`articleLinks["${s}"]: not an object`); continue; }
116
+ for (const [sec, r] of Object.entries(m)) {
117
+ if (!isObj(r) || !HEX64.test(String(r.article)) || !HEX64.test(String(r.slide))) e.push(`articleLinks["${s}"]["${sec}"]: not {article, slide} (lowercase hex SHA-256)`);
118
+ }
119
+ }
120
+ return e;
121
+ }
122
+ // 組ごとの状態:[{slide, section, state}](pairs の順)。recorded:記録(形の誤りは記録なしとみなす)。current:currentLinkHashes の結果
123
+ export function linkStates(recorded, current, pairs) {
124
+ const rec = isObj(recorded) ? recorded : {};
125
+ const out = [];
126
+ for (const { slide, section } of pairs) {
127
+ const c = current[slide] && current[slide][section];
128
+ if (!c) continue;
129
+ const r = isObj(rec[slide]) && isObj(rec[slide][section]) ? rec[slide][section] : null;
130
+ let state = 'ok';
131
+ if (!r || !HEX64.test(String(r.article)) || !HEX64.test(String(r.slide))) state = 'unconfirmed';
132
+ else {
133
+ const a = r.article !== c.article, s = c.slide !== null && r.slide !== c.slide;
134
+ state = a && s ? 'both' : a ? 'article' : s ? 'slide' : 'ok';
135
+ }
136
+ out.push({ slide, section, state });
137
+ }
138
+ return out;
139
+ }
140
+ // もうつながっていない組の記録を外したもの(§9C.7:組み立てのとき)。返すもの:{links(記録が 1 つもなければ null), removed: [{slide, section}]}
141
+ export function pruneLinks(recorded, pairs) {
142
+ if (!isObj(recorded)) return { links: null, removed: [] };
143
+ const want = new Set(pairs.map((p) => `${p.slide}\u0000${p.section}`));
144
+ const links = {}, removed = [];
145
+ for (const [s, m] of Object.entries(recorded)) {
146
+ if (!isObj(m)) continue;
147
+ for (const [sec, r] of Object.entries(m)) {
148
+ if (!want.has(`${s}\u0000${sec}`)) { removed.push({ slide: s, section: sec }); continue; }
149
+ if (!own(links, s)) links[s] = {};
150
+ links[s][sec] = r;
151
+ }
152
+ }
153
+ return { links: Object.keys(links).length ? links : null, removed };
154
+ }
155
+ // 記録を付ける:mode 'missing'(記録のない組だけ。つないだとき)・'all'(つながっている組すべてを今の hash で。確かめたとき)。
156
+ // only:確かめる組を絞る([{slide, section?}]。section がなければそのスライドの組すべて)。返すもの:{links, added: [{slide, section}]}
157
+ export function recordLinks(recorded, current, pairs, { mode = 'missing', only = null } = {}) {
158
+ const pr = pruneLinks(recorded, pairs);
159
+ const links = pr.links || {};
160
+ const added = [];
161
+ const pick = (p) => !only || only.some((o) => o.slide === p.slide && (!o.section || o.section === p.section));
162
+ for (const p of pairs) {
163
+ const c = current[p.slide] && current[p.slide][p.section];
164
+ if (!c || c.slide === null || !pick(p)) continue;
165
+ const r = isObj(links[p.slide]) ? links[p.slide][p.section] : undefined;
166
+ const valid = isObj(r) && HEX64.test(String(r.article)) && HEX64.test(String(r.slide));
167
+ if (mode === 'missing' && valid) continue;
168
+ if (valid && r.article === c.article && r.slide === c.slide) continue;
169
+ if (!own(links, p.slide)) links[p.slide] = {};
170
+ links[p.slide][p.section] = { article: c.article, slide: c.slide };
171
+ added.push({ slide: p.slide, section: p.section });
172
+ }
173
+ return { links: Object.keys(links).length ? links : null, added, removed: pr.removed };
174
+ }
@@ -0,0 +1,119 @@
1
+ // 本文の点検(kit/core/article-text.mjs・article.mjs)の知らせの言葉(日本語・英語)。何が違うかと、どう直すか。
2
+ // 場所(ファイル・行)は articleWhere が前に付け、仕様の節(§9C.x)は後ろに付ける。check(kit/check-messages.mjs の MESSAGES)と build が使う
3
+ import { quoteJa } from './quote-ja.mjs';
4
+ const hintJa = (a) => (a.hint ? `:${a.hint} と書く` : '');
5
+ const hintEn = (a) => (a.hint ? `: write ${a.hint}` : '');
6
+ const WHY_SUBFIG = {
7
+ ja: { alt: '小さな図に :alt: がない', path: '小さな図に画像のパスがない', paragraph: '1 つの段落に画像を並べている(alt が見出しになって消える)。画像ごとに :::{figure} <パス> と :alt: を書き、外の図は ::::{figure} にする', count: '小さな図を持つ図に、:::{figure} <パス> が 2 つ以上ない' },
8
+ en: { alt: 'a subfigure has no :alt:', path: 'a subfigure has no image path', paragraph: 'images side by side in one paragraph (their alt text would become captions): write one :::{figure} <path> with :alt: per image inside a ::::{figure}', count: 'a figure with subfigures needs two or more :::{figure} <path> inside' },
9
+ };
10
+ const WHY_GLOSS = {
11
+ ja: { second: '用語集が 2 つ目(本文全体で 1 つまで)', body: '用語集の中は定義の並び(用語の行と「: 説明」の行)1 つだけ', markup: (a) => `用語「${a.term}」に飾り(強調など)がある:用語は飾りのない字で書く`, twice: (a) => `用語「${a.term}」が 2 度ある` },
12
+ en: { second: 'a second glossary (one per article)', body: 'a glossary holds exactly one definition list (a term line, then ": description" lines)', markup: (a) => `the term “${a.term}” has markup: write terms as plain text`, twice: (a) => `the term “${a.term}” is listed twice` },
13
+ };
14
+ const WHY_LABEL = {
15
+ ja: { pattern: '名前の書式(英字で始まり、英数字・_・- の 64 字まで)に合わない', reserved: 'sec-・s-・ref-・fn-・term-・egatari- で始まる名前は使えない(節の id・文献・脚注・用語に取ってある)。fig-・tbl-・eq-・box- などにする', section: '節(## の見出し)の id は sec- で始まる(npm run ids が付ける)' },
16
+ en: { pattern: 'does not match the label pattern (a letter, then up to 63 letters, digits, _ or -)', reserved: 'labels may not start with sec-, s-, ref-, fn-, term- or egatari- (reserved for section ids, references, footnotes and terms): use fig-, tbl-, eq-, box-, …', section: 'a section id (on a ## heading) starts with sec- (npm run ids adds one)' },
17
+ };
18
+ const WHY_SOL = { ja: { missing: 'がない', 'not-exercise': 'は問(:::{exercise})でない', twice: 'の解答が 2 つ目(1 つの問に 1 つまで)' }, en: { missing: 'does not exist', 'not-exercise': 'is not an exercise', twice: 'already has a solution (one per exercise)' } };
19
+ const WHY_STEP = {
20
+ ja: (a) => (a.why === 'slide' ? 'のスライドがない' : a.why === 'not-id' ? 'のスライドの鍵がスライドの id でない(npm run ids で id を付ける)' : a.why === 'concl' ? 'のスライドに結論のステップがない' : `のステップがない${a.max !== undefined ? `(0〜${a.max})` : ''}`),
21
+ en: (a) => (a.why === 'slide' ? ': no such slide' : a.why === 'not-id' ? ': the slide key is not a slide id (add ids with npm run ids)' : a.why === 'concl' ? ': the slide has no conclusion step' : `: no such step${a.max !== undefined ? ` (0–${a.max})` : ''}`),
22
+ };
23
+ const ENC = { ja: { bom: '先頭に BOM がある(BOM なしの UTF-8 にする)', crlf: '改行が CRLF(LF にする)', nfc: 'Unicode の NFC になっていない(NFC で保存する)' }, en: { bom: 'starts with a BOM (save as UTF-8 without BOM)', crlf: 'has CRLF line endings (use LF)', nfc: 'is not in Unicode NFC (save it normalized to NFC)' } };
24
+
25
+ export const ARTICLE_MESSAGES = {
26
+ articleEncoding: { ja: (a) => `本文のファイルが${ENC.ja[a.what]}`, en: (a) => `the article file ${ENC.en[a.what]}` },
27
+ articleFrontMatter: { ja: (a) => `前付けの行「${a.text}」が読めない:1 行に「名前: 値」だけを書く`, en: (a) => `cannot read the front matter line “${a.text}”: write one “name: value” per line` },
28
+ articleFrontMatterMember: { ja: (a) => `前付けの「${a.member}」は書けない(title・subtitle・lang・bibliography・writing-mode・chapter・kind・numbering だけ)`, en: (a) => `the front matter member “${a.member}” is not allowed (only title, subtitle, lang, bibliography, writing-mode, chapter, kind, numbering)` },
29
+ articleFrontMatterValue: { ja: (a) => `前付けの ${a.member} の値「${a.value}」が違う(${{ string: '空でない字', lang: '言語の名前(ja・en など)', mode: 'horizontal-tb か vertical-rl', posint: '正の整数', kind: 'preface・chapter・appendix・afterword のどれか', boolean: 'true か false' }[a.expected]})`, en: (a) => `front matter ${a.member}: “${a.value}” is not ${{ string: 'a non-empty string', lang: 'a language tag (ja, en, …)', mode: 'horizontal-tb or vertical-rl', posint: 'a positive integer', kind: 'one of preface, chapter, appendix, afterword', boolean: 'true or false' }[a.expected]}` },
30
+ articleKindChapter: { ja: (a) => `kind: ${a.kind} のファイルに chapter(章の番号)がある:付録は A・B…と自動で振るので chapter を外す`, en: (a) => `a kind: ${a.kind} file states chapter: remove it (appendices are lettered A, B, … automatically)` },
31
+ articleDirective: { ja: (a) => `{${a.name}} は Egatari Text の外の書き方${hintJa(a)}`, en: (a) => `{${a.name}} is outside Egatari Text${hintEn(a)}` },
32
+ articleBacktickDirective: { ja: (a) => `{${a.name}} を「\`\`\`」で囲んでいる:指令は「:::」で囲む`, en: (a) => `{${a.name}} is fenced with backticks: fence directives with ::: (colons)` },
33
+ articleOption: { ja: (a) => `{${a.name}} に :${a.option}: は書けない`, en: (a) => `{${a.name}} does not take the option :${a.option}:` },
34
+ articleRole: { ja: (a) => `{${a.name}} は Egatari Text の外の書き方${hintJa(a)}`, en: (a) => `the role {${a.name}} is outside Egatari Text${hintEn(a)}` },
35
+ articleHtml: { ja: (a) => `HTML「${a.html}」は書けない(:::{table} の中の表だけ)${hintJa(a)}`, en: (a) => `raw HTML “${a.html}” is not allowed (only a table inside :::{table})${hintEn(a)}` },
36
+ articleHtmlTable: { ja: (a) => `HTML の表が決まりに合わない:${a.why}(使えるのは table・thead・tbody・tr・th・td、属性 colspan・rowspan・align、セルの中は字と em・strong・code・sub・sup・br だけ。空行・数式・Markdown は書けない)`, en: (a) => `the HTML table breaks the rules: ${a.why} (only table, thead, tbody, tr, th, td; attributes colspan, rowspan, align; cells hold text and em, strong, code, sub, sup, br; no blank lines, math or Markdown)` },
37
+ articleHtmlTableNoSpan: { ja: () => 'HTML の表にセルをつなぐところ(colspan・rowspan)がない:パイプの表(| 見出し | … |)で書く', en: () => 'the HTML table merges no cells (no colspan or rowspan): write it as a pipe table (| header | … |)' },
38
+ articleComment: { ja: (a) => `「%」で始まる行(${a.text})は MyST では消える:字として書くなら \\% と書く`, en: (a) => `a line starting with % (${a.text}) is a MyST comment and disappears: write \\% for the character` },
39
+ articleBlockBreak: { ja: () => '「+++」(区切り)は書けない:外すか、--- (横線)にする', en: () => 'a block break (+++) is not allowed: remove it or use --- (a thematic break)' },
40
+ articleSubstitution: { ja: (a) => `置き換え「${a.text}」は書けない:字をそのまま書く`, en: (a) => `the substitution “${a.text}” is not allowed: write the text itself` },
41
+ articleStrike: { ja: (a) => `取り消し線「${a.text}」は書けない`, en: (a) => `strikethrough “${a.text}” is not allowed` },
42
+ articleBareUrl: { ja: (a) => `URL「${a.url}」がリンクになっていない:<${a.url}> か [字](${a.url}) と書く`, en: (a) => `the URL ${a.url} is not a link: write <${a.url}> or [text](${a.url})` },
43
+ articleTaskList: { ja: () => 'チェックの付く箇条書き(- [ ])は書けない:普通の箇条書きにする', en: () => 'task lists (- [ ]) are not allowed: use a plain list' },
44
+ articleHeadingLevel: { ja: (a) => (a.depth === 1 ? '「#」(第 1 段の見出し)は書けない:題は前付けの title に書き、節は ## から' : `「${'#'.repeat(a.depth)}」(第 ${a.depth} 段の見出し)は書けない:見出しは ##・###・#### まで`), en: (a) => (a.depth === 1 ? 'a level-1 heading (#) is not allowed: put the title in the front matter title and start sections at ##' : `a level-${a.depth} heading is not allowed: use ##, ### or ####`) },
45
+ articleSectionId: { ja: (a) => `節${quoteJa(a.heading)}(## の見出し)に id がない:npm run ids で (sec-…)= の行を付ける(自分で書かない)`, en: (a) => `the section “${a.heading}” (a ## heading) has no id: run npm run ids to add its (sec-…)= line (do not write ids by hand)` },
46
+ articleSectionIdForm: { ja: (a) => `節の id「${a.label}」が決まりの形(sec- と英小文字・2〜7 の 6 字)でない:その (…)= の行を消して npm run ids で付け直す(参照も直す)`, en: (a) => `the section id “${a.label}” is not of the required form (sec- and 6 characters a–z, 2–7): delete its (…)= line, run npm run ids and update references to it` },
47
+ articleLabel: { ja: (a) => `名前「${a.label}」:${WHY_LABEL.ja[a.why]}`, en: (a) => `the label “${a.label}” ${WHY_LABEL.en[a.why]}` },
48
+ articleCiteKey: { ja: (a) => `引用の鍵「${a.key}」が鍵の書式に合わない(英数字と _、間に . : - 。64 字まで)`, en: (a) => `the citation key “${a.key}” does not match the key pattern (letters, digits, _, separated by . : -; up to 64)` },
49
+ articleCitePrefix: { ja: (a) => `[@${a.key}] の前に字(${a.prefix})がある:字は角かっこの外に書く`, en: (a) => `text before the key in the citation of ${a.key} (“${a.prefix}”): write the text outside the brackets` },
50
+ articleCiteNarrativeLocator: { ja: (a) => `地の文の引用 @${a.key} の後ろに所在(ページなど)がある:[@${a.key}, p. 3] と書く`, en: (a) => `a narrative citation @${a.key} followed by a locator: write [@${a.key}, p. 3]` },
51
+ articleImagePath: { ja: (a) => `画像「${a.url}」が作業フォルダの中のパスでない(URL・絶対パス・.. は使えない):画像を作業フォルダに置き、images/… のように書く`, en: (a) => `the image “${a.url}” is not a path in the working folder (no URLs, absolute paths or ..): put the image in the folder and write e.g. images/…` },
52
+ articleAsideTitle: { ja: () => 'コラム(:::{aside})に題がない::::{aside} 題 と書く', en: () => 'an aside has no title: write :::{aside} <title>' },
53
+ articleAsideNested: { ja: () => 'コラムの中にコラムがある:入れ子にしない', en: () => 'an aside inside an aside: do not nest them' },
54
+ articleNested: { ja: (a) => `${a.outer === 'aside' ? 'コラム' : '問'}の中に ${a.inner} は置けない`, en: (a) => `an ${a.outer} cannot hold a ${a.inner}` },
55
+ articleAsideClass: { ja: (a) => `コラムの :class: の名前「${a.cls}」は英小文字・数字・- だけ(例:inquiry、goals)`, en: (a) => `the aside class “${a.cls}” must be lowercase letters, digits and - (e.g. inquiry, goals)` },
56
+ articleTableClass: { ja: (a) => `表の :class: の名前「${a.cls}」は英小文字・数字・- だけ(例:horizontal)`, en: (a) => `the table class “${a.cls}” must be lowercase letters, digits and - (e.g. horizontal)` },
57
+ articleProofKind: { ja: (a) => `定理の類の種類 prf:${a.kind} は Egatari Text 1 にない(theorem・lemma・definition など 15 種)`, en: (a) => `prf:${a.kind} is not a theorem-like kind of Egatari Text 1 (theorem, lemma, definition, … 15 kinds)` },
58
+ articleFootnoteContent: { ja: (a) => `脚注 [^${a.name}] の中に ${a.what} がある:脚注は段落だけ`, en: (a) => `the footnote [^${a.name}] holds a ${a.what}: footnotes hold paragraphs only` },
59
+ articleFootnoteMissing: { ja: (a) => `脚注 [^${a.name}] の定義がない:[^${a.name}]: 本文 の行を足す`, en: (a) => `the footnote [^${a.name}] has no definition: add a line [^${a.name}]: text` },
60
+ articleFootnoteUnused: { ja: (a) => `脚注 [^${a.name}] の定義がどこからも参照されていない(表示されない)`, en: (a) => `the footnote definition [^${a.name}] is never referenced (it is not shown)` },
61
+ articleFootnoteName: { ja: (a) => `脚注の名前「${a.name}」は英数字・_・- だけ`, en: (a) => `the footnote name “${a.name}” must be letters, digits, _ and -` },
62
+ articleFootnoteDuplicate: { ja: (a) => `脚注 [^${a.name}] の定義が 2 つある`, en: (a) => `the footnote [^${a.name}] is defined twice` },
63
+ articleRuby: { ja: (a) => `ルビ「${a.value}」:{ruby}\`字|よみ\` と書く(字とよみは空でなく、よみに | を入れない)`, en: (a) => `ruby “${a.value}”: write {ruby}\`base|reading\` (both non-empty, no | in the reading)` },
64
+ articleStepSyntax: { ja: (a) => `ステップへのリンク「${a.value}」:{step}\`<スライドの id>:<ステップ>\` か {step}\`字 <スライドの id>:<ステップ>\` と書く(ステップは 0・1・…・concl)`, en: (a) => `step link “${a.value}”: write {step}\`<slide id>:<step>\` or {step}\`text <slide id>:<step>\` (step 0, 1, … or concl)` },
65
+ articleSubfigure: { ja: (a) => WHY_SUBFIG.ja[a.why], en: (a) => WHY_SUBFIG.en[a.why] },
66
+ articleFigureAlt: { ja: (a) => `図${a.label ? `(${a.label})` : ''}に :alt: がない:見えない人のために図の中身を書く`, en: (a) => `the figure${a.label ? ` ${a.label}` : ''} has no :alt: — describe the image for readers who cannot see it` },
67
+ articleGlossary: { ja: (a) => { const w = WHY_GLOSS.ja[a.why]; return typeof w === 'function' ? w(a) : w; }, en: (a) => { const w = WHY_GLOSS.en[a.why]; return typeof w === 'function' ? w(a) : w; } },
68
+ articleSolutionLabel: { ja: () => '解答(:::{solution})に問の名前がない::::{solution} exr-… と書く', en: () => 'a solution names no exercise: write :::{solution} exr-…' },
69
+ articleConverted: { ja: (a) => `${a.from} を ${a.to} に直して読んだ(原稿も直す)`, en: (a) => `read ${a.from} as ${a.to} (fix the source too)` },
70
+ articleIndex: { ja: (a) => (a.why === 'both' ? 'article.md と article/ の章のファイルの両方がある:1 つのファイルか章に分けるかのどちらかにする' : '本文のファイルがない(index.article に path も chapters もない)'), en: (a) => (a.why === 'both' ? 'both article.md and chapter files in article/: use one file or chapters, not both' : 'index.article has neither path nor chapters') },
71
+ articleConfig: { ja: (a) => `egatari.json の article(本文のファイルと読む順)${{ shape: 'が object でない', path: `の path(${a.path})が article.md でない`, chapters: 'の chapters が article/<名前>.md の重ならない並びでない', missing: `のファイル ${a.path} が作業フォルダにない`, unreadable: 'が読めない(egatari.json が JSON でない)' }[a.why]}:直すか、article の項目を消す(読む順は種類とファイルの名前の順になる)`, en: (a) => `egatari.json article (the book's files and reading order): ${{ shape: 'not an object', path: `path (${a.path}) is not article.md`, chapters: 'chapters is not a list of distinct article/<name>.md paths', missing: `${a.path} is not in the working folder`, unreadable: 'unreadable (egatari.json is not JSON)' }[a.why]}; fix it or remove the article member (the order then follows kind and file name)` },
72
+ articleUnlisted: { ja: () => '本文のファイルが egatari.json の article に載っていない(本に入らない):chapters に足すか、ファイルを外す', en: () => 'this article file is not listed in egatari.json article (it is not part of the book): add it to chapters or move the file' },
73
+ articleRead: { ja: (a) => `本文のファイルが読めない:${a.why}`, en: (a) => `cannot read the article file: ${a.why}` },
74
+ articleUnsafeParagraph: {
75
+ ja: (a) => `${a.heading ? `節${quoteJa(a.heading)}の` : ''}段落${quoteJa(a.text + '…')}に${a.what === 'html' ? 'タグの書き出し(<! と <?)' : '引用符(" と \')'}が ${a.count} 個ある。1 つの段落に ${a.max} 個を越えると安全に読めないので、本を読み込まない:段落を分けるか、${a.what === 'html' ? 'タグ' : '引用符'}を減らす`,
76
+ en: (a) => `the paragraph “${a.text}…”${a.heading ? ` in the section “${a.heading}”` : ''} has ${a.count} ${a.what === 'html' ? 'tag openings (<! and <?)' : 'quotation marks (" and \')'}. More than ${a.max} in one paragraph cannot be read safely, so the book is not read: split the paragraph or use fewer ${a.what === 'html' ? 'tags' : 'quotation marks'}`,
77
+ },
78
+ articleTooLarge: { ja: (a) => `本文のファイルが大きすぎる(${a.bytes} 字、${a.max} まで):章に分ける`, en: (a) => `the article file is too large (${a.bytes} characters, up to ${a.max}): split it into chapters` },
79
+ articleChapterNumber: { ja: () => '章のファイルに chapter(章の番号)がない:前付けに chapter: 番号 を書く', en: () => 'a chapter file has no chapter number: add chapter: <n> to its front matter' },
80
+ articleChapterTitle: { ja: () => '章のファイルに title(章の題)がない:前付けに title: 題 を書く', en: () => 'a chapter file has no title: add title: <title> to its front matter' },
81
+ articleChapterIncrease: { ja: (a) => `章の番号 ${a.chapter} が前の章(${a.before})より大きくない:読む順(ファイルの名前の順)に大きくする`, en: (a) => `chapter ${a.chapter} does not follow chapter ${a.before}: numbers must increase in reading order (file name order)` },
82
+ articleChapterOrder: { ja: (a) => `kind: ${a.kind} のファイルの順が違う:前書き・章・付録・後書きの順にファイルの名前を付ける`, en: (a) => `the kind: ${a.kind} file is out of order: name the files so that prefaces, chapters, appendices and afterwords come in that order` },
83
+ articleChapterDiffer: { ja: (a) => `章のファイルで ${a.member} が違う(${a.values.join('・')}):すべての章で同じにする`, en: (a) => `${a.member} differs between chapter files (${a.values.join(', ')}): use the same value in every chapter` },
84
+ articleLang: { ja: (a) => `前付けの lang(${a.lang})が教材の言語(${a.deck})と違う:同じにするか、lang を外す`, en: (a) => `front matter lang (${a.lang}) differs from the lesson language (${a.deck}): make them equal or remove lang` },
85
+ articleBibliography: { ja: (a) => `前付けの bibliography(${a.value})が文献のファイル(${a.references || 'なし'})と違う:references.json にするか外す`, en: (a) => `front matter bibliography (${a.value}) is not the references file (${a.references || 'none'}): use references.json or remove it` },
86
+ articleLabelDuplicate: { ja: (a) => `名前「${a.label}」が 2 度使われている(${a.other}${a.otherLine ? ` ${a.otherLine} 行目` : ''}):本文全体で 1 つにする`, en: (a) => `the label “${a.label}” is used twice (also ${a.other}${a.otherLine ? ` line ${a.otherLine}` : ''}): labels are unique in the whole article` },
87
+ articleLabelSlideId: { ja: (a) => `名前「${a.label}」がスライドの id と同じ:別の名前にする`, en: (a) => `the label “${a.label}” is also a slide id: rename it` },
88
+ articleXref: { ja: (a) => `相互参照 [](#${a.label}) の行き先がない:ある名前(:label: や (…)= で付けたもの)を書く`, en: (a) => `the cross-reference [](#${a.label}) points to no label: use a label given with :label: or (…)=` },
89
+ articleSolution: { ja: (a) => `解答の問「${a.label}」${WHY_SOL.ja[a.why]}`, en: (a) => `the solution's exercise “${a.label}” ${WHY_SOL.en[a.why]}` },
90
+ articleTerm: { ja: (a) => (a.glossary ? `用語「${a.term}」が用語集にない:用語集に足すか、字を合わせる` : `用語「${a.term}」を使っているが用語集(:::{glossary})がない`), en: (a) => (a.glossary ? `the term “${a.term}” is not in the glossary: add it or match the spelling` : `the term “${a.term}” is used but there is no glossary (:::{glossary})`) },
91
+ articleStep: { ja: (a) => `ステップへのリンク ${a.value} ${WHY_STEP.ja(a)}`, en: (a) => `the step link ${a.value}${WHY_STEP.en(a)}` },
92
+ articleCite: { ja: (a) => (a.why === 'no-references' ? `引用 @${a.key} があるが文献のファイル(references.json)がない` : `引用の鍵 @${a.key} が references.json にない`), en: (a) => (a.why === 'no-references' ? `the citation @${a.key} needs a bibliography, but there is no references.json` : `the citation key @${a.key} is not in references.json`) },
93
+ articleReferences: { ja: (a) => `references.json が読めない(${a.why}):CSL-JSON の配列にする`, en: (a) => `cannot read references.json (${a.why}): it must be a CSL-JSON array` },
94
+ articleImage: { ja: (a) => `画像 ${a.path} が作業フォルダにない`, en: (a) => `the image ${a.path} is not in the working folder` },
95
+ articleDataArticle: { ja: (a) => `スライド ${a.slide} の data-article の節「${a.section}」が本文にない`, en: (a) => `slide ${a.slide}: data-article names “${a.section}”, which is not a section of the article` },
96
+ articleCitations: { ja: (a) => (a.why === 'list' ? `egatari.json の metadata.citations.list「${a.value}」が違う(end・chapter・none のどれか)` : 'egatari.json の metadata.citations が object でない({"style": "apa", "list": "end"} のように書く)'), en: (a) => (a.why === 'list' ? `egatari.json metadata.citations.list “${a.value}” is not one of end, chapter, none` : 'egatari.json metadata.citations is not an object (write e.g. {"style": "apa", "list": "end"})') },
97
+ articleCiteStyle: { ja: (a) => `引用の書式「${a.style}」はこの Studio にない:${a.fallback} で組んだ(使える書式:${a.styles.join('・')}。style はそのまま残す)`, en: (a) => `this Studio does not have the citation style “${a.style}”: used ${a.fallback} instead (available: ${a.styles.join(', ')}; style is kept as written)` },
98
+ articleCiteListChapter: { ja: () => 'metadata.citations.list が chapter だが、本文が章に分かれていない(article/ の章のファイルのときだけ):end にする', en: () => 'metadata.citations.list is chapter, but the article has no chapters (only with chapter files in article/): use end' },
99
+ articleCiteEngine: { ja: (a) => `引用を書式で組めなかった(${a.why}):鍵の字のまま書いた。references.json の項目を確かめる`, en: (a) => `could not format citations (${a.why}); wrote the keys instead: check the items in references.json` },
100
+ articleUncited: { ja: (a) => `本文で引いていない文献が ${a.count} 件ある(${a.keys.join('・')}${a.count > a.keys.length ? ' …' : ''}):一覧には出ない`, en: (a) => `${a.count} reference(s) never cited (${a.keys.join(', ')}${a.count > a.keys.length ? ', …' : ''}); they are not listed` },
101
+ articleLinksShape: { ja: (a) => `egatari.json の articleLinks の形が違う(${a.why}):その項目を消し、npm run ids で付け直す`, en: (a) => `egatari.json articleLinks has the wrong shape (${a.why}): remove it and run npm run ids to record the links again` },
102
+ articleLinkStale: { ja: (a) => `スライドと本が合っていないかもしれません:スライド ${a.slide} と節${quoteJa(a.heading || a.section)}(${a.section})。つないだ後に${a.changed === 'article' ? '節' : a.changed === 'slide' ? 'スライドか口述原稿' : '節とスライドの両方'}が変わった。読み比べて、合っていれば npm run ids -- --confirm-links で確かめた印を付ける(字は自動では直さない)`, en: (a) => `slides and book may not match: slide ${a.slide} and the section “${a.heading || a.section}” (${a.section}); ${a.changed === 'article' ? 'the section' : a.changed === 'slide' ? 'the slide or its narration' : 'both the section and the slide'} changed after they were linked. Compare them; if they still agree, run npm run ids -- --confirm-links (nothing is changed automatically)` },
103
+ articleLinkUnconfirmed: { ja: (a) => `スライドと節のつながり ${a.count} 組がまだ記録されていない(${a.pairs.join('、')}${a.count > a.pairs.length ? ' …' : ''}):npm run ids で記録すると、後でどちらかが変わったときに知らせる`, en: (a) => `${a.count} slide–section link(s) are not recorded yet (${a.pairs.join(', ')}${a.count > a.pairs.length ? ', …' : ''}): run npm run ids to record them, so that later changes on either side are reported` },
104
+ articleLinkUnlinked: { ja: (a) => `egatari.json の articleLinks に、もうつながっていない組が ${a.count} 組ある(${a.pairs.join('、')}${a.count > a.pairs.length ? ' …' : ''}):1 ファイルに書き出すときに外す`, en: (a) => `egatari.json articleLinks records ${a.count} pair(s) that are no longer linked (${a.pairs.join(', ')}${a.count > a.pairs.length ? ', …' : ''}); they are dropped when the single file is written` },
105
+ articleSummary: { ja: (a) => `本文:ファイル ${a.files}、節 ${a.sections}、名前 ${a.labels}`, en: (a) => `article: ${a.files} file(s), ${a.sections} section(s), ${a.labels} label(s)` },
106
+ articleSectionUnlinked: { ja: (a) => `節${quoteJa(a.heading)}(${a.section})がどのスライドともつながっていない({step} のリンクか、スライドの data-article で結ぶ)`, en: (a) => `the section “${a.heading}” (${a.section}) is linked to no slide (add a {step} link or name it in a slide's data-article)` },
107
+ };
108
+
109
+ // 1 つの知らせの言葉:場所(ファイル・行)+言葉+(§…)
110
+ export function articleMessage(lang, p) {
111
+ const m = ARTICLE_MESSAGES[p.code];
112
+ const en = lang === 'en';
113
+ const body = m ? (en ? m.en : m.ja)(p.data || {}) : p.code;
114
+ return `${articleWhere(lang, p)}${body}${p.spec ? (en ? ` (${p.spec})` : `(${p.spec})`) : ''}`;
115
+ }
116
+ export function articleWhere(lang, p) {
117
+ if (!p.file) return '';
118
+ return lang === 'en' ? `${p.file}${p.line ? ` line ${p.line}` : ''}: ` : `${p.file}${p.line ? ` ${p.line} 行目` : ''}:`;
119
+ }
@@ -0,0 +1,183 @@
1
+ // 作業フォルダの本文を読み、点検し(§9C.8)、読むための 1 枚の HTML(§9C.6 の <article id="egatari-article"> を
2
+ // <section id="egatari-readable"> に入れたもの)にする。組み立て(kit/build.mjs)と品質チェック(kit/check.mjs)が使う。
3
+ // 読み書きは env(kit/build.mjs の nodeEnv と同じ形:path・listFiles・readText・readBase64・exists・isFile・within・katex・katexDir)を通す。
4
+ // 再生器(kit/deck.js)にはまだ載せない(本文の窓は v0.6.5 の B)。1 ファイル(.ega.html)への書き出しは kit/core/portable.mjs が
5
+ // renderedArticle で本文を組み、#egatari-readable の最後に入れる(§9C.6・§9C.12)。
6
+ import { articleLayout, articleFiles, readArticle, validateArticle, referenceKeys, dataArticleOf, parseStep, assignSectionIds } from './article.mjs';
7
+ import { renderArticle, ARTICLE_CSS, esc } from './article-render.mjs';
8
+ export { ARTICLE_CSS }; // 再生器の本の窓の体裁(組み立てが articleCss で入れる。kit/core/portable.mjs も)
9
+ import { citationSettings } from './article-cite.mjs';
10
+ import { linkedPairs, currentLinkHashes, linkStates, pruneLinks, articleLinksProblems } from './article-links.mjs';
11
+ import { ARTICLE_LIMITS, visit } from './article-text.mjs';
12
+ import { analyzeSlideIds, readMacros, katexCss } from './build-core.mjs';
13
+ import { configObject } from './config-file.mjs';
14
+ import { FORMAT } from './format.mjs';
15
+
16
+ const IMAGE_MIME = { png: 'image/png', jpg: 'image/jpeg', jpeg: 'image/jpeg', gif: 'image/gif', webp: 'image/webp', avif: 'image/avif', svg: 'image/svg+xml' };
17
+ const IMAGE_MAX = 16 << 20;
18
+ const SOURCE_MAX = 32 << 20;
19
+
20
+ // 返すもの:本文がなければ null。あれば {deckDir, index, article, ctx, problems, slides}。ctx は validateArticle に渡す文脈(resolveStep は呼び手が足す)
21
+ export function loadArticle(env, srcPath, opts = {}) {
22
+ const P = env.path, deckDir = P.dirname(P.resolve(srcPath));
23
+ const rels = env.listFiles(deckDir).map((f) => P.relative(deckDir, f).split(P.sep).join('/'));
24
+ const abs = (rel) => P.join(deckDir, ...rel.split('/'));
25
+ const read = (rel, max) => { const p = abs(rel); if (!env.within(p, deckDir)) throw new Error('outside the working folder'); return env.readText(p, max); };
26
+ // egatari.json の article(読む順。§9C.7)。読めなければ順を決めずに知らせる
27
+ let conf = null; const confProblems = [];
28
+ if (rels.includes(FORMAT.CONFIG_FILE)) { try { conf = configObject(read(FORMAT.CONFIG_FILE, 16 << 20)); } catch (e) { confProblems.push({ sev: 'warn', code: 'articleConfig', spec: '§9C.7', file: FORMAT.CONFIG_FILE, line: null, data: { why: 'unreadable' } }); } }
29
+ const layout = articleLayout(rels, conf);
30
+ if (!layout.index) return layout.problems.length ? { deckDir, index: null, article: { files: [], problems: [] }, ctx: {}, problems: [...confProblems, ...layout.problems], slides: new Map(), abs } : null;
31
+ const article = readArticle(layout.index, (rel) => read(rel, ARTICLE_LIMITS.fileBytes), { lang: opts.lang || '', convert: !!opts.convert, order: layout.order });
32
+ const problems = [...confProblems, ...layout.problems, ...article.problems];
33
+ let references, items = [];
34
+ if (layout.index.references) {
35
+ try { const r = referenceKeys(read(layout.index.references, 16 << 20), layout.index.references); references = r.keys; items = r.items; if (r.problem) problems.push(r.problem); }
36
+ catch (e) { references = new Set(); problems.push({ sev: 'error', code: 'articleReferences', spec: '§9C.4', file: layout.index.references, line: null, data: { why: String(e.message || e).slice(0, 80) } }); }
37
+ } else references = null;
38
+ // 引用の書式と一覧(egatari.json の metadata.citations。§9C.4)
39
+ const citations = conf && conf.metadata && typeof conf.metadata === 'object' && Object.prototype.hasOwnProperty.call(conf.metadata, 'citations') ? conf.metadata.citations : null;
40
+ // スライド(id・見出し・data-article)とデッキのほかの id
41
+ let ids = { slides: [], docIds: new Map() }, deckText = '';
42
+ try { deckText = env.readText(srcPath, SOURCE_MAX); ids = analyzeSlideIds(deckText); } catch { /* 原稿が読めないときは組み立てが知らせる */ }
43
+ const slides = new Map(ids.slides.map((s) => [s.key, { title: s.heading || s.key, id: s.id }]));
44
+ const exists = (u) => { const p = abs(u); try { return env.within(p, deckDir) && env.exists(p) && env.isFile(p); } catch { return false; } };
45
+ const ctx = { slideIds: new Set(ids.slides.filter((s) => s.id).map((s) => s.id)), otherIds: new Set(ids.docIds.keys()), dataArticle: dataArticleOf(ids.slides), references, exists, citations };
46
+ return { deckDir, index: layout.index, order: layout.order, article, ctx, problems, slides, abs, items, citations, conf, deckText, rels, read };
47
+ }
48
+
49
+ // スライドと節のつながりの記録と今(§9C.5・§9C.7。kit/core/article-links.mjs)。L:loadArticle の結果。
50
+ // 返すもの:{pairs, current, recorded(egatari.json の articleLinks か null), states, pruned(もうつながっていない組を外した記録か null), removed, problems}
51
+ export async function articleLinkReport(L) {
52
+ const pairs = linkedPairs(L.article, L.ctx.dataArticle || []);
53
+ let narration = '';
54
+ if (L.rels && L.rels.includes('narration.md')) { try { narration = L.read('narration.md', SOURCE_MAX); } catch { narration = ''; } }
55
+ const current = await currentLinkHashes(L.article, pairs, L.deckText || '', narration);
56
+ const has = L.conf && Object.prototype.hasOwnProperty.call(L.conf, 'articleLinks');
57
+ const problems = [];
58
+ let recorded = has ? L.conf.articleLinks : null;
59
+ if (has) { const e = articleLinksProblems(recorded); if (e.length) { problems.push({ sev: 'warn', code: 'articleLinksShape', spec: '§9C.7', file: FORMAT.CONFIG_FILE, line: null, data: { why: e.slice(0, 3).join('; ') } }); if (!recorded || typeof recorded !== 'object' || Array.isArray(recorded)) recorded = null; } }
60
+ const states = linkStates(recorded, current, pairs);
61
+ const pr = pruneLinks(recorded, pairs);
62
+ return { pairs, current, recorded, states, pruned: pr.links, removed: pr.removed, problems };
63
+ }
64
+
65
+ // 作業フォルダに本文のファイル(article.md・article/<名前>.md)があるか(本文の道具を読み込むかを決める。読みはしない)
66
+ export function hasArticleFiles(env, deckDir) {
67
+ const P = env.path;
68
+ if (typeof env.listFiles === 'function') {
69
+ try { return env.listFiles(deckDir).some((f) => /^(?:article\.md|article\/[^/]+\.md)$/.test(P.relative(deckDir, f).split(P.sep).join('/'))); } catch { return false; }
70
+ }
71
+ return env.exists(P.join(deckDir, 'article.md')) || env.exists(P.join(deckDir, 'article'));
72
+ }
73
+ // 節の id(§9C.3):本文のファイルの id のない ## の見出しに (sec-xxxxxx)= を足したもの(組み立て・書き出しが作業フォルダに書き戻す。npm run ids と同じ)。
74
+ // スライドの id・デッキのほかの id・本文のほかの名前を避ける。返すもの:{writes: {作業フォルダの中のパス: 字}, added: [{file, line, id, heading}]}
75
+ export function sectionIdWrites(env, srcPath, opts = {}) {
76
+ const P = env.path, deckDir = P.dirname(P.resolve(srcPath));
77
+ const rels = env.listFiles(deckDir).map((f) => P.relative(deckDir, f).split(P.sep).join('/'));
78
+ const read = (rel, max) => { const p = P.join(deckDir, ...rel.split('/')); if (!env.within(p, deckDir)) throw new Error('outside the working folder'); return env.readText(p, max); };
79
+ let conf = null;
80
+ if (rels.includes(FORMAT.CONFIG_FILE)) { try { conf = configObject(read(FORMAT.CONFIG_FILE, 16 << 20)); } catch { conf = null; } }
81
+ const layout = articleLayout(rels, conf);
82
+ const writes = {}, added = [];
83
+ if (!layout.index) return { writes, added };
84
+ let ids = { slides: [], docIds: new Map() };
85
+ try { ids = analyzeSlideIds(env.readText(srcPath, SOURCE_MAX)); } catch { /* 組み立てが知らせる */ }
86
+ const taken = new Set([...ids.slides.map((s) => s.id || s.key), ...ids.docIds.keys()]);
87
+ for (const rel of articleFiles(layout.index)) {
88
+ let text;
89
+ try { text = read(rel, ARTICLE_LIMITS.fileBytes); } catch { continue; }
90
+ const r = assignSectionIds(text, taken, opts.rand);
91
+ for (const a of r.added) { taken.add(a.id); added.push({ file: rel, ...a }); }
92
+ if (r.added.length) writes[rel] = r.out;
93
+ }
94
+ return { writes, added };
95
+ }
96
+
97
+ // 本文のステップへのリンク(重ねずに):"<slideKey>:<stepKey>" の並び(check が再生器で行き先を確かめる)
98
+ export function stepLinksOf(article) {
99
+ const out = new Set();
100
+ for (const f of article.files) visit(f.tree, (n) => { if (n.type === 'mystRole' && n.name === 'step') { const s = parseStep(n.value); if (s) out.add(`${s.slideKey}:${s.stepKey}`); } });
101
+ return [...out];
102
+ }
103
+
104
+ // 本文を読み、点検し(§9C.8)、実行時の形(§9C.6 の <article id="egatari-article">)に組む。opts:lang・title(metadata.title)・
105
+ // resolveStep(ステップがあるか。kit/core/article.mjs の validateArticle)。
106
+ // 返すもの:本文がなければ null。あれば {L(loadArticle の結果), html(<article> の要素), problems, warnings, lang}
107
+ export function renderedArticle(env, srcPath, opts = {}) {
108
+ const L = loadArticle(env, srcPath, opts);
109
+ if (!L) return null;
110
+ const v = validateArticle(L.article, { ...L.ctx, ...(opts.resolveStep ? { resolveStep: opts.resolveStep } : {}) });
111
+ const problems = [...L.problems, ...v.problems];
112
+ if (!L.index) return { L, html: '', problems, warnings: [], lang: opts.lang || '' };
113
+ const P = env.path;
114
+ let macros = {};
115
+ const mf = P.join(L.deckDir, 'macros.tex');
116
+ try { if (env.exists(mf) && env.within(mf, L.deckDir)) macros = readMacros(env.readText(mf, 1 << 20)); } catch { /* なくてよい */ }
117
+ const image = (u) => {
118
+ const ext = (u.match(/\.([A-Za-z0-9]+)$/) || [])[1];
119
+ const mime = ext && IMAGE_MIME[ext.toLowerCase()];
120
+ if (!mime || !L.ctx.exists(u)) return null;
121
+ try { return `data:${mime};base64,${env.readBase64(L.abs(u), IMAGE_MAX)}`; } catch { return null; }
122
+ };
123
+ const lang = opts.lang || L.article.lang || '';
124
+ // 本の題は metadata.title(egatari.json にあればそれ。なければ呼び手の渡したもの:デッキの <title>)
125
+ const mt = L.conf && L.conf.metadata && typeof L.conf.metadata.title === 'string' && L.conf.metadata.title ? L.conf.metadata.title : '';
126
+ if (mt) opts = { ...opts, title: mt };
127
+ const cs = citationSettings(L.citations === null ? undefined : L.citations, { book: !!(L.index && L.index.chapters) });
128
+ const r = renderArticle(L.article, { lang, title: opts.title || '', katex: env.katex, macros, image, slides: L.slides, references: L.items, csl: L.items.length && typeof env.csl === 'function' ? env.csl() : null, citations: cs });
129
+ problems.push(...r.problems);
130
+ return { L, html: r.html, problems, warnings: r.warnings, lang, sections: v.sections, citeproc: r.citeproc };
131
+ }
132
+
133
+ // 読むための 1 枚の HTML。opts:lang・title(metadata.title)。返すもの:本文がなければ null。あれば {html, problems, warnings, stats}
134
+ export function articlePage(env, srcPath, opts = {}) {
135
+ const R = renderedArticle(env, srcPath, opts);
136
+ return R ? articlePageOf(env, R, opts) : null;
137
+ }
138
+ // renderedArticle の結果 R から読むための 1 枚の HTML を作る(編集アプリのプレビューの本も同じ:本文を 2 度読まない)
139
+ export function articlePageOf(env, R, opts = {}) {
140
+ const { L, problems, lang } = R;
141
+ if (!L.index) return { html: '', problems, warnings: [], index: null, stats: { files: 0, sections: 0, figures: 0, tables: 0, equations: 0 } };
142
+ const r = { html: R.html, warnings: R.warnings };
143
+ const title = L.article.files.length === 1 && L.article.files[0].fm.title ? L.article.files[0].fm.title : opts.title || '';
144
+ const usesMath = /class="katex/.test(r.html);
145
+ // 縦書きの本の頁は、根も縦書きにする:頁は右から左へ進み、開いたときは右端(本の初め)が見える(§9C.2・EPUB の page-progression-direction="rtl")
146
+ const html = `<!DOCTYPE html>
147
+ <html lang="${esc(lang)}"${L.article.writingMode === 'vertical-rl' ? ' class="egatari-vertical-page"' : ''}>
148
+ <head>
149
+ <meta charset="utf-8">
150
+ <meta name="viewport" content="width=device-width, initial-scale=1">
151
+ <title>${esc(title)}</title>
152
+ <style>${themeTokens(opts.themeCss || '')}
153
+ body{margin:0;background:var(--bg,Canvas);color:var(--fg,CanvasText);font-family:${/^ja\b/i.test(lang) ? (L.article.writingMode === 'vertical-rl' ? '"BIZ UDPMincho",serif' : '"BIZ UDPGothic",sans-serif') : 'system-ui,sans-serif'}}
154
+ ${usesMath ? katexCss(env) : ''}
155
+ ${ARTICLE_CSS}
156
+ html.egatari-vertical-page{writing-mode:vertical-rl}</style>
157
+ </head>
158
+ <body>
159
+ <section id="egatari-readable" lang="${esc(lang)}">
160
+ ${r.html}
161
+ </section>
162
+ </body>
163
+ </html>
164
+ `;
165
+ const count = (t) => { let n = 0; for (const f of L.article.files) visit(f.tree, (x) => { if (t(x)) n++; }); return n; };
166
+ return {
167
+ html, problems, warnings: r.warnings, index: L.index, citeproc: R.citeproc,
168
+ // 再生器の本の窓に入れる本文(§9C.6 の <article>)とその体裁・言語(kit/build.mjs が組んだデッキに入れる)
169
+ article: r.html, css: ARTICLE_CSS, lang,
170
+ stats: { files: L.article.files.length, sections: count((x) => x.type === 'heading' && x.depth === 2), figures: count((x) => x.type === 'container' && x.kind === 'figure' && !x.subcontainer), tables: count((x) => x.type === 'container' && x.kind === 'table'), equations: count((x) => x.type === 'math' && x.label) },
171
+ };
172
+ }
173
+ // 組んだデッキの :root の色の変数(--fg・--bg・--muted・--line・--accent2・--term・--emph)だけを写す(色を直接書かない)
174
+ export function themeTokens(css) {
175
+ const decl = [];
176
+ for (const m of String(css).replace(/\/\*[\s\S]*?\*\//g, '').matchAll(/:root\s*\{([^{}]*)\}/g)) for (const d of m[1].split(';')) if (/^\s*--(fg|bg|muted|line|accent2|term|emph|emph-from-hue|base|complement)\s*:/.test(d)) decl.push(d.trim());
177
+ return decl.length ? `:root{${decl.join(';')}}` : '';
178
+ }
179
+ // 本文の頁の既定の書き出し先:デッキの出力の横に <名前>.article.html
180
+ export function articlePageOut(P, deckOut) {
181
+ const p = P.parse(deckOut);
182
+ return P.join(p.dir, `${p.name}.article.html`);
183
+ }