@silurus/ooxml 0.62.0 → 0.63.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.
@@ -29873,4 +29873,110 @@ function $n(e, t) {
29873
29873
  return e === !0 ? "rtl" : e === !1 ? "ltr" : Qn().computeLevels(t, "auto").paragraphLevel === 1 ? "rtl" : "ltr";
29874
29874
  }
29875
29875
  //#endregion
29876
- export { I as A, c as B, Re as C, ke as D, je as E, j as F, s as H, u as I, d as L, R as M, F as N, Oe as O, A as P, p as R, We as S, Me as T, t as U, m as V, Ye as _, bn as a, qe as b, qt as c, Wt as d, _t as f, lt as g, ct as h, xn as i, L as j, De as k, Jt as l, ut as m, Qn as n, yn as o, yt as p, Sn as r, Yt as s, $n as t, Rt as u, Ze as v, Ue as w, ze as x, Xe as y, l as z };
29876
+ //#region packages/core/src/text/kinsoku/rules.ts
29877
+ var er = "”’)〕]}〉》」』】〙〗〟⦆»、。,.・:;/?!‐ー゠–〜~ぁぃぅぇぉっゃゅょゎゕゖァィゥェォッャュョヮヵヶㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ゝゞヽヾ゛゜%‰℃°′″。」、・ー゙゚!),.:;?]}⦆", tr = "“‘(〔[{〈《「『【〘〖〝⦅«$¥#£¢([{⦅";
29878
+ function nr(e) {
29879
+ let t = /* @__PURE__ */ new Set();
29880
+ for (let n of e) t.add(n.codePointAt(0));
29881
+ return t;
29882
+ }
29883
+ function rr(e) {
29884
+ return {
29885
+ enabled: e?.kinsoku !== !1,
29886
+ lineStartForbidden: nr(e?.noLineBreaksBefore ?? er),
29887
+ lineEndForbidden: nr(e?.noLineBreaksAfter ?? tr)
29888
+ };
29889
+ }
29890
+ var ir = rr();
29891
+ //#endregion
29892
+ //#region packages/core/src/text/kinsoku/split.ts
29893
+ function ar(e, t, n, r = 1) {
29894
+ if (!n.enabled || t <= 0 || t >= e.length) return t;
29895
+ let i = (t) => t < e.length && n.lineStartForbidden.has(e[t].codePointAt(0)), a = (t) => t >= 0 && n.lineEndForbidden.has(e[t].codePointAt(0)), o = t;
29896
+ for (; o > r && (i(o) || a(o - 1));) o--;
29897
+ return o <= r && (i(o) || a(o - 1)) ? t : o;
29898
+ }
29899
+ function or(e, t, n) {
29900
+ if (!t.enabled) return 0;
29901
+ let r = e.length - n;
29902
+ for (let n = 1; n <= r; n++) {
29903
+ let r = e[e.length - n];
29904
+ if (/\s/.test(r) || t.lineStartForbidden.has(r.codePointAt(0))) continue;
29905
+ let i = e[e.length - n - 1];
29906
+ if (!(i && t.lineEndForbidden.has(i.codePointAt(0)))) return n;
29907
+ }
29908
+ return 0;
29909
+ }
29910
+ //#endregion
29911
+ //#region packages/core/src/text/cjk-ranges.ts
29912
+ function sr(e) {
29913
+ return e >= 12288 && e <= 40959 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65280 && e <= 65519;
29914
+ }
29915
+ //#endregion
29916
+ //#region packages/core/src/text/line-distribute.ts
29917
+ var cr = (e) => e === 32 || e === 12288;
29918
+ function lr(e, t, n = {}) {
29919
+ if (Math.abs(t) <= .5) return null;
29920
+ let r = n.firstContentSi ?? 0, i = n.lastDrawnSi ?? e.length - 1, a = n.minPerGap ?? -Infinity, o = n.isGapChar ?? sr, s = n.isWhitespace ?? cr, c = [];
29921
+ for (let t = r; t < e.length; t++) {
29922
+ let n = e[t];
29923
+ if (n === void 0) continue;
29924
+ if (n.text === void 0) {
29925
+ c.push({
29926
+ si: t,
29927
+ off: 0,
29928
+ ws: !1
29929
+ });
29930
+ continue;
29931
+ }
29932
+ let r = 0;
29933
+ for (let e of n.text) {
29934
+ let n = e.codePointAt(0);
29935
+ c.push({
29936
+ si: t,
29937
+ off: r,
29938
+ cp: n,
29939
+ ws: s(n)
29940
+ }), r++;
29941
+ }
29942
+ }
29943
+ let l = -1, u = -1;
29944
+ for (let e = 0; e < c.length; e++) c[e].ws || (l === -1 && (l = e), u = e);
29945
+ if (l === -1 || l === u) return null;
29946
+ let d = Array(c.length).fill(!1), f = 0;
29947
+ for (let e = l; e < u; e++) {
29948
+ let t = c[e];
29949
+ if (t.si === i) continue;
29950
+ if (t.ws) {
29951
+ d[e] = !0, f++;
29952
+ continue;
29953
+ }
29954
+ let n = c[e + 1];
29955
+ if (n.ws) continue;
29956
+ let r = t.cp, a = n.cp;
29957
+ (r !== void 0 && o(r) || a !== void 0 && o(a)) && (d[e] = !0, f++);
29958
+ }
29959
+ if (f === 0) return null;
29960
+ let p = t / f;
29961
+ t < 0 && p < a && (p = a);
29962
+ let m = /* @__PURE__ */ new Map();
29963
+ for (let e of c) e.cp !== void 0 && m.set(e.si, (m.get(e.si) ?? 0) + 1);
29964
+ let h = /* @__PURE__ */ new Map();
29965
+ for (let e = 0; e < c.length; e++) {
29966
+ if (!d[e]) continue;
29967
+ let t = c[e], n = h.get(t.si);
29968
+ n || (n = {
29969
+ splitBefore: [],
29970
+ trailingGap: !1,
29971
+ internalStretch: 0
29972
+ }, h.set(t.si, n));
29973
+ let r = m.get(t.si) ?? 0;
29974
+ t.cp === void 0 || t.off === r - 1 ? n.trailingGap = !0 : (n.splitBefore.push(t.off + 1), n.internalStretch += p);
29975
+ }
29976
+ return {
29977
+ perGap: p,
29978
+ perSeg: h
29979
+ };
29980
+ }
29981
+ //#endregion
29982
+ export { Ue as A, A as B, Ye as C, ze as D, qe as E, De as F, l as G, u as H, I, s as J, c as K, L, je as M, ke as N, We as O, Oe as P, R, lt as S, Xe as T, d as U, j as V, p as W, t as Y, Wt as _, ir as a, ut as b, Qn as c, bn as d, yn as f, Rt as g, Jt as h, ar as i, Me as j, Re as k, Sn as l, qt as m, sr as n, rr as o, Yt as p, m as q, or as r, $n as s, lr as t, xn as u, _t as v, Ze as w, ct as x, yt as y, F as z };
@@ -769,6 +769,9 @@ export declare interface NumberingInfo {
769
769
  text: string;
770
770
  indentLeft: number;
771
771
  tab: number;
772
+ /** ECMA-376 §17.9.28 `<w:suff>` — "tab" (default) | "space" | "nothing".
773
+ * Where body text starts after the marker on the first line. */
774
+ suff: string;
772
775
  }
