@web-ppt/edit-core 0.6.0 → 0.8.0-beta.2
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 +29 -0
- package/README.md +8 -0
- package/dist/agent/base64.d.ts +2 -0
- package/dist/agent/errors.d.ts +9 -0
- package/dist/agent/generated-schema.d.ts +6038 -0
- package/dist/agent/generated-validator.d.ts +6 -0
- package/dist/agent/index.d.ts +6 -0
- package/dist/agent/query.d.ts +3 -0
- package/dist/agent/session.d.ts +33 -0
- package/dist/agent/targets.d.ts +5 -0
- package/dist/agent/tools.d.ts +2 -0
- package/dist/agent/types.d.ts +126 -0
- package/dist/agent/validation.d.ts +2 -0
- package/dist/agent.js +46364 -0
- package/dist/commands/types.d.ts +23 -23
- package/dist/fill/api.d.ts +29 -0
- package/dist/fill/chart-seed-chart.d.ts +7 -0
- package/dist/fill/chart-seed-workbook.d.ts +12 -0
- package/dist/fill/chart-seed-xml.d.ts +12 -0
- package/dist/fill/chart-seed.d.ts +17 -0
- package/dist/fill/content.d.ts +16 -0
- package/dist/fill/errors.d.ts +10 -0
- package/dist/fill/generated-schema.d.ts +291 -0
- package/dist/fill/generated-validator.d.ts +6 -0
- package/dist/fill/index.d.ts +10 -0
- package/dist/fill/layouts.d.ts +24 -0
- package/dist/fill/package.d.ts +2 -0
- package/dist/fill/repair.d.ts +32 -0
- package/dist/fill/text-validation.d.ts +3 -0
- package/dist/fill/types.d.ts +60 -0
- package/dist/fill/validation.d.ts +10 -0
- package/dist/fill.js +12 -0
- package/dist/generate.js +53 -53
- package/dist/index-2ti1e4_F.js +411 -0
- package/dist/index-BbsPmmoy.js +4046 -0
- package/dist/save/notes-master.d.ts +12 -0
- package/dist/save.js +650 -484
- package/dist/{slide-parts-D0o_DDhi.js → slide-parts-zyOP9lia.js} +5 -5
- package/dist/types.d.ts +4 -4
- package/package.json +13 -3
- package/schemas/agent-tools.schema.json +7999 -0
- package/schemas/template-fill.schema.json +371 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface TemplateFillParagraph {
|
|
2
|
+
readonly text: string;
|
|
3
|
+
readonly level?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
4
|
+
readonly bullet?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface TemplateFillImage {
|
|
7
|
+
readonly bytes: string;
|
|
8
|
+
readonly mime: 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp';
|
|
9
|
+
readonly altText?: string;
|
|
10
|
+
readonly fit?: 'contain' | 'cover';
|
|
11
|
+
}
|
|
12
|
+
export interface TemplateFillChartSeries {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly values: readonly (number | null)[];
|
|
15
|
+
readonly x?: readonly (number | null)[];
|
|
16
|
+
readonly sizes?: readonly (number | null)[];
|
|
17
|
+
}
|
|
18
|
+
export interface TemplateFillChart {
|
|
19
|
+
readonly type: 'bar' | 'line' | 'pie' | 'doughnut' | 'area' | 'scatter' | 'radar' | 'bubble';
|
|
20
|
+
readonly categories: readonly string[];
|
|
21
|
+
readonly series: readonly TemplateFillChartSeries[];
|
|
22
|
+
readonly title?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface TemplateFillSlideBase {
|
|
25
|
+
readonly title: string;
|
|
26
|
+
readonly notes?: string;
|
|
27
|
+
readonly layoutId?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface TemplateFillTitleSlide extends TemplateFillSlideBase {
|
|
30
|
+
readonly type: 'title';
|
|
31
|
+
readonly subtitle?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface TemplateFillSectionSlide extends TemplateFillSlideBase {
|
|
34
|
+
readonly type: 'section';
|
|
35
|
+
readonly body?: readonly TemplateFillParagraph[];
|
|
36
|
+
}
|
|
37
|
+
export interface TemplateFillContentSlide extends TemplateFillSlideBase {
|
|
38
|
+
readonly type: 'content';
|
|
39
|
+
/** @minItems 1 */
|
|
40
|
+
readonly body: readonly TemplateFillParagraph[];
|
|
41
|
+
}
|
|
42
|
+
export interface TemplateFillTwoColumnSlide extends TemplateFillSlideBase {
|
|
43
|
+
readonly type: 'two-column';
|
|
44
|
+
readonly columns: readonly [readonly TemplateFillParagraph[], readonly TemplateFillParagraph[]];
|
|
45
|
+
}
|
|
46
|
+
export interface TemplateFillImageSlide extends TemplateFillSlideBase {
|
|
47
|
+
readonly type: 'image';
|
|
48
|
+
readonly image: TemplateFillImage;
|
|
49
|
+
readonly body?: readonly TemplateFillParagraph[];
|
|
50
|
+
}
|
|
51
|
+
export interface TemplateFillChartSlide extends TemplateFillSlideBase {
|
|
52
|
+
readonly type: 'chart';
|
|
53
|
+
readonly chart: TemplateFillChart;
|
|
54
|
+
}
|
|
55
|
+
export type TemplateFillSlide = TemplateFillTitleSlide | TemplateFillSectionSlide | TemplateFillContentSlide | TemplateFillTwoColumnSlide | TemplateFillImageSlide | TemplateFillChartSlide;
|
|
56
|
+
export interface TemplateFillOutline {
|
|
57
|
+
readonly version: 1;
|
|
58
|
+
/** @minItems 1 */
|
|
59
|
+
readonly slides: readonly TemplateFillSlide[];
|
|
60
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ImageMetadata } from '@web-ppt/core';
|
|
2
|
+
import type { TemplateFillOutline } from './types';
|
|
3
|
+
export interface PreparedFillImage {
|
|
4
|
+
readonly bytes: Uint8Array;
|
|
5
|
+
readonly metadata: ImageMetadata;
|
|
6
|
+
}
|
|
7
|
+
export declare function prepareOutline(input: unknown): {
|
|
8
|
+
readonly outline: TemplateFillOutline;
|
|
9
|
+
readonly images: ReadonlyMap<number, PreparedFillImage>;
|
|
10
|
+
};
|
package/dist/fill.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "@web-ppt/core";
|
|
2
|
+
import "@web-ppt/edit-core";
|
|
3
|
+
import "@web-ppt/edit-core/describe";
|
|
4
|
+
import "@web-ppt/edit-core/lint";
|
|
5
|
+
import "@web-ppt/edit-core/save";
|
|
6
|
+
import "@web-ppt/edit-core/opc";
|
|
7
|
+
import { T as a, f, t as s } from "./index-BbsPmmoy.js";
|
|
8
|
+
export {
|
|
9
|
+
a as TemplateFillError,
|
|
10
|
+
f as fillTemplate,
|
|
11
|
+
s as templateFillSchema
|
|
12
|
+
};
|
package/dist/generate.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { am as lt, b as V, at as me, S as Ge, au as ct, ad as He, ae as Ue, av as Ee, g as Xe, h as pt, aw as mt, n as ut, a5 as dt, ax as ye, ay as ft, w as ue, Y as ht, az as gt, aA as xt, aB as $t, aC as yt, aD as we, o as wt, x as
|
|
1
|
+
import { am as lt, b as V, at as me, S as Ge, au as ct, ad as He, ae as Ue, av as Ee, g as Xe, h as pt, aw as mt, n as ut, a5 as dt, ax as ye, ay as ft, w as ue, Y as ht, az as gt, aA as xt, aB as $t, aC as yt, aD as we, o as wt, x as vt, a3 as bt, af as St, r as Y, a as Ce, aE as It, aF as Pt, l as Et, aG as Ct, aH as Tt, aI as qe, aJ as kt, y as Mt, A as Ft, aK as Lt, aL as Ot, aM as Te, q as Nt, s as Rt, aN as At, aO as jt, d as Dt, aP as ke, aQ as _t, an as Bt, aR as zt, aS as Gt, aT as Me, aU as Fe, R as Ht, v as Ut } from "./model-invariants-BM19JVxy.js";
|
|
2
2
|
import { c as We, d as Xt } from "./patch-BwhfBbYE.js";
|
|
3
3
|
import { TEXT_RUN_DIRECT_BITS as J, PARAGRAPH_LAYOUT_DIRECT_BITS as qt, THEME_COLOR_SLOTS as Wt } from "@web-ppt/core";
|
|
4
4
|
import { c as Le, m as Vt, s as Yt, i as Qt, a as Kt } from "./clipboard-links-GuPtqr1z.js";
|
|
5
|
-
import { P as H, D as _, s as G, g as Oe, d as Zt, p as R, h as Ve, t as Ye, O as
|
|
6
|
-
import { i as Qe,
|
|
5
|
+
import { P as H, D as _, s as G, g as Oe, d as Zt, p as R, h as Ve, t as Ye, O as be, a as Q, x as ee, i as K, c as se, b as ne, X as Jt, r as Ne, k as er } from "./index-C2r7c6G6.js";
|
|
6
|
+
import { i as Qe, p as le, v as tr, s as rr, u as sr, m as nr, x as ar, k as or, y as ir, d as lr } from "./slide-parts-zyOP9lia.js";
|
|
7
7
|
import { copyElements as Re } from "@web-ppt/edit-core";
|
|
8
8
|
function Ke(e, t, s, n) {
|
|
9
9
|
const r = lt(e, s);
|
|
@@ -51,9 +51,9 @@ function dr(e, t, s) {
|
|
|
51
51
|
n *= T, r *= T;
|
|
52
52
|
}
|
|
53
53
|
const $ = n * n, x = r * r, h = $ * f * f + x * p * p, g = Math.max(0, $ * x - h), M = h === 0 ? 0 : (o === i ? -1 : 1) * Math.sqrt(g / h), S = (l + d) / 2 + M * (n * f / r), C = (m + u) / 2 - M * (r * p / n), E = Math.atan2((m - C) / r, (l - S) / n);
|
|
54
|
-
let
|
|
55
|
-
return i === 1 &&
|
|
56
|
-
markup: `<a:arcTo wR="${te(n, "A.rx")}" hR="${te(r, "A.ry")}" stAng="${Ae(E, "A.start")}" swAng="${Ae(
|
|
54
|
+
let b = Math.atan2((u - C) / r, (d - S) / n) - E;
|
|
55
|
+
return i === 1 && b < 0 && (b += Math.PI * 2), i === 0 && b > 0 && (b -= Math.PI * 2), {
|
|
56
|
+
markup: `<a:arcTo wR="${te(n, "A.rx")}" hR="${te(r, "A.ry")}" stAng="${Ae(E, "A.start")}" swAng="${Ae(b, "A.sweep")}"/>`,
|
|
57
57
|
target: c
|
|
58
58
|
};
|
|
59
59
|
}
|
|
@@ -257,7 +257,7 @@ function wr(e, t) {
|
|
|
257
257
|
}
|
|
258
258
|
t.shadowEffect && mt(s(e, "effectLst"), t.shadowEffect), t.underlineColor && Ee(s(s(e, "uFill"), "solidFill"), t.underlineColor);
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function vr(e, t, s, n) {
|
|
261
261
|
var o, i;
|
|
262
262
|
const r = (o = t.editInfo) == null ? void 0 : o.bullet, a = r && r.kind !== "none" ? {
|
|
263
263
|
...r.color !== void 0 ? { color: r.color } : {},
|
|
@@ -311,7 +311,7 @@ function je(e, t, s, n, r = !1) {
|
|
|
311
311
|
autoFit: o
|
|
312
312
|
},
|
|
313
313
|
paragraphs: a.paragraphs.map((i, c) => {
|
|
314
|
-
const l =
|
|
314
|
+
const l = vr(e, s.paragraphs[c], c, n);
|
|
315
315
|
return {
|
|
316
316
|
...i,
|
|
317
317
|
sourceParagraph: s.paragraphs[c].runs.some((m) => {
|
|
@@ -355,7 +355,7 @@ function je(e, t, s, n, r = !1) {
|
|
|
355
355
|
})
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
|
-
const
|
|
358
|
+
const br = new Set(`textNoShape textPlain textStop textTriangle textTriangleInverted
|
|
359
359
|
textChevron textChevronInverted textRingInside textRingOutside textArchUp textArchDown
|
|
360
360
|
textCircle textButton textArchUpPour textArchDownPour textCirclePour textButtonPour
|
|
361
361
|
textCurveUp textCurveDown textCanUp textCanDown textWave1 textWave2 textDoubleWave1 textWave4
|
|
@@ -366,7 +366,7 @@ function Sr(e) {
|
|
|
366
366
|
var s;
|
|
367
367
|
if (!e) return "";
|
|
368
368
|
if ((s = e.generationIssues) != null && s.length) throw new Error(e.generationIssues.join("、"));
|
|
369
|
-
if (!
|
|
369
|
+
if (!br.has(e.preset) || Object.entries(e.adj).some(([n, r]) => !/^[A-Za-z][\w]*$/.test(n) || !Number.isSafeInteger(r)))
|
|
370
370
|
throw new Error("艺术字预设或调整值无效");
|
|
371
371
|
const t = Object.entries(e.adj).map(([n, r]) => `<a:gd name="${n}" fmla="val ${r}"/>`).join("");
|
|
372
372
|
return `<a:prstTxWarp prst="${e.preset}"><a:avLst>${t}</a:avLst></a:prstTxWarp>`;
|
|
@@ -540,7 +540,7 @@ function kr(e, t) {
|
|
|
540
540
|
markup: `<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id="${t}" name="${o}"/><p:cNvGraphicFramePr/><p:nvPr/></p:nvGraphicFramePr>
|
|
541
541
|
<p:xfrm/><a:graphic><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/table"><a:tbl>
|
|
542
542
|
${l}<a:tblGrid>${n}</a:tblGrid>${a}</a:tbl></a:graphicData></a:graphic></p:graphicFrame>`,
|
|
543
|
-
namespaces: { "xmlns:a": _, "xmlns:p": H, "xmlns:r":
|
|
543
|
+
namespaces: { "xmlns:a": _, "xmlns:p": H, "xmlns:r": be },
|
|
544
544
|
spids: { [String(t)]: t }
|
|
545
545
|
};
|
|
546
546
|
}
|
|
@@ -780,7 +780,7 @@ function zr(e) {
|
|
|
780
780
|
};
|
|
781
781
|
}
|
|
782
782
|
function Gr(e) {
|
|
783
|
-
return
|
|
783
|
+
return bt(ot(e));
|
|
784
784
|
}
|
|
785
785
|
function ge(e) {
|
|
786
786
|
const t = e.paragraphs[0];
|
|
@@ -833,7 +833,7 @@ function Xr(e, t) {
|
|
|
833
833
|
function qr(e, t, s) {
|
|
834
834
|
var l, m, d;
|
|
835
835
|
const n = (l = e.slides[e.slideOrder[0]]) == null ? void 0 : l.layoutId, r = n ? (m = e.layouts[n]) == null ? void 0 : m.origin.masterPart : e.masterOrder[0], a = r ? e.masters[r] : void 0, o = a ? wt(a.ovr, "background") ? a.ovr.background : a.background : (d = t[0]) == null ? void 0 : d.background, i = (o == null ? void 0 : o.type) === "image" ? void 0 : o === null ? { type: "none" } : o, c = R(s[he]);
|
|
836
|
-
|
|
836
|
+
vt(c, {
|
|
837
837
|
id: he,
|
|
838
838
|
ovr: {
|
|
839
839
|
...i ? { background: i } : {},
|
|
@@ -919,13 +919,13 @@ class Vr {
|
|
|
919
919
|
t["[Content_Types].xml"] = Q(r);
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
|
-
function
|
|
922
|
+
function ve(e, t) {
|
|
923
923
|
const s = e.namespaceUri === _ && ["stCxn", "endCxn"].includes(e.localName) ? "id" : e.namespaceUri === H && e.localName === "spTgt" ? "spid" : null;
|
|
924
924
|
if (s) {
|
|
925
925
|
const n = ne(e, { localName: s, namespaceUri: null }), r = n ? t[n.value] : void 0;
|
|
926
926
|
r !== void 0 && G(e, s, String(r));
|
|
927
927
|
}
|
|
928
|
-
for (const n of ee(e))
|
|
928
|
+
for (const n of ee(e)) ve(n, t);
|
|
929
929
|
}
|
|
930
930
|
function Yr(e, t, s, n, r, a) {
|
|
931
931
|
var S, C, E, U;
|
|
@@ -937,32 +937,32 @@ function Yr(e, t, s, n, r, a) {
|
|
|
937
937
|
if (!m && !d) throw new Error(`兼容对象 ${t.id} 缺少原包来源`);
|
|
938
938
|
a.registerMedia((m == null ? void 0 : m.resources) ?? []);
|
|
939
939
|
const u = { ...t, meta: { ...t.meta, editable: "frame", origin: o } }, p = m ? Pt(e, l) : R(d), f = Et(p, u).host;
|
|
940
|
-
m &&
|
|
940
|
+
m && ve(f, m.spids);
|
|
941
941
|
const y = {};
|
|
942
|
-
for (const
|
|
943
|
-
const T = ne(
|
|
944
|
-
y[T] = n, G(
|
|
942
|
+
for (const b of Ct(p, u)) {
|
|
943
|
+
const T = ne(b, { localName: "id", namespaceUri: null }).value;
|
|
944
|
+
y[T] = n, G(b, "id", String(o.spid));
|
|
945
945
|
}
|
|
946
946
|
const $ = { [String(o.spid)]: n };
|
|
947
947
|
let x = 2;
|
|
948
|
-
for (const
|
|
949
|
-
if (!(
|
|
948
|
+
for (const b of Yt(f))
|
|
949
|
+
if (!(b in $)) {
|
|
950
950
|
for (; r.has(x); ) x++;
|
|
951
|
-
$[
|
|
951
|
+
$[b] = x, r.add(x++);
|
|
952
952
|
}
|
|
953
|
-
|
|
954
|
-
const h = {}, g = (
|
|
955
|
-
if (
|
|
956
|
-
for (const T of
|
|
953
|
+
ve(f, { ...$, ...y });
|
|
954
|
+
const h = {}, g = (b) => {
|
|
955
|
+
if (b !== f && !ee(b).some(g)) return !1;
|
|
956
|
+
for (const T of b.attributes)
|
|
957
957
|
T.namespaceUri === Jt && !(T.name in h) && (h[T.name] = T.value);
|
|
958
958
|
return !0;
|
|
959
959
|
};
|
|
960
960
|
g(p.root);
|
|
961
|
-
const
|
|
962
|
-
const w =
|
|
963
|
-
if (!w) throw new Error(`兼容对象缺少原包关系:${
|
|
961
|
+
const v = (m == null ? void 0 : m.relationships) ?? a.relationships(c), M = Tt(f, !0).map((b, T) => {
|
|
962
|
+
const w = v.find((I) => I.targetId === b);
|
|
963
|
+
if (!w) throw new Error(`兼容对象缺少原包关系:${b}`);
|
|
964
964
|
return a.relocate(
|
|
965
|
-
{ ...w, sourceId:
|
|
965
|
+
{ ...w, sourceId: b },
|
|
966
966
|
m ? o.part : c,
|
|
967
967
|
s,
|
|
968
968
|
`rIdCompat${n}_${T + 1}`
|
|
@@ -973,7 +973,7 @@ function Yr(e, t, s, n, r, a) {
|
|
|
973
973
|
namespaces: h,
|
|
974
974
|
spids: $,
|
|
975
975
|
relationships: M,
|
|
976
|
-
unmodeledSpids: Object.values($).filter((
|
|
976
|
+
unmodeledSpids: Object.values($).filter((b) => b !== n)
|
|
977
977
|
};
|
|
978
978
|
}
|
|
979
979
|
const ze = "{C676402C-5697-4E1C-873F-D02D1690AC5C}", Qr = "http://schemas.microsoft.com/office/powerpoint/2012/main", Kr = (e, t) => {
|
|
@@ -1011,8 +1011,8 @@ function Jr(e, t) {
|
|
|
1011
1011
|
})) return;
|
|
1012
1012
|
const s = (d) => R(`<?xml version="1.0" encoding="UTF-8"?><p:${d} xmlns:p="${H}"/>`), n = R(e["[Content_Types].xml"]), r = s("cmAuthorLst"), a = /* @__PURE__ */ new Map(), o = (d, u, p) => {
|
|
1013
1013
|
const f = Y(d), y = e[f], $ = new Set(y ? ee(R(y).root).map((g) => {
|
|
1014
|
-
var
|
|
1015
|
-
return (
|
|
1014
|
+
var v;
|
|
1015
|
+
return (v = ne(g, { localName: "Id" })) == null ? void 0 : v.value;
|
|
1016
1016
|
}) : []);
|
|
1017
1017
|
let x = 1;
|
|
1018
1018
|
for (; $.has(`rId${x}`); ) x++;
|
|
@@ -1020,7 +1020,7 @@ function Jr(e, t) {
|
|
|
1020
1020
|
e[f] = le(y, [{
|
|
1021
1021
|
sourceId: h,
|
|
1022
1022
|
targetId: h,
|
|
1023
|
-
type: `${
|
|
1023
|
+
type: `${be}/${p}`,
|
|
1024
1024
|
target: u
|
|
1025
1025
|
}]);
|
|
1026
1026
|
}, i = (d, u) => {
|
|
@@ -1042,9 +1042,9 @@ function Jr(e, t) {
|
|
|
1042
1042
|
name: x.author,
|
|
1043
1043
|
initials: x.initials
|
|
1044
1044
|
}, a.set(h, g));
|
|
1045
|
-
const
|
|
1046
|
-
if (
|
|
1047
|
-
g.last =
|
|
1045
|
+
const v = ++c;
|
|
1046
|
+
if (v > 4294967295) throw new Error("批注索引超出 OOXML 可表示范围");
|
|
1047
|
+
g.last = v, f.set(x.id ?? `source:${$}`, { author: g.id, idx: v });
|
|
1048
1048
|
}
|
|
1049
1049
|
for (const [$, x] of u.comments.entries()) {
|
|
1050
1050
|
const h = $e(p.root, "p:cm");
|
|
@@ -1111,13 +1111,13 @@ function ss(e, t, s, n, r) {
|
|
|
1111
1111
|
if (a.kind === "table") {
|
|
1112
1112
|
const p = {};
|
|
1113
1113
|
return a.rows.forEach((f, y) => f.cells.forEach(($, x) => {
|
|
1114
|
-
var g,
|
|
1114
|
+
var g, v;
|
|
1115
1115
|
const h = !$.merged && je(
|
|
1116
1116
|
e,
|
|
1117
1117
|
t,
|
|
1118
1118
|
$.text,
|
|
1119
1119
|
c(`R${y + 1}C${x + 1}`),
|
|
1120
|
-
!!((g = a.editInfo) != null && g.tableStyle) && !!((
|
|
1120
|
+
!!((g = a.editInfo) != null && g.tableStyle) && !!((v = $.editInfo) != null && v.styleBase)
|
|
1121
1121
|
);
|
|
1122
1122
|
h && (p[zt({ r: y, c: x })] = { text: h });
|
|
1123
1123
|
})), { ...i, ...Object.keys(p).length ? { tableCells: p } : {} };
|
|
@@ -1137,7 +1137,7 @@ function ns(e, t, s, n) {
|
|
|
1137
1137
|
return {
|
|
1138
1138
|
markup: `<p:sp><p:nvSpPr><p:cNvPr id="${s}" name="${l}"/><p:cNvSpPr${m ? ' txBox="1"' : ""}/><p:nvPr/></p:nvSpPr>
|
|
1139
1139
|
<p:spPr><a:xfrm/>${d}</p:spPr>${c}</p:sp>`,
|
|
1140
|
-
namespaces: { "xmlns:a": _, "xmlns:p": H, "xmlns:r":
|
|
1140
|
+
namespaces: { "xmlns:a": _, "xmlns:p": H, "xmlns:r": be },
|
|
1141
1141
|
spids: { [String(s)]: s },
|
|
1142
1142
|
...u ? { relationships: [u.relationship] } : {},
|
|
1143
1143
|
...u != null && u.resource ? { resources: [u.resource] } : {}
|
|
@@ -1200,7 +1200,7 @@ function is(e, t, s, n) {
|
|
|
1200
1200
|
throw new Error(`生成保存遇到未知元素类型:${String(r)}`);
|
|
1201
1201
|
}
|
|
1202
1202
|
function ls(e, t, s, n, r) {
|
|
1203
|
-
var C, E, U,
|
|
1203
|
+
var C, E, U, b, T;
|
|
1204
1204
|
const a = `ppt/slides/slide${s + 1}.xml`, o = _r(e, t), i = Dr(o.sourceRecords, o.roots), c = /* @__PURE__ */ new Set([1, ...i.values()]), l = /* @__PURE__ */ Object.create(null), m = /* @__PURE__ */ new Map();
|
|
1205
1205
|
for (const [w, I] of Object.entries(o.sourceRecords)) {
|
|
1206
1206
|
let A = o.sourceRecords[I.parent], Ie = !1;
|
|
@@ -1280,16 +1280,16 @@ function ls(e, t, s, n, r) {
|
|
|
1280
1280
|
package: null
|
|
1281
1281
|
}, g = [...o.roots].sort((w, I) => Te(l[w]).localeCompare(Te(l[I])));
|
|
1282
1282
|
d.children = g;
|
|
1283
|
-
const
|
|
1283
|
+
const v = R(nt()), M = Object.values(l).flatMap((w) => {
|
|
1284
1284
|
var I;
|
|
1285
1285
|
return ((I = w.meta.insertion) == null ? void 0 : I.relationships) ?? [];
|
|
1286
1286
|
});
|
|
1287
1287
|
f && M.push(f.relationship);
|
|
1288
1288
|
const S = Nt(h, a, n, M);
|
|
1289
|
-
Rt(
|
|
1289
|
+
Rt(v, h, a, g.map((w) => l[w]), [], { links: S }), lr(v, h, d);
|
|
1290
1290
|
for (const w of Object.values(l))
|
|
1291
|
-
(
|
|
1292
|
-
return { bytes: Q(
|
|
1291
|
+
(b = w.src.editInfo) != null && b.requiresOriginal || (At(v, w, !0), w.src.kind === "shape" && ((T = w.src.fill) == null ? void 0 : T.type) === "image" && jt(v, w, w.src.fill, `rIdFill${i.get(w.id)}`), (w.src.kind === "shape" || w.src.kind === "image") && Dt(v, w, w.src.stroke ?? null));
|
|
1292
|
+
return { bytes: Q(v), work: h, links: S };
|
|
1293
1293
|
}
|
|
1294
1294
|
function it(e, t, s = e) {
|
|
1295
1295
|
var p, f, y;
|
|
@@ -1311,16 +1311,16 @@ function it(e, t, s = e) {
|
|
|
1311
1311
|
}
|
|
1312
1312
|
const d = /* @__PURE__ */ new Map(), u = new Vr(e);
|
|
1313
1313
|
e.slideOrder.forEach(($, x) => {
|
|
1314
|
-
const h = `ppt/slides/slide${x + 1}.xml`, g = Y(h),
|
|
1315
|
-
l[h] =
|
|
1316
|
-
const M = nr(
|
|
1314
|
+
const h = `ppt/slides/slide${x + 1}.xml`, g = Y(h), v = ls(e, $, x, l[g], u);
|
|
1315
|
+
l[h] = v.bytes, t == null || t($, v.work);
|
|
1316
|
+
const M = nr(v.work);
|
|
1317
1317
|
for (const [S, C] of M.relationships) {
|
|
1318
1318
|
const E = Y(S);
|
|
1319
1319
|
l[E] = S === h ? Mt(
|
|
1320
1320
|
l[E],
|
|
1321
1321
|
C,
|
|
1322
|
-
|
|
1323
|
-
|
|
1322
|
+
v.links,
|
|
1323
|
+
v.bytes
|
|
1324
1324
|
) : le(l[E], C);
|
|
1325
1325
|
}
|
|
1326
1326
|
for (const [S, C] of M.resources) {
|
|
@@ -1424,7 +1424,7 @@ function $s(e, t) {
|
|
|
1424
1424
|
const r = /* @__PURE__ */ Object.create(null), a = (h) => {
|
|
1425
1425
|
const g = e.elements[h];
|
|
1426
1426
|
r[h] = { ...g };
|
|
1427
|
-
for (const
|
|
1427
|
+
for (const v of g.children ?? []) a(v);
|
|
1428
1428
|
};
|
|
1429
1429
|
for (const h of t) a(h);
|
|
1430
1430
|
let o = [...t], i = s;
|
|
@@ -1440,8 +1440,8 @@ function $s(e, t) {
|
|
|
1440
1440
|
const d = ps(l), u = { ...l, elements: d, extensions: {}, package: { format: "pptx", parts: m, bytes: new Uint8Array(), disposed: !1 }, saveState: { ...l.saveState, baselines: m } };
|
|
1441
1441
|
Me(u, e);
|
|
1442
1442
|
const p = Re(u, t), f = { ...p.records }, y = (h, g) => {
|
|
1443
|
-
const
|
|
1444
|
-
f[g] = { ...
|
|
1443
|
+
const v = p.records[g];
|
|
1444
|
+
f[g] = { ...v, meta: { ...v.meta, ...Kt(e, h, ue(e, h)) } }, e.elements[h].meta.editable !== "frame" && (e.elements[h].children ?? []).forEach((M, S) => y(M, v.children[S]));
|
|
1445
1445
|
};
|
|
1446
1446
|
return [...t].sort((h, g) => (e.elements[h].order ?? e.elements[h].z).localeCompare(e.elements[g].order ?? e.elements[g].z)).forEach((h, g) => y(h, p.roots[g])), { ...p, records: f };
|
|
1447
1447
|
}
|