@bendyline/squisq-react 2.12.3 → 2.12.4
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/{chunk-LWB4AM3W.js → chunk-4ILJDBJ7.js} +13 -3
- package/dist/{chunk-CZVZ6AXP.js → chunk-BJQCVANW.js} +1 -1
- package/dist/{chunk-MTVOORBB.js → chunk-F4YKXLEH.js} +299 -135
- package/dist/{chunk-PVRZGR5J.js → chunk-MGFMKGZY.js} +1 -1
- package/dist/{chunk-M7DM4NOX.js → chunk-PFKYO6C2.js} +1 -1
- package/dist/diagram-pictures/index.js +33 -17
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/layers/index.js +1 -1
- package/dist/page/index.js +4 -4
- package/dist/player/index.d.ts +1 -1
- package/dist/player/index.js +4 -4
- package/dist/{player-Q28R0dKx.d.ts → player-BdckuwwB.d.ts} +7 -1
- package/dist/squisq-player.full.global.js +405 -405
- package/dist/squisq-player.global.js +76 -76
- package/dist/standalone-player-full.js +1 -1
- package/dist/standalone-source.js +1 -1
- package/dist/styles/index.css +222 -28
- package/package.json +2 -2
|
@@ -445,7 +445,12 @@ function IconTextLayer({ layer, viewport, blockTime, textScale = 1 }) {
|
|
|
445
445
|
"div",
|
|
446
446
|
{
|
|
447
447
|
"data-squisq-text-content": "true",
|
|
448
|
-
style: {
|
|
448
|
+
style: {
|
|
449
|
+
width: "100%",
|
|
450
|
+
whiteSpace: "pre-wrap",
|
|
451
|
+
wordBreak: "break-word",
|
|
452
|
+
...baselineShiftStyle(style.baselineShift)
|
|
453
|
+
},
|
|
449
454
|
dangerouslySetInnerHTML: { __html: html }
|
|
450
455
|
}
|
|
451
456
|
)
|
|
@@ -491,6 +496,7 @@ function PlainTextLayer({ layer, viewport, blockTime, textScale = 1 }) {
|
|
|
491
496
|
const shrinkToFit = style.shrinkToFit === true;
|
|
492
497
|
const centerBlock = shrinkToFit && dominantBaseline === "middle";
|
|
493
498
|
const firstLineDy = centerBlock ? -((lines.length - 1) / 2) * lineHeightPx : 0;
|
|
499
|
+
const baselineShiftPx = (style.baselineShift ?? 0) * style.fontSize;
|
|
494
500
|
const textRef = useRef(null);
|
|
495
501
|
const [fit, setFit] = useState(null);
|
|
496
502
|
const linesKey = lines.join("\n");
|
|
@@ -607,7 +613,7 @@ function PlainTextLayer({ layer, viewport, blockTime, textScale = 1 }) {
|
|
|
607
613
|
style: textStyles,
|
|
608
614
|
filter: filterId ? `url(#${filterId})` : void 0,
|
|
609
615
|
transform: fitTransform,
|
|
610
|
-
children: lines.map((line, i) => /* @__PURE__ */ jsxs2("tspan", { x, dy: i === 0 ? firstLineDy : lineHeightPx, children: [
|
|
616
|
+
children: lines.map((line, i) => /* @__PURE__ */ jsxs2("tspan", { x, dy: i === 0 ? firstLineDy + baselineShiftPx : lineHeightPx, children: [
|
|
611
617
|
renderLine(line),
|
|
612
618
|
" "
|
|
613
619
|
] }, i))
|
|
@@ -704,7 +710,8 @@ function RichTextLayer({ layer, viewport, blockTime, textScale = 1 }) {
|
|
|
704
710
|
width: "100%",
|
|
705
711
|
color: style.color,
|
|
706
712
|
whiteSpace: "pre-wrap",
|
|
707
|
-
wordBreak: "break-word"
|
|
713
|
+
wordBreak: "break-word",
|
|
714
|
+
...baselineShiftStyle(style.baselineShift)
|
|
708
715
|
},
|
|
709
716
|
dangerouslySetInnerHTML: { __html: safeHtml }
|
|
710
717
|
}
|
|
@@ -758,6 +765,9 @@ function getTextAnchor(align, anchor) {
|
|
|
758
765
|
if (anchor === "center") return "middle";
|
|
759
766
|
return "start";
|
|
760
767
|
}
|
|
768
|
+
function baselineShiftStyle(shift) {
|
|
769
|
+
return shift ? { position: "relative", top: `${shift}em` } : {};
|
|
770
|
+
}
|
|
761
771
|
function getDominantBaseline(verticalAlign, anchor) {
|
|
762
772
|
if (verticalAlign === "top") return "text-before-edge";
|
|
763
773
|
if (verticalAlign === "middle") return "middle";
|