@aiquants/markdown 2.0.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +227 -16
- package/dist/{abnfDiagram-VRR7QNED-BBmog1I4.cjs → abnfDiagram-VRR7QNED-BEW-pzlz.cjs} +1 -1
- package/dist/{abnfDiagram-VRR7QNED-CxfTrgXf.js → abnfDiagram-VRR7QNED-ashFdTvJ.js} +15 -15
- package/dist/{arc-ClGqtl_2.js → arc-CV_3A_PF.js} +32 -32
- package/dist/{arc-DKsAswGe.cjs → arc-DVw3O83w.cjs} +1 -1
- package/dist/{architectureDiagram-ZJ3FMSHR-Dild3kjN.js → architectureDiagram-ZJ3FMSHR-BsYF-1vK.js} +2 -2
- package/dist/{architectureDiagram-ZJ3FMSHR-BLhnaJyB.cjs → architectureDiagram-ZJ3FMSHR-ClwjWrgh.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-DD1l8WOn.js → blockDiagram-677ZJIJ3-CG0redjq.js} +3 -3
- package/dist/{blockDiagram-677ZJIJ3-D72bpMhN.cjs → blockDiagram-677ZJIJ3-Dv1BULkl.cjs} +1 -1
- package/dist/{c4Diagram-LMCZKHZV-BJkJh-kC.js → c4Diagram-LMCZKHZV-Bp8B3b7f.js} +2 -2
- package/dist/{c4Diagram-LMCZKHZV-D3d1d4zO.cjs → c4Diagram-LMCZKHZV-DC4usA2R.cjs} +1 -1
- package/dist/{channel-DE5LXIMm.cjs → channel-Cg0ufK1F.cjs} +1 -1
- package/dist/{channel-DaGDswnD.js → channel-NjFKsGs9.js} +1 -1
- package/dist/{chunk-2Q5K7J3B-BrnUlAaZ.cjs → chunk-2Q5K7J3B-BY6lLkFO.cjs} +1 -1
- package/dist/{chunk-2Q5K7J3B-DejpXtzn.js → chunk-2Q5K7J3B-XXQGFlOd.js} +1 -1
- package/dist/{chunk-32BRIVSS-BCAuSjpE.js → chunk-32BRIVSS-DgnH6GLY.js} +1 -1
- package/dist/{chunk-32BRIVSS-CDxbP_I9.cjs → chunk-32BRIVSS-kO6eHILC.cjs} +1 -1
- package/dist/{chunk-5VM5RSS4-C-cBAbST.cjs → chunk-5VM5RSS4-BITLjZU7.cjs} +1 -1
- package/dist/{chunk-5VM5RSS4-DI1kbCYB.js → chunk-5VM5RSS4-BhA4Tl7P.js} +1 -1
- package/dist/{chunk-EX3LRPZG-uKd75-FB.cjs → chunk-EX3LRPZG-CJr2-IiP.cjs} +1 -1
- package/dist/{chunk-EX3LRPZG-CVTsVkLX.js → chunk-EX3LRPZG-DSylTHty.js} +28 -28
- package/dist/{chunk-JWPE2WC7-CNFRDah7.cjs → chunk-JWPE2WC7-BTz8xxEq.cjs} +1 -1
- package/dist/{chunk-JWPE2WC7-Cu3ql0Gi.js → chunk-JWPE2WC7-Cr_-c4Em.js} +1 -1
- package/dist/{chunk-MOJQB5TN-BZ0Sok4l.js → chunk-MOJQB5TN-DngSrRvI.js} +9 -9
- package/dist/{chunk-MOJQB5TN-Bs5Jj3Zh.cjs → chunk-MOJQB5TN-vnYqNQhm.cjs} +1 -1
- package/dist/{chunk-PUDLZKDR-DisfuynB.cjs → chunk-PUDLZKDR-BTwddg7A.cjs} +1 -1
- package/dist/{chunk-PUDLZKDR-3RVC5ezN.js → chunk-PUDLZKDR-Jnb9X3uo.js} +6 -6
- package/dist/{chunk-RYQCIY6F-CSpf1fBI.js → chunk-RYQCIY6F-CwJsUgE_.js} +1 -1
- package/dist/{chunk-RYQCIY6F-xFTrTO6v.cjs → chunk-RYQCIY6F-DxECu9__.cjs} +1 -1
- package/dist/{chunk-V7JOEXUC-BvkxRSjK.cjs → chunk-V7JOEXUC-DgGwolBn.cjs} +1 -1
- package/dist/{chunk-V7JOEXUC-BnwuCkOT.js → chunk-V7JOEXUC-gEKuI7OI.js} +5 -5
- package/dist/{chunk-VR4S4FIN-DSW2sQDL.js → chunk-VR4S4FIN-8cM_PVeG.js} +3 -3
- package/dist/{chunk-VR4S4FIN-DAwCjhU3.cjs → chunk-VR4S4FIN-DKbaKheJ.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-B7vX1DJv.cjs → chunk-XXDRQBXY-CDD2QRgB.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-DrE4gFtL.js → chunk-XXDRQBXY-CN2bL4d4.js} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-BxIt89EK.cjs → classDiagram-OUVF2IWQ-DpgKwDbm.cjs} +1 -1
- package/dist/{classDiagram-v2-EOCWNBFH-DlER_wIi.js → classDiagram-OUVF2IWQ-_cymiFSf.js} +2 -2
- package/dist/{classDiagram-v2-EOCWNBFH-BxIt89EK.cjs → classDiagram-v2-EOCWNBFH-DpgKwDbm.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-DlER_wIi.js → classDiagram-v2-EOCWNBFH-_cymiFSf.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/components/MarkdownRenderer.d.ts +7 -2
- package/dist/components/MarkdownViewer.d.ts +17 -35
- package/dist/components/MermaidDiagram.d.ts +3 -0
- package/dist/components/NodesRenderer.d.ts +2 -1
- package/dist/components/TableOfContents.d.ts +14 -4
- package/dist/components/embeds.d.ts +30 -0
- package/dist/components/htmlSanitizer.d.ts +21 -0
- package/dist/components/labels.d.ts +12 -0
- package/dist/components/links.d.ts +18 -0
- package/dist/components/mdastNodes/HTMLBlockContainerNode.d.ts +3 -2
- package/dist/components/mdastNodes/HTMLNode.d.ts +1 -1
- package/dist/components/mdastNodes/TwitterEmbedNode.d.ts +3 -2
- package/dist/components/mdastNodes/YouTubeEmbedNode.d.ts +4 -2
- package/dist/components/mermaidInteraction.d.ts +1 -4
- package/dist/components/mermaidLabels.d.ts +19 -0
- package/dist/components/plugins/DifyIFramePlugin.d.ts +2 -6
- package/dist/components/plugins/IFramePluginRegistry.d.ts +6 -4
- package/dist/components/rawHtml.d.ts +13 -0
- package/dist/components/toolbarOverlap.d.ts +17 -0
- package/dist/components/viewerLabels.d.ts +31 -0
- package/dist/{cose-bilkent-JH36ORCC-BvnlFiZm.js → cose-bilkent-JH36ORCC-BYBqAjZw.js} +1 -1
- package/dist/{cose-bilkent-JH36ORCC-BzL-a0Zv.cjs → cose-bilkent-JH36ORCC-DnfyBXGg.cjs} +1 -1
- package/dist/css/details.css +7 -0
- package/dist/css/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/css/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/css/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/css/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/css/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/css/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/css/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/css/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/css/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/css/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/css/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/css/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/css/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/css/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/css/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/css/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/css/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/css/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/css/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/css/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/css/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/css/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/css/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/css/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/css/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/css/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/css/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/css/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/css/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/css/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/css/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/css/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/css/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/css/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/css/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/css/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/css/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/css/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/css/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/css/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/css/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/css/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/css/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/css/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/css/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/css/github-markdown.css +23 -0
- package/dist/css/katex.min.css +1 -1129
- package/dist/css/message.css +2 -0
- package/dist/css/zenn-content.css +14 -0
- package/dist/{cynefinDiagram-TSTJHNR4-CUwuCyMp.js → cynefinDiagram-TSTJHNR4-BWEOxUpI.js} +23 -23
- package/dist/{cynefinDiagram-TSTJHNR4-B1lNDIu_.cjs → cynefinDiagram-TSTJHNR4-C8EYsJAe.cjs} +1 -1
- package/dist/{dagre-VKFMJZFB-Ct0vbIs9.js → dagre-VKFMJZFB-D9yci9ce.js} +12 -12
- package/dist/{dagre-VKFMJZFB-COYURQTh.cjs → dagre-VKFMJZFB-Dzz7AfJC.cjs} +1 -1
- package/dist/{diagram-FQU43EPY-DkgdwwAT.cjs → diagram-FQU43EPY-B_jbLFxw.cjs} +1 -1
- package/dist/{diagram-FQU43EPY-B5HmiJPw.js → diagram-FQU43EPY-Byd0f28a.js} +2 -2
- package/dist/{diagram-G47NLZAW-CcXcBx81.cjs → diagram-G47NLZAW-BD7Qvt5F.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-C-nfBNGF.js → diagram-G47NLZAW-CzGLTuaI.js} +131 -131
- package/dist/{diagram-NH7WQ7WH-yu8B8Q4y.js → diagram-NH7WQ7WH-D6J_ePSr.js} +11 -11
- package/dist/{diagram-NH7WQ7WH-BMYzS0pm.cjs → diagram-NH7WQ7WH-DtE40O1y.cjs} +1 -1
- package/dist/{diagram-OA4YK3LP-CROsfore.js → diagram-OA4YK3LP-BRkpKDSL.js} +57 -57
- package/dist/{diagram-OA4YK3LP-DSeI6RLe.cjs → diagram-OA4YK3LP-BV_3h5ls.cjs} +1 -1
- package/dist/{diagram-WEI45ONY-CCJwQ42c.cjs → diagram-WEI45ONY-CMtm1y9S.cjs} +1 -1
- package/dist/{diagram-WEI45ONY-DmPpMglv.js → diagram-WEI45ONY-TZvlAD74.js} +11 -11
- package/dist/{ebnfDiagram-CCIWWBDH-B2ck9j39.js → ebnfDiagram-CCIWWBDH-CK7wZZmM.js} +5 -5
- package/dist/{ebnfDiagram-CCIWWBDH-D_nz1FvR.cjs → ebnfDiagram-CCIWWBDH-DgZ7GeJ2.cjs} +1 -1
- package/dist/{erDiagram-Q63AITRT-BfpyxqAV.js → erDiagram-Q63AITRT-ByF7VP5D.js} +4 -4
- package/dist/{erDiagram-Q63AITRT-2r-lfgSt.cjs → erDiagram-Q63AITRT-C4Tmp1ar.cjs} +1 -1
- package/dist/{extractHeadings-Dgzd324l.js → extractHeadings-CS-qqdgu.js} +6115 -5783
- package/dist/{extractHeadings-BrLI2qQF.cjs → extractHeadings-DZwpYYZa.cjs} +70 -70
- package/dist/flowDiagram-23GEKE2U-BPhnjQfA.cjs +1 -0
- package/dist/flowDiagram-23GEKE2U-UIracYlJ.js +7 -0
- package/dist/{ganttDiagram-NO4QXBWP-DR3YQ-Kd.js → ganttDiagram-NO4QXBWP-BxYBLrwg.js} +2 -2
- package/dist/{ganttDiagram-NO4QXBWP-CNhgpKSH.cjs → ganttDiagram-NO4QXBWP-CWaEb7A9.cjs} +1 -1
- package/dist/gen/markdown/v1/markdown_pb.d.ts +14 -0
- package/dist/{gitGraphDiagram-IHSO6WYX-D5IYosEF.cjs → gitGraphDiagram-IHSO6WYX-Bj41cd84.cjs} +1 -1
- package/dist/{gitGraphDiagram-IHSO6WYX-CzLNLS8W.js → gitGraphDiagram-IHSO6WYX-DinEtmt2.js} +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.client.cjs +1 -1
- package/dist/index.client.d.ts +5 -2
- package/dist/index.client.js +39 -35
- package/dist/index.js +39 -35
- package/dist/index.server.cjs +1 -1
- package/dist/index.server.d.ts +1 -1
- package/dist/index.server.js +258 -170
- package/dist/{infoDiagram-FWYZ7A6U-CBcx5GhE.js → infoDiagram-FWYZ7A6U-Cvu8wgVT.js} +1 -1
- package/dist/{infoDiagram-FWYZ7A6U-U2OiliOP.cjs → infoDiagram-FWYZ7A6U-D0pXl2DF.cjs} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-DK3M6wrz.cjs → ishikawaDiagram-FXEZZL3T-C4ywo5e2.cjs} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-CWXT_3xh.js → ishikawaDiagram-FXEZZL3T-a_OKoT7W.js} +20 -20
- package/dist/{journeyDiagram-5HDEW3XC-DRbAj2Yz.js → journeyDiagram-5HDEW3XC-BKYDr_AO.js} +4 -4
- package/dist/{journeyDiagram-5HDEW3XC-B-BfhPr4.cjs → journeyDiagram-5HDEW3XC-Bf5zZtzp.cjs} +1 -1
- package/dist/{kanban-definition-HUTT4EX6-BvnLv2HN.cjs → kanban-definition-HUTT4EX6-CRrw6nZl.cjs} +1 -1
- package/dist/{kanban-definition-HUTT4EX6-DtRSv2_P.js → kanban-definition-HUTT4EX6-uCk_xnx6.js} +34 -34
- package/dist/{linear-B9JMAP1U.cjs → linear-BNrZe-4B.cjs} +1 -1
- package/dist/{linear-HTaGrbQh.js → linear-RwkMjaFq.js} +12 -12
- package/dist/markdown.css +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-asDDR5DU.cjs → mindmap-definition-LN4V7U3C-CtNh9-A3.cjs} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-4cN-VjxO.js → mindmap-definition-LN4V7U3C-DLgc7_Ea.js} +20 -20
- package/dist/{pegDiagram-2B236MQR-cMLC3Ggy.js → pegDiagram-2B236MQR-BI08u62h.js} +5 -5
- package/dist/{pegDiagram-2B236MQR-C3qJlDiV.cjs → pegDiagram-2B236MQR-gjNvnRzE.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-D5-meW-_.cjs → pieDiagram-ENE6RG2P-C6mPk_9r.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-nk_3VO3x.js → pieDiagram-ENE6RG2P-CqqtfJsQ.js} +41 -41
- package/dist/{quadrantDiagram-ABIIQ3AL-Ctdfu4Qk.js → quadrantDiagram-ABIIQ3AL-BAudlbem.js} +2 -2
- package/dist/{quadrantDiagram-ABIIQ3AL-CmqrHJ4C.cjs → quadrantDiagram-ABIIQ3AL-k1wF3el0.cjs} +1 -1
- package/dist/{railroadDiagram-RFXS5EU6-2rLqmvj_.js → railroadDiagram-RFXS5EU6-BV-FtI-Y.js} +3 -3
- package/dist/{railroadDiagram-RFXS5EU6-a-pSoUg2.cjs → railroadDiagram-RFXS5EU6-qTQnd_2E.cjs} +1 -1
- package/dist/remarkProcessor.server.d.ts +11 -1
- package/dist/{requirementDiagram-TGXJPOKE-BlCu380H.js → requirementDiagram-TGXJPOKE-CSI9iBde.js} +3 -3
- package/dist/{requirementDiagram-TGXJPOKE-BaKLflmx.cjs → requirementDiagram-TGXJPOKE-DXxySydn.cjs} +1 -1
- package/dist/{sankeyDiagram-HTMAVEWB-6lNyI55x.js → sankeyDiagram-HTMAVEWB-BYAMj1wQ.js} +20 -20
- package/dist/{sankeyDiagram-HTMAVEWB-DuUzdIP0.cjs → sankeyDiagram-HTMAVEWB-DU5j0Hpe.cjs} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-sgwpzZWi.js → sequenceDiagram-DBY2YBRQ-BruqK1lr.js} +3 -3
- package/dist/{sequenceDiagram-DBY2YBRQ-B29fl34a.cjs → sequenceDiagram-DBY2YBRQ-Dbk1YO-l.cjs} +1 -1
- package/dist/{simple-logger-DIfMY3fH.js → simple-logger-i94ikRyH.js} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-DMDy-RCU.js → sizeCapture-X5ZJPWSS-BSn0u1_t.js} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-DAiqtb_j.cjs → sizeCapture-X5ZJPWSS-qz-hVWx4.cjs} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-DAN7ei1t.js → stateDiagram-2N3HPSRC-CKh5ZWdm.js} +9 -9
- package/dist/{stateDiagram-2N3HPSRC-BXIH2aOp.cjs → stateDiagram-2N3HPSRC-CtoTfzmG.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB--pCo5CzX.js → stateDiagram-v2-6OUMAXLB-BmILy7Yi.js} +2 -2
- package/dist/{stateDiagram-v2-6OUMAXLB-8XTokhrn.cjs → stateDiagram-v2-6OUMAXLB-D9tt3CyI.cjs} +1 -1
- package/dist/styles/markdown.css +1 -1
- package/dist/{swimlanes-5IMT3BWC-B-sXtUgS.js → swimlanes-5IMT3BWC-8aqGUD9B.js} +3 -3
- package/dist/{swimlanes-5IMT3BWC-BnT290KL.cjs → swimlanes-5IMT3BWC-CgWWlJUL.cjs} +1 -1
- package/dist/{swimlanesDiagram-G3AALYLV-CkxURj6O.js → swimlanesDiagram-G3AALYLV-0sUz7qWx.js} +2 -2
- package/dist/{swimlanesDiagram-G3AALYLV-CAEjADeH.cjs → swimlanesDiagram-G3AALYLV-BQL_l0K6.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-Dqdftl5b.cjs → timeline-definition-FHXFAJF6-CnMWGedg.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-D47CoBOm.js → timeline-definition-FHXFAJF6-Cps3CVTR.js} +34 -34
- package/dist/{vennDiagram-L72KCM5P-DzcOxkzh.js → vennDiagram-L72KCM5P-C3u6VbZv.js} +55 -55
- package/dist/{vennDiagram-L72KCM5P-BxjgXNwH.cjs → vennDiagram-L72KCM5P-Duki5CI_.cjs} +1 -1
- package/dist/viewer-settings.cjs +1 -0
- package/dist/viewer-settings.d.ts +9 -0
- package/dist/viewer-settings.js +7 -0
- package/dist/{wardleyDiagram-EHGQE667-tZJBiyrP.js → wardleyDiagram-EHGQE667-CKNXRrYV.js} +27 -27
- package/dist/{wardleyDiagram-EHGQE667-CurWRCjn.cjs → wardleyDiagram-EHGQE667-DiefhIvI.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-D0ltrZo8.cjs → xychartDiagram-FW5EYKEG-DGB2SKXi.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-DRQ_o9WV.js → xychartDiagram-FW5EYKEG-lymeWtXL.js} +23 -23
- package/package.json +18 -12
- package/dist/flowDiagram-23GEKE2U-D3w55eDA.cjs +0 -1
- package/dist/flowDiagram-23GEKE2U-LZTzy0Rx.js +0 -7
package/dist/index.server.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("cheerio"),B=require("./simple-logger-DZxBpX7v.cjs"),C=require("unist-util-visit"),H=require("node:child_process"),k=require("node:fs"),D=require("node:module"),j=require("node:net"),F=require("node:path"),U=require("node:url"),T=require("@connectrpc/connect"),N=require("@connectrpc/connect-node"),s=require("@bufbuild/protobuf");var v=typeof document<"u"?document.currentScript:null;function R(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const q=R(j),M=R(F),A=async r=>{try{const e=new AbortController,t=setTimeout(()=>e.abort(),1e4),i=await fetch(r,{signal:e.signal});if(clearTimeout(t),!i.ok)return null;const o=await i.text(),n={url:r},c=$.load(o),a=c("title").text().trim();n.title=a;const h=c("meta");for(const l of h){const w=l.attribs.property;w==="og:site_name"&&(n.site_name=l.attribs.content||void 0),w==="og:title"&&(n.title=l.attribs.content||a),w==="og:description"&&(n.description=l.attribs.content||void 0),w==="og:image"&&(n.image=l.attribs.content||void 0),w==="og:type"&&(n.type=l.attribs.content||void 0),l.attribs.name==="description"&&(n.description=l.attribs.content||void 0)}return n}catch(e){return B.Logger.error("Error fetching site metadata:",e),null}},b=new Map,K=(r,e)=>e.fetchAll?!0:e.urlPatterns&&e.urlPatterns.length>0?e.urlPatterns.some(t=>t.test(r)):/^https?:\/\//.test(r)&&!r.includes("localhost")&&!r.includes("127.0.0.1"),Y=(r={})=>{const{enableCache:e=!0}=r;return async t=>{const i=[];C.visit(t,"block-link",n=>{K(n.url,r)&&i.push(n)});const o=i.map(async n=>{const c=n.url;if(e&&b.has(c)){const a=b.get(c);a&&(n.data=n.data||{},n.data.siteMetadata=a);return}try{const a=await A(c);a?(n.data=n.data||{},n.data.siteMetadata=a,e&&b.set(c,a)):e&&b.set(c,null)}catch(a){B.Logger.warn(`Failed to fetch metadata for ${c}:`,a),e&&b.set(c,null)}});await Promise.all(o)}};class u extends s.Message{markdownText="";filePath="";workspaceRoot="";validateExistence=!1;enableSubscript;enableSuperscript;enableMark;enableTableMerge;enableEmbeds;enableZennDirectives;resolveImports=!1;maxHtmlBytes;deny;constructor(e){super(),s.proto3.util.initPartial(e,this)}static runtime=s.proto3;static typeName="markdown.v1.ConvertRequest";static fields=s.proto3.util.newFieldList(()=>[{no:1,name:"markdown_text",kind:"scalar",T:9},{no:2,name:"file_path",kind:"scalar",T:9},{no:3,name:"workspace_root",kind:"scalar",T:9},{no:4,name:"validate_existence",kind:"scalar",T:8},{no:5,name:"enable_subscript",kind:"scalar",T:8,opt:!0},{no:6,name:"enable_superscript",kind:"scalar",T:8,opt:!0},{no:7,name:"enable_mark",kind:"scalar",T:8,opt:!0},{no:8,name:"enable_table_merge",kind:"scalar",T:8,opt:!0},{no:9,name:"enable_embeds",kind:"scalar",T:8,opt:!0},{no:10,name:"enable_zenn_directives",kind:"scalar",T:8,opt:!0},{no:11,name:"resolve_imports",kind:"scalar",T:8},{no:12,name:"max_html_bytes",kind:"scalar",T:13,opt:!0},{no:13,name:"deny",kind:"message",T:m}]);static fromBinary(e,t){return new u().fromBinary(e,t)}static fromJson(e,t){return new u().fromJson(e,t)}static fromJsonString(e,t){return new u().fromJsonString(e,t)}static equals(e,t){return s.proto3.util.equals(u,e,t)}}class m extends s.Message{segmentPatterns=[];constructor(e){super(),s.proto3.util.initPartial(e,this)}static runtime=s.proto3;static typeName="markdown.v1.DenyRules";static fields=s.proto3.util.newFieldList(()=>[{no:1,name:"segment_patterns",kind:"scalar",T:9,repeated:!0}]);static fromBinary(e,t){return new m().fromBinary(e,t)}static fromJson(e,t){return new m().fromJson(e,t)}static fromJsonString(e,t){return new m().fromJsonString(e,t)}static equals(e,t){return s.proto3.util.equals(m,e,t)}}class d extends s.Message{htmlContent="";headings=[];constructor(e){super(),s.proto3.util.initPartial(e,this)}static runtime=s.proto3;static typeName="markdown.v1.ConvertResponse";static fields=s.proto3.util.newFieldList(()=>[{no:1,name:"html_content",kind:"scalar",T:9},{no:2,name:"headings",kind:"message",T:p,repeated:!0}]);static fromBinary(e,t){return new d().fromBinary(e,t)}static fromJson(e,t){return new d().fromJson(e,t)}static fromJsonString(e,t){return new d().fromJsonString(e,t)}static equals(e,t){return s.proto3.util.equals(d,e,t)}}class p extends s.Message{text="";depth=0;id="";constructor(e){super(),s.proto3.util.initPartial(e,this)}static runtime=s.proto3;static typeName="markdown.v1.Heading";static fields=s.proto3.util.newFieldList(()=>[{no:1,name:"text",kind:"scalar",T:9},{no:2,name:"depth",kind:"scalar",T:5},{no:3,name:"id",kind:"scalar",T:9}]);static fromBinary(e,t){return new p().fromBinary(e,t)}static fromJson(e,t){return new p().fromJson(e,t)}static fromJsonString(e,t){return new p().fromJsonString(e,t)}static equals(e,t){return s.proto3.util.equals(p,e,t)}}const G={typeName:"markdown.v1.MarkdownService",methods:{convert:{name:"Convert",I:u,O:d,kind:s.MethodKind.Unary}}},f=process.env.MARKDOWN_SOCKET_PATH||"/tmp/markdown.sock",W=new N.Http2SessionManager("http://localhost",void 0,{createConnection:()=>q.connect(f)}),I=64*1024,X=4294967295,x=Math.floor((X-I)/2);class L extends Error{constructor(e){super(e.rawMessage,{cause:e}),this.name="MarkdownResourceExhaustedError"}}const _=()=>{try{return M.dirname(U.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:v&&v.tagName.toUpperCase()==="SCRIPT"&&v.src||new URL("index.server.cjs",document.baseURI).href))}catch{return __dirname}},O=()=>`@aiquants/markdown-${process.platform}-${process.arch}`,E=()=>process.platform==="win32"?"bin/markdown-api.exe":"bin/markdown-api",z=()=>{const r=process.env.MARKDOWN_API_BINARY;if(r&&k.existsSync(r))return r;try{const t=D.createRequire(M.join(_(),"index.js")).resolve(`${O()}/${E()}`);if(k.existsSync(t))return t}catch{}const e=M.join(_(),"..","..","go","markdown-api","dist",M.basename(E()));return k.existsSync(e)?e:void 0},V=()=>[`markdown-api binary not found for ${process.platform}-${process.arch}.`,`Expected the optional dependency ${O()} to be installed.`,"If your platform is unsupported, build the service yourself","(https://github.com/fehde-k/aiquants/tree/main/packages/go/markdown-api)","and point MARKDOWN_API_BINARY at it."].join(" "),J=()=>new Promise(r=>{const e=q.connect(f);e.on("connect",()=>{e.destroy(),r(!0)}),e.on("error",()=>r(!1))}),P=async r=>{const e=Date.now();for(;Date.now()-e<r;){if(await J())return!0;await new Promise(t=>setTimeout(t,100))}return!1};let g=null,y=null;const Z=2e3,Q=()=>{const r=Number(process.env.MARKDOWN_API_STARTUP_TIMEOUT_MS);return Number.isFinite(r)&&r>0?r:1e4};let S=null;const ee=async()=>{if(await J())return!0;if(y)return y;y=(async()=>{const e=z();if(!e)return await P(Z)?!0:(S=V(),!1);S=null;try{k.existsSync(f)&&k.unlinkSync(f)}catch{}try{g=H.spawn(e,[],{stdio:"ignore"});const t=()=>{if(g){try{g.kill("SIGTERM")}catch{}g=null}};return process.once("exit",t),await P(Q())?!0:(console.error("markdown-api Go server did not become ready on socket:",f),t(),process.removeListener("exit",t),!1)}catch(t){return console.error("Failed to spawn markdown-api Go server:",t),g=null,!1}})();const r=await y;return r||(y=null),r},te=r=>{if(!Array.isArray(r.deniedPathSegments))throw new TypeError("parseMarkdown: deniedPathSegments must be an array of path segment patterns (an empty array denies nothing)");if(!Number.isSafeInteger(r.maxHtmlBytes)||r.maxHtmlBytes<=0||r.maxHtmlBytes>x)throw new RangeError(`parseMarkdown: maxHtmlBytes must be an integer from 1 to ${x}, got ${r.maxHtmlBytes}`);if(r.timeoutMs!==void 0&&(!Number.isSafeInteger(r.timeoutMs)||r.timeoutMs<=0))throw new RangeError(`parseMarkdown: timeoutMs must be a positive integer, got ${r.timeoutMs}`)},re=async(r,e,t,i,o)=>{if(te(o),!await ee()){const a=S?` ${S}`:"";throw new Error(`markdown service is not reachable on ${f}.${a}`)}const n={};i&&(n.Authorization=`Bearer ${i}`);const c=T.createClient(G,N.createConnectTransport({baseUrl:"http://localhost",httpVersion:"2",sessionManager:W,readMaxBytes:2*o.maxHtmlBytes+I}));try{const a=await c.convert({markdownText:r,filePath:e,workspaceRoot:t,validateExistence:o.validateExistence??!0,enableSubscript:o.enableSubscript,enableSuperscript:o.enableSuperscript,enableMark:o.enableMark,enableTableMerge:o.enableTableMerge,enableEmbeds:o.enableEmbeds,enableZennDirectives:o.enableZennDirectives,resolveImports:o.resolveImports??!1,maxHtmlBytes:o.maxHtmlBytes,deny:new m({segmentPatterns:[...o.deniedPathSegments]})},{headers:n,signal:o.signal,timeoutMs:o.timeoutMs});return{htmlContent:a.htmlContent,headings:a.headings.map(h=>({text:h.text,depth:h.depth,id:h.id}))}}catch(a){throw a instanceof T.ConnectError&&a.code===T.Code.ResourceExhausted?new L(a):a}};exports.MAX_HTML_BYTES_LIMIT=x;exports.MarkdownResourceExhaustedError=L;exports.fetchSiteMetadata=A;exports.parseMarkdown=re;exports.remarkBlockLinkMetadata=Y;
|
package/dist/index.server.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { fetchSiteMetadata, type SiteMetadata } from "./plugins/fetchSiteMetadata.ts";
|
|
2
2
|
export { remarkBlockLinkMetadata } from "./plugins/remark-block-link-metadata.ts";
|
|
3
|
-
export { type ParseOptions, type ParseResult, parseMarkdown } from "./remarkProcessor.server.ts";
|
|
3
|
+
export { MAX_HTML_BYTES_LIMIT, MarkdownResourceExhaustedError, type ParseOptions, type ParseResult, parseMarkdown } from "./remarkProcessor.server.ts";
|
package/dist/index.server.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { load as
|
|
2
|
-
import { L as
|
|
3
|
-
import { visit as
|
|
4
|
-
import { spawn as
|
|
5
|
-
import { existsSync as
|
|
6
|
-
import { createRequire as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import { fileURLToPath as
|
|
10
|
-
import { createClient as q } from "@connectrpc/connect";
|
|
11
|
-
import { createConnectTransport as K } from "@connectrpc/connect-node";
|
|
12
|
-
import { Message as
|
|
13
|
-
const
|
|
1
|
+
import { load as I } from "cheerio";
|
|
2
|
+
import { L as B } from "./simple-logger-i94ikRyH.js";
|
|
3
|
+
import { visit as J } from "unist-util-visit";
|
|
4
|
+
import { spawn as $ } from "node:child_process";
|
|
5
|
+
import { existsSync as k, unlinkSync as C } from "node:fs";
|
|
6
|
+
import { createRequire as H } from "node:module";
|
|
7
|
+
import * as _ from "node:net";
|
|
8
|
+
import * as M from "node:path";
|
|
9
|
+
import { fileURLToPath as L } from "node:url";
|
|
10
|
+
import { createClient as O, ConnectError as q, Code as D } from "@connectrpc/connect";
|
|
11
|
+
import { Http2SessionManager as F, createConnectTransport as K } from "@connectrpc/connect-node";
|
|
12
|
+
import { Message as S, proto3 as o, MethodKind as U } from "@bufbuild/protobuf";
|
|
13
|
+
const Y = async (r) => {
|
|
14
14
|
try {
|
|
15
|
-
const
|
|
16
|
-
if (clearTimeout(
|
|
15
|
+
const e = new AbortController(), t = setTimeout(() => e.abort(), 1e4), c = await fetch(r, { signal: e.signal });
|
|
16
|
+
if (clearTimeout(t), !c.ok)
|
|
17
17
|
return null;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
for (const
|
|
22
|
-
const
|
|
23
|
-
|
|
18
|
+
const s = await c.text(), a = { url: r }, i = I(s), n = i("title").text().trim();
|
|
19
|
+
a.title = n;
|
|
20
|
+
const w = i("meta");
|
|
21
|
+
for (const m of w) {
|
|
22
|
+
const h = m.attribs.property;
|
|
23
|
+
h === "og:site_name" && (a.site_name = m.attribs.content || void 0), h === "og:title" && (a.title = m.attribs.content || n), h === "og:description" && (a.description = m.attribs.content || void 0), h === "og:image" && (a.image = m.attribs.content || void 0), h === "og:type" && (a.type = m.attribs.content || void 0), m.attribs.name === "description" && (a.description = m.attribs.content || void 0);
|
|
24
24
|
}
|
|
25
|
-
return
|
|
26
|
-
} catch (
|
|
27
|
-
return
|
|
25
|
+
return a;
|
|
26
|
+
} catch (e) {
|
|
27
|
+
return B.error("Error fetching site metadata:", e), null;
|
|
28
28
|
}
|
|
29
|
-
},
|
|
30
|
-
const { enableCache:
|
|
31
|
-
return async (
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
}, b = /* @__PURE__ */ new Map(), j = (r, e) => e.fetchAll ? !0 : e.urlPatterns && e.urlPatterns.length > 0 ? e.urlPatterns.some((t) => t.test(r)) : /^https?:\/\//.test(r) && !r.includes("localhost") && !r.includes("127.0.0.1"), pe = (r = {}) => {
|
|
30
|
+
const { enableCache: e = !0 } = r;
|
|
31
|
+
return async (t) => {
|
|
32
|
+
const c = [];
|
|
33
|
+
J(t, "block-link", (a) => {
|
|
34
|
+
j(a.url, r) && c.push(a);
|
|
35
35
|
});
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
|
|
36
|
+
const s = c.map(async (a) => {
|
|
37
|
+
const i = a.url;
|
|
38
|
+
if (e && b.has(i)) {
|
|
39
|
+
const n = b.get(i);
|
|
40
|
+
n && (a.data = a.data || {}, a.data.siteMetadata = n);
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
43
|
try {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
} catch (
|
|
47
|
-
|
|
44
|
+
const n = await Y(i);
|
|
45
|
+
n ? (a.data = a.data || {}, a.data.siteMetadata = n, e && b.set(i, n)) : e && b.set(i, null);
|
|
46
|
+
} catch (n) {
|
|
47
|
+
B.warn(`Failed to fetch metadata for ${i}:`, n), e && b.set(i, null);
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
await Promise.all(
|
|
50
|
+
await Promise.all(s);
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
class
|
|
53
|
+
class d extends S {
|
|
54
54
|
/**
|
|
55
55
|
* @generated from field: string markdown_text = 1;
|
|
56
56
|
*/
|
|
@@ -82,10 +82,12 @@ class u extends v {
|
|
|
82
82
|
* Enables existence validation for locally resolvable image and doc-link
|
|
83
83
|
* targets. When true, a missing local image loses its src and gains
|
|
84
84
|
* `data-asset-exists="false"` plus `data-asset-src` (the workspace-relative
|
|
85
|
-
* target,
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
85
|
+
* target), and local doc links gain `data-doc-exists`. A target refused by
|
|
86
|
+
* `deny` or outside `workspace_root` is never probed: it is marked exactly
|
|
87
|
+
* like a missing one, without `data-asset-src`, whether or not it exists.
|
|
88
|
+
* When false, no existence markers are emitted and no existence probes run.
|
|
89
|
+
* Cloud-scheme (gcs/gdrive) targets are rewritten to signed/proxy URLs
|
|
90
|
+
* without existence validation in either mode.
|
|
89
91
|
*
|
|
90
92
|
* @generated from field: bool validate_existence = 4;
|
|
91
93
|
*/
|
|
@@ -114,12 +116,42 @@ class u extends v {
|
|
|
114
116
|
* @generated from field: optional bool enable_zenn_directives = 10;
|
|
115
117
|
*/
|
|
116
118
|
enableZennDirectives;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Expands `<!-- @import "path" -->` directives before conversion. False by
|
|
121
|
+
* default: a directive then stays an HTML comment and nothing is read. When
|
|
122
|
+
* true, a target is read only when it is a Markdown file (its name ends in
|
|
123
|
+
* `.md` in any letter case, also once symbolic links are resolved) and
|
|
124
|
+
* `deny` admits it, nested imports included; a refused target fails the
|
|
125
|
+
* conversion with PERMISSION_DENIED. The document with every import expanded
|
|
126
|
+
* is held to the server's source limit (RESOURCE_EXHAUSTED past it).
|
|
127
|
+
*
|
|
128
|
+
* @generated from field: bool resolve_imports = 11;
|
|
129
|
+
*/
|
|
130
|
+
resolveImports = !1;
|
|
131
|
+
/**
|
|
132
|
+
* The largest HTML the conversion may produce, in bytes, before and after
|
|
133
|
+
* post-processing. Must be positive when set (INVALID_ARGUMENT otherwise).
|
|
134
|
+
* The server's own limit applies as well; the smaller one wins. A conversion
|
|
135
|
+
* that would exceed it stops while rendering and fails with
|
|
136
|
+
* RESOURCE_EXHAUSTED.
|
|
137
|
+
*
|
|
138
|
+
* @generated from field: optional uint32 max_html_bytes = 12;
|
|
139
|
+
*/
|
|
140
|
+
maxHtmlBytes;
|
|
141
|
+
/**
|
|
142
|
+
* Deny rules applied to every target the conversion resolves: imports,
|
|
143
|
+
* images and links. Required (INVALID_ARGUMENT when unset); an empty pattern
|
|
144
|
+
* list denies nothing.
|
|
145
|
+
*
|
|
146
|
+
* @generated from field: markdown.v1.DenyRules deny = 13;
|
|
147
|
+
*/
|
|
148
|
+
deny;
|
|
149
|
+
constructor(e) {
|
|
150
|
+
super(), o.util.initPartial(e, this);
|
|
119
151
|
}
|
|
120
|
-
static runtime =
|
|
152
|
+
static runtime = o;
|
|
121
153
|
static typeName = "markdown.v1.ConvertRequest";
|
|
122
|
-
static fields =
|
|
154
|
+
static fields = o.util.newFieldList(() => [
|
|
123
155
|
{
|
|
124
156
|
no: 1,
|
|
125
157
|
name: "markdown_text",
|
|
@@ -153,22 +185,55 @@ class u extends v {
|
|
|
153
185
|
{ no: 7, name: "enable_mark", kind: "scalar", T: 8, opt: !0 },
|
|
154
186
|
{ no: 8, name: "enable_table_merge", kind: "scalar", T: 8, opt: !0 },
|
|
155
187
|
{ no: 9, name: "enable_embeds", kind: "scalar", T: 8, opt: !0 },
|
|
156
|
-
{ no: 10, name: "enable_zenn_directives", kind: "scalar", T: 8, opt: !0 }
|
|
188
|
+
{ no: 10, name: "enable_zenn_directives", kind: "scalar", T: 8, opt: !0 },
|
|
189
|
+
{
|
|
190
|
+
no: 11,
|
|
191
|
+
name: "resolve_imports",
|
|
192
|
+
kind: "scalar",
|
|
193
|
+
T: 8
|
|
194
|
+
/* ScalarType.BOOL */
|
|
195
|
+
},
|
|
196
|
+
{ no: 12, name: "max_html_bytes", kind: "scalar", T: 13, opt: !0 },
|
|
197
|
+
{ no: 13, name: "deny", kind: "message", T: l }
|
|
157
198
|
]);
|
|
158
|
-
static fromBinary(
|
|
159
|
-
return new
|
|
199
|
+
static fromBinary(e, t) {
|
|
200
|
+
return new d().fromBinary(e, t);
|
|
160
201
|
}
|
|
161
|
-
static fromJson(
|
|
162
|
-
return new
|
|
202
|
+
static fromJson(e, t) {
|
|
203
|
+
return new d().fromJson(e, t);
|
|
163
204
|
}
|
|
164
|
-
static fromJsonString(
|
|
165
|
-
return new
|
|
205
|
+
static fromJsonString(e, t) {
|
|
206
|
+
return new d().fromJsonString(e, t);
|
|
166
207
|
}
|
|
167
|
-
static equals(
|
|
168
|
-
return
|
|
208
|
+
static equals(e, t) {
|
|
209
|
+
return o.util.equals(d, e, t);
|
|
169
210
|
}
|
|
170
211
|
}
|
|
171
|
-
class
|
|
212
|
+
class l extends S {
|
|
213
|
+
/**
|
|
214
|
+
* @generated from field: repeated string segment_patterns = 1;
|
|
215
|
+
*/
|
|
216
|
+
segmentPatterns = [];
|
|
217
|
+
constructor(e) {
|
|
218
|
+
super(), o.util.initPartial(e, this);
|
|
219
|
+
}
|
|
220
|
+
static runtime = o;
|
|
221
|
+
static typeName = "markdown.v1.DenyRules";
|
|
222
|
+
static fields = o.util.newFieldList(() => [{ no: 1, name: "segment_patterns", kind: "scalar", T: 9, repeated: !0 }]);
|
|
223
|
+
static fromBinary(e, t) {
|
|
224
|
+
return new l().fromBinary(e, t);
|
|
225
|
+
}
|
|
226
|
+
static fromJson(e, t) {
|
|
227
|
+
return new l().fromJson(e, t);
|
|
228
|
+
}
|
|
229
|
+
static fromJsonString(e, t) {
|
|
230
|
+
return new l().fromJsonString(e, t);
|
|
231
|
+
}
|
|
232
|
+
static equals(e, t) {
|
|
233
|
+
return o.util.equals(l, e, t);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
class u extends S {
|
|
172
237
|
/**
|
|
173
238
|
* @generated from field: string html_content = 1;
|
|
174
239
|
*/
|
|
@@ -177,12 +242,12 @@ class d extends v {
|
|
|
177
242
|
* @generated from field: repeated markdown.v1.Heading headings = 2;
|
|
178
243
|
*/
|
|
179
244
|
headings = [];
|
|
180
|
-
constructor(
|
|
181
|
-
super(),
|
|
245
|
+
constructor(e) {
|
|
246
|
+
super(), o.util.initPartial(e, this);
|
|
182
247
|
}
|
|
183
|
-
static runtime =
|
|
248
|
+
static runtime = o;
|
|
184
249
|
static typeName = "markdown.v1.ConvertResponse";
|
|
185
|
-
static fields =
|
|
250
|
+
static fields = o.util.newFieldList(() => [
|
|
186
251
|
{
|
|
187
252
|
no: 1,
|
|
188
253
|
name: "html_content",
|
|
@@ -192,20 +257,20 @@ class d extends v {
|
|
|
192
257
|
},
|
|
193
258
|
{ no: 2, name: "headings", kind: "message", T: f, repeated: !0 }
|
|
194
259
|
]);
|
|
195
|
-
static fromBinary(
|
|
196
|
-
return new
|
|
260
|
+
static fromBinary(e, t) {
|
|
261
|
+
return new u().fromBinary(e, t);
|
|
197
262
|
}
|
|
198
|
-
static fromJson(
|
|
199
|
-
return new
|
|
263
|
+
static fromJson(e, t) {
|
|
264
|
+
return new u().fromJson(e, t);
|
|
200
265
|
}
|
|
201
|
-
static fromJsonString(
|
|
202
|
-
return new
|
|
266
|
+
static fromJsonString(e, t) {
|
|
267
|
+
return new u().fromJsonString(e, t);
|
|
203
268
|
}
|
|
204
|
-
static equals(
|
|
205
|
-
return
|
|
269
|
+
static equals(e, t) {
|
|
270
|
+
return o.util.equals(u, e, t);
|
|
206
271
|
}
|
|
207
272
|
}
|
|
208
|
-
class f extends
|
|
273
|
+
class f extends S {
|
|
209
274
|
/**
|
|
210
275
|
* @generated from field: string text = 1;
|
|
211
276
|
*/
|
|
@@ -218,12 +283,12 @@ class f extends v {
|
|
|
218
283
|
* @generated from field: string id = 3;
|
|
219
284
|
*/
|
|
220
285
|
id = "";
|
|
221
|
-
constructor(
|
|
222
|
-
super(),
|
|
286
|
+
constructor(e) {
|
|
287
|
+
super(), o.util.initPartial(e, this);
|
|
223
288
|
}
|
|
224
|
-
static runtime =
|
|
289
|
+
static runtime = o;
|
|
225
290
|
static typeName = "markdown.v1.Heading";
|
|
226
|
-
static fields =
|
|
291
|
+
static fields = o.util.newFieldList(() => [
|
|
227
292
|
{
|
|
228
293
|
no: 1,
|
|
229
294
|
name: "text",
|
|
@@ -246,20 +311,20 @@ class f extends v {
|
|
|
246
311
|
/* ScalarType.STRING */
|
|
247
312
|
}
|
|
248
313
|
]);
|
|
249
|
-
static fromBinary(
|
|
250
|
-
return new f().fromBinary(
|
|
314
|
+
static fromBinary(e, t) {
|
|
315
|
+
return new f().fromBinary(e, t);
|
|
251
316
|
}
|
|
252
|
-
static fromJson(
|
|
253
|
-
return new f().fromJson(
|
|
317
|
+
static fromJson(e, t) {
|
|
318
|
+
return new f().fromJson(e, t);
|
|
254
319
|
}
|
|
255
|
-
static fromJsonString(
|
|
256
|
-
return new f().fromJsonString(
|
|
320
|
+
static fromJsonString(e, t) {
|
|
321
|
+
return new f().fromJsonString(e, t);
|
|
257
322
|
}
|
|
258
|
-
static equals(
|
|
259
|
-
return
|
|
323
|
+
static equals(e, t) {
|
|
324
|
+
return o.util.equals(f, e, t);
|
|
260
325
|
}
|
|
261
326
|
}
|
|
262
|
-
const
|
|
327
|
+
const G = {
|
|
263
328
|
typeName: "markdown.v1.MarkdownService",
|
|
264
329
|
methods: {
|
|
265
330
|
/**
|
|
@@ -267,125 +332,148 @@ const W = {
|
|
|
267
332
|
*/
|
|
268
333
|
convert: {
|
|
269
334
|
name: "Convert",
|
|
270
|
-
I:
|
|
271
|
-
O:
|
|
272
|
-
kind:
|
|
335
|
+
I: d,
|
|
336
|
+
O: u,
|
|
337
|
+
kind: U.Unary
|
|
273
338
|
}
|
|
274
339
|
}
|
|
275
|
-
}, p = process.env.MARKDOWN_SOCKET_PATH || "/tmp/markdown.sock",
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
340
|
+
}, p = process.env.MARKDOWN_SOCKET_PATH || "/tmp/markdown.sock", W = new F("http://localhost", void 0, {
|
|
341
|
+
createConnection: () => _.connect(p)
|
|
342
|
+
}), N = 64 * 1024, X = 4294967295, v = Math.floor((X - N) / 2);
|
|
343
|
+
class Z extends Error {
|
|
344
|
+
/**
|
|
345
|
+
* Wraps the service's or the transport's resource-exhausted error.
|
|
346
|
+
* サービスか転送の resource exhausted のエラーを包む処理。
|
|
347
|
+
*
|
|
348
|
+
* @param cause - The connect error. connect のエラー。
|
|
349
|
+
*/
|
|
350
|
+
constructor(e) {
|
|
351
|
+
super(e.rawMessage, { cause: e }), this.name = "MarkdownResourceExhaustedError";
|
|
280
352
|
}
|
|
281
|
-
}
|
|
353
|
+
}
|
|
354
|
+
const x = () => {
|
|
282
355
|
try {
|
|
283
|
-
return
|
|
356
|
+
return M.dirname(L(import.meta.url));
|
|
284
357
|
} catch {
|
|
285
358
|
return __dirname;
|
|
286
359
|
}
|
|
287
|
-
},
|
|
360
|
+
}, A = () => `@aiquants/markdown-${process.platform}-${process.arch}`, E = () => process.platform === "win32" ? "bin/markdown-api.exe" : "bin/markdown-api", z = () => {
|
|
288
361
|
const r = process.env.MARKDOWN_API_BINARY;
|
|
289
|
-
if (r &&
|
|
362
|
+
if (r && k(r))
|
|
290
363
|
return r;
|
|
291
364
|
try {
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
return
|
|
365
|
+
const t = H(M.join(x(), "index.js")).resolve(`${A()}/${E()}`);
|
|
366
|
+
if (k(t))
|
|
367
|
+
return t;
|
|
295
368
|
} catch {
|
|
296
369
|
}
|
|
297
|
-
const
|
|
298
|
-
return
|
|
299
|
-
},
|
|
370
|
+
const e = M.join(x(), "..", "..", "go", "markdown-api", "dist", M.basename(E()));
|
|
371
|
+
return k(e) ? e : void 0;
|
|
372
|
+
}, V = () => [
|
|
300
373
|
`markdown-api binary not found for ${process.platform}-${process.arch}.`,
|
|
301
|
-
`Expected the optional dependency ${
|
|
374
|
+
`Expected the optional dependency ${A()} to be installed.`,
|
|
302
375
|
"If your platform is unsupported, build the service yourself",
|
|
303
376
|
"(https://github.com/fehde-k/aiquants/tree/main/packages/go/markdown-api)",
|
|
304
377
|
"and point MARKDOWN_API_BINARY at it."
|
|
305
|
-
].join(" "),
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}),
|
|
310
|
-
}),
|
|
311
|
-
const
|
|
312
|
-
for (; Date.now() -
|
|
313
|
-
if (await
|
|
314
|
-
await new Promise((
|
|
378
|
+
].join(" "), R = () => new Promise((r) => {
|
|
379
|
+
const e = _.connect(p);
|
|
380
|
+
e.on("connect", () => {
|
|
381
|
+
e.destroy(), r(!0);
|
|
382
|
+
}), e.on("error", () => r(!1));
|
|
383
|
+
}), P = async (r) => {
|
|
384
|
+
const e = Date.now();
|
|
385
|
+
for (; Date.now() - e < r; ) {
|
|
386
|
+
if (await R()) return !0;
|
|
387
|
+
await new Promise((t) => setTimeout(t, 100));
|
|
315
388
|
}
|
|
316
389
|
return !1;
|
|
317
390
|
};
|
|
318
|
-
let
|
|
319
|
-
const
|
|
391
|
+
let y = null, g = null;
|
|
392
|
+
const Q = 2e3, ee = () => {
|
|
320
393
|
const r = Number(process.env.MARKDOWN_API_STARTUP_TIMEOUT_MS);
|
|
321
394
|
return Number.isFinite(r) && r > 0 ? r : 1e4;
|
|
322
395
|
};
|
|
323
|
-
let
|
|
324
|
-
const
|
|
325
|
-
if (await
|
|
326
|
-
if (
|
|
327
|
-
|
|
328
|
-
const
|
|
329
|
-
if (!
|
|
330
|
-
return await
|
|
331
|
-
|
|
396
|
+
let T = null;
|
|
397
|
+
const te = async () => {
|
|
398
|
+
if (await R()) return !0;
|
|
399
|
+
if (g) return g;
|
|
400
|
+
g = (async () => {
|
|
401
|
+
const e = z();
|
|
402
|
+
if (!e)
|
|
403
|
+
return await P(Q) ? !0 : (T = V(), !1);
|
|
404
|
+
T = null;
|
|
332
405
|
try {
|
|
333
|
-
|
|
406
|
+
k(p) && C(p);
|
|
334
407
|
} catch {
|
|
335
408
|
}
|
|
336
409
|
try {
|
|
337
|
-
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
410
|
+
y = $(e, [], { stdio: "ignore" });
|
|
411
|
+
const t = () => {
|
|
412
|
+
if (y) {
|
|
340
413
|
try {
|
|
341
|
-
|
|
414
|
+
y.kill("SIGTERM");
|
|
342
415
|
} catch {
|
|
343
416
|
}
|
|
344
|
-
|
|
417
|
+
y = null;
|
|
345
418
|
}
|
|
346
419
|
};
|
|
347
|
-
return process.once("exit",
|
|
348
|
-
} catch (
|
|
349
|
-
return console.error("Failed to spawn markdown-api Go server:",
|
|
420
|
+
return process.once("exit", t), await P(ee()) ? !0 : (console.error("markdown-api Go server did not become ready on socket:", p), t(), process.removeListener("exit", t), !1);
|
|
421
|
+
} catch (t) {
|
|
422
|
+
return console.error("Failed to spawn markdown-api Go server:", t), y = null, !1;
|
|
350
423
|
}
|
|
351
424
|
})();
|
|
352
|
-
const r = await
|
|
353
|
-
return r || (
|
|
354
|
-
},
|
|
355
|
-
if (!
|
|
356
|
-
|
|
357
|
-
|
|
425
|
+
const r = await g;
|
|
426
|
+
return r || (g = null), r;
|
|
427
|
+
}, re = (r) => {
|
|
428
|
+
if (!Array.isArray(r.deniedPathSegments))
|
|
429
|
+
throw new TypeError("parseMarkdown: deniedPathSegments must be an array of path segment patterns (an empty array denies nothing)");
|
|
430
|
+
if (!Number.isSafeInteger(r.maxHtmlBytes) || r.maxHtmlBytes <= 0 || r.maxHtmlBytes > v)
|
|
431
|
+
throw new RangeError(`parseMarkdown: maxHtmlBytes must be an integer from 1 to ${v}, got ${r.maxHtmlBytes}`);
|
|
432
|
+
if (r.timeoutMs !== void 0 && (!Number.isSafeInteger(r.timeoutMs) || r.timeoutMs <= 0))
|
|
433
|
+
throw new RangeError(`parseMarkdown: timeoutMs must be a positive integer, got ${r.timeoutMs}`);
|
|
434
|
+
}, we = async (r, e, t, c, s) => {
|
|
435
|
+
if (re(s), !await te()) {
|
|
436
|
+
const n = T ? ` ${T}` : "";
|
|
437
|
+
throw new Error(`markdown service is not reachable on ${p}.${n}`);
|
|
438
|
+
}
|
|
439
|
+
const a = {};
|
|
440
|
+
c && (a.Authorization = `Bearer ${c}`);
|
|
441
|
+
const i = O(G, K({ baseUrl: "http://localhost", httpVersion: "2", sessionManager: W, readMaxBytes: 2 * s.maxHtmlBytes + N }));
|
|
442
|
+
try {
|
|
443
|
+
const n = await i.convert(
|
|
444
|
+
{
|
|
445
|
+
markdownText: r,
|
|
446
|
+
filePath: e,
|
|
447
|
+
workspaceRoot: t,
|
|
448
|
+
validateExistence: s.validateExistence ?? !0,
|
|
449
|
+
enableSubscript: s.enableSubscript,
|
|
450
|
+
enableSuperscript: s.enableSuperscript,
|
|
451
|
+
enableMark: s.enableMark,
|
|
452
|
+
enableTableMerge: s.enableTableMerge,
|
|
453
|
+
enableEmbeds: s.enableEmbeds,
|
|
454
|
+
enableZennDirectives: s.enableZennDirectives,
|
|
455
|
+
resolveImports: s.resolveImports ?? !1,
|
|
456
|
+
maxHtmlBytes: s.maxHtmlBytes,
|
|
457
|
+
deny: new l({ segmentPatterns: [...s.deniedPathSegments] })
|
|
458
|
+
},
|
|
459
|
+
{ headers: a, signal: s.signal, timeoutMs: s.timeoutMs }
|
|
460
|
+
);
|
|
461
|
+
return {
|
|
462
|
+
htmlContent: n.htmlContent,
|
|
463
|
+
headings: n.headings.map((w) => ({
|
|
464
|
+
text: w.text,
|
|
465
|
+
depth: w.depth,
|
|
466
|
+
id: w.id
|
|
467
|
+
}))
|
|
468
|
+
};
|
|
469
|
+
} catch (n) {
|
|
470
|
+
throw n instanceof q && n.code === D.ResourceExhausted ? new Z(n) : n;
|
|
358
471
|
}
|
|
359
|
-
let n = !0, s, o, y, c, m, S;
|
|
360
|
-
typeof a == "boolean" ? n = a : a && typeof a == "object" && (n = a.validateExistence ?? !0, s = a.enableSubscript, o = a.enableSuperscript, y = a.enableMark, c = a.enableTableMerge, m = a.enableEmbeds, S = a.enableZennDirectives);
|
|
361
|
-
const P = {};
|
|
362
|
-
l && (P.Authorization = `Bearer ${l}`);
|
|
363
|
-
const _ = await z.convert(
|
|
364
|
-
{
|
|
365
|
-
markdownText: r,
|
|
366
|
-
filePath: t,
|
|
367
|
-
workspaceRoot: e,
|
|
368
|
-
validateExistence: n,
|
|
369
|
-
enableSubscript: s,
|
|
370
|
-
enableSuperscript: o,
|
|
371
|
-
enableMark: y,
|
|
372
|
-
enableTableMerge: c,
|
|
373
|
-
enableEmbeds: m,
|
|
374
|
-
enableZennDirectives: S
|
|
375
|
-
},
|
|
376
|
-
{ headers: P }
|
|
377
|
-
);
|
|
378
|
-
return {
|
|
379
|
-
htmlContent: _.htmlContent,
|
|
380
|
-
headings: _.headings.map((b) => ({
|
|
381
|
-
text: b.text,
|
|
382
|
-
depth: b.depth,
|
|
383
|
-
id: b.id
|
|
384
|
-
}))
|
|
385
|
-
};
|
|
386
472
|
};
|
|
387
473
|
export {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
474
|
+
v as MAX_HTML_BYTES_LIMIT,
|
|
475
|
+
Z as MarkdownResourceExhaustedError,
|
|
476
|
+
Y as fetchSiteMetadata,
|
|
477
|
+
we as parseMarkdown,
|
|
478
|
+
pe as remarkBlockLinkMetadata
|
|
391
479
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as e,
|
|
1
|
+
import { _ as e, $ as s, as as o, a0 as i } from "./extractHeadings-CS-qqdgu.js";
|
|
2
2
|
import { p as g } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
|
|
3
3
|
var p = {
|
|
4
4
|
parse: /* @__PURE__ */ e(async (r) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./extractHeadings-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./extractHeadings-DZwpYYZa.cjs"),s=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var i={parse:e.__name(async r=>{const a=await s.parse("info",r);e.log.debug(a)},"parse")},o={version:"11.16.0"},g=e.__name(()=>o.version,"getVersion"),d={getVersion:g},v=e.__name((r,a,n)=>{e.log.debug(`rendering info diagram
|
|
2
2
|
`+r);const t=e.selectSvgElement(a);e.configureSvgSize(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),c={draw:v},p={parser:i,db:d,renderer:c};exports.diagram=p;
|