@treely/strapi-slices 8.3.1 → 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 +30 -6
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +30 -6
- 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
|
@@ -3572,12 +3572,20 @@ var CertificationBadge_default = CertificationBadge;
|
|
|
3572
3572
|
// src/components/CertificationBadge/index.ts
|
|
3573
3573
|
var CertificationBadge_default2 = CertificationBadge_default;
|
|
3574
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
|
+
|
|
3575
3583
|
// src/components/ProjectGridCard/ProjectGridCard.tsx
|
|
3576
3584
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3577
3585
|
var ProjectGridCard = ({
|
|
3578
3586
|
project
|
|
3579
3587
|
}) => {
|
|
3580
|
-
const { formatNumber } = (0, import_react27.useContext)(IntlContext);
|
|
3588
|
+
const { formatNumber, locale } = (0, import_react27.useContext)(IntlContext);
|
|
3581
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: [
|
|
3582
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)(
|
|
3583
3591
|
import_image16.default,
|
|
@@ -3591,7 +3599,7 @@ var ProjectGridCard = ({
|
|
|
3591
3599
|
}
|
|
3592
3600
|
}
|
|
3593
3601
|
) }),
|
|
3594
|
-
/* @__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) }),
|
|
3595
3603
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_boemly25.Flex, { flexDir: "row", gap: "2", flexWrap: "wrap", children: [
|
|
3596
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(
|
|
3597
3605
|
(project.area || 0) / 1e4,
|
|
@@ -4072,7 +4080,7 @@ var getProjectTypeLabel = (projectType, formatMessage) => {
|
|
|
4072
4080
|
var ProjectGridCardV2 = ({
|
|
4073
4081
|
project
|
|
4074
4082
|
}) => {
|
|
4075
|
-
const { formatNumber, formatMessage } = (0, import_react31.useContext)(IntlContext);
|
|
4083
|
+
const { formatNumber, formatMessage, locale } = (0, import_react31.useContext)(IntlContext);
|
|
4076
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: [
|
|
4077
4085
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_boemly32.Box, { position: "relative", height: "56", children: [
|
|
4078
4086
|
project.thumbnail && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
@@ -4116,7 +4124,7 @@ var ProjectGridCardV2 = ({
|
|
|
4116
4124
|
)
|
|
4117
4125
|
] }),
|
|
4118
4126
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_boemly32.Box, { padding: "6", backgroundColor: "white", children: [
|
|
4119
|
-
/* @__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) }),
|
|
4120
4128
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_boemly32.Flex, { flexDir: "column", gap: "2", children: [
|
|
4121
4129
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_boemly32.Flex, { alignItems: "center", gap: "3", children: [
|
|
4122
4130
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react32.MapPinIcon, { size: 20, color: "var(--boemly-colors-gray-500)" }),
|
|
@@ -5120,11 +5128,23 @@ var ProjectsMap = ({
|
|
|
5120
5128
|
const coordinates = e.features[0].geometry.coordinates.slice();
|
|
5121
5129
|
const {
|
|
5122
5130
|
title,
|
|
5131
|
+
nameTranslations: nameTranslationsRaw,
|
|
5123
5132
|
projectDeveloper,
|
|
5124
5133
|
slug,
|
|
5125
5134
|
portfolioHost,
|
|
5126
5135
|
creditAvailability
|
|
5127
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
|
+
);
|
|
5128
5148
|
const point = map.current.project(coordinates);
|
|
5129
5149
|
const popupHeight = 150;
|
|
5130
5150
|
const offset = point.y - popupHeight - 20 < 0 ? [0, 20] : [0, -20];
|
|
@@ -5181,7 +5201,7 @@ var ProjectsMap = ({
|
|
|
5181
5201
|
const description = `
|
|
5182
5202
|
<div style="padding: 2px; padding-right: 16px; min-width: 180px; max-width: 260px;">
|
|
5183
5203
|
${badge}
|
|
5184
|
-
<h3 style="font-size: 15px; font-weight: bold;">${
|
|
5204
|
+
<h3 style="font-size: 15px; font-weight: bold;">${displayName}</h3>
|
|
5185
5205
|
<p style="font-size: 15px; color: #64748b;">${developer}</p>
|
|
5186
5206
|
${button}
|
|
5187
5207
|
</div>
|
|
@@ -5252,7 +5272,11 @@ var ProjectsMap = ({
|
|
|
5252
5272
|
map.current.addControl(new import_mapbox_gl.default.NavigationControl(), "top-right");
|
|
5253
5273
|
map.current.on("load", () => {
|
|
5254
5274
|
if (map.current?.getLayer("road-number-shield")) {
|
|
5255
|
-
map.current?.setLayoutProperty(
|
|
5275
|
+
map.current?.setLayoutProperty(
|
|
5276
|
+
"road-number-shield",
|
|
5277
|
+
"visibility",
|
|
5278
|
+
"none"
|
|
5279
|
+
);
|
|
5256
5280
|
}
|
|
5257
5281
|
setIsMapReady(true);
|
|
5258
5282
|
});
|