@aiquants/markdown 12.2.3 → 12.3.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 (139) hide show
  1. package/README.md +113 -16
  2. package/dist/{abnfDiagram-VRR7QNED-DQ52KUbH.js → abnfDiagram-VRR7QNED-B_QmXzWv.js} +3 -3
  3. package/dist/{abnfDiagram-VRR7QNED-1fn6qV_P.cjs → abnfDiagram-VRR7QNED-Crz-ChMJ.cjs} +1 -1
  4. package/dist/{arc-D9kg3f8-.js → arc-BKGy6Me1.js} +32 -32
  5. package/dist/{arc-D8xGHwLe.cjs → arc-CYJCyviq.cjs} +1 -1
  6. package/dist/{architectureDiagram-ZJ3FMSHR-Cc9gQRX2.js → architectureDiagram-ZJ3FMSHR-CEb923Bc.js} +123 -123
  7. package/dist/{architectureDiagram-ZJ3FMSHR-C4QxQA-o.cjs → architectureDiagram-ZJ3FMSHR-gTB8pttO.cjs} +1 -1
  8. package/dist/{blockDiagram-677ZJIJ3-DIpIE77y.js → blockDiagram-677ZJIJ3-CmKMdhaS.js} +166 -166
  9. package/dist/{blockDiagram-677ZJIJ3-BCgCtZXM.cjs → blockDiagram-677ZJIJ3-D7RRzjUx.cjs} +1 -1
  10. package/dist/{c4Diagram-LMCZKHZV-jgR25uUP.js → c4Diagram-LMCZKHZV-CG6fvZQo.js} +2 -2
  11. package/dist/{c4Diagram-LMCZKHZV-q0iHoZqg.cjs → c4Diagram-LMCZKHZV-W7Qa-ecL.cjs} +1 -1
  12. package/dist/{channel-DuWQwUVP.cjs → channel-BKoPLS2j.cjs} +1 -1
  13. package/dist/{channel-Bw3o-12p.js → channel-TsF8sms_.js} +1 -1
  14. package/dist/{chunk-2Q5K7J3B-0amJDSXB.js → chunk-2Q5K7J3B-CopwR1m3.js} +1 -1
  15. package/dist/{chunk-2Q5K7J3B-gCP3NILS.cjs → chunk-2Q5K7J3B-DgtYKcDs.cjs} +1 -1
  16. package/dist/{chunk-32BRIVSS-BMqTi8UH.js → chunk-32BRIVSS-BnNlhc1M.js} +1 -1
  17. package/dist/{chunk-32BRIVSS-PidRQo43.cjs → chunk-32BRIVSS-D-6GBFtx.cjs} +1 -1
  18. package/dist/{chunk-5VM5RSS4-EGE3VaH8.js → chunk-5VM5RSS4-O28FGAOF.js} +1 -1
  19. package/dist/{chunk-5VM5RSS4-C0OtlojA.cjs → chunk-5VM5RSS4-lKwSmIqG.cjs} +1 -1
  20. package/dist/{chunk-EX3LRPZG-wasnZ2h7.js → chunk-EX3LRPZG-C36gZH3_.js} +26 -26
  21. package/dist/{chunk-EX3LRPZG-4qSuVZkz.cjs → chunk-EX3LRPZG-CtFe4olX.cjs} +1 -1
  22. package/dist/{chunk-JWPE2WC7-CHK_g5p5.cjs → chunk-JWPE2WC7-5sd39cpa.cjs} +1 -1
  23. package/dist/{chunk-JWPE2WC7-O891tu2Q.js → chunk-JWPE2WC7-DG0ebjV4.js} +1 -1
  24. package/dist/{chunk-MOJQB5TN-BSfpWEVd.cjs → chunk-MOJQB5TN-DADVbG98.cjs} +1 -1
  25. package/dist/{chunk-MOJQB5TN-BzuZr6pz.js → chunk-MOJQB5TN-nqR_swpx.js} +15 -15
  26. package/dist/{chunk-PUDLZKDR-DNbm7Xzd.cjs → chunk-PUDLZKDR-BUSFO-Gx.cjs} +1 -1
  27. package/dist/{chunk-PUDLZKDR-BRL3efwE.js → chunk-PUDLZKDR-CD96jce3.js} +13 -13
  28. package/dist/{chunk-RYQCIY6F-B_33Thwg.cjs → chunk-RYQCIY6F-BBTBydZd.cjs} +1 -1
  29. package/dist/{chunk-RYQCIY6F-DwmsCCiA.js → chunk-RYQCIY6F-DJkrr1sD.js} +5 -5
  30. package/dist/{chunk-V7JOEXUC-BowEdIo-.cjs → chunk-V7JOEXUC-BzCaDGop.cjs} +1 -1
  31. package/dist/{chunk-V7JOEXUC-D0oynREN.js → chunk-V7JOEXUC-eBy2sAXD.js} +15 -15
  32. package/dist/{chunk-VR4S4FIN-Dg_3SNs1.js → chunk-VR4S4FIN-C-qPzUSR.js} +3 -3
  33. package/dist/{chunk-VR4S4FIN-Ca3mlCgX.cjs → chunk-VR4S4FIN-CHKLwvYh.cjs} +1 -1
  34. package/dist/{chunk-XXDRQBXY-Byo5u3b_.js → chunk-XXDRQBXY-BK6HOWf6.js} +1 -1
  35. package/dist/{chunk-XXDRQBXY-CeZMmeIi.cjs → chunk-XXDRQBXY-DttkP7wv.cjs} +1 -1
  36. package/dist/{classDiagram-OUVF2IWQ-DPzttpgE.cjs → classDiagram-OUVF2IWQ-BKruajP_.cjs} +1 -1
  37. package/dist/{classDiagram-v2-EOCWNBFH-CVu4_B8x.js → classDiagram-OUVF2IWQ-CPDmG5kI.js} +2 -2
  38. package/dist/{classDiagram-v2-EOCWNBFH-DPzttpgE.cjs → classDiagram-v2-EOCWNBFH-BKruajP_.cjs} +1 -1
  39. package/dist/{classDiagram-OUVF2IWQ-CVu4_B8x.js → classDiagram-v2-EOCWNBFH-CPDmG5kI.js} +2 -2
  40. package/dist/components/CopyButton.d.ts +9 -0
  41. package/dist/components/HostedScrollArea.d.ts +2 -1
  42. package/dist/components/MarkdownRenderer.d.ts +7 -2
  43. package/dist/components/MarkdownViewer.d.ts +5 -3
  44. package/dist/components/SpreadsheetBlock.d.ts +3 -2
  45. package/dist/components/codeBlockLabels.d.ts +9 -0
  46. package/dist/components/cssLength.d.ts +1 -0
  47. package/dist/components/displayMathLabels.d.ts +11 -0
  48. package/dist/components/mathRendering.d.ts +3 -1
  49. package/dist/components/mdastNodes/CodeNode.d.ts +3 -1
  50. package/dist/components/mdastNodes/MathNode.d.ts +6 -5
  51. package/dist/components/ownPixels.d.ts +3 -0
  52. package/dist/components/toolbarOverlap.d.ts +4 -1
  53. package/dist/components/viewerLabels.d.ts +11 -1
  54. package/dist/components/viewerToolbarStyles.d.ts +2 -0
  55. package/dist/converter.wasm +0 -0
  56. package/dist/{cose-bilkent-JH36ORCC-BmM-AQ-j.js → cose-bilkent-JH36ORCC-BxO1rjEU.js} +24 -24
  57. package/dist/{cose-bilkent-JH36ORCC-C3UAMvQQ.cjs → cose-bilkent-JH36ORCC-Cjfa6NyL.cjs} +1 -1
  58. package/dist/{cynefinDiagram-TSTJHNR4-DStGofoE.cjs → cynefinDiagram-TSTJHNR4-B3boTACW.cjs} +1 -1
  59. package/dist/{cynefinDiagram-TSTJHNR4-iS4n-7T_.js → cynefinDiagram-TSTJHNR4-DBD-B_Un.js} +60 -60
  60. package/dist/{dagre-VKFMJZFB-C1Y6S6Dm.js → dagre-VKFMJZFB-B8vZCPJg.js} +17 -17
  61. package/dist/{dagre-VKFMJZFB-BXsQ5-Ek.cjs → dagre-VKFMJZFB-DF3Mvuas.cjs} +1 -1
  62. package/dist/{diagram-FQU43EPY-CRXs7mU1.cjs → diagram-FQU43EPY-DwhEcKWF.cjs} +1 -1
  63. package/dist/{diagram-FQU43EPY-CFG9AlAq.js → diagram-FQU43EPY-YrRTNuX-.js} +36 -36
  64. package/dist/{diagram-G47NLZAW-BaX-jrfs.cjs → diagram-G47NLZAW-CKIEbGLS.cjs} +1 -1
  65. package/dist/{diagram-G47NLZAW-Bqr76Qn5.js → diagram-G47NLZAW-D4vmirJw.js} +51 -51
  66. package/dist/{diagram-NH7WQ7WH-Cczq2y99.cjs → diagram-NH7WQ7WH-D6wMwkLQ.cjs} +1 -1
  67. package/dist/{diagram-NH7WQ7WH-BDWfQ8xs.js → diagram-NH7WQ7WH-Drekwiur.js} +10 -10
  68. package/dist/{diagram-OA4YK3LP-DuW90Uhk.js → diagram-OA4YK3LP-DZsM4Fpo.js} +21 -21
  69. package/dist/{diagram-OA4YK3LP-uBVV8yBB.cjs → diagram-OA4YK3LP-DeJ7pMIO.cjs} +1 -1
  70. package/dist/{diagram-WEI45ONY-Cd3qe8Wi.js → diagram-WEI45ONY-CjRbsbkF.js} +32 -32
  71. package/dist/{diagram-WEI45ONY-C_L-4kui.cjs → diagram-WEI45ONY-SYHw7k8b.cjs} +1 -1
  72. package/dist/{ebnfDiagram-CCIWWBDH-Cg7DTSlM.cjs → ebnfDiagram-CCIWWBDH-23bjk9FU.cjs} +1 -1
  73. package/dist/{ebnfDiagram-CCIWWBDH-CMmTdVTT.js → ebnfDiagram-CCIWWBDH-D0kt5Zdu.js} +3 -3
  74. package/dist/{erDiagram-Q63AITRT-tOZoI25O.js → erDiagram-Q63AITRT-Ce4GpK2Z.js} +7 -7
  75. package/dist/{erDiagram-Q63AITRT-ONnVKrzr.cjs → erDiagram-Q63AITRT-DqFANbZx.cjs} +1 -1
  76. package/dist/{extractHeadings-3qWVTkb9.js → extractHeadings-DlQcPv5N.js} +8033 -7962
  77. package/dist/extractHeadings-wWAipplS.cjs +315 -0
  78. package/dist/flowDiagram-23GEKE2U-CRC9U6qD.cjs +1 -0
  79. package/dist/flowDiagram-23GEKE2U-CRo7TM3K.js +7 -0
  80. package/dist/{ganttDiagram-NO4QXBWP-CHP_muri.cjs → ganttDiagram-NO4QXBWP-CR55KG5d.cjs} +1 -1
  81. package/dist/{ganttDiagram-NO4QXBWP-C23vm5cK.js → ganttDiagram-NO4QXBWP-DjpANtqX.js} +2 -2
  82. package/dist/{gitGraphDiagram-IHSO6WYX-DOH3WBNZ.cjs → gitGraphDiagram-IHSO6WYX-BWYUn1Bi.cjs} +1 -1
  83. package/dist/{gitGraphDiagram-IHSO6WYX-BXWses91.js → gitGraphDiagram-IHSO6WYX-DzhnsGXo.js} +24 -24
  84. package/dist/index.cjs +1 -1
  85. package/dist/index.client.cjs +1 -1
  86. package/dist/index.client.d.ts +3 -1
  87. package/dist/index.client.js +50 -48
  88. package/dist/index.js +50 -48
  89. package/dist/{infoDiagram-FWYZ7A6U-Bj2fnr5Y.cjs → infoDiagram-FWYZ7A6U-CsUGc58_.cjs} +1 -1
  90. package/dist/{infoDiagram-FWYZ7A6U-C4NsbHAN.js → infoDiagram-FWYZ7A6U-hraoyboI.js} +1 -1
  91. package/dist/{ishikawaDiagram-FXEZZL3T-Cjqwv-T2.cjs → ishikawaDiagram-FXEZZL3T-D5b25aDN.cjs} +1 -1
  92. package/dist/{ishikawaDiagram-FXEZZL3T-B2bMsFnl.js → ishikawaDiagram-FXEZZL3T-cBJei3wJ.js} +32 -32
  93. package/dist/{journeyDiagram-5HDEW3XC-DfRiiYRf.cjs → journeyDiagram-5HDEW3XC-DrNyUSsx.cjs} +1 -1
  94. package/dist/{journeyDiagram-5HDEW3XC-DO1Xx-OE.js → journeyDiagram-5HDEW3XC-IkQqMl8f.js} +28 -28
  95. package/dist/{kanban-definition-HUTT4EX6-Cu_E-BJj.cjs → kanban-definition-HUTT4EX6-CvBgN3eX.cjs} +1 -1
  96. package/dist/{kanban-definition-HUTT4EX6-RfpoaM17.js → kanban-definition-HUTT4EX6-D2UL88Cz.js} +46 -46
  97. package/dist/{linear-BbWOUIQi.js → linear-BiJV9gYf.js} +10 -10
  98. package/dist/{linear-Cz3x9Lkl.cjs → linear-DwqXGYLc.cjs} +1 -1
  99. package/dist/{mindmap-definition-LN4V7U3C-CB606E3L.cjs → mindmap-definition-LN4V7U3C-CBrUse7P.cjs} +1 -1
  100. package/dist/{mindmap-definition-LN4V7U3C-B5LpvJ9m.js → mindmap-definition-LN4V7U3C-CK67hf6V.js} +11 -11
  101. package/dist/{pegDiagram-2B236MQR-BCqBc3Re.cjs → pegDiagram-2B236MQR-C5pLIpKI.cjs} +1 -1
  102. package/dist/{pegDiagram-2B236MQR-DaosueJV.js → pegDiagram-2B236MQR-CwWX4Irn.js} +3 -3
  103. package/dist/{pieDiagram-ENE6RG2P-BUY2Dvjo.cjs → pieDiagram-ENE6RG2P-BKvggS7k.cjs} +1 -1
  104. package/dist/{pieDiagram-ENE6RG2P-wfsOfWyT.js → pieDiagram-ENE6RG2P-MO42pSl8.js} +68 -68
  105. package/dist/{quadrantDiagram-ABIIQ3AL-BSvHqsTp.cjs → quadrantDiagram-ABIIQ3AL-BHhoAvLS.cjs} +1 -1
  106. package/dist/{quadrantDiagram-ABIIQ3AL-Bgc3vspL.js → quadrantDiagram-ABIIQ3AL-CzHgLdS3.js} +7 -7
  107. package/dist/{railroadDiagram-RFXS5EU6-Du2CFU9M.js → railroadDiagram-RFXS5EU6-Bu_Fhi5x.js} +3 -3
  108. package/dist/{railroadDiagram-RFXS5EU6-DdF2c_n3.cjs → railroadDiagram-RFXS5EU6-CwGmOFD_.cjs} +1 -1
  109. package/dist/{requirementDiagram-TGXJPOKE-WM3sItRw.cjs → requirementDiagram-TGXJPOKE-BhdvQnjG.cjs} +1 -1
  110. package/dist/{requirementDiagram-TGXJPOKE-CnafqSUP.js → requirementDiagram-TGXJPOKE-CY-JYM-P.js} +18 -18
  111. package/dist/{sankeyDiagram-HTMAVEWB-D4Qv4d98.js → sankeyDiagram-HTMAVEWB-BmHtjxlW.js} +10 -10
  112. package/dist/{sankeyDiagram-HTMAVEWB-DaZN3ZDb.cjs → sankeyDiagram-HTMAVEWB-CUeYKZeQ.cjs} +1 -1
  113. package/dist/{sequenceDiagram-DBY2YBRQ-CmP6XGGE.js → sequenceDiagram-DBY2YBRQ-Cn2CC9BC.js} +47 -47
  114. package/dist/{sequenceDiagram-DBY2YBRQ-C6fa7Axs.cjs → sequenceDiagram-DBY2YBRQ-GepntdDB.cjs} +1 -1
  115. package/dist/{sizeCapture-X5ZJPWSS-mWZkTwA5.js → sizeCapture-X5ZJPWSS-CZF99dy_.js} +1 -1
  116. package/dist/{sizeCapture-X5ZJPWSS-B6sRQba9.cjs → sizeCapture-X5ZJPWSS-Cd-k8xwk.cjs} +1 -1
  117. package/dist/{stateDiagram-2N3HPSRC-ClDZKhLD.js → stateDiagram-2N3HPSRC-CCbBvBua.js} +18 -18
  118. package/dist/{stateDiagram-2N3HPSRC-B__29zPZ.cjs → stateDiagram-2N3HPSRC-D2cvrAtN.cjs} +1 -1
  119. package/dist/{stateDiagram-v2-6OUMAXLB-BA-_ovVY.cjs → stateDiagram-v2-6OUMAXLB-BaktPIVY.cjs} +1 -1
  120. package/dist/{stateDiagram-v2-6OUMAXLB-K7slPgH_.js → stateDiagram-v2-6OUMAXLB-_A1QESxx.js} +2 -2
  121. package/dist/styles/markdown.css +1 -1
  122. package/dist/styles/markdown.standalone.css +1 -1
  123. package/dist/{swimlanes-5IMT3BWC-Cpowlk7O.js → swimlanes-5IMT3BWC-B-BDM_Ae.js} +3 -3
  124. package/dist/{swimlanes-5IMT3BWC-BhxZhB7M.cjs → swimlanes-5IMT3BWC-DtdLK5z3.cjs} +1 -1
  125. package/dist/{swimlanesDiagram-G3AALYLV-36K4ynZn.js → swimlanesDiagram-G3AALYLV-BysT2rWl.js} +2 -2
  126. package/dist/{swimlanesDiagram-G3AALYLV-BZ0eguZa.cjs → swimlanesDiagram-G3AALYLV-DZuQxKuB.cjs} +1 -1
  127. package/dist/{timeline-definition-FHXFAJF6-C2xHtlkw.js → timeline-definition-FHXFAJF6-DVzdzbl1.js} +58 -58
  128. package/dist/{timeline-definition-FHXFAJF6-BJN69nkZ.cjs → timeline-definition-FHXFAJF6-oFf_sUOI.cjs} +1 -1
  129. package/dist/utils/promiseTry.d.ts +1 -0
  130. package/dist/{vennDiagram-L72KCM5P-3R1vuMWd.cjs → vennDiagram-L72KCM5P-Ba2FGeN1.cjs} +1 -1
  131. package/dist/{vennDiagram-L72KCM5P-DbqRaWm5.js → vennDiagram-L72KCM5P-Bm1TGZux.js} +146 -146
  132. package/dist/{wardleyDiagram-EHGQE667-CF5I0pM9.js → wardleyDiagram-EHGQE667-BC_1RAbp.js} +32 -32
  133. package/dist/{wardleyDiagram-EHGQE667-CyU76ilz.cjs → wardleyDiagram-EHGQE667-CqB3gLCH.cjs} +1 -1
  134. package/dist/{xychartDiagram-FW5EYKEG-spkx-w6w.js → xychartDiagram-FW5EYKEG-ClITdEhV.js} +47 -47
  135. package/dist/{xychartDiagram-FW5EYKEG-DaKE_uIg.cjs → xychartDiagram-FW5EYKEG-a1vb5UxD.cjs} +1 -1
  136. package/package.json +10 -11
  137. package/dist/extractHeadings-DpvwXCio.cjs +0 -315
  138. package/dist/flowDiagram-23GEKE2U-DfDAl_qd.cjs +0 -1
  139. package/dist/flowDiagram-23GEKE2U-p6ccACf3.js +0 -7
