@treely/strapi-slices 8.2.4 → 8.2.5

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
@@ -5246,7 +5246,7 @@ var ProjectsMap = ({
5246
5246
  const bounds = new import_mapbox_gl.default.LngLatBounds([west, south], [east, north]);
5247
5247
  const center = bounds.getCenter();
5248
5248
  initialCenter = [center.lng, center.lat];
5249
- initialZoom = 6;
5249
+ initialZoom = slice.defaultZoomLevel ?? 6;
5250
5250
  }
5251
5251
  map.current = new import_mapbox_gl.default.Map({
5252
5252
  container: mapContainer.current,
@@ -5259,12 +5259,6 @@ var ProjectsMap = ({
5259
5259
  map.current.addControl(new import_mapbox_gl.default.NavigationControl(), "top-right");
5260
5260
  map.current.on("load", () => {
5261
5261
  setIsMapReady(true);
5262
- if (!(slice.defaultCenterCoordinates && slice.defaultZoomLevel)) {
5263
- const bbox = initialBboxRef.current || FALLBACK_BBOX;
5264
- const [west, south, east, north] = bbox.split(",").map(Number);
5265
- const bounds = new import_mapbox_gl.default.LngLatBounds([west, south], [east, north]);
5266
- map.current?.fitBounds(bounds, { padding: 20 });
5267
- }
5268
5262
  });
5269
5263
  map.current.on("moveend", () => {
5270
5264
  if (initialBboxRef.current) {
@@ -5313,12 +5307,11 @@ var ProjectsMap = ({
5313
5307
  if (map.current) {
5314
5308
  map.current.easeTo({
5315
5309
  center: [userLoc.lon, userLoc.lat],
5316
- zoom: 10,
5310
+ zoom: slice.defaultZoomLevel ?? 10,
5317
5311
  duration: 1500
5318
5312
  });
5319
5313
  const buffer = 1;
5320
5314
  const bbox = `${userLoc.lon - buffer},${userLoc.lat - buffer},${userLoc.lon + buffer},${userLoc.lat + buffer}`;
5321
- initialBboxRef.current = bbox;
5322
5315
  fetchProjectsData(bbox);
5323
5316
  }
5324
5317
  },
@@ -8856,12 +8849,30 @@ var VARIANTS5 = {
8856
8849
  white: { backgroundColor: "white", titleColor: "primary.900" },
8857
8850
  gray: { backgroundColor: "primary.50", titleColor: "primary.900" }
8858
8851
  };
8852
+ var getMobileSize = (size) => {
8853
+ const sizeMap = {
8854
+ "7xl": "4xl",
8855
+ "6xl": "3xl",
8856
+ "5xl": "2xl",
8857
+ "4xl": "xl",
8858
+ "3xl": "lg",
8859
+ "2xl": "md",
8860
+ "xl": "sm",
8861
+ "lg": "xs",
8862
+ "md": "xs",
8863
+ "sm": "xs",
8864
+ "xs": "xs"
8865
+ };
8866
+ return sizeMap[size];
8867
+ };
8859
8868
  var HeroWithHighlights = ({
8860
8869
  slice
8861
8870
  }) => {
8862
8871
  const parts = parseTitle(slice.title);
8863
8872
  const variant = slice.variant || "white";
8864
8873
  const textAlign = slice.textAlign || "left";
8874
+ const desktopSize = slice.headingSize || "3xl";
8875
+ const mobileSize = getMobileSize(desktopSize);
8865
8876
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8866
8877
  import_boemly61.Box,
8867
8878
  {
@@ -8875,7 +8886,7 @@ var HeroWithHighlights = ({
8875
8886
  import_boemly61.Heading,
8876
8887
  {
8877
8888
  as: slice.headingLevel || "h1",
8878
- size: [slice.headingSize || "3xl"],
8889
+ size: [mobileSize, desktopSize],
8879
8890
  color: VARIANTS5[variant].titleColor,
8880
8891
  lineHeight: "1.3",
8881
8892
  fontWeight: "600",