@aiquants/markdown 2.0.2 → 3.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 +227 -16
  2. package/dist/{abnfDiagram-VRR7QNED-BBmog1I4.cjs → abnfDiagram-VRR7QNED-BEW-pzlz.cjs} +1 -1
  3. package/dist/{abnfDiagram-VRR7QNED-CxfTrgXf.js → abnfDiagram-VRR7QNED-ashFdTvJ.js} +15 -15
  4. package/dist/{arc-ClGqtl_2.js → arc-CV_3A_PF.js} +32 -32
  5. package/dist/{arc-DKsAswGe.cjs → arc-DVw3O83w.cjs} +1 -1
  6. package/dist/{architectureDiagram-ZJ3FMSHR-Dild3kjN.js → architectureDiagram-ZJ3FMSHR-BsYF-1vK.js} +2 -2
  7. package/dist/{architectureDiagram-ZJ3FMSHR-BLhnaJyB.cjs → architectureDiagram-ZJ3FMSHR-ClwjWrgh.cjs} +1 -1
  8. package/dist/{blockDiagram-677ZJIJ3-DD1l8WOn.js → blockDiagram-677ZJIJ3-CG0redjq.js} +3 -3
  9. package/dist/{blockDiagram-677ZJIJ3-D72bpMhN.cjs → blockDiagram-677ZJIJ3-Dv1BULkl.cjs} +1 -1
  10. package/dist/{c4Diagram-LMCZKHZV-BJkJh-kC.js → c4Diagram-LMCZKHZV-Bp8B3b7f.js} +2 -2
  11. package/dist/{c4Diagram-LMCZKHZV-D3d1d4zO.cjs → c4Diagram-LMCZKHZV-DC4usA2R.cjs} +1 -1
  12. package/dist/{channel-DE5LXIMm.cjs → channel-Cg0ufK1F.cjs} +1 -1
  13. package/dist/{channel-DaGDswnD.js → channel-NjFKsGs9.js} +1 -1
  14. package/dist/{chunk-2Q5K7J3B-BrnUlAaZ.cjs → chunk-2Q5K7J3B-BY6lLkFO.cjs} +1 -1
  15. package/dist/{chunk-2Q5K7J3B-DejpXtzn.js → chunk-2Q5K7J3B-XXQGFlOd.js} +1 -1
  16. package/dist/{chunk-32BRIVSS-BCAuSjpE.js → chunk-32BRIVSS-DgnH6GLY.js} +1 -1
  17. package/dist/{chunk-32BRIVSS-CDxbP_I9.cjs → chunk-32BRIVSS-kO6eHILC.cjs} +1 -1
  18. package/dist/{chunk-5VM5RSS4-C-cBAbST.cjs → chunk-5VM5RSS4-BITLjZU7.cjs} +1 -1
  19. package/dist/{chunk-5VM5RSS4-DI1kbCYB.js → chunk-5VM5RSS4-BhA4Tl7P.js} +1 -1
  20. package/dist/{chunk-EX3LRPZG-uKd75-FB.cjs → chunk-EX3LRPZG-CJr2-IiP.cjs} +1 -1
  21. package/dist/{chunk-EX3LRPZG-CVTsVkLX.js → chunk-EX3LRPZG-DSylTHty.js} +28 -28
  22. package/dist/{chunk-JWPE2WC7-CNFRDah7.cjs → chunk-JWPE2WC7-BTz8xxEq.cjs} +1 -1
  23. package/dist/{chunk-JWPE2WC7-Cu3ql0Gi.js → chunk-JWPE2WC7-Cr_-c4Em.js} +1 -1
  24. package/dist/{chunk-MOJQB5TN-BZ0Sok4l.js → chunk-MOJQB5TN-DngSrRvI.js} +9 -9
  25. package/dist/{chunk-MOJQB5TN-Bs5Jj3Zh.cjs → chunk-MOJQB5TN-vnYqNQhm.cjs} +1 -1
  26. package/dist/{chunk-PUDLZKDR-DisfuynB.cjs → chunk-PUDLZKDR-BTwddg7A.cjs} +1 -1
  27. package/dist/{chunk-PUDLZKDR-3RVC5ezN.js → chunk-PUDLZKDR-Jnb9X3uo.js} +6 -6
  28. package/dist/{chunk-RYQCIY6F-CSpf1fBI.js → chunk-RYQCIY6F-CwJsUgE_.js} +1 -1
  29. package/dist/{chunk-RYQCIY6F-xFTrTO6v.cjs → chunk-RYQCIY6F-DxECu9__.cjs} +1 -1
  30. package/dist/{chunk-V7JOEXUC-BvkxRSjK.cjs → chunk-V7JOEXUC-DgGwolBn.cjs} +1 -1
  31. package/dist/{chunk-V7JOEXUC-BnwuCkOT.js → chunk-V7JOEXUC-gEKuI7OI.js} +5 -5
  32. package/dist/{chunk-VR4S4FIN-DSW2sQDL.js → chunk-VR4S4FIN-8cM_PVeG.js} +3 -3
  33. package/dist/{chunk-VR4S4FIN-DAwCjhU3.cjs → chunk-VR4S4FIN-DKbaKheJ.cjs} +1 -1
  34. package/dist/{chunk-XXDRQBXY-B7vX1DJv.cjs → chunk-XXDRQBXY-CDD2QRgB.cjs} +1 -1
  35. package/dist/{chunk-XXDRQBXY-DrE4gFtL.js → chunk-XXDRQBXY-CN2bL4d4.js} +1 -1
  36. package/dist/{classDiagram-OUVF2IWQ-BxIt89EK.cjs → classDiagram-OUVF2IWQ-DpgKwDbm.cjs} +1 -1
  37. package/dist/{classDiagram-v2-EOCWNBFH-DlER_wIi.js → classDiagram-OUVF2IWQ-_cymiFSf.js} +2 -2
  38. package/dist/{classDiagram-v2-EOCWNBFH-BxIt89EK.cjs → classDiagram-v2-EOCWNBFH-DpgKwDbm.cjs} +1 -1
  39. package/dist/{classDiagram-OUVF2IWQ-DlER_wIi.js → classDiagram-v2-EOCWNBFH-_cymiFSf.js} +2 -2
  40. package/dist/cli.js +1 -1
  41. package/dist/components/MarkdownRenderer.d.ts +7 -2
  42. package/dist/components/MarkdownViewer.d.ts +17 -35
  43. package/dist/components/MermaidDiagram.d.ts +3 -0
  44. package/dist/components/NodesRenderer.d.ts +2 -1
  45. package/dist/components/TableOfContents.d.ts +14 -4
  46. package/dist/components/embeds.d.ts +30 -0
  47. package/dist/components/htmlSanitizer.d.ts +21 -0
  48. package/dist/components/labels.d.ts +12 -0
  49. package/dist/components/links.d.ts +18 -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/TwitterEmbedNode.d.ts +3 -2
  53. package/dist/components/mdastNodes/YouTubeEmbedNode.d.ts +4 -2
  54. package/dist/components/mermaidInteraction.d.ts +1 -4
  55. package/dist/components/mermaidLabels.d.ts +19 -0
  56. package/dist/components/plugins/DifyIFramePlugin.d.ts +2 -6
  57. package/dist/components/plugins/IFramePluginRegistry.d.ts +6 -4
  58. package/dist/components/rawHtml.d.ts +13 -0
  59. package/dist/components/toolbarOverlap.d.ts +17 -0
  60. package/dist/components/viewerLabels.d.ts +31 -0
  61. package/dist/{cose-bilkent-JH36ORCC-BvnlFiZm.js → cose-bilkent-JH36ORCC-BYBqAjZw.js} +1 -1
  62. package/dist/{cose-bilkent-JH36ORCC-BzL-a0Zv.cjs → cose-bilkent-JH36ORCC-DnfyBXGg.cjs} +1 -1
  63. package/dist/css/details.css +7 -0
  64. package/dist/css/fonts/KaTeX_AMS-Regular.ttf +0 -0
  65. package/dist/css/fonts/KaTeX_AMS-Regular.woff +0 -0
  66. package/dist/css/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  67. package/dist/css/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  68. package/dist/css/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  69. package/dist/css/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  70. package/dist/css/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  71. package/dist/css/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  72. package/dist/css/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  73. package/dist/css/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  74. package/dist/css/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  75. package/dist/css/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  76. package/dist/css/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  77. package/dist/css/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  78. package/dist/css/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  79. package/dist/css/fonts/KaTeX_Main-Bold.ttf +0 -0
  80. package/dist/css/fonts/KaTeX_Main-Bold.woff +0 -0
  81. package/dist/css/fonts/KaTeX_Main-Bold.woff2 +0 -0
  82. package/dist/css/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  83. package/dist/css/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  84. package/dist/css/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  85. package/dist/css/fonts/KaTeX_Main-Italic.ttf +0 -0
  86. package/dist/css/fonts/KaTeX_Main-Italic.woff +0 -0
  87. package/dist/css/fonts/KaTeX_Main-Italic.woff2 +0 -0
  88. package/dist/css/fonts/KaTeX_Main-Regular.ttf +0 -0
  89. package/dist/css/fonts/KaTeX_Main-Regular.woff +0 -0
  90. package/dist/css/fonts/KaTeX_Main-Regular.woff2 +0 -0
  91. package/dist/css/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  92. package/dist/css/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  93. package/dist/css/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  94. package/dist/css/fonts/KaTeX_Math-Italic.ttf +0 -0
  95. package/dist/css/fonts/KaTeX_Math-Italic.woff +0 -0
  96. package/dist/css/fonts/KaTeX_Math-Italic.woff2 +0 -0
  97. package/dist/css/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  98. package/dist/css/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  99. package/dist/css/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  100. package/dist/css/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  101. package/dist/css/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  102. package/dist/css/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  103. package/dist/css/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  104. package/dist/css/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  105. package/dist/css/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  106. package/dist/css/fonts/KaTeX_Script-Regular.ttf +0 -0
  107. package/dist/css/fonts/KaTeX_Script-Regular.woff +0 -0
  108. package/dist/css/fonts/KaTeX_Script-Regular.woff2 +0 -0
  109. package/dist/css/fonts/KaTeX_Size1-Regular.ttf +0 -0
  110. package/dist/css/fonts/KaTeX_Size1-Regular.woff +0 -0
  111. package/dist/css/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  112. package/dist/css/fonts/KaTeX_Size2-Regular.ttf +0 -0
  113. package/dist/css/fonts/KaTeX_Size2-Regular.woff +0 -0
  114. package/dist/css/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  115. package/dist/css/fonts/KaTeX_Size3-Regular.ttf +0 -0
  116. package/dist/css/fonts/KaTeX_Size3-Regular.woff +0 -0
  117. package/dist/css/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  118. package/dist/css/fonts/KaTeX_Size4-Regular.ttf +0 -0
  119. package/dist/css/fonts/KaTeX_Size4-Regular.woff +0 -0
  120. package/dist/css/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  121. package/dist/css/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  122. package/dist/css/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  123. package/dist/css/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  124. package/dist/css/github-markdown.css +23 -0
  125. package/dist/css/katex.min.css +1 -1129
  126. package/dist/css/message.css +2 -0
  127. package/dist/css/zenn-content.css +14 -0
  128. package/dist/{cynefinDiagram-TSTJHNR4-CUwuCyMp.js → cynefinDiagram-TSTJHNR4-BWEOxUpI.js} +23 -23
  129. package/dist/{cynefinDiagram-TSTJHNR4-B1lNDIu_.cjs → cynefinDiagram-TSTJHNR4-C8EYsJAe.cjs} +1 -1
  130. package/dist/{dagre-VKFMJZFB-Ct0vbIs9.js → dagre-VKFMJZFB-D9yci9ce.js} +12 -12
  131. package/dist/{dagre-VKFMJZFB-COYURQTh.cjs → dagre-VKFMJZFB-Dzz7AfJC.cjs} +1 -1
  132. package/dist/{diagram-FQU43EPY-DkgdwwAT.cjs → diagram-FQU43EPY-B_jbLFxw.cjs} +1 -1
  133. package/dist/{diagram-FQU43EPY-B5HmiJPw.js → diagram-FQU43EPY-Byd0f28a.js} +2 -2
  134. package/dist/{diagram-G47NLZAW-CcXcBx81.cjs → diagram-G47NLZAW-BD7Qvt5F.cjs} +1 -1
  135. package/dist/{diagram-G47NLZAW-C-nfBNGF.js → diagram-G47NLZAW-CzGLTuaI.js} +131 -131
  136. package/dist/{diagram-NH7WQ7WH-yu8B8Q4y.js → diagram-NH7WQ7WH-D6J_ePSr.js} +11 -11
  137. package/dist/{diagram-NH7WQ7WH-BMYzS0pm.cjs → diagram-NH7WQ7WH-DtE40O1y.cjs} +1 -1
  138. package/dist/{diagram-OA4YK3LP-CROsfore.js → diagram-OA4YK3LP-BRkpKDSL.js} +57 -57
  139. package/dist/{diagram-OA4YK3LP-DSeI6RLe.cjs → diagram-OA4YK3LP-BV_3h5ls.cjs} +1 -1
  140. package/dist/{diagram-WEI45ONY-CCJwQ42c.cjs → diagram-WEI45ONY-CMtm1y9S.cjs} +1 -1
  141. package/dist/{diagram-WEI45ONY-DmPpMglv.js → diagram-WEI45ONY-TZvlAD74.js} +11 -11
  142. package/dist/{ebnfDiagram-CCIWWBDH-B2ck9j39.js → ebnfDiagram-CCIWWBDH-CK7wZZmM.js} +5 -5
  143. package/dist/{ebnfDiagram-CCIWWBDH-D_nz1FvR.cjs → ebnfDiagram-CCIWWBDH-DgZ7GeJ2.cjs} +1 -1
  144. package/dist/{erDiagram-Q63AITRT-BfpyxqAV.js → erDiagram-Q63AITRT-ByF7VP5D.js} +4 -4
  145. package/dist/{erDiagram-Q63AITRT-2r-lfgSt.cjs → erDiagram-Q63AITRT-C4Tmp1ar.cjs} +1 -1
  146. package/dist/{extractHeadings-Dgzd324l.js → extractHeadings-CS-qqdgu.js} +6115 -5783
  147. package/dist/{extractHeadings-BrLI2qQF.cjs → extractHeadings-DZwpYYZa.cjs} +70 -70
  148. package/dist/flowDiagram-23GEKE2U-BPhnjQfA.cjs +1 -0
  149. package/dist/flowDiagram-23GEKE2U-UIracYlJ.js +7 -0
  150. package/dist/{ganttDiagram-NO4QXBWP-DR3YQ-Kd.js → ganttDiagram-NO4QXBWP-BxYBLrwg.js} +2 -2
  151. package/dist/{ganttDiagram-NO4QXBWP-CNhgpKSH.cjs → ganttDiagram-NO4QXBWP-CWaEb7A9.cjs} +1 -1
  152. package/dist/gen/markdown/v1/markdown_pb.d.ts +14 -0
  153. package/dist/{gitGraphDiagram-IHSO6WYX-D5IYosEF.cjs → gitGraphDiagram-IHSO6WYX-Bj41cd84.cjs} +1 -1
  154. package/dist/{gitGraphDiagram-IHSO6WYX-CzLNLS8W.js → gitGraphDiagram-IHSO6WYX-DinEtmt2.js} +3 -3
  155. package/dist/index.cjs +1 -1
  156. package/dist/index.client.cjs +1 -1
  157. package/dist/index.client.d.ts +5 -2
  158. package/dist/index.client.js +39 -35
  159. package/dist/index.js +39 -35
  160. package/dist/index.server.cjs +1 -1
  161. package/dist/index.server.d.ts +1 -1
  162. package/dist/index.server.js +258 -170
  163. package/dist/{infoDiagram-FWYZ7A6U-CBcx5GhE.js → infoDiagram-FWYZ7A6U-Cvu8wgVT.js} +1 -1
  164. package/dist/{infoDiagram-FWYZ7A6U-U2OiliOP.cjs → infoDiagram-FWYZ7A6U-D0pXl2DF.cjs} +1 -1
  165. package/dist/{ishikawaDiagram-FXEZZL3T-DK3M6wrz.cjs → ishikawaDiagram-FXEZZL3T-C4ywo5e2.cjs} +1 -1
  166. package/dist/{ishikawaDiagram-FXEZZL3T-CWXT_3xh.js → ishikawaDiagram-FXEZZL3T-a_OKoT7W.js} +20 -20
  167. package/dist/{journeyDiagram-5HDEW3XC-DRbAj2Yz.js → journeyDiagram-5HDEW3XC-BKYDr_AO.js} +4 -4
  168. package/dist/{journeyDiagram-5HDEW3XC-B-BfhPr4.cjs → journeyDiagram-5HDEW3XC-Bf5zZtzp.cjs} +1 -1
  169. package/dist/{kanban-definition-HUTT4EX6-BvnLv2HN.cjs → kanban-definition-HUTT4EX6-CRrw6nZl.cjs} +1 -1
  170. package/dist/{kanban-definition-HUTT4EX6-DtRSv2_P.js → kanban-definition-HUTT4EX6-uCk_xnx6.js} +34 -34
  171. package/dist/{linear-B9JMAP1U.cjs → linear-BNrZe-4B.cjs} +1 -1
  172. package/dist/{linear-HTaGrbQh.js → linear-RwkMjaFq.js} +12 -12
  173. package/dist/markdown.css +1 -1
  174. package/dist/{mindmap-definition-LN4V7U3C-asDDR5DU.cjs → mindmap-definition-LN4V7U3C-CtNh9-A3.cjs} +1 -1
  175. package/dist/{mindmap-definition-LN4V7U3C-4cN-VjxO.js → mindmap-definition-LN4V7U3C-DLgc7_Ea.js} +20 -20
  176. package/dist/{pegDiagram-2B236MQR-cMLC3Ggy.js → pegDiagram-2B236MQR-BI08u62h.js} +5 -5
  177. package/dist/{pegDiagram-2B236MQR-C3qJlDiV.cjs → pegDiagram-2B236MQR-gjNvnRzE.cjs} +1 -1
  178. package/dist/{pieDiagram-ENE6RG2P-D5-meW-_.cjs → pieDiagram-ENE6RG2P-C6mPk_9r.cjs} +1 -1
  179. package/dist/{pieDiagram-ENE6RG2P-nk_3VO3x.js → pieDiagram-ENE6RG2P-CqqtfJsQ.js} +41 -41
  180. package/dist/{quadrantDiagram-ABIIQ3AL-Ctdfu4Qk.js → quadrantDiagram-ABIIQ3AL-BAudlbem.js} +2 -2
  181. package/dist/{quadrantDiagram-ABIIQ3AL-CmqrHJ4C.cjs → quadrantDiagram-ABIIQ3AL-k1wF3el0.cjs} +1 -1
  182. package/dist/{railroadDiagram-RFXS5EU6-2rLqmvj_.js → railroadDiagram-RFXS5EU6-BV-FtI-Y.js} +3 -3
  183. package/dist/{railroadDiagram-RFXS5EU6-a-pSoUg2.cjs → railroadDiagram-RFXS5EU6-qTQnd_2E.cjs} +1 -1
  184. package/dist/remarkProcessor.server.d.ts +11 -1
  185. package/dist/{requirementDiagram-TGXJPOKE-BlCu380H.js → requirementDiagram-TGXJPOKE-CSI9iBde.js} +3 -3
  186. package/dist/{requirementDiagram-TGXJPOKE-BaKLflmx.cjs → requirementDiagram-TGXJPOKE-DXxySydn.cjs} +1 -1
  187. package/dist/{sankeyDiagram-HTMAVEWB-6lNyI55x.js → sankeyDiagram-HTMAVEWB-BYAMj1wQ.js} +20 -20
  188. package/dist/{sankeyDiagram-HTMAVEWB-DuUzdIP0.cjs → sankeyDiagram-HTMAVEWB-DU5j0Hpe.cjs} +1 -1
  189. package/dist/{sequenceDiagram-DBY2YBRQ-sgwpzZWi.js → sequenceDiagram-DBY2YBRQ-BruqK1lr.js} +3 -3
  190. package/dist/{sequenceDiagram-DBY2YBRQ-B29fl34a.cjs → sequenceDiagram-DBY2YBRQ-Dbk1YO-l.cjs} +1 -1
  191. package/dist/{simple-logger-DIfMY3fH.js → simple-logger-i94ikRyH.js} +1 -1
  192. package/dist/{sizeCapture-X5ZJPWSS-DMDy-RCU.js → sizeCapture-X5ZJPWSS-BSn0u1_t.js} +1 -1
  193. package/dist/{sizeCapture-X5ZJPWSS-DAiqtb_j.cjs → sizeCapture-X5ZJPWSS-qz-hVWx4.cjs} +1 -1
  194. package/dist/{stateDiagram-2N3HPSRC-DAN7ei1t.js → stateDiagram-2N3HPSRC-CKh5ZWdm.js} +9 -9
  195. package/dist/{stateDiagram-2N3HPSRC-BXIH2aOp.cjs → stateDiagram-2N3HPSRC-CtoTfzmG.cjs} +1 -1
  196. package/dist/{stateDiagram-v2-6OUMAXLB--pCo5CzX.js → stateDiagram-v2-6OUMAXLB-BmILy7Yi.js} +2 -2
  197. package/dist/{stateDiagram-v2-6OUMAXLB-8XTokhrn.cjs → stateDiagram-v2-6OUMAXLB-D9tt3CyI.cjs} +1 -1
  198. package/dist/styles/markdown.css +1 -1
  199. package/dist/{swimlanes-5IMT3BWC-B-sXtUgS.js → swimlanes-5IMT3BWC-8aqGUD9B.js} +3 -3
  200. package/dist/{swimlanes-5IMT3BWC-BnT290KL.cjs → swimlanes-5IMT3BWC-CgWWlJUL.cjs} +1 -1
  201. package/dist/{swimlanesDiagram-G3AALYLV-CkxURj6O.js → swimlanesDiagram-G3AALYLV-0sUz7qWx.js} +2 -2
  202. package/dist/{swimlanesDiagram-G3AALYLV-CAEjADeH.cjs → swimlanesDiagram-G3AALYLV-BQL_l0K6.cjs} +1 -1
  203. package/dist/{timeline-definition-FHXFAJF6-Dqdftl5b.cjs → timeline-definition-FHXFAJF6-CnMWGedg.cjs} +1 -1
  204. package/dist/{timeline-definition-FHXFAJF6-D47CoBOm.js → timeline-definition-FHXFAJF6-Cps3CVTR.js} +34 -34
  205. package/dist/{vennDiagram-L72KCM5P-DzcOxkzh.js → vennDiagram-L72KCM5P-C3u6VbZv.js} +55 -55
  206. package/dist/{vennDiagram-L72KCM5P-BxjgXNwH.cjs → vennDiagram-L72KCM5P-Duki5CI_.cjs} +1 -1
  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-tZJBiyrP.js → wardleyDiagram-EHGQE667-CKNXRrYV.js} +27 -27
  211. package/dist/{wardleyDiagram-EHGQE667-CurWRCjn.cjs → wardleyDiagram-EHGQE667-DiefhIvI.cjs} +1 -1
  212. package/dist/{xychartDiagram-FW5EYKEG-D0ltrZo8.cjs → xychartDiagram-FW5EYKEG-DGB2SKXi.cjs} +1 -1
  213. package/dist/{xychartDiagram-FW5EYKEG-DRQ_o9WV.js → xychartDiagram-FW5EYKEG-lymeWtXL.js} +23 -23
  214. package/package.json +18 -12
  215. package/dist/flowDiagram-23GEKE2U-D3w55eDA.cjs +0 -1
  216. package/dist/flowDiagram-23GEKE2U-LZTzy0Rx.js +0 -7
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
 
