allyhub 0.9.0 → 0.11.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 +16 -0
- package/dist/commands/auth.js +4 -4
- package/dist/commands/cloud-tools.js +11 -11
- package/dist/commands/dev.js +2 -2
- package/dist/commands/frames/compare.js +2 -2
- package/dist/commands/frames/piece.js +1 -1
- package/dist/commands/frames/report.js +2 -0
- package/dist/commands/frames.js +11 -9
- 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/commands/render.js +2 -2
- package/dist/help.js +4 -4
- package/dist/main.js +8 -7
- package/dist/node_modules/@allyhub/3d-extension/dist/stage-routes.js +1 -1
- 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/dist/emoji.d.ts +29 -0
- package/dist/node_modules/@allyhub/browser/dist/emoji.js +57 -0
- package/dist/node_modules/@allyhub/browser/dist/picture.d.ts +18 -0
- package/dist/node_modules/@allyhub/browser/dist/picture.js +2 -0
- package/dist/node_modules/@allyhub/browser/package.json +9 -1
- package/dist/node_modules/@allyhub/build/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +7 -0
- package/dist/node_modules/@allyhub/build/dist/made-notes.d.ts +9 -0
- package/dist/node_modules/@allyhub/build/dist/made-notes.js +2 -0
- package/dist/node_modules/@allyhub/build/dist/project-tool.d.ts +17 -0
- package/dist/node_modules/@allyhub/build/dist/stage-route.d.ts +7 -0
- 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/dist/exports.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/inputs.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/pages.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/ports.js +2 -0
- 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/respond.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/reveal.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/server.js +2 -2
- package/dist/node_modules/@allyhub/dev-server/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/watcher.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +7 -0
- 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 +51 -92
- 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 +19 -6
- package/dist/node_modules/@allyhub/doc-print/dist/pages.js +5 -5
- package/dist/node_modules/@allyhub/doc-print/dist/print.js +10 -10
- 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/note-shape.d.ts +20 -0
- package/dist/node_modules/@allyhub/formats/dist/note-shape.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/dist/export.js +4 -1
- package/dist/node_modules/@allyhub/image-extension/package.json +16 -6
- 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/linkedin-extension/LICENSE +241 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/article-build.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/article-kind.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/build-plugins.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/build.js +5 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/media.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/stage-module.js +82 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/stage.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-extension/dist/workspace.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-extension/package.json +287 -0
- package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +12 -0
- package/dist/node_modules/@allyhub/linkedin-model/LICENSE +241 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/article-check.js +5 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/article.js +3 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/check.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/count.js +3 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/edit.js +3 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/html.js +19 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/limits.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/little.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/post.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-model/dist/requests.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-model/package.json +14 -0
- package/dist/node_modules/@allyhub/linkedin-view/LICENSE +241 -0
- package/dist/node_modules/@allyhub/linkedin-view/dist/article.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-view/dist/fold.js +3 -0
- package/dist/node_modules/@allyhub/linkedin-view/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-view/dist/post.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-view/dist/stage.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-view/dist/text.js +2 -0
- package/dist/node_modules/@allyhub/linkedin-view/package.json +21 -0
- package/dist/node_modules/@allyhub/linkedin-view/src/style.css +600 -0
- 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/layer.d.ts +2 -0
- package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -1
- package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +14 -1
- package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +18 -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 +140 -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/cloud.d.ts +157 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +10 -2
- package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +101 -186
- package/dist/node_modules/@allyhub/protocol/dist/frame.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 +92 -94
- package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +17 -0
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +7 -0
- package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +15 -3
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- 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/dist/encode.js +1 -1
- package/dist/node_modules/@allyhub/render/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/render/dist/look.js +1 -1
- package/dist/node_modules/@allyhub/render/dist/render.js +2 -2
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
- package/dist/node_modules/@allyhub/report-extension/dist/build.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/check.js +3 -0
- package/dist/node_modules/@allyhub/report-extension/dist/cli/find.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +5 -0
- package/dist/node_modules/@allyhub/report-extension/dist/cli/picture.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
- package/dist/node_modules/@allyhub/report-extension/dist/page.js +21 -0
- package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +21 -0
- package/dist/node_modules/@allyhub/report-extension/dist/styles.js +5 -0
- package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/package.json +182 -0
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +132 -0
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.css +105 -0
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +17 -0
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/tokens.js +38 -0
- 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/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/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/dist/viewer.d.ts +6 -0
- package/dist/node_modules/@allyhub/scenery-host/dist/viewer.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/export.js +2 -4
- 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 +2 -6
- package/dist/node_modules/@allyhub/sheet-extension/package.json +24 -9
- 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/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +22 -16
- 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/install.js +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +3 -0
- package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.js +1 -1
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +18 -18
- 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/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/package.json +17 -4
- 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/preview.js +5 -5
- 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/dist/build.js +4 -3
- package/dist/node_modules/@allyhub/x-extension/package.json +43 -15
- 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 +12 -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-BKmMA6gn.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-BnvZtQYk.js → architecture-WOLXFQ4H-BEFBgb4k.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-tkcEcFQ8.js → architectureDiagram-ZHVYKT53-_u5YfCjY.js} +1 -1
- package/editor-web/assets/{arrow-up-DTP2yVSU.js → arrow-up-B5rJbBv0.js} +1 -1
- package/editor-web/assets/article-BUmD3xtR.js +8 -0
- package/editor-web/assets/article-DNioBb3p.js +7 -0
- package/editor-web/assets/{audio-lines-Ti8-m7H2.js → audio-lines-CzuzsGjI.js} +1 -1
- package/editor-web/assets/{blockDiagram-RJAE7QA3-DhqEIpie.js → blockDiagram-RJAE7QA3-DybfaO3Z.js} +1 -1
- package/editor-web/assets/bookmark-Dsd3kHJJ.js +1 -0
- package/editor-web/assets/button-eGxLxbv9.js +41 -0
- package/editor-web/assets/{c4Diagram-XDPPPE54-Bg9G95tl.js → c4Diagram-XDPPPE54-BfqLHB5i.js} +1 -1
- package/editor-web/assets/calc-worker-D2pGis6e.js +45 -0
- package/editor-web/assets/channel-TNPgFDrw.js +1 -0
- package/editor-web/assets/chart-C37xvZT2.js +1 -0
- package/editor-web/assets/chart-no-axes-column-BVkeF_Mr.js +1 -0
- package/editor-web/assets/{chunk-2E7WHVMD-C8Ve9lAa.js → chunk-2E7WHVMD-BVp1I_d0.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-BDWwPUnT.js → chunk-4EMNKR2T-CTdgWEMr.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-BQiNPKgx.js → chunk-55XCU76K-7pnsxeaP.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-QoEt-6jf.js → chunk-7S6XSTFO-Dc0Dvkq7.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-BeuwIv0-.js → chunk-AQDTSKZB-VAILIsfx.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-BHW7sLAz.js → chunk-DSNLSHJZ-CUDx1Rv5.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-bbGED0hu.js → chunk-HAGFOTED-DAoEe-dJ.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-FltWp8yo.js → chunk-HNE4Q36P-g0akya12.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-NeQzr6kH.js → chunk-NQOKRVIF-hTGjzXdJ.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-eA4-WUhn.js → chunk-UHW7PFBP-BgLV8BIJ.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-BPPv325z.js → chunk-VQ5W62QI-Bw19OOSD.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-DOCIz7Te.js → chunk-WQQL4CDK-CMST9dyE.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-Dc_ihQJi.js → chunk-YZO67HFG-Bbpu36XF.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-CoqwCPSm.js → chunk-ZAUX2LTX-C48Ri0Gs.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-CZUQPkJx.js → chunk-ZCHMQSOR-DN1g01Oe.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-DUh9c50k.js → classDiagram-v2-4MYWR3UA-U6jbPr2d.js} +1 -1
- package/editor-web/assets/collaborator-B1u2td9m.js +1 -0
- package/editor-web/assets/createLucideIcon-GFZ_fxLc.js +1 -0
- package/editor-web/assets/{cynefin-EF2NZ3EQ-DUTZiog0.js → cynefin-EF2NZ3EQ-gzkai_7-.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-oAjpfbrU.js → cynefinDiagram-WF24UDRP-DtSekSr6.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-BrKvKCvb.js → dagre-NK4GIZVX-CiUwYVT6.js} +1 -1
- package/editor-web/assets/{diagram-CBK3MWTC-GekVRnmm.js → diagram-CBK3MWTC-r9XHCV-k.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-CDd1VFRT.js → diagram-I5XIIV2D-DxVsDZ34.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-535RISTn.js → diagram-ODIL2UCW-B0eNQoHV.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-MXzzKCGG.js → diagram-PFBEJUXE-C7f2MfJT.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-vKVwkQxY.js → diagram-RJA3I4VV-CSXcnvct.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-UwGAiQLx.js → diagram-TYUNFSNR-DXzOD_ii.js} +1 -1
- package/editor-web/assets/dist-BGRwhCQO.js +1 -0
- package/editor-web/assets/{dist-9ymlIMhr.js → dist-BW4X7BrF.js} +1 -1
- package/editor-web/assets/dist-BgDRE85b.js +2 -0
- package/editor-web/assets/dist-Blq5nJnU.js +24 -0
- package/editor-web/assets/dist-BuWaZ3Y4.js +274 -0
- package/editor-web/assets/dist-C1emZ9wX.js +37 -0
- package/editor-web/assets/dist-CC7OeU1e.js +6 -0
- package/editor-web/assets/dist-CX-fiPSn.js +38 -0
- package/editor-web/assets/dist-C_VvG-_9.js +5 -0
- package/editor-web/assets/dist-Ce7HrBxv.js +3 -0
- package/editor-web/assets/dist-D2k6w-_a.js +1 -0
- package/editor-web/assets/dist-DDv_SbKw.js +84 -0
- package/editor-web/assets/dist-DEoEO4zs.js +1 -0
- package/editor-web/assets/dist-DlDxxPIP.js +16 -0
- package/editor-web/assets/dist-Gz6NDS0J.js +4 -0
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-73yGokYa.js → ebnfDiagram-V4P3TTPT-Cs4YRvDD.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-BW6V9y6a.js → elk-QONTBCTQ-Bh3LZ9WI.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-BPqIJ22h.js → erDiagram-KYQIGQAA-C4vYTYXp.js} +1 -1
- package/editor-web/assets/{eventmodeling-K75KTNOO-_VZ8jvuy.js → eventmodeling-K75KTNOO-BN1kkHWS.js} +1 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-B04NGsyi.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-DZ157JN2.js → ganttDiagram-R7GPNTJY-CA1LkkC5.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-fmcNL9bq.js → gitGraph-VSP46ZUC-Dy5tA7dG.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-DiZDyksR.js → gitGraphDiagram-PDYL7XHY-hJIB8EkH.js} +1 -1
- package/editor-web/assets/hint-B8JpEypy.js +1 -0
- package/editor-web/assets/index-CgB5osVc.js +28 -0
- package/editor-web/assets/index-Daytem9N.css +2 -0
- package/editor-web/assets/{info-OHQRW6UA-V06620kN.js → info-OHQRW6UA-DvzSf7rQ.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-CbIgheWX.js → infoDiagram-MVDRKAX5-BjIMm4Af.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-D5oJQPkG.js → ishikawaDiagram-HPEHV2GE-Bpz71S40.js} +1 -1
- package/editor-web/assets/{italic-CDhZKo_q.js → italic-D10w8n6C.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-BZEv6JI4.js → journeyDiagram-BOSHW7O7-DAB-pZjD.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-CLG1R8y_.js → kanban-definition-FNSA4HC5-cYeyh3P6.js} +1 -1
- package/editor-web/assets/katex-5Z2zF-9g.js +257 -0
- package/editor-web/assets/link-BC5xK1-1.js +1 -0
- package/editor-web/assets/{mermaid-parser.core-DxDwXM7z.js → mermaid-parser.core-req5LE0X.js} +3 -3
- package/editor-web/assets/{mermaid.core-tU55ZwVG.js → mermaid.core-zFwZug4C.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-CYf4zzAh.js → mindmap-definition-6OY57UG3-TStWb7DG.js} +1 -1
- package/editor-web/assets/minus-DaWs5i8B.js +1 -0
- package/editor-web/assets/{packet-JDAUHWVQ-DsHeKYNL.js → packet-JDAUHWVQ-smFhVKcB.js} +1 -1
- package/editor-web/assets/palette-BIOudGkm.js +1 -0
- package/editor-web/assets/{pegDiagram-ECIUJNBX-CQyh6TTa.js → pegDiagram-ECIUJNBX-DvSNRv0-.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-3vCIvpNB.js → pie-XZMESJXO-qjaGsBZG.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-DF5yGBLn.js → pieDiagram-GNMPY74T-Dd9P-Pdc.js} +1 -1
- package/editor-web/assets/play-CrMmPghG.js +1 -0
- package/editor-web/assets/progress-DE4C5_3x.js +6 -0
- package/editor-web/assets/props-form-CsmDBqzy.js +1 -0
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-B7pxlDYP.js → quadrantDiagram-D57K4MC3-h2IIKUUA.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-cpEA41mL.js → radar-ABXABTNO-DlVrSA1d.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-BLyy5R2c.js → railroad-I3PHUGI6-nFbuLAtc.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-Y-oyol19.js → railroad-abnf-LNEFI6M7-Daj8h2iV.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-o58wHZsr.js → railroad-ebnf-DWYD2UWJ-eYJyl5PH.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-CcD3PXZ8.js → railroad-peg-JR7BVNR7-BTRhKZQq.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-BuCC4eyy.js → railroadDiagram-Y72NRBL7-CeLGUjdp.js} +1 -1
- package/editor-web/assets/react-WA6wlt8S.js +1 -0
- package/editor-web/assets/{repeat-2-C5PCbNsg.js → repeat-2-VQP1EVOZ.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-Dp-JFGn4.js → requirementDiagram-EQYSW5RA-Dmk9XRM5.js} +1 -1
- package/editor-web/assets/row-BRlEWRrK.js +1 -0
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-rYuCqEvw.js → sankeyDiagram-SY24JHO5-Yn4zlrAM.js} +1 -1
- package/editor-web/assets/schemas-VikZYZIK.js +1 -0
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DryW8x6d.js → sequenceDiagram-BLEHNHQU-BTRnp_PW.js} +1 -1
- package/editor-web/assets/session-Do9AqS38.js +1 -0
- package/editor-web/assets/slides-diTEQ3C5.js +1 -0
- package/editor-web/assets/snapshots-BUGlKQIB.js +56 -0
- package/editor-web/assets/sound-Bj3o9_Fa.js +1 -0
- package/editor-web/assets/split-CNU1RHcX.js +3 -0
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-Bnp0XfpT.js → stateDiagram-v2-A6IESKWZ-kstrRKv2.js} +1 -1
- package/editor-web/assets/{strikethrough-DJckA35o.js → strikethrough-CfXx6IYH.js} +1 -1
- package/editor-web/assets/{svg-BjM9RazX.js → svg-Cx50MpxK.js} +1 -1
- package/editor-web/assets/swatch-WeJD41aW.js +1 -0
- package/editor-web/assets/{swimlanes-B3ENRKFQ-BiRRhhbd.js → swimlanes-B3ENRKFQ-DaZsZkeP.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-CBZAujYY.js +8 -0
- package/editor-web/assets/switch-N0G_sbqt.js +1 -0
- package/editor-web/assets/syntax-BVsgRJ4I.js +66 -0
- package/editor-web/assets/syntax-oWsKBWFw.js +1 -0
- package/editor-web/assets/table-B6hVZAMi.js +1 -0
- package/editor-web/assets/tabs-DIFDqj-l.js +1 -0
- package/editor-web/assets/{textarea-BGtPqZdB.js → textarea-tEWvBY9p.js} +1 -1
- package/editor-web/assets/{timeline-definition-JXYKGLGB-D-Q5ZtDF.js → timeline-definition-JXYKGLGB-CLCvY-Yf.js} +1 -1
- package/editor-web/assets/{trash-2-Bjj6cWzP.js → trash-2-BP6nqpg2.js} +1 -1
- package/editor-web/assets/{treeView-D4JQ5SDB-B6DDatXq.js → treeView-D4JQ5SDB-BmN0gwdC.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-D7j5ZhiI.js → treemap-SAJKECNS-DN29G_E_.js} +1 -1
- package/editor-web/assets/{undo-2-yOSG766T.js → undo-2-CHR0nvWL.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-tkrdKUJB.js → usecaseDiagram-WPOLBNNX-DTRS54cB.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-Ch4XbSnD.js → vennDiagram-Q3Y3IDCW-DAAc11Hx.js} +1 -1
- package/editor-web/assets/video-BlvmR8BK.js +1 -0
- package/editor-web/assets/{wardley-7MLQ67FV-Bynt7qNQ.js → wardley-7MLQ67FV-B-UYkmdB.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-DRuSgm_L.js → wardleyDiagram-IVAIDKWA-BmbwCaky.js} +1 -1
- package/editor-web/assets/words-D_4T9Adq.js +3 -0
- package/editor-web/assets/words-WgdEQdYP.js +2 -0
- package/editor-web/assets/{xychartDiagram-4URNHDU4-DctpvfkL.js → xychartDiagram-4URNHDU4-ChAfAq1U.js} +1 -1
- package/editor-web/index.html +6 -5
- package/package.json +8 -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-CKyfo5RM.js +0 -340
- 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-shKo7XVN.js +0 -2
- 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/syntax-CC6QYhCz.js +0 -1
- package/editor-web/assets/tabs-C-re0Kxn.js +0 -1
- package/editor-web/assets/video-DXFiCNGc.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{colorFile as y}from"@allyhub/formats";import{accentOf as I,AUTOSHAPE_STYLE as
|
|
2
|
+
import{colorFile as y}from"@allyhub/formats";import{accentOf as I,AUTOSHAPE_STYLE as O,CHART_DEFAULTS as m,CONNECTOR_STYLE as K,groupingOf as R,hasLines as Q,isBar as ee,isConnectorGeometry as F,isLine as ne,isRound as H,isScatter as te,labelPositionOf as ie,MSO_CONNECTOR as oe,MSO_SHAPE as re,NAME_OF_TYPE as B,DRAWN_TEXTBOX_FRAME as ae,placeholderFrame as le,placeholderLevels as se,TEXT_INSETS as M,TEXTBOX_FRAME as de,glued as ce,Pt as A,toPt as $}from"@allyhub/slides-core";import{nameOf as z}from"./names.js";const fe={l:"PP_ALIGN.LEFT",ctr:"PP_ALIGN.CENTER",r:"PP_ALIGN.RIGHT",just:"PP_ALIGN.JUSTIFY"},ue={t:"MSO_ANCHOR.TOP",ctr:"MSO_ANCHOR.MIDDLE",b:"MSO_ANCHOR.BOTTOM"},_e={none:"MSO_AUTO_SIZE.NONE",shape:"MSO_AUTO_SIZE.SHAPE_TO_FIT_TEXT",text:"MSO_AUTO_SIZE.TEXT_TO_FIT_SHAPE"},he={title:"TITLE",ctrTitle:"CENTER_TITLE",subTitle:"SUBTITLE",body:"BODY",pic:"PICTURE",media:"MEDIA_CLIP",obj:"OBJECT",dt:"DATE",ftr:"FOOTER",sldNum:"SLIDE_NUMBER"},ge=Object.fromEntries(Object.entries(re).map(([e,n])=>[n,e])),pe=e=>{const n=ge[e];return n===void 0?str(e):`MSO_SHAPE.${n}`},me=Object.fromEntries(Object.entries(oe).map(([e,n])=>[n,e])),$e=e=>{const n=me[e];return n===void 0?str(e):`MSO_CONNECTOR.${n}`},D=(e,n=[])=>n.map((o,i)=>`${e}.adjustments[${String(i)}] = ${String(Math.round(o*1e5)/1e5)};`);export const emu=e=>`Emu(${String(Math.round(e))})`;const E=e=>`Pt(${String(Math.round(e/12700*100)/100)})`;export const str=e=>JSON.stringify(e);export function colorLines(e,n,o){if(typeof n=="object"&&"rgb"in n)return[`${e}.rgb = ${str(n.rgb)};`];const i=typeof n=="string"?0:n.brightness;return[`${e}.theme_color = ${str(typeof n=="string"?n:n.theme_color)};`,...i!==0||typeof o=="object"&&"brightness"in o?[`${e}.brightness = ${String(Math.round(i*1e5)/1e5)};`]:[]]}function N(e,n,o,i){return Object.keys(i).flatMap(r=>{const l=n[r],a=i[r];return!a||canonical(l)===canonical(o[r])?[]:[`${e}.${r} = ${l==null?String(l):a(l)};`]})}const L=e=>String(e);function U(e,n,o={}){const i=n??{},r=i.color;return[...N(e,i,o,{name:str,size:E,bold:L,italic:L,spacing:E,underline:L,strike:L,baseline:l=>String(Math.round(l*1e3)/1e3),highlight:str}),...canonical(r)===canonical(o.color)?[]:r===void 0?[`${e}.color.theme_color = undefined;`]:colorLines(`${e}.color`,r,o.color)]}const be=e=>"lines"in e?String(Math.round(e.lines*1e3)/1e3):E(e.fixed);function j(e,n,o,i={}){return[...N(e,n,i,{alignment:r=>fe[r],line_spacing:be,space_before:E,space_after:E}),...o?N(e,n,i,{bullet:str,bullet_font:str,numbered:str,margin_left:emu,indent:emu}):[],...U(`${e}.font`,n.font,i.font)]}export function levelLines(e,n,o=[]){const i=Array.from({length:Math.max(n?.length??0,o.length)},(a,c)=>n?.[c]??{}),r=i.map((a,c)=>j("level",a,!0,o[c])),l=r[0]?.join(`
|
|
3
3
|
`)??"";return r.length===9&&l!==""&&r.every(a=>a.join(`
|
|
4
|
-
`)===l)?[`for (const level of ${e}) {`,...(r[0]??[]).map(a=>` ${a}`),"}"]:i.flatMap((a,c)=>P(`${e}[${String(c)}]`,a,!0,o[c]))}const z={margin_left:M.left,margin_top:M.top,margin_right:M.right,margin_bottom:M.bottom};export const MADE={placeholder:e=>({...le(e),...z}),textbox:{vertical_anchor:"t",...de,...z},autoshape:{vertical_anchor:w.vertical_anchor,word_wrap:!0,auto_size:"none",...z}},FILE_TEXTBOX={...MADE.textbox,...ae};export function bodyLines(e,t,o={},i=[]){if(!t)return[];const r=s=>t[s]===void 0||t[s]===o[s]?void 0:t[s],l=r("vertical_anchor"),a=r("auto_size"),c=r("word_wrap");return[...l===void 0?[]:[`${e}.vertical_anchor = ${ue[l]};`],...a===void 0?[]:[`${e}.auto_size = ${_e[a]};`],...c===void 0?[]:[`${e}.word_wrap = ${String(c)};`],...["margin_left","margin_top","margin_right","margin_bottom"].flatMap(s=>{const f=r(s);return f===void 0?[]:[`${e}.${s} = ${emu(f)};`]}),...levelLines(`${e}.list_style`,t.levels,i)]}export const sameColor=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function G(e,t,o){return t===void 0||sameColor(t,o)?[]:t===null?[`${e}.fill.background();`]:[`${e}.fill.solid();`,...colorLines(`${e}.fill.fore_color`,t)]}function k(e,t,o){return[...t.line===void 0||sameColor(t.line,o.line)?[]:t.line===null?[`${e}.line.fill.background();`]:colorLines(`${e}.line.color`,t.line),...t.line_width===void 0||t.line===null||t.line_width===o.line_width?[]:[`${e}.line.width = ${emu(t.line_width)};`],...t.line_dash===void 0?[]:[`${e}.line.dash_style = ${str(t.line_dash)};`],...t.line_begin===void 0?[]:[`${e}.line.begin_arrow = ${str(t.line_begin)};`],...t.line_end===void 0?[]:[`${e}.line.end_arrow = ${str(t.line_end)};`]]}export const lineFile=e=>({...e.line_dash===void 0?{}:{line_dash:e.line_dash},...e.line_begin===void 0?{}:{line_begin:e.line_begin},...e.line_end===void 0?{}:{line_end:e.line_end}});function ye(e,t,o){const i=t.frame??{left:0,top:0,width:0,height:0},r=o.w===0?1:i.width/o.w,l=o.h===0?1:i.height/o.h,a=o.steps.flatMap(d=>d.op==="close"?[]:d.op==="curve"?[[d.x1,d.y1],[d.x2,d.y2],[d.x,d.y]]:[[d.x,d.y]]),c=d=>Math.min(...a.map(n=>n[d]??0)),[s,...f]=o.steps,p=s?.op==="move"?`${String(s.x)}, ${String(s.y)}`:"0, 0",g=(s?.op==="move"?f:o.steps).map(d=>d.op==="close"?".add_line_segments([], true)":d.op==="move"?`.move_to(${String(d.x)}, ${String(d.y)})`:d.op==="line"?`.add_line_segments([[${String(d.x)}, ${String(d.y)}]], false)`:`.add_curve_segment(${[d.x1,d.y1,d.x2,d.y2,d.x,d.y].map(String).join(", ")})`);return`${e}.shapes.build_freeform(${p}, [${String(r)}, ${String(l)}])${g.join("")}.convert_to_shape(${emu(i.left-Math.round(c(0)*r))}, ${emu(i.top-Math.round(c(1)*l))})`}const C=(e,t)=>t.rotation===void 0?[]:[`${e}.rotation = ${String(Math.round(t.rotation*1e3)/1e3)};`];function Se(e){const t=e.text?.levels??[],o=e.text_color??"dk1";return e.kind!=="autoshape"||sameColor(o,w.font_color)?t:Array.from({length:9},(i,r)=>{const l=t[r]??{};return l.font?.color!==void 0?l:{...l,font:{...l.font,color:o}}})}function xe(e,t,o,i={}){return o.flatMap((r,l)=>{const a=`${e}_p${String(l)}`,c=[...r.level>0?[`${a}.level = ${String(r.level)};`]:[],...P(a,r,!1,l===0?i:{}),...r.runs.flatMap((s,f)=>s.text==="\v"?[`${a}.add_line_break();`]:s.font?[`const ${a}r${String(f)} = ${a}.add_run();`,`${a}r${String(f)}.text = ${str(s.text)};`,...U(`${a}r${String(f)}.font`,s.font),...s.font.link===void 0?[]:[`${a}r${String(f)}.hyperlink.address = ${str(s.font.link)};`]]:[`${a}.add_run().text = ${str(s.text)};`])];return l===0&&c.length===0?[]:[`const ${a} = ${l===0?`${t}.paragraphs[0]`:`${t}.add_paragraph()`};`,...c]})}const E=e=>`${emu(e.left)}, ${emu(e.top)}, ${emu(e.width)}, ${emu(e.height)}`;export class MediaFiles{files=new Map;byPart=new Map;bytes;taken;constructor(t,o=()=>!1){this.bytes=t,this.taken=o}path(t){const o=this.byPart.get(t);if(o)return o;const i=this.bytes(t);if(!i)return;const r=t.split("/").pop()??"file",l=r.lastIndexOf("."),[a,c]=l>0?[r.slice(0,l),r.slice(l)]:[r,""];let s=r;for(let f=2;this.files.has(s)||this.taken(s);f++)s=`${a}-${String(f)}${c}`;return this.files.set(s,i),this.byPart.set(t,`./${s}`),`./${s}`}}export const GLUE_MOVED="a glued connector is drawn with its ends on its shapes' sites, where the file has it off them";const X=e=>({left:A($(e.left)),top:A($(e.top)),width:A($(e.width)),height:A($(e.height))});export function placedGlue(e,t=()=>{}){const o=new Map(e.flatMap(i=>i.id===void 0?[]:[[i.id,i]]));return e.map(i=>{if(!i.glue||!i.frame)return i;const r=g=>g===void 0?void 0:{shape:g.id,site:g.site},l=r(i.glue.begin),a=r(i.glue.end),c=ce({frame:X(i.frame),flip:i.flip,rotation:i.rotation,connect:{...l?{begin:l}:{},...a?{end:a}:{}}},g=>{const d=o.get(g);return d?.frame?{frame:X(d.frame),geometry:d.geometry,adjustments:d.adjustments,flip:d.flip,rotation:d.rotation,path:d.path}:void 0}),s=i.frame,f=c.frame;(Math.abs(s.left-f.left)>64||Math.abs(s.top-f.top)>64||Math.abs(s.width-f.width)>64||Math.abs(s.height-f.height)>64||!!i.flip?.h!=!!c.flip?.h||!!i.flip?.v!=!!c.flip?.v)&&t(i);const p={...i,frame:c.frame};return c.flip?p.flip=c.flip:delete p.flip,p})}export function shapeCode(e,t,o,i,r){const l=placedGlue(t,n=>{i(n,"p:cNvCxnSpPr",GLUE_MOVED,"approximated")}),a=[],c=new Set,s=new Map,f=new Map,p=new Set(l.flatMap(n=>[n.glue?.begin?.id,n.glue?.end?.id].filter(S=>S!==void 0))),g=new Map,d=[];l.forEach((n,S)=>{const u=`${e}_s${String(S)}`,O=n.id!==void 0&&p.has(n.id);O&&n.id!==void 0&&g.set(n.id,u);let h=e;if(n.group!==void 0&&(h=f.get(n.group)??`${e}_g${String(f.size)}`,f.has(n.group)||(f.set(n.group,h),a.push(`const ${h} = ${e}.shapes.add_group_shape();`,`${h}.name = ${str(L(n.group,c,"group"))};`))),n.flip&&!F(n.geometry)&&i(n,"a:xfrm@flipH","a master's or a layout's shape mirrored: python-pptx's API has no flip"),n.kind==="placeholder"&&n.placeholder){const _=/^[A-Za-z0-9_-]+$/u.test(n.name)?L(n.name,c,"placeholder"):L(B[n.placeholder.type],c,"placeholder");s.set(n.placeholder.idx,_);const x=bodyLines(`${u}.text_frame`,n.text,r?MADE.placeholder(n.placeholder.type):{},se(n.placeholder.type));a.push(`${x.length>0||O?`const ${u} = `:""}${h}.placeholders.add(PP_PLACEHOLDER.${he[n.placeholder.type]}${n.frame?`, ${E(n.frame)}`:""}${_===B[n.placeholder.type]?"":`, { name: ${str(_)} }`});`,...x);return}const b=L(n.name,c,n.kind);if(!n.frame){i(n,"a:xfrm","a shape with no frame of its own is left out");return}if((n.kind==="picture"||n.kind==="movie")&&n.part){const _=o.path(n.part);if(!_){i(n,"p:pic","its file is not in the file");return}n.crop&&Object.values(n.crop).some(x=>x>0)&&i(n,"a:srcRect","a picture's crop on a master or a layout"),a.push(...n.rotation===void 0&&!O?[`${h}.shapes.${n.kind==="movie"?"add_movie":"add_picture"}(${str(_)}, ${E(n.frame)}).name = ${str(b)};`]:[`const ${u} = ${h}.shapes.${n.kind==="movie"?"add_movie":"add_picture"}(${str(_)}, ${E(n.frame)});`,`${u}.name = ${str(b)};`,...C(u,n)]);return}if(n.table||n.chart){i(n,n.table?"a:tbl":"c:chart","a table or a chart on a master or a layout: one goes on a slide");return}if(!n.path&&F(n.geometry)){const _=n.frame,[x,W]=n.flip?.h?[_.left+_.width,_.left]:[_.left,_.left+_.width],[V,q]=n.flip?.v?[_.top+_.height,_.top]:[_.top,_.top+_.height];a.push(`const ${u} = ${h}.shapes.add_connector(${$e(n.geometry??"line")}, ${emu(x)}, ${emu(V)}, ${emu(W)}, ${emu(q)});`,`${u}.name = ${str(b)};`,...D(u,n.adjustments),...C(u,n),...k(u,n,K)),n.glue&&d.push({v:u,s:n});return}const Z=n.path?ye(h,n,n.path):n.kind==="textbox"?`${h}.shapes.add_textbox(${E(n.frame)})`:`${h}.shapes.add_shape(${ge(n.geometry??"rect")}, ${E(n.frame)})`;a.push(`const ${u} = ${Z};`,`${u}.name = ${str(b)};`,...D(u,n.adjustments),...C(u,n),...n.kind==="textbox"?[...G(u,n.fill,null),...k(u,n,{line:null})]:[...G(u,n.fill,w.fill),...k(u,n,w)],...bodyLines(`${u}.text_frame`,n.text&&{...n.text,levels:Se(n)},MADE[n.kind==="textbox"?"textbox":"autoshape"]),...n.text?xe(u,`${u}.text_frame`,n.text.paragraphs,n.kind==="autoshape"?{alignment:w.alignment}:{}):[])});for(const{v:n,s:S}of d)for(const[u,O]of[["begin","a:stCxn"],["end","a:endCxn"]]){const h=S.glue?.[u];if(!h)continue;const b=g.get(h.id);b===void 0?i(S,O,"a connector's end glued to a shape that is left out: it stays where it is"):a.push(`${n}.${u}_connect(${b}, ${String(h.site)});`)}return{lines:a,names:s}}export const frameFile=e=>({x:$(e.left),y:$(e.top),w:$(e.width),h:$(e.height)});export{y as colorFile};const J=e=>({...e.minimum_scale===void 0?{}:{min:e.minimum_scale},...e.maximum_scale===void 0?{}:{max:e.maximum_scale},...e.major_unit===void 0?{}:{major:e.major_unit},...e.has_major_gridlines===void 0?{}:{gridlines:e.has_major_gridlines},...e.visible===void 0?{}:{visible:e.visible},...e.number_format===void 0?{}:{format:e.number_format},...e.reverse_order===void 0?{}:{reverse:e.reverse_order},...e.gridline_color===void 0?{}:{gridline_color:y(e.gridline_color)},...e.line_color===void 0?{}:{line_color:y(e.line_color)}});function T(e,t){return Object.fromEntries(Object.entries(e).filter(([o,i])=>canonical(i)!==canonical(t[o])))}const Y=(e,t,o)=>{const i=t&&o(t);return i&&Object.keys(i).length>0?{[e]:i}:{}};function Oe(e){const t={gridline_color:{rgb:m.gridline},line_color:{rgb:m.axisLine}},o=e.font_size??m.fontSize,i=ee(e.type)&&R(e.type)!=="clustered",r=(te(e.type)||ne(e.type))&&Q(e.type),{value_axis:l,category_axis:a,labels:c,...s}=e;return{...T(s,{gap_width:m.gapWidth,hole_size:m.holeSize,vary_by_categories:H(e.type),category_colors:e.categories.map((f,p)=>I(p)),font_size:m.fontSize,title_size:Math.round(o*m.titleScale*100)/100,font_color:"dk1",...i?{overlap:100}:{}}),series:e.series.map((f,p)=>T(f,{color:I(p),line_width:r?m.lineWidth:f.line_width,marker_size:m.marker})),...Y("value_axis",l,f=>T(f,{...t,has_major_gridlines:!0,...R(e.type)==="percentStacked"?{number_format:"0%"}:{}})),...Y("category_axis",a,f=>T(f,{...t,has_major_gridlines:!1})),...c?{labels:T(c,{position:ie({type:e.type}),...H(e.type)?{color:"lt1"}:{}})}:{}}}export function chartFile(e){const t=Oe(e),o=t.labels;return{type:t.type,...t.categories.length===0&&t.series.some(i=>i.x)?{}:{categories:t.categories},series:t.series.map(i=>({name:i.name,values:i.values,...i.x===void 0?{}:{x:i.x},...i.color===void 0?{}:{color:y(i.color)},...i.number_format===void 0?{}:{format:i.number_format},...i.smooth===void 0?{}:{smooth:i.smooth},...i.line_width===void 0?{}:{line_width:i.line_width},...i.marker_size===void 0?{}:{marker_size:i.marker_size}})),...t.legend===void 0?{}:{legend:t.legend},...o?{labels:{...o.show_value===void 0?{}:{value:o.show_value},...o.show_percentage===void 0?{}:{percentage:o.show_percentage},...o.show_category_name===void 0?{}:{category:o.show_category_name},...o.show_series_name===void 0?{}:{series:o.show_series_name},...o.number_format===void 0?{}:{format:o.number_format},...o.position===void 0?{}:{position:o.position},...o.size===void 0?{}:{size:o.size},...o.color===void 0?{}:{color:y(o.color)}}}:{},...t.gap_width===void 0?{}:{gap_width:t.gap_width},...t.overlap===void 0?{}:{overlap:t.overlap},...t.vary_by_categories===void 0?{}:{vary_by_categories:t.vary_by_categories},...t.category_colors===void 0?{}:{category_colors:t.category_colors.map(y)},...t.hole_size===void 0?{}:{hole_size:t.hole_size},...t.value_axis?{value_axis:J(t.value_axis)}:{},...t.category_axis?{category_axis:J(t.category_axis)}:{},...t.font_size===void 0?{}:{size:t.font_size},...t.title_size===void 0?{}:{title_size:t.title_size},...t.font_color===void 0?{}:{color:y(t.font_color)}}}export const canonical=e=>JSON.stringify(e,(t,o)=>o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).sort(([i],[r])=>i<r?-1:1)):o);
|
|
4
|
+
`)===l)?[`for (const level of ${e}) {`,...(r[0]??[]).map(a=>` ${a}`),"}"]:i.flatMap((a,c)=>j(`${e}[${String(c)}]`,a,!0,o[c]))}const P={margin_left:M.left,margin_top:M.top,margin_right:M.right,margin_bottom:M.bottom};export const MADE={placeholder:e=>({...le(e),...P}),textbox:{vertical_anchor:"t",...de,...P},autoshape:{vertical_anchor:O.vertical_anchor,word_wrap:!0,auto_size:"none",...P}},FILE_TEXTBOX={...MADE.textbox,...ae};export function bodyLines(e,n,o={},i=[]){if(!n)return[];const r=s=>n[s]===void 0||n[s]===o[s]?void 0:n[s],l=r("vertical_anchor"),a=r("auto_size"),c=r("word_wrap");return[...l===void 0?[]:[`${e}.vertical_anchor = ${ue[l]};`],...a===void 0?[]:[`${e}.auto_size = ${_e[a]};`],...c===void 0?[]:[`${e}.word_wrap = ${String(c)};`],...["margin_left","margin_top","margin_right","margin_bottom"].flatMap(s=>{const f=r(s);return f===void 0?[]:[`${e}.${s} = ${emu(f)};`]}),...levelLines(`${e}.list_style`,n.levels,i)]}export const sameColor=(e,n)=>JSON.stringify(e)===JSON.stringify(n);function G(e,n,o){return n===void 0||sameColor(n,o)?[]:n===null?[`${e}.fill.background();`]:[`${e}.fill.solid();`,...colorLines(`${e}.fill.fore_color`,n)]}function k(e,n,o){return[...n.line===void 0||sameColor(n.line,o.line)?[]:n.line===null?[`${e}.line.fill.background();`]:colorLines(`${e}.line.color`,n.line),...n.line_width===void 0||n.line===null||n.line_width===o.line_width?[]:[`${e}.line.width = ${emu(n.line_width)};`],...n.line_dash===void 0?[]:[`${e}.line.dash_style = ${str(n.line_dash)};`],...n.line_begin===void 0?[]:[`${e}.line.begin_arrow = ${str(n.line_begin)};`],...n.line_end===void 0?[]:[`${e}.line.end_arrow = ${str(n.line_end)};`],...["begin","end"].flatMap(i=>{const r=i==="begin"?n.line_begin_size:n.line_end_size;return[...r?.w===void 0?[]:[`${e}.line.${i}_arrow_width = ${str(r.w)};`],...r?.len===void 0?[]:[`${e}.line.${i}_arrow_length = ${str(r.len)};`]]})]}export const lineFile=e=>({...e.line_dash===void 0?{}:{line_dash:e.line_dash},...e.line_begin===void 0?{}:{line_begin:e.line_begin},...e.line_end===void 0?{}:{line_end:e.line_end},...e.line_begin_size===void 0?{}:{line_begin_size:e.line_begin_size},...e.line_end_size===void 0?{}:{line_end_size:e.line_end_size}});function ye(e,n,o){const i=n.frame??{left:0,top:0,width:0,height:0},r=o.w===0?1:i.width/o.w,l=o.h===0?1:i.height/o.h,a=o.steps.flatMap(d=>d.op==="close"?[]:d.op==="curve"?[[d.x1,d.y1],[d.x2,d.y2],[d.x,d.y]]:[[d.x,d.y]]),c=d=>Math.min(...a.map(t=>t[d]??0)),[s,...f]=o.steps,g=s?.op==="move"?`${String(s.x)}, ${String(s.y)}`:"0, 0",p=(s?.op==="move"?f:o.steps).map(d=>d.op==="close"?".add_line_segments([], true)":d.op==="move"?`.move_to(${String(d.x)}, ${String(d.y)})`:d.op==="line"?`.add_line_segments([[${String(d.x)}, ${String(d.y)}]], false)`:`.add_curve_segment(${[d.x1,d.y1,d.x2,d.y2,d.x,d.y].map(String).join(", ")})`);return`${e}.shapes.build_freeform(${g}, [${String(r)}, ${String(l)}])${p.join("")}.convert_to_shape(${emu(i.left-Math.round(c(0)*r))}, ${emu(i.top-Math.round(c(1)*l))})`}const C=(e,n)=>n.rotation===void 0?[]:[`${e}.rotation = ${String(Math.round(n.rotation*1e3)/1e3)};`];function Se(e){const n=e.text?.levels??[],o=e.text_color??"dk1";return e.kind!=="autoshape"||sameColor(o,O.font_color)?n:Array.from({length:9},(i,r)=>{const l=n[r]??{};return l.font?.color!==void 0?l:{...l,font:{...l.font,color:o}}})}function xe(e,n,o,i={}){return o.flatMap((r,l)=>{const a=`${e}_p${String(l)}`,c=[...r.level>0?[`${a}.level = ${String(r.level)};`]:[],...j(a,r,!1,l===0?i:{}),...r.runs.flatMap((s,f)=>s.text==="\v"?[`${a}.add_line_break();`]:s.font?[`const ${a}r${String(f)} = ${a}.add_run();`,`${a}r${String(f)}.text = ${str(s.text)};`,...U(`${a}r${String(f)}.font`,s.font),...s.font.link===void 0?[]:[`${a}r${String(f)}.hyperlink.address = ${str(s.font.link)};`]]:[`${a}.add_run().text = ${str(s.text)};`])];return l===0&&c.length===0?[]:[`const ${a} = ${l===0?`${n}.paragraphs[0]`:`${n}.add_paragraph()`};`,...c]})}const v=e=>`${emu(e.left)}, ${emu(e.top)}, ${emu(e.width)}, ${emu(e.height)}`;export class MediaFiles{files=new Map;byPart=new Map;bytes;taken;constructor(n,o=()=>!1){this.bytes=n,this.taken=o}path(n){const o=this.byPart.get(n);if(o)return o;const i=this.bytes(n);if(!i)return;const r=n.split("/").pop()??"file",l=r.lastIndexOf("."),[a,c]=l>0?[r.slice(0,l),r.slice(l)]:[r,""];let s=r;for(let f=2;this.files.has(s)||this.taken(s);f++)s=`${a}-${String(f)}${c}`;return this.files.set(s,i),this.byPart.set(n,`./${s}`),`./${s}`}}export const GLUE_MOVED="a glued connector is drawn with its ends on its shapes' sites, where the file has it off them";const X=e=>({left:A($(e.left)),top:A($(e.top)),width:A($(e.width)),height:A($(e.height))});export function placedGlue(e,n=()=>{}){const o=new Map(e.flatMap(i=>i.id===void 0?[]:[[i.id,i]]));return e.map(i=>{if(!i.glue||!i.frame)return i;const r=p=>p===void 0?void 0:{shape:p.id,site:p.site},l=r(i.glue.begin),a=r(i.glue.end),c=ce({frame:X(i.frame),flip:i.flip,rotation:i.rotation,connect:{...l?{begin:l}:{},...a?{end:a}:{}}},p=>{const d=o.get(p);return d?.frame?{frame:X(d.frame),geometry:d.geometry,adjustments:d.adjustments,flip:d.flip,rotation:d.rotation,path:d.path}:void 0}),s=i.frame,f=c.frame;(Math.abs(s.left-f.left)>64||Math.abs(s.top-f.top)>64||Math.abs(s.width-f.width)>64||Math.abs(s.height-f.height)>64||!!i.flip?.h!=!!c.flip?.h||!!i.flip?.v!=!!c.flip?.v)&&n(i);const g={...i,frame:c.frame};return c.flip?g.flip=c.flip:delete g.flip,g})}export function shapeCode(e,n,o,i,r){const l=placedGlue(n,t=>{i(t,"p:cNvCxnSpPr",GLUE_MOVED,"approximated")}),a=[],c=new Set,s=new Map,f=new Map,g=new Set(l.flatMap(t=>[t.glue?.begin?.id,t.glue?.end?.id].filter(S=>S!==void 0))),p=new Map,d=[];l.forEach((t,S)=>{const u=`${e}_s${String(S)}`,w=t.id!==void 0&&g.has(t.id);w&&t.id!==void 0&&p.set(t.id,u);let h=e;if(t.group!==void 0&&(h=f.get(t.group)??`${e}_g${String(f.size)}`,f.has(t.group)||(f.set(t.group,h),a.push(`const ${h} = ${e}.shapes.add_group_shape();`,`${h}.name = ${str(z(t.group,c,"group"))};`))),t.flip&&!F(t.geometry)&&i(t,"a:xfrm@flipH","a master's or a layout's shape mirrored: python-pptx's API has no flip"),t.kind==="placeholder"&&t.placeholder){const _=/^[A-Za-z0-9_-]+$/u.test(t.name)?z(t.name,c,"placeholder"):z(B[t.placeholder.type],c,"placeholder");s.set(t.placeholder.idx,_);const x=bodyLines(`${u}.text_frame`,t.text,r?MADE.placeholder(t.placeholder.type):{},se(t.placeholder.type));a.push(`${x.length>0||w?`const ${u} = `:""}${h}.placeholders.add(PP_PLACEHOLDER.${he[t.placeholder.type]}${t.frame?`, ${v(t.frame)}`:""}${_===B[t.placeholder.type]?"":`, { name: ${str(_)} }`});`,...x);return}const b=z(t.name,c,t.kind);if(!t.frame){i(t,"a:xfrm","a shape with no frame of its own is left out");return}if((t.kind==="picture"||t.kind==="movie")&&t.part){const _=o.path(t.part);if(!_){i(t,"p:pic","its file is not in the file");return}t.crop&&Object.values(t.crop).some(x=>x>0)&&i(t,"a:srcRect","a picture's crop on a master or a layout"),a.push(...t.rotation===void 0&&!w?[`${h}.shapes.${t.kind==="movie"?"add_movie":"add_picture"}(${str(_)}, ${v(t.frame)}).name = ${str(b)};`]:[`const ${u} = ${h}.shapes.${t.kind==="movie"?"add_movie":"add_picture"}(${str(_)}, ${v(t.frame)});`,`${u}.name = ${str(b)};`,...C(u,t)]);return}if(t.table||t.chart){i(t,t.table?"a:tbl":"c:chart","a table or a chart on a master or a layout: one goes on a slide");return}if(!t.path&&F(t.geometry)){const _=t.frame,[x,W]=t.flip?.h?[_.left+_.width,_.left]:[_.left,_.left+_.width],[V,q]=t.flip?.v?[_.top+_.height,_.top]:[_.top,_.top+_.height];a.push(`const ${u} = ${h}.shapes.add_connector(${$e(t.geometry??"line")}, ${emu(x)}, ${emu(V)}, ${emu(W)}, ${emu(q)});`,`${u}.name = ${str(b)};`,...D(u,t.adjustments),...C(u,t),...k(u,t,K)),t.glue&&d.push({v:u,s:t});return}const Z=t.path?ye(h,t,t.path):t.kind==="textbox"?`${h}.shapes.add_textbox(${v(t.frame)})`:`${h}.shapes.add_shape(${pe(t.geometry??"rect")}, ${v(t.frame)})`;a.push(`const ${u} = ${Z};`,`${u}.name = ${str(b)};`,...D(u,t.adjustments),...C(u,t),...t.kind==="textbox"?[...G(u,t.fill,null),...k(u,t,{line:null})]:[...G(u,t.fill,O.fill),...k(u,t,O)],...bodyLines(`${u}.text_frame`,t.text&&{...t.text,levels:Se(t)},MADE[t.kind==="textbox"?"textbox":"autoshape"]),...t.text?xe(u,`${u}.text_frame`,t.text.paragraphs,t.kind==="autoshape"?{alignment:O.alignment}:{}):[])});for(const{v:t,s:S}of d)for(const[u,w]of[["begin","a:stCxn"],["end","a:endCxn"]]){const h=S.glue?.[u];if(!h)continue;const b=p.get(h.id);b===void 0?i(S,w,"a connector's end glued to a shape that is left out: it stays where it is"):a.push(`${t}.${u}_connect(${b}, ${String(h.site)});`)}return{lines:a,names:s}}export const frameFile=e=>({x:$(e.left),y:$(e.top),w:$(e.width),h:$(e.height)});export{y as colorFile};const J=e=>({...e.minimum_scale===void 0?{}:{min:e.minimum_scale},...e.maximum_scale===void 0?{}:{max:e.maximum_scale},...e.major_unit===void 0?{}:{major:e.major_unit},...e.has_major_gridlines===void 0?{}:{gridlines:e.has_major_gridlines},...e.visible===void 0?{}:{visible:e.visible},...e.number_format===void 0?{}:{format:e.number_format},...e.reverse_order===void 0?{}:{reverse:e.reverse_order},...e.gridline_color===void 0?{}:{gridline_color:y(e.gridline_color)},...e.line_color===void 0?{}:{line_color:y(e.line_color)}});function T(e,n){return Object.fromEntries(Object.entries(e).filter(([o,i])=>canonical(i)!==canonical(n[o])))}const Y=(e,n,o)=>{const i=n&&o(n);return i&&Object.keys(i).length>0?{[e]:i}:{}};function we(e){const n={gridline_color:{rgb:m.gridline},line_color:{rgb:m.axisLine}},o=e.font_size??m.fontSize,i=ee(e.type)&&R(e.type)!=="clustered",r=(ne(e.type)||te(e.type))&&Q(e.type),{value_axis:l,category_axis:a,labels:c,...s}=e;return{...T(s,{gap_width:m.gapWidth,hole_size:m.holeSize,vary_by_categories:H(e.type),category_colors:e.categories.map((f,g)=>I(g)),font_size:m.fontSize,title_size:Math.round(o*m.titleScale*100)/100,font_color:"dk1",...i?{overlap:100}:{}}),series:e.series.map((f,g)=>T(f,{color:I(g),line_width:r?m.lineWidth:f.line_width,marker_size:m.marker})),...Y("value_axis",l,f=>T(f,{...n,has_major_gridlines:!0,...R(e.type)==="percentStacked"?{number_format:"0%"}:{}})),...Y("category_axis",a,f=>T(f,{...n,has_major_gridlines:!1})),...c?{labels:T(c,{position:ie({type:e.type}),...H(e.type)?{color:"lt1"}:{}})}:{}}}export function chartFile(e){const n=we(e),o=n.labels;return{type:n.type,...n.categories.length===0&&n.series.some(i=>i.x)?{}:{categories:n.categories},series:n.series.map(i=>({name:i.name,values:i.values,...i.x===void 0?{}:{x:i.x},...i.color===void 0?{}:{color:y(i.color)},...i.number_format===void 0?{}:{format:i.number_format},...i.smooth===void 0?{}:{smooth:i.smooth},...i.line_width===void 0?{}:{line_width:i.line_width},...i.marker_size===void 0?{}:{marker_size:i.marker_size}})),...n.legend===void 0?{}:{legend:n.legend},...o?{labels:{...o.show_value===void 0?{}:{value:o.show_value},...o.show_percentage===void 0?{}:{percentage:o.show_percentage},...o.show_category_name===void 0?{}:{category:o.show_category_name},...o.show_series_name===void 0?{}:{series:o.show_series_name},...o.number_format===void 0?{}:{format:o.number_format},...o.position===void 0?{}:{position:o.position},...o.size===void 0?{}:{size:o.size},...o.color===void 0?{}:{color:y(o.color)}}}:{},...n.gap_width===void 0?{}:{gap_width:n.gap_width},...n.overlap===void 0?{}:{overlap:n.overlap},...n.vary_by_categories===void 0?{}:{vary_by_categories:n.vary_by_categories},...n.category_colors===void 0?{}:{category_colors:n.category_colors.map(y)},...n.hole_size===void 0?{}:{hole_size:n.hole_size},...n.value_axis?{value_axis:J(n.value_axis)}:{},...n.category_axis?{category_axis:J(n.category_axis)}:{},...n.font_size===void 0?{}:{size:n.font_size},...n.title_size===void 0?{}:{title_size:n.title_size},...n.font_color===void 0?{}:{color:y(n.font_color)}}}export const canonical=e=>JSON.stringify(e,(n,o)=>o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).sort(([i],[r])=>i<r?-1:1)):o);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{stringify as
|
|
3
|
-
`)),o.set(`${
|
|
2
|
+
import{stringify as ye}from"yaml";import{AUTOSHAPE_STYLE as ee,CONNECTOR_STYLE as _e,EAST_ASIAN_FONT as Te,isConnectorGeometry as Fe,NAME_OF_TYPE as Ae,OFFICE_TEXT_STYLES as we,pathText as Le,SHADOW_DEFAULTS as Ce,SLIDE_SIZES as Ne,toPt as I}from"@allyhub/slides-core";import{bodyLines as Ie,chartFile as ze,colorFile as T,colorLines as ke,emu as Oe,FILE_TEXTBOX as De,frameFile as xe,levelLines as He,lineFile as re,MADE as Be,MediaFiles as Re,placedGlue as Ue,GLUE_MOVED as Ge,sameColor as se,shapeCode as $e,str as ne}from"./code.js";import{nameOf as oe}from"./names.js";import{variesIn as de,wordsOf as ce}from"./script.js";export const UNMAPPED=!0;const ve=n=>({...n.angle===0?{}:{angle:Math.round(n.angle*1e3)/1e3},stops:n.stops.map(d=>({at:Math.round(d.at*1e3)/1e3,color:T(d.color),...d.transparency===void 0?{}:{transparency:d.transparency}}))}),le=n=>({color:T(n.color),blur:I(n.blur),distance:I(n.distance),angle:Math.round(n.angle*1e3)/1e3,...n.transparency===Ce.transparency?{}:{transparency:n.transparency}});function Se(n){const d=Object.fromEntries(Object.entries(n??{}).filter(([,O])=>O>0));return Object.keys(d).length>0?d:void 0}const Ee=n=>({...n.locked?{locked:!0}:{},...n.rotation===void 0?{}:{rotation:n.rotation},...n.flip?.h?{flip_h:!0}:{},...n.flip?.v?{flip_v:!0}:{}});function fe(n,d,O){const _=n.flatMap(t=>t.runs.filter(l=>l.text!=="\v"&&l.text.trim()!==""));if(_.length===0)return;const y=t=>{const l=_.map(t),b=l[0];return b!==void 0&&l.every(x=>x===b)?b:void 0},$=(t,l,b)=>{const x=n.map(j=>JSON.stringify(t(j)??null));if(x.every(j=>j===x[0]))return n[0]&&t(n[0]);d(l,b)},u=y(t=>t.font?.size),v=y(t=>t.font?.color===void 0?void 0:T(t.font.color)),F=y(t=>t.font?.name),D=y(t=>t.font?.underline===!0?!0:void 0),A=y(t=>t.font?.strike===!0?!0:void 0),M=n.every(t=>t.alignment===n[0]?.alignment)?n[0]?.alignment:void 0;M===void 0&&n.some(t=>t.alignment!==void 0)&&d("a:pPr@algn","paragraphs aligned differently take the first's");const o=n.every(t=>t.numbered===n[0]?.numbered)?n[0]?.numbered:void 0,i=$(t=>t.line_spacing,"a:lnSpc","paragraphs with different line spacing take their levels'");i&&"fixed"in i&&d("a:lnSpc/a:spcPts","exact line spacing is its levels'");const h=$(t=>t.space_before,"a:spcBef","paragraphs with different space before take their levels'"),p=$(t=>t.space_after,"a:spcAft","paragraphs with different space after take their levels'"),g=o===void 0?$(t=>t.bullet,"a:buChar","paragraphs with different bullets take their levels'"):void 0;_.some(t=>t.font?.spacing!==void 0&&t.font.spacing!==0)&&d("a:rPr@spc","letter spacing");const a={...u===void 0?{}:{size:I(u)},...D===void 0?{}:{underline:D},...A===void 0?{}:{strike:A},...v===void 0?{}:{color:v},...F===void 0?{}:{font:F},...M===void 0?{}:{align:M},...i&&"lines"in i?{line_spacing:Math.round(i.lines*1e3)/1e3}:{},...h===void 0?{}:{space_before:I(h)},...p===void 0?{}:{space_after:I(p)},...O===void 0?{}:{anchor:O},...g===void 0||g!==null&&g.length>2?{}:{bullet:g??!1},...o===void 0?{}:{numbered:o}};return Object.keys(a).length>0?a:void 0}export function importDeck(n,d){const O=d.name??"deck",_=[...n.report],y=new Re(n.bytes,d.taken),$=Object.entries(Ne).find(([,[i,h]])=>i===n.width&&h===n.height)?.[0],u=[];Object.keys(n.theme).length>0&&u.push(`prs.theme.colors = ${JSON.stringify(n.theme)};`);const v=Object.fromEntries(Object.entries(n.fonts).filter(([i,h])=>!i.endsWith("_east_asian")||h!==Te));Object.keys(v).length>0&&u.push(`prs.theme.fonts = ${JSON.stringify(v)};`);const F=new Map;n.masters.forEach((i,h)=>{const p=`master${String(h+1)}`,g=a=>(t,l,b,x="cannot-hold")=>{_.push({kind:x,part:"",where:t?`${a} › "${t.name}"`:a,what:l,detail:b})};u.push("",`const ${p} = prs.slide_masters.add(${ne(i.name)});`),i.background&&!se(i.background,"lt1")&&u.push(`${p}.background.fill.solid();`,...ke(`${p}.background.fill.fore_color`,i.background));for(const[a,t]of[["title","title_style"],["body","body_style"],["other","other_style"]])u.push(...He(`${p}.text_styles.${t}`,i.text_styles[a],we[a]));u.push(...$e(p,i.shapes,y,g(`master "${i.name}"`),!0).lines),i.layouts.forEach((a,t)=>{const l=`${p}_layout${String(t+1)}`;u.push("",`const ${l} = ${p}.slide_layouts.add(${ne(a.name)});`),a.display_master_shapes===!1&&u.push(`${l}.display_master_shapes = false;`),a.background&&u.push(`${l}.background.fill.solid();`,...ke(`${l}.background.fill.fore_color`,a.background));const b=$e(l,a.shapes,y,g(`layout "${a.name}"`),!1);u.push(...b.lines),F.set(a.name,b.names)})});const D=new Set,A=[],M=[];n.slides.forEach((i,h)=>{const{slide:p,words:g}=We(i,h,D,F.get(i.layout)??new Map,y,_,n.masters.find(a=>a.layouts.some(t=>t.name===i.layout))?.text_styles.other??we.other);A.push(p),M.push(g)});const o=new Map;o.set(`${O}.ts`,['import { Emu, MSO_ANCHOR, MSO_AUTO_SIZE, MSO_CONNECTOR, MSO_SHAPE, PP_ALIGN, PP_PLACEHOLDER, Pt, presentation } from "@allyhub/sdk/slides";',"",`// ${d.source}, imported by allyhub slides import: its masters and layouts.`,`export default presentation({ slides: ${ne(`./${O}.yaml`)}, script: ${ne(`./${O}.{locale}.yaml`)}, size: ${$?ne($):`{ width: ${Oe(n.width)}, height: ${Oe(n.height)} }`} }, (prs) => {`,...u.map(i=>i===""?"":` ${i}`),"});",""].join(`
|
|
3
|
+
`)),o.set(`${O}.yaml`,ye({slides:A},{lineWidth:0})),o.set(`${O}.${d.lang}.yaml`,ye({...n.title?{title:n.title}:{},slides:M},{lineWidth:0}));for(const[i,h]of y.files)o.set(i,h);for(const[i,h]of y.byPart){const p=/\.(emf|wmf|tiff?)$/iu.exec(h)?.[1];p&&_.push({kind:"cannot-hold",part:i,what:"a:blip",detail:`a picture as ${p.toUpperCase()}, which the stage cannot draw (its export keeps it)`})}return{files:o,report:_,reasons:n.reasons}}const Je=new Set(["dt","ftr","sldNum"]);function We(n,d,O,_,y,$,u){const v=`slide ${String(d+1)}`,D=n.shapes.find(e=>e.placeholder?.type==="title"||e.placeholder?.type==="ctrTitle")?.text?.paragraphs.map(e=>e.runs.map(r=>r.text).join("")).join(" ")??"",A=n.name!==void 0&&/^[A-Za-z0-9_-]+$/u.test(n.name)&&!O.has(n.name)?oe(n.name,O,"slide"):oe(D,O,`slide-${String(d+1)}`),M=new Set(_.values()),o={},i={},h={},p=new Map,g=new Map,a=new Set,t=[],l=new Map,b=[],x=Ue(n.shapes,e=>{$.push({kind:"approximated",part:n.part,where:`${v} › "${e.name}"`,what:"p:cNvCxnSpPr",detail:Ge})});for(const e of x){const r=`${v} › "${e.name}"`,w=c=>(m,P)=>{$.push({kind:c,part:n.part,where:r,what:m,detail:P})},L=w("cannot-hold");if(e.placeholder){const c=_.get(e.placeholder.idx)??[..._.values()].find(P=>P===Ae[e.placeholder?.type??"body"]);if(!c){L("p:ph","its layout has no such placeholder; it is left out");continue}p.set(e.name,c),e.id!==void 0&&l.set(e.id,c),t.push({name:c,placeholder:!0});const m={};if(e.frame&&(m.frame=xe(e.frame)),Object.assign(m,Ee(e)),(e.kind==="picture"||e.kind==="movie")&&e.part){const P=y.path(e.part);P&&(m[e.kind==="movie"?"movie":"picture"]=P);const W=Se(e.crop);W&&(m.crop=W)}if(e.text&&e.placeholder.type!=="sldNum"){const P=ce(e.text.paragraphs,de(e.text.paragraphs),L);P!==void 0&&(i[c]=P);const W=fe(e.text.paragraphs,L,e.text.vertical_anchor);W&&(m.text=W)}e.fill&&(m.fill=T(e.fill)),e.line!==void 0&&(m.line=e.line===null?"none":T(e.line)),e.alt!==void 0&&(h[c]=e.alt),Je.has(e.placeholder.type)&&a.add(c),o[c]=m;continue}const S=oe(e.name,M,e.kind);if(p.set(e.name,S),!e.frame){L("a:xfrm","a shape with no frame is left out");continue}const R=Ye(e,S,y,w,i,u);if(R){if(e.id!==void 0&&l.set(e.id,S),e.glue&&b.push({name:S,at:r,glue:e.glue}),e.group!==void 0){const c=g.get(e.group)??oe(e.group,M,"group");g.set(e.group,c),R.group=c}e.alt!==void 0&&(h[S]=e.alt),o[S]=R,t.push({name:S,placeholder:!1})}}for(const e of b){const r={};for(const L of["begin","end"]){const S=e.glue[L];if(!S)continue;const R=l.get(S.id);R===void 0?$.push({kind:"cannot-hold",part:n.part,where:e.at,what:L==="begin"?"a:stCxn":"a:endCxn",detail:"a connector's end glued to a shape that is left out: it stays where it is"}):r[L]={shape:R,site:S.site}}const w=o[e.name];w&&Object.keys(r).length>0&&(w.connect=r)}const j=t.map(e=>e.placeholder).lastIndexOf(!0),z=t.findIndex(e=>e.placeholder),V=[..._.values()],B=t.filter(e=>e.placeholder).map(e=>V.indexOf(e.name)),G=t.some((e,r)=>!e.placeholder&&r>z&&r<j)||B.some((e,r)=>r>0&&e<(B[r-1]??-1));t.forEach((e,r)=>{const w=o[e.name]??(o[e.name]={});G?w.z=r-t.length:!e.placeholder&&z>=0&&r<z&&(w.z=-1)});const J=Object.fromEntries(Object.entries(o).filter(([e,r])=>Object.keys(r).length>0||a.has(e))),q=n.animations.flatMap(e=>{const r=p.get(e.shape);return r!==void 0?[{...e,shape:r}]:($.push({kind:"cannot-hold",part:n.part,where:v,what:"p:spTgt",detail:`an animation of ${e.shape}, which is left out`}),[])}),K=n.background?n.background.picture!==void 0?(()=>{const e=y.path(n.background.picture);return e===void 0?void 0:{picture:e}})():n.background.gradient?{gradient:ve(n.background.gradient)}:n.background.fill!==void 0?{fill:T(n.background.fill)}:void 0:void 0;return{slide:{id:A,layout:n.layout,...n.hidden?{hidden:!0}:{},...K?{background:K}:{},...Object.keys(J).length>0?{shapes:J}:{},...q.length>0?{animations:q}:{},...n.transition?{transition:n.transition}:{},...n.advance===void 0?{}:{advance_after:n.advance}},words:{id:A,...Object.keys(i).length>0?{text:i}:{},...Object.keys(h).length>0?{alt:h}:{},...n.notes===void 0?{}:{notes:n.notes}}}}function Ye(n,d,O,_,y,$){const u=_("cannot-hold"),{kind:v,frame:F,rotation:D,flip:A,locked:M,text:o,fill:i,fill_transparency:h,gradient:p,shadow:g,line:a,line_width:t,line_dash:l,line_begin:b,line_end:x,line_begin_size:j,line_end_size:z,geometry:V,path:B,table:G,chart:J,adjustments:q,part:K,crop:e,text_color:r}=n;if(!F)return;const w={frame:xe(F),...Ee({...D===void 0?{}:{rotation:D},...A?{flip:A}:{},...M?{locked:M}:{}})},L=q?{adjustments:q.map(C=>Math.round(C*1e5)/1e5)}:{},S={...p?{gradient:ve(p)}:{},...g?{shadow:le(g)}:{}};if(J)return J.title!==void 0&&(y[d]=J.title),{chart:ze(J),...w};if(G){const C=G.rows.reduce((s,k)=>s+k.height,0),Y=G.rows.filter(s=>s.height<=0).length,N=Y===0?0:Math.max(12700,(F.height-C)/Y),U=G.rows.map(s=>s.height>0?s:{...s,height:N}),X=U.reduce((s,k)=>s+k.height,0),ie=U.map(s=>({...s,height:X>0?s.height*F.height/X:s.height})),pe=G.columns.map(I),he=s=>Math.round(s.reduce((k,H)=>k+H,0)*100)/100,me=s=>{const k=s.map(H=>JSON.stringify(H??null));return k.every(H=>H===k[0])?s[0]:void 0},je={table:{columns:pe,rows:ie.map(s=>{const k=s.cells.filter(f=>!f.spanned).map(f=>f.fill),H=me(k);H===void 0&&k.some(f=>f!==void 0)&&_("approximated")("a:tcPr/a:solidFill","cells of a row filled differently take its first's");const ae=H??k.find(f=>f!=null),E=s.cells.map(f=>f.borders?.bottom?.color),Z=me(E)??E.find(f=>f!==void 0);s.cells.some(f=>f.borders?.left!==void 0||f.borders?.right!==void 0||f.borders?.top!==void 0)&&_("approximated")("a:tcPr/a:lnL","a cell's edges are its row's foot");const Q=fe(s.cells.flatMap(f=>f.text.paragraphs),u),ge=s.cells.flatMap(f=>f.text.paragraphs.flatMap(Pe=>Pe.runs)).filter(f=>f.text.trim()!==""),be=ge.length>0&&ge.every(f=>f.font?.bold===!0);return{height:I(s.height),...ae===void 0?{}:{fill:T(ae)},...Q??be?{text:{...Q,...be?{bold:!0}:{}}}:{},...Z===void 0?{}:{line:T(Z)}}})},...w,frame:{...w.frame,w:he(pe),h:he(ie.map(s=>I(s.height)))}};return ie.some(s=>s.cells.some(k=>k.spanned))&&u("a:tc@gridSpan","merged cells are apart"),y[d]=ie.map(s=>s.cells.map(k=>{const ae=s.cells.flatMap(E=>E.text.paragraphs.flatMap(Z=>Z.runs)).filter(E=>E.text.trim()!=="").every(E=>E.font?.bold===!0)?k.text.paragraphs.map(E=>({...E,runs:E.runs.map(Z=>{const Q={...Z.font};return delete Q.bold,{...Z,font:Q}})})):k.text.paragraphs;return ce(ae,de(s.cells.flatMap(E=>E.text.paragraphs)),u)??""})),je}if((v==="picture"||v==="movie")&&K){const C=O.path(K);if(!C)return;const Y=Se(e);return{[v==="movie"?"movie":"picture"]:C,...w,...Y?{crop:Y}:{},...g?{shadow:le(g)}:{}}}const R={...t===void 0||a===null?{}:{line_width:I(t)},...re({...l===void 0?{}:{line_dash:l},...b===void 0?{}:{line_begin:b},...x===void 0?{}:{line_end:x},...j===void 0?{}:{line_begin_size:j},...z===void 0?{}:{line_end_size:z}})};if(!B&&V!==void 0&&Fe(V))return{geometry:V,...L,...w,...a===void 0||se(a,_e.line)?{}:{line:a===null?"none":T(a)},...t===void 0||t===_e.line_width?{}:{line_width:I(t)},...re({...l===void 0?{}:{line_dash:l},...b===void 0?{}:{line_begin:b},...x===void 0?{}:{line_end:x},...j===void 0?{}:{line_begin_size:j},...z===void 0?{}:{line_end_size:z}}),...g?{shadow:le(g)}:{}};const c=v==="textbox",m=c?{textbox:!0,...w}:B?{path:{w:B.w,h:B.h,d:Le(B.steps)},...w}:{geometry:V??"rect",...L,...w},P=c?null:ee.fill;p?Object.assign(m,S):(i&&!se(i,P)&&(m.fill=T(i)),h!==void 0&&i&&(m.fill_transparency=h),i===null&&P!==null&&(m.fill="none"),g&&(m.shadow=le(g)));const W=c?null:ee.line;a!==void 0&&!se(a,W)&&(m.line=a===null?"none":T(a)),!c&&a!==null&&t!==void 0&&t!==ee.line_width?Object.assign(m,R):a!==null&&Object.assign(m,re({...l===void 0?{}:{line_dash:l},...b===void 0?{}:{line_begin:b},...x===void 0?{}:{line_end:x},...j===void 0?{}:{line_begin_size:j},...z===void 0?{}:{line_end_size:z}})),c&&a!==void 0&&a!==null&&t!==void 0&&(m.line_width=I(t));const te=c?De:Be.autoshape,Me=o?.vertical_anchor===void 0||o.vertical_anchor===te.vertical_anchor?void 0:o.vertical_anchor,ue=Ie("",o&&{...o,levels:[],...te.vertical_anchor===void 0?{}:{vertical_anchor:te.vertical_anchor}},te);if(ue.length>0&&u("a:bodyPr",`its text frame (${ue.map(C=>C.replace(/^\.(\w+) = .*$/u,"$1")).join(", ")}) is the basic ${c?"text box's":"shape's"}`),o){const C=ce(o.paragraphs,de(o.paragraphs),u);C!==void 0&&(y[d]=C);const Y=o.paragraphs.map(U=>({...U,alignment:U.alignment??o.levels[U.level]?.alignment??$[U.level]?.alignment??"l",runs:U.runs.map(X=>X.font?.color!==void 0||r===void 0?X:{...X,font:{...X.font,color:r}})})),N=fe(c?o.paragraphs:Y,u,Me);N&&!c&&N.color===T(ee.font_color)&&delete N.color,N&&!c&&N.align===ee.alignment&&delete N.align,N&&Object.keys(N).length>0&&(m.text=N)}return m}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{as as f,colorIn as
|
|
2
|
+
import{as as f,colorIn as b}from"@allyhub/ooxml";export function say(t,e,n,a){t.read.pkg.entries.push({kind:e,part:t.part,where:t.where,what:n,...a===void 0?{}:{detail:a}})}const D=new Set(["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"]);export function modelColor(t,e,n){return t.scheme!==void 0&&D.has(t.scheme)?t.brightness===void 0?t.scheme:{theme_color:t.scheme,brightness:t.brightness}:(t.transformed&&say(e,"approximated",n,"a theme colour lightened, darkened or otherwise changed is kept as the colour it makes, no longer following the theme"),{rgb:t.rgb})}export function colorAt(t,e,n){const a=b(t,e.colors);return a?{color:modelColor(a,e,n),alpha:a.alpha}:void 0}export const transparencyOf=t=>t>=1?void 0:Math.round((1-t)*1e3)/1e3;export function gradientOf(t,e){const n=f(t),a=(n.one("a:gsLst")?.all("a:gs")??[]).flatMap(o=>{const l=colorAt(o,e,"a:gs");if(!l)return[];const r=transparencyOf(l.alpha);return[{at:Math.min(1,Math.max(0,(o.attr("pos")??0)/1e5)),color:l.color,...r===void 0?{}:{transparency:r}}]});if(a.length<2){say(e,"cannot-hold","a:gradFill","a gradient of fewer than two colours");return}const s=n.one("a:lin");return n.one("a:path")&&say(e,"approximated","a:gradFill/a:path","a radial or rectangular gradient is drawn along a line"),s?.ignore(["scaled"],"a linear gradient's scaling with its shape"),n.ignore(["rotWithShape"],"a gradient's turning with its shape"),n.one("a:tileRect"),{angle:(s?.attr("ang")??0)/6e4%360,stops:[...a].sort((o,l)=>o.at-l.at).slice(0,10)}}const O=["a:noFill","a:solidFill","a:gradFill","a:blipFill","a:pattFill","a:grpFill"];export function fillOf(t,e){const n=t&&f(t).choice(...O);return n?fillElement(n,e):void 0}export function fillElement(t,e){switch(t.use(),t.key){case"a:noFill":return{fill:null};case"a:solidFill":{const n=colorAt(t,e,"a:solidFill");if(!n)return;const a=transparencyOf(n.alpha);return{fill:n.color,...a===void 0?{}:{fill_transparency:a}}}case"a:gradFill":{const n=gradientOf(t,e);return n?{gradient:n}:void 0}case"a:pattFill":{const n=f(t);say(e,"approximated","a:pattFill",`a pattern (${n.attr("prst")??"pct5"}) is filled with its foreground colour`);const a=colorAt(n.one("a:fgClr"),e,"a:pattFill");return n.one("a:bgClr")?.consume(),a?{fill:a.color}:void 0}case"a:grpFill":return{group:!0};default:say(e,"cannot-hold",t.key,"a picture filling a shape"),t.consume();return}}const F=new Set(["solid","sysDash","sysDot","dash","dashDot","lgDash","lgDashDot","lgDashDotDot"]);export function lineOf(t,e){if(!t)return{};const n=f(t),a=fillOf(n,e);a?.gradient&&say(e,"approximated","a:ln/a:gradFill","a gradient line is drawn in its first colour"),a?.fill_transparency!==void 0&&say(e,"cannot-hold","a:ln/a:alpha","a line's transparency");const s=a?.fill!==void 0?a.fill:a?.gradient?a.gradient.stops[0]?.color:void 0,o=n.attr("w"),l=n.one("a:prstDash")?.attr("val"),r=l==="solid"?void 0:l;r!==void 0&&!F.has(r)&&say(e,"approximated","a:prstDash",`${r} is drawn as dashes`);const u=p=>{const c=p?.attr("type");return c===void 0||c==="none"?void 0:c},i=p=>{const c=p?.attr("w"),x=p?.attr("len"),_={...c===void 0||c==="med"?{}:{w:c},...x===void 0||x==="med"?{}:{len:x}};return Object.keys(_).length===0?void 0:_},d=n.one("a:headEnd"),m=n.one("a:tailEnd"),g=u(d),h=u(m),S=i(d),k=i(m),w=g===void 0?void 0:S,y=h===void 0?void 0:k;for(const p of["a:round","a:bevel","a:miter"])n.one(p)?.skip("a line's join (round, bevel, miter): the stage joins its own way");return{...s===void 0?{}:{line:s},...o===void 0?{}:{line_width:o},...r===void 0?{}:{line_dash:F.has(r)?r:"dash"},...g===void 0?{}:{line_begin:g},...h===void 0?{}:{line_end:h},...w===void 0?{}:{line_begin_size:w},...y===void 0?{}:{line_end_size:y}}}export function shadowOf(t,e){const n=t&&f(t).one("a:outerShdw");if(!n)return;const a=colorAt(n,e,"a:outerShdw");return n.ignore(["algn","rotWithShape"],"a shadow's alignment and turning with its shape"),((n.attr("sx")??1e5)!==1e5||(n.attr("sy")??1e5)!==1e5)&&say(e,"cannot-hold","a:outerShdw@sx","a shadow's scale"),n.attr("kx"),n.attr("ky"),{color:a?.color??"dk1",blur:n.attr("blurRad")??0,distance:n.attr("dist")??0,angle:(n.attr("dir")??0)/6e4%360,transparency:a?transparencyOf(a.alpha)??0:0}}export function styleOf(t,e){const n=t&&f(t);if(!n)return{};const a=i=>{if(!i)return;const d=b(i,e.colors);return{idx:i.attr("idx")??0,ctx:{...e,colors:{...e.colors,...d?{placeholder:d}:{}}}}},s={},o=a(n.one("a:fillRef"));if(o){const i=o.idx>=1001?e.read.matrix.background[o.idx-1001]:o.idx>0?e.read.matrix.fill[o.idx-1]:void 0,d=i?fillElement(i,o.ctx):{fill:null};Object.assign(s,d??{})}const l=a(n.one("a:lnRef"));if(l){const i=l.idx>0?e.read.matrix.line[l.idx-1]:void 0;Object.assign(s,i?lineOf(i,l.ctx):{line:null})}const r=a(n.one("a:effectRef"));if(r&&r.idx>0){const i=e.read.matrix.effect[r.idx-1],d=shadowOf(i&&f(i).one("a:effectLst"),r.ctx);d&&(s.shadow=d)}const u=n.one("a:fontRef");if(u){const i=colorAt(u,e,"a:fontRef");i&&(s.text_color=i.color);const d=u.attr("idx");d==="major"?s.font="+mj-lt":d==="minor"&&(s.font="+mn-lt")}return s}export const sameColor=(t,e)=>JSON.stringify(t)===JSON.stringify(e);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{SHAPE_TYPES as ee}from"@allyhub/ooxml/enums";import{evaluate as te,presetAdjustments as ne}from"@allyhub/ooxml/geometry";import{as as H,parseXml as oe}from"@allyhub/ooxml";import{strFromU8 as ae}from"fflate";import{isConnectorGeometry as ie,pathSteps as re}from"@allyhub/slides-core";import{fillOf as I,lineOf as B,say as b,shadowOf as W,styleOf as V}from"./common.js";import{chartOf as se}from"./chart.js";import{tableOf as ce}from"./table.js";import{BODY_DEFAULTS as de,bodyOf as le}from"./text.js";const Z=new Set(["title","ctrTitle","subTitle","body","pic","media","obj","dt","ftr","sldNum"]),pe=new Set(ee),q={place:e=>e};function z(e){const i=e?.one("a:off"),n=e?.one("a:ext");if(!(!e||!i||!n))return{frame:{left:i.attr("x")??0,top:i.attr("y")??0,width:n.attr("cx")??0,height:n.attr("cy")??0},rotation:e.attrOr("rot")/6e4%360,flip:{h:e.attrOr("flipH"),v:e.attrOr("flipV")}}}function D(e){if(!e)return{};const i=Math.round((e.rotation%360+360)%360*1e3)/1e3;return{frame:{left:Math.round(e.frame.left),top:Math.round(e.frame.top),width:Math.round(e.frame.width),height:Math.round(e.frame.height)},...i===0||i===360?{}:{rotation:i},...e.flip.h||e.flip.v?{flip:{...e.flip.h?{h:!0}:{},...e.flip.v?{v:!0}:{}}}:{}}}function fe(e,i){const n=(r,h)=>e?.one(r)?.attr(h)??0,o=(r,h)=>e?.one(r)?.attr(h)??0,d=o("a:chExt","cx")===0?1:o("a:ext","cx")/o("a:chExt","cx"),t=o("a:chExt","cy")===0?1:o("a:ext","cy")/o("a:chExt","cy"),s=(e?.attrOr("rot")??0)/6e4%360,m=e?.attrOr("flipH")??!1,f=e?.attrOr("flipV")??!1,g=n("a:off","x")+o("a:ext","cx")/2,c=n("a:off","y")+o("a:ext","cy")/2;return r=>{const h=r.frame.width*d,w=r.frame.height*t;let l=n("a:off","x")+(r.frame.left-n("a:chOff","x"))*d+h/2,p=n("a:off","y")+(r.frame.top-n("a:chOff","y"))*t+w/2,a=r.rotation;const y={...r.flip};if(m&&(l=2*g-l,a=-a,y.h=!y.h),f&&(p=2*c-p,a=-a,y.v=!y.v),s!==0){const v=s*Math.PI/180,[_,u]=[l-g,p-c];l=g+_*Math.cos(v)-u*Math.sin(v),p=c+_*Math.sin(v)+u*Math.cos(v),a+=s}return i.place({frame:{left:l-h/2,top:p-w/2,width:h,height:w},rotation:a,flip:y})}}function ue(e,i,n){const o=a=>(a?.all("a:gd")??[]).map(y=>[y.attr("name")??"",y.attr("fmla")??""]),d=o(e.one("a:avLst")),t=o(e.one("a:gdLst"));e.one("a:ahLst")?.skip("a freeform's handles: editing aids"),e.one("a:cxnLst")?.skip("a freeform's connection sites: editing aids"),e.one("a:rect")?.skip("a freeform's text rectangle: its text takes the shape's box");const s=a=>H(a).all("a:pt").flatMap(y=>[String(y.attr("x")??"0"),String(y.attr("y")??"0")]),m={"a:moveTo":"M","a:lnTo":"L","a:quadBezTo":"Q","a:cubicBezTo":"C","a:close":"Z","a:arcTo":"A"},f=(e.one("a:pathLst")?.all("a:path")??[]).map(a=>{const y=a.kids().map(u=>{if(u.use(),u.key==="a:arcTo"){const k=u;return["A",...["wR","hR","stAng","swAng"].map(S=>String(k.attr(S)??"0"))].join(" ")}return[m[u.key]??"Z",...s(u)].join(" ")}),v=a.attr("fill"),_=a.attr("stroke");return a.attr("extrusionOk"),{...a.attr("w")?{w:a.attr("w")}:{},...a.attr("h")?{h:a.attr("h")}:{},...v===void 0||v==="norm"?{}:{fill:v},..._===!1?{stroke:!1}:{},d:y.join(" ")}});if(f.length===0)return;f.some(a=>a.fill!==void 0||a.stroke===!1)&&b(n,"approximated","a:path@fill","a freeform's paths are drawn alike: filled and outlined");const g=f[0]?.w??0,c=f[0]?.h??0,r=g>0&&c>0&&f.every(a=>(a.w??0)===g&&(a.h??0)===c),h=r?g:i&&i.width>0?i.width:g>0?g:1,w=r?c:i&&i.height>0?i.height:c>0?c:1,l=te({av:d,gd:t,paths:f.map(a=>({d:a.d,...a.w?{w:a.w}:{},...a.h?{h:a.h}:{}}))},h,w),p=re(l.paths.map(a=>a.d).join(" "));return p?{w:h,h:w,steps:p}:void 0}function he(e,i,n){const o=new Map((i?.all("a:gd")??[]).map(s=>[s.attr("name")??"",s.attr("fmla")??""]));if(o.size===0)return;const d=ne(e);for(const s of o.keys())d.some(m=>m.name===s)||b(n,"unread","a:gd@name",`${e} has no adjustment ${s}`);return d.map(s=>{const m=o.get(s.name),f=m===void 0?NaN:Number(/^val\s+(-?[\d.]+)$/u.exec(m.trim())?.[1]);return m!==void 0&&Number.isNaN(f)&&b(n,"approximated","a:gd@fmla",`an adjustment by a formula (${m}) is the preset's own`),(Number.isNaN(f)?s.value:f)/1e5})}function E(e,i){const n=e?.attr("name")??"",o=e?.attr("id"),d=e?.attr("descr");e?.attr("hidden")===!0&&b(i,"cannot-hold","p:cNvPr@hidden","a shape hidden on its slide"),e?.attr("title")&&b(i,"cannot-hold","p:cNvPr@title","an alternative text's title");for(const s of["a:hlinkClick","a:hlinkHover"]){const m=e?.one(s);if(m?.attr("action")==="ppaction://media"){m.consume();continue}m&&(b(i,"cannot-hold",s,"a link on a whole shape"),m.consume())}return{name:n,...o===void 0?{}:{id:String(o)},...d?{alt:d}:{}}}export function shapesOf(e,i,n=q){const o=[];if(!e)return o;for(const d of e.kids())switch(d.key){case"p:nvGrpSpPr":case"p:grpSpPr":n===q&&d.consume();break;case"p:sp":o.push(...be(d,i,n));break;case"p:cxnSp":o.push(...we(d,i,n));break;case"p:pic":o.push(...K(d,i,n));break;case"p:graphicFrame":o.push(...ve(d,i,n));break;case"p:grpSp":o.push(...ke(d,i,n));break;case"p:contentPart":d.use(),b(i,"cannot-hold","p:contentPart","ink"),d.consume();break;default:break}return o}const C=(e,i,n)=>{const o=`${e.where} › "${n||"unnamed"}"`;return i.label(o),{...e,where:o}},me=["noGrp","noUngrp","noSelect","noChangeAspect","noEditPoints","noAdjustHandles","noChangeArrowheads","noChangeShapeType","noTextEdit","noCrop","noDrilldown"];function $(e,i){if(!e)return!1;const n=H(e),o=e.key!=="a:graphicFrameLocks",d=n.attr("noMove")===!0,t=n.attr("noResize")===!0,s=o&&n.attr("noRot")===!0;return n.ignore(me,"locks against editing in PowerPoint"),H(e).one("a:extLst")?.skip("a lock's extensions"),d&&t?!0:((d||t||s)&&b(i,"cannot-hold",`${e.key}@${[d&&"noMove",t&&"noResize",s&&"noRot"].filter(Boolean).join(",")}`,"a shape locked against some changes and not others: a deck locks moving, sizing and turning together"),!1)}const ge={};function be(e,i,n){e.use();const o=e.one("p:nvSpPr"),d=o?.one("p:cNvPr"),t=C(i,e,d?.el.attrs.find(P=>P.key==="name")?.value??""),s=E(d,t),m=o?.one("p:cNvSpPr");$(m?.one("a:spLocks"),t)&&(s.locked=!0);const f=m?.attr("txBox")===!0,g=o?.one("p:nvPr");g?.ignore(["isPhoto","userDrawn"],"a shape's origin in PowerPoint");const c=g?.one("p:ph"),r=e.one("p:spPr");r?.ignore(["bwMode"],"a shape's black and white printing mode");const h=z(r?.one("a:xfrm")),w=D(h&&n.place(h)),l=r?.one("a:prstGeom"),p=l?.attr("prst"),a=I(r,t),y=r?.one("a:ln"),v=B(y,t),_=W(r?.one("a:effectLst"),t),u=c||f?{}:V(e.one("p:style"),t);(c||f)&&e.one("p:style")?.skip("a placeholder's or a text box's style: its own properties are what it shows");const k=a?.group?n.fill:a;a?.group&&!n.fill&&b(t,"approximated","a:grpFill","a group's fill outside a group is none");const S=e.one("p:txBody"),G=c!==void 0&&!t.part.includes("/slides/")&&(c.attr("type")??"obj")!=="sldNum",L=S?le(S,c&&!t.part.includes("/slideMasters/")?ge:de,t,G):void 0,M={...s,kind:"autoshape",...w,...k?.fill!==void 0?{fill:k.fill}:k?.gradient?{}:c?{}:f?{fill:null}:u.fill!==void 0?{fill:u.fill}:u.gradient?{}:{fill:null},...(k?.fill_transparency??(k?void 0:u.fill_transparency))===void 0?{}:{fill_transparency:k?.fill_transparency??u.fill_transparency??0},...k?.gradient??(k?void 0:u.gradient)?{gradient:k?.gradient??u.gradient}:{},..._??u.shadow?{shadow:_??u.shadow}:{},...v.line!==void 0?{line:v.line}:c?{}:f?{}:{line:u.line??null},...(v.line_width??(c?void 0:u.line_width))===void 0?{}:{line_width:v.line_width??u.line_width},...(v.line_dash??u.line_dash)===void 0?{}:{line_dash:v.line_dash??u.line_dash},...(v.line_begin??u.line_begin)===void 0?{}:{line_begin:v.line_begin??u.line_begin},...(v.line_end??u.line_end)===void 0?{}:{line_end:v.line_end??u.line_end},...u.text_color===void 0?{}:{text_color:u.text_color},...L?{text:L}:{},...n.group===void 0?{}:{group:n.group}};if(c){const P=c.attr("type")??"obj",F=c.attr("idx")??0;if(c.ignore(["hasCustomPrompt"],"a placeholder's own prompt text"),c.attr("orient")==="vert"&&b(t,"cannot-hold","p:ph@orient","a vertical placeholder"),c.attr("sz"),P==="sldImg"||P==="hdr")return[];const O=Z.has(P)?P:P==="clipArt"||P==="chart"||P==="tbl"||P==="dgm"?"obj":"body";return Z.has(P)||b(t,"approximated","p:ph@type",`a ${P} placeholder is a${O==="obj"?"n object":" body"} placeholder`),p!==void 0&&p!=="rect"?[{...M,kind:"placeholder",placeholder:{type:O,idx:F},geometry:p,...U(p,l?.one("a:avLst"),t)}]:(l?.one("a:avLst"),[{...M,kind:"placeholder",placeholder:{type:O,idx:F}}])}const T=r?.one("a:custGeom"),N=T?ue(T,w.frame,t):void 0;T&&!N&&b(t,"approximated","a:custGeom","a freeform with no outline is a rectangle");const R=p!==void 0&&pe.has(p)?p:"rect";return[{...M,kind:f?"textbox":"autoshape",...N?{path:N}:{geometry:R},...p===void 0||N?{}:U(p,l?.one("a:avLst"),t)}]}const U=(e,i,n)=>{const o=he(e,i,n);return o?{adjustments:o}:{}};function we(e,i,n){e.use();const o=e.one("p:nvCxnSpPr"),d=o?.one("p:cNvPr"),t=C(i,e,d?.el.attrs.find(v=>v.key==="name")?.value??""),s=E(d,t),m=o?.one("p:cNvCxnSpPr");$(m?.one("a:cxnSpLocks"),t)&&(s.locked=!0);const f={};for(const[v,_]of[["begin","a:stCxn"],["end","a:endCxn"]]){const u=m?.one(_);if(!u)continue;const k=u.attr("id"),S=u.attr("idx");k!==void 0&&S!==void 0&&(f[v]={id:String(k),site:S}),u.consume()}o?.one("p:nvPr");const g=e.one("p:spPr");g?.ignore(["bwMode"],"a shape's black and white printing mode");const c=z(g?.one("a:xfrm")),r=g?.one("a:prstGeom"),h=r?.attr("prst")??"line",w=U(h,r?.one("a:avLst"),t),l=V(e.one("p:style"),t),p=B(g?.one("a:ln"),t),a=W(g?.one("a:effectLst"),t),y=ie(h);return y||b(t,"approximated","a:prstGeom@prst",`a connector of the ${h} preset is a shape of it with no fill`),[{...s,kind:"autoshape",geometry:h,...w,...D(c&&n.place(c)),...y?{}:{fill:null},line:p.line??l.line??null,...(p.line_width??l.line_width)===void 0?{}:{line_width:p.line_width??l.line_width},...(p.line_dash??l.line_dash)===void 0?{}:{line_dash:p.line_dash??l.line_dash},...(p.line_begin??l.line_begin)===void 0?{}:{line_begin:p.line_begin??l.line_begin},...(p.line_end??l.line_end)===void 0?{}:{line_end:p.line_end??l.line_end},...a??l.shadow?{shadow:a??l.shadow}:{},...n.group===void 0?{}:{group:n.group},...f.begin||f.end?{glue:f}:{}}]}function K(e,i,n){e.use();const o=e.one("p:nvPicPr"),d=o?.one("p:cNvPr"),t=C(i,e,d?.el.attrs.find(x=>x.key==="name")?.value??""),s=E(d,t),m=o?.one("p:cNvPicPr");$(m?.one("a:picLocks"),t)&&(s.locked=!0),m?.attr("preferRelativeResize");const f=o?.one("p:nvPr");f?.ignore(["isPhoto","userDrawn"],"a shape's origin in PowerPoint");const g=f?.one("p:ph"),c=f?.one("a:videoFile"),r=f?.choice("a:audioFile","a:wavAudioFile","a:audioCd","a:quickTimeFile"),h=f?.one("p:extLst")?.all("p:ext").flatMap(x=>{const j=x.one("p14:media");return j?[j]:[]})[0],w=t.read.pkg,l=w.rel(t.part,h?.attr("r:embed"))??w.rel(t.part,c?.attr("r:link"));if(h){h.attr("r:link");for(const x of["p14:trim","p14:fade","p14:bmkLst"]){const j=h.one(x);j&&(b(t,"cannot-hold",x,x==="p14:trim"?"a video's trim":x==="p14:fade"?"a video's fade in and out":"a video's bookmarks"),j.consume())}}r&&(b(t,"cannot-hold",r.key,"a sound"),r.consume());const p=e.one("p:blipFill");p?.ignore(["dpi","rotWithShape"],"a picture's resolution and turning with its fill");const a=p?.one("a:blip");a?.ignore(["cstate"],"a picture's compression state");const y=a?.one("a:extLst")?.all("a:ext").flatMap(x=>{const j=x.one("asvg:svgBlip");return x.one("a14:useLocalDpi")?.skip("a picture kept at its own resolution"),j?[j]:[]})[0],v=w.rel(t.part,y?.attr("r:embed"))??w.rel(t.part,a?.attr("r:embed"));a?.attr("r:link")&&b(t,"missing","a:blip@r:link","a picture linked from outside the file");for(const x of a?.kids()??[])x.key!=="a:extLst"&&(x.use(),b(t,"cannot-hold",x.key,"a picture's own effect (transparency, recolouring, brightness)"),x.consume());const u=p?.one("a:srcRect"),k=x=>(u?.attr(x)??0)/1e5,S=u?{left:k("l"),top:k("t"),right:k("r"),bottom:k("b")}:void 0;p?.one("a:stretch")?.consume();const G=p?.one("a:tile");G&&(b(t,"cannot-hold","a:tile","a picture tiled in its frame"),G.consume());const L=e.one("p:spPr");L?.ignore(["bwMode"],"a shape's black and white printing mode");const M=z(L?.one("a:xfrm")),T=L?.one("a:prstGeom"),N=T?.attr("prst");T?.one("a:avLst"),N!==void 0&&N!=="rect"&&b(t,"cannot-hold","a:prstGeom@prst",`a picture cut to a ${N}`);const R=L?.one("a:ln");R&&B(R,t).line&&b(t,"cannot-hold","p:pic/a:ln","a picture's outline");const P=W(L?.one("a:effectLst"),t),F=I(L,t);(F?.fill||F?.gradient)&&b(t,"cannot-hold","p:pic/p:spPr","a fill behind a picture"),e.one("p:style")?.skip("a picture's style");const A=c!==void 0||h!==void 0&&!r,O=A?l:v;if(!O||O.external)return b(t,"missing","p:pic","a picture or a video whose file is not in the file"),[];w.bytes(O.target),A&&(v&&w.bytes(v.target),c?.attr("r:link"));const Y=s.alt!==void 0&&/^[^\s/\\]+\.[A-Za-z0-9]{2,5}$/u.test(s.alt);Y&&d?.ignore(["descr"],"a picture's file name as its description (python-pptx's habit)");const J=s.alt===void 0||Y?{}:{alt:s.alt};return[{name:s.name,...s.id===void 0?{}:{id:s.id},...s.locked?{locked:!0}:{},...J,kind:A?"movie":"picture",...g?{placeholder:{type:g.attr("type")??"pic",idx:g.attr("idx")??0}}:{},...D(M&&n.place(M)),part:O.target,...S&&!A?{crop:S}:{},...P?{shadow:P}:{},...n.group===void 0?{}:{group:n.group}}]}function ve(e,i,n){e.use();const o=e.one("p:nvGraphicFramePr"),d=o?.one("p:cNvPr"),t=C(i,e,d?.el.attrs.find(l=>l.key==="name")?.value??""),s=E(d,t);$(o?.one("p:cNvGraphicFramePr")?.one("a:graphicFrameLocks"),t)&&(s.locked=!0);const m=o?.one("p:nvPr")?.one("p:ph");m&&(b(t,"approximated","p:ph","a table, a chart or an object in a placeholder is the slide's own, its placeholder left empty"),m.consume()),e.ignore(["bwMode"],"a shape's black and white printing mode");const f=z(e.one("p:xfrm")),g=D(f&&n.place(f)),c=e.one("a:graphic")?.one("a:graphicData"),r=c?.attr("uri")??"",h={...s,...g,...n.group===void 0?{}:{group:n.group}};if(r.endsWith("/table")){const l=c?.one("a:tbl");if(l)return[{...h,kind:"table",table:ce(l.use(),t)}]}if(r.endsWith("/chart")){const l=c?.one("c:chart");l?.use();const p=t.read.pkg.rel(t.part,l?.attr("r:id")),a=p?se(p.target,t):"its chart is not in the file";return typeof a=="string"?(b(t,"cannot-hold","c:chart",a),[]):[{...h,kind:"chart",chart:a}]}if(r.endsWith("/diagram"))return b(t,"cannot-hold","dgm:relIds","SmartArt"),c?.consume(),[];const w=c?.one("p:oleObj");if(w){w.use(),b(t,"approximated","p:oleObj",`an embedded ${w.attr("progId")??"object"} is its picture`),w.ignore(["spid","name","showAsIcon","r:id","imgW","imgH","progId"],"an embedded object's program and size"),w.one("p:embed")?.consume(),w.one("p:link")?.consume();const l=w.one("p:pic");if(l){const[a]=K(l,i,n);return a?[{...a,...s,...g,kind:"picture"}]:[]}const p=ye(w.el.attrs.find(a=>a.key==="spid")?.value,t);return p?[{...h,kind:"picture",part:p}]:(b(t,"missing","p:oleObj","an embedded object whose picture is not in the file"),[])}return b(t,"cannot-hold","a:graphicData",r||"a graphic frame"),c?.consume(),[]}const Q="urn:schemas-microsoft-com:vml",X="urn:schemas-microsoft-com:office:office";function ye(e,i){const n=i.read.pkg,o=n.relOfType(i.part,"vmlDrawing")?.target,d=o===void 0?void 0:n.bytes(o);if(o===void 0||!d||e===void 0)return;let t;try{t=oe(ae(d))}catch{return}const s=(r,h,w)=>r.attrs.find(l=>l.uri===h&&l.local===w)?.value,m=r=>[r,...r.children.flatMap(m)],g=m(t).find(r=>r.uri===Q&&(s(r,"","id")===e||s(r,X,"spid")===e))?.children.find(r=>r.uri===Q&&r.local==="imagedata"),c=n.rel(o,g&&s(g,X,"relid"));if(!(!c||c.external||!n.bytes(c.target)))return c.target}function ke(e,i,n){e.use();const o=e.one("p:nvGrpSpPr"),d=o?.one("p:cNvPr"),t=C(i,e,d?.el.attrs.find(h=>h.key==="name")?.value??""),s=E(d,t),m=$(o?.one("p:cNvGrpSpPr")?.one("a:grpSpLocks"),t);o?.one("p:nvPr");const f=e.one("p:grpSpPr");f?.ignore(["bwMode"],"a shape's black and white printing mode");const g=I(f,t),c=f?.one("a:effectLst");c&&(b(t,"cannot-hold","p:grpSpPr/a:effectLst","a group's own effects"),c.consume()),n.group!==void 0&&b(t,"approximated","p:grpSp",`a group in a group is one group, ${n.group}`);const r=shapesOf(e,t,{...g?{fill:g}:n.fill?{fill:n.fill}:{},group:n.group??s.name,place:fe(f?.one("a:xfrm"),n)});return m?r.map(h=>({...h,locked:!0})):r}
|
|
2
|
+
import{SHAPE_TYPES as ee}from"@allyhub/ooxml/enums";import{evaluate as te,presetAdjustments as ne}from"@allyhub/ooxml/geometry";import{as as I,parseXml as oe}from"@allyhub/ooxml";import{strFromU8 as ie}from"fflate";import{isConnectorGeometry as ae,pathSteps as re}from"@allyhub/slides-core";import{fillOf as B,lineOf as W,say as v,shadowOf as U,styleOf as V}from"./common.js";import{chartOf as se}from"./chart.js";import{tableOf as ce}from"./table.js";import{BODY_DEFAULTS as de,bodyOf as le}from"./text.js";const Z=new Set(["title","ctrTitle","subTitle","body","pic","media","obj","dt","ftr","sldNum"]),pe=new Set(ee),q={place:e=>e};function D(e){const a=e?.one("a:off"),n=e?.one("a:ext");if(!(!e||!a||!n))return{frame:{left:a.attr("x")??0,top:a.attr("y")??0,width:n.attr("cx")??0,height:n.attr("cy")??0},rotation:e.attrOr("rot")/6e4%360,flip:{h:e.attrOr("flipH"),v:e.attrOr("flipV")}}}function H(e){if(!e)return{};const a=Math.round((e.rotation%360+360)%360*1e3)/1e3;return{frame:{left:Math.round(e.frame.left),top:Math.round(e.frame.top),width:Math.round(e.frame.width),height:Math.round(e.frame.height)},...a===0||a===360?{}:{rotation:a},...e.flip.h||e.flip.v?{flip:{...e.flip.h?{h:!0}:{},...e.flip.v?{v:!0}:{}}}:{}}}function fe(e,a){const n=(r,u)=>e?.one(r)?.attr(u)??0,o=(r,u)=>e?.one(r)?.attr(u)??0,l=o("a:chExt","cx")===0?1:o("a:ext","cx")/o("a:chExt","cx"),t=o("a:chExt","cy")===0?1:o("a:ext","cy")/o("a:chExt","cy"),s=(e?.attrOr("rot")??0)/6e4%360,m=e?.attrOr("flipH")??!1,f=e?.attrOr("flipV")??!1,g=n("a:off","x")+o("a:ext","cx")/2,c=n("a:off","y")+o("a:ext","cy")/2;return r=>{const u=r.frame.width*l,w=r.frame.height*t;let p=n("a:off","x")+(r.frame.left-n("a:chOff","x"))*l+u/2,d=n("a:off","y")+(r.frame.top-n("a:chOff","y"))*t+w/2,i=r.rotation;const _={...r.flip};if(m&&(p=2*g-p,i=-i,_.h=!_.h),f&&(d=2*c-d,i=-i,_.v=!_.v),s!==0){const b=s*Math.PI/180,[S,h]=[p-g,d-c];p=g+S*Math.cos(b)-h*Math.sin(b),d=c+S*Math.sin(b)+h*Math.cos(b),i+=s}return a.place({frame:{left:p-u/2,top:d-w/2,width:u,height:w},rotation:i,flip:_})}}function ue(e,a,n){const o=i=>(i?.all("a:gd")??[]).map(_=>[_.attr("name")??"",_.attr("fmla")??""]),l=o(e.one("a:avLst")),t=o(e.one("a:gdLst"));e.one("a:ahLst")?.skip("a freeform's handles: editing aids"),e.one("a:cxnLst")?.skip("a freeform's connection sites: editing aids"),e.one("a:rect")?.skip("a freeform's text rectangle: its text takes the shape's box");const s=i=>I(i).all("a:pt").flatMap(_=>[String(_.attr("x")??"0"),String(_.attr("y")??"0")]),m={"a:moveTo":"M","a:lnTo":"L","a:quadBezTo":"Q","a:cubicBezTo":"C","a:close":"Z","a:arcTo":"A"},f=(e.one("a:pathLst")?.all("a:path")??[]).map(i=>{const _=i.kids().map(h=>{if(h.use(),h.key==="a:arcTo"){const P=h;return["A",...["wR","hR","stAng","swAng"].map(k=>String(P.attr(k)??"0"))].join(" ")}return[m[h.key]??"Z",...s(h)].join(" ")}),b=i.attr("fill"),S=i.attr("stroke");return i.attr("extrusionOk"),{...i.attr("w")?{w:i.attr("w")}:{},...i.attr("h")?{h:i.attr("h")}:{},...b===void 0||b==="norm"?{}:{fill:b},...S===!1?{stroke:!1}:{},d:_.join(" ")}});if(f.length===0)return;f.some(i=>i.fill!==void 0||i.stroke===!1)&&v(n,"approximated","a:path@fill","a freeform's paths are drawn alike: filled and outlined");const g=f[0]?.w??0,c=f[0]?.h??0,r=g>0&&c>0&&f.every(i=>(i.w??0)===g&&(i.h??0)===c),u=r?g:a&&a.width>0?a.width:g>0?g:1,w=r?c:a&&a.height>0?a.height:c>0?c:1,p=te({av:l,gd:t,paths:f.map(i=>({d:i.d,...i.w?{w:i.w}:{},...i.h?{h:i.h}:{}}))},u,w),d=re(p.paths.map(i=>i.d).join(" "));return d?{w:u,h:w,steps:d}:void 0}function he(e,a,n){const o=new Map((a?.all("a:gd")??[]).map(s=>[s.attr("name")??"",s.attr("fmla")??""]));if(o.size===0)return;const l=ne(e);for(const s of o.keys())l.some(m=>m.name===s)||v(n,"unread","a:gd@name",`${e} has no adjustment ${s}`);return l.map(s=>{const m=o.get(s.name),f=m===void 0?NaN:Number(/^val\s+(-?[\d.]+)$/u.exec(m.trim())?.[1]);return m!==void 0&&Number.isNaN(f)&&v(n,"approximated","a:gd@fmla",`an adjustment by a formula (${m}) is the preset's own`),(Number.isNaN(f)?s.value:f)/1e5})}function C(e,a){const n=e?.attr("name")??"",o=e?.attr("id"),l=e?.attr("descr");e?.attr("hidden")===!0&&v(a,"cannot-hold","p:cNvPr@hidden","a shape hidden on its slide"),e?.attr("title")&&v(a,"cannot-hold","p:cNvPr@title","an alternative text's title");for(const s of["a:hlinkClick","a:hlinkHover"]){const m=e?.one(s);if(m?.attr("action")==="ppaction://media"){m.consume();continue}m&&(v(a,"cannot-hold",s,"a link on a whole shape"),m.consume())}return{name:n,...o===void 0?{}:{id:String(o)},...l?{alt:l}:{}}}export function shapesOf(e,a,n=q){const o=[];if(!e)return o;for(const l of e.kids())switch(l.key){case"p:nvGrpSpPr":case"p:grpSpPr":n===q&&l.consume();break;case"p:sp":o.push(...be(l,a,n));break;case"p:cxnSp":o.push(...ve(l,a,n));break;case"p:pic":o.push(...K(l,a,n));break;case"p:graphicFrame":o.push(...we(l,a,n));break;case"p:grpSp":o.push(...ye(l,a,n));break;case"p:contentPart":l.use(),v(a,"cannot-hold","p:contentPart","ink"),l.consume();break;default:break}return o}const $=(e,a,n)=>{const o=`${e.where} › "${n||"unnamed"}"`;return a.label(o),{...e,where:o}},me=["noGrp","noUngrp","noSelect","noChangeAspect","noEditPoints","noAdjustHandles","noChangeArrowheads","noChangeShapeType","noTextEdit","noCrop","noDrilldown"];function G(e,a){if(!e)return!1;const n=I(e),o=e.key!=="a:graphicFrameLocks",l=n.attr("noMove")===!0,t=n.attr("noResize")===!0,s=o&&n.attr("noRot")===!0;return n.ignore(me,"locks against editing in PowerPoint"),I(e).one("a:extLst")?.skip("a lock's extensions"),l&&t?!0:((l||t||s)&&v(a,"cannot-hold",`${e.key}@${[l&&"noMove",t&&"noResize",s&&"noRot"].filter(Boolean).join(",")}`,"a shape locked against some changes and not others: a deck locks moving, sizing and turning together"),!1)}const ge={};function be(e,a,n){e.use();const o=e.one("p:nvSpPr"),l=o?.one("p:cNvPr"),t=$(a,e,l?.el.attrs.find(x=>x.key==="name")?.value??""),s=C(l,t),m=o?.one("p:cNvSpPr");G(m?.one("a:spLocks"),t)&&(s.locked=!0);const f=m?.attr("txBox")===!0,g=o?.one("p:nvPr");g?.ignore(["isPhoto","userDrawn"],"a shape's origin in PowerPoint");const c=g?.one("p:ph"),r=e.one("p:spPr");r?.ignore(["bwMode"],"a shape's black and white printing mode");const u=D(r?.one("a:xfrm")),w=H(u&&n.place(u)),p=r?.one("a:prstGeom"),d=p?.attr("prst"),i=B(r,t),_=r?.one("a:ln"),b=W(_,t),S=r?.one("a:effectLst"),h=c||f?{}:V(e.one("p:style"),t),P=S?U(S,t):h.shadow;(c||f)&&e.one("p:style")?.skip("a placeholder's or a text box's style: its own properties are what it shows");const k=i?.group?n.fill:i;i?.group&&!n.fill&&v(t,"approximated","a:grpFill","a group's fill outside a group is none");const L=e.one("p:txBody"),N=c!==void 0&&!t.part.includes("/slides/")&&(c.attr("type")??"obj")!=="sldNum",A=L?le(L,c&&!t.part.includes("/slideMasters/")?ge:de,t,N):void 0,T={...s,kind:"autoshape",...w,...k?.fill!==void 0?{fill:k.fill}:k?.gradient?{}:c?{}:f?{fill:null}:h.fill!==void 0?{fill:h.fill}:h.gradient?{}:{fill:null},...(k?.fill_transparency??(k?void 0:h.fill_transparency))===void 0?{}:{fill_transparency:k?.fill_transparency??h.fill_transparency??0},...k?.gradient??(k?void 0:h.gradient)?{gradient:k?.gradient??h.gradient}:{},...P?{shadow:P}:{},...b.line!==void 0?{line:b.line}:c?{}:f?{}:{line:h.line??null},...(b.line_width??(c?void 0:h.line_width))===void 0?{}:{line_width:b.line_width??h.line_width},...(b.line_dash??h.line_dash)===void 0?{}:{line_dash:b.line_dash??h.line_dash},...(b.line_begin??h.line_begin)===void 0?{}:{line_begin:b.line_begin??h.line_begin},...(b.line_end??h.line_end)===void 0?{}:{line_end:b.line_end??h.line_end},...b.line_begin_size===void 0?{}:{line_begin_size:b.line_begin_size},...b.line_end_size===void 0?{}:{line_end_size:b.line_end_size},...h.text_color===void 0?{}:{text_color:h.text_color},...A?{text:A}:{},...n.group===void 0?{}:{group:n.group}};if(c){const x=c.attr("type")??"obj",z=c.attr("idx")??0;if(c.ignore(["hasCustomPrompt"],"a placeholder's own prompt text"),c.attr("orient")==="vert"&&v(t,"cannot-hold","p:ph@orient","a vertical placeholder"),c.attr("sz"),x==="sldImg"||x==="hdr")return[];const F=Z.has(x)?x:x==="clipArt"||x==="chart"||x==="tbl"||x==="dgm"?"obj":"body";return Z.has(x)||v(t,"approximated","p:ph@type",`a ${x} placeholder is a${F==="obj"?"n object":" body"} placeholder`),d!==void 0&&d!=="rect"?[{...T,kind:"placeholder",placeholder:{type:F,idx:z},geometry:d,...Y(d,p?.one("a:avLst"),t)}]:(p?.one("a:avLst"),[{...T,kind:"placeholder",placeholder:{type:F,idx:z}}])}const j=r?.one("a:custGeom"),M=j?ue(j,w.frame,t):void 0;j&&!M&&v(t,"approximated","a:custGeom","a freeform with no outline is a rectangle");const R=d!==void 0&&pe.has(d)?d:"rect";return[{...T,kind:f?"textbox":"autoshape",...M?{path:M}:{geometry:R},...d===void 0||M?{}:Y(d,p?.one("a:avLst"),t)}]}const Y=(e,a,n)=>{const o=he(e,a,n);return o?{adjustments:o}:{}};function ve(e,a,n){e.use();const o=e.one("p:nvCxnSpPr"),l=o?.one("p:cNvPr"),t=$(a,e,l?.el.attrs.find(S=>S.key==="name")?.value??""),s=C(l,t),m=o?.one("p:cNvCxnSpPr");G(m?.one("a:cxnSpLocks"),t)&&(s.locked=!0);const f={};for(const[S,h]of[["begin","a:stCxn"],["end","a:endCxn"]]){const P=m?.one(h);if(!P)continue;const k=P.attr("id"),L=P.attr("idx");k!==void 0&&L!==void 0&&(f[S]={id:String(k),site:L}),P.consume()}o?.one("p:nvPr");const g=e.one("p:spPr");g?.ignore(["bwMode"],"a shape's black and white printing mode");const c=D(g?.one("a:xfrm")),r=g?.one("a:prstGeom"),u=r?.attr("prst")??"line",w=Y(u,r?.one("a:avLst"),t),p=V(e.one("p:style"),t),d=W(g?.one("a:ln"),t),i=g?.one("a:effectLst"),_=i?U(i,t):p.shadow,b=ae(u);return b||v(t,"approximated","a:prstGeom@prst",`a connector of the ${u} preset is a shape of it with no fill`),[{...s,kind:"autoshape",geometry:u,...w,...H(c&&n.place(c)),...b?{}:{fill:null},line:d.line??p.line??null,...(d.line_width??p.line_width)===void 0?{}:{line_width:d.line_width??p.line_width},...(d.line_dash??p.line_dash)===void 0?{}:{line_dash:d.line_dash??p.line_dash},...(d.line_begin??p.line_begin)===void 0?{}:{line_begin:d.line_begin??p.line_begin},...(d.line_end??p.line_end)===void 0?{}:{line_end:d.line_end??p.line_end},...d.line_begin_size===void 0?{}:{line_begin_size:d.line_begin_size},...d.line_end_size===void 0?{}:{line_end_size:d.line_end_size},..._?{shadow:_}:{},...n.group===void 0?{}:{group:n.group},...f.begin||f.end?{glue:f}:{}}]}function K(e,a,n){e.use();const o=e.one("p:nvPicPr"),l=o?.one("p:cNvPr"),t=$(a,e,l?.el.attrs.find(y=>y.key==="name")?.value??""),s=C(l,t),m=o?.one("p:cNvPicPr");G(m?.one("a:picLocks"),t)&&(s.locked=!0),m?.attr("preferRelativeResize");const f=o?.one("p:nvPr");f?.ignore(["isPhoto","userDrawn"],"a shape's origin in PowerPoint");const g=f?.one("p:ph"),c=f?.one("a:videoFile"),r=f?.choice("a:audioFile","a:wavAudioFile","a:audioCd","a:quickTimeFile"),u=f?.one("p:extLst")?.all("p:ext").flatMap(y=>{const O=y.one("p14:media");return O?[O]:[]})[0],w=t.read.pkg,p=w.rel(t.part,u?.attr("r:embed"))??w.rel(t.part,c?.attr("r:link"));if(u){u.attr("r:link");for(const y of["p14:trim","p14:fade","p14:bmkLst"]){const O=u.one(y);O&&(v(t,"cannot-hold",y,y==="p14:trim"?"a video's trim":y==="p14:fade"?"a video's fade in and out":"a video's bookmarks"),O.consume())}}r&&(v(t,"cannot-hold",r.key,"a sound"),r.consume());const d=e.one("p:blipFill");d?.ignore(["dpi","rotWithShape"],"a picture's resolution and turning with its fill");const i=d?.one("a:blip");i?.ignore(["cstate"],"a picture's compression state");const _=i?.one("a:extLst")?.all("a:ext").flatMap(y=>{const O=y.one("asvg:svgBlip");return y.one("a14:useLocalDpi")?.skip("a picture kept at its own resolution"),O?[O]:[]})[0],b=w.rel(t.part,_?.attr("r:embed"))??w.rel(t.part,i?.attr("r:embed"));i?.attr("r:link")&&v(t,"missing","a:blip@r:link","a picture linked from outside the file");for(const y of i?.kids()??[])y.key!=="a:extLst"&&(y.use(),v(t,"cannot-hold",y.key,"a picture's own effect (transparency, recolouring, brightness)"),y.consume());const h=d?.one("a:srcRect"),P=y=>(h?.attr(y)??0)/1e5,k=h?{left:P("l"),top:P("t"),right:P("r"),bottom:P("b")}:void 0;d?.one("a:stretch")?.consume();const L=d?.one("a:tile");L&&(v(t,"cannot-hold","a:tile","a picture tiled in its frame"),L.consume());const N=e.one("p:spPr");N?.ignore(["bwMode"],"a shape's black and white printing mode");const A=D(N?.one("a:xfrm")),T=N?.one("a:prstGeom"),j=T?.attr("prst");T?.one("a:avLst"),j!==void 0&&j!=="rect"&&v(t,"cannot-hold","a:prstGeom@prst",`a picture cut to a ${j}`);const M=N?.one("a:ln");M&&W(M,t).line&&v(t,"cannot-hold","p:pic/a:ln","a picture's outline");const R=U(N?.one("a:effectLst"),t),x=B(N,t);(x?.fill||x?.gradient)&&v(t,"cannot-hold","p:pic/p:spPr","a fill behind a picture"),e.one("p:style")?.skip("a picture's style");const z=c!==void 0||u!==void 0&&!r,E=z?p:b;if(!E||E.external)return v(t,"missing","p:pic","a picture or a video whose file is not in the file"),[];w.bytes(E.target),z&&(b&&w.bytes(b.target),c?.attr("r:link"));const F=s.alt!==void 0&&/^[^\s/\\]+\.[A-Za-z0-9]{2,5}$/u.test(s.alt);F&&l?.ignore(["descr"],"a picture's file name as its description (python-pptx's habit)");const J=s.alt===void 0||F?{}:{alt:s.alt};return[{name:s.name,...s.id===void 0?{}:{id:s.id},...s.locked?{locked:!0}:{},...J,kind:z?"movie":"picture",...g?{placeholder:{type:g.attr("type")??"pic",idx:g.attr("idx")??0}}:{},...H(A&&n.place(A)),part:E.target,...k&&!z?{crop:k}:{},...R?{shadow:R}:{},...n.group===void 0?{}:{group:n.group}}]}function we(e,a,n){e.use();const o=e.one("p:nvGraphicFramePr"),l=o?.one("p:cNvPr"),t=$(a,e,l?.el.attrs.find(p=>p.key==="name")?.value??""),s=C(l,t);G(o?.one("p:cNvGraphicFramePr")?.one("a:graphicFrameLocks"),t)&&(s.locked=!0);const m=o?.one("p:nvPr")?.one("p:ph");m&&(v(t,"approximated","p:ph","a table, a chart or an object in a placeholder is the slide's own, its placeholder left empty"),m.consume()),e.ignore(["bwMode"],"a shape's black and white printing mode");const f=D(e.one("p:xfrm")),g=H(f&&n.place(f)),c=e.one("a:graphic")?.one("a:graphicData"),r=c?.attr("uri")??"",u={...s,...g,...n.group===void 0?{}:{group:n.group}};if(r.endsWith("/table")){const p=c?.one("a:tbl");if(p)return[{...u,kind:"table",table:ce(p.use(),t)}]}if(r.endsWith("/chart")){const p=c?.one("c:chart");p?.use();const d=t.read.pkg.rel(t.part,p?.attr("r:id")),i=d?se(d.target,t):"its chart is not in the file";return typeof i=="string"?(v(t,"cannot-hold","c:chart",i),[]):[{...u,kind:"chart",chart:i}]}if(r.endsWith("/diagram"))return v(t,"cannot-hold","dgm:relIds","SmartArt"),c?.consume(),[];const w=c?.one("p:oleObj");if(w){w.use(),v(t,"approximated","p:oleObj",`an embedded ${w.attr("progId")??"object"} is its picture`),w.ignore(["spid","name","showAsIcon","r:id","imgW","imgH","progId"],"an embedded object's program and size"),w.one("p:embed")?.consume(),w.one("p:link")?.consume();const p=w.one("p:pic");if(p){const[i]=K(p,a,n);return i?[{...i,...s,...g,kind:"picture"}]:[]}const d=_e(w.el.attrs.find(i=>i.key==="spid")?.value,t);return d?[{...u,kind:"picture",part:d}]:(v(t,"missing","p:oleObj","an embedded object whose picture is not in the file"),[])}return v(t,"cannot-hold","a:graphicData",r||"a graphic frame"),c?.consume(),[]}const Q="urn:schemas-microsoft-com:vml",X="urn:schemas-microsoft-com:office:office";function _e(e,a){const n=a.read.pkg,o=n.relOfType(a.part,"vmlDrawing")?.target,l=o===void 0?void 0:n.bytes(o);if(o===void 0||!l||e===void 0)return;let t;try{t=oe(ie(l))}catch{return}const s=(r,u,w)=>r.attrs.find(p=>p.uri===u&&p.local===w)?.value,m=r=>[r,...r.children.flatMap(m)],g=m(t).find(r=>r.uri===Q&&(s(r,"","id")===e||s(r,X,"spid")===e))?.children.find(r=>r.uri===Q&&r.local==="imagedata"),c=n.rel(o,g&&s(g,X,"relid"));if(!(!c||c.external||!n.bytes(c.target)))return c.target}function ye(e,a,n){e.use();const o=e.one("p:nvGrpSpPr"),l=o?.one("p:cNvPr"),t=$(a,e,l?.el.attrs.find(u=>u.key==="name")?.value??""),s=C(l,t),m=G(o?.one("p:cNvGrpSpPr")?.one("a:grpSpLocks"),t);o?.one("p:nvPr");const f=e.one("p:grpSpPr");f?.ignore(["bwMode"],"a shape's black and white printing mode");const g=B(f,t),c=f?.one("a:effectLst");c&&(v(t,"cannot-hold","p:grpSpPr/a:effectLst","a group's own effects"),c.consume()),n.group!==void 0&&v(t,"approximated","p:grpSp",`a group in a group is one group, ${n.group}`);const r=shapesOf(e,t,{...g?{fill:g}:n.fill?{fill:n.fill}:{},group:n.group??s.name,place:fe(f?.one("a:xfrm"),n)});return m?r.map(u=>({...u,locked:!0})):r}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{NUMBERINGS as _}from"@allyhub/formats";import{colorIn as v}from"@allyhub/ooxml";import{TEXT_INSETS as x}from"@allyhub/slides-core";import{colorAt as w,say as
|
|
2
|
+
import{NUMBERINGS as _}from"@allyhub/formats";import{colorIn as v}from"@allyhub/ooxml";import{TEXT_INSETS as x}from"@allyhub/slides-core";import{colorAt as w,say as i}from"./common.js";export function fontOf(t,a){if(!t)return;const n={},c=t.attr("sz");c!==void 0&&(n.size=c*127);const r=t.attr("b");r!==void 0&&(n.bold=r);const o=t.attr("i");o!==void 0&&(n.italic=o);const f=t.attr("u");f!==void 0&&(n.underline=f!=="none",f!=="none"&&f!=="sng"&&i(a,"approximated","a:rPr@u",`${f} underline is a single line`));const s=t.attr("strike");s!==void 0&&(n.strike=s!=="noStrike",s==="dblStrike"&&i(a,"approximated","a:rPr@strike","a double strike is one line"));const l=t.attr("baseline");l!==void 0&&l!==0&&(n.baseline=l/1e5);const d=t.attr("spc");d!==void 0&&(n.spacing=d*127);const h=t.attr("cap");h!==void 0&&h!=="none"&&i(a,"cannot-hold","a:rPr@cap",`${h} capitals`),t.ignore(["lang","altLang"],"a run's language: a deck's is its script's"),t.ignore(["noProof","dirty","err","smtClean","smtId","bmk"],"spell-check and editing state"),t.ignore(["kern"],"kerning from a size: the stage kerns as the browser does (PowerPoint's own is not measured here)");const p=t.choice("a:solidFill","a:noFill","a:gradFill");if(p?.key==="a:solidFill"){const u=w(p,a,"a:rPr/a:solidFill");u&&(n.color=u.color,u.alpha<1&&i(a,"cannot-hold","a:rPr/a:alpha","text's transparency"))}else p&&(i(a,"cannot-hold",`a:rPr/${p.key}`,p.key==="a:noFill"?"text with no fill":"text filled with a gradient"),p.consume());const m=v(t.one("a:highlight"),a.colors);m&&(n.highlight=m.rgb);const e=t.one("a:latin");if(e){e.ignore(["panose","pitchFamily","charset"],"a font's panose, pitch and character set: its name picks it");const u=e.attr("typeface");u&&(n.name=u)}for(const u of["a:ea","a:cs","a:sym"]){const k=t.one(u);if(!k)continue;k.ignore(["panose","pitchFamily","charset"],"a font's panose, pitch and character set: its name picks it");const P=k.attr("typeface");P&&!P.startsWith("+")&&!a.read.faces.has(P)&&i(a,"cannot-hold",u,`a run's own ${u==="a:ea"?"East Asian":u==="a:cs"?"complex script":"symbol"} face (${P})`)}const g=t.one("a:hlinkClick");if(g){const u=g.attr("action"),k=a.read.pkg.rel(a.part,g.attr("r:id"));k?.external&&(u===void 0||u==="")?n.link=k.target:u!==void 0&&u!==""?i(a,"cannot-hold","a:hlinkClick@action",u):g.attr("r:id")!==""&&i(a,"missing","a:hlinkClick","a link whose target is not in the file"),g.ignore(["tooltip","history","highlightClick","endSnd","tgtFrame","invalidUrl"],"a link's tooltip and browser settings")}t.one("a:uLnTx"),t.one("a:uFillTx");const b=t.one("a:effectLst");return b&&b.el.children.length>0&&(i(a,"cannot-hold","a:rPr/a:effectLst","text effects (shadow, glow)"),b.consume()),Object.keys(n).length>0?n:void 0}function y(t){const a=t?.one("a:spcPct")?.attr("val");if(a!==void 0)return{lines:a/1e5};const n=t?.one("a:spcPts")?.attr("val");if(n!==void 0)return{fixed:n*127}}function A(t){return t.startsWith("alphaLc")?"alphaLcPeriod":t.startsWith("alphaUc")?"alphaUcPeriod":t.startsWith("romanLc")?"romanLcPeriod":t.startsWith("romanUc")?"romanUcPeriod":t==="arabicParenR"||t==="arabicParenBoth"?"arabicParenR":"arabicPeriod"}export function formatOf(t,a){if(!t)return{};const n={},c=t.attr("algn");c==="l"||c==="ctr"||c==="r"||c==="just"?n.alignment=c:c!==void 0&&(n.alignment="just",i(a,"approximated","a:pPr@algn",`${c} is justified`));const r=t.attr("marL");r!==void 0&&(n.margin_left=r);const o=t.attr("indent");o!==void 0&&(n.indent=o);const f=t.attr("marR");f!==void 0&&f!==0&&i(a,"cannot-hold","a:pPr@marR","a paragraph's right margin");const s=y(t.one("a:lnSpc"));s&&(n.line_spacing=s);for(const[e,g]of[["a:spcBef","space_before"],["a:spcAft","space_after"]]){const b=y(t.one(e));b&&"fixed"in b&&(n[g]=b.fixed)}t.has("a:buNone")&&(n.bullet=null);const l=t.one("a:buChar")?.attr("char");l!==void 0&&(n.bullet=l);const d=t.one("a:buFont");if(d){d.ignore(["panose","pitchFamily","charset"],"a font's panose, pitch and character set: its name picks it");const e=d.attr("typeface");e!==void 0&&(n.bullet_font=e)}const h=t.one("a:buAutoNum");if(h){const e=h.attr("type")??"arabicPeriod";_.includes(e)?n.numbered=e:(n.numbered=A(e),i(a,"approximated","a:buAutoNum@type",`${e} is counted as ${n.numbered}`));const g=h.attr("startAt");g!==void 0&&g!==1&&i(a,"cannot-hold","a:buAutoNum@startAt",`a list counted from ${String(g)}`)}for(const e of["a:buClrTx","a:buSzTx","a:buFontTx"])t.one(e);for(const e of["a:buClr","a:buSzPct","a:buSzPts","a:buBlip"]){const g=t.one(e);g&&(i(a,"cannot-hold",e,e==="a:buClr"?"a bullet's own colour":e==="a:buBlip"?"a picture as a bullet":"a bullet's own size"),g.consume())}t.ignore(["eaLnBrk","latinLnBrk","hangingPunct","fontAlgn"],"line-breaking and alignment rules for East Asian text: the stage breaks lines as the browser does"),t.ignore(["defTabSz"],"a default tab stop");const p=t.one("a:tabLst");p&&p.el.children.length>0&&(i(a,"cannot-hold","a:tabLst","tab stops"),p.consume()),t.attr("rtl")===!0&&i(a,"cannot-hold","a:pPr@rtl","a right-to-left paragraph");const m=fontOf(t.one("a:defRPr"),a);m&&(n.font=m);for(const[e,g]of[["a:spcBef","space_before"],["a:spcAft","space_after"]]){const b=t.one(e)?.one("a:spcPct")?.attr("val");b!==void 0&&(m?.size!==void 0?(n[g]=Math.round(b/1e5*m.size*1.2),i(a,"approximated",`${e}/a:spcPct`,"space between paragraphs as a share of a line is points at the level's size")):i(a,"cannot-hold",`${e}/a:spcPct`,"space between paragraphs as a share of a line"))}return n}const L=["a:lvl1pPr","a:lvl2pPr","a:lvl3pPr","a:lvl4pPr","a:lvl5pPr","a:lvl6pPr","a:lvl7pPr","a:lvl8pPr","a:lvl9pPr"];export function levelsOf(t,a){const n=formatOf(t?.one("a:defPPr"),a);return L.map(c=>{const r=t?.one(c);r?.attr("lvl");const o=formatOf(r,a);return Object.keys(n).length===0?o:{...n,...o,...n.font||o.font?{font:{...n.font,...o.font}}:{}}})}export function paragraphsOf(t,a){return(t?.all("a:p")??[]).map(n=>{const c=n.one("a:pPr"),r=[];let o;for(const s of n.kids())if(s.key==="a:r"){const l=s.use(),d=fontOf(l.one("a:rPr"),a);r.push({text:l.one("a:t")?.text()??"",...d?{font:d}:{}})}else if(s.key==="a:br")s.use(),s.one("a:rPr")?.skip("a line break's font"),r.push({text:"\v"});else if(s.key==="a:fld"){const l=s.use();l.attr("id");const d=l.attr("type")??"",h=fontOf(l.one("a:rPr"),a),p=l.one("a:pPr");p&&(p.el.attrs.length>0||p.el.children.length>0)&&i(a,"cannot-hold","a:fld/a:pPr","a field's own paragraph properties");const m=l.one("a:t")?.text()??"";d!=="slidenum"&&i(a,"cannot-hold","a:fld@type",`${d||"a field"}: kept as the text it showed`),r.push({text:m,...h?{font:h}:{},...d==="slidenum"?{field:"slidenum"}:{}})}else s.key==="a:endParaRPr"&&(r.length===0?o=fontOf(s.use(),a):s.skip("the font of a paragraph's end"));const f=formatOf(c,a);return{...f,...o?{font:{...f.font,...o}}:{},runs:r,level:c?.attr("lvl")??0}})}export const BODY_DEFAULTS={vertical_anchor:"t",word_wrap:!0,auto_size:"none",margin_left:x.left,margin_top:x.top,margin_right:x.right,margin_bottom:x.bottom};export function bodyOf(t,a,n,c=!1){const r=t?.one("a:bodyPr");if(c)for(const h of t?.all("a:p")??[])h.skip("a master's or a layout's placeholder's prompt text");const o={...a,levels:levelsOf(t?.one("a:lstStyle"),n),paragraphs:c?[]:paragraphsOf(t,n)},f=r?.attr("anchor");f==="t"||f==="ctr"||f==="b"?o.vertical_anchor=f:f!==void 0&&(o.vertical_anchor="t",i(n,"approximated","a:bodyPr@anchor",`${f} is at the top`));const s=r?.attr("wrap");s!==void 0&&(o.word_wrap=s!=="none");const l=r?.choice("a:normAutofit","a:spAutoFit","a:noAutofit");l?.key==="a:normAutofit"?(o.auto_size="text",l.ignore(["fontScale","lnSpcReduction"],"the share PowerPoint last shrank text to: the stage fits it again")):l?.key==="a:spAutoFit"?o.auto_size="shape":l&&(o.auto_size="none");for(const[h,p]of[["lIns","margin_left"],["tIns","margin_top"],["rIns","margin_right"],["bIns","margin_bottom"]]){const m=r?.attr(h);m!==void 0&&(o[p]=m)}r?.ignore(["forceAA","compatLnSpc"],"rendering hints of a text body");const d=r?.attr("vert");return d!==void 0&&d!=="horz"&&i(n,"cannot-hold","a:bodyPr@vert",`${d} text`),r?.attr("rtlCol")===!0&&i(n,"cannot-hold","a:bodyPr@rtlCol","columns right to left"),o}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{presetAdjustments as k}from"@allyhub/ooxml/geometry";import{NS as
|
|
2
|
+
import{presetAdjustments as k}from"@allyhub/ooxml/geometry";import{NS as o,effects as m,el as n,fill as g,gradientFill as b}from"./xml.js";export const LOCKED={noMove:1,noResize:1,noRot:1};const h=e=>e.locked?LOCKED:{},u=(e,r={})=>n("a:xfrm",{rot:r.rotation===void 0?void 0:Math.round(r.rotation*6e4),flipH:r.flip?.h?1:void 0,flipV:r.flip?.v?1:void 0},n("a:off",{x:e.left,y:e.top}),n("a:ext",{cx:e.width,cy:e.height})),x=(e,r)=>{const i=k(e);return n("a:prstGeom",{prst:e},n("a:avLst",{},...(r??[]).flatMap((a,c)=>{const p=i[c]?.name;return p===void 0?[]:[n("a:gd",{name:p,fmla:`val ${String(Math.round(a*1e5))}`})]})))};function w(e,r){const i=e.steps.every(t=>t.op==="close"?!0:t.op==="curve"?[t.x1,t.y1,t.x2,t.y2,t.x,t.y].every(Number.isInteger):Number.isInteger(t.x)&&Number.isInteger(t.y)),[a,c]=i||!r?[1,1]:[e.w===0?1:r.width/e.w,e.h===0?1:r.height/e.h],p=(t,d)=>n("a:pt",{x:Math.round(t*a),y:Math.round(d*c)}),f=e.steps.map(t=>t.op==="close"?n("a:close"):t.op==="move"?n("a:moveTo",{},p(t.x,t.y)):t.op==="line"?n("a:lnTo",{},p(t.x,t.y)):n("a:cubicBezTo",{},p(t.x1,t.y1),p(t.x2,t.y2),p(t.x,t.y)));return n("a:custGeom",{},n("a:avLst"),n("a:gdLst"),n("a:ahLst"),n("a:cxnLst"),n("a:rect",{l:"l",t:"t",r:"r",b:"b"}),n("a:pathLst",{},n("a:path",{w:Math.round(e.w*a),h:Math.round(e.h*c)},...f)))}const v=e=>e.line===void 0&&e.lineWidth===void 0&&e.lineDash===void 0&&e.lineBegin===void 0&&e.lineEnd===void 0?"":n("a:ln",{w:e.lineWidth},e.line===void 0?"":g(e.line),e.lineDash===void 0?"":n("a:prstDash",{val:e.lineDash}),e.lineBegin===void 0?"":n("a:headEnd",{type:e.lineBegin,...e.lineBeginSize}),e.lineEnd===void 0?"":n("a:tailEnd",{type:e.lineEnd,...e.lineEndSize})),l=(e,r,i)=>n(e,{idx:r},n("a:schemeClr",{val:i})),y={shape:n("p:style",{},l("a:lnRef",1,"accent1"),l("a:fillRef",3,"accent1"),l("a:effectRef",2,"accent1"),l("a:fontRef","minor","lt1")),connector:n("p:style",{},l("a:lnRef",2,"accent1"),l("a:fillRef",0,"accent1"),l("a:effectRef",1,"accent1"),l("a:fontRef","minor","tx1"))},M=e=>n("p:ph",{type:e.type==="obj"?void 0:e.type,idx:e.idx===0?void 0:e.idx,sz:e.sz}),P=(e,r="")=>n("p:nvPr",{},e.placeholder?M(e.placeholder):"",r);export function shapeXml(e){if(e.kind==="table"||e.kind==="chart")return n("p:graphicFrame",{},n("p:nvGraphicFramePr",{},n("p:cNvPr",{id:e.id,name:e.name,descr:e.descr}),n("p:cNvGraphicFramePr",{},n("a:graphicFrameLocks",{noGrp:1,...e.locked?{noMove:1,noResize:1}:{}})),n("p:nvPr")),n("p:xfrm",{},n("a:off",{x:e.frame?.left??0,y:e.frame?.top??0}),n("a:ext",{cx:e.frame?.width??0,cy:e.frame?.height??0})),n("a:graphic",{},n("a:graphicData",{uri:`http://schemas.openxmlformats.org/drawingml/2006/${e.kind}`},e.kind==="table"?e.table??"":n("c:chart",{"xmlns:c":"http://schemas.openxmlformats.org/drawingml/2006/chart","xmlns:r":o.r,"r:id":e.chart??""}))));if(e.kind==="cxn")return n("p:cxnSp",{},n("p:nvCxnSpPr",{},n("p:cNvPr",{id:e.id,name:e.name,descr:e.descr}),n("p:cNvCxnSpPr",{},e.locked?n("a:cxnSpLocks",h(e)):"",e.connect?.begin?n("a:stCxn",e.connect.begin):"",e.connect?.end?n("a:endCxn",e.connect.end):""),n("p:nvPr")),n("p:spPr",{},e.frame?u(e.frame,e):"",x(e.geometry??"line",e.adjustments),v(e),e.shadow===void 0?"":m(e.shadow)),e.style?y[e.style]:"");if(e.kind==="pic"){const i=e.video;return n("p:pic",{},n("p:nvPicPr",{},n("p:cNvPr",{id:e.id,name:e.name,descr:e.descr},i?n("a:hlinkClick",{"r:id":"",action:"ppaction://media"}):""),n("p:cNvPicPr",{},n("a:picLocks",{noChangeAspect:1,...h(e)})),P(e,i?n("a:videoFile",{"r:link":i.link})+n("p:extLst",{},n("p:ext",{uri:"{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}"},n("p14:media",{"xmlns:p14":o.p14,"r:embed":i.media}))):"")),n("p:blipFill",{},n("a:blip",{"r:embed":e.picture?.image}),e.picture?.crop?n("a:srcRect",{l:s(e.picture.crop.left),t:s(e.picture.crop.top),r:s(e.picture.crop.right),b:s(e.picture.crop.bottom)}):"",n("a:stretch",{},n("a:fillRect"))),n("p:spPr",{},e.frame?u(e.frame,e):"",x("rect"),e.shadow===void 0?"":m(e.shadow)))}const r=e.placeholder||e.locked?n("a:spLocks",{...e.placeholder?{noGrp:1}:{},...h(e)}):"";return n("p:sp",{},n("p:nvSpPr",{},n("p:cNvPr",{id:e.id,name:e.name,descr:e.descr}),n("p:cNvSpPr",{txBox:e.textbox?1:void 0},r),P(e)),n("p:spPr",{},e.frame?u(e.frame,e):"",e.path?w(e.path,e.frame):e.geometry?x(e.geometry,e.adjustments):"",e.gradient?b(e.gradient):e.fill===void 0?"":g(e.fill,e.fillTransparency),v(e),e.shadow===void 0?"":m(e.shadow)),e.style?y[e.style]:"",e.text??"")}function S(e,r,i){const a=i.flatMap(d=>d.frame?[d.frame]:[]),c=Math.min(...a.map(d=>d.left)),p=Math.min(...a.map(d=>d.top)),f=Math.max(...a.map(d=>d.left+d.width))-c,t=Math.max(...a.map(d=>d.top+d.height))-p;return n("p:grpSp",{},n("p:nvGrpSpPr",{},n("p:cNvPr",{id:e,name:r}),n("p:cNvGrpSpPr"),n("p:nvPr")),n("p:grpSpPr",{},n("a:xfrm",{},n("a:off",{x:c,y:p}),n("a:ext",{cx:f,cy:t}),n("a:chOff",{x:c,y:p}),n("a:chExt",{cx:f,cy:t}))),...i.map(shapeXml))}export function treeXml(e){const r=[];let i=Math.max(0,...e.map(a=>a.id));for(let a=0;a<e.length;a++){const c=e[a];if(!c)continue;if(c.group===void 0){r.push(shapeXml(c));continue}const p=[c];for(;e[a+1]?.group===c.group;){const f=e[++a];f&&p.push(f)}r.push(S(++i,c.group,p))}return r}const s=e=>e===0?void 0:Math.round(e*1e5);export const NO_PARAGRAPHS=[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{runLang as _}from"@allyhub/slides-core";import{face as h}from"./theme.js";import{centipoints as c,color as y,el as t,esc as m,fill as P}from"./xml.js";const v={t:"t",ctr:"ctr",b:"b"},x={"+mj-lt":"+mj-ea","+mn-lt":"+mn-ea"};export const LINK="link:";export function runProps(e,n,a){const r=n?.color===void 0?"":P(n.color),i=n?.name===void 0?void 0:x[n.name];return t(e,{lang:a,sz:n?.size===void 0?void 0:c(n.size),b:n?.bold,i:n?.italic,u:n?.underline===void 0?void 0:n.underline?"sng":"none",strike:n?.strike===void 0?void 0:n.strike?"sngStrike":"noStrike",baseline:n?.baseline===void 0?void 0:Math.round(n.baseline*1e5),spc:n?.spacing===void 0?void 0:c(n.spacing)},r,n?.highlight===void 0?"":t("a:highlight",{},y({rgb:n.highlight})),n?.name===void 0?"":t("a:latin",{typeface:h(n.name)}),i===void 0?"":t("a:ea",{typeface:i}),n?.link===void 0?"":t("a:hlinkClick",{"r:id":`${LINK}${n.link}`}))}function b(e,n){const a=e.line_spacing;return{attrs:{marL:e.margin_left,indent:e.indent,algn:e.alignment},children:[a===void 0?"":t("a:lnSpc",{},"lines"in a?t("a:spcPct",{val:Math.round(a.lines*1e5)}):t("a:spcPts",{val:c(a.fixed)})),e.space_before===void 0?"":t("a:spcBef",{},t("a:spcPts",{val:c(e.space_before)})),e.space_after===void 0?"":t("a:spcAft",{},t("a:spcPts",{val:c(e.space_after)})),e.bullet_font===void 0?"":t("a:buFont",{typeface:e.bullet_font}),e.numbered!==void 0?t("a:buAutoNum",{type:e.numbered}):e.bullet===void 0?"":e.bullet===null?t("a:buNone"):t("a:buChar",{char:e.bullet}),n&&e.font&&Object.keys(e.font).length>0?runProps("a:defRPr",e.font):""]}}export function listStyle(e,n="a:lstStyle"){const a=e.slice(0,9).flatMap((r,i)=>{const{attrs:l,children:o}=b(r,!0),d=o.join("");return d===""&&Object.values(l).every(u=>u===void 0)?[]:[t(`a:lvl${String(i+1)}pPr`,l,d)]});return t(n,{},...a)}export function levelOf(e){return{alignment:e.alignment,line_spacing:e.line_spacing,space_before:e.space_before,space_after:e.space_after,...e.numbered===void 0?{bullet:e.bullet?e.bullet.char:null}:{numbered:e.numbered},...e.bullet?.font===void 0?{}:{bullet_font:e.bullet.font},margin_left:e.margin_left,indent:e.indent,font:e.font}}export function bodyProps(e,n,a={}){const r=n!==void 0?t("a:normAutofit",{fontScale:Math.round(n*1e5)}):e.auto_size==="text"?t("a:normAutofit"):e.auto_size==="shape"?t("a:spAutoFit"):e.auto_size==="none"?t("a:noAutofit"):"";return t("a:bodyPr",{wrap:e.word_wrap===void 0?void 0:e.word_wrap?"square":"none",lIns:e.margin_left,tIns:e.margin_top,rIns:e.margin_right,bIns:e.margin_bottom,anchor:e.vertical_anchor===void 0?void 0:v[e.vertical_anchor],...a},r)}export const bodyOfStyle=e=>({vertical_anchor:e.vertical_anchor,auto_size:e.auto_size,word_wrap:e.word_wrap,margin_left:e.margins.left,margin_top:e.margins.top,margin_right:e.margins.right,margin_bottom:e.margins.bottom}),bodyUnder=(e,n)=>n?.anchor===void 0?e:{...e,vertical_anchor:n.anchor};const A="{B6F15528-21DE-4FAA-801E-634DDDAF4B2B}";export const SLIDE_NUMBER=[{level:0,runs:[{text:"‹#›",field:"slidenum"}]}];export function paragraph(e,n,a){const r={...e,...a?.paragraph,...a?.levels?.[e.level]};a?.paragraph.bullet!==void 0&&delete r.numbered,(a?.paragraph.bullet!==void 0||a?.paragraph.numbered!==void 0)&&delete r.bullet_font;const{attrs:i,children:l}=b(r,!1),o=t("a:pPr",{...i,lvl:e.level>0?e.level:void 0},...l),d=e.runs.flatMap(s=>s.text.split("\v").flatMap((u,g)=>{const p={...e.font,...a?.font,...s.font},f=runProps("a:rPr",Object.keys(p).length>0?p:void 0,_(u,n));return[...g>0?[t("a:br",{},runProps("a:rPr",void 0,n))]:[],...u===""?[]:[s.field?t("a:fld",{id:A,type:s.field},f,t("a:t",{},m(u))):t("a:r",{},f,t("a:t",{},m(u)))]]}));return t("a:p",{},o==="<a:pPr/>"?"":o,...d,d.length===0?runProps("a:endParaRPr",a?.font,n):"")}export function txBody(e,n,a,r,i,l){const o=r.map(d=>paragraph(d,i,l));return t(e,{},n,a,...o.length>0?o:[t("a:p")])}
|
|
2
|
+
import{runLang as _}from"@allyhub/slides-core";import{face as h}from"./theme.js";import{centipoints as c,color as y,el as t,esc as m,fill as P}from"./xml.js";const v={t:"t",ctr:"ctr",b:"b"},x={"+mj-lt":"+mj-ea","+mn-lt":"+mn-ea"};export const LINK="link:";export function runProps(e,n,a){const r=n?.color===void 0?"":P(n.color),i=n?.name===void 0?void 0:x[n.name];return t(e,{lang:a,sz:n?.size===void 0?void 0:c(n.size),b:n?.bold,i:n?.italic,u:n?.underline===void 0?void 0:n.underline?"sng":"none",strike:n?.strike===void 0?void 0:n.strike?"sngStrike":"noStrike",baseline:n?.baseline===void 0?void 0:Math.round(n.baseline*1e5),spc:n?.spacing===void 0?void 0:c(n.spacing)},r,n?.highlight===void 0?"":t("a:highlight",{},y({rgb:n.highlight})),n?.name===void 0?"":t("a:latin",{typeface:h(n.name)}),i===void 0?"":t("a:ea",{typeface:i}),n?.link===void 0?"":t("a:hlinkClick",{"r:id":`${LINK}${n.link}`}))}function b(e,n){const a=e.line_spacing;return{attrs:{marL:e.margin_left,indent:e.indent,algn:e.alignment},children:[a===void 0?"":t("a:lnSpc",{},"lines"in a?t("a:spcPct",{val:Math.round(a.lines*1e5)}):t("a:spcPts",{val:c(a.fixed)})),e.space_before===void 0?"":t("a:spcBef",{},t("a:spcPts",{val:c(e.space_before)})),e.space_after===void 0?"":t("a:spcAft",{},t("a:spcPts",{val:c(e.space_after)})),e.bullet_font===void 0?"":t("a:buFont",{typeface:e.bullet_font}),e.numbered!==void 0?t("a:buAutoNum",{type:e.numbered}):e.bullet===void 0?"":e.bullet===null?t("a:buNone"):t("a:buChar",{char:e.bullet}),n&&e.font&&Object.keys(e.font).length>0?runProps("a:defRPr",e.font):""]}}export function listStyle(e,n="a:lstStyle"){const a=e.slice(0,9).flatMap((r,i)=>{const{attrs:l,children:o}=b(r,!0),d=o.join("");return d===""&&Object.values(l).every(u=>u===void 0)?[]:[t(`a:lvl${String(i+1)}pPr`,l,d)]});return t(n,{},...a)}export function levelOf(e){return{alignment:e.alignment,line_spacing:e.line_spacing,space_before:e.space_before,space_after:e.space_after,...e.numbered===void 0?{bullet:e.bullet?e.bullet.char:null}:{numbered:e.numbered},...e.bullet?.font===void 0?{}:{bullet_font:e.bullet.font},margin_left:e.margin_left,indent:e.indent,font:e.font}}export function bodyProps(e,n,a={}){const r=n!==void 0?t("a:normAutofit",{fontScale:Math.round(n*1e5)}):e.auto_size==="text"?t("a:normAutofit"):e.auto_size==="shape"?t("a:spAutoFit"):e.auto_size==="none"?t("a:noAutofit"):"";return t("a:bodyPr",{wrap:e.word_wrap===void 0?void 0:e.word_wrap?"square":"none",lIns:e.margin_left,tIns:e.margin_top,rIns:e.margin_right,bIns:e.margin_bottom,anchor:e.vertical_anchor===void 0?void 0:v[e.vertical_anchor],...a},r)}export const bodyOfStyle=e=>({vertical_anchor:e.vertical_anchor,auto_size:e.auto_size,word_wrap:e.word_wrap,margin_left:e.margins.left,margin_top:e.margins.top,margin_right:e.margins.right,margin_bottom:e.margins.bottom}),bodyUnder=(e,n)=>n?.anchor===void 0?e:{...e,vertical_anchor:n.anchor};const A="{B6F15528-21DE-4FAA-801E-634DDDAF4B2B}";export const SLIDE_NUMBER=[{level:0,runs:[{text:"‹#›",field:"slidenum"}]}];export function paragraph(e,n,a){const r={...e,...a?.paragraph,...a?.levels?.[e.level]};a?.paragraph.bullet!==void 0&&delete r.numbered,(a?.paragraph.bullet!==void 0||a?.paragraph.numbered!==void 0)&&delete r.bullet_font;const{attrs:i,children:l}=b(r,!1),o=t("a:pPr",{...i,lvl:e.level>0?e.level:void 0},...l),d=e.runs.flatMap(s=>s.text.split("\v").flatMap((u,g)=>{const p={...e.font,...a?.font,...s.font},f=runProps("a:rPr",Object.keys(p).length>0?p:void 0,_(u,n));return[...g>0?[t("a:br",{},runProps("a:rPr",void 0,n))]:[],...u===""?[]:[s.field?t("a:fld",{id:A,type:s.field},f,t("a:t",{},m(u))):t("a:r",{},f,t("a:t",{},m(u)))]]}));return t("a:p",{},o==="<a:pPr/>"?"":o,...d,d.length===0?runProps("a:endParaRPr",{...e.font,...a?.font},n):"")}export function txBody(e,n,a,r,i,l){const o=r.map(d=>paragraph(d,i,l));return t(e,{},n,a,...o.length>0?o:[t("a:p")])}
|