@web-ppt/edit-core 0.5.0-beta.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +183 -0
- package/README.md +164 -21
- 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/commands/add-slide-identity.d.ts +2 -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/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 +5 -2
- 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-text.d.ts +1 -1
- package/dist/commands/element-transform.d.ts +2 -2
- package/dist/commands/geometry-types.d.ts +23 -1
- 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 +14 -1
- 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 +1 -1
- package/dist/commands/patch-stage.d.ts +4 -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-preset.d.ts +5 -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 +1 -1
- package/dist/commands/table-grid-patch.d.ts +12 -0
- package/dist/commands/text-target.d.ts +2 -2
- package/dist/commands/theme-types.d.ts +47 -0
- package/dist/commands/theme.d.ts +9 -0
- package/dist/commands/types.d.ts +194 -17
- package/dist/commands/ungroup-source.d.ts +3 -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/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 +5420 -4111
- package/dist/editor.d.ts +15 -3
- 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/index.d.ts +1 -0
- package/dist/generate/master-defaults.d.ts +4 -0
- package/dist/generate/materialize.d.ts +2 -2
- package/dist/generate/math.d.ts +3 -0
- package/dist/generate/portable-clipboard.d.ts +4 -0
- package/dist/generate/projection-tree.d.ts +8 -0
- package/dist/generate/template.d.ts +68 -1
- 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 +1232 -512
- package/dist/history.d.ts +11 -1
- package/dist/identities.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 +35 -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 +17 -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.js +1 -1
- package/dist/paragraph-level.d.ts +2 -2
- package/dist/paragraph-property-schema.d.ts +4 -1
- package/dist/{patch-D7lZelRa.js → patch-BwhfBbYE.js} +10 -10
- package/dist/patch-events.d.ts +5 -1
- 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 +1 -0
- 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/index.d.ts +6 -1
- package/dist/save/insertion.d.ts +6 -5
- package/dist/save/layout-properties.d.ts +4 -0
- package/dist/save/master-properties.d.ts +5 -0
- package/dist/save/paragraph-overrides.d.ts +3 -0
- package/dist/save/slide-parts.d.ts +1 -0
- package/dist/save/table.d.ts +2 -0
- package/dist/save/xfrm.d.ts +8 -2
- package/dist/save.js +493 -498
- 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-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 +5 -4
- 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 +174 -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 +79 -5
- package/schemas/describe.schema.json +479 -0
- package/schemas/lint.schema.json +145 -0
- package/dist/document-B1jjN-QB.js +0 -274
- package/dist/image-resource-DbgJS9n-.js +0 -24
- package/dist/index-D2JizcOQ.js +0 -706
- package/dist/insertion-CGpb504L.js +0 -6152
- package/dist/table-style-part-DBtpxmuo.js +0 -1042
package/dist/opc.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TextBody } from '@web-ppt/core';
|
|
2
|
-
import type { FlatTextParagraph, ParagraphPropertyOverrides, TextOverride } from './types';
|
|
2
|
+
import type { ElementImageReplacement, FlatTextParagraph, ParagraphPropertyOverrides, TextOverride } from './types';
|
|
3
3
|
import type { TextRange } from './commands/types';
|
|
4
4
|
/** 改级只重基未直设字段;pPr/rPr 的来源直设与用户覆盖继续压过列表样式。 */
|
|
5
5
|
export declare function rebaseParagraphLevel(body: TextBody, paragraph: FlatTextParagraph, paragraphIndex: number, level: number, template: TextBody | undefined): FlatTextParagraph;
|
|
@@ -8,4 +8,4 @@ export declare function renumberParagraphs(body: TextBody, paragraphs: readonly
|
|
|
8
8
|
/** 段落覆盖与列表重基必须一次生成,避免派生布局和稀疏覆盖出现中间态。 */
|
|
9
9
|
export declare function applyParagraphPropertyOverrides(sourceBody: TextBody, override: Extract<TextOverride, {
|
|
10
10
|
kind: 'flat';
|
|
11
|
-
}>, range: TextRange, changes: ParagraphPropertyOverrides, levelTemplate?: TextBody): TextOverride;
|
|
11
|
+
}>, range: TextRange, changes: ParagraphPropertyOverrides, levelTemplate?: TextBody, imageOverride?: ElementImageReplacement): TextOverride;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type { ParagraphPropertyOverrides } from './types';
|
|
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"];
|
|
2
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;
|
|
@@ -41,7 +41,7 @@ function M(t) {
|
|
|
41
41
|
for (const e of t) n = _[(n ^ e) & 255] ^ n >>> 8;
|
|
42
42
|
return (n ^ 4294967295) >>> 0;
|
|
43
43
|
}
|
|
44
|
-
const G = 33639248,
|
|
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",
|
|
@@ -81,7 +81,7 @@ function st(t) {
|
|
|
81
81
|
if (t.length < 22) throw new Error("ZIP 缺少 EOCD");
|
|
82
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
|
}
|
|
@@ -124,10 +124,10 @@ function it(t) {
|
|
|
124
124
|
let c = h;
|
|
125
125
|
for (let u = 0; u < i; u++) {
|
|
126
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),
|
|
128
|
-
if (O(t, c, z, "中央目录条目"), P === 4294967295 || I === 4294967295 || g === 4294967295 ||
|
|
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 数据描述符不支持直通");
|
|
@@ -137,7 +137,7 @@ function it(t) {
|
|
|
137
137
|
if (L(
|
|
138
138
|
t,
|
|
139
139
|
c + 46 + S,
|
|
140
|
-
|
|
140
|
+
v,
|
|
141
141
|
x,
|
|
142
142
|
`中央目录 extra ${u + 1}`
|
|
143
143
|
))
|
|
@@ -203,7 +203,7 @@ function lt(t, 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
205
|
function at(t, n, e) {
|
|
206
|
-
const r = t.centralRaw
|
|
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
209
|
function ut(t, n) {
|
|
@@ -230,7 +230,7 @@ function ut(t, n) {
|
|
|
230
230
|
if (U > 4294967295 || l > 4294967295)
|
|
231
231
|
throw new Error("保存结果需要 ZIP64 偏移,当前不支持");
|
|
232
232
|
const c = new Uint8Array(22), u = E(c);
|
|
233
|
-
return u.setUint32(0,
|
|
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
235
|
function V(t, n) {
|
|
236
236
|
const e = Object.keys(t), r = new Set(e), o = e.filter((l) => n.get(l) !== null);
|
|
@@ -246,7 +246,7 @@ function V(t, n) {
|
|
|
246
246
|
const h = i.reduce((l, c) => l + c.length, 0);
|
|
247
247
|
if (a > 4294967295 || h > 4294967295) throw new Error("重压结果需要 ZIP64 偏移,当前不支持");
|
|
248
248
|
const d = new Uint8Array(22), U = E(d);
|
|
249
|
-
return U.setUint32(0,
|
|
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
250
|
bytes: F([...s, ...i, d]),
|
|
251
251
|
preservedEntries: 0,
|
|
252
252
|
rewrittenEntries: o.length
|
|
@@ -268,7 +268,7 @@ function ft(t, n) {
|
|
|
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
|
}
|
package/dist/patch-events.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import type { EditorPatchEvent, EditorPatchSubscriber, EditorPatchSubscribeOptions } from './commands/types';
|
|
1
|
+
import type { EditorPatchEvent, EditorPatchSubscriber, EditorPatchSubscribeOptions, Patch } from './commands/types';
|
|
2
|
+
import type { EditDoc } from './types';
|
|
2
3
|
export declare function reportEditorSubscriberError(error: unknown): void;
|
|
3
4
|
/** recovery 前只给协同元数据观察者;普通观察者继续在视图事件后按 FIFO 收到补丁。 */
|
|
4
5
|
export declare class EditorPatchJournal {
|
|
5
6
|
private readonly subscribers;
|
|
6
7
|
private readonly beforeRecoverySubscribers;
|
|
7
8
|
private readonly pending;
|
|
9
|
+
private readonly addresses;
|
|
8
10
|
private dispatching;
|
|
11
|
+
get observed(): boolean;
|
|
9
12
|
subscribe(subscriber: EditorPatchSubscriber, options?: EditorPatchSubscribeOptions): () => void;
|
|
13
|
+
transport(doc: EditDoc, patches: readonly Patch[], origin: string): readonly Patch[];
|
|
10
14
|
queue(event: EditorPatchEvent): void;
|
|
11
15
|
flush(): void;
|
|
12
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;
|