pptx-svelte-viewer 4.1.3 → 4.1.4

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/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { Ch as e, Fc as a, Fl as o, Hu as r, Jd as t, Jm as i, Rl as l, Sh as n, Th as S, Tl as m, Vo as d, ad as p, as as T, cs as h, fn as v, fp as c, kl as g, ls as P, mc as u, nc as C, os as f, ps as k, sn as A, wh as E, xh as N, yp as x, zl as D } from "./transition-overlay-6-XCGrBb.js";
1
+ import { Ch as e, Fc as a, Fl as o, Hu as r, Jd as t, Jm as i, Rl as l, Sh as n, Th as S, Tl as m, Vo as d, ad as p, as as T, cs as h, fn as v, fp as c, kl as g, ls as P, mc as u, nc as C, os as f, ps as k, sn as A, wh as E, xh as N, yp as x, zl as D } from "./transition-overlay-DIPxa90i.js";
2
2
  import { i as F } from "./translator-D7duxy6A.js";
3
- import { a as B, c as O, l as R, o as V, s as _, t as w, u as y } from "./export-DFc5l3nx.js";
3
+ import { a as B, c as O, l as R, o as V, s as _, t as w, u as y } from "./export-B2Ws2H1S.js";
4
4
  import "./i18n.js";
5
5
  export {
6
6
  A as PPTX_OPEN_ACCEPT,
package/dist/internals.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Bn as a, Kf as n, Lc as i, Mf as T, Oc as t, Ut as S, Vn as _, Zf as e, _c as A, cp as E, cr as I, ft as o, gr as r, ht as N, in as R, ip as O, jf as M, nn as D, rn as l, t as L, tt as P, wn as c, xt as F } from "./transition-overlay-6-XCGrBb.js";
1
+ import { Bn as a, Kf as n, Lc as i, Mf as T, Oc as t, Ut as S, Vn as _, Zf as e, _c as A, cp as E, cr as I, ft as o, gr as r, ht as N, in as R, ip as O, jf as M, nn as D, rn as l, t as L, tt as P, wn as c, xt as F } from "./transition-overlay-DIPxa90i.js";
2
2
  export {
3
3
  P as CINEMATIC_TRANSITION_KEYFRAMES,
4
4
  o as DEFAULT_MORPH_DURATION_MS,
@@ -90403,71 +90403,73 @@ var YV, BTe, WTt = M({ "src/core/core/runtime/PptxHandlerRuntimeChartParsingHelp
90403
90403
  if (!n) throw new Error(`Slide index ${e} out of range`);
90404
90404
  let i = this.layoutXmlMap.get(t);
90405
90405
  if (!i) {
90406
- const h = await this.zip.file(t)?.async("string");
90407
- if (!h) throw new Error(`Layout not found: ${t}`);
90408
- i = this.parser.parse(h), this.layoutXmlMap.set(t, i);
90406
+ const T = await this.zip.file(t)?.async("string");
90407
+ if (!T) throw new Error(`Layout not found: ${t}`);
90408
+ i = this.parser.parse(T), this.layoutXmlMap.set(t, i);
90409
90409
  }
90410
- const o = n.id, a = `${o.replace("slides/", "slides/_rels/")}.rels`, s = await this.zip.file(a)?.async("string");
90411
- if (s) {
90412
- const h = this.parser.parse(s), g = Array.isArray(h?.Relationships?.Relationship) ? h.Relationships.Relationship : h?.Relationships?.Relationship ? [h.Relationships.Relationship] : [], y = `../slideLayouts/${t.split("/").pop()}`;
90413
- let b = !1;
90414
- for (const k of g) if (String(k["@_Type"] || "").includes("/slideLayout")) {
90415
- k["@_Target"] = y, b = !0;
90410
+ const o = n.id, a = `../slideLayouts/${t.split("/").pop()}`, s = o.startsWith("ppt/slides/") ? a : `/${t}`, l = `${o.replace("slides/", "slides/_rels/")}.rels`, c = await this.zip.file(l)?.async("string");
90411
+ let d;
90412
+ if (c) {
90413
+ const T = this.parser.parse(c), k = Array.isArray(T?.Relationships?.Relationship) ? T.Relationships.Relationship : T?.Relationships?.Relationship ? [T.Relationships.Relationship] : [];
90414
+ let C = !1;
90415
+ for (const I of k) if (String(I["@_Type"] || "").includes("/slideLayout")) {
90416
+ d = String(I["@_Id"] || ""), I["@_Target"] = a, C = !0;
90416
90417
  break;
90417
90418
  }
90418
- if (!b) {
90419
- const k = g.reduce((C, P) => {
90420
- const I = parseInt(String(P["@_Id"] || "rId0").replace("rId", ""), 10);
90421
- return Number.isFinite(I) && I > C ? I : C;
90422
- }, 0);
90423
- g.push({
90424
- "@_Id": `rId${k + 1}`,
90425
- "@_Type": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",
90426
- "@_Target": y
90427
- });
90428
- }
90429
- h.Relationships.Relationship = g.length === 1 ? g[0] : g;
90430
- const w = this.builder.build(h);
90431
- this.zip.file(a, w);
90432
- const T = this.slideRelsMap.get(o);
90433
- if (T) {
90434
- for (const [k, C] of T.entries()) if (C.includes("slideLayout")) {
90435
- T.set(k, y);
90436
- break;
90437
- }
90438
- }
90439
- }
90440
- this.slideRelsMap.has(o) || this.slideRelsMap.set(o, /* @__PURE__ */ new Map([["rId1", `../slideLayouts/${t.split("/").pop()}`]])), this.layoutCache.delete(t), await this.getLayoutElements(o);
90441
- const l = qdt(this.remapElementsToNewLayout(n.elements, i, t), {
90442
- resolveDefaults: (h) => {
90443
- const g = this.getElementPlaceholderInfo(h);
90444
- return g ? this.lookupPlaceholderDefaults(o, g) : void 0;
90445
- },
90446
- placeholderType: (h) => this.getElementPlaceholderInfo(h)?.type,
90447
- applyBodyDefaults: (h, g) => this.applyPlaceholderBodyDefaults(h, g),
90448
- applyLevelDefaults: (h, g) => this.applyPlaceholderLevelDefaults(h, g)
90449
- }), c = i["p:sldLayout"], d = String(c?.["p:cSld"]?.["@_name"] || "").trim() || t, u = {
90419
+ C || (d = `rId${k.reduce((I, R) => {
90420
+ const L = parseInt(String(R["@_Id"] || "rId0").replace("rId", ""), 10);
90421
+ return Number.isFinite(L) && L > I ? L : I;
90422
+ }, 0) + 1}`, k.push({
90423
+ "@_Id": d,
90424
+ "@_Type": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",
90425
+ "@_Target": a
90426
+ })), T.Relationships.Relationship = k.length === 1 ? k[0] : k;
90427
+ const P = this.builder.build(T);
90428
+ this.zip.file(l, P);
90429
+ }
90430
+ let u = this.slideRelsMap.get(o);
90431
+ u || (u = /* @__PURE__ */ new Map(), this.slideRelsMap.set(o, u));
90432
+ const f = [...u.entries()].find(([, T]) => T.includes("slideLayout"));
90433
+ if (f) u.set(f[0], s);
90434
+ else {
90435
+ if (!d) {
90436
+ let T = 1;
90437
+ for (; u.has(`rId${T}`); ) T++;
90438
+ d = `rId${T}`;
90439
+ }
90440
+ u.set(d, s);
90441
+ }
90442
+ this.layoutCache.delete(t), await this.getLayoutElements(o);
90443
+ const h = qdt(this.remapElementsToNewLayout(n.elements, i, t), {
90444
+ resolveDefaults: (T) => {
90445
+ const k = this.getElementPlaceholderInfo(T);
90446
+ return k ? this.lookupPlaceholderDefaults(o, k) : void 0;
90447
+ },
90448
+ placeholderType: (T) => this.getElementPlaceholderInfo(T)?.type,
90449
+ applyBodyDefaults: (T, k) => this.applyPlaceholderBodyDefaults(T, k),
90450
+ applyLevelDefaults: (T, k) => this.applyPlaceholderLevelDefaults(T, k)
90451
+ }), g = i["p:sldLayout"], y = String(g?.["p:cSld"]?.["@_name"] || "").trim() || t, b = {
90450
90452
  ...n,
90451
- elements: l,
90453
+ elements: h,
90452
90454
  layoutPath: t,
90453
- layoutName: d,
90455
+ layoutName: y,
90454
90456
  isDirty: !0
90455
- }, f = Afe(this, o);
90456
- if (f ? Pfe(f, n) : !n.rawXml || !this.extractBackgroundColor(n.rawXml)) {
90457
+ }, w = Afe(this, o);
90458
+ if (w ? Pfe(w, n) : !n.rawXml || !this.extractBackgroundColor(n.rawXml)) {
90457
90459
  await this.loadSlideRelationships(t, Lc(t));
90458
- const [h, g, y] = await Promise.all([
90460
+ const [T, k, C] = await Promise.all([
90459
90461
  this.getLayoutBackgroundColor(o),
90460
90462
  this.getLayoutBackgroundGradient(o),
90461
90463
  this.getLayoutBackgroundImage(o)
90462
90464
  ]);
90463
- u.backgroundColor = h ?? n.backgroundColor, u.backgroundGradient = g, u.backgroundImage = y, kfe(this, o, {
90465
+ b.backgroundColor = T ?? n.backgroundColor, b.backgroundGradient = k, b.backgroundImage = C, kfe(this, o, {
90464
90466
  authored: !1,
90465
- color: u.backgroundColor,
90466
- gradient: g,
90467
- image: y
90467
+ color: b.backgroundColor,
90468
+ gradient: k,
90469
+ image: C
90468
90470
  });
90469
90471
  }
90470
- return r[e] = u, u;
90472
+ return r[e] = b, b;
90471
90473
  }
90472
90474
  };
90473
90475
  } }), WTe, e2t = M({ "src/core/core/runtime/PptxHandlerRuntimeImplementation.ts"() {
@@ -16376,6 +16376,8 @@ declare class ViewerState {
16376
16376
  set zoomPercent(percent: number | null);
16377
16377
  /** Reset for a freshly-loaded presentation. */
16378
16378
  reset(slideCount: number, initialSlide?: number): void;
16379
+ /** Keep navigation bounds aligned when editor operations change the deck. */
16380
+ setSlideCount(slideCount: number): void;
16379
16381
  goTo(index: number): void;
16380
16382
  next(): void;
16381
16383
  prev(): void;
@@ -1,5 +1,5 @@
1
- import { Uh as l, Wh as S } from "../transition-overlay-6-XCGrBb.js";
2
- import { A as e, F as a, M as o, N as r, P as s, c as n, d, f as b, i as m, j as t, l as p, m as c, n as g, o as x, p as w, r as C, s as P, t as T, u as $ } from "../export-DFc5l3nx.js";
1
+ import { Uh as l, Wh as S } from "../transition-overlay-DIPxa90i.js";
2
+ import { A as e, F as a, M as o, N as r, P as s, c as n, d, f as b, i as m, j as t, l as p, m as c, n as g, o as x, p as w, r as C, s as P, t as T, u as $ } from "../export-B2Ws2H1S.js";
3
3
  var y = a, A = s, V = o, f = t, u = e, R = r;
4
4
  export {
5
5
  f as CollaborationCursors,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pptx-svelte-viewer",
3
- "version": "4.1.3",
3
+ "version": "4.1.4",
4
4
  "description": "Svelte 5 PowerPoint viewer and editor component: render, edit, present, and export PPTX slides in the browser.",
5
5
  "keywords": [
6
6
  "office",