@aiquants/markdown 2.0.3 → 4.0.0

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 (216) hide show
  1. package/README.md +266 -14
  2. package/dist/{abnfDiagram-VRR7QNED-BBmog1I4.cjs → abnfDiagram-VRR7QNED-DL9JJfMF.cjs} +1 -1
  3. package/dist/{abnfDiagram-VRR7QNED-IjPsliMa.js → abnfDiagram-VRR7QNED-utxwo7Ri.js} +15 -15
  4. package/dist/{arc-DKsAswGe.cjs → arc-BY7loL0l.cjs} +1 -1
  5. package/dist/{arc-E1KzF_uD.js → arc-Byq9kr_0.js} +32 -32
  6. package/dist/{architectureDiagram-ZJ3FMSHR-BLhnaJyB.cjs → architectureDiagram-ZJ3FMSHR-CLLwinmD.cjs} +1 -1
  7. package/dist/{architectureDiagram-ZJ3FMSHR-u79eEnkY.js → architectureDiagram-ZJ3FMSHR-DpnBy_s1.js} +2 -2
  8. package/dist/{blockDiagram-677ZJIJ3-DcCNlY_i.js → blockDiagram-677ZJIJ3-C8dybZZU.js} +3 -3
  9. package/dist/{blockDiagram-677ZJIJ3-D72bpMhN.cjs → blockDiagram-677ZJIJ3-Cs5tpWQ-.cjs} +1 -1
  10. package/dist/{c4Diagram-LMCZKHZV-Bp9asujr.js → c4Diagram-LMCZKHZV-3aG0bDyP.js} +2 -2
  11. package/dist/{c4Diagram-LMCZKHZV-D3d1d4zO.cjs → c4Diagram-LMCZKHZV-B-rz2a3v.cjs} +1 -1
  12. package/dist/{channel-DpcrO3R2.js → channel-BoXFYC1g.js} +1 -1
  13. package/dist/{channel-DE5LXIMm.cjs → channel-Dn2hPSB8.cjs} +1 -1
  14. package/dist/{chunk-2Q5K7J3B-BrnUlAaZ.cjs → chunk-2Q5K7J3B-B7QkO_05.cjs} +1 -1
  15. package/dist/{chunk-2Q5K7J3B-OuVdfHE1.js → chunk-2Q5K7J3B-CYpyj9EA.js} +1 -1
  16. package/dist/{chunk-32BRIVSS-CDxbP_I9.cjs → chunk-32BRIVSS-BjI5igEa.cjs} +1 -1
  17. package/dist/{chunk-32BRIVSS-w8TMFT10.js → chunk-32BRIVSS-DcLe6F1l.js} +1 -1
  18. package/dist/{chunk-5VM5RSS4-BHG-YQpQ.js → chunk-5VM5RSS4-C4ILSCRb.js} +1 -1
  19. package/dist/{chunk-5VM5RSS4-C-cBAbST.cjs → chunk-5VM5RSS4-DafQyxAv.cjs} +1 -1
  20. package/dist/{chunk-EX3LRPZG-uKd75-FB.cjs → chunk-EX3LRPZG-BXZDK2R1.cjs} +1 -1
  21. package/dist/{chunk-EX3LRPZG-BNHa-x9z.js → chunk-EX3LRPZG-CTaiVHYY.js} +28 -28
  22. package/dist/{chunk-JWPE2WC7-DtFuVO4n.js → chunk-JWPE2WC7-B-nuuS4b.js} +1 -1
  23. package/dist/{chunk-JWPE2WC7-CNFRDah7.cjs → chunk-JWPE2WC7-CNZBI1Pb.cjs} +1 -1
  24. package/dist/{chunk-MOJQB5TN-DwJ5ntgS.js → chunk-MOJQB5TN-D1oF99aM.js} +9 -9
  25. package/dist/{chunk-MOJQB5TN-Bs5Jj3Zh.cjs → chunk-MOJQB5TN-Dh_1HfSC.cjs} +1 -1
  26. package/dist/{chunk-PUDLZKDR-DisfuynB.cjs → chunk-PUDLZKDR-CMFJFweY.cjs} +1 -1
  27. package/dist/{chunk-PUDLZKDR-CG9K3aEk.js → chunk-PUDLZKDR-CPadtN2C.js} +6 -6
  28. package/dist/{chunk-RYQCIY6F-xFTrTO6v.cjs → chunk-RYQCIY6F-C6453DQl.cjs} +1 -1
  29. package/dist/{chunk-RYQCIY6F-c2KNx-Ia.js → chunk-RYQCIY6F-DxuegR0d.js} +1 -1
  30. package/dist/{chunk-V7JOEXUC-BvkxRSjK.cjs → chunk-V7JOEXUC-l9PaMPOT.cjs} +1 -1
  31. package/dist/{chunk-V7JOEXUC-CA3ccBvd.js → chunk-V7JOEXUC-ziE5DrnY.js} +5 -5
  32. package/dist/{chunk-VR4S4FIN-Cn9aeq2_.js → chunk-VR4S4FIN-BiCYvwb8.js} +3 -3
  33. package/dist/{chunk-VR4S4FIN-DAwCjhU3.cjs → chunk-VR4S4FIN-CCCnXTuJ.cjs} +1 -1
  34. package/dist/{chunk-XXDRQBXY-pPF9BeL7.js → chunk-XXDRQBXY-BFKT7vFo.js} +1 -1
  35. package/dist/{chunk-XXDRQBXY-B7vX1DJv.cjs → chunk-XXDRQBXY-D5IbqpUM.cjs} +1 -1
  36. package/dist/{classDiagram-OUVF2IWQ-BxIt89EK.cjs → classDiagram-OUVF2IWQ-C1AZm4pB.cjs} +1 -1
  37. package/dist/{classDiagram-v2-EOCWNBFH-MQ0VQAsx.js → classDiagram-OUVF2IWQ-KA_F_TBQ.js} +2 -2
  38. package/dist/{classDiagram-v2-EOCWNBFH-BxIt89EK.cjs → classDiagram-v2-EOCWNBFH-C1AZm4pB.cjs} +1 -1
  39. package/dist/{classDiagram-OUVF2IWQ-MQ0VQAsx.js → classDiagram-v2-EOCWNBFH-KA_F_TBQ.js} +2 -2
  40. package/dist/components/MarkdownRenderer.d.ts +9 -2
  41. package/dist/components/MarkdownViewer.d.ts +19 -35
  42. package/dist/components/MermaidDiagram.d.ts +4 -0
  43. package/dist/components/NodesRenderer.d.ts +2 -1
  44. package/dist/components/TableOfContents.d.ts +14 -4
  45. package/dist/components/embeds.d.ts +30 -0
  46. package/dist/components/htmlSanitizer.d.ts +21 -0
  47. package/dist/components/labels.d.ts +12 -0
  48. package/dist/components/links.d.ts +18 -0
  49. package/dist/components/mathRendering.d.ts +11 -0
  50. package/dist/components/mdastNodes/HTMLBlockContainerNode.d.ts +3 -2
  51. package/dist/components/mdastNodes/HTMLNode.d.ts +1 -1
  52. package/dist/components/mdastNodes/MathNode.d.ts +10 -0
  53. package/dist/components/mdastNodes/TwitterEmbedNode.d.ts +3 -2
  54. package/dist/components/mdastNodes/YouTubeEmbedNode.d.ts +4 -2
  55. package/dist/components/mermaidInteraction.d.ts +1 -4
  56. package/dist/components/mermaidLabels.d.ts +19 -0
  57. package/dist/components/plugins/DifyIFramePlugin.d.ts +2 -6
  58. package/dist/components/plugins/IFramePluginRegistry.d.ts +6 -4
  59. package/dist/components/rawHtml.d.ts +13 -0
  60. package/dist/components/toolbarOverlap.d.ts +17 -0
  61. package/dist/components/viewerLabels.d.ts +31 -0
  62. package/dist/{cose-bilkent-JH36ORCC-BzL-a0Zv.cjs → cose-bilkent-JH36ORCC-BQ2K2GyI.cjs} +1 -1
  63. package/dist/{cose-bilkent-JH36ORCC-ukc_ZtcU.js → cose-bilkent-JH36ORCC-B_16TV-v.js} +1 -1
  64. package/dist/css/details.css +7 -0
  65. package/dist/css/fonts/KaTeX_AMS-Regular.ttf +0 -0
  66. package/dist/css/fonts/KaTeX_AMS-Regular.woff +0 -0
  67. package/dist/css/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  68. package/dist/css/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  69. package/dist/css/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  70. package/dist/css/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  71. package/dist/css/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  72. package/dist/css/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  73. package/dist/css/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  74. package/dist/css/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  75. package/dist/css/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  76. package/dist/css/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  77. package/dist/css/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  78. package/dist/css/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  79. package/dist/css/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  80. package/dist/css/fonts/KaTeX_Main-Bold.ttf +0 -0
  81. package/dist/css/fonts/KaTeX_Main-Bold.woff +0 -0
  82. package/dist/css/fonts/KaTeX_Main-Bold.woff2 +0 -0
  83. package/dist/css/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  84. package/dist/css/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  85. package/dist/css/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  86. package/dist/css/fonts/KaTeX_Main-Italic.ttf +0 -0
  87. package/dist/css/fonts/KaTeX_Main-Italic.woff +0 -0
  88. package/dist/css/fonts/KaTeX_Main-Italic.woff2 +0 -0
  89. package/dist/css/fonts/KaTeX_Main-Regular.ttf +0 -0
  90. package/dist/css/fonts/KaTeX_Main-Regular.woff +0 -0
  91. package/dist/css/fonts/KaTeX_Main-Regular.woff2 +0 -0
  92. package/dist/css/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  93. package/dist/css/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  94. package/dist/css/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  95. package/dist/css/fonts/KaTeX_Math-Italic.ttf +0 -0
  96. package/dist/css/fonts/KaTeX_Math-Italic.woff +0 -0
  97. package/dist/css/fonts/KaTeX_Math-Italic.woff2 +0 -0
  98. package/dist/css/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  99. package/dist/css/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  100. package/dist/css/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  101. package/dist/css/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  102. package/dist/css/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  103. package/dist/css/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  104. package/dist/css/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  105. package/dist/css/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  106. package/dist/css/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  107. package/dist/css/fonts/KaTeX_Script-Regular.ttf +0 -0
  108. package/dist/css/fonts/KaTeX_Script-Regular.woff +0 -0
  109. package/dist/css/fonts/KaTeX_Script-Regular.woff2 +0 -0
  110. package/dist/css/fonts/KaTeX_Size1-Regular.ttf +0 -0
  111. package/dist/css/fonts/KaTeX_Size1-Regular.woff +0 -0
  112. package/dist/css/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  113. package/dist/css/fonts/KaTeX_Size2-Regular.ttf +0 -0
  114. package/dist/css/fonts/KaTeX_Size2-Regular.woff +0 -0
  115. package/dist/css/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  116. package/dist/css/fonts/KaTeX_Size3-Regular.ttf +0 -0
  117. package/dist/css/fonts/KaTeX_Size3-Regular.woff +0 -0
  118. package/dist/css/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  119. package/dist/css/fonts/KaTeX_Size4-Regular.ttf +0 -0
  120. package/dist/css/fonts/KaTeX_Size4-Regular.woff +0 -0
  121. package/dist/css/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  122. package/dist/css/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  123. package/dist/css/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  124. package/dist/css/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  125. package/dist/css/github-markdown.css +23 -0
  126. package/dist/css/katex.min.css +1 -1129
  127. package/dist/css/message.css +2 -0
  128. package/dist/css/zenn-content.css +14 -0
  129. package/dist/{cynefinDiagram-TSTJHNR4-C1GqR9hq.js → cynefinDiagram-TSTJHNR4-DTV6ORFc.js} +23 -23
  130. package/dist/{cynefinDiagram-TSTJHNR4-B1lNDIu_.cjs → cynefinDiagram-TSTJHNR4-Dq7UoRYB.cjs} +1 -1
  131. package/dist/{dagre-VKFMJZFB-COYURQTh.cjs → dagre-VKFMJZFB-PCi8s-PP.cjs} +1 -1
  132. package/dist/{dagre-VKFMJZFB-DpiBVdXS.js → dagre-VKFMJZFB-kSrm5dp4.js} +12 -12
  133. package/dist/{diagram-FQU43EPY-CVw420ny.js → diagram-FQU43EPY-D3dKlAPv.js} +2 -2
  134. package/dist/{diagram-FQU43EPY-DkgdwwAT.cjs → diagram-FQU43EPY-wTUTIyQQ.cjs} +1 -1
  135. package/dist/{diagram-G47NLZAW-cr36B9DD.js → diagram-G47NLZAW-HJlhMCYj.js} +131 -131
  136. package/dist/{diagram-G47NLZAW-CcXcBx81.cjs → diagram-G47NLZAW-_4FrgCGJ.cjs} +1 -1
  137. package/dist/{diagram-NH7WQ7WH-BMYzS0pm.cjs → diagram-NH7WQ7WH-ByCeah-n.cjs} +1 -1
  138. package/dist/{diagram-NH7WQ7WH-CoL7cXmX.js → diagram-NH7WQ7WH-CgeHmdJL.js} +11 -11
  139. package/dist/{diagram-OA4YK3LP-DSeI6RLe.cjs → diagram-OA4YK3LP-C0IhePjD.cjs} +1 -1
  140. package/dist/{diagram-OA4YK3LP-DRAbN1oy.js → diagram-OA4YK3LP-CwJcZGHD.js} +57 -57
  141. package/dist/{diagram-WEI45ONY-CCJwQ42c.cjs → diagram-WEI45ONY-Cf-TVNEb.cjs} +1 -1
  142. package/dist/{diagram-WEI45ONY-CxkNlW0N.js → diagram-WEI45ONY-v1LUmWAx.js} +11 -11
  143. package/dist/{ebnfDiagram-CCIWWBDH-PADFa1z_.js → ebnfDiagram-CCIWWBDH-DqZtnwGP.js} +5 -5
  144. package/dist/{ebnfDiagram-CCIWWBDH-D_nz1FvR.cjs → ebnfDiagram-CCIWWBDH-k5XOUGml.cjs} +1 -1
  145. package/dist/{erDiagram-Q63AITRT-DFD27ud_.js → erDiagram-Q63AITRT-D6kP6d5J.js} +4 -4
  146. package/dist/{erDiagram-Q63AITRT-2r-lfgSt.cjs → erDiagram-Q63AITRT-DFet1VTy.cjs} +1 -1
  147. package/dist/{extractHeadings-BUHj1PcO.js → extractHeadings-B2I83li5.js} +6326 -5913
  148. package/dist/{extractHeadings-BrLI2qQF.cjs → extractHeadings-R7NxLZJP.cjs} +71 -71
  149. package/dist/flowDiagram-23GEKE2U-BTXvBdte.js +7 -0
  150. package/dist/flowDiagram-23GEKE2U-C81VZYM7.cjs +1 -0
  151. package/dist/{ganttDiagram-NO4QXBWP-CNhgpKSH.cjs → ganttDiagram-NO4QXBWP-CEQqLRYx.cjs} +1 -1
  152. package/dist/{ganttDiagram-NO4QXBWP-CmV2JOI4.js → ganttDiagram-NO4QXBWP-I9DxJwkX.js} +2 -2
  153. package/dist/gen/markdown/v1/markdown_pb.d.ts +14 -0
  154. package/dist/{gitGraphDiagram-IHSO6WYX-D6YozD-Z.js → gitGraphDiagram-IHSO6WYX-p_7WQssC.js} +3 -3
  155. package/dist/{gitGraphDiagram-IHSO6WYX-D5IYosEF.cjs → gitGraphDiagram-IHSO6WYX-yyEwsmHH.cjs} +1 -1
  156. package/dist/index.cjs +1 -1
  157. package/dist/index.client.cjs +1 -1
  158. package/dist/index.client.d.ts +6 -2
  159. package/dist/index.client.js +39 -35
  160. package/dist/index.js +39 -35
  161. package/dist/index.server.cjs +1 -1
  162. package/dist/index.server.d.ts +1 -1
  163. package/dist/index.server.js +258 -170
  164. package/dist/{infoDiagram-FWYZ7A6U-U2OiliOP.cjs → infoDiagram-FWYZ7A6U-BFCkTfAI.cjs} +1 -1
  165. package/dist/{infoDiagram-FWYZ7A6U-Jthjyrbt.js → infoDiagram-FWYZ7A6U-C9L5rIcg.js} +1 -1
  166. package/dist/{ishikawaDiagram-FXEZZL3T-DK3M6wrz.cjs → ishikawaDiagram-FXEZZL3T-B3TjOzka.cjs} +1 -1
  167. package/dist/{ishikawaDiagram-FXEZZL3T-CWrHeeTL.js → ishikawaDiagram-FXEZZL3T-uxcpJtLF.js} +20 -20
  168. package/dist/{journeyDiagram-5HDEW3XC-B-BfhPr4.cjs → journeyDiagram-5HDEW3XC-CvtPgaNR.cjs} +1 -1
  169. package/dist/{journeyDiagram-5HDEW3XC-GOWrusc2.js → journeyDiagram-5HDEW3XC-DMq3piuW.js} +4 -4
  170. package/dist/{kanban-definition-HUTT4EX6-BvnLv2HN.cjs → kanban-definition-HUTT4EX6-DJ9sXiRP.cjs} +1 -1
  171. package/dist/{kanban-definition-HUTT4EX6-BebMuVhZ.js → kanban-definition-HUTT4EX6-Dfal8jdL.js} +34 -34
  172. package/dist/{linear-B9JMAP1U.cjs → linear-CLykHvhQ.cjs} +1 -1
  173. package/dist/{linear-BdCaKB6J.js → linear-CvzPdVAO.js} +12 -12
  174. package/dist/markdown.css +1 -1
  175. package/dist/{mindmap-definition-LN4V7U3C-ChJ71VGh.js → mindmap-definition-LN4V7U3C-C8erO2Mh.js} +20 -20
  176. package/dist/{mindmap-definition-LN4V7U3C-asDDR5DU.cjs → mindmap-definition-LN4V7U3C-CErimIK1.cjs} +1 -1
  177. package/dist/{pegDiagram-2B236MQR-BO1fCXl7.js → pegDiagram-2B236MQR-CECcXaCN.js} +5 -5
  178. package/dist/{pegDiagram-2B236MQR-C3qJlDiV.cjs → pegDiagram-2B236MQR-DBL8X0k9.cjs} +1 -1
  179. package/dist/{pieDiagram-ENE6RG2P-D5-meW-_.cjs → pieDiagram-ENE6RG2P-B_-x0Nvj.cjs} +1 -1
  180. package/dist/{pieDiagram-ENE6RG2P-fYjP8dvh.js → pieDiagram-ENE6RG2P-CWlf16nv.js} +41 -41
  181. package/dist/{quadrantDiagram-ABIIQ3AL-CmqrHJ4C.cjs → quadrantDiagram-ABIIQ3AL-HKlopKX4.cjs} +1 -1
  182. package/dist/{quadrantDiagram-ABIIQ3AL-CKeeL3uz.js → quadrantDiagram-ABIIQ3AL-JpouSW89.js} +2 -2
  183. package/dist/{railroadDiagram-RFXS5EU6-a-pSoUg2.cjs → railroadDiagram-RFXS5EU6-B-v61EFn.cjs} +1 -1
  184. package/dist/{railroadDiagram-RFXS5EU6-D7OWpbvJ.js → railroadDiagram-RFXS5EU6-CLTBEsir.js} +3 -3
  185. package/dist/remarkProcessor.server.d.ts +11 -1
  186. package/dist/{requirementDiagram-TGXJPOKE-BaKLflmx.cjs → requirementDiagram-TGXJPOKE-4vCejkrF.cjs} +1 -1
  187. package/dist/{requirementDiagram-TGXJPOKE-C5_kJLGy.js → requirementDiagram-TGXJPOKE-DtoTpDLe.js} +3 -3
  188. package/dist/{sankeyDiagram-HTMAVEWB-DuUzdIP0.cjs → sankeyDiagram-HTMAVEWB-Bp8p_ojk.cjs} +1 -1
  189. package/dist/{sankeyDiagram-HTMAVEWB-IdJ3gjdw.js → sankeyDiagram-HTMAVEWB-WxnjUz1I.js} +20 -20
  190. package/dist/{sequenceDiagram-DBY2YBRQ-B29fl34a.cjs → sequenceDiagram-DBY2YBRQ-BUPaWSIG.cjs} +1 -1
  191. package/dist/{sequenceDiagram-DBY2YBRQ-B_lxtRfw.js → sequenceDiagram-DBY2YBRQ-DGJcC2MQ.js} +3 -3
  192. package/dist/{sizeCapture-X5ZJPWSS-Dc9QwSOp.js → sizeCapture-X5ZJPWSS-BmP0pJAx.js} +1 -1
  193. package/dist/{sizeCapture-X5ZJPWSS-DAiqtb_j.cjs → sizeCapture-X5ZJPWSS-Dk82fAT8.cjs} +1 -1
  194. package/dist/{stateDiagram-2N3HPSRC-BXIH2aOp.cjs → stateDiagram-2N3HPSRC-CL5Omkqs.cjs} +1 -1
  195. package/dist/{stateDiagram-2N3HPSRC-Wu5OaQhD.js → stateDiagram-2N3HPSRC-ZL_eFTbb.js} +9 -9
  196. package/dist/{stateDiagram-v2-6OUMAXLB-BfTH3hZ6.js → stateDiagram-v2-6OUMAXLB-BgOqjiSL.js} +2 -2
  197. package/dist/{stateDiagram-v2-6OUMAXLB-8XTokhrn.cjs → stateDiagram-v2-6OUMAXLB-D3Zgp8xl.cjs} +1 -1
  198. package/dist/styles/markdown.css +1 -1
  199. package/dist/{swimlanes-5IMT3BWC-BnT290KL.cjs → swimlanes-5IMT3BWC-CuW1KWfs.cjs} +1 -1
  200. package/dist/{swimlanes-5IMT3BWC-CcYHrJAC.js → swimlanes-5IMT3BWC-GB1p75ou.js} +3 -3
  201. package/dist/{swimlanesDiagram-G3AALYLV-CAEjADeH.cjs → swimlanesDiagram-G3AALYLV-Di_Nug7g.cjs} +1 -1
  202. package/dist/{swimlanesDiagram-G3AALYLV-CxHkefqm.js → swimlanesDiagram-G3AALYLV-Jr2ZWz3z.js} +2 -2
  203. package/dist/{timeline-definition-FHXFAJF6-BjbG4nbM.js → timeline-definition-FHXFAJF6-663e-yVA.js} +34 -34
  204. package/dist/{timeline-definition-FHXFAJF6-Dqdftl5b.cjs → timeline-definition-FHXFAJF6-BKVe7Qad.cjs} +1 -1
  205. package/dist/{vennDiagram-L72KCM5P-BxjgXNwH.cjs → vennDiagram-L72KCM5P-2NIIKtsl.cjs} +1 -1
  206. package/dist/{vennDiagram-L72KCM5P-DnlkQHn-.js → vennDiagram-L72KCM5P-BDGC8Vm3.js} +55 -55
  207. package/dist/viewer-settings.cjs +1 -0
  208. package/dist/viewer-settings.d.ts +9 -0
  209. package/dist/viewer-settings.js +7 -0
  210. package/dist/{wardleyDiagram-EHGQE667-CurWRCjn.cjs → wardleyDiagram-EHGQE667-BrTNZSmG.cjs} +1 -1
  211. package/dist/{wardleyDiagram-EHGQE667-2T71AdlP.js → wardleyDiagram-EHGQE667-IbGr9hGV.js} +27 -27
  212. package/dist/{xychartDiagram-FW5EYKEG-DZCKaSum.js → xychartDiagram-FW5EYKEG-CbxKOQYO.js} +23 -23
  213. package/dist/{xychartDiagram-FW5EYKEG-D0ltrZo8.cjs → xychartDiagram-FW5EYKEG-MCkmgF8g.cjs} +1 -1
  214. package/package.json +17 -11
  215. package/dist/flowDiagram-23GEKE2U-BVLgnxZW.js +0 -7
  216. package/dist/flowDiagram-23GEKE2U-D3w55eDA.cjs +0 -1