@@ -82,8 +87,13 @@ console.log("Hello, World!")
82
87
  // Parse the markdown using the Go parser server
83
88
  const parseResult = await parseMarkdown(
84
89
  markdownText,
85
- "/workspace/tmp/my-file.md",
86
- "/workspace"
90
+ "/srv/docs/notes/my-file.md",
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,28 +109,187 @@ 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
- "/workspace/tmp/my-file.md",
110
- "/workspace",
122
+ "/srv/docs/notes/my-file.md",
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
+ ### Viewer toolbar
220
+
221
+ `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:
222
+
223
+ | Property | Effect |
224
+ | --- | --- |
225
+ | `--aqmd-toolbar-inset-block-start` | Offset from the top of the toolbar's containing block |
226
+ | `--aqmd-toolbar-inset-inline-end` | Offset from the inline end of the containing block (added to the scrollbar clearance) |
227
+
228
+ 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:
229
+
230
+ ```css
231
+ .my-layout {
232
+ --aqmd-toolbar-inset-inline-end: var(--my-side-menu-width, 0px);
233
+ }
234
+ ```
235
+
236
+ 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.
237
+
238
+ 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.
239
+ 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).
240
+
241
+ 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.
242
+
243
+ 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.
244
+
245
+ ### Table of contents
246
+
247
+ 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.
248
+
249
+ 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.
250
+ 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.
251
+
252
+ The viewer stops the link's own navigation, so it reveals the heading the way a browser reveals the fragment it navigates to:
253
+
254
+ - 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.
255
+ - 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`.
256
+ - An open `<details>` and a plain `hidden` are left as they are.
257
+
258
+ ```tsx
259
+ <MarkdownViewer
260
+ {...props}
261
+ onHeadingSelect={(heading) => {
262
+ history.replaceState(null, "", `#${heading.id}`)
263
+ return false
264
+ }}
265
+ />
266
+ ```
267
+
268
+ ```tsx
269
+ // Module level, so the function stays the same between renders
270
+ const headingHref: MarkdownHeadingHrefResolver = (heading) => `/docs/guide.md#${encodeURIComponent(heading.id)}`
271
+
272
+ <MarkdownViewer
273
+ {...props}
274
+ headingHref={headingHref}
275
+ onHeadingSelect={(_heading, event) => event.ctrlKey || event.metaKey || event.shiftKey}
276
+ />
277
+ ```
278
+
279
+ ### Labels and languages
280
+
281
+ 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`).
282
+ A label you pass carries no language of its own and is read in your page's language.
283
+ 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.
284
+
285
+ ### Settings without React
286
+
287
+ `@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.
288
+
289
+ ```ts
290
+ import { DEFAULT_MARKDOWN_STYLES, toContentAlign } from "@aiquants/markdown/viewer-settings"
291
+ ```
292
+
124
293
  ## Extended Syntax
125
294
 
126
295
  The parser supports the following extended markdown syntax in addition to CommonMark and GFM.
@@ -128,7 +297,28 @@ The parser supports the following extended markdown syntax in addition to Common
128
297
  ### LaTeX Math Expressions
129
298
 
130
299
  - Inline math: `$y=x^2$`
131
- - Display math: `$$ e^{i\theta} = \cos\theta + i\sin\theta $$` (or multiline block)
300
+ - 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.
301
+ - 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.
302
+ - 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).
303
+
304
+ ```markdown
305
+ $$
306
+ e^{i\theta} = \cos\theta + i\sin\theta
307
+ $$
308
+ ```
309
+
310
+ ### GitHub Alerts
311
+
312
+ ```markdown
313
+ > [!NOTE]
314
+ > Useful information that users should know.
315
+ ```
316
+
317
+ `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:
318
+
319
+ - 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;
320
+ - the marker must be alone on the first line (`> [!NOTE] text` stays a blockquote);
321
+ - something must follow the marker line (`> [!NOTE]` alone stays a blockquote).
132
322
 
