@cntrl-site/sdk 1.24.3-7 → 1.24.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/index.js CHANGED
@@ -2407,29 +2407,13 @@ function ImageRevealSlider({ settings, content, isEditor }) {
2407
2407
  setPlacedImages((prev) => visible === "all" ? [...prev, newImage] : [newImage]);
2408
2408
  setCounter((prev) => prev >= content.length - 1 ? 0 : prev + 1);
2409
2409
  };
2410
- const handleMouseMove = (e) => {
2411
- if (!divRef.current) return;
2412
- if (cursorType === "system") {
2413
- divRef.current.style.cursor = "";
2414
- return;
2415
- }
2416
- const rect = divRef.current.getBoundingClientRect();
2417
- const mouseX = e.clientX - rect.left;
2418
- const mouseY = e.clientY - rect.top;
2419
- const isHover = target === "area" || isMouseOverImage(mouseX, mouseY, placedImages);
2420
- const newCursor = `url(${isHover ? hoverCursor : defaultCursor}), auto`;
2421
- if (divRef.current.style.cursor !== newCursor) {
2422
- divRef.current.style.cursor = newCursor;
2423
- }
2424
- };
2425
2410
  return /* @__PURE__ */ jsxRuntime.jsx(
2426
2411
  "div",
2427
2412
  {
2428
2413
  ref: divRef,
2429
2414
  onClick: handleClick,
2430
- onMouseEnter: handleMouseMove,
2431
- onMouseMove: handleMouseMove,
2432
2415
  className: styles.imageRevealSlider,
2416
+ style: { cursor: cursorType !== "system" && defaultCursor ? `url(${target === "area" ? hoverCursor : defaultCursor}), auto` : "default" },
2433
2417
  children: placedImages.map((img2) => /* @__PURE__ */ jsxRuntime.jsx(
2434
2418
  "div",
2435
2419
  {
@@ -2440,7 +2424,8 @@ function ImageRevealSlider({ settings, content, isEditor }) {
2440
2424
  position: "absolute",
2441
2425
  transform: "translate(-50%, -50%)",
2442
2426
  width: img2.width ?? "auto",
2443
- height: "auto"
2427
+ height: "auto",
2428
+ cursor: cursorType !== "system" && hoverCursor ? `url(${hoverCursor}), auto` : "default"
2444
2429
  },
2445
2430
  children: target === "area" && img2.link ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: img2.link, target: "_blank", className: styles.link, children: /* @__PURE__ */ jsxRuntime.jsx(
2446
2431
  "img",
package/dist/index.mjs CHANGED
@@ -2388,29 +2388,13 @@ function ImageRevealSlider({ settings, content, isEditor }) {
2388
2388
  setPlacedImages((prev) => visible === "all" ? [...prev, newImage] : [newImage]);
2389
2389
  setCounter((prev) => prev >= content.length - 1 ? 0 : prev + 1);
2390
2390
  };
2391
- const handleMouseMove = (e) => {
2392
- if (!divRef.current) return;
2393
- if (cursorType === "system") {
2394
- divRef.current.style.cursor = "";
2395
- return;
2396
- }
2397
- const rect = divRef.current.getBoundingClientRect();
2398
- const mouseX = e.clientX - rect.left;
2399
- const mouseY = e.clientY - rect.top;
2400
- const isHover = target === "area" || isMouseOverImage(mouseX, mouseY, placedImages);
2401
- const newCursor = `url(${isHover ? hoverCursor : defaultCursor}), auto`;
2402
- if (divRef.current.style.cursor !== newCursor) {
2403
- divRef.current.style.cursor = newCursor;
2404
- }
2405
- };
2406
2391
  return /* @__PURE__ */ jsx(
2407
2392
  "div",
2408
2393
  {
2409
2394
  ref: divRef,
2410
2395
  onClick: handleClick,
2411
- onMouseEnter: handleMouseMove,
2412
- onMouseMove: handleMouseMove,
2413
2396
  className: styles.imageRevealSlider,
2397
+ style: { cursor: cursorType !== "system" && defaultCursor ? `url(${target === "area" ? hoverCursor : defaultCursor}), auto` : "default" },
2414
2398
  children: placedImages.map((img2) => /* @__PURE__ */ jsx(
2415
2399
  "div",
2416
2400
  {
@@ -2421,7 +2405,8 @@ function ImageRevealSlider({ settings, content, isEditor }) {
2421
2405
  position: "absolute",
2422
2406
  transform: "translate(-50%, -50%)",
2423
2407
  width: img2.width ?? "auto",
2424
- height: "auto"
2408
+ height: "auto",
2409
+ cursor: cursorType !== "system" && hoverCursor ? `url(${hoverCursor}), auto` : "default"
2425
2410
  },
2426
2411
  children: target === "area" && img2.link ? /* @__PURE__ */ jsx("a", { href: img2.link, target: "_blank", className: styles.link, children: /* @__PURE__ */ jsx(
2427
2412
  "img",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk",
3
- "version": "1.24.3-7",
3
+ "version": "1.24.4",
4
4
  "description": "Generic SDK for use in public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",