package/README.md CHANGED
@@ -6,7 +6,7 @@ Advanced Markdown renderer for React with support for various extensions and cus
6
6
 
7
7
  - **Rich Markdown Support**: Full support for CommonMark, GitHub Flavored Markdown (GFM), and LaTeX Math expressions.
8
8
  - **Offloaded Parser**: CPU-heavy Markdown parsing and AST transformation are offloaded to a high-performance Go API server running `goldmark` and `ConnectRPC`.
9
- - **Custom Extensions & Plugins**: Pluggable support for subscript, superscript, mark highlights, table cell merges, embeds (YouTube, Twitter), and Zenn-style directives.
9
+ - **Custom Extensions & Plugins**: GitHub alerts, Zenn-style directives (`:::message` / `:::details`), single-line display math, and pluggable subscript, superscript, mark highlights, table cell merges and embeds (YouTube, Twitter).
10
10
  - **Dynamic Configuration**: Easily enable or disable custom extensions dynamically using parse options.
11
11
  - **Syntax Highlighting**: Code blocks with Shiki syntax highlighting.
12
12
  - **TypeScript**: Full TypeScript support with comprehensive type definitions.
@@ -59,6 +59,11 @@ export MARKDOWN_API_BINARY=/path/to/markdown-api
59
59
  | `MARKDOWN_SOCKET_PATH` | `/tmp/markdown.sock` | サービスと通信する UNIX ドメインソケットのパス |
