@treely/strapi-slices 8.0.0 → 8.0.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 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
- copyToClipboard(`${currentUrl}#${slug}`);
5906
+ await navigator.clipboard.writeText(`${currentUrl}#${slug}`);
5909
5907
  setCopiedItem(slug);
5910
5908
  setTimeout(() => {
5911
5909
  setCopiedItem(void 0);
@@ -6228,22 +6226,16 @@ var Facts = ({ slice }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6228
6226
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6229
6227
  import_boemly41.Flex,
6230
6228
  {
6231
- justifyContent: slice.facts.length <= 4 ? "center" : "flex-start",
6229
+ justifyContent: slice.facts.length < 3 ? "center" : "flex-start",
6232
6230
  alignItems: "center",
6233
6231
  flexWrap: "wrap",
6234
6232
  mx: [null, null, null, "22", "28"],
6235
6233
  flexDir: ["column", null, null, "row"],
6236
- gap: [null, null, null, "12"],
6237
6234
  children: slice.facts.map((fact) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
6238
6235
  import_boemly41.Flex,
6239
6236
  {
6240
6237
  flexDir: "column",
6241
- width: [
6242
- "var(--boemly-sizes-full)",
6243
- null,
6244
- null,
6245
- "calc((var(--boemly-sizes-full) - var(--boemly-space-24))/ 3 )"
6246
- ],
6238
+ width: ["100%", null, null, "calc(100% / 3)"],
6247
6239
  mt: ["8", "8", "8", slice.facts.length > 3 ? "16" : "0"],
6248
6240
  children: [
6249
6241
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
@@ -7466,7 +7458,7 @@ var import_react50 = require("react");
7466
7458
  var import_boemly54 = require("boemly");
7467
7459
  var import_image31 = __toESM(require("next/image"), 1);
7468
7460
  var import_embla_carousel_react = __toESM(require("embla-carousel-react"), 1);
7469
- var import_core7 = require("@reactuses/core");
7461
+ var import_core6 = require("@reactuses/core");
7470
7462
  var import_embla_carousel_auto_scroll = __toESM(require("embla-carousel-auto-scroll"), 1);
7471
7463
 
7472
7464
  // src/slices/CarouselMarqueeBanner/styles.ts
@@ -7508,7 +7500,7 @@ var CarouselMarqueeBannerContent = ({
7508
7500
  slice
7509
7501
  }) => {
7510
7502
  const [primary50] = (0, import_boemly54.useToken)("colors", ["primary.50"]);
7511
- const { width: windowWidth } = (0, import_core7.useWindowSize)();
7503
+ const { width: windowWidth } = (0, import_core6.useWindowSize)();
7512
7504
  const hasEnoughLogosForLoop = slice.logos.length >= 5;
7513
7505
  const LOOP_ARRAY_LENGTH = windowWidth > 2e3 ? 5 : 4;
7514
7506
  const logosToRender = hasEnoughLogosForLoop ? Array.from({ length: LOOP_ARRAY_LENGTH }, () => slice.logos).flat() : slice.logos;