@particle-academy/react-fancy 3.4.0 → 3.4.2
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/index.cjs +12 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3248,12 +3248,17 @@ function useFloatingPosition(anchorRef, floatingRef, options = {}) {
|
|
|
3248
3248
|
}, [anchorRef, floatingRef, placement, offset]);
|
|
3249
3249
|
useLayoutEffect(() => {
|
|
3250
3250
|
if (!enabled) return;
|
|
3251
|
-
|
|
3252
|
-
|
|
3251
|
+
let raf = 0;
|
|
3252
|
+
let frames = 0;
|
|
3253
|
+
const measure = () => {
|
|
3253
3254
|
update();
|
|
3254
|
-
|
|
3255
|
+
if (!floatingRef.current && frames++ < 20) {
|
|
3256
|
+
raf = requestAnimationFrame(measure);
|
|
3257
|
+
}
|
|
3258
|
+
};
|
|
3259
|
+
measure();
|
|
3255
3260
|
return () => cancelAnimationFrame(raf);
|
|
3256
|
-
}, [update, enabled]);
|
|
3261
|
+
}, [update, enabled, floatingRef]);
|
|
3257
3262
|
useEffect(() => {
|
|
3258
3263
|
if (!enabled) return;
|
|
3259
3264
|
window.addEventListener("scroll", update, true);
|
|
@@ -10791,8 +10796,9 @@ function ContentRenderer({
|
|
|
10791
10796
|
[instanceExtensions]
|
|
10792
10797
|
);
|
|
10793
10798
|
const html = useMemo(() => {
|
|
10794
|
-
const
|
|
10795
|
-
const
|
|
10799
|
+
const safe = value ?? "";
|
|
10800
|
+
const resolvedFormat = format === "auto" ? detectFormat(safe) : format;
|
|
10801
|
+
const raw = resolvedFormat === "markdown" ? marked.parse(safe, { async: false }) : safe;
|
|
10796
10802
|
return unsafe ? raw : sanitizeHtml(raw);
|
|
10797
10803
|
}, [value, format, unsafe]);
|
|
10798
10804
|
const hasExtensions = extensions.length > 0;
|