@web-ppt/edit-core 0.5.0-beta.1 → 0.5.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +188 -0
- package/README.md +165 -22
- package/dist/alt-text.d.ts +5 -0
- package/dist/appearance/index.d.ts +12 -0
- package/dist/appearance/materialize.d.ts +4 -0
- package/dist/appearance/types.d.ts +26 -0
- package/dist/appearance/values.d.ts +9 -0
- package/dist/appearance.js +301 -0
- package/dist/cfb/index.d.ts +5 -0
- package/dist/cfb/read.d.ts +16 -0
- package/dist/cfb/write.d.ts +3 -0
- package/dist/cfb.js +208 -0
- package/dist/change-classification.d.ts +3 -3
- package/dist/chart/category-binding.d.ts +4 -0
- package/dist/chart/category-commands.d.ts +23 -0
- package/dist/chart/category-levels.d.ts +14 -0
- package/dist/chart/category-matrix.d.ts +2 -0
- package/dist/chart/category-value.d.ts +2 -0
- package/dist/chart/category-workbook.d.ts +13 -0
- package/dist/chart/commands.d.ts +28 -0
- package/dist/chart/context.d.ts +12 -0
- package/dist/chart/dataset-merge.d.ts +5 -0
- package/dist/chart/formula.d.ts +13 -0
- package/dist/chart/identity-frames.d.ts +4 -0
- package/dist/chart/identity-scopes.d.ts +6 -0
- package/dist/chart/identity.d.ts +24 -0
- package/dist/chart/index.d.ts +8 -0
- package/dist/chart/limits.d.ts +6 -0
- package/dist/chart/locator.d.ts +4 -0
- package/dist/chart/materialize.d.ts +7 -0
- package/dist/chart/ordering.d.ts +9 -0
- package/dist/chart/part-graph.d.ts +5 -0
- package/dist/chart/patch-validation.d.ts +3 -0
- package/dist/chart/plot-kinds.d.ts +2 -0
- package/dist/chart/projection.d.ts +8 -0
- package/dist/chart/save.d.ts +4 -0
- package/dist/chart/shared-added-plan.d.ts +19 -0
- package/dist/chart/shared-added-records.d.ts +8 -0
- package/dist/chart/shared-address.d.ts +5 -0
- package/dist/chart/shared-allocate.d.ts +7 -0
- package/dist/chart/shared-cache-codec.d.ts +5 -0
- package/dist/chart/shared-cache-identities.d.ts +3 -0
- package/dist/chart/shared-cache-migration.d.ts +7 -0
- package/dist/chart/shared-cache-save.d.ts +3 -0
- package/dist/chart/shared-cache-scopes.d.ts +13 -0
- package/dist/chart/shared-cache.d.ts +11 -0
- package/dist/chart/shared-category.d.ts +4 -0
- package/dist/chart/shared-cell.d.ts +9 -0
- package/dist/chart/shared-family.d.ts +26 -0
- package/dist/chart/shared-fields.d.ts +18 -0
- package/dist/chart/shared-graph.d.ts +19 -0
- package/dist/chart/shared-growth-space.d.ts +5 -0
- package/dist/chart/shared-inserted-cells.d.ts +14 -0
- package/dist/chart/shared-inserted-command.d.ts +7 -0
- package/dist/chart/shared-inserted-layout.d.ts +16 -0
- package/dist/chart/shared-inserted-project.d.ts +14 -0
- package/dist/chart/shared-inserted-records.d.ts +16 -0
- package/dist/chart/shared-inserted-save.d.ts +6 -0
- package/dist/chart/shared-joint-command.d.ts +9 -0
- package/dist/chart/shared-joint-records.d.ts +9 -0
- package/dist/chart/shared-record-axis.d.ts +25 -0
- package/dist/chart/shared-record-remove.d.ts +13 -0
- package/dist/chart/shared-record-stage.d.ts +2 -0
- package/dist/chart/shared-records.d.ts +2 -0
- package/dist/chart/shared-rows.d.ts +17 -0
- package/dist/chart/shared-runtime.d.ts +19 -0
- package/dist/chart/shared-save-plan.d.ts +4 -0
- package/dist/chart/shared-save.d.ts +3 -0
- package/dist/chart/shared-series.d.ts +6 -0
- package/dist/chart/shared-source-cache.d.ts +4 -0
- package/dist/chart/shared-topology.d.ts +9 -0
- package/dist/chart/shared-unresolved.d.ts +3 -0
- package/dist/chart/shared-validation.d.ts +6 -0
- package/dist/chart/shared-workbook-source.d.ts +6 -0
- package/dist/chart/shared-xy-command.d.ts +7 -0
- package/dist/chart/shared-xy-family.d.ts +16 -0
- package/dist/chart/shared-xy-project.d.ts +6 -0
- package/dist/chart/shared-xy-records.d.ts +23 -0
- package/dist/chart/shared-xy-save.d.ts +5 -0
- package/dist/chart/shared-xy-source.d.ts +39 -0
- package/dist/chart/shared.d.ts +13 -0
- package/dist/chart/source.d.ts +11 -0
- package/dist/chart/types.d.ts +86 -0
- package/dist/chart/validation.d.ts +24 -0
- package/dist/chart/workbook-range.d.ts +16 -0
- package/dist/chart/workbook-read.d.ts +7 -0
- package/dist/chart/workbook-write.d.ts +9 -0
- package/dist/chart/workbook.d.ts +25 -0
- package/dist/chart/xml-data.d.ts +14 -0
- package/dist/chart/xml-namespaces.d.ts +16 -0
- package/dist/chart-design/index.d.ts +10 -0
- package/dist/chart-design/types.d.ts +11 -0
- package/dist/chart-design/xml.d.ts +2 -0
- package/dist/chart-design.js +361 -0
- package/dist/chart-ex/index.d.ts +15 -0
- package/dist/chart-ex/workbook.d.ts +6 -0
- package/dist/chart-ex/xml.d.ts +14 -0
- package/dist/chart-ex.js +457 -0
- package/dist/chart-shared/index.d.ts +12 -0
- package/dist/chart-shared.js +1 -0
- package/dist/chart.js +1 -0
- package/dist/clipboard-links-GuPtqr1z.js +778 -0
- package/dist/clipboard-package.d.ts +4 -0
- package/dist/clipboard-source.d.ts +6 -2
- package/dist/clipboard-trees.d.ts +9 -0
- package/dist/collaboration-identity.d.ts +3 -0
- package/dist/commands/add-slide-identity.d.ts +4 -0
- package/dist/commands/bullet-image-resource.d.ts +11 -0
- package/dist/commands/clear-format.d.ts +4 -0
- package/dist/commands/common-object-slide-patch.d.ts +4 -0
- package/dist/commands/common-object-slide-types.d.ts +68 -0
- package/dist/commands/convert-to-custom-geometry.d.ts +4 -0
- package/dist/commands/direct-format-patches.d.ts +11 -5
- package/dist/commands/distribute-elements.d.ts +4 -0
- package/dist/commands/edit-table-grid.d.ts +10 -0
- package/dist/commands/element-alt-text.d.ts +8 -0
- package/dist/commands/element-arrangement.d.ts +17 -0
- package/dist/commands/element-effects.d.ts +1 -1
- package/dist/commands/element-fill.d.ts +1 -1
- package/dist/commands/element-geometry.d.ts +9 -0
- package/dist/commands/element-hierarchy.d.ts +6 -0
- package/dist/commands/element-image-content.d.ts +2 -2
- package/dist/commands/element-link.d.ts +1 -1
- package/dist/commands/element-name.d.ts +1 -1
- package/dist/commands/element-stroke.d.ts +1 -1
- package/dist/commands/element-table-style.d.ts +5 -0
- package/dist/commands/element-text.d.ts +1 -1
- package/dist/commands/element-transform.d.ts +2 -2
- package/dist/commands/frame-decomposition.d.ts +10 -0
- package/dist/commands/generated-creation-defaults.d.ts +4 -0
- package/dist/commands/geometry-types.d.ts +44 -0
- package/dist/commands/group-types.d.ts +24 -0
- package/dist/commands/group.d.ts +4 -0
- package/dist/commands/hierarchy-record.d.ts +5 -0
- package/dist/commands/image-resource.d.ts +8 -1
- package/dist/commands/insertion-host.d.ts +16 -0
- package/dist/commands/insertion-rect.d.ts +2 -0
- package/dist/commands/layout-property.d.ts +7 -0
- package/dist/commands/master-property.d.ts +5 -0
- package/dist/commands/master-text-style-types.d.ts +27 -0
- package/dist/commands/master-text-style.d.ts +7 -0
- package/dist/commands/paste-resources.d.ts +9 -5
- package/dist/commands/patch-apply.d.ts +3 -0
- package/dist/commands/patch-count.d.ts +1 -0
- package/dist/commands/patch-invalidation.d.ts +4 -0
- package/dist/commands/patch-stage.d.ts +4 -0
- package/dist/commands/patch.d.ts +4 -0
- package/dist/commands/record-clone.d.ts +3 -0
- package/dist/commands/record-override.d.ts +5 -0
- package/dist/commands/replace-image.d.ts +6 -1
- package/dist/commands/sections.d.ts +10 -0
- package/dist/commands/set-geometry.d.ts +4 -0
- package/dist/commands/set-preset.d.ts +5 -0
- package/dist/commands/set-table-style.d.ts +3 -0
- package/dist/commands/slide-property-types.d.ts +55 -5
- package/dist/commands/slide-size.d.ts +7 -0
- package/dist/commands/spid.d.ts +2 -1
- package/dist/commands/table-grid-patch.d.ts +12 -0
- package/dist/commands/table-style-types.d.ts +28 -0
- package/dist/commands/text-target.d.ts +3 -2
- package/dist/commands/theme-types.d.ts +47 -0
- package/dist/commands/theme.d.ts +9 -0
- package/dist/commands/types.d.ts +219 -17
- package/dist/commands/ungroup-source.d.ts +3 -0
- package/dist/commands/ungroup.d.ts +4 -0
- package/dist/comments/index.d.ts +35 -0
- package/dist/comments/save.d.ts +3 -0
- package/dist/comments/state.d.ts +10 -0
- package/dist/comments/xml.d.ts +12 -0
- package/dist/comments.js +782 -0
- package/dist/common-object-slide-types.d.ts +34 -0
- package/dist/custom-geometry-path.d.ts +3 -0
- package/dist/custom-geometry.d.ts +12 -0
- package/dist/data-validation.d.ts +1 -1
- package/dist/describe/budget.d.ts +3 -0
- package/dist/describe/index.d.ts +5 -0
- package/dist/describe/read.d.ts +4 -0
- package/dist/describe/types.d.ts +103 -0
- package/dist/describe.js +192 -0
- package/dist/design-dependencies.d.ts +8 -0
- package/dist/design-projection-package.d.ts +10 -0
- package/dist/design-target.d.ts +10 -0
- package/dist/design.d.ts +3 -0
- package/dist/document-extensions.d.ts +9 -0
- package/dist/document.d.ts +1 -1
- package/dist/dynamic-projection.d.ts +6 -0
- package/dist/edit-core.js +5680 -3413
- package/dist/editor.d.ts +19 -2
- package/dist/element-source.d.ts +11 -0
- package/dist/element-spids.d.ts +4 -0
- package/dist/extension-address-journal.d.ts +9 -0
- package/dist/extension-address-remap.d.ts +14 -0
- package/dist/extension-addresses.d.ts +20 -0
- package/dist/extension-copy-history.d.ts +7 -0
- package/dist/extension-copy.d.ts +16 -0
- package/dist/extension-migration-receipt.d.ts +34 -0
- package/dist/extension-recovery-context.d.ts +5 -0
- package/dist/extension-runtime.d.ts +64 -0
- package/dist/generate/comments.d.ts +3 -0
- package/dist/generate/compatibility-parts.d.ts +14 -0
- package/dist/generate/compatibility-references.d.ts +3 -0
- package/dist/generate/compatibility.d.ts +4 -0
- package/dist/generate/custom-geometry.d.ts +2 -0
- package/dist/generate/index.d.ts +13 -0
- package/dist/generate/links.d.ts +3 -0
- package/dist/generate/master-defaults.d.ts +4 -0
- package/dist/generate/materialize.d.ts +2 -0
- package/dist/generate/math.d.ts +3 -0
- package/dist/generate/media.d.ts +13 -0
- package/dist/generate/portable-clipboard.d.ts +4 -0
- package/dist/generate/projection-tree.d.ts +8 -0
- package/dist/generate/table.d.ts +4 -0
- package/dist/generate/template.d.ts +70 -0
- package/dist/generate/text-body.d.ts +2 -0
- package/dist/generate/text-effects.d.ts +5 -0
- package/dist/generate/text-override.d.ts +8 -0
- package/dist/generate/validation.d.ts +3 -0
- package/dist/generate/warp.d.ts +2 -0
- package/dist/generate.js +1464 -0
- package/dist/history.d.ts +11 -1
- package/dist/hyperlink.d.ts +2 -0
- package/dist/identities.d.ts +4 -0
- package/dist/identity-allocation.d.ts +12 -0
- package/dist/identity-watermark.d.ts +4 -0
- package/dist/image-content.d.ts +5 -2
- package/dist/image-resource-history.d.ts +2 -0
- package/dist/index-C2r7c6G6.js +714 -0
- package/dist/index-CYDvbiwF.js +1 -0
- package/dist/index.d.ts +43 -7
- package/dist/ink/index.d.ts +27 -0
- package/dist/ink/model.d.ts +4 -0
- package/dist/ink/save.d.ts +3 -0
- package/dist/ink/source.d.ts +7 -0
- package/dist/ink.js +324 -0
- package/dist/layout-assets.d.ts +3 -1
- package/dist/layout-projection.d.ts +19 -5
- package/dist/layout-state.d.ts +2 -0
- package/dist/layout-types.d.ts +42 -0
- package/dist/layout.d.ts +5 -0
- package/dist/lint/color.d.ts +5 -0
- package/dist/lint/index.d.ts +7 -0
- package/dist/lint/prompts.d.ts +3 -0
- package/dist/lint/report.d.ts +21 -0
- package/dist/lint/sampler-batch.d.ts +4 -0
- package/dist/lint/sampler-images.d.ts +2 -0
- package/dist/lint/sampler.d.ts +9 -0
- package/dist/lint/snapshot.d.ts +34 -0
- package/dist/lint/types.d.ts +67 -0
- package/dist/lint-sampler.js +187 -0
- package/dist/lint.js +659 -0
- package/dist/master-state.d.ts +3 -0
- package/dist/master-text-style-state.d.ts +3 -0
- package/dist/master-types.d.ts +55 -0
- package/dist/master.d.ts +5 -0
- package/dist/media/audio-icon.d.ts +2 -0
- package/dist/media/commands.d.ts +3 -0
- package/dist/media/index.d.ts +10 -0
- package/dist/media/markup.d.ts +10 -0
- package/dist/media/mp4-boxes.d.ts +12 -0
- package/dist/media/mp4-fragments.d.ts +8 -0
- package/dist/media/mp4-samples.d.ts +4 -0
- package/dist/media/mp4.d.ts +2 -0
- package/dist/media/poster.d.ts +2 -0
- package/dist/media/replace-poster.d.ts +3 -0
- package/dist/media/resource.d.ts +4 -0
- package/dist/media/source.d.ts +14 -0
- package/dist/media/types.d.ts +33 -0
- package/dist/media-properties.d.ts +4 -0
- package/dist/media.js +1630 -0
- package/dist/model-invariants-BM19JVxy.js +8980 -0
- package/dist/object-source.d.ts +11 -0
- package/dist/ole/container.d.ts +14 -0
- package/dist/ole/content.d.ts +94 -0
- package/dist/ole/index.d.ts +20 -0
- package/dist/ole/preview.d.ts +3 -0
- package/dist/ole/save.d.ts +2 -0
- package/dist/ole/state.d.ts +16 -0
- package/dist/ole.js +870 -0
- package/dist/opc/patch.d.ts +2 -0
- package/dist/opc.js +1 -1
- package/dist/paragraph-level.d.ts +11 -0
- package/dist/paragraph-property-schema.d.ts +5 -2
- package/dist/{patch-DO8497wO.js → patch-BwhfBbYE.js} +112 -95
- package/dist/patch-change.d.ts +4 -0
- package/dist/patch-events.d.ts +16 -0
- package/dist/ppt/appearance.d.ts +11 -0
- package/dist/ppt/binary.d.ts +20 -0
- package/dist/ppt/drawing.d.ts +18 -0
- package/dist/ppt/geometry.d.ts +4 -0
- package/dist/ppt/index.d.ts +12 -0
- package/dist/ppt/pictures.d.ts +11 -0
- package/dist/ppt/text.d.ts +9 -0
- package/dist/ppt.js +774 -0
- package/dist/preset-geometry.d.ts +6 -0
- package/dist/projection.d.ts +2 -0
- package/dist/query-BHLjWjnu.js +903 -0
- package/dist/recovery-identity.d.ts +3 -1
- package/dist/recovery-migrations.d.ts +3 -0
- package/dist/recovery.d.ts +3 -0
- package/dist/resize/index.d.ts +6 -0
- package/dist/resize/text.d.ts +4 -0
- package/dist/resize.js +5090 -0
- package/dist/retained-element-origins.d.ts +6 -0
- package/dist/run-property-fields.d.ts +12 -0
- package/dist/run-property-schema.d.ts +3 -1
- package/dist/run-style.d.ts +15 -0
- package/dist/save/alt-text.d.ts +4 -0
- package/dist/save/comments.d.ts +3 -0
- package/dist/save/effects.d.ts +2 -1
- package/dist/save/extension-availability.d.ts +3 -0
- package/dist/save/extension-elements.d.ts +26 -0
- package/dist/save/geometry.d.ts +5 -0
- package/dist/save/index.d.ts +6 -1
- package/dist/save/insertion.d.ts +7 -3
- package/dist/save/layout-properties.d.ts +4 -0
- package/dist/save/master-properties.d.ts +5 -0
- package/dist/save/notes.d.ts +2 -0
- package/dist/save/paragraph-overrides.d.ts +3 -0
- package/dist/save/run-overrides.d.ts +10 -0
- package/dist/save/shape-format.d.ts +3 -0
- package/dist/save/slide-parts.d.ts +1 -0
- package/dist/save/table-style-part.d.ts +11 -0
- package/dist/save/table.d.ts +5 -0
- package/dist/save/text-source-less.d.ts +6 -0
- package/dist/save/xfrm.d.ts +8 -2
- package/dist/save.js +502 -1480
- package/dist/sections.d.ts +8 -0
- package/dist/session-assets.d.ts +4 -0
- package/dist/slide-parts-D0o_DDhi.js +1331 -0
- package/dist/slide-size.d.ts +6 -0
- package/dist/smartart/drawing.d.ts +3 -0
- package/dist/smartart/index.d.ts +16 -0
- package/dist/smartart/model.d.ts +18 -0
- package/dist/smartart/save.d.ts +3 -0
- package/dist/smartart.js +604 -0
- package/dist/source-retention.d.ts +7 -0
- package/dist/space.d.ts +37 -0
- package/dist/table-cell.d.ts +7 -1
- package/dist/table-direct-markup.d.ts +7 -1
- package/dist/table-grid-projection.d.ts +6 -0
- package/dist/table-grid.d.ts +45 -0
- package/dist/table-invariants.d.ts +4 -0
- package/dist/table-rows.d.ts +2 -1
- package/dist/table-scale.d.ts +4 -0
- package/dist/table-style.d.ts +21 -0
- package/dist/templates/index.d.ts +4 -0
- package/dist/templates/recipes.d.ts +5 -0
- package/dist/templates/types.d.ts +17 -0
- package/dist/templates.js +543 -0
- package/dist/text-flatten.d.ts +6 -0
- package/dist/text-fragment.d.ts +5 -0
- package/dist/text-model.d.ts +8 -8
- package/dist/text-override-validation.d.ts +6 -2
- package/dist/text-selection.d.ts +4 -0
- package/dist/theme-projection.d.ts +8 -0
- package/dist/theme-xml.d.ts +3 -0
- package/dist/theme.d.ts +14 -0
- package/dist/types.d.ts +217 -8
- package/dist/xml/index.d.ts +1 -1
- package/dist/xml/nodes.d.ts +2 -2
- package/dist/xml/shape-ids.d.ts +3 -0
- package/dist/xml.js +19 -16
- package/package.json +77 -5
- package/schemas/describe.schema.json +479 -0
- package/schemas/lint.schema.json +145 -0
- package/dist/index-D4ZTaYOa.js +0 -706
- package/dist/insertion-DabLme_U.js +0 -5471
package/dist/opc/patch.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { OpcPackage } from '@web-ppt/core';
|
|
2
2
|
import type { OpcPartChanges, OpcPatchResult } from './types';
|
|
3
|
+
/** 生成保存从已解压 part 构造全新包;输入和结果都拍快照,调用方不能随后改写。 */
|
|
4
|
+
export declare function createOpcPackage(parts: Readonly<Record<string, Uint8Array>>): OpcPatchResult;
|
|
3
5
|
/** 释放脱离 EditDoc 单独持有的保存结果;原始解析包仍由 Presentation.dispose() 释放。 */
|
|
4
6
|
export declare function disposeOpcPackage(pkg: OpcPackage): void;
|
|
5
7
|
/** 在原 OPC 包上应用 part 级修改;空修改必须保持整包字节身份。 */
|
package/dist/opc.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TextBody } from '@web-ppt/core';
|
|
2
|
+
import type { ElementImageReplacement, FlatTextParagraph, ParagraphPropertyOverrides, TextOverride } from './types';
|
|
3
|
+
import type { TextRange } from './commands/types';
|
|
4
|
+
/** 改级只重基未直设字段;pPr/rPr 的来源直设与用户覆盖继续压过列表样式。 */
|
|
5
|
+
export declare function rebaseParagraphLevel(body: TextBody, paragraph: FlatTextParagraph, paragraphIndex: number, level: number, template: TextBody | undefined): FlatTextParagraph;
|
|
6
|
+
/** 改动中段级别会改变后续同级编号,必须在整段序列上重新计数。 */
|
|
7
|
+
export declare function renumberParagraphs(body: TextBody, paragraphs: readonly FlatTextParagraph[], template: TextBody | undefined): FlatTextParagraph[];
|
|
8
|
+
/** 段落覆盖与列表重基必须一次生成,避免派生布局和稀疏覆盖出现中间态。 */
|
|
9
|
+
export declare function applyParagraphPropertyOverrides(sourceBody: TextBody, override: Extract<TextOverride, {
|
|
10
|
+
kind: 'flat';
|
|
11
|
+
}>, range: TextRange, changes: ParagraphPropertyOverrides, levelTemplate?: TextBody, imageOverride?: ElementImageReplacement): TextOverride;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type { ParagraphPropertyOverrides } from './types';
|
|
2
|
-
export declare const
|
|
1
|
+
import type { ParagraphBullet, ParagraphPropertyInput, ParagraphPropertyOverrides } from './types';
|
|
2
|
+
export declare const PARAGRAPH_AUTO_NUMBER_TYPES: readonly ["alphaLcParenBoth", "alphaLcParenR", "alphaLcPeriod", "alphaUcParenBoth", "alphaUcParenR", "alphaUcPeriod", "arabic1Minus", "arabic2Minus", "arabicDbPeriod", "arabicDbPlain", "arabicParenBoth", "arabicParenR", "arabicPeriod", "arabicPlain", "circleNumDbPlain", "circleNumWdBlackPlain", "circleNumWdWhitePlain", "ea1ChsPeriod", "ea1ChsPlain", "ea1ChtPeriod", "ea1ChtPlain", "ea1JpnChsDbPeriod", "ea1JpnKorPeriod", "ea1JpnKorPlain", "hebrew2Minus", "hindiAlpha1Period", "hindiAlphaPeriod", "hindiNumParenR", "hindiNumPeriod", "romanLcParenBoth", "romanLcParenR", "romanLcPeriod", "romanUcParenBoth", "romanUcParenR", "romanUcPeriod", "thaiAlphaParenBoth", "thaiAlphaParenR", "thaiAlphaPeriod", "thaiNumParenBoth", "thaiNumParenR", "thaiNumPeriod"];
|
|
3
|
+
export declare const PARAGRAPH_PROPERTY_FIELDS: readonly ["align", "lineHeight", "spaceBefore", "spaceAfter", "marginLeft", "indent", "level"];
|
|
3
4
|
export declare const PARAGRAPH_ALIGNMENTS: readonly ["left", "center", "right", "justify"];
|
|
4
5
|
export declare function assertParagraphPropertyOverrides(value: ParagraphPropertyOverrides, label: string): void;
|
|
6
|
+
export declare function assertParagraphPropertyInput(value: ParagraphPropertyInput, label: string): void;
|
|
7
|
+
export declare function assertSourceParagraphBullet(value: ParagraphBullet, label: string): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { deflateSync as
|
|
1
|
+
import { deflateSync as T } from "fflate";
|
|
2
2
|
function N(t, n) {
|
|
3
3
|
return t.length === n.length && t.every((e, r) => e === n[r]);
|
|
4
4
|
}
|
|
5
|
-
const
|
|
6
|
-
function
|
|
5
|
+
const J = new Uint8Array(), K = Object.freeze(/* @__PURE__ */ Object.create(null)), $ = Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
6
|
+
function D(t, n, e = $) {
|
|
7
7
|
let r = t, o = n, s = e, i = !1;
|
|
8
8
|
const a = {
|
|
9
9
|
format: "pptx",
|
|
@@ -22,26 +22,26 @@ function H(t, n, e = y) {
|
|
|
22
22
|
};
|
|
23
23
|
return Object.defineProperty(a, "dispose", {
|
|
24
24
|
value: () => {
|
|
25
|
-
r =
|
|
25
|
+
r = J, o = K, s = $, i = !0;
|
|
26
26
|
}
|
|
27
27
|
}), Object.freeze(a);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function Q(t) {
|
|
30
30
|
var n;
|
|
31
31
|
(n = t.dispose) == null || n.call(t);
|
|
32
32
|
}
|
|
33
|
-
const
|
|
33
|
+
const _ = new Uint32Array(256);
|
|
34
34
|
for (let t = 0; t < 256; t++) {
|
|
35
35
|
let n = t;
|
|
36
36
|
for (let e = 0; e < 8; e++) n = n & 1 ? 3988292384 ^ n >>> 1 : n >>> 1;
|
|
37
|
-
|
|
37
|
+
_[t] = n >>> 0;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function M(t) {
|
|
40
40
|
let n = 4294967295;
|
|
41
|
-
for (const e of t) n =
|
|
41
|
+
for (const e of t) n = _[(n ^ e) & 255] ^ n >>> 8;
|
|
42
42
|
return (n ^ 4294967295) >>> 0;
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const G = 33639248, y = 101010256, Y = 67324752, tt = 101075792, et = 117853008, x = 1, nt = new TextDecoder("utf-8", { fatal: !0 }), rt = new TextEncoder(), ot = /* @__PURE__ */ new Set([
|
|
45
45
|
"7z",
|
|
46
46
|
"aac",
|
|
47
47
|
"avi",
|
|
@@ -66,39 +66,39 @@ const M = 33639248, C = 101010256, G = 67324752, K = 101075792, Q = 117853008, L
|
|
|
66
66
|
"woff",
|
|
67
67
|
"woff2",
|
|
68
68
|
"zip"
|
|
69
|
-
]),
|
|
69
|
+
]), B = (t, n) => t < n ? -1 : t > n ? 1 : 0;
|
|
70
70
|
class p extends Error {
|
|
71
71
|
constructor(n, e) {
|
|
72
72
|
super(e), this.reason = n, this.name = "ZipPassthroughUnsupported";
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
const
|
|
76
|
-
function
|
|
75
|
+
const E = (t) => new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
76
|
+
function O(t, n, e, r) {
|
|
77
77
|
if (!Number.isSafeInteger(n) || !Number.isSafeInteger(e) || n < 0 || e < 0 || n + e > t.length)
|
|
78
78
|
throw new Error(`ZIP ${r} 超出文件边界`);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function st(t) {
|
|
81
81
|
if (t.length < 22) throw new Error("ZIP 缺少 EOCD");
|
|
82
|
-
const n =
|
|
82
|
+
const n = E(t), e = Math.max(0, t.length - 22 - 65535);
|
|
83
83
|
for (let r = t.length - 22; r >= e; r--) {
|
|
84
|
-
if (n.getUint32(r, !0) !==
|
|
84
|
+
if (n.getUint32(r, !0) !== y) continue;
|
|
85
85
|
const o = n.getUint16(r + 20, !0);
|
|
86
86
|
if (r + 22 + o === t.length) return r;
|
|
87
87
|
}
|
|
88
88
|
throw new Error("ZIP 缺少有效 EOCD");
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function ct(t, n) {
|
|
91
91
|
if (!(n & 2048) && t.some((e) => e >= 128))
|
|
92
92
|
throw new p("legacy-filename", "ZIP 使用非 UTF-8 文件名,不能安全映射 OPC part");
|
|
93
93
|
try {
|
|
94
|
-
return
|
|
94
|
+
return nt.decode(t);
|
|
95
95
|
} catch {
|
|
96
96
|
throw new Error("ZIP 文件名不是有效 UTF-8");
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
101
|
-
const s =
|
|
99
|
+
function L(t, n, e, r, o) {
|
|
100
|
+
O(t, n, e, o);
|
|
101
|
+
const s = E(t), i = n + e;
|
|
102
102
|
let a = n;
|
|
103
103
|
for (; a < i; ) {
|
|
104
104
|
if (a + 4 > i) throw new Error(`ZIP ${o} 字段头不完整`);
|
|
@@ -109,9 +109,9 @@ function T(t, n, e, r, o) {
|
|
|
109
109
|
}
|
|
110
110
|
return !1;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
const n =
|
|
114
|
-
if (n >= 20 && e.getUint32(n - 20, !0) ===
|
|
112
|
+
function it(t) {
|
|
113
|
+
const n = st(t), e = E(t), r = e.getUint16(n + 4, !0), o = e.getUint16(n + 6, !0), s = e.getUint16(n + 8, !0), i = e.getUint16(n + 10, !0), a = e.getUint32(n + 12, !0), h = e.getUint32(n + 16, !0), d = e.getUint16(n + 20, !0);
|
|
114
|
+
if (n >= 20 && e.getUint32(n - 20, !0) === et)
|
|
115
115
|
throw new p("zip64", "ZIP64 定位器不支持直通");
|
|
116
116
|
if (r || o || s !== i)
|
|
117
117
|
throw new p("multi-disk", "ZIP 多磁盘格式不支持直通");
|
|
@@ -119,94 +119,94 @@ function st(t) {
|
|
|
119
119
|
throw new p("zip64", "ZIP64 不支持直通");
|
|
120
120
|
if (d)
|
|
121
121
|
throw new p("archive-comment", "带存档注释的 ZIP 不支持直通");
|
|
122
|
-
|
|
122
|
+
O(t, h, a, "中央目录");
|
|
123
123
|
const U = [], l = /* @__PURE__ */ new Set();
|
|
124
124
|
let c = h;
|
|
125
125
|
for (let u = 0; u < i; u++) {
|
|
126
|
-
if (
|
|
127
|
-
const f = e.getUint16(c + 8, !0), w = e.getUint16(c + 10, !0), P = e.getUint32(c + 20, !0), I = e.getUint32(c + 24, !0), S = e.getUint16(c + 28, !0),
|
|
128
|
-
if (
|
|
126
|
+
if (O(t, c, 46, "中央目录条目"), e.getUint32(c, !0) !== G) throw new Error("ZIP 中央目录签名错误");
|
|
127
|
+
const f = e.getUint16(c + 8, !0), w = e.getUint16(c + 10, !0), P = e.getUint32(c + 20, !0), I = e.getUint32(c + 24, !0), S = e.getUint16(c + 28, !0), v = e.getUint16(c + 30, !0), X = e.getUint16(c + 32, !0), k = e.getUint16(c + 34, !0), g = e.getUint32(c + 42, !0), z = 46 + S + v + X;
|
|
128
|
+
if (O(t, c, z, "中央目录条目"), P === 4294967295 || I === 4294967295 || g === 4294967295 || k === 65535)
|
|
129
129
|
throw new p("zip64", "ZIP64 条目不支持直通");
|
|
130
|
-
if (
|
|
130
|
+
if (k) throw new p("multi-disk", "跨磁盘 ZIP 条目不支持直通");
|
|
131
131
|
if (f & 1) throw new p("encrypted-entry", "ZIP 加密条目不支持直通");
|
|
132
132
|
if (f & 8)
|
|
133
133
|
throw new p("data-descriptor", "ZIP 数据描述符不支持直通");
|
|
134
134
|
if (w !== 0 && w !== 8)
|
|
135
135
|
throw new p("unsupported-compression", `ZIP 压缩方法 ${w} 不支持直通`);
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
136
|
+
const R = t.subarray(c + 46, c + 46 + S);
|
|
137
|
+
if (L(
|
|
138
138
|
t,
|
|
139
139
|
c + 46 + S,
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
v,
|
|
141
|
+
x,
|
|
142
142
|
`中央目录 extra ${u + 1}`
|
|
143
143
|
))
|
|
144
144
|
throw new p("zip64", "ZIP64 中央目录 extra 不支持直通");
|
|
145
|
-
const
|
|
146
|
-
if (l.has(
|
|
147
|
-
if (l.add(
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
145
|
+
const m = ct(R, f);
|
|
146
|
+
if (l.has(m)) throw new Error(`ZIP 存在重复条目:${m}`);
|
|
147
|
+
if (l.add(m), O(t, g, 30, `本地头 ${m}`), e.getUint32(g, !0) !== Y) throw new Error(`ZIP 本地头签名错误:${m}`);
|
|
148
|
+
const b = e.getUint16(g + 6, !0), Z = e.getUint16(g + 8, !0);
|
|
149
|
+
if (b & 1)
|
|
150
150
|
throw new p("encrypted-entry", "ZIP 本地头声明加密,不支持直通");
|
|
151
|
-
if (
|
|
151
|
+
if (b & 8)
|
|
152
152
|
throw new p("data-descriptor", "ZIP 本地头使用数据描述符,不支持直通");
|
|
153
|
-
if (
|
|
153
|
+
if (Z !== 0 && Z !== 8)
|
|
154
154
|
throw new p(
|
|
155
155
|
"unsupported-compression",
|
|
156
|
-
`ZIP 本地头压缩方法 ${
|
|
156
|
+
`ZIP 本地头压缩方法 ${Z} 不支持直通`
|
|
157
157
|
);
|
|
158
|
-
if (
|
|
159
|
-
throw new Error(`ZIP 本地头与中央目录元数据不一致:${
|
|
160
|
-
const
|
|
161
|
-
if (
|
|
158
|
+
if (b !== f || Z !== w || e.getUint32(g + 14, !0) !== e.getUint32(c + 16, !0) || e.getUint32(g + 18, !0) !== P || e.getUint32(g + 22, !0) !== I)
|
|
159
|
+
throw new Error(`ZIP 本地头与中央目录元数据不一致:${m}`);
|
|
160
|
+
const A = e.getUint16(g + 26, !0), j = e.getUint16(g + 28, !0);
|
|
161
|
+
if (L(
|
|
162
162
|
t,
|
|
163
|
-
g + 30 +
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
`本地头 extra ${
|
|
163
|
+
g + 30 + A,
|
|
164
|
+
j,
|
|
165
|
+
x,
|
|
166
|
+
`本地头 extra ${m}`
|
|
167
167
|
))
|
|
168
168
|
throw new p("zip64", "ZIP64 本地头 extra 不支持直通");
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
if (!N(
|
|
169
|
+
const C = 30 + A + j + P;
|
|
170
|
+
O(t, g, C, `本地条目 ${m}`);
|
|
171
|
+
const H = t.subarray(g + 30, g + 30 + A);
|
|
172
|
+
if (!N(H, R)) throw new Error(`ZIP 本地头与中央目录名称不一致:${m}`);
|
|
173
173
|
U.push({
|
|
174
|
-
name:
|
|
174
|
+
name: m,
|
|
175
175
|
flags: f,
|
|
176
176
|
method: w,
|
|
177
177
|
compressedSize: P,
|
|
178
178
|
uncompressedSize: I,
|
|
179
179
|
localOffset: g,
|
|
180
|
-
localRaw: t.subarray(g, g +
|
|
180
|
+
localRaw: t.subarray(g, g + C),
|
|
181
181
|
centralRaw: t.subarray(c, c + z)
|
|
182
182
|
}), c += z;
|
|
183
183
|
}
|
|
184
184
|
if (c !== h + a) throw new Error("ZIP 中央目录包含未识别记录");
|
|
185
185
|
if (c !== n)
|
|
186
|
-
throw c + 4 <= t.length && e.getUint32(c, !0) ===
|
|
186
|
+
throw c + 4 <= t.length && e.getUint32(c, !0) === tt ? new p("zip64", "ZIP64 EOCD 记录不支持直通") : new Error("ZIP 中央目录与 EOCD 之间存在未识别记录");
|
|
187
187
|
return { entries: U };
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function F(t) {
|
|
190
190
|
const n = t.reduce((o, s) => o + s.length, 0), e = new Uint8Array(n);
|
|
191
191
|
let r = 0;
|
|
192
192
|
for (const o of t)
|
|
193
193
|
e.set(o, r), r += o.length;
|
|
194
194
|
return e;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function lt(t, n) {
|
|
197
197
|
if (n.length > 4294967295) throw new Error(`OPC part 过大,需要 ZIP64:${t.name}`);
|
|
198
|
-
const e = t.method === 8 ?
|
|
198
|
+
const e = t.method === 8 ? T(n, { level: 6 }) : n;
|
|
199
199
|
if (e.length > 4294967295) throw new Error(`OPC part 压缩后过大,需要 ZIP64:${t.name}`);
|
|
200
200
|
const r = t.localRaw.length - t.compressedSize, o = new Uint8Array(r + e.length);
|
|
201
201
|
o.set(t.localRaw.subarray(0, r)), o.set(e, r);
|
|
202
|
-
const s =
|
|
202
|
+
const s = E(o), i = M(n);
|
|
203
203
|
return s.setUint32(14, i, !0), s.setUint32(18, e.length, !0), s.setUint32(22, n.length, !0), { bytes: o, checksum: i, compressedSize: e.length, uncompressedSize: n.length };
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
const r = t.centralRaw
|
|
205
|
+
function at(t, n, e) {
|
|
206
|
+
const r = new Uint8Array(t.centralRaw), o = E(r);
|
|
207
207
|
return n && (o.setUint32(16, n.checksum, !0), o.setUint32(20, n.compressedSize, !0), o.setUint32(24, n.uncompressedSize, !0)), o.setUint32(42, e, !0), r;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function ut(t, n) {
|
|
210
210
|
const e = [], r = [];
|
|
211
211
|
let o = 0, s = 0, i = 0;
|
|
212
212
|
const a = new Set(t.entries.map((f) => f.name));
|
|
@@ -216,12 +216,12 @@ function lt(t, n) {
|
|
|
216
216
|
i++;
|
|
217
217
|
continue;
|
|
218
218
|
}
|
|
219
|
-
const P = w ?
|
|
220
|
-
e.push(I), r.push(
|
|
219
|
+
const P = w ? lt(f, w) : null, I = (P == null ? void 0 : P.bytes) ?? f.localRaw;
|
|
220
|
+
e.push(I), r.push(at(f, P, o)), o += I.length, w ? i++ : s++;
|
|
221
221
|
}
|
|
222
|
-
const h = [...n].filter(([f, w]) => !a.has(f) && w !== null).sort(([f], [w]) =>
|
|
222
|
+
const h = [...n].filter(([f, w]) => !a.has(f) && w !== null).sort(([f], [w]) => B(f, w));
|
|
223
223
|
for (const [f, w] of h) {
|
|
224
|
-
const P =
|
|
224
|
+
const P = W(f, w, o);
|
|
225
225
|
e.push(P.local), r.push(P.central), o += P.local.length, i++;
|
|
226
226
|
}
|
|
227
227
|
const d = e.length;
|
|
@@ -229,54 +229,70 @@ function lt(t, n) {
|
|
|
229
229
|
const U = o, l = r.reduce((f, w) => f + w.length, 0);
|
|
230
230
|
if (U > 4294967295 || l > 4294967295)
|
|
231
231
|
throw new Error("保存结果需要 ZIP64 偏移,当前不支持");
|
|
232
|
-
const c = new Uint8Array(22), u =
|
|
233
|
-
return u.setUint32(0,
|
|
232
|
+
const c = new Uint8Array(22), u = E(c);
|
|
233
|
+
return u.setUint32(0, y, !0), u.setUint16(8, d, !0), u.setUint16(10, d, !0), u.setUint32(12, l, !0), u.setUint32(16, U, !0), { bytes: F([...e, ...r, c]), preservedEntries: s, rewrittenEntries: i };
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function V(t, n) {
|
|
236
236
|
const e = Object.keys(t), r = new Set(e), o = e.filter((l) => n.get(l) !== null);
|
|
237
|
-
if (o.push(...[...n].filter(([l, c]) => !r.has(l) && c !== null).map(([l]) => l).sort(
|
|
237
|
+
if (o.push(...[...n].filter(([l, c]) => !r.has(l) && c !== null).map(([l]) => l).sort(B)), o.length > 65535) throw new Error("重压结果需要 ZIP64 条目计数,当前不支持");
|
|
238
238
|
const s = [], i = [];
|
|
239
239
|
let a = 0;
|
|
240
240
|
for (const l of o) {
|
|
241
241
|
const c = n.get(l) ?? t[l];
|
|
242
242
|
if (!c) throw new Error(`重压时缺少 OPC part:${l}`);
|
|
243
|
-
const u =
|
|
243
|
+
const u = W(l, c, a);
|
|
244
244
|
s.push(u.local), i.push(u.central), a += u.local.length;
|
|
245
245
|
}
|
|
246
246
|
const h = i.reduce((l, c) => l + c.length, 0);
|
|
247
247
|
if (a > 4294967295 || h > 4294967295) throw new Error("重压结果需要 ZIP64 偏移,当前不支持");
|
|
248
|
-
const d = new Uint8Array(22), U =
|
|
249
|
-
return U.setUint32(0,
|
|
250
|
-
bytes:
|
|
248
|
+
const d = new Uint8Array(22), U = E(d);
|
|
249
|
+
return U.setUint32(0, y, !0), U.setUint16(8, o.length, !0), U.setUint16(10, o.length, !0), U.setUint32(12, h, !0), U.setUint32(16, a, !0), {
|
|
250
|
+
bytes: F([...s, ...i, d]),
|
|
251
251
|
preservedEntries: 0,
|
|
252
252
|
rewrittenEntries: o.length
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function W(t, n, e) {
|
|
256
256
|
if (n.length > 4294967295) throw new Error(`OPC part 过大,需要 ZIP64:${t}`);
|
|
257
|
-
const r =
|
|
257
|
+
const r = rt.encode(t);
|
|
258
258
|
if (r.length > 65535) throw new Error(`OPC part 路径过长:${t.slice(0, 80)}`);
|
|
259
|
-
const o = t.slice(t.lastIndexOf(".") + 1).toLowerCase(), s =
|
|
259
|
+
const o = t.slice(t.lastIndexOf(".") + 1).toLowerCase(), s = ot.has(o) ? null : T(n, { level: 6 }), i = s !== null && s.length < n.length, a = i ? 8 : 0, h = i ? s : n;
|
|
260
260
|
if (h.length > 4294967295) throw new Error(`OPC part 压缩后过大,需要 ZIP64:${t}`);
|
|
261
|
-
const d =
|
|
262
|
-
l.setUint32(0,
|
|
263
|
-
const c = new Uint8Array(46 + r.length), u =
|
|
264
|
-
return u.setUint32(0,
|
|
261
|
+
const d = M(n), U = new Uint8Array(30 + r.length + h.length), l = E(U);
|
|
262
|
+
l.setUint32(0, Y, !0), l.setUint16(4, 20, !0), l.setUint16(6, 2048, !0), l.setUint16(8, a, !0), l.setUint16(12, 33, !0), l.setUint32(14, d, !0), l.setUint32(18, h.length, !0), l.setUint32(22, n.length, !0), l.setUint16(26, r.length, !0), U.set(r, 30), U.set(h, 30 + r.length);
|
|
263
|
+
const c = new Uint8Array(46 + r.length), u = E(c);
|
|
264
|
+
return u.setUint32(0, G, !0), u.setUint16(4, 798, !0), u.setUint16(6, 20, !0), u.setUint16(8, 2048, !0), u.setUint16(10, a, !0), u.setUint16(14, 33, !0), u.setUint32(16, d, !0), u.setUint32(20, h.length, !0), u.setUint32(24, n.length, !0), u.setUint16(28, r.length, !0), u.setUint32(42, e, !0), c.set(r, 46), { local: U, central: c };
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function ft(t, n) {
|
|
267
267
|
const e = /* @__PURE__ */ new Map();
|
|
268
268
|
for (const [r, o] of Object.entries(n)) {
|
|
269
|
-
|
|
269
|
+
q(r);
|
|
270
270
|
const s = t.parts[r];
|
|
271
|
-
o === null ? s && e.set(r, null) : (!s || !N(s, o)) && e.set(r, o
|
|
271
|
+
o === null ? s && e.set(r, null) : (!s || !N(s, o)) && e.set(r, new Uint8Array(o));
|
|
272
272
|
}
|
|
273
273
|
return e;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function q(t) {
|
|
276
276
|
const n = t.split("/");
|
|
277
277
|
if (!t || t.startsWith("/") || t.endsWith("/") || t.includes("\\") || n.some((e) => !e || e === "." || e === ".."))
|
|
278
278
|
throw new Error(`非法 OPC part 路径:${t}`);
|
|
279
279
|
}
|
|
280
|
+
function gt(t) {
|
|
281
|
+
const n = /* @__PURE__ */ Object.create(null), e = /* @__PURE__ */ new Map();
|
|
282
|
+
for (const [s, i] of Object.entries(t)) {
|
|
283
|
+
q(s);
|
|
284
|
+
const a = i.slice();
|
|
285
|
+
n[s] = a, e.set(s, a);
|
|
286
|
+
}
|
|
287
|
+
const r = V(/* @__PURE__ */ Object.create(null), e), o = Object.freeze(n);
|
|
288
|
+
return {
|
|
289
|
+
...r,
|
|
290
|
+
bytes: r.bytes,
|
|
291
|
+
package: D(r.bytes, o),
|
|
292
|
+
mode: "repacked",
|
|
293
|
+
fallbackReason: null
|
|
294
|
+
};
|
|
295
|
+
}
|
|
280
296
|
function wt(t, n, e) {
|
|
281
297
|
const r = /* @__PURE__ */ Object.create(null);
|
|
282
298
|
for (const [s, i] of Object.entries(t.parts))
|
|
@@ -284,21 +300,21 @@ function wt(t, n, e) {
|
|
|
284
300
|
for (const [s, i] of e) i !== null && (r[s] = i);
|
|
285
301
|
Object.freeze(r);
|
|
286
302
|
const o = Object.freeze(Object.fromEntries(Object.entries(t.assets ?? {}).filter(([, s]) => !!s.sourcePart && !!r[s.sourcePart] && !e.has(s.sourcePart))));
|
|
287
|
-
return
|
|
303
|
+
return D(n, r, o);
|
|
288
304
|
}
|
|
289
|
-
function
|
|
290
|
-
|
|
305
|
+
function pt(t) {
|
|
306
|
+
Q(t);
|
|
291
307
|
}
|
|
292
|
-
function
|
|
308
|
+
function Ut(t, n) {
|
|
293
309
|
if (t.disposed) throw new Error("OPC 原包已释放,不能保存");
|
|
294
|
-
const e =
|
|
310
|
+
const e = ft(t, n);
|
|
295
311
|
if (e.size) {
|
|
296
312
|
let r, o = null;
|
|
297
313
|
try {
|
|
298
|
-
r =
|
|
314
|
+
r = ut(it(t.bytes), e);
|
|
299
315
|
} catch (s) {
|
|
300
316
|
if (!(s instanceof p)) throw s;
|
|
301
|
-
o = s.reason, r =
|
|
317
|
+
o = s.reason, r = V(t.parts, e);
|
|
302
318
|
}
|
|
303
319
|
return {
|
|
304
320
|
...r,
|
|
@@ -317,6 +333,7 @@ function pt(t, n) {
|
|
|
317
333
|
};
|
|
318
334
|
}
|
|
319
335
|
export {
|
|
320
|
-
gt as
|
|
321
|
-
pt as
|
|
336
|
+
gt as c,
|
|
337
|
+
pt as d,
|
|
338
|
+
Ut as p
|
|
322
339
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EditorChange, Patch, Selection } from './commands/types';
|
|
2
|
+
import type { EditDoc, ProjectionInvalidation } from './types';
|
|
3
|
+
/** 撤销、重做和外部补丁必须给 DOM 层同一套精确失效集合,不能各自近似一遍。 */
|
|
4
|
+
export declare function changeFromPatches(doc: EditDoc, patches: readonly Patch[], inverse: readonly Patch[], source: EditorChange['source'], selection: Selection, dirty: ProjectionInvalidation): EditorChange;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EditorPatchEvent, EditorPatchSubscriber, EditorPatchSubscribeOptions, Patch } from './commands/types';
|
|
2
|
+
import type { EditDoc } from './types';
|
|
3
|
+
export declare function reportEditorSubscriberError(error: unknown): void;
|
|
4
|
+
/** recovery 前只给协同元数据观察者;普通观察者继续在视图事件后按 FIFO 收到补丁。 */
|
|
5
|
+
export declare class EditorPatchJournal {
|
|
6
|
+
private readonly subscribers;
|
|
7
|
+
private readonly beforeRecoverySubscribers;
|
|
8
|
+
private readonly pending;
|
|
9
|
+
private readonly addresses;
|
|
10
|
+
private dispatching;
|
|
11
|
+
get observed(): boolean;
|
|
12
|
+
subscribe(subscriber: EditorPatchSubscriber, options?: EditorPatchSubscribeOptions): () => void;
|
|
13
|
+
transport(doc: EditDoc, patches: readonly Patch[], origin: string): readonly Patch[];
|
|
14
|
+
queue(event: EditorPatchEvent): void;
|
|
15
|
+
flush(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Fill, Stroke } from '@web-ppt/core';
|
|
2
|
+
import { type Property } from './binary';
|
|
3
|
+
export declare function fillProperties(fill: Fill | null): Property[];
|
|
4
|
+
export declare function strokeProperties(stroke: Stroke | null | undefined): Property[];
|
|
5
|
+
/** crop 分数 → 16.16;属性顺序 Top/Bottom/Left/Right,与 MS-ODRAW / 读取侧一致。 */
|
|
6
|
+
export declare function cropProperties(crop: {
|
|
7
|
+
l: number;
|
|
8
|
+
t: number;
|
|
9
|
+
r: number;
|
|
10
|
+
b: number;
|
|
11
|
+
}): Property[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** [MS-PPT]/[MS-ODRAW] 记录头是共享协议,长度始终只计算记录体。 */
|
|
2
|
+
export declare const view: (bytes: Uint8Array) => DataView;
|
|
3
|
+
export declare function concat(parts: readonly Uint8Array[]): Uint8Array;
|
|
4
|
+
export declare function u16(value: number): Uint8Array;
|
|
5
|
+
export declare function u32(value: number): Uint8Array;
|
|
6
|
+
export declare function utf16(text: string, terminate?: boolean): Uint8Array;
|
|
7
|
+
export declare function atom(type: number, body?: Uint8Array, version?: number, instance?: number): Uint8Array;
|
|
8
|
+
export declare function container(type: number, children: readonly Uint8Array[], instance?: number): Uint8Array;
|
|
9
|
+
export interface Property {
|
|
10
|
+
id: number;
|
|
11
|
+
value: number | Uint8Array;
|
|
12
|
+
blip?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function properties(input: readonly Property[]): Uint8Array;
|
|
15
|
+
export declare function signed(value: number, label: string): number;
|
|
16
|
+
export declare function color(value: string): number;
|
|
17
|
+
export declare function rgba(value: string): {
|
|
18
|
+
rgb: number;
|
|
19
|
+
alpha: number;
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Fill, SlideElement } from '@web-ppt/core';
|
|
2
|
+
import { FontTable } from './text';
|
|
3
|
+
import { Pictures } from './pictures';
|
|
4
|
+
export declare class Drawings {
|
|
5
|
+
readonly fonts: FontTable;
|
|
6
|
+
readonly pictures: Pictures;
|
|
7
|
+
readonly clusters: {
|
|
8
|
+
id: number;
|
|
9
|
+
used: number;
|
|
10
|
+
}[];
|
|
11
|
+
private next;
|
|
12
|
+
private count;
|
|
13
|
+
constructor(fonts: FontTable, pictures: Pictures);
|
|
14
|
+
private identity;
|
|
15
|
+
private element;
|
|
16
|
+
drawing(elements: readonly SlideElement[], background: Fill | null, drawing: number, notePlaceholder?: number): Uint8Array;
|
|
17
|
+
group(): Uint8Array;
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type EditDoc } from '@web-ppt/edit-core';
|
|
2
|
+
export declare const PPT_MIME = "application/vnd.ms-powerpoint";
|
|
3
|
+
export interface PptSaveIssue {
|
|
4
|
+
readonly slide: number;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class PptSaveError extends Error {
|
|
8
|
+
readonly issues: readonly PptSaveIssue[];
|
|
9
|
+
constructor(issues: readonly PptSaveIssue[]);
|
|
10
|
+
}
|
|
11
|
+
/** 原生 PPT 生成保存。保持当前投影可编辑,不修改源包、历史或保存点。 */
|
|
12
|
+
export declare function savePpt(doc: EditDoc): Uint8Array;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EditDoc } from '../types';
|
|
2
|
+
/** 图片保持原 PNG/JPEG 字节;不把 SVG 或 OLE 的预览冒充原生对象。 */
|
|
3
|
+
export declare class Pictures {
|
|
4
|
+
private readonly doc;
|
|
5
|
+
private readonly items;
|
|
6
|
+
private readonly indexes;
|
|
7
|
+
constructor(doc: EditDoc);
|
|
8
|
+
add(url: string): number;
|
|
9
|
+
stream(): Uint8Array;
|
|
10
|
+
store(): Uint8Array;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TextBody } from '@web-ppt/core';
|
|
2
|
+
export declare class FontTable {
|
|
3
|
+
readonly names: string[];
|
|
4
|
+
index(name: string): number;
|
|
5
|
+
records(): Uint8Array[];
|
|
6
|
+
}
|
|
7
|
+
/** 字符覆盖含段落末尾的 CR;最后一段还必须覆盖隐含的终止字符。 */
|
|
8
|
+
export declare function textRecords(body: TextBody, fonts: FontTable, type?: number): Uint8Array;
|
|
9
|
+
export declare function defaultTextStyle(type: number): Uint8Array;
|