@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
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import { a as U, r as J, c as K, i as Q, h as Y, d as Z, e as ee, f as te } from "./insertion-CGpb504L.js";
|
|
2
|
-
const S = 4294967295, x = 4294967295, F = (e) => e.startsWith("spid:") || e.startsWith("relationship:");
|
|
3
|
-
function G(e) {
|
|
4
|
-
return [...new TextEncoder().encode(e)].map((o) => o.toString(16).padStart(2, "0")).join("");
|
|
5
|
-
}
|
|
6
|
-
function ne(e, o = "身份分配命名空间", a) {
|
|
7
|
-
const t = e, r = t != null && t.ranges && typeof t.ranges == "object" && !Array.isArray(t.ranges) ? Object.entries(t.ranges) : null;
|
|
8
|
-
if (!t || typeof t != "object" || typeof t.replicaId != "string" || !t.replicaId || typeof t.prefix != "string" || !t.prefix || a !== void 0 && t.prefix !== `${a}c${G(t.replicaId)}_` || !Number.isSafeInteger(t.slot) || t.slot < 0 || !Number.isSafeInteger(t.count) || t.count < 2 || t.slot >= t.count || t.count > 65536 || !Number.isSafeInteger(t.clock) || t.clock < 0 || t.clock > x || !Number.isSafeInteger(t.sequence) || t.sequence < 0 || t.sequence > x || !r || r.length > 2e4 || r.some(([n, s]) => !n || !s || !Number.isSafeInteger(s.base) || s.base <= 0 || !Number.isSafeInteger(s.maximum) || s.maximum < s.base || s.maximum > S || !Number.isSafeInteger(s.next) || !Number.isSafeInteger(s.end) || !Number.isSafeInteger(s.step) || s.step <= 0 || s.next <= 0 || s.end <= 0 || s.end > s.maximum + 1 || s.next > s.end + s.step - 1 || (F(n) ? s.base !== t.slot + 1 || s.maximum !== S || s.step !== t.count || s.end !== S + 1 || (s.next - s.base) % t.count !== 0 : (() => {
|
|
9
|
-
const d = Math.floor((s.maximum - s.base + 1) / t.count), m = s.base + t.slot * d, u = t.slot === t.count - 1 ? s.maximum + 1 : m + d;
|
|
10
|
-
return d < 1 || s.step !== 1 || s.end !== u || s.next < m || s.next > u;
|
|
11
|
-
})())))
|
|
12
|
-
throw new Error(`${o}无效`);
|
|
13
|
-
}
|
|
14
|
-
function le(e, o, a, t = 4096) {
|
|
15
|
-
const r = e.allocation;
|
|
16
|
-
if (r) {
|
|
17
|
-
if (ne(r, "身份分配命名空间", e.prefix), r.replicaId !== o || r.slot !== a || r.count !== t)
|
|
18
|
-
throw new Error("同一文档不能切换协同身份分配命名空间");
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
e.allocation = {
|
|
22
|
-
replicaId: o,
|
|
23
|
-
slot: a,
|
|
24
|
-
count: t,
|
|
25
|
-
prefix: `${e.prefix}c${G(o)}_`,
|
|
26
|
-
clock: 0,
|
|
27
|
-
sequence: 0,
|
|
28
|
-
ranges: {}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function oe(e, o, a, t = S) {
|
|
32
|
-
const r = e.allocation;
|
|
33
|
-
if (!r) return null;
|
|
34
|
-
const n = r.ranges[o];
|
|
35
|
-
if (n) {
|
|
36
|
-
if (F(o)) {
|
|
37
|
-
if (n.base !== r.slot + 1 || n.maximum !== S || n.step !== r.count || n.end !== S + 1 || (n.next - n.base) % r.count !== 0)
|
|
38
|
-
throw new Error(`身份范围 ${o} 与当前副本分区不匹配`);
|
|
39
|
-
return n;
|
|
40
|
-
}
|
|
41
|
-
const u = Math.floor((t - n.base + 1) / r.count), g = n.base + r.slot * u, p = r.slot === r.count - 1 ? t + 1 : g + u;
|
|
42
|
-
if (n.maximum !== t || n.step !== 1 || n.end !== p || n.next < g || n.next > p)
|
|
43
|
-
throw new Error(`身份范围 ${o} 与当前副本分区不匹配`);
|
|
44
|
-
return n;
|
|
45
|
-
}
|
|
46
|
-
if (!Number.isSafeInteger(a) || a <= 0 || a > t)
|
|
47
|
-
throw new Error(`身份范围 ${o} 已耗尽`);
|
|
48
|
-
const s = Math.floor((t - a + 1) / r.count);
|
|
49
|
-
if (s < 1) throw new Error(`身份范围 ${o} 无法容纳协同副本`);
|
|
50
|
-
const d = a + r.slot * s, m = r.slot === r.count - 1 ? t + 1 : d + s;
|
|
51
|
-
return r.ranges[o] = { base: a, maximum: t, next: d, end: m, step: 1 };
|
|
52
|
-
}
|
|
53
|
-
function de(e, o, a, t = S) {
|
|
54
|
-
const r = oe(e, o, a, t);
|
|
55
|
-
if (!r) return null;
|
|
56
|
-
if (r.next >= r.end) throw new Error(`身份范围 ${o} 已耗尽`);
|
|
57
|
-
const n = r.next;
|
|
58
|
-
return r.next += r.step, n;
|
|
59
|
-
}
|
|
60
|
-
const X = (e) => {
|
|
61
|
-
var o;
|
|
62
|
-
return ((o = e.allocation) == null ? void 0 : o.prefix) ?? e.prefix;
|
|
63
|
-
};
|
|
64
|
-
function se(e) {
|
|
65
|
-
const o = e.allocation;
|
|
66
|
-
if (o && (o.clock >= x || o.sequence >= x))
|
|
67
|
-
throw new Error("协同逻辑时钟或消息序号已耗尽");
|
|
68
|
-
}
|
|
69
|
-
function ue(e) {
|
|
70
|
-
const o = e.allocation;
|
|
71
|
-
o && (se(e), o.clock++, o.sequence++);
|
|
72
|
-
}
|
|
73
|
-
let V = 0;
|
|
74
|
-
const y = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakSet();
|
|
75
|
-
function z(e) {
|
|
76
|
-
var t, r;
|
|
77
|
-
if (e !== void 0) return e;
|
|
78
|
-
V++;
|
|
79
|
-
const o = new Uint32Array(2);
|
|
80
|
-
return (r = (t = globalThis.crypto) == null ? void 0 : t.getRandomValues) == null || r.call(t, o), `d${o[0] || o[1] ? `${o[0].toString(36)}${o[1].toString(36)}` : `${Date.now().toString(36)}${V.toString(36)}`}-`;
|
|
81
|
-
}
|
|
82
|
-
function re(e) {
|
|
83
|
-
var o;
|
|
84
|
-
return (o = e.editInfo) != null && o.editable ? e.editInfo.editable : e.kind === "unsupported" || e.kind === "group" && (e.name === "图表" || e.name === "SmartArt" || e.name === "墨迹") ? "frame" : "full";
|
|
85
|
-
}
|
|
86
|
-
function ie(e, o, a, t) {
|
|
87
|
-
var u;
|
|
88
|
-
const r = re(e), n = e.editInfo, s = a === "pptx" && !(n != null && n.origin), d = a === "pptx" && ((u = n == null ? void 0 : n.origin) == null ? void 0 : u.part) !== t, m = o === "full" && !s && !d ? r : "none";
|
|
89
|
-
return {
|
|
90
|
-
...n != null && n.geom ? { geom: n.geom } : {},
|
|
91
|
-
...n != null && n.customGeometry ? { customGeometry: n.customGeometry } : {},
|
|
92
|
-
...n != null && n.placeholder ? { ph: n.placeholder } : {},
|
|
93
|
-
...n != null && n.placeholderDirect ? { placeholderDirect: n.placeholderDirect } : {},
|
|
94
|
-
...n != null && n.placeholderInheritedEffects ? { placeholderInheritedEffects: n.placeholderInheritedEffects } : {},
|
|
95
|
-
...n != null && n.origin ? { origin: n.origin } : {},
|
|
96
|
-
...n != null && n.moveLocked ? { moveLocked: !0 } : {},
|
|
97
|
-
...n != null && n.textTemplate ? { textTemplate: n.textTemplate } : {},
|
|
98
|
-
...n != null && n.readonlyLink ? { sourceLinkReadonly: !0 } : {},
|
|
99
|
-
editable: m,
|
|
100
|
-
...d ? { inherited: !0 } : {}
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
function ae(e) {
|
|
104
|
-
const { elements: o, editInfo: a, ...t } = e;
|
|
105
|
-
return t;
|
|
106
|
-
}
|
|
107
|
-
function fe(e, o = {}) {
|
|
108
|
-
var E, $, P, v, k, A, O, N, j, D, M, R, T, C, L;
|
|
109
|
-
const a = z(o.idPrefix), t = {}, r = {}, n = [];
|
|
110
|
-
let s = 0, d = 0;
|
|
111
|
-
const m = (i, c, l, f, h, q) => i.map((I, H) => {
|
|
112
|
-
const b = `${a}e${(++d).toString(36)}`, _ = ie(I, l, e.source, f), W = {
|
|
113
|
-
id: b,
|
|
114
|
-
parent: c,
|
|
115
|
-
z: Q(H),
|
|
116
|
-
src: I,
|
|
117
|
-
ovr: {},
|
|
118
|
-
meta: _
|
|
119
|
-
};
|
|
120
|
-
return r[b] = W, Y(I) && h.push(b), Z(I) && q.push(b), I.kind === "group" && (W.children = m(
|
|
121
|
-
I.children,
|
|
122
|
-
b,
|
|
123
|
-
_.editable,
|
|
124
|
-
f,
|
|
125
|
-
h,
|
|
126
|
-
q
|
|
127
|
-
)), b;
|
|
128
|
-
});
|
|
129
|
-
for (const i of e.slides) {
|
|
130
|
-
const c = `${a}s${(++s).toString(36)}`, l = [], f = [], h = {
|
|
131
|
-
id: c,
|
|
132
|
-
src: ae(i),
|
|
133
|
-
ovr: {},
|
|
134
|
-
children: [],
|
|
135
|
-
dynamicSlideNumbers: l,
|
|
136
|
-
dynamicSlideLinks: f,
|
|
137
|
-
origin: ((E = i.editInfo) == null ? void 0 : E.origin) ?? null,
|
|
138
|
-
...($ = i.editInfo) != null && $.notes ? {
|
|
139
|
-
notes: {
|
|
140
|
-
sourcePart: i.editInfo.notes.part,
|
|
141
|
-
targetPart: i.editInfo.notes.part,
|
|
142
|
-
relationshipId: i.editInfo.notes.relationshipId
|
|
143
|
-
}
|
|
144
|
-
} : {},
|
|
145
|
-
...(P = i.editInfo) != null && P.layoutId ? { layoutId: i.editInfo.layoutId } : {},
|
|
146
|
-
...(v = i.editInfo) != null && v.layoutId ? { sourceLayoutId: i.editInfo.layoutId } : {},
|
|
147
|
-
...(k = i.editInfo) != null && k.directBackground ? { sourceDirectBackground: !0 } : {},
|
|
148
|
-
...(A = i.editInfo) != null && A.directTransition ? { sourceDirectTransition: !0 } : {},
|
|
149
|
-
...(O = i.editInfo) != null && O.hideMasterShapes ? { sourceHideMasterShapes: !0 } : {},
|
|
150
|
-
...(N = i.editInfo) != null && N.defaultShape ? { defaultShape: structuredClone(i.editInfo.defaultShape) } : {},
|
|
151
|
-
...(j = i.editInfo) != null && j.defaultTable ? { defaultTable: structuredClone(i.editInfo.defaultTable) } : {},
|
|
152
|
-
...(D = i.editInfo) != null && D.tableStyles ? { tableStyles: structuredClone(i.editInfo.tableStyles) } : {}
|
|
153
|
-
};
|
|
154
|
-
t[c] = h, n.push(c), h.children = m(
|
|
155
|
-
i.elements,
|
|
156
|
-
c,
|
|
157
|
-
"full",
|
|
158
|
-
((M = h.origin) == null ? void 0 : M.part) ?? null,
|
|
159
|
-
l,
|
|
160
|
-
f
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
if (e.source === "pptx") {
|
|
164
|
-
const i = /* @__PURE__ */ new Map();
|
|
165
|
-
for (const c of Object.values(r)) {
|
|
166
|
-
if (!c.meta.origin) continue;
|
|
167
|
-
const l = `${c.meta.origin.part}\0${c.meta.origin.spid}`, f = i.get(l) ?? [];
|
|
168
|
-
f.push(c), i.set(l, f);
|
|
169
|
-
}
|
|
170
|
-
for (const c of i.values())
|
|
171
|
-
if (c.length > 1) for (const l of c) l.meta.editable = "none";
|
|
172
|
-
}
|
|
173
|
-
const u = e.package ?? null, g = e.source === "pptx" ? !!u && !u.disposed && n.every((i) => t[i].origin !== null) : !0, p = {
|
|
174
|
-
meta: {
|
|
175
|
-
width: e.width,
|
|
176
|
-
height: e.height,
|
|
177
|
-
source: e.source,
|
|
178
|
-
readonly: !g,
|
|
179
|
-
...(R = e.editInfo) != null && R.tableStylesPart ? { tableStylesPart: e.editInfo.tableStylesPart } : {}
|
|
180
|
-
},
|
|
181
|
-
identity: { prefix: a, nextSlide: s + 1, nextElement: d + 1, nextSpid: {} },
|
|
182
|
-
slides: t,
|
|
183
|
-
slideOrder: n,
|
|
184
|
-
layouts: Object.fromEntries((((T = e.editInfo) == null ? void 0 : T.layouts) ?? []).map((i) => [
|
|
185
|
-
i.id,
|
|
186
|
-
structuredClone(i)
|
|
187
|
-
])),
|
|
188
|
-
layoutOrder: ((C = e.editInfo) == null ? void 0 : C.layouts.map((i) => i.id)) ?? [],
|
|
189
|
-
elements: r,
|
|
190
|
-
removedElements: {},
|
|
191
|
-
imageResources: {},
|
|
192
|
-
package: u,
|
|
193
|
-
saveState: {
|
|
194
|
-
baselines: /* @__PURE__ */ Object.create(null),
|
|
195
|
-
createdParts: [],
|
|
196
|
-
sourceSlideParts: n.flatMap((i) => {
|
|
197
|
-
var c;
|
|
198
|
-
return ((c = t[i].origin) == null ? void 0 : c.part) ?? [];
|
|
199
|
-
})
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
return e.slides.forEach((i, c) => {
|
|
203
|
-
var h;
|
|
204
|
-
const l = n[c], f = U(p, l, i.animations);
|
|
205
|
-
f.steps.length && (p.slides[l].sourceAnimations = f.steps), (f.readonly || (h = i.editInfo) != null && h.animationSourceReadonly) && (p.slides[l].sourceAnimationsReadonly = !0);
|
|
206
|
-
}), e.dispose && y.set(p, e.dispose), J(p, (L = e.editInfo) == null ? void 0 : L.assets), p;
|
|
207
|
-
}
|
|
208
|
-
function me(e) {
|
|
209
|
-
if (!Number.isFinite(e.width) || e.width <= 0 || !Number.isFinite(e.height) || e.height <= 0)
|
|
210
|
-
throw new Error("页面宽高必须是有限正数");
|
|
211
|
-
const o = z(e.idPrefix);
|
|
212
|
-
return {
|
|
213
|
-
meta: { width: e.width, height: e.height, source: "pptx", readonly: !1 },
|
|
214
|
-
identity: { prefix: o, nextSlide: 1, nextElement: 1, nextSpid: {} },
|
|
215
|
-
slides: {},
|
|
216
|
-
slideOrder: [],
|
|
217
|
-
layouts: {},
|
|
218
|
-
layoutOrder: [],
|
|
219
|
-
elements: {},
|
|
220
|
-
removedElements: {},
|
|
221
|
-
imageResources: {},
|
|
222
|
-
package: null,
|
|
223
|
-
saveState: { baselines: /* @__PURE__ */ Object.create(null), createdParts: [], sourceSlideParts: [] }
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
function pe(e) {
|
|
227
|
-
for (; ; ) {
|
|
228
|
-
const o = `${X(e.identity)}s${(e.identity.nextSlide++).toString(36)}`;
|
|
229
|
-
if (!e.slides[o] && !e.elements[o]) return o;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
function he(e) {
|
|
233
|
-
for (; ; ) {
|
|
234
|
-
const o = `${X(e.identity)}e${(e.identity.nextElement++).toString(36)}`;
|
|
235
|
-
if (!e.elements[o] && !e.slides[o]) return o;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
function w(e, o) {
|
|
239
|
-
var t;
|
|
240
|
-
const a = e.package;
|
|
241
|
-
a !== o && (ee(e), te(e)), e.package = o, a !== o && ((t = a == null ? void 0 : a.dispose) == null || t.call(a));
|
|
242
|
-
}
|
|
243
|
-
function Se(e, o) {
|
|
244
|
-
if (o.disposed) throw new Error("不能采用已经释放的 OPC 包");
|
|
245
|
-
w(e, o), e.saveState.baselines = /* @__PURE__ */ Object.create(null), e.saveState.createdParts = [], e.saveState.sourceSlideParts = e.slideOrder.flatMap((a) => {
|
|
246
|
-
var t;
|
|
247
|
-
return ((t = e.slides[a].origin) == null ? void 0 : t.part) ?? [];
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
function Ie(e, o, a, t) {
|
|
251
|
-
w(e, o), e.saveState.baselines = a, e.saveState.createdParts = t;
|
|
252
|
-
}
|
|
253
|
-
function be(e) {
|
|
254
|
-
var o;
|
|
255
|
-
B.has(e) || (B.add(e), (o = y.get(e)) == null || o(), y.delete(e), K(e), e.saveState.baselines = /* @__PURE__ */ Object.create(null), e.saveState.createdParts = [], e.saveState.sourceSlideParts = [], e.imageResources = {}, w(e, null));
|
|
256
|
-
}
|
|
257
|
-
export {
|
|
258
|
-
x as M,
|
|
259
|
-
de as a,
|
|
260
|
-
he as b,
|
|
261
|
-
Ie as c,
|
|
262
|
-
ie as d,
|
|
263
|
-
oe as e,
|
|
264
|
-
pe as f,
|
|
265
|
-
ne as g,
|
|
266
|
-
se as h,
|
|
267
|
-
ue as i,
|
|
268
|
-
le as j,
|
|
269
|
-
fe as k,
|
|
270
|
-
X as l,
|
|
271
|
-
me as m,
|
|
272
|
-
be as n,
|
|
273
|
-
Se as r
|
|
274
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { v as i, b as f, s as a } from "./insertion-CGpb504L.js";
|
|
2
|
-
const b = 5 * 1024 * 1024;
|
|
3
|
-
function c(o, e, r) {
|
|
4
|
-
if (!ArrayBuffer.isView(o) || Object.prototype.toString.call(o) !== "[object Uint8Array]")
|
|
5
|
-
throw new Error(`${e} 必须是 Uint8Array`);
|
|
6
|
-
const t = o;
|
|
7
|
-
if (!t.byteLength) throw new Error(`${e} 不能为空`);
|
|
8
|
-
if (r !== void 0 && t.byteLength > r)
|
|
9
|
-
throw new Error(`${e} 不能超过 ${r} 字节`);
|
|
10
|
-
return new Uint8Array(t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength));
|
|
11
|
-
}
|
|
12
|
-
function h(o, e, r, t) {
|
|
13
|
-
const n = c(o, `${r}.bytes`, t), s = i(n, e, r);
|
|
14
|
-
return {
|
|
15
|
-
hash: a(n),
|
|
16
|
-
mime: e,
|
|
17
|
-
extension: s.extension,
|
|
18
|
-
bytes: f(n)
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export {
|
|
22
|
-
b as M,
|
|
23
|
-
h as c
|
|
24
|
-
};
|