docgen-utils 1.0.30 → 1.0.31
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/bundle.js +212 -45
- package/dist/bundle.min.js +99 -99
- package/dist/packages/slides/parse.d.ts.map +1 -1
- package/dist/packages/slides/parse.js +211 -8
- package/dist/packages/slides/parse.js.map +1 -1
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -65537,6 +65537,22 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
65537
65537
|
return void 0;
|
|
65538
65538
|
return parsed;
|
|
65539
65539
|
}
|
|
65540
|
+
function getEffectiveZIndex(element, win) {
|
|
65541
|
+
let current = element;
|
|
65542
|
+
while (current && current !== win.document.body && current !== win.document.documentElement) {
|
|
65543
|
+
const computed = win.getComputedStyle(current);
|
|
65544
|
+
const position = computed.position;
|
|
65545
|
+
const isPositioned = position === "absolute" || position === "relative" || position === "fixed" || position === "sticky";
|
|
65546
|
+
if (isPositioned) {
|
|
65547
|
+
const zIndex = extractZIndex(computed);
|
|
65548
|
+
if (zIndex !== void 0) {
|
|
65549
|
+
return zIndex;
|
|
65550
|
+
}
|
|
65551
|
+
}
|
|
65552
|
+
current = current.parentElement;
|
|
65553
|
+
}
|
|
65554
|
+
return void 0;
|
|
65555
|
+
}
|
|
65540
65556
|
function getEffectiveOpacity(element, win) {
|
|
65541
65557
|
let effectiveOpacity = 1;
|
|
65542
65558
|
let current = element;
|
|
@@ -67433,7 +67449,7 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
67433
67449
|
cssTriangle: null,
|
|
67434
67450
|
customGeometry: null
|
|
67435
67451
|
},
|
|
67436
|
-
zIndex:
|
|
67452
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
67437
67453
|
};
|
|
67438
67454
|
elements.push(shapeElement);
|
|
67439
67455
|
if (hasBorder && !hasUniformBorder) {
|
|
@@ -67515,7 +67531,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
67515
67531
|
rotate: null,
|
|
67516
67532
|
cssTriangle: null,
|
|
67517
67533
|
customGeometry: points
|
|
67518
|
-
}
|
|
67534
|
+
},
|
|
67535
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
67519
67536
|
};
|
|
67520
67537
|
elements.push(borderLeftShape);
|
|
67521
67538
|
} else {
|
|
@@ -67543,7 +67560,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
67543
67560
|
rotate: null,
|
|
67544
67561
|
cssTriangle: null,
|
|
67545
67562
|
customGeometry: null
|
|
67546
|
-
}
|
|
67563
|
+
},
|
|
67564
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
67547
67565
|
};
|
|
67548
67566
|
elements.push(borderLeftShape);
|
|
67549
67567
|
}
|
|
@@ -67614,7 +67632,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
67614
67632
|
rotate: null,
|
|
67615
67633
|
cssTriangle: null,
|
|
67616
67634
|
customGeometry: points
|
|
67617
|
-
}
|
|
67635
|
+
},
|
|
67636
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
67618
67637
|
};
|
|
67619
67638
|
elements.push(borderRightShape);
|
|
67620
67639
|
} else {
|
|
@@ -67642,7 +67661,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
67642
67661
|
rotate: null,
|
|
67643
67662
|
cssTriangle: null,
|
|
67644
67663
|
customGeometry: null
|
|
67645
|
-
}
|
|
67664
|
+
},
|
|
67665
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
67646
67666
|
};
|
|
67647
67667
|
elements.push(borderRightShape);
|
|
67648
67668
|
}
|
|
@@ -67717,7 +67737,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
67717
67737
|
rotate: null,
|
|
67718
67738
|
cssTriangle: null,
|
|
67719
67739
|
customGeometry: points
|
|
67720
|
-
}
|
|
67740
|
+
},
|
|
67741
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
67721
67742
|
};
|
|
67722
67743
|
elements.push(borderTopShape);
|
|
67723
67744
|
} else {
|
|
@@ -67745,7 +67766,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
67745
67766
|
rotate: null,
|
|
67746
67767
|
cssTriangle: null,
|
|
67747
67768
|
customGeometry: null
|
|
67748
|
-
}
|
|
67769
|
+
},
|
|
67770
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
67749
67771
|
};
|
|
67750
67772
|
elements.push(borderTopShape);
|
|
67751
67773
|
}
|
|
@@ -67815,7 +67837,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
67815
67837
|
rotate: null,
|
|
67816
67838
|
cssTriangle: null,
|
|
67817
67839
|
customGeometry: points
|
|
67818
|
-
}
|
|
67840
|
+
},
|
|
67841
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
67819
67842
|
};
|
|
67820
67843
|
elements.push(borderBottomShape);
|
|
67821
67844
|
} else {
|
|
@@ -67843,7 +67866,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
67843
67866
|
rotate: null,
|
|
67844
67867
|
cssTriangle: null,
|
|
67845
67868
|
customGeometry: null
|
|
67846
|
-
}
|
|
67869
|
+
},
|
|
67870
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
67847
67871
|
};
|
|
67848
67872
|
elements.push(borderBottomShape);
|
|
67849
67873
|
}
|
|
@@ -67940,7 +67964,7 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
67940
67964
|
cssTriangle: null,
|
|
67941
67965
|
customGeometry: null
|
|
67942
67966
|
},
|
|
67943
|
-
zIndex:
|
|
67967
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
67944
67968
|
};
|
|
67945
67969
|
elements.push(shapeElement);
|
|
67946
67970
|
if (hasBorder && !hasUniformBorder) {
|
|
@@ -68022,7 +68046,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68022
68046
|
rotate: null,
|
|
68023
68047
|
cssTriangle: null,
|
|
68024
68048
|
customGeometry: points
|
|
68025
|
-
}
|
|
68049
|
+
},
|
|
68050
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
68026
68051
|
};
|
|
68027
68052
|
elements.push(borderLeftShape);
|
|
68028
68053
|
} else {
|
|
@@ -68050,7 +68075,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68050
68075
|
rotate: null,
|
|
68051
68076
|
cssTriangle: null,
|
|
68052
68077
|
customGeometry: null
|
|
68053
|
-
}
|
|
68078
|
+
},
|
|
68079
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
68054
68080
|
};
|
|
68055
68081
|
elements.push(borderLeftShape);
|
|
68056
68082
|
}
|
|
@@ -68121,7 +68147,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68121
68147
|
rotate: null,
|
|
68122
68148
|
cssTriangle: null,
|
|
68123
68149
|
customGeometry: points
|
|
68124
|
-
}
|
|
68150
|
+
},
|
|
68151
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
68125
68152
|
};
|
|
68126
68153
|
elements.push(borderRightShape);
|
|
68127
68154
|
} else {
|
|
@@ -68149,7 +68176,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68149
68176
|
rotate: null,
|
|
68150
68177
|
cssTriangle: null,
|
|
68151
68178
|
customGeometry: null
|
|
68152
|
-
}
|
|
68179
|
+
},
|
|
68180
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
68153
68181
|
};
|
|
68154
68182
|
elements.push(borderRightShape);
|
|
68155
68183
|
}
|
|
@@ -68224,7 +68252,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68224
68252
|
rotate: null,
|
|
68225
68253
|
cssTriangle: null,
|
|
68226
68254
|
customGeometry: points
|
|
68227
|
-
}
|
|
68255
|
+
},
|
|
68256
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
68228
68257
|
};
|
|
68229
68258
|
elements.push(borderTopShape);
|
|
68230
68259
|
} else {
|
|
@@ -68252,7 +68281,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68252
68281
|
rotate: null,
|
|
68253
68282
|
cssTriangle: null,
|
|
68254
68283
|
customGeometry: null
|
|
68255
|
-
}
|
|
68284
|
+
},
|
|
68285
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
68256
68286
|
};
|
|
68257
68287
|
elements.push(borderTopShape);
|
|
68258
68288
|
}
|
|
@@ -68402,7 +68432,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68402
68432
|
lineSpacing: lineHeightMultiplier2 * pxToPoints(computed22.fontSize),
|
|
68403
68433
|
fontFill: spanFontFill,
|
|
68404
68434
|
...extractAlpha(computed22.color) !== null ? { transparency: extractAlpha(computed22.color) } : {}
|
|
68405
|
-
}
|
|
68435
|
+
},
|
|
68436
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
68406
68437
|
};
|
|
68407
68438
|
elements.push(textElement);
|
|
68408
68439
|
processed.add(el);
|
|
@@ -68560,6 +68591,10 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68560
68591
|
if (hasOpacity && !maskApplied) {
|
|
68561
68592
|
imageElement.transparency = Math.round((1 - imgOpacity) * 100);
|
|
68562
68593
|
}
|
|
68594
|
+
const imgZIndex = getEffectiveZIndex(el, win);
|
|
68595
|
+
if (imgZIndex !== void 0) {
|
|
68596
|
+
imageElement.zIndex = imgZIndex;
|
|
68597
|
+
}
|
|
68563
68598
|
elements.push(imageElement);
|
|
68564
68599
|
processed.add(el);
|
|
68565
68600
|
return;
|
|
@@ -68706,7 +68741,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68706
68741
|
h: displayH
|
|
68707
68742
|
},
|
|
68708
68743
|
sizing: null,
|
|
68709
|
-
transparency: svgEffectiveOpacity < 1 ? Math.round((1 - svgEffectiveOpacity) * 100) : void 0
|
|
68744
|
+
transparency: svgEffectiveOpacity < 1 ? Math.round((1 - svgEffectiveOpacity) * 100) : void 0,
|
|
68745
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
68710
68746
|
};
|
|
68711
68747
|
elements.push(imageElement);
|
|
68712
68748
|
processed.add(el);
|
|
@@ -68770,7 +68806,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68770
68806
|
w: pxToInch(rect2.width),
|
|
68771
68807
|
h: pxToInch(rect2.height)
|
|
68772
68808
|
},
|
|
68773
|
-
sizing: null
|
|
68809
|
+
sizing: null,
|
|
68810
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
68774
68811
|
};
|
|
68775
68812
|
elements.push(imageElement);
|
|
68776
68813
|
}
|
|
@@ -68803,7 +68840,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68803
68840
|
h: pxToInch(blurResult.h)
|
|
68804
68841
|
},
|
|
68805
68842
|
sizing: null,
|
|
68806
|
-
rectRadius: 0
|
|
68843
|
+
rectRadius: 0,
|
|
68844
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
68807
68845
|
};
|
|
68808
68846
|
elements.push(imgElement);
|
|
68809
68847
|
processed.add(el);
|
|
@@ -68833,7 +68871,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68833
68871
|
h: pxToInch(rect2.height)
|
|
68834
68872
|
},
|
|
68835
68873
|
sizing: null,
|
|
68836
|
-
rectRadius: 0
|
|
68874
|
+
rectRadius: 0,
|
|
68875
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
68837
68876
|
};
|
|
68838
68877
|
elements.push(imgElement);
|
|
68839
68878
|
hasConicGradientImage = true;
|
|
@@ -68907,7 +68946,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68907
68946
|
rotate: triRotation,
|
|
68908
68947
|
cssTriangle: { direction: triangleDirection },
|
|
68909
68948
|
customGeometry: null
|
|
68910
|
-
}
|
|
68949
|
+
},
|
|
68950
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
68911
68951
|
};
|
|
68912
68952
|
elements.push(triangleShape);
|
|
68913
68953
|
processed.add(el);
|
|
@@ -68944,7 +68984,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
68944
68984
|
},
|
|
68945
68985
|
sizing: null,
|
|
68946
68986
|
rectRadius: 0,
|
|
68947
|
-
transparency: effOp < 1 ? Math.round((1 - effOp) * 100) : void 0
|
|
68987
|
+
transparency: effOp < 1 ? Math.round((1 - effOp) * 100) : void 0,
|
|
68988
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
68948
68989
|
};
|
|
68949
68990
|
elements.push(imgElement);
|
|
68950
68991
|
}
|
|
@@ -69055,7 +69096,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
69055
69096
|
rotate: null,
|
|
69056
69097
|
cssTriangle: null,
|
|
69057
69098
|
customGeometry: points
|
|
69058
|
-
}
|
|
69099
|
+
},
|
|
69100
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
69059
69101
|
});
|
|
69060
69102
|
} else {
|
|
69061
69103
|
borderShapes.push({
|
|
@@ -69082,7 +69124,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
69082
69124
|
rotate: null,
|
|
69083
69125
|
cssTriangle: null,
|
|
69084
69126
|
customGeometry: null
|
|
69085
|
-
}
|
|
69127
|
+
},
|
|
69128
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
69086
69129
|
});
|
|
69087
69130
|
}
|
|
69088
69131
|
}
|
|
@@ -69154,7 +69197,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
69154
69197
|
rotate: null,
|
|
69155
69198
|
cssTriangle: null,
|
|
69156
69199
|
customGeometry: points
|
|
69157
|
-
}
|
|
69200
|
+
},
|
|
69201
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
69158
69202
|
});
|
|
69159
69203
|
} else {
|
|
69160
69204
|
borderShapes.push({
|
|
@@ -69181,7 +69225,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
69181
69225
|
rotate: null,
|
|
69182
69226
|
cssTriangle: null,
|
|
69183
69227
|
customGeometry: null
|
|
69184
|
-
}
|
|
69228
|
+
},
|
|
69229
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
69185
69230
|
});
|
|
69186
69231
|
}
|
|
69187
69232
|
}
|
|
@@ -69254,7 +69299,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
69254
69299
|
rotate: null,
|
|
69255
69300
|
cssTriangle: null,
|
|
69256
69301
|
customGeometry: points
|
|
69257
|
-
}
|
|
69302
|
+
},
|
|
69303
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
69258
69304
|
});
|
|
69259
69305
|
} else {
|
|
69260
69306
|
borderShapes.push({
|
|
@@ -69281,7 +69327,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
69281
69327
|
rotate: null,
|
|
69282
69328
|
cssTriangle: null,
|
|
69283
69329
|
customGeometry: null
|
|
69284
|
-
}
|
|
69330
|
+
},
|
|
69331
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
69285
69332
|
});
|
|
69286
69333
|
}
|
|
69287
69334
|
}
|
|
@@ -69350,7 +69397,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
69350
69397
|
rotate: null,
|
|
69351
69398
|
cssTriangle: null,
|
|
69352
69399
|
customGeometry: points
|
|
69353
|
-
}
|
|
69400
|
+
},
|
|
69401
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
69354
69402
|
});
|
|
69355
69403
|
} else {
|
|
69356
69404
|
borderShapes.push({
|
|
@@ -69377,7 +69425,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
69377
69425
|
rotate: null,
|
|
69378
69426
|
cssTriangle: null,
|
|
69379
69427
|
customGeometry: null
|
|
69380
|
-
}
|
|
69428
|
+
},
|
|
69429
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
69381
69430
|
});
|
|
69382
69431
|
}
|
|
69383
69432
|
}
|
|
@@ -69399,7 +69448,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
69399
69448
|
sizing: {
|
|
69400
69449
|
type: bgImageSize === "cover" ? "cover" : bgImageSize === "contain" ? "contain" : "cover",
|
|
69401
69450
|
position: bgImagePosition
|
|
69402
|
-
}
|
|
69451
|
+
},
|
|
69452
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
69403
69453
|
};
|
|
69404
69454
|
elements.push(bgImgElement);
|
|
69405
69455
|
}
|
|
@@ -70299,7 +70349,7 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
70299
70349
|
return points;
|
|
70300
70350
|
})() : null
|
|
70301
70351
|
},
|
|
70302
|
-
zIndex:
|
|
70352
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
70303
70353
|
};
|
|
70304
70354
|
if (hasPadding && shapeElement.style && (shapeText || shapeTextRuns && shapeTextRuns.length > 0)) {
|
|
70305
70355
|
let effectiveLeftPadding = paddingLeft;
|
|
@@ -70336,6 +70386,58 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
70336
70386
|
tc.querySelectorAll("*").forEach((desc) => processed.delete(desc));
|
|
70337
70387
|
});
|
|
70338
70388
|
}
|
|
70389
|
+
if (!shouldMergeText && hasDirectText && directTextContent) {
|
|
70390
|
+
const range2 = win.document.createRange();
|
|
70391
|
+
let foundTextNode = false;
|
|
70392
|
+
for (const node of Array.from(el.childNodes)) {
|
|
70393
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
70394
|
+
const text2 = (node.textContent || "").trim();
|
|
70395
|
+
if (text2) {
|
|
70396
|
+
if (!foundTextNode) {
|
|
70397
|
+
range2.setStart(node, 0);
|
|
70398
|
+
foundTextNode = true;
|
|
70399
|
+
}
|
|
70400
|
+
range2.setEnd(node, node.textContent?.length || 0);
|
|
70401
|
+
}
|
|
70402
|
+
}
|
|
70403
|
+
}
|
|
70404
|
+
if (foundTextNode) {
|
|
70405
|
+
const textRect = range2.getBoundingClientRect();
|
|
70406
|
+
if (textRect.width > 0 && textRect.height > 0) {
|
|
70407
|
+
const isBold = parseInt(computed2.fontWeight) >= 600;
|
|
70408
|
+
const isItalic = computed2.fontStyle === "italic";
|
|
70409
|
+
const isUnderline = computed2.textDecoration && computed2.textDecoration.includes("underline");
|
|
70410
|
+
let displayText = directTextContent;
|
|
70411
|
+
if (computed2.textTransform && computed2.textTransform !== "none") {
|
|
70412
|
+
displayText = applyTextTransform2(displayText, computed2.textTransform);
|
|
70413
|
+
}
|
|
70414
|
+
const directTextElement = {
|
|
70415
|
+
type: "p",
|
|
70416
|
+
text: displayText,
|
|
70417
|
+
position: {
|
|
70418
|
+
x: pxToInch(textRect.left),
|
|
70419
|
+
y: pxToInch(textRect.top),
|
|
70420
|
+
w: pxToInch(textRect.width),
|
|
70421
|
+
h: pxToInch(textRect.height)
|
|
70422
|
+
},
|
|
70423
|
+
style: {
|
|
70424
|
+
fontSize: pxToPoints(computed2.fontSize),
|
|
70425
|
+
fontFace: extractFontFace(computed2.fontFamily),
|
|
70426
|
+
color: rgbToHex(computed2.color),
|
|
70427
|
+
bold: isBold,
|
|
70428
|
+
italic: isItalic,
|
|
70429
|
+
underline: isUnderline ? true : void 0,
|
|
70430
|
+
valign: "middle",
|
|
70431
|
+
align: "left",
|
|
70432
|
+
...extractLetterSpacing(computed2) !== null ? { charSpacing: extractLetterSpacing(computed2) } : {},
|
|
70433
|
+
...extractAlpha(computed2.color) !== null ? { transparency: extractAlpha(computed2.color) } : {}
|
|
70434
|
+
},
|
|
70435
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
70436
|
+
};
|
|
70437
|
+
elements.push(directTextElement);
|
|
70438
|
+
}
|
|
70439
|
+
}
|
|
70440
|
+
}
|
|
70339
70441
|
if (shouldSplitTextFromClippedShape && overflowClipGeometry) {
|
|
70340
70442
|
const originalArea = originalShapeW * originalShapeH;
|
|
70341
70443
|
const clippedArea = clippedShapeW * clippedShapeH;
|
|
@@ -70378,7 +70480,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
70378
70480
|
cssTriangle: null,
|
|
70379
70481
|
customGeometry: null
|
|
70380
70482
|
// NO custom geometry - PPTX doesn't clip text to paths
|
|
70381
|
-
}
|
|
70483
|
+
},
|
|
70484
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
70382
70485
|
};
|
|
70383
70486
|
if (hasPadding && clippedTextShape.style) {
|
|
70384
70487
|
clippedTextShape.style.margin = [
|
|
@@ -70421,7 +70524,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
70421
70524
|
rotate: null,
|
|
70422
70525
|
cssTriangle: null,
|
|
70423
70526
|
customGeometry: null
|
|
70424
|
-
}
|
|
70527
|
+
},
|
|
70528
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
70425
70529
|
};
|
|
70426
70530
|
elements.push(extraShape);
|
|
70427
70531
|
}
|
|
@@ -70548,6 +70652,59 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
70548
70652
|
} else if (directText) {
|
|
70549
70653
|
extractedText = directText;
|
|
70550
70654
|
}
|
|
70655
|
+
if (isPlainDivFlexRow && directText && hasStructuralChildren) {
|
|
70656
|
+
const range2 = win.document.createRange();
|
|
70657
|
+
let foundTextNode = false;
|
|
70658
|
+
for (const node of Array.from(el.childNodes)) {
|
|
70659
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
70660
|
+
const text2 = (node.textContent || "").trim();
|
|
70661
|
+
if (text2) {
|
|
70662
|
+
if (!foundTextNode) {
|
|
70663
|
+
range2.setStart(node, 0);
|
|
70664
|
+
foundTextNode = true;
|
|
70665
|
+
}
|
|
70666
|
+
range2.setEnd(node, node.textContent?.length || 0);
|
|
70667
|
+
}
|
|
70668
|
+
}
|
|
70669
|
+
}
|
|
70670
|
+
if (foundTextNode) {
|
|
70671
|
+
const textRect = range2.getBoundingClientRect();
|
|
70672
|
+
if (textRect.width > 0 && textRect.height > 0) {
|
|
70673
|
+
const computed22 = win.getComputedStyle(el);
|
|
70674
|
+
const isBold = parseInt(computed22.fontWeight) >= 600;
|
|
70675
|
+
const isItalic = computed22.fontStyle === "italic";
|
|
70676
|
+
const isUnderline = computed22.textDecoration && computed22.textDecoration.includes("underline");
|
|
70677
|
+
let displayText = directText;
|
|
70678
|
+
if (computed22.textTransform && computed22.textTransform !== "none") {
|
|
70679
|
+
displayText = applyTextTransform2(displayText, computed22.textTransform);
|
|
70680
|
+
}
|
|
70681
|
+
const flexDirectTextElement = {
|
|
70682
|
+
type: "p",
|
|
70683
|
+
text: displayText,
|
|
70684
|
+
position: {
|
|
70685
|
+
x: pxToInch(textRect.left),
|
|
70686
|
+
y: pxToInch(textRect.top),
|
|
70687
|
+
w: pxToInch(textRect.width),
|
|
70688
|
+
h: pxToInch(textRect.height)
|
|
70689
|
+
},
|
|
70690
|
+
style: {
|
|
70691
|
+
fontSize: pxToPoints(computed22.fontSize),
|
|
70692
|
+
fontFace: extractFontFace(computed22.fontFamily),
|
|
70693
|
+
color: rgbToHex(computed22.color),
|
|
70694
|
+
bold: isBold,
|
|
70695
|
+
italic: isItalic,
|
|
70696
|
+
underline: isUnderline ? true : void 0,
|
|
70697
|
+
valign: "middle",
|
|
70698
|
+
align: "left",
|
|
70699
|
+
...extractLetterSpacing(computed22) !== null ? { charSpacing: extractLetterSpacing(computed22) } : {},
|
|
70700
|
+
...extractAlpha(computed22.color) !== null ? { transparency: extractAlpha(computed22.color) } : {}
|
|
70701
|
+
},
|
|
70702
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
70703
|
+
};
|
|
70704
|
+
elements.push(flexDirectTextElement);
|
|
70705
|
+
}
|
|
70706
|
+
}
|
|
70707
|
+
}
|
|
70551
70708
|
if (extractedText && !hasStructuralChildren) {
|
|
70552
70709
|
const computed22 = win.getComputedStyle(el);
|
|
70553
70710
|
const fontSizePx2 = parseFloat(computed22.fontSize);
|
|
@@ -70675,7 +70832,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
70675
70832
|
valign: hasPadding ? "top" : "middle",
|
|
70676
70833
|
lineSpacing: lineHeightMultiplier2 * pxToPoints(computed22.fontSize),
|
|
70677
70834
|
margin: hasPadding ? [paddingLeft * PT_PER_PX, paddingRight * PT_PER_PX, paddingBottom * PT_PER_PX, paddingTop * PT_PER_PX] : void 0
|
|
70678
|
-
}
|
|
70835
|
+
},
|
|
70836
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
70679
70837
|
};
|
|
70680
70838
|
if (baseRunOptions.transparency !== void 0 && baseRunOptions.transparency > 0) {
|
|
70681
70839
|
textElement.style.transparency = baseRunOptions.transparency;
|
|
@@ -70751,7 +70909,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
70751
70909
|
align: liComputed2.textAlign === "start" ? "left" : liComputed2.textAlign,
|
|
70752
70910
|
valign: "top",
|
|
70753
70911
|
lineSpacing: pxToPoints(liComputed2.lineHeight)
|
|
70754
|
-
}
|
|
70912
|
+
},
|
|
70913
|
+
zIndex: getEffectiveZIndex(liEl, win)
|
|
70755
70914
|
};
|
|
70756
70915
|
elements.push(textElement);
|
|
70757
70916
|
processed.add(liEl);
|
|
@@ -70799,7 +70958,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
70799
70958
|
paraSpaceBefore: 0,
|
|
70800
70959
|
paraSpaceAfter: pxToPoints(liComputed.marginBottom),
|
|
70801
70960
|
margin: [marginLeft, 0, 0, 0]
|
|
70802
|
-
}
|
|
70961
|
+
},
|
|
70962
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
70803
70963
|
};
|
|
70804
70964
|
elements.push(listElement);
|
|
70805
70965
|
liElements.forEach((li) => processed.add(li));
|
|
@@ -71025,7 +71185,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
71025
71185
|
type: el.tagName.toLowerCase(),
|
|
71026
71186
|
text: runs,
|
|
71027
71187
|
position: { x: pxToInch(x), y: pxToInch(y), w: pxToInch(w), h: pxToInch(h) },
|
|
71028
|
-
style: baseStyle
|
|
71188
|
+
style: baseStyle,
|
|
71189
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
71029
71190
|
};
|
|
71030
71191
|
elements.push(textElement);
|
|
71031
71192
|
} else {
|
|
@@ -71041,7 +71202,8 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
71041
71202
|
bold: isBold && !shouldSkipBold(computed.fontFamily),
|
|
71042
71203
|
italic: computed.fontStyle === "italic",
|
|
71043
71204
|
underline: computed.textDecoration.includes("underline")
|
|
71044
|
-
}
|
|
71205
|
+
},
|
|
71206
|
+
zIndex: getEffectiveZIndex(el, win)
|
|
71045
71207
|
};
|
|
71046
71208
|
elements.push(textElement);
|
|
71047
71209
|
}
|
|
@@ -71070,12 +71232,17 @@ ${generateStylesCss(styleMap, themeFonts)}
|
|
|
71070
71232
|
const pseudoElements = extractPseudoElements(htmlDiv, win);
|
|
71071
71233
|
elements.push(...pseudoElements);
|
|
71072
71234
|
});
|
|
71073
|
-
elements.
|
|
71074
|
-
|
|
71075
|
-
const
|
|
71076
|
-
|
|
71235
|
+
const indexedElements = elements.map((el, i) => ({ el, originalIndex: i }));
|
|
71236
|
+
indexedElements.sort((a, b) => {
|
|
71237
|
+
const zIndexA = "zIndex" in a.el && a.el.zIndex !== void 0 ? a.el.zIndex : 0;
|
|
71238
|
+
const zIndexB = "zIndex" in b.el && b.el.zIndex !== void 0 ? b.el.zIndex : 0;
|
|
71239
|
+
if (zIndexA !== zIndexB) {
|
|
71240
|
+
return zIndexA - zIndexB;
|
|
71241
|
+
}
|
|
71242
|
+
return a.originalIndex - b.originalIndex;
|
|
71077
71243
|
});
|
|
71078
|
-
|
|
71244
|
+
const sortedElements = indexedElements.map((item) => item.el);
|
|
71245
|
+
return { background, elements: sortedElements, placeholders, errors };
|
|
71079
71246
|
}
|
|
71080
71247
|
|
|
71081
71248
|
// packages/slides/convert.js
|