@aiquants/markdown 6.3.0 → 6.4.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 +40 -3
- package/dist/{abnfDiagram-VRR7QNED-BGUmgNQ4.cjs → abnfDiagram-VRR7QNED-B4qwBPG8.cjs} +1 -1
- package/dist/{abnfDiagram-VRR7QNED-D3L_2hCD.js → abnfDiagram-VRR7QNED-DJQK-fno.js} +3 -3
- package/dist/{arc-ChEpDr_9.js → arc-B5-ynLRd.js} +1 -1
- package/dist/{arc-B48_ucR0.cjs → arc-CXmyMsv9.cjs} +1 -1
- package/dist/{architectureDiagram-ZJ3FMSHR-D4ta1ajC.js → architectureDiagram-ZJ3FMSHR-C_JEocx6.js} +2 -2
- package/dist/{architectureDiagram-ZJ3FMSHR-Bg0dBVnf.cjs → architectureDiagram-ZJ3FMSHR-DyhTbYvV.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-DkWMy8pP.cjs → blockDiagram-677ZJIJ3-BsWnBpmo.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-CupyE7nK.js → blockDiagram-677ZJIJ3-COWsJwrz.js} +3 -3
- package/dist/{c4Diagram-LMCZKHZV-Cy1lIde9.js → c4Diagram-LMCZKHZV-BJGPyybb.js} +2 -2
- package/dist/{c4Diagram-LMCZKHZV-DxOKAkJI.cjs → c4Diagram-LMCZKHZV-C8SAoymj.cjs} +1 -1
- package/dist/{channel-TOZvPft0.cjs → channel-Catm-7_m.cjs} +1 -1
- package/dist/{channel-C9c0_XwC.js → channel-gEEzHgMK.js} +1 -1
- package/dist/{chunk-2Q5K7J3B-DahzXbiI.js → chunk-2Q5K7J3B-BrZPj48S.js} +1 -1
- package/dist/{chunk-2Q5K7J3B-DaGwwho3.cjs → chunk-2Q5K7J3B-D2pUNN7e.cjs} +1 -1
- package/dist/{chunk-32BRIVSS-BddWRgx3.cjs → chunk-32BRIVSS-BHwCDqTA.cjs} +1 -1
- package/dist/{chunk-32BRIVSS-DFLtYkrI.js → chunk-32BRIVSS-Qjp2CRZG.js} +1 -1
- package/dist/{chunk-5VM5RSS4-DSg2-2mp.cjs → chunk-5VM5RSS4-C-2Xl1mK.cjs} +1 -1
- package/dist/{chunk-5VM5RSS4-DiwEVqol.js → chunk-5VM5RSS4-Cz-1oXF8.js} +1 -1
- package/dist/{chunk-EX3LRPZG-OD-kvRfM.cjs → chunk-EX3LRPZG-CcWHrBHu.cjs} +1 -1
- package/dist/{chunk-EX3LRPZG-Ca4uquaA.js → chunk-EX3LRPZG-DOly63cQ.js} +4 -4
- package/dist/{chunk-JWPE2WC7-njgGfGvE.js → chunk-JWPE2WC7-D8oKuUKk.js} +1 -1
- package/dist/{chunk-JWPE2WC7-BGdnK7yg.cjs → chunk-JWPE2WC7-uLMzLWor.cjs} +1 -1
- package/dist/{chunk-MOJQB5TN-DPs_chEk.cjs → chunk-MOJQB5TN-CFHULd2m.cjs} +1 -1
- package/dist/{chunk-MOJQB5TN-B-H_fDpi.js → chunk-MOJQB5TN-DFfn4gwS.js} +1 -1
- package/dist/{chunk-PUDLZKDR-9xQzJ025.js → chunk-PUDLZKDR-BSXgzvcs.js} +6 -6
- package/dist/{chunk-PUDLZKDR-DZphdeDg.cjs → chunk-PUDLZKDR-CdXVWW4P.cjs} +1 -1
- package/dist/{chunk-RYQCIY6F-8Qpsw4iJ.cjs → chunk-RYQCIY6F-CVamSMzr.cjs} +1 -1
- package/dist/{chunk-RYQCIY6F-BNzT71C4.js → chunk-RYQCIY6F-D7rBCtF6.js} +1 -1
- package/dist/{chunk-V7JOEXUC-DG6RRlOY.js → chunk-V7JOEXUC-BEGUrMN0.js} +5 -5
- package/dist/{chunk-V7JOEXUC-BPE4_Rfd.cjs → chunk-V7JOEXUC-DJuvtTef.cjs} +1 -1
- package/dist/{chunk-VR4S4FIN-CLtgFgby.js → chunk-VR4S4FIN-DbzCqIxB.js} +1 -1
- package/dist/{chunk-VR4S4FIN-C-Pbv_Mm.cjs → chunk-VR4S4FIN-Okfemb3d.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-B0bOz96Q.cjs → chunk-XXDRQBXY-DQBgFSg2.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-DEXdwwNg.js → chunk-XXDRQBXY-DzmhMVRC.js} +1 -1
- package/dist/{classDiagram-v2-EOCWNBFH-B9uAd2dg.js → classDiagram-OUVF2IWQ-BGn-HjT8.js} +2 -2
- package/dist/{classDiagram-OUVF2IWQ-DMqQXVMf.cjs → classDiagram-OUVF2IWQ-DR8DD7tr.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-B9uAd2dg.js → classDiagram-v2-EOCWNBFH-BGn-HjT8.js} +2 -2
- package/dist/{classDiagram-v2-EOCWNBFH-DMqQXVMf.cjs → classDiagram-v2-EOCWNBFH-DR8DD7tr.cjs} +1 -1
- package/dist/components/mathRendering.d.ts +1 -0
- package/dist/conversion.d.ts +26 -0
- package/dist/converter/NOTICES.md +178 -0
- package/dist/converter/createMarkdownConverter.d.ts +12 -0
- package/dist/converter/protocol.d.ts +58 -0
- package/dist/converter/serve.d.ts +12 -0
- package/dist/converter/worker.d.ts +1 -0
- package/dist/converter/worker.js +76 -0
- package/dist/converter.cjs +1 -0
- package/dist/converter.d.ts +4 -0
- package/dist/converter.js +109 -0
- package/dist/converter.wasm +0 -0
- package/dist/{cose-bilkent-JH36ORCC-DVB8IdFe.js → cose-bilkent-JH36ORCC-CXaSZTQh.js} +1 -1
- package/dist/{cose-bilkent-JH36ORCC-DxpO_Qhk.cjs → cose-bilkent-JH36ORCC-DKpnPAKO.cjs} +1 -1
- package/dist/{cynefinDiagram-TSTJHNR4-C-iEKX8r.js → cynefinDiagram-TSTJHNR4-BQSdT_2p.js} +2 -2
- package/dist/{cynefinDiagram-TSTJHNR4-Dvc8nHOe.cjs → cynefinDiagram-TSTJHNR4-WzHtBOXU.cjs} +1 -1
- package/dist/{dagre-VKFMJZFB-DqU8jG6A.cjs → dagre-VKFMJZFB-BOlxvZO9.cjs} +1 -1
- package/dist/{dagre-VKFMJZFB-CI1hyGqk.js → dagre-VKFMJZFB-DQ5e1PJD.js} +2 -2
- package/dist/{diagram-FQU43EPY-DQHw46B-.cjs → diagram-FQU43EPY-DdDxGx-M.cjs} +1 -1
- package/dist/{diagram-FQU43EPY-iMIQEr1Q.js → diagram-FQU43EPY-DlCF28sn.js} +2 -2
- package/dist/{diagram-G47NLZAW-Dxkn-83c.cjs → diagram-G47NLZAW-Cvts7_pn.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-L7A0K5es.js → diagram-G47NLZAW-DVdw7HhH.js} +3 -3
- package/dist/{diagram-NH7WQ7WH-8BnG6h8J.js → diagram-NH7WQ7WH-BkU3b82h.js} +2 -2
- package/dist/{diagram-NH7WQ7WH-CBMFD5SB.cjs → diagram-NH7WQ7WH-Cs_Dyb0p.cjs} +1 -1
- package/dist/{diagram-OA4YK3LP-C24uGaef.js → diagram-OA4YK3LP-D39RUkK3.js} +3 -3
- package/dist/{diagram-OA4YK3LP-DrD1SsZM.cjs → diagram-OA4YK3LP-ONhluSWR.cjs} +1 -1
- package/dist/{diagram-WEI45ONY-kBWsy9sQ.js → diagram-WEI45ONY-CMD5pSfn.js} +2 -2
- package/dist/{diagram-WEI45ONY-BYN2qTiw.cjs → diagram-WEI45ONY-DyEvKt6H.cjs} +1 -1
- package/dist/{ebnfDiagram-CCIWWBDH-C7whdHrV.cjs → ebnfDiagram-CCIWWBDH-Bi-wg1C0.cjs} +1 -1
- package/dist/{ebnfDiagram-CCIWWBDH-DRfaz75o.js → ebnfDiagram-CCIWWBDH-Z3TtxdlL.js} +3 -3
- package/dist/{erDiagram-Q63AITRT-CvcOag5w.js → erDiagram-Q63AITRT-C-O8hBWj.js} +4 -4
- package/dist/{erDiagram-Q63AITRT-Cbh7ns6U.cjs → erDiagram-Q63AITRT-DQO3kH0H.cjs} +1 -1
- package/dist/errors-BW5JXRoX.cjs +1 -0
- package/dist/errors-Blk_XJ9C.js +55 -0
- package/dist/errors.d.ts +12 -0
- package/dist/{extractHeadings-By3kC3b_.cjs → extractHeadings-DSlyjlEb.cjs} +58 -58
- package/dist/{extractHeadings-Dz8gnhsx.js → extractHeadings-DkKFCMIW.js} +3766 -3732
- package/dist/flowDiagram-23GEKE2U-BHV7jjdl.js +7 -0
- package/dist/flowDiagram-23GEKE2U-Bn8nX3mJ.cjs +1 -0
- package/dist/{ganttDiagram-NO4QXBWP-Ccrw6Vga.js → ganttDiagram-NO4QXBWP-BgxDDjW1.js} +2 -2
- package/dist/{ganttDiagram-NO4QXBWP-YWoWQpTa.cjs → ganttDiagram-NO4QXBWP-C6v1dyOv.cjs} +1 -1
- package/dist/{gitGraphDiagram-IHSO6WYX-C-mHT-ew.js → gitGraphDiagram-IHSO6WYX-BSIaczat.js} +3 -3
- package/dist/{gitGraphDiagram-IHSO6WYX-nKm0aLrL.cjs → gitGraphDiagram-IHSO6WYX-Dly6wuUW.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.client.cjs +1 -1
- package/dist/index.client.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.server.cjs +1 -1
- package/dist/index.server.d.ts +3 -1
- package/dist/index.server.js +159 -173
- package/dist/{infoDiagram-FWYZ7A6U-HBcwdQ6Z.js → infoDiagram-FWYZ7A6U-BJpiPMD3.js} +1 -1
- package/dist/{infoDiagram-FWYZ7A6U-B6uUqDCC.cjs → infoDiagram-FWYZ7A6U-CRxeian2.cjs} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-CcSYEsTJ.js → ishikawaDiagram-FXEZZL3T-B3tCfTEo.js} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-D9WZm1OZ.cjs → ishikawaDiagram-FXEZZL3T-jEnTu6LN.cjs} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-BC3ajweK.cjs → journeyDiagram-5HDEW3XC-BXFW-Svx.cjs} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-PJm-8Gz8.js → journeyDiagram-5HDEW3XC-D7U-NNAM.js} +4 -4
- package/dist/{kanban-definition-HUTT4EX6-42_dEzBV.js → kanban-definition-HUTT4EX6-B14iIRCh.js} +2 -2
- package/dist/{kanban-definition-HUTT4EX6-BR-C1joQ.cjs → kanban-definition-HUTT4EX6-DSprt7D2.cjs} +1 -1
- package/dist/{linear-CoCezkp4.cjs → linear-B-_z7_Qw.cjs} +1 -1
- package/dist/{linear-B7J7VKh9.js → linear-DZOg62FH.js} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-BO555Yeu.cjs → mindmap-definition-LN4V7U3C-Bs_ccQ71.cjs} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-e4fXdr28.js → mindmap-definition-LN4V7U3C-Dh-Z6t4L.js} +3 -3
- package/dist/{pegDiagram-2B236MQR-nN-jUv5o.js → pegDiagram-2B236MQR-6OQwK0r-.js} +3 -3
- package/dist/{pegDiagram-2B236MQR-CqN17IwE.cjs → pegDiagram-2B236MQR-BunF191h.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-D_EIGKcE.cjs → pieDiagram-ENE6RG2P-BUdykoZb.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-EvhF_8o2.js → pieDiagram-ENE6RG2P-DjvAa5zD.js} +3 -3
- package/dist/{quadrantDiagram-ABIIQ3AL-2gTiccyy.js → quadrantDiagram-ABIIQ3AL-DfiOa0GN.js} +2 -2
- package/dist/{quadrantDiagram-ABIIQ3AL-HNTFSQzi.cjs → quadrantDiagram-ABIIQ3AL-ksoulitn.cjs} +1 -1
- package/dist/{railroadDiagram-RFXS5EU6-CRuA7qqW.cjs → railroadDiagram-RFXS5EU6-BWupYLwR.cjs} +1 -1
- package/dist/{railroadDiagram-RFXS5EU6-CYAI9-bK.js → railroadDiagram-RFXS5EU6-DxJ3t05t.js} +3 -3
- package/dist/remarkProcessor.server.d.ts +1 -28
- package/dist/{requirementDiagram-TGXJPOKE-BZc_cLKC.js → requirementDiagram-TGXJPOKE-CxplHHB8.js} +3 -3
- package/dist/{requirementDiagram-TGXJPOKE-DesNyieJ.cjs → requirementDiagram-TGXJPOKE-D17FjoFO.cjs} +1 -1
- package/dist/{sankeyDiagram-HTMAVEWB-wLwqusl2.cjs → sankeyDiagram-HTMAVEWB-CDXvEE-n.cjs} +1 -1
- package/dist/{sankeyDiagram-HTMAVEWB-B1QsmzsN.js → sankeyDiagram-HTMAVEWB-DFOQ2fD-.js} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-D3ciEWOE.cjs → sequenceDiagram-DBY2YBRQ-D-aVI5Yt.cjs} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-OTeHr40Q.js → sequenceDiagram-DBY2YBRQ-Gf5VRPPO.js} +3 -3
- package/dist/{sizeCapture-X5ZJPWSS-LlzRMz8i.cjs → sizeCapture-X5ZJPWSS-BAB3SekL.cjs} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-BhcQlLlw.js → sizeCapture-X5ZJPWSS-DyErW1EK.js} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-D0q856z6.cjs → stateDiagram-2N3HPSRC-BrUDPgXu.cjs} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-DjLE1--n.js → stateDiagram-2N3HPSRC-lxQmuBDw.js} +2 -2
- package/dist/{stateDiagram-v2-6OUMAXLB-DJHUGWBX.cjs → stateDiagram-v2-6OUMAXLB-B67PZ7bz.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB-DKU0HsD1.js → stateDiagram-v2-6OUMAXLB-l5VmN12f.js} +2 -2
- package/dist/{swimlanes-5IMT3BWC-cxcj_GGS.js → swimlanes-5IMT3BWC-CMkiOd-R.js} +3 -3
- package/dist/{swimlanes-5IMT3BWC-DC6qS8iI.cjs → swimlanes-5IMT3BWC-DW61y4w7.cjs} +1 -1
- package/dist/{swimlanesDiagram-G3AALYLV-B95OToWo.js → swimlanesDiagram-G3AALYLV-CaDY11RK.js} +2 -2
- package/dist/{swimlanesDiagram-G3AALYLV-Dv76fKaH.cjs → swimlanesDiagram-G3AALYLV-DN1x1exB.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-wD6O9DDR.cjs → timeline-definition-FHXFAJF6-DCW8SrSN.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-P-5kO0xQ.js → timeline-definition-FHXFAJF6-GIvmYQNR.js} +2 -2
- package/dist/{vennDiagram-L72KCM5P-BwinGtNb.js → vennDiagram-L72KCM5P-DtN1NFNM.js} +1 -1
- package/dist/{vennDiagram-L72KCM5P-BXHvaRtm.cjs → vennDiagram-L72KCM5P-wENEw3FH.cjs} +1 -1
- package/dist/{wardleyDiagram-EHGQE667-BeYbREE2.js → wardleyDiagram-EHGQE667-CPYTbfuJ.js} +2 -2
- package/dist/{wardleyDiagram-EHGQE667-BDgwIQTf.cjs → wardleyDiagram-EHGQE667-Daugt2NV.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-DLCCDPGO.cjs → xychartDiagram-FW5EYKEG-B3D8pi1c.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-BXjx9Zgc.js → xychartDiagram-FW5EYKEG-C-NgU5xv.js} +2 -2
- package/package.json +17 -8
- package/dist/flowDiagram-23GEKE2U-C5ygxVuP.js +0 -7
- package/dist/flowDiagram-23GEKE2U-DSpM0zzA.cjs +0 -1
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@ Advanced Markdown renderer for React with support for various extensions and cus
|
|
|
6
6
|
|
|
7
7
|
- **Rich Markdown Support**: Full support for CommonMark, GitHub Flavored Markdown (GFM), and LaTeX Math expressions.
|
|
8
8
|
- **Offloaded Parser**: CPU-heavy Markdown parsing and AST transformation are offloaded to a high-performance Go API server running `goldmark` and `ConnectRPC`.
|
|
9
|
+
- **Browser Converter**: the same Go converter, compiled to WebAssembly and run in a worker, converts in the browser exactly as the service does, byte for byte, without a round trip (`@aiquants/markdown/converter`).
|
|
9
10
|
- **Custom Extensions & Plugins**: GitHub alerts, Zenn-style directives (`:::message` / `:::details`), single-line display math, and pluggable subscript, superscript, mark highlights, table cell merges, and opt-in embeds: posts and videos of ten SNS and video providers as script-free cross-origin frames, and link cards from the host's metadata endpoint.
|
|
10
11
|
- **Dynamic Configuration**: Easily enable or disable custom extensions dynamically using parse options.
|
|
11
12
|
- **Syntax Highlighting**: Code blocks with Shiki syntax highlighting.
|
|
@@ -190,8 +191,39 @@ const block = target.closest(`[${SOURCE_LINES_ATTRIBUTE}]`)
|
|
|
190
191
|
const lines = parseSourceLines(block?.getAttribute(SOURCE_LINES_ATTRIBUTE))
|
|
191
192
|
```
|
|
192
193
|
|
|
194
|
+
### Browser converter
|
|
195
|
+
|
|
196
|
+
`@aiquants/markdown/converter` runs the service's Go converter, compiled to WebAssembly, in a worker, so a browser converts a document exactly as the service does, without a round trip: with existence validation off and `@import` directives left as written, the HTML and the headings are the service's byte for byte (the package's end-to-end tests compare both on the same documents). A host serves two assets and passes their URLs, here with Vite:
|
|
197
|
+
|
|
198
|
+
```ts
|
|
199
|
+
import { createMarkdownConverter } from "@aiquants/markdown/converter"
|
|
200
|
+
import converterWorkerUrl from "@aiquants/markdown/converter/worker?worker&url"
|
|
201
|
+
import converterWasmUrl from "@aiquants/markdown/converter.wasm?url"
|
|
202
|
+
|
|
203
|
+
const converter = createMarkdownConverter({ workerUrl: converterWorkerUrl, wasmUrl: converterWasmUrl, timeoutMs: 10_000 })
|
|
204
|
+
const { htmlContent, headings } = await converter.convert(
|
|
205
|
+
{
|
|
206
|
+
markdownText,
|
|
207
|
+
filePath: "notes/my-file.md", // the document's path under workspaceRoot, or its gcs:// / gdrive:// URI
|
|
208
|
+
workspaceRoot: "/workspace", // any absolute path: the browser has no workspace
|
|
209
|
+
options: { deniedPathSegments: hostDenyRules, maxHtmlBytes: 4 * 1024 * 1024, includeSourceLines: true },
|
|
210
|
+
},
|
|
211
|
+
controller.signal,
|
|
212
|
+
)
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
- **Options** are `BrowserParseOptions`: `ParseOptions` without `resolveImports`, `validateExistence` (the browser has no storage), `signal` and `timeoutMs` (the call has its own). They are validated as `parseMarkdown` validates them.
|
|
216
|
+
- **Paths**: `filePath` is read as the service reads it. Give a local document's path relative to any absolute `workspaceRoot`: the converter writes workspace-relative document paths (`data-asset-src`, `data-doc-path`), the same as the service with the real root. The deny rules apply as written; symbolic links are not resolved, since there is no file system, so the service stays the authority when the host serves a target.
|
|
217
|
+
- **One conversion at a time**, in call order. One aborted before it starts never runs; one aborted while it runs rejects at once with the signal's reason and its answer is dropped, since a WebAssembly call cannot be interrupted. `timeoutMs` counts from the moment the converter is loaded; past it the converter stops its worker, rejects with `MarkdownConversionTimeoutError` and starts a new worker for the next conversion.
|
|
218
|
+
- **Errors**: `MarkdownResourceExhaustedError` past a size limit (the same class `./server` exports; the browser applies the service's default limits, an 8 MiB source and a 32 MiB HTML, lowered by `maxHtmlBytes`), `MarkdownConversionTimeoutError`, and `MarkdownConversionError` with `code`: `invalid_argument` for a refused request, `internal` when the converter failed on the document, `unavailable` when the converter could not load or was disposed (every later call fails the same way; create a new converter to retry). `dispose()` stops the worker.
|
|
219
|
+
- **Assets**: `converter.wasm` is about 9.1 MiB (gzip 2.0 MiB, brotli 1.6 MiB); serve it as `application/wasm`, so it compiles while it downloads, and compressed. The first conversion starts the worker, compiles the module and starts Go (about 0.4 s in Chromium); a 700-line document then converts in about 35 ms, the worker's round trip included. The worker is one self-contained script that starts with the `wasm_exec.js` of the Go toolchain that built the module, under its BSD license; `dist/converter/NOTICES.md` lists the licenses of everything linked into the module.
|
|
220
|
+
- **Content Security Policy**: a page that sets `script-src` needs `'wasm-unsafe-eval'` in it, and `worker-src 'self'` (or a `script-src` that covers the worker) for the same-origin worker.
|
|
221
|
+
- **Building from source** needs the Go toolchain on PATH: `pnpm run build` compiles `cmd/markdown-wasm` of `packages/go/markdown-api` and bundles the worker with the same toolchain's `wasm_exec.js` (`pnpm run build:converter` alone).
|
|
222
|
+
|
|
193
223
|
## Viewer, embeds and links
|
|
194
224
|
|
|
225
|
+
`MarkdownRenderer` keys every top-level block by its content: a fingerprint of the block's HTML without `data-source-lines`, and its occurrence among equal blocks. When the document around a block changes (a paragraph added above, the lines it came from moved), the block keeps its components, so a highlighted code block, a Mermaid diagram or an embedded frame is not built again; only a block whose content changed is.
|
|
226
|
+
|
|
195
227
|
### Stylesheets
|
|
196
228
|
|
|
197
229
|
| Import | Content |
|
|
@@ -453,9 +485,14 @@ Given the prop, the viewer renders
|
|
|
453
485
|
|
|
454
486
|
The function receives the scroll container, `[data-aqmd-scroll-container]`, the same element with the same hooks and classes as without the prop. It is called on every render once the container is mounted, before the first paint. The bar reads and writes the container's scroll position itself (`scrollTop`, `scrollHeight`, `clientHeight`, `scroll` events).
|
|
455
487
|
|
|
456
|
-
Only the native vertical scrollbar is hidden, in every engine: the scroll container always reserves it (`overflow-y: scroll`, so its thickness is constant), its border box (`box-sizing: border-box`, whatever the host's default) is widened by the measured thickness (`width: calc(100% + <thickness>px)`), and the clipping cell cuts that strip off.
|
|
488
|
+
Only the native vertical scrollbar is hidden, in every engine: the scroll container always reserves it (`overflow-y: scroll`, so its thickness is constant), its border box (`box-sizing: border-box`, whatever the host's default) is widened by the measured thickness (`width: calc(100% + <thickness>px)`), and the clipping cell cuts that strip off.
|
|
489
|
+
The native horizontal scrollbar keeps its native look, spans exactly the visible width and stays usable, as do the wheel, the keyboard and touch in both directions. No `::-webkit-scrollbar` or `scrollbar-width` rule is involved, so a host's `scrollbar-color` or `scrollbar-width` neither breaks the hiding nor is overridden. The cell uses `overflow: clip` rather than `hidden`, so nothing can scroll the cell itself, and it creates no containing block, so the fixed toolbar is neither moved nor clipped by it.
|
|
490
|
+
Coverage: classic (space-taking) scrollbars are hidden in every browser that supports `overflow: clip` (Chromium 90, Firefox 81, Safari 16). An overlay scrollbar (macOS by default, mobile browsers, Firefox and GTK overlay modes) takes no space, measures 0 px and is drawn over the content while scrolling, so it stays visible there; the right-to-left inline end is handled the same way.
|
|
457
491
|
|
|
458
|
-
The thickness and the slot's width are measured in the scroll container's own CSS px, which a CSS `zoom` or a transform above it makes differ from the viewport's: a native scrollbar keeps its size on screen, so under `zoom: 1.1` its 15 px are 13.64 of the container's px.
|
|
492
|
+
The thickness and the slot's width are measured in the scroll container's own CSS px, which a CSS `zoom` or a transform above it makes differ from the viewport's: a native scrollbar keeps its size on screen, so under `zoom: 1.1` its 15 px are 13.64 of the container's px.
|
|
493
|
+
The container is positioned (`position: relative`) and holds an invisible, zero-tall box stretched across its padding box, `[data-aqmd-scroll-bar-probe]` (`aria-hidden`, out of flow); the thickness is the container's rect width less that box's, converted by the ratio of the container's rect width to its computed width, less its side borders.
|
|
494
|
+
It is rounded up to a whole px, because the clip must never leave any of the native bar showing: the price is less than 1 px of the container's own px cut off its inline-end padding and the end of the native horizontal scrollbar (0.36 px at `zoom: 1.1`, none where the thickness is whole).
|
|
495
|
+
Both are measured before the first paint and again whenever the container or the slot resizes and the window resizes (a page zoom changes a scrollbar's thickness in CSS px). The floating toolbar keeps the slot's measured width from the inline end instead of a native scrollbar's 24 px, and each popover's maximum width uses the same clearance.
|
|
459
496
|
|
|
460
497
|
Everything else keeps using the native scroller: fragment and table-of-contents scrolling with `scroll-padding-block-start`, the scroll position kept across a display-style change, link-card visibility observation, embed minimum widths measured from the content column, and the browser's scroll anchoring. Without the prop, the scroll container is the viewer's root element with its native scrollbars, and no row, cell or slot is rendered. Switching between given and omitted moves the scroll container onto another element, which starts at the top.
|
|
461
498
|
|
|
@@ -577,7 +614,7 @@ e^{i\theta} = \cos\theta + i\sin\theta
|
|
|
577
614
|
$$
|
|
578
615
|
```
|
|
579
616
|
|
|
580
|
-
Every renderer (`MarkdownRenderer`, `MarkdownViewer`, `NodesRenderer`) renders a formula with the same KaTeX options: `throwOnError: false` (an invalid formula shows its source in red) and display math in display mode.
|
|
617
|
+
Every renderer (`MarkdownRenderer`, `MarkdownViewer`, `NodesRenderer`) renders a formula with the same KaTeX options: `throwOnError: false` (an invalid formula shows its source in red) and display math in display mode. The 610 most recently used renderings are kept, reports included, so a document re-rendered while it is edited renders only its new formulas.
|
|
581
618
|
Nothing KaTeX says about a formula reaches the console, in the browser or on the server: its reports about LaTeX-incompatible input that still renders (a text-mode accent such as `\r` in math mode, an unknown symbol, `\\` in display math), its warning about a character its fonts have no metrics for (※, ①, ★, €, an emoji: code `noCharacterMetrics`), and the TeX console commands `\message`, `\errmessage` and `\show`, which render nothing (code `consoleCommand`).
|
|
582
619
|
`MarkdownRenderer` and `MarkdownViewer` hand them to `onMathDiagnostics` as `MarkdownMathDiagnostic` objects (`{ code, message, formula, displayMode }`): after the commit, once per document, and only when there is one; the viewer's function may change on any render without the document being parsed again.
|
|
583
620
|
Japanese or other non-Latin letters inside a formula (`\frac{売上}{原価}`) are not reported, since KaTeX renders them as written; `\text{…}` is the LaTeX way to write words inside a formula.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chunk-MOJQB5TN-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chunk-MOJQB5TN-CFHULd2m.cjs"),u=require("./chunk-JWPE2WC7-uLMzLWor.cjs"),n=require("./extractHeadings-DSlyjlEb.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-
|
|
2
|
-
import { p as f } from "./chunk-JWPE2WC7-
|
|
3
|
-
import { _ as n, Q as o } from "./extractHeadings-
|
|
1
|
+
import { g as p, r as u, d as a } from "./chunk-MOJQB5TN-DFfn4gwS.js";
|
|
2
|
+
import { p as f } from "./chunk-JWPE2WC7-D8oKuUKk.js";
|
|
3
|
+
import { _ as n, Q as o } from "./extractHeadings-DkKFCMIW.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,4 +1,4 @@
|
|
|
1
|
-
import { aD as ln, aE as an, aF as y, aG as tn, aH as N, aI as D, aJ as _, aK as un, aL as rn, aM as j, aN as o, aO as J, aP as sn, aQ as on, aR as fn } from "./extractHeadings-
|
|
1
|
+
import { aD as ln, aE as an, aF as y, aG as tn, aH as N, aI as D, aJ as _, aK as un, aL as rn, aM as j, aN as o, aO as J, aP as sn, aQ as on, aR as fn } from "./extractHeadings-DkKFCMIW.js";
|
|
2
2
|
function cn(l) {
|
|
3
3
|
return l.innerRadius;
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("./extractHeadings-
|
|
1
|
+
"use strict";const n=require("./extractHeadings-DSlyjlEb.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;
|
package/dist/{architectureDiagram-ZJ3FMSHR-D4ta1ajC.js → architectureDiagram-ZJ3FMSHR-C_JEocx6.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as Ze } from "./chunk-JWPE2WC7-
|
|
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-
|
|
1
|
+
import { p as Ze } from "./chunk-JWPE2WC7-D8oKuUKk.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-DkKFCMIW.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;
|