allyhub 0.5.0 → 0.7.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/dist/audio-text.js +1 -1
- package/dist/commands/add.js +2 -2
- package/dist/commands/cloud-tools.js +5 -5
- package/dist/commands/dev.js +1 -1
- package/dist/commands/frames/piece.js +1 -1
- package/dist/commands/frames/sheet.js +1 -1
- package/dist/commands/frames.js +8 -8
- package/dist/commands/index.js +1 -1
- package/dist/commands/inspect/common.js +1 -1
- package/dist/commands/inspect/layout.js +1 -1
- package/dist/commands/render.js +1 -1
- package/dist/commands/sheet.js +7 -7
- package/dist/commands/site.js +3 -2
- package/dist/commands/skills.js +3 -3
- package/dist/commands/slides.js +2 -2
- package/dist/node_modules/@allyhub-next/audio/dist/node/index.js +1 -1
- package/dist/node_modules/@allyhub-next/audio/dist/node/master.js +1 -1
- package/dist/node_modules/@allyhub-next/audio/package.json +1 -1
- package/dist/node_modules/@allyhub-next/browser/dist/html.js +1 -1
- package/dist/node_modules/@allyhub-next/browser/package.json +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/content.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/build/dist/content.js +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/index.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/build/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/meta-worker.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/build/dist/meta-worker.js +3 -3
- package/dist/node_modules/@allyhub-next/build/dist/move-refs.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/move-refs.js +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/plugin.d.ts +12 -3
- package/dist/node_modules/@allyhub-next/build/dist/plugin.js +7 -6
- package/dist/node_modules/@allyhub-next/build/dist/prepare.d.ts +9 -5
- package/dist/node_modules/@allyhub-next/build/dist/prepare.js +2 -2
- package/dist/node_modules/@allyhub-next/build/dist/vite.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/build/dist/vite.js +2 -2
- package/dist/node_modules/@allyhub-next/build/package.json +1 -1
- package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.js +2 -2
- package/dist/node_modules/@allyhub-next/chart/dist/chart.d.ts +14 -5
- package/dist/node_modules/@allyhub-next/chart/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub-next/chart/package.json +1 -1
- package/dist/node_modules/@allyhub-next/check/dist/check.js +3 -3
- package/dist/node_modules/@allyhub-next/check/package.json +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/blobs.js +2 -0
- package/dist/node_modules/@allyhub-next/cloud/dist/call.js +4 -2
- package/dist/node_modules/@allyhub-next/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/errors.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/hashes.js +2 -0
- package/dist/node_modules/@allyhub-next/cloud/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/sites.js +2 -0
- package/dist/node_modules/@allyhub-next/cloud/dist/voice.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub-next/components/package.json +1 -1
- package/dist/node_modules/@allyhub-next/components/r/caption-subtitle.json +1 -1
- package/dist/node_modules/@allyhub-next/components/src/caption-subtitle.ts +54 -16
- package/dist/node_modules/@allyhub-next/dev-server/dist/background.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/exports.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/fonts.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/live.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/project.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/reach.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/dist/record.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/dist/server.js +2 -2
- package/dist/node_modules/@allyhub-next/dev-server/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/tree.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub-next/doc/package.json +1 -1
- package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.js +1 -1
- package/dist/node_modules/@allyhub-next/export/dist/export.js +5 -5
- package/dist/node_modules/@allyhub-next/export/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/export/package.json +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.d.ts +205 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/script.d.ts +4 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/script.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +248 -18
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.d.ts +1114 -91
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/website.d.ts +20 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/website.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/index.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/formats/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/items.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/media-type.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/formats/dist/media-type.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +625 -30
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/strict.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/strict.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/zip.d.ts +17 -0
- package/dist/node_modules/@allyhub-next/formats/dist/zip.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/package.json +2 -1
- package/dist/node_modules/@allyhub-next/measure/package.json +1 -1
- package/dist/node_modules/@allyhub-next/media/dist/index.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/media/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/media/dist/sheet.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/media/dist/sheet.js +7 -7
- package/dist/node_modules/@allyhub-next/media/package.json +1 -1
- package/dist/node_modules/@allyhub-next/model/package.json +1 -1
- package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.d.ts +31 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/color.d.ts +33 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/color.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/enums.d.ts +13 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/enums.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ext.d.ts +79 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ext.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.d.ts +132 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.d.ts +4708 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.d.ts +57 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/index.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/index.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/mce.d.ts +12 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/mce.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/node.d.ts +111 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/node.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ns.d.ts +45 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ns.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/opc.d.ts +48 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/opc.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/report.d.ts +45 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/report.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/xml.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/xml.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/package.json +26 -0
- package/dist/node_modules/@allyhub-next/project/dist/deck-keys.js +2 -0
- package/dist/node_modules/@allyhub-next/project/dist/deck-measure.js +2 -0
- package/dist/node_modules/@allyhub-next/project/dist/deck-pool.js +2 -0
- package/dist/node_modules/@allyhub-next/project/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/project/dist/session.js +1 -1
- package/dist/node_modules/@allyhub-next/project/dist/stills.js +2 -0
- package/dist/node_modules/@allyhub-next/project/package.json +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/account.d.ts +338 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/account.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/auth.d.ts +12 -13
- package/dist/node_modules/@allyhub-next/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/blobs.d.ts +35 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/blobs.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +101 -32
- package/dist/node_modules/@allyhub-next/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/editor.d.ts +89 -5
- package/dist/node_modules/@allyhub-next/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/files.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/protocol/dist/index.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.d.ts +23 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/open.d.ts +13 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/open.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/registry.d.ts +73 -59
- package/dist/node_modules/@allyhub-next/protocol/dist/registry.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/routes.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/shares.d.ts +115 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/shares.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/sites.d.ts +293 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/sites.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.d.ts +377 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/teams.d.ts +27 -9
- package/dist/node_modules/@allyhub-next/protocol/dist/teams.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/tools.d.ts +53 -14
- package/dist/node_modules/@allyhub-next/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/package.json +2 -1
- package/dist/node_modules/@allyhub-next/registry/package.json +1 -1
- package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.js +3 -2
- package/dist/node_modules/@allyhub-next/render/dist/doc/index.js +1 -1
- package/dist/node_modules/@allyhub-next/render/dist/doc/pdf.js +34 -0
- package/dist/node_modules/@allyhub-next/render/dist/doc/print.js +4 -4
- package/dist/node_modules/@allyhub-next/render/dist/exports.js +2 -2
- package/dist/node_modules/@allyhub-next/render/dist/pdf.js +2 -0
- package/dist/node_modules/@allyhub-next/render/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtime/dist/fonts.js +1 -1
- package/dist/node_modules/@allyhub-next/runtime/dist/music.js +1 -1
- package/dist/node_modules/@allyhub-next/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +25 -5
- package/dist/node_modules/@allyhub-next/scaffold/dist/index.js +4 -4
- package/dist/node_modules/@allyhub-next/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub-next/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.js +3 -3
- package/dist/node_modules/@allyhub-next/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/capabilities.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/index.d.ts +1 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/page.d.ts +83 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/page.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.d.ts +40 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.d.ts +9 -3
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.d.ts +5 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.d.ts +60 -13
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.d.ts +27 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.d.ts +16 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.d.ts +18 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.d.ts +38 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.d.ts +19 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.d.ts +49 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.d.ts +82 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.d.ts +6 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/check.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.d.ts +15 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/export.d.ts +29 -8
- package/dist/node_modules/@allyhub-next/sheet/dist/export.js +3 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/file.js +2 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/format.d.ts +8 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/format.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/html.d.ts +52 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/html.js +43 -11
- package/dist/node_modules/@allyhub-next/sheet/dist/index.d.ts +7 -3
- package/dist/node_modules/@allyhub-next/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/paginate.d.ts +98 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/paginate.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/table-style.d.ts +32 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-style.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/values.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.d.ts +10 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +12 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.d.ts +14 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.js +2 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.d.ts +11 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.js +36 -16
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +6 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +44 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +2 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.d.ts +23 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.d.ts +40 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/api.d.ts +121 -44
- package/dist/node_modules/@allyhub-next/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.d.ts +50 -13
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-file.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/check.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/code.d.ts +33 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/code.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/components.d.ts +31 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/components.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/enums.d.ts +188 -5
- package/dist/node_modules/@allyhub-next/slides-core/dist/enums.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/file.d.ts +43 -21
- package/dist/node_modules/@allyhub-next/slides-core/dist/file.js +3 -3
- package/dist/node_modules/@allyhub-next/slides-core/dist/identity.d.ts +17 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/identity.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.d.ts +5 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/lang.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/lang.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/merge.d.ts +58 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/merge.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/model.d.ts +38 -4
- package/dist/node_modules/@allyhub-next/slides-core/dist/office.d.ts +27 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/office.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.d.ts +26 -5
- package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/script.d.ts +18 -16
- package/dist/node_modules/@allyhub-next/slides-core/dist/script.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-core/dist/stage.d.ts +51 -53
- package/dist/node_modules/@allyhub-next/slides-core/dist/strict.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/units.d.ts +27 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/units.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/values.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/values.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/code.js +4 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/index.js +3 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/names.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/script.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/chart.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/common.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/index.js +4 -0
- package/dist/{site.js → node_modules/@allyhub-next/slides-pptx/dist/read/model.js} +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/shapes.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/table.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/text.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/timing.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/component.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.js +5 -5
- package/dist/node_modules/@allyhub-next/slides-runtime/package.json +5 -1
- package/dist/node_modules/@allyhub-next/stage/dist/graphics.js +1 -1
- package/dist/node_modules/@allyhub-next/stage/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/stage/dist/page.js +22 -12
- package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.js +5 -5
- package/dist/node_modules/@allyhub-next/stage/dist/server.js +1 -1
- package/dist/node_modules/@allyhub-next/stage/package.json +1 -1
- package/dist/node_modules/@allyhub-next/stage-page/dist/host.js +1 -20
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/probe.html +8 -0
- package/dist/{astro.js → node_modules/@allyhub-next/stage-page/dist/runtime/probe.js} +1 -1
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/runtime.js +79 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.html +21 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.js +3 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.html +9 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.js +3 -0
- package/dist/node_modules/@allyhub-next/stage-page/package.json +2 -3
- package/dist/node_modules/@allyhub-next/video-core/dist/captions.js +6 -6
- package/dist/node_modules/@allyhub-next/video-core/dist/fact.d.ts +47 -8
- package/dist/node_modules/@allyhub-next/video-core/dist/fact.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/marks.d.ts +14 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/marks.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/music.d.ts +2 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/piece.d.ts +11 -2
- package/dist/node_modules/@allyhub-next/video-core/dist/problem.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/problem.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/schema.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/video-core/dist/schema.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/script.d.ts +2 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/script.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/source.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/source.js +2 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +10 -33
- package/dist/node_modules/@allyhub-next/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub-next/website/LICENSE +241 -0
- package/dist/node_modules/@allyhub-next/website/dist/index.js +2 -0
- package/dist/node_modules/@allyhub-next/website/dist/publish.js +3 -0
- package/dist/node_modules/@allyhub-next/website/dist/rules.js +2 -0
- package/dist/node_modules/@allyhub-next/website/dist/website.js +4 -0
- package/dist/node_modules/@allyhub-next/website/package.json +13 -0
- package/dist/text/facts-text.js +4 -4
- package/dist/works.js +1 -1
- package/editor-web/assets/calc-worker-Bz9r26p1.js +158 -0
- package/editor-web/assets/dist-0emakyZE.js +36 -0
- package/editor-web/assets/dist-B3UoDUa5.js +37 -0
- package/editor-web/assets/dist-B6KzR3pN.js +10 -0
- package/editor-web/assets/dist-Bc5iA5k1.js +1 -0
- package/editor-web/assets/dist-CTQIm8Im.js +10 -0
- package/editor-web/assets/dist-CiHNHwyq.js +2 -0
- package/editor-web/assets/dist-DNZ8PQ-E.js +224 -0
- package/editor-web/assets/index-CFt3ovRY.js +69 -0
- package/editor-web/assets/index-ujKjdu_s.css +2 -0
- package/editor-web/assets/minus-BhoPZC5P.js +1 -0
- package/editor-web/assets/react-C_-rEEBU.js +101 -0
- package/editor-web/assets/tabs-Den4gHrU.js +105 -0
- package/editor-web/assets/text-align-start-CsW4nqqL.js +1 -0
- package/editor-web/index.html +5 -5
- package/package.json +8 -14
- package/dist/astro.d.ts +0 -2
- package/dist/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +0 -52
- package/dist/node_modules/@allyhub-next/audio/dist/decode.d.ts +0 -33
- package/dist/node_modules/@allyhub-next/audio/dist/envelope.d.ts +0 -37
- package/dist/node_modules/@allyhub-next/audio/dist/index.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/audio/dist/levels.d.ts +0 -97
- package/dist/node_modules/@allyhub-next/audio/dist/master.d.ts +0 -29
- package/dist/node_modules/@allyhub-next/audio/dist/music.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +0 -39
- package/dist/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +0 -25
- package/dist/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +0 -31
- package/dist/node_modules/@allyhub-next/audio/dist/node/index.d.ts +0 -8
- package/dist/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/audio/dist/node/master.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +0 -60
- package/dist/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +0 -31
- package/dist/node_modules/@allyhub-next/audio/dist/plan.d.ts +0 -143
- package/dist/node_modules/@allyhub-next/audio/dist/recorded.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +0 -47
- package/dist/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +0 -89
- package/dist/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +0 -64
- package/dist/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +0 -56
- package/dist/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +0 -67
- package/dist/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +0 -64
- package/dist/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +0 -78
- package/dist/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +0 -111
- package/dist/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +0 -3
- package/dist/node_modules/@allyhub-next/audio/dist/render.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/audio/dist/sfx.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/audio/dist/shape.d.ts +0 -118
- package/dist/node_modules/@allyhub-next/audio/dist/voice.d.ts +0 -45
- package/dist/node_modules/@allyhub-next/browser/dist/browser.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/browser/dist/capture.d.ts +0 -61
- package/dist/node_modules/@allyhub-next/browser/dist/cdp.d.ts +0 -51
- package/dist/node_modules/@allyhub-next/browser/dist/flags.d.ts +0 -13
- package/dist/node_modules/@allyhub-next/browser/dist/frames.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/browser/dist/html.d.ts +0 -19
- package/dist/node_modules/@allyhub-next/browser/dist/index.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/browser/dist/launch.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/browser/dist/page.d.ts +0 -67
- package/dist/node_modules/@allyhub-next/browser/dist/server.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/check/dist/cache.d.ts +0 -46
- package/dist/node_modules/@allyhub-next/check/dist/check.d.ts +0 -142
- package/dist/node_modules/@allyhub-next/check/dist/generated.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/check/dist/index.d.ts +0 -7
- package/dist/node_modules/@allyhub-next/check/dist/plans.d.ts +0 -111
- package/dist/node_modules/@allyhub-next/check/dist/result.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/check/dist/scenery.d.ts +0 -23
- package/dist/node_modules/@allyhub-next/dev-server/dist/background.d.ts +0 -50
- package/dist/node_modules/@allyhub-next/dev-server/dist/card.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/dev-server/dist/exports.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/dev-server/dist/index.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/dev-server/dist/live.d.ts +0 -77
- package/dist/node_modules/@allyhub-next/dev-server/dist/mime.d.ts +0 -2
- package/dist/node_modules/@allyhub-next/dev-server/dist/mime.js +0 -2
- package/dist/node_modules/@allyhub-next/dev-server/dist/paths.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/dev-server/dist/project.d.ts +0 -153
- package/dist/node_modules/@allyhub-next/dev-server/dist/reveal.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/dev-server/dist/server.d.ts +0 -47
- package/dist/node_modules/@allyhub-next/dev-server/dist/sound.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/dev-server/dist/stage.d.ts +0 -82
- package/dist/node_modules/@allyhub-next/dev-server/dist/stage.js +0 -121
- package/dist/node_modules/@allyhub-next/dev-server/dist/tools.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/dev-server/dist/validate.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/dev-server/dist/watcher.d.ts +0 -47
- package/dist/node_modules/@allyhub-next/dev-server/dist/writer.d.ts +0 -51
- package/dist/node_modules/@allyhub-next/export/dist/batch.d.ts +0 -70
- package/dist/node_modules/@allyhub-next/export/dist/deck-fonts.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/export/dist/export.d.ts +0 -123
- package/dist/node_modules/@allyhub-next/export/dist/index.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/export/dist/names.d.ts +0 -36
- package/dist/node_modules/@allyhub-next/measure/dist/compare.d.ts +0 -195
- package/dist/node_modules/@allyhub-next/measure/dist/contrast.d.ts +0 -14
- package/dist/node_modules/@allyhub-next/measure/dist/cut-sheet.d.ts +0 -90
- package/dist/node_modules/@allyhub-next/measure/dist/cuts.d.ts +0 -108
- package/dist/node_modules/@allyhub-next/measure/dist/facts.d.ts +0 -60
- package/dist/node_modules/@allyhub-next/measure/dist/fidelity.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/measure/dist/flat.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/measure/dist/index.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/measure/dist/loop.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/measure/dist/overlay.d.ts +0 -57
- package/dist/node_modules/@allyhub-next/measure/dist/recording-report.d.ts +0 -66
- package/dist/node_modules/@allyhub-next/measure/dist/reference/compare.d.ts +0 -118
- package/dist/node_modules/@allyhub-next/measure/dist/reference/folder.d.ts +0 -75
- package/dist/node_modules/@allyhub-next/measure/dist/reference/interpret.d.ts +0 -39
- package/dist/node_modules/@allyhub-next/measure/dist/reference/piece.d.ts +0 -53
- package/dist/node_modules/@allyhub-next/measure/dist/reference/sections.d.ts +0 -53
- package/dist/node_modules/@allyhub-next/measure/dist/reference/sets.d.ts +0 -84
- package/dist/node_modules/@allyhub-next/measure/dist/reference/text.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/measure/dist/reference/video.d.ts +0 -55
- package/dist/node_modules/@allyhub-next/measure/dist/seams.d.ts +0 -46
- package/dist/node_modules/@allyhub-next/measure/dist/sound-measures.d.ts +0 -74
- package/dist/node_modules/@allyhub-next/measure/dist/sound-report.d.ts +0 -156
- package/dist/node_modules/@allyhub-next/measure/dist/still.d.ts +0 -58
- package/dist/node_modules/@allyhub-next/measure/dist/version-voice.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/project/dist/console.d.ts +0 -34
- package/dist/node_modules/@allyhub-next/project/dist/digest.d.ts +0 -9
- package/dist/node_modules/@allyhub-next/project/dist/index.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/project/dist/ledger.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/project/dist/media-index.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/project/dist/page.d.ts +0 -119
- package/dist/node_modules/@allyhub-next/project/dist/says.d.ts +0 -15
- package/dist/node_modules/@allyhub-next/project/dist/scenery.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/project/dist/session.d.ts +0 -37
- package/dist/node_modules/@allyhub-next/project/dist/stretch.d.ts +0 -38
- package/dist/node_modules/@allyhub-next/project/dist/version.d.ts +0 -114
- package/dist/node_modules/@allyhub-next/render/dist/cap.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/render/dist/capture.d.ts +0 -78
- package/dist/node_modules/@allyhub-next/render/dist/clip.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/render/dist/composite.d.ts +0 -106
- package/dist/node_modules/@allyhub-next/render/dist/delivery.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.d.ts +0 -3
- package/dist/node_modules/@allyhub-next/render/dist/doc/index.d.ts +0 -3
- package/dist/node_modules/@allyhub-next/render/dist/doc/print.d.ts +0 -51
- package/dist/node_modules/@allyhub-next/render/dist/encode.d.ts +0 -111
- package/dist/node_modules/@allyhub-next/render/dist/errors.d.ts +0 -15
- package/dist/node_modules/@allyhub-next/render/dist/exports.d.ts +0 -76
- package/dist/node_modules/@allyhub-next/render/dist/ffmpeg.d.ts +0 -75
- package/dist/node_modules/@allyhub-next/render/dist/footage.d.ts +0 -169
- package/dist/node_modules/@allyhub-next/render/dist/image.d.ts +0 -16
- package/dist/node_modules/@allyhub-next/render/dist/index.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/render/dist/junction.d.ts +0 -70
- package/dist/node_modules/@allyhub-next/render/dist/look.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/render/dist/page.d.ts +0 -186
- package/dist/node_modules/@allyhub-next/render/dist/parts.d.ts +0 -140
- package/dist/node_modules/@allyhub-next/render/dist/png.d.ts +0 -37
- package/dist/node_modules/@allyhub-next/render/dist/pool.d.ts +0 -54
- package/dist/node_modules/@allyhub-next/render/dist/post-probe.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/render/dist/post.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/render/dist/render.d.ts +0 -151
- package/dist/node_modules/@allyhub-next/render/dist/segments.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/render/dist/sound.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/render/dist/stills.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/render/dist/tools.d.ts +0 -25
- package/dist/node_modules/@allyhub-next/render/dist/webp.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/runtime/dist/bridge.d.ts +0 -211
- package/dist/node_modules/@allyhub-next/runtime/dist/captions.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/runtime/dist/clock.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/runtime/dist/compose.d.ts +0 -149
- package/dist/node_modules/@allyhub-next/runtime/dist/console.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/runtime/dist/contrast.d.ts +0 -13
- package/dist/node_modules/@allyhub-next/runtime/dist/embed.d.ts +0 -50
- package/dist/node_modules/@allyhub-next/runtime/dist/env.d.ts +0 -101
- package/dist/node_modules/@allyhub-next/runtime/dist/errors.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/runtime/dist/facade.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/runtime/dist/fonts.d.ts +0 -110
- package/dist/node_modules/@allyhub-next/runtime/dist/footage.d.ts +0 -52
- package/dist/node_modules/@allyhub-next/runtime/dist/frame.d.ts +0 -61
- package/dist/node_modules/@allyhub-next/runtime/dist/guards.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/runtime/dist/index.d.ts +0 -14
- package/dist/node_modules/@allyhub-next/runtime/dist/inspect.d.ts +0 -112
- package/dist/node_modules/@allyhub-next/runtime/dist/locate.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/runtime/dist/measure.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/runtime/dist/mix-plan.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/runtime/dist/music.d.ts +0 -29
- package/dist/node_modules/@allyhub-next/runtime/dist/output.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/runtime/dist/pictures.d.ts +0 -39
- package/dist/node_modules/@allyhub-next/runtime/dist/piece.d.ts +0 -34
- package/dist/node_modules/@allyhub-next/runtime/dist/player/clips.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/runtime/dist/player/cutout.d.ts +0 -57
- package/dist/node_modules/@allyhub-next/runtime/dist/player/player.d.ts +0 -78
- package/dist/node_modules/@allyhub-next/runtime/dist/reads.d.ts +0 -132
- package/dist/node_modules/@allyhub-next/runtime/dist/sound.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/runtime/dist/speech.d.ts +0 -107
- package/dist/node_modules/@allyhub-next/runtime/dist/stage-kit.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/runtime/dist/stage.d.ts +0 -34
- package/dist/node_modules/@allyhub-next/runtime/dist/styles.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/runtime/dist/takes.d.ts +0 -72
- package/dist/node_modules/@allyhub-next/runtime/dist/titles.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/runtime/dist/transitions.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/site/dist/assets.d.ts +0 -59
- package/dist/node_modules/@allyhub-next/site/dist/assets.js +0 -2
- package/dist/node_modules/@allyhub-next/site/dist/astro.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/site/dist/astro.js +0 -3
- package/dist/node_modules/@allyhub-next/site/dist/lockfile.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/site/dist/lockfile.js +0 -3
- package/dist/node_modules/@allyhub-next/site/dist/media.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/site/dist/media.js +0 -4
- package/dist/node_modules/@allyhub-next/site/package.json +0 -25
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/fonts.d.ts +0 -45
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.js +0 -3
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.d.ts +0 -55
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.js +0 -4
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.d.ts +0 -67
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.d.ts +0 -4
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.d.ts +0 -4
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.js +0 -2
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.d.ts +0 -4
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/ink.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/stage/dist/bakes.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/stage/dist/graphics.d.ts +0 -7
- package/dist/node_modules/@allyhub-next/stage/dist/identity.d.ts +0 -2
- package/dist/node_modules/@allyhub-next/stage/dist/index.d.ts +0 -9
- package/dist/node_modules/@allyhub-next/stage/dist/page.d.ts +0 -87
- package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.d.ts +0 -69
- package/dist/node_modules/@allyhub-next/stage/dist/scenery-solve.d.ts +0 -49
- package/dist/node_modules/@allyhub-next/stage/dist/scenery.d.ts +0 -8
- package/dist/node_modules/@allyhub-next/stage/dist/server.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/stage-page/dist/host.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/stage-page/dist/page.js +0 -79
- package/dist/site.d.ts +0 -2
- package/editor-web/assets/dist-Cg2PdedY.js +0 -6
- package/editor-web/assets/dist-CuW84oPe.js +0 -233
- package/editor-web/assets/dist-CxAS_vp7.js +0 -2
- package/editor-web/assets/dist-DCVaj9i1.js +0 -4
- package/editor-web/assets/dist-DGVUuVPB.js +0 -33
- package/editor-web/assets/dist-Yi3sy7Ea.js +0 -1
- package/editor-web/assets/index-B7S9RZhL.css +0 -2
- package/editor-web/assets/index-pwRfZ2Jv.js +0 -69
- package/editor-web/assets/minus-BizJdinJ.js +0 -1
- package/editor-web/assets/react-D54s6gwK.js +0 -101
- package/editor-web/assets/textarea-CvxipnGW.js +0 -105
- package/editor-web/assets/trash-2-Bq1Dt8XG.js +0 -1
- package/editor-web/assets/undo-2-Djhvu4xt.js +0 -1
- /package/dist/node_modules/@allyhub-next/{site → ooxml}/LICENSE +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type ScriptFile, type ScriptText } from "@allyhub-next/formats";
|
|
2
|
+
import { type Document } from "yaml";
|
|
3
|
+
import type { Words } from "./resolve.js";
|
|
2
4
|
/** A slide's speaker notes: a line, or a plural. */
|
|
3
5
|
type Notes = NonNullable<ScriptFile["slides"][number]["notes"]>;
|
|
4
6
|
export type DeckScriptEdit =
|
|
@@ -8,6 +10,13 @@ export type DeckScriptEdit =
|
|
|
8
10
|
slide: string;
|
|
9
11
|
shape: string;
|
|
10
12
|
words: ScriptText | undefined;
|
|
13
|
+
}
|
|
14
|
+
/** A picture's or a shape's alternative text (`p:cNvPr/@descr`); undefined takes it away. */
|
|
15
|
+
| {
|
|
16
|
+
op: "alt";
|
|
17
|
+
slide: string;
|
|
18
|
+
shape: string;
|
|
19
|
+
alt: string | undefined;
|
|
11
20
|
} | {
|
|
12
21
|
op: "notes";
|
|
13
22
|
slide: string;
|
|
@@ -18,26 +27,19 @@ export type DeckScriptEdit =
|
|
|
18
27
|
op: "remove";
|
|
19
28
|
slide: string;
|
|
20
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* A script's words of a key, as resolveDeck asks them
|
|
32
|
+
* (`<prefix>.<slide>.<shape>`, or `.notes`): what the editor and a
|
|
33
|
+
* snapshot's recorder resolve a deck's slides with.
|
|
34
|
+
*/
|
|
35
|
+
export declare function scriptWords(script: ScriptFile, prefix: string): (key: string) => Words;
|
|
21
36
|
/** A script's text read; undefined when it is not a script. */
|
|
22
37
|
export declare function readScript(text: string): ScriptFile | undefined;
|
|
23
38
|
/** The script's text after an edit. */
|
|
24
39
|
export declare function editDeckScript(text: string | undefined, edit: DeckScriptEdit): string;
|
|
25
|
-
/**
|
|
40
|
+
/** An edit made on the script's parsed document, in place: only the nodes it changes are touched. */
|
|
41
|
+
export declare function editDeckScriptDocument(doc: Document, edit: DeckScriptEdit): void;
|
|
42
|
+
/** What `b` changes of `a`'s slides' words, alternative text and notes, as edits. */
|
|
26
43
|
export declare function deckScriptEdits(a: ScriptFile, b: ScriptFile): DeckScriptEdit[];
|
|
27
|
-
/** Where a person's words met another hand's: the person's stand. */
|
|
28
|
-
export interface DeckScriptConflict {
|
|
29
|
-
slide: string;
|
|
30
|
-
/** The shape whose words both changed; absent for the notes. */
|
|
31
|
-
shape?: string;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* A person's script (`mine`, made from `base`) merged into the script as
|
|
35
|
-
* another hand left it (`theirs`), as mergeSlides merges slides.yaml.
|
|
36
|
-
* Undefined when theirs is not a script.
|
|
37
|
-
*/
|
|
38
|
-
export declare function mergeDeckScript(base: string, mine: ScriptFile, theirs: string): {
|
|
39
|
-
text: string;
|
|
40
|
-
conflicts: DeckScriptConflict[];
|
|
41
|
-
} | undefined;
|
|
42
44
|
export {};
|
|
43
45
|
//# sourceMappingURL=script.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{readDataFile as
|
|
3
|
-
`:
|
|
2
|
+
import{readDataFile as S}from"@allyhub-next/formats";import{isCollection as m,isMap as c,isSeq as w,parseDocument as g}from"yaml";export function scriptWords(s,e){const n=new Map(s.slides.map(r=>[r.id,r]));return r=>{if(!r.startsWith(`${e}.`))return;const f=r.slice(e.length+1),t=f.lastIndexOf(".");if(t<0)return;const o=n.get(f.slice(0,t)),l=f.slice(t+1);return l==="notes"?typeof o?.notes=="string"?o.notes:void 0:o?.text?.[l]}}export function readScript(s){const e=g(s);if(e.errors.length>0)return;const n=S("script",e.toJS()??{});return n.ok?n.value:void 0}function k(s){let e=s.get("slides",!0);if(w(e)||(c(s.contents)?s.set("slides",s.createNode([])):s.contents=s.createNode({slides:[]}),e=s.get("slides",!0)),!w(e))throw new Error("The script has no slides list.");return e.flow===!0&&(e.flow=!1),e}function x(s,e){!m(s)||!m(e)||(e.flow===!0&&(s.flow=!0),s.items.forEach((n,r)=>{x(n,e.items[r])}))}export function editDeckScript(s,e){const n=g(s===void 0||s.trim()===""?`slides: []
|
|
3
|
+
`:s);if(n.errors.length>0)throw new Error("The script is not YAML: it is mended by hand first.");return editDeckScriptDocument(n,e),n.toString()}export function editDeckScriptDocument(s,e){const n=k(s),r=n.items.findIndex(o=>c(o)&&o.get("id")===e.slide);if(e.op==="remove"){r>=0&&n.items.splice(r,1);return}const f=e.op==="text"?e.words===void 0:e.op==="alt"?e.alt===void 0:e.notes===void 0;if(r<0&&f)return;let t=n.items[r];if(c(t)||(n.items.push(s.createNode({id:e.slide})),t=n.items.at(-1)),!!c(t)){if(e.op==="notes")e.notes===void 0?t.delete("notes"):t.set("notes",s.createNode(e.notes));else if(e.op==="alt")if(e.alt===void 0){t.deleteIn(["alt",e.shape]);const o=t.get("alt",!0);c(o)&&o.items.length===0&&t.delete("alt")}else t.setIn(["alt",e.shape],e.alt);else if(e.words===void 0){t.deleteIn(["text",e.shape]);const o=t.get("text",!0);c(o)&&o.items.length===0&&t.delete("text")}else{const o=s.createNode(e.words);x(o,t.getIn(["text",e.shape],!0)),t.setIn(["text",e.shape],o)}t.items.length===1&&n.items.splice(n.items.indexOf(t),1)}}const a=s=>JSON.stringify(s);export function deckScriptEdits(s,e){const n=[],r=new Map(s.slides.map(t=>[t.id,t])),f=new Map(e.slides.map(t=>[t.id,t]));for(const t of r.keys())f.has(t)||n.push({op:"remove",slide:t});for(const[t,o]of f){const l=r.get(t),p=l?.text??{},u=o.text??{};for(const i of new Set([...Object.keys(p),...Object.keys(u)]))a(p[i])!==a(u[i])&&n.push({op:"text",slide:t,shape:i,words:u[i]});const h=l?.alt??{},d=o.alt??{};for(const i of new Set([...Object.keys(h),...Object.keys(d)]))h[i]!==d[i]&&n.push({op:"alt",slide:t,shape:i,alt:d[i]});a(l?.notes)!==a(o.notes)&&n.push({op:"notes",slide:t,notes:o.notes})}return n}
|
|
@@ -1,63 +1,61 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { DeckCode } from "./code.js";
|
|
2
|
+
import type { ResolvedDeck } from "./resolve.js";
|
|
3
|
+
import type { Theme } from "./theme.js";
|
|
4
|
+
/** A component drawn alone, on a transparent page of its frame's size. */
|
|
5
|
+
export interface ComponentAt {
|
|
6
|
+
name: string;
|
|
7
|
+
props: Record<string, unknown>;
|
|
8
|
+
/** Its frame, in the stage's pixels. */
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
/** Seconds since it came on: what moves in it has settled by its slide's still. */
|
|
12
|
+
t: number;
|
|
6
13
|
}
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
/** The editor to a frame. */
|
|
15
|
+
export type DeckHostCommand =
|
|
16
|
+
/** The code host: the deck's code as data (asked any time after the frame is made). */
|
|
9
17
|
{
|
|
10
|
-
type: "deck-
|
|
11
|
-
shape: string;
|
|
12
|
-
frame: Frame | null;
|
|
18
|
+
type: "deck-code";
|
|
13
19
|
}
|
|
14
|
-
/**
|
|
20
|
+
/** A component frame: draw this (asked any time after the frame is made; each draw replaces the last). */
|
|
21
|
+
| ({
|
|
22
|
+
type: "component";
|
|
23
|
+
} & ComponentAt)
|
|
24
|
+
/** The player: the deck as the editor resolved it now, for the same code; media it shows that the stage was not given, by project path. */
|
|
15
25
|
| {
|
|
16
|
-
type: "deck-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
/** The word at the point selected, as a double click does. */
|
|
23
|
-
word?: boolean;
|
|
24
|
-
/** Words typed on arrival, past what it says: the key that started it. */
|
|
25
|
-
text?: string;
|
|
26
|
-
cell?: readonly [row: number, col: number];
|
|
27
|
-
}
|
|
28
|
-
/** Typing goes on though the focus leaves: the editor's bar is about to act on the selected words. */
|
|
29
|
-
| {
|
|
30
|
-
type: "deck-hold";
|
|
31
|
-
}
|
|
32
|
-
/** The selected words made bold or not, or a colour (a theme colour or `#RRGGBB`). */
|
|
33
|
-
| {
|
|
34
|
-
type: "deck-format";
|
|
35
|
-
bold?: boolean;
|
|
36
|
-
italic?: boolean;
|
|
37
|
-
color?: string;
|
|
38
|
-
}
|
|
39
|
-
/** Stop typing. */
|
|
40
|
-
| {
|
|
41
|
-
type: "deck-stop";
|
|
26
|
+
type: "deck-update";
|
|
27
|
+
deck: ResolvedDeck;
|
|
28
|
+
media?: Record<string, {
|
|
29
|
+
url: string;
|
|
30
|
+
duration?: number;
|
|
31
|
+
}>;
|
|
42
32
|
};
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
/** A frame to the editor. */
|
|
34
|
+
export type DeckHostMessage =
|
|
35
|
+
/**
|
|
36
|
+
* The deck's code as data, and the theme under the deck's own that the
|
|
37
|
+
* stage resolves it with (the project's look): resolveDeck's `code` and
|
|
38
|
+
* `theme`. Said once unasked as soon as it is run, and to each ask.
|
|
39
|
+
*/
|
|
45
40
|
{
|
|
46
|
-
type: "deck-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
bold: boolean;
|
|
50
|
-
italic: boolean;
|
|
41
|
+
type: "deck-code";
|
|
42
|
+
code: DeckCode;
|
|
43
|
+
theme: Theme;
|
|
51
44
|
} | {
|
|
52
|
-
type: "
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
type: "component-ready";
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The player drew the update in place: the slides it drew again.
|
|
49
|
+
* `reload`: the slides' timing changed (an animation, a transition, a
|
|
50
|
+
* movie, a slide added or moved), which a player cannot take in place:
|
|
51
|
+
* the editor loads a new stage.
|
|
52
|
+
*/
|
|
53
|
+
| {
|
|
54
|
+
type: "deck-updated";
|
|
55
|
+
redrawn: string[];
|
|
56
|
+
reload?: true;
|
|
57
57
|
} | {
|
|
58
|
-
type: "
|
|
59
|
-
|
|
60
|
-
paragraphs: TypedParagraph[];
|
|
61
|
-
cell?: readonly [row: number, col: number];
|
|
58
|
+
type: "error";
|
|
59
|
+
message: string;
|
|
62
60
|
};
|
|
63
61
|
//# sourceMappingURL=stage.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{closest as e,publicNames as
|
|
2
|
+
import{closest as e,publicNames as o,strict as c,strictEnum as n}from"@allyhub-next/formats";import{held as l}from"./units.js";const r="allyhub slides capabilities lists what of python-pptx the API holds and where it differs.";export{e as closest,o as publicNames};export function strict(t,i,s={}){return c(t,i,r,{value:l,...s})}export function strictEnum(t,i){return n(t,i,r)}
|
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
export type Length = number;
|
|
2
|
+
/** What python-pptx's `Length` says of itself. */
|
|
3
|
+
export interface LengthUnits {
|
|
4
|
+
readonly emu: number;
|
|
5
|
+
readonly inches: number;
|
|
6
|
+
readonly cm: number;
|
|
7
|
+
readonly mm: number;
|
|
8
|
+
readonly pt: number;
|
|
9
|
+
readonly centipoints: number;
|
|
10
|
+
readonly twips: number;
|
|
11
|
+
}
|
|
12
|
+
/** python-pptx's `Length`: a number of EMU, in other units too. */
|
|
13
|
+
export type LengthValue = Length & LengthUnits;
|
|
14
|
+
/** A number of EMU as python-pptx's Length. */
|
|
15
|
+
export declare function length(emu: number): LengthValue;
|
|
16
|
+
/** A Length, or nothing. */
|
|
17
|
+
export declare const lengthOr: (emu: number | undefined) => LengthValue | undefined;
|
|
18
|
+
/** What the API is given, as it holds it: a Length as its number, a String (`new RGBColor(…)`) as its text; anything else as it is. */
|
|
19
|
+
export declare const held: (v: unknown) => unknown;
|
|
20
|
+
/** python-pptx's length functions as a deck's code has them: each gives a Length. */
|
|
21
|
+
export declare const LENGTH_UNITS: {
|
|
22
|
+
Emu: (n: number) => LengthValue;
|
|
23
|
+
Inches: (n: number) => LengthValue;
|
|
24
|
+
Pt: (n: number) => LengthValue;
|
|
25
|
+
Cm: (n: number) => LengthValue;
|
|
26
|
+
Mm: (n: number) => LengthValue;
|
|
27
|
+
Centipoints: (n: number) => LengthValue;
|
|
28
|
+
};
|
|
2
29
|
export declare const EMU_PER_INCH = 914400;
|
|
3
30
|
export declare const EMU_PER_PT = 12700;
|
|
4
31
|
export declare const EMU_PER_CM = 360000;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export const EMU_PER_INCH=914400,EMU_PER_PT=12700,EMU_PER_CM=36e4,EMU_PER_MM=36e3,EMU_PER_CENTIPOINT=127,Emu=t=>Math.trunc(t),Inches=t=>Math.trunc(t*
|
|
2
|
+
class o extends Number{get emu(){return this.valueOf()}get inches(){return this.valueOf()/EMU_PER_INCH}get cm(){return this.valueOf()/EMU_PER_CM}get mm(){return this.valueOf()/EMU_PER_MM}get pt(){return this.valueOf()/EMU_PER_PT}get centipoints(){return Math.trunc(this.valueOf()/EMU_PER_CENTIPOINT)}get twips(){return Math.trunc(this.valueOf()/(EMU_PER_PT/20))}}const r=new Map;export function length(t){const n=Math.trunc(t);let e=r.get(n);return e||(e=new o(n),r.set(n,e)),e}export const lengthOr=t=>t===void 0?void 0:length(t),held=t=>t instanceof Number||t instanceof String?t.valueOf():t,LENGTH_UNITS={Emu:t=>length(t),Inches:t=>length(t*EMU_PER_INCH),Pt:t=>length(t*EMU_PER_PT),Cm:t=>length(t*EMU_PER_CM),Mm:t=>length(t*EMU_PER_MM),Centipoints:t=>length(t*EMU_PER_CENTIPOINT)},EMU_PER_INCH=914400,EMU_PER_PT=12700,EMU_PER_CM=36e4,EMU_PER_MM=36e3,EMU_PER_CENTIPOINT=127,Emu=t=>Math.trunc(t),Inches=t=>Math.trunc(t*EMU_PER_INCH),Pt=t=>Math.trunc(t*EMU_PER_PT),Cm=t=>Math.trunc(t*EMU_PER_CM),Mm=t=>Math.trunc(t*EMU_PER_MM),Centipoints=t=>Math.trunc(t*EMU_PER_CENTIPOINT),toPt=t=>Math.round(t/EMU_PER_PT*100)/100,SLIDE_SIZES={"16:9":[Emu(12192e3),Emu(6858e3)],"16:10":[Emu(9144e3),Emu(5715e3)],"4:3":[Emu(9144e3),Emu(6858e3)],a4:[Mm(297),Mm(210)],"a4-portrait":[Mm(210),Mm(297)],letter:[Inches(11),Inches(8.5)],"letter-portrait":[Inches(8.5),Inches(11)],"1:1":[Emu(6858e3),Emu(6858e3)],"4:5":[Emu(6858e3),Emu(8572500)],"9:16":[Emu(6858e3),Emu(12192e3)]};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const isRecord: (v: unknown) => v is Record<string, unknown>;
|
|
2
|
+
/** A value's JSON, its keys in order: two values are the same when theirs are. */
|
|
3
|
+
export declare const valueKey: (v: unknown) => string;
|
|
4
|
+
export declare const sameValue: (a: unknown, b: unknown) => boolean;
|
|
5
|
+
/** The pairs of places, `a`'s and `b`'s, where the two hold the same key: a longest common subsequence, in order. */
|
|
6
|
+
export declare function commonPairs(a: readonly string[], b: readonly string[]): [number, number][];
|
|
7
|
+
//# sourceMappingURL=values.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{diffArrays as f}from"diff";export const isRecord=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);const n=e=>Array.isArray(e)?e.map(n):isRecord(e)?Object.fromEntries(Object.entries(e).filter(([,o])=>o!==void 0).sort(([o],[r])=>o<r?-1:o>r?1:0).map(([o,r])=>[o,n(r)])):e;export const valueKey=e=>e===void 0?"":JSON.stringify(n(e)),sameValue=(e,o)=>valueKey(e)===valueKey(o);export function commonPairs(e,o){const r=[];let s=0,c=0;for(const t of f([...e],[...o]))if(t.added)c+=t.count;else if(t.removed)s+=t.count;else for(let i=0;i<t.count;i++)r.push([s++,c++]);return r}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{zipSync as
|
|
2
|
+
import{zipSync as T}from"fflate";import{chartSpaceXml as y,EMU_PER_PT as k,isScatter as w}from"@allyhub-next/slides-core";import{el as S,esc as E,HEAD as C}from"./xml.js";const n=t=>t<26?String.fromCharCode(65+t):n(Math.floor(t/26)-1)+String.fromCharCode(65+t%26);export function chartXml(t,r,m){const c=t.categories.length,i=e=>n(e+1),f=w(t.type),p=(e,h)=>{const a=String((t.series[e]?.values.length??0)+1);return`Sheet1!$${n(e*2+h)}$2:$${n(e*2+h)}$${a}`};return y(t,{refs:f?{name:e=>`Sheet1!$${n(e*2+1)}$1`,categories:void 0,values:e=>p(e,1),x:e=>p(e,0)}:{name:e=>`Sheet1!$${i(e)}$1`,categories:`Sheet1!$A$2:$A$${String(c+1)}`,values:e=>`Sheet1!$${i(e)}$2:$${i(e)}$${String(c+1)}`},frame:{width:r.width/k,height:r.height/k},tail:S("c:externalData",{"r:id":m},S("c:autoUpdate",{val:0}))})}const v="http://schemas.openxmlformats.org/spreadsheetml/2006/main",u="http://schemas.openxmlformats.org/officeDocument/2006/relationships",D=new Date(1980,0,1);export function chartBook(t){const r=(s,o)=>`<c r="${s}" t="inlineStr"><is><t>${E(o)}</t></is></c>`,m=w(t.type),c=(m?t.series.flatMap((s,o)=>[r(`${n(o*2)}1`,"X"),r(`${n(o*2+1)}1`,s.name)]):[r("A1",""),...t.series.map((s,o)=>r(`${n(o+1)}1`,s.name))]).join(""),i=(s,o)=>o==null?"":`<c r="${s}"><v>${String(o)}</v></c>`,f=Math.max(0,...t.series.map(s=>s.values.length)),p=Array.from({length:f},(s,o)=>{const l=String(o+2),d=t.series.flatMap(($,x)=>[i(`${n(x*2)}${l}`,$.x?.[o]),i(`${n(x*2+1)}${l}`,$.values[o])]);return`<row r="${l}">${d.join("")}</row>`}),e=t.categories.map((s,o)=>{const l=String(o+2),d=t.series.map(($,x)=>{const g=$.values[o];return g==null?"":`<c r="${n(x+1)}${l}"><v>${String(g)}</v></c>`});return`<row r="${l}">${r(`A${l}`,s)}${d.join("")}</row>`}),h=new TextEncoder,a=s=>[h.encode(C+s),{mtime:D}];return T({"[Content_Types].xml":a('<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/></Types>'),"_rels/.rels":a(`<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${u}/officeDocument" Target="xl/workbook.xml"/></Relationships>`),"xl/workbook.xml":a(`<workbook xmlns="${v}" xmlns:r="${u}"><sheets><sheet name="Sheet1" sheetId="1" r:id="rId1"/></sheets></workbook>`),"xl/_rels/workbook.xml.rels":a(`<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${u}/worksheet" Target="worksheets/sheet1.xml"/></Relationships>`),"xl/worksheets/sheet1.xml":a(`<worksheet xmlns="${v}"><sheetData><row r="1">${c}</row>${(m?p:e).join("")}</sheetData></worksheet>`)})}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{colorFile as g}from"@allyhub-next/formats";import{accentOf as X,AUTOSHAPE_STYLE as $,CHART_DEFAULTS as u,CONNECTOR_STYLE as G,groupingOf as N,hasLines as J,isBar as Y,isConnectorGeometry as z,isLine as Z,isRound as j,isScatter as W,labelPositionOf as q,MSO_CONNECTOR as K,MSO_SHAPE as Q,NAME_OF_TYPE as P,DRAWN_TEXTBOX_FRAME as V,placeholderFrame as ee,placeholderLevels as ne,TEXT_INSETS as S,TEXTBOX_FRAME as te,toPt as O}from"@allyhub-next/slides-core";import{nameOf as E}from"./names.js";const ie={l:"PP_ALIGN.LEFT",ctr:"PP_ALIGN.CENTER",r:"PP_ALIGN.RIGHT",just:"PP_ALIGN.JUSTIFY"},oe={t:"MSO_ANCHOR.TOP",ctr:"MSO_ANCHOR.MIDDLE",b:"MSO_ANCHOR.BOTTOM"},re={none:"MSO_AUTO_SIZE.NONE",shape:"MSO_AUTO_SIZE.SHAPE_TO_FIT_TEXT",text:"MSO_AUTO_SIZE.TEXT_TO_FIT_SHAPE"},ae={title:"TITLE",ctrTitle:"CENTER_TITLE",subTitle:"SUBTITLE",body:"BODY",pic:"PICTURE",media:"MEDIA_CLIP",obj:"OBJECT",dt:"DATE",ftr:"FOOTER",sldNum:"SLIDE_NUMBER"},le=Object.fromEntries(Object.entries(Q).map(([e,n])=>[n,e])),se=e=>{const n=le[e];return n===void 0?str(e):`MSO_SHAPE.${n}`},de=Object.fromEntries(Object.entries(K).map(([e,n])=>[n,e])),ce=e=>{const n=de[e];return n===void 0?str(e):`MSO_CONNECTOR.${n}`},I=(e,n=[])=>n.map((i,o)=>`${e}.adjustments[${String(o)}] = ${String(Math.round(i*1e5)/1e5)};`);export const emu=e=>`Emu(${String(Math.round(e))})`;const b=e=>`Pt(${String(Math.round(e/12700*100)/100)})`;export const str=e=>JSON.stringify(e);export function colorLines(e,n,i){if(typeof n=="object"&&"rgb"in n)return[`${e}.rgb = ${str(n.rgb)};`];const o=typeof n=="string"?0:n.brightness;return[`${e}.theme_color = ${str(typeof n=="string"?n:n.theme_color)};`,...o!==0||typeof i=="object"&&"brightness"in i?[`${e}.brightness = ${String(Math.round(o*1e5)/1e5)};`]:[]]}function T(e,n,i,o){return Object.keys(o).flatMap(a=>{const r=n[a],s=o[a];return!s||canonical(r)===canonical(i[a])?[]:[`${e}.${a} = ${r==null?String(r):s(r)};`]})}const v=e=>String(e);function k(e,n,i={}){const o=n??{},a=o.color;return[...T(e,o,i,{name:str,size:b,bold:v,italic:v,spacing:b,underline:v,strike:v,baseline:r=>String(Math.round(r*1e3)/1e3),highlight:str}),...canonical(a)===canonical(i.color)?[]:a===void 0?[`${e}.color.theme_color = undefined;`]:colorLines(`${e}.color`,a,i.color)]}const _e=e=>"lines"in e?String(Math.round(e.lines*1e3)/1e3):b(e.fixed);function w(e,n,i,o={}){return[...T(e,n,o,{alignment:a=>ie[a],line_spacing:_e,space_before:b,space_after:b}),...i?T(e,n,o,{bullet:str,bullet_font:str,numbered:str,margin_left:emu,indent:emu}):[],...k(`${e}.font`,n.font,o.font)]}export function levelLines(e,n,i=[]){const o=Array.from({length:Math.max(n?.length??0,i.length)},(s,_)=>n?.[_]??{}),a=o.map((s,_)=>w("level",s,!0,i[_])),r=a[0]?.join(`
|
|
3
|
+
`)??"";return a.length===9&&r!==""&&a.every(s=>s.join(`
|
|
4
|
+
`)===r)?[`for (const level of ${e}) {`,...(a[0]??[]).map(s=>` ${s}`),"}"]:o.flatMap((s,_)=>w(`${e}[${String(_)}]`,s,!0,i[_]))}const A={margin_left:S.left,margin_top:S.top,margin_right:S.right,margin_bottom:S.bottom};export const MADE={placeholder:e=>({...ee(e),...A}),textbox:{vertical_anchor:"t",...te,...A},autoshape:{vertical_anchor:$.vertical_anchor,word_wrap:!0,auto_size:"none",...A}},FILE_TEXTBOX={...MADE.textbox,...V};export function bodyLines(e,n,i={},o=[]){if(!n)return[];const a=d=>n[d]===void 0||n[d]===i[d]?void 0:n[d],r=a("vertical_anchor"),s=a("auto_size"),_=a("word_wrap");return[...r===void 0?[]:[`${e}.vertical_anchor = ${oe[r]};`],...s===void 0?[]:[`${e}.auto_size = ${re[s]};`],..._===void 0?[]:[`${e}.word_wrap = ${String(_)};`],...["margin_left","margin_top","margin_right","margin_bottom"].flatMap(d=>{const t=a(d);return t===void 0?[]:[`${e}.${d} = ${emu(t)};`]}),...levelLines(`${e}.list_style`,n.levels,o)]}export const sameColor=(e,n)=>JSON.stringify(e)===JSON.stringify(n);function C(e,n,i){return n===void 0||sameColor(n,i)?[]:n===null?[`${e}.fill.background();`]:[`${e}.fill.solid();`,...colorLines(`${e}.fill.fore_color`,n)]}function M(e,n,i){return[...n.line===void 0||sameColor(n.line,i.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===i.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)};`]]}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 fe(e,n,i){const o=n.frame??{left:0,top:0,width:0,height:0},a=i.w===0?1:o.width/i.w,r=i.h===0?1:o.height/i.h,s=i.steps.flatMap(l=>l.op==="close"?[]:l.op==="curve"?[[l.x1,l.y1],[l.x2,l.y2],[l.x,l.y]]:[[l.x,l.y]]),_=l=>Math.min(...s.map(m=>m[l]??0)),[d,...t]=i.steps,p=d?.op==="move"?`${String(d.x)}, ${String(d.y)}`:"0, 0",c=(d?.op==="move"?t:i.steps).map(l=>l.op==="close"?".add_line_segments([], true)":l.op==="move"?`.move_to(${String(l.x)}, ${String(l.y)})`:l.op==="line"?`.add_line_segments([[${String(l.x)}, ${String(l.y)}]], false)`:`.add_curve_segment(${[l.x1,l.y1,l.x2,l.y2,l.x,l.y].map(String).join(", ")})`);return`${e}.shapes.build_freeform(${p}, [${String(a)}, ${String(r)}])${c.join("")}.convert_to_shape(${emu(o.left-Math.round(_(0)*a))}, ${emu(o.top-Math.round(_(1)*r))})`}const L=(e,n)=>n.rotation===void 0?[]:[`${e}.rotation = ${String(Math.round(n.rotation*1e3)/1e3)};`];function ue(e){const n=e.text?.levels??[],i=e.text_color??"dk1";return e.kind!=="autoshape"||sameColor(i,$.font_color)?n:Array.from({length:9},(o,a)=>{const r=n[a]??{};return r.font?.color!==void 0?r:{...r,font:{...r.font,color:i}}})}function me(e,n,i,o={}){return i.flatMap((a,r)=>{const s=`${e}_p${String(r)}`,_=[...a.level>0?[`${s}.level = ${String(a.level)};`]:[],...w(s,a,!1,r===0?o:{}),...a.runs.flatMap((d,t)=>d.text==="\v"?[`${s}.add_line_break();`]:d.font?[`const ${s}r${String(t)} = ${s}.add_run();`,`${s}r${String(t)}.text = ${str(d.text)};`,...k(`${s}r${String(t)}.font`,d.font),...d.font.link===void 0?[]:[`${s}r${String(t)}.hyperlink.address = ${str(d.font.link)};`]]:[`${s}.add_run().text = ${str(d.text)};`])];return r===0&&_.length===0?[]:[`const ${s} = ${r===0?`${n}.paragraphs[0]`:`${n}.add_paragraph()`};`,..._]})}const y=e=>`${emu(e.left)}, ${emu(e.top)}, ${emu(e.width)}, ${emu(e.height)}`;export class MediaFiles{files=new Map;byPart=new Map;bytes;constructor(n){this.bytes=n}path(n){const i=this.byPart.get(n);if(i)return i;const o=this.bytes(n);if(!o)return;const a=n.split("/").pop()??"file";let r=a;for(let s=2;this.files.has(`media/${r}`);s++)r=`${String(s)}-${a}`;return this.files.set(`media/${r}`,o),this.byPart.set(n,`./media/${r}`),`./media/${r}`}}export function shapeCode(e,n,i,o,a){const r=[],s=new Set,_=new Map,d=new Map;return n.forEach((t,p)=>{const c=`${e}_s${String(p)}`;let l=e;if(t.group!==void 0&&(l=d.get(t.group)??`${e}_g${String(d.size)}`,d.has(t.group)||(d.set(t.group,l),r.push(`const ${l} = ${e}.shapes.add_group_shape();`,`${l}.name = ${str(E(t.group,s,"group"))};`))),t.flip&&!z(t.geometry)&&o(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 f=/^[A-Za-z0-9_-]+$/u.test(t.name)?E(t.name,s,"placeholder"):E(P[t.placeholder.type],s,"placeholder");_.set(t.placeholder.idx,f);const h=bodyLines(`${c}.text_frame`,t.text,a?MADE.placeholder(t.placeholder.type):{},ne(t.placeholder.type));r.push(`${h.length>0?`const ${c} = `:""}${l}.placeholders.add(PP_PLACEHOLDER.${ae[t.placeholder.type]}${t.frame?`, ${y(t.frame)}`:""}${f===P[t.placeholder.type]?"":`, { name: ${str(f)} }`});`,...h);return}const m=E(t.name,s,t.kind);if(!t.frame){o(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 f=i.path(t.part);if(!f){o(t,"p:pic","its file is not in the file");return}t.crop&&Object.values(t.crop).some(h=>h>0)&&o(t,"a:srcRect","a picture's crop on a master or a layout"),r.push(...t.rotation===void 0?[`${l}.shapes.${t.kind==="movie"?"add_movie":"add_picture"}(${str(f)}, ${y(t.frame)}).name = ${str(m)};`]:[`const ${c} = ${l}.shapes.${t.kind==="movie"?"add_movie":"add_picture"}(${str(f)}, ${y(t.frame)});`,`${c}.name = ${str(m)};`,...L(c,t)]);return}if(t.table||t.chart){o(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&&z(t.geometry)){const f=t.frame,[h,D]=t.flip?.h?[f.left+f.width,f.left]:[f.left,f.left+f.width],[U,B]=t.flip?.v?[f.top+f.height,f.top]:[f.top,f.top+f.height];r.push(`const ${c} = ${l}.shapes.add_connector(${ce(t.geometry??"line")}, ${emu(h)}, ${emu(U)}, ${emu(D)}, ${emu(B)});`,`${c}.name = ${str(m)};`,...I(c,t.adjustments),...L(c,t),...M(c,t,G));return}const H=t.path?fe(l,t,t.path):t.kind==="textbox"?`${l}.shapes.add_textbox(${y(t.frame)})`:`${l}.shapes.add_shape(${se(t.geometry??"rect")}, ${y(t.frame)})`;r.push(`const ${c} = ${H};`,`${c}.name = ${str(m)};`,...I(c,t.adjustments),...L(c,t),...t.kind==="textbox"?[...C(c,t.fill,null),...M(c,t,{line:null})]:[...C(c,t.fill,$.fill),...M(c,t,$)],...bodyLines(`${c}.text_frame`,t.text&&{...t.text,levels:ue(t)},MADE[t.kind==="textbox"?"textbox":"autoshape"]),...t.text?me(c,`${c}.text_frame`,t.text.paragraphs,t.kind==="autoshape"?{alignment:$.alignment}:{}):[])}),{lines:r,names:_}}export const frameFile=e=>({x:O(e.left),y:O(e.top),w:O(e.width),h:O(e.height)});export{g as colorFile};const R=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:g(e.gridline_color)},...e.line_color===void 0?{}:{line_color:g(e.line_color)}});function x(e,n){return Object.fromEntries(Object.entries(e).filter(([i,o])=>canonical(o)!==canonical(n[i])))}const F=(e,n,i)=>{const o=n&&i(n);return o&&Object.keys(o).length>0?{[e]:o}:{}};function he(e){const n={gridline_color:{rgb:u.gridline},line_color:{rgb:u.axisLine}},i=e.font_size??u.fontSize,o=Y(e.type)&&N(e.type)!=="clustered",a=(Z(e.type)||W(e.type))&&J(e.type),{value_axis:r,category_axis:s,labels:_,...d}=e;return{...x(d,{gap_width:u.gapWidth,hole_size:u.holeSize,vary_by_categories:j(e.type),font_size:u.fontSize,title_size:Math.round(i*u.titleScale*100)/100,font_color:"dk1",...o?{overlap:100}:{}}),series:e.series.map((t,p)=>x(t,{color:X(p),line_width:a?u.lineWidth:t.line_width,marker_size:u.marker})),...F("value_axis",r,t=>x(t,{...n,has_major_gridlines:!0,...N(e.type)==="percentStacked"?{number_format:"0%"}:{}})),...F("category_axis",s,t=>x(t,{...n,has_major_gridlines:!1})),..._?{labels:x(_,{position:q({type:e.type}),...j(e.type)?{color:"lt1"}:{}})}:{}}}export function chartFile(e){const n=he(e),i=n.labels;return{type:n.type,...n.categories.length===0&&n.series.some(o=>o.x)?{}:{categories:n.categories},series:n.series.map(o=>({name:o.name,values:o.values,...o.x===void 0?{}:{x:o.x},...o.color===void 0?{}:{color:g(o.color)},...o.number_format===void 0?{}:{format:o.number_format},...o.smooth===void 0?{}:{smooth:o.smooth},...o.line_width===void 0?{}:{line_width:o.line_width},...o.marker_size===void 0?{}:{marker_size:o.marker_size}})),...n.legend===void 0?{}:{legend:n.legend},...i?{labels:{...i.show_value===void 0?{}:{value:i.show_value},...i.show_percentage===void 0?{}:{percentage:i.show_percentage},...i.show_category_name===void 0?{}:{category:i.show_category_name},...i.show_series_name===void 0?{}:{series:i.show_series_name},...i.number_format===void 0?{}:{format:i.number_format},...i.position===void 0?{}:{position:i.position},...i.size===void 0?{}:{size:i.size},...i.color===void 0?{}:{color:g(i.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.hole_size===void 0?{}:{hole_size:n.hole_size},...n.value_axis?{value_axis:R(n.value_axis)}:{},...n.category_axis?{category_axis:R(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:g(n.font_color)}}}export const canonical=e=>JSON.stringify(e,(n,i)=>i&&typeof i=="object"&&!Array.isArray(i)?Object.fromEntries(Object.entries(i).sort(([o],[a])=>o<a?-1:1)):i);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{stringify as me}from"yaml";import{AUTOSHAPE_STYLE as K,CONNECTOR_STYLE as ge,EAST_ASIAN_FONT as je,isConnectorGeometry as Pe,NAME_OF_TYPE as Te,OFFICE_TEXT_STYLES as be,pathText as Fe,SHADOW_DEFAULTS as Ae,SLIDE_SIZES as Le,toPt as L}from"@allyhub-next/slides-core";import{bodyLines as Ne,chartFile as Ce,colorFile as j,colorLines as ye,emu as _e,FILE_TEXTBOX as Ie,frameFile as we,levelLines as ze,lineFile as ae,MADE as De,MediaFiles as Be,sameColor as ne,shapeCode as ke,str as oe}from"./code.js";import{nameOf as te}from"./names.js";import{variesIn as se,wordsOf as re}from"./script.js";export const UNMAPPED=!0;const Oe=e=>({...e.angle===0?{}:{angle:Math.round(e.angle*1e3)/1e3},stops:e.stops.map(c=>({at:Math.round(c.at*1e3)/1e3,color:j(c.color),...c.transparency===void 0?{}:{transparency:c.transparency}}))}),ie=e=>({color:j(e.color),blur:L(e.blur),distance:L(e.distance),angle:Math.round(e.angle*1e3)/1e3,...e.transparency===Ae.transparency?{}:{transparency:e.transparency}});function xe(e){const c=Object.fromEntries(Object.entries(e??{}).filter(([,w])=>w>0));return Object.keys(c).length>0?c:void 0}const ve=e=>({...e.locked?{locked:!0}:{},...e.rotation===void 0?{}:{rotation:e.rotation},...e.flip?.h?{flip_h:!0}:{},...e.flip?.v?{flip_v:!0}:{}});function le(e,c,w){const g=e.flatMap(t=>t.runs.filter(u=>u.text!=="\v"&&u.text.trim()!==""));if(g.length===0)return;const y=t=>{const u=g.map(t),_=u[0];return _!==void 0&&u.every(S=>S===_)?_:void 0},f=(t,u,_)=>{const S=e.map(T=>JSON.stringify(t(T)??null));if(S.every(T=>T===S[0]))return e[0]&&t(e[0]);c(u,_)},x=y(t=>t.font?.size),$=y(t=>t.font?.color===void 0?void 0:j(t.font.color)),N=y(t=>t.font?.name),C=y(t=>t.font?.underline===!0?!0:void 0),P=y(t=>t.font?.strike===!0?!0:void 0),k=e.every(t=>t.alignment===e[0]?.alignment)?e[0]?.alignment:void 0;k===void 0&&e.some(t=>t.alignment!==void 0)&&c("a:pPr@algn","paragraphs aligned differently take the first's");const i=e.every(t=>t.numbered===e[0]?.numbered)?e[0]?.numbered:void 0,s=f(t=>t.line_spacing,"a:lnSpc","paragraphs with different line spacing take their levels'");s&&"fixed"in s&&c("a:lnSpc/a:spcPts","exact line spacing is its levels'");const d=f(t=>t.space_before,"a:spcBef","paragraphs with different space before take their levels'"),O=f(t=>t.space_after,"a:spcAft","paragraphs with different space after take their levels'"),o=i===void 0?f(t=>t.bullet,"a:buChar","paragraphs with different bullets take their levels'"):void 0;g.some(t=>t.font?.spacing!==void 0&&t.font.spacing!==0)&&c("a:rPr@spc","letter spacing");const r={...x===void 0?{}:{size:L(x)},...C===void 0?{}:{underline:C},...P===void 0?{}:{strike:P},...$===void 0?{}:{color:$},...N===void 0?{}:{font:N},...k===void 0?{}:{align:k},...s&&"lines"in s?{line_spacing:Math.round(s.lines*1e3)/1e3}:{},...d===void 0?{}:{space_before:L(d)},...O===void 0?{}:{space_after:L(O)},...w===void 0?{}:{anchor:w},...o===void 0||o!==null&&o.length>2?{}:{bullet:o??!1},...i===void 0?{}:{numbered:i}};return Object.keys(r).length>0?r:void 0}export function importDeck(e,c){const w=[...e.report],g=new Be(e.bytes),y=Object.entries(Le).find(([,[i,s]])=>i===e.width&&s===e.height)?.[0],f=[];Object.keys(e.theme).length>0&&f.push(`prs.theme.colors = ${JSON.stringify(e.theme)};`);const x=Object.fromEntries(Object.entries(e.fonts).filter(([i,s])=>!i.endsWith("_east_asian")||s!==je));Object.keys(x).length>0&&f.push(`prs.theme.fonts = ${JSON.stringify(x)};`);const $=new Map;e.masters.forEach((i,s)=>{const d=`master${String(s+1)}`,O=o=>(r,t,u)=>{w.push({kind:"cannot-hold",part:"",where:r?`${o} › "${r.name}"`:o,what:t,detail:u})};f.push("",`const ${d} = prs.slide_masters.add(${oe(i.name)});`),i.background&&!ne(i.background,"lt1")&&f.push(`${d}.background.fill.solid();`,...ye(`${d}.background.fill.fore_color`,i.background));for(const[o,r]of[["title","title_style"],["body","body_style"],["other","other_style"]])f.push(...ze(`${d}.text_styles.${r}`,i.text_styles[o],be[o]));f.push(...ke(d,i.shapes,g,O(`master "${i.name}"`),!0).lines),i.layouts.forEach((o,r)=>{const t=`${d}_layout${String(r+1)}`;f.push("",`const ${t} = ${d}.slide_layouts.add(${oe(o.name)});`),o.display_master_shapes===!1&&f.push(`${t}.display_master_shapes = false;`),o.background&&f.push(`${t}.background.fill.solid();`,...ye(`${t}.background.fill.fore_color`,o.background));const u=ke(t,o.shapes,g,O(`layout "${o.name}"`),!1);f.push(...u.lines),$.set(o.name,u.names)})});const N=new Set,C=[],P=[];e.slides.forEach((i,s)=>{const{slide:d,words:O}=Re(i,s,N,$.get(i.layout)??new Map,g,w,e.masters.find(o=>o.layouts.some(r=>r.name===i.layout))?.text_styles.other??be.other);C.push(d),P.push(O)});const k=new Map;k.set("slides.ts",['import { Emu, MSO_ANCHOR, MSO_AUTO_SIZE, MSO_CONNECTOR, MSO_SHAPE, PP_ALIGN, PP_PLACEHOLDER, Pt, presentation } from "@allyhub/sdk/slides";',"",`// ${c.source}, imported by allyhub slides import: its masters and layouts.`,`export default presentation({ size: ${y?oe(y):`{ width: ${_e(e.width)}, height: ${_e(e.height)} }`} }, (prs) => {`,...f.map(i=>i===""?"":` ${i}`),"});",""].join(`
|
|
3
|
+
`)),k.set("slides.yaml",me({slides:C},{lineWidth:0})),k.set(`script.${c.lang}.yaml`,me({...e.title?{title:e.title}:{},slides:P},{lineWidth:0}));for(const[i,s]of g.files)k.set(i,s);for(const[i,s]of g.byPart){const d=/\.(emf|wmf|tiff?)$/iu.exec(s)?.[1];d&&w.push({kind:"cannot-hold",part:i,what:"a:blip",detail:`a picture as ${d.toUpperCase()}, which the stage cannot draw (its export keeps it)`})}return{files:k,report:w,reasons:e.reasons}}const He=new Set(["dt","ftr","sldNum"]);function Re(e,c,w,g,y,f,x){const $=`slide ${String(c+1)}`,C=e.shapes.find(n=>n.placeholder?.type==="title"||n.placeholder?.type==="ctrTitle")?.text?.paragraphs.map(n=>n.runs.map(m=>m.text).join("")).join(" ")??"",P=e.name!==void 0&&/^[A-Za-z0-9_-]+$/u.test(e.name)&&!w.has(e.name)?te(e.name,w,"slide"):te(C,w,`slide-${String(c+1)}`),k=new Set(g.values()),i={},s={},d={},O=new Map,o=new Map,r=new Set,t=[];for(const n of e.shapes){const m=`${$} › "${n.name}"`,D=v=>(p,h)=>{f.push({kind:v,part:e.part,where:m,what:p,detail:h})},E=D("cannot-hold");if(n.placeholder){const v=g.get(n.placeholder.idx)??[...g.values()].find(h=>h===Te[n.placeholder?.type??"body"]);if(!v){E("p:ph","its layout has no such placeholder; it is left out");continue}O.set(n.name,v),t.push({name:v,placeholder:!0});const p={};if(n.frame&&(p.frame=we(n.frame)),Object.assign(p,ve(n)),(n.kind==="picture"||n.kind==="movie")&&n.part){const h=y.path(n.part);h&&(p[n.kind==="movie"?"movie":"picture"]=h);const H=xe(n.crop);H&&(p.crop=H)}if(n.text&&n.placeholder.type!=="sldNum"){const h=re(n.text.paragraphs,se(n.text.paragraphs),E);h!==void 0&&(s[v]=h);const H=le(n.text.paragraphs,E,n.text.vertical_anchor);H&&(p.text=H)}n.fill&&(p.fill=j(n.fill)),n.line!==void 0&&(p.line=n.line===null?"none":j(n.line)),n.alt!==void 0&&(d[v]=n.alt),He.has(n.placeholder.type)&&r.add(v),i[v]=p;continue}const B=te(n.name,k,n.kind);if(O.set(n.name,B),!n.frame){E("a:xfrm","a shape with no frame is left out");continue}const G=Ue(n,B,y,D,s,x);if(G){if(n.group!==void 0){const v=o.get(n.group)??te(n.group,k,"group");o.set(n.group,v),G.group=v}n.alt!==void 0&&(d[B]=n.alt),i[B]=G,t.push({name:B,placeholder:!1})}}const u=t.map(n=>n.placeholder).lastIndexOf(!0),_=t.findIndex(n=>n.placeholder),S=[...g.values()],T=t.filter(n=>n.placeholder).map(n=>S.indexOf(n.name)),U=t.some((n,m)=>!n.placeholder&&m>_&&m<u)||T.some((n,m)=>m>0&&n<(T[m-1]??-1));t.forEach((n,m)=>{const D=i[n.name]??(i[n.name]={});U?D.z=m-t.length:!n.placeholder&&_>=0&&m<_&&(D.z=-1)});const z=Object.fromEntries(Object.entries(i).filter(([n,m])=>Object.keys(m).length>0||r.has(n))),J=e.animations.flatMap(n=>{const m=O.get(n.shape);return m!==void 0?[{...n,shape:m}]:(f.push({kind:"cannot-hold",part:e.part,where:$,what:"p:spTgt",detail:`an animation of ${n.shape}, which is left out`}),[])}),Z=e.background?e.background.picture!==void 0?(()=>{const n=y.path(e.background.picture);return n===void 0?void 0:{picture:n}})():e.background.gradient?{gradient:Oe(e.background.gradient)}:e.background.fill!==void 0?{fill:j(e.background.fill)}:void 0:void 0;return{slide:{id:P,layout:e.layout,...e.hidden?{hidden:!0}:{},...Z?{background:Z}:{},...Object.keys(z).length>0?{shapes:z}:{},...J.length>0?{animations:J}:{},...e.transition?{transition:e.transition}:{},...e.advance===void 0?{}:{advance_after:e.advance}},words:{id:P,...Object.keys(s).length>0?{text:s}:{},...Object.keys(d).length>0?{alt:d}:{},...e.notes===void 0?{}:{notes:e.notes}}}}function Ue(e,c,w,g,y,f){const x=g("cannot-hold"),{kind:$,frame:N,rotation:C,flip:P,locked:k,text:i,fill:s,fill_transparency:d,gradient:O,shadow:o,line:r,line_width:t,line_dash:u,line_begin:_,line_end:S,geometry:T,path:U,table:z,chart:J,adjustments:Z,part:n,crop:m,text_color:D}=e;if(!N)return;const E={frame:we(N),...ve({...C===void 0?{}:{rotation:C},...P?{flip:P}:{},...k?{locked:k}:{}})},B=Z?{adjustments:Z.map(F=>Math.round(F*1e5)/1e5)}:{},G={...O?{gradient:Oe(O)}:{},...o?{shadow:ie(o)}:{}};if(J)return J.title!==void 0&&(y[c]=J.title),{chart:Ce(J),...E};if(z){const F=z.rows.reduce((a,b)=>a+b.height,0),W=z.rows.filter(a=>a.height<=0).length,A=W===0?0:Math.max(12700,(N.height-F)/W),R=z.rows.map(a=>a.height>0?a:{...a,height:A}),Y=R.reduce((a,b)=>a+b.height,0),V=R.map(a=>({...a,height:Y>0?a.height*N.height/Y:a.height})),ce=z.columns.map(L),fe=a=>Math.round(a.reduce((b,I)=>b+I,0)*100)/100,ue=a=>{const b=a.map(I=>JSON.stringify(I??null));return b.every(I=>I===b[0])?a[0]:void 0},Ee={table:{columns:ce,rows:V.map(a=>{const b=a.cells.filter(l=>!l.spanned).map(l=>l.fill),I=ue(b);I===void 0&&b.some(l=>l!==void 0)&&g("approximated")("a:tcPr/a:solidFill","cells of a row filled differently take its first's");const ee=I??b.find(l=>l!=null),M=a.cells.map(l=>l.borders?.bottom?.color),X=ue(M)??M.find(l=>l!==void 0);a.cells.some(l=>l.borders?.left!==void 0||l.borders?.right!==void 0||l.borders?.top!==void 0)&&g("approximated")("a:tcPr/a:lnL","a cell's edges are its row's foot");const q=le(a.cells.flatMap(l=>l.text.paragraphs),x),pe=a.cells.flatMap(l=>l.text.paragraphs.flatMap(Me=>Me.runs)).filter(l=>l.text.trim()!==""),he=pe.length>0&&pe.every(l=>l.font?.bold===!0);return{height:L(a.height),...ee===void 0?{}:{fill:j(ee)},...q??he?{text:{...q,...he?{bold:!0}:{}}}:{},...X===void 0?{}:{line:j(X)}}})},...E,frame:{...E.frame,w:fe(ce),h:fe(V.map(a=>L(a.height)))}};return V.some(a=>a.cells.some(b=>b.spanned))&&x("a:tc@gridSpan","merged cells are apart"),y[c]=V.map(a=>a.cells.map(b=>{const ee=a.cells.flatMap(M=>M.text.paragraphs.flatMap(X=>X.runs)).filter(M=>M.text.trim()!=="").every(M=>M.font?.bold===!0)?b.text.paragraphs.map(M=>({...M,runs:M.runs.map(X=>{const q={...X.font};return delete q.bold,{...X,font:q}})})):b.text.paragraphs;return re(ee,se(a.cells.flatMap(M=>M.text.paragraphs)),x)??""})),Ee}if(($==="picture"||$==="movie")&&n){const F=w.path(n);if(!F)return;const W=xe(m);return{[$==="movie"?"movie":"picture"]:F,...E,...W?{crop:W}:{},...o?{shadow:ie(o)}:{}}}const v={...t===void 0||r===null?{}:{line_width:L(t)},...ae({...u===void 0?{}:{line_dash:u},..._===void 0?{}:{line_begin:_},...S===void 0?{}:{line_end:S}})};if(!U&&T!==void 0&&Pe(T))return{geometry:T,...B,...E,...r===void 0||ne(r,ge.line)?{}:{line:r===null?"none":j(r)},...t===void 0||t===ge.line_width?{}:{line_width:L(t)},...ae({...u===void 0?{}:{line_dash:u},..._===void 0?{}:{line_begin:_},...S===void 0?{}:{line_end:S}}),...o?{shadow:ie(o)}:{}};const p=$==="textbox",h=p?{textbox:!0,...E}:U?{path:{w:U.w,h:U.h,d:Fe(U.steps)},...E}:{geometry:T??"rect",...B,...E},H=p?null:K.fill;O?Object.assign(h,G):(s&&!ne(s,H)&&(h.fill=j(s)),d!==void 0&&s&&(h.fill_transparency=d),s===null&&H!==null&&(h.fill="none"),o&&(h.shadow=ie(o)));const $e=p?null:K.line;r!==void 0&&!ne(r,$e)&&(h.line=r===null?"none":j(r)),!p&&r!==null&&t!==void 0&&t!==K.line_width?Object.assign(h,v):r!==null&&Object.assign(h,ae({...u===void 0?{}:{line_dash:u},..._===void 0?{}:{line_begin:_},...S===void 0?{}:{line_end:S}})),p&&r!==void 0&&r!==null&&t!==void 0&&(h.line_width=L(t));const Q=p?Ie:De.autoshape,Se=i?.vertical_anchor===void 0||i.vertical_anchor===Q.vertical_anchor?void 0:i.vertical_anchor,de=Ne("",i&&{...i,levels:[],...Q.vertical_anchor===void 0?{}:{vertical_anchor:Q.vertical_anchor}},Q);if(de.length>0&&x("a:bodyPr",`its text frame (${de.map(F=>F.replace(/^\.(\w+) = .*$/u,"$1")).join(", ")}) is the basic ${p?"text box's":"shape's"}`),i){const F=re(i.paragraphs,se(i.paragraphs),x);F!==void 0&&(y[c]=F);const W=i.paragraphs.map(R=>({...R,alignment:R.alignment??i.levels[R.level]?.alignment??f[R.level]?.alignment??"l",runs:R.runs.map(Y=>Y.font?.color!==void 0||D===void 0?Y:{...Y,font:{...Y.font,color:D}})})),A=le(p?i.paragraphs:W,x,Se);A&&!p&&A.color===j(K.font_color)&&delete A.color,A&&!p&&A.align===K.alignment&&delete A.align,A&&Object.keys(A).length>0&&(h.text=A)}return h}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{SCRIPT_NAME as i}from"@allyhub-next/formats";export function nameOf(e,o,s){if(i.test(e)&&!o.has(e))return o.add(e),e;const t=e.normalize("NFKD").toLowerCase().replace(/[^a-z0-9_-]+/gu,"-").replace(/^-+|-+$/gu,"").slice(0,40)||s;let r=t;for(let n=2;o.has(r);n++)r=`${t}-${String(n)}`;return o.add(r),r}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{colorFile as h}from"@allyhub-next/formats";import{writeMarks as m}from"@allyhub-next/video-core";import{EMU_PER_PT as g}from"@allyhub-next/slides-core";const a=s=>s.font?.color===void 0?void 0:h(s.font.color);function b(s,i){const e=s.font,n=[],f=a(s);return i.color&&f!==void 0&&n.push(`color="${f}"`),i.font&&e?.name!==void 0&&n.push(`font="${e.name}"`),i.size&&e?.size!==void 0&&n.push(`size="${String(Math.round(e.size/g*100)/100)}"`),e?.bold===!1&&n.push('bold="false"'),e?.italic===!1&&n.push('italic="false"'),i.underline&&e?.underline===!0&&n.push('underline="true"'),e?.link!==void 0&&n.push(`link="${e.link.replace(/"/gu,"%22")}"`),e?.highlight!==void 0&&n.push(`highlight="${e.highlight}"`),e?.baseline!==void 0&&e.baseline!==0&&n.push(`baseline="${String(Math.round(e.baseline*1e3)/1e3)}"`),i.strike&&e?.strike===!0&&n.push('strike="true"'),n.join(" ")}function p(s,i,e){const n=s.runs.flatMap(r=>r.text!=="\v"?[r]:(e("a:br","a line break inside a paragraph is a space"),[{text:" "}])),f=[];let t;const o=()=>{if(!t)return;const r=m(t.runs);f.push(t.span===""?r:`<span ${t.span}>${r}</span>`),t=void 0};for(const r of n){const u=r.text.trim()===""?t?.span??"":b(r,i);t?.span!==u&&o(),t??={span:u,runs:[]},t.runs.push({text:r.text,...r.font?.bold===!0?{strong:!0}:{},...r.font?.italic===!0?{em:!0}:{}})}return o(),f.join("")}export function wordsOf(s,i,e){const n=s.length===1&&!s.some(t=>t.runs.some(o=>o.text!==""))?[]:s;if(n.length===0)return;if(n.every(t=>t.level===0)){const t=n.map(o=>p(o,i,e));return t.length===1?t[0]:t}const f=(t,o)=>{const r=[];let u=t;for(;u<n.length;){const l=n[u];if(!l||l.level<o)break;if(l.level>o){const[d,c]=f(u,o+1);r.push(d),u=c;continue}r.push(p(l,i,e)),u++}return[r,u]};return f(0,0)[0]}export function variesIn(s){const i=s.flatMap(e=>e.runs).filter(e=>e.text.trim()!==""&&e.text!=="\v");return{color:new Set(i.map(e=>JSON.stringify(a(e)??null))).size>1,font:new Set(i.map(e=>e.font?.name??"")).size>1,size:new Set(i.map(e=>e.font?.size??0)).size>1,underline:!i.every(e=>e.font?.underline===!0),strike:!i.every(e=>e.font?.strike===!0)}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export{filesOf,picturedShapes,pptxParts,writePptx}from"./write.js";export{readPptx}from"./read.js";export{importDeck
|
|
2
|
+
export{filesOf,picturedShapes,pptxParts,writePptx}from"./write.js";export{readPptx}from"./read/index.js";export{importDeck}from"./import/index.js";export{nameOf}from"./import/names.js";export{variesIn,wordsOf}from"./import/script.js";export{asFace,eotOf,fontInfo,refusedEmbedding}from"./fonts.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{as as pe}from"@allyhub-next/ooxml";import{EMU_PER_PT as be}from"@allyhub-next/slides-core";import{colorAt as P,say as xe}from"./common.js";const we=(n,o)=>n===void 0||n===""?o:n,C=n=>n===void 0?void 0:n.attr("val")??!0,L=n=>{n?.one("c:ptCount")?.attr("val");const o=[];for(const a of n?.all("c:pt")??[])o[a.attr("idx")??o.length]=a.one("c:v")?.text()??"";return Array.from(o,a=>a??"")};function O(n){return n?.one("c:f")?.skip("a series' formula into its workbook: the deck writes its own"),n?.one("c:strCache")}function N(n){return n?.one("c:f")?.skip("a series' formula into its workbook: the deck writes its own"),n?.one("c:numCache")}const ye=["c:axId","c:crossAx","c:axPos","c:crosses","c:crossesAt","c:crossBetween","c:auto","c:lblAlgn","c:lblOffset","c:noMultiLvlLbl","c:majorTickMark","c:minorTickMark","c:tickLblPos","c:txPr"];function D(n){n?.one("a:bodyPr")?.skip("a chart text's body: the deck sets its own"),n?.one("a:lstStyle")?.skip("a chart text's list style");const o=n?.all("a:p")[0];return o?.one("a:endParaRPr")?.skip("the font of a paragraph's end"),o?.one("a:pPr")?.one("a:defRPr")}function ve(n,o){for(const u of ye)n.one(u)?.skip("an axis's id, place, ticks, crossing and label alignment: the deck draws its own");const a=n.one("c:scaling"),r=a?.one("c:min")?.attr("val"),l=a?.one("c:max")?.attr("val"),k=n.one("c:majorUnit")?.attr("val"),i=n.one("c:numFmt"),d=i?.attr("formatCode"),A=i?.attr("sourceLinked"),t=u=>{const s=u?.one("a:ln");return s?.attr("w"),s?.one("a:noFill"),s?.one("a:round")?.skip("a chart line's join"),P(s?.one("a:solidFill"),o,"c:spPr")?.color},p=n.one("c:majorGridlines"),c=t(p?.one("c:spPr")),x=t(n.one("c:spPr"));return{...r===void 0?{}:{minimum_scale:r},...l===void 0?{}:{maximum_scale:l},...k===void 0?{}:{major_unit:k},has_major_gridlines:p!==void 0,...C(n.one("c:delete"))===!0?{visible:!1}:{},...d===void 0||d==="General"||A===!0?{}:{number_format:d},...a?.one("c:orientation")?.attr("val")==="maxMin"?{reverse_order:!0}:{},...c===void 0?{}:{gridline_color:c},...x===void 0?{}:{line_color:x}}}export function chartOf(n,o){const a=o.read.pkg,r=a.open(n);if(!r)return"its part is not in the file";const l={...o,part:n};r.one("c:date1904")?.attr("val"),r.one("c:lang")?.skip("a chart's language"),r.one("c:style")?.skip("a chart's style number: its colours are read where it sets them"),r.one("c:roundedCorners")?.attr("val")===!0&&xe(l,"cannot-hold","c:roundedCorners","a chart's rounded corners"),r.one("c:printSettings")?.skip("a chart's print settings");const k=r.one("c:externalData");if(k){const e=a.rel(n,k.attr("r:id"));e&&!e.external&&a.leave(e.target,"a chart's workbook: the deck writes one from its numbers"),k.one("c:autoUpdate")?.attr("val")}const i=r.one("c:chart");i?.one("c:autoTitleDeleted")?.attr("val"),i?.one("c:plotVisOnly")?.attr("val"),i?.one("c:showDLblsOverMax")?.skip("labels over a chart's maximum"),i?.one("c:dispBlanksAs")?.skip("how a chart draws a blank value");const d=i?.one("c:plotArea");d?.one("c:layout")?.skip("a chart's plot area's own layout");const A=(d?.kids()??[]).filter(e=>e.key.endsWith("Chart")),[t]=A,p=e=>(r.consume(),e);if(!t)return p("it has no plot");if(A.length>1)return p("it combines several kinds of chart");t.use();const c=t.key;for(const e of t.all("c:axId"))e.attr("val");const x=t.one("c:grouping")?.attr("val"),u=x==="percentStacked"?"-stacked-100":x==="stacked"?"-stacked":"",s=t.all("c:ser"),I=s.map(e=>e.one("c:marker")?.one("c:symbol")?.attr("val")).some(e=>e!=="none");t.one("c:marker");const V=(()=>{if(c==="c:barChart")return`${t.one("c:barDir")?.attr("val")==="bar"?"bar":"column"}${u===""?"-clustered":u}`;if(c==="c:lineChart")return u===""?I?"line-markers":"line":void 0;if(c==="c:areaChart")return`area${u}`;if(c==="c:pieChart")return"pie";if(c==="c:doughnutChart")return"doughnut";if(c==="c:scatterChart"){pe(t).one("c:scatterStyle")?.attr("val");const e=s.every(b=>b.one("c:spPr")?.one("a:ln")?.el.children.some(y=>y.local==="noFill")),g=s.every(b=>C(b.one("c:smooth"))===!0);return e?"scatter":g&&!I?"scatter-smooth":"scatter-lines"}})();if(!V)return p(`a deck has no ${c.slice(2)} chart`);if(s.length===0)return p("it has no series");const f=c==="c:scatterChart",[$]=s,E=f?void 0:$?.one("c:cat"),W=L(O(E?.one("c:strRef"))??N(E?.one("c:numRef"))),ke=s.map(e=>{if(e.one("c:idx")?.attr("val"),e.one("c:order")?.attr("val"),e!==$&&!f){const R=e.one("c:cat");O(R?.one("c:strRef"))?.consume(),N(R?.one("c:numRef"))?.consume()}const g=pe(e),b=N((f?g.one("c:yVal"):e.one("c:val"))?.one("c:numRef")),y=b?.one("c:formatCode")?.text()??"",ce=L(b),se=f?N(g.one("c:xVal")?.one("c:numRef")):void 0;se?.one("c:formatCode");const z=f?L(se):void 0,le=z?Math.max(z.length,ce.length):W.length,_=e.one("c:spPr"),ie=P(_?.one("a:solidFill"),l,"c:spPr")?.color??P(_?.one("a:ln")?.one("a:solidFill"),l,"c:spPr")?.color,de=C(e.one("c:smooth")),ue=_?.one("a:ln")?.attr("w");_?.one("a:ln")?.one("a:noFill"),_?.one("a:ln")?.one("a:round")?.skip("a chart line's join");const fe=e.one("c:marker"),me=fe?.one("c:size")?.attr("val");fe?.one("c:spPr")?.consume(),e.one("c:invertIfNegative")?.attr("val");const he=e.one("c:tx");return{name:we(L(O(he?.one("c:strRef")))[0]??he?.one("c:v")?.text(),`Series ${String(s.indexOf(e)+1)}`),values:Array.from({length:le},(R,T)=>{const v=ce[T];return v===void 0||v===""?null:Number(v)}),...z?{x:Array.from({length:le},(R,T)=>{const v=z[T];return v===void 0||v===""?null:Number(v)})}:{},...y===""||y==="General"?{}:{number_format:y},...ie===void 0?{}:{color:ie},...de===!0?{smooth:de}:{},...ue===void 0||c!=="c:lineChart"&&!f?{}:{line_width:ue/be},...me===void 0?{}:{marker_size:me}}}),j=i?.one("c:title"),F=j?.one("c:tx")?.one("c:rich");F?.one("a:bodyPr")?.skip("a chart title's text body"),F?.one("a:lstStyle");const B=F?.all("a:p")??[],G=B.map(e=>e.all("a:r").map(g=>g.one("a:t")?.text()??"").join("")).join(""),U=B[0]?.all("a:r")[0]?.one("a:rPr")?.attr("sz");j?.one("c:overlay")?.attr("val"),j?.one("c:layout")?.skip("a chart title's own place");const w=i?.one("c:legend"),S=w?.one("c:legendPos")?.attr("val");w?.one("c:overlay")?.attr("val"),w?.one("c:layout")?.skip("a legend's own place"),D(w?.one("c:txPr"))?.attr("sz");const ge={b:"bottom",t:"top",l:"left",r:"right"}[S==="b"||S==="t"||S==="l"?S:"r"],m=t.one("c:dLbls"),h=e=>C(m?.one(e))===!0;m?.one("c:showLegendKey")?.attr("val"),m?.one("c:showBubbleSize")?.attr("val"),m?.one("c:showLeaderLines")?.attr("val");const K=m?.one("c:numFmt")?.attr("formatCode"),X=m?.one("c:dLblPos")?.attr("val"),q=D(m?.one("c:txPr")),H=q?.attr("sz"),J=P(q?.one("a:solidFill"),l,"c:dLbls")?.color,Q=t.one("c:gapWidth")?.attr("val"),Y=t.one("c:overlap")?.attr("val"),Z=t.one("c:holeSize")?.attr("val"),ee=C(t.one("c:varyColors"));t.one("c:varyColors")?.attr("val"),t.one("c:firstSliceAng");const ne=D(r.one("c:txPr")),te=ne?.attr("sz"),oe=P(ne?.one("a:solidFill"),l,"c:txPr")?.color,M=d?.all("c:valAx")??[],re=f?M[1]:M[0],ae=f?M[0]:d?.one("c:catAx");return{type:V,categories:W,series:ke,...G===""?{}:{title:G},...w?{legend:ge}:{},...m&&(h("c:showVal")||h("c:showPercent")||h("c:showCatName")||h("c:showSerName"))?{labels:{show_value:h("c:showVal"),show_percentage:h("c:showPercent"),show_category_name:h("c:showCatName"),show_series_name:h("c:showSerName"),...K===void 0?{}:{number_format:K},...X===void 0?{}:{position:X},...H===void 0?{}:{size:H/100},...J===void 0?{}:{color:J}}}:{},...Q===void 0?{}:{gap_width:Number(Q)},...Y===void 0?{}:{overlap:Number(Y)},...Z===void 0?{}:{hole_size:Number(Z)},...ee===void 0?{}:{vary_by_categories:ee},...re?{value_axis:ve(re,l)}:{},...ae?{category_axis:ve(ae,l)}:{},...te===void 0?{}:{font_size:te/100},...U===void 0?{}:{title_size:U/100},...oe===void 0?{}:{font_color:oe}}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{as as f,colorIn as x}from"@allyhub-next/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 w=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&&w.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=x(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(i=>{const l=colorAt(i,e,"a:gs");if(!l)return[];const r=transparencyOf(l.alpha);return[{at:Math.min(1,Math.max(0,(i.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((i,l)=>i.at-l.at).slice(0,10)}}const y=["a:noFill","a:solidFill","a:gradFill","a:blipFill","a:pattFill","a:grpFill"];export function fillOf(t,e){const n=t&&f(t).choice(...y);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 m=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,i=n.attr("w"),l=n.one("a:prstDash")?.attr("val"),r=l==="solid"?void 0:l;r!==void 0&&!m.has(r)&&say(e,"approximated","a:prstDash",`${r} is drawn as dashes`);const u=c=>{const p=c?.attr("type");return p===void 0||p==="none"?void 0:p},o=n.one("a:headEnd"),d=n.one("a:tailEnd"),g=u(o),h=u(d);for(const c of[o,d])((c?.attr("w")??"med")!=="med"||(c?.attr("len")??"med")!=="med")&&say(e,"cannot-hold",`${c?.key??""}@w`,"a line end's own width or length");for(const c of["a:round","a:bevel","a:miter"])n.one(c)?.skip("a line's join (round, bevel, miter): the stage joins its own way");return{...s===void 0?{}:{line:s},...i===void 0?{}:{line_width:i},...r===void 0?{}:{line_dash:m.has(r)?r:"dash"},...g===void 0?{}:{line_begin:g},...h===void 0?{}:{line_end:h}}}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=o=>{if(!o)return;const d=x(o,e.colors);return{idx:o.attr("idx")??0,ctx:{...e,colors:{...e.colors,...d?{placeholder:d}:{}}}}},s={},i=a(n.one("a:fillRef"));if(i){const o=i.idx>=1001?e.read.matrix.background[i.idx-1001]:i.idx>0?e.read.matrix.fill[i.idx-1]:void 0,d=o?fillElement(o,i.ctx):{fill:null};Object.assign(s,d??{})}const l=a(n.one("a:lnRef"));if(l){const o=l.idx>0?e.read.matrix.line[l.idx-1]:void 0;Object.assign(s,o?lineOf(o,l.ctx):{line:null})}const r=a(n.one("a:effectRef"));if(r&&r.idx>0){const o=e.read.matrix.effect[r.idx-1],d=shadowOf(o&&f(o).one("a:effectLst"),r.ctx);d&&(s.shadow=d)}const u=n.one("a:fontRef");if(u){const o=colorAt(u,e,"a:fontRef");o&&(s.text_color=o.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);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{unzipSync as xe}from"fflate";import{withinZip as Le}from"@allyhub-next/formats";import{DEFAULT_COLOR_MAP as N,Package as Pe,SCHEME_COLORS as Oe,colorIn as me}from"@allyhub-next/ooxml";import{OFFICE_TEXT_STYLES as ve}from"@allyhub-next/slides-core";import{colorAt as Me,fillElement as Te,fillOf as Ie,say as f}from"./common.js";import{shapesOf as ee}from"./shapes.js";import{levelsOf as X,paragraphsOf as Fe}from"./text.js";import{animationsOf as Ee,transitionOf as _e}from"./timing.js";const ue={presProps:"presentation properties (how a show runs, recent colours)",viewProps:"PowerPoint's view of the file (zoom, guides, the last slide shown)","extended-properties":"the application's statistics of the file",thumbnail:"a preview picture of the first slide",printerSettings:"printer settings",notesMaster:"the notes pages' master: a deck's notes are text",handoutMaster:"the handouts' master"};function he(s){if(!s)return N;const o={...N};for(const e of["bg1","tx1","bg2","tx2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"]){const r=s.attr(e);r!==void 0&&(o[e]=r)}return s.one("a:extLst"),o}function ge(s,o){o?.one("a:masterClrMapping");const e=o?.one("a:overrideClrMapping");return e?he(e):s}function te(s,o){const e=s?.one("p:bg");if(!e)return;e.ignore(["bwMode"],"a background's black and white printing mode");const r=e.one("p:bgPr");if(r){r.ignore(["shadeToTitle"],"a background shaded to its title, a legacy option"),r.one("a:effectLst");const w=r.one("a:blipFill");if(w){w.ignore(["dpi","rotWithShape"],"a picture's resolution and turning with its fill");const b=o.read.pkg.rel(o.part,w.one("a:blip")?.ignore(["cstate"],"a picture's compression state").attr("r:embed"));if(w.one("a:srcRect"),w.one("a:stretch")?.consume(),w.one("a:tile")&&f(o,"approximated","a:tile","a tiled background picture is stretched"),b&&!b.external)return o.read.pkg.bytes(b.target),{picture:b.target};f(o,"missing","a:blip","a background picture whose file is not in the file");return}const v=Ie(r,o);return v?.fill===null?{fill:"lt1"}:v?.fill!==void 0?{fill:v.fill}:v?.gradient?{gradient:v.gradient}:void 0}const a=e.one("p:bgRef");if(!a)return;const c=a.attr("idx")??0,m=me(a,o.colors),u=c>=1001?o.read.matrix.background[c-1001]:c>0?o.read.matrix.fill[c-1]:void 0;if(!u)return m?{fill:Me(a,o,"p:bgRef")?.color??"lt1"}:void 0;const h=Te(u,{...o,colors:{...o.colors,...m?{placeholder:m}:{}}});if(h?.fill!==void 0&&h.fill!==null)return{fill:h.fill};if(h?.gradient)return{gradient:h.gradient}}function ye(s,o){if(s){if(s.fill!==void 0)return s.fill;if(s.gradient)return f(o,"approximated","p:bg/a:gradFill","a master's or a layout's gradient background is its first colour"),s.gradient.stops[0]?.color;f(o,"cannot-hold","p:bg/a:blipFill","a master's or a layout's picture background")}}function ke(s,o){for(const e of["p:transition","p:timing"]){const r=s.one(e);r&&(f(o,"cannot-hold",e,`a ${e==="p:transition"?"transition":"animation"} on a master or a layout`),r.consume())}s.one("p:hf")?.skip("which of date, footer and slide number new slides get: a deck's slide shows them where it says so")}function ne(s){for(const o of s?.all("p:ext")??[])for(const e of["p14:creationId","p14:modId"])o.one(e)?.skip("PowerPoint's ids of a part across versions")}export function readPptx(s,o){const e=new Pe(xe(s,{filter:Le(o)})),r=e.relOfType("","officeDocument")?.target??"ppt/presentation.xml";for(const t of e.rels("")){const n=ue[t.type.split("/").pop()??""];n!==void 0&&!t.external&&e.leave(t.target,n)}e.ignoreExtensions(["p14:creationId","p14:modId","a16:creationId","a16:colId","a16:rowId","a14:useLocalDpi","p15:sldGuideLst","p14:discardImageEditData","p14:defaultImageDpi","p15:chartTrackingRefBased"],"PowerPoint's ids and settings across versions");const a=e.open(r);if(!a)throw new Error(`it has no presentation (${r})`);for(const t of e.rels(r)){const n=ue[t.type.split("/").pop()??""];n!==void 0&&!t.external&&e.leave(t.target,n)}const c={read:{pkg:e,matrix:{fill:[],line:[],effect:[],background:[]},faces:new Set},part:r,colors:{scheme:{},map:N},where:"presentation"};a.ignore(["saveSubsetFonts","autoCompressPictures","strictFirstAndLastChars","embedTrueTypeFonts","removePersonalInfoOnSave","bookmarkIdSeed","serverZoom","compatMode","conformance","showSpecialPlsOnTitleSld"],"how PowerPoint saves and shows the file");const m=a.attrOr("firstSlideNum");m!==1&&f(c,"cannot-hold","p:presentation@firstSlideNum",`slides numbered from ${String(m)}`),a.attrOr("rtl")&&f(c,"cannot-hold","p:presentation@rtl","a right-to-left presentation");const u=a.one("p:sldSz");u?.ignore(["type"],"a slide size's name: its width and height are read"),a.one("p:notesSz")?.skip("the notes pages' size"),a.one("p:notesMasterIdLst")?.consume(),a.one("p:handoutMasterIdLst")?.consume();for(const t of["p:embeddedFontLst","p:custShowLst","p:photoAlbum","p:custDataLst","p:kinsoku","p:modifyVerifier"]){const n=a.one(t);n&&(f(c,"cannot-hold",t,t==="p:embeddedFontLst"?"fonts carried in the file":t==="p:custShowLst"?"custom shows":t.slice(2)),n.consume())}for(const t of a.one("p:extLst")?.all("p:ext")??[])for(const n of t.kids())n.key==="p15:sldGuideLst"&&n.skip("PowerPoint's guides");for(const t of e.rels(r))(t.type.endsWith("/fonts")||t.type.endsWith("/font"))&&e.leave(t.target,"a font carried in the file (said above)");const h=u?.attr("cx")??12192e3,w=u?.attr("cy")??6858e3,b=(a.one("p:sldMasterIdLst")?.all("p:sldMasterId")??[]).flatMap(t=>{t.attr("id");const n=e.rel(r,t.attr("r:id"));return n?[n.target]:[]}),_=b[0]?e.relOfType(b[0],"theme")?.target:void 0,M=_?e.open(_):void 0;M?.attr("name");const R=M?.one("a:themeElements"),oe=R?.one("a:clrScheme");oe?.attr("name");const se={},W={};for(const t of Oe){const n=me(oe?.one(`a:${t}`),{scheme:{},map:N});n&&(se[t]=n.rgb,W[t]=n.rgb)}const Z=R?.one("a:fontScheme");Z?.attr("name");const $={},H=(t,n)=>{const i=Z?.one(t)?.one(n);i?.ignore(["panose","pitchFamily","charset"],"a font's panose, pitch and character set: its name picks it");const g=i?.attr("typeface");return g===""?void 0:g},U=H("a:majorFont","a:latin"),V=H("a:minorFont","a:latin"),Y=H("a:majorFont","a:ea"),q=H("a:minorFont","a:ea");U&&($.major=U),V&&($.minor=V),Y&&($.major_east_asian=Y),q&&($.minor_east_asian=q);const K={...c,part:_??"",where:"theme"};for(const t of["a:majorFont","a:minorFont"]){const n=Z?.one(t),l=n?.one("a:cs");l?.ignore(["panose","pitchFamily","charset"],"a font's panose, pitch and character set: its name picks it"),l?.attr("typeface")&&f(K,"cannot-hold",`${t}/a:cs`,"the theme's complex script face (Arabic, Hebrew, Thai…)");const i=n?.all("a:font")??[],g=n?.one("a:ea")?.el.attrs.find(p=>p.key==="typeface")?.value;i.some(p=>(p.attr("typeface")??"")!==""&&p.attr("typeface")!==g)&&f(K,"cannot-hold",`${t}/a:font`,"the theme's faces for each script (one East Asian face is the deck's)");for(const p of i)p.consume()}const j=R?.one("a:fmtScheme"),we={fill:j?.one("a:fillStyleLst")?.kids()??[],line:j?.one("a:lnStyleLst")?.kids()??[],effect:j?.one("a:effectStyleLst")?.kids()??[],background:j?.one("a:bgFillStyleLst")?.kids()??[]};j?.skip("the theme's style matrix: read where a shape's style names an entry of it"),R?.one("a:extLst")?.skip("the theme's extensions"),M?.one("a:objectDefaults")?.skip("the defaults PowerPoint gives a shape a person adds"),M?.one("a:extraClrSchemeLst")?.skip("other colour schemes PowerPoint offers"),M?.one("a:extLst")?.skip("the theme's family, PowerPoint's bookkeeping");const re=M?.one("a:custClrLst");re&&(f(K,"cannot-hold","a:custClrLst","the theme's custom colours"),re.consume());const C={pkg:e,matrix:we,faces:new Set([U,V,Y,q].filter(t=>t!==void 0))};c.read=C;const ae=e.relOfType(r,"tableStyles");ae&&e.open(ae.target)?.skip("the table styles: read where a table names one");for(const t of e.rels(r))if(t.type.endsWith("/notesMaster")||t.type.endsWith("/handoutMaster")){const n=e.relOfType(t.target,"theme")?.target;n&&e.leave(n,"the notes or handout master's theme")}for(const t of b.slice(1)){const n=e.relOfType(t,"theme")?.target;n&&n!==_&&e.leave(n,"a second master's theme: a deck has one"),n&&n!==_&&f({...c,part:n,where:"theme"},"cannot-hold","a:theme","a second master's own theme")}const ie=a.one("p:defaultTextStyle"),be=X(ie,{...c,read:C}),J=new Map,B=new Map,ce=b.map((t,n)=>{const l=e.open(t),i=l?.one("p:cSld"),g=i?.attr("name"),p=g===void 0||g===""?`Master ${String(n+1)}`:g;l?.ignore(["preserve"],"whether PowerPoint keeps an unused master");const O=he(l?.one("p:clrMap"));B.set(t,O);const S={read:C,part:t,colors:{scheme:W,map:O},where:`master "${p}"`};l&&ke(l,S),ne(l?.one("p:extLst"));const Q=l?.one("p:sldLayoutIdLst")?.all("p:sldLayoutId").flatMap(I=>{I.attr("id");const P=e.rel(t,I.attr("r:id"))?.target;if(!P)return[];const k=e.open(P),F=k?.one("p:cSld"),z=F?.attr("name");let d=z===void 0||z===""?`Layout ${String(J.size+1)}`:z;for(;[...J.values()].includes(d);)d=`${d} (${String(n+1)})`;J.set(P,d),k?.ignore(["type","matchingName","preserve","userDrawn","showMasterPhAnim"],"a layout's kind and bookkeeping in PowerPoint's gallery");const E=ge(O,k?.one("p:clrMapOvr"));E!==O&&B.set(P,E);const G={read:C,part:P,colors:{scheme:W,map:E},where:`layout "${d}"`};k&&ke(k,G),ne(k?.one("p:extLst"));const fe=ye(te(F,G),G);return F?.one("p:extLst")?.skip("a layout's extensions"),[{name:d,...fe?{background:fe}:{},...k?.attrOr("showMasterSp")===!1?{display_master_shapes:!1}:{},shapes:ee(F?.one("p:spTree"),G)}]})??[],y=ye(te(i,S),S),x=l?.one("p:txStyles"),L={},A=x?.one("p:titleStyle"),D=x?.one("p:bodyStyle"),T=x?.one("p:otherStyle");return A&&(L.title=X(A,S)),D&&(L.body=X(D,S)),T&&(L.other=X(T,S)),n===0&&ie&&$e(be,L.other??[])&&f(c,"cannot-hold","p:defaultTextStyle","the presentation's default text differs from its first master's other text, which a deck takes for both"),i?.one("p:extLst")?.skip("a master's extensions"),{name:p,...y?{background:y}:{},text_styles:L,shapes:ee(i?.one("p:spTree"),S),layouts:Q}}),Se=(a.one("p:sldIdLst")?.all("p:sldId")??[]).flatMap((t,n)=>{t.attr("id"),je(t);const l=e.rel(r,t.attr("r:id"))?.target;if(!l)return[];const i=e.open(l);if(!i)return[];const g=`slide ${String(n+1)}`,p=e.relOfType(l,"slideLayout")?.target,O=p?e.relOfType(p,"slideMaster")?.target:void 0,S=(p===void 0?void 0:B.get(p))??(O===void 0?void 0:B.get(O))??N,Q=ge(S,i.one("p:clrMapOvr")),y={read:C,part:l,colors:{scheme:W,map:Q},where:g};i.attrOr("showMasterPhAnim"),i.attrOr("showMasterSp")||f(y,"cannot-hold","p:sld@showMasterSp","a slide that hides its master's shapes (its layout's say for all its slides)"),ne(i.one("p:extLst"));const x=i.one("p:cSld"),L=x?.attr("name");for(const d of["p:custDataLst","p:controls"]){const E=x?.one(d);E&&(f(y,"cannot-hold",d,d==="p:controls"?"ActiveX controls":"a slide's custom data"),E.consume())}x?.one("p:extLst")?.skip("a slide's extensions");const A=te(x,y),D=ee(x?.one("p:spTree"),y),T=e.relOfType(l,"notesSlide")?.target,I=T?Ce(T,{...y,part:T,where:`${g} notes`}):void 0,{transition:P,advance:k}=_e(i.one("p:transition"),y),F=new Map(D.flatMap(d=>d.id===void 0?[]:[[d.id,d.name.replace(/^!!/u,"")]])),z=Ee(i.one("p:timing"),F,{width:h,height:w},y);return[{...L?{name:L}:{},layout:(p?J.get(p):void 0)??ce[0]?.layouts[0]?.name??"",hidden:!i.attrOr("show"),...I!==void 0&&I.trim()!==""?{notes:I}:{},shapes:D.map(d=>({...d,name:d.name.replace(/^!!/u,"")})),...A?{background:A}:{},animations:z,...P?{transition:P}:{},...k===void 0?{}:{advance:k},part:l}]}),le=e.rels("").find(t=>t.type.endsWith("/core-properties"))?.target,de=le?e.open(le):void 0,pe=de?.el.children.find(t=>t.key==="dc:title")?.text.trim()??"";return de?.consume(),{width:h,height:w,...pe===""?{}:{title:pe},theme:se,fonts:$,masters:ce,slides:Se,report:e.report(),reasons:e.reasons(),bytes:t=>e.parts[t]}}function $e(s,o){return s.some((e,r)=>Object.entries(e).some(([a,c])=>{const m=o[r]?.[a],u=ve.other[r]?.[a],h=m??u;return h!==void 0&&JSON.stringify(h)!==JSON.stringify(c)&&JSON.stringify({...h,...c})!==JSON.stringify(h)}))}function je(s){s.one("p:extLst")?.skip("a slide id's extensions")}function Ce(s,o){const e=o.read.pkg.open(s);if(!e)return;const a=e.one("p:cSld")?.one("p:spTree")?.all("p:sp").find(m=>(m.one("p:nvSpPr")?.one("p:nvPr")?.one("p:ph")?.attr("type")??"obj")==="body"),c=Fe(a?.one("p:txBody"),o);return c.some(m=>m.runs.some(u=>u.font!==void 0))&&f(o,"approximated","p:notes","speaker notes keep their words, not their formatting"),e.consume(),c.map(m=>m.runs.map(u=>u.text==="\v"?`
|
|
3
|
+
`:u.text).join("")).join(`
|
|
4
|
+
`)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export{
|
|
2
|
+
export{};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{SHAPE_TYPES as ee}from"@allyhub-next/ooxml/enums";import{evaluate as te,presetAdjustments as ne}from"@allyhub-next/ooxml/geometry";import{as as H,parseXml as oe}from"@allyhub-next/ooxml";import{strFromU8 as ae}from"fflate";import{isConnectorGeometry as ie,pathSteps as re}from"@allyhub-next/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 r=e?.one("a:off"),n=e?.one("a:ext");if(!(!e||!r||!n))return{frame:{left:r.attr("x")??0,top:r.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 r=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)},...r===0||r===360?{}:{rotation:r},...e.flip.h||e.flip.v?{flip:{...e.flip.h?{h:!0}:{},...e.flip.v?{v:!0}:{}}}:{}}}function fe(e,r){const n=(i,g)=>e?.one(i)?.attr(g)??0,o=(i,g)=>e?.one(i)?.attr(g)??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,h=e?.attrOr("flipH")??!1,l=e?.attrOr("flipV")??!1,w=n("a:off","x")+o("a:ext","cx")/2,c=n("a:off","y")+o("a:ext","cy")/2;return i=>{const g=i.frame.width*d,p=i.frame.height*t;let f=n("a:off","x")+(i.frame.left-n("a:chOff","x"))*d+g/2,u=n("a:off","y")+(i.frame.top-n("a:chOff","y"))*t+p/2,a=i.rotation;const y={...i.flip};if(h&&(f=2*w-f,a=-a,y.h=!y.h),l&&(u=2*c-u,a=-a,y.v=!y.v),s!==0){const v=s*Math.PI/180,[S,m]=[f-w,u-c];f=w+S*Math.cos(v)-m*Math.sin(v),u=c+S*Math.sin(v)+m*Math.cos(v),a+=s}return r.place({frame:{left:f-g/2,top:u-p/2,width:g,height:p},rotation:a,flip:y})}}function ue(e,r,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")]),h={"a:moveTo":"M","a:lnTo":"L","a:quadBezTo":"Q","a:cubicBezTo":"C","a:close":"Z","a:arcTo":"A"},l=(e.one("a:pathLst")?.all("a:path")??[]).map(a=>{const y=a.kids().map(m=>{if(m.use(),m.key==="a:arcTo"){const x=m;return["A",...["wR","hR","stAng","swAng"].map(j=>String(x.attr(j)??"0"))].join(" ")}return[h[m.key]??"Z",...s(m)].join(" ")}),v=a.attr("fill"),S=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},...S===!1?{stroke:!1}:{},d:y.join(" ")}});if(l.length===0)return;l.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 w=l[0]?.w??0,c=l[0]?.h??0,i=w>0&&c>0&&l.every(a=>(a.w??0)===w&&(a.h??0)===c),g=i?w:r&&r.width>0?r.width:w>0?w:1,p=i?c:r&&r.height>0?r.height:c>0?c:1,f=te({av:d,gd:t,paths:l.map(a=>({d:a.d,...a.w?{w:a.w}:{},...a.h?{h:a.h}:{}}))},g,p),u=re(f.paths.map(a=>a.d).join(" "));return u?{w:g,h:p,steps:u}:void 0}function he(e,r,n){const o=new Map((r?.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(h=>h.name===s)||b(n,"unread","a:gd@name",`${e} has no adjustment ${s}`);return d.map(s=>{const h=o.get(s.name),l=h===void 0?NaN:Number(/^val\s+(-?[\d.]+)$/u.exec(h.trim())?.[1]);return h!==void 0&&Number.isNaN(l)&&b(n,"approximated","a:gd@fmla",`an adjustment by a formula (${h}) is the preset's own`),(Number.isNaN(l)?s.value:l)/1e5})}function E(e,r){const n=e?.attr("name")??"",o=e?.attr("id"),d=e?.attr("descr");e?.attr("hidden")===!0&&b(r,"cannot-hold","p:cNvPr@hidden","a shape hidden on its slide"),e?.attr("title")&&b(r,"cannot-hold","p:cNvPr@title","an alternative text's title");for(const s of["a:hlinkClick","a:hlinkHover"]){const h=e?.one(s);if(h?.attr("action")==="ppaction://media"){h.consume();continue}h&&(b(r,"cannot-hold",s,"a link on a whole shape"),h.consume())}return{name:n,...o===void 0?{}:{id:String(o)},...d?{alt:d}:{}}}export function shapesOf(e,r,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,r,n));break;case"p:cxnSp":o.push(...we(d,r,n));break;case"p:pic":o.push(...K(d,r,n));break;case"p:graphicFrame":o.push(...ve(d,r,n));break;case"p:grpSp":o.push(...ke(d,r,n));break;case"p:contentPart":d.use(),b(r,"cannot-hold","p:contentPart","ink"),d.consume();break;default:break}return o}const C=(e,r,n)=>{const o=`${e.where} › "${n||"unnamed"}"`;return r.label(o),{...e,where:o}},me=["noGrp","noUngrp","noSelect","noChangeAspect","noEditPoints","noAdjustHandles","noChangeArrowheads","noChangeShapeType","noTextEdit","noCrop","noDrilldown"];function $(e,r){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(r,"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,r,n){e.use();const o=e.one("p:nvSpPr"),d=o?.one("p:cNvPr"),t=C(r,e,d?.el.attrs.find(P=>P.key==="name")?.value??""),s=E(d,t),h=o?.one("p:cNvSpPr");$(h?.one("a:spLocks"),t)&&(s.locked=!0);const l=h?.attr("txBox")===!0,w=o?.one("p:nvPr");w?.ignore(["isPhoto","userDrawn"],"a shape's origin in PowerPoint");const c=w?.one("p:ph"),i=e.one("p:spPr");i?.ignore(["bwMode"],"a shape's black and white printing mode");const g=z(i?.one("a:xfrm")),p=D(g&&n.place(g)),f=i?.one("a:prstGeom"),u=f?.attr("prst"),a=I(i,t),y=i?.one("a:ln"),v=B(y,t),S=W(i?.one("a:effectLst"),t),m=c||l?{}:V(e.one("p:style"),t);(c||l)&&e.one("p:style")?.skip("a placeholder's or a text box's style: its own properties are what it shows");const x=a?.group?n.fill:a;a?.group&&!n.fill&&b(t,"approximated","a:grpFill","a group's fill outside a group is none");const j=e.one("p:txBody"),G=c!==void 0&&!t.part.includes("/slides/")&&(c.attr("type")??"obj")!=="sldNum",_=j?le(j,c&&!t.part.includes("/slideMasters/")?ge:de,t,G):void 0,M={...s,kind:"autoshape",...p,...x?.fill!==void 0?{fill:x.fill}:x?.gradient?{}:c?{}:l?{fill:null}:m.fill!==void 0?{fill:m.fill}:m.gradient?{}:{fill:null},...(x?.fill_transparency??(x?void 0:m.fill_transparency))===void 0?{}:{fill_transparency:x?.fill_transparency??m.fill_transparency??0},...x?.gradient??(x?void 0:m.gradient)?{gradient:x?.gradient??m.gradient}:{},...S??m.shadow?{shadow:S??m.shadow}:{},...v.line!==void 0?{line:v.line}:c?{}:l?{}:{line:m.line??null},...(v.line_width??(c?void 0:m.line_width))===void 0?{}:{line_width:v.line_width??m.line_width},...(v.line_dash??m.line_dash)===void 0?{}:{line_dash:v.line_dash??m.line_dash},...(v.line_begin??m.line_begin)===void 0?{}:{line_begin:v.line_begin??m.line_begin},...(v.line_end??m.line_end)===void 0?{}:{line_end:v.line_end??m.line_end},...m.text_color===void 0?{}:{text_color:m.text_color},..._?{text:_}:{},...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 N=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${N==="obj"?"n object":" body"} placeholder`),u!==void 0&&u!=="rect"?[{...M,kind:"placeholder",placeholder:{type:N,idx:F},geometry:u,...U(u,f?.one("a:avLst"),t)}]:(f?.one("a:avLst"),[{...M,kind:"placeholder",placeholder:{type:N,idx:F}}])}const T=i?.one("a:custGeom"),L=T?ue(T,p.frame,t):void 0;T&&!L&&b(t,"approximated","a:custGeom","a freeform with no outline is a rectangle");const R=u!==void 0&&pe.has(u)?u:"rect";return[{...M,kind:l?"textbox":"autoshape",...L?{path:L}:{geometry:R},...u===void 0||L?{}:U(u,f?.one("a:avLst"),t)}]}const U=(e,r,n)=>{const o=he(e,r,n);return o?{adjustments:o}:{}};function we(e,r,n){e.use();const o=e.one("p:nvCxnSpPr"),d=o?.one("p:cNvPr"),t=C(r,e,d?.el.attrs.find(y=>y.key==="name")?.value??""),s=E(d,t),h=o?.one("p:cNvCxnSpPr");$(h?.one("a:cxnSpLocks"),t)&&(s.locked=!0);for(const y of["a:stCxn","a:endCxn"]){const v=h?.one(y);v&&(b(t,"cannot-hold",y,"a connector's end joined to a shape: it stays where it is"),v.consume())}o?.one("p:nvPr");const l=e.one("p:spPr");l?.ignore(["bwMode"],"a shape's black and white printing mode");const w=z(l?.one("a:xfrm")),c=l?.one("a:prstGeom"),i=c?.attr("prst")??"line",g=U(i,c?.one("a:avLst"),t),p=V(e.one("p:style"),t),f=B(l?.one("a:ln"),t),u=W(l?.one("a:effectLst"),t),a=ie(i);return a||b(t,"approximated","a:prstGeom@prst",`a connector of the ${i} preset is a shape of it with no fill`),[{...s,kind:"autoshape",geometry:i,...g,...D(w&&n.place(w)),...a?{}:{fill:null},line:f.line??p.line??null,...(f.line_width??p.line_width)===void 0?{}:{line_width:f.line_width??p.line_width},...(f.line_dash??p.line_dash)===void 0?{}:{line_dash:f.line_dash??p.line_dash},...(f.line_begin??p.line_begin)===void 0?{}:{line_begin:f.line_begin??p.line_begin},...(f.line_end??p.line_end)===void 0?{}:{line_end:f.line_end??p.line_end},...u??p.shadow?{shadow:u??p.shadow}:{},...n.group===void 0?{}:{group:n.group}}]}function K(e,r,n){e.use();const o=e.one("p:nvPicPr"),d=o?.one("p:cNvPr"),t=C(r,e,d?.el.attrs.find(k=>k.key==="name")?.value??""),s=E(d,t),h=o?.one("p:cNvPicPr");$(h?.one("a:picLocks"),t)&&(s.locked=!0),h?.attr("preferRelativeResize");const l=o?.one("p:nvPr");l?.ignore(["isPhoto","userDrawn"],"a shape's origin in PowerPoint");const w=l?.one("p:ph"),c=l?.one("a:videoFile"),i=l?.choice("a:audioFile","a:wavAudioFile","a:audioCd","a:quickTimeFile"),g=l?.one("p:extLst")?.all("p:ext").flatMap(k=>{const O=k.one("p14:media");return O?[O]:[]})[0],p=t.read.pkg,f=p.rel(t.part,g?.attr("r:embed"))??p.rel(t.part,c?.attr("r:link"));if(g){g.attr("r:link");for(const k of["p14:trim","p14:fade","p14:bmkLst"]){const O=g.one(k);O&&(b(t,"cannot-hold",k,k==="p14:trim"?"a video's trim":k==="p14:fade"?"a video's fade in and out":"a video's bookmarks"),O.consume())}}i&&(b(t,"cannot-hold",i.key,"a sound"),i.consume());const u=e.one("p:blipFill");u?.ignore(["dpi","rotWithShape"],"a picture's resolution and turning with its fill");const a=u?.one("a:blip");a?.ignore(["cstate"],"a picture's compression state");const y=a?.one("a:extLst")?.all("a:ext").flatMap(k=>{const O=k.one("asvg:svgBlip");return k.one("a14:useLocalDpi")?.skip("a picture kept at its own resolution"),O?[O]:[]})[0],v=p.rel(t.part,y?.attr("r:embed"))??p.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 k of a?.kids()??[])k.key!=="a:extLst"&&(k.use(),b(t,"cannot-hold",k.key,"a picture's own effect (transparency, recolouring, brightness)"),k.consume());const m=u?.one("a:srcRect"),x=k=>(m?.attr(k)??0)/1e5,j=m?{left:x("l"),top:x("t"),right:x("r"),bottom:x("b")}:void 0;u?.one("a:stretch")?.consume();const G=u?.one("a:tile");G&&(b(t,"cannot-hold","a:tile","a picture tiled in its frame"),G.consume());const _=e.one("p:spPr");_?.ignore(["bwMode"],"a shape's black and white printing mode");const M=z(_?.one("a:xfrm")),T=_?.one("a:prstGeom"),L=T?.attr("prst");T?.one("a:avLst"),L!==void 0&&L!=="rect"&&b(t,"cannot-hold","a:prstGeom@prst",`a picture cut to a ${L}`);const R=_?.one("a:ln");R&&B(R,t).line&&b(t,"cannot-hold","p:pic/a:ln","a picture's outline");const P=W(_?.one("a:effectLst"),t),F=I(_,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||g!==void 0&&!i,N=A?f:v;if(!N||N.external)return b(t,"missing","p:pic","a picture or a video whose file is not in the file"),[];p.bytes(N.target),A&&(v&&p.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",...w?{placeholder:{type:w.attr("type")??"pic",idx:w.attr("idx")??0}}:{},...D(M&&n.place(M)),part:N.target,...j&&!A?{crop:j}:{},...P?{shadow:P}:{},...n.group===void 0?{}:{group:n.group}}]}function ve(e,r,n){e.use();const o=e.one("p:nvGraphicFramePr"),d=o?.one("p:cNvPr"),t=C(r,e,d?.el.attrs.find(f=>f.key==="name")?.value??""),s=E(d,t);$(o?.one("p:cNvGraphicFramePr")?.one("a:graphicFrameLocks"),t)&&(s.locked=!0);const h=o?.one("p:nvPr")?.one("p:ph");h&&(b(t,"approximated","p:ph","a table, a chart or an object in a placeholder is the slide's own, its placeholder left empty"),h.consume()),e.ignore(["bwMode"],"a shape's black and white printing mode");const l=z(e.one("p:xfrm")),w=D(l&&n.place(l)),c=e.one("a:graphic")?.one("a:graphicData"),i=c?.attr("uri")??"",g={...s,...w,...n.group===void 0?{}:{group:n.group}};if(i.endsWith("/table")){const f=c?.one("a:tbl");if(f)return[{...g,kind:"table",table:ce(f.use(),t)}]}if(i.endsWith("/chart")){const f=c?.one("c:chart");f?.use();const u=t.read.pkg.rel(t.part,f?.attr("r:id")),a=u?se(u.target,t):"its chart is not in the file";return typeof a=="string"?(b(t,"cannot-hold","c:chart",a),[]):[{...g,kind:"chart",chart:a}]}if(i.endsWith("/diagram"))return b(t,"cannot-hold","dgm:relIds","SmartArt"),c?.consume(),[];const p=c?.one("p:oleObj");if(p){p.use(),b(t,"approximated","p:oleObj",`an embedded ${p.attr("progId")??"object"} is its picture`),p.ignore(["spid","name","showAsIcon","r:id","imgW","imgH","progId"],"an embedded object's program and size"),p.one("p:embed")?.consume(),p.one("p:link")?.consume();const f=p.one("p:pic");if(f){const[a]=K(f,r,n);return a?[{...a,...s,...w,kind:"picture"}]:[]}const u=ye(p.el.attrs.find(a=>a.key==="spid")?.value,t);return u?[{...g,kind:"picture",part:u}]:(b(t,"missing","p:oleObj","an embedded object whose picture is not in the file"),[])}return b(t,"cannot-hold","a:graphicData",i||"a graphic frame"),c?.consume(),[]}const Q="urn:schemas-microsoft-com:vml",X="urn:schemas-microsoft-com:office:office";function ye(e,r){const n=r.read.pkg,o=n.relOfType(r.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=(i,g,p)=>i.attrs.find(f=>f.uri===g&&f.local===p)?.value,h=i=>[i,...i.children.flatMap(h)],w=h(t).find(i=>i.uri===Q&&(s(i,"","id")===e||s(i,X,"spid")===e))?.children.find(i=>i.uri===Q&&i.local==="imagedata"),c=n.rel(o,w&&s(w,X,"relid"));if(!(!c||c.external||!n.bytes(c.target)))return c.target}function ke(e,r,n){e.use();const o=e.one("p:nvGrpSpPr"),d=o?.one("p:cNvPr"),t=C(r,e,d?.el.attrs.find(g=>g.key==="name")?.value??""),s=E(d,t),h=$(o?.one("p:cNvGrpSpPr")?.one("a:grpSpLocks"),t);o?.one("p:nvPr");const l=e.one("p:grpSpPr");l?.ignore(["bwMode"],"a shape's black and white printing mode");const w=I(l,t),c=l?.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 i=shapesOf(e,t,{...w?{fill:w}:n.fill?{fill:n.fill}:{},group:n.group??s.name,place:fe(l?.one("a:xfrm"),n)});return h?i.map(g=>({...g,locked:!0})):i}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{colorAt as B,fillOf as I,lineOf as j,say as O}from"./common.js";import{bodyOf as P}from"./text.js";function A(a,t,o){const n={borders:{},font:{}};if(!a)return n;const i=a.one("a:tcTxStyle");if(i){const u=i.attr("b");u==="on"?n.font.bold=!0:u==="off"&&(n.font.bold=!1);const c=i.attr("i");c==="on"?n.font.italic=!0:c==="off"&&(n.font.italic=!1);const b=i.one("a:fontRef"),p=B(b??i,t,"a:tcTxStyle");b?.attr("idx"),p&&(n.font.color=p.color),i.one("a:font")?.skip("a table style's own fonts")}const l=a.one("a:tcStyle");if(l){const u=l.one("a:fill"),c=I(u,t);c?.fill!==void 0&&(n.fill=c.fill);const b=l.one("a:fillRef");if(b){const e=b.attr("idx")??0,r=B(b,t,"a:fillRef");n.fill=e===0?null:r?.color??null}l.one("a:cell3D")?.skip("a table style's 3-D cells");const p=l.one("a:tcBdr"),s=e=>{const r=p?.one(e),d=r?.one("a:ln");if(d){const w=j(d,t);return w.line===null?null:w.line===void 0?void 0:{color:w.line,width:w.line_width??12700}}const C=r?.one("a:lnRef");if(C){const w=B(C,t,"a:lnRef"),h=C.attr("idx")??0,_=t.read.matrix.line[h-1]?.el.attrs.find(y=>y.key==="w")?.value;return h===0||!w?null:{color:w.color,width:Number(_??12700)}}},f=(e,r)=>{r!==void 0&&(n.borders[e]=r)};f("left",o.left?s("a:insideV"):s("a:left")),f("right",o.right?s("a:insideV"):s("a:right")),f("top",o.top?s("a:insideH"):s("a:top")),f("bottom",o.bottom?s("a:insideH"):s("a:bottom"));for(const e of["a:tl2br","a:tr2bl"]){const r=p?.one(e);r&&(O(t,"cannot-hold",e,"a cell's diagonal line"),r.consume())}}return n}function L(a,t,o,n,i,l,u){const c={borders:{},font:{}};if(!a)return c;const b={top:o>0,bottom:o<i-1,left:n>0,right:n<l-1},p=t.firstRow?1:0,s=t.firstCol?1:0,f=[a.one("a:wholeTbl")];t.bandRow&&o>=p&&!(t.lastRow&&o===i-1)&&f.push(a.one((o-p)%2===0?"a:band1H":"a:band2H")),t.bandCol&&n>=s&&!(t.lastCol&&n===l-1)&&f.push(a.one((n-s)%2===0?"a:band1V":"a:band2V")),t.lastCol&&n===l-1&&f.push(a.one("a:lastCol")),t.firstCol&&n===0&&f.push(a.one("a:firstCol")),t.lastRow&&o===i-1&&f.push(a.one("a:lastRow")),t.firstRow&&o===0&&f.push(a.one("a:firstRow"));const e=(r,d)=>{r&&f.push(a.one(d))};e(t.firstRow&&t.firstCol&&o===0&&n===0,"a:nwCell"),e(t.firstRow&&t.lastCol&&o===0&&n===l-1,"a:neCell"),e(t.lastRow&&t.firstCol&&o===i-1&&n===0,"a:swCell"),e(t.lastRow&&t.lastCol&&o===i-1&&n===l-1,"a:seCell");for(const r of f){const d=A(r,u,b);d.fill!==void 0&&(c.fill=d.fill),Object.assign(c.borders,d.borders),Object.assign(c.font,d.font)}return c}function M(a,t){const o=t.read.pkg,n=o.relOfType("ppt/presentation.xml","tableStyles");return(n?o.open(n.target):void 0)?.all("a:tblStyle").find(l=>l.attr("styleId")===a)}export function tableOf(a,t){const o=a.one("a:tblPr"),n={firstRow:o?.attrOr("firstRow")??!1,firstCol:o?.attrOr("firstCol")??!1,lastRow:o?.attrOr("lastRow")??!1,lastCol:o?.attrOr("lastCol")??!1,bandRow:o?.attrOr("bandRow")??!1,bandCol:o?.attrOr("bandCol")??!1},i=I(o,t);i?.fill&&O(t,"approximated","a:tblPr/a:solidFill","a table's own fill is each cell's");const l=o?.one("a:tableStyleId")?.text().trim(),u=l?M(l,t):void 0;l&&!u&&l!=="{2D5ABB26-0587-4C30-8999-92F81FD0307C}"&&O(t,"missing","a:tableStyleId",`table style ${l} is not defined in the file: its look is not known here`),u&&(O(t,"approximated","a:tableStyleId",`table style ${u.attr("styleName")??l??""} is each cell's own look`),u.one("a:tblBg")?.skip("a table style's background behind its cells"),u.attr("styleName"));const c=(a.one("a:tblGrid")?.all("a:gridCol")??[]).map(s=>s.attr("w")??0),b=a.all("a:tr"),p=b.map((s,f)=>({height:s.attr("h")??0,cells:s.all("a:tc").map((e,r)=>{const d=e.one("a:tcPr"),C=L(u,n,f,r,b.length,c.length,t),w=P(e.one("a:txBody"),{},t);if(Object.keys(C.font).length>0)for(const m of w.paragraphs)for(const R of m.runs){const g=R.font??{};R.font={...C.font,...g}}const h=I(d,t),_=h?.fill!==void 0?h.fill:C.fill??i?.fill,y={};for(const[m,R]of[["left","a:lnL"],["right","a:lnR"],["top","a:lnT"],["bottom","a:lnB"]]){const g=d?.one(R),x=g?j(g,t):void 0,N=x?.line===null?null:x?.line!==void 0?{color:x.line,width:x.line_width??12700}:C.borders[m];N&&(y[m]=N)}for(const m of["a:lnTlToBr","a:lnBlToTr"]){const R=d?.one(m);R&&j(R,t).line&&O(t,"cannot-hold",m,"a cell's diagonal line")}const k=d?.attr("anchor"),V=m=>d?.attr(m),[v,D,F,H]=["marL","marR","marT","marB"].map(V),S=e.attr("gridSpan"),T=e.attr("rowSpan");return{text:{...w,...v===void 0?{}:{margin_left:v},...D===void 0?{}:{margin_right:D},...F===void 0?{}:{margin_top:F},...H===void 0?{}:{margin_bottom:H},...k==="t"||k==="ctr"||k==="b"?{vertical_anchor:k}:{}},..._===void 0?{}:{fill:_},...Object.keys(y).length>0?{borders:y}:{},...S===void 0||S<2?{}:{span_width:S},...T===void 0||T<2?{}:{span_height:T},...e.attrOr("hMerge")||e.attrOr("vMerge")?{spanned:!0}:{}}})}));return{columns:c,rows:p,...n.firstRow?{first_row:!0}:{},...n.firstCol?{first_col:!0}:{},...n.lastRow?{last_row:!0}:{},...n.lastCol?{last_col:!0}:{},...n.bandRow?{horz_banding:!0}:{},...n.bandCol?{vert_banding:!0}:{}}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{NUMBERINGS as _}from"@allyhub-next/formats";import{colorIn as v}from"@allyhub-next/ooxml";import{TEXT_INSETS as x}from"@allyhub-next/slides-core";import{colorAt as w,say as r}from"./common.js";export function fontOf(t,a){if(!t)return;const n={},l=t.attr("sz");l!==void 0&&(n.size=l*127);const s=t.attr("b");s!==void 0&&(n.bold=s);const e=t.attr("i");e!==void 0&&(n.italic=e);const o=t.attr("u");o!==void 0&&(n.underline=o!=="none",o!=="none"&&o!=="sng"&&r(a,"approximated","a:rPr@u",`${o} underline is a single line`));const f=t.attr("strike");f!==void 0&&(n.strike=f!=="noStrike",f==="dblStrike"&&r(a,"approximated","a:rPr@strike","a double strike is one line"));const u=t.attr("baseline");u!==void 0&&u!==0&&(n.baseline=u/1e5);const p=t.attr("spc");p!==void 0&&(n.spacing=p*127);const g=t.attr("cap");g!==void 0&&g!=="none"&&r(a,"cannot-hold","a:rPr@cap",`${g} 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 h=t.choice("a:solidFill","a:noFill","a:gradFill");if(h?.key==="a:solidFill"){const c=w(h,a,"a:rPr/a:solidFill");c&&(n.color=c.color,c.alpha<1&&r(a,"cannot-hold","a:rPr/a:alpha","text's transparency"))}else h&&(r(a,"cannot-hold",`a:rPr/${h.key}`,h.key==="a:noFill"?"text with no fill":"text filled with a gradient"),h.consume());const m=v(t.one("a:highlight"),a.colors);m&&(n.highlight=m.rgb);const i=t.one("a:latin");if(i){i.ignore(["panose","pitchFamily","charset"],"a font's panose, pitch and character set: its name picks it");const c=i.attr("typeface");c&&(n.name=c)}for(const c of["a:ea","a:cs","a:sym"]){const k=t.one(c);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)&&r(a,"cannot-hold",c,`a run's own ${c==="a:ea"?"East Asian":c==="a:cs"?"complex script":"symbol"} face (${P})`)}const d=t.one("a:hlinkClick");if(d){const c=d.attr("action"),k=a.read.pkg.rel(a.part,d.attr("r:id"));k?.external&&(c===void 0||c==="")?n.link=k.target:c!==void 0&&c!==""?r(a,"cannot-hold","a:hlinkClick@action",c):d.attr("r:id")!==""&&r(a,"missing","a:hlinkClick","a link whose target is not in the file"),d.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&&(r(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={},l=t.attr("algn");l==="l"||l==="ctr"||l==="r"||l==="just"?n.alignment=l:l!==void 0&&(n.alignment="just",r(a,"approximated","a:pPr@algn",`${l} is justified`));const s=t.attr("marL");s!==void 0&&(n.margin_left=s);const e=t.attr("indent");e!==void 0&&(n.indent=e);const o=t.attr("marR");o!==void 0&&o!==0&&r(a,"cannot-hold","a:pPr@marR","a paragraph's right margin");const f=y(t.one("a:lnSpc"));f&&(n.line_spacing=f);for(const[i,d]of[["a:spcBef","space_before"],["a:spcAft","space_after"]]){const b=y(t.one(i));b&&"fixed"in b&&(n[d]=b.fixed)}t.has("a:buNone")&&(n.bullet=null);const u=t.one("a:buChar")?.attr("char");u!==void 0&&(n.bullet=u);const p=t.one("a:buFont");if(p){p.ignore(["panose","pitchFamily","charset"],"a font's panose, pitch and character set: its name picks it");const i=p.attr("typeface");i!==void 0&&(n.bullet_font=i)}const g=t.one("a:buAutoNum");if(g){const i=g.attr("type")??"arabicPeriod";_.includes(i)?n.numbered=i:(n.numbered=A(i),r(a,"approximated","a:buAutoNum@type",`${i} is counted as ${n.numbered}`));const d=g.attr("startAt");d!==void 0&&d!==1&&r(a,"cannot-hold","a:buAutoNum@startAt",`a list counted from ${String(d)}`)}for(const i of["a:buClrTx","a:buSzTx","a:buFontTx"])t.one(i);for(const i of["a:buClr","a:buSzPct","a:buSzPts","a:buBlip"]){const d=t.one(i);d&&(r(a,"cannot-hold",i,i==="a:buClr"?"a bullet's own colour":i==="a:buBlip"?"a picture as a bullet":"a bullet's own size"),d.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 h=t.one("a:tabLst");h&&h.el.children.length>0&&(r(a,"cannot-hold","a:tabLst","tab stops"),h.consume()),t.attr("rtl")===!0&&r(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[i,d]of[["a:spcBef","space_before"],["a:spcAft","space_after"]]){const b=t.one(i)?.one("a:spcPct")?.attr("val");b!==void 0&&(m?.size!==void 0?(n[d]=Math.round(b/1e5*m.size*1.2),r(a,"approximated",`${i}/a:spcPct`,"space between paragraphs as a share of a line is points at the level's size")):r(a,"cannot-hold",`${i}/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(l=>{const s=t?.one(l);s?.attr("lvl");const e=formatOf(s,a);return Object.keys(n).length===0?e:{...n,...e,...n.font||e.font?{font:{...n.font,...e.font}}:{}}})}export function paragraphsOf(t,a){return(t?.all("a:p")??[]).map(n=>{const l=n.one("a:pPr"),s=[];for(const e of n.kids())if(e.key==="a:r"){const o=e.use(),f=fontOf(o.one("a:rPr"),a);s.push({text:o.one("a:t")?.text()??"",...f?{font:f}:{}})}else if(e.key==="a:br")e.use(),e.one("a:rPr")?.skip("a line break's font"),s.push({text:"\v"});else if(e.key==="a:fld"){const o=e.use();o.attr("id");const f=o.attr("type")??"",u=fontOf(o.one("a:rPr"),a),p=o.one("a:pPr");p&&(p.el.attrs.length>0||p.el.children.length>0)&&r(a,"cannot-hold","a:fld/a:pPr","a field's own paragraph properties");const g=o.one("a:t")?.text()??"";f!=="slidenum"&&r(a,"cannot-hold","a:fld@type",`${f||"a field"}: kept as the text it showed`),s.push({text:g,...u?{font:u}:{},...f==="slidenum"?{field:"slidenum"}:{}})}else e.key==="a:endParaRPr"&&e.skip("the font of a paragraph's end");return{...formatOf(l,a),runs:s,level:l?.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,l=!1){const s=t?.one("a:bodyPr");if(l)for(const g of t?.all("a:p")??[])g.skip("a master's or a layout's placeholder's prompt text");const e={...a,levels:levelsOf(t?.one("a:lstStyle"),n),paragraphs:l?[]:paragraphsOf(t,n)},o=s?.attr("anchor");o==="t"||o==="ctr"||o==="b"?e.vertical_anchor=o:o!==void 0&&(e.vertical_anchor="t",r(n,"approximated","a:bodyPr@anchor",`${o} is at the top`));const f=s?.attr("wrap");f!==void 0&&(e.word_wrap=f!=="none");const u=s?.choice("a:normAutofit","a:spAutoFit","a:noAutofit");u?.key==="a:normAutofit"?(e.auto_size="text",u.ignore(["fontScale","lnSpcReduction"],"the share PowerPoint last shrank text to: the stage fits it again")):u?.key==="a:spAutoFit"?e.auto_size="shape":u&&(e.auto_size="none");for(const[g,h]of[["lIns","margin_left"],["tIns","margin_top"],["rIns","margin_right"],["bIns","margin_bottom"]]){const m=s?.attr(g);m!==void 0&&(e[h]=m)}s?.ignore(["forceAA","compatLnSpc"],"rendering hints of a text body");const p=s?.attr("vert");return p!==void 0&&p!=="horz"&&r(n,"cannot-hold","a:bodyPr@vert",`${p} text`),s?.attr("rtlCol")===!0&&r(n,"cannot-hold","a:bodyPr@rtlCol","columns right to left"),e}
|