133
323
  ### Table cell merge markers
134
324
 
@@ -165,7 +355,7 @@ This is ==important== text.
165
355
 
166
356
  ### Zenn-style Directives
167
357
 
168
- Supports Zenn-style message box and details box with support for recursive nesting:
358
+ Message boxes and collapsible details, enabled unless `enableZennDirectives` is `false`:
169
359
 
170
360
  ```markdown
171
361
  :::message info
@@ -179,6 +369,27 @@ This is a nested warning message inside details.
179
369
  :::
180
370
  ```
181
371
 
372
+ - **Opening line**: three or more `:`, then `message` or `details` and an optional argument. No blank lines are needed around fence lines.
373
+ - **Message types**: `:::message alert`, `:::message info` and `:::message warning`; any other argument gives a plain message.
374
+ - **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.
375
+ - **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).
376
+ - **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.
377
+ 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.
378
+ - **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.
379
+
380
+ 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`.
381
+
382
+ ### Stylesheets for the extended syntax
383
+
384
+ | Stylesheet | Styles |
385
+ | --- | --- |
386
+ | `@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. |
387
+ | `@aiquants/markdown/styles/github-markdown.css` | The GitHub display style (`.markdown-body`), including GitHub's own alert rules, which win over the baseline. |
388
+ | `@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. |
389
+ | `@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. |
390
+ | `@aiquants/markdown/styles/zenn-content.css` | The Zenn display style (`.znc`). |
391
+ | `@aiquants/markdown/styles/katex.min.css` | KaTeX output for inline and display math. |
392
+
182
393
  ### Notes