package/README.md CHANGED
@@ -477,13 +477,35 @@ A block rendered without such a sheet shows plain inherited text: the components
477
477
 
478
478
  - **Contrast**: every token reaches at least 7:1 (WCAG AAA) on its block and on the tinted lines of a diff, in None, GitHub and Zenn, light and dark (the lowest measured in a browser is 7.01 for None and GitHub in the light scheme, 8.16 in the dark one; 7.15 for Zenn in the light scheme, 7.19 in the dark one).
479
479
  - **Palette**: a theme colour that falls below 7:1 on any of those backgrounds is replaced by one with the same hue and chroma (chroma is lowered only to stay inside sRGB), moved in lightness only as far as 7:1 needs. The tints keep the hue of a translucent green and red and take the luminance of the block, so a tint never lowers a token's contrast.
480
- - **Hooks** are data attributes, not classes: `data-aqmd-code-block` on the block's root, `data-aqmd-code-filename` on the file name's tab, `data-aqmd-code-copy` on the copy button (the copy button of a display-math block carries it too) and `data-aqmd-diff="add"` or `"remove"` on a changed line, which sets no inline background.
481
- - **Copy button and file name**: `markdown.css` colours them (`#1f2937` on `#e5e7eb`, `#d1d5db` on hover; in the dark scheme, `.dark` or `[data-theme="dark"]` on an ancestor, `#f3f4f6` on `#374151`, `#4a5361` on hover), every pair at 7:1 or more. The copy buttons are at least 44 × 44 px under every pointer.
480
+ - **Hooks** are data attributes, not classes: `data-aqmd-code-block` on the block's root, `data-aqmd-code-header` on the header row above the code, `data-aqmd-code-filename` on the file name's tab, `data-aqmd-code-copy` on the copy button (the copy button of a display-math block carries it too) with `data-aqmd-copy-outcome` (`idle`, `copied` or `failed`), `data-aqmd-copy-notice` on the button's status region, `data-aqmd-code-pending` on the plain `pre` that holds the code while the highlighting loads, and `data-aqmd-diff="add"` or `"remove"` on a changed line, which sets no inline background.
481
+ - **Copy button and file name**: `markdown.css` colours them (`#1f2937` on `#e5e7eb`, `#d1d5db` on hover; in the dark scheme, `.dark` or `[data-theme="dark"]` on an ancestor, `#f3f4f6` on `#374151`, `#4a5361` on hover), every pair at 7:1 or more. The copy button is an icon button of 44 × 44 px under every pointer, and keyboard focus draws on it the package's two-colour focus ring (`--aqmd-control-focus-inner` and `--aqmd-control-focus-outer`, set on the block's root).
482
+ - **Layout**: the copy button never covers the code. The block's root holds a header row and then the `pre`; the header is a flex row at least 2.75rem (44 px) tall that packs its items to its inline end, with the file name at its inline start (when the fence names one; its own margin takes the free space) and the copy button at its inline end. A copy's outcome changes neither the button's size nor its name, so it moves nothing. A block without a file name keeps the row with the button alone, a long file name wraps inside the row, and the block's outer
483
+ margin is `1rem 0` either way (the markup is below the list).
484
+ - **Copying**: a press writes the code to the clipboard of the window that shows the block. The outcome shows for 2 seconds as the button's icon (the copy glyph with a check or a cross) and is announced by the status region beside the button (`role="status"`, drawn nowhere), which holds the `copied` or the `copyFailed` label for that time; the button's name stays the `copy` label. A page without the asynchronous clipboard (one served over plain `http`), a clipboard that throws and a write the browser refuses are a failed copy, never an exception; the
485
+ last two are also logged to the console. Each press starts the 2 seconds again and is announced again; only the latest press decides the outcome. The labels come from `labels` in `MarkdownViewer` (`codeBlockCopy`, `codeBlockCopied`, `codeBlockCopyFailed`), `codeBlockLabels` in `MarkdownRenderer` and `labels` in `CodeNode` (`CodeBlockLabels`; see [Labels and languages](#labels-and-languages)).
486
+ - **Loading**: the root, with its source lines, and the header row render at once. Until Shiki's HTML is ready, the `pre` holds the code as plain text in the highlighted `pre`'s box (`margin: 0; padding: 0.8rem 0`, a keyboard scroll stop as Shiki's is), so the lines wrap and scroll as the highlighted ones will and the block keeps its height when they replace it.
487
+ - **Hydration**: a block the browser hydrates takes over the lines, box and keyboard scroll stop the server highlighted, as they stand, and does not wait for the browser's highlighting, so no update that reaches it before Shiki loads (a context above the document changing, say a panel group measuring its container right after hydration) turns it into plain text. The browser highlights only the blocks it renders itself and a block whose code, language or diff mode changes; it loads no grammar for a hydrated block. React compares neither those lines nor
488
+ the `pre`'s attributes, so the server and the browser must render the same code, as they must for the rest of the document. A block whose highlighting the server did not complete (`renderToString` does not wait for it) shows plain text and highlights in the browser.
482
489
  - **Languages**: a fence's language is highlighted when Shiki knows it — one of its languages or their aliases
483
490
  (`bundledLanguages`), or a plain one (`text`, `txt`, `plain`, `plaintext`, `ansi`). `svg` is highlighted as `xml`.
484
491
  Every other language (`logql`, a misspelling, a language in capitals such as `SVG`) renders as plain text, so no fence
485
492
  can fail the document; the block keeps its file name and copy button.
486
493
 
494
+ The block's markup (the file name's tab only when the fence names a file):
495
+
496
+ ```html
497
+ <div data-aqmd-code-block="">
498
+ <div data-aqmd-code-header="">
499
+ <div data-aqmd-code-filename="">answer.js</div>
500
+ <button type="button" data-aqmd-code-copy="" data-aqmd-copy-outcome="idle" aria-label="Copy the code" lang="en">
501
+ <svg aria-hidden="true">…</svg>
502
+ </button>
503
+ <span data-aqmd-copy-notice="" role="status"></span>
504
+ </div>
505
+ <pre class="shiki …">…</pre>
506
+ </div>
507
+ ```
508
+
487
509
  ### SVG images
488
510
 
489
511
  Give `MarkdownViewer` or `MarkdownRenderer` a reader of image sources (`imageSource`, a `MarkdownImageSourceReader`),
@@ -527,7 +549,10 @@ as written.
527
549
  browser cannot draw copies nothing and says it could not copy, as does a browser without `ClipboardItem`.
528
550
  - With the whole source shown (`copy`, its outcomes `copied` and `copyFailed`) it writes the text exactly as read. A
529
551
  source the host cut never offers Copy, so the clipboard never gets part of a file.
530
- - Leaving the block aborts the read.
552
+ - Each press of Copy stops the copy before it, and leaving the block stops the one under way, so only the latest press
553
+ tells its outcome (a copy of the image still reading its file stops too). A clipboard that refuses or throws is a
554
+ failed copy, never an exception, and is logged to the console; a browser without the asynchronous clipboard is not
555
+ logged.
531
556
  - **Toolbar**: 44 × 44 px controls in a wrapping row at the inline end that never covers the image, Copy first, then the
532
557
  Source toggle and the full-screen toggle at the row's end (so both toggles stay put whether Copy shows or not), one
533
558
  tab stop whose controls the arrow keys, Home and End walk, and the palette and focus ring the Mermaid and spreadsheet
@@ -656,7 +681,9 @@ Total 17,600 MT
656
681
  the viewport's height less two 44 px bands, so the page can always be scrolled past it. A box whose `height` reaches the
657
682
  rows the grid shows shows every row instead (`data-aqmd-spreadsheet-whole` on the block): it takes their height, rounded
658
683
  up plus 1 px (the grid's reported content height once it has loaded, so rows a reader makes taller still fit), with no
659
- cap. Its rows never scroll, so the wheel and a finger's vertical swipe over the table reach the page, a keyboard move
684
+ cap. Its rows never scroll, so the wheel and a finger's vertical swipe over the table reach the page (a horizontal swipe
685
+ over the rows of a table wider than its box still scrolls the columns: the grid then takes only horizontal swipes,
686
+ `touch-action: pan-y`), a keyboard move
660
687
  scrolls the page to the active cell, and PageUp / PageDown move by the part of the table the window shows (the grid's
661
688
  0.17.1); the 1 px keeps a fractional zoom's rounding from making the rows scrollable, which would let the grid take the
662
689
  finger. The box is never wider than the table: once the grid has loaded, its width is the
@@ -711,6 +738,16 @@ Total 17,600 MT
711
738
  controls and of the grid's own circle, and that criterion's exceptions do not cover it: it floats over the cells,
712
739
  which are targets themselves, and the table's scroll bars are 12 px. It is an aid a writer opts into per table; the
713
740
  table scrolls without it by a finger's drag, the wheel and the keys.
741
+ - **The scroll bars' controls**: `spreadsheetScrollBarControls` on `MarkdownRenderer` and `MarkdownViewer` gives the
742
+ tables of a document the controls of the grid's scroll bars (the grid's `scrollBarControls`, a
743
+ `SpreadsheetScrollBarControls` with `showArrowButtons`, `enableThumbDrag` and `enableTrackClick`; the grid's own bars
744
+ when absent). A host whose reader points with a finger leaves all three out: the 12 px bars are too thin to aim at,
745
+ and a finger that drags the table near its edge would meet an arrow or the track by mistake. The bars then only show
746
+ where the table is scrolled, and no press on them scrolls it. A host that renders
747
+ `SpreadsheetBlock` itself passes them as `scrollBarControls`; the mdast path has no prop for them, so its tables keep
748
+ the grid's own bars. Keep the object's identity across renders: the viewer draws the document again when it changes,
749
+ and MarkdownRenderer renders every table block again (the grids read the three by value, so none of them is drawn
750
+ again).
714
751
  - **Reading**: a read-only table (the default) is the grid's `readOnly` — every cell refuses edits and is announced as
715
752
  read-only — while selection, Ctrl+C (the grid's own copy: TSV in Excel's clipboard form and the interop HTML table),
716
753
  scrolling, the zoom, Excel's Ctrl+Arrow data edges, column and row sizes, the active row and column bands (on by default),
@@ -800,7 +837,9 @@ Total 17,600 MT
800
837
  grid).
