@enyxs/wikex-components 0.8.12 → 0.8.13
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.js +58 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +58 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -645,6 +645,21 @@ var minimalUiBlocks = [
|
|
|
645
645
|
|
|
646
646
|
// src/minimal-ui/marketing-blocks.tsx
|
|
647
647
|
import { useState as useState2 } from "react";
|
|
648
|
+
|
|
649
|
+
// src/list-items.ts
|
|
650
|
+
function cmsListItems(content, fallback, field = "items") {
|
|
651
|
+
const raw = content[field];
|
|
652
|
+
if (typeof raw !== "string") return fallback;
|
|
653
|
+
try {
|
|
654
|
+
const parsed = JSON.parse(raw);
|
|
655
|
+
if (!Array.isArray(parsed)) return fallback;
|
|
656
|
+
return parsed.filter((item) => Boolean(item) && typeof item === "object").map((item) => Object.fromEntries(Object.entries(item).map(([key, value6]) => [key, typeof value6 === "string" ? value6 : ""])));
|
|
657
|
+
} catch {
|
|
658
|
+
return fallback;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
// src/minimal-ui/marketing-blocks.tsx
|
|
648
663
|
import Accordion from "@mui/material/Accordion";
|
|
649
664
|
import AccordionDetails from "@mui/material/AccordionDetails";
|
|
650
665
|
import AccordionSummary from "@mui/material/AccordionSummary";
|
|
@@ -768,6 +783,7 @@ function MetricsStrip({ content, editable, onChange }) {
|
|
|
768
783
|
);
|
|
769
784
|
}
|
|
770
785
|
function TestimonialGrid({ content, editable, onChange }) {
|
|
786
|
+
const listIndexes = cmsListItems(content, Array.from({ length: 3 }, () => ({}))).map((_, index) => index + 1);
|
|
771
787
|
return /* @__PURE__ */ jsx3(
|
|
772
788
|
Box3,
|
|
773
789
|
{
|
|
@@ -819,7 +835,7 @@ function TestimonialGrid({ content, editable, onChange }) {
|
|
|
819
835
|
mt: 3
|
|
820
836
|
}
|
|
821
837
|
},
|
|
822
|
-
children:
|
|
838
|
+
children: listIndexes.map((item) => /* @__PURE__ */ jsxs3(
|
|
823
839
|
Box3,
|
|
824
840
|
{
|
|
825
841
|
sx: {
|
|
@@ -887,6 +903,7 @@ function TestimonialGrid({ content, editable, onChange }) {
|
|
|
887
903
|
}
|
|
888
904
|
function FaqSection({ content, editable, onChange }) {
|
|
889
905
|
const [expanded, setExpanded] = useState2(1);
|
|
906
|
+
const listIndexes = cmsListItems(content, Array.from({ length: 3 }, () => ({}))).map((_, index) => index + 1);
|
|
890
907
|
return /* @__PURE__ */ jsx3(
|
|
891
908
|
Box3,
|
|
892
909
|
{
|
|
@@ -940,7 +957,7 @@ function FaqSection({ content, editable, onChange }) {
|
|
|
940
957
|
}
|
|
941
958
|
)
|
|
942
959
|
] }),
|
|
943
|
-
/* @__PURE__ */ jsx3(Box3, { children:
|
|
960
|
+
/* @__PURE__ */ jsx3(Box3, { children: listIndexes.map((item) => /* @__PURE__ */ jsxs3(
|
|
944
961
|
Accordion,
|
|
945
962
|
{
|
|
946
963
|
expanded: expanded === item,
|
|
@@ -2963,6 +2980,7 @@ var projectDefaults = {
|
|
|
2963
2980
|
project4Location: "B\xECnh D\u01B0\u01A1ng"
|
|
2964
2981
|
};
|
|
2965
2982
|
function FeaturedProjectsRenderer(props) {
|
|
2983
|
+
const listIndexes = cmsListItems(props.content, Array.from({ length: 4 }, () => ({}))).map((_, index) => index + 1);
|
|
2966
2984
|
return /* @__PURE__ */ jsx5(Box5, { component: "section", sx: { ...sectionSx, bgcolor: palette.cream, color: palette.ink }, children: /* @__PURE__ */ jsxs5(Box5, { sx: { maxWidth: 1376, mx: "auto" }, children: [
|
|
2967
2985
|
/* @__PURE__ */ jsxs5(Box5, { sx: { display: "flex", alignItems: { xs: "flex-start", md: "flex-end" }, justifyContent: "space-between", flexDirection: { xs: "column", md: "row" }, gap: 3, mb: 6 }, children: [
|
|
2968
2986
|
/* @__PURE__ */ jsxs5(Stack3, { spacing: 2, children: [
|
|
@@ -2971,7 +2989,7 @@ function FeaturedProjectsRenderer(props) {
|
|
|
2971
2989
|
] }),
|
|
2972
2990
|
/* @__PURE__ */ jsx5(Text, { props, field: "intro", fallback: projectDefaults.intro, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: { maxWidth: 420, color: palette.muted, fontSize: 16, lineHeight: 1.8 }, children: node }) })
|
|
2973
2991
|
] }),
|
|
2974
|
-
/* @__PURE__ */ jsx5(Box5, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(12, 1fr)" }, gap: 2 }, children:
|
|
2992
|
+
/* @__PURE__ */ jsx5(Box5, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(12, 1fr)" }, gap: 2 }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Box5, { sx: { position: "relative", minHeight: { xs: 390, md: index < 3 ? 600 : 430 }, overflow: "hidden", bgcolor: "#59665C", color: "white", gridColumn: { xs: "1", md: index === 1 ? "span 7" : index === 2 ? "span 5" : "span 6" } }, children: [
|
|
2975
2993
|
/* @__PURE__ */ jsx5(Image, { props, field: `project${index}Image`, fallback: projectDefaults[`project${index}Image`], alt: "D\u1EF1 \xE1n n\u1ED5i b\u1EADt" }),
|
|
2976
2994
|
/* @__PURE__ */ jsx5(Box5, { sx: { position: "absolute", inset: 0, zIndex: 1, pointerEvents: "none", background: "linear-gradient(0deg, rgba(17,24,18,.88), transparent 64%)" } }),
|
|
2977
2995
|
/* @__PURE__ */ jsx5(Box5, { sx: { position: "absolute", zIndex: 2, pointerEvents: "none", top: 20, right: 20, display: "grid", width: 44, height: 44, placeItems: "center", border: "1px solid rgba(255,255,255,.38)", borderRadius: "50%", bgcolor: "rgba(0,0,0,.12)", fontSize: 20 }, children: "\u2197" }),
|
|
@@ -3009,13 +3027,14 @@ var processDefaults = {
|
|
|
3009
3027
|
step4Description: "Nghi\u1EC7m thu chi ti\u1EBFt, b\u1EA3o h\xE0nh v\xE0 ch\u0103m s\xF3c c\xF4ng tr\xECnh l\xE2u d\xE0i."
|
|
3010
3028
|
};
|
|
3011
3029
|
function EstateProcessRenderer(props) {
|
|
3030
|
+
const listIndexes = cmsListItems(props.content, Array.from({ length: 4 }, () => ({}))).map((_, index) => index + 1);
|
|
3012
3031
|
return /* @__PURE__ */ jsx5(Box5, { component: "section", sx: { ...sectionSx, borderBlock: `1px solid ${palette.line}`, bgcolor: palette.pale, color: palette.ink }, children: /* @__PURE__ */ jsxs5(Box5, { sx: { display: "grid", maxWidth: 1376, mx: "auto", gap: { xs: 5, md: 10 }, gridTemplateColumns: { xs: "1fr", md: ".75fr 1.25fr" } }, children: [
|
|
3013
3032
|
/* @__PURE__ */ jsxs5(Stack3, { spacing: 2.5, sx: { alignItems: "flex-start" }, children: [
|
|
3014
3033
|
/* @__PURE__ */ jsx5(Text, { props, field: "eyebrow", fallback: processDefaults.eyebrow, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: outlinedEyebrowSx, children: node }) }),
|
|
3015
3034
|
/* @__PURE__ */ jsx5(Text, { props, field: "heading", fallback: processDefaults.heading, children: (node) => /* @__PURE__ */ jsx5(Box5, { component: "h2", sx: { ...headingSx, fontSize: { xs: 48, md: 78 } }, children: node }) }),
|
|
3016
3035
|
/* @__PURE__ */ jsx5(Text, { props, field: "body", fallback: processDefaults.body, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: { maxWidth: 450, color: palette.muted, fontSize: 16, lineHeight: 1.85 }, children: node }) })
|
|
3017
3036
|
] }),
|
|
3018
|
-
/* @__PURE__ */ jsx5(Stack3, { component: "ol", sx: { m: 0, p: 0, listStyle: "none", borderTop: `1px solid ${palette.line}` }, children:
|
|
3037
|
+
/* @__PURE__ */ jsx5(Stack3, { component: "ol", sx: { m: 0, p: 0, listStyle: "none", borderTop: `1px solid ${palette.line}` }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Box5, { component: "li", sx: { display: "grid", py: 3, gap: { xs: 1, md: 2 }, borderBottom: `1px solid ${palette.line}`, gridTemplateColumns: { xs: "36px 1fr", md: "56px 1fr 1fr" } }, children: [
|
|
3019
3038
|
/* @__PURE__ */ jsxs5(Box5, { sx: { color: palette.gold, fontFamily: "monospace", fontSize: 12, pt: 0.5 }, children: [
|
|
3020
3039
|
"0",
|
|
3021
3040
|
index
|
|
@@ -3056,6 +3075,7 @@ var servicesDefaults = {
|
|
|
3056
3075
|
service4Url: "#"
|
|
3057
3076
|
};
|
|
3058
3077
|
function EstateServicesRenderer(props) {
|
|
3078
|
+
const listIndexes = cmsListItems(props.content, Array.from({ length: 4 }, () => ({}))).map((_, index) => index + 1);
|
|
3059
3079
|
return /* @__PURE__ */ jsx5(Box5, { component: "section", sx: { ...sectionSx, bgcolor: palette.dark, color: "white" }, children: /* @__PURE__ */ jsxs5(Box5, { sx: { maxWidth: 1376, mx: "auto" }, children: [
|
|
3060
3080
|
/* @__PURE__ */ jsxs5(Box5, { sx: { display: "grid", gap: 4, gridTemplateColumns: { xs: "1fr", md: "1.1fr .9fr" }, alignItems: "end", mb: 6 }, children: [
|
|
3061
3081
|
/* @__PURE__ */ jsxs5(Stack3, { spacing: 2.5, children: [
|
|
@@ -3064,7 +3084,7 @@ function EstateServicesRenderer(props) {
|
|
|
3064
3084
|
] }),
|
|
3065
3085
|
/* @__PURE__ */ jsx5(Text, { props, field: "intro", fallback: servicesDefaults.intro, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: { maxWidth: 480, justifySelf: { md: "end" }, color: "rgba(255,255,255,.58)", fontSize: 16, lineHeight: 1.85 }, children: node }) })
|
|
3066
3086
|
] }),
|
|
3067
|
-
/* @__PURE__ */ jsx5(Box5, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "1fr 1fr" }, borderTop: "1px solid rgba(255,255,255,.14)", borderLeft: "1px solid rgba(255,255,255,.14)" }, children:
|
|
3087
|
+
/* @__PURE__ */ jsx5(Box5, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "1fr 1fr" }, borderTop: "1px solid rgba(255,255,255,.14)", borderLeft: "1px solid rgba(255,255,255,.14)" }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Stack3, { sx: { minHeight: { xs: 300, md: 370 }, p: { xs: 2.5, md: 4 }, borderRight: "1px solid rgba(255,255,255,.14)", borderBottom: "1px solid rgba(255,255,255,.14)", transition: "background .25s ease", "&:hover": { bgcolor: "#C2A268", color: palette.ink }, "&:hover .service-description": { color: "rgba(23,32,25,.72)" } }, children: [
|
|
3068
3088
|
/* @__PURE__ */ jsxs5(Box5, { sx: { display: "flex", justifyContent: "space-between", color: "#D8BD8A", fontFamily: "monospace", fontSize: 11 }, children: [
|
|
3069
3089
|
"0",
|
|
3070
3090
|
index,
|
|
@@ -3110,12 +3130,13 @@ var articlesDefaults = {
|
|
|
3110
3130
|
article3Url: "#"
|
|
3111
3131
|
};
|
|
3112
3132
|
function EstateArticlesRenderer(props) {
|
|
3133
|
+
const listIndexes = cmsListItems(props.content, Array.from({ length: 3 }, () => ({}))).map((_, index) => index + 1);
|
|
3113
3134
|
return /* @__PURE__ */ jsx5(Box5, { component: "section", sx: { ...sectionSx, bgcolor: "#DED7CA", color: palette.ink }, children: /* @__PURE__ */ jsxs5(Box5, { sx: { maxWidth: 1376, mx: "auto" }, children: [
|
|
3114
3135
|
/* @__PURE__ */ jsxs5(Stack3, { spacing: 2.5, sx: { mb: 6 }, children: [
|
|
3115
3136
|
/* @__PURE__ */ jsx5(Text, { props, field: "eyebrow", fallback: articlesDefaults.eyebrow, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: outlinedEyebrowSx, children: node }) }),
|
|
3116
3137
|
/* @__PURE__ */ jsx5(Text, { props, field: "heading", fallback: articlesDefaults.heading, children: (node) => /* @__PURE__ */ jsx5(Box5, { component: "h2", sx: headingSx, children: node }) })
|
|
3117
3138
|
] }),
|
|
3118
|
-
/* @__PURE__ */ jsx5(Box5, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(3, 1fr)" }, gap: "1px", bgcolor: palette.line }, children:
|
|
3139
|
+
/* @__PURE__ */ jsx5(Box5, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(3, 1fr)" }, gap: "1px", bgcolor: palette.line }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Stack3, { sx: { minHeight: 390, p: { xs: 2.5, md: 4 }, bgcolor: palette.cream, transition: "background .2s ease", "&:hover": { bgcolor: palette.pale } }, children: [
|
|
3119
3140
|
/* @__PURE__ */ jsx5(Text, { props, field: `article${index}Meta`, fallback: articlesDefaults[`article${index}Meta`], children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: { color: palette.gold, fontSize: 11, fontWeight: 800, letterSpacing: ".13em", textTransform: "uppercase" }, children: node }) }),
|
|
3120
3141
|
/* @__PURE__ */ jsx5(Text, { props, field: `article${index}Title`, fallback: articlesDefaults[`article${index}Title`], children: (node) => /* @__PURE__ */ jsx5(Box5, { component: "h3", sx: { mt: 5, fontFamily: displayFont, fontSize: { xs: 31, md: 36 }, fontWeight: 400, letterSpacing: "-.04em", lineHeight: 1.06 }, children: node }) }),
|
|
3121
3142
|
/* @__PURE__ */ jsx5(Text, { props, field: `article${index}Excerpt`, fallback: articlesDefaults[`article${index}Excerpt`], children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: { mt: 2, color: palette.muted, fontSize: 14, lineHeight: 1.75 }, children: node }) }),
|
|
@@ -3147,12 +3168,13 @@ var galleryDefaults = {
|
|
|
3147
3168
|
caption4: "M\u1ED9t g\xF3c th\u01B0 gi\xE3n ri\xEAng t\u01B0"
|
|
3148
3169
|
};
|
|
3149
3170
|
function PropertyGalleryRenderer(props) {
|
|
3171
|
+
const listIndexes = cmsListItems(props.content, Array.from({ length: 4 }, () => ({}))).map((_, index) => index + 1);
|
|
3150
3172
|
return /* @__PURE__ */ jsx5(Box5, { component: "section", sx: { ...sectionSx, bgcolor: palette.cream, color: palette.ink }, children: /* @__PURE__ */ jsxs5(Box5, { sx: { maxWidth: 1376, mx: "auto" }, children: [
|
|
3151
3173
|
/* @__PURE__ */ jsxs5(Stack3, { spacing: 2, sx: { mb: 6 }, children: [
|
|
3152
3174
|
/* @__PURE__ */ jsx5(Text, { props, field: "eyebrow", fallback: galleryDefaults.eyebrow, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: eyebrowSx, children: node }) }),
|
|
3153
3175
|
/* @__PURE__ */ jsx5(Text, { props, field: "heading", fallback: galleryDefaults.heading, children: (node) => /* @__PURE__ */ jsx5(Box5, { component: "h2", sx: headingSx, children: node }) })
|
|
3154
3176
|
] }),
|
|
3155
|
-
/* @__PURE__ */ jsx5(Box5, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr", md: "repeat(3, 1fr)" }, gap: 2 }, children:
|
|
3177
|
+
/* @__PURE__ */ jsx5(Box5, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr", md: "repeat(3, 1fr)" }, gap: 2 }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Box5, { children: [
|
|
3156
3178
|
/* @__PURE__ */ jsx5(Box5, { sx: { aspectRatio: "4 / 3" }, children: /* @__PURE__ */ jsx5(Image, { props, field: `image${index}`, fallback: galleryDefaults[`image${index}`], alt: "B\u1ED9 s\u01B0u t\u1EADp b\u1EA5t \u0111\u1ED9ng s\u1EA3n" }) }),
|
|
3157
3179
|
/* @__PURE__ */ jsx5(Text, { props, field: `caption${index}`, fallback: galleryDefaults[`caption${index}`], children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: { pt: 1, color: palette.muted, fontSize: 12 }, children: node }) })
|
|
3158
3180
|
] }, index)) })
|
|
@@ -3183,12 +3205,13 @@ var amenitiesDefaults = {
|
|
|
3183
3205
|
amenity6Description: "S\u1EF1 an t\xE2m cho t\u1EEBng kho\u1EA3nh kh\u1EAFc t\u1EA1i nh\xE0."
|
|
3184
3206
|
};
|
|
3185
3207
|
function AmenitiesRenderer(props) {
|
|
3208
|
+
const listIndexes = cmsListItems(props.content, Array.from({ length: 6 }, () => ({}))).map((_, index) => index + 1);
|
|
3186
3209
|
return /* @__PURE__ */ jsx5(Box5, { component: "section", sx: { ...sectionSx, bgcolor: palette.dark, color: "#F7F2E8" }, children: /* @__PURE__ */ jsxs5(Box5, { sx: { maxWidth: 1376, mx: "auto" }, children: [
|
|
3187
3210
|
/* @__PURE__ */ jsxs5(Stack3, { spacing: 2, sx: { mb: 6 }, children: [
|
|
3188
3211
|
/* @__PURE__ */ jsx5(Text, { props, field: "eyebrow", fallback: amenitiesDefaults.eyebrow, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: { ...eyebrowSx, color: "#D5B77E" }, children: node }) }),
|
|
3189
3212
|
/* @__PURE__ */ jsx5(Text, { props, field: "heading", fallback: amenitiesDefaults.heading, children: (node) => /* @__PURE__ */ jsx5(Box5, { component: "h2", sx: { ...headingSx, color: "#F7F2E8" }, children: node }) })
|
|
3190
3213
|
] }),
|
|
3191
|
-
/* @__PURE__ */ jsx5(Box5, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr", md: "repeat(3, 1fr)" }, borderTop: "1px solid rgba(255,255,255,.16)", borderLeft: "1px solid rgba(255,255,255,.16)" }, children:
|
|
3214
|
+
/* @__PURE__ */ jsx5(Box5, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr", md: "repeat(3, 1fr)" }, borderTop: "1px solid rgba(255,255,255,.16)", borderLeft: "1px solid rgba(255,255,255,.16)" }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Stack3, { sx: { minHeight: 320, p: { xs: 2.5, md: 3.5 }, borderRight: "1px solid rgba(255,255,255,.16)", borderBottom: "1px solid rgba(255,255,255,.16)" }, children: [
|
|
3192
3215
|
/* @__PURE__ */ jsxs5(Stack3, { direction: "row", justifyContent: "space-between", children: [
|
|
3193
3216
|
/* @__PURE__ */ jsxs5(Box5, { sx: { color: "#C9AA72", fontFamily: "monospace", fontSize: 11 }, children: [
|
|
3194
3217
|
"0",
|
|
@@ -3225,12 +3248,13 @@ var testimonialsDefaults = {
|
|
|
3225
3248
|
role3: "C\u01B0 d\xE2n"
|
|
3226
3249
|
};
|
|
3227
3250
|
function TestimonialsRenderer(props) {
|
|
3251
|
+
const listIndexes = cmsListItems(props.content, Array.from({ length: 3 }, () => ({}))).map((_, index) => index + 1);
|
|
3228
3252
|
return /* @__PURE__ */ jsx5(Box5, { component: "section", sx: { ...sectionSx, bgcolor: palette.pale, color: palette.ink }, children: /* @__PURE__ */ jsxs5(Box5, { sx: { maxWidth: 1376, mx: "auto" }, children: [
|
|
3229
3253
|
/* @__PURE__ */ jsxs5(Stack3, { spacing: 2, sx: { mb: 6 }, children: [
|
|
3230
3254
|
/* @__PURE__ */ jsx5(Text, { props, field: "eyebrow", fallback: testimonialsDefaults.eyebrow, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: eyebrowSx, children: node }) }),
|
|
3231
3255
|
/* @__PURE__ */ jsx5(Text, { props, field: "heading", fallback: testimonialsDefaults.heading, children: (node) => /* @__PURE__ */ jsx5(Box5, { component: "h2", sx: headingSx, children: node }) })
|
|
3232
3256
|
] }),
|
|
3233
|
-
/* @__PURE__ */ jsx5(Box5, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(3, 1fr)" }, gap: 2 }, children:
|
|
3257
|
+
/* @__PURE__ */ jsx5(Box5, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(3, 1fr)" }, gap: 2 }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Stack3, { sx: { minHeight: 340, p: 3, bgcolor: palette.cream, border: `1px solid ${palette.line}` }, children: [
|
|
3234
3258
|
/* @__PURE__ */ jsx5(Box5, { sx: { color: "#A17C43", fontFamily: displayFont, fontSize: 40, lineHeight: 0.6 }, children: "\u201C" }),
|
|
3235
3259
|
/* @__PURE__ */ jsx5(Text, { props, field: `quote${index}`, fallback: testimonialsDefaults[`quote${index}`], children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: { mt: 3, fontFamily: displayFont, fontSize: 25, letterSpacing: "-.025em", lineHeight: 1.3 }, children: node }) }),
|
|
3236
3260
|
/* @__PURE__ */ jsxs5(Box5, { sx: { mt: "auto", pt: 3 }, children: [
|
|
@@ -3261,12 +3285,13 @@ var faqDefaults = {
|
|
|
3261
3285
|
answer4: "H\xE3y \u0111\u1EC3 l\u1EA1i th\xF4ng tin li\xEAn h\u1EC7 \u0111\u1EC3 \u0111\u1ED9i ng\u0169 t\u01B0 v\u1EA5n v\xE0 s\u1EAFp x\u1EBFp bu\u1ED5i trao \u0111\u1ED5i ph\xF9 h\u1EE3p."
|
|
3262
3286
|
};
|
|
3263
3287
|
function FAQRenderer(props) {
|
|
3288
|
+
const listIndexes = cmsListItems(props.content, Array.from({ length: 4 }, () => ({}))).map((_, index) => index + 1);
|
|
3264
3289
|
return /* @__PURE__ */ jsx5(Box5, { component: "section", sx: { ...sectionSx, bgcolor: palette.cream, color: palette.ink }, children: /* @__PURE__ */ jsxs5(Box5, { sx: { display: "grid", maxWidth: 1376, mx: "auto", gap: { xs: 4, md: 10 }, gridTemplateColumns: { xs: "1fr", md: ".72fr 1.28fr" } }, children: [
|
|
3265
3290
|
/* @__PURE__ */ jsxs5(Stack3, { spacing: 2, children: [
|
|
3266
3291
|
/* @__PURE__ */ jsx5(Text, { props, field: "eyebrow", fallback: faqDefaults.eyebrow, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: eyebrowSx, children: node }) }),
|
|
3267
3292
|
/* @__PURE__ */ jsx5(Text, { props, field: "heading", fallback: faqDefaults.heading, children: (node) => /* @__PURE__ */ jsx5(Box5, { component: "h2", sx: { ...headingSx, fontSize: { xs: 38, md: 56 } }, children: node }) })
|
|
3268
3293
|
] }),
|
|
3269
|
-
/* @__PURE__ */ jsx5(Box5, { children:
|
|
3294
|
+
/* @__PURE__ */ jsx5(Box5, { children: listIndexes.map((index) => /* @__PURE__ */ jsx5(Box5, { sx: { py: 2.5, borderTop: `1px solid ${palette.line}`, ...index === listIndexes.length && { borderBottom: `1px solid ${palette.line}` } }, children: /* @__PURE__ */ jsxs5(Stack3, { direction: "row", spacing: 2, children: [
|
|
3270
3295
|
/* @__PURE__ */ jsxs5(Box5, { sx: { color: palette.gold, fontFamily: "monospace", fontSize: 11, pt: 0.5 }, children: [
|
|
3271
3296
|
"0",
|
|
3272
3297
|
index
|
|
@@ -3564,7 +3589,7 @@ var archiveDefaults = {
|
|
|
3564
3589
|
project3Year: "2025"
|
|
3565
3590
|
};
|
|
3566
3591
|
function archiveProjects(props) {
|
|
3567
|
-
|
|
3592
|
+
const legacy = [1, 2, 3].map((index) => ({
|
|
3568
3593
|
image: String(getValue(props, `project${index}Image`, archiveDefaults[`project${index}Image`])),
|
|
3569
3594
|
type: String(getValue(props, `project${index}Type`, archiveDefaults[`project${index}Type`])),
|
|
3570
3595
|
title: String(getValue(props, `project${index}Title`, archiveDefaults[`project${index}Title`])),
|
|
@@ -3574,6 +3599,7 @@ function archiveProjects(props) {
|
|
|
3574
3599
|
scope: String(getValue(props, `project${index}Scope`, archiveDefaults[`project${index}Scope`])),
|
|
3575
3600
|
year: String(getValue(props, `project${index}Year`, archiveDefaults[`project${index}Year`]))
|
|
3576
3601
|
}));
|
|
3602
|
+
return cmsListItems(props.content, legacy);
|
|
3577
3603
|
}
|
|
3578
3604
|
function EstateProjectsArchiveRenderer(props) {
|
|
3579
3605
|
const [query, setQuery] = useState4("");
|
|
@@ -3712,6 +3738,13 @@ var detailDefaults = {
|
|
|
3712
3738
|
ctaLabel: "Trao \u0111\u1ED5i c\xF9ng \u0111\u1ED9i ng\u0169"
|
|
3713
3739
|
};
|
|
3714
3740
|
function EstateProjectDetailRenderer(props) {
|
|
3741
|
+
const galleryIndexes = cmsListItems(props.content, Array.from({ length: 3 }, () => ({}))).map((_, index) => index + 1);
|
|
3742
|
+
const projectInformation = cmsListItems(props.content, [
|
|
3743
|
+
{ label: "\u0110\u1ECBa \u0111i\u1EC3m", value: String(props.content.location ?? detailDefaults.location) },
|
|
3744
|
+
{ label: "Ch\u1EE7 \u0111\u1EA7u t\u01B0", value: String(props.content.client ?? detailDefaults.client) },
|
|
3745
|
+
{ label: "Di\u1EC7n t\xEDch", value: String(props.content.area ?? detailDefaults.area) },
|
|
3746
|
+
{ label: "Quy m\xF4", value: String(props.content.floors ?? detailDefaults.floors) }
|
|
3747
|
+
], "information");
|
|
3715
3748
|
return /* @__PURE__ */ jsxs6(Box6, { sx: { bgcolor: palette2.cream, color: palette2.ink }, children: [
|
|
3716
3749
|
/* @__PURE__ */ jsx6(EstateProjectFonts, {}),
|
|
3717
3750
|
/* @__PURE__ */ jsxs6(Box6, { component: "section", sx: { position: "relative", isolation: "isolate", minHeight: { xs: 650, md: 900 }, overflow: "hidden", bgcolor: palette2.dark, color: "#F8F5EF" }, children: [
|
|
@@ -3726,10 +3759,10 @@ function EstateProjectDetailRenderer(props) {
|
|
|
3726
3759
|
/* @__PURE__ */ jsxs6(Box6, { component: "section", sx: { ...containerSx, display: "grid", py: { xs: 7, md: 12 }, gap: { xs: 5, md: 12 }, gridTemplateColumns: { xs: "1fr", md: ".68fr 1.32fr" } }, children: [
|
|
3727
3760
|
/* @__PURE__ */ jsxs6(Box6, { children: [
|
|
3728
3761
|
/* @__PURE__ */ jsx6(Box6, { sx: eyebrowSx2, children: "Th\xF4ng tin d\u1EF1 \xE1n" }),
|
|
3729
|
-
/* @__PURE__ */ jsx6(Box6, { sx: { mt: 3, borderTop: `1px solid ${palette2.line}` }, children:
|
|
3730
|
-
/* @__PURE__ */ jsx6(Box6, { sx: { color: palette2.muted, fontSize: 12 }, children: label }),
|
|
3731
|
-
/* @__PURE__ */ jsx6(
|
|
3732
|
-
] },
|
|
3762
|
+
/* @__PURE__ */ jsx6(Box6, { sx: { mt: 3, borderTop: `1px solid ${palette2.line}` }, children: projectInformation.map((item, index) => /* @__PURE__ */ jsxs6(Box6, { sx: { display: "flex", justifyContent: "space-between", gap: 2, py: 1.2, borderBottom: `1px solid ${palette2.line}` }, children: [
|
|
3763
|
+
/* @__PURE__ */ jsx6(Box6, { sx: { color: palette2.muted, fontSize: 12 }, children: item.label || "M\u1EE5c m\u1EDBi" }),
|
|
3764
|
+
/* @__PURE__ */ jsx6(Box6, { sx: { fontSize: 12, fontWeight: 700, textAlign: "right" }, children: item.value })
|
|
3765
|
+
] }, `${item.label}-${index}`)) })
|
|
3733
3766
|
] }),
|
|
3734
3767
|
/* @__PURE__ */ jsxs6(Stack4, { spacing: 3, sx: { alignItems: "flex-start" }, children: [
|
|
3735
3768
|
/* @__PURE__ */ jsx6(Text2, { props, field: "storyEyebrow", fallback: detailDefaults.storyEyebrow, sx: eyebrowSx2 }),
|
|
@@ -3747,13 +3780,14 @@ function EstateProjectDetailRenderer(props) {
|
|
|
3747
3780
|
] }) }),
|
|
3748
3781
|
/* @__PURE__ */ jsxs6(Box6, { component: "section", sx: { ...containerSx, py: { xs: 8, md: 13 } }, children: [
|
|
3749
3782
|
/* @__PURE__ */ jsx6(Text2, { props, field: "galleryHeading", fallback: detailDefaults.galleryHeading, component: "h2", sx: { maxWidth: 760, fontFamily: displayFont2, fontSize: { xs: 46, md: 76 }, fontWeight: 400, letterSpacing: "-.06em", lineHeight: 0.94 } }),
|
|
3750
|
-
/* @__PURE__ */ jsx6(Stack4, { spacing: { xs: 5, md: 10 }, sx: { mt: { xs: 5, md: 8 } }, children:
|
|
3783
|
+
/* @__PURE__ */ jsx6(Stack4, { spacing: { xs: 5, md: 10 }, sx: { mt: { xs: 5, md: 8 } }, children: galleryIndexes.map((index) => /* @__PURE__ */ jsxs6(Box6, { sx: { display: "grid", alignItems: "center", gap: { xs: 2, md: 8 }, gridTemplateColumns: { xs: "1fr", md: index % 2 ? "1.45fr .55fr" : ".55fr 1.45fr" } }, children: [
|
|
3751
3784
|
/* @__PURE__ */ jsx6(Box6, { sx: { order: { md: index % 2 ? 1 : 2 }, minHeight: { xs: 330, md: index === 2 ? 520 : 430 } }, children: /* @__PURE__ */ jsx6(Image2, { props, field: `gallery${index}Image`, fallback: detailDefaults[`gallery${index}Image`], alt: "H\xECnh \u1EA3nh d\u1EF1 \xE1n" }) }),
|
|
3752
3785
|
/* @__PURE__ */ jsxs6(Stack4, { sx: { order: { md: index % 2 ? 2 : 1 }, alignItems: "flex-start", borderTop: `1px solid ${palette2.line}`, pt: 2 }, spacing: 1.5, children: [
|
|
3753
3786
|
/* @__PURE__ */ jsxs6(Box6, { sx: { color: palette2.gold, fontFamily: "monospace", fontSize: 11 }, children: [
|
|
3754
3787
|
"0",
|
|
3755
3788
|
index,
|
|
3756
|
-
" /
|
|
3789
|
+
" / ",
|
|
3790
|
+
String(galleryIndexes.length).padStart(2, "0")
|
|
3757
3791
|
] }),
|
|
3758
3792
|
/* @__PURE__ */ jsx6(Text2, { props, field: `gallery${index}Caption`, fallback: detailDefaults[`gallery${index}Caption`], sx: { fontFamily: displayFont2, fontSize: { xs: 24, md: 30 }, letterSpacing: "-.035em", lineHeight: 1.18 } }),
|
|
3759
3793
|
/* @__PURE__ */ jsx6(Text2, { props, field: `gallery${index}Note`, fallback: detailDefaults[`gallery${index}Note`], sx: { color: palette2.muted, fontSize: 14, lineHeight: 1.72 } })
|
|
@@ -3798,20 +3832,9 @@ var estateProjectPageBlocks = [estateProjectsArchiveBlock, estateProjectDetailBl
|
|
|
3798
3832
|
import Box7 from "@mui/material/Box";
|
|
3799
3833
|
import Button7 from "@mui/material/Button";
|
|
3800
3834
|
import Stack5 from "@mui/material/Stack";
|
|
3801
|
-
import Typography4 from "@mui/material/Typography";
|
|
3802
3835
|
import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3803
3836
|
var allBlocks = [...estateBlocks, ...estateProjectPageBlocks, ...minimalMarketingBlocks];
|
|
3804
3837
|
var stringValue = (content, key) => String(content[key] ?? "");
|
|
3805
|
-
function parseItems(value6, fallback) {
|
|
3806
|
-
if (typeof value6 !== "string") return fallback;
|
|
3807
|
-
try {
|
|
3808
|
-
const items = JSON.parse(value6);
|
|
3809
|
-
if (!Array.isArray(items)) return fallback;
|
|
3810
|
-
return items.filter((item) => Boolean(item) && typeof item === "object").map((item) => Object.fromEntries(Object.entries(item).map(([key, itemValue]) => [key, typeof itemValue === "string" ? itemValue : ""])));
|
|
3811
|
-
} catch {
|
|
3812
|
-
return fallback;
|
|
3813
|
-
}
|
|
3814
|
-
}
|
|
3815
3838
|
function fields2(...items) {
|
|
3816
3839
|
return items.map(([key, label, type]) => ({ key, label, type, required: key === "title" || key === "question" }));
|
|
3817
3840
|
}
|
|
@@ -3846,15 +3869,19 @@ var configs = [
|
|
|
3846
3869
|
listConfig("faq-section", 3, /^item\d+(Question|Answer)$/, fields2(["question", "C\xE2u h\u1ECFi", "text"], ["answer", "Tr\u1EA3 l\u1EDDi", "textarea"]), "item", ["question", "answer"])
|
|
3847
3870
|
];
|
|
3848
3871
|
function DynamicListRenderer({ base, config, ...props }) {
|
|
3849
|
-
const items =
|
|
3850
|
-
const information = config.type === "estate-project-detail" ?
|
|
3872
|
+
const items = cmsListItems(props.content, config.legacy(props.content));
|
|
3873
|
+
const information = config.type === "estate-project-detail" ? cmsListItems(props.content, [
|
|
3851
3874
|
{ label: "\u0110\u1ECBa \u0111i\u1EC3m", value: stringValue(props.content, "location") },
|
|
3852
3875
|
{ label: "Ch\u1EE7 \u0111\u1EA7u t\u01B0", value: stringValue(props.content, "client") },
|
|
3853
3876
|
{ label: "Di\u1EC7n t\xEDch", value: stringValue(props.content, "area") },
|
|
3854
3877
|
{ label: "Quy m\xF4", value: stringValue(props.content, "floors") }
|
|
3855
3878
|
]) : [];
|
|
3856
3879
|
const BaseRenderer = base.Renderer;
|
|
3857
|
-
const content =
|
|
3880
|
+
const content = {
|
|
3881
|
+
...config.apply({ ...props.content, ...information.length ? { location: information[0]?.value ?? "", client: information[1]?.value ?? "", area: information[2]?.value ?? "", floors: information[3]?.value ?? "" } : {} }, items),
|
|
3882
|
+
items: JSON.stringify(items),
|
|
3883
|
+
...config.type === "estate-project-detail" ? { information: JSON.stringify(information) } : {}
|
|
3884
|
+
};
|
|
3858
3885
|
const add = (field, list, itemFields) => (event) => {
|
|
3859
3886
|
event.preventDefault();
|
|
3860
3887
|
event.stopPropagation();
|
|
@@ -3862,12 +3889,6 @@ function DynamicListRenderer({ base, config, ...props }) {
|
|
|
3862
3889
|
};
|
|
3863
3890
|
return /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
3864
3891
|
/* @__PURE__ */ jsx7(BaseRenderer, { ...props, content }),
|
|
3865
|
-
items.length > config.count && /* @__PURE__ */ jsx7(Box7, { sx: { px: { xs: 2, md: 4 }, py: 4, bgcolor: "#FAF8F3" }, children: /* @__PURE__ */ jsx7(Stack5, { sx: { maxWidth: 1376, mx: "auto" }, spacing: 1.5, children: items.slice(config.count).map((item, index) => /* @__PURE__ */ jsxs7(Box7, { sx: { p: 2.5, border: "1px solid rgba(32,40,32,.16)" }, children: [
|
|
3866
|
-
item.image && /* @__PURE__ */ jsx7(Box7, { component: "img", src: item.image, alt: item.title || "H\xECnh \u1EA3nh", sx: { display: "block", width: 1, maxHeight: 300, objectFit: "cover", mb: 2 } }),
|
|
3867
|
-
/* @__PURE__ */ jsx7(Typography4, { sx: { fontWeight: 700 }, children: item.question || item.title || "M\u1EE5c m\u1EDBi" }),
|
|
3868
|
-
/* @__PURE__ */ jsx7(Typography4, { sx: { mt: 0.75, color: "#687067" }, children: item.answer || item.description || item.quote || item.excerpt || "" })
|
|
3869
|
-
] }, `${item.title}-${index}`)) }) }),
|
|
3870
|
-
" ",
|
|
3871
3892
|
props.editable && /* @__PURE__ */ jsx7(Box7, { sx: { px: { xs: 2, md: 4 }, pb: 3, bgcolor: "#FAF8F3" }, children: /* @__PURE__ */ jsxs7(Stack5, { direction: "row", spacing: 1, children: [
|
|
3872
3893
|
/* @__PURE__ */ jsx7(Button7, { size: "small", variant: "outlined", onClick: add("items", items, config.fields), children: "+ Th\xEAm item" }),
|
|
3873
3894
|
config.type === "estate-project-detail" && /* @__PURE__ */ jsx7(Button7, { size: "small", variant: "outlined", onClick: add("information", information, fields2(["label", "Nh\xE3n", "text"], ["value", "Gi\xE1 tr\u1ECB", "text"])), children: "+ Th\xEAm th\xF4ng tin" })
|