@treely/strapi-slices 8.3.0 → 8.4.0
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/components/ProjectGridCard/ProjectGridCard.d.ts.map +1 -1
- package/dist/components/ProjectGridCardV2/ProjectGridCardV2.d.ts.map +1 -1
- package/dist/index.cjs +38 -22
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +38 -22
- package/dist/index.js.map +3 -3
- package/dist/models/fpm/FPMProject.d.ts +6 -1
- package/dist/models/fpm/FPMProject.d.ts.map +1 -1
- package/dist/slices/ProjectsMap/ProjectsMap.d.ts.map +1 -1
- package/dist/utils/getProjectTranslation.d.ts +4 -0
- package/dist/utils/getProjectTranslation.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectGridCard.d.ts","sourceRoot":"","sources":["../../../src/components/ProjectGridCard/ProjectGridCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"ProjectGridCard.d.ts","sourceRoot":"","sources":["../../../src/components/ProjectGridCard/ProjectGridCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAQ7D,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED,eAAO,MAAM,eAAe,GAAI,cAE7B,oBAAoB,KAAG,KAAK,CAAC,GAAG,CAAC,OA0CnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectGridCardV2.d.ts","sourceRoot":"","sources":["../../../src/components/ProjectGridCardV2/ProjectGridCardV2.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"ProjectGridCardV2.d.ts","sourceRoot":"","sources":["../../../src/components/ProjectGridCardV2/ProjectGridCardV2.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAS7D,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAiBD,eAAO,MAAM,iBAAiB,GAAI,cAE/B,sBAAsB,KAAG,KAAK,CAAC,GAAG,CAAC,OAgFrC,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -307,10 +307,8 @@ var SLICES_WITH_PROJECTS = [
|
|
|
307
307
|
|
|
308
308
|
// src/utils/mergeGlobalAndStrapiBlogPostData.ts
|
|
309
309
|
var mergeGlobalAndStrapiBlogPostData = (context, global, post, blog, projects) => {
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
"large"
|
|
313
|
-
) : DEFAULT_SHARE_IMAGE;
|
|
310
|
+
const metaShareImageMedia = post.attributes.metadata?.shareImage?.media ?? global.attributes.metadata.shareImage?.media;
|
|
311
|
+
const metaShareImageUrl = metaShareImageMedia ? strapiMediaUrl_default(metaShareImageMedia, "large") : DEFAULT_SHARE_IMAGE;
|
|
314
312
|
const schemaMarkupTypes = post.attributes.metadata?.schemaMarkupTypes ?? global.attributes.metadata?.schemaMarkupTypes ?? [];
|
|
315
313
|
const returnBlog = post.attributes.slices.some(
|
|
316
314
|
(slice) => SLICES_WITH_BLOG_POSTS.includes(slice.__component)
|
|
@@ -359,10 +357,8 @@ var mergeGlobalAndStrapiBlogPostData_default = mergeGlobalAndStrapiBlogPostData;
|
|
|
359
357
|
|
|
360
358
|
// src/utils/mergeGlobalAndStrapiCustomerStoryData.ts
|
|
361
359
|
var mergeGlobalAndStrapiCustomerStoryData = (context, global, customerStory, customerStories) => {
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
"large"
|
|
365
|
-
) : DEFAULT_SHARE_IMAGE;
|
|
360
|
+
const metaShareImageMedia = customerStory.attributes.metadata?.shareImage?.media ?? global.attributes.metadata.shareImage?.media;
|
|
361
|
+
const metaShareImageUrl = metaShareImageMedia ? strapiMediaUrl_default(metaShareImageMedia, "large") : DEFAULT_SHARE_IMAGE;
|
|
366
362
|
const schemaMarkupTypes = customerStory.attributes.metadata?.schemaMarkupTypes ?? global.attributes.metadata?.schemaMarkupTypes ?? [];
|
|
367
363
|
const returnCustomerStories = customerStory.attributes.slices.some(
|
|
368
364
|
(slice) => SLICES_WITH_CUSTOMER_STORIES.includes(slice.__component)
|
|
@@ -407,10 +403,8 @@ var mergeGlobalAndStrapiCustomerStoryData_default = mergeGlobalAndStrapiCustomer
|
|
|
407
403
|
|
|
408
404
|
// src/utils/mergeGlobalAndStrapiPageData.ts
|
|
409
405
|
var mergeGlobalAndStrapiPageData = (context, global, page, blogPosts, customerStories, projects) => {
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
"large"
|
|
413
|
-
) : DEFAULT_SHARE_IMAGE;
|
|
406
|
+
const metaShareImageMedia = page.attributes.metadata?.shareImage?.media ?? global.attributes.metadata.shareImage?.media;
|
|
407
|
+
const metaShareImageUrl = metaShareImageMedia ? strapiMediaUrl_default(metaShareImageMedia, "large") : DEFAULT_SHARE_IMAGE;
|
|
414
408
|
const schemaMarkupTypes = page.attributes.metadata?.schemaMarkupTypes ?? global.attributes.metadata?.schemaMarkupTypes ?? [];
|
|
415
409
|
const returnBlogPosts = page.attributes.slices.some(
|
|
416
410
|
(slice) => SLICES_WITH_BLOG_POSTS.includes(slice.__component)
|
|
@@ -466,10 +460,8 @@ var mergeGlobalAndStrapiPageData_default = mergeGlobalAndStrapiPageData;
|
|
|
466
460
|
|
|
467
461
|
// src/utils/mergeGlobalAndStrapiProjectData.ts
|
|
468
462
|
var mergeGlobalAndStrapiProject = (context, global, project, blogPosts, projects) => {
|
|
469
|
-
const
|
|
470
|
-
|
|
471
|
-
"large"
|
|
472
|
-
) : DEFAULT_SHARE_IMAGE;
|
|
463
|
+
const metaShareImageMedia = project.attributes.metadata?.shareImage?.media ?? global.attributes.metadata.shareImage?.media;
|
|
464
|
+
const metaShareImageUrl = metaShareImageMedia ? strapiMediaUrl_default(metaShareImageMedia, "large") : DEFAULT_SHARE_IMAGE;
|
|
473
465
|
const schemaMarkupTypes = project.attributes.metadata?.schemaMarkupTypes ?? global.attributes.metadata?.schemaMarkupTypes ?? [];
|
|
474
466
|
const returnBlogPosts = project.attributes.slices.some(
|
|
475
467
|
(slice) => SLICES_WITH_BLOG_POSTS.includes(slice.__component)
|
|
@@ -3580,12 +3572,20 @@ var CertificationBadge_default = CertificationBadge;
|
|
|
3580
3572
|
// src/components/CertificationBadge/index.ts
|
|
3581
3573
|
var CertificationBadge_default2 = CertificationBadge_default;
|
|
3582
3574
|
|
|
3575
|
+
// src/utils/getProjectTranslation.ts
|
|
3576
|
+
var getProjectTranslation = (nameTranslations, locale, fallback) => {
|
|
3577
|
+
if (!nameTranslations || nameTranslations.length === 0) return fallback;
|
|
3578
|
+
const match = nameTranslations.find((t) => t.language === locale);
|
|
3579
|
+
return match?.value || fallback;
|
|
3580
|
+
};
|
|
3581
|
+
var getProjectTranslation_default = getProjectTranslation;
|
|
3582
|
+
|
|
3583
3583
|
// src/components/ProjectGridCard/ProjectGridCard.tsx
|
|
3584
3584
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3585
3585
|
var ProjectGridCard = ({
|
|
3586
3586
|
project
|
|
3587
3587
|
}) => {
|
|
3588
|
-
const { formatNumber } = (0, import_react27.useContext)(IntlContext);
|
|
3588
|
+
const { formatNumber, locale } = (0, import_react27.useContext)(IntlContext);
|
|
3589
3589
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_boemly25.Container, { height: "full", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_boemly25.Flex, { flexDir: "column", height: "full", children: [
|
|
3590
3590
|
project.thumbnail && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_boemly25.Box, { borderRadius: "xl", position: "relative", height: "36", mb: "2", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3591
3591
|
import_image16.default,
|
|
@@ -3599,7 +3599,7 @@ var ProjectGridCard = ({
|
|
|
3599
3599
|
}
|
|
3600
3600
|
}
|
|
3601
3601
|
) }),
|
|
3602
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_boemly25.Heading, { my: "4", size: "lg", children: project.
|
|
3602
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_boemly25.Heading, { my: "4", size: "lg", children: getProjectTranslation_default(project.nameTranslations, locale, project.title) }),
|
|
3603
3603
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_boemly25.Flex, { flexDir: "row", gap: "2", flexWrap: "wrap", children: [
|
|
3604
3604
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_boemly25.BoemlyTag, { backgroundColor: "gray.100", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_boemly25.Text, { size: "xsLowBold", color: "gray.800", children: formatNumber(
|
|
3605
3605
|
(project.area || 0) / 1e4,
|
|
@@ -4080,7 +4080,7 @@ var getProjectTypeLabel = (projectType, formatMessage) => {
|
|
|
4080
4080
|
var ProjectGridCardV2 = ({
|
|
4081
4081
|
project
|
|
4082
4082
|
}) => {
|
|
4083
|
-
const { formatNumber, formatMessage } = (0, import_react31.useContext)(IntlContext);
|
|
4083
|
+
const { formatNumber, formatMessage, locale } = (0, import_react31.useContext)(IntlContext);
|
|
4084
4084
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_boemly32.Box, { height: "full", borderRadius: "lg", boxShadow: "sm", overflow: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_boemly32.Flex, { flexDir: "column", height: "full", children: [
|
|
4085
4085
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_boemly32.Box, { position: "relative", height: "56", children: [
|
|
4086
4086
|
project.thumbnail && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
@@ -4124,7 +4124,7 @@ var ProjectGridCardV2 = ({
|
|
|
4124
4124
|
)
|
|
4125
4125
|
] }),
|
|
4126
4126
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_boemly32.Box, { padding: "6", backgroundColor: "white", children: [
|
|
4127
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_boemly32.Heading, { size: "xl", color: "primary.700", mb: "2", children: project.
|
|
4127
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_boemly32.Heading, { size: "xl", color: "primary.700", mb: "2", children: getProjectTranslation_default(project.nameTranslations, locale, project.title) }),
|
|
4128
4128
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_boemly32.Flex, { flexDir: "column", gap: "2", children: [
|
|
4129
4129
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_boemly32.Flex, { alignItems: "center", gap: "3", children: [
|
|
4130
4130
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react32.MapPinIcon, { size: 20, color: "var(--boemly-colors-gray-500)" }),
|
|
@@ -5128,11 +5128,23 @@ var ProjectsMap = ({
|
|
|
5128
5128
|
const coordinates = e.features[0].geometry.coordinates.slice();
|
|
5129
5129
|
const {
|
|
5130
5130
|
title,
|
|
5131
|
+
nameTranslations: nameTranslationsRaw,
|
|
5131
5132
|
projectDeveloper,
|
|
5132
5133
|
slug,
|
|
5133
5134
|
portfolioHost,
|
|
5134
5135
|
creditAvailability
|
|
5135
5136
|
} = e.features[0].properties;
|
|
5137
|
+
let parsedNameTranslations;
|
|
5138
|
+
try {
|
|
5139
|
+
parsedNameTranslations = nameTranslationsRaw ? JSON.parse(nameTranslationsRaw) : void 0;
|
|
5140
|
+
} catch {
|
|
5141
|
+
parsedNameTranslations = void 0;
|
|
5142
|
+
}
|
|
5143
|
+
const displayName = getProjectTranslation_default(
|
|
5144
|
+
parsedNameTranslations,
|
|
5145
|
+
locale,
|
|
5146
|
+
title
|
|
5147
|
+
);
|
|
5136
5148
|
const point = map.current.project(coordinates);
|
|
5137
5149
|
const popupHeight = 150;
|
|
5138
5150
|
const offset = point.y - popupHeight - 20 < 0 ? [0, 20] : [0, -20];
|
|
@@ -5189,7 +5201,7 @@ var ProjectsMap = ({
|
|
|
5189
5201
|
const description = `
|
|
5190
5202
|
<div style="padding: 2px; padding-right: 16px; min-width: 180px; max-width: 260px;">
|
|
5191
5203
|
${badge}
|
|
5192
|
-
<h3 style="font-size: 15px; font-weight: bold;">${
|
|
5204
|
+
<h3 style="font-size: 15px; font-weight: bold;">${displayName}</h3>
|
|
5193
5205
|
<p style="font-size: 15px; color: #64748b;">${developer}</p>
|
|
5194
5206
|
${button}
|
|
5195
5207
|
</div>
|
|
@@ -5260,7 +5272,11 @@ var ProjectsMap = ({
|
|
|
5260
5272
|
map.current.addControl(new import_mapbox_gl.default.NavigationControl(), "top-right");
|
|
5261
5273
|
map.current.on("load", () => {
|
|
5262
5274
|
if (map.current?.getLayer("road-number-shield")) {
|
|
5263
|
-
map.current?.setLayoutProperty(
|
|
5275
|
+
map.current?.setLayoutProperty(
|
|
5276
|
+
"road-number-shield",
|
|
5277
|
+
"visibility",
|
|
5278
|
+
"none"
|
|
5279
|
+
);
|
|
5264
5280
|
}
|
|
5265
5281
|
setIsMapReady(true);
|
|
5266
5282
|
});
|