@syncfusion/ej2-docx 0.0.0-stage → 35.1.40
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/.gitleaksignore +35 -0
- package/README.md +68 -2
- package/core.js +4 -0
- package/dist/ej2-docx.umd.min.js +11 -0
- package/dist/ej2-docx.umd.min.js.map +1 -0
- package/dist/es6/ej2-docx.es2015.js +66697 -0
- package/dist/es6/ej2-docx.es2015.js.map +1 -0
- package/dist/es6/ej2-docx.es5.js +77568 -0
- package/dist/es6/ej2-docx.es5.js.map +1 -0
- package/dist/global/ej2-docx.min.js +11 -0
- package/dist/global/ej2-docx.min.js.map +1 -0
- package/dist/global/index.d.ts +14 -0
- package/features.js +4 -0
- package/index.js +4 -0
- package/license +10 -0
- package/package.json +30 -3
- package/src/all.d.ts +50 -0
- package/src/all.js +147 -0
- package/src/core/compat/base64.d.ts +13 -0
- package/src/core/compat/base64.js +90 -0
- package/src/core/compat/object-compat.d.ts +30 -0
- package/src/core/compat/object-compat.js +40 -0
- package/src/core/compat/sha256.d.ts +9 -0
- package/src/core/compat/sha256.js +98 -0
- package/src/core/errors/docx-error.d.ts +89 -0
- package/src/core/errors/docx-error.js +138 -0
- package/src/core/errors/error-codes.d.ts +8 -0
- package/src/core/errors/error-codes.js +0 -0
- package/src/core/errors/index.d.ts +10 -0
- package/src/core/errors/index.js +9 -0
- package/src/core/index.d.ts +12 -0
- package/src/core/index.js +12 -0
- package/src/core/mc/alternate-content.d.ts +7 -0
- package/src/core/mc/alternate-content.js +67 -0
- package/src/core/mc/attributes.d.ts +24 -0
- package/src/core/mc/attributes.js +82 -0
- package/src/core/mc/index.d.ts +7 -0
- package/src/core/mc/index.js +5 -0
- package/src/core/mc/inspect.d.ts +16 -0
- package/src/core/mc/inspect.js +148 -0
- package/src/core/mc/namespaces.d.ts +4 -0
- package/src/core/mc/namespaces.js +4 -0
- package/src/core/mc/scope.d.ts +6 -0
- package/src/core/mc/scope.js +47 -0
- package/src/core/opc/content-types.d.ts +34 -0
- package/src/core/opc/content-types.js +162 -0
- package/src/core/opc/index.d.ts +8 -0
- package/src/core/opc/index.js +4 -0
- package/src/core/opc/package.d.ts +49 -0
- package/src/core/opc/package.js +324 -0
- package/src/core/opc/part-name.d.ts +47 -0
- package/src/core/opc/part-name.js +205 -0
- package/src/core/opc/relationships.d.ts +46 -0
- package/src/core/opc/relationships.js +212 -0
- package/src/core/preservation/index.d.ts +2 -0
- package/src/core/preservation/index.js +1 -0
- package/src/core/preservation/opaque-body.d.ts +16 -0
- package/src/core/preservation/opaque-body.js +69 -0
- package/src/core/registry/block-handlers.d.ts +30 -0
- package/src/core/registry/block-handlers.js +36 -0
- package/src/core/registry/create-defaults.d.ts +39 -0
- package/src/core/registry/create-defaults.js +42 -0
- package/src/core/registry/feature-registry.d.ts +20 -0
- package/src/core/registry/feature-registry.js +29 -0
- package/src/core/registry/index.d.ts +9 -0
- package/src/core/registry/index.js +8 -0
- package/src/core/registry/inline-handlers.d.ts +20 -0
- package/src/core/registry/inline-handlers.js +30 -0
- package/src/core/registry/materialize-handlers.d.ts +35 -0
- package/src/core/registry/materialize-handlers.js +75 -0
- package/src/core/registry/multi-part-handlers.d.ts +37 -0
- package/src/core/registry/multi-part-handlers.js +206 -0
- package/src/core/registry/package-part-handlers.d.ts +28 -0
- package/src/core/registry/package-part-handlers.js +190 -0
- package/src/core/registry/part-handlers.d.ts +24 -0
- package/src/core/registry/part-handlers.js +172 -0
- package/src/core/registry/run-leaf-handlers.d.ts +26 -0
- package/src/core/registry/run-leaf-handlers.js +72 -0
- package/src/core/security/limits.d.ts +40 -0
- package/src/core/security/limits.js +26 -0
- package/src/core/xml/index.d.ts +7 -0
- package/src/core/xml/index.js +3 -0
- package/src/core/xml/model.d.ts +66 -0
- package/src/core/xml/model.js +17 -0
- package/src/core/xml/parse.d.ts +12 -0
- package/src/core/xml/parse.js +382 -0
- package/src/core/xml/serialize.d.ts +6 -0
- package/src/core/xml/serialize.js +93 -0
- package/src/core/zip/crc32.d.ts +2 -0
- package/src/core/zip/crc32.js +25 -0
- package/src/core/zip/deflate.d.ts +6 -0
- package/src/core/zip/deflate.js +6 -0
- package/src/core/zip/index.d.ts +10 -0
- package/src/core/zip/index.js +4 -0
- package/src/core/zip/inflate-raw.d.ts +17 -0
- package/src/core/zip/inflate-raw.js +450 -0
- package/src/core/zip/names.d.ts +6 -0
- package/src/core/zip/names.js +52 -0
- package/src/core/zip/read.d.ts +8 -0
- package/src/core/zip/read.js +262 -0
- package/src/core/zip/write.d.ts +7 -0
- package/src/core/zip/write.js +189 -0
- package/src/core/zip/zip-entry.d.ts +4 -0
- package/src/core/zip/zip-entry.js +0 -0
- package/src/features/bibliography/index.d.ts +100 -0
- package/src/features/bibliography/index.js +290 -0
- package/src/features/bookmarks/index.d.ts +331 -0
- package/src/features/bookmarks/index.js +1009 -0
- package/src/features/comments/comment-extensions.d.ts +157 -0
- package/src/features/comments/comment-extensions.js +356 -0
- package/src/features/comments/index.d.ts +579 -0
- package/src/features/comments/index.js +1727 -0
- package/src/features/content-controls/index.d.ts +821 -0
- package/src/features/content-controls/index.js +2857 -0
- package/src/features/custom-xml/index.d.ts +236 -0
- package/src/features/custom-xml/index.js +661 -0
- package/src/features/document/alignment.d.ts +23 -0
- package/src/features/document/alignment.js +36 -0
- package/src/features/document/alt-chunk.d.ts +103 -0
- package/src/features/document/alt-chunk.js +221 -0
- package/src/features/document/assert-never.d.ts +1 -0
- package/src/features/document/assert-never.js +4 -0
- package/src/features/document/augmentations.d.ts +578 -0
- package/src/features/document/augmentations.js +0 -0
- package/src/features/document/body-always-on.d.ts +36 -0
- package/src/features/document/body-always-on.js +66 -0
- package/src/features/document/body-blocks.d.ts +7 -0
- package/src/features/document/body-blocks.js +78 -0
- package/src/features/document/body-item-adapters.d.ts +62 -0
- package/src/features/document/body-item-adapters.js +97 -0
- package/src/features/document/body-item-collection.d.ts +151 -0
- package/src/features/document/body-item-collection.js +440 -0
- package/src/features/document/body-item.d.ts +35 -0
- package/src/features/document/body-item.js +8 -0
- package/src/features/document/body.d.ts +150 -0
- package/src/features/document/body.js +263 -0
- package/src/features/document/character-format.d.ts +413 -0
- package/src/features/document/character-format.js +2054 -0
- package/src/features/document/color.d.ts +178 -0
- package/src/features/document/color.js +495 -0
- package/src/features/document/document.d.ts +410 -0
- package/src/features/document/document.js +1049 -0
- package/src/features/document/element-type.d.ts +68 -0
- package/src/features/document/element-type.js +133 -0
- package/src/features/document/entity-type.d.ts +92 -0
- package/src/features/document/entity-type.js +93 -0
- package/src/features/document/feature-block.d.ts +16 -0
- package/src/features/document/feature-block.js +0 -0
- package/src/features/document/feature-inline.d.ts +13 -0
- package/src/features/document/feature-inline.js +0 -0
- package/src/features/document/feature-multi-package-part.d.ts +19 -0
- package/src/features/document/feature-multi-package-part.js +8 -0
- package/src/features/document/feature-package-level-part.d.ts +18 -0
- package/src/features/document/feature-package-level-part.js +8 -0
- package/src/features/document/feature-package-part.d.ts +14 -0
- package/src/features/document/feature-package-part.js +0 -0
- package/src/features/document/feature-run-leaf.d.ts +9 -0
- package/src/features/document/feature-run-leaf.js +0 -0
- package/src/features/document/headers-footers.d.ts +206 -0
- package/src/features/document/headers-footers.js +384 -0
- package/src/features/document/index.d.ts +41 -0
- package/src/features/document/index.js +34 -0
- package/src/features/document/length.d.ts +152 -0
- package/src/features/document/length.js +245 -0
- package/src/features/document/load-options.d.ts +14 -0
- package/src/features/document/load-options.js +0 -0
- package/src/features/document/locale-ids.d.ts +227 -0
- package/src/features/document/locale-ids.js +485 -0
- package/src/features/document/on-off.d.ts +9 -0
- package/src/features/document/on-off.js +27 -0
- package/src/features/document/page-setup.d.ts +339 -0
- package/src/features/document/page-setup.js +244 -0
- package/src/features/document/paragraph-format.d.ts +880 -0
- package/src/features/document/paragraph-format.js +2807 -0
- package/src/features/document/paragraph-item-collection.d.ts +162 -0
- package/src/features/document/paragraph-item-collection.js +363 -0
- package/src/features/document/paragraph-item.d.ts +83 -0
- package/src/features/document/paragraph-item.js +103 -0
- package/src/features/document/paragraph.d.ts +435 -0
- package/src/features/document/paragraph.js +888 -0
- package/src/features/document/run.d.ts +1 -0
- package/src/features/document/run.js +768 -0
- package/src/features/document/section-partition-flatten.d.ts +124 -0
- package/src/features/document/section-partition-flatten.js +217 -0
- package/src/features/document/section-properties-model.d.ts +13 -0
- package/src/features/document/section-properties-model.js +0 -0
- package/src/features/document/section.d.ts +93 -0
- package/src/features/document/section.js +178 -0
- package/src/features/document/sections.d.ts +103 -0
- package/src/features/document/sections.js +217 -0
- package/src/features/document/sub-super-script.d.ts +23 -0
- package/src/features/document/sub-super-script.js +43 -0
- package/src/features/document/text-range.d.ts +445 -0
- package/src/features/document/text-range.js +1156 -0
- package/src/features/document/typed-body-collections.d.ts +162 -0
- package/src/features/document/typed-body-collections.js +371 -0
- package/src/features/document/underline-style.d.ts +38 -0
- package/src/features/document/underline-style.js +126 -0
- package/src/features/document/units.d.ts +8 -0
- package/src/features/document/units.js +7 -0
- package/src/features/document/wml.d.ts +16 -0
- package/src/features/document/wml.js +67 -0
- package/src/features/drawing/authoring.d.ts +27 -0
- package/src/features/drawing/authoring.js +271 -0
- package/src/features/drawing/body-pr.d.ts +271 -0
- package/src/features/drawing/body-pr.js +663 -0
- package/src/features/drawing/drawing-shape.d.ts +1192 -0
- package/src/features/drawing/drawing-shape.js +3239 -0
- package/src/features/drawing/encode-builders.d.ts +176 -0
- package/src/features/drawing/encode-builders.js +390 -0
- package/src/features/drawing/fill-format.d.ts +52 -0
- package/src/features/drawing/fill-format.js +124 -0
- package/src/features/drawing/host-codec.d.ts +632 -0
- package/src/features/drawing/host-codec.js +2595 -0
- package/src/features/drawing/index.d.ts +13 -0
- package/src/features/drawing/index.js +33 -0
- package/src/features/drawing/line-format.d.ts +76 -0
- package/src/features/drawing/line-format.js +343 -0
- package/src/features/drawing/parse-register.d.ts +50 -0
- package/src/features/drawing/parse-register.js +257 -0
- package/src/features/drawing/residual-utils.d.ts +47 -0
- package/src/features/drawing/residual-utils.js +290 -0
- package/src/features/drawing/shape-types.d.ts +433 -0
- package/src/features/drawing/shape-types.js +437 -0
- package/src/features/drawing/sp-pr.d.ts +396 -0
- package/src/features/drawing/sp-pr.js +610 -0
- package/src/features/drawing/text-frame.d.ts +90 -0
- package/src/features/drawing/text-frame.js +152 -0
- package/src/features/drawing/types.d.ts +352 -0
- package/src/features/drawing/types.js +60 -0
- package/src/features/drawing/wrap-format.d.ts +62 -0
- package/src/features/drawing/wrap-format.js +114 -0
- package/src/features/editable-ranges/index.d.ts +494 -0
- package/src/features/editable-ranges/index.js +1348 -0
- package/src/features/fields/index.d.ts +428 -0
- package/src/features/fields/index.js +2148 -0
- package/src/features/fields/paragraph-field.d.ts +187 -0
- package/src/features/fields/paragraph-field.js +692 -0
- package/src/features/font-table/font-substitution-table.d.ts +75 -0
- package/src/features/font-table/font-substitution-table.js +257 -0
- package/src/features/font-table/font-table-entry.d.ts +255 -0
- package/src/features/font-table/font-table-entry.js +823 -0
- package/src/features/font-table/font-table.d.ts +128 -0
- package/src/features/font-table/font-table.js +313 -0
- package/src/features/font-table/index.d.ts +27 -0
- package/src/features/font-table/index.js +48 -0
- package/src/features/glossary/index.d.ts +97 -0
- package/src/features/glossary/index.js +286 -0
- package/src/features/headers-footers/index.d.ts +506 -0
- package/src/features/headers-footers/index.js +1666 -0
- package/src/features/hyperlinks/index.d.ts +230 -0
- package/src/features/hyperlinks/index.js +685 -0
- package/src/features/images/caption-authoring-api.d.ts +33 -0
- package/src/features/images/caption-authoring-api.js +33 -0
- package/src/features/images/caption-enums.d.ts +52 -0
- package/src/features/images/caption-enums.js +141 -0
- package/src/features/images/caption-host.d.ts +10 -0
- package/src/features/images/caption-host.js +21 -0
- package/src/features/images/captions.d.ts +13 -0
- package/src/features/images/captions.js +142 -0
- package/src/features/images/host-codec.d.ts +103 -0
- package/src/features/images/host-codec.js +720 -0
- package/src/features/images/image-sniff.d.ts +21 -0
- package/src/features/images/image-sniff.js +71 -0
- package/src/features/images/index.d.ts +506 -0
- package/src/features/images/index.js +1429 -0
- package/src/features/images/layout-types.d.ts +232 -0
- package/src/features/images/layout-types.js +294 -0
- package/src/features/images/public-entry.d.ts +9 -0
- package/src/features/images/public-entry.js +9 -0
- package/src/features/index.d.ts +35 -0
- package/src/features/index.js +36 -0
- package/src/features/mail-merge/index.d.ts +113 -0
- package/src/features/mail-merge/index.js +315 -0
- package/src/features/notes/index.d.ts +573 -0
- package/src/features/notes/index.js +1725 -0
- package/src/features/numbering/abstract-numbering.d.ts +90 -0
- package/src/features/numbering/abstract-numbering.js +292 -0
- package/src/features/numbering/index.d.ts +182 -0
- package/src/features/numbering/index.js +668 -0
- package/src/features/numbering/list-format.d.ts +158 -0
- package/src/features/numbering/list-format.js +590 -0
- package/src/features/numbering/list-string.d.ts +7 -0
- package/src/features/numbering/list-string.js +423 -0
- package/src/features/numbering/list-style.d.ts +204 -0
- package/src/features/numbering/list-style.js +1084 -0
- package/src/features/numbering/numbering-instance.d.ts +101 -0
- package/src/features/numbering/numbering-instance.js +329 -0
- package/src/features/numbering/numbering-level.d.ts +118 -0
- package/src/features/numbering/numbering-level.js +501 -0
- package/src/features/numbering/picture-bullet.d.ts +34 -0
- package/src/features/numbering/picture-bullet.js +88 -0
- package/src/features/ole-object/catalog.d.ts +300 -0
- package/src/features/ole-object/catalog.js +908 -0
- package/src/features/ole-object/index.d.ts +526 -0
- package/src/features/ole-object/index.js +1421 -0
- package/src/features/ole-object/relationship.d.ts +27 -0
- package/src/features/ole-object/relationship.js +27 -0
- package/src/features/ole-object/typed-dom.d.ts +186 -0
- package/src/features/ole-object/typed-dom.js +595 -0
- package/src/features/properties/index.d.ts +205 -0
- package/src/features/properties/index.js +549 -0
- package/src/features/revisions/index.d.ts +204 -0
- package/src/features/revisions/index.js +695 -0
- package/src/features/sections/column-collection.d.ts +119 -0
- package/src/features/sections/column-collection.js +478 -0
- package/src/features/sections/column.d.ts +15 -0
- package/src/features/sections/column.js +37 -0
- package/src/features/sections/index.d.ts +91 -0
- package/src/features/sections/index.js +1096 -0
- package/src/features/sections/margins.d.ts +40 -0
- package/src/features/sections/margins.js +105 -0
- package/src/features/sections/page-number-style.d.ts +21 -0
- package/src/features/sections/page-number-style.js +62 -0
- package/src/features/sections/page-orientation.d.ts +10 -0
- package/src/features/sections/page-orientation.js +10 -0
- package/src/features/sections/page-setup.d.ts +435 -0
- package/src/features/sections/page-setup.js +1479 -0
- package/src/features/sections/page-size.d.ts +59 -0
- package/src/features/sections/page-size.js +68 -0
- package/src/features/sections/section-break-code.d.ts +27 -0
- package/src/features/sections/section-break-code.js +60 -0
- package/src/features/sections/section-document-association.d.ts +18 -0
- package/src/features/sections/section-document-association.js +31 -0
- package/src/features/sections/section-validation.d.ts +43 -0
- package/src/features/sections/section-validation.js +97 -0
- package/src/features/settings/attached-template.d.ts +35 -0
- package/src/features/settings/attached-template.js +98 -0
- package/src/features/settings/compat-settings.d.ts +216 -0
- package/src/features/settings/compat-settings.js +508 -0
- package/src/features/settings/document-background.d.ts +59 -0
- package/src/features/settings/document-background.js +131 -0
- package/src/features/settings/document-protection.d.ts +65 -0
- package/src/features/settings/document-protection.js +157 -0
- package/src/features/settings/document-settings-facades.d.ts +108 -0
- package/src/features/settings/document-settings-facades.js +312 -0
- package/src/features/settings/document-settings-values.d.ts +43 -0
- package/src/features/settings/document-settings-values.js +60 -0
- package/src/features/settings/footnote-properties.d.ts +211 -0
- package/src/features/settings/footnote-properties.js +591 -0
- package/src/features/settings/index.d.ts +356 -0
- package/src/features/settings/index.js +829 -0
- package/src/features/settings/settings-children.d.ts +151 -0
- package/src/features/settings/settings-children.js +505 -0
- package/src/features/settings/web-settings.d.ts +88 -0
- package/src/features/settings/web-settings.js +227 -0
- package/src/features/settings/zoom.d.ts +79 -0
- package/src/features/settings/zoom.js +147 -0
- package/src/features/styles/builtin-catalog.d.ts +159 -0
- package/src/features/styles/builtin-catalog.js +963 -0
- package/src/features/styles/builtin-resolver.d.ts +49 -0
- package/src/features/styles/builtin-resolver.js +165 -0
- package/src/features/styles/default-styles.d.ts +37 -0
- package/src/features/styles/default-styles.js +186 -0
- package/src/features/styles/default-theme.d.ts +13 -0
- package/src/features/styles/default-theme.js +13 -0
- package/src/features/styles/doc-defaults.d.ts +58 -0
- package/src/features/styles/doc-defaults.js +178 -0
- package/src/features/styles/formatting-resolver.d.ts +27 -0
- package/src/features/styles/formatting-resolver.js +72 -0
- package/src/features/styles/index.d.ts +256 -0
- package/src/features/styles/index.js +1325 -0
- package/src/features/styles/latent-styles.d.ts +68 -0
- package/src/features/styles/latent-styles.js +305 -0
- package/src/features/styles/paragraph-properties.d.ts +71 -0
- package/src/features/styles/paragraph-properties.js +237 -0
- package/src/features/styles/run-properties.d.ts +93 -0
- package/src/features/styles/run-properties.js +516 -0
- package/src/features/styles/style-base.d.ts +402 -0
- package/src/features/styles/style-base.js +1026 -0
- package/src/features/styles/style-collection.d.ts +264 -0
- package/src/features/styles/style-collection.js +714 -0
- package/src/features/styles/style-format-bridge.d.ts +64 -0
- package/src/features/styles/style-format-bridge.js +100 -0
- package/src/features/styles/style.d.ts +84 -0
- package/src/features/styles/style.js +375 -0
- package/src/features/styles/styles-with-effects.d.ts +71 -0
- package/src/features/styles/styles-with-effects.js +180 -0
- package/src/features/styles/table-style.d.ts +272 -0
- package/src/features/styles/table-style.js +1226 -0
- package/src/features/styles/theme.d.ts +126 -0
- package/src/features/styles/theme.js +377 -0
- package/src/features/tables/border-style-map.d.ts +24 -0
- package/src/features/tables/border-style-map.js +81 -0
- package/src/features/tables/borders.d.ts +126 -0
- package/src/features/tables/borders.js +527 -0
- package/src/features/tables/collections.d.ts +113 -0
- package/src/features/tables/collections.js +261 -0
- package/src/features/tables/format.d.ts +208 -0
- package/src/features/tables/format.js +716 -0
- package/src/features/tables/index.d.ts +597 -0
- package/src/features/tables/index.js +2386 -0
- package/src/features/tables/paddings.d.ts +41 -0
- package/src/features/tables/paddings.js +97 -0
- package/src/features/tables/tbl-pr-positioning.d.ts +27 -0
- package/src/features/tables/tbl-pr-positioning.js +178 -0
- package/src/features/tables/tbl-pr.d.ts +528 -0
- package/src/features/tables/tbl-pr.js +1208 -0
- package/src/features/tables/tc-pr.d.ts +168 -0
- package/src/features/tables/tc-pr.js +553 -0
- package/src/features/tables/tr-pr.d.ts +60 -0
- package/src/features/tables/tr-pr.js +215 -0
- package/src/features/watermark/detect.d.ts +76 -0
- package/src/features/watermark/detect.js +219 -0
- package/src/features/watermark/index.d.ts +28 -0
- package/src/features/watermark/index.js +91 -0
- package/src/features/watermark/logical-store.d.ts +29 -0
- package/src/features/watermark/logical-store.js +31 -0
- package/src/features/watermark/model.d.ts +285 -0
- package/src/features/watermark/model.js +597 -0
- package/src/features/watermark/parse.d.ts +84 -0
- package/src/features/watermark/parse.js +815 -0
- package/src/features/watermark/serialize.d.ts +98 -0
- package/src/features/watermark/serialize.js +1517 -0
- package/src/global.js +1 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DocxStyle, DocxStyleType } from './style';
|
|
2
|
+
/**
|
|
3
|
+
* Lookup / mutation surface the built-in catalog resolver needs.
|
|
4
|
+
* Implemented by `StylesPart` (transitional DocxStyle projection) and seed bags.
|
|
5
|
+
* Named distinctly from the public live {@link StyleCollection} DOM type.
|
|
6
|
+
*
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
export interface StyleLookupSurface {
|
|
10
|
+
getStyle(styleId: string): DocxStyle | undefined;
|
|
11
|
+
/** Style whose `w:name` matches `name` after normalization. */
|
|
12
|
+
findStyleByDisplayName(name: string): DocxStyle | undefined;
|
|
13
|
+
addStyle(style: DocxStyle): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Resolve one style (id or display name) into the collection for `target`,
|
|
17
|
+
* following §5.1: document-first, catalog-second, dependencies recursive,
|
|
18
|
+
* cycle-safe, duplicate-free. Returns the style — existing or newly
|
|
19
|
+
* instantiated. Throws `styles/undefined-style` for unknown values.
|
|
20
|
+
*
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveStyleForTarget(collection: StyleLookupSurface, nameOrId: string, target: DocxStyleType): DocxStyle;
|
|
24
|
+
/**
|
|
25
|
+
* Resolve `style`'s `basedOn` / `next` / `link` dependencies, recursively,
|
|
26
|
+
* adding each missing dependency before its dependent (deterministic
|
|
27
|
+
* order). `visited` is the cycle guard: it starts with the dependent's own
|
|
28
|
+
* id and accumulates every id already resolved on this branch.
|
|
29
|
+
*
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveDependencies(collection: StyleLookupSurface, style: DocxStyle, visited: Set<string>): void;
|
|
33
|
+
/**
|
|
34
|
+
* Resolve a referenced style id at save time (pending materialization /
|
|
35
|
+
* parsed references): document-first, catalog-second, unknown preserved
|
|
36
|
+
* without error. `target` type-checks a catalog hit only (an unknown
|
|
37
|
+
* reference that stays absent is valid OOXML — a dangling reference).
|
|
38
|
+
*
|
|
39
|
+
* @private
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveReferencedStyle(collection: StyleLookupSurface, styleId: string, target: DocxStyleType): DocxStyle | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Normalize `nameOrId` to the canonical built-in id when it names a known
|
|
44
|
+
* built-in (id or display name); otherwise return the value verbatim
|
|
45
|
+
* (custom styles keep their id).
|
|
46
|
+
*
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
export declare function canonicalizeStyleReference(nameOrId: string): string;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic built-in style resolver (spec
|
|
3
|
+
* `docs/specs/styles-builtin-definitions-catalog.md` §5, §6, §8, §9).
|
|
4
|
+
*
|
|
5
|
+
* One algorithm for all four {@link DocxStyleType}s:
|
|
6
|
+
* 1. document collection first (by `styleId`, then by display name) — an
|
|
7
|
+
* existing (possibly user-modified) style is used unchanged, never
|
|
8
|
+
* replaced by catalog defaults;
|
|
9
|
+
* 2. built-in catalog second (canonical ID, then display name) —
|
|
10
|
+
* deep-cloned via {@link instantiateBuiltinStyle};
|
|
11
|
+
* 3. dependencies (`basedOn`, `next`, `link`) resolved recursively with a
|
|
12
|
+
* visited-set (cycle-safe, duplicate-free, type-validated);
|
|
13
|
+
* 4. unknown on both paths — `styles/undefined-style` at the public
|
|
14
|
+
* assignment bridges; preserved silently on the parsed/save path
|
|
15
|
+
* (round-trip compatibility).
|
|
16
|
+
*
|
|
17
|
+
* @private
|
|
18
|
+
*/
|
|
19
|
+
import { DocxError } from '../../core/errors/docx-error';
|
|
20
|
+
import { canonicalBuiltinStyleId, getBuiltinStyleTemplate, getBuiltinStyleTemplateByDisplayName, instantiateBuiltinStyle, } from './builtin-catalog';
|
|
21
|
+
function throwUndefinedStyle(nameOrId, target) {
|
|
22
|
+
throw new DocxError('styles/undefined-style', "Style \"" + nameOrId + "\" is not defined in this document and is not a known built-in " + target + " style");
|
|
23
|
+
}
|
|
24
|
+
function invalidTypeForTarget(style, target) {
|
|
25
|
+
return new DocxError('styles/invalid-type-for-target', "Style \"" + style.styleId + "\" is a " + String(style.type) + " style and cannot be used as a " + target + " style");
|
|
26
|
+
}
|
|
27
|
+
function assertType(style, target) {
|
|
28
|
+
if (style.type !== target) {
|
|
29
|
+
throw invalidTypeForTarget(style, target);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function oppositeType(type) {
|
|
33
|
+
return type === 'paragraph' ? 'character' : 'paragraph';
|
|
34
|
+
}
|
|
35
|
+
/** Style type for dependency resolution; untyped styles can't have typed deps validated. */
|
|
36
|
+
function typeOf(style) {
|
|
37
|
+
return style.type != null ? style.type : 'paragraph';
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Resolve one style (id or display name) into the collection for `target`,
|
|
41
|
+
* following §5.1: document-first, catalog-second, dependencies recursive,
|
|
42
|
+
* cycle-safe, duplicate-free. Returns the style — existing or newly
|
|
43
|
+
* instantiated. Throws `styles/undefined-style` for unknown values.
|
|
44
|
+
*
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
export function resolveStyleForTarget(collection, nameOrId, target) {
|
|
48
|
+
var __ts33_0, __ts33_1;
|
|
49
|
+
if (nameOrId.trim().length === 0) {
|
|
50
|
+
throw new DocxError('content/invalid-style-id', 'Style id must not be empty');
|
|
51
|
+
}
|
|
52
|
+
// 2. WordDocument collection: by id, then by display name. Existing style is
|
|
53
|
+
// used unchanged (user modifications preserved).
|
|
54
|
+
var existing = ((__ts33_0 = collection.getStyle(nameOrId)), __ts33_0 != null ? __ts33_0 : collection.findStyleByDisplayName(nameOrId));
|
|
55
|
+
if (existing !== undefined) {
|
|
56
|
+
assertType(existing, target);
|
|
57
|
+
return existing;
|
|
58
|
+
}
|
|
59
|
+
// 3. Catalog: canonical ID, then display name.
|
|
60
|
+
var template = ((__ts33_1 = getBuiltinStyleTemplate(nameOrId)), __ts33_1 != null ? __ts33_1 : getBuiltinStyleTemplateByDisplayName(nameOrId));
|
|
61
|
+
if (template === undefined) {
|
|
62
|
+
throwUndefinedStyle(nameOrId, target);
|
|
63
|
+
}
|
|
64
|
+
if (template.type !== target) {
|
|
65
|
+
throw new DocxError('styles/invalid-type-for-target', "Built-in style \"" + template.styleId + "\" is a " + template.type + " style and cannot be used as a " + target + " style");
|
|
66
|
+
}
|
|
67
|
+
var instance = instantiateBuiltinStyle(template);
|
|
68
|
+
resolveDependencies(collection, instance, new Set([template.styleId]));
|
|
69
|
+
collection.addStyle(instance);
|
|
70
|
+
return instance;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Resolve `style`'s `basedOn` / `next` / `link` dependencies, recursively,
|
|
74
|
+
* adding each missing dependency before its dependent (deterministic
|
|
75
|
+
* order). `visited` is the cycle guard: it starts with the dependent's own
|
|
76
|
+
* id and accumulates every id already resolved on this branch.
|
|
77
|
+
*
|
|
78
|
+
* @private
|
|
79
|
+
*/
|
|
80
|
+
export function resolveDependencies(collection, style, visited) {
|
|
81
|
+
var basedOn = style.basedOn;
|
|
82
|
+
if (basedOn !== undefined && basedOn.length > 0) {
|
|
83
|
+
resolveDependency(collection, style, basedOn, 'basedOn', typeOf(style), visited);
|
|
84
|
+
}
|
|
85
|
+
var next = style.next;
|
|
86
|
+
if (next !== undefined && next.length > 0) {
|
|
87
|
+
// `next` must exist when it is a known built-in; a custom next style is
|
|
88
|
+
// the document's own and is never invented.
|
|
89
|
+
var canonical = canonicalBuiltinStyleId(next);
|
|
90
|
+
if (canonical !== undefined && collection.getStyle(next) === undefined) {
|
|
91
|
+
resolveStyleForTarget(collection, next, typeOf(style));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
var link = style.link;
|
|
95
|
+
if (link !== undefined && link.length > 0) {
|
|
96
|
+
resolveDependency(collection, style, link, 'link', oppositeType(typeOf(style)), visited);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function resolveDependency(collection, dependent, dependencyId, kind, expectedType, visited) {
|
|
100
|
+
// Existing (possibly user-modified) dependency — reuse unchanged.
|
|
101
|
+
var existing = collection.getStyle(dependencyId);
|
|
102
|
+
if (existing !== undefined) {
|
|
103
|
+
if (existing.type !== expectedType) {
|
|
104
|
+
throw new DocxError(kind === 'basedOn' ? 'styles/invalid-based-on' : 'styles/invalid-link', "Style \"" + dependent.styleId + "\" " + kind + " \"" + dependencyId + "\" is a " + String(existing.type) + " style; expected " + expectedType);
|
|
105
|
+
}
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
// Cycle: the dependency chain returned to a style already on this
|
|
109
|
+
// branch. Parsed cycles are preserved verbatim and only guarded here —
|
|
110
|
+
// report and stop, never recurse.
|
|
111
|
+
if (visited.has(dependencyId)) {
|
|
112
|
+
throw new DocxError(kind === 'basedOn' ? 'styles/circular-based-on' : 'styles/circular-link', "Circular " + kind + " relationship on style \"" + dependencyId + "\"");
|
|
113
|
+
}
|
|
114
|
+
var template = getBuiltinStyleTemplate(dependencyId);
|
|
115
|
+
if (template === undefined) {
|
|
116
|
+
// A catalog style referencing an unknown dependency: preserve the
|
|
117
|
+
// reference verbatim (it round-trips); the document may define it later.
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (template.type !== expectedType) {
|
|
121
|
+
throw new DocxError(kind === 'basedOn' ? 'styles/invalid-based-on' : 'styles/invalid-link', "Style \"" + dependent.styleId + "\" " + kind + " \"" + dependencyId + "\" is a " + template.type + " style; expected " + expectedType);
|
|
122
|
+
}
|
|
123
|
+
var instance = instantiateBuiltinStyle(template);
|
|
124
|
+
var branchVisited = new Set(visited);
|
|
125
|
+
branchVisited.add(dependencyId);
|
|
126
|
+
resolveDependencies(collection, instance, branchVisited);
|
|
127
|
+
collection.addStyle(instance);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Resolve a referenced style id at save time (pending materialization /
|
|
131
|
+
* parsed references): document-first, catalog-second, unknown preserved
|
|
132
|
+
* without error. `target` type-checks a catalog hit only (an unknown
|
|
133
|
+
* reference that stays absent is valid OOXML — a dangling reference).
|
|
134
|
+
*
|
|
135
|
+
* @private
|
|
136
|
+
*/
|
|
137
|
+
export function resolveReferencedStyle(collection, styleId, target) {
|
|
138
|
+
var __ts33_2, __ts33_3;
|
|
139
|
+
var existing = ((__ts33_2 = collection.getStyle(styleId)), __ts33_2 != null ? __ts33_2 : collection.findStyleByDisplayName(styleId));
|
|
140
|
+
if (existing !== undefined) {
|
|
141
|
+
return existing;
|
|
142
|
+
}
|
|
143
|
+
var template = ((__ts33_3 = getBuiltinStyleTemplate(styleId)), __ts33_3 != null ? __ts33_3 : getBuiltinStyleTemplateByDisplayName(styleId));
|
|
144
|
+
if (template === undefined) {
|
|
145
|
+
return undefined;
|
|
146
|
+
}
|
|
147
|
+
if (template.type !== target) {
|
|
148
|
+
throw new DocxError('styles/invalid-type-for-target', "Built-in style \"" + template.styleId + "\" is a " + template.type + " style and cannot be used as a " + target + " style");
|
|
149
|
+
}
|
|
150
|
+
var instance = instantiateBuiltinStyle(template);
|
|
151
|
+
resolveDependencies(collection, instance, new Set([template.styleId]));
|
|
152
|
+
collection.addStyle(instance);
|
|
153
|
+
return instance;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Normalize `nameOrId` to the canonical built-in id when it names a known
|
|
157
|
+
* built-in (id or display name); otherwise return the value verbatim
|
|
158
|
+
* (custom styles keep their id).
|
|
159
|
+
*
|
|
160
|
+
* @private
|
|
161
|
+
*/
|
|
162
|
+
export function canonicalizeStyleReference(nameOrId) {
|
|
163
|
+
var __ts33_4;
|
|
164
|
+
return ((__ts33_4 = canonicalBuiltinStyleId(nameOrId)), __ts33_4 != null ? __ts33_4 : nameOrId);
|
|
165
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DocDefaults } from './doc-defaults';
|
|
2
|
+
import { DocxStyle } from './style';
|
|
3
|
+
/**
|
|
4
|
+
* Build the structural `w:docDefaults` element matching the Word minimum.
|
|
5
|
+
*
|
|
6
|
+
* CT_DocDefaults sequence: `rPrDefault?`, `pPrDefault?`.
|
|
7
|
+
* Run defaults beyond size (TASK-8039) from Word sample evidence.
|
|
8
|
+
* `sz` / `szCs` use `ST_HpsMeasure` half-points (`24` = 12 pt) — TASK-8035.
|
|
9
|
+
* Paragraph spacing under `pPrDefault` — TASK-8038.
|
|
10
|
+
*
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildDefaultDocDefaults(): DocDefaults;
|
|
14
|
+
/**
|
|
15
|
+
* Arguments for constructing a `StylesPart` with the canonical Word create-path
|
|
16
|
+
* defaults. Returned by {@link buildDefaultStylesArgs} to avoid a circular
|
|
17
|
+
* module dependency (`index.ts` ↔ `default-styles.ts`).
|
|
18
|
+
*
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
21
|
+
export interface DefaultStylesArgs {
|
|
22
|
+
readonly docDefaults: DocDefaults;
|
|
23
|
+
readonly styles: DocxStyle[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Constructor args for a `StylesPart` pre-populated with catalog-complete
|
|
27
|
+
* create-path styles (spec §4).
|
|
28
|
+
*
|
|
29
|
+
* Called when no `styles.xml` OPC part exists — `WordDocument.create()` and
|
|
30
|
+
* scratch loads. Caller must pass `dirty = true` to `StylesPart`.
|
|
31
|
+
*
|
|
32
|
+
* Seeded style ids: `Normal`, `DefaultParagraphFont`, `TableNormal`, `NoList`,
|
|
33
|
+
* `TableGrid`, `Hyperlink`. No optional built-ins.
|
|
34
|
+
*
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
export declare function buildDefaultStylesArgs(): DefaultStylesArgs;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
var __values = (this && this.__values) || function (o) {
|
|
2
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
|
3
|
+
if (m) return m.call(o);
|
|
4
|
+
return {
|
|
5
|
+
next: function () {
|
|
6
|
+
if (o && i >= o.length) o = void 0;
|
|
7
|
+
return { value: o && o[i++], done: !o };
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
12
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
13
|
+
if (!m) return o;
|
|
14
|
+
var i = m.call(o), r, ar = [], e;
|
|
15
|
+
try {
|
|
16
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
17
|
+
}
|
|
18
|
+
catch (error) { e = { error: error }; }
|
|
19
|
+
finally {
|
|
20
|
+
try {
|
|
21
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
22
|
+
}
|
|
23
|
+
finally { if (e) throw e.error; }
|
|
24
|
+
}
|
|
25
|
+
return ar;
|
|
26
|
+
};
|
|
27
|
+
var __spread = (this && this.__spread) || function () {
|
|
28
|
+
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Canonical Word create-path styles when no `styles.xml` part exists.
|
|
33
|
+
*
|
|
34
|
+
* `docDefaults` remain the shipped structural default (TASK-8035/8038/8039).
|
|
35
|
+
* Mandatory + create-path styles are deep-cloned from the built-in catalog
|
|
36
|
+
* (`docs/specs/styles-builtin-definitions-catalog.md` §4) via the generic
|
|
37
|
+
* resolver so dependencies land before dependents and the catalog is never
|
|
38
|
+
* mutated.
|
|
39
|
+
*
|
|
40
|
+
* @private
|
|
41
|
+
*/
|
|
42
|
+
import { wmlAttr, wmlElement, } from '../document/wml';
|
|
43
|
+
import { resolveStyleForTarget } from './builtin-resolver';
|
|
44
|
+
import { DocDefaults } from './doc-defaults';
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
// docDefaults (unchanged structural create-path default)
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
/**
|
|
49
|
+
* Build the structural `w:docDefaults` element matching the Word minimum.
|
|
50
|
+
*
|
|
51
|
+
* CT_DocDefaults sequence: `rPrDefault?`, `pPrDefault?`.
|
|
52
|
+
* Run defaults beyond size (TASK-8039) from Word sample evidence.
|
|
53
|
+
* `sz` / `szCs` use `ST_HpsMeasure` half-points (`24` = 12 pt) — TASK-8035.
|
|
54
|
+
* Paragraph spacing under `pPrDefault` — TASK-8038.
|
|
55
|
+
*
|
|
56
|
+
* @private
|
|
57
|
+
*/
|
|
58
|
+
export function buildDefaultDocDefaults() {
|
|
59
|
+
var rFonts = wmlElement('rFonts', {
|
|
60
|
+
attributes: [
|
|
61
|
+
wmlAttr('asciiTheme', 'minorHAnsi'),
|
|
62
|
+
wmlAttr('eastAsiaTheme', 'minorHAnsi'),
|
|
63
|
+
wmlAttr('hAnsiTheme', 'minorHAnsi'),
|
|
64
|
+
wmlAttr('cstheme', 'minorBidi'),
|
|
65
|
+
],
|
|
66
|
+
});
|
|
67
|
+
var kern = wmlElement('kern', { attributes: [wmlAttr('val', '2')] });
|
|
68
|
+
var sz = wmlElement('sz', { attributes: [wmlAttr('val', '24')] });
|
|
69
|
+
var szCs = wmlElement('szCs', { attributes: [wmlAttr('val', '24')] });
|
|
70
|
+
var lang = wmlElement('lang', {
|
|
71
|
+
attributes: [
|
|
72
|
+
wmlAttr('val', 'en-US'),
|
|
73
|
+
wmlAttr('eastAsia', 'en-US'),
|
|
74
|
+
wmlAttr('bidi', 'ar-SA'),
|
|
75
|
+
],
|
|
76
|
+
});
|
|
77
|
+
var rPr = wmlElement('rPr', { children: [rFonts, kern, sz, szCs, lang] });
|
|
78
|
+
var rPrDefault = wmlElement('rPrDefault', { children: [rPr] });
|
|
79
|
+
var spacing = wmlElement('spacing', {
|
|
80
|
+
attributes: [wmlAttr('after', '160'), wmlAttr('line', '278'), wmlAttr('lineRule', 'auto')],
|
|
81
|
+
});
|
|
82
|
+
var pPr = wmlElement('pPr', { children: [spacing] });
|
|
83
|
+
var pPrDefault = wmlElement('pPrDefault', { children: [pPr] });
|
|
84
|
+
return new DocDefaults(rPrDefault, pPrDefault);
|
|
85
|
+
}
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
// Create-path seed set (spec §1.2 + TASK-8027 extras)
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
/**
|
|
90
|
+
* Styles seeded on `WordDocument.create()` / missing `styles.xml` (spec §4).
|
|
91
|
+
* Order is the resolve order: bases before dependents so the temporary
|
|
92
|
+
* collection stays duplicate-free when the resolver walks `basedOn`.
|
|
93
|
+
*
|
|
94
|
+
* Emission order in the part may differ slightly (resolver may insert a
|
|
95
|
+
* dependency before the requested id); Word does not require a fixed style
|
|
96
|
+
* child order under `w:styles`.
|
|
97
|
+
*/
|
|
98
|
+
var CREATE_PATH_SEEDS = [
|
|
99
|
+
{ styleId: 'Normal', type: 'paragraph' },
|
|
100
|
+
{ styleId: 'DefaultParagraphFont', type: 'character' },
|
|
101
|
+
{ styleId: 'TableNormal', type: 'table' },
|
|
102
|
+
{ styleId: 'NoList', type: 'numbering' },
|
|
103
|
+
{ styleId: 'TableGrid', type: 'table' },
|
|
104
|
+
{ styleId: 'Hyperlink', type: 'character' },
|
|
105
|
+
];
|
|
106
|
+
/**
|
|
107
|
+
* Mutable bag used only while seeding create-path styles through the
|
|
108
|
+
* resolver (avoids constructing a full `StylesPart` and circular imports).
|
|
109
|
+
*/
|
|
110
|
+
var SeedStyleCollection = /** @class */ (function () {
|
|
111
|
+
function SeedStyleCollection() {
|
|
112
|
+
this.byId = new Map();
|
|
113
|
+
this.ordered = [];
|
|
114
|
+
}
|
|
115
|
+
SeedStyleCollection.prototype.getStyle = function (styleId) {
|
|
116
|
+
return this.byId.get(styleId);
|
|
117
|
+
};
|
|
118
|
+
SeedStyleCollection.prototype.findStyleByDisplayName = function (name) {
|
|
119
|
+
var e_1, _a;
|
|
120
|
+
var needle = name.trim().toLowerCase().replace(/\s+/g, '');
|
|
121
|
+
if (needle.length === 0) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
for (var _b = __values(this.ordered), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
126
|
+
var style = _c.value;
|
|
127
|
+
var styleName = style.name;
|
|
128
|
+
if (styleName !== undefined && styleName.trim().toLowerCase().replace(/\s+/g, '') === needle) {
|
|
129
|
+
return style;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
134
|
+
finally {
|
|
135
|
+
try {
|
|
136
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
137
|
+
}
|
|
138
|
+
finally { if (e_1) throw e_1.error; }
|
|
139
|
+
}
|
|
140
|
+
return undefined;
|
|
141
|
+
};
|
|
142
|
+
SeedStyleCollection.prototype.addStyle = function (style) {
|
|
143
|
+
if (this.byId.has(style.styleId)) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
this.ordered.push(style);
|
|
147
|
+
this.byId.set(style.styleId, style);
|
|
148
|
+
};
|
|
149
|
+
SeedStyleCollection.prototype.styles = function () {
|
|
150
|
+
return __spread(this.ordered);
|
|
151
|
+
};
|
|
152
|
+
return SeedStyleCollection;
|
|
153
|
+
}());
|
|
154
|
+
/**
|
|
155
|
+
* Constructor args for a `StylesPart` pre-populated with catalog-complete
|
|
156
|
+
* create-path styles (spec §4).
|
|
157
|
+
*
|
|
158
|
+
* Called when no `styles.xml` OPC part exists — `WordDocument.create()` and
|
|
159
|
+
* scratch loads. Caller must pass `dirty = true` to `StylesPart`.
|
|
160
|
+
*
|
|
161
|
+
* Seeded style ids: `Normal`, `DefaultParagraphFont`, `TableNormal`, `NoList`,
|
|
162
|
+
* `TableGrid`, `Hyperlink`. No optional built-ins.
|
|
163
|
+
*
|
|
164
|
+
* @private
|
|
165
|
+
*/
|
|
166
|
+
export function buildDefaultStylesArgs() {
|
|
167
|
+
var e_2, _a;
|
|
168
|
+
var collection = new SeedStyleCollection();
|
|
169
|
+
try {
|
|
170
|
+
for (var CREATE_PATH_SEEDS_1 = __values(CREATE_PATH_SEEDS), CREATE_PATH_SEEDS_1_1 = CREATE_PATH_SEEDS_1.next(); !CREATE_PATH_SEEDS_1_1.done; CREATE_PATH_SEEDS_1_1 = CREATE_PATH_SEEDS_1.next()) {
|
|
171
|
+
var seed = CREATE_PATH_SEEDS_1_1.value;
|
|
172
|
+
resolveStyleForTarget(collection, seed.styleId, seed.type);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
176
|
+
finally {
|
|
177
|
+
try {
|
|
178
|
+
if (CREATE_PATH_SEEDS_1_1 && !CREATE_PATH_SEEDS_1_1.done && (_a = CREATE_PATH_SEEDS_1.return)) _a.call(CREATE_PATH_SEEDS_1);
|
|
179
|
+
}
|
|
180
|
+
finally { if (e_2) throw e_2.error; }
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
docDefaults: buildDefaultDocDefaults(),
|
|
184
|
+
styles: collection.styles(),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical Word "Office Theme" payload emitted when no Theme part exists.
|
|
3
|
+
*
|
|
4
|
+
* Evidence: `word/theme/theme1.xml` extracted from
|
|
5
|
+
* `input-documents/Sample_With_All_word_Element.docx` (Microsoft Word Office Theme).
|
|
6
|
+
* Root `a:theme` with `themeElements` (clrScheme/fontScheme/fmtScheme),
|
|
7
|
+
* `objectDefaults`, `extraClrSchemeLst`, and `extLst` / thm15:themeFamily.
|
|
8
|
+
* DrawingML Main NS (ECMA-376-1 section 14.2.7). Do not invent OOXML - bytes are
|
|
9
|
+
* Word-proven fixture content only.
|
|
10
|
+
*
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
13
|
+
export declare const DEFAULT_OFFICE_THEME_XML = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\"><a:themeElements><a:clrScheme name=\"Office\"><a:dk1><a:sysClr val=\"windowText\" lastClr=\"000000\"/></a:dk1><a:lt1><a:sysClr val=\"window\" lastClr=\"FFFFFF\"/></a:lt1><a:dk2><a:srgbClr val=\"0E2841\"/></a:dk2><a:lt2><a:srgbClr val=\"E8E8E8\"/></a:lt2><a:accent1><a:srgbClr val=\"156082\"/></a:accent1><a:accent2><a:srgbClr val=\"E97132\"/></a:accent2><a:accent3><a:srgbClr val=\"196B24\"/></a:accent3><a:accent4><a:srgbClr val=\"0F9ED5\"/></a:accent4><a:accent5><a:srgbClr val=\"A02B93\"/></a:accent5><a:accent6><a:srgbClr val=\"4EA72E\"/></a:accent6><a:hlink><a:srgbClr val=\"467886\"/></a:hlink><a:folHlink><a:srgbClr val=\"96607D\"/></a:folHlink></a:clrScheme><a:fontScheme name=\"Office\"><a:majorFont><a:latin typeface=\"Aptos Display\" panose=\"02110004020202020204\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"\u6E38\u30B4\u30B7\u30C3\u30AF Light\"/><a:font script=\"Hang\" typeface=\"\uB9D1\uC740 \uACE0\uB515\"/><a:font script=\"Hans\" typeface=\"\u7B49\u7EBF Light\"/><a:font script=\"Hant\" typeface=\"\u65B0\u7D30\u660E\u9AD4\"/><a:font script=\"Arab\" typeface=\"Times New Roman\"/><a:font script=\"Hebr\" typeface=\"Times New Roman\"/><a:font script=\"Thai\" typeface=\"Angsana New\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"MoolBoran\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Times New Roman\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/><a:font script=\"Armn\" typeface=\"Arial\"/><a:font script=\"Bugi\" typeface=\"Leelawadee UI\"/><a:font script=\"Bopo\" typeface=\"Microsoft JhengHei\"/><a:font script=\"Java\" typeface=\"Javanese Text\"/><a:font script=\"Lisu\" typeface=\"Segoe UI\"/><a:font script=\"Mymr\" typeface=\"Myanmar Text\"/><a:font script=\"Nkoo\" typeface=\"Ebrima\"/><a:font script=\"Olck\" typeface=\"Nirmala UI\"/><a:font script=\"Osma\" typeface=\"Ebrima\"/><a:font script=\"Phag\" typeface=\"Phagspa\"/><a:font script=\"Syrn\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Syrj\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Syre\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Sora\" typeface=\"Nirmala UI\"/><a:font script=\"Tale\" typeface=\"Microsoft Tai Le\"/><a:font script=\"Talu\" typeface=\"Microsoft New Tai Lue\"/><a:font script=\"Tfng\" typeface=\"Ebrima\"/></a:majorFont><a:minorFont><a:latin typeface=\"Aptos\" panose=\"02110004020202020204\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"\u6E38\u660E\u671D\"/><a:font script=\"Hang\" typeface=\"\uB9D1\uC740 \uACE0\uB515\"/><a:font script=\"Hans\" typeface=\"\u7B49\u7EBF\"/><a:font script=\"Hant\" typeface=\"\u65B0\u7D30\u660E\u9AD4\"/><a:font script=\"Arab\" typeface=\"Arial\"/><a:font script=\"Hebr\" typeface=\"Arial\"/><a:font script=\"Thai\" typeface=\"Cordia New\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"DaunPenh\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Arial\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/><a:font script=\"Armn\" typeface=\"Arial\"/><a:font script=\"Bugi\" typeface=\"Leelawadee UI\"/><a:font script=\"Bopo\" typeface=\"Microsoft JhengHei\"/><a:font script=\"Java\" typeface=\"Javanese Text\"/><a:font script=\"Lisu\" typeface=\"Segoe UI\"/><a:font script=\"Mymr\" typeface=\"Myanmar Text\"/><a:font script=\"Nkoo\" typeface=\"Ebrima\"/><a:font script=\"Olck\" typeface=\"Nirmala UI\"/><a:font script=\"Osma\" typeface=\"Ebrima\"/><a:font script=\"Phag\" typeface=\"Phagspa\"/><a:font script=\"Syrn\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Syrj\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Syre\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Sora\" typeface=\"Nirmala UI\"/><a:font script=\"Tale\" typeface=\"Microsoft Tai Le\"/><a:font script=\"Talu\" typeface=\"Microsoft New Tai Lue\"/><a:font script=\"Tfng\" typeface=\"Ebrima\"/></a:minorFont></a:fontScheme><a:fmtScheme name=\"Office\"><a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"110000\"/><a:satMod val=\"105000\"/><a:tint val=\"67000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"103000\"/><a:tint val=\"73000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"109000\"/><a:tint val=\"81000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:satMod val=\"103000\"/><a:lumMod val=\"102000\"/><a:tint val=\"94000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:satMod val=\"110000\"/><a:lumMod val=\"100000\"/><a:shade val=\"100000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"99000\"/><a:satMod val=\"120000\"/><a:shade val=\"78000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w=\"12700\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"19050\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"57150\" dist=\"19050\" dir=\"5400000\" algn=\"ctr\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"63000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:solidFill><a:schemeClr val=\"phClr\"><a:tint val=\"95000\"/><a:satMod val=\"170000\"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"93000\"/><a:satMod val=\"150000\"/><a:shade val=\"98000\"/><a:lumMod val=\"102000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:tint val=\"98000\"/><a:satMod val=\"130000\"/><a:shade val=\"90000\"/><a:lumMod val=\"103000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"63000\"/><a:satMod val=\"120000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults><a:lnDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx=\"2\"><a:schemeClr val=\"accent1\"/></a:lnRef><a:fillRef idx=\"0\"><a:schemeClr val=\"accent1\"/></a:fillRef><a:effectRef idx=\"1\"><a:schemeClr val=\"accent1\"/></a:effectRef><a:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></a:fontRef></a:style></a:lnDef></a:objectDefaults><a:extraClrSchemeLst/><a:extLst><a:ext uri=\"{05A4C25C-085E-4340-85A3-A5531E510DB2}\"><thm15:themeFamily xmlns:thm15=\"http://schemas.microsoft.com/office/thememl/2012/main\" name=\"Office Theme\" id=\"{2E142A2C-CD16-42D6-873A-C26D2A0506FA}\" vid=\"{1BDDFF52-6CD6-40A5-AB3C-68EB2F1E4D0A}\"/></a:ext></a:extLst></a:theme>";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical Word "Office Theme" payload emitted when no Theme part exists.
|
|
3
|
+
*
|
|
4
|
+
* Evidence: `word/theme/theme1.xml` extracted from
|
|
5
|
+
* `input-documents/Sample_With_All_word_Element.docx` (Microsoft Word Office Theme).
|
|
6
|
+
* Root `a:theme` with `themeElements` (clrScheme/fontScheme/fmtScheme),
|
|
7
|
+
* `objectDefaults`, `extraClrSchemeLst`, and `extLst` / thm15:themeFamily.
|
|
8
|
+
* DrawingML Main NS (ECMA-376-1 section 14.2.7). Do not invent OOXML - bytes are
|
|
9
|
+
* Word-proven fixture content only.
|
|
10
|
+
*
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
13
|
+
export var DEFAULT_OFFICE_THEME_XML = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\"><a:themeElements><a:clrScheme name=\"Office\"><a:dk1><a:sysClr val=\"windowText\" lastClr=\"000000\"/></a:dk1><a:lt1><a:sysClr val=\"window\" lastClr=\"FFFFFF\"/></a:lt1><a:dk2><a:srgbClr val=\"0E2841\"/></a:dk2><a:lt2><a:srgbClr val=\"E8E8E8\"/></a:lt2><a:accent1><a:srgbClr val=\"156082\"/></a:accent1><a:accent2><a:srgbClr val=\"E97132\"/></a:accent2><a:accent3><a:srgbClr val=\"196B24\"/></a:accent3><a:accent4><a:srgbClr val=\"0F9ED5\"/></a:accent4><a:accent5><a:srgbClr val=\"A02B93\"/></a:accent5><a:accent6><a:srgbClr val=\"4EA72E\"/></a:accent6><a:hlink><a:srgbClr val=\"467886\"/></a:hlink><a:folHlink><a:srgbClr val=\"96607D\"/></a:folHlink></a:clrScheme><a:fontScheme name=\"Office\"><a:majorFont><a:latin typeface=\"Aptos Display\" panose=\"02110004020202020204\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"游ゴシック Light\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"等线 Light\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Times New Roman\"/><a:font script=\"Hebr\" typeface=\"Times New Roman\"/><a:font script=\"Thai\" typeface=\"Angsana New\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"MoolBoran\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Times New Roman\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/><a:font script=\"Armn\" typeface=\"Arial\"/><a:font script=\"Bugi\" typeface=\"Leelawadee UI\"/><a:font script=\"Bopo\" typeface=\"Microsoft JhengHei\"/><a:font script=\"Java\" typeface=\"Javanese Text\"/><a:font script=\"Lisu\" typeface=\"Segoe UI\"/><a:font script=\"Mymr\" typeface=\"Myanmar Text\"/><a:font script=\"Nkoo\" typeface=\"Ebrima\"/><a:font script=\"Olck\" typeface=\"Nirmala UI\"/><a:font script=\"Osma\" typeface=\"Ebrima\"/><a:font script=\"Phag\" typeface=\"Phagspa\"/><a:font script=\"Syrn\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Syrj\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Syre\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Sora\" typeface=\"Nirmala UI\"/><a:font script=\"Tale\" typeface=\"Microsoft Tai Le\"/><a:font script=\"Talu\" typeface=\"Microsoft New Tai Lue\"/><a:font script=\"Tfng\" typeface=\"Ebrima\"/></a:majorFont><a:minorFont><a:latin typeface=\"Aptos\" panose=\"02110004020202020204\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\"游明朝\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"等线\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Arial\"/><a:font script=\"Hebr\" typeface=\"Arial\"/><a:font script=\"Thai\" typeface=\"Cordia New\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"DaunPenh\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Arial\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/><a:font script=\"Armn\" typeface=\"Arial\"/><a:font script=\"Bugi\" typeface=\"Leelawadee UI\"/><a:font script=\"Bopo\" typeface=\"Microsoft JhengHei\"/><a:font script=\"Java\" typeface=\"Javanese Text\"/><a:font script=\"Lisu\" typeface=\"Segoe UI\"/><a:font script=\"Mymr\" typeface=\"Myanmar Text\"/><a:font script=\"Nkoo\" typeface=\"Ebrima\"/><a:font script=\"Olck\" typeface=\"Nirmala UI\"/><a:font script=\"Osma\" typeface=\"Ebrima\"/><a:font script=\"Phag\" typeface=\"Phagspa\"/><a:font script=\"Syrn\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Syrj\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Syre\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Sora\" typeface=\"Nirmala UI\"/><a:font script=\"Tale\" typeface=\"Microsoft Tai Le\"/><a:font script=\"Talu\" typeface=\"Microsoft New Tai Lue\"/><a:font script=\"Tfng\" typeface=\"Ebrima\"/></a:minorFont></a:fontScheme><a:fmtScheme name=\"Office\"><a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"110000\"/><a:satMod val=\"105000\"/><a:tint val=\"67000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"103000\"/><a:tint val=\"73000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"109000\"/><a:tint val=\"81000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:satMod val=\"103000\"/><a:lumMod val=\"102000\"/><a:tint val=\"94000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:satMod val=\"110000\"/><a:lumMod val=\"100000\"/><a:shade val=\"100000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"99000\"/><a:satMod val=\"120000\"/><a:shade val=\"78000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w=\"12700\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"19050\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"57150\" dist=\"19050\" dir=\"5400000\" algn=\"ctr\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"63000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:solidFill><a:schemeClr val=\"phClr\"><a:tint val=\"95000\"/><a:satMod val=\"170000\"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"93000\"/><a:satMod val=\"150000\"/><a:shade val=\"98000\"/><a:lumMod val=\"102000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:tint val=\"98000\"/><a:satMod val=\"130000\"/><a:shade val=\"90000\"/><a:lumMod val=\"103000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"63000\"/><a:satMod val=\"120000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults><a:lnDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx=\"2\"><a:schemeClr val=\"accent1\"/></a:lnRef><a:fillRef idx=\"0\"><a:schemeClr val=\"accent1\"/></a:fillRef><a:effectRef idx=\"1\"><a:schemeClr val=\"accent1\"/></a:effectRef><a:fontRef idx=\"minor\"><a:schemeClr val=\"tx1\"/></a:fontRef></a:style></a:lnDef></a:objectDefaults><a:extraClrSchemeLst/><a:extLst><a:ext uri=\"{05A4C25C-085E-4340-85A3-A5531E510DB2}\"><thm15:themeFamily xmlns:thm15=\"http://schemas.microsoft.com/office/thememl/2012/main\" name=\"Office Theme\" id=\"{2E142A2C-CD16-42D6-873A-C26D2A0506FA}\" vid=\"{1BDDFF52-6CD6-40A5-AB3C-68EB2F1E4D0A}\"/></a:ext></a:extLst></a:theme>";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { OpenXmlElement } from '../../core/xml/index';
|
|
2
|
+
import { ModeledParagraphProperties } from './paragraph-properties';
|
|
3
|
+
import { ModeledRunProperties } from './run-properties';
|
|
4
|
+
/**
|
|
5
|
+
* WordDocument-level default paragraph and run properties (`w:docDefaults` / `CT_DocDefaults`).
|
|
6
|
+
*
|
|
7
|
+
* Sequence: optional `w:rPrDefault`, optional `w:pPrDefault` (Transitional `wml.xsd`).
|
|
8
|
+
* Unmodeled children are retained and re-emitted after the two known slots.
|
|
9
|
+
*
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
export declare class DocDefaults {
|
|
13
|
+
private readonly rPrDefaultElement;
|
|
14
|
+
private readonly pPrDefaultElement;
|
|
15
|
+
private readonly extras;
|
|
16
|
+
/**
|
|
17
|
+
* @private
|
|
18
|
+
*/
|
|
19
|
+
constructor(rPrDefault: OpenXmlElement | undefined, pPrDefault: OpenXmlElement | undefined, extras?: OpenXmlElement[]);
|
|
20
|
+
/**
|
|
21
|
+
* Opaque `w:rPrDefault` element when present.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
rPrDefault(): OpenXmlElement | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Modeled run properties from `w:rPrDefault/w:rPr`.
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
runProperties(): ModeledRunProperties;
|
|
32
|
+
/**
|
|
33
|
+
* Opaque `w:pPrDefault` element when present.
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
pPrDefault(): OpenXmlElement | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Modeled paragraph properties from `w:pPrDefault/w:pPr`.
|
|
40
|
+
*
|
|
41
|
+
* Spacing fields use plain point `number`s (twips on the wire). Absent markup
|
|
42
|
+
* yields an empty model (`spacing` undefined) — create-path defaults are not
|
|
43
|
+
* injected on load.
|
|
44
|
+
*
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
paragraphProperties(): ModeledParagraphProperties;
|
|
48
|
+
/**
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
51
|
+
serialize(): OpenXmlElement;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Parse `w:docDefaults` into {@link DocDefaults}.
|
|
55
|
+
*
|
|
56
|
+
* @private
|
|
57
|
+
*/
|
|
58
|
+
export declare function parseDocDefaults(element: OpenXmlElement): DocDefaults | undefined;
|