allyhub 0.15.2 → 0.17.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/CHANGELOG.md +24 -0
- package/dist/commands/add.js +1 -1
- package/dist/commands/cloud-tools.js +1 -1
- package/dist/commands/dev.js +6 -2
- package/dist/commands/doctor.js +3 -3
- package/dist/commands/frames/doc.js +1 -1
- package/dist/commands/inspect/common.js +3 -3
- package/dist/commands/inspect/facts.js +2 -2
- package/dist/commands/inspect/index.js +1 -1
- package/dist/commands/inspect/layout.js +1 -1
- package/dist/commands/inspect/uses.js +3 -0
- package/dist/commands/mail.js +6 -6
- package/dist/commands/render.js +1 -1
- package/dist/main.js +8 -8
- package/dist/node_modules/@allyhub/3d-extension/dist/cli/scenery-text.js +2 -2
- package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/audio/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/audio/dist/place.js +2 -0
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/browser/package.json +1 -1
- package/dist/node_modules/@allyhub/build/dist/content.d.ts +7 -0
- package/dist/node_modules/@allyhub/build/dist/file-check.d.ts +2 -2
- package/dist/node_modules/@allyhub/build/dist/imports.d.ts +17 -0
- package/dist/node_modules/@allyhub/build/dist/imports.js +2 -0
- package/dist/node_modules/@allyhub/build/dist/index.d.ts +3 -2
- package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/inspect-view.d.ts +1 -1
- package/dist/node_modules/@allyhub/build/dist/inspect-view.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +19 -3
- package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
- package/dist/node_modules/@allyhub/build/dist/uses.d.ts +27 -6
- package/dist/node_modules/@allyhub/build/dist/uses.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/work.d.ts +9 -1
- package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
- package/dist/node_modules/@allyhub/build/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/skills/allyhub/references/canvas.md +2 -2
- package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/blobs.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +12 -3
- package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/index.d.ts +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/deletion.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/inputs.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/writer.js +3 -2
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
- package/dist/node_modules/@allyhub/doc/dist/html.js +40 -40
- package/dist/node_modules/@allyhub/doc/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/markdown.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/parse.js +4 -4
- package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/write.js +26 -26
- package/dist/node_modules/@allyhub/doc/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/build.js +2 -2
- package/dist/node_modules/@allyhub/doc-extension/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
- package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/export/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
- package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +15 -3
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/website.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/items.d.ts +70 -11
- package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +15 -4
- package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +4 -0
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/i18n/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/dist/stage.js +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/workspace.js +1 -1
- package/dist/node_modules/@allyhub/image-extension/package.json +2 -2
- package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +3 -3
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
- package/dist/node_modules/@allyhub/image-render/package.json +1 -1
- package/dist/node_modules/@allyhub/image-runtime/dist/load.js +2 -2
- package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/jobs/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-extension/package.json +3 -1
- package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +1 -1
- package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/LICENSE +241 -0
- package/dist/node_modules/@allyhub/office-extension/markup/csv/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/csv/data/leads.csv +5 -0
- package/dist/node_modules/@allyhub/office-extension/markup/csv/markup.json +19 -0
- package/dist/node_modules/@allyhub/office-extension/markup/document/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/document/briefs/launch.docx +0 -0
- package/dist/node_modules/@allyhub/office-extension/markup/document/markup.json +11 -0
- package/dist/node_modules/@allyhub/office-extension/markup/presentation/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/presentation/decks/pitch.pptx +0 -0
- package/dist/node_modules/@allyhub/office-extension/markup/presentation/markup.json +11 -0
- package/dist/node_modules/@allyhub/office-extension/markup/workbook/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/workbook/data/plans.xlsx +0 -0
- package/dist/node_modules/@allyhub/office-extension/markup/workbook/markup.json +10 -0
- package/dist/node_modules/@allyhub/office-extension/package.json +124 -0
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +15 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +9 -0
- package/dist/node_modules/@allyhub/piece/dist/page/runtimes.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/source.d.ts +53 -10
- package/dist/node_modules/@allyhub/piece/dist/source.js +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/dist/digest.js +1 -1
- package/dist/node_modules/@allyhub/project/dist/part-keys.js +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +10 -11
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +7 -0
- package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/blobs.d.ts +9 -0
- package/dist/node_modules/@allyhub/protocol/dist/blobs.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.d.ts +77 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +39 -9
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +15 -15
- package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +441 -5
- package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +2 -2
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +4 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +8 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +5 -5
- package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +45 -0
- package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/paywall.d.ts +134 -0
- package/dist/node_modules/@allyhub/protocol/dist/paywall.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/place.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +3 -3
- package/dist/node_modules/@allyhub/protocol/dist/purposes.d.ts +47 -0
- package/dist/node_modules/@allyhub/protocol/dist/purposes.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +52 -5
- package/dist/node_modules/@allyhub/protocol/dist/shares.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.d.ts +34 -0
- package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/sites.d.ts +1 -0
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +21 -52
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/studio-server.d.ts +264 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-server.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.d.ts +18 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.d.ts +97 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +3 -2
- package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +26 -20
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/turns.d.ts +71 -0
- package/dist/node_modules/@allyhub/protocol/dist/turns.js +2 -0
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/embed.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/film.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/piece.js +2 -2
- package/dist/node_modules/@allyhub/runtime/dist/player/player.js +1 -1
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scaffold/dist/index.js +4 -4
- package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/dynamic.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/logical.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/package.json +3 -3
- package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/components.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/build.js +2 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +2 -2
- package/dist/node_modules/@allyhub/slides-extension/dist/deck-pptx.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/evaluate.js +2 -2
- package/dist/node_modules/@allyhub/slides-extension/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/audio-icon.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/package.json +5 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/component.js +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
- package/dist/node_modules/@allyhub/slides-runtime/dist/item.js +2 -0
- package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
- package/dist/node_modules/@allyhub/slides-runtime/dist/slide-css.js +20 -0
- package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/stage/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/install.js +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.js +2 -2
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +20 -20
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/dist/doc.js +17 -2
- package/dist/node_modules/@allyhub/telemetry/dist/level.js +2 -2
- package/dist/node_modules/@allyhub/telemetry/dist/levels.js +2 -0
- package/dist/node_modules/@allyhub/telemetry/dist/scrub.js +1 -1
- package/dist/node_modules/@allyhub/telemetry/package.json +5 -1
- package/dist/node_modules/@allyhub/text-extension/markup/markup.json +1 -1
- package/dist/node_modules/@allyhub/text-extension/markup-file/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/text-extension/markup-file/archive/assets.zip +0 -0
- package/dist/node_modules/@allyhub/text-extension/markup-file/markup.json +10 -0
- package/dist/node_modules/@allyhub/text-extension/package.json +35 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/cli/reference-text.js +3 -3
- package/dist/node_modules/@allyhub/video-extension/package.json +2 -2
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-extension/package.json +3 -1
- package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +1 -1
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +13 -12
- package/dist/project.js +1 -1
- package/dist/telemetry.js +3 -3
- package/dist/text/console-text.js +2 -2
- package/dist/works.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-9z0ZEYUq.js → abnfDiagram-WEYOIA3C-CHNpVSPv.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-ELMO_PA6.js → architecture-WOLXFQ4H-gPsJqQwV.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-C0yuCWU3.js → architectureDiagram-ZHVYKT53-CEIDcC6r.js} +1 -1
- package/editor-web/assets/arrow-down-B8VUPCGi.js +1 -0
- package/editor-web/assets/arrow-up-Ds4juY8X.js +1 -0
- package/editor-web/assets/article-BHTjq0_Y.js +3 -0
- package/editor-web/assets/article-DfELjJ2o.js +7 -0
- package/editor-web/assets/{audio-lines-1s1eRs4Q.js → audio-lines-PZj77e7t.js} +1 -1
- package/editor-web/assets/bar-button-J9vbfzTx.js +1 -0
- package/editor-web/assets/{blockDiagram-RJAE7QA3-vi6JOg4o.js → blockDiagram-RJAE7QA3-CUzEGVet.js} +4 -4
- package/editor-web/assets/browser-C1XuTMlp.js +1 -0
- package/editor-web/assets/{c4Diagram-XDPPPE54-Agf_H8uS.js → c4Diagram-XDPPPE54-CB94NR9s.js} +1 -1
- package/editor-web/assets/calc-worker-BdHh5LXM.js +45 -0
- package/editor-web/assets/channel-DCDCx5Es.js +1 -0
- package/editor-web/assets/chart-amT4lgX3.js +2 -0
- package/editor-web/assets/chart-file-CfbWK9l1.js +1 -0
- package/editor-web/assets/{chart-no-axes-column-CJmeYOSo.js → chart-no-axes-column-Be0lFcGF.js} +1 -1
- package/editor-web/assets/{chunk-2E7WHVMD-XalaZaha.js → chunk-2E7WHVMD-DFYo_Boi.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-DUlRZkCS.js → chunk-4EMNKR2T-CLLjmweX.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-DTa7whGr.js → chunk-55XCU76K-CkwQ_3m1.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-85zCPzj0.js → chunk-7S6XSTFO-V-AvHpAB.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-CWBseIyh.js → chunk-AQDTSKZB-PjHyYpb8.js} +1 -1
- package/editor-web/assets/chunk-DSNLSHJZ-QaczBS3J.js +127 -0
- package/editor-web/assets/{chunk-HAGFOTED-DFWda2Rk.js → chunk-HAGFOTED-aLaQB5Xu.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-aXibFitC.js → chunk-HNE4Q36P-De3ftDQR.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-CtJUuFdN.js → chunk-NQOKRVIF-CrhVQyvP.js} +17 -17
- package/editor-web/assets/{chunk-UHW7PFBP-B6QKSKWE.js → chunk-UHW7PFBP-BFmZ5ZLn.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-CF6Al55P.js → chunk-VQ5W62QI-CzppUHLA.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-w2TKLkyw.js → chunk-WQQL4CDK-BrAU7V6v.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-DVGOATM3.js → chunk-YZO67HFG-BSiF71qj.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-Cq7MMjDP.js → chunk-ZAUX2LTX-BJc4r5b1.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-GMW_lBh4.js → chunk-ZCHMQSOR-CkGTuehB.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-C7AK5Bkj.js → classDiagram-v2-4MYWR3UA-Byxc7J88.js} +7 -7
- package/editor-web/assets/code-CD-CbJG9.js +1 -0
- package/editor-web/assets/collaborator-BU4qU7O3.js +1 -0
- package/editor-web/assets/{copy-DvOiv9Ra.js → copy-CuJSs0nI.js} +1 -1
- package/editor-web/assets/{createLucideIcon-REX213UO.js → createLucideIcon-lm_6n8YT.js} +1 -1
- package/editor-web/assets/csv-Bwre9FdI.js +11 -0
- package/editor-web/assets/{cynefin-EF2NZ3EQ-ZnDieQsN.js → cynefin-EF2NZ3EQ-BSxkVbdf.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-BrukKIBF.js → cynefinDiagram-WF24UDRP-IkCgARNs.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-DfO0S2p_.js → dagre-NK4GIZVX-9PgeH6nY.js} +1 -1
- package/editor-web/assets/deck-tTzKONci.js +1 -0
- package/editor-web/assets/{diagram-CBK3MWTC-D43RLesi.js → diagram-CBK3MWTC-DRzeg3Ds.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-bA1B1QQG.js → diagram-I5XIIV2D-B_zeKMN6.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-DAdXBD2K.js → diagram-ODIL2UCW-FFm0O8SN.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-C_KyEaws.js → diagram-PFBEJUXE-DrtCT8OA.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-oXTtENF7.js → diagram-RJA3I4VV-DtxJ3V0q.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-Czupe6mO.js → diagram-TYUNFSNR-DmxF_8H_.js} +16 -16
- package/editor-web/assets/dist-BEpzsYn_.js +6 -0
- package/editor-web/assets/dist-BUD4ywMB.js +18 -0
- package/editor-web/assets/{dist-BrGYx10E.js → dist-Bd8IxQPP.js} +1 -1
- package/editor-web/assets/dist-C21CkR7Z.js +531 -0
- package/editor-web/assets/dist-C56mWAec.js +5 -0
- package/editor-web/assets/dist-CAb3W9_P.js +43 -0
- package/editor-web/assets/dist-CEknsRDd.js +24 -0
- package/editor-web/assets/dist-CbZAznNW.js +19 -0
- package/editor-web/assets/{dist-2lNSE-G_.js → dist-D3C6FyrO.js} +1 -1
- package/editor-web/assets/dist-DDzjbKIg.js +4 -0
- package/editor-web/assets/dist-DaEbElXI.js +3 -0
- package/editor-web/assets/dist-Dr3o4vee.js +1 -0
- package/editor-web/assets/{dist-BtRMClDw.js → dist-DruvDNQe.js} +1 -1
- package/editor-web/assets/dist-JLyDtl9X.js +1 -0
- package/editor-web/assets/dist-PBbWAsrV.js +17 -0
- package/editor-web/assets/dist-ZZlQa66J.js +1 -0
- package/editor-web/assets/dist-bQKpw3Zz.js +16 -0
- package/editor-web/assets/dist-d4dayaWE.js +17 -0
- package/editor-web/assets/docx-draw-9Q_fArBC.js +4 -0
- package/editor-web/assets/docx-preview-pcg9ioe3.js +21 -0
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-BOhNZmtp.js → ebnfDiagram-V4P3TTPT-DSX1Aoty.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-DoZH3OoE.js → elk-QONTBCTQ-C7gy9q56.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-Bv0KDJi4.js → erDiagram-KYQIGQAA-CKx_HoY4.js} +2 -2
- package/editor-web/assets/esm-BZb5QMQf.js +21 -0
- package/editor-web/assets/{eventmodeling-K75KTNOO-C-_xzqfj.js → eventmodeling-K75KTNOO-DL4HvSrd.js} +1 -1
- package/editor-web/assets/{file-exclamation-point-C_fX4fpI.js → file-exclamation-point-_L3ElCJ5.js} +1 -1
- package/editor-web/assets/file-question-mark-DlIjUK37.js +1 -0
- package/editor-web/assets/flowDiagram-IUGLLWBU-BUnRtJ8q.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-CAuJlaZX.js → ganttDiagram-R7GPNTJY-N-AP4slN.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-Dx2xLi5C.js → gitGraph-VSP46ZUC-BKRGJKWm.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-DHsk_UOT.js → gitGraphDiagram-PDYL7XHY-ClwL7w2_.js} +1 -1
- package/editor-web/assets/{group-pebHQTdP.js → group-BdrTp7gi.js} +1 -1
- package/editor-web/assets/hint-rlht0uxG.js +1 -0
- package/editor-web/assets/index-BedbINE5.css +2 -0
- package/editor-web/assets/index-DG2nHq4D.js +28 -0
- package/editor-web/assets/{info-OHQRW6UA-CnKQHx5m.js → info-OHQRW6UA-DpcY8t23.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-ibAVFw_2.js → infoDiagram-MVDRKAX5-ChtmtWni.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-C1OCHt3y.js → ishikawaDiagram-HPEHV2GE-BZNTuG_F.js} +1 -1
- package/editor-web/assets/iso-ahTwmFwH.js +56 -0
- package/editor-web/assets/{italic-CtlNOXN9.js → italic-zw4_eUNF.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-BDdqMOM1.js → journeyDiagram-BOSHW7O7-C3uVmZbL.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-CSAS_zGn.js → kanban-definition-FNSA4HC5-puEhftGG.js} +4 -4
- package/editor-web/assets/{link-CW2KxKT_.js → link-DopSU3aa.js} +1 -1
- package/editor-web/assets/{mermaid-parser.core-DTLyYXbn.js → mermaid-parser.core-Bw8re-WE.js} +3 -3
- package/editor-web/assets/mermaid.core-Cc2GIqBr.js +44 -0
- package/editor-web/assets/{mindmap-definition-6OY57UG3-DSWHcglH.js → mindmap-definition-6OY57UG3-C6MUl_S_.js} +3 -3
- package/editor-web/assets/minus-CbPnUIOy.js +1 -0
- package/editor-web/assets/{packet-JDAUHWVQ-_k1BF29s.js → packet-JDAUHWVQ-C75RnvC5.js} +1 -1
- package/editor-web/assets/{pegDiagram-ECIUJNBX-B22YyWAa.js → pegDiagram-ECIUJNBX-ChjmsdV4.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-CSwV32hj.js → pie-XZMESJXO-BaKxJQpj.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-rSFNeWnq.js → pieDiagram-GNMPY74T-CT2ez8pr.js} +1 -1
- package/editor-web/assets/progress-CwKcXARv.js +6 -0
- package/editor-web/assets/props-form-D5oKHfpk.js +1 -0
- package/editor-web/assets/purify.es-B9ve_eFf.js +3 -0
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-Xrntfg4j.js → quadrantDiagram-D57K4MC3-BJItlTfk.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-Dwq5qiNw.js → radar-ABXABTNO-DnLzBlTo.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-sIUGWcZh.js → railroad-I3PHUGI6-D5hj6Yv3.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-1rWlT9BX.js → railroad-abnf-LNEFI6M7-DUZlZoPu.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-DWdkzEHc.js → railroad-ebnf-DWYD2UWJ-CDyyDC6d.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-CME0JBbV.js → railroad-peg-JR7BVNR7-CC3ImNnT.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-Ch4BpP22.js → railroadDiagram-Y72NRBL7-Bjw-8Se5.js} +1 -1
- package/editor-web/assets/{react-Bk7NnOLX.js → react-Edyoga_4.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-CgE-x3wN.js → requirementDiagram-EQYSW5RA-CDFnuEIO.js} +1 -1
- package/editor-web/assets/row-C_svyL8o.js +1 -0
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-DBf4G6n3.js → sankeyDiagram-SY24JHO5-CQPVLY1w.js} +1 -1
- package/editor-web/assets/schemas-moE_A7Nj.js +1 -0
- package/editor-web/assets/{scissors-BURkYWPv.js → scissors-B_xOiUhd.js} +1 -1
- package/editor-web/assets/{search-jKDvFIEU.js → search-Ba2BbT6T.js} +1 -1
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-Bz07CoUS.js → sequenceDiagram-BLEHNHQU-BQzuLmBX.js} +1 -1
- package/editor-web/assets/{session-CUCSWPTE.js → session-s1I85rox.js} +1 -1
- package/editor-web/assets/{sigma-CY2Chbro.js → sigma-DSUsJhMn.js} +1 -1
- package/editor-web/assets/slides-oQ_C0SVJ.js +1 -0
- package/editor-web/assets/snapshots-BPJKywuN.js +1 -0
- package/editor-web/assets/{sound-DUCxe9eC.js → sound-bTlco_K3.js} +1 -1
- package/editor-web/assets/split-7CVjIkSU.js +3 -0
- package/editor-web/assets/square-arrow-out-up-right-DF5dvsSp.js +1 -0
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-DuqAmDPP.js → stateDiagram-v2-A6IESKWZ-DOuageUf.js} +7 -7
- package/editor-web/assets/{sticky-note-C5qUDHhC.js → sticky-note-BdkIu5_D.js} +1 -1
- package/editor-web/assets/{strikethrough-DP-7tMz0.js → strikethrough-BwXWi4zg.js} +1 -1
- package/editor-web/assets/surface-DtCjIlrq.js +1 -0
- package/editor-web/assets/svg-CWIBMIQ9.js +1 -0
- package/editor-web/assets/swatch-DhztHwPU.js +1 -0
- package/editor-web/assets/{swimlanes-B3ENRKFQ-C7sOL6rB.js → swimlanes-B3ENRKFQ-CXKkok7X.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-C3Car2M0.js +8 -0
- package/editor-web/assets/switch-8MU4Nfxe.js +1 -0
- package/editor-web/assets/{syntax-DSsHrzWF.js → syntax-CU_WPKxt.js} +1 -1
- package/editor-web/assets/{table-CTjNpE4W.js → table-DRbddzx0.js} +1 -1
- package/editor-web/assets/tabs-CiF1N-pL.js +1 -0
- package/editor-web/assets/tag-CIfWT8B_.js +1 -0
- package/editor-web/assets/text-align-start-Cic2-TLh.js +1 -0
- package/editor-web/assets/textarea-D7TnPwv1.js +1 -0
- package/editor-web/assets/{timeline-definition-JXYKGLGB-CaLYz9mc.js → timeline-definition-JXYKGLGB-DgAjAeZp.js} +3 -3
- package/editor-web/assets/{treeView-D4JQ5SDB-D1P1Kyxc.js → treeView-D4JQ5SDB-C0Xvnhck.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-2YaFL53t.js → treemap-SAJKECNS-aXfKAeSX.js} +1 -1
- package/editor-web/assets/{undo-2-DUGGyBdX.js → undo-2-C47jrRp5.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-uYdbUhUS.js → usecaseDiagram-WPOLBNNX-CvUlBa-L.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-DHepmX4t.js → vennDiagram-Q3Y3IDCW-qMJ1iCxs.js} +3 -3
- package/editor-web/assets/{video-Xl-OaXRc.js → video-DQrjo1TI.js} +1 -1
- package/editor-web/assets/{wardley-7MLQ67FV-Dx0MOPV1.js → wardley-7MLQ67FV-DEdnH0by.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-BX8ElwDW.js → wardleyDiagram-IVAIDKWA-Bt-B2hQ5.js} +1 -1
- package/editor-web/assets/{whole-word-6DliXke2.js → whole-word-D3ZAtnkw.js} +1 -1
- package/editor-web/assets/{words-B2FXYyeZ.js → words-0Ww2RyT4.js} +1 -1
- package/editor-web/assets/{words-DFIhHhHF.js → words-XlXG79Ur.js} +1 -1
- package/editor-web/assets/workbook-FSSUiIp9.js +45 -0
- package/editor-web/assets/x-DlhyIKuu.js +41 -0
- package/editor-web/assets/{xychartDiagram-4URNHDU4-DoWQRJUS.js → xychartDiagram-4URNHDU4-DV4bSzTb.js} +1 -1
- package/editor-web/assets/{zoom-in-C4lxmIDE.js → zoom-in-PgsC94hP.js} +1 -1
- package/editor-web/index.html +8 -6
- package/package.json +2 -2
- package/editor-web/assets/arrow-down-DzZjFrBL.js +0 -1
- package/editor-web/assets/arrow-up-hdmh9LVD.js +0 -1
- package/editor-web/assets/article-DHFgHYjv.js +0 -3
- package/editor-web/assets/article-Dt9id9Y9.js +0 -7
- package/editor-web/assets/button-BVQH7zxz.js +0 -41
- package/editor-web/assets/calc-worker-jImBXoeb.js +0 -45
- package/editor-web/assets/channel-Dkg198L0.js +0 -1
- package/editor-web/assets/chart-BC3kUUDD.js +0 -2
- package/editor-web/assets/chunk-DSNLSHJZ-BFnyvrWg.js +0 -129
- package/editor-web/assets/code-BID_OoRp.js +0 -1
- package/editor-web/assets/collaborator-2qfw-8OJ.js +0 -1
- package/editor-web/assets/dist-5HNrQ9AU.js +0 -45
- package/editor-web/assets/dist-BPecIPz6.js +0 -530
- package/editor-web/assets/dist-BXJKASX4.js +0 -24
- package/editor-web/assets/dist-BeDRTqQ8.js +0 -38
- package/editor-web/assets/dist-BlL-4sl3.js +0 -43
- package/editor-web/assets/dist-BuqBg8k8.js +0 -1
- package/editor-web/assets/dist-BwW08gSh.js +0 -1
- package/editor-web/assets/dist-C30Thvb3.js +0 -1
- package/editor-web/assets/dist-Cj5AmpVb.js +0 -5
- package/editor-web/assets/dist-CjjnDOa8.js +0 -3
- package/editor-web/assets/dist-D7ur8721.js +0 -6
- package/editor-web/assets/dist-DOHhp09C.js +0 -4
- package/editor-web/assets/dist-LhFEYZza.js +0 -16
- package/editor-web/assets/flowDiagram-IUGLLWBU-C7ZmHJZW.js +0 -1
- package/editor-web/assets/hint-mQB8slJ2.js +0 -1
- package/editor-web/assets/index-BGAXezRR.js +0 -28
- package/editor-web/assets/index-Br4a-QEv.css +0 -2
- package/editor-web/assets/mermaid.core-B8478wZ1.js +0 -44
- package/editor-web/assets/minus-D1tgAHbU.js +0 -1
- package/editor-web/assets/progress-udl4pNsP.js +0 -6
- package/editor-web/assets/props-form-B6mYjTgZ.js +0 -1
- package/editor-web/assets/row-dgHEAE7h.js +0 -1
- package/editor-web/assets/schemas-B89k2jEC.js +0 -1
- package/editor-web/assets/slides-BdaWgL_N.js +0 -1
- package/editor-web/assets/snapshots-CTS2iez5.js +0 -56
- package/editor-web/assets/split-mDSkdQkd.js +0 -3
- package/editor-web/assets/surface-D9qJjJQL.js +0 -1
- package/editor-web/assets/svg-nJtFNJ-7.js +0 -1
- package/editor-web/assets/swatch-S8YuBYyj.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-CQ2aWYP-.js +0 -8
- package/editor-web/assets/switch-D5kPl2jO.js +0 -1
- package/editor-web/assets/tabs-C0AHyuE5.js +0 -1
- package/editor-web/assets/textarea-mzr9Kfuf.js +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{chartColor as te,chartFrame as ne,docChartSvg as ie}from"./chart.js";import{emojiPicturesScript as oe}from"@allyhub/browser/emoji";export{EMOJI_PATTERN}from"@allyhub/browser/emoji";import{BACKGROUNDS as B,TEXT_COLORS as D}from"./color.js";import{columnWidths as ae,COLUMN_GAP as se}from"./columns.js";import{COMPONENT_WIDTH as U,componentName as re}from"./component.js";import{citationText as de,citedOf as le,sourceList as ce}from"./cite.js";import{blockId as pe,captionNumbers as fe,contentsTitle as he,numberedCaption as R,writtenInChinese as ge,withoutTitle as ue}from"./captions.js";import{DRAWN_CODE as K,mathHtml as me}from"./math.js";import{charsAcross as X,columnShares as $e,emptyHead as be,numberColumns as ke}from"./table.js";import{splitTitle as
|
|
3
|
-
`)}function J(i,n=""){const{list:e,style:a}=i.sources;return e.length===0?"":`<section class="sources" data-style="${a}"${n}><ol>${e.map(s=>`<li id="source-${p(s.item.id)}">${s.pieces.map(t=>t.italic?`<i>${p(t.text)}</i>`:p(t.text)).join("")}</li>`).join("")}</ol></section>`}const L=i=>i===void 0?"":` id="${p(i)}"`;function
|
|
4
|
-
`).map(n=>`<span class="line">${p(n)}</span>`).join(""),W=(i,n,e)=>i?.length?`<div class="under">${
|
|
2
|
+
import{chartColor as te,chartFrame as ne,docChartSvg as ie}from"./chart.js";import{emojiPicturesScript as oe}from"@allyhub/browser/emoji";export{EMOJI_PATTERN}from"@allyhub/browser/emoji";import{BACKGROUNDS as B,TEXT_COLORS as D}from"./color.js";import{columnWidths as ae,COLUMN_GAP as se}from"./columns.js";import{COMPONENT_WIDTH as U,componentName as re}from"./component.js";import{citationText as de,citedOf as le,sourceList as ce}from"./cite.js";import{blockId as pe,captionNumbers as fe,contentsTitle as he,numberedCaption as R,writtenInChinese as ge,withoutTitle as ue}from"./captions.js";import{DRAWN_CODE as K,mathHtml as me}from"./math.js";import{charsAcross as X,columnShares as $e,emptyHead as be,numberColumns as ke,withTableData as xe}from"./table.js";import{splitTitle as we}from"./title.js";import{PAPER as l,TONE_COLORS as Z,tagColors as ye}from"./paper.js";import{COVER_HEIGHT_MM as Se,everyBlock as q,innerBlocks as ve,noteNumbers as Ce,statTone as ze}from"./model.js";import{effectiveLook as H,lineMultiple as Ee,resolvePage as j,SINGLE_LINE as I}from"./page.js";export const PAGE_FACES={sans:'Carlito, Calibri, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif',serif:'Caladea, Cambria, "Noto Serif SC", "Songti SC", Georgia, serif',times:'Tinos, "Times New Roman", Times, "Noto Serif SC", serif',mono:'Cousine, "Courier New", "Noto Sans SC", monospace',song:'"Noto Serif SC", "Songti SC", SimSun, "宋体", serif',hei:'"Noto Sans SC", "PingFang SC", SimHei, "黑体", sans-serif',fangsong:'FangSong, STFangsong, "仿宋", "FangSong_GB2312", "Noto Serif SC", serif',kai:'"LXGW WenKai", KaiTi, STKaiti, "楷体", "Noto Serif SC", serif',xiaobiaosong:'"FZXiaoBiaoSong-B05S", "方正小标宋简体", "Noto Serif SC", "Songti SC", serif'};export function pageFaces(i={}){const n=H(i).font??"sans";return{text:PAGE_FACES[n],heading:PAGE_FACES[n],mono:PAGE_FACES.mono}}export const pageAccent=(i={})=>i.accent===void 0?void 0:te(i.accent);export{BACKGROUNDS,TEXT_COLORS}from"./color.js";export function blockNumbers(i){const n=new Map;for(const e of q(i))n.set(e,n.size);return n}const p=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),O=(i,n)=>n[i]??(/^(#[0-9a-f]{3,8}|[a-z]+|(rgb|hsl)a?\([\d\s.,%/]+\))$/i.test(i)?i:void 0),h=(i,n)=>{const e=n.ids?.get(i);return e===void 0?"":` data-b="${String(e)}"`};export function headingAnchors(i){const n=new Map,e=new Map;for(const a of q(i)){if(a.type!=="heading")continue;const s=a.content.map(r=>r.text).join("").trim().toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,"").replace(/\s/gu,"-"),t=s===""?"section":s,o=e.get(t)??0;e.set(t,o+1),n.set(a,o===0?t:`${t}-${String(o)}`)}return n}function x(i,n){return i.map(e=>{if(e.cite!==void 0){const{items:d,numbers:c,style:f}=n.sources,g=le(e.cite).keys[0],w=p(de(e.cite,d,c,f));return g!==void 0&&c.has(g)?`<a class="cite" href="#source-${p(g)}">${w}</a>`:`<span class="cite">${w}</span>`}if(e.note!==void 0){const d=n.notes.get(e.note.toLowerCase());return d===void 0?`<sup class="fn">[${p(e.note)}]</sup>`:`<sup class="fn"><a href="#note-${String(d)}">${String(d)}</a></sup>`}const a=e.text===""&&e.href?.startsWith("#")===!0?n.refs.get(decodeURIComponent(e.href.slice(1)))??"":e.text;let s=p(a).replace(/\n/g,"<br>");const t=e.styles;t.code&&(s=`<code>${s}</code>`),t.strike&&(s=`<s>${s}</s>`),t.italic&&(s=`<em>${s}</em>`),t.bold&&(s=`<strong>${s}</strong>`),t.underline&&(s=`<u>${s}</u>`);const o=t.color===void 0?void 0:O(t.color,D),r=t.background===void 0?void 0:O(t.background,B);if((o!==void 0||r!==void 0)&&(s=`<span style="${o===void 0?"":`color:${o};`}${r===void 0?"":`background:${r};`}">${s}</span>`),t.tag!==void 0){const d=ye(t.tag);s=`<span class="tag" style="background:${d.bg};color:${d.fg}">${s}</span>`}return e.href!==void 0&&/^(https?:|mailto:|#|\/|\.)/i.test(e.href)&&(s=`<a href="${p(e.href)}">${s}</a>`),s}).join("")}function z(i,n=!1){if(!i)return"";const e=i.color===void 0?void 0:O(i.color,D),a=i.background===void 0?void 0:O(i.background,B),s=[i.align===void 0?"":`text-align:${i.align};`,e===void 0?"":`color:${e};`,a===void 0?"":n?`background:${a};`:`background:${a};padding:0.15em 0.4em;border-radius:3px;`].join("");return s===""?"":` style="${s}"`}const Y=i=>i.type==="bullet"||i.type==="numbered"||i.type==="check";function S(i,n,e){const a=[];let s=0;for(;s<i.length;){const t=i[s];if(t===void 0)break;if(Y(t)){const o=t.type==="numbered";let r=s;const d=[];for(;r<i.length;){const f=i[r];if(!f||!Y(f)||f.type==="numbered"!==o)break;const g=f.type==="check"?`<span class="box${f.checked?" done":""}"></span>`:"";d.push(`<li${h(f,e)}${f.type==="check"?` class="task${f.checked?" done":""}"`:""}${z(f.look)}>${g}<span class="words">${x(f.content,e)}</span>${S(f.children??[],n,e)}</li>`),r++}const c=t.type==="numbered"&&t.start!==void 0?` start="${String(t.start)}"`:"";a.push(o?`<ol${c}>${d.join("")}</ol>`:`<ul>${d.join("")}</ul>`),s=r;continue}switch(s++,t.type){case"paragraph":a.push(`<p${h(t,e)}${z(t.look)}>${x(t.content,e)||" "}</p>${W(t.children,n,e)}`);break;case"heading":{const o=`h${String(t.level)}`;a.push(`<${o} id="${p(e.anchors.get(t)??"")}"${h(t,e)}${z(t.look)}>${x(t.content,e)}</${o}>${W(t.children,n,e)}`);break}case"toggle":a.push(`<p${h(t,e)}${z(t.look)}>${x(t.content,e)}</p>${W(t.children,n,e)}`);break;case"quote":a.push(`<blockquote${h(t,e)}${z(t.look)}><p>${x(t.content,e)}</p>${S(t.children??[],n,e)}</blockquote>`);break;case"callout":a.push(`<div class="callout"${h(t,e)}${z(t.look,!0)}>${t.icon===void 0?"":`<span class="callout-icon">${p(t.icon)}</span>`}<div><p>${x(t.content,e)}</p>${S(t.children??[],n,e)}</div></div>`);break;case"card":a.push(`<div class="card${cardKept(t,j(n.page))?" kept":""}"${h(t,e)}>${t.title===void 0&&t.subtitle===void 0?"":`<div class="card-head">${t.title===void 0?"":`<p class="card-title">${p(t.title)}</p>`}${t.subtitle===void 0?"":`<p class="card-subtitle">${p(t.subtitle)}</p>`}</div>`}${S(t.children??[],{...n,room:(n.room??U)-2*Ne},e)}</div>`);break;case"stats":a.push(`<div class="stats"${h(t,e)} style="grid-template-columns:repeat(${String(t.stats.length)},minmax(0,1fr))">${t.stats.map(o=>{const r=ze(o),d=o.delta===void 0&&o.note===void 0?"":`<p class="stat-foot">${o.delta===void 0?"":`<span class="stat-delta" style="color:${Z[r]}">${p(o.delta)}</span>`}${o.delta!==void 0&&o.note!==void 0?" ":""}${o.note===void 0?"":p(o.note)}</p>`,c=o.trend===void 0?"":trendSvg(o.trend,Z[r==="flat"?"flat":r]);return`<div class="stat"><p class="stat-label">${p(o.label)}</p><p class="stat-value">${p(o.value)}</p>${d}${c}</div>`}).join("")}</div>`);break;case"code":a.push(je(t,n,h(t,e)));break;case"columns":{const o=t.columns.map(d=>`${String(d.width??1)}fr`).join(" "),r=ae(t,n.room);a.push(`<div class="columns${columnsKept(t,j(n.page))?" kept":""}"${h(t,e)} style="grid-template-columns:${o}">${t.columns.map((d,c)=>`<div class="column">${S(d.blocks,{...n,room:r[c]??U},e)}</div>`).join("")}</div>`);break}case"chart":{const o=e.numbers.get(t),r=o===void 0?t:ue(t),{svg:d,problems:c}=ie(r,{...n,font:pageFaces(n.page).text}),{width:f}=ne(t,n.room),g=o===void 0||t.title===void 0?"":`<figcaption>${p(R(t.title,o))}</figcaption>`;a.push(d===void 0?`<div class="embed"${h(t,e)} data-chart>${p(t.title??"Chart")}<br><small>${p(c.join("; "))}</small></div>`:`<figure class="chart"${L(t.id)}${h(t,e)} style="max-width:${String(f)}px">${d}${g}</figure>`);break}case"image":{const o=n.image?.(t.src)??t.src;a.push(`<figure${L(t.id)}${h(t,e)}${t.align===void 0?"":` style="text-align:${t.align}"`}><img src="${p(o)}" alt="${p(t.alt??"")}"${t.width===void 0?"":` width="${String(t.width)}"`}>${t.caption===void 0?"":`<figcaption>${p(R(t.caption,e.numbers.get(t)))}</figcaption>`}</figure>`);break}case"table":{const o=t.head===void 0||t.head==="both",r=t.head==="column"||t.head==="both",d=ke(t),c=be(t),f=(m,$,y)=>`<tr${e.ids===void 0?"":` data-row="${String(y)}"`}>${m.map((_,F)=>{const G=$||r&&F===0?"th":"td",ee=d.has(F)?' class="num"':"";return`<${G}${ee}>${x(_,e)}</${G}>`}).join("")}</tr>`,g=j(n.page),w=(t.widths??[]).reduce((m,$)=>m+($??0),0),P=n.room??g.textWidth*96/25.4,E=$e(t,{across:X(Math.max(P-w,0),g.spacing.small),margins:X(2*g.spacing.cell.side*96/72,g.spacing.small)}),C=E.reduce((m,$,y)=>m+(t.widths?.[y]?0:$),0)||1,T=`<colgroup>${E.map((m,$)=>{const y=t.widths?.[$],_=b(m/C*100);return y?`<col style="width:${String(y)}px">`:w===0?`<col style="width:${_}%">`:`<col style="width:calc((100% - ${String(w)}px) * ${b(m/C)})">`}).join("")}</colgroup>`,[M,...N]=t.rows,A=o&&M!==void 0&&!c?`<thead>${f(M,!0,0)}</thead>`:"",u=(o?N:t.rows).map((m,$)=>f(m,!1,o?$+1:$)).join(""),v=t.caption===void 0?"":`<caption>${p(R(t.caption,e.numbers.get(t)))}</caption>`;a.push(`<table${L(t.id)}${h(t,e)}>${v}${T}${A}<tbody>${u}</tbody></table>`);break}case"divider":a.push(`<hr${h(t,e)}>`);break;case"pagebreak":a.push(`<div class="page-break"${h(t,e)}></div>`);break;case"toc":a.push(Te(t,e));break;case"bibliography":e.listed||(e.listed=!0,a.push(J(e,h(t,e))));break;case"note":break;case"component":{const o=n.component?.(t),r=t.align===void 0?"":` style="text-align:${t.align}"`;a.push(o===void 0?`<div class="embed"${h(t,e)} data-component>${p(re(t))}</div>`:`<figure${L(t.id)}${h(t,e)}${r}><img src="${p(o)}" alt="${p(t.alt??"")}"${t.width===void 0?"":` width="${String(t.width)}"`}>${t.caption===void 0?"":`<figcaption>${p(R(t.caption,e.numbers.get(t)))}</figcaption>`}</figure>`);break}case"embed":{const o=n.embed?.(t.source,e.embeds);e.embeds++;const r=/^<\s*([A-Za-z][\w.]*)/.exec(t.source.trim())?.[1];a.push(o===void 0?`<div class="embed"${h(t,e)} data-embed>${p(r??"")}</div>`:`<div${h(t,e)}>${o}</div>`);break}case"source":break}}return a.join(`
|
|
3
|
+
`)}function J(i,n=""){const{list:e,style:a}=i.sources;return e.length===0?"":`<section class="sources" data-style="${a}"${n}><ol>${e.map(s=>`<li id="source-${p(s.item.id)}">${s.pieces.map(t=>t.italic?`<i>${p(t.text)}</i>`:p(t.text)).join("")}</li>`).join("")}</ol></section>`}const L=i=>i===void 0?"":` id="${p(i)}"`;function Te(i,n){const e=i.levels??3,a=n.headings.filter(r=>r.block.level<=e),s=Math.min(...a.map(r=>r.block.level)),t=a.map(({block:r,anchor:d})=>{const c=n.headingPage?.(d);return`<li style="padding-left:${String(r.level-s)}em"><a href="#${p(d)}"><span class="toc-words">${x(r.content,n)}</span>${c===void 0?"":`<span class="toc-fill"></span><span class="toc-page">${String(c)}</span>`}</a></li>`}),o=he(i,n.chinese);return`<nav class="toc"${h(i,n)}>${o===""?"":`<p class="toc-title">${p(o)}</p>`}<ol>${t.join("")}</ol></nav>`}export function keptWhole(i,n,e=0){const a=.35277777777777775,s="pt"in n.lineHeight?n.lineHeight.pt:n.lineHeight.multiple*(I[n.font]??1.22)*n.size,t=Math.max(20,(n.textWidth/a-30)/(n.size*.5)),o=r=>r.reduce((d,c)=>{if(c.type==="table")return d+c.rows.length*1.6+1;if(c.type==="chart"||c.type==="image"||c.type==="component")return d+18;if(c.type==="card")return d+2+o(c.children??[]);const f="content"in c?Math.max(1,Math.ceil(c.content.map(g=>g.text).join("").length/t))+.5:2;return d+f+o(ve(c))},0);return(e+o(i))*s<n.textHeight/a*.6}export const cardKept=(i,n)=>keptWhole(i.children??[],n,2),columnsKept=(i,n)=>i.columns.every(e=>keptWhole(e.blocks,n));const Ne=15;export function trendSvg(i,n){const s=Math.min(...i),o=Math.max(...i)-s||1,d=i.map((c,f)=>[f/Math.max(1,i.length-1)*100,22-(c-s)/o*20]).map(([c,f],g)=>`${g===0?"M":"L"}${(c??0).toFixed(1)} ${(f??0).toFixed(1)}`).join(" ");return`<svg class="stat-trend" viewBox="0 0 ${String(100)} ${String(24)}" preserveAspectRatio="none" aria-hidden="true"><path d="${d}" fill="none" stroke="${n}" stroke-width="1.5" vector-effect="non-scaling-stroke" stroke-linejoin="round" stroke-linecap="round"/></svg>`}function je(i,n,e=""){if(i.language===K.math)return`<div class="math"${e}>${me(i.code).html}</div>`;if(i.language===K.mermaid){const a=n.diagram?.(i.code);if(a?.svg!==void 0)return`<figure class="diagram"${e}>${a.svg}</figure>`;if(a?.error!==void 0)return`<pre${e}><code>${p(i.code)}</code></pre><p class="drawn-error">Mermaid: ${p(a.error)}</p>`}return`<pre${e}><code>${Me(i.code)}</code></pre>`}const Me=i=>i.split(`
|
|
4
|
+
`).map(n=>`<span class="line">${p(n)}</span>`).join(""),W=(i,n,e)=>i?.length?`<div class="under">${S(i,n,e)}</div>`:"";export const DOC_CSS=`
|
|
5
5
|
/* The page's side margins are the text column's own padding, so a cover
|
|
6
6
|
can reach the page's edges. The default page is Letter (PAGE_DEFAULTS). */
|
|
7
7
|
@page { size: 215.9mm 279.4mm; margin: 18mm 0; }
|
|
8
8
|
* { box-sizing: border-box; }
|
|
9
9
|
html { font-size: 11pt; }
|
|
10
|
-
body { margin: 0; color: ${
|
|
10
|
+
body { margin: 0; color: ${l.ink}; font-family: Carlito, Calibri, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.4; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
|
|
11
11
|
main { max-width: 215.9mm; margin: 0 auto; padding: 0 20mm; overflow-x: clip; }
|
|
12
12
|
/* Every block's space and step in is the page's (pageCss, from BlockSpacing). */
|
|
13
13
|
h1, h2, h3, h4, h5, h6 { line-height: inherit; margin: 0; break-after: avoid; }
|
|
@@ -19,18 +19,18 @@ h2 { font-size: 1.45em; }
|
|
|
19
19
|
.toc-title { font-weight: bold; line-height: inherit; break-after: avoid; }
|
|
20
20
|
h3 { font-size: 1.15em; }
|
|
21
21
|
h4, h5, h6 { font-size: 1em; }
|
|
22
|
-
h5 { color: ${
|
|
23
|
-
h6 { color: ${
|
|
22
|
+
h5 { color: ${l.lead}; }
|
|
23
|
+
h6 { color: ${l.leadSoft}; font-weight: 500; }
|
|
24
24
|
p, ul, ol, li { margin: 0; }
|
|
25
25
|
ul, ol { padding-left: 0; }
|
|
26
26
|
/* A task as the editor draws it: a box, ticked and the words struck when done. */
|
|
27
27
|
li.task { list-style: none; }
|
|
28
|
-
li.task .box { display: inline-block; width: 0.95em; height: 0.95em; margin-right: 0.55em; border: 1.5px solid ${
|
|
29
|
-
li.task .box.done { border-color: ${
|
|
30
|
-
li.task.done > .words { color: ${
|
|
31
|
-
blockquote { margin: 0; border-left: var(--quote-rule, 1px) solid ${
|
|
32
|
-
code { font-family: Cousine, "Courier New", monospace; font-size: 0.88em; background: ${
|
|
33
|
-
pre { margin: 0; font-family: Cousine, "Courier New", monospace; background: ${
|
|
28
|
+
li.task .box { display: inline-block; width: 0.95em; height: 0.95em; margin-right: 0.55em; border: 1.5px solid ${l.ruleStrong}; border-radius: 3px; vertical-align: -0.14em; }
|
|
29
|
+
li.task .box.done { border-color: ${l.ink}; background: ${l.ink} url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-4.9' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 85% no-repeat; }
|
|
30
|
+
li.task.done > .words { color: ${l.leadSoft}; text-decoration: line-through; text-decoration-color: ${l.ruleStrong}; }
|
|
31
|
+
blockquote { margin: 0; border-left: var(--quote-rule, 1px) solid ${l.ruleStrong}; color: ${l.lead}; }
|
|
32
|
+
code { font-family: Cousine, "Courier New", monospace; font-size: 0.88em; background: ${l.stone2}; border-radius: 3px; padding: 0.12em 0.34em; }
|
|
33
|
+
pre { margin: 0; font-family: Cousine, "Courier New", monospace; background: ${l.stone}; border: 0.5pt solid ${l.stone}; border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; break-inside: avoid; }
|
|
34
34
|
pre code { background: none; padding: 0; }
|
|
35
35
|
pre .line { display: block; min-height: 1lh; padding-left: 2ch; text-indent: -2ch; }
|
|
36
36
|
/* Tables as the editor sets them, a report's three rules (booktabs): a
|
|
@@ -38,56 +38,56 @@ pre .line { display: block; min-height: 1lh; padding-left: 2ch; text-indent: -2c
|
|
|
38
38
|
by lines, no lines between columns; laid
|
|
39
39
|
out as Word lays them, each column as wide as it is set, the rest shared. */
|
|
40
40
|
table { border-collapse: collapse; width: 100%; table-layout: fixed; }
|
|
41
|
-
th, td { border: 0; border-bottom: 0.5pt solid ${
|
|
42
|
-
table > thead > tr:first-child > *, table:not(:has(> thead)) > tbody > tr:first-child > * { border-top: 1pt solid ${
|
|
43
|
-
table > tbody > tr:last-child > * { border-bottom: 1pt solid ${
|
|
41
|
+
th, td { border: 0; border-bottom: 0.5pt solid ${l.ruleMid}; text-align: left; vertical-align: top; }
|
|
42
|
+
table > thead > tr:first-child > *, table:not(:has(> thead)) > tbody > tr:first-child > * { border-top: 1pt solid ${l.ruleStrong}; }
|
|
43
|
+
table > tbody > tr:last-child > * { border-bottom: 1pt solid ${l.ruleStrong}; }
|
|
44
44
|
th { font-weight: 600; }
|
|
45
|
-
thead th { border-bottom: 0.75pt solid ${
|
|
45
|
+
thead th { border-bottom: 0.75pt solid ${l.ruleStrong}; background: ${l.stone3}; }
|
|
46
46
|
th.num, td.num { text-align: right; }
|
|
47
47
|
figure { break-inside: avoid; }
|
|
48
48
|
img { max-width: 100%; }
|
|
49
|
-
figcaption { color: ${
|
|
50
|
-
hr { box-sizing: content-box; border: 0; border-bottom: 0.5pt solid ${
|
|
51
|
-
a { color: inherit; text-decoration: underline; text-decoration-color: ${
|
|
49
|
+
figcaption { color: ${l.leadSoft}; }
|
|
50
|
+
hr { box-sizing: content-box; border: 0; border-bottom: 0.5pt solid ${l.rule}; }
|
|
51
|
+
a { color: inherit; text-decoration: underline; text-decoration-color: ${l.ruleStrong}; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
|
|
52
52
|
/* A callout's sign in a column of its own, as wide as Word's cell for it. */
|
|
53
53
|
/* A card: blocks in a hairline border under a title and a quieter line. */
|
|
54
|
-
.card { border: 0.5pt solid ${
|
|
54
|
+
.card { border: 0.5pt solid ${l.rule}; border-radius: 8px; background: ${l.sheet}; }
|
|
55
55
|
.card.kept, .columns.kept { break-inside: avoid; }
|
|
56
56
|
.card-head p { margin: 0; }
|
|
57
57
|
.card-title { font-weight: 700; }
|
|
58
|
-
.card-subtitle { color: ${
|
|
58
|
+
.card-subtitle { color: ${l.lead}; }
|
|
59
59
|
/* Figures side by side: each a label over its value, how it moved under it. */
|
|
60
60
|
.stats { display: grid; break-inside: avoid; }
|
|
61
|
-
.stat { border: 0.5pt solid ${
|
|
61
|
+
.stat { border: 0.5pt solid ${l.rule}; border-radius: 8px; background: ${l.sheet}; }
|
|
62
62
|
.stat p { margin: 0; }
|
|
63
|
-
.stat-label, .stat-foot { color: ${
|
|
64
|
-
.stat-value { font-weight: 700; color: ${
|
|
63
|
+
.stat-label, .stat-foot { color: ${l.lead}; }
|
|
64
|
+
.stat-value { font-weight: 700; color: ${l.ink}; }
|
|
65
65
|
.stat-trend { display: block; width: 100%; height: 18pt; margin-top: 3pt; }
|
|
66
66
|
/* A tag: a word or two in a pill of its colour. */
|
|
67
67
|
.tag { border-radius: 999px; padding: 0 0.4em; font-size: 0.85em; }
|
|
68
|
-
.callout { display: flex; border-radius: 6px; background: ${
|
|
68
|
+
.callout { display: flex; border-radius: 6px; background: ${l.stone}; break-inside: avoid; }
|
|
69
69
|
.callout-icon { flex: none; width: 1.8em; }
|
|
70
70
|
.callout > div { flex: 1; min-width: 0; }
|
|
71
|
-
.embed { border: 1px dashed ${
|
|
71
|
+
.embed { border: 1px dashed ${l.ruleMid}; border-radius: 6px; padding: 1.5em; text-align: center; color: ${l.leadSoft}; break-inside: avoid; }
|
|
72
72
|
/* A cover: a band of a picture across the top of the first page, edge to
|
|
73
73
|
edge (Notion's). */
|
|
74
|
-
.cover { height: ${String(
|
|
74
|
+
.cover { height: ${String(Se)}mm; margin: 0 -20mm 2.4em; overflow: hidden; break-inside: avoid; }
|
|
75
75
|
.cover img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
|
|
76
76
|
/* A footnote's mark, and the notes at the end under a short rule. */
|
|
77
77
|
sup.fn { font-size: 0.72em; line-height: 0; margin-left: 0.02em; font-variant-numeric: tabular-nums; }
|
|
78
|
-
sup.fn a { text-decoration: none; color: ${
|
|
79
|
-
.notes { margin-top: 2.5em; padding-top: 0.8em; border-top: 1px solid ${
|
|
78
|
+
sup.fn a { text-decoration: none; color: ${l.lead}; }
|
|
79
|
+
.notes { margin-top: 2.5em; padding-top: 0.8em; border-top: 1px solid ${l.rule}; width: 100%; font-size: 0.85em; color: ${l.lead}; }
|
|
80
80
|
.notes ol { padding-left: 1.6em; margin: 0; }
|
|
81
81
|
.notes li { margin: 0.25em 0; }
|
|
82
82
|
.notes li p { margin: 0; }
|
|
83
83
|
.page-break { break-after: page; height: 0; }
|
|
84
84
|
/* A mark set half wide at a line's end, as Word squeezes it (GRID_SQUEEZE). */
|
|
85
85
|
.squeezed { letter-spacing: -0.5em; }
|
|
86
|
-
caption { caption-side: top; text-align: left; color: ${
|
|
86
|
+
caption { caption-side: top; text-align: left; color: ${l.leadSoft}; }
|
|
87
87
|
/* The contents: each heading a link, its page after a line of dots. */
|
|
88
88
|
.toc ol { list-style: none; padding: 0; }
|
|
89
89
|
.toc a { display: flex; align-items: baseline; gap: 0.4em; color: inherit; text-decoration: none; }
|
|
90
|
-
.toc-fill { flex: 1; min-width: 1em; border-bottom: 1px dotted ${
|
|
90
|
+
.toc-fill { flex: 1; min-width: 1em; border-bottom: 1px dotted ${l.ruleMid}; }
|
|
91
91
|
.toc-page { font-variant-numeric: tabular-nums; }
|
|
92
92
|
/* Citations and the list of sources: numbered with a hanging number (GB/T 7714), or by author with a hanging line (APA, MLA) as deep as a paragraph's first line is set in (--hang). */
|
|
93
93
|
a.cite { color: inherit; text-decoration: none; }
|
|
@@ -110,10 +110,10 @@ figure.chart svg, figure.diagram svg { display: inline-block; max-width: 100%; h
|
|
|
110
110
|
a row never split, a table's head again on each page. */
|
|
111
111
|
p, li { orphans: 2; widows: 2; }
|
|
112
112
|
tr { break-inside: avoid; }
|
|
113
|
-
`;function
|
|
114
|
-
`)}export function docParts(i){const n=[];let e=[],a=!1;for(const s of i)s.type==="pagebreak"&&s.orientation!==void 0?(n.push({blocks:e,landscape:a}),e=[],a=s.orientation==="landscape"):e.push(s);return n.push({blocks:e,landscape:a}),n}const
|
|
113
|
+
`;function Ae(i,n,e){const a=[...q(i)].filter(o=>o.type==="note");return a.length===0?"":`<section class="notes"><ol>${a.map(o=>({note:o,n:e.notes.get(o.label.toLowerCase())})).sort((o,r)=>(o.n??1/0)-(r.n??1/0)).map(({note:o,n:r})=>`<li${h(o,e)}${r===void 0?"":` id="note-${String(r)}" value="${String(r)}"`}><p>${x(o.content,e)}</p>${S(o.children??[],n,e)}</li>`).join("")}</ol></section>`}const Q="body > h1:first-child, main > h1:first-child, article > h1:first-child, main > .cover + h1",k=i=>`${String(Math.round(i*100)/100)}mm`,b=i=>String(Math.round(i*1e3)/1e3);function Re(i){const n=i.spacing,e=o=>`${b(o)}pt`,a=e(n.after),s=e(n.step),t="pt"in i.lineHeight?e(i.lineHeight.pt):b(i.lineHeight.multiple*(I.mono??1));return[`p, ul, ol, blockquote, pre, table, figure, .math, .callout, .card, .stats, .embed, .sources li { margin: 0 0 ${a}; }`,`h1, h2, h3, h4, h5, h6 { margin: ${e(n.heading.before)} 0 ${e(n.heading.after)}; }`,`.toc-title { margin: ${e(n.heading.before)} 0 ${e(n.heading.after)}; }`,`${Q} { margin-top: 0; margin-bottom: ${e(n.title)}; }`,`ul, ol { padding-left: ${s}; } li ul, li ol { margin-bottom: 0; } li.task { margin-left: -${s}; } .under { margin-left: ${s}; }`,`:is(ul, ol) + :is(ul, ol) { margin-top: -${a}; }`,`blockquote { padding-left: calc(${e(n.quote)} - var(--quote-rule, 1px)); }`,`pre { padding: ${e(n.box.top)} ${e(n.box.side)}; font-size: ${e(n.small)}; line-height: ${t}; } pre code { font-size: inherit; }`,`.callout { padding: ${e(n.box.top)} ${e(n.box.side)} ${e(Math.max(n.box.top-n.after,0))}; }`,`.card { padding: ${e(n.card.top)} ${e(n.card.side)} ${e(Math.max(n.card.top-n.after,0))}; } .card-head { margin-bottom: ${a}; } .card-subtitle { font-size: ${e(n.small)}; }`,`.stats { gap: ${e(n.gap)}; } .stat { padding: ${e(n.card.top)} ${e(n.card.side)}; } .stat-label, .stat-foot { font-size: ${e(n.small)}; } .stat-value { font-size: ${e(n.figure)}; line-height: ${b(I[i.font]??I.sans??1.22)}; }`,`table { font-size: ${e(n.small)}; } th, td { padding: ${e(n.cell.top)} ${e(n.cell.side)}; }`,`caption { font-size: ${e(n.small)}; padding-bottom: ${e(n.caption)}; }`,`figcaption { font-size: ${e(n.small)}; margin-top: ${e(n.caption)}; }`,`hr { height: 1pt; margin: ${e(n.divider)} 0; }`,`.toc ol { margin: 0; } .toc li { margin: 0 0 ${e(n.contents)}; } .sources ol { margin: 0; }`]}function V(i,n,e){if(n===void 0)return;const a=[n.font===void 0?"":`font-family: ${PAGE_FACES[e.font]};`,n.size===void 0?"":`font-size: ${b(e.size)}pt;`,e.font==="xiaobiaosong"?"font-weight: 700;":n.weight===void 0?"":`font-weight: ${e.weight==="bold"?"700":"400"};`,n.align===void 0?"":`text-align: ${e.align};`,n.italic===void 0?"":`font-style: ${e.italic?"italic":"normal"};`,e.rule?`border-bottom: 0.5pt solid ${l.rule}; padding-bottom: ${b(HEADING_RULE_SPACE)}pt;`:""].join(" ");return a.trim()===""?void 0:`${i} { ${a.trim()} }`}export const HEADING_RULE_SPACE=3;export function pageCss(i={}){const n=H(i),e=j(i),a=pageFaces(i),s=pageAccent(n),t=[];if(n.paper!==void 0||n.orientation!==void 0||n.margins!==void 0){const{top:r,right:d,bottom:c,left:f}=e.margins;t.push(`@page { size: ${k(e.width)} ${k(e.height)}; margin: ${k(r)} 0 ${k(c)}; }`,`main { max-width: ${k(e.width)}; padding: 0 ${k(d)} 0 ${k(f)}; }`,`.cover { margin-left: -${k(f)}; margin-right: -${k(d)}; }`)}n.font!==void 0&&n.font!=="sans"&&t.push(`body { font-family: ${a.text}; }`,`h1, h2, h3, h4, h5, h6 { font-family: ${a.heading}; }`,`.toc-title { font-family: ${a.heading}; }`),(n.size!==void 0||n.grid!==void 0)&&t.push(`html { font-size: ${b(e.size)}pt; }`),t.push(`body { line-height: ${"pt"in e.lineHeight?`${b(e.lineHeight.pt)}pt`:b(Ee(e)??1)}; }`),t.push(...Re(e)),e.letterSpacing!==0&&t.push(`body { letter-spacing: ${b(e.letterSpacing)}em; }`),n.textIndent!==void 0&&n.textIndent>0&&t.push(`.sources { --hang: ${b(n.textIndent)}em; }`,`p { text-indent: ${b(n.textIndent)}em; }`,"blockquote p, .callout p, .notes p, .toc p { text-indent: 0; }"),n.textAlign==="justify"&&t.push("p, li { text-align: justify; }");const o=V(Q,n.title,e.title);o!==void 0&&t.push(o);for(const r of[1,2,3,4,5,6]){const d=V(r===1?"h1, .toc-title":`h${String(r)}`,n.headings?.[r],e.headings[r]);d!==void 0&&t.push(d)}return s!==void 0&&t.push(`a { color: ${s}; text-decoration-color: color-mix(in oklab, ${s} 45%, transparent); }`,`blockquote { --quote-rule: 2px; border-left-color: ${s}; }`),t.join(`
|
|
114
|
+
`)}export function docParts(i){const n=[];let e=[],a=!1;for(const s of i)s.type==="pagebreak"&&s.orientation!==void 0?(n.push({blocks:e,landscape:a}),e=[],a=s.orientation==="landscape"):e.push(s);return n.push({blocks:e,landscape:a}),n}const qe=`<script>
|
|
115
115
|
window.allyhubReady = ${oe({scope:"main",face:"Noto Color Emoji"})};
|
|
116
|
-
<\/script>`,
|
|
116
|
+
<\/script>`,He=`<script>
|
|
117
117
|
window.allyhubReady = (async (before) => {
|
|
118
118
|
await before;
|
|
119
119
|
await document.fonts.ready;
|
|
@@ -129,7 +129,7 @@ window.allyhubReady = (async (before) => {
|
|
|
129
129
|
if (el.matches("p") || el.children.length === el.querySelectorAll(":scope > .words, :scope > .box").length)
|
|
130
130
|
if (lines(el) < 4) el.style.breakInside = "avoid";
|
|
131
131
|
})(window.allyhubReady);
|
|
132
|
-
<\/script>`,
|
|
132
|
+
<\/script>`,Ie=`<script>
|
|
133
133
|
window.allyhubReady = (async (before) => {
|
|
134
134
|
await before;
|
|
135
135
|
await document.fonts.ready;
|
|
@@ -214,8 +214,8 @@ window.allyhubReady = (async (before) => {
|
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
})(window.allyhubReady);
|
|
217
|
-
<\/script>`;export function docHtml(i,n={}){const e=
|
|
218
|
-
`}${
|
|
217
|
+
<\/script>`;export function docHtml(i,n={}){const e=xe(i,n),a=headingAnchors(e),s=fe(e,n.page),{title:t}=we(e),o=new Map,r=[];for(const u of q(e)){const v=pe(u),m=s.get(u);if(v!==void 0&&m!==void 0&&o.set(v,m.label),u.type==="heading"){const $=a.get(u)??"";o.set($,u.content.map(y=>y.text).join("")),u!==t&&r.push({block:u,anchor:$})}}const d={embeds:0,notes:Ce(e),anchors:a,ids:n.ids?blockNumbers(e):void 0,numbers:s,refs:o,headings:r,headingPage:n.headingPage,chinese:ge(e),sources:(()=>{const u=H(n.page??{}).citationStyle??"apa",v=n.sources??[],m=ce(e,v,u);return{items:v,style:u,numbers:new Map(m.map($=>[$.item.id,$.n])),list:m}})(),listed:!1},c=docParts(e),f=n.part,g=f===void 0?void 0:c[f],w=g===void 0?c.flatMap(u=>u.blocks):g.blocks,P=f===void 0||f===0,E=f===void 0||f===c.length-1,C=P?n.page?.cover:void 0,T=C===void 0?void 0:n.image?.(C)??C,M=`${T===void 0?"":`<figure class="cover"><img src="${p(T)}" alt="" style="object-position:50% ${String(n.page?.coverY??50)}%"></figure>
|
|
218
|
+
`}${S(w,n,d)}${E&&!d.listed?J(d):""}${E?Ae(e,n,d):""}`,N=j(n.page),A=[pageCss(n.page),...g?.landscape===!0?[`@page { size: ${k(N.height)} ${k(N.width)}; }`,`main { max-width: ${k(N.height)}; }`]:[],...T===void 0?[]:["@page :first { margin-top: 0; }"]].filter(u=>u!=="").join(`
|
|
219
219
|
`);return`<!doctype html>
|
|
220
220
|
<html>
|
|
221
221
|
<head>
|
|
@@ -227,11 +227,11 @@ ${A}`}</style>
|
|
|
227
227
|
</head>
|
|
228
228
|
<body>
|
|
229
229
|
<main>
|
|
230
|
-
${
|
|
230
|
+
${M}
|
|
231
231
|
</main>
|
|
232
|
-
${Re}
|
|
233
|
-
${H(n.page??{}).grid===void 0?"":He}
|
|
234
232
|
${qe}
|
|
233
|
+
${H(n.page??{}).grid===void 0?"":Ie}
|
|
234
|
+
${He}
|
|
235
235
|
</body>
|
|
236
236
|
</html>
|
|
237
237
|
`}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export{DOC_CSS,EMOJI_PATTERN,PAGE_FACES,blockNumbers,docHtml,docParts,headingAnchors,pageAccent,pageCss,pageFaces,trendSvg}from"./html.js";export{CHART_BARS,ROUND_FRAME,CHART_PALETTE,CHART_SECOND_TONE,CHART_TEXT,SMOOTHED,chartColor,chartFrame,chartTheme,chartWords,docChart,docChartSvg}from"./chart.js";export{COMPONENT_ASPECT,COMPONENT_WIDTH,componentAt,componentDrawing,componentDrawingKey,componentDraws,componentName}from"./component.js";export{COLUMN_GAP,columnWidths}from"./columns.js";export{numberColumns}from"./table.js";export{CITATION_STYLES,citationText,citedKeys,citedOf,readSources,sourceList,sourceText,sourcePieces,withSources}from"./cite.js";export{blockId,captionNumbers,captionOf,captionWords,contentsTitle,numberedCaption,writtenInChinese}from"./captions.js";export{DRAWN_CODE,mathHtml}from"./math.js";export{DIAGRAM_TEXT_PX,PAPER,TONE_COLORS,diagramConfig,tagColors,tint}from"./paper.js";export{markdownOf,plainBlocks}from"./markdown.js";export*from"./model.js";export{CHINESE_SIZES,PAGE_DEFAULTS,PAGE_KEYS,PAGE_PRESETS,PAPERS,RUNNING_PLACES,effectiveLook,lineHeightPt,lineMultiple,SINGLE_LINE,marginBox,paperSize,presetLook,resolvePage,sizePt}from"./page.js";export{BLOCK_TAG,CALLOUT_TAG,CARD_TAG,STAT_ATTRIBUTES,STAT_TAG,STATS_TAG,TAG_TAG,CHART_ATTRIBUTES,CHART_TAG,COLUMN_TAG,COLUMNS_TAG,PAGE_BREAK_TAG,BIBLIOGRAPHY_TAG,TOC_TAG,COMPONENT_ATTRIBUTES,COMPONENT_TAG,TABLE_TAG,parseDoc}from"./parse.js";export{patchDoc}from"./patch.js";export{isTitle,retitle,splitTitle,titleText,withTitle}from"./title.js";export{frontMatterOf,withPage,writeBlocks}from"./write.js";export{COVER_NAMES,COVER_WORDS,coverFileName,coverSvg}from"./covers.js";
|
|
2
|
+
export{DOC_CSS,EMOJI_PATTERN,PAGE_FACES,blockNumbers,docHtml,docParts,headingAnchors,pageAccent,pageCss,pageFaces,trendSvg}from"./html.js";export{CHART_BARS,ROUND_FRAME,CHART_PALETTE,CHART_SECOND_TONE,CHART_TEXT,SMOOTHED,chartColor,chartFrame,chartTheme,chartWords,docChart,docChartSvg}from"./chart.js";export{COMPONENT_ASPECT,COMPONENT_WIDTH,componentAt,componentDrawing,componentDrawingKey,componentDraws,componentName}from"./component.js";export{COLUMN_GAP,columnWidths}from"./columns.js";export{numberColumns,tableRowsOf,withTableData}from"./table.js";export{CITATION_STYLES,citationText,citedKeys,citedOf,readSources,sourceList,sourceText,sourcePieces,withSources}from"./cite.js";export{blockId,captionNumbers,captionOf,captionWords,contentsTitle,numberedCaption,writtenInChinese}from"./captions.js";export{DRAWN_CODE,mathHtml}from"./math.js";export{DIAGRAM_TEXT_PX,PAPER,TONE_COLORS,diagramConfig,tagColors,tint}from"./paper.js";export{markdownOf,plainBlocks}from"./markdown.js";export*from"./model.js";export{CHINESE_SIZES,PAGE_DEFAULTS,PAGE_KEYS,PAGE_PRESETS,PAPERS,RUNNING_PLACES,effectiveLook,lineHeightPt,lineMultiple,SINGLE_LINE,marginBox,paperSize,presetLook,resolvePage,sizePt}from"./page.js";export{BLOCK_TAG,CALLOUT_TAG,CARD_TAG,STAT_ATTRIBUTES,STAT_TAG,STATS_TAG,TAG_TAG,CHART_ATTRIBUTES,CHART_TAG,COLUMN_TAG,COLUMNS_TAG,PAGE_BREAK_TAG,BIBLIOGRAPHY_TAG,TOC_TAG,COMPONENT_ATTRIBUTES,COMPONENT_TAG,ITEM_TAG,TABLE_TAG,parseDoc}from"./parse.js";export{patchDoc}from"./patch.js";export{isTitle,retitle,splitTitle,titleText,withTitle}from"./title.js";export{frontMatterOf,withPage,writeBlocks}from"./write.js";export{COVER_NAMES,COVER_WORDS,coverFileName,coverSvg}from"./covers.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{withSources as f}from"./cite.js";import{docChart as h}from"./chart.js";import{writeBlocks as y}from"./write.js";function u(e){const t={};return e.bold&&(t.bold=!0),e.italic&&(t.italic=!0),e.strike&&(t.strike=!0),e.code&&(t.code=!0),t}const
|
|
2
|
+
import{withSources as f}from"./cite.js";import{docChart as h}from"./chart.js";import{withTableData as m}from"./table.js";import{writeBlocks as y}from"./write.js";function u(e){const t={};return e.bold&&(t.bold=!0),e.italic&&(t.italic=!0),e.strike&&(t.strike=!0),e.code&&(t.code=!0),t}const l=e=>e.map(t=>t.note!==void 0?{text:t.text,styles:{},note:t.note}:t.href===void 0?{text:t.text,styles:u(t.styles)}:{text:t.text,href:t.href,styles:u(t.styles)});function g(e,t){switch(e.type){case"embed":case"source":return[];case"component":{const n=t.component?.(e);return n===void 0?[]:[{type:"image",src:n,...e.alt===void 0?{}:{alt:e.alt},...e.caption===void 0?{}:{caption:e.caption}}]}case"code":case"divider":return[e];case"pagebreak":case"toc":return[];case"bibliography":return[];case"columns":return e.columns.flatMap(n=>plainBlocks(n.blocks,t));case"card":{const n=[...e.title===void 0?[]:[{text:e.title,styles:{bold:!0}}],...e.subtitle===void 0?[]:[{text:`${e.title===void 0?"":" — "}${e.subtitle}`,styles:{}}]];return[...n.length>0?[{type:"paragraph",content:n}]:[],...plainBlocks(e.children??[],t)]}case"stats":return e.stats.map(n=>({type:"bullet",content:[{text:n.value,styles:{bold:!0}},{text:` ${n.label}`,styles:{}},...n.delta===void 0&&n.note===void 0?[]:[{text:` (${[n.delta,n.note].filter(s=>s!==void 0).join(" ")})`,styles:{}}]]}));case"chart":{const n=i=>i===""?[]:[{text:i,styles:{}}],s=e.table===void 0?h(e,t).chart:void 0,c=e.table??(s&&s.categories.length>0?[[e.categories??"",...s.series.map(i=>i.name)],...s.categories.map((i,p)=>[i,...s.series.map(o=>{const d=o.values[p];return d==null?"":String(d)})])]:void 0);return c===void 0?[]:[...e.title===void 0?[]:[{type:"paragraph",content:[{text:e.title,styles:{bold:!0}}]}],{type:"table",rows:c.map(i=>i.map(n))}]}case"image":return[{type:"image",src:e.src,...e.alt===void 0?{}:{alt:e.alt},...e.caption===void 0?{}:{caption:e.caption}}];case"table":return[...e.caption===void 0?[]:[{type:"paragraph",content:[{text:e.caption,styles:{bold:!0}}]}],{type:"table",rows:e.rows.map(n=>n.map(l))}];default:break}const a=l(e.content),r=plainBlocks(e.children??[],t);switch(e.type){case"bullet":case"numbered":case"check":case"note":case"quote":{const n={...e};return delete n.look,delete n.children,[{...n,content:a,...r.length?{children:r}:{}}]}case"callout":return[{type:"quote",content:[...e.icon===void 0?[]:[{text:`${e.icon} `,styles:{}}],...a],...r.length?{children:r}:{}}];case"heading":return[{type:"heading",level:e.level,content:a},...r];case"toggle":case"paragraph":return[{type:"paragraph",content:a},...r]}}export function plainBlocks(e,t={}){return e.flatMap(a=>g(a,t))}export function markdownOf(e,t={}){const a=t.page?.cover,r=a===void 0?[]:[{type:"image",src:a}],n=f(m(e,t),t.sources??[],t.page?.citationStyle??"apa");return`${y([...r,...plainBlocks(n,t)])}
|
|
3
3
|
`}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{CHART_LEGEND_POSITIONS as
|
|
3
|
-
`,n,
|
|
4
|
-
`,n,
|
|
5
|
-
`&&Object.keys(i[0].styles).length===0?[]:i,under:T(t,r)}}return H(n)?{content:[],under:T(t,r)}:{content:[],under:T(t,e)}}const w=(t,e)=>e.length>0?{...t,children:e}:t;function ce(t,e,n,r){const{content:i,under:o}=M(t,e.children);return typeof e.checked=="boolean"?w({type:"check",checked:e.checked,content:i},o):w(n?{type:"numbered",...r===void 0||r===1?{}:{start:r},content:i}:{type:"bullet",content:i},o)}function de(t,e){return e.children.map(n=>_(t,n.children))}function m(t,e){return e?{[t]:e}:{}}function fe(t,e){const n=h(t,e,["align","color","bg","toggle"]),r=T(t,e.children),[i,...o]=r;if(i===void 0)return l(t,e,`<${BLOCK_TAG}> holds a block: this one is empty`),[];if(i.type==="embed"||i.type==="source")return l(t,e,`<${BLOCK_TAG}> holds a block of the doc's own, not a tag or an import`),r;const s=n.get("align");s!==void 0&&!J.has(s)&&l(t,e,`align is center, right or justify, not "${s}"`);const d={...s!==void 0&&J.has(s)?{align:s}:{},...m("color",n.get("color")),...m("background",n.get("bg"))};let a=i;if(n.has("toggle")&&(a.type==="heading"?a={...a,toggle:!0}:a.type==="paragraph"?a={type:"toggle",content:a.content}:l(t,e,"toggle is for a heading or a line of text")),Object.keys(d).length>0&&("content"in a?a={...a,look:d}:l(t,e,`a ${a.type} has no look to set`)),o.length>0)if("content"in a)a={...a,children:[...a.children??[],...o]};else return l(t,e,`a ${a.type} holds no blocks under it`),[a,...o];return[a]}function me(t,e){const n=h(t,e,["icon","color","bg"]),{content:r,under:i}=M(t,e.children),o={...m("color",n.get("color")),...m("background",n.get("bg"))};return[w({type:"callout",...m("icon",n.get("icon")),...Object.keys(o).length>0?{look:o}:{},content:r},i)]}function ge(t,e){const n=h(t,e,["title","subtitle"]),r=T(t,e.children);return[w({type:"card",...m("title",n.get("title")),...m("subtitle",n.get("subtitle"))},r)]}function he(t,e){h(t,e,[]);const n=[];for(const r of e.children){if(r.type!=="mdxJsxFlowElement"||r.name!==STAT_TAG||r.children.length>0)return l(t,r,`<${STATS_TAG}> holds <${STAT_TAG} label="…" value="…" />s, one to a line`),[];const i=h(t,r,STAT_ATTRIBUTES),o=i.get("label"),s=i.get("value");if(s===void 0||o===void 0)return l(t,r,`a <${STAT_TAG}> has a label and a value`),[];const d=i.get("trend"),a=d?.split(",").map(c=>Number(c.trim()));if(a!==void 0&&!a.every(c=>Number.isFinite(c)))return l(t,r,`a stat's trend is numbers, oldest first, comma-separated ("12,15,14,19"), not "${d??""}"`),[];n.push({label:o,value:s,...m("delta",i.get("delta")),...m("note",i.get("note")),...i.has("down-is-good")&&i.get("down-is-good")!=="false"?{downIsGood:!0}:{},...a===void 0||a.length<2?{}:{trend:a}})}return n.length===0?(l(t,e,`<${STATS_TAG}> holds one <${STAT_TAG} /> or more`),[]):[{type:"stats",stats:n}]}function pe(t,e){const n=h(t,e,["src","alt","title","width","align","id"]),r=n.get("src");if(!r)return l(t,e,"<img> names its picture: src is missing"),[];const i=Number(n.get("width")),o=n.get("align");return o!==void 0&&o!=="center"&&o!=="right"&&l(t,e,`a picture's align is center or right, not "${o}"`),[{type:"image",src:r,...m("alt",n.get("alt")),...m("caption",n.get("title")),...Number.isFinite(i)&&i>0?{width:Math.round(i)}:{},...o==="center"||o==="right"?{align:o}:{},...m("id",n.get("id"))}]}function be(t,e){if(e.children.length>0)return l(t,e,`<${COMPONENT_TAG}> holds nothing: its props are its attributes`),[];const n=new Map,r={};for(const u of e.attributes){if(u.type!=="mdxJsxAttribute"){l(t,e,`<${COMPONENT_TAG}>'s attributes are plain strings, not {…}`);continue}const f=u.value===null||u.value===void 0?"":typeof u.value=="string"?u.value:void 0;if(f===void 0){l(t,e,`${u.name} of <${COMPONENT_TAG}> is a plain string`);continue}COMPONENT_ATTRIBUTES.includes(u.name)?n.set(u.name,f):r[u.name]=f}const i=n.get("of")??"";if(i.trim()==="")return l(t,e,`<${COMPONENT_TAG}> names its component: of is missing (of="../ui.ts#Dialog")`),[];const o=u=>{const f=n.get(u);if(f===void 0)return;const b=Number(f);if(Number.isFinite(b)&&b>0)return Math.round(b);l(t,e,`${u} of <${COMPONENT_TAG}> is a number of pixels, not "${f}"`)},s=o("width"),d=o("height"),a=n.get("at"),c=a===void 0?void 0:Number(a);c!==void 0&&!(Number.isFinite(c)&&c>=0)&&l(t,e,`at of <${COMPONENT_TAG}> is seconds, 0 or more, not "${a??""}"`);const g=n.get("align");return g!==void 0&&g!=="center"&&g!=="right"&&l(t,e,`a component's align is center or right, not "${g}"`),[{type:"component",of:i,...s===void 0?{}:{width:s},...d===void 0?{}:{height:d},...c!==void 0&&Number.isFinite(c)&&c>=0?{at:c}:{},...m("alt",n.get("alt")),...m("caption",n.get("title")),...g==="center"||g==="right"?{align:g}:{},...m("id",n.get("id")),props:r}]}function ke(t,e){const n=h(t,e,CHART_ATTRIBUTES),r=p=>{l(t,e,p)},i=n.get("type");if(i===void 0||i==="")return r(`<${CHART_TAG}> says what it is drawn as: type is missing (${j.join(", ")})`),[];if(!j.includes(i))return r(`a chart's type is ${j.join(", ")}, not "${i}"`),[];const o=e.children,[s,...d]=o;if(d.length>0||s!==void 0&&s.type!=="table")return r(`<${CHART_TAG}> holds one table: its numbers`),[];const a=s?.type==="table"?s.children.map(p=>p.children.map($=>_(t,$.children).map(E=>E.text).join("").trim())):void 0,c=n.get("data"),g=n.get("categories"),u=n.get("series");if(a!==void 0&&c!==void 0)return r("a chart's numbers are its table or the file data names, not both"),[];if(a===void 0&&(c===void 0||c===""))return r(`<${CHART_TAG}> has numbers: a table inside it, or data="…" naming a file of them`),[];if(a!==void 0){(g!==void 0||u!==void 0)&&r("categories and series name a file's columns: a chart's own table has its series in its head row and its categories in its first column");const p=Math.min(...a.map($=>$.length));(a.length<2||p<2)&&r("a chart's table has a head row and a row of numbers, a column of categories and a column of numbers")}else(g===void 0||g==="")&&r("with data, categories names the column of the categories"),(u===void 0||v(u).length===0)&&r('with data, series names the columns of the numbers (series="revenue,cost")');const f=n.get("legend"),b=[...D,"none"];f!==void 0&&!b.includes(f)&&r(`a chart's legend is ${b.join(", ")}, not "${f}"`);const A=n.get("labels"),S=A===void 0?void 0:A===""?["value"]:v(A),G=S?.filter(p=>!P.includes(p));G?.length&&r(`a chart's labels are ${P.join(", ")}, not ${G.map(p=>`"${p}"`).join(", ")}`);const F=(p,$)=>{const E=n.get(p);if(E===void 0)return;const C=Number(E);if(E.trim()!==""&&Number.isFinite(C)&&(!$||C>0))return $?Math.round(C):C;r(`${p} of <${CHART_TAG}> is ${$?"a number of pixels":"a number"}, not "${E}"`)},L=F("min",!1),B=F("max",!1),I=F("width",!0),R=F("height",!0),O=n.get("colors");return[{type:"chart",kind:i,...m("title",n.get("title")),...a===void 0?{}:{table:a},...c===void 0||c===""?{}:{data:c},...a===void 0?m("categories",g):{},...a===void 0&&u!==void 0&&v(u).length>0?{series:v(u)}:{},...f!==void 0&&b.includes(f)?{legend:f}:{},...S!==void 0&&!G?.length?{labels:S}:{},...m("format",n.get("format")),...L===void 0?{}:{min:L},...B===void 0?{}:{max:B},...O!==void 0&&v(O).length>0?{colors:v(O)}:{},...n.has("smooth")&&n.get("smooth")!=="false"?{smooth:!0}:{},...I===void 0?{}:{width:I},...R===void 0?{}:{height:R},...m("alt",n.get("alt")),...m("id",n.get("id"))}]}function $e(t,e){h(t,e,[]);const n=[];for(const r of e.children){if(r.type!=="mdxJsxFlowElement"||r.name!==COLUMN_TAG)return l(t,r,`<${COLUMNS_TAG}> holds <${COLUMN_TAG}>s, each around its blocks`),[];const o=h(t,r,["width"]).get("width"),s=o===void 0?void 0:Number(o);o!==void 0&&!(Number.isFinite(s)&&(s??0)>0)&&l(t,r,`a column's width is a share against the others' (1, 2, 0.5), not "${o}"`);const d=T(t,r.children);if(d.some(a=>a.type==="columns"))return l(t,r,`a <${COLUMN_TAG}> holds no <${COLUMNS_TAG}>`),[];n.push({...s!==void 0&&Number.isFinite(s)&&s>0&&s!==1?{width:s}:{},blocks:d})}return n.length<2?(l(t,e,`<${COLUMNS_TAG}> holds two or more <${COLUMN_TAG}>s`),[]):[{type:"columns",columns:n}]}function ye(t,e){const n=h(t,e,["widths","head","caption","id"]),r=T(t,e.children),[i,...o]=r;if(i?.type!=="table"||o.length>0)return l(t,e,`<${TABLE_TAG}> holds one table`),r;const s=n.get("head");s!==void 0&&!["none","column","both","row"].includes(s)&&l(t,e,`a table's head is none, row, column or both, not "${s}"`);const d=n.get("widths")?.split(",").map(a=>{const c=Number(a.trim());return a.trim()!==""&&Number.isFinite(c)&&c>0?Math.round(c):null});return[{...i,...s==="none"||s==="column"||s==="both"?{head:s}:{},...d?.some(a=>a!==null)?{widths:d}:{},...m("caption",n.get("caption")),...m("id",n.get("id"))}]}function we(t,e){switch(e.type){case"paragraph":{const n=e.children.length===1?e.children[0]:void 0;if(n?.type==="image")return[{type:"image",src:n.url,...n.alt?{alt:n.alt}:{},...n.title?{caption:n.title}:{}}];const r=_(t,e.children),i=r.map(o=>o.text).join("").trim();return i.startsWith("$$")&&i.endsWith("$$")&&i.length>4&&l(t,e,"$$ is not drawn in a doc: an equation is a ```math code block"),[{type:"paragraph",content:r}]}case"heading":return[{type:"heading",level:e.depth,content:_(t,e.children)}];case"list":{const n=e.ordered===!0;return e.children.map((r,i)=>ce(t,r,n,i===0&&n?e.start??void 0:void 0))}case"blockquote":{const{content:n,under:r}=M(t,e.children);return[w({type:"quote",content:n},r)]}case"code":return[{type:"code",...e.lang?{language:e.lang}:{},code:e.value}];case"table":return[{type:"table",rows:e.children.map(n=>de(t,n))}];case"thematicBreak":return[{type:"divider"}];case"mdxJsxFlowElement":{const n=r=>r.length>0?r:[{type:"embed",source:k(t,e)}];if(e.name===BLOCK_TAG)return n(fe(t,e));if(e.name===TABLE_TAG)return ye(t,e);if(e.name===CALLOUT_TAG)return me(t,e);if(e.name===COMPONENT_TAG)return n(be(t,e));if(e.name===CHART_TAG)return n(ke(t,e));if(e.name===COLUMNS_TAG)return n($e(t,e));if(e.name===CARD_TAG)return n(ge(t,e));if(e.name===STATS_TAG)return n(he(t,e));if(e.name===STAT_TAG)return l(t,e,`a <${STAT_TAG} /> stands inside <${STATS_TAG}>`),n([]);if(e.name===PAGE_BREAK_TAG){const i=h(t,e,["orientation"]).get("orientation");return e.children.length>0?(l(t,e,`<${PAGE_BREAK_TAG} /> holds nothing`),n([])):i!==void 0&&i!=="portrait"&&i!=="landscape"?(l(t,e,`a page break's orientation is portrait or landscape, not "${i}"`),n([])):[{type:"pagebreak",...i===void 0?{}:{orientation:i}}]}if(e.name===BIBLIOGRAPHY_TAG)return e.attributes.length>0||e.children.length>0?(l(t,e,`<${BIBLIOGRAPHY_TAG} /> takes nothing`),n([])):[{type:"bibliography"}];if(e.name===TOC_TAG){const r=h(t,e,["levels","title"]),i=r.get("levels"),o=r.get("title"),s=i===void 0?void 0:Number(i);return e.children.length>0||s!==void 0&&!(Number.isInteger(s)&&s>=1&&s<=6)?(l(t,e,`<${TOC_TAG} /> holds nothing, and its levels are 1 to 6 (the deepest heading it lists)`),n([])):[{type:"toc",...s===void 0?{}:{levels:s},...o===void 0?{}:{title:o}}]}return e.name===COLUMN_TAG?(l(t,e,`a <${COLUMN_TAG}> stands inside <${COLUMNS_TAG}>`),n([])):e.name==="img"&&e.children.length===0?n(pe(t,e)):H(e)?[{type:"paragraph",content:[]}]:[{type:"embed",source:k(t,e)}]}case"footnoteDefinition":{const{content:n,under:r}=M(t,e.children);return[w({type:"note",label:e.label??e.identifier,content:n},r)]}case"mdxjsEsm":case"definition":return[{type:"source",source:k(t,e)}];case"mdxFlowExpression":return l(t,e,"{…} on its own is not drawn in a doc"),[{type:"source",source:k(t,e)}];default:return l(t,e,`${e.type} is not drawn in a doc`),[{type:"source",source:k(t,e)}]}}function U(t,e){return e.map((n,r)=>{const i=we(t,n),o=e[r-1],s=i[0];return n.type==="list"&&n.ordered===!0&&o?.type==="list"&&o.ordered===!0&&s?.type==="numbered"&&s.start===void 0&&(i[0]={...s,start:n.start??1}),i})}function T(t,e){return U(t,e).flat()}export function parseDoc(t){const e={source:t,problems:[]};let n;try{n=Y(t,{extensions:[Z(),re(),x(),te(),ee(),ne(),V()],mdastExtensions:[q(),Q(),K(),z(),W(),X()]})}catch(u){const f=u;return{source:t,blocks:[],segments:[],page:{},problems:[{message:f.reason??f.message??"The file is not MDX",...typeof f.line=="number"?{line:f.line}:{},...typeof f.column=="number"?{column:f.column}:{}}]}}const[r]=n.children,i=r?.type==="yaml"?r:void 0,o=i?n.children.slice(1):n.children,s=i?Te(e,i):{},d=[],a=U(e,o);o.forEach((u,f)=>{const b=u.position?.start.offset,A=u.position?.end.offset;b===void 0||A===void 0||d.push({start:b,end:A,blocks:a[f]??[]})});const c=i?.position?.start.offset,g=i?.position?.end.offset;return{source:t,blocks:d.flatMap(u=>u.blocks),segments:d,problems:e.problems,page:s,...c===void 0||g===void 0?{}:{frontMatter:{start:c,end:g}}}}function Te(t,e){let n;try{n=ie(e.value)}catch(r){return l(t,e,`the front matter is not YAML: ${r instanceof Error?r.message:String(r)}`),{}}return n==null?{}:typeof n!="object"||Array.isArray(n)?(l(t,e,`the front matter holds keys: ${se.join(", ")}`),{}):ae(n,r=>{l(t,e,r)})}
|
|
2
|
+
import{CHART_LEGEND_POSITIONS as Y,SHEET_CHART_TYPES as j}from"@allyhub/formats";import{fromMarkdown as q}from"mdast-util-from-markdown";import{frontmatterFromMarkdown as K}from"mdast-util-frontmatter";import{gfmFootnoteFromMarkdown as W}from"mdast-util-gfm-footnote";import{gfmStrikethroughFromMarkdown as z}from"mdast-util-gfm-strikethrough";import{gfmTableFromMarkdown as X}from"mdast-util-gfm-table";import{gfmTaskListItemFromMarkdown as Q}from"mdast-util-gfm-task-list-item";import{mdxFromMarkdown as V}from"mdast-util-mdx";import{cjkFriendlyExtension as Z}from"micromark-extension-cjk-friendly";import{frontmatter as x}from"micromark-extension-frontmatter";import{gfmFootnote as ee}from"micromark-extension-gfm-footnote";import{gfmStrikethrough as te}from"micromark-extension-gfm-strikethrough";import{gfmTable as ne}from"micromark-extension-gfm-table";import{gfmTaskListItem as ie}from"micromark-extension-gfm-task-list-item";import{mdxjs as re}from"micromark-extension-mdxjs";import{parse as oe}from"yaml";import{citedOf as se}from"./cite.js";import{PAGE_KEYS as ae,readPageLook as le}from"./page.js";import{CHART_LABELS as P}from"./model.js";export const BLOCK_TAG="Block",CALLOUT_TAG="Callout",TABLE_TAG="Table",COMPONENT_TAG="Component",ITEM_TAG="Item",COMPONENT_ATTRIBUTES=["of","width","height","at","alt","title","align","id"],PAGE_BREAK_TAG="PageBreak",CARD_TAG="Card",STATS_TAG="Stats",STAT_TAG="Stat",STAT_ATTRIBUTES=["label","value","delta","note","down-is-good","trend"],TAG_TAG="Tag",COLUMNS_TAG="Columns",COLUMN_TAG="Column",CHART_TAG="Chart",CHART_ATTRIBUTES=["type","title","data","categories","series","legend","labels","format","min","max","colors","smooth","width","height","alt","id"],BIBLIOGRAPHY_TAG="Bibliography",TOC_TAG="TableOfContents";const N=t=>t.split(",").map(e=>e.trim()).filter(e=>e!==""),J=new Set(["center","right","justify"]),k=(t,e)=>{const n=e.position?.start.offset,i=e.position?.end.offset;return n===void 0||i===void 0?"":t.source.slice(n,i)};function l(t,e,n){const i=e.position?.start;t.problems.push({message:n,...i?{line:i.line,column:i.column}:{}})}const ue=(t,e)=>t.bold===e.bold&&t.italic===e.italic&&t.underline===e.underline&&t.strike===e.strike&&t.code===e.code&&t.color===e.color&&t.background===e.background&&t.tag===e.tag;function T(t,e,n,i){if(e==="")return;const r=t.at(-1);if(r&&r.note===void 0&&r.cite===void 0&&r.href===i&&ue(r.styles,n)){r.text+=e;return}t.push({text:e,styles:{...n},...i===void 0?{}:{href:i}})}function b(t,e,n){const i=new Map;for(const r of e.attributes){if(r.type!=="mdxJsxAttribute"||!n.includes(r.name)){l(t,e,`<${e.name??""}> takes ${n.join(", ")}: ${r.type==="mdxJsxAttribute"?r.name:"{…}"} is not one of them`);continue}r.value===null||r.value===void 0?i.set(r.name,""):typeof r.value=="string"?i.set(r.name,r.value):l(t,e,`${r.name} of <${e.name??""}> is a plain string`)}return i}function ce(t,e,n){switch(e.name){case"u":return{...n,underline:!0};case"strong":case"b":return{...n,bold:!0};case"em":case"i":return{...n,italic:!0};case"del":case"s":return{...n,strike:!0};case"code":return{...n,code:!0};case TAG_TAG:{const i=b(t,e,["color"]).get("color");return{...n,tag:i===void 0||i===""?"gray":i}}case"span":{const i=b(t,e,["color","bg"]),r=i.get("color"),o=i.get("bg");return{...n,...r?{color:r}:{},...o?{background:o}:{}}}default:return}}function _(t,e,n,i,r){for(const o of e)switch(o.type){case"text":for(const[,s]of o.value.matchAll(/\[\^([^\]\s]+)\]/gu))l(t,o,`the footnote [^${s??""}] has no note: write [^${s??""}]: … on a line of its own`);for(const s of o.value.replace(/\r?\n/g," ").split(/(\[-?@[^\]]+\])/u)){if(s==="")continue;const c=/^\[(-?@[^\]]+)\]$/u.exec(s)?.[1];c!==void 0&&se(c).keys.length>0?r.push({text:s,styles:{...n},cite:c}):T(r,s,n,i)}break;case"strong":_(t,o.children,{...n,bold:!0},i,r);break;case"emphasis":_(t,o.children,{...n,italic:!0},i,r);break;case"delete":_(t,o.children,{...n,strike:!0},i,r);break;case"inlineCode":T(r,o.value,{...n,code:!0},i);break;case"break":T(r,`
|
|
3
|
+
`,n,i);break;case"link":o.children.length===0?r.push({text:"",styles:{...n},href:o.url}):_(t,o.children,n,o.url,r);break;case"footnoteReference":{const s=o.label??o.identifier;r.push({text:s,styles:{...n},...i===void 0?{}:{href:i},note:s});break}case"mdxJsxTextElement":{if(o.name==="br"){T(r,`
|
|
4
|
+
`,n,i);break}const s=ce(t,o,n);if(s){_(t,o.children,s,i,r);break}l(t,o,`<${o.name??""}> inside a line is not drawn: a tag the doc's code draws goes on lines of its own`),T(r,k(t,o),n,i);break}case"mdxTextExpression":l(t,o,"{…} in a line is not drawn: write \\{ for a brace"),T(r,k(t,o),n,i);break;default:l(t,o,`${o.type} is not drawn in a doc`),T(r,k(t,o),n,i)}}function F(t,e){const n=[];return _(t,e,{},void 0,n),n}const H=t=>t?.type==="mdxJsxFlowElement"&&t.name==="br"&&t.children.length===0;function G(t,e){const[n,...i]=e;if(n?.type==="paragraph"){const r=F(t,n.children);return{content:r.length===1&&r[0]?.text===`
|
|
5
|
+
`&&Object.keys(r[0].styles).length===0?[]:r,under:E(t,i)}}return H(n)?{content:[],under:E(t,i)}:{content:[],under:E(t,e)}}const A=(t,e)=>e.length>0?{...t,children:e}:t;function de(t,e,n,i){const{content:r,under:o}=G(t,e.children);return typeof e.checked=="boolean"?A({type:"check",checked:e.checked,content:r},o):A(n?{type:"numbered",...i===void 0||i===1?{}:{start:i},content:r}:{type:"bullet",content:r},o)}function fe(t,e){return e.children.map(n=>F(t,n.children))}function f(t,e){return e?{[t]:e}:{}}function me(t,e){const n=b(t,e,["align","color","bg","toggle"]),i=E(t,e.children),[r,...o]=i;if(r===void 0)return l(t,e,`<${BLOCK_TAG}> holds a block: this one is empty`),[];if(r.type==="embed"||r.type==="source")return l(t,e,`<${BLOCK_TAG}> holds a block of the doc's own, not a tag or an import`),i;const s=n.get("align");s!==void 0&&!J.has(s)&&l(t,e,`align is center, right or justify, not "${s}"`);const c={...s!==void 0&&J.has(s)?{align:s}:{},...f("color",n.get("color")),...f("background",n.get("bg"))};let a=r;if(n.has("toggle")&&(a.type==="heading"?a={...a,toggle:!0}:a.type==="paragraph"?a={type:"toggle",content:a.content}:l(t,e,"toggle is for a heading or a line of text")),Object.keys(c).length>0&&("content"in a?a={...a,look:c}:l(t,e,`a ${a.type} has no look to set`)),o.length>0)if("content"in a)a={...a,children:[...a.children??[],...o]};else return l(t,e,`a ${a.type} holds no blocks under it`),[a,...o];return[a]}function he(t,e){const n=b(t,e,["icon","color","bg"]),{content:i,under:r}=G(t,e.children),o={...f("color",n.get("color")),...f("background",n.get("bg"))};return[A({type:"callout",...f("icon",n.get("icon")),...Object.keys(o).length>0?{look:o}:{},content:i},r)]}function ge(t,e){const n=b(t,e,["title","subtitle"]),i=E(t,e.children);return[A({type:"card",...f("title",n.get("title")),...f("subtitle",n.get("subtitle"))},i)]}function pe(t,e){b(t,e,[]);const n=[];for(const i of e.children){if(i.type!=="mdxJsxFlowElement"||i.name!==STAT_TAG||i.children.length>0)return l(t,i,`<${STATS_TAG}> holds <${STAT_TAG} label="…" value="…" />s, one to a line`),[];const r=b(t,i,STAT_ATTRIBUTES),o=r.get("label"),s=r.get("value");if(s===void 0||o===void 0)return l(t,i,`a <${STAT_TAG}> has a label and a value`),[];const c=r.get("trend"),a=c?.split(",").map(g=>Number(g.trim()));if(a!==void 0&&!a.every(g=>Number.isFinite(g)))return l(t,i,`a stat's trend is numbers, oldest first, comma-separated ("12,15,14,19"), not "${c??""}"`),[];n.push({label:o,value:s,...f("delta",r.get("delta")),...f("note",r.get("note")),...r.has("down-is-good")&&r.get("down-is-good")!=="false"?{downIsGood:!0}:{},...a===void 0||a.length<2?{}:{trend:a}})}return n.length===0?(l(t,e,`<${STATS_TAG}> holds one <${STAT_TAG} /> or more`),[]):[{type:"stats",stats:n}]}function be(t,e){const n=b(t,e,["src","alt","title","width","align","id"]),i=n.get("src");if(!i)return l(t,e,"<img> names its picture: src is missing"),[];const r=Number(n.get("width")),o=n.get("align");return o!==void 0&&o!=="center"&&o!=="right"&&l(t,e,`a picture's align is center or right, not "${o}"`),[{type:"image",src:i,...f("alt",n.get("alt")),...f("caption",n.get("title")),...Number.isFinite(r)&&r>0?{width:Math.round(r)}:{},...o==="center"||o==="right"?{align:o}:{},...f("id",n.get("id"))}]}function U(t,e,n=COMPONENT_TAG){const i=n===ITEM_TAG;if(e.children.length>0)return l(t,e,i?`<${ITEM_TAG}> holds nothing: what it shows is its attributes`:`<${n}> holds nothing: its props are its attributes`),[];const r=new Map,o={};for(const h of e.attributes){if(h.type!=="mdxJsxAttribute"){l(t,e,`<${n}>'s attributes are plain strings, not {…}`);continue}const p=h.value===null||h.value===void 0?"":typeof h.value=="string"?h.value:void 0;if(p===void 0){l(t,e,`${h.name} of <${n}> is a plain string`);continue}COMPONENT_ATTRIBUTES.includes(h.name)?r.set(h.name,p):i?l(t,e,`<${ITEM_TAG}> has no ${h.name}: it takes of, at, width, height, alt, title, align and id`):o[h.name]=p}const s=r.get("of")??"";if(s.trim()==="")return l(t,e,i?`<${ITEM_TAG}> names the item it shows: of is missing (of="../deck/q3.ts#pricing")`:`<${n}> names its component: of is missing (of="../ui.ts#Dialog")`),[];const c=h=>{const p=r.get(h);if(p===void 0)return;const w=Number(p);if(Number.isFinite(w)&&w>0)return Math.round(w);l(t,e,`${h} of <${n}> is a number of pixels, not "${p}"`)},a=c("width"),g=c("height"),m=r.get("at"),u=m===void 0?void 0:Number(m);u!==void 0&&!(Number.isFinite(u)&&u>=0)&&l(t,e,`at of <${n}> is seconds, 0 or more, not "${m??""}"`);const d=r.get("align");return d!==void 0&&d!=="center"&&d!=="right"&&l(t,e,`a component's align is center or right, not "${d}"`),[{type:"component",of:s,...a===void 0?{}:{width:a},...g===void 0?{}:{height:g},...u!==void 0&&Number.isFinite(u)&&u>=0?{at:u}:{},...f("alt",r.get("alt")),...f("caption",r.get("title")),...d==="center"||d==="right"?{align:d}:{},...f("id",r.get("id")),props:o,...i?{item:!0}:{}}]}function $e(t,e){const n=b(t,e,CHART_ATTRIBUTES),i=$=>{l(t,e,$)},r=n.get("type");if(r===void 0||r==="")return i(`<${CHART_TAG}> says what it is drawn as: type is missing (${j.join(", ")})`),[];if(!j.includes(r))return i(`a chart's type is ${j.join(", ")}, not "${r}"`),[];const o=e.children,[s,...c]=o;if(c.length>0||s!==void 0&&s.type!=="table")return i(`<${CHART_TAG}> holds one table: its numbers`),[];const a=s?.type==="table"?s.children.map($=>$.children.map(y=>F(t,y.children).map(v=>v.text).join("").trim())):void 0,g=n.get("data"),m=n.get("categories"),u=n.get("series");if(a!==void 0&&g!==void 0)return i("a chart's numbers are its table or the file data names, not both"),[];if(a===void 0&&(g===void 0||g===""))return i(`<${CHART_TAG}> has numbers: a table inside it, or data="…" naming a file of them`),[];if(a!==void 0){(m!==void 0||u!==void 0)&&i("categories and series name a file's columns: a chart's own table has its series in its head row and its categories in its first column");const $=Math.min(...a.map(y=>y.length));(a.length<2||$<2)&&i("a chart's table has a head row and a row of numbers, a column of categories and a column of numbers")}else(m===void 0||m==="")&&i("with data, categories names the column of the categories"),(u===void 0||N(u).length===0)&&i('with data, series names the columns of the numbers (series="revenue,cost")');const d=n.get("legend"),h=[...Y,"none"];d!==void 0&&!h.includes(d)&&i(`a chart's legend is ${h.join(", ")}, not "${d}"`);const p=n.get("labels"),w=p===void 0?void 0:p===""?["value"]:N(p),S=w?.filter($=>!P.includes($));S?.length&&i(`a chart's labels are ${P.join(", ")}, not ${S.map($=>`"${$}"`).join(", ")}`);const M=($,y)=>{const v=n.get($);if(v===void 0)return;const C=Number(v);if(v.trim()!==""&&Number.isFinite(C)&&(!y||C>0))return y?Math.round(C):C;i(`${$} of <${CHART_TAG}> is ${y?"a number of pixels":"a number"}, not "${v}"`)},L=M("min",!1),B=M("max",!1),I=M("width",!0),R=M("height",!0),O=n.get("colors");return[{type:"chart",kind:r,...f("title",n.get("title")),...a===void 0?{}:{table:a},...g===void 0||g===""?{}:{data:g},...a===void 0?f("categories",m):{},...a===void 0&&u!==void 0&&N(u).length>0?{series:N(u)}:{},...d!==void 0&&h.includes(d)?{legend:d}:{},...w!==void 0&&!S?.length?{labels:w}:{},...f("format",n.get("format")),...L===void 0?{}:{min:L},...B===void 0?{}:{max:B},...O!==void 0&&N(O).length>0?{colors:N(O)}:{},...n.has("smooth")&&n.get("smooth")!=="false"?{smooth:!0}:{},...I===void 0?{}:{width:I},...R===void 0?{}:{height:R},...f("alt",n.get("alt")),...f("id",n.get("id"))}]}function ke(t,e){b(t,e,[]);const n=[];for(const i of e.children){if(i.type!=="mdxJsxFlowElement"||i.name!==COLUMN_TAG)return l(t,i,`<${COLUMNS_TAG}> holds <${COLUMN_TAG}>s, each around its blocks`),[];const o=b(t,i,["width"]).get("width"),s=o===void 0?void 0:Number(o);o!==void 0&&!(Number.isFinite(s)&&(s??0)>0)&&l(t,i,`a column's width is a share against the others' (1, 2, 0.5), not "${o}"`);const c=E(t,i.children);if(c.some(a=>a.type==="columns"))return l(t,i,`a <${COLUMN_TAG}> holds no <${COLUMNS_TAG}>`),[];n.push({...s!==void 0&&Number.isFinite(s)&&s>0&&s!==1?{width:s}:{},blocks:c})}return n.length<2?(l(t,e,`<${COLUMNS_TAG}> holds two or more <${COLUMN_TAG}>s`),[]):[{type:"columns",columns:n}]}function we(t,e){const n=b(t,e,["widths","head","caption","id","data","fields"]),i=E(t,e.children),r=n.get("data"),o=n.get("fields")?.split(",").map(m=>m.trim()).filter(m=>m!=="");if(r===void 0&&o!==void 0&&l(t,e,"fields say which columns a table shows of its data: give it data"),r!==void 0&&i.length>0)return l(t,e,`<${TABLE_TAG} data> reads its rows: it holds no table`),i;const[s,...c]=r===void 0?i:[{type:"table",rows:[]}];if(s?.type!=="table"||c.length>0)return l(t,e,`<${TABLE_TAG}> holds one table`),i;const a=n.get("head");a!==void 0&&!["none","column","both","row"].includes(a)&&l(t,e,`a table's head is none, row, column or both, not "${a}"`);const g=n.get("widths")?.split(",").map(m=>{const u=Number(m.trim());return m.trim()!==""&&Number.isFinite(u)&&u>0?Math.round(u):null});return[{...s,...a==="none"||a==="column"||a==="both"?{head:a}:{},...g?.some(m=>m!==null)?{widths:g}:{},...f("caption",n.get("caption")),...f("id",n.get("id")),...r===void 0?{}:{data:r},...r===void 0||o===void 0||o.length===0?{}:{fields:o}}]}function ye(t,e){switch(e.type){case"paragraph":{const n=e.children.length===1?e.children[0]:void 0;if(n?.type==="image")return[{type:"image",src:n.url,...n.alt?{alt:n.alt}:{},...n.title?{caption:n.title}:{}}];const i=F(t,e.children),r=i.map(o=>o.text).join("").trim();return r.startsWith("$$")&&r.endsWith("$$")&&r.length>4&&l(t,e,"$$ is not drawn in a doc: an equation is a ```math code block"),[{type:"paragraph",content:i}]}case"heading":return[{type:"heading",level:e.depth,content:F(t,e.children)}];case"list":{const n=e.ordered===!0;return e.children.map((i,r)=>de(t,i,n,r===0&&n?e.start??void 0:void 0))}case"blockquote":{const{content:n,under:i}=G(t,e.children);return[A({type:"quote",content:n},i)]}case"code":return[{type:"code",...e.lang?{language:e.lang}:{},code:e.value}];case"table":return[{type:"table",rows:e.children.map(n=>fe(t,n))}];case"thematicBreak":return[{type:"divider"}];case"mdxJsxFlowElement":{const n=i=>i.length>0?i:[{type:"embed",source:k(t,e)}];if(e.name===BLOCK_TAG)return n(me(t,e));if(e.name===TABLE_TAG)return we(t,e);if(e.name===CALLOUT_TAG)return he(t,e);if(e.name===COMPONENT_TAG)return n(U(t,e));if(e.name===ITEM_TAG)return n(U(t,e,ITEM_TAG));if(e.name===CHART_TAG)return n($e(t,e));if(e.name===COLUMNS_TAG)return n(ke(t,e));if(e.name===CARD_TAG)return n(ge(t,e));if(e.name===STATS_TAG)return n(pe(t,e));if(e.name===STAT_TAG)return l(t,e,`a <${STAT_TAG} /> stands inside <${STATS_TAG}>`),n([]);if(e.name===PAGE_BREAK_TAG){const r=b(t,e,["orientation"]).get("orientation");return e.children.length>0?(l(t,e,`<${PAGE_BREAK_TAG} /> holds nothing`),n([])):r!==void 0&&r!=="portrait"&&r!=="landscape"?(l(t,e,`a page break's orientation is portrait or landscape, not "${r}"`),n([])):[{type:"pagebreak",...r===void 0?{}:{orientation:r}}]}if(e.name===BIBLIOGRAPHY_TAG)return e.attributes.length>0||e.children.length>0?(l(t,e,`<${BIBLIOGRAPHY_TAG} /> takes nothing`),n([])):[{type:"bibliography"}];if(e.name===TOC_TAG){const i=b(t,e,["levels","title"]),r=i.get("levels"),o=i.get("title"),s=r===void 0?void 0:Number(r);return e.children.length>0||s!==void 0&&!(Number.isInteger(s)&&s>=1&&s<=6)?(l(t,e,`<${TOC_TAG} /> holds nothing, and its levels are 1 to 6 (the deepest heading it lists)`),n([])):[{type:"toc",...s===void 0?{}:{levels:s},...o===void 0?{}:{title:o}}]}return e.name===COLUMN_TAG?(l(t,e,`a <${COLUMN_TAG}> stands inside <${COLUMNS_TAG}>`),n([])):e.name==="img"&&e.children.length===0?n(be(t,e)):H(e)?[{type:"paragraph",content:[]}]:[{type:"embed",source:k(t,e)}]}case"footnoteDefinition":{const{content:n,under:i}=G(t,e.children);return[A({type:"note",label:e.label??e.identifier,content:n},i)]}case"mdxjsEsm":case"definition":return[{type:"source",source:k(t,e)}];case"mdxFlowExpression":return l(t,e,"{…} on its own is not drawn in a doc"),[{type:"source",source:k(t,e)}];default:return l(t,e,`${e.type} is not drawn in a doc`),[{type:"source",source:k(t,e)}]}}function D(t,e){return e.map((n,i)=>{const r=ye(t,n),o=e[i-1],s=r[0];return n.type==="list"&&n.ordered===!0&&o?.type==="list"&&o.ordered===!0&&s?.type==="numbered"&&s.start===void 0&&(r[0]={...s,start:n.start??1}),r})}function E(t,e){return D(t,e).flat()}export function parseDoc(t){const e={source:t,problems:[]};let n;try{n=q(t,{extensions:[x(),re(),ee(),ne(),te(),ie(),Z()],mdastExtensions:[K(),V(),W(),X(),z(),Q()]})}catch(u){const d=u;return{source:t,blocks:[],segments:[],page:{},problems:[{message:d.reason??d.message??"The file is not MDX",...typeof d.line=="number"?{line:d.line}:{},...typeof d.column=="number"?{column:d.column}:{}}]}}const[i]=n.children,r=i?.type==="yaml"?i:void 0,o=r?n.children.slice(1):n.children,s=r?Te(e,r):{},c=[],a=D(e,o);o.forEach((u,d)=>{const h=u.position?.start.offset,p=u.position?.end.offset;h===void 0||p===void 0||c.push({start:h,end:p,blocks:a[d]??[]})});const g=r?.position?.start.offset,m=r?.position?.end.offset;return{source:t,blocks:c.flatMap(u=>u.blocks),segments:c,problems:e.problems,page:s,...g===void 0||m===void 0?{}:{frontMatter:{start:g,end:m}}}}function Te(t,e){let n;try{n=oe(e.value)}catch(i){return l(t,e,`the front matter is not YAML: ${i instanceof Error?i.message:String(i)}`),{}}return n==null?{}:typeof n!="object"||Array.isArray(n)?(l(t,e,`the front matter holds keys: ${ae.join(", ")}`),{}):le(n,i=>{l(t,e,i)})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
const
|
|
2
|
+
import{shownPath as M}from"@allyhub/formats";const x=/^[+\-−–]?[$€£¥]?\s?\d[\d,.\s]*\s?(%|×|x|k|K|M|B|bn|pt|pp)?\*?$/u,A=/^([—–-]|n\/a|N\/A|NA)$/u,w=t=>t.map(n=>n.text).join("").trim();export function numberColumns(t){const n=t.head===void 0||t.head==="both",e=t.head==="column"||t.head==="both",o=n?t.rows.slice(1):t.rows,c=Math.max(0,...t.rows.map(s=>s.length)),i=new Set;for(let s=e?1:0;s<c;s++){const u=o.map(d=>w(d[s]??[]));u.some(d=>x.test(d))&&u.every(d=>d===""||x.test(d)||A.test(d))&&i.add(s)}return i}export function emptyHead(t){const n=t.head===void 0||t.head==="both",e=t.rows[0];return n&&e!==void 0&&t.rows.length>1&&e.every(o=>w(o)==="")}const p={min:6,max:36,room:2},$=.55;export const charsAcross=(t,n)=>t/(n*96/72)/$;const R=t=>Math.max(0,...t.split(/\s+/u).map(n=>Array.from(n).length));export function columnShares(t,n){const e=Math.max(0,...t.rows.map(r=>r.length)),o=r=>t.rows.map(m=>w(m[r]??[])),c=r=>Math.max(0,...o(r).map(m=>Array.from(m).length)),i=Array.from({length:e},(r,m)=>Math.min(p.max,Math.max(p.min,c(m)+p.room)));if(n===void 0)return i;const s=i.map((r,m)=>Math.max(0,...o(m).map(R))+n.margins),u=i.map((r,m)=>Math.max(s[m]??0,Math.min(p.max,Math.max(p.min,c(m)))+n.margins)),d=r=>!t.widths?.[r],l=r=>r.reduce((m,f,g)=>m+(d(g)?f:0),0),a=l(s),h=l(u);if(h<=n.across||h===a)return u;if(a>=n.across)return s;const y=(n.across-a)/(h-a);return u.map((r,m)=>{const f=s[m]??r;return f+(r-f)*y})}export function tableRowsOf(t,n){if(t.data===void 0)return{rows:t.rows,problems:[]};if(n.data===void 0)return{rows:[],problems:[],waiting:!0};const e=n.data(M(t.data)),o=Array.isArray(e)?e:n.data(t.data);if(!Array.isArray(o)||o.length===0)return{rows:[],problems:[o===void 0?`${t.data} is not a data file or a sheet's table of the project`:`${t.data} holds no rows`]};const c=o,i=Object.keys(c[0]??{}),s=t.fields??i,u=s.filter(a=>!i.includes(a));if(u.length>0)return{rows:[],problems:[`${t.data} has no column ${u.join(", ")} (it has ${i.join(", ")})`]};const d=a=>{const h=typeof a=="string"||typeof a=="number"||typeof a=="boolean"?String(a):"";return h===""?[]:[{text:h,styles:{}}]};return{rows:[...t.head!=="none"&&t.head!=="column"?[s.map(a=>d(a))]:[],...c.map(a=>s.map(h=>d(a[h])))],problems:[]}}export function withTableData(t,n){return t.map(e=>e.type==="table"&&e.data!==void 0?{...e,rows:tableRowsOf(e,n).rows}:e.type==="columns"?{...e,columns:e.columns.map(o=>({...o,blocks:withTableData(o.blocks,n)}))}:e)}
|