pptx-react-viewer 1.23.0 → 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 +6 -0
- package/README.md +27 -0
- package/dist/{Model3DScene-4XNBDASE.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-AQS7KDM4.js → Model3DScene-RD4XEC3F.js} +3 -3
- package/dist/Model3DScene-RD4XEC3F.js.br +0 -0
- package/dist/Model3DScene-RD4XEC3F.js.gz +0 -0
- package/dist/{PowerPointViewer-DFTatVS4.d.ts → PowerPointViewer-CnADroqZ.d.ts} +2 -2
- package/dist/{PowerPointViewer-DFTatVS4.d.ts.map → PowerPointViewer-CnADroqZ.d.ts.map} +1 -1
- package/dist/{SurfaceChart3DScene-K7ZDXDBL.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-HA2SD6BY.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-Da1M5VBY.d.ts → animation-timeline-CEJJLFqK.d.ts} +3 -3
- package/dist/animation-timeline-CEJJLFqK.d.ts.map +1 -0
- package/dist/{chunk-LS2AIX2H.js → chunk-3YMK5VLS.js} +26707 -26744
- package/dist/chunk-3YMK5VLS.js.br +0 -0
- package/dist/chunk-3YMK5VLS.js.gz +0 -0
- package/dist/{chunk-H5RREYCO.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-2DXNTVFV.js → chunk-I5SO5OV4.js} +69 -71
- package/dist/chunk-I5SO5OV4.js.br +0 -0
- package/dist/chunk-I5SO5OV4.js.gz +0 -0
- package/dist/{chunk-I42XL2WU.mjs → chunk-KPT54MHG.mjs} +40 -42
- package/dist/chunk-KPT54MHG.mjs.br +0 -0
- package/dist/chunk-KPT54MHG.mjs.gz +0 -0
- package/dist/{chunk-MS6S6YYR.js → chunk-KV3EOLP3.js} +50785 -50553
- package/dist/chunk-KV3EOLP3.js.br +0 -0
- package/dist/chunk-KV3EOLP3.js.gz +0 -0
- package/dist/{chunk-AFWMAFWR.mjs → chunk-LDZQNYWL.mjs} +50784 -50554
- package/dist/chunk-LDZQNYWL.mjs.br +0 -0
- package/dist/chunk-LDZQNYWL.mjs.gz +0 -0
- package/dist/{chunk-36NC56XG.mjs → chunk-PUQ6GIOM.mjs} +26099 -26138
- package/dist/chunk-PUQ6GIOM.mjs.br +0 -0
- package/dist/chunk-PUQ6GIOM.mjs.gz +0 -0
- package/dist/{chunk-LFEVG3ED.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-5KQQ6GP2.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-CVSSAFDL.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 +407 -37
- 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/{index-COgh2UTL.d.ts → index-hm2FF-FU.d.ts} +3 -3
- package/dist/{index-COgh2UTL.d.ts.map → index-hm2FF-FU.d.ts.map} +1 -1
- package/dist/index.d.ts +865 -7
- 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/useViewerBuildingBlocks-ll3_ncCH.d.ts +378 -0
- package/dist/useViewerBuildingBlocks-ll3_ncCH.d.ts.map +1 -0
- 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-4XNBDASE.mjs.br +0 -0
- package/dist/Model3DScene-4XNBDASE.mjs.gz +0 -0
- package/dist/Model3DScene-AQS7KDM4.js.br +0 -0
- package/dist/Model3DScene-AQS7KDM4.js.gz +0 -0
- package/dist/SurfaceChart3DScene-HA2SD6BY.js.br +0 -0
- package/dist/SurfaceChart3DScene-HA2SD6BY.js.gz +0 -0
- package/dist/SurfaceChart3DScene-K7ZDXDBL.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-K7ZDXDBL.mjs.gz +0 -0
- package/dist/chunk-2DXNTVFV.js.br +0 -0
- package/dist/chunk-2DXNTVFV.js.gz +0 -0
- package/dist/chunk-36NC56XG.mjs.br +0 -0
- package/dist/chunk-36NC56XG.mjs.gz +0 -0
- package/dist/chunk-AFWMAFWR.mjs.br +0 -0
- package/dist/chunk-AFWMAFWR.mjs.gz +0 -0
- package/dist/chunk-H5RREYCO.js.br +0 -0
- package/dist/chunk-H5RREYCO.js.gz +0 -0
- package/dist/chunk-I42XL2WU.mjs.br +0 -0
- package/dist/chunk-I42XL2WU.mjs.gz +0 -0
- package/dist/chunk-LFEVG3ED.mjs.br +0 -0
- package/dist/chunk-LFEVG3ED.mjs.gz +0 -0
- package/dist/chunk-LS2AIX2H.js.br +0 -0
- package/dist/chunk-LS2AIX2H.js.gz +0 -0
- package/dist/chunk-MS6S6YYR.js.br +0 -0
- package/dist/chunk-MS6S6YYR.js.gz +0 -0
- package/dist/dist-5KQQ6GP2.mjs.br +0 -0
- package/dist/dist-5KQQ6GP2.mjs.gz +0 -0
- package/dist/dist-CVSSAFDL.js.br +0 -0
- package/dist/dist-CVSSAFDL.js.gz +0 -0
- package/dist/types-Da1M5VBY.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 }; }
|
|
@@ -307,7 +307,7 @@ function buildInitialGuides(presentationGuides, firstSlideGuides) {
|
|
|
307
307
|
guides.push({
|
|
308
308
|
id: g.id,
|
|
309
309
|
axis: g.orientation === "horz" ? "h" : "v",
|
|
310
|
-
position:
|
|
310
|
+
position: chunkKV3EOLP3_js.guideEmuToPx(g.positionEmu)
|
|
311
311
|
});
|
|
312
312
|
}
|
|
313
313
|
}
|
|
@@ -316,7 +316,7 @@ function buildInitialGuides(presentationGuides, firstSlideGuides) {
|
|
|
316
316
|
guides.push({
|
|
317
317
|
id: g.id,
|
|
318
318
|
axis: g.orientation === "horz" ? "h" : "v",
|
|
319
|
-
position:
|
|
319
|
+
position: chunkKV3EOLP3_js.guideEmuToPx(g.positionEmu)
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
322
|
}
|
|
@@ -329,23 +329,23 @@ function getResolvedShapeClipPathFor(shapeType, width, height, adjustments) {
|
|
|
329
329
|
return void 0;
|
|
330
330
|
}
|
|
331
331
|
if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) {
|
|
332
|
-
return
|
|
332
|
+
return chunkKV3EOLP3_js.getShapeClipPath(shapeType);
|
|
333
333
|
}
|
|
334
334
|
if (adjustments && Object.keys(adjustments).length > 0) {
|
|
335
|
-
const adjusted =
|
|
335
|
+
const adjusted = chunkKV3EOLP3_js.getAdjustmentAwareShapeClipPath(shapeType, width, height, adjustments);
|
|
336
336
|
if (adjusted !== void 0) {
|
|
337
337
|
return adjusted;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
const fromPreset =
|
|
340
|
+
const fromPreset = chunkKV3EOLP3_js.getShapeClipPathFromPreset(shapeType, width, height, adjustments);
|
|
341
341
|
if (fromPreset !== void 0) {
|
|
342
342
|
return fromPreset;
|
|
343
343
|
}
|
|
344
|
-
const cloud =
|
|
344
|
+
const cloud = chunkKV3EOLP3_js.getCloudPathForRendering(shapeType, width, height);
|
|
345
345
|
if (cloud !== void 0) {
|
|
346
346
|
return cloud;
|
|
347
347
|
}
|
|
348
|
-
return
|
|
348
|
+
return chunkKV3EOLP3_js.getShapeClipPath(shapeType);
|
|
349
349
|
}
|
|
350
350
|
function getResolvedShapeClipPath(element, width, height) {
|
|
351
351
|
const shapeType = element.shapeType;
|
|
@@ -1060,7 +1060,7 @@ var DEFAULT_SCHEME_COLOR_MAP = {
|
|
|
1060
1060
|
phclr: "#4472C4"
|
|
1061
1061
|
};
|
|
1062
1062
|
function applyDrawingColorTransforms2(baseColor, colorNode) {
|
|
1063
|
-
return
|
|
1063
|
+
return chunkKV3EOLP3_js.applyDrawingColorTransforms(baseColor, colorNode);
|
|
1064
1064
|
}
|
|
1065
1065
|
function parseDrawingColorChoice(colorNode, schemeColorOverrides) {
|
|
1066
1066
|
if (!colorNode) {
|
|
@@ -1112,7 +1112,7 @@ function parseDrawingColorChoice(colorNode, schemeColorOverrides) {
|
|
|
1112
1112
|
const h = hueRaw / 6e4;
|
|
1113
1113
|
const s = clampUnitInterval(satRaw / 1e5);
|
|
1114
1114
|
const l = clampUnitInterval(lumRaw / 1e5);
|
|
1115
|
-
const rgb =
|
|
1115
|
+
const rgb = chunkKV3EOLP3_js.hslToRgb(h, s, l);
|
|
1116
1116
|
const toHex = (value) => Math.min(255, Math.max(0, Math.round(value))).toString(16).padStart(2, "0").toUpperCase();
|
|
1117
1117
|
const base = `#${toHex(rgb.r)}${toHex(rgb.g)}${toHex(rgb.b)}`;
|
|
1118
1118
|
return applyDrawingColorTransforms2(base, hslNode);
|
|
@@ -1122,7 +1122,7 @@ function parseDrawingColorChoice(colorNode, schemeColorOverrides) {
|
|
|
1122
1122
|
const preset = String(
|
|
1123
1123
|
colorNode["a:prstClr"]?.["@_val"] || ""
|
|
1124
1124
|
).toLowerCase();
|
|
1125
|
-
const mapped =
|
|
1125
|
+
const mapped = chunkKV3EOLP3_js.PRESET_COLOR_MAP[preset];
|
|
1126
1126
|
if (!mapped) {
|
|
1127
1127
|
return void 0;
|
|
1128
1128
|
}
|
|
@@ -1477,7 +1477,7 @@ function hexToRgbUnit2(hex) {
|
|
|
1477
1477
|
};
|
|
1478
1478
|
}
|
|
1479
1479
|
function getEffects(element) {
|
|
1480
|
-
if (!
|
|
1480
|
+
if (!chunkKV3EOLP3_js.isImageLikeElement(element)) {
|
|
1481
1481
|
return void 0;
|
|
1482
1482
|
}
|
|
1483
1483
|
return element.imageEffects;
|
|
@@ -1666,7 +1666,7 @@ function buildDuotoneFilterMarkup(color1, color2) {
|
|
|
1666
1666
|
const c2 = hexToRgbUnit2(color2);
|
|
1667
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>`;
|
|
1668
1668
|
}
|
|
1669
|
-
function getDuotoneImageFilter(element, elementId =
|
|
1669
|
+
function getDuotoneImageFilter(element, elementId = chunkKV3EOLP3_js.isImageLikeElement(element) ? element.id : "") {
|
|
1670
1670
|
const effects = getEffects(element);
|
|
1671
1671
|
if (!effects?.duotone) {
|
|
1672
1672
|
return void 0;
|
|
@@ -1768,7 +1768,7 @@ function buildImageAlphaFilterMarkup(effects) {
|
|
|
1768
1768
|
}
|
|
1769
1769
|
return parts.length > 0 ? parts.join("") : void 0;
|
|
1770
1770
|
}
|
|
1771
|
-
function getImageAlphaFilter(element, elementId =
|
|
1771
|
+
function getImageAlphaFilter(element, elementId = chunkKV3EOLP3_js.isImageLikeElement(element) ? element.id : "") {
|
|
1772
1772
|
const effects = getEffects(element);
|
|
1773
1773
|
if (!effects || !hasAdvancedImageAlphaEffects(element)) {
|
|
1774
1774
|
return void 0;
|
|
@@ -1858,7 +1858,7 @@ function buildArtisticFilterMarkup(effectName, radius) {
|
|
|
1858
1858
|
return void 0;
|
|
1859
1859
|
}
|
|
1860
1860
|
}
|
|
1861
|
-
function getArtisticImageFilter(element, elementId =
|
|
1861
|
+
function getArtisticImageFilter(element, elementId = chunkKV3EOLP3_js.isImageLikeElement(element) ? element.id : "") {
|
|
1862
1862
|
const effects = getEffects(element);
|
|
1863
1863
|
if (!effects?.artisticEffect || !needsSvgArtisticFilter(effects.artisticEffect)) {
|
|
1864
1864
|
return void 0;
|
|
@@ -2817,12 +2817,13 @@ function convertChildren(node) {
|
|
|
2817
2817
|
if (key.startsWith("@_")) {
|
|
2818
2818
|
continue;
|
|
2819
2819
|
}
|
|
2820
|
-
|
|
2820
|
+
const tag = chunkKV3EOLP3_js.stripXmlOrderSuffix(key);
|
|
2821
|
+
if (tag === "m:oMathPara") {
|
|
2821
2822
|
continue;
|
|
2822
2823
|
}
|
|
2823
2824
|
const items = ensureArray(node[key]);
|
|
2824
2825
|
for (const item of items) {
|
|
2825
|
-
const result = convertElement(
|
|
2826
|
+
const result = convertElement(tag, item);
|
|
2826
2827
|
if (result) {
|
|
2827
2828
|
parts.push(result);
|
|
2828
2829
|
}
|
|
@@ -2887,7 +2888,8 @@ function findOmathRoots(node) {
|
|
|
2887
2888
|
return ensureArray(paraNode["m:oMath"]);
|
|
2888
2889
|
}
|
|
2889
2890
|
}
|
|
2890
|
-
|
|
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)))) {
|
|
2891
2893
|
return [node];
|
|
2892
2894
|
}
|
|
2893
2895
|
return [];
|
|
@@ -3069,43 +3071,49 @@ function tokenize(latex) {
|
|
|
3069
3071
|
}
|
|
3070
3072
|
return tokens;
|
|
3071
3073
|
}
|
|
3072
|
-
function
|
|
3074
|
+
function isGroupedByTag(tags) {
|
|
3073
3075
|
const seen = /* @__PURE__ */ new Set();
|
|
3074
3076
|
let previous = "";
|
|
3075
|
-
for (const
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
continue;
|
|
3079
|
-
}
|
|
3080
|
-
if (key !== previous && seen.has(key)) {
|
|
3081
|
-
return false;
|
|
3082
|
-
}
|
|
3083
|
-
seen.add(key);
|
|
3084
|
-
previous = key;
|
|
3077
|
+
for (const tag of tags) {
|
|
3078
|
+
if (tag !== previous && seen.has(tag)) {
|
|
3079
|
+
return false;
|
|
3085
3080
|
}
|
|
3081
|
+
seen.add(tag);
|
|
3082
|
+
previous = tag;
|
|
3086
3083
|
}
|
|
3087
3084
|
return true;
|
|
3088
3085
|
}
|
|
3089
3086
|
function mergeSiblings(nodes) {
|
|
3090
|
-
|
|
3091
|
-
return { "m:box": nodes.map((node) => ({ "m:e": node })) };
|
|
3092
|
-
}
|
|
3093
|
-
const result = {};
|
|
3087
|
+
const entries = [];
|
|
3094
3088
|
for (const node of nodes) {
|
|
3095
3089
|
for (const key of Object.keys(node)) {
|
|
3096
|
-
if (node[key]
|
|
3097
|
-
|
|
3090
|
+
if (node[key] !== void 0) {
|
|
3091
|
+
entries.push([key, node[key]]);
|
|
3098
3092
|
}
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
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);
|
|
3106
3112
|
} else {
|
|
3107
|
-
result[key] =
|
|
3113
|
+
result[key] = [existing, value];
|
|
3108
3114
|
}
|
|
3115
|
+
} else {
|
|
3116
|
+
result[key] = value;
|
|
3109
3117
|
}
|
|
3110
3118
|
}
|
|
3111
3119
|
return result;
|
|
@@ -3282,18 +3290,7 @@ var LatexParser = class {
|
|
|
3282
3290
|
}
|
|
3283
3291
|
wrapE(nodes) {
|
|
3284
3292
|
if (nodes.length === 1) {
|
|
3285
|
-
return
|
|
3286
|
-
"m:r": nodes[0]["m:r"],
|
|
3287
|
-
"m:f": nodes[0]["m:f"],
|
|
3288
|
-
"m:rad": nodes[0]["m:rad"],
|
|
3289
|
-
"m:sSup": nodes[0]["m:sSup"],
|
|
3290
|
-
"m:sSub": nodes[0]["m:sSub"],
|
|
3291
|
-
"m:sSubSup": nodes[0]["m:sSubSup"],
|
|
3292
|
-
"m:nary": nodes[0]["m:nary"],
|
|
3293
|
-
"m:d": nodes[0]["m:d"],
|
|
3294
|
-
"m:func": nodes[0]["m:func"],
|
|
3295
|
-
"m:box": nodes[0]["m:box"]
|
|
3296
|
-
};
|
|
3293
|
+
return nodes[0];
|
|
3297
3294
|
}
|
|
3298
3295
|
return mergeSiblings(nodes);
|
|
3299
3296
|
}
|
|
@@ -3506,9 +3503,10 @@ function ommlChildrenToLatex(node) {
|
|
|
3506
3503
|
if (key.startsWith("@_")) {
|
|
3507
3504
|
continue;
|
|
3508
3505
|
}
|
|
3506
|
+
const tag = chunkKV3EOLP3_js.stripXmlOrderSuffix(key);
|
|
3509
3507
|
const items = ensureArr(node[key]);
|
|
3510
3508
|
for (const item of items) {
|
|
3511
|
-
const result = ommlElementToLatex(
|
|
3509
|
+
const result = ommlElementToLatex(tag, item);
|
|
3512
3510
|
if (result) {
|
|
3513
3511
|
parts.push(result);
|
|
3514
3512
|
}
|
|
@@ -12114,7 +12112,7 @@ function rotateDelta(dx, dy, rotationDeg) {
|
|
|
12114
12112
|
}
|
|
12115
12113
|
function applyResize(box, handle, dxScreen, dyScreen, zoom, opts = {}) {
|
|
12116
12114
|
const scale = zoom || 1;
|
|
12117
|
-
const minSize = opts.minSize ??
|
|
12115
|
+
const minSize = opts.minSize ?? chunkKV3EOLP3_js.MIN_ELEMENT_SIZE;
|
|
12118
12116
|
const rotation = rotationOf(box);
|
|
12119
12117
|
const local = rotateDelta(dxScreen / scale, dyScreen / scale, rotation);
|
|
12120
12118
|
const dx = local.x;
|
|
@@ -12141,7 +12139,7 @@ function applyResize(box, handle, dxScreen, dyScreen, zoom, opts = {}) {
|
|
|
12141
12139
|
}
|
|
12142
12140
|
return { x: newX, y: newY, width: newW, height: newH, rotation };
|
|
12143
12141
|
}
|
|
12144
|
-
function snapBoxToGrid(box, handle, gridSpacingPx, minSize =
|
|
12142
|
+
function snapBoxToGrid(box, handle, gridSpacingPx, minSize = chunkKV3EOLP3_js.MIN_ELEMENT_SIZE) {
|
|
12145
12143
|
if (handle === null || gridSpacingPx <= 0) {
|
|
12146
12144
|
return box;
|
|
12147
12145
|
}
|
|
@@ -12171,7 +12169,7 @@ function snapBoxToGrid(box, handle, gridSpacingPx, minSize = chunkMS6S6YYR_js.MI
|
|
|
12171
12169
|
}
|
|
12172
12170
|
return { x, y, width, height };
|
|
12173
12171
|
}
|
|
12174
|
-
function computeMarqueeHitIds(marquee, elements, minSize =
|
|
12172
|
+
function computeMarqueeHitIds(marquee, elements, minSize = chunkKV3EOLP3_js.MIN_ELEMENT_SIZE) {
|
|
12175
12173
|
const minX = Math.min(marquee.startX, marquee.currentX);
|
|
12176
12174
|
const minY = Math.min(marquee.startY, marquee.currentY);
|
|
12177
12175
|
const maxX = Math.max(marquee.startX, marquee.currentX);
|
|
@@ -13726,7 +13724,7 @@ var THEME_COLOR_LABELS = {
|
|
|
13726
13724
|
};
|
|
13727
13725
|
function buildThemeColorGrid(colorScheme) {
|
|
13728
13726
|
return THEME_COLOR_TINT_ROWS.map(
|
|
13729
|
-
(row) =>
|
|
13727
|
+
(row) => chunkKV3EOLP3_js.THEME_COLOR_SCHEME_KEYS.map((key) => ({
|
|
13730
13728
|
hex: row.transform(colorScheme[key]),
|
|
13731
13729
|
schemeKey: key,
|
|
13732
13730
|
rowLabel: row.label,
|
|
@@ -14202,7 +14200,7 @@ function svgLineCap(lineCap) {
|
|
|
14202
14200
|
}
|
|
14203
14201
|
function copyFormatFromElement(element) {
|
|
14204
14202
|
const result = {};
|
|
14205
|
-
if (
|
|
14203
|
+
if (chunkKV3EOLP3_js.hasShapeProperties(element) && element.shapeStyle) {
|
|
14206
14204
|
const s = element.shapeStyle;
|
|
14207
14205
|
result.shapeStyle = {
|
|
14208
14206
|
fillColor: s.fillColor,
|
|
@@ -14231,7 +14229,7 @@ function copyFormatFromElement(element) {
|
|
|
14231
14229
|
softEdgeRadius: s.softEdgeRadius
|
|
14232
14230
|
};
|
|
14233
14231
|
}
|
|
14234
|
-
if (
|
|
14232
|
+
if (chunkKV3EOLP3_js.hasTextProperties(element) && element.textStyle) {
|
|
14235
14233
|
const t = element.textStyle;
|
|
14236
14234
|
result.textStyle = {
|
|
14237
14235
|
fontFamily: t.fontFamily,
|
|
@@ -14262,7 +14260,7 @@ function definedEntries(obj) {
|
|
|
14262
14260
|
}
|
|
14263
14261
|
function applyFormatToElement(element, format) {
|
|
14264
14262
|
let updated = { ...element };
|
|
14265
|
-
if (format.shapeStyle &&
|
|
14263
|
+
if (format.shapeStyle && chunkKV3EOLP3_js.hasShapeProperties(updated)) {
|
|
14266
14264
|
updated = {
|
|
14267
14265
|
...updated,
|
|
14268
14266
|
shapeStyle: {
|
|
@@ -14271,7 +14269,7 @@ function applyFormatToElement(element, format) {
|
|
|
14271
14269
|
}
|
|
14272
14270
|
};
|
|
14273
14271
|
}
|
|
14274
|
-
if (format.textStyle &&
|
|
14272
|
+
if (format.textStyle && chunkKV3EOLP3_js.hasTextProperties(updated)) {
|
|
14275
14273
|
updated = {
|
|
14276
14274
|
...updated,
|
|
14277
14275
|
textStyle: {
|
|
@@ -14286,7 +14284,7 @@ function hasCopyableFormat(element) {
|
|
|
14286
14284
|
if (!element) {
|
|
14287
14285
|
return false;
|
|
14288
14286
|
}
|
|
14289
|
-
return
|
|
14287
|
+
return chunkKV3EOLP3_js.hasShapeProperties(element) || chunkKV3EOLP3_js.hasTextProperties(element);
|
|
14290
14288
|
}
|
|
14291
14289
|
function copySegmentMetadata(from, to) {
|
|
14292
14290
|
if (from.equationXml !== void 0) {
|
|
@@ -14423,7 +14421,7 @@ function getRoundRectRadiusPx(element) {
|
|
|
14423
14421
|
return Math.min(Math.max(element.width, 1), Math.max(element.height, 1)) * 0.5 * normalizedAdjustment;
|
|
14424
14422
|
}
|
|
14425
14423
|
function getShapeAdjustmentHandleDescriptor(element) {
|
|
14426
|
-
if (!
|
|
14424
|
+
if (!chunkKV3EOLP3_js.hasShapeProperties(element)) {
|
|
14427
14425
|
return null;
|
|
14428
14426
|
}
|
|
14429
14427
|
const normalizedShapeType = String(element.shapeType || "").toLowerCase();
|
|
@@ -15414,7 +15412,7 @@ function createSyncGate(onOpen, graceMs = INITIAL_SYNC_GRACE_MS) {
|
|
|
15414
15412
|
var POSITION_THRESHOLD = 2;
|
|
15415
15413
|
var SIZE_THRESHOLD = 2;
|
|
15416
15414
|
function getElementText(element) {
|
|
15417
|
-
if (!
|
|
15415
|
+
if (!chunkKV3EOLP3_js.hasTextProperties(element)) {
|
|
15418
15416
|
return "";
|
|
15419
15417
|
}
|
|
15420
15418
|
if (element.textSegments && element.textSegments.length > 0) {
|
|
@@ -18988,7 +18986,7 @@ function getAriaRole(element) {
|
|
|
18988
18986
|
case "model3d":
|
|
18989
18987
|
return "img";
|
|
18990
18988
|
case "shape": {
|
|
18991
|
-
if (
|
|
18989
|
+
if (chunkKV3EOLP3_js.hasTextProperties(element) && element.text) {
|
|
18992
18990
|
return "group";
|
|
18993
18991
|
}
|
|
18994
18992
|
return "img";
|
|
@@ -19001,7 +18999,7 @@ function getAriaLabel(element) {
|
|
|
19001
18999
|
if ((element.type === "image" || element.type === "picture") && "altText" in element && typeof element.altText === "string" && element.altText.trim()) {
|
|
19002
19000
|
return element.altText.trim();
|
|
19003
19001
|
}
|
|
19004
|
-
if (
|
|
19002
|
+
if (chunkKV3EOLP3_js.hasTextProperties(element) && element.text) {
|
|
19005
19003
|
const text = element.text.trim();
|
|
19006
19004
|
if (text) {
|
|
19007
19005
|
return text.length > 120 ? `${text.slice(0, 117)}...` : text;
|
|
@@ -19408,7 +19406,7 @@ var DEFAULT_CHART_POSITION = { x: 120, y: 120, width: 480, height: 320 };
|
|
|
19408
19406
|
var DEFAULT_CATEGORIES = ["Category 1", "Category 2", "Category 3"];
|
|
19409
19407
|
var DEFAULT_SERIES_VALUES = [4, 3, 5];
|
|
19410
19408
|
function createDefaultChartElement(chartType = DEFAULT_INSERT_CHART_TYPE, position) {
|
|
19411
|
-
return
|
|
19409
|
+
return chunkKV3EOLP3_js.createChartElement(
|
|
19412
19410
|
chartType,
|
|
19413
19411
|
{
|
|
19414
19412
|
categories: [...DEFAULT_CATEGORIES],
|
|
@@ -20428,7 +20426,7 @@ function computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight,
|
|
|
20428
20426
|
};
|
|
20429
20427
|
}
|
|
20430
20428
|
function collectFontsFromElement(element, fonts) {
|
|
20431
|
-
if (
|
|
20429
|
+
if (chunkKV3EOLP3_js.hasTextProperties(element)) {
|
|
20432
20430
|
if (element.textStyle?.fontFamily) {
|
|
20433
20431
|
fonts.add(element.textStyle.fontFamily);
|
|
20434
20432
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MIN_ELEMENT_SIZE, guideEmuToPx, THEME_COLOR_SCHEME_KEYS, hasShapeProperties, hasTextProperties, createChartElement, getShapeClipPath, getAdjustmentAwareShapeClipPath, getShapeClipPathFromPreset, getCloudPathForRendering, hslToRgb, PRESET_COLOR_MAP, isImageLikeElement, applyDrawingColorTransforms } from './chunk-
|
|
1
|
+
import { MIN_ELEMENT_SIZE, guideEmuToPx, THEME_COLOR_SCHEME_KEYS, hasShapeProperties, hasTextProperties, createChartElement, getShapeClipPath, getAdjustmentAwareShapeClipPath, getShapeClipPathFromPreset, getCloudPathForRendering, hslToRgb, PRESET_COLOR_MAP, isImageLikeElement, stripXmlOrderSuffix, orderedXmlKey, applyDrawingColorTransforms } from './chunk-LDZQNYWL.mjs';
|
|
2
2
|
import DOMPurify from 'dompurify';
|
|
3
3
|
|
|
4
4
|
var defaultThemeColors = {
|
|
@@ -2811,12 +2811,13 @@ function convertChildren(node) {
|
|
|
2811
2811
|
if (key.startsWith("@_")) {
|
|
2812
2812
|
continue;
|
|
2813
2813
|
}
|
|
2814
|
-
|
|
2814
|
+
const tag = stripXmlOrderSuffix(key);
|
|
2815
|
+
if (tag === "m:oMathPara") {
|
|
2815
2816
|
continue;
|
|
2816
2817
|
}
|
|
2817
2818
|
const items = ensureArray(node[key]);
|
|
2818
2819
|
for (const item of items) {
|
|
2819
|
-
const result = convertElement(
|
|
2820
|
+
const result = convertElement(tag, item);
|
|
2820
2821
|
if (result) {
|
|
2821
2822
|
parts.push(result);
|
|
2822
2823
|
}
|
|
@@ -2881,7 +2882,8 @@ function findOmathRoots(node) {
|
|
|
2881
2882
|
return ensureArray(paraNode["m:oMath"]);
|
|
2882
2883
|
}
|
|
2883
2884
|
}
|
|
2884
|
-
|
|
2885
|
+
const contentTags = /* @__PURE__ */ new Set(["m:r", "m:f", "m:rad", "m:sSup", "m:sSub", "m:box"]);
|
|
2886
|
+
if (Object.keys(node).some((key) => contentTags.has(stripXmlOrderSuffix(key)))) {
|
|
2885
2887
|
return [node];
|
|
2886
2888
|
}
|
|
2887
2889
|
return [];
|
|
@@ -3063,43 +3065,49 @@ function tokenize(latex) {
|
|
|
3063
3065
|
}
|
|
3064
3066
|
return tokens;
|
|
3065
3067
|
}
|
|
3066
|
-
function
|
|
3068
|
+
function isGroupedByTag(tags) {
|
|
3067
3069
|
const seen = /* @__PURE__ */ new Set();
|
|
3068
3070
|
let previous = "";
|
|
3069
|
-
for (const
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
continue;
|
|
3073
|
-
}
|
|
3074
|
-
if (key !== previous && seen.has(key)) {
|
|
3075
|
-
return false;
|
|
3076
|
-
}
|
|
3077
|
-
seen.add(key);
|
|
3078
|
-
previous = key;
|
|
3071
|
+
for (const tag of tags) {
|
|
3072
|
+
if (tag !== previous && seen.has(tag)) {
|
|
3073
|
+
return false;
|
|
3079
3074
|
}
|
|
3075
|
+
seen.add(tag);
|
|
3076
|
+
previous = tag;
|
|
3080
3077
|
}
|
|
3081
3078
|
return true;
|
|
3082
3079
|
}
|
|
3083
3080
|
function mergeSiblings(nodes) {
|
|
3084
|
-
|
|
3085
|
-
return { "m:box": nodes.map((node) => ({ "m:e": node })) };
|
|
3086
|
-
}
|
|
3087
|
-
const result = {};
|
|
3081
|
+
const entries = [];
|
|
3088
3082
|
for (const node of nodes) {
|
|
3089
3083
|
for (const key of Object.keys(node)) {
|
|
3090
|
-
if (node[key]
|
|
3091
|
-
|
|
3084
|
+
if (node[key] !== void 0) {
|
|
3085
|
+
entries.push([key, node[key]]);
|
|
3092
3086
|
}
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
if (!isGroupedByTag(entries.map(([key]) => key))) {
|
|
3090
|
+
const counts = /* @__PURE__ */ new Map();
|
|
3091
|
+
for (const [key] of entries) {
|
|
3092
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
3093
|
+
}
|
|
3094
|
+
const ordered = {};
|
|
3095
|
+
for (const [position, [key, value]] of entries.entries()) {
|
|
3096
|
+
ordered[(counts.get(key) ?? 0) > 1 ? orderedXmlKey(key, position) : key] = value;
|
|
3097
|
+
}
|
|
3098
|
+
return ordered;
|
|
3099
|
+
}
|
|
3100
|
+
const result = {};
|
|
3101
|
+
for (const [key, value] of entries) {
|
|
3102
|
+
if (result[key]) {
|
|
3103
|
+
const existing = result[key];
|
|
3104
|
+
if (Array.isArray(existing)) {
|
|
3105
|
+
existing.push(value);
|
|
3100
3106
|
} else {
|
|
3101
|
-
result[key] =
|
|
3107
|
+
result[key] = [existing, value];
|
|
3102
3108
|
}
|
|
3109
|
+
} else {
|
|
3110
|
+
result[key] = value;
|
|
3103
3111
|
}
|
|
3104
3112
|
}
|
|
3105
3113
|
return result;
|
|
@@ -3276,18 +3284,7 @@ var LatexParser = class {
|
|
|
3276
3284
|
}
|
|
3277
3285
|
wrapE(nodes) {
|
|
3278
3286
|
if (nodes.length === 1) {
|
|
3279
|
-
return
|
|
3280
|
-
"m:r": nodes[0]["m:r"],
|
|
3281
|
-
"m:f": nodes[0]["m:f"],
|
|
3282
|
-
"m:rad": nodes[0]["m:rad"],
|
|
3283
|
-
"m:sSup": nodes[0]["m:sSup"],
|
|
3284
|
-
"m:sSub": nodes[0]["m:sSub"],
|
|
3285
|
-
"m:sSubSup": nodes[0]["m:sSubSup"],
|
|
3286
|
-
"m:nary": nodes[0]["m:nary"],
|
|
3287
|
-
"m:d": nodes[0]["m:d"],
|
|
3288
|
-
"m:func": nodes[0]["m:func"],
|
|
3289
|
-
"m:box": nodes[0]["m:box"]
|
|
3290
|
-
};
|
|
3287
|
+
return nodes[0];
|
|
3291
3288
|
}
|
|
3292
3289
|
return mergeSiblings(nodes);
|
|
3293
3290
|
}
|
|
@@ -3500,9 +3497,10 @@ function ommlChildrenToLatex(node) {
|
|
|
3500
3497
|
if (key.startsWith("@_")) {
|
|
3501
3498
|
continue;
|
|
3502
3499
|
}
|
|
3500
|
+
const tag = stripXmlOrderSuffix(key);
|
|
3503
3501
|
const items = ensureArr(node[key]);
|
|
3504
3502
|
for (const item of items) {
|
|
3505
|
-
const result = ommlElementToLatex(
|
|
3503
|
+
const result = ommlElementToLatex(tag, item);
|
|
3506
3504
|
if (result) {
|
|
3507
3505
|
parts.push(result);
|
|
3508
3506
|
}
|
|
Binary file
|
|
Binary file
|