801
838
  - **Known limits**: formulas are not calculated (a cell starting with `=` shows as written); a tap does not start editing (the
802
839
  spreadsheet's rule); a finger swipe that starts over a table whose rows scroll does not scroll the page (a box that shows
803
- every row never scrolls its rows, so a swipe over it does); Tab moves inside the grid and Escape leaves it; column widths,
840
+ every row never scrolls its rows, so a vertical swipe over it does); a finger's pan that starts on a table's header or
841
+ footer rows or on its horizontal scroll bar does not move the columns (they lie outside the rows' scroll pane, so the
842
+ pan goes to the page; one over the rows does); Tab moves inside the grid and Escape leaves it; column widths,
804
843
  row heights and the zoom are not saved (a reload resets all three; the grid also resets the widths when the column count
805
844
  changes and the heights when the row count changes, an edit that adds or removes a column or a row included); with
806
845
  `autofit=1` a reader's resize lasts until the table or the options change or a web font of the cells' families
@@ -875,8 +914,25 @@ The viewer reads no other package's variable. Where the toolbar is fixed to the
875
914
 
876
915
  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.
877
916
 
878
- 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.
879
- 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).
917
+ Each button is a circle `--aqmd-toolbar-block-size` across: 11 spacing steps plus a 1 px border on each side, 46 px at the default step (`0.25rem`), a 44 px target inside the border. The package stylesheet defines the property on the scroll container and gives every `[data-aqmd-toolbar-button]` that border-box width and height with its icon centred, so the row is as tall as one button whatever
918
+ the host's font, line height and box sizing. The step is the one the stylesheet's utilities take: `markdown.css` reads the host's `--spacing` (`0.25rem` when the page defines none), so a Tailwind host that changes it scales the buttons with it, and `markdown.standalone.css` writes the default theme's step in, as it does into its own utilities, and never reads a `--spacing` on the page.
919
+
920
+ 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. The depth is measured in the container's own CSS px and rounded up to a whole px, so a CSS `zoom` or a transform above the viewer gives the depth it has at 100 %.
921
+ 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). A container with no layout (under a `display: none` ancestor) is not measured: the band in force stays, so the content does not move when the container is shown.
922
+
923
+ Until the viewer has measured it (the server's markup and the first client render), the container carries no inline value and the package stylesheet supplies one: `0px`, unless the host opts in with `--aqmd-toolbar-reserve-before-measure: 1` on an ancestor.
924
+ Opted in, a container whose toolbar certainly covers the content's inline extent (`[data-aqmd-toolbar-over-content]`: the toolbar is shown and neither `width` nor `maxWidth` is given, so the column runs under it) reserves the toolbar's reach, `--aqmd-toolbar-block-reach`: `--aqmd-toolbar-inset-block-start` plus `--aqmd-toolbar-block-size`, rounded up to a whole px (with `round()`, in browsers that support it). The rounding starts 1/256 px below the exact sum, so a browser that computes the band in the px of a page zoom or a CSS `zoom` never lifts a whole sum by a px through floating-point error.
925
+ The stylesheet registers a copy of the reach as a length, `--aqmd-toolbar-block-reach-px` (`@property`), which the viewer reads in the container's own px; no rule substitutes the copy, because Firefox applies a CSS `zoom` a second time to a registered length that `var()` substitutes. The viewer writes the reach in place of the measured depth whenever the toolbar's bottom lies within the reach's px (from 1 px above the reach to the reach), widened on each side by the snapping of the toolbar's inset and size,
926
+ which layout applies before the viewer measures them: two layout units of 1/16 px each, the coarsest a browser lays a page out in (1/64 of a px of the page's zoom, at the smallest zoom, 25 %), divided by a CSS `zoom` below 1. So the document's first line stays where the server put it, for a toolbar whose containing block starts at the container's top, at any root font size and zoom. In a browser without `@property` the viewer writes the measured depth rounded up, which can move the first line by 1 px.
927
+ Opt in only for such a layout (the viewer fills its own containing block, or the viewport, from its top); elsewhere the first line moves once, to the measured depth.
928
+
929
+ ```css
930
+ .my-document-pane {
931
+ contain: layout paint;
932
+ --aqmd-toolbar-reserve-before-measure: 1;
933
+ --aqmd-toolbar-inset-block-start: 4px;
934
+ }
935
+ ```
880
936
 
881
937
  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.
882
938
  A popover is also never taller than the room below its top in the scroll container's visible part (the container's bottom, clipped to the visual viewport), less 8 px: it scrolls inside instead (`overflow-y: auto`, `overscroll-behavior: contain`, so its scroll never chains to the document), so the last entry of a long table of contents stays reachable on a phone and in a landscape window.
@@ -906,14 +962,31 @@ The function receives the scroll container, `[data-aqmd-scroll-container]`, the
906
962
  A bar that watches the container's size or children must not render React synchronously from a `ResizeObserver` or `MutationObserver` callback (for example by notifying a `useSyncExternalStore` store there). React would then render inside the browser's delivery of the observations, and before such a render it runs the page's pending effects and updates, the viewer's insertion of a drawn Mermaid diagram among them. Elements observed in the same delivery then change size, and the browser reports `ResizeObserver loop completed with undelivered notifications`.
907
963
  Measure, and notify React, on the next animation frame instead; notifying from the container's `scroll` event is fine, because the browser dispatches it before it delivers the observations.
908
964
 
909
- A bar that draws something over the scroll container beside itself, such as a tap-scroll circle, reserves a lane for it with `scrollBarGutter` (CSS px, default 0):
965
+ A bar that draws something over the scroll container beside itself, such as a tap-scroll circle, reserves a lane for it with `scrollBarGutter`: a number of CSS px, or a string holding a CSS length or a custom property reference (default 0, no lane):
910
966
 
911
967
  ```tsx
912
968
  <MarkdownViewer {...props} renderScrollBar={(scroller) => <MyScrollBar target={scroller} />} scrollBarGutter={54} />
969
+ <MarkdownViewer {...props} renderScrollBar={(scroller) => <MyScrollBar target={scroller} />} scrollBarGutter="var(--my-bar-lane)" />
913
970
  ```
914
971
 
915
972
  The viewer adds the lane to the container's inline-end padding, outside `padding`, so no content (a block's toolbar, a focused link) lies under what the bar draws there at any scroll position; where the bar draws inside the lane is the bar's own.
