@treely/strapi-slices 8.0.0 → 8.0.1
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
CHANGED
|
@@ -5888,13 +5888,11 @@ var CtaOnly_default = CtaOnly;
|
|
|
5888
5888
|
var import_react35 = require("react");
|
|
5889
5889
|
var import_boemly39 = require("boemly");
|
|
5890
5890
|
var import_react36 = require("@phosphor-icons/react");
|
|
5891
|
-
var import_core6 = require("@reactuses/core");
|
|
5892
5891
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5893
5892
|
var Glossary = ({ slice }) => {
|
|
5894
5893
|
const { formatMessage } = (0, import_react35.useContext)(IntlContext);
|
|
5895
5894
|
const grouped = {};
|
|
5896
5895
|
const [copiedItem, setCopiedItem] = (0, import_react35.useState)();
|
|
5897
|
-
const [, copyToClipboard] = (0, import_core6.useCopyToClipboard)();
|
|
5898
5896
|
slice.glossary_items.sort((a, b) => a.attributes.title.localeCompare(b.attributes.title)).forEach((curr) => {
|
|
5899
5897
|
const index = curr.attributes.title.at(0)?.toUpperCase() || "A";
|
|
5900
5898
|
if (!grouped[index]) {
|
|
@@ -5903,9 +5901,9 @@ var Glossary = ({ slice }) => {
|
|
|
5903
5901
|
grouped[index].push(curr.attributes);
|
|
5904
5902
|
}, {});
|
|
5905
5903
|
const handleAnchorClick = async (slug) => {
|
|
5906
|
-
if (typeof window !== "undefined" && window.location) {
|
|
5904
|
+
if (typeof window !== "undefined" && window.location && navigator.clipboard) {
|
|
5907
5905
|
const currentUrl = window.location.href.split("#")[0];
|
|
5908
|
-
|
|
5906
|
+
await navigator.clipboard.writeText(`${currentUrl}#${slug}`);
|
|
5909
5907
|
setCopiedItem(slug);
|
|
5910
5908
|
setTimeout(() => {
|
|
5911
5909
|
setCopiedItem(void 0);
|
|
@@ -7466,7 +7464,7 @@ var import_react50 = require("react");
|
|
|
7466
7464
|
var import_boemly54 = require("boemly");
|
|
7467
7465
|
var import_image31 = __toESM(require("next/image"), 1);
|
|
7468
7466
|
var import_embla_carousel_react = __toESM(require("embla-carousel-react"), 1);
|
|
7469
|
-
var
|
|
7467
|
+
var import_core6 = require("@reactuses/core");
|
|
7470
7468
|
var import_embla_carousel_auto_scroll = __toESM(require("embla-carousel-auto-scroll"), 1);
|
|
7471
7469
|
|
|
7472
7470
|
// src/slices/CarouselMarqueeBanner/styles.ts
|
|
@@ -7508,7 +7506,7 @@ var CarouselMarqueeBannerContent = ({
|
|
|
7508
7506
|
slice
|
|
7509
7507
|
}) => {
|
|
7510
7508
|
const [primary50] = (0, import_boemly54.useToken)("colors", ["primary.50"]);
|
|
7511
|
-
const { width: windowWidth } = (0,
|
|
7509
|
+
const { width: windowWidth } = (0, import_core6.useWindowSize)();
|
|
7512
7510
|
const hasEnoughLogosForLoop = slice.logos.length >= 5;
|
|
7513
7511
|
const LOOP_ARRAY_LENGTH = windowWidth > 2e3 ? 5 : 4;
|
|
7514
7512
|
const logosToRender = hasEnoughLogosForLoop ? Array.from({ length: LOOP_ARRAY_LENGTH }, () => slice.logos).flat() : slice.logos;
|