773
776
 
774
777
  export declare interface ParaBorderEdge {
@@ -1968,6 +1968,9 @@ declare interface NumberingInfo {
1968
1968
  text: string;
1969
1969
  indentLeft: number;
1970
1970
  tab: number;
1971
+ /** ECMA-376 §17.9.28 `<w:suff>` — "tab" (default) | "space" | "nothing".
1972
+ * Where body text starts after the marker on the first line. */
1973
+ suff: string;
1971
1974
  }
1972
1975
 
1973
1976
  declare interface NumFmt {
@@ -2015,6 +2018,23 @@ declare interface Paragraph {
2015
2018
  runs: TextRun[];
2016
2019
  }
2017
2020
 
2021
+ /**
2022
+ * PPTX paragraph. Extends the shared core `Paragraph` with the PPTX-only
2023
+ * `eaLnBrk` flag that the pptx parser emits but the shared core model does not
2024
+ * carry (docx/xlsx paragraphs don't surface it). Mirrors the Rust
2025
+ * `Paragraph` struct's `ea_ln_brk` field 1:1.
2026
+ */
2027
+ declare interface Paragraph_2 extends Paragraph {
2028
+ /**
2029
+ * `<a:pPr eaLnBrk>` (ECMA-376 §21.1.2.2.7, xsd:boolean, default true). When
2030
+ * true, East Asian text may break at character boundaries (kinsoku rules);
2031
+ * when false, an East Asian word must not be split mid-character. The parser
2032
+ * resolves the paragraph → body/list-style → layout/master cascade and always
2033
+ * emits an effective boolean.
2034
+ */
2035
+ eaLnBrk: boolean;
2036
+ }
2037
+
2018
2038
  declare interface ParagraphBorders {
2019
2039
  top: ParaBorderEdge | null;
2020
2040
  bottom: ParaBorderEdge | null;
@@ -2147,6 +2167,16 @@ declare interface PictureElement {
2147
2167
  flipV: boolean;
2148
2168
  /** Data URL, e.g. "data:image/png;base64,..." */
2149
2169
  dataUrl: string;
2170
+ /**
2171
+ * Microsoft 2016 SVG extension (`<a:blip><a:extLst><a:ext
2172
+ * uri="{96DAC541-7B7A-43D3-8B79-37D633B846F1}"><asvg:svgBlip r:embed>`). When
2173
+ * PowerPoint embeds an SVG image, `dataUrl` above is only the PNG fallback it
2174
+ * rasterizes for compatibility; this is the original vector image as a
2175
+ * `data:image/svg+xml;base64,…` URL. The renderer prefers this and falls back
2176
+ * to `dataUrl` if the SVG fails to decode. Omitted when the picture has no
2177
+ * svgBlip extension (the common case).
2178
+ */
2179
+ svgDataUrl?: string;
2150
2180
  /**
2151
2181
  * Border line from `<p:pic><p:spPr><a:ln>` (ECMA-376 §20.1.2.2.24). A
2152
2182
  * `p:pic`'s spPr is `CT_ShapeProperties` (§19.3.1.37), so a picture carries
@@ -2264,7 +2294,7 @@ export declare namespace pptx {
2264
2294
  SpaceLine,
2265
2295
  TabStop,
2266
2296
  TextBody,
2267
- Paragraph,
2297
+ Paragraph_2 as Paragraph,
2268
2298
  TextRun,
2269
2299
  TextRunData,
2270
2300
  LineBreak,
@@ -3331,6 +3361,12 @@ declare interface TextBody extends TextBody_2 {
3331
3361
  * omitted from JSON when false. Only meaningful when `numCol > 1`.
3332
3362
  */
3333
3363
  rtlCol?: boolean;
3364
+ /**
3365
+ * Narrow the inherited `paragraphs` to the PPTX `Paragraph` so consumers see
3366
+ * the PPTX-only `eaLnBrk` flag. PPTX `Paragraph extends CoreParagraph`, so
3367
+ * this is a covariant refinement of `CoreTextBody.paragraphs`.
3368
+ */
3369
+ paragraphs: Paragraph_2[];
3334
3370
  }
3335
3371
 
3336
3372
  declare interface TextBody_2 {
@@ -863,7 +863,24 @@ export declare interface NoFill {
863
863
  fillType: 'none';
864
864
  }
865
865
 
866
- export declare interface Paragraph {
866
+ /**
867
+ * PPTX paragraph. Extends the shared core `Paragraph` with the PPTX-only
868
+ * `eaLnBrk` flag that the pptx parser emits but the shared core model does not
869
+ * carry (docx/xlsx paragraphs don't surface it). Mirrors the Rust
870
+ * `Paragraph` struct's `ea_ln_brk` field 1:1.
871
+ */
872
+ export declare interface Paragraph extends Paragraph_2 {
873
+ /**
874
+ * `<a:pPr eaLnBrk>` (ECMA-376 §21.1.2.2.7, xsd:boolean, default true). When
875
+ * true, East Asian text may break at character boundaries (kinsoku rules);
876
+ * when false, an East Asian word must not be split mid-character. The parser
877
+ * resolves the paragraph → body/list-style → layout/master cascade and always
878
+ * emits an effective boolean.
879
+ */
880
+ eaLnBrk: boolean;
881
+ }
882
+
883
+ declare interface Paragraph_2 {
867
884
  /** Alignment: "l" | "ctr" | "r" | "just" */
868
885
  alignment: string;
869
886
  /** Left margin in EMU */
@@ -945,6 +962,16 @@ export declare interface PictureElement {
945
962
  flipV: boolean;
946
963
  /** Data URL, e.g. "data:image/png;base64,..." */
947
964
  dataUrl: string;
965
+ /**
966
+ * Microsoft 2016 SVG extension (`<a:blip><a:extLst><a:ext
967
+ * uri="{96DAC541-7B7A-43D3-8B79-37D633B846F1}"><asvg:svgBlip r:embed>`). When
968
+ * PowerPoint embeds an SVG image, `dataUrl` above is only the PNG fallback it
969
+ * rasterizes for compatibility; this is the original vector image as a
970
+ * `data:image/svg+xml;base64,…` URL. The renderer prefers this and falls back
971
+ * to `dataUrl` if the SVG fails to decode. Omitted when the picture has no
972
+ * svgBlip extension (the common case).
973
+ */
974
+ svgDataUrl?: string;
948
975
  /**
949
976
  * Border line from `<p:pic><p:spPr><a:ln>` (ECMA-376 §20.1.2.2.24). A
950
977
  * `p:pic`'s spPr is `CT_ShapeProperties` (§19.3.1.37), so a picture carries
@@ -1567,12 +1594,18 @@ export declare interface TextBody extends TextBody_2 {
1567
1594
  * omitted from JSON when false. Only meaningful when `numCol > 1`.
1568
1595
  */
1569
1596
  rtlCol?: boolean;
1597
+ /**
1598
+ * Narrow the inherited `paragraphs` to the PPTX `Paragraph` so consumers see
1599
+ * the PPTX-only `eaLnBrk` flag. PPTX `Paragraph extends CoreParagraph`, so
1600
+ * this is a covariant refinement of `CoreTextBody.paragraphs`.
1601
+ */
1602
+ paragraphs: Paragraph[];
1570
1603
  }
1571
1604
 
1572
1605
  declare interface TextBody_2 {
1573
1606
  /** Vertical anchor: "t" | "ctr" | "b" */
1574
1607
  verticalAnchor: string;
1575
- paragraphs: Paragraph[];
1608
+ paragraphs: Paragraph_2[];
1576
1609
  /** Default pt size from lstStyle (overrides renderer default when present) */
1577
1610
  defaultFontSize: number | null;
1578
1611
  /** Inherited bold from layout/master defRPr (null = not set, use false as final default) */