60
60
  | `MARKDOWN_API_BINARY` | (なし) | 自前ビルドしたバイナリの明示指定 |
61
61
  | `MARKDOWN_API_STARTUP_TIMEOUT_MS` | `10000` | 自動起動したサービスが待ち受け開始するまでの猶予 |
62
+ | `MARKDOWN_MAX_SOURCE_BYTES` | `8388608` (8 MiB) | サービスが受け付ける Markdown の本文の最大 (`@import` で取り込んだ分を含む) |
63
+ | `MARKDOWN_MAX_HTML_BYTES` | `33554432` (32 MiB) | サービスが作る HTML の最大 (呼び出しの `maxHtmlBytes` はこれを下げることだけができる) |
64
+ | `MARKDOWN_CONVERT_TIMEOUT` | `30s` | 変換 1 回の最長の時間 (Go の時間の書式。呼び出しの `timeoutMs` はこれを短くすることだけができる) |
65
+
66
+ 後の 3 つはサービス (`markdown-api`) が読む。自動起動したサービスは呼び出し元のプロセスの環境を受け継ぐ。正の数 (時間は正の時間) 以外の値ではサービスが起動しない。
62
67
 
63
68
  ## Usage
64
69
 
@@ -83,7 +88,12 @@ console.log("Hello, World!")
83
88
  const parseResult = await parseMarkdown(
84
89
  markdownText,
85
90
  "/srv/docs/notes/my-file.md",
86
- "/srv/docs"
91
+ "/srv/docs",
92
+ undefined, // the reader's OAuth token for cloud documents
93
+ {
94
+ deniedPathSegments: [".env*", "secrets", "*.pem"], // the host's deny rules ([] denies nothing)
95
+ maxHtmlBytes: 4 * 1024 * 1024
96
+ }
87
97
  )
88
98
 
89
99
  // parseResult: ParseResult
@@ -99,36 +109,257 @@ console.log("Hello, World!")
99
109
  }
100
110
  ```
101
111
 
102
- ### Pluggable Parser Options
112
+ `htmlContent` can go to `MarkdownRenderer` as `parseMarkdown` returns it: the converter renders raw HTML as written, and the renderer passes every element through its own allow list (see [Raw HTML](#raw-html)), under server rendering and in the browser alike. A host may sanitize the HTML before as well.
113
+
114
+ ### Parse Options
103
115
 
104
- You can dynamically enable or disable custom extensions using `ParseOptions` (exported from `@aiquants/markdown/server`):
116
+ The fifth argument of `parseMarkdown` is `ParseOptions` (exported from `@aiquants/markdown/server`). `deniedPathSegments` and `maxHtmlBytes` are required.
105
117
 
106
118
  ```tsx
119
+ const controller = new AbortController()
107
120
  const parseResult = await parseMarkdown(
108
121
  markdownText,
109
122
  "/srv/docs/notes/my-file.md",
110
123
  "/srv/docs",
111
124
  undefined, // OAuth Token if needed
112
125
  {
113
- validateExistence: true,
114
- enableSubscript: false, // Disable subscript (leaves ~2~ as plain text)
115
- enableSuperscript: true, // Enable superscript
116
- enableMark: false, // Disable highlight mark
117
- enableTableMerge: true, // Enable table merges (> and ^)
118
- enableEmbeds: true, // Enable YouTube / Twitter embeds
119
- enableZennDirectives: true // Enable :::message / :::details
126
+ deniedPathSegments: hostDenyRules, // required; [] denies nothing
127
+ maxHtmlBytes: 4 * 1024 * 1024, // required; the largest HTML in bytes
128
+ resolveImports: false, // expand <!-- @import "path" --> (default false)
129
+ validateExistence: true, // mark missing local images and doc links (default true)
130
+ signal: controller.signal, // cancels the conversion in the service too
131
+ timeoutMs: 10_000, // the conversion's deadline
132
+ enableSubscript: false, // Disable subscript (leaves ~2~ as plain text)
133
+ enableSuperscript: true, // Enable superscript
134
+ enableMark: false, // Disable highlight mark
135
+ enableTableMerge: true, // Enable table merges (> and ^)
136
+ enableEmbeds: true, // Enable YouTube / Twitter embeds
137
+ enableZennDirectives: true // Enable :::message / :::details
120
138
  }
121
139
  )
