allyhub 0.9.0 → 0.10.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 +8 -0
- package/dist/commands/auth.js +4 -4
- package/dist/commands/cloud-tools.js +11 -11
- package/dist/commands/frames/compare.js +2 -2
- package/dist/commands/frames/piece.js +1 -1
- package/dist/commands/frames.js +8 -8
- package/dist/commands/index.js +1 -1
- package/dist/commands/inspect/common.js +4 -2
- package/dist/commands/inspect/facts.js +3 -3
- package/dist/commands/inspect/layout.js +1 -1
- package/dist/commands/orgs.js +2 -2
- package/dist/help.js +4 -4
- package/dist/main.js +8 -7
- package/dist/node_modules/@allyhub/3d-extension/package.json +34 -2
- 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/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +2 -1
- package/dist/node_modules/@allyhub/canvas-extension/skills/allyhub/references/canvas.md +4 -24
- package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
- package/dist/node_modules/@allyhub/chart/dist/chart.js +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/client.d.ts +10 -0
- package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +9 -0
- package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/credentials.d.ts +4 -4
- package/dist/node_modules/@allyhub/cloud/dist/credentials.js +2 -2
- package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +12 -0
- package/dist/node_modules/@allyhub/cloud/dist/device.js +2 -0
- 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/components/r/callout.json +1 -1
- package/dist/node_modules/@allyhub/components/src/callout.ts +98 -13
- 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/captions.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
- package/dist/node_modules/@allyhub/doc/dist/html.js +50 -47
- package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/page.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/write.js +22 -22
- package/dist/node_modules/@allyhub/doc/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/package.json +17 -2
- 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/faces.d.ts +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +50 -0
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/package.json +16 -1
- package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +7 -39
- 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/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/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +7 -4
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
- package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +6 -0
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/dist/version.js +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +132 -0
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.d.ts +337 -0
- package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +153 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +4 -2
- package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +43 -188
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
- package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +51 -91
- package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +3 -3
- package/dist/node_modules/@allyhub/protocol/package.json +5 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/dist/look.js +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/player/clips.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/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
- package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
- package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
- package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
- package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.d.ts +7 -0
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.js +2 -0
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.d.ts +4 -3
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.js +1 -1
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.d.ts +1 -1
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.js +1 -1
- package/dist/node_modules/@allyhub/scenery-host/dist/measure/facts.js +1 -1
- package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.d.ts +8 -0
- package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.js +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/define.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/kernels.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/maths.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
- 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/sax.js +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +4 -4
- package/dist/node_modules/@allyhub/sheet-extension/package.json +22 -3
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +20 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
- package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
- 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/fonts/caladea/400-italic.css +19 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400.css +19 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700-italic.css +19 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700.css +19 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/cambria.css +76 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400-italic.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700-italic.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/courier-new.css +316 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400-italic.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700-italic.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700.css +79 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/LICENSE +93 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-italic.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-normal.woff2 +0 -0
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/times-new-roman.css +316 -0
- package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +3 -0
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +19 -19
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/package.json +16 -1
- package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +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/dist/held.js +2 -0
- package/dist/node_modules/@allyhub/website-extension/dist/project-tools.js +24 -1
- package/dist/node_modules/@allyhub/website-extension/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +49 -2
- package/dist/node_modules/@allyhub/x-extension/package.json +34 -4
- package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +7 -62
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/dist/article.js +1 -1
- package/dist/node_modules/@allyhub/x-view/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/x-view/dist/post.js +2 -2
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +10 -10
- package/dist/text/facts-text.js +5 -5
- package/dist/text/index.js +1 -1
- package/dist/text/long-text.js +4 -0
- package/dist/works.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-CN5PiJYY.js → abnfDiagram-WEYOIA3C-CjAmWsNR.js} +1 -1
- package/editor-web/assets/alt-DnBZJzEh.js +4 -0
- package/editor-web/assets/{architecture-WOLXFQ4H-BnvZtQYk.js → architecture-WOLXFQ4H-DeeKhyhZ.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-tkcEcFQ8.js → architectureDiagram-ZHVYKT53-b32qTaJg.js} +1 -1
- package/editor-web/assets/{arrow-up-DTP2yVSU.js → arrow-up-L4YV_65f.js} +1 -1
- package/editor-web/assets/article-DLMjAdbP.js +73 -0
- package/editor-web/assets/{audio-lines-Ti8-m7H2.js → audio-lines-BFcM7G2L.js} +1 -1
- package/editor-web/assets/{blockDiagram-RJAE7QA3-DhqEIpie.js → blockDiagram-RJAE7QA3-BNbnMNmw.js} +1 -1
- package/editor-web/assets/button-Chk675Xu.js +41 -0
- package/editor-web/assets/{c4Diagram-XDPPPE54-Bg9G95tl.js → c4Diagram-XDPPPE54-BEuemvMw.js} +1 -1
- package/editor-web/assets/calc-worker-D2pGis6e.js +45 -0
- package/editor-web/assets/channel-EzYq4r0d.js +1 -0
- package/editor-web/assets/chart-Be9Hj5GL.js +1 -0
- package/editor-web/assets/choice-BgmBh4yu.js +1 -0
- package/editor-web/assets/{chunk-2E7WHVMD-C8Ve9lAa.js → chunk-2E7WHVMD-Zb5nPx_e.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-BDWwPUnT.js → chunk-4EMNKR2T-DSEM2reX.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-BQiNPKgx.js → chunk-55XCU76K-BOZa_65H.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-QoEt-6jf.js → chunk-7S6XSTFO-DeiGeVpB.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-BeuwIv0-.js → chunk-AQDTSKZB-fPuQFBJc.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-BHW7sLAz.js → chunk-DSNLSHJZ-5vdnoak2.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-bbGED0hu.js → chunk-HAGFOTED-DFF2mZJ1.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-FltWp8yo.js → chunk-HNE4Q36P-g6-ZLbTg.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-NeQzr6kH.js → chunk-NQOKRVIF-o3hNcHMJ.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-eA4-WUhn.js → chunk-UHW7PFBP-BQiDI9dK.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-BPPv325z.js → chunk-VQ5W62QI-CJlMXWWz.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-DOCIz7Te.js → chunk-WQQL4CDK-pNBU8dXv.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-Dc_ihQJi.js → chunk-YZO67HFG-2x-BiWd-.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-CoqwCPSm.js → chunk-ZAUX2LTX-etFStEM8.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-CZUQPkJx.js → chunk-ZCHMQSOR-B3AYRhIY.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-DUh9c50k.js → classDiagram-v2-4MYWR3UA-6y2yX0oq.js} +1 -1
- package/editor-web/assets/collaborator-LRd0hELn.js +1 -0
- package/editor-web/assets/createLucideIcon-CPS-TrJJ.js +1 -0
- package/editor-web/assets/{cynefin-EF2NZ3EQ-DUTZiog0.js → cynefin-EF2NZ3EQ-CX4BTQQe.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-oAjpfbrU.js → cynefinDiagram-WF24UDRP-LbDkOTy3.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-BrKvKCvb.js → dagre-NK4GIZVX-wCKQk7hi.js} +1 -1
- package/editor-web/assets/{diagram-CBK3MWTC-GekVRnmm.js → diagram-CBK3MWTC-a9fofQwk.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-CDd1VFRT.js → diagram-I5XIIV2D-UCLZWch5.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-535RISTn.js → diagram-ODIL2UCW-CAEe88Lp.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-MXzzKCGG.js → diagram-PFBEJUXE-Cp1o45bs.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-vKVwkQxY.js → diagram-RJA3I4VV-c6OVxDyq.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-UwGAiQLx.js → diagram-TYUNFSNR-BVRWslDM.js} +1 -1
- package/editor-web/assets/{dist-CKyfo5RM.js → dist--KKyT5zP.js} +1 -1
- package/editor-web/assets/dist-1k0MHB3i.js +1 -0
- package/editor-web/assets/dist-B9KHJqL5.js +4 -0
- package/editor-web/assets/dist-BbJyrhIY.js +1 -0
- package/editor-web/assets/dist-CJXCQxQM.js +37 -0
- package/editor-web/assets/dist-D9xQGwe9.js +5 -0
- package/editor-web/assets/dist-DFiLzbx8.js +219 -0
- package/editor-web/assets/{dist-shKo7XVN.js → dist-DIPV6xfF.js} +1 -1
- package/editor-web/assets/dist-Dp-fQMtx.js +6 -0
- package/editor-web/assets/dist-Duw28VxJ.js +16 -0
- package/editor-web/assets/{dist-9ymlIMhr.js → dist-DwGhfliS.js} +1 -1
- package/editor-web/assets/dist-OBE2IIYP.js +24 -0
- package/editor-web/assets/dist-j6ZLVcgf.js +38 -0
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-73yGokYa.js → ebnfDiagram-V4P3TTPT-KdOTJgFu.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-BW6V9y6a.js → elk-QONTBCTQ-Cmlrp7qB.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-BPqIJ22h.js → erDiagram-KYQIGQAA-CBM7-aQm.js} +1 -1
- package/editor-web/assets/{eventmodeling-K75KTNOO-_VZ8jvuy.js → eventmodeling-K75KTNOO-CEoJkbuW.js} +1 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-Xm2E2ib_.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-DZ157JN2.js → ganttDiagram-R7GPNTJY-D4S6ZSYD.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-fmcNL9bq.js → gitGraph-VSP46ZUC-BvkL6RSh.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-DiZDyksR.js → gitGraphDiagram-PDYL7XHY-lTGguloH.js} +1 -1
- package/editor-web/assets/hint-BimUgJms.js +1 -0
- package/editor-web/assets/index-C-i_iuxN.js +28 -0
- package/editor-web/assets/index-Cxh_Shkm.css +2 -0
- package/editor-web/assets/{info-OHQRW6UA-V06620kN.js → info-OHQRW6UA-DvKzqNvp.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-CbIgheWX.js → infoDiagram-MVDRKAX5-D7hCpehs.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-D5oJQPkG.js → ishikawaDiagram-HPEHV2GE-Bg93sZQe.js} +1 -1
- package/editor-web/assets/{italic-CDhZKo_q.js → italic-BQBwRTe8.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-BZEv6JI4.js → journeyDiagram-BOSHW7O7-CKm_KONJ.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-CLG1R8y_.js → kanban-definition-FNSA4HC5-BKknnpTR.js} +1 -1
- package/editor-web/assets/{mermaid-parser.core-DxDwXM7z.js → mermaid-parser.core-BzqkDnqL.js} +3 -3
- package/editor-web/assets/{mermaid.core-tU55ZwVG.js → mermaid.core-CEpvTOAe.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-CYf4zzAh.js → mindmap-definition-6OY57UG3-BJ0qG8Wi.js} +1 -1
- package/editor-web/assets/minus-oPj1GxwA.js +1 -0
- package/editor-web/assets/{packet-JDAUHWVQ-DsHeKYNL.js → packet-JDAUHWVQ-ew3kvyFm.js} +1 -1
- package/editor-web/assets/{pegDiagram-ECIUJNBX-CQyh6TTa.js → pegDiagram-ECIUJNBX-DqUS2xit.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-3vCIvpNB.js → pie-XZMESJXO-DTIAMPGm.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-DF5yGBLn.js → pieDiagram-GNMPY74T-DoKOE02-.js} +1 -1
- package/editor-web/assets/progress-CPEbDOoN.js +6 -0
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-B7pxlDYP.js → quadrantDiagram-D57K4MC3-DauOpYun.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-cpEA41mL.js → radar-ABXABTNO-BvMJXUU-.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-BLyy5R2c.js → railroad-I3PHUGI6-D3jdJmhM.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-Y-oyol19.js → railroad-abnf-LNEFI6M7-Dm8ZpmPj.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-o58wHZsr.js → railroad-ebnf-DWYD2UWJ-oc0Du7Ag.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-CcD3PXZ8.js → railroad-peg-JR7BVNR7-CMrQL_7U.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-BuCC4eyy.js → railroadDiagram-Y72NRBL7-y99z0C7i.js} +1 -1
- package/editor-web/assets/react-DztDSW4P.js +1 -0
- package/editor-web/assets/{repeat-2-C5PCbNsg.js → repeat-2-DJi4LW5C.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-Dp-JFGn4.js → requirementDiagram-EQYSW5RA-jMr_uoF6.js} +1 -1
- package/editor-web/assets/row-ClBisiBs.js +1 -0
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-rYuCqEvw.js → sankeyDiagram-SY24JHO5-DcUyx03Q.js} +1 -1
- package/editor-web/assets/schemas-68mjUjP5.js +1 -0
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DryW8x6d.js → sequenceDiagram-BLEHNHQU-R4X8wRCd.js} +1 -1
- package/editor-web/assets/session-2u9U7koW.js +1 -0
- package/editor-web/assets/slides-BByblSSR.js +1 -0
- package/editor-web/assets/snapshots-C9KV-Y2_.js +56 -0
- package/editor-web/assets/sound-DExlNJbb.js +1 -0
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-Bnp0XfpT.js → stateDiagram-v2-A6IESKWZ-BqvXKbCA.js} +1 -1
- package/editor-web/assets/{strikethrough-DJckA35o.js → strikethrough-CyUBnGTl.js} +1 -1
- package/editor-web/assets/{svg-BjM9RazX.js → svg-lBRT-uhy.js} +1 -1
- package/editor-web/assets/swatch-1c1uVn1z.js +1 -0
- package/editor-web/assets/{swimlanes-B3ENRKFQ-BiRRhhbd.js → swimlanes-B3ENRKFQ-hjTXIc6M.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-BLfytmPY.js +8 -0
- package/editor-web/assets/switch-D0K-K8-C.js +1 -0
- package/editor-web/assets/{syntax-CC6QYhCz.js → syntax-Bih_jv7W.js} +1 -1
- package/editor-web/assets/tabs-CxxOnGLR.js +1 -0
- package/editor-web/assets/{textarea-BGtPqZdB.js → textarea-Fu93tFO3.js} +1 -1
- package/editor-web/assets/{timeline-definition-JXYKGLGB-D-Q5ZtDF.js → timeline-definition-JXYKGLGB-BcSoN4Dq.js} +1 -1
- package/editor-web/assets/{trash-2-Bjj6cWzP.js → trash-2-BAKAeziW.js} +1 -1
- package/editor-web/assets/{treeView-D4JQ5SDB-B6DDatXq.js → treeView-D4JQ5SDB-CsFN2jrc.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-D7j5ZhiI.js → treemap-SAJKECNS-DP1eqXJ2.js} +1 -1
- package/editor-web/assets/{undo-2-yOSG766T.js → undo-2-DQ5CBmki.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-tkrdKUJB.js → usecaseDiagram-WPOLBNNX-BGxa0osF.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-Ch4XbSnD.js → vennDiagram-Q3Y3IDCW-D2XhTF49.js} +1 -1
- package/editor-web/assets/video-CDbPX4Cr.js +1 -0
- package/editor-web/assets/{wardley-7MLQ67FV-Bynt7qNQ.js → wardley-7MLQ67FV-DM3jMAbZ.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-DRuSgm_L.js → wardleyDiagram-IVAIDKWA-Bf-DaZEg.js} +1 -1
- package/editor-web/assets/{xychartDiagram-4URNHDU4-DctpvfkL.js → xychartDiagram-4URNHDU4-dp-mdcWd.js} +1 -1
- package/editor-web/index.html +6 -5
- package/package.json +2 -2
- package/editor-web/assets/alt-BOVao_9S.js +0 -4
- package/editor-web/assets/article-B6YCzhj8.js +0 -73
- package/editor-web/assets/calc-worker-B5-fDWnb.js +0 -45
- package/editor-web/assets/channel-C26aBI4o.js +0 -1
- package/editor-web/assets/chart-BOnxneyw.js +0 -1
- package/editor-web/assets/choice-O5nwc2N0.js +0 -1
- package/editor-web/assets/collaborator-BJU5qwHd.js +0 -1
- package/editor-web/assets/createLucideIcon-B3B95oX5.js +0 -1
- package/editor-web/assets/dist-C6NqUEG4.js +0 -16
- package/editor-web/assets/dist-C9UGmCG9.js +0 -6
- package/editor-web/assets/dist-CAk5bjBm.js +0 -1
- package/editor-web/assets/dist-CRaWqNwq.js +0 -37
- package/editor-web/assets/dist-CwIBc7HQ.js +0 -1
- package/editor-web/assets/dist-DXRmkezB.js +0 -38
- package/editor-web/assets/dist-EKK5i0dG.js +0 -219
- package/editor-web/assets/dist-hHJlpLWo.js +0 -5
- package/editor-web/assets/dist-oYKcwWUj.js +0 -4
- package/editor-web/assets/dist-wrKxBrVu.js +0 -24
- package/editor-web/assets/flowDiagram-IUGLLWBU-ouDQYiTr.js +0 -1
- package/editor-web/assets/hint-_AQWCDMj.js +0 -1
- package/editor-web/assets/index-BsstP-cI.js +0 -28
- package/editor-web/assets/index-DQRcmxBO.css +0 -2
- package/editor-web/assets/minus-Cgmm6ncD.js +0 -1
- package/editor-web/assets/progress-0B_TVsPi.js +0 -6
- package/editor-web/assets/react-BP46yLMB.js +0 -1
- package/editor-web/assets/react-pgBZqVxJ.js +0 -96
- package/editor-web/assets/schemas-Ewwjtbf4.js +0 -1
- package/editor-web/assets/session-DiI9KYRI.js +0 -1
- package/editor-web/assets/slides-CCwgBcGH.js +0 -1
- package/editor-web/assets/sound-CqryteNl.js +0 -1
- package/editor-web/assets/swatch-DL3HqIjW.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-BkOls8Tv.js +0 -8
- package/editor-web/assets/switch-DltnKqN-.js +0 -1
- package/editor-web/assets/tabs-C-re0Kxn.js +0 -1
- package/editor-web/assets/video-DXFiCNGc.js +0 -1
|
@@ -697,16 +697,99 @@ const seconds = (v: Time | undefined): number | undefined =>
|
|
|
697
697
|
typeof v === "number" && Number.isFinite(v) ? v : undefined;
|
|
698
698
|
|
|
699
699
|
let fontCanvas: CanvasRenderingContext2D | null | undefined;
|
|
700
|
+
let inkOf: InkOf | undefined;
|
|
701
|
+
|
|
702
|
+
/** A glyph's ink in ems from its pen position: how far above the baseline it reaches, where it starts and ends, and its advance. */
|
|
703
|
+
export interface GlyphInk {
|
|
704
|
+
top: number;
|
|
705
|
+
left: number;
|
|
706
|
+
right: number;
|
|
707
|
+
advance: number;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/** A font's face: its style, weight and family, at any size. */
|
|
711
|
+
export type TextFace = Pick<
|
|
712
|
+
CSSStyleDeclaration,
|
|
713
|
+
"fontStyle" | "fontWeight" | "fontFamily"
|
|
714
|
+
>;
|
|
715
|
+
|
|
716
|
+
/** Measures a glyph's ink in a face. */
|
|
717
|
+
export type InkOf = (face: TextFace, glyph: string) => GlyphInk | undefined;
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* Measures glyphs' ink by drawing them, each once per font. A canvas's
|
|
721
|
+
* `actualBoundingBox*` is not the ink: Chrome on Linux rounds it to whole
|
|
722
|
+
* pixels below 240px and to 1/64 of an em above (a capital's top 1.5px off
|
|
723
|
+
* at 120px). Drawn at 256px, with a pixel's coverage taken as the share of
|
|
724
|
+
* it inside the outline, the ink is within a few thousandths of an em.
|
|
725
|
+
* Self-contained, so it can be shown to a page as source.
|
|
726
|
+
*/
|
|
727
|
+
export function glyphInk(): InkOf {
|
|
728
|
+
const R = 256;
|
|
729
|
+
const ox = R;
|
|
730
|
+
const oy = 1.5 * R;
|
|
731
|
+
const kept = new Map<string, GlyphInk | undefined>();
|
|
732
|
+
let g: CanvasRenderingContext2D | null | undefined;
|
|
733
|
+
return (face, glyph) => {
|
|
734
|
+
const font = `${face.fontStyle} ${face.fontWeight} ${String(R)}px ${face.fontFamily}`;
|
|
735
|
+
const key = `${font}\n${glyph}`;
|
|
736
|
+
if (kept.has(key)) return kept.get(key);
|
|
737
|
+
if (g === undefined) {
|
|
738
|
+
const c = document.createElement("canvas");
|
|
739
|
+
c.width = 3 * R;
|
|
740
|
+
c.height = 2 * R;
|
|
741
|
+
g = c.getContext("2d", { willReadFrequently: true });
|
|
742
|
+
}
|
|
743
|
+
let ink: GlyphInk | undefined;
|
|
744
|
+
if (g) {
|
|
745
|
+
const { width: W, height: H } = g.canvas;
|
|
746
|
+
g.clearRect(0, 0, W, H);
|
|
747
|
+
g.font = font;
|
|
748
|
+
g.textBaseline = "alphabetic";
|
|
749
|
+
g.fillStyle = "#000";
|
|
750
|
+
g.fillText(glyph, ox, oy);
|
|
751
|
+
const a = g.getImageData(0, 0, W, H).data;
|
|
752
|
+
const row = new Float64Array(H);
|
|
753
|
+
const col = new Float64Array(W);
|
|
754
|
+
for (let y = 0; y < H; y++) {
|
|
755
|
+
for (let x = 0; x < W; x++) {
|
|
756
|
+
const v = a[(y * W + x) * 4 + 3] ?? 0;
|
|
757
|
+
if (v > (row[y] ?? 0)) row[y] = v;
|
|
758
|
+
if (v > (col[x] ?? 0)) col[x] = v;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
const t = row.findIndex((v) => v > 0);
|
|
762
|
+
const l = col.findIndex((v) => v > 0);
|
|
763
|
+
const r = col.findLastIndex((v) => v > 0);
|
|
764
|
+
if (t >= 0 && l >= 0 && r >= 0) {
|
|
765
|
+
// An edge's pixel is covered as far as the outline reaches into it.
|
|
766
|
+
const top = t + 1 - (row[t] ?? 0) / 255;
|
|
767
|
+
const left = l + 1 - (col[l] ?? 0) / 255;
|
|
768
|
+
const right = r + (col[r] ?? 0) / 255;
|
|
769
|
+
ink = {
|
|
770
|
+
top: (oy - top) / R,
|
|
771
|
+
left: (left - ox) / R,
|
|
772
|
+
right: (right - ox) / R,
|
|
773
|
+
advance: g.measureText(glyph).width / R,
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
kept.set(key, ink);
|
|
778
|
+
return ink;
|
|
779
|
+
};
|
|
780
|
+
}
|
|
700
781
|
|
|
701
782
|
/**
|
|
702
783
|
* The box an element's text reads as, in client pixels: from its capitals'
|
|
703
784
|
* tops (the font's cap height above the baseline, lowercase text too) to
|
|
704
785
|
* its baseline, and from its first glyph's ink to its last's. `g` measures
|
|
705
|
-
* the fonts. Undefined when it
|
|
786
|
+
* the fonts' ascent and descent, `ink` the glyphs' ink. Undefined when it
|
|
787
|
+
* has no text.
|
|
706
788
|
*/
|
|
707
789
|
export function textBoxOf(
|
|
708
790
|
node: Element,
|
|
709
791
|
g: CanvasRenderingContext2D,
|
|
792
|
+
ink: InkOf,
|
|
710
793
|
): DOMRect | undefined {
|
|
711
794
|
const walk = document.createTreeWalker(node, NodeFilter.SHOW_TEXT);
|
|
712
795
|
let x0 = Infinity;
|
|
@@ -719,11 +802,12 @@ export function textBoxOf(
|
|
|
719
802
|
if (from < 0 || !n.parentElement) continue;
|
|
720
803
|
const to = text.trimEnd().length;
|
|
721
804
|
const cs = getComputedStyle(n.parentElement);
|
|
805
|
+
const size = parseFloat(cs.fontSize);
|
|
722
806
|
g.font = `${cs.fontStyle} ${cs.fontWeight} ${cs.fontSize} ${cs.fontFamily}`;
|
|
723
807
|
const H = g.measureText("H");
|
|
724
808
|
const up = H.fontBoundingBoxAscent;
|
|
725
809
|
const tall = up + H.fontBoundingBoxDescent;
|
|
726
|
-
const cap = H.actualBoundingBoxAscent;
|
|
810
|
+
const cap = (ink(cs, "H")?.top ?? H.actualBoundingBoxAscent / size) * size;
|
|
727
811
|
const range = document.createRange();
|
|
728
812
|
range.setStart(n, from);
|
|
729
813
|
range.setEnd(n, to);
|
|
@@ -732,7 +816,7 @@ export function textBoxOf(
|
|
|
732
816
|
);
|
|
733
817
|
const first = lines[0];
|
|
734
818
|
const last = lines.at(-1);
|
|
735
|
-
if (!first || !last || !(tall > 0)) continue;
|
|
819
|
+
if (!first || !last || !(tall > 0) || !(size > 0)) continue;
|
|
736
820
|
for (const r of lines) {
|
|
737
821
|
// A line's box is the font's ascent and descent, scaled as it is.
|
|
738
822
|
const k = r.height / tall;
|
|
@@ -740,15 +824,13 @@ export function textBoxOf(
|
|
|
740
824
|
y0 = Math.min(y0, baseline - cap * k);
|
|
741
825
|
y1 = Math.max(y1, baseline);
|
|
742
826
|
}
|
|
743
|
-
|
|
744
|
-
const
|
|
745
|
-
const
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
last.right - (tail.width - tail.actualBoundingBoxRight) * kl,
|
|
751
|
-
);
|
|
827
|
+
// A glyph that draws nothing ends where its advance does.
|
|
828
|
+
const head = ink(cs, text.charAt(from));
|
|
829
|
+
const tail = ink(cs, text.charAt(to - 1));
|
|
830
|
+
const kf = (first.height / tall) * size;
|
|
831
|
+
const kl = (last.height / tall) * size;
|
|
832
|
+
x0 = Math.min(x0, first.left + (head ? head.left : 0) * kf);
|
|
833
|
+
x1 = Math.max(x1, last.right - (tail ? tail.advance - tail.right : 0) * kl);
|
|
752
834
|
}
|
|
753
835
|
return x1 > x0 && y1 > y0 ? new DOMRect(x0, y0, x1 - x0, y1 - y0) : undefined;
|
|
754
836
|
}
|
|
@@ -778,8 +860,11 @@ function placeOf(
|
|
|
778
860
|
}
|
|
779
861
|
if (!node || root.contains(node)) return undefined;
|
|
780
862
|
fontCanvas ??= document.createElement("canvas").getContext("2d");
|
|
863
|
+
inkOf ??= glyphInk();
|
|
781
864
|
const text =
|
|
782
|
-
fit === "text" && fontCanvas
|
|
865
|
+
fit === "text" && fontCanvas
|
|
866
|
+
? textBoxOf(node, fontCanvas, inkOf)
|
|
867
|
+
: undefined;
|
|
783
868
|
const r = text ?? node.getBoundingClientRect();
|
|
784
869
|
if (!(r.width > 0) || !(r.height > 0)) return undefined;
|
|
785
870
|
// The stage may be shown at another size (a preview zooms it): measure
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{everyBlock as c}from"./model.js";import{effectiveLook as
|
|
2
|
+
import{everyBlock as c}from"./model.js";import{effectiveLook as a}from"./page.js";export function captionWords(t){return t?{figure:"图",table:"表"}:{figure:"Figure",table:"Table"}}export function contentsTitle(t,e){return t.title??(e?"目录":"Contents")}export function captionOf(t){switch(t.type){case"image":case"component":case"table":return t.caption;case"chart":return t.title;default:return}}export function blockId(t){return t.type==="image"||t.type==="component"||t.type==="table"||t.type==="chart"?t.id:void 0}export function writtenInChinese(t){let e=0,n=0;for(const i of c(t))if("content"in i)for(const r of i.content)e+=(r.text.match(/[㐀-鿿-ヿ]/gu)??[]).length,n+=(r.text.match(/[A-Za-z]+/gu)??[]).length;return e>n}export function captionNumbers(t,e={}){const n=new Map;if(a(e).captions==="plain")return n;const i=captionWords(writtenInChinese(t)),r={figure:0,table:0};for(const u of c(t)){if(captionOf(u)===void 0)continue;const o=u.type==="table"?"table":"figure";r[o]+=1,n.set(u,{kind:o,n:r[o],label:`${i[o]} ${String(r[o])}`})}return n}export function numberedCaption(t,e){return e===void 0?t:/^[图表]/u.test(e.label)?`${e.label} ${t}`:`${e.label}. ${t}`}export const withoutTitle=t=>{const e={...t};return delete e.title,e};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{chartBook as
|
|
3
|
-
`).map((s,
|
|
4
|
-
`).map((
|
|
5
|
-
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${
|
|
2
|
+
import{chartBook as Qe,embeddedChartXml as Je}from"@allyhub/chart";import{chartFrame as et,chartWords as tt,docChart as nt}from"./chart.js";import{BACKGROUNDS as Ie,TEXT_COLORS as Se,hex as ee}from"./color.js";import{columnWidths as it}from"./columns.js";import{COMPONENT_WIDTH as rt,componentName as ot}from"./component.js";import{blockId as $e,captionNumbers as st,contentsTitle as at,numberedCaption as Oe,writtenInChinese as dt,withoutTitle as ct}from"./captions.js";import{sourceList as lt,withSources as ht}from"./cite.js";import{HEADING_RULE_SPACE as ut,cardKept as pt,columnsKept as ft,docParts as gt,headingAnchors as mt,pageAccent as wt,trendSvg as yt}from"./html.js";import{effectiveLook as Fe,LIST_STEP as At,lineHeightPt as Tt,resolvePage as Et,sizePt as He}from"./page.js";import{splitTitle as Rt}from"./title.js";import{markdownOf as St}from"./markdown.js";import{charsAcross as Xe,columnShares as zt,emptyHead as Lt,numberColumns as Mt}from"./table.js";import{DRAWN_CODE as ve}from"./math.js";import{PAPER as te,TONE_COLORS as Ue,tagColors as Ct}from"./paper.js";import{COVER_ASPECT as Nt,everyBlock as ze,firstNoteMarks as bt,noteNumbers as xt,statTone as Dt}from"./model.js";const ue=15,It=1440/25.4,Y=n=>Math.round(n*It),Ge="ListParagraph",Be="bullets",Ot=1.8,pe=At*20,We={sans:{latin:"Calibri"},serif:{latin:"Cambria"},mono:{latin:"Courier New"},times:{latin:"Times New Roman"},song:{latin:"Times New Roman",eastAsia:"宋体"},hei:{latin:"Arial",eastAsia:"黑体"},fangsong:{latin:"Times New Roman",eastAsia:"仿宋"},kai:{latin:"Times New Roman",eastAsia:"楷体"},xiaobiaosong:{latin:"Times New Roman",eastAsia:"方正小标宋简体"}},Pe="Courier New",W=n=>n.slice(1).toUpperCase(),le=W(te.ink),fe=W(te.lead),vt=Buffer.from("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=","base64"),Le=W(te.rule),ge=W(te.ruleStrong),Me=W(te.ruleMid),Ce=W(te.stone),Pt=W(te.stone3),de=W(te.leadSoft),je="ALLYHUB-CHART-";function _t(n){return/[\u3040-\u30ff]/u.test(n)?"Yu Gothic":/[\uac00-\ud7af]/u.test(n)?"Malgun Gothic":"Microsoft YaHei"}const $t=/^(https?:|mailto:)/i,Ne=n=>({indent:0,level:0,room:n,frame:rt}),Ke=n=>({...n,indent:n.indent+pe,level:Math.min(n.level+1,8)}),Ft=400,Ht=n=>n.type==="bullet"||n.type==="numbered"||n.type==="check";function Xt(n,u,w){const l=w/ue,S=Math.floor(Math.min(u??n.width,l));return{width:S,height:Math.round(S*n.height/n.width)}}const qe="TOCHeading";function Ut(n,u,w,l,S,z,r){const{AlignmentType:m,BorderStyle:y,ExternalHyperlink:c,ImageRun:x,Paragraph:h,ShadingType:Z,Table:F,TableCell:_,TableLayoutType:H,TableRow:G,TextRun:M,WidthType:p}=n,N=e=>{const t=e.filter(i=>!(i instanceof n.TableOfContents));return t.at(-1)instanceof h?t:[...t,Q(0)]},X={ascii:Pe,hAnsi:Pe,cs:Pe,eastAsia:w},$=new Set([1]);let ne=0;const k=[],B=e=>({type:Z.CLEAR,color:"auto",fill:e}),he=(e,t,i=4)=>({style:e,color:t,size:i,space:4}),o=r.page.spacing,E=e=>Math.round(e*20),Q=e=>new h({spacing:{before:0,after:E(e),line:14,lineRule:n.LineRuleType.EXACT}}),J=()=>o.after>0?[Q(o.after)]:[],j=e=>e==="center"?m.CENTER:e==="right"?m.RIGHT:e==="justify"?m.JUSTIFIED:void 0,ie=(e,t,i,f={})=>{if(t.tag!==void 0){const s=Ct(t.tag),R={...f,color:W(s.fg),size:Math.round((i.size??r.page.size*2)*.85),shading:B(W(s.bg)),...t.bold||i.bold?{bold:!0}:{},...t.italic?{italics:!0}:{}};return[new M({...R,text:` ${e.replace(/\n/gu," ")} `})]}const g=ee(t.color,Se)??i.color,a=ee(t.background,Ie),d={...f,...t.bold||i.bold?{bold:!0}:{},...t.italic?{italics:!0}:{},...t.underline?{underline:{}}:{},...t.strike?{strike:!0}:{},...g===void 0?{}:{color:g},...i.size===void 0?{}:{size:i.size},...t.code?{font:X,shading:B(a??Ce)}:a===void 0?{}:{shading:B(a)}};return e.split(`
|
|
3
|
+
`).map((s,R)=>new M({...d,text:s,...R>0?{break:1}:{}}))},U=(e,t={})=>e.flatMap(i=>i.note!==void 0?S.has(i.note.toLowerCase())?z.has(i)?[new n.FootnoteReferenceRun(S.get(i.note.toLowerCase())??1)]:[new M({text:String(S.get(i.note.toLowerCase())??1),style:"FootnoteReference"})]:[]:i.text===""&&i.href?.startsWith("#")===!0?xe(i.href.slice(1),i.styles,t):i.href!==void 0&&$t.test(i.href)?[new c({link:i.href,children:ie(i.text,i.styles,t,{style:"Hyperlink"})})]:ie(i.text,i.styles,t)),xe=(e,t,i)=>{const f=decodeURIComponent(e),g=r.refs.get(f)??"",a=r.bookmarks.get(f);return g===""?[]:a===void 0?ie(g,t,i):[new n.InternalHyperlink({anchor:a,children:ie(g,t,i,{style:"Hyperlink"})})]},T=(e,t)=>{const i=e===void 0?void 0:r.bookmarks.get(e);return i===void 0?t:[new n.Bookmark({id:i,children:t})]},D=e=>{const t=j(e?.align),i=ee(e?.background,Ie);return{...t===void 0?{}:{alignment:t},...i===void 0?{}:{shading:B(i)}}},L=e=>e.indent===0?{}:{indent:{left:e.indent}},re=e=>{const t={style:y.SINGLE,color:e,size:4};return{top:t,bottom:t,left:t,right:t}},me=(e,t)=>{const i=ee(e.look?.background,Ie)??Ce,f=ee(e.look?.color,Se),g=t.room-t.indent,a=e.icon===void 0?0:E(r.page.size*Ot)+E(o.box.side),d=g-a,s=(R,C)=>({top:E(o.box.top),bottom:E(Math.max(o.box.top-o.after,0)),left:R,right:C,marginUnitType:p.DXA});return new F({layout:H.FIXED,width:{size:g,type:p.DXA},columnWidths:a===0?[d]:[a,d],...t.indent===0?{}:{indent:{size:t.indent,type:p.DXA}},rows:[new G({cantSplit:!0,children:[...e.icon===void 0?[]:[new _({width:{size:a,type:p.DXA},shading:B(i),borders:re(i),margins:s(E(o.box.side),0),children:[new h({children:[new M({text:e.icon})]})]})],new _({width:{size:d,type:p.DXA},shading:B(i),borders:re(i),margins:s(a===0?E(o.box.side):0,E(o.box.side)),children:[new h({children:U(e.content,{color:f})}),...N(V(e.children??[],Ne(d-E(o.box.side))))]})]})]})},we=(e,t)=>{const i=t.room-t.indent,f=E(o.card.side),g=[...e.title===void 0?[]:[new h({spacing:{after:e.subtitle===void 0?E(o.after):0},children:U([{text:e.title,styles:{bold:!0}}])})],...e.subtitle===void 0?[]:[new h({spacing:{after:E(o.after)},children:[new M({text:e.subtitle,color:fe,size:o.small*2})]})]];return new F({layout:H.FIXED,width:{size:i,type:p.DXA},columnWidths:[i],...t.indent===0?{}:{indent:{size:t.indent,type:p.DXA}},rows:[new G({cantSplit:pt(e,r.page),children:[new _({width:{size:i,type:p.DXA},borders:re(Le),margins:{top:E(o.card.top),bottom:E(Math.max(o.card.top-o.after,0)),left:f,right:f,marginUnitType:p.DXA},children:N([...g,...V(e.children??[],Ne(i-2*f))])})]})]})},oe=(e,t)=>{const i=t.room-t.indent,f=E(o.gap),g=e.stats.length,a=Math.floor((i-f*(g-1))/g),d=e.stats.flatMap((b,P)=>P===0?[a]:[f,a]),s={style:y.NONE,size:0,color:"auto"},R={top:s,bottom:s,left:s,right:s},C=E(o.card.side),A=o.small*2,v=e.stats.flatMap((b,P)=>{const q=Dt(b),ce=[...b.delta===void 0?[]:[new M({text:b.delta,color:W(Ue[q]),size:A})],...b.note===void 0?[]:[new M({text:`${b.delta===void 0?"":" "}${b.note}`,color:fe,size:A})]],Ae=a-2*C,Te=b.trend===void 0?[]:[new h({spacing:{before:60,after:0,line:240},children:[new x({type:"svg",data:Buffer.from(yt(b.trend,Ue[q]).replace("<svg ",`<svg xmlns="http://www.w3.org/2000/svg" width="${String(Math.round(Ae/15))}" height="24" `)),fallback:{type:"png",data:vt},transformation:{width:Math.round(Ae/15),height:24}})]})],I=new _({width:{size:a,type:p.DXA},borders:re(Le),margins:{top:E(o.card.top),bottom:E(o.card.top),left:C,right:C,marginUnitType:p.DXA},children:[new h({spacing:{after:0},children:[new M({text:b.label,color:fe,size:A})]}),new h({spacing:{after:0,line:240,lineRule:n.LineRuleType.AUTO},children:U([{text:b.value,styles:{bold:!0}}],{size:o.figure*2})}),...ce.length===0?[]:[new h({spacing:{after:0},children:ce})],...Te]}),O=new _({width:{size:f,type:p.DXA},borders:R,children:[new h({children:[]})]});return P===0?[I]:[O,I]});return new F({layout:H.FIXED,width:{size:i,type:p.DXA},columnWidths:d,...t.indent===0?{}:{indent:{size:t.indent,type:p.DXA}},rows:[new G({cantSplit:!0,children:v})]})},se=(e,t)=>{const i=t.room-t.indent,f=Math.max(1,...e.rows.map(I=>I.length)),g=Array.from({length:f},(I,O)=>e.widths?.[O]?(e.widths[O]??0)*ue:void 0),a=g.reduce((I,O)=>I+(O??0),0),d=zt(e,{across:Xe(Math.max(i-a,0)/ue,o.small),margins:Xe(2*o.cell.side*96/72,o.small)}),s=g.reduce((I,O,_e)=>I+(O===void 0?d[_e]??1:0),0)||1,R=Math.max(i-a,0),C=g.map((I,O)=>I??R*(d[O]??1)/s),A=C.reduce((I,O)=>I+O,0)||1,v=Math.min(1,i/A),b=C.map(I=>Math.round(I*v)),P=Lt(e),q=(e.head===void 0||e.head==="both")&&!P,ce=e.head==="column"||e.head==="both",Ae=Mt(e),Te=P?e.rows.slice(1):e.rows;return new F({layout:H.FIXED,width:{size:b.reduce((I,O)=>I+O,0),type:p.DXA},columnWidths:b,...t.indent===0?{}:{indent:{size:t.indent,type:p.DXA}},rows:Te.map((I,O)=>new G({tableHeader:q&&O===0,cantSplit:!0,children:Array.from({length:f},(_e,Ee)=>{const Re=q&&O===0,ke=ce&&Ee===0&&!Re;return new _({width:{size:b[Ee]??0,type:p.DXA},...Re?{shading:B(Pt)}:{},borders:{top:O===0?{style:y.SINGLE,size:8,color:ge}:{style:y.NONE,size:0,color:"auto"},left:{style:y.NONE,size:0,color:"auto"},right:{style:y.NONE,size:0,color:"auto"},bottom:O===Te.length-1?{style:y.SINGLE,size:8,color:ge}:Re?{style:y.SINGLE,size:6,color:ge}:{style:y.SINGLE,size:4,color:Me}},margins:{top:E(o.cell.top),bottom:E(o.cell.top),left:E(o.cell.side),right:E(o.cell.side),marginUnitType:p.DXA},children:[new h({spacing:{after:0},...Ae.has(Ee)?{alignment:m.RIGHT}:{},children:U(I[Ee]??[],{bold:ke||Re,size:o.small*2})})]})})}))})},ae=(e,t,i,f,g,a)=>{const d=j(e.align),s={...L(t),...d===void 0?{}:{alignment:d}},R=i===void 0?void 0:e.caption,C=R!==void 0,A=[new h({...s,keepNext:C,...i?{spacing:{line:240,lineRule:n.LineRuleType.AUTO,...C?{after:E(o.caption)}:{}}}:{},children:i?[new x({type:i.type,data:i.data,transformation:Xt(i,e.width,t.room-t.indent),altText:{name:e.alt??"",title:e.caption??e.alt??"",description:e.alt??""}})]:[new M({text:f,color:de})]})];return R!==void 0&&A.push(new h({...s,style:"Caption",children:T(a,[new M({text:Oe(R,g)})])})),A},ye=(e,t)=>{const i=t.room-t.indent,f=e.columns.map(A=>A.width??1),g=f.reduce((A,v)=>A+v,0)||1,a=f.map(A=>Math.round(i*A/g)),d=it(e,t.frame),s={style:y.NONE,size:0,color:"auto"},R={top:s,bottom:s,left:s,right:s,insideHorizontal:s,insideVertical:s},C=Ft/2;return new F({layout:H.FIXED,width:{size:i,type:p.DXA},columnWidths:a,borders:R,...t.indent===0?{}:{indent:{size:t.indent,type:p.DXA}},rows:[new G({cantSplit:ft(e,r.page),children:e.columns.map((A,v)=>{const b=a[v]??0,P=v===0?0:C,q=v===e.columns.length-1?0:C,ce=N(V(A.blocks,{indent:0,level:0,room:b-P-q,frame:d[v]??t.frame}));return new _({width:{size:b,type:p.DXA},borders:R,margins:{top:0,bottom:0,left:P,right:q,marginUnitType:p.DXA},children:ce})})})]})},K=(e,t,i)=>{const f=ee(e.look?.color,Se),g=V(e.children??[],Ke(t)),a=D(e.look),d=Ge;return e.type==="check"?[new h({...a,...L(t),style:d,children:[new M({text:e.checked?"☑ ":"☐ "}),...U(e.content,{color:f})]}),...g]:[new h({...a,style:d,numbering:e.type==="bullet"?{reference:Be,level:t.level}:{reference:`start-${String(i.start)}`,level:t.level,instance:i.id},children:U(e.content,{color:f})}),...g]},De=(e,t)=>{const i="look"in e?e.look:void 0,f=ee(i?.color,Se),g=D(i),a=()=>"children"in e?V(e.children??[],Ke(t)):[];switch(e.type){case"paragraph":case"toggle":return[new h({...r.sets.align&&e.look?.align===void 0?{alignment:m.JUSTIFIED}:{},...g,...r.sets.indent&&e.type==="paragraph"?{indent:{left:t.indent,firstLine:Math.round(r.page.textIndent*r.page.size*20)}}:L(t),children:U(e.content,{color:f})}),...a()];case"heading":return[new h({...g,...L(t),...e===r.title?{heading:n.HeadingLevel.TITLE}:{heading:n.HeadingLevel[`HEADING_${String(e.level)}`]},children:T(r.anchors.get(e),U(e.content,{color:f}))}),...a()];case"quote":return[new h({...g,indent:{left:t.indent+E(o.quote)},border:{left:{style:y.SINGLE,color:l??ge,size:l?12:6,space:Math.floor(o.quote-(l?1.5:.75))}},children:U(e.content,{color:f??fe})}),...a()];case"callout":return[me(e,t),...J()];case"card":return[we(e,t),...J()];case"stats":return[oe(e,t),...J()];case"code":{if(e.language===ve.math||e.language===ve.mermaid){const R=u.drawn?.(e);if(R)return ae({...e.language===ve.math?{}:{align:"center"}},t,R,"")}const d=R=>({style:y.SINGLE,color:Ce,size:4,space:R}),s=E(o.box.side+.5);return[new h({indent:{left:t.indent+s,right:s},shading:B(Ce),border:{top:d(o.box.top),bottom:d(o.box.top),left:d(o.box.side),right:d(o.box.side)},keepLines:!0,children:e.code.split(`
|
|
4
|
+
`).map((R,C)=>new M({text:R,font:X,size:o.small*2,...C>0?{break:1}:{}}))})]}case"columns":return[ye(e,t)];case"chart":{const d=r.numbers.get(e),s=d===void 0?void 0:e.title,{chart:R,problems:C}=nt(s===void 0?e:ct(e),u),A=he(y.DASHED,Me);if(!R)return[new h({...L(t),alignment:m.CENTER,border:{top:A,bottom:A,left:A,right:A},children:[new M({text:[e.title??"Chart",...C].join(": "),color:de})]})];const v=et(e,t.frame),b=(t.room-t.indent)/ue,P=Math.min(1,b/v.width);return k.push({chart:R,width:Math.round(v.width*P),height:Math.round(v.height*P),words:tt(e,R)}),[new h({...L(t),alignment:m.CENTER,keepNext:s!==void 0,spacing:{line:240,lineRule:n.LineRuleType.AUTO},children:[new M({text:`${je}${String(k.length)}`})]}),...s===void 0?[]:[new h({...L(t),alignment:m.CENTER,style:"Caption",children:T(e.id,[new M({text:Oe(s,d)})])})]]}case"image":return ae(e,t,u.picture?.(e.src),e.alt??e.caption??e.src,r.numbers.get(e),e.id);case"component":{const d=u.component?.(e);if(d)return ae(e,t,d,"",r.numbers.get(e),e.id);const s=he(y.DASHED,Me);return[new h({...L(t),alignment:m.CENTER,border:{top:s,bottom:s,left:s,right:s},children:[new M({text:ot(e),color:de})]})]}case"table":return[...e.caption===void 0?[]:[new h({...L(t),style:"Caption",keepNext:!0,spacing:{after:E(o.caption)},children:T(e.id,[new M({text:Oe(e.caption,r.numbers.get(e))})])})],se(e,t),...J()];case"pagebreak":return[new h({spacing:{before:0,after:0,line:20,lineRule:n.LineRuleType.EXACT},children:[new n.PageBreak]})];case"bibliography":{const{page:d}=r,s=d.textIndent>0?Math.round(d.textIndent*d.size*20):480;return r.sources.map(R=>new h({...L(t),alignment:m.LEFT,indent:{left:t.indent+s,hanging:s},spacing:{after:E(o.after)},children:R.pieces.map(C=>{const A=C.italic?{italics:!0}:{};return new M({text:C.text,...A})})}))}case"toc":{const d=e.levels??3,s=r.headings.filter(A=>A.level<=d).map(A=>{const v=r.anchors.get(A)??"",b=u.headingPage?.(v),P=r.bookmarks.get(v);return{title:A.content.map(q=>q.text).join(""),level:A.level,...b===void 0?{}:{page:b},...P===void 0?{}:{href:P}}}),R=Math.min(...s.map(A=>A.level)),C=at(e,r.chinese);return[...C===""?[]:[new h({style:qe,text:C})],new n.TableOfContents(void 0,{hyperlink:!0,headingStyleRange:`1-${String(d)}`,beginDirty:!1,cachedEntries:s.map(A=>({...A,level:A.level-R+1}))})]}case"note":return[];case"divider":return[new h({...L(t),spacing:{before:E(o.divider),after:E(o.divider),line:20,lineRule:n.LineRuleType.EXACT},border:{bottom:{style:y.SINGLE,color:Le,size:4,space:0}}})];case"embed":{const d=/^<\s*([A-Za-z][\w.]*)/.exec(e.source.trim())?.[1],s=he(y.DASHED,Me);return[new h({...L(t),alignment:m.CENTER,border:{top:s,bottom:s,left:s,right:s},children:[new M({text:d??"",color:de})]})]}case"source":return[];case"bullet":case"numbered":case"check":return[]}};function V(e,t){const i=[];let f,g;for(const a of e){if(!Ht(a)){f=void 0,g=void 0,i.push(...De(a,t));continue}if(f===void 0||g===void 0||g.type==="numbered"!=(a.type==="numbered")){const d=a.type==="numbered"?a.start??1:1;$.add(d),f={id:++ne,start:d}}g=a,i.push(...K(a,t,f))}return i.flatMap((a,d)=>a instanceof F&&i[d+1]instanceof F?[a,Q(0)]:[a])}return{charts:k,body:(e,t)=>V(e,Ne(t)),footnotes:e=>Object.fromEntries([...ze(e)].flatMap(t=>{if(t.type!=="note")return[];const i=S.get(t.label.toLowerCase());if(i===void 0)return[];const f=V(t.children??[],Ne(Y(r.page.width)-Y(r.page.margins.left+r.page.margins.right))).filter(g=>g instanceof h);return[[String(i),{children:[new h({spacing:{after:40},children:U(t.content,{size:18,color:fe})}),...f]}]]})),numbering:()=>[{reference:Be,levels:Array.from({length:9},(e,t)=>({level:t,format:n.LevelFormat.BULLET,text:["•","◦","▪"][t%3]??"•",alignment:m.LEFT,style:{paragraph:{indent:{left:(t+1)*pe,hanging:pe}}}}))},...[...$].sort((e,t)=>e-t).map(e=>({reference:`start-${String(e)}`,levels:Array.from({length:9},(t,i)=>({level:i,format:[n.LevelFormat.DECIMAL,n.LevelFormat.LOWER_LETTER,n.LevelFormat.LOWER_ROMAN][i%3]??n.LevelFormat.DECIMAL,text:`%${String(i+1)}.`,alignment:m.LEFT,...i===0?{start:e}:{},style:{paragraph:{indent:{left:(i+1)*pe,hanging:pe}}}}))}))]}}const Gt="1980-01-01T00:00:00Z",Ye=9525,Ve="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Bt=n=>n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");function Wt(n,u,w,l,S){return n.forEach((z,r)=>{const m=String(r+1),y=`rIdChart${m}`,c=`Microsoft_Excel_Worksheet${m}.xlsx`;S(`word/charts/chart${m}.xml`,Je(z.chart,{width:z.width*.75,height:z.height*.75},"rId1",{frameless:!0})),S(`word/charts/_rels/chart${m}.xml.rels`,`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
5
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${Ve}/package" Target="../embeddings/${c}"/></Relationships>`),S(`word/embeddings/${c}`,Qe(z.chart)),w=w.replace("</Relationships>",`<Relationship Id="${y}" Type="${Ve}/chart" Target="charts/chart${m}.xml"/></Relationships>`),l=l.replace("</Types>",`<Override ContentType="application/vnd.openxmlformats-officedocument.drawingml.chart+xml" PartName="/word/charts/chart${m}.xml"/></Types>`);const x=String(z.width*Ye),h=String(z.height*Ye),Z=`<w:r><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${x}" cy="${h}"/><wp:effectExtent l="0" t="0" r="0" b="0"/><wp:docPr id="0" name="Chart ${m}" descr="${Bt(z.words)}"/><wp:cNvGraphicFramePr/><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/chart"><c:chart xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" r:id="${y}"/></a:graphicData></a:graphic></wp:inline></w:drawing></w:r>`;u=u.replace(new RegExp(`<w:r>(?:(?!<w:r>).)*?<w:t[^>]*>${je}${m}</w:t></w:r>`,"su"),Z)}),n.length>0&&!l.includes('Extension="xlsx"')&&(l=l.replace("</Types>",'<Default ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" Extension="xlsx"/></Types>')),{document:u,rels:w,types:l}}function jt(n,u,w){const l=u.unzipSync(n),S=p=>{const N=l[p];return N&&new TextDecoder().decode(N)},z=(p,N)=>{l[p]=typeof N=="string"?new TextEncoder().encode(N):N},r="word/document.xml",m="word/_rels/document.xml.rels",y="[Content_Types].xml",c=Wt(w,S(r)??"",S(m)??"",S(y)??"",z);z(y,c.types);let x=c.document,h=c.rels;[...new Set([...x.matchAll(/w:hyperlink [^>]*r:id="([^"]+)"/g)].map(p=>p[1]??""))].forEach((p,N)=>{const X=`rIdLink${String(N+1)}`;x=x.split(`"${p}"`).join(`"${X}"`),h=h.split(`"${p}"`).join(`"${X}"`)});let F=0;x=x.replace(/<wp:docPr id="\d+"/g,()=>`<wp:docPr id="${String(++F)}"`);const _=new Map;x=x.replace(/<w:bookmarkStart w:name="([^"]*)" w:id="(\d+)"/g,(p,N,X)=>{const $=String(_.size+1);return _.set(X,$),`<w:bookmarkStart w:name="${N}" w:id="${$}"`}),x=x.replace(/<w:bookmarkEnd w:id="(\d+)"/g,(p,N)=>{const X=_.get(N);return X===void 0?p:`<w:bookmarkEnd w:id="${X}"`}),z(r,x),z(m,h);const H="docProps/core.xml",G=S(H);G!==void 0&&z(H,G.replace(/(<dcterms:(?:created|modified)[^>]*>)[^<]*/g,`$1${Gt}`));const M=Object.fromEntries(Object.entries(l).sort(([p],[N])=>p<N?-1:1));return u.zipSync(M,{mtime:new Date(1980,0,1)})}const be=(n,u)=>{const w=We[n];return{ascii:w.latin,hAnsi:w.latin,cs:w.latin,eastAsia:w.eastAsia??u}};function Kt(n,u,w){const l={left:[],center:[],right:[]};u.left!==void 0&&l.left.push(u.left),u.center!==void 0&&l.center.push(u.center),u.right!==void 0&&l.right.push(u.right),u.outside!==void 0&&l[w.odd?"right":"left"].push(u.outside),u.inside!==void 0&&l[w.odd?"left":"right"].push(u.inside);const S={size:Math.round(w.size*2),color:w.color,font:be(w.face,w.eastAsia)},z=r=>r.split(/(\{title\}|\{section\}|\{page\}|\{pages\})/u).filter(m=>m!=="").map(m=>m==="{page}"?new n.TextRun({...S,children:[n.PageNumber.CURRENT]}):m==="{pages}"?new n.TextRun({...S,children:[n.PageNumber.TOTAL_PAGES]}):m==="{section}"?new n.SimpleField(`STYLEREF "heading ${String(w.section)}"`,""):new n.TextRun({...S,text:m==="{title}"?w.title:m}));return new n.Paragraph({style:w.style,tabStops:[{type:n.TabStopType.CENTER,position:Math.round(w.width/2)},{type:n.TabStopType.RIGHT,position:w.width}],children:[...z(l.left.join(" ")),new n.TextRun({...S,children:[new n.Tab]}),...z(l.center.join(" ")),new n.TextRun({...S,children:[new n.Tab]}),...z(l.right.join(" "))]})}const Ze=(n,u,w,l)=>({run:{...u?.font===void 0?{}:{font:be(n.font,w)},...u?.size===void 0?{}:{size:Math.round(n.size*2)},...u?.weight===void 0?{}:{bold:n.weight==="bold"},...u?.italic===void 0?{}:{italics:n.italic}},paragraph:u?.align===void 0?{}:{alignment:n.align==="center"?l.AlignmentType.CENTER:n.align==="right"?l.AlignmentType.RIGHT:l.AlignmentType.LEFT}});function qt(n){const u=new Map,w=new Set;return n.forEach((l,S)=>{const z=l.replace(/[^A-Za-z0-9_]/gu,"_").replace(/^[^A-Za-z]+/u,"");let r=`b_${z}`.slice(0,32);(w.has(r)||z==="")&&(r=`b_${String(S)}_${z}`.slice(0,40)),w.add(r),u.set(l,r)}),u}export async function docxOf(n,u,w,l={}){const S=l.page??{},z=Fe(S).citationStyle??"apa",r=ht(w,l.sources??[],z,"block"),m=lt(w,l.sources??[],z),y=Fe(S),c=Et(S),x=We[c.font].eastAsia??_t(St(r)),h=be(c.font,x),Z=ee(wt(l.page),{}),F=mt(r),_=st(r,S),H=new Map;for(const T of ze(r)){const D=$e(T),L=_.get(T);D!==void 0&&L!==void 0&&H.set(D,L.label)}for(const[T,D]of F)T.type==="heading"&&H.set(D,T.content.map(L=>L.text).join(""));const{title:G}=Rt(r),M=[...ze(r)].filter(T=>T.type==="heading"&&T!==G),p=qt([...F.values(),...[...ze(r)].flatMap(T=>{const D=$e(T);return D===void 0?[]:[D]})]),N=Ut(n,l,x,Z,xt(r),bt(r),{page:c,sets:{indent:y.textIndent!==void 0&&y.textIndent>0,align:y.textAlign==="justify"},numbers:_,refs:H,bookmarks:p,anchors:F,title:G,headings:M,chinese:dt(r),sources:m}),X=gt(r),$={width:Y(c.width),height:Y(c.height)},ne={top:Y(c.margins.top),bottom:Y(c.margins.bottom),left:Y(c.margins.left),right:Y(c.margins.right)},k=l.cover,B=[c.header,c.footer].some(T=>T!==void 0&&(T.outside!==void 0||T.inside!==void 0)),he=X.map((T,D)=>{const L=T.landscape?$.height:$.width,re=L-ne.left-ne.right,me=N.body(T.blocks,re);if(D===0&&k){const K=Math.round(L/ue);me.unshift(new n.Paragraph({spacing:{before:0,after:0},children:[new n.ImageRun({type:k.type,data:k.data,transformation:{width:K,height:Math.round(K*Nt)},floating:{horizontalPosition:{relative:n.HorizontalPositionRelativeFrom.PAGE,offset:0},verticalPosition:{relative:n.VerticalPositionRelativeFrom.PAGE,offset:0},allowOverlap:!1,margins:{bottom:324e3},wrap:{type:n.TextWrappingType.TOP_AND_BOTTOM}},altText:{name:"Cover",title:"Cover",description:""}})]}))}const we=(K,De,V)=>{if(K===void 0)return;const e=t=>Kt(n,K,{style:V,odd:t,width:re,title:l.title??"",section:Math.min(...M.map(i=>i.level),6),face:K.font??c.font,eastAsia:x,size:K.size===void 0?Math.max(7.5,c.size*.75):He(K.size),color:De?de:le});return{default:e(!0),...B?{even:e(!1)}:{}}},oe=we(c.header,y.header===void 0,"Header"),se=we(c.footer,y.footer===void 0,"Footer"),ae=D===0&&k!==void 0&&oe!==void 0,ye=y.grid===void 0?void 0:{type:n.DocumentGridType.LINES_AND_CHARS,linePitch:Math.round(Tt(c)*20),charSpace:Math.round(c.textWidth/25.4*72/y.grid.chars-c.size)*4096};return{properties:{page:{size:{width:Math.min($.width,$.height),height:Math.max($.width,$.height),...T.landscape||$.width>$.height?{orientation:n.PageOrientation.LANDSCAPE}:{}},margin:{...ne,header:Math.max(0,ne.top-Y(7)-Math.round(c.size*20*1.2)),footer:Math.max(0,ne.bottom-Y(7)-Math.round(c.size*20*1.2))}},...ye===void 0?{}:{grid:ye},...ae?{titlePage:!0}:{}},...oe===void 0?{}:{headers:{default:new n.Header({children:[oe.default]}),...oe.even?{even:new n.Header({children:[oe.even]})}:{},...ae?{first:new n.Header({children:[]})}:{}}},...se===void 0?{}:{footers:{default:new n.Footer({children:[se.default]}),...se.even?{even:new n.Footer({children:[se.even]})}:{},...ae?{first:new n.Footer({children:[se.default]})}:{}}},children:me}}),o=c.lineHeight,E={spacing:{after:Math.round(c.paragraphSpacing*c.size*20),..."pt"in o?{line:Math.round(o.pt*20),lineRule:n.LineRuleType.EXACT}:{line:Math.round(o.multiple*240),lineRule:n.LineRuleType.AUTO}}},Q=c.spacing,J=T=>Math.round(T*20),j=T=>{const D=y.headings?.[T],L=Ze(c.headings[T],D,x,n);return{run:{size:Math.round(c.headings[T].size*2),bold:!0,font:h,color:le,...L.run},paragraph:{spacing:{before:J(Q.heading.before),after:J(Q.heading.after)},keepNext:!0,keepLines:!0,...c.headings[T].rule?{border:{bottom:{style:n.BorderStyle.SINGLE,size:4,color:Le,space:ut}}}:{},...L.paragraph}}},ie=Ze(c.title,y.title,x,n),U=new n.Document({creator:"AllyHub",lastModifiedBy:"AllyHub",...l.title===void 0?{}:{title:l.title},...B?{evenAndOddHeaderAndFooters:!0}:{},numbering:{config:N.numbering()},styles:{default:{document:{run:{font:h,size:Math.round(c.size*2),color:le},paragraph:E},hyperlink:{run:{color:Z??le,underline:{color:Z??ge}}},title:{run:{size:Math.round(c.title.size*2),bold:!0,font:h,color:le,...ie.run},paragraph:{spacing:{before:0,after:J(Q.title)},keepNext:!0,...ie.paragraph}},heading1:j(1),heading2:j(2),heading3:j(3),heading4:j(4),heading5:j(5),heading6:j(6)},paragraphStyles:[{id:qe,name:"TOC Heading",basedOn:"Normal",next:"Normal",quickFormat:!0,...j(1)},{id:"Caption",name:"caption",basedOn:"Normal",next:"Normal",quickFormat:!0,run:{size:Q.small*2,color:de},paragraph:{spacing:{before:0}}},{id:Ge,name:"List Paragraph",basedOn:"Normal",quickFormat:!0,paragraph:{contextualSpacing:!0}},...[["Header",c.header,y.header===void 0],["Footer",c.footer,y.footer===void 0]].flatMap(([T,D,L])=>D===void 0?[]:[{id:T,name:T.toLowerCase(),basedOn:"Normal",run:{size:Math.round((D.size===void 0?Math.max(7.5,c.size*.75):He(D.size))*2),color:L?de:le,font:be(D.font??c.font,x)},paragraph:{spacing:{before:0,after:0,line:240}}}])]},sections:he,footnotes:N.footnotes(r)}),xe=await n.Packer.toBuffer(U);return jt(new Uint8Array(xe),u,N.charts)}
|