183
394
 
184
395
  - 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-vnYqNQhm.cjs"),u=require("./chunk-JWPE2WC7-BTz8xxEq.cjs"),n=require("./extractHeadings-DZwpYYZa.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-BZ0Sok4l.js";
2
- import { p as f } from "./chunk-JWPE2WC7-Cu3ql0Gi.js";
3
- import { _ as a, a0 as o } from "./extractHeadings-Dgzd324l.js";
1
+ import { g as p, r as u, d as a } from "./chunk-MOJQB5TN-DngSrRvI.js";
2
+ import { p as f } from "./chunk-JWPE2WC7-Cr_-c4Em.js";
3
+ import { _ as n, $ as o } from "./extractHeadings-CS-qqdgu.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,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-Dgzd324l.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-CS-qqdgu.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;
@@ -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-DZwpYYZa.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,5 +1,5 @@
1
- import { p as Ze } from "./chunk-JWPE2WC7-Cu3ql0Gi.js";
2
- import { bT as qe, _ as gt, at as Qe, aJ as Je, a0 as Fe, W as Ke, V as je, ae as _e, af as tr, U as er, Q as rr, ak as ir, aq as ar, ao as nr, ar as or, X as Ee, bM as Te, b3 as pe, a4 as sr, $ as hr, aj as lr, b4 as fr, bU as cr } from "./extractHeadings-Dgzd324l.js";
1
+ import { p as Ze } from "./chunk-JWPE2WC7-Cr_-c4Em.js";
2
+ import { bS as qe, _ as gt, as as Qe, aI as Je, $ as Fe, V as Ke, U as je, ad as _e, ae as tr, Q as er, O as rr, aj as ir, ap as ar, an as nr, aq as or, W as Ee, bL as Te, b2 as pe, a3 as sr, X as hr, ai as lr, b3 as fr, bT as cr } from "./extractHeadings-CS-qqdgu.js";
3
3
  import { p as gr } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
4
4
  import { c as be } from "./cytoscape.esm-kVAWcYoG.js";
5
5
  var he = { exports: {} }, le = { exports: {} }, fe = { exports: {} }, ur = fe.exports, Oe;