@aiquants/markdown 8.1.0 → 9.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 (137) hide show
  1. package/README.md +105 -6
  2. package/dist/{abnfDiagram-VRR7QNED-COhNzXNE.cjs → abnfDiagram-VRR7QNED-BlcBSkWc.cjs} +1 -1
  3. package/dist/{abnfDiagram-VRR7QNED-C8c6opKu.js → abnfDiagram-VRR7QNED-DPvv0JN7.js} +3 -3
  4. package/dist/{arc-B7dJeCE2.cjs → arc-DnEVH7-N.cjs} +1 -1
  5. package/dist/arc-b3PXY3wd.js +83 -0
  6. package/dist/{architectureDiagram-ZJ3FMSHR-DkPnUyg2.js → architectureDiagram-ZJ3FMSHR-BPDNqRgJ.js} +2 -2
  7. package/dist/{architectureDiagram-ZJ3FMSHR-CEKrAopq.cjs → architectureDiagram-ZJ3FMSHR-BPesVaHB.cjs} +1 -1
  8. package/dist/{blockDiagram-677ZJIJ3-8SbxgSPX.js → blockDiagram-677ZJIJ3-Bif7ObTM.js} +3 -3
  9. package/dist/{blockDiagram-677ZJIJ3-CjkHADz7.cjs → blockDiagram-677ZJIJ3-D1wkf-um.cjs} +1 -1
  10. package/dist/{c4Diagram-LMCZKHZV-yyFJx8cz.js → c4Diagram-LMCZKHZV-BTR45GVa.js} +2 -2
  11. package/dist/{c4Diagram-LMCZKHZV-DNA2nQGH.cjs → c4Diagram-LMCZKHZV-ByUwS5Pa.cjs} +1 -1
  12. package/dist/{channel-AU6Wl3tM.js → channel-BjDEP12v.js} +1 -1
  13. package/dist/{channel-BmWKcNRa.cjs → channel-s9lqY49F.cjs} +1 -1
  14. package/dist/{chunk-2Q5K7J3B-piQwYJQ4.js → chunk-2Q5K7J3B-3Yxool5g.js} +1 -1
  15. package/dist/{chunk-2Q5K7J3B-CNGMKVwn.cjs → chunk-2Q5K7J3B-GdBcW8di.cjs} +1 -1
  16. package/dist/{chunk-32BRIVSS-BqVwiyb1.cjs → chunk-32BRIVSS-B08XoiLi.cjs} +1 -1
  17. package/dist/{chunk-32BRIVSS-UYOJ_0zk.js → chunk-32BRIVSS-CVTMS7GT.js} +1 -1
  18. package/dist/{chunk-5VM5RSS4-D2uhPXpB.cjs → chunk-5VM5RSS4-BQoi-IrE.cjs} +1 -1
  19. package/dist/{chunk-5VM5RSS4-BW4JCEEi.js → chunk-5VM5RSS4-D9iWNvvu.js} +1 -1
  20. package/dist/{chunk-EX3LRPZG-0d4k1nQH.cjs → chunk-EX3LRPZG-BXIZ7mJ_.cjs} +1 -1
  21. package/dist/{chunk-EX3LRPZG-iHiCfad6.js → chunk-EX3LRPZG-CRf3FYTC.js} +21 -21
  22. package/dist/{chunk-JWPE2WC7-B0wbe9kC.cjs → chunk-JWPE2WC7-BziKhEzJ.cjs} +1 -1
  23. package/dist/{chunk-JWPE2WC7-BIvGQze3.js → chunk-JWPE2WC7-D2PL9wSE.js} +1 -1
  24. package/dist/{chunk-MOJQB5TN-D_szn4LO.cjs → chunk-MOJQB5TN-BZPg0rA4.cjs} +1 -1
  25. package/dist/{chunk-MOJQB5TN-ClyJPR3N.js → chunk-MOJQB5TN-DcKI-L1a.js} +7 -7
  26. package/dist/{chunk-PUDLZKDR-DCWC9BV3.js → chunk-PUDLZKDR-DDUAtfaX.js} +6 -6
  27. package/dist/{chunk-PUDLZKDR-Da8ALohe.cjs → chunk-PUDLZKDR-DtwY_vfa.cjs} +1 -1
  28. package/dist/{chunk-RYQCIY6F-D-fL7Arm.cjs → chunk-RYQCIY6F-BczXRQc_.cjs} +1 -1
  29. package/dist/{chunk-RYQCIY6F-BJunVYHV.js → chunk-RYQCIY6F-CrSm-DUq.js} +5 -5
  30. package/dist/{chunk-V7JOEXUC-dOvhhSJR.cjs → chunk-V7JOEXUC-DHDaKlaz.cjs} +1 -1
  31. package/dist/{chunk-V7JOEXUC-CKvcevsF.js → chunk-V7JOEXUC-fKZqn2BY.js} +15 -15
  32. package/dist/{chunk-VR4S4FIN-UyLNi7_d.js → chunk-VR4S4FIN-CB1TUCm-.js} +3 -3
  33. package/dist/{chunk-VR4S4FIN-BXb1KkES.cjs → chunk-VR4S4FIN-CbOikBFH.cjs} +1 -1
  34. package/dist/{chunk-XXDRQBXY-CrK2v0cI.cjs → chunk-XXDRQBXY-BNQCeyB9.cjs} +1 -1
  35. package/dist/{chunk-XXDRQBXY-BR25mC1D.js → chunk-XXDRQBXY-K8anqUB1.js} +1 -1
  36. package/dist/{classDiagram-v2-EOCWNBFH-Dk9Cb1P_.js → classDiagram-OUVF2IWQ-0DLLfHtC.js} +2 -2
  37. package/dist/{classDiagram-OUVF2IWQ-Dd8K3APq.cjs → classDiagram-OUVF2IWQ-D1vfgcCB.cjs} +1 -1
  38. package/dist/{classDiagram-OUVF2IWQ-Dk9Cb1P_.js → classDiagram-v2-EOCWNBFH-0DLLfHtC.js} +2 -2
  39. package/dist/{classDiagram-v2-EOCWNBFH-Dd8K3APq.cjs → classDiagram-v2-EOCWNBFH-D1vfgcCB.cjs} +1 -1
  40. package/dist/code-blocks.cjs +1 -0
  41. package/dist/code-blocks.d.ts +12 -0
  42. package/dist/code-blocks.js +36 -0
  43. package/dist/components/MarkdownRenderer.d.ts +6 -1
  44. package/dist/components/MarkdownViewer.d.ts +5 -1
  45. package/dist/components/SpreadsheetBlock.d.ts +24 -0
  46. package/dist/components/SpreadsheetToolbar.d.ts +21 -0
  47. package/dist/components/controlStyles.d.ts +3 -0
  48. package/dist/components/mdastNodes/CodeNode.d.ts +1 -0
  49. package/dist/components/spreadsheetClipboard.d.ts +16 -0
  50. package/dist/components/spreadsheetLabels.d.ts +33 -0
  51. package/dist/components/spreadsheetModel.d.ts +31 -0
  52. package/dist/components/viewerLabels.d.ts +6 -1
  53. package/dist/converter.wasm +0 -0
  54. package/dist/{cose-bilkent-JH36ORCC-R8-QyE8i.js → cose-bilkent-JH36ORCC-DSrvI7Rp.js} +5 -5
  55. package/dist/{cose-bilkent-JH36ORCC-BabWDfU-.cjs → cose-bilkent-JH36ORCC-Flvn8Q3R.cjs} +1 -1
  56. package/dist/{cynefinDiagram-TSTJHNR4-DA9Y86zK.js → cynefinDiagram-TSTJHNR4-BGtSNTPQ.js} +56 -56
  57. package/dist/{cynefinDiagram-TSTJHNR4-DkOQZ78i.cjs → cynefinDiagram-TSTJHNR4-BxqOgmm9.cjs} +1 -1
  58. package/dist/{dagre-VKFMJZFB-DDd8r_DC.js → dagre-VKFMJZFB-Bq5NKuKi.js} +26 -26
  59. package/dist/{dagre-VKFMJZFB-CgbTP0Wx.cjs → dagre-VKFMJZFB-CIQyEWnl.cjs} +1 -1
  60. package/dist/{diagram-FQU43EPY-BAgBAvgs.js → diagram-FQU43EPY-B4shMan7.js} +31 -31
  61. package/dist/{diagram-FQU43EPY-CxfNu2-7.cjs → diagram-FQU43EPY-C-3vCuEY.cjs} +1 -1
  62. package/dist/{diagram-G47NLZAW-CB93NFXX.js → diagram-G47NLZAW-BnJ5uYMd.js} +49 -49
  63. package/dist/{diagram-G47NLZAW-CkiymCo7.cjs → diagram-G47NLZAW-BnVPH5jd.cjs} +1 -1
  64. package/dist/{diagram-NH7WQ7WH-p6Y93aOD.cjs → diagram-NH7WQ7WH-4RGgOu7p.cjs} +1 -1
  65. package/dist/{diagram-NH7WQ7WH-B9v-kVbL.js → diagram-NH7WQ7WH-9s11j-Nx.js} +15 -15
  66. package/dist/{diagram-OA4YK3LP-COWMD9b-.cjs → diagram-OA4YK3LP-BBtbKikh.cjs} +1 -1
  67. package/dist/{diagram-OA4YK3LP-sJRwAzB_.js → diagram-OA4YK3LP-CgqOV0tg.js} +25 -25
  68. package/dist/{diagram-WEI45ONY-C8T5giSx.js → diagram-WEI45ONY-CvzP7VJ3.js} +67 -67
  69. package/dist/{diagram-WEI45ONY-DpIxbF21.cjs → diagram-WEI45ONY-DZKSviH2.cjs} +1 -1
  70. package/dist/{ebnfDiagram-CCIWWBDH-BeltWCbi.js → ebnfDiagram-CCIWWBDH-CJSyu4o9.js} +3 -3
  71. package/dist/{ebnfDiagram-CCIWWBDH-C3mX3xi4.cjs → ebnfDiagram-CCIWWBDH-DpiouxMS.cjs} +1 -1
  72. package/dist/{erDiagram-Q63AITRT-CEJEnlDH.cjs → erDiagram-Q63AITRT-BT1bGFxN.cjs} +1 -1
  73. package/dist/{erDiagram-Q63AITRT-BDRv2ZL5.js → erDiagram-Q63AITRT-BxRdYBzJ.js} +19 -19
  74. package/dist/extractHeadings-B-v1O82x.cjs +314 -0
  75. package/dist/{extractHeadings-4Twze1a2.js → extractHeadings-SqtThWou.js} +6481 -5975
  76. package/dist/flowDiagram-23GEKE2U-C-drHfAk.js +7 -0
  77. package/dist/flowDiagram-23GEKE2U-Cr8_S21X.cjs +1 -0
  78. package/dist/{ganttDiagram-NO4QXBWP-D8PJGFBA.cjs → ganttDiagram-NO4QXBWP-BXUukgtA.cjs} +1 -1
  79. package/dist/{ganttDiagram-NO4QXBWP-ufXjgu_J.js → ganttDiagram-NO4QXBWP-BbNFbubH.js} +2 -2
  80. package/dist/{gitGraphDiagram-IHSO6WYX-CIFUIlyT.js → gitGraphDiagram-IHSO6WYX-BY7URUuV.js} +10 -10
  81. package/dist/{gitGraphDiagram-IHSO6WYX-B_0MTo_P.cjs → gitGraphDiagram-IHSO6WYX-CtRl8SF8.cjs} +1 -1
  82. package/dist/index.cjs +1 -1
  83. package/dist/index.client.cjs +1 -1
  84. package/dist/index.client.d.ts +3 -1
  85. package/dist/index.client.js +38 -36
  86. package/dist/index.js +38 -36
  87. package/dist/{infoDiagram-FWYZ7A6U-D6Gz3U8C.js → infoDiagram-FWYZ7A6U-BwM_aV37.js} +3 -3
  88. package/dist/{infoDiagram-FWYZ7A6U-Kc-I0YS9.cjs → infoDiagram-FWYZ7A6U-DjbpQufv.cjs} +1 -1
  89. package/dist/{ishikawaDiagram-FXEZZL3T-DhiZcFc2.js → ishikawaDiagram-FXEZZL3T-CWHT2wjh.js} +35 -35
  90. package/dist/{ishikawaDiagram-FXEZZL3T-D6HwKFYQ.cjs → ishikawaDiagram-FXEZZL3T-D0k3NpJW.cjs} +1 -1
  91. package/dist/{journeyDiagram-5HDEW3XC-BM9CUgjl.cjs → journeyDiagram-5HDEW3XC-BAzrW3sk.cjs} +1 -1
  92. package/dist/{journeyDiagram-5HDEW3XC-C7RWP4gW.js → journeyDiagram-5HDEW3XC-CTBamWVg.js} +30 -30
  93. package/dist/{kanban-definition-HUTT4EX6-BuOwUllf.js → kanban-definition-HUTT4EX6-DX8ATmyc.js} +47 -47
  94. package/dist/{kanban-definition-HUTT4EX6-GHkiFLFG.cjs → kanban-definition-HUTT4EX6-vEBxhqy3.cjs} +1 -1
  95. package/dist/{linear-CFU1TjYA.js → linear-CUPbFHK0.js} +5 -5
  96. package/dist/{linear-CfqknxqH.cjs → linear-DO7t2MIy.cjs} +1 -1
  97. package/dist/{mindmap-definition-LN4V7U3C-DIl1G8VF.cjs → mindmap-definition-LN4V7U3C-CPgbGhe0.cjs} +1 -1
  98. package/dist/{mindmap-definition-LN4V7U3C-HAxXHmB6.js → mindmap-definition-LN4V7U3C-CZiyButG.js} +11 -11
  99. package/dist/{pegDiagram-2B236MQR-BDNdKFri.js → pegDiagram-2B236MQR-BTTxMeDC.js} +3 -3
  100. package/dist/{pegDiagram-2B236MQR-BMcKIFEC.cjs → pegDiagram-2B236MQR-DFSWh2UC.cjs} +1 -1
  101. package/dist/{pieDiagram-ENE6RG2P-7MKargq5.js → pieDiagram-ENE6RG2P-5OqZWuO-.js} +49 -49
  102. package/dist/{pieDiagram-ENE6RG2P-DkoMk8N8.cjs → pieDiagram-ENE6RG2P-DWsTb8I9.cjs} +1 -1
  103. package/dist/{quadrantDiagram-ABIIQ3AL-DzHTxI0w.cjs → quadrantDiagram-ABIIQ3AL-BnIKvRMS.cjs} +1 -1
  104. package/dist/{quadrantDiagram-ABIIQ3AL-D9WiLVW4.js → quadrantDiagram-ABIIQ3AL-DimV94Rb.js} +45 -45
  105. package/dist/{railroadDiagram-RFXS5EU6-DqqU0Jzd.js → railroadDiagram-RFXS5EU6-CO_q8JT9.js} +3 -3
  106. package/dist/{railroadDiagram-RFXS5EU6-Bh7sCsCx.cjs → railroadDiagram-RFXS5EU6-D7cUshy0.cjs} +1 -1
  107. package/dist/{requirementDiagram-TGXJPOKE-BoMZfE4l.js → requirementDiagram-TGXJPOKE-Ceitr12-.js} +3 -3
  108. package/dist/{requirementDiagram-TGXJPOKE-DAHoWz6v.cjs → requirementDiagram-TGXJPOKE-CjPsjAsx.cjs} +1 -1
  109. package/dist/{sankeyDiagram-HTMAVEWB-DEozFb2a.js → sankeyDiagram-HTMAVEWB-CAfuQjzU.js} +47 -47
  110. package/dist/{sankeyDiagram-HTMAVEWB-DwacVzcw.cjs → sankeyDiagram-HTMAVEWB-CQhx84em.cjs} +1 -1
  111. package/dist/{sequenceDiagram-DBY2YBRQ-3bp9kw3C.js → sequenceDiagram-DBY2YBRQ-BZ2yIdO6.js} +3 -3
  112. package/dist/{sequenceDiagram-DBY2YBRQ-BOF7BGz4.cjs → sequenceDiagram-DBY2YBRQ-Cr1VcoK2.cjs} +1 -1
  113. package/dist/{sizeCapture-X5ZJPWSS-Dxg1anpP.cjs → sizeCapture-X5ZJPWSS-B5X1945u.cjs} +1 -1
  114. package/dist/{sizeCapture-X5ZJPWSS-DI71KO2Z.js → sizeCapture-X5ZJPWSS-CA-VZP1J.js} +1 -1
  115. package/dist/{stateDiagram-2N3HPSRC-BvJAkHvW.cjs → stateDiagram-2N3HPSRC-BeP4b2HS.cjs} +1 -1
  116. package/dist/{stateDiagram-2N3HPSRC-CRtqzCvL.js → stateDiagram-2N3HPSRC-CbAk-IE5.js} +13 -13
  117. package/dist/{stateDiagram-v2-6OUMAXLB-ykYcMSNc.js → stateDiagram-v2-6OUMAXLB-C5uUx1aU.js} +2 -2
  118. package/dist/{stateDiagram-v2-6OUMAXLB-KiBzbGzx.cjs → stateDiagram-v2-6OUMAXLB-L_ypLgkx.cjs} +1 -1
  119. package/dist/styles/markdown.css +1 -1
  120. package/dist/styles/markdown.standalone.css +1 -1
  121. package/dist/{swimlanes-5IMT3BWC-ZT-jPiq7.js → swimlanes-5IMT3BWC-BOKZHjmn.js} +313 -313
  122. package/dist/{swimlanes-5IMT3BWC-D_bRoBJj.cjs → swimlanes-5IMT3BWC-DGpEXqaM.cjs} +1 -1
  123. package/dist/{swimlanesDiagram-G3AALYLV-TRdFQTHr.js → swimlanesDiagram-G3AALYLV-BG07hh3H.js} +2 -2
  124. package/dist/{swimlanesDiagram-G3AALYLV-DfmI7K4T.cjs → swimlanesDiagram-G3AALYLV-DqChJVS9.cjs} +1 -1
  125. package/dist/{timeline-definition-FHXFAJF6-zQVxGI0F.js → timeline-definition-FHXFAJF6-Ct3xWe_j.js} +40 -40
  126. package/dist/{timeline-definition-FHXFAJF6-1LlewnX0.cjs → timeline-definition-FHXFAJF6-O0HVNX0c.cjs} +1 -1
  127. package/dist/{vennDiagram-L72KCM5P-Zx_75FNg.cjs → vennDiagram-L72KCM5P-BqOqbGRA.cjs} +1 -1
  128. package/dist/{vennDiagram-L72KCM5P-DsfKtIWC.js → vennDiagram-L72KCM5P-DCY6NWkD.js} +124 -124
  129. package/dist/{wardleyDiagram-EHGQE667-D11yaIHG.cjs → wardleyDiagram-EHGQE667-B2Civob5.cjs} +1 -1
  130. package/dist/{wardleyDiagram-EHGQE667-DfKCyD8F.js → wardleyDiagram-EHGQE667-CYStGsZi.js} +25 -25
  131. package/dist/{xychartDiagram-FW5EYKEG-CDJtv7Wv.js → xychartDiagram-FW5EYKEG-BifGB5it.js} +40 -40
  132. package/dist/{xychartDiagram-FW5EYKEG-uuIDwc70.cjs → xychartDiagram-FW5EYKEG-C4GuhADi.cjs} +1 -1
  133. package/package.json +16 -7
  134. package/dist/arc-R4utbJ-t.js +0 -83
  135. package/dist/extractHeadings-CqbucFeq.cjs +0 -311
  136. package/dist/flowDiagram-23GEKE2U-BUEdVRzZ.cjs +0 -1
  137. package/dist/flowDiagram-23GEKE2U-D34IusSc.js +0 -7