916
- The lane is kept while the content fits as well, so the text never re-wraps when the bar appears. It is ignored without `renderScrollBar`, and a negative, infinite or NaN value throws a `RangeError`.
973
+ With a lane the container's padding is `padding-inline-start: <padding>px; padding-inline-end: calc(<padding>px + <lane>)`; without one it stays `padding-inline: <padding>px`.
974
+ A string is written as given (white space around it removed), so a lane that the host varies with its own media queries, through a custom property, gives the same server markup on every device and no hydration difference. It takes one of two forms:
975
+
976
+ - **A non-negative CSS length**: an unsigned integer or decimal, with an optional exponent, directly followed by a length unit in any ASCII case (`"54px"`, `"3.5rem"`, `"0.5EM"`, `"1e1px"`). The units are `px`, `cm`, `mm`, `q`, `in`, `pc`, `pt`, `em`, `rem`, `ex`, `rex`, `cap`, `rcap`, `ch`, `rch`, `ic`, `ric`, `lh`, `rlh`, `vw`, `vh`, `vi`, `vb`, `vmin`, `vmax`, `svw`, `svh`, `svi`, `svb`, `svmin`, `svmax`, `lvw`, `lvh`, `lvi`, `lvb`, `lvmin`, `lvmax`, `dvw`, `dvh`, `dvi`, `dvb`, `dvmin`, `dvmax`, `cqw`, `cqh`, `cqi`, `cqb`, `cqmin` and `cqmax`; a percentage is no lane, since the lane is a length.
977
+ - **A custom property reference without a fallback**, `var(--name)`: the name is `--` followed by one or more of `A-Z`, `a-z`, `0-9`, `_` and `-`, and white space may stand inside the parentheses (`"var(--my-bar-lane)"`, `"var( --my-bar-lane )"`). The browser resolves it, so define the property as a length: an undefined property, or one that is not a length, leaves the inline-end padding at 0.
978
+
979
+ Any other string throws a `RangeError`, on the server and in the browser alike (the check is a fixed grammar and does not ask `CSS.supports`): an empty or white-space-only string, a bare number (`"54"`, which `calc()` cannot add to a length), a sign (`"-1rem"`, `"+1rem"`), white space before the unit (`"10 px"`), a percentage (`"50%"`), `calc()` or any other function, a fallback (`"var(--x, 1px)"`), two values (`"1px 2px"`) and any other character (`"10px;color:red"`).
980
+ A host's string therefore can neither add a declaration to the style nor make the browser drop the padding.
981
+ The lane is kept while the content fits as well, so the text never re-wraps when the bar appears. It is ignored without `renderScrollBar`, and an invalid value throws a `RangeError` either way: a negative, infinite or NaN number, or a string in neither form.
982
+
983
+ The slot takes the width of what the bar renders, and the bar renders only once the scroll container is mounted, so on its own the column would narrow by the bar's width at hydration. Give that width with `scrollBarInlineSize`, in the same forms as `scrollBarGutter` (a number of CSS px, or a non-negative CSS length or `var(--name)` string), and the slot is that wide from the first render on, the server's markup included:
984
+
985
+ ```tsx
986
+ <MarkdownViewer {...props} renderScrollBar={(scroller) => <MyScrollBar target={scroller} />} scrollBarInlineSize="var(--my-bar-size)" />
987
+ ```
988
+
989
+ The toolbar then keeps that length from the inline end instead of the slot's measured width. It is ignored without `renderScrollBar`, and an invalid value throws a `RangeError` naming `scrollBarInlineSize`.
917
990
 
