@cntrl-site/components 0.1.0-5 → 0.1.0-7
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 +3 -18
- package/dist/index.mjs +4 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1483,29 +1483,14 @@ const styles = {
|
|
|
1483
1483
|
};
|
|
1484
1484
|
function LightboxGallery({ settings, content, styles: styles2, portalId }) {
|
|
1485
1485
|
const [open, setOpen] = React.useState(false);
|
|
1486
|
-
const [wrapperRef, setWrapperRef] = React.useState(null);
|
|
1487
|
-
const [coverDimensions, setCoverDimensions] = React.useState(void 0);
|
|
1488
1486
|
const { url: coverUrl } = settings.cover;
|
|
1489
|
-
|
|
1490
|
-
if (!wrapperRef) return;
|
|
1491
|
-
const observer = new ResizeObserver((entries) => {
|
|
1492
|
-
if (!wrapperRef) return;
|
|
1493
|
-
const [wrapper2] = entries;
|
|
1494
|
-
setCoverDimensions({
|
|
1495
|
-
width: Math.round(wrapper2.contentRect.width),
|
|
1496
|
-
height: Math.round(wrapper2.contentRect.height)
|
|
1497
|
-
});
|
|
1498
|
-
});
|
|
1499
|
-
observer.observe(wrapperRef);
|
|
1500
|
-
return () => observer.unobserve(wrapperRef);
|
|
1501
|
-
}, [wrapperRef]);
|
|
1502
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: setWrapperRef, children: [
|
|
1487
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1503
1488
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1504
1489
|
"img",
|
|
1505
1490
|
{
|
|
1506
1491
|
src: coverUrl,
|
|
1507
1492
|
alt: "Cover",
|
|
1508
|
-
style: { width:
|
|
1493
|
+
style: { width: "100%", height: "100%", cursor: "pointer" },
|
|
1509
1494
|
onClick: () => setOpen(true)
|
|
1510
1495
|
}
|
|
1511
1496
|
),
|
|
@@ -1917,7 +1902,7 @@ const LightboxComponent = {
|
|
|
1917
1902
|
type: "string",
|
|
1918
1903
|
title: "Align",
|
|
1919
1904
|
display: {
|
|
1920
|
-
type: "align-
|
|
1905
|
+
type: "align-vertical"
|
|
1921
1906
|
},
|
|
1922
1907
|
enum: ["top", "center", "bottom"]
|
|
1923
1908
|
},
|
package/dist/index.mjs
CHANGED
|
@@ -1480,30 +1480,15 @@ const styles = {
|
|
|
1480
1480
|
slideInBottom
|
|
1481
1481
|
};
|
|
1482
1482
|
function LightboxGallery({ settings, content, styles: styles2, portalId }) {
|
|
1483
|
-
const [open, setOpen] = useState(false);
|
|
1484
|
-
const [wrapperRef, setWrapperRef] = useState(null);
|
|
1485
|
-
const [coverDimensions, setCoverDimensions] = useState(void 0);
|
|
1483
|
+
const [open, setOpen] = React.useState(false);
|
|
1486
1484
|
const { url: coverUrl } = settings.cover;
|
|
1487
|
-
|
|
1488
|
-
if (!wrapperRef) return;
|
|
1489
|
-
const observer = new ResizeObserver((entries) => {
|
|
1490
|
-
if (!wrapperRef) return;
|
|
1491
|
-
const [wrapper2] = entries;
|
|
1492
|
-
setCoverDimensions({
|
|
1493
|
-
width: Math.round(wrapper2.contentRect.width),
|
|
1494
|
-
height: Math.round(wrapper2.contentRect.height)
|
|
1495
|
-
});
|
|
1496
|
-
});
|
|
1497
|
-
observer.observe(wrapperRef);
|
|
1498
|
-
return () => observer.unobserve(wrapperRef);
|
|
1499
|
-
}, [wrapperRef]);
|
|
1500
|
-
return /* @__PURE__ */ jsxs("div", { ref: setWrapperRef, children: [
|
|
1485
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
1501
1486
|
/* @__PURE__ */ jsx(
|
|
1502
1487
|
"img",
|
|
1503
1488
|
{
|
|
1504
1489
|
src: coverUrl,
|
|
1505
1490
|
alt: "Cover",
|
|
1506
|
-
style: { width:
|
|
1491
|
+
style: { width: "100%", height: "100%", cursor: "pointer" },
|
|
1507
1492
|
onClick: () => setOpen(true)
|
|
1508
1493
|
}
|
|
1509
1494
|
),
|
|
@@ -1915,7 +1900,7 @@ const LightboxComponent = {
|
|
|
1915
1900
|
type: "string",
|
|
1916
1901
|
title: "Align",
|
|
1917
1902
|
display: {
|
|
1918
|
-
type: "align-
|
|
1903
|
+
type: "align-vertical"
|
|
1919
1904
|
},
|
|
1920
1905
|
enum: ["top", "center", "bottom"]
|
|
1921
1906
|
},
|