@bendyline/squisq-react 2.12.3 → 2.12.5
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-PVRZGR5J.js → chunk-5KK6I55U.js} +2 -2
- package/dist/{chunk-CZVZ6AXP.js → chunk-FI7UATA5.js} +1 -1
- package/dist/{chunk-YVQ7KEYI.js → chunk-IERUAQFK.js} +31 -3
- package/dist/{chunk-O2ZISYT3.js → chunk-OSTSRQD3.js} +1 -1
- package/dist/{chunk-M7DM4NOX.js → chunk-PFKYO6C2.js} +1 -1
- package/dist/{chunk-MTVOORBB.js → chunk-RYLHJNQX.js} +300 -136
- package/dist/diagram-pictures/index.js +33 -17
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -7
- package/dist/json-view/index.js +2 -2
- package/dist/layers/index.js +1 -1
- package/dist/markdown/index.js +1 -1
- package/dist/page/index.js +5 -5
- package/dist/player/index.d.ts +1 -1
- package/dist/player/index.js +5 -5
- package/dist/{player-Q28R0dKx.d.ts → player-BdckuwwB.d.ts} +7 -1
- package/dist/squisq-player.full.global.js +427 -427
- package/dist/squisq-player.global.js +75 -75
- 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";
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
InlineVideoPlayer,
|
|
6
6
|
MarkdownRenderer,
|
|
7
7
|
VideoEmbedFrame
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IERUAQFK.js";
|
|
9
9
|
import {
|
|
10
10
|
BlockRenderer
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PFKYO6C2.js";
|
|
12
12
|
import {
|
|
13
13
|
svgDataImageSrc,
|
|
14
14
|
useMediaUrl
|
|
@@ -536,7 +536,17 @@ function renderInline(nodes, keyPrefix = "", ctx = DEFAULT_CTX) {
|
|
|
536
536
|
const label = node.alt || node.title || void 0;
|
|
537
537
|
return kind === "video" ? /* @__PURE__ */ jsx6(InlineVideoPlayer, { src, basePath: ".", label }, key) : /* @__PURE__ */ jsx6(InlineAudioPlayer, { src, basePath: ".", label }, key);
|
|
538
538
|
}
|
|
539
|
-
return /* @__PURE__ */ jsx6(
|
|
539
|
+
return /* @__PURE__ */ jsx6(
|
|
540
|
+
MdImage,
|
|
541
|
+
{
|
|
542
|
+
src: node.url,
|
|
543
|
+
alt: node.alt ?? "",
|
|
544
|
+
title: node.title ?? void 0,
|
|
545
|
+
width: node.width,
|
|
546
|
+
height: node.height
|
|
547
|
+
},
|
|
548
|
+
key
|
|
549
|
+
);
|
|
540
550
|
}
|
|
541
551
|
case "break":
|
|
542
552
|
return /* @__PURE__ */ jsx6("br", {}, key);
|
|
@@ -732,14 +742,30 @@ function renderTable(rows, align, key, ctx = DEFAULT_CTX) {
|
|
|
732
742
|
function renderBlocks(nodes, keyPrefix = "", ctx = DEFAULT_CTX) {
|
|
733
743
|
return nodes.map((node, i) => renderBlock(node, `${keyPrefix}b${i}`, ctx));
|
|
734
744
|
}
|
|
735
|
-
function MdImage({
|
|
745
|
+
function MdImage({
|
|
746
|
+
src,
|
|
747
|
+
alt,
|
|
748
|
+
title,
|
|
749
|
+
width,
|
|
750
|
+
height
|
|
751
|
+
}) {
|
|
736
752
|
const safeSrc = sanitizeUrl(src, "media") ?? svgDataImageSrc(src);
|
|
737
753
|
const resolved = useMediaUrl(safeSrc ?? "", ".");
|
|
738
754
|
const imageRef = useRef4(null);
|
|
739
755
|
const playback = useAnimatedImage(safeSrc ?? "", resolved);
|
|
740
756
|
if (!safeSrc) return null;
|
|
741
757
|
if (!mayBeAnimatedImage2(safeSrc)) {
|
|
742
|
-
return /* @__PURE__ */ jsx6(
|
|
758
|
+
return /* @__PURE__ */ jsx6(
|
|
759
|
+
"img",
|
|
760
|
+
{
|
|
761
|
+
className: "squisq-md-image",
|
|
762
|
+
src: resolved,
|
|
763
|
+
alt,
|
|
764
|
+
title,
|
|
765
|
+
width,
|
|
766
|
+
height
|
|
767
|
+
}
|
|
768
|
+
);
|
|
743
769
|
}
|
|
744
770
|
return /* @__PURE__ */ jsxs4(
|
|
745
771
|
"span",
|
|
@@ -756,6 +782,8 @@ function MdImage({ src, alt, title }) {
|
|
|
756
782
|
src: playback.displaySrc,
|
|
757
783
|
alt,
|
|
758
784
|
title,
|
|
785
|
+
width,
|
|
786
|
+
height,
|
|
759
787
|
style: { display: "block", maxWidth: "100%" }
|
|
760
788
|
}
|
|
761
789
|
),
|