122
140
  ```
123
141
 
142
+ | Option | Required | Meaning |
143
+ | --- | --- | --- |
144
+ | `deniedPathSegments` | ✅ | Deny rules applied to every target the conversion resolves: `@import` targets, images and links. A pattern matches one whole path segment (`*` matches any run of characters within it), compared after NFKC normalization and case folding at every percent-decoding level (the semantics of `@aiquants/markdown-explorer`'s deny rules). Local targets must also stay inside `workspaceRoot`, also once symbolic links are resolved. A refused image renders without `src`, a refused link without a destination (with `validateExistence`, both are marked like a missing target, whether or not the target exists), and a refused import rejects the call. |
145
+ | `maxHtmlBytes` | ✅ | The largest HTML in bytes, a positive integer up to `MAX_HTML_BYTES_LIMIT`. The service stops while it renders and the call rejects with `MarkdownResourceExhaustedError`; the response the call accepts is bounded by twice this plus 64 KiB. |
146
+ | `resolveImports` | | Expand `<!-- @import "path" -->` directives (default `false`: a directive stays an HTML comment and nothing is read). Only Markdown (`.md`) targets the deny rules admit are read, nested imports included; a refused target rejects the call with `permission_denied`. |
147
+ | `validateExistence` | | Mark missing local images (`data-asset-exists="false"`, `data-asset-src`) and doc links (`data-doc-exists`) (default `true`). |
148
+ | `signal` | | Cancels the call; the service stops converting. |
149
+ | `timeoutMs` | | The conversion's deadline in milliseconds (a positive integer); the service stops at it or at `MARKDOWN_CONVERT_TIMEOUT`, whichever comes first. |
150
+ | `enable*` | | Switch the syntax extensions and HTML plugins (each enabled unless `false`). The text plugins leave `summary` text (a `:::details` title included) as written. |
151
+
152
+ Invalid options throw `TypeError` / `RangeError` before any request. A conversion stopped at a size limit (the HTML limit, the service's source limit or a message limit) rejects with `MarkdownResourceExhaustedError` (its `cause` is the connect error); every other failure rejects with the `ConnectError` of the service (`invalid_argument`, `permission_denied`, `canceled`, `deadline_exceeded`, `internal`).
153
+
154
+ ### Local image URLs
155
+
156
+ An image destination is a URL decoded once: `![](a%2541.png)` names the file `a%41.png`, while `![](a%41.png)` names `aA.png` (a `%` not followed by two hexadecimal digits, as in `100%.png`, may be written as it is).
157
+ A local image's `src` is `/assets/` followed by its path from `workspaceRoot`, written as `@aiquants/markdown-explorer`'s README asks of an asset URL ("Serving images and media"): each path segment percent-encoded after every `%` is written as `%25`, and a final `.data` written as `%2Edata` (`資料/進捗100%.png` becomes `/assets/%E8%B3%87%E6%96%99/%E9%80%B2%E6%8D%97100%2525.png`, `x.data` becomes `/assets/x%2Edata`).
158
+ Serve `/assets/*` from a route that decodes the path once and then turns only `%25` back into `%` (in a React Router splat route, replace `%25` with `%` in the splat React Router has decoded); every file name then arrives unchanged.
159
+
160
+ ## Viewer, embeds and links
161
+
162
+ ### Stylesheets
163
+
164
+ | Import | Content |
165
+ | --- | --- |
166
+ | `@aiquants/markdown/styles/markdown.css` | The components' own styles (Tailwind build) |
167
+ | `@aiquants/markdown/styles/github-markdown.css` | GitHub document style (`markdown-body`) |
168
+ | `@aiquants/markdown/styles/zenn-content.css` | Zenn document style (`znc`) |
169
+ | `@aiquants/markdown/styles/katex.min.css` | KaTeX's own stylesheet, shipped with the fonts it references (`fonts/` next to it) at the version of the bundled `katex` |
170
+ | `@aiquants/markdown/styles/details.css` / `message.css` | `<details>` and message blocks |
171
+
172
+ The document stylesheets size their text in `rem`, so the document follows text-only zoom (the browser's default font size, the root `font-size`) together with the viewer's controls; at the default 16 px root they look exactly as GitHub's and Zenn's own stylesheets.
173
+
174
+ ### Raw HTML
175
+
176
+ Every renderer of the package — `MarkdownRenderer` (and so `MarkdownViewer`) for the converter's HTML, and `NodesRenderer`'s raw HTML nodes and HTML containers for an mdast tree — renders raw HTML through one allow list. It runs on the tree html-react-parser builds, right where the tree is rendered, so it needs no DOM and holds the same under server rendering and in the browser; nothing is serialized and parsed again.
177
+
178
+ - **Removed with their content**: `script`, `style`, `template`, `noscript`, `noembed`, `noframes`, `plaintext`, `xmp`, `title`, `head`, `meta`, `link`, `base`, `object`, `embed`, `applet`, `param`, `frame`, `frameset`, `select`, `datalist`, `track`, `math`, `foreignObject`, every iframe that is not an allowed embed (see [Embeds](#embeds)), and every `input` except a disabled checkbox (a task-list item).
179
+ - **Kept**: the elements Markdown produces and common text and structure elements (`a`, `img`, `p`, `div`, `span`, headings, lists, tables, `blockquote`, `pre`, `code`, `details`, `summary`, `aside`, `section`, `figure`, `sup`, `sub`, `mark`, `video`, `audio`, `source` …) and, for icons, an `svg` with `g` and `path` inside it (anything else inside an `svg` is removed).
180
+ - **Unwrapped** (the element is dropped, its children render): every other element — `form`, `button`, `textarea`, `label`, `font`, `center`, custom elements and the like — so its text survives.
181
+ - **Attributes**: `title`, `lang`, `dir`, `role`, `hidden`, `translate`, `aria-*`, a reduced `class`, `id` and `style`, and each element's own (`href`, `src`, `alt`, `width`, `height`, `colspan`, `rowspan`, `align`, `open`, `start` …; a link keeps `name`, the fragment target of older documents).
182
+ The `data-*` attributes the renderers read survive on their element only: `data-link-kind`, `data-doc-path`, `data-doc-exists`, `data-footnote-ref` and `data-footnote-backref` on links, `data-asset-src` and `data-asset-exists` on images, `data-footnotes` on sections, and the embed placeholders' `data-plugin-type`, `data-video-id`, `data-tweet-id` and `data-url` on `div`. Event handlers, `target`, `rel`, `name` (except on links), `srcset`, `usemap`, `ping`, `formaction`, `xlink:href`, `tabindex` and every other attribute are dropped.
183
+ - **Attribute names** are read as an HTML parser stores them: in lower case, and of names that differ only in case the first one written. Kept attributes carry lower-case names, so `<p STYLE="text-align:center">` or `<a HREF="https://…">` renders the same on the server (where html-react-parser keeps the author's case) and in the browser, and hydrates without a mismatch.
184
+ - **`class`** keeps only the package's own tokens: the converter's markup (`markdown-alert`, `markdown-alert-{note,tip,important,warning,caution}`, `markdown-alert-title`, `octicon`, `octicon-{info,light-bulb,report,alert,stop}`, `mr-2`, `message`, `alert`, `info`, `warning`, `message-symbol`, `message-content`, `markdown-details`, `markdown-details-content`, `footnotes`, `footnote-ref`, `footnote-backref`, `math`, `inline`, `display`) and a code block's language (`language-*`).
185
+ An author's tokens and utility classes (`fixed inset-0 z-50` …) are dropped, so a document can neither restyle the page nor lay an element over it; a link's `className` (also the one `linkComponent` receives) holds only the kept tokens and the package's link classes. Tables carry their alignment in `align` and `style`, not in classes.
186
+ - **`id`** survives only on a heading (the table of contents, in-document links and a host's fragment navigation name headings by it), on the converter's footnotes (`fnref:N` / `fnrefK:N` on a reference's `sup`, `fn:N` on a note's `li`) and in the user-content namespace (`user-content-…`, the prefix GitHub-style footnotes use; write raw HTML fragment targets with it, or as `<a name="…">`).
187
+ Every other element loses its id, so a document cannot take a name the page or a script looks up (`getElementById`, the named properties of `window`). A heading keeps whatever id the document gives it: a host should not look up its own elements by an id a document could also give a heading (prefer refs), and the package's own lookups check what they find (see [Embeds](#embeds)).
188
+ - **Host sanitizers**: a host that sanitizes the HTML before the renderer (as `@aiquants/markdown-explorer` does with DOMPurify) gets the intersection of both allow lists; DOMPurify keeps `class` and `id` by default, so on the page the rules above are the ones that apply.
189
+ - **URLs** (`href`, `src`, `cite`, `poster`, `data-url`): `http:`, `https:`, `mailto:` and `tel:` in any letter case, and references without a scheme. `javascript:`, `data:` and every other scheme are dropped, however they are spelled (entities, spaces, tabs, control characters). The mdast `LinkNode` and `ImageNode`, the block link card `RichLinkCard` (its `href`, and the `url` and `image` of the site metadata it shows) and the table of contents' entries follow the same rule.
190
+ - **`style`** keeps only its last valid `text-align` declaration (the alignment of table cells); positioning, `url()` and every other declaration are dropped. An SVG `fill` that references anything (`url(…)`) is dropped.
191
+
192
+ ### Embeds
193
+
194
+ - `iFrameAllowedDomains` lists the hostnames an iframe may load from: the `src` must be `https:`, without a user name, a password or an explicit port, and its hostname must match an entry exactly. Every other iframe is removed (fail closed), including an iframe without `src` (`srcdoc`). An allowed iframe is rendered from validated values and keeps only `title`, `width`, `height`, `allow`, `allowfullscreen`, `sandbox`, `referrerpolicy`, `loading`, `frameborder` and `scrolling` (no `id` or `class`: the package's markup gives an iframe neither).
195
+ `allow` keeps each feature's name without its allowlist, so a feature applies to the embedded origin only (`camera *; microphone 'self' https://x.example` becomes `camera; microphone`); `referrerpolicy` is kept only as `no-referrer`, `origin`, `same-origin`, `strict-origin` or `strict-origin-when-cross-origin`.
196
+ - An iframe plugin (`data-plugin-type="dify"`) receives the validated iframe as structured props, never as an HTML string. The Dify plugin acts only on messages its own frame's window posts from an allowed origin, and ignores a message that is not an object with a string `type`.
197
+ - A YouTube embed loads the player only when `www.youtube.com` is in `iFrameAllowedDomains`; otherwise it renders a link to the video's watch page.
198
+ - A tweet renders as a link to its address unless the host sets `allowTwitterWidgetScript` (on `MarkdownRenderer` and `MarkdownViewer`), which lets the page load and run `https://platform.twitter.com/widgets.js`. The widgets are taken from that script only: an existing copy is found as a `script` element with that `src` (never by the `twitter-wjs` id), and `window.twttr.widgets` is used only when its `createTweet` is a function, so an element a document names `twitter-wjs` or `twttr` cannot block or impersonate it.
199
+
200
+ ```tsx
201
+ <MarkdownViewer {...props} iFrameAllowedDomains={["www.youtube.com"]} allowTwitterWidgetScript={false} />
202
+ ```
203
+
204
+ ### Links
205
+
206
+ - A link is external when its `href` names a scheme in any case (`https:`, `HTTPS:`, `mailto:`) or another host (`//host/…`, `/\host/…`), whatever its `data-link-kind` says (only `asset` links, the converter's storage objects, may carry an absolute URL and stay with `linkComponent`), and when `data-link-kind` is `external`. An external link opens in a new tab with `rel="noreferrer"` and is never handed to `linkComponent`. The author's `target` and `rel` never survive.
207
+ - `linkComponent` receives `href`, `kind`, `docPath`, `docExists`, `className`, `children` and `attributes`: the link's `id`, `title`, `lang`, `dir`, `role`, `aria-*` and `data-footnote-*` (event handlers, `style` and `href`-like attributes never pass). Spread `attributes` onto the anchor you render so footnote references keep their `id` and `aria-describedby` and back-references keep their `aria-label`:
208
+
209
+ ```tsx
210
+ const AppLink = ({ href, className, attributes, children }: MarkdownLinkProps) => (
211
+ <Link to={href} className={className} {...attributes}>
212
+ {children}
213
+ </Link>
214
+ )
215
+ ```
216
+
217
+ - Only a link that wraps an image or block content is laid out as a box (`inline-block`); a link around text stays inline, so a footnote reference inside `<sup>` keeps the height of its glyphs and shows its focus ring.
218
+
219
+ ### Content column and alignment
220
+
221
+ `MarkdownViewer` lays the document out in one column, `[data-aqmd-content]`, inside the scroll container's padding:
222
+
223
+ | Prop | Effect |
224
+ | --- | --- |
225
+ | `width` | The column's CSS `width`. Unset, the column is `100%` wide: the full width of the scroll container's track, whatever the content, so a short document and a diagram drawn at the column's width get the whole width |
226
+ | `maxWidth` | The column's CSS `max-width` (`"1200px"`, `"min(1200px, 100%)"` …). Unset, nothing caps the column beyond `width` |
227
+ | `align` | Places a column narrower than the track: `left` (`margin-inline: 0 auto`), `center` (`auto`) or `right` (`auto 0`). It shows only when `width` or `maxWidth` makes the column narrower than the track |
228
+
229
+ The alignment button needs `onAlignChange`, `showAlign` (on by default) and a `width` or `maxWidth`. Without either of the two, the column fills the track and no alignment can move it, so the viewer does not render the button, whatever `showAlign` says.
230
+
231
+ With the `GitHub` and `Zenn` styles of `DEFAULT_MARKDOWN_STYLES`, a wide table or a long code line scrolls inside its own box. Content with a fixed width wider than the column, such as an embedded `<iframe>` whose `width` attribute exceeds it, overflows the column, and so does any wide content under the `None` style, which loads no stylesheet; the scroll container then scrolls sideways.
232
+
233
+ ### Mermaid diagrams
234
+
235
+ A fenced code block in the `mermaid` language renders as `MermaidDiagram`, a block that takes its containing block's width (its slot). The slot's first child is a hidden measuring element, `[data-aqmd-mermaid-measure]` (no height, clipped, `visibility: hidden`, `aria-hidden`), present while the diagram loads, shows or fails; the component measures the slot's width with it.
236
+ Each drawing gets its own drawing host, `[data-aqmd-mermaid-host]`: a hidden element (`visibility: hidden`, `aria-hidden`, absolutely positioned just outside the start edge, `contain: strict`) appended to the main document's `<body>`, with its width set to the measured width in px.
237
+ Mermaid draws in that element and the component shows the result in the slot, so a gantt chart, whose width Mermaid takes from where it is drawn, is exactly as wide as the slot. Because Mermaid looks its drawing up through the main document, the host lives in the main document's light DOM, and a diagram in a slot inside a shadow root is drawn the same way.
238
+
239
+ - The component removes a drawing host when its drawing settles (shown, failed, or discarded as stale) and when the component unmounts or its text changes, so none is left behind, not even the error drawing Mermaid leaves for a text it cannot parse.
240
+ - Nothing is drawn while the slot has no width (inside a closed `<details>` the browser does not lay out, or a hidden panel): the loading text stays until the slot gets a width. A drawing already under way when the slot loses its width finishes at the width it was given.
241
+ - When the width of a slot showing a gantt chart changes (a splitter drag, a window resize), the chart is drawn again at the new width 200 ms after the last change, unless the slot then has no width or the width of the latest drawing. The shown chart stays until the new one replaces it, and the new one starts at the initial zoom and pan. Other diagram types take their size from their text and are never drawn again for a width change.
242
+ - A drawing that finishes after a newer one started, after the diagram's text changed or after the component unmounted is discarded.
243
+
244
+ ### Viewer toolbar
245
+
246
+ `MarkdownViewer` shows its alignment, style and table-of-contents buttons as one fixed row, in that visual and tab order, spaced in `rem` so they never overlap at large text sizes. Place the row with two package-scoped custom properties, both `0px` unless set:
247
+
248
+ | Property | Effect |
249
+ | --- | --- |
250
+ | `--aqmd-toolbar-inset-block-start` | Offset from the top of the toolbar's containing block |
251
+ | `--aqmd-toolbar-inset-inline-end` | Offset from the inline end of the containing block (added to the scrollbar clearance) |
252
+
253
+ The viewer reads no other package's variable. Where the toolbar is fixed to the viewport and must clear something of the host's own (a pinned side menu, for example), bind the property to that width in the host's layout, on an ancestor of the viewer:
254
+
255
+ ```css
256
+ .my-layout {
257
+ --aqmd-toolbar-inset-inline-end: var(--my-side-menu-width, 0px);
258
+ }
259
+ ```
260
+
261
+ A viewer inside a containing block of its own (an element with `contain: layout paint`, a transform) needs no binding: the row sits at that block's edge.
262
+
263
+ The scroll container (`[data-aqmd-scroll-container]`) publishes `--aqmd-toolbar-block-overlap`: the depth of its top band that the floating toolbar covers, `0px` at widths where the toolbar covers none of the content. The viewer already reserves it as top padding and `scroll-padding-block-start`, so the first line and fragment targets stay clear of the buttons; read it when you place your own content at the start of the container.
264
+ The value is measured again whenever the container, the content or the toolbar resizes, the window resizes, the alignment changes (the content moves sideways), anything scrolls (a toolbar fixed to the viewport stays put while the container moves; at most once per frame), and the two inset properties change (an invisible box inside the toolbar, `[data-aqmd-toolbar-inset-probe]`, takes its size from them).
265
+
266
+ Each menu's popover opens below the toolbar at its inline end, whichever button opened it, and is never wider than the scroll container less the toolbar's distance from its inline end, so the popover stays inside the container at any width and text size. The scroll container is an inline-size query container (`container-type: inline-size`) for that measure; the menu activated last stacks on top.
267
+
268
+ An open, unpinned popover closes on Escape while the focus is inside its menu, returns the focus to its button and calls `preventDefault()` on that keydown, so an outer Escape handler can skip a key the viewer consumed. Escape is not consumed while no popover is open.
269
+
270
+ ### Table of contents
271
+
272
+ Activating an entry closes an unpinned table of contents, reveals the heading if it is hidden, scrolls to it (instantly under `prefers-reduced-motion: reduce`) and moves the focus to it (adding `tabindex="-1"` when the heading has none), so the next Tab continues from that section. Pass `onHeadingSelect(heading, event)` to take part: return `false` to let the viewer reveal, scroll and focus after your own work (writing the URL hash, say), or `true` when you have handled the navigation yourself.
273
+
274
+ An entry links to `#` followed by the heading's id. Where the page's URL does not address the document (several documents side by side, a document chosen by state), pass `headingHref(heading)` (`MarkdownHeadingHrefResolver`) to give each entry the heading's own address, so copying the entry's address or opening it in a new tab with a middle click reaches the heading; pass a stable function, since the table of contents is built again when it changes.
275
+ The href goes through the package's URL rule (an entry with a refused href has none), and activating an entry still runs `onHeadingSelect` and the viewer's navigation. A Ctrl-, Cmd- or Shift-click is an activation, so return `true` from `onHeadingSelect` when a modifier key is down to let the browser open the address instead.
276
+
277
+ The viewer stops the link's own navigation, so it reveals the heading the way a browser reveals the fragment it navigates to:
278
+
279
+ - Every closed `<details>` around the heading opens, except one whose own summary (its first `<summary>` child, which shows while the `<details>` is closed) holds the heading. A heading in a second `<summary>` belongs to the hidden content, so its `<details>` opens.
280
+ - Each element from the heading upward that has `hidden="until-found"` (in any letter case) receives a bubbling `beforematch` event, innermost first, and then loses `hidden`.
281
+ - An open `<details>` and a plain `hidden` are left as they are.
282
+
283
+ ```tsx
284
+ <MarkdownViewer
285
+ {...props}
286
+ onHeadingSelect={(heading) => {
287
+ history.replaceState(null, "", `#${heading.id}`)
288
+ return false
289
+ }}
290
+ />
291
+ ```
292
+
293
+ ```tsx
294
+ // Module level, so the function stays the same between renders
295
+ const headingHref: MarkdownHeadingHrefResolver = (heading) => `/docs/guide.md#${encodeURIComponent(heading.id)}`
296
+
297
+ <MarkdownViewer
298
+ {...props}
299
+ headingHref={headingHref}
300
+ onHeadingSelect={(_heading, event) => event.ctrlKey || event.metaKey || event.shiftKey}
301
+ />
302
+ ```
303
+
304
+ ### Labels and languages
305
+
306
+ Every name and text the viewer draws comes from `labels` (`MarkdownViewerLabels`), including the table-of-contents and alignment controls and, through the `mermaid*` keys, the controls of each Mermaid diagram (`MermaidDiagram` takes `MermaidDiagramLabels` as `labels`).
307
+ A label you pass carries no language of its own and is read in your page's language.
308
+ A built-in label marks the element that bears it with its own language: the status texts and style controls are English (`lang="en"`), the table-of-contents, alignment and Mermaid menu controls are Japanese (`lang="ja"`), and the Mermaid zoom buttons are English. `DEFAULT_MARKDOWN_VIEWER_LABELS` and `DEFAULT_MERMAID_DIAGRAM_LABELS` hold the built-in texts.
309
+
310
+ ### Settings without React
311
+
312
+ `@aiquants/markdown/viewer-settings` exports the built-in document styles and the alignments without loading React, for modules that also run on the server (configuration, validation): `DEFAULT_MARKDOWN_STYLES`, `MarkdownStyleOption`, `ContentAlign`, `CONTENT_ALIGNS`, `DEFAULT_CONTENT_ALIGN` and `toContentAlign`. `@aiquants/markdown` re-exports the same values.
313
+
314
+ ```ts
315
+ import { DEFAULT_MARKDOWN_STYLES, toContentAlign } from "@aiquants/markdown/viewer-settings"
316
+ ```
317
+
124
318
  ## Extended Syntax
125
319
 
126
320
  The parser supports the following extended markdown syntax in addition to CommonMark and GFM.
127
321
 
128
322
  ### LaTeX Math Expressions
129
323
 
130
- - Inline math: `$y=x^2$`
131
- - Display math: `$$ e^{i\theta} = \cos\theta + i\sin\theta $$` (or multiline block)
324
+ - Inline math: `$y=x^2$`. A single `$` follows the `tex_math_dollars` rule of Pandoc 3.12: the opening `$` must be followed by a character that is not white space, and the formula ends at the first `$` after it that is not escaped by `\` and not inside a `\text{…}` group whose braces close; that `$` must follow a character that is not white space (a character escaped by `\`, such as the space in `$a\ $`, is not) and must not be followed by an ASCII digit; otherwise the `$` stays text.
325
+ Stricter than Pandoc, white space is Unicode's (the ideographic space included) and a `$` at the start of a line never closes. So `$20,000 and $30,000`, `$100〜$200`, `$HOME and $PATH` and `$ x $` are text, while `$x$`, `$a\$b$`, `$a\ $` and `$\text{for all $x$}$` are formulas; write a literal dollar as `\$` or inside a code span.
326
+ - Within a line of text, `$$ … $$` is inline math too (`Cost $$ x $$ here` is the formula `x`): it ends at the next run of as many `$`, with white space allowed inside its ends. An inline formula may continue on the paragraph's next line.
327
+ - Display math: a multi-line block, or a whole line `$$ e^{i\theta} = \cos\theta + i\sin\theta $$` (at most three spaces of indentation; it can follow a paragraph line directly). Both forms render the same. Inside code blocks the lines stay code.
328
+ - A multi-line block opens on a line of two or more `$` whose rest holds no `$` (that rest is not part of the formula) and closes on a line of two or more `$` alone. Any other `$$ … $$` — within a line of text, or followed by more text on its line (`$$E=mc^2$$.`) — is inline math in its paragraph.
329
+ - A formula reaches KaTeX exactly as written: `0<x<1`, `a & b`, quotes and `x^2 + y^2` included (the converter escapes the formula's text once, the viewer reads the text back once, and the subscript, superscript and highlight syntax never applies inside a formula).
330
+
331
+ ```markdown
332
+ $$
333
+ e^{i\theta} = \cos\theta + i\sin\theta
334
+ $$
335
+ ```
336
+
337
+ Every renderer (`MarkdownRenderer`, `MarkdownViewer`, `NodesRenderer`) renders a formula with the same KaTeX options: `throwOnError: false` (an invalid formula shows its source in red) and display math in display mode.
338
+ Nothing KaTeX says about a formula reaches the console, in the browser or on the server: its reports about LaTeX-incompatible input that still renders (a text-mode accent such as `\r` in math mode, an unknown symbol, `\\` in display math), its warning about a character its fonts have no metrics for (※, ①, ★, €, an emoji: code `noCharacterMetrics`), and the TeX console commands `\message`, `\errmessage` and `\show`, which render nothing (code `consoleCommand`).
339
+ `MarkdownRenderer` and `MarkdownViewer` hand them to `onMathDiagnostics` as `MarkdownMathDiagnostic` objects (`{ code, message, formula, displayMode }`): after the commit, once per document, and only when there is one; the viewer's function may change on any render without the document being parsed again.
340
+ Japanese or other non-Latin letters inside a formula (`\frac{売上}{原価}`) are not reported, since KaTeX renders them as written; `\text{…}` is the LaTeX way to write words inside a formula.
341
+
342
+ ```tsx
343
+ <MarkdownViewer
344
+ {...props}
345
+ onMathDiagnostics={(diagnostics) => {
346
+ for (const { code, message, formula } of diagnostics) logger.debug(`[math] ${code}: ${message} — ${formula}`)
347
+ }}
348
+ />
349
+ ```
350
+
351
+ ### GitHub Alerts
352
+
353
+ ```markdown
354
+ > [!NOTE]
355
+ > Useful information that users should know.
356
+ ```
357
+
358
+ `NOTE`, `TIP`, `IMPORTANT`, `WARNING` and `CAUTION` (any letter case) render GitHub's own alert markup (`div.markdown-alert.markdown-alert-{type}` with a `p.markdown-alert-title` holding the type's octicon and title). As on GitHub:
359
+
360
+ - only a blockquote directly at the document root becomes an alert — inside a list item, another blockquote or a Zenn directive it stays a blockquote;
361
+ - the marker must be alone on the first line (`> [!NOTE] text` stays a blockquote);
362
+ - something must follow the marker line (`> [!NOTE]` alone stays a blockquote).
132
363
 
133
364
  ### Table cell merge markers
134
365
 
@@ -165,7 +396,7 @@ This is ==important== text.
165
396
 
166
397
  ### Zenn-style Directives
167
398
 
168
- Supports Zenn-style message box and details box with support for recursive nesting:
399
+ Message boxes and collapsible details, enabled unless `enableZennDirectives` is `false`:
169
400
 
170
401
  ```markdown
171
402
  :::message info
@@ -179,6 +410,27 @@ This is a nested warning message inside details.
179
410
  :::
180
411
  ```
181
412
 
413
+ - **Opening line**: three or more `:`, then `message` or `details` and an optional argument. No blank lines are needed around fence lines.
414
+ - **Message types**: `:::message alert`, `:::message info` and `:::message warning`; any other argument gives a plain message.
415
+ - **Details title**: the rest of the line, shown as plain text (HTML-escaped, no Markdown, and left as written by the subscript, superscript and mark plugins, as on Zenn); it may be empty.
416
+ - **Nesting**: at most eight directives are open around a line; an opening line inside eight is ordinary text (as markdown-it caps its nesting, without dropping what follows).
417
+ - **Closing line**: three or more `:` alone. It closes the innermost open directive it reaches whose opening fence is not longer than it, so nested directives work with equal fences (as above) and with Zenn's longer outer fence (`::::details` … `::::`). It reaches a directive only through the containers around it (a blockquote's `>`, a list item's indentation) and nothing inside a container it does not continue.
418
+ A closing line inside a fenced code block or a `$$` math block belongs to that block, and so does one inside a multi-line `<pre>`, `<script>`, `<style>`, `<textarea>` or comment; after any other HTML block (`<div>`, `<img>`, `<br>`, a one-line comment …) it closes the directive, as on Zenn.
419
+ - **Unclosed** directives extend to the end of their parent (the document, a blockquote, a list item or an enclosing directive). The content is ordinary Markdown.
420
+
421
+ The markup is the one the `ZennMessageNode` / `ZennDetailsNode` components render: `aside.message` (plus `alert` / `info` / `warning`) with `span.message-symbol` and `div.message-content`, and `details.markdown-details` with its `summary` and `div.markdown-details-content`.
422
+
423
+ ### Stylesheets for the extended syntax
424
+
425
+ | Stylesheet | Styles |
426
+ | --- | --- |
427
+ | `@aiquants/markdown/styles/markdown.css` | Package core sheet. Includes a theme-independent baseline for GitHub alerts (GitHub's light and dark palette, dark via `.dark` or `[data-theme="dark"]`), written with zero-specificity `:where()` selectors so any display style overrides it. |
428
+ | `@aiquants/markdown/styles/github-markdown.css` | The GitHub display style (`.markdown-body`), including GitHub's own alert rules, which win over the baseline. |
429
+ | `@aiquants/markdown/styles/message.css` | `:::message` boxes (`aside.message`), in every display style. The `!` symbol (`.message-symbol`) is not selectable, so copying a message copies its text only. |
430
+ | `@aiquants/markdown/styles/details.css` | `:::details` boxes (`.markdown-details`), in every display style. A summary focused from the keyboard (`:focus-visible`) shows the GitHub style's focus ring, `2px solid` drawn `2px` inside its edge, in `#0969da` (`#1f6feb` under `[data-theme="dark"]`); a mouse press shows none. |
431
+ | `@aiquants/markdown/styles/zenn-content.css` | The Zenn display style (`.znc`). |
432
+ | `@aiquants/markdown/styles/katex.min.css` | KaTeX output for inline and display math. |
433
+
182
434
  ### Notes
183
435
 
184
436
  - goldmark's GFM strikethrough only recognizes double tildes (`~~text~~`), so single-tilde `~text~` is reserved for subscript.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chunk-MOJQB5TN-Bs5Jj3Zh.cjs"),u=require("./chunk-JWPE2WC7-CNFRDah7.cjs"),n=require("./extractHeadings-BrLI2qQF.cjs"),i=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var p=i.createRailroadAbnfServices().RailroadAbnf.parser.LangiumParser,o=n.__name(e=>{const r=e.alternatives.map(c);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),c=n.__name(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),f=n.__name(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),d=n.__name(e=>{const r=b(e.primary);if(!e.repeat)return r;const{min:t,max:s}=f(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),b=n.__name(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return o(e.element);case"AbnfOptionalGroup":return{type:"optional",element:o(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),g=n.__name(e=>({name:e.name,definition:o(e.definition)}),"transformRule"),v=n.__name(e=>{u.populateCommonDb(e,a.db),e.title&&a.db.setTitle(e.title),e.rules.map(r=>a.db.addRule(g(r)))},"populateDb"),y={parse:n.__name(e=>{a.db.clear(),n.log.debug("[ABNF Parser] Starting Langium parse");const r=p.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new i.MermaidParseError(r);const t=r.value;n.log.debug("[ABNF Parser] Parsed rules:",t.rules.length),v(t),n.log.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a.db}},_={parser:y,db:a.db,renderer:a.renderer,styles:a.getStyles};exports.diagram=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chunk-MOJQB5TN-Dh_1HfSC.cjs"),u=require("./chunk-JWPE2WC7-CNZBI1Pb.cjs"),n=require("./extractHeadings-R7NxLZJP.cjs"),i=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var p=i.createRailroadAbnfServices().RailroadAbnf.parser.LangiumParser,o=n.__name(e=>{const r=e.alternatives.map(c);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),c=n.__name(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),f=n.__name(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),d=n.__name(e=>{const r=b(e.primary);if(!e.repeat)return r;const{min:t,max:s}=f(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),b=n.__name(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return o(e.element);case"AbnfOptionalGroup":return{type:"optional",element:o(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),g=n.__name(e=>({name:e.name,definition:o(e.definition)}),"transformRule"),v=n.__name(e=>{u.populateCommonDb(e,a.db),e.title&&a.db.setTitle(e.title),e.rules.map(r=>a.db.addRule(g(r)))},"populateDb"),y={parse:n.__name(e=>{a.db.clear(),n.log.debug("[ABNF Parser] Starting Langium parse");const r=p.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new i.MermaidParseError(r);const t=r.value;n.log.debug("[ABNF Parser] Parsed rules:",t.rules.length),v(t),n.log.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a.db}},_={parser:y,db:a.db,renderer:a.renderer,styles:a.getStyles};exports.diagram=_;
@@ -1,27 +1,27 @@
1
- import { g as p, r as u, d as n } from "./chunk-MOJQB5TN-DwJ5ntgS.js";
2
- import { p as f } from "./chunk-JWPE2WC7-DtFuVO4n.js";
3
- import { _ as a, a0 as o } from "./extractHeadings-BUHj1PcO.js";
1
+ import { g as p, r as u, d as a } from "./chunk-MOJQB5TN-D1oF99aM.js";
2
+ import { p as f } from "./chunk-JWPE2WC7-B-nuuS4b.js";
3
+ import { _ as n, $ as o } from "./extractHeadings-B2I83li5.js";
4
4
  import { M as c, b as d } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
5
- var v = d().RailroadAbnf.parser.LangiumParser, i = /* @__PURE__ */ a((e) => {
5
+ var v = d().RailroadAbnf.parser.LangiumParser, i = /* @__PURE__ */ n((e) => {
6
6
  const r = e.alternatives.map(g);
7
7
  return r.length === 1 ? r[0] : {
8
8
  type: "choice",
9
9
  alternatives: r
10
10
  };
11
- }, "transformAlternation"), g = /* @__PURE__ */ a((e) => {
11
+ }, "transformAlternation"), g = /* @__PURE__ */ n((e) => {
12
12
  const r = e.elements.map(y);
13
13
  return r.length === 1 ? r[0] : {
14
14
  type: "sequence",
15
15
  elements: r
16
16
  };
17
- }, "transformConcatenation"), b = /* @__PURE__ */ a((e) => {
17
+ }, "transformConcatenation"), b = /* @__PURE__ */ n((e) => {
18
18
  if (e.includes("*")) {
19
19
  const [t, s] = e.split("*"), l = t ? parseInt(t, 10) : 0, m = s ? parseInt(s, 10) : 1 / 0;
20
20
  return { min: l, max: m };
21
21
  }
22
22
  const r = parseInt(e, 10);
23
23
  return { min: r, max: r };
24
- }, "parseRepeat"), y = /* @__PURE__ */ a((e) => {
24
+ }, "parseRepeat"), y = /* @__PURE__ */ n((e) => {
25
25
  const r = A(e.primary);
26
26
  if (!e.repeat)
27
27
  return r;
@@ -32,7 +32,7 @@ var v = d().RailroadAbnf.parser.LangiumParser, i = /* @__PURE__ */ a((e) => {
32
32
  min: t,
33
33
  max: s
34
34
  };
35
- }, "transformElement"), A = /* @__PURE__ */ a((e) => {
35
+ }, "transformElement"), A = /* @__PURE__ */ n((e) => {
36
36
  switch (e.$type) {
37
37
  case "AbnfStringLiteral":
38
38
  return {
@@ -59,14 +59,14 @@ var v = d().RailroadAbnf.parser.LangiumParser, i = /* @__PURE__ */ a((e) => {
59
59
  default:
60
60
  throw new Error(`Unsupported ABNF primary node: ${e.$type}`);
61
61
  }
62
- }, "transformPrimary"), P = /* @__PURE__ */ a((e) => ({
62
+ }, "transformPrimary"), P = /* @__PURE__ */ n((e) => ({
63
63
  name: e.name,
64
64
  definition: i(e.definition)
65
- }), "transformRule"), h = /* @__PURE__ */ a((e) => {
66
- f(e, n), e.title && n.setTitle(e.title), e.rules.map((r) => n.addRule(P(r)));
65
+ }), "transformRule"), h = /* @__PURE__ */ n((e) => {
66
+ f(e, a), e.title && a.setTitle(e.title), e.rules.map((r) => a.addRule(P(r)));
67
67
  }, "populateDb"), R = {
68
- parse: /* @__PURE__ */ a((e) => {
69
- n.clear(), o.debug("[ABNF Parser] Starting Langium parse");
68
+ parse: /* @__PURE__ */ n((e) => {
69
+ a.clear(), o.debug("[ABNF Parser] Starting Langium parse");
70
70
  const r = v.parse(e);
71
71
  if (r.lexerErrors.length > 0 || r.parserErrors.length > 0)
72
72
  throw new c(r);
@@ -74,11 +74,11 @@ var v = d().RailroadAbnf.parser.LangiumParser, i = /* @__PURE__ */ a((e) => {
74
74
  o.debug("[ABNF Parser] Parsed rules:", t.rules.length), h(t), o.debug("[ABNF Parser] Parse complete");
75
75
  }, "parse"),
76
76
  parser: {
77
- yy: n
77
+ yy: a
78
78
  }
79
79
  }, w = {
80
80
  parser: R,
81
- db: n,
81
+ db: a,
82
82
  renderer: u,
83
83
  styles: p
84
84
  };
@@ -1 +1 @@
1
- "use strict";const n=require("./extractHeadings-BrLI2qQF.cjs");function $(o){return o.innerRadius}function b(o){return o.outerRadius}function k(o){return o.startAngle}function _(o){return o.endAngle}function nn(o){return o&&o.padAngle}function en(o,x,D,P,h,v,S,s){var E=D-o,r=P-x,e=S-h,p=s-v,i=p*E-e*r;if(!(i*i<n.epsilon))return i=(e*(x-v)-p*(o-h))/i,[o+i*E,x+i*r]}function M(o,x,D,P,h,v,S){var s=o-D,E=x-P,r=(S?v:-v)/n.sqrt(s*s+E*E),e=r*E,p=-r*s,i=o+e,u=x+p,c=D+e,f=P+p,j=(i+c)/2,l=(u+f)/2,y=c-i,g=f-u,A=y*y+g*g,R=h-v,T=i*f-c*u,H=(g<0?-1:1)*n.sqrt(n.max(0,R*R*A-T*T)),I=(T*g-y*H)/A,O=(-T*y-g*H)/A,q=(T*g+y*H)/A,d=(-T*y+g*H)/A,m=I-j,a=O-l,t=q-j,z=d-l;return m*m+a*a>t*t+z*z&&(I=q,O=d),{cx:I,cy:O,x01:-e,y01:-p,x11:I*(h/R-1),y11:O*(h/R-1)}}function an(){var o=$,x=b,D=n.constant(0),P=null,h=k,v=_,S=nn,s=null,E=n.withPath(r);function r(){var e,p,i=+o.apply(this,arguments),u=+x.apply(this,arguments),c=h.apply(this,arguments)-n.halfPi,f=v.apply(this,arguments)-n.halfPi,j=n.abs(f-c),l=f>c;if(s||(s=e=E()),u<i&&(p=u,u=i,i=p),!(u>n.epsilon))s.moveTo(0,0);else if(j>n.tau-n.epsilon)s.moveTo(u*n.cos(c),u*n.sin(c)),s.arc(0,0,u,c,f,!l),i>n.epsilon&&(s.moveTo(i*n.cos(f),i*n.sin(f)),s.arc(0,0,i,f,c,l));else{var y=c,g=f,A=c,R=f,T=j,H=j,I=S.apply(this,arguments)/2,O=I>n.epsilon&&(P?+P.apply(this,arguments):n.sqrt(i*i+u*u)),q=n.min(n.abs(u-i)/2,+D.apply(this,arguments)),d=q,m=q,a,t;if(O>n.epsilon){var z=n.asin(O/i*n.sin(I)),F=n.asin(O/u*n.sin(I));(T-=z*2)>n.epsilon?(z*=l?1:-1,A+=z,R-=z):(T=0,A=R=(c+f)/2),(H-=F*2)>n.epsilon?(F*=l?1:-1,y+=F,g-=F):(H=0,y=g=(c+f)/2)}var B=u*n.cos(y),C=u*n.sin(y),G=i*n.cos(R),J=i*n.sin(R);if(q>n.epsilon){var K=u*n.cos(g),L=u*n.sin(g),N=i*n.cos(A),Q=i*n.sin(A),w;if(j<n.pi)if(w=en(B,C,N,Q,K,L,G,J)){var U=B-w[0],V=C-w[1],W=K-w[0],X=L-w[1],Y=1/n.sin(n.acos((U*W+V*X)/(n.sqrt(U*U+V*V)*n.sqrt(W*W+X*X)))/2),Z=n.sqrt(w[0]*w[0]+w[1]*w[1]);d=n.min(q,(i-Z)/(Y-1)),m=n.min(q,(u-Z)/(Y+1))}else d=m=0}H>n.epsilon?m>n.epsilon?(a=M(N,Q,B,C,u,m,l),t=M(K,L,G,J,u,m,l),s.moveTo(a.cx+a.x01,a.cy+a.y01),m<q?s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,u,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),!l),s.arc(t.cx,t.cy,m,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):(s.moveTo(B,C),s.arc(0,0,u,y,g,!l)):s.moveTo(B,C),!(i>n.epsilon)||!(T>n.epsilon)?s.lineTo(G,J):d>n.epsilon?(a=M(G,J,K,L,i,-d,l),t=M(B,C,N,Q,i,-d,l),s.lineTo(a.cx+a.x01,a.cy+a.y01),d<q?s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,i,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),l),s.arc(t.cx,t.cy,d,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):s.arc(0,0,i,R,A,l)}if(s.closePath(),e)return s=null,e+""||null}return r.centroid=function(){var e=(+o.apply(this,arguments)+ +x.apply(this,arguments))/2,p=(+h.apply(this,arguments)+ +v.apply(this,arguments))/2-n.pi/2;return[n.cos(p)*e,n.sin(p)*e]},r.innerRadius=function(e){return arguments.length?(o=typeof e=="function"?e:n.constant(+e),r):o},r.outerRadius=function(e){return arguments.length?(x=typeof e=="function"?e:n.constant(+e),r):x},r.cornerRadius=function(e){return arguments.length?(D=typeof e=="function"?e:n.constant(+e),r):D},r.padRadius=function(e){return arguments.length?(P=e==null?null:typeof e=="function"?e:n.constant(+e),r):P},r.startAngle=function(e){return arguments.length?(h=typeof e=="function"?e:n.constant(+e),r):h},r.endAngle=function(e){return arguments.length?(v=typeof e=="function"?e:n.constant(+e),r):v},r.padAngle=function(e){return arguments.length?(S=typeof e=="function"?e:n.constant(+e),r):S},r.context=function(e){return arguments.length?(s=e??null,r):s},r}exports.d3arc=an;
1
+ "use strict";const n=require("./extractHeadings-R7NxLZJP.cjs");function $(o){return o.innerRadius}function b(o){return o.outerRadius}function k(o){return o.startAngle}function _(o){return o.endAngle}function nn(o){return o&&o.padAngle}function en(o,x,D,P,h,v,S,s){var E=D-o,r=P-x,e=S-h,p=s-v,i=p*E-e*r;if(!(i*i<n.epsilon))return i=(e*(x-v)-p*(o-h))/i,[o+i*E,x+i*r]}function M(o,x,D,P,h,v,S){var s=o-D,E=x-P,r=(S?v:-v)/n.sqrt(s*s+E*E),e=r*E,p=-r*s,i=o+e,u=x+p,c=D+e,f=P+p,j=(i+c)/2,l=(u+f)/2,y=c-i,g=f-u,A=y*y+g*g,R=h-v,T=i*f-c*u,H=(g<0?-1:1)*n.sqrt(n.max(0,R*R*A-T*T)),I=(T*g-y*H)/A,O=(-T*y-g*H)/A,q=(T*g+y*H)/A,d=(-T*y+g*H)/A,m=I-j,a=O-l,t=q-j,z=d-l;return m*m+a*a>t*t+z*z&&(I=q,O=d),{cx:I,cy:O,x01:-e,y01:-p,x11:I*(h/R-1),y11:O*(h/R-1)}}function an(){var o=$,x=b,D=n.constant(0),P=null,h=k,v=_,S=nn,s=null,E=n.withPath(r);function r(){var e,p,i=+o.apply(this,arguments),u=+x.apply(this,arguments),c=h.apply(this,arguments)-n.halfPi,f=v.apply(this,arguments)-n.halfPi,j=n.abs(f-c),l=f>c;if(s||(s=e=E()),u<i&&(p=u,u=i,i=p),!(u>n.epsilon))s.moveTo(0,0);else if(j>n.tau-n.epsilon)s.moveTo(u*n.cos(c),u*n.sin(c)),s.arc(0,0,u,c,f,!l),i>n.epsilon&&(s.moveTo(i*n.cos(f),i*n.sin(f)),s.arc(0,0,i,f,c,l));else{var y=c,g=f,A=c,R=f,T=j,H=j,I=S.apply(this,arguments)/2,O=I>n.epsilon&&(P?+P.apply(this,arguments):n.sqrt(i*i+u*u)),q=n.min(n.abs(u-i)/2,+D.apply(this,arguments)),d=q,m=q,a,t;if(O>n.epsilon){var z=n.asin(O/i*n.sin(I)),F=n.asin(O/u*n.sin(I));(T-=z*2)>n.epsilon?(z*=l?1:-1,A+=z,R-=z):(T=0,A=R=(c+f)/2),(H-=F*2)>n.epsilon?(F*=l?1:-1,y+=F,g-=F):(H=0,y=g=(c+f)/2)}var B=u*n.cos(y),C=u*n.sin(y),G=i*n.cos(R),J=i*n.sin(R);if(q>n.epsilon){var K=u*n.cos(g),L=u*n.sin(g),N=i*n.cos(A),Q=i*n.sin(A),w;if(j<n.pi)if(w=en(B,C,N,Q,K,L,G,J)){var U=B-w[0],V=C-w[1],W=K-w[0],X=L-w[1],Y=1/n.sin(n.acos((U*W+V*X)/(n.sqrt(U*U+V*V)*n.sqrt(W*W+X*X)))/2),Z=n.sqrt(w[0]*w[0]+w[1]*w[1]);d=n.min(q,(i-Z)/(Y-1)),m=n.min(q,(u-Z)/(Y+1))}else d=m=0}H>n.epsilon?m>n.epsilon?(a=M(N,Q,B,C,u,m,l),t=M(K,L,G,J,u,m,l),s.moveTo(a.cx+a.x01,a.cy+a.y01),m<q?s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,u,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),!l),s.arc(t.cx,t.cy,m,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):(s.moveTo(B,C),s.arc(0,0,u,y,g,!l)):s.moveTo(B,C),!(i>n.epsilon)||!(T>n.epsilon)?s.lineTo(G,J):d>n.epsilon?(a=M(G,J,K,L,i,-d,l),t=M(B,C,N,Q,i,-d,l),s.lineTo(a.cx+a.x01,a.cy+a.y01),d<q?s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,i,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),l),s.arc(t.cx,t.cy,d,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):s.arc(0,0,i,R,A,l)}if(s.closePath(),e)return s=null,e+""||null}return r.centroid=function(){var e=(+o.apply(this,arguments)+ +x.apply(this,arguments))/2,p=(+h.apply(this,arguments)+ +v.apply(this,arguments))/2-n.pi/2;return[n.cos(p)*e,n.sin(p)*e]},r.innerRadius=function(e){return arguments.length?(o=typeof e=="function"?e:n.constant(+e),r):o},r.outerRadius=function(e){return arguments.length?(x=typeof e=="function"?e:n.constant(+e),r):x},r.cornerRadius=function(e){return arguments.length?(D=typeof e=="function"?e:n.constant(+e),r):D},r.padRadius=function(e){return arguments.length?(P=e==null?null:typeof e=="function"?e:n.constant(+e),r):P},r.startAngle=function(e){return arguments.length?(h=typeof e=="function"?e:n.constant(+e),r):h},r.endAngle=function(e){return arguments.length?(v=typeof e=="function"?e:n.constant(+e),r):v},r.padAngle=function(e){return arguments.length?(S=typeof e=="function"?e:n.constant(+e),r):S},r.context=function(e){return arguments.length?(s=e??null,r):s},r}exports.d3arc=an;
@@ -1,4 +1,4 @@
1
- import { aL as ln, aM as an, aN as y, aO as tn, aP as W, aQ as O, aR as _, aS as un, aT as rn, aU as Z, aV as o, aW as N, aX as sn, aY as on, aZ as fn } from "./extractHeadings-BUHj1PcO.js";
1
+ import { aK as ln, aL as an, aM as y, aN as tn, aO as V, aP as O, aQ as _, aR as un, aS as rn, aT as Y, aU as o, aV as M, aW as sn, aX as on, aY as fn } from "./extractHeadings-B2I83li5.js";
2
2
  function cn(l) {
3
3
  return l.innerRadius;
4
4
  }
@@ -14,66 +14,66 @@ function dn(l) {
14
14
  function mn(l) {
15
15
  return l && l.padAngle;
16
16
  }
17
- function pn(l, h, D, S, v, R, Q, a) {
18
- var E = D - l, i = S - h, n = Q - v, d = a - R, u = d * E - n * i;
17
+ function pn(l, h, D, S, v, R, N, a) {
18
+ var E = D - l, i = S - h, n = N - v, d = a - R, u = d * E - n * i;
19
19
  if (!(u * u < y))
20
20
  return u = (n * (h - R) - d * (l - v)) / u, [l + u * E, h + u * i];
21
21
  }
22
- function G(l, h, D, S, v, R, Q) {
23
- var a = l - D, E = h - S, i = (Q ? R : -R) / Z(a * a + E * E), n = i * E, d = -i * a, u = l + n, s = h + d, f = D + n, c = S + d, U = (u + f) / 2, t = (s + c) / 2, m = f - u, g = c - s, A = m * m + g * g, T = v - R, P = u * c - f * s, I = (g < 0 ? -1 : 1) * Z(fn(0, T * T * A - P * P)), L = (P * g - m * I) / A, M = (-P * m - g * I) / A, w = (P * g + m * I) / A, p = (-P * m + g * I) / A, x = L - U, e = M - t, r = w - U, V = p - t;
24
- return x * x + e * e > r * r + V * V && (L = w, M = p), {
25
- cx: L,
26
- cy: M,
22
+ function G(l, h, D, S, v, R, N) {
23
+ var a = l - D, E = h - S, i = (N ? R : -R) / Y(a * a + E * E), n = i * E, d = -i * a, u = l + n, s = h + d, f = D + n, c = S + d, Q = (u + f) / 2, t = (s + c) / 2, m = f - u, g = c - s, A = m * m + g * g, T = v - R, P = u * c - f * s, I = (g < 0 ? -1 : 1) * Y(fn(0, T * T * A - P * P)), K = (P * g - m * I) / A, L = (-P * m - g * I) / A, w = (P * g + m * I) / A, p = (-P * m + g * I) / A, x = K - Q, e = L - t, r = w - Q, U = p - t;
24
+ return x * x + e * e > r * r + U * U && (K = w, L = p), {
25
+ cx: K,
26
+ cy: L,
27
27
  x01: -n,
28
28
  y01: -d,
29
- x11: L * (v / T - 1),
30
- y11: M * (v / T - 1)
29
+ x11: K * (v / T - 1),
30
+ y11: L * (v / T - 1)
31
31
  };
32
32
  }
33
33
  function hn() {
34
- var l = cn, h = yn, D = N(0), S = null, v = gn, R = dn, Q = mn, a = null, E = ln(i);
34
+ var l = cn, h = yn, D = M(0), S = null, v = gn, R = dn, N = mn, a = null, E = ln(i);
35
35
  function i() {
36
- var n, d, u = +l.apply(this, arguments), s = +h.apply(this, arguments), f = v.apply(this, arguments) - an, c = R.apply(this, arguments) - an, U = un(c - f), t = c > f;
36
+ var n, d, u = +l.apply(this, arguments), s = +h.apply(this, arguments), f = v.apply(this, arguments) - an, c = R.apply(this, arguments) - an, Q = un(c - f), t = c > f;
37
37
  if (a || (a = n = E()), s < u && (d = s, s = u, u = d), !(s > y)) a.moveTo(0, 0);
38
- else if (U > tn - y)
39
- a.moveTo(s * W(f), s * O(f)), a.arc(0, 0, s, f, c, !t), u > y && (a.moveTo(u * W(c), u * O(c)), a.arc(0, 0, u, c, f, t));
38
+ else if (Q > tn - y)
39
+ a.moveTo(s * V(f), s * O(f)), a.arc(0, 0, s, f, c, !t), u > y && (a.moveTo(u * V(c), u * O(c)), a.arc(0, 0, u, c, f, t));
40
40
  else {
41
- var m = f, g = c, A = f, T = c, P = U, I = U, L = Q.apply(this, arguments) / 2, M = L > y && (S ? +S.apply(this, arguments) : Z(u * u + s * s)), w = _(un(s - u) / 2, +D.apply(this, arguments)), p = w, x = w, e, r;
42
- if (M > y) {
43
- var V = sn(M / u * O(L)), j = sn(M / s * O(L));
44
- (P -= V * 2) > y ? (V *= t ? 1 : -1, A += V, T -= V) : (P = 0, A = T = (f + c) / 2), (I -= j * 2) > y ? (j *= t ? 1 : -1, m += j, g -= j) : (I = 0, m = g = (f + c) / 2);
41
+ var m = f, g = c, A = f, T = c, P = Q, I = Q, K = N.apply(this, arguments) / 2, L = K > y && (S ? +S.apply(this, arguments) : Y(u * u + s * s)), w = _(un(s - u) / 2, +D.apply(this, arguments)), p = w, x = w, e, r;
42
+ if (L > y) {
43
+ var U = sn(L / u * O(K)), j = sn(L / s * O(K));
44
+ (P -= U * 2) > y ? (U *= t ? 1 : -1, A += U, T -= U) : (P = 0, A = T = (f + c) / 2), (I -= j * 2) > y ? (j *= t ? 1 : -1, m += j, g -= j) : (I = 0, m = g = (f + c) / 2);
45
45
  }
46
- var X = s * W(m), Y = s * O(m), z = u * W(T), B = u * O(T);
46
+ var W = s * V(m), X = s * O(m), z = u * V(T), B = u * O(T);
47
47
  if (w > y) {
48
- var C = s * W(g), F = s * O(g), H = u * W(A), J = u * O(A), q;
49
- if (U < rn)
50
- if (q = pn(X, Y, H, J, C, F, z, B)) {
51
- var K = X - q[0], $ = Y - q[1], k = C - q[0], b = F - q[1], nn = 1 / O(on((K * k + $ * b) / (Z(K * K + $ * $) * Z(k * k + b * b))) / 2), en = Z(q[0] * q[0] + q[1] * q[1]);
48
+ var C = s * V(g), F = s * O(g), H = u * V(A), J = u * O(A), q;
49
+ if (Q < rn)
50
+ if (q = pn(W, X, H, J, C, F, z, B)) {
51
+ var Z = W - q[0], $ = X - q[1], k = C - q[0], b = F - q[1], nn = 1 / O(on((Z * k + $ * b) / (Y(Z * Z + $ * $) * Y(k * k + b * b))) / 2), en = Y(q[0] * q[0] + q[1] * q[1]);
52
52
  p = _(w, (u - en) / (nn - 1)), x = _(w, (s - en) / (nn + 1));
53
53
  } else
54
54
  p = x = 0;
55
55
  }
56
- I > y ? x > y ? (e = G(H, J, X, Y, s, x, t), r = G(C, F, z, B, s, x, t), a.moveTo(e.cx + e.x01, e.cy + e.y01), x < w ? a.arc(e.cx, e.cy, x, o(e.y01, e.x01), o(r.y01, r.x01), !t) : (a.arc(e.cx, e.cy, x, o(e.y01, e.x01), o(e.y11, e.x11), !t), a.arc(0, 0, s, o(e.cy + e.y11, e.cx + e.x11), o(r.cy + r.y11, r.cx + r.x11), !t), a.arc(r.cx, r.cy, x, o(r.y11, r.x11), o(r.y01, r.x01), !t))) : (a.moveTo(X, Y), a.arc(0, 0, s, m, g, !t)) : a.moveTo(X, Y), !(u > y) || !(P > y) ? a.lineTo(z, B) : p > y ? (e = G(z, B, C, F, u, -p, t), r = G(X, Y, H, J, u, -p, t), a.lineTo(e.cx + e.x01, e.cy + e.y01), p < w ? a.arc(e.cx, e.cy, p, o(e.y01, e.x01), o(r.y01, r.x01), !t) : (a.arc(e.cx, e.cy, p, o(e.y01, e.x01), o(e.y11, e.x11), !t), a.arc(0, 0, u, o(e.cy + e.y11, e.cx + e.x11), o(r.cy + r.y11, r.cx + r.x11), t), a.arc(r.cx, r.cy, p, o(r.y11, r.x11), o(r.y01, r.x01), !t))) : a.arc(0, 0, u, T, A, t);
56
+ I > y ? x > y ? (e = G(H, J, W, X, s, x, t), r = G(C, F, z, B, s, x, t), a.moveTo(e.cx + e.x01, e.cy + e.y01), x < w ? a.arc(e.cx, e.cy, x, o(e.y01, e.x01), o(r.y01, r.x01), !t) : (a.arc(e.cx, e.cy, x, o(e.y01, e.x01), o(e.y11, e.x11), !t), a.arc(0, 0, s, o(e.cy + e.y11, e.cx + e.x11), o(r.cy + r.y11, r.cx + r.x11), !t), a.arc(r.cx, r.cy, x, o(r.y11, r.x11), o(r.y01, r.x01), !t))) : (a.moveTo(W, X), a.arc(0, 0, s, m, g, !t)) : a.moveTo(W, X), !(u > y) || !(P > y) ? a.lineTo(z, B) : p > y ? (e = G(z, B, C, F, u, -p, t), r = G(W, X, H, J, u, -p, t), a.lineTo(e.cx + e.x01, e.cy + e.y01), p < w ? a.arc(e.cx, e.cy, p, o(e.y01, e.x01), o(r.y01, r.x01), !t) : (a.arc(e.cx, e.cy, p, o(e.y01, e.x01), o(e.y11, e.x11), !t), a.arc(0, 0, u, o(e.cy + e.y11, e.cx + e.x11), o(r.cy + r.y11, r.cx + r.x11), t), a.arc(r.cx, r.cy, p, o(r.y11, r.x11), o(r.y01, r.x01), !t))) : a.arc(0, 0, u, T, A, t);
57
57
  }
58
58
  if (a.closePath(), n) return a = null, n + "" || null;
59
59
  }
60
60
  return i.centroid = function() {
61
61
  var n = (+l.apply(this, arguments) + +h.apply(this, arguments)) / 2, d = (+v.apply(this, arguments) + +R.apply(this, arguments)) / 2 - rn / 2;
62
- return [W(d) * n, O(d) * n];
62
+ return [V(d) * n, O(d) * n];
63
63
  }, i.innerRadius = function(n) {
64
- return arguments.length ? (l = typeof n == "function" ? n : N(+n), i) : l;
64
+ return arguments.length ? (l = typeof n == "function" ? n : M(+n), i) : l;
65
65
  }, i.outerRadius = function(n) {
66
- return arguments.length ? (h = typeof n == "function" ? n : N(+n), i) : h;
66
+ return arguments.length ? (h = typeof n == "function" ? n : M(+n), i) : h;
67
67
  }, i.cornerRadius = function(n) {
68
- return arguments.length ? (D = typeof n == "function" ? n : N(+n), i) : D;
68
+ return arguments.length ? (D = typeof n == "function" ? n : M(+n), i) : D;
69
69
  }, i.padRadius = function(n) {
70
- return arguments.length ? (S = n == null ? null : typeof n == "function" ? n : N(+n), i) : S;
70
+ return arguments.length ? (S = n == null ? null : typeof n == "function" ? n : M(+n), i) : S;
71
71
  }, i.startAngle = function(n) {
72
- return arguments.length ? (v = typeof n == "function" ? n : N(+n), i) : v;
72
+ return arguments.length ? (v = typeof n == "function" ? n : M(+n), i) : v;
73
73
  }, i.endAngle = function(n) {
74
- return arguments.length ? (R = typeof n == "function" ? n : N(+n), i) : R;
74
+ return arguments.length ? (R = typeof n == "function" ? n : M(+n), i) : R;
75
75
  }, i.padAngle = function(n) {
76
- return arguments.length ? (Q = typeof n == "function" ? n : N(+n), i) : Q;
76
+ return arguments.length ? (N = typeof n == "function" ? n : M(+n), i) : N;
77
77
  }, i.context = function(n) {
78
78
  return arguments.length ? (a = n ?? null, i) : a;
79
79
  }, i;