package/README.md CHANGED
@@ -15,13 +15,16 @@ Advanced Markdown renderer for React with support for various extensions and cus
15
15
  ## Installation
16
16
 
17
17
  ```bash
18
- npm install @aiquants/markdown
18
+ npm install @aiquants/markdown @aiquants/spreadsheet @aiquants/virtualscroll
19
19
  # or
20
- pnpm add @aiquants/markdown
20
+ pnpm add @aiquants/markdown @aiquants/spreadsheet @aiquants/virtualscroll
21
21
  # or
22
- yarn add @aiquants/markdown
22
+ yarn add @aiquants/markdown @aiquants/spreadsheet @aiquants/virtualscroll
23
23
  ```
24
24
 
25
+ `@aiquants/spreadsheet` is a required peer (it draws ```spreadsheets blocks) and `@aiquants/virtualscroll` is its own
26
+ peer. The grid is imported only when a document holds a table, so a document without one never loads it.
27
+
25
28
  ### パーサーバイナリの配布
26
29
 
27
30
  Markdown の解析は Go 製サービス (`markdown-api`) が担当します。このバイナリは**プラットフォーム別のパッケージ**として配布され、パッケージマネージャが実行環境に合うものだけを自動選択します (esbuild や Biome と同じ方式)。本体パッケージにバイナリは含まれません。
@@ -261,6 +264,10 @@ The document stylesheets size their text in `rem`, so the document follows text-
261
264
  The `@source` over the whole `dist` also scans the Mermaid diagram chunks bundled there, which only adds utilities for class-like words in them to the host's CSS. No narrower glob is stable: the components land in a chunk the bundler names by content hash.
262
265
  - **Any other host** links `markdown.standalone.css` instead. Never load it together with `markdown.css` or with a Tailwind v4 build of the host: its utilities would meet the host's own in the same cascade layer. A banner comment near the top of the file, after Tailwind's own, says so.
263
266
  - **Never both** sheets of the components on one page.
267
+ - **Spreadsheet blocks** need the grid's stylesheets too: a Tailwind v4 host imports
268
+ `@aiquants/virtualscroll/styles/virtualscroll.css` and `@aiquants/spreadsheet/styles/spreadsheet.css` in its Tailwind entry
269
+ (with an `@source` over `@aiquants/spreadsheet`'s build output, as for this package), any other host links
270
+ `@aiquants/spreadsheet/styles/spreadsheet.standalone.css`, which already bundles the virtualscroll sheet.
264
271
  - **The document styles** (`github-markdown.css`, `zenn-content.css`, `message.css`, `details.css`, `katex.min.css`) are linked as before. Load `zenn-content.css` after `github-markdown.css`: where both match, the Zenn code block's navy and the Zenn token colours win by order. The colours of the code blocks come from these sheets, not from the components' own (see [Code blocks](#code-blocks)).
265
272
 
266
273
  ### Raw HTML
@@ -482,10 +489,11 @@ A fenced code block in the `mermaid` language renders as `MermaidDiagram`, a blo
482
489
  Each drawing gets its own drawing host, `[data-aqmd-mermaid-host]`: a hidden element (`visibility: hidden`, `aria-hidden`, absolutely positioned just outside the start edge, `contain: strict`) appended to the main document's `<body>`, with its width set to the measured width in px.
483
490
  Mermaid draws in that element and the component shows the result in the slot, so a gantt chart, whose width Mermaid takes from where it is drawn, is exactly as wide as the slot. Because Mermaid looks its drawing up through the main document, the host lives in the main document's light DOM, and a diagram in a slot inside a shadow root is drawn the same way.
484
491
 
485
- - The component removes a drawing host when its drawing settles (shown, failed, or discarded as stale) and when the component unmounts or its text changes, so none is left behind, not even the error drawing Mermaid leaves for a text it cannot parse.
492
+ - Every diagram on the page hands its drawings to Mermaid through one lane, one at a time and in the order they were requested. A drawing that is stale when its turn comes (a newer drawing of the same diagram was requested, its text changed, or the component unmounted) never reaches Mermaid and gets no drawing host.
493
+ - The component removes a drawing host when Mermaid settles its drawing (shown, failed, or discarded as stale) and never earlier, also after the text changed or the component unmounted: Mermaid keeps drawing in the element it found, and in an element outside the document every measurement is 0, which gives a flowchart's labelled edges `translate(undefined, NaN)`. No host is left behind, not even the error drawing Mermaid leaves for a text it cannot parse.
486
494
  - Nothing is drawn while the slot has no width (inside a closed `<details>` the browser does not lay out, or a hidden panel): the loading text stays until the slot gets a width. A drawing already under way when the slot loses its width finishes at the width it was given.
487
495
  - When the width of a slot showing a gantt chart changes (a splitter drag, a window resize), the chart is drawn again at the new width 200 ms after the last change, unless the slot then has no width or the width of the latest drawing. The shown chart stays until the new one replaces it, and the new one starts at the initial zoom and pan. Other diagram types take their size from their text and are never drawn again for a width change.
488
- - A drawing that finishes after a newer one started, after the diagram's text changed or after the component unmounted is discarded.
496
+ - A drawing that finishes after a newer one was requested, after the diagram's text changed or after the component unmounted is discarded.
489
497
  - **Touch and pen**: the default mode, `both-shift`, is the same for every pointer, and Shift gates only the mouse. A finger or pen pans the drawing only while the drawing overflows its frame (zoomed in, or capped, see below); at fit it scrolls the page over the diagram as anywhere else. The component writes `touch-action` on the diagram's `<svg>` and on its frame to match, rewrites it whenever the zoom or pan changes, the mode changes or the frame resizes, and removes it (with the other styles Panzoom wrote) when it tears its Panzoom instance down:
490
498
 
491
499
  | Mode | Drawing fits its frame | Drawing overflows its frame |
@@ -509,6 +517,87 @@ Mermaid draws in that element and the component shows the result in the slot, so
509
517
  - **Colours and focus ring**: the controls, the menu items, the checked item, the error message and the retry button reach 7:1 against their surfaces in both schemes (dark when `.dark` or `[data-theme="dark"]` is on an ancestor). The focus ring of the frame, the toolbar controls and the retry button is a 2 px `#003abc` outline with a white 4 px halo, 9:1 apart, so some part of it stands out on any background (WCAG 2.4.13, 1.4.11); the menu items draw it inset. The ring's rules sit outside every cascade layer, so the controls' `shadow` utility cannot replace the halo.
510
518
  - **Hooks**: `data-aqmd-mermaid` (the root, which carries the palette's CSS variables), `data-aqmd-mermaid-frame`, `data-aqmd-mermaid-toolbar`, `data-aqmd-mermaid-control` (`mode`, `zoom-in`, `zoom-out`, `reset`, `pan-left`, `pan-up`, `pan-down` or `pan-right`), `data-aqmd-mermaid-menu`, `data-aqmd-mermaid-error` and `data-aqmd-mermaid-retry`.
511
519
 
520
+ ### Spreadsheets
521
+
522
+ A fenced code block in the `spreadsheets` language renders as `SpreadsheetBlock`: its body is a TSV table drawn with
523
+ `@aiquants/spreadsheet`, and the info string after the language holds its options (the converter writes them as
524
+ `data-code-meta`, see [Settings without React](#settings-without-react)).
525
+
526
+ <!-- markdownlint-disable MD010 -- the example's cells are separated by real tabs (TSV) -->
527
+ ````markdown
528
+ ```spreadsheets header=1 footer=1 freeze=1 height=12
529
+ Item Q1 Q2
530
+ Apples 120 140
531
+ Pears 80 95
532
+ Total 200 235
533
+ ```
534
+ ````
535
+ <!-- markdownlint-enable MD010 -->
536
+
537
+ | Option | Value | Default | Effect |
538
+ | --- | --- | --- | --- |
539
+ | `header=N` | 0–128 | 0 | The first N rows are frozen at the top and drawn bold on `#f3f4f6` (the cell text keeps 7:1 on it) |
540
+ | `footer=N` | 0–128 | 0 | The last N rows are frozen at the bottom (totals) |
541
+ | `freeze=N` | 0–128 | 0 | The first N columns are frozen at the start |
542
+ | `height=N` | 1–100 | the rows, at most 15 | The rows the block's box shows; a larger value than the table's rows shows the table's rows |
543
+
544
+ - **Options are strict**: words are `key=value` separated by white space, each key at most once, each value a decimal integer
545
+ without a sign or leading zeros. An unknown key, a repeated key, a malformed word or a value out of range shows an error in
546
+ place of the table (`role="alert"`, naming the word) and the rest of the document renders. Counts larger than the table
547
+ follow the spreadsheet's own rules (everything frozen), so an edit that shrinks the table never turns it into an error.
548
+ - **The box**: the block reserves the grid's height before the grid loads — the column-header band, the visible rows and the
549
+ horizontal scroll bar (`@aiquants/spreadsheet/view`'s constants and the block's 24 px rows) — and the server render and the
550
+ hydrating render show a plain `<table>` of the visible rows there (header rows in `<thead>`), so the page does not shift
551
+ when the grid replaces it (a block that mounts after the grid has loaded draws the grid at once) and a reader without JavaScript still sees the data. A failed load keeps the plain table and
552
+ shows the error with a retry button.
553
+ - **Reading**: in a read-only table (the default) every cell is read-only, but selection, Ctrl+C, scrolling, the zoom
554
+ (Alt+wheel, Ctrl+Alt+`=` / `-` / `0` and the toolbar), Excel's Ctrl+Arrow data edges, column resizing and autofit, the
555
+ active row and column bands (on by default), URL cells (a cell whose whole text is one http, https, mailto or tel URL links
556
+ to it; Ctrl+click or Alt+Enter opens it in a new tab with `noopener,noreferrer`) and the cell and selection announcements
557
+ (`B2, 120` / `A1:C3 selected`) all work. Numbers align right and text left by value.
558
+ - **Toolbar** (44 × 44 px controls in a wrapping row above the box, the Mermaid toolbar's look): zoom in, zoom out and reset
559
+ (the grid's 0.1 detents between 0.25 and 4), the bands toggle (`aria-pressed`), copy the whole table (TSV as `text/plain`
560
+ and the interop HTML table, which carries the grid's own payload, as `text/html` — a paste into a grid reads it back
561
+ losslessly), save as TSV (no byte order mark; the menu next to it saves with one, for Excel), full screen and the table's
562
+ size. A control that cannot act now keeps its focus and slot (`aria-disabled`).
563
+ - **Full screen**: the toolbar and the box always sit in one `<dialog>` that stays open in the document (non-modal, named
564
+ like a group); full screen turns that same dialog modal over the whole window (the top layer, the page behind inert), so
565
+ the grid keeps its selection, zoom, bands and scroll. Escape or the control leaves full screen and returns the focus to the
566
+ control; from inside the grid the first Escape is the grid's own (it hands the focus out) and the second leaves. The block
567
+ takes that Escape itself (`preventDefault()` and `stopPropagation()` on the keydown), so a host's own Escape handling
568
+ around the document never sees it; an Escape already cancelled or ending an input method composition is left alone, and
569
+ a close request without a key (Android's back) leaves full screen too, keeping the table in the document. The browser's
570
+ Fullscreen API is not used, because iPhone Safari offers it to video only.
571
+ - **Editing**: pass `spreadsheetEditor` (`SpreadsheetEditor`: `write`, `undo`, `redo`) to `MarkdownRenderer` or
572
+ `MarkdownViewer` and every table with source lines outside list items and quotes becomes editable (inside them each source
573
+ line carries the container's markers, so no write-back could match); its root carries `data-aqmd-spreadsheet-editable`. The
574
+ grid shows one spare row and one spare column to grow into (no spare row when the table has a footer). Each transaction
575
+ (a commit, a paste, a delete, a fill) is one write-back, `write({ fenceLine, expected, text })`: `fenceLine` is the block's
576
+ opening fence line (the first of its source lines), `expected` the body the table knows and `text` the new body (TSV with
577
+ line feeds, trailing empty rows and columns removed). The host replaces the body only when the lines after the fence still
578
+ read `expected`, as one undo step, and answers `true`; otherwise it changes nothing and answers `false`. A TSV table keeps
579
+ text only: a change of formatting or links alone is refused (the cells keep their state and a notice says why) and a paste
580
+ keeps its text. A body that would put ``` or ~~~ at the start of a line (after up to three spaces) is refused, because it
581
+ could close the fence. The grid's Ctrl+Z and Ctrl+Y call `undo` and `redo` (the editor keeps the one history). A body that
582
+ comes back from the document is the echo of the block's own write and changes nothing; any other body (typed in the editor,
583
+ undone) is read again. The block keeps one adapter for its life, and its key ignores its body (see
584
+ [Viewer, embeds and links](#viewer-embeds-and-links)), so a write-back keeps the selection and the scroll.
585
+ - **Languages**: `spreadsheetLocale` (`"en"`, the default, or `"ja"`) picks the language of the block's labels and of the
586
+ grid's own chrome; the viewer's `spreadsheet*` labels replace single entries (see [Labels and languages](#labels-and-languages)).
587
+ - **Hooks**: `data-aqmd-spreadsheet` (the root, which carries `data-source-lines` and the palette's CSS variables),
588
+ `data-aqmd-spreadsheet-dialog`, `data-aqmd-spreadsheet-toolbar`, `data-aqmd-spreadsheet-control` (`zoom-in`, `zoom-out`,
589
+ `reset-zoom`, `highlight`, `copy`, `save`, `save-menu`, `fullscreen`), `data-aqmd-spreadsheet-menu`,
590
+ `data-aqmd-spreadsheet-size`, `data-aqmd-spreadsheet-box`, `data-aqmd-spreadsheet-static`, `data-aqmd-spreadsheet-notice`,
591
+ `data-aqmd-spreadsheet-error` (`options` or `load`), `data-aqmd-spreadsheet-retry`, and the state attributes
592
+ `data-aqmd-spreadsheet-editable` and `data-aqmd-spreadsheet-fullscreen` (a host gives the double-click and the keys inside an
593
+ editable or full-screen table to the grid).
594
+ - **Known limits**: formulas are not calculated (a cell starting with `=` shows as written); a tap does not start editing (the
595
+ spreadsheet's rule); a finger swipe that starts over a scrollable table does not scroll the page; Tab moves inside the grid
596
+ and Escape leaves it; column widths and the zoom are not saved (a reload, or an edit that changes the row or column count,
597
+ resets the widths); printing shows the visible part of the grid only; the grid stays white in the dark scheme; a table inside
598
+ a list or a quote cannot be written back (its body in the editor carries the container's indentation, so `expected` never
599
+ matches and the write is refused with a notice); the clipboard is written only in a secure context (https or localhost).
600
+
512
601
  ### Viewer toolbar
513
602
 
514
603
  `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:
@@ -640,7 +729,7 @@ const headingHref: MarkdownHeadingHrefResolver = (heading) => `/docs/guide.md#${
640
729
 
641
730
  ### Labels and languages
642
731
 
643
- 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`).
732
+ 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`).
644
733
  A label you pass carries no language of its own and is read in your page's language.
645
734
  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 and pan 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.
646
735
 
@@ -659,6 +748,16 @@ The Mermaid keys of `MermaidDiagramLabels`, all optional (the viewer's key for e
659
748
 
660
749
  ### Settings without React
661
750
 
751
+ `@aiquants/markdown/code-blocks` holds the code-block contract without loading React: `CODE_META_ATTRIBUTE`
752
+ (`data-code-meta`, the attribute the converter writes on a fenced block's `code` for the info string after the language,
753
+ read as text only), `SPREADSHEETS_LANGUAGE`, `parseSpreadsheetOptions` (the one reader of a table's options, a `RangeError`
754
+ naming the word for an invalid one) and its limits `DEFAULT_SPREADSHEET_VISIBLE_ROWS` (15), `MAX_SPREADSHEET_VISIBLE_ROWS`
755
+ (100) and `MAX_SPREADSHEET_FROZEN_TRACKS` (128). A host's own sanitizer keeps `data-code-meta` on `code` with this name.
756
+
757
+ ```ts
758
+ import { CODE_META_ATTRIBUTE, parseSpreadsheetOptions } from "@aiquants/markdown/code-blocks"
759
+ ```
760
+
662
761
  `@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.
663
762
 
664
763
  ```ts
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chunk-MOJQB5TN-D_szn4LO.cjs"),u=require("./chunk-JWPE2WC7-B0wbe9kC.cjs"),n=require("./extractHeadings-CqbucFeq.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-BZPg0rA4.cjs"),u=require("./chunk-JWPE2WC7-BziKhEzJ.cjs"),n=require("./extractHeadings-B-v1O82x.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,6 +1,6 @@
1
- import { g as p, r as u, d as a } from "./chunk-MOJQB5TN-ClyJPR3N.js";
2
- import { p as f } from "./chunk-JWPE2WC7-BIvGQze3.js";
3
- import { _ as n, Q as o } from "./extractHeadings-4Twze1a2.js";
1
+ import { g as p, r as u, d as a } from "./chunk-MOJQB5TN-DcKI-L1a.js";
2
+ import { p as f } from "./chunk-JWPE2WC7-D2PL9wSE.js";
3
+ import { _ as n, U as o } from "./extractHeadings-SqtThWou.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";const n=require("./extractHeadings-CqbucFeq.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-B-v1O82x.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;
@@ -0,0 +1,83 @@
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-SqtThWou.js";
2
+ function cn(l) {
3
+ return l.innerRadius;
4
+ }
5
+ function yn(l) {
6
+ return l.outerRadius;
7
+ }
8
+ function gn(l) {
9
+ return l.startAngle;
10
+ }
11
+ function dn(l) {
12
+ return l.endAngle;
13
+ }
14
+ function mn(l) {
15
+ return l && l.padAngle;
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;
19
+ if (!(u * u < y))
20
+ return u = (n * (h - R) - d * (l - v)) / u, [l + u * D, h + u * i];
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,
27
+ x01: -n,
28
+ y01: -d,
29
+ x11: F * (v / T - 1),
30
+ y11: G * (v / T - 1)
31
+ };
32
+ }
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);
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;
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));
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);
45
+ }
46
+ var N = s * M(m), Q = s * I(m), B = u * M(T), C = u * I(T);
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]);
52
+ p = _(w, (u - en) / (nn - 1)), x = _(w, (s - en) / (nn + 1));
53
+ } else
54
+ p = x = 0;
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);
57
+ }
58
+ if (a.closePath(), n) return a = null, n + "" || null;
59
+ }
60
+ return i.centroid = function() {
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];
63
+ }, i.innerRadius = function(n) {
64
+ return arguments.length ? (l = typeof n == "function" ? n : H(+n), i) : l;
65
+ }, i.outerRadius = function(n) {
66
+ return arguments.length ? (h = typeof n == "function" ? n : H(+n), i) : h;
67
+ }, i.cornerRadius = function(n) {
68
+ return arguments.length ? (q = typeof n == "function" ? n : H(+n), i) : q;
69
+ }, i.padRadius = function(n) {
70
+ return arguments.length ? (O = n == null ? null : typeof n == "function" ? n : H(+n), i) : O;
71
+ }, i.startAngle = function(n) {
72
+ return arguments.length ? (v = typeof n == "function" ? n : H(+n), i) : v;
73
+ }, i.endAngle = function(n) {
74
+ return arguments.length ? (R = typeof n == "function" ? n : H(+n), i) : R;
75
+ }, i.padAngle = function(n) {
76
+ return arguments.length ? (J = typeof n == "function" ? n : H(+n), i) : J;
77
+ }, i.context = function(n) {
78
+ return arguments.length ? (a = n ?? null, i) : a;
79
+ }, i;
80
+ }
81
+ export {
82
+ hn as d
83
+ };
@@ -1,5 +1,5 @@
1
- import { p as Ze } from "./chunk-JWPE2WC7-BIvGQze3.js";
2
- import { bL as qe, _ as gt, al as Qe, aB as Je, Q as Fe, J as Ke, G as je, a6 as _e, a7 as tr, A as er, z as rr, ac as ir, ai as ar, ag as nr, aj as or, K as Ee, bE as Te, aX as pe, W as sr, O as hr, ab as lr, aY as fr, bM as cr } from "./extractHeadings-4Twze1a2.js";
1
+ import { p as Ze } from "./chunk-JWPE2WC7-D2PL9wSE.js";
2
+ import { bN as qe, _ as gt, an as Qe, aD as Je, U as Fe, O as Ke, K as je, a8 as _e, a9 as tr, J as er, G as rr, ae as ir, ak as ar, ai as nr, al as or, Q as Ee, bG as Te, aZ as pe, Y as sr, R as hr, ad as lr, a_ as fr, bO as cr } from "./extractHeadings-SqtThWou.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;