918
991
  The native vertical scrollbar never shows beside the host's bar. How it is hidden depends on how the platform draws scrollbars:
919
992
 
@@ -921,14 +994,16 @@ The native vertical scrollbar never shows beside the host's bar. How it is hidde
921
994
  The native horizontal scrollbar keeps its native look, spans exactly the visible width and stays usable. No `::-webkit-scrollbar` or `scrollbar-width` rule is involved, so a host's `scrollbar-color` or `scrollbar-width` neither breaks the hiding nor is overridden.
922
995
  - **Scrollbars overlaid on the content** (phones, tablets, macOS by default, Firefox's and GTK's overlay modes): such a bar takes no space, so there is no strip to cut off, and it would be drawn over the content beside the host's bar while scrolling. The scroll container takes `scrollbar-width: none` instead, which hides both native scrollbars, the horizontal one included (overriding a host's `scrollbar-width` there).
923
996
 
997
+ The container takes `scrollbar-width: none` before it is measured as well (the server's markup and the first client render), so the content already has the width it keeps once a bar that takes space is cut off: nothing moves when the measurement replaces the hiding with the clip.
998
+ While it hides them, the container also carries `data-aqmd-native-scrollbars-hidden`, through which the package stylesheet hides them in browsers without `scrollbar-width` (`::-webkit-scrollbar`, which an inline style cannot reach: Safari before 18.2), so a bar that takes space does not narrow the server's paint there either; browsers with `scrollbar-width` ignore that rule while the inline value is set.
924
999
  Either way the wheel, the keyboard, touch and the trackpad scroll in both directions. The cell uses `overflow: clip` rather than `hidden`, so nothing can scroll the cell itself, and it creates no containing block, so the fixed toolbar is neither moved nor clipped by it.
925
- Coverage: scrollbars that take space are hidden in every browser that supports `overflow: clip` (Chromium 90, Firefox 81, Safari 16); overlaid ones in every browser that supports `scrollbar-width` (Chromium 121, Firefox 64, Safari 18.2), and they stay visible while scrolling in older ones. The right-to-left inline end is handled the same way.
1000
+ Coverage: scrollbars that take space are hidden in every browser that supports `overflow: clip` (Chromium 90, Firefox 81, Safari 16), before the measurement as well; overlaid ones in every browser that supports `scrollbar-width` (Chromium 121, Firefox 64, Safari 18.2) or `::-webkit-scrollbar` (Safari and Chromium before them), and they stay visible while scrolling in older Firefox. The right-to-left inline end is handled the same way.
926
1001
 
927
1002
  The thickness and the slot's width are measured in the scroll container's own CSS px, which a CSS `zoom` or a transform above it makes differ from the viewport's: a native scrollbar keeps its size on screen, so under `zoom: 1.1` its 15 px are 13.64 of the container's px.
928
1003
  The container is positioned (`position: relative`) and holds an invisible box stretched across its padding box, `[data-aqmd-scroll-bar-probe]` (`aria-hidden`, out of flow, no larger than the padding box); the thickness is the container's rect width less that box's, converted by the ratio of the container's rect width to its computed width, less its side borders.
929
1004
  The box is a scroller itself with nothing to scroll (`overflow-y: scroll`), and its own vertical scrollbar tells how the platform draws scrollbars: the platform overlays them when the container's thickness is 0 and the box's own scrollbar takes no space either (`offsetWidth` equals `clientWidth`). The box, not the container, is read for this because the container keeps measuring 0 once its scrollbars are hidden, while the box follows the platform: when the platform switches (macOS's setting, a mouse attached or removed), the box's content box narrows or widens and the area measures again.
930
- It is rounded up to a whole px, because the clip must never leave any of the native bar showing: the price is less than 1 px of the container's own px cut off its inline-end padding and the end of the native horizontal scrollbar (0.36 px at `zoom: 1.1`, none where the thickness is whole).
931
- Both are measured before the first paint and again whenever the container, the probe or the slot resizes and the window resizes (a page zoom changes a scrollbar's thickness in CSS px). The floating toolbar keeps the slot's measured width from the inline end instead of a native scrollbar's 24 px, and each popover's maximum width uses the same clearance.
1005
+ The widening is the measured thickness plus 1/256 px, a margin above the measurement's error and well below the engine's layout unit (1/64 px in Chromium and WebKit, 1/60 px in Firefox), which the engine's snapping takes back: the cell cuts off exactly the bar, so none of it shows, nothing of the padding or the horizontal scrollbar is cut, and the content keeps its width to the layout unit at any zoom (under `zoom: 1.1` the container is widened by 13.6403 px).
1006
+ Both are measured before the first paint and again whenever the container, the probe or the slot resizes and the window resizes (a page zoom changes a scrollbar's thickness in CSS px). The floating toolbar keeps the slot's width (`scrollBarInlineSize` when given, else the measured width) from the inline end instead of a native scrollbar's 24 px, and each popover's maximum width uses the same clearance.
932
1007
 
933
1008
  Everything else keeps using the native scroller: fragment and table-of-contents scrolling with `scroll-padding-block-start`, the scroll position kept across a display-style change, link-card visibility observation, embed minimum widths measured from the content column, and the browser's scroll anchoring. Without the prop, the scroll container is the viewer's root element with its native scrollbars, and no row, cell or slot is rendered. Switching between given and omitted moves the scroll container onto another element, which starts at the top.
934
1009
 
@@ -955,9 +1030,11 @@ The layout is the exported `HostedScrollArea` (next section), which hosts can us
955
1030
  | `children` | The scroller's content. |
956
1031
  | `renderScrollBar` | The host's bar (`MarkdownScrollBarRenderer`). Omitted, the area renders the scroller alone with the caller's props unchanged and measures nothing, so a host can use it unconditionally. |
957
1032
  | `rowClassName`, `rowStyle` | Place the row in its parent, with a bar only: the row takes the scroller's place there, so a flex item's `flex` and minimum sizes go here. `rowStyle` is merged over the row's own `display: flex; inline-size: 100%; block-size: 100%` and zero minimum sizes. |
1033
+ | `barInlineSize` | The slot's inline size from the first render on, the server's markup included: a number of CSS px, or a non-negative CSS length or `var(--name)` string as the viewer's `scrollBarGutter` takes. Omitted, the slot takes the width of what the bar renders (0 until the bar is drawn). An invalid value throws a `RangeError` naming `barInlineSize`. |
958
1034
  | `onBarInlineSizeChange` | Called with the slot's measured width, in the scroller's own CSS px, whenever it changes, before the paint that shows it. The width is 0 before the first call and returns to 0 when the bar is removed. The viewer keeps its floating toolbar clear of the bar with it. |
959
1035
 
960
- With a bar, the area owns four of the scroller's styles, `position: relative`, `box-sizing: border-box`, `overflow-y: scroll` and `width: calc(100% + <thickness>px)`, and a fifth, `scrollbar-width: none`, while the platform overlays its scrollbars; it appends the probe as its last child. The rest of `scrollerProps.style` and the class are kept, so the horizontal overflow stays the caller's. The scroller must be as tall as the clipping cell (`block-size: 100%`). The hiding, the measurement under zoom and their coverage are those described in the previous section.
1036
+ With a bar, the area owns four of the scroller's styles, `position: relative`, `box-sizing: border-box`, `overflow-y: scroll` and `width: calc(100% + <thickness>px)`, and a fifth, `scrollbar-width: none`, with the attribute `data-aqmd-native-scrollbars-hidden`, before the scroller is measured and while it measures 0 px thick (the platform overlays its scrollbars, or the caller's style hides them); it appends the probe as its last child. The thickness is measured with the caller's own `scrollbar-width` in effect (the inline value
1037
+ of `scrollerProps.style`, else the cascade's): the area sets that inline value and removes the attribute for the reads and puts both back before anything is painted, so a caller's `thin` bar is measured as it is drawn. The rest of `scrollerProps.style` and the class are kept, so the horizontal overflow stays the caller's. The scroller must be as tall as the clipping cell (`block-size: 100%`). The hiding, the measurement under zoom and their coverage are those described in the previous section.
961
1038
 
962
1039
  ### Table of contents
963
1040
 
@@ -996,9 +1073,11 @@ const headingHref: MarkdownHeadingHrefResolver = (heading) => `/docs/guide.md#${
996
1073
 
997
1074
  ### Labels and languages
998
1075
 
999
- 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`) and, through the `spreadsheet*` keys, the labels of each spreadsheet block (`SpreadsheetBlock` takes `SpreadsheetBlockLabels` as `labels`).
1076
+ 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`) and, through the `spreadsheet*` keys, the labels of each spreadsheet block (`SpreadsheetBlock` takes `SpreadsheetBlockLabels` as `labels`), and, through the `svgImage*`, `codeBlock*` and `displayMath*` keys, those of the SVG image blocks, the code blocks and the display formulas
1077
+ (`MarkdownRenderer` takes them as `svgImageLabels`, `codeBlockLabels` and `displayMathLabels`; `CodeNode` takes `CodeBlockLabels` as `labels`).
1000
1078
  A label you pass carries no language of its own and is read in your page's language.
1001
- 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, pan and full-screen buttons and the diagram's frame name are English. The embed labels (`embeddedVideo`, `embeddedPost`, `embeddedFrame`) are English. `DEFAULT_MARKDOWN_VIEWER_LABELS`, `DEFAULT_MERMAID_DIAGRAM_LABELS` and `DEFAULT_MARKDOWN_EMBED_LABELS` hold the built-in texts.
1079
+ 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, pan and full-screen buttons and the diagram's frame name are English. The embed labels (`embeddedVideo`, `embeddedPost`, `embeddedFrame`) and the labels of the SVG image blocks, the code blocks and the display formulas are English. `DEFAULT_MARKDOWN_VIEWER_LABELS`, `DEFAULT_MERMAID_DIAGRAM_LABELS`,
1080
+ `DEFAULT_MARKDOWN_EMBED_LABELS`, `DEFAULT_SVG_IMAGE_LABELS`, `DEFAULT_CODE_BLOCK_LABELS` and `DEFAULT_DISPLAY_MATH_LABELS` hold the built-in texts.
1002
1081
 
1003
1082
  The Mermaid keys of `MermaidDiagramLabels`, all optional (the viewer's key for each is `mermaid` followed by the key with a capital first letter: `panUp` is `mermaidPanUp`):
1004
1083
 
@@ -1062,6 +1141,14 @@ The SVG image block's keys of `SvgImageLabels`, all optional and English by defa
1062
1141
  | `fullscreen`, `exitFullscreen` | The full-screen toggle, by the way it goes | View full screen / Exit full screen |
1063
1142
  | `fullscreenDialog` | The block's dialog while full screen; `{name}` as in `sourceRegion` | {name} (full screen) |
1064
1143
 
1144
+ The copy buttons of the code blocks and of the display formulas take the keys of `CodeBlockLabels` and `DisplayMathLabels`, all optional and English by default (`lang="en"`; the viewer's key for each is `codeBlock` or `displayMath` followed by the key with a capital first letter: `copy` is `codeBlockCopy` and `displayMathCopy`; `DEFAULT_CODE_BLOCK_LABELS` and `DEFAULT_DISPLAY_MATH_LABELS` hold the texts). The name is the button's whatever the outcome, and the notices are what its status region announces:
1145
+
1146
+ | Key | Names or says | Code block (`codeBlock*`) | Display formula (`displayMath*`) |
1147
+ | --- | --- | --- | --- |
1148
+ | `copy` | The copy button | Copy the code | Copy the formula |
1149
+ | `copied` | The notice after a copy | Copied the code. | Copied the formula. |
1150
+ | `copyFailed` | The notice when the copy failed | Could not copy the code. | Could not copy the formula. |
1151
+
1065
1152
  The viewer's `blockFailed` (the renderer's `blockFailedLabel`; built in: "This block could not be shown.", `lang="en"`) names the notice of a block that cannot render.
1066
1153
 
1067
1154
  ### Settings without React
@@ -1165,9 +1252,19 @@ Japanese or other non-Latin letters inside a formula (`\frac{売上}{原価}`) a
1165
1252
  ```
1166
1253
 
1167
1254
  A display formula sits in a frame with its copy button beside it, never on it. A formula that fits stays centred (one that reaches the button moves aside just enough), and a formula wider than the column scrolls sideways inside its own box instead of widening the document.
1255
+ The button is the code blocks' copy button (see [Code blocks](#code-blocks)) and copies the formula's TeX source; it keeps its size and its name whatever the outcome of a copy, so a copy never moves the formula. Its labels come from `labels` in `MarkdownViewer` (`displayMathCopy`, `displayMathCopied`, `displayMathCopyFailed`) and `displayMathLabels` in `MarkdownRenderer` (`DisplayMathLabels`); the formulas of `NodesRenderer` use the built-in ones.
1168
1256
  While the formula overflows, its box takes keyboard focus (`tabIndex=0`) so the arrow keys scroll it; the box is measured again when it resizes, when its formula changes and when a font loads (a document without a `FontFaceSet`, such as jsdom in tests, loads no fonts, and the frame needs none there). A formula with a `\tag` takes the whole width left of the button, so the tag stands beside the button. A formula in a paragraph keeps KaTeX's own spacing above and below.
1169
1257
 
1170
- - **Hooks**: `data-aqmd-math-display` on the frame (`"flow"` in `MarkdownRenderer` and `MarkdownViewer`, built from `<span>` elements so it is valid inside `<p>`; `"block"` in `NodesRenderer`, built from `<div>` elements), `data-aqmd-math-scroll` on the formula's box and `data-aqmd-math-copy` on the button's column. The button keeps `data-aqmd-code-copy`, and the layout comes from the components' stylesheet.
1258
+ - **Hooks**: `data-aqmd-math-display` on the frame (`"flow"` in `MarkdownRenderer` and `MarkdownViewer`, built from `<span>` elements so it is valid inside `<p>`; `"block"` in `NodesRenderer`, built from `<div>` elements), `data-aqmd-math-scroll` on the formula's box and `data-aqmd-math-copy` on the button's column, which holds the button and then its status region (`data-aqmd-copy-notice`). The button keeps `data-aqmd-code-copy` and `data-aqmd-copy-outcome`, and the layout comes from the components' stylesheet.
1259
+
1260
+ ### Front matter
1261
+
1262
+ A YAML block opening the document is front matter, and the converter renders nothing for it: it shows neither as a thematic break and a setext heading nor in the table of contents, and its keys are not read.
1263
+ The first line is three or more dashes (a UTF-8 byte order mark may precede it), and the block runs through the first later line that is at least as many dashes, or `...` (the fences of Marp's front matter); both may end in spaces and tabs, and the lines may end in `\r\n`.
1264
+ Without a closing line the document renders as plain Markdown (a thematic break, then the text), and a line of dashes anywhere else (a later line, an indented line, a line inside a blockquote or a list item) opens no front matter.
1265
+ So a document whose first line is a thematic break written as three or more dashes (`---`) starts with front matter whenever a later line is at least as many dashes, or `...` (a setext heading's underline, a later thematic break, such a line inside a fenced code block): nothing up to that line is rendered, its headings are not in the table of contents, and when the line stands inside a fenced code block, that block's closing fence opens a new code block.
1266
+ To begin a document with a thematic break, write it as `***` or `___`, or put a blank line before it.
1267
+ The blocks after it keep their source lines in the document: `data-source-lines` counts the front matter's lines.
1171
1268
 
1172
1269
  ### GitHub Alerts
1173
1270
 
@@ -1,6 +1,6 @@
1
- import { g as p, r as u, d as a } from "./chunk-MOJQB5TN-BzuZr6pz.js";
2
- import { p as f } from "./chunk-JWPE2WC7-O891tu2Q.js";
3
- import { _ as n, U as o } from "./extractHeadings-3qWVTkb9.js";
1
+ import { g as p, r as u, d as a } from "./chunk-MOJQB5TN-nqR_swpx.js";
2
+ import { p as f } from "./chunk-JWPE2WC7-DG0ebjV4.js";
3
+ import { _ as n, W as o } from "./extractHeadings-DlQcPv5N.js";
4
4
  import { M as c, b as d } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
5
5
  var v = d().RailroadAbnf.parser.LangiumParser, i = /* @__PURE__ */ n((e) => {
6
6
  const r = e.alternatives.map(g);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chunk-MOJQB5TN-BSfpWEVd.cjs"),u=require("./chunk-JWPE2WC7-CHK_g5p5.cjs"),n=require("./extractHeadings-DpvwXCio.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-DADVbG98.cjs"),u=require("./chunk-JWPE2WC7-5sd39cpa.cjs"),n=require("./extractHeadings-wWAipplS.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,4 +1,4 @@
1
- import { aF as ln, aG as an, aH as y, aI as tn, aJ as M, aK as I, aL as _, aM as un, aN as rn, aO as j, aP as o, aQ as H, aR as sn, aS as on, aT as fn } from "./extractHeadings-3qWVTkb9.js";
1
+ import { aH as ln, aI as an, aJ as y, aK as tn, aL as Q, aM as I, aN as _, aO as un, aP as rn, aQ as j, aR as o, aS as K, aT as sn, aU as on, aV as fn } from "./extractHeadings-DlQcPv5N.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, q, O, v, R, J, a) {
18
- var D = q - l, i = O - h, n = J - v, d = a - R, u = d * D - n * i;
17
+ function pn(l, h, q, O, v, R, L, a) {
18
+ var D = q - l, i = O - h, n = L - v, d = a - R, u = d * D - n * i;
19
19
  if (!(u * u < y))
20
20
  return u = (n * (h - R) - d * (l - v)) / u, [l + u * D, h + u * i];
21
21
  }
22
- function W(l, h, q, O, v, R, J) {
23
- var a = l - q, D = h - O, i = (J ? R : -R) / j(a * a + D * D), n = i * D, d = -i * a, u = l + n, s = h + d, f = q + n, c = O + d, K = (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, E = (g < 0 ? -1 : 1) * j(fn(0, T * T * A - P * P)), F = (P * g - m * E) / A, G = (-P * m - g * E) / A, w = (P * g + m * E) / A, p = (-P * m + g * E) / A, x = F - K, e = G - t, r = w - K, L = p - t;
24
- return x * x + e * e > r * r + L * L && (F = w, G = p), {
25
- cx: F,
26
- cy: G,
22
+ function W(l, h, q, O, v, R, L) {
23
+ var a = l - q, D = h - O, i = (L ? R : -R) / j(a * a + D * D), n = i * D, d = -i * a, u = l + n, s = h + d, f = q + n, c = O + d, M = (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, E = (g < 0 ? -1 : 1) * j(fn(0, T * T * A - P * P)), H = (P * g - m * E) / A, J = (-P * m - g * E) / A, w = (P * g + m * E) / A, p = (-P * m + g * E) / A, x = H - M, e = J - t, r = w - M, N = p - t;
24
+ return x * x + e * e > r * r + N * N && (H = w, J = p), {
25
+ cx: H,
26
+ cy: J,
27
27
  x01: -n,
28
28
  y01: -d,
29
- x11: F * (v / T - 1),
30
- y11: G * (v / T - 1)
29
+ x11: H * (v / T - 1),
30
+ y11: J * (v / T - 1)
31
31
  };
32
32
  }
33
33
  function hn() {
34
- var l = cn, h = yn, q = H(0), O = null, v = gn, R = dn, J = mn, a = null, D = ln(i);
34
+ var l = cn, h = yn, q = K(0), O = null, v = gn, R = dn, L = mn, a = null, D = 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, K = 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, M = un(c - f), t = c > f;
37
37
  if (a || (a = n = D()), s < u && (d = s, s = u, u = d), !(s > y)) a.moveTo(0, 0);
38
- else if (K > tn - y)
39
- a.moveTo(s * M(f), s * I(f)), a.arc(0, 0, s, f, c, !t), u > y && (a.moveTo(u * M(c), u * I(c)), a.arc(0, 0, u, c, f, t));
38
+ else if (M > tn - y)
39
+ a.moveTo(s * Q(f), s * I(f)), a.arc(0, 0, s, f, c, !t), u > y && (a.moveTo(u * Q(c), u * I(c)), a.arc(0, 0, u, c, f, t));
40
40
  else {
41
- var m = f, g = c, A = f, T = c, P = K, E = K, F = J.apply(this, arguments) / 2, G = F > y && (O ? +O.apply(this, arguments) : j(u * u + s * s)), w = _(un(s - u) / 2, +q.apply(this, arguments)), p = w, x = w, e, r;
42
- if (G > y) {
43
- var L = sn(G / u * I(F)), z = sn(G / s * I(F));
44
- (P -= L * 2) > y ? (L *= t ? 1 : -1, A += L, T -= L) : (P = 0, A = T = (f + c) / 2), (E -= z * 2) > y ? (z *= t ? 1 : -1, m += z, g -= z) : (E = 0, m = g = (f + c) / 2);
41
+ var m = f, g = c, A = f, T = c, P = M, E = M, H = L.apply(this, arguments) / 2, J = H > y && (O ? +O.apply(this, arguments) : j(u * u + s * s)), w = _(un(s - u) / 2, +q.apply(this, arguments)), p = w, x = w, e, r;
42
+ if (J > y) {
43
+ var N = sn(J / u * I(H)), z = sn(J / s * I(H));
44
+ (P -= N * 2) > y ? (N *= t ? 1 : -1, A += N, T -= N) : (P = 0, A = T = (f + c) / 2), (E -= z * 2) > y ? (z *= t ? 1 : -1, m += z, g -= z) : (E = 0, m = g = (f + c) / 2);
45
45
  }
46
- var N = s * M(m), Q = s * I(m), B = u * M(T), C = u * I(T);
46
+ var U = s * Q(m), V = s * I(m), B = u * Q(T), C = u * I(T);
47
47
  if (w > y) {
48
- var U = s * M(g), V = s * I(g), X = u * M(A), Y = u * I(A), S;
49
- if (K < rn)
50
- if (S = pn(N, Q, X, Y, U, V, B, C)) {
51
- var Z = N - S[0], $ = Q - S[1], k = U - S[0], b = V - S[1], nn = 1 / I(on((Z * k + $ * b) / (j(Z * Z + $ * $) * j(k * k + b * b))) / 2), en = j(S[0] * S[0] + S[1] * S[1]);
48
+ var F = s * Q(g), G = s * I(g), X = u * Q(A), Y = u * I(A), S;
49
+ if (M < rn)
50
+ if (S = pn(U, V, X, Y, F, G, B, C)) {
51
+ var Z = U - S[0], $ = V - S[1], k = F - S[0], b = G - S[1], nn = 1 / I(on((Z * k + $ * b) / (j(Z * Z + $ * $) * j(k * k + b * b))) / 2), en = j(S[0] * S[0] + S[1] * S[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
- E > y ? x > y ? (e = W(X, Y, N, Q, s, x, t), r = W(U, V, B, C, 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(N, Q), a.arc(0, 0, s, m, g, !t)) : a.moveTo(N, Q), !(u > y) || !(P > y) ? a.lineTo(B, C) : p > y ? (e = W(B, C, U, V, u, -p, t), r = W(N, Q, X, Y, 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
+ E > y ? x > y ? (e = W(X, Y, U, V, s, x, t), r = W(F, G, B, C, 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(U, V), a.arc(0, 0, s, m, g, !t)) : a.moveTo(U, V), !(u > y) || !(P > y) ? a.lineTo(B, C) : p > y ? (e = W(B, C, F, G, u, -p, t), r = W(U, V, X, Y, 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 [M(d) * n, I(d) * n];
62
+ return [Q(d) * n, I(d) * n];
63
63
  }, i.innerRadius = function(n) {
64
- return arguments.length ? (l = typeof n == "function" ? n : H(+n), i) : l;
64
+ return arguments.length ? (l = typeof n == "function" ? n : K(+n), i) : l;
65
65
  }, i.outerRadius = function(n) {
66
- return arguments.length ? (h = typeof n == "function" ? n : H(+n), i) : h;
66
+ return arguments.length ? (h = typeof n == "function" ? n : K(+n), i) : h;
67
67
  }, i.cornerRadius = function(n) {
68
- return arguments.length ? (q = typeof n == "function" ? n : H(+n), i) : q;
68
+ return arguments.length ? (q = typeof n == "function" ? n : K(+n), i) : q;
69
69
  }, i.padRadius = function(n) {
70
- return arguments.length ? (O = n == null ? null : typeof n == "function" ? n : H(+n), i) : O;
70
+ return arguments.length ? (O = n == null ? null : typeof n == "function" ? n : K(+n), i) : O;
71
71
  }, i.startAngle = function(n) {
72
- return arguments.length ? (v = typeof n == "function" ? n : H(+n), i) : v;
72
+ return arguments.length ? (v = typeof n == "function" ? n : K(+n), i) : v;
73
73
  }, i.endAngle = function(n) {
74
- return arguments.length ? (R = typeof n == "function" ? n : H(+n), i) : R;
74
+ return arguments.length ? (R = typeof n == "function" ? n : K(+n), i) : R;
75
75
  }, i.padAngle = function(n) {
76
- return arguments.length ? (J = typeof n == "function" ? n : H(+n), i) : J;
76
+ return arguments.length ? (L = typeof n == "function" ? n : K(+n), i) : L;
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-DpvwXCio.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-wWAipplS.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;