@office-kit/pptx-preview 0.9.5 → 0.9.7

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,2 +1,2 @@
1
- import { a as MONO, c as TIMES, d as substituteFamily, l as defaultMeasurer, n as renderSlideSvg, o as SANS, r as ARIAL, s as SERIF, t as auditTextLayout } from "./src-BqJTKEQf.js";
1
+ import { a as MONO, c as TIMES, d as substituteFamily, l as defaultMeasurer, n as renderSlideSvg, o as SANS, r as ARIAL, s as SERIF, t as auditTextLayout } from "./src-BCN48I0D.js";
2
2
  export { ARIAL, MONO, SANS, SERIF, TIMES, auditTextLayout, defaultMeasurer, renderSlideSvg as renderSlideToSvg, substituteFamily };
package/dist/node.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as MONO, c as TIMES, d as substituteFamily, i as AVG_GLYPH_W_RATIO, l as defaultMeasurer, n as renderSlideSvg, o as SANS, r as ARIAL, s as SERIF, t as auditTextLayout, u as isCjk } from "./src-BqJTKEQf.js";
1
+ import { a as MONO, c as TIMES, d as substituteFamily, i as AVG_GLYPH_W_RATIO, l as defaultMeasurer, n as renderSlideSvg, o as SANS, r as ARIAL, s as SERIF, t as auditTextLayout, u as isCjk } from "./src-BCN48I0D.js";
2
2
  import { getSlideSize } from "@office-kit/pptx";
3
3
  import { Resvg } from "@resvg/resvg-js";
4
4
  import * as fontkit from "fontkit";
@@ -2539,24 +2539,22 @@ const resolveTextBodyModel = (pres, shape, bounds, theme, phType, measure, defau
2539
2539
  LINE_HEIGHT * lineHeightScale;
2540
2540
  const numberLabels = Array.from({ length: paraData.length }, () => null);
2541
2541
  {
2542
- let counter = 0;
2543
- let activeLevel = -1;
2544
- let activeType = null;
2542
+ const counters = [];
2543
+ const types = [];
2545
2544
  for (let i = 0; i < paraData.length; i++) {
2546
2545
  const para = paraData[i];
2547
2546
  const num = bulletAutoNumType(para.bulletStyle);
2548
- if (num === null) {
2549
- counter = 0;
2550
- activeLevel = -1;
2551
- activeType = null;
2552
- continue;
2547
+ const level = Math.max(0, para.level);
2548
+ for (let l = num === null ? level : level + 1; l < counters.length; l++) {
2549
+ counters[l] = 0;
2550
+ types[l] = null;
2553
2551
  }
2554
- if (para.level !== activeLevel || num !== activeType) {
2555
- counter = 1;
2556
- activeLevel = para.level;
2557
- activeType = num;
2558
- } else counter += 1;
2559
- numberLabels[i] = formatAutoNum(num, counter);
2552
+ if (num === null) continue;
2553
+ if (types[level] !== num) {
2554
+ counters[level] = 1;
2555
+ types[level] = num;
2556
+ } else counters[level] = (counters[level] ?? 0) + 1;
2557
+ numberLabels[i] = formatAutoNum(num, counters[level]);
2560
2558
  }
2561
2559
  }
2562
2560
  if (authoredAutofit && autoFitScale === 1) {
@@ -3745,6 +3743,8 @@ const renderScatterChart = (f, spec, colors) => {
3745
3743
  if (allX.length === 0) return "";
3746
3744
  const xB = scatterAxisBounds(allX);
3747
3745
  const yB = scatterAxisBounds(allY);
3746
+ if (spec.categoryAxisScaling?.min !== void 0) xB.min = spec.categoryAxisScaling.min;
3747
+ if (spec.categoryAxisScaling?.max !== void 0) xB.max = spec.categoryAxisScaling.max;
3748
3748
  if (spec.valueAxis?.min !== void 0) yB.min = spec.valueAxis.min;
3749
3749
  if (spec.valueAxis?.max !== void 0) yB.max = spec.valueAxis.max;
3750
3750
  const xRange = xB.max - xB.min || 1;
@@ -3790,6 +3790,8 @@ const renderBubbleChart = (f, spec, colors) => {
3790
3790
  if (allX.length === 0) return "";
3791
3791
  const xB = scatterAxisBounds(allX);
3792
3792
  const yB = scatterAxisBounds(allY);
3793
+ if (spec.categoryAxisScaling?.min !== void 0) xB.min = spec.categoryAxisScaling.min;
3794
+ if (spec.categoryAxisScaling?.max !== void 0) xB.max = spec.categoryAxisScaling.max;
3793
3795
  if (spec.valueAxis?.min !== void 0) yB.min = spec.valueAxis.min;
3794
3796
  if (spec.valueAxis?.max !== void 0) yB.max = spec.valueAxis.max;
3795
3797
  const xRange = xB.max - xB.min || 1;
@@ -3891,6 +3893,14 @@ const renderChart = (shape, x, y, w, h, transform, theme) => {
3891
3893
  return null;
3892
3894
  }
3893
3895
  if (!spec) return null;
3896
+ if (spec.kind === "stock") spec = {
3897
+ ...spec,
3898
+ kind: "line"
3899
+ };
3900
+ else if (spec.kind === "surface") spec = {
3901
+ ...spec,
3902
+ kind: "column"
3903
+ };
3894
3904
  const colors = accentSequence(theme);
3895
3905
  const isCartesian = spec.kind === "column" || spec.kind === "bar" || spec.kind === "line" || spec.kind === "area";
3896
3906
  const hasAxes = isCartesian || spec.kind === "scatter" || spec.kind === "bubble";
@@ -4951,4 +4961,4 @@ const auditTextLayout = (pres, options = {}) => {
4951
4961
  //#endregion
4952
4962
  export { MONO as a, TIMES as c, substituteFamily as d, AVG_GLYPH_W_RATIO as i, defaultMeasurer as l, renderSlideSvg as n, SANS as o, ARIAL as r, SERIF as s, auditTextLayout as t, isCjk as u };
4953
4963
 
4954
- //# sourceMappingURL=src-BqJTKEQf.js.map
4964
+ //# sourceMappingURL=src-BCN48I0D.js.map