pptx-react-viewer 1.22.2 → 1.24.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 +8 -0
- package/README.md +27 -0
- package/dist/{Model3DScene-NLUSXHD6.mjs → Model3DScene-QTNGCODM.mjs} +2 -2
- package/dist/Model3DScene-QTNGCODM.mjs.br +0 -0
- package/dist/Model3DScene-QTNGCODM.mjs.gz +0 -0
- package/dist/{Model3DScene-3YB3JAJS.js → Model3DScene-RD4XEC3F.js} +3 -3
- package/dist/{Model3DScene-3YB3JAJS.js.br → Model3DScene-RD4XEC3F.js.br} +0 -0
- package/dist/Model3DScene-RD4XEC3F.js.gz +0 -0
- package/dist/{PowerPointViewer-WGVR_u4z.d.ts → PowerPointViewer-CnADroqZ.d.ts} +2 -2
- package/dist/{PowerPointViewer-WGVR_u4z.d.ts.map → PowerPointViewer-CnADroqZ.d.ts.map} +1 -1
- package/dist/{SurfaceChart3DScene-YBMJQGH3.mjs → SurfaceChart3DScene-VKS3ELTU.mjs} +2 -2
- package/dist/SurfaceChart3DScene-VKS3ELTU.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-VKS3ELTU.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-PUQ5DCO5.js → SurfaceChart3DScene-YR3GX4X6.js} +3 -3
- package/dist/SurfaceChart3DScene-YR3GX4X6.js.br +0 -0
- package/dist/SurfaceChart3DScene-YR3GX4X6.js.gz +0 -0
- package/dist/{types-Cdh0XYcS.d.ts → animation-timeline-CEJJLFqK.d.ts} +4 -4
- package/dist/animation-timeline-CEJJLFqK.d.ts.map +1 -0
- package/dist/{chunk-JUFGTL2A.js → chunk-3YMK5VLS.js} +26769 -26790
- package/dist/chunk-3YMK5VLS.js.br +0 -0
- package/dist/chunk-3YMK5VLS.js.gz +0 -0
- package/dist/{chunk-KA7ST7IH.js → chunk-GKST4OS7.js} +1270 -454
- package/dist/chunk-GKST4OS7.js.br +0 -0
- package/dist/chunk-GKST4OS7.js.gz +0 -0
- package/dist/{chunk-VSNXVKJI.js → chunk-I5SO5OV4.js} +171 -76
- package/dist/chunk-I5SO5OV4.js.br +0 -0
- package/dist/chunk-I5SO5OV4.js.gz +0 -0
- package/dist/{chunk-5SBQZEKD.mjs → chunk-KPT54MHG.mjs} +142 -48
- package/dist/chunk-KPT54MHG.mjs.br +0 -0
- package/dist/chunk-KPT54MHG.mjs.gz +0 -0
- package/dist/{chunk-AD3EAEY6.js → chunk-KV3EOLP3.js} +52160 -51141
- package/dist/chunk-KV3EOLP3.js.br +0 -0
- package/dist/chunk-KV3EOLP3.js.gz +0 -0
- package/dist/{chunk-3ZGCM6RC.mjs → chunk-LDZQNYWL.mjs} +52159 -51142
- package/dist/chunk-LDZQNYWL.mjs.br +0 -0
- package/dist/chunk-LDZQNYWL.mjs.gz +0 -0
- package/dist/{chunk-OIAKQGMC.mjs → chunk-PUQ6GIOM.mjs} +26213 -26236
- package/dist/chunk-PUQ6GIOM.mjs.br +0 -0
- package/dist/chunk-PUQ6GIOM.mjs.gz +0 -0
- package/dist/{chunk-3MZ7IARF.mjs → chunk-YJVMOX2Y.mjs} +819 -5
- package/dist/chunk-YJVMOX2Y.mjs.br +0 -0
- package/dist/chunk-YJVMOX2Y.mjs.gz +0 -0
- package/dist/{dist-3YRZ26TL.mjs → dist-A3OATMOE.mjs} +1 -1
- package/dist/dist-A3OATMOE.mjs.br +0 -0
- package/dist/dist-A3OATMOE.mjs.gz +0 -0
- package/dist/{dist-M2P6HBG4.js → dist-XF3QJAEF.js} +568 -560
- package/dist/dist-XF3QJAEF.js.br +0 -0
- package/dist/dist-XF3QJAEF.js.gz +0 -0
- package/dist/hooks-unstable.d.ts +5492 -5260
- package/dist/hooks-unstable.d.ts.map +1 -1
- package/dist/hooks-unstable.js +80 -76
- package/dist/hooks-unstable.js.br +0 -0
- package/dist/hooks-unstable.js.gz +0 -0
- package/dist/hooks-unstable.mjs +3 -3
- package/dist/hooks-unstable.mjs.br +0 -0
- package/dist/hooks-unstable.mjs.gz +0 -0
- package/dist/i18n.d.ts +3 -0
- package/dist/{index-SUL_8gq8.d.ts → index-CGKutKk1.d.ts} +4 -1
- package/dist/index-CGKutKk1.d.ts.map +1 -0
- package/dist/{index-ntF3kHHU.d.ts → index-hm2FF-FU.d.ts} +3 -3
- package/dist/{index-ntF3kHHU.d.ts.map → index-hm2FF-FU.d.ts.map} +1 -1
- package/dist/index.d.ts +4190 -3390
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -30
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/useViewerBuildingBlocks-ll3_ncCH.d.ts +378 -0
- package/dist/useViewerBuildingBlocks-ll3_ncCH.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +5118 -5224
- package/dist/viewer/index.js +20 -20
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +4 -4
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/Model3DScene-3YB3JAJS.js.gz +0 -0
- package/dist/Model3DScene-NLUSXHD6.mjs.br +0 -0
- package/dist/Model3DScene-NLUSXHD6.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-PUQ5DCO5.js.br +0 -0
- package/dist/SurfaceChart3DScene-PUQ5DCO5.js.gz +0 -0
- package/dist/SurfaceChart3DScene-YBMJQGH3.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-YBMJQGH3.mjs.gz +0 -0
- package/dist/chunk-3MZ7IARF.mjs.br +0 -0
- package/dist/chunk-3MZ7IARF.mjs.gz +0 -0
- package/dist/chunk-3ZGCM6RC.mjs.br +0 -0
- package/dist/chunk-3ZGCM6RC.mjs.gz +0 -0
- package/dist/chunk-5SBQZEKD.mjs.br +0 -0
- package/dist/chunk-5SBQZEKD.mjs.gz +0 -0
- package/dist/chunk-AD3EAEY6.js.br +0 -0
- package/dist/chunk-AD3EAEY6.js.gz +0 -0
- package/dist/chunk-JUFGTL2A.js.br +0 -0
- package/dist/chunk-JUFGTL2A.js.gz +0 -0
- package/dist/chunk-KA7ST7IH.js.br +0 -0
- package/dist/chunk-KA7ST7IH.js.gz +0 -0
- package/dist/chunk-OIAKQGMC.mjs.br +0 -0
- package/dist/chunk-OIAKQGMC.mjs.gz +0 -0
- package/dist/chunk-VSNXVKJI.js.br +0 -0
- package/dist/chunk-VSNXVKJI.js.gz +0 -0
- package/dist/dist-3YRZ26TL.mjs.br +0 -0
- package/dist/dist-3YRZ26TL.mjs.gz +0 -0
- package/dist/dist-M2P6HBG4.js.br +0 -0
- package/dist/dist-M2P6HBG4.js.gz +0 -0
- package/dist/index-SUL_8gq8.d.ts.map +0 -1
- package/dist/types-Cdh0XYcS.d.ts.map +0 -1
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKV3EOLP3_js = require('./chunk-KV3EOLP3.js');
|
|
4
4
|
var DOMPurify = require('dompurify');
|
|
5
5
|
|
|
6
6
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -108,6 +108,10 @@ var COLOR_KEY_TO_CSS = {
|
|
|
108
108
|
input: "input",
|
|
109
109
|
ring: "ring"
|
|
110
110
|
};
|
|
111
|
+
var DERIVED_COLOR_TOKENS = [
|
|
112
|
+
{ source: "primary", cssSuffix: "inspector-active" },
|
|
113
|
+
{ source: "border", cssSuffix: "inspector-border" }
|
|
114
|
+
];
|
|
111
115
|
function themeToCssVars(theme, omitDefaults = false) {
|
|
112
116
|
const vars = {};
|
|
113
117
|
if (!theme) {
|
|
@@ -126,6 +130,16 @@ function themeToCssVars(theme, omitDefaults = false) {
|
|
|
126
130
|
vars[`--pptx-${cssSuffix}`] = value;
|
|
127
131
|
vars[`--color-${cssSuffix}`] = value;
|
|
128
132
|
}
|
|
133
|
+
for (const { source, cssSuffix } of DERIVED_COLOR_TOKENS) {
|
|
134
|
+
const value = colors[source];
|
|
135
|
+
if (value === void 0) {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (omitDefaults && value === defaultThemeColors[source]) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
vars[`--pptx-${cssSuffix}`] = value;
|
|
142
|
+
}
|
|
129
143
|
}
|
|
130
144
|
if (theme.radius !== void 0) {
|
|
131
145
|
if (!omitDefaults || theme.radius !== defaultRadius) {
|
|
@@ -149,6 +163,9 @@ function defaultCssVars() {
|
|
|
149
163
|
for (const [key, cssSuffix] of Object.entries(COLOR_KEY_TO_CSS)) {
|
|
150
164
|
vars[`--pptx-${cssSuffix}`] = defaultThemeColors[key];
|
|
151
165
|
}
|
|
166
|
+
for (const { source, cssSuffix } of DERIVED_COLOR_TOKENS) {
|
|
167
|
+
vars[`--pptx-${cssSuffix}`] = defaultThemeColors[source];
|
|
168
|
+
}
|
|
152
169
|
vars["--pptx-radius"] = defaultRadius;
|
|
153
170
|
return vars;
|
|
154
171
|
}
|
|
@@ -290,7 +307,7 @@ function buildInitialGuides(presentationGuides, firstSlideGuides) {
|
|
|
290
307
|
guides.push({
|
|
291
308
|
id: g.id,
|
|
292
309
|
axis: g.orientation === "horz" ? "h" : "v",
|
|
293
|
-
position:
|
|
310
|
+
position: chunkKV3EOLP3_js.guideEmuToPx(g.positionEmu)
|
|
294
311
|
});
|
|
295
312
|
}
|
|
296
313
|
}
|
|
@@ -299,7 +316,7 @@ function buildInitialGuides(presentationGuides, firstSlideGuides) {
|
|
|
299
316
|
guides.push({
|
|
300
317
|
id: g.id,
|
|
301
318
|
axis: g.orientation === "horz" ? "h" : "v",
|
|
302
|
-
position:
|
|
319
|
+
position: chunkKV3EOLP3_js.guideEmuToPx(g.positionEmu)
|
|
303
320
|
});
|
|
304
321
|
}
|
|
305
322
|
}
|
|
@@ -312,23 +329,23 @@ function getResolvedShapeClipPathFor(shapeType, width, height, adjustments) {
|
|
|
312
329
|
return void 0;
|
|
313
330
|
}
|
|
314
331
|
if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) {
|
|
315
|
-
return
|
|
332
|
+
return chunkKV3EOLP3_js.getShapeClipPath(shapeType);
|
|
316
333
|
}
|
|
317
334
|
if (adjustments && Object.keys(adjustments).length > 0) {
|
|
318
|
-
const adjusted =
|
|
335
|
+
const adjusted = chunkKV3EOLP3_js.getAdjustmentAwareShapeClipPath(shapeType, width, height, adjustments);
|
|
319
336
|
if (adjusted !== void 0) {
|
|
320
337
|
return adjusted;
|
|
321
338
|
}
|
|
322
339
|
}
|
|
323
|
-
const fromPreset =
|
|
340
|
+
const fromPreset = chunkKV3EOLP3_js.getShapeClipPathFromPreset(shapeType, width, height, adjustments);
|
|
324
341
|
if (fromPreset !== void 0) {
|
|
325
342
|
return fromPreset;
|
|
326
343
|
}
|
|
327
|
-
const cloud =
|
|
344
|
+
const cloud = chunkKV3EOLP3_js.getCloudPathForRendering(shapeType, width, height);
|
|
328
345
|
if (cloud !== void 0) {
|
|
329
346
|
return cloud;
|
|
330
347
|
}
|
|
331
|
-
return
|
|
348
|
+
return chunkKV3EOLP3_js.getShapeClipPath(shapeType);
|
|
332
349
|
}
|
|
333
350
|
function getResolvedShapeClipPath(element, width, height) {
|
|
334
351
|
const shapeType = element.shapeType;
|
|
@@ -1043,7 +1060,7 @@ var DEFAULT_SCHEME_COLOR_MAP = {
|
|
|
1043
1060
|
phclr: "#4472C4"
|
|
1044
1061
|
};
|
|
1045
1062
|
function applyDrawingColorTransforms2(baseColor, colorNode) {
|
|
1046
|
-
return
|
|
1063
|
+
return chunkKV3EOLP3_js.applyDrawingColorTransforms(baseColor, colorNode);
|
|
1047
1064
|
}
|
|
1048
1065
|
function parseDrawingColorChoice(colorNode, schemeColorOverrides) {
|
|
1049
1066
|
if (!colorNode) {
|
|
@@ -1095,7 +1112,7 @@ function parseDrawingColorChoice(colorNode, schemeColorOverrides) {
|
|
|
1095
1112
|
const h = hueRaw / 6e4;
|
|
1096
1113
|
const s = clampUnitInterval(satRaw / 1e5);
|
|
1097
1114
|
const l = clampUnitInterval(lumRaw / 1e5);
|
|
1098
|
-
const rgb =
|
|
1115
|
+
const rgb = chunkKV3EOLP3_js.hslToRgb(h, s, l);
|
|
1099
1116
|
const toHex = (value) => Math.min(255, Math.max(0, Math.round(value))).toString(16).padStart(2, "0").toUpperCase();
|
|
1100
1117
|
const base = `#${toHex(rgb.r)}${toHex(rgb.g)}${toHex(rgb.b)}`;
|
|
1101
1118
|
return applyDrawingColorTransforms2(base, hslNode);
|
|
@@ -1105,7 +1122,7 @@ function parseDrawingColorChoice(colorNode, schemeColorOverrides) {
|
|
|
1105
1122
|
const preset = String(
|
|
1106
1123
|
colorNode["a:prstClr"]?.["@_val"] || ""
|
|
1107
1124
|
).toLowerCase();
|
|
1108
|
-
const mapped =
|
|
1125
|
+
const mapped = chunkKV3EOLP3_js.PRESET_COLOR_MAP[preset];
|
|
1109
1126
|
if (!mapped) {
|
|
1110
1127
|
return void 0;
|
|
1111
1128
|
}
|
|
@@ -1460,7 +1477,7 @@ function hexToRgbUnit2(hex) {
|
|
|
1460
1477
|
};
|
|
1461
1478
|
}
|
|
1462
1479
|
function getEffects(element) {
|
|
1463
|
-
if (!
|
|
1480
|
+
if (!chunkKV3EOLP3_js.isImageLikeElement(element)) {
|
|
1464
1481
|
return void 0;
|
|
1465
1482
|
}
|
|
1466
1483
|
return element.imageEffects;
|
|
@@ -1649,7 +1666,7 @@ function buildDuotoneFilterMarkup(color1, color2) {
|
|
|
1649
1666
|
const c2 = hexToRgbUnit2(color2);
|
|
1650
1667
|
return `<feColorMatrix type="matrix" values="${GRAYSCALE_LUMINANCE_MATRIX}"/><feComponentTransfer><feFuncR type="linear" slope="${c2.r - c1.r}" intercept="${c1.r}"/><feFuncG type="linear" slope="${c2.g - c1.g}" intercept="${c1.g}"/><feFuncB type="linear" slope="${c2.b - c1.b}" intercept="${c1.b}"/></feComponentTransfer>`;
|
|
1651
1668
|
}
|
|
1652
|
-
function getDuotoneImageFilter(element, elementId =
|
|
1669
|
+
function getDuotoneImageFilter(element, elementId = chunkKV3EOLP3_js.isImageLikeElement(element) ? element.id : "") {
|
|
1653
1670
|
const effects = getEffects(element);
|
|
1654
1671
|
if (!effects?.duotone) {
|
|
1655
1672
|
return void 0;
|
|
@@ -1751,7 +1768,7 @@ function buildImageAlphaFilterMarkup(effects) {
|
|
|
1751
1768
|
}
|
|
1752
1769
|
return parts.length > 0 ? parts.join("") : void 0;
|
|
1753
1770
|
}
|
|
1754
|
-
function getImageAlphaFilter(element, elementId =
|
|
1771
|
+
function getImageAlphaFilter(element, elementId = chunkKV3EOLP3_js.isImageLikeElement(element) ? element.id : "") {
|
|
1755
1772
|
const effects = getEffects(element);
|
|
1756
1773
|
if (!effects || !hasAdvancedImageAlphaEffects(element)) {
|
|
1757
1774
|
return void 0;
|
|
@@ -1841,7 +1858,7 @@ function buildArtisticFilterMarkup(effectName, radius) {
|
|
|
1841
1858
|
return void 0;
|
|
1842
1859
|
}
|
|
1843
1860
|
}
|
|
1844
|
-
function getArtisticImageFilter(element, elementId =
|
|
1861
|
+
function getArtisticImageFilter(element, elementId = chunkKV3EOLP3_js.isImageLikeElement(element) ? element.id : "") {
|
|
1845
1862
|
const effects = getEffects(element);
|
|
1846
1863
|
if (!effects?.artisticEffect || !needsSvgArtisticFilter(effects.artisticEffect)) {
|
|
1847
1864
|
return void 0;
|
|
@@ -2800,12 +2817,13 @@ function convertChildren(node) {
|
|
|
2800
2817
|
if (key.startsWith("@_")) {
|
|
2801
2818
|
continue;
|
|
2802
2819
|
}
|
|
2803
|
-
|
|
2820
|
+
const tag = chunkKV3EOLP3_js.stripXmlOrderSuffix(key);
|
|
2821
|
+
if (tag === "m:oMathPara") {
|
|
2804
2822
|
continue;
|
|
2805
2823
|
}
|
|
2806
2824
|
const items = ensureArray(node[key]);
|
|
2807
2825
|
for (const item of items) {
|
|
2808
|
-
const result = convertElement(
|
|
2826
|
+
const result = convertElement(tag, item);
|
|
2809
2827
|
if (result) {
|
|
2810
2828
|
parts.push(result);
|
|
2811
2829
|
}
|
|
@@ -2870,7 +2888,8 @@ function findOmathRoots(node) {
|
|
|
2870
2888
|
return ensureArray(paraNode["m:oMath"]);
|
|
2871
2889
|
}
|
|
2872
2890
|
}
|
|
2873
|
-
|
|
2891
|
+
const contentTags = /* @__PURE__ */ new Set(["m:r", "m:f", "m:rad", "m:sSup", "m:sSub", "m:box"]);
|
|
2892
|
+
if (Object.keys(node).some((key) => contentTags.has(chunkKV3EOLP3_js.stripXmlOrderSuffix(key)))) {
|
|
2874
2893
|
return [node];
|
|
2875
2894
|
}
|
|
2876
2895
|
return [];
|
|
@@ -3052,6 +3071,53 @@ function tokenize(latex) {
|
|
|
3052
3071
|
}
|
|
3053
3072
|
return tokens;
|
|
3054
3073
|
}
|
|
3074
|
+
function isGroupedByTag(tags) {
|
|
3075
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3076
|
+
let previous = "";
|
|
3077
|
+
for (const tag of tags) {
|
|
3078
|
+
if (tag !== previous && seen.has(tag)) {
|
|
3079
|
+
return false;
|
|
3080
|
+
}
|
|
3081
|
+
seen.add(tag);
|
|
3082
|
+
previous = tag;
|
|
3083
|
+
}
|
|
3084
|
+
return true;
|
|
3085
|
+
}
|
|
3086
|
+
function mergeSiblings(nodes) {
|
|
3087
|
+
const entries = [];
|
|
3088
|
+
for (const node of nodes) {
|
|
3089
|
+
for (const key of Object.keys(node)) {
|
|
3090
|
+
if (node[key] !== void 0) {
|
|
3091
|
+
entries.push([key, node[key]]);
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
}
|
|
3095
|
+
if (!isGroupedByTag(entries.map(([key]) => key))) {
|
|
3096
|
+
const counts = /* @__PURE__ */ new Map();
|
|
3097
|
+
for (const [key] of entries) {
|
|
3098
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
3099
|
+
}
|
|
3100
|
+
const ordered = {};
|
|
3101
|
+
for (const [position, [key, value]] of entries.entries()) {
|
|
3102
|
+
ordered[(counts.get(key) ?? 0) > 1 ? chunkKV3EOLP3_js.orderedXmlKey(key, position) : key] = value;
|
|
3103
|
+
}
|
|
3104
|
+
return ordered;
|
|
3105
|
+
}
|
|
3106
|
+
const result = {};
|
|
3107
|
+
for (const [key, value] of entries) {
|
|
3108
|
+
if (result[key]) {
|
|
3109
|
+
const existing = result[key];
|
|
3110
|
+
if (Array.isArray(existing)) {
|
|
3111
|
+
existing.push(value);
|
|
3112
|
+
} else {
|
|
3113
|
+
result[key] = [existing, value];
|
|
3114
|
+
}
|
|
3115
|
+
} else {
|
|
3116
|
+
result[key] = value;
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
3119
|
+
return result;
|
|
3120
|
+
}
|
|
3055
3121
|
function tryParseScripts(ctx, base) {
|
|
3056
3122
|
let hasSup = false;
|
|
3057
3123
|
let hasSub = false;
|
|
@@ -3224,34 +3290,9 @@ var LatexParser = class {
|
|
|
3224
3290
|
}
|
|
3225
3291
|
wrapE(nodes) {
|
|
3226
3292
|
if (nodes.length === 1) {
|
|
3227
|
-
return
|
|
3228
|
-
"m:r": nodes[0]["m:r"],
|
|
3229
|
-
"m:f": nodes[0]["m:f"],
|
|
3230
|
-
"m:rad": nodes[0]["m:rad"],
|
|
3231
|
-
"m:sSup": nodes[0]["m:sSup"],
|
|
3232
|
-
"m:sSub": nodes[0]["m:sSub"],
|
|
3233
|
-
"m:sSubSup": nodes[0]["m:sSubSup"],
|
|
3234
|
-
"m:nary": nodes[0]["m:nary"],
|
|
3235
|
-
"m:d": nodes[0]["m:d"],
|
|
3236
|
-
"m:func": nodes[0]["m:func"]
|
|
3237
|
-
};
|
|
3293
|
+
return nodes[0];
|
|
3238
3294
|
}
|
|
3239
|
-
|
|
3240
|
-
for (const n of nodes) {
|
|
3241
|
-
for (const key of Object.keys(n)) {
|
|
3242
|
-
if (result[key]) {
|
|
3243
|
-
const existing = result[key];
|
|
3244
|
-
if (Array.isArray(existing)) {
|
|
3245
|
-
existing.push(n[key]);
|
|
3246
|
-
} else {
|
|
3247
|
-
result[key] = [existing, n[key]];
|
|
3248
|
-
}
|
|
3249
|
-
} else {
|
|
3250
|
-
result[key] = n[key];
|
|
3251
|
-
}
|
|
3252
|
-
}
|
|
3253
|
-
}
|
|
3254
|
-
return result;
|
|
3295
|
+
return mergeSiblings(nodes);
|
|
3255
3296
|
}
|
|
3256
3297
|
makeRun(text, normal = false) {
|
|
3257
3298
|
const run = { "m:t": text };
|
|
@@ -3398,21 +3439,7 @@ function convertLatexToOmml(latex) {
|
|
|
3398
3439
|
if (nodes.length === 0) {
|
|
3399
3440
|
return {};
|
|
3400
3441
|
}
|
|
3401
|
-
const oMath =
|
|
3402
|
-
for (const node of nodes) {
|
|
3403
|
-
for (const key of Object.keys(node)) {
|
|
3404
|
-
if (oMath[key]) {
|
|
3405
|
-
const existing = oMath[key];
|
|
3406
|
-
if (Array.isArray(existing)) {
|
|
3407
|
-
existing.push(node[key]);
|
|
3408
|
-
} else {
|
|
3409
|
-
oMath[key] = [existing, node[key]];
|
|
3410
|
-
}
|
|
3411
|
-
} else {
|
|
3412
|
-
oMath[key] = node[key];
|
|
3413
|
-
}
|
|
3414
|
-
}
|
|
3415
|
-
}
|
|
3442
|
+
const oMath = mergeSiblings(nodes);
|
|
3416
3443
|
return {
|
|
3417
3444
|
"m:oMathPara": {
|
|
3418
3445
|
"m:oMath": oMath
|
|
@@ -3476,9 +3503,10 @@ function ommlChildrenToLatex(node) {
|
|
|
3476
3503
|
if (key.startsWith("@_")) {
|
|
3477
3504
|
continue;
|
|
3478
3505
|
}
|
|
3506
|
+
const tag = chunkKV3EOLP3_js.stripXmlOrderSuffix(key);
|
|
3479
3507
|
const items = ensureArr(node[key]);
|
|
3480
3508
|
for (const item of items) {
|
|
3481
|
-
const result = ommlElementToLatex(
|
|
3509
|
+
const result = ommlElementToLatex(tag, item);
|
|
3482
3510
|
if (result) {
|
|
3483
3511
|
parts.push(result);
|
|
3484
3512
|
}
|
|
@@ -3576,6 +3604,10 @@ function ommlElementToLatex(tag, node) {
|
|
|
3576
3604
|
const body = ommlChildrenToLatex(childNode(node, "m:e"));
|
|
3577
3605
|
return `${fName}{${body}}`;
|
|
3578
3606
|
}
|
|
3607
|
+
case "m:box":
|
|
3608
|
+
case "m:borderBox": {
|
|
3609
|
+
return ensureArr(node["m:e"]).map((e) => ommlChildrenToLatex(e)).join("");
|
|
3610
|
+
}
|
|
3579
3611
|
case "m:oMath":
|
|
3580
3612
|
return ommlChildrenToLatex(node);
|
|
3581
3613
|
default:
|
|
@@ -3597,6 +3629,68 @@ function convertOmmlToLatex(omml) {
|
|
|
3597
3629
|
}
|
|
3598
3630
|
return ommlChildrenToLatex(oMath);
|
|
3599
3631
|
}
|
|
3632
|
+
var EQUATION_TEMPLATES = [
|
|
3633
|
+
{
|
|
3634
|
+
label: "Fraction",
|
|
3635
|
+
latex: "\\frac{a}{b}",
|
|
3636
|
+
i18nKey: "pptx.equation.template.fraction"
|
|
3637
|
+
},
|
|
3638
|
+
{
|
|
3639
|
+
label: "Quadratic",
|
|
3640
|
+
latex: "x=\\frac{-b\\pm\\sqrt{b^{2}-4ac}}{2a}",
|
|
3641
|
+
i18nKey: "pptx.equation.template.quadratic"
|
|
3642
|
+
},
|
|
3643
|
+
{
|
|
3644
|
+
label: "Pythagorean",
|
|
3645
|
+
latex: "a^{2}+b^{2}=c^{2}",
|
|
3646
|
+
i18nKey: "pptx.equation.template.pythagorean"
|
|
3647
|
+
},
|
|
3648
|
+
{
|
|
3649
|
+
label: "Sum",
|
|
3650
|
+
latex: "\\sum_{i=1}^{n}{a_{i}}",
|
|
3651
|
+
i18nKey: "pptx.equation.template.sum"
|
|
3652
|
+
},
|
|
3653
|
+
{
|
|
3654
|
+
label: "Integral",
|
|
3655
|
+
latex: "\\int_{a}^{b}{f(x)}dx",
|
|
3656
|
+
i18nKey: "pptx.equation.template.integral"
|
|
3657
|
+
},
|
|
3658
|
+
{
|
|
3659
|
+
label: "Square Root",
|
|
3660
|
+
latex: "\\sqrt{x^{2}+y^{2}}",
|
|
3661
|
+
i18nKey: "pptx.equation.template.squareRoot"
|
|
3662
|
+
},
|
|
3663
|
+
{
|
|
3664
|
+
label: "Limit",
|
|
3665
|
+
latex: "\\lim_{x\\to\\infty}{f(x)}",
|
|
3666
|
+
i18nKey: "pptx.equation.template.limit"
|
|
3667
|
+
},
|
|
3668
|
+
{
|
|
3669
|
+
label: "Euler's",
|
|
3670
|
+
latex: "e^{i\\pi}+1=0",
|
|
3671
|
+
i18nKey: "pptx.equation.template.euler"
|
|
3672
|
+
},
|
|
3673
|
+
{
|
|
3674
|
+
label: "Matrix 2x2",
|
|
3675
|
+
latex: "\\left[a,b;c,d\\right]",
|
|
3676
|
+
i18nKey: "pptx.equation.template.matrix"
|
|
3677
|
+
},
|
|
3678
|
+
{
|
|
3679
|
+
label: "Binomial",
|
|
3680
|
+
latex: "\\left(a+b\\right)^{n}",
|
|
3681
|
+
i18nKey: "pptx.equation.template.binomial"
|
|
3682
|
+
},
|
|
3683
|
+
{
|
|
3684
|
+
label: "Derivative",
|
|
3685
|
+
latex: "\\frac{dy}{dx}",
|
|
3686
|
+
i18nKey: "pptx.equation.template.derivative"
|
|
3687
|
+
},
|
|
3688
|
+
{
|
|
3689
|
+
label: "Trig Identity",
|
|
3690
|
+
latex: "\\sin^{2}\\theta+\\cos^{2}\\theta=1",
|
|
3691
|
+
i18nKey: "pptx.equation.template.trigIdentity"
|
|
3692
|
+
}
|
|
3693
|
+
];
|
|
3600
3694
|
var ACCENT1 = "#4472C4";
|
|
3601
3695
|
var ACCENT2 = "#ED7D31";
|
|
3602
3696
|
var ACCENT3 = "#A5A5A5";
|
|
@@ -12018,7 +12112,7 @@ function rotateDelta(dx, dy, rotationDeg) {
|
|
|
12018
12112
|
}
|
|
12019
12113
|
function applyResize(box, handle, dxScreen, dyScreen, zoom, opts = {}) {
|
|
12020
12114
|
const scale = zoom || 1;
|
|
12021
|
-
const minSize = opts.minSize ??
|
|
12115
|
+
const minSize = opts.minSize ?? chunkKV3EOLP3_js.MIN_ELEMENT_SIZE;
|
|
12022
12116
|
const rotation = rotationOf(box);
|
|
12023
12117
|
const local = rotateDelta(dxScreen / scale, dyScreen / scale, rotation);
|
|
12024
12118
|
const dx = local.x;
|
|
@@ -12045,7 +12139,7 @@ function applyResize(box, handle, dxScreen, dyScreen, zoom, opts = {}) {
|
|
|
12045
12139
|
}
|
|
12046
12140
|
return { x: newX, y: newY, width: newW, height: newH, rotation };
|
|
12047
12141
|
}
|
|
12048
|
-
function snapBoxToGrid(box, handle, gridSpacingPx, minSize =
|
|
12142
|
+
function snapBoxToGrid(box, handle, gridSpacingPx, minSize = chunkKV3EOLP3_js.MIN_ELEMENT_SIZE) {
|
|
12049
12143
|
if (handle === null || gridSpacingPx <= 0) {
|
|
12050
12144
|
return box;
|
|
12051
12145
|
}
|
|
@@ -12075,7 +12169,7 @@ function snapBoxToGrid(box, handle, gridSpacingPx, minSize = chunkAD3EAEY6_js.MI
|
|
|
12075
12169
|
}
|
|
12076
12170
|
return { x, y, width, height };
|
|
12077
12171
|
}
|
|
12078
|
-
function computeMarqueeHitIds(marquee, elements, minSize =
|
|
12172
|
+
function computeMarqueeHitIds(marquee, elements, minSize = chunkKV3EOLP3_js.MIN_ELEMENT_SIZE) {
|
|
12079
12173
|
const minX = Math.min(marquee.startX, marquee.currentX);
|
|
12080
12174
|
const minY = Math.min(marquee.startY, marquee.currentY);
|
|
12081
12175
|
const maxX = Math.max(marquee.startX, marquee.currentX);
|
|
@@ -13630,7 +13724,7 @@ var THEME_COLOR_LABELS = {
|
|
|
13630
13724
|
};
|
|
13631
13725
|
function buildThemeColorGrid(colorScheme) {
|
|
13632
13726
|
return THEME_COLOR_TINT_ROWS.map(
|
|
13633
|
-
(row) =>
|
|
13727
|
+
(row) => chunkKV3EOLP3_js.THEME_COLOR_SCHEME_KEYS.map((key) => ({
|
|
13634
13728
|
hex: row.transform(colorScheme[key]),
|
|
13635
13729
|
schemeKey: key,
|
|
13636
13730
|
rowLabel: row.label,
|
|
@@ -14106,7 +14200,7 @@ function svgLineCap(lineCap) {
|
|
|
14106
14200
|
}
|
|
14107
14201
|
function copyFormatFromElement(element) {
|
|
14108
14202
|
const result = {};
|
|
14109
|
-
if (
|
|
14203
|
+
if (chunkKV3EOLP3_js.hasShapeProperties(element) && element.shapeStyle) {
|
|
14110
14204
|
const s = element.shapeStyle;
|
|
14111
14205
|
result.shapeStyle = {
|
|
14112
14206
|
fillColor: s.fillColor,
|
|
@@ -14135,7 +14229,7 @@ function copyFormatFromElement(element) {
|
|
|
14135
14229
|
softEdgeRadius: s.softEdgeRadius
|
|
14136
14230
|
};
|
|
14137
14231
|
}
|
|
14138
|
-
if (
|
|
14232
|
+
if (chunkKV3EOLP3_js.hasTextProperties(element) && element.textStyle) {
|
|
14139
14233
|
const t = element.textStyle;
|
|
14140
14234
|
result.textStyle = {
|
|
14141
14235
|
fontFamily: t.fontFamily,
|
|
@@ -14166,7 +14260,7 @@ function definedEntries(obj) {
|
|
|
14166
14260
|
}
|
|
14167
14261
|
function applyFormatToElement(element, format) {
|
|
14168
14262
|
let updated = { ...element };
|
|
14169
|
-
if (format.shapeStyle &&
|
|
14263
|
+
if (format.shapeStyle && chunkKV3EOLP3_js.hasShapeProperties(updated)) {
|
|
14170
14264
|
updated = {
|
|
14171
14265
|
...updated,
|
|
14172
14266
|
shapeStyle: {
|
|
@@ -14175,7 +14269,7 @@ function applyFormatToElement(element, format) {
|
|
|
14175
14269
|
}
|
|
14176
14270
|
};
|
|
14177
14271
|
}
|
|
14178
|
-
if (format.textStyle &&
|
|
14272
|
+
if (format.textStyle && chunkKV3EOLP3_js.hasTextProperties(updated)) {
|
|
14179
14273
|
updated = {
|
|
14180
14274
|
...updated,
|
|
14181
14275
|
textStyle: {
|
|
@@ -14190,7 +14284,7 @@ function hasCopyableFormat(element) {
|
|
|
14190
14284
|
if (!element) {
|
|
14191
14285
|
return false;
|
|
14192
14286
|
}
|
|
14193
|
-
return
|
|
14287
|
+
return chunkKV3EOLP3_js.hasShapeProperties(element) || chunkKV3EOLP3_js.hasTextProperties(element);
|
|
14194
14288
|
}
|
|
14195
14289
|
function copySegmentMetadata(from, to) {
|
|
14196
14290
|
if (from.equationXml !== void 0) {
|
|
@@ -14327,7 +14421,7 @@ function getRoundRectRadiusPx(element) {
|
|
|
14327
14421
|
return Math.min(Math.max(element.width, 1), Math.max(element.height, 1)) * 0.5 * normalizedAdjustment;
|
|
14328
14422
|
}
|
|
14329
14423
|
function getShapeAdjustmentHandleDescriptor(element) {
|
|
14330
|
-
if (!
|
|
14424
|
+
if (!chunkKV3EOLP3_js.hasShapeProperties(element)) {
|
|
14331
14425
|
return null;
|
|
14332
14426
|
}
|
|
14333
14427
|
const normalizedShapeType = String(element.shapeType || "").toLowerCase();
|
|
@@ -15318,7 +15412,7 @@ function createSyncGate(onOpen, graceMs = INITIAL_SYNC_GRACE_MS) {
|
|
|
15318
15412
|
var POSITION_THRESHOLD = 2;
|
|
15319
15413
|
var SIZE_THRESHOLD = 2;
|
|
15320
15414
|
function getElementText(element) {
|
|
15321
|
-
if (!
|
|
15415
|
+
if (!chunkKV3EOLP3_js.hasTextProperties(element)) {
|
|
15322
15416
|
return "";
|
|
15323
15417
|
}
|
|
15324
15418
|
if (element.textSegments && element.textSegments.length > 0) {
|
|
@@ -18892,7 +18986,7 @@ function getAriaRole(element) {
|
|
|
18892
18986
|
case "model3d":
|
|
18893
18987
|
return "img";
|
|
18894
18988
|
case "shape": {
|
|
18895
|
-
if (
|
|
18989
|
+
if (chunkKV3EOLP3_js.hasTextProperties(element) && element.text) {
|
|
18896
18990
|
return "group";
|
|
18897
18991
|
}
|
|
18898
18992
|
return "img";
|
|
@@ -18905,7 +18999,7 @@ function getAriaLabel(element) {
|
|
|
18905
18999
|
if ((element.type === "image" || element.type === "picture") && "altText" in element && typeof element.altText === "string" && element.altText.trim()) {
|
|
18906
19000
|
return element.altText.trim();
|
|
18907
19001
|
}
|
|
18908
|
-
if (
|
|
19002
|
+
if (chunkKV3EOLP3_js.hasTextProperties(element) && element.text) {
|
|
18909
19003
|
const text = element.text.trim();
|
|
18910
19004
|
if (text) {
|
|
18911
19005
|
return text.length > 120 ? `${text.slice(0, 117)}...` : text;
|
|
@@ -19312,7 +19406,7 @@ var DEFAULT_CHART_POSITION = { x: 120, y: 120, width: 480, height: 320 };
|
|
|
19312
19406
|
var DEFAULT_CATEGORIES = ["Category 1", "Category 2", "Category 3"];
|
|
19313
19407
|
var DEFAULT_SERIES_VALUES = [4, 3, 5];
|
|
19314
19408
|
function createDefaultChartElement(chartType = DEFAULT_INSERT_CHART_TYPE, position) {
|
|
19315
|
-
return
|
|
19409
|
+
return chunkKV3EOLP3_js.createChartElement(
|
|
19316
19410
|
chartType,
|
|
19317
19411
|
{
|
|
19318
19412
|
categories: [...DEFAULT_CATEGORIES],
|
|
@@ -20332,7 +20426,7 @@ function computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight,
|
|
|
20332
20426
|
};
|
|
20333
20427
|
}
|
|
20334
20428
|
function collectFontsFromElement(element, fonts) {
|
|
20335
|
-
if (
|
|
20429
|
+
if (chunkKV3EOLP3_js.hasTextProperties(element)) {
|
|
20336
20430
|
if (element.textStyle?.fontFamily) {
|
|
20337
20431
|
fonts.add(element.textStyle.fontFamily);
|
|
20338
20432
|
}
|
|
@@ -22154,6 +22248,7 @@ exports.DEFAULT_VIEWER_PROFILE = DEFAULT_VIEWER_PROFILE;
|
|
|
22154
22248
|
exports.DEFAULT_VIRTUAL_OVERSCAN = DEFAULT_VIRTUAL_OVERSCAN;
|
|
22155
22249
|
exports.DIRECTIONAL_PRESETS = DIRECTIONAL_PRESETS;
|
|
22156
22250
|
exports.DUOTONE_PRESETS = DUOTONE_PRESETS;
|
|
22251
|
+
exports.EQUATION_TEMPLATES = EQUATION_TEMPLATES;
|
|
22157
22252
|
exports.EXPORT_ASSEMBLING_PERCENT = EXPORT_ASSEMBLING_PERCENT;
|
|
22158
22253
|
exports.EXPORT_DONE_PERCENT = EXPORT_DONE_PERCENT;
|
|
22159
22254
|
exports.FILL_MODE_OPTIONS = FILL_MODE_OPTIONS;
|
|
Binary file
|
|
Binary file
|