@enyxs/wikex-components 0.8.16 → 0.8.17
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.d.mts +22 -2
- package/dist/index.d.ts +22 -2
- package/dist/index.js +174 -74
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +157 -55
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { createElement } from "react";
|
|
3
|
+
|
|
1
4
|
// src/minimal-ui/blocks.tsx
|
|
2
5
|
import { useEffect, useMemo, useState } from "react";
|
|
3
6
|
import Box2 from "@mui/material/Box";
|
|
@@ -7,10 +10,29 @@ import Pagination from "@mui/material/Pagination";
|
|
|
7
10
|
import Typography2 from "@mui/material/Typography";
|
|
8
11
|
|
|
9
12
|
// src/shared/editable.tsx
|
|
13
|
+
import { createContext, useContext } from "react";
|
|
10
14
|
import Box from "@mui/material/Box";
|
|
11
15
|
import Button from "@mui/material/Button";
|
|
12
16
|
import Typography from "@mui/material/Typography";
|
|
13
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var textColorContext;
|
|
19
|
+
function getTextColorContext() {
|
|
20
|
+
textColorContext ?? (textColorContext = createContext(null));
|
|
21
|
+
return textColorContext;
|
|
22
|
+
}
|
|
23
|
+
function CmsTextColorProvider({
|
|
24
|
+
children,
|
|
25
|
+
content,
|
|
26
|
+
editable,
|
|
27
|
+
onSelectText,
|
|
28
|
+
selectedTextField
|
|
29
|
+
}) {
|
|
30
|
+
const TextColorContext = getTextColorContext();
|
|
31
|
+
return /* @__PURE__ */ jsx(TextColorContext.Provider, { value: { content, editable, onSelectText, selectedTextField }, children });
|
|
32
|
+
}
|
|
33
|
+
function validTextColor(value6) {
|
|
34
|
+
return typeof value6 === "string" && /^#[0-9a-fA-F]{6}$/.test(value6);
|
|
35
|
+
}
|
|
14
36
|
function EditableText({
|
|
15
37
|
className,
|
|
16
38
|
field,
|
|
@@ -21,6 +43,10 @@ function EditableText({
|
|
|
21
43
|
sx,
|
|
22
44
|
variant
|
|
23
45
|
}) {
|
|
46
|
+
const colorContext = useContext(getTextColorContext());
|
|
47
|
+
const colorValue = colorContext?.content[`${field}Color`];
|
|
48
|
+
const color = validTextColor(colorValue) ? colorValue : void 0;
|
|
49
|
+
const selected = editable && colorContext?.selectedTextField === field;
|
|
24
50
|
return /* @__PURE__ */ jsx(
|
|
25
51
|
Typography,
|
|
26
52
|
{
|
|
@@ -30,18 +56,29 @@ function EditableText({
|
|
|
30
56
|
contentEditable: editable,
|
|
31
57
|
suppressContentEditableWarning: true,
|
|
32
58
|
onBlur: (event) => onChange?.(field, event.currentTarget.textContent ?? ""),
|
|
33
|
-
onClick: (event) =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"&:hover": { boxShadow: "0 0 0 2px rgba(0, 167, 111, 0.22)" },
|
|
41
|
-
"&:focus": { boxShadow: "0 0 0 2px #00A76F" }
|
|
42
|
-
},
|
|
43
|
-
...sx
|
|
59
|
+
onClick: (event) => {
|
|
60
|
+
if (!editable) return;
|
|
61
|
+
event.stopPropagation();
|
|
62
|
+
colorContext?.onSelectText?.({
|
|
63
|
+
field,
|
|
64
|
+
currentColor: getComputedStyle(event.currentTarget).color
|
|
65
|
+
});
|
|
44
66
|
},
|
|
67
|
+
sx: [
|
|
68
|
+
{
|
|
69
|
+
outline: "none",
|
|
70
|
+
...editable && {
|
|
71
|
+
borderRadius: 0.75,
|
|
72
|
+
cursor: "text",
|
|
73
|
+
transition: "box-shadow 150ms ease",
|
|
74
|
+
"&:hover": { boxShadow: "0 0 0 2px rgba(0, 167, 111, 0.22)" },
|
|
75
|
+
"&:focus": { boxShadow: "0 0 0 2px #00A76F" }
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
...Array.isArray(sx) ? sx : sx ? [sx] : [],
|
|
79
|
+
...color ? [{ color }] : [],
|
|
80
|
+
...selected ? [{ outline: "2px solid #00A76F", outlineOffset: 2 }] : []
|
|
81
|
+
],
|
|
45
82
|
children: value6
|
|
46
83
|
}
|
|
47
84
|
);
|
|
@@ -885,6 +922,8 @@ function TestimonialGrid({ content, editable, onChange }) {
|
|
|
885
922
|
children: listIndexes.map((item) => /* @__PURE__ */ jsxs3(
|
|
886
923
|
Box3,
|
|
887
924
|
{
|
|
925
|
+
"data-cms-list-field": "items",
|
|
926
|
+
"data-cms-list-item-index": item - 1,
|
|
888
927
|
sx: {
|
|
889
928
|
display: "flex",
|
|
890
929
|
minHeight: 240,
|
|
@@ -1007,6 +1046,8 @@ function FaqSection({ content, editable, onChange }) {
|
|
|
1007
1046
|
/* @__PURE__ */ jsx3(Box3, { children: listIndexes.map((item) => /* @__PURE__ */ jsxs3(
|
|
1008
1047
|
Accordion,
|
|
1009
1048
|
{
|
|
1049
|
+
"data-cms-list-field": "items",
|
|
1050
|
+
"data-cms-list-item-index": item - 1,
|
|
1010
1051
|
expanded: expanded === item,
|
|
1011
1052
|
onChange: (_event, isExpanded) => setExpanded(isExpanded ? item : 0),
|
|
1012
1053
|
square: false,
|
|
@@ -3156,7 +3197,7 @@ function FeaturedProjectsRenderer(props) {
|
|
|
3156
3197
|
] }),
|
|
3157
3198
|
/* @__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 }) })
|
|
3158
3199
|
] }),
|
|
3159
|
-
/* @__PURE__ */ jsx5(Box5, { className: "estate-featured-grid", sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(12, 1fr)" }, gap: 2 }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Box5, { className: "estate-featured-card", 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: [
|
|
3200
|
+
/* @__PURE__ */ jsx5(Box5, { className: "estate-featured-grid", sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(12, 1fr)" }, gap: 2 }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Box5, { className: "estate-featured-card", "data-cms-list-field": "items", "data-cms-list-item-index": index - 1, 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: [
|
|
3160
3201
|
/* @__PURE__ */ jsx5(Image, { props, field: `project${index}Image`, fallback: projectDefaults[`project${index}Image`], alt: "D\u1EF1 \xE1n n\u1ED5i b\u1EADt" }),
|
|
3161
3202
|
/* @__PURE__ */ jsx5(Box5, { sx: { position: "absolute", inset: 0, zIndex: 1, pointerEvents: "none", background: "linear-gradient(0deg, rgba(17,24,18,.88), transparent 64%)" } }),
|
|
3162
3203
|
/* @__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" }),
|
|
@@ -3201,7 +3242,7 @@ function EstateProcessRenderer(props) {
|
|
|
3201
3242
|
/* @__PURE__ */ jsx5(Text, { props, field: "heading", fallback: processDefaults.heading, children: (node) => /* @__PURE__ */ jsx5(Box5, { className: "estate-display-lg", component: "h2", sx: { ...headingSx, fontSize: { xs: 48, md: 78 } }, children: node }) }),
|
|
3202
3243
|
/* @__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 }) })
|
|
3203
3244
|
] }),
|
|
3204
|
-
/* @__PURE__ */ jsx5(Stack3, { component: "ol", sx: { m: 0, p: 0, listStyle: "none", borderTop: `1px solid ${palette.line}` }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Box5, { className: "estate-process-row", 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: [
|
|
3245
|
+
/* @__PURE__ */ jsx5(Stack3, { component: "ol", sx: { m: 0, p: 0, listStyle: "none", borderTop: `1px solid ${palette.line}` }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Box5, { className: "estate-process-row", "data-cms-list-field": "items", "data-cms-list-item-index": index - 1, 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: [
|
|
3205
3246
|
/* @__PURE__ */ jsxs5(Box5, { sx: { color: palette.gold, fontFamily: "monospace", fontSize: 12, pt: 0.5 }, children: [
|
|
3206
3247
|
"0",
|
|
3207
3248
|
index
|
|
@@ -3251,7 +3292,7 @@ function EstateServicesRenderer(props) {
|
|
|
3251
3292
|
] }),
|
|
3252
3293
|
/* @__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 }) })
|
|
3253
3294
|
] }),
|
|
3254
|
-
/* @__PURE__ */ jsx5(Box5, { className: "estate-card-grid-2", 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, { className: "estate-service-card", 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: [
|
|
3295
|
+
/* @__PURE__ */ jsx5(Box5, { className: "estate-card-grid-2", 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, { className: "estate-service-card", "data-cms-list-field": "items", "data-cms-list-item-index": index - 1, 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: [
|
|
3255
3296
|
/* @__PURE__ */ jsxs5(Box5, { sx: { display: "flex", justifyContent: "space-between", color: "#D8BD8A", fontFamily: "monospace", fontSize: 11 }, children: [
|
|
3256
3297
|
"0",
|
|
3257
3298
|
index,
|
|
@@ -3303,7 +3344,7 @@ function EstateArticlesRenderer(props) {
|
|
|
3303
3344
|
/* @__PURE__ */ jsx5(Text, { props, field: "eyebrow", fallback: articlesDefaults.eyebrow, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: outlinedEyebrowSx, children: node }) }),
|
|
3304
3345
|
/* @__PURE__ */ jsx5(Text, { props, field: "heading", fallback: articlesDefaults.heading, children: (node) => /* @__PURE__ */ jsx5(Box5, { className: "estate-display-md", component: "h2", sx: headingSx, children: node }) })
|
|
3305
3346
|
] }),
|
|
3306
|
-
/* @__PURE__ */ jsx5(Box5, { className: "estate-card-grid-3", sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(3, 1fr)" }, gap: "1px", bgcolor: palette.line }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Stack3, { className: "estate-article-card", sx: { minHeight: 390, p: { xs: 2.5, md: 4 }, bgcolor: palette.cream, transition: "background .2s ease", "&:hover": { bgcolor: palette.pale } }, children: [
|
|
3347
|
+
/* @__PURE__ */ jsx5(Box5, { className: "estate-card-grid-3", sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(3, 1fr)" }, gap: "1px", bgcolor: palette.line }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Stack3, { className: "estate-article-card", "data-cms-list-field": "items", "data-cms-list-item-index": index - 1, sx: { minHeight: 390, p: { xs: 2.5, md: 4 }, bgcolor: palette.cream, transition: "background .2s ease", "&:hover": { bgcolor: palette.pale } }, children: [
|
|
3307
3348
|
/* @__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 }) }),
|
|
3308
3349
|
/* @__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 }) }),
|
|
3309
3350
|
/* @__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 }) }),
|
|
@@ -3341,7 +3382,7 @@ function PropertyGalleryRenderer(props) {
|
|
|
3341
3382
|
/* @__PURE__ */ jsx5(Text, { props, field: "eyebrow", fallback: galleryDefaults.eyebrow, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: eyebrowSx, children: node }) }),
|
|
3342
3383
|
/* @__PURE__ */ jsx5(Text, { props, field: "heading", fallback: galleryDefaults.heading, children: (node) => /* @__PURE__ */ jsx5(Box5, { className: "estate-display-md", component: "h2", sx: headingSx, children: node }) })
|
|
3343
3384
|
] }),
|
|
3344
|
-
/* @__PURE__ */ jsx5(Box5, { className: "estate-card-grid-3", sx: { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr", md: "repeat(3, 1fr)" }, gap: 2 }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Box5, { children: [
|
|
3385
|
+
/* @__PURE__ */ jsx5(Box5, { className: "estate-card-grid-3", sx: { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr", md: "repeat(3, 1fr)" }, gap: 2 }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Box5, { "data-cms-list-field": "items", "data-cms-list-item-index": index - 1, children: [
|
|
3345
3386
|
/* @__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" }) }),
|
|
3346
3387
|
/* @__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 }) })
|
|
3347
3388
|
] }, index)) })
|
|
@@ -3378,7 +3419,7 @@ function AmenitiesRenderer(props) {
|
|
|
3378
3419
|
/* @__PURE__ */ jsx5(Text, { props, field: "eyebrow", fallback: amenitiesDefaults.eyebrow, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: { ...eyebrowSx, color: "#D5B77E" }, children: node }) }),
|
|
3379
3420
|
/* @__PURE__ */ jsx5(Text, { props, field: "heading", fallback: amenitiesDefaults.heading, children: (node) => /* @__PURE__ */ jsx5(Box5, { className: "estate-display-md", component: "h2", sx: { ...headingSx, color: "#F7F2E8" }, children: node }) })
|
|
3380
3421
|
] }),
|
|
3381
|
-
/* @__PURE__ */ jsx5(Box5, { className: "estate-card-grid-3", 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, { className: "estate-amenity-card", 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: [
|
|
3422
|
+
/* @__PURE__ */ jsx5(Box5, { className: "estate-card-grid-3", 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, { className: "estate-amenity-card", "data-cms-list-field": "items", "data-cms-list-item-index": index - 1, 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: [
|
|
3382
3423
|
/* @__PURE__ */ jsxs5(Stack3, { direction: "row", justifyContent: "space-between", children: [
|
|
3383
3424
|
/* @__PURE__ */ jsxs5(Box5, { sx: { color: "#C9AA72", fontFamily: "monospace", fontSize: 11 }, children: [
|
|
3384
3425
|
"0",
|
|
@@ -3421,7 +3462,7 @@ function TestimonialsRenderer(props) {
|
|
|
3421
3462
|
/* @__PURE__ */ jsx5(Text, { props, field: "eyebrow", fallback: testimonialsDefaults.eyebrow, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: eyebrowSx, children: node }) }),
|
|
3422
3463
|
/* @__PURE__ */ jsx5(Text, { props, field: "heading", fallback: testimonialsDefaults.heading, children: (node) => /* @__PURE__ */ jsx5(Box5, { className: "estate-display-md", component: "h2", sx: headingSx, children: node }) })
|
|
3423
3464
|
] }),
|
|
3424
|
-
/* @__PURE__ */ jsx5(Box5, { className: "estate-card-grid-3", sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(3, 1fr)" }, gap: 2 }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Stack3, { className: "estate-testimonial-card", sx: { minHeight: 340, p: 3, bgcolor: palette.cream, border: `1px solid ${palette.line}` }, children: [
|
|
3465
|
+
/* @__PURE__ */ jsx5(Box5, { className: "estate-card-grid-3", sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(3, 1fr)" }, gap: 2 }, children: listIndexes.map((index) => /* @__PURE__ */ jsxs5(Stack3, { className: "estate-testimonial-card", "data-cms-list-field": "items", "data-cms-list-item-index": index - 1, sx: { minHeight: 340, p: 3, bgcolor: palette.cream, border: `1px solid ${palette.line}` }, children: [
|
|
3425
3466
|
/* @__PURE__ */ jsx5(Box5, { sx: { color: "#A17C43", fontFamily: displayFont, fontSize: 40, lineHeight: 0.6 }, children: "\u201C" }),
|
|
3426
3467
|
/* @__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 }) }),
|
|
3427
3468
|
/* @__PURE__ */ jsxs5(Box5, { sx: { mt: "auto", pt: 3 }, children: [
|
|
@@ -3458,7 +3499,7 @@ function FAQRenderer(props) {
|
|
|
3458
3499
|
/* @__PURE__ */ jsx5(Text, { props, field: "eyebrow", fallback: faqDefaults.eyebrow, children: (node) => /* @__PURE__ */ jsx5(Box5, { sx: eyebrowSx, children: node }) }),
|
|
3459
3500
|
/* @__PURE__ */ jsx5(Text, { props, field: "heading", fallback: faqDefaults.heading, children: (node) => /* @__PURE__ */ jsx5(Box5, { className: "estate-display-md", component: "h2", sx: { ...headingSx, fontSize: { xs: 38, md: 56 } }, children: node }) })
|
|
3460
3501
|
] }),
|
|
3461
|
-
/* @__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: [
|
|
3502
|
+
/* @__PURE__ */ jsx5(Box5, { children: listIndexes.map((index) => /* @__PURE__ */ jsx5(Box5, { "data-cms-list-field": "items", "data-cms-list-item-index": index - 1, 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: [
|
|
3462
3503
|
/* @__PURE__ */ jsxs5(Box5, { sx: { color: palette.gold, fontFamily: "monospace", fontSize: 11, pt: 0.5 }, children: [
|
|
3463
3504
|
"0",
|
|
3464
3505
|
index
|
|
@@ -3878,7 +3919,7 @@ function EstateProjectsArchiveRenderer(props) {
|
|
|
3878
3919
|
/* @__PURE__ */ jsx6(Text2, { props, field: "catalogEyebrow", fallback: archiveDefaults.catalogEyebrow, sx: eyebrowSx2 }),
|
|
3879
3920
|
/* @__PURE__ */ jsx6(Text2, { props, field: "catalogIntro", fallback: archiveDefaults.catalogIntro, sx: { maxWidth: 470, color: palette2.muted, fontSize: 15, lineHeight: 1.7 } })
|
|
3880
3921
|
] }),
|
|
3881
|
-
/* @__PURE__ */ jsx6(Box6, { className: "estate-card-grid", sx: { display: "grid", gap: 2, gridTemplateColumns: { xs: "1fr", md: "repeat(2, minmax(0, 1fr))" } }, children: projects.map((project, index) => /* @__PURE__ */ jsxs6(Box6, { className: "estate-feature-card", sx: { display: "grid", overflow: "hidden", border: `1px solid ${palette2.line}`, bgcolor: palette2.pale, gridColumn: { md: index === 0 ? "1 / -1" : "auto" }, gridTemplateColumns: { xs: "1fr", md: index === 0 ? "1.1fr .9fr" : "1fr" } }, children: [
|
|
3922
|
+
/* @__PURE__ */ jsx6(Box6, { className: "estate-card-grid", sx: { display: "grid", gap: 2, gridTemplateColumns: { xs: "1fr", md: "repeat(2, minmax(0, 1fr))" } }, children: projects.map((project, index) => /* @__PURE__ */ jsxs6(Box6, { className: "estate-feature-card", "data-cms-list-field": "items", "data-cms-list-item-index": index, sx: { display: "grid", overflow: "hidden", border: `1px solid ${palette2.line}`, bgcolor: palette2.pale, gridColumn: { md: index === 0 ? "1 / -1" : "auto" }, gridTemplateColumns: { xs: "1fr", md: index === 0 ? "1.1fr .9fr" : "1fr" } }, children: [
|
|
3882
3923
|
/* @__PURE__ */ jsxs6(Box6, { className: "estate-card-image", sx: { position: "relative", height: { xs: 300, sm: 380, md: index === 0 ? 540 : 360 } }, children: [
|
|
3883
3924
|
/* @__PURE__ */ jsx6(Image2, { props, field: `project${index + 1}Image`, fallback: project.image, alt: project.title }),
|
|
3884
3925
|
/* @__PURE__ */ jsxs6(Box6, { sx: { position: "absolute", top: 18, left: 18, px: 1, py: 0.65, border: "1px solid rgba(255,255,255,.44)", bgcolor: "rgba(23,32,25,.45)", color: "white", fontFamily: "monospace", fontSize: 11 }, children: [
|
|
@@ -4047,7 +4088,7 @@ function EstateProjectsArchiveRenderer(props) {
|
|
|
4047
4088
|
]
|
|
4048
4089
|
}
|
|
4049
4090
|
),
|
|
4050
|
-
/* @__PURE__ */ jsx6(Box6, { children: filtered.map((project, index) => /* @__PURE__ */ jsxs6(Box6, { className: "estate-list-row", sx: { display: "grid", alignItems: "center", py: 1.5, borderBottom: `1px solid ${palette2.line}`, gap: { xs: 1, md: 2 }, gridTemplateColumns: { xs: "30px 72px minmax(0, 1fr)", md: "40px 120px minmax(200px, 1.35fr) minmax(150px, .65fr) 24px" } }, children: [
|
|
4091
|
+
/* @__PURE__ */ jsx6(Box6, { children: filtered.map((project, index) => /* @__PURE__ */ jsxs6(Box6, { className: "estate-list-row", "data-cms-list-field": "items", "data-cms-list-item-index": projects.indexOf(project), sx: { display: "grid", alignItems: "center", py: 1.5, borderBottom: `1px solid ${palette2.line}`, gap: { xs: 1, md: 2 }, gridTemplateColumns: { xs: "30px 72px minmax(0, 1fr)", md: "40px 120px minmax(200px, 1.35fr) minmax(150px, .65fr) 24px" } }, children: [
|
|
4051
4092
|
/* @__PURE__ */ jsxs6(Box6, { sx: { color: palette2.gold, fontFamily: "monospace", fontSize: 11 }, children: [
|
|
4052
4093
|
"0",
|
|
4053
4094
|
index + 1
|
|
@@ -4092,7 +4133,7 @@ function EstateProjectCatalogRenderer(props) {
|
|
|
4092
4133
|
/* @__PURE__ */ jsx6(Text2, { props, field: "catalogEyebrow", fallback: archiveDefaults.catalogEyebrow, sx: eyebrowSx2 }),
|
|
4093
4134
|
/* @__PURE__ */ jsx6(Text2, { props, field: "catalogIntro", fallback: archiveDefaults.catalogIntro, sx: { maxWidth: 470, color: palette2.muted, fontSize: 15, lineHeight: 1.7 } })
|
|
4094
4135
|
] }),
|
|
4095
|
-
/* @__PURE__ */ jsx6(Box6, { className: "estate-card-grid", sx: { display: "grid", gap: 2, gridTemplateColumns: { xs: "1fr", md: "repeat(2, minmax(0, 1fr))" } }, children: projects.map((project, index) => /* @__PURE__ */ jsxs6(Box6, { className: "estate-feature-card", sx: { display: "grid", overflow: "hidden", border: `1px solid ${palette2.line}`, bgcolor: palette2.pale, gridColumn: { md: index === 0 ? "1 / -1" : "auto" }, gridTemplateColumns: { xs: "1fr", md: index === 0 ? "1.1fr .9fr" : "1fr" } }, children: [
|
|
4136
|
+
/* @__PURE__ */ jsx6(Box6, { className: "estate-card-grid", sx: { display: "grid", gap: 2, gridTemplateColumns: { xs: "1fr", md: "repeat(2, minmax(0, 1fr))" } }, children: projects.map((project, index) => /* @__PURE__ */ jsxs6(Box6, { className: "estate-feature-card", "data-cms-list-field": "items", "data-cms-list-item-index": index, sx: { display: "grid", overflow: "hidden", border: `1px solid ${palette2.line}`, bgcolor: palette2.pale, gridColumn: { md: index === 0 ? "1 / -1" : "auto" }, gridTemplateColumns: { xs: "1fr", md: index === 0 ? "1.1fr .9fr" : "1fr" } }, children: [
|
|
4096
4137
|
/* @__PURE__ */ jsxs6(Box6, { className: "estate-card-image", sx: { position: "relative", height: { xs: 300, sm: 380, md: index === 0 ? 540 : 360 } }, children: [
|
|
4097
4138
|
/* @__PURE__ */ jsx6(Image2, { props, field: `project${index + 1}Image`, fallback: project.image, alt: project.title }),
|
|
4098
4139
|
/* @__PURE__ */ jsxs6(Box6, { sx: { position: "absolute", top: 18, left: 18, px: 1, py: 0.65, border: "1px solid rgba(255,255,255,.44)", bgcolor: "rgba(23,32,25,.45)", color: "white", fontFamily: "monospace", fontSize: 11 }, children: [
|
|
@@ -4129,7 +4170,7 @@ function EstateProjectExplorerRenderer(props) {
|
|
|
4129
4170
|
const filters = ["T\u1EA5t c\u1EA3", ...Array.from(new Set(projects.map((project) => project.type)))];
|
|
4130
4171
|
const filtered = useMemo2(() => {
|
|
4131
4172
|
const search = query.trim().toLocaleLowerCase("vi");
|
|
4132
|
-
return projects.filter((project) => (filter === "T\u1EA5t c\u1EA3" || project.type === filter) && (!search || [project.title, project.location, project.client, project.scope].join(" ").toLocaleLowerCase("vi").includes(search)));
|
|
4173
|
+
return projects.map((project, index) => ({ project, index })).filter(({ project }) => (filter === "T\u1EA5t c\u1EA3" || project.type === filter) && (!search || [project.title, project.location, project.client, project.scope].join(" ").toLocaleLowerCase("vi").includes(search)));
|
|
4133
4174
|
}, [filter, projects, query]);
|
|
4134
4175
|
return /* @__PURE__ */ jsxs6(Box6, { sx: { ...estateResponsiveSx2, py: { xs: 8, md: 12 }, borderTop: `1px solid ${palette2.line}`, bgcolor: palette2.pale, color: palette2.ink }, children: [
|
|
4135
4176
|
/* @__PURE__ */ jsx6(EstateProjectFonts, {}),
|
|
@@ -4158,23 +4199,32 @@ function EstateProjectExplorerRenderer(props) {
|
|
|
4158
4199
|
filter
|
|
4159
4200
|
] })
|
|
4160
4201
|
] }),
|
|
4161
|
-
/* @__PURE__ */ jsx6(Box6, { children: filtered.map((project, index) => /* @__PURE__ */ jsxs6(
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4202
|
+
/* @__PURE__ */ jsx6(Box6, { children: filtered.map(({ project, index }, displayIndex) => /* @__PURE__ */ jsxs6(
|
|
4203
|
+
Box6,
|
|
4204
|
+
{
|
|
4205
|
+
className: "estate-list-row",
|
|
4206
|
+
"data-cms-list-field": "items",
|
|
4207
|
+
"data-cms-list-item-index": index,
|
|
4208
|
+
sx: { display: "grid", alignItems: "center", py: 1.5, borderBottom: `1px solid ${palette2.line}`, gap: { xs: 1, md: 2 }, gridTemplateColumns: { xs: "30px 72px minmax(0, 1fr)", md: "40px 120px minmax(200px, 1.35fr) minmax(150px, .65fr) 24px" } },
|
|
4209
|
+
children: [
|
|
4210
|
+
/* @__PURE__ */ jsxs6(Box6, { sx: { color: palette2.gold, fontFamily: "monospace", fontSize: 11 }, children: [
|
|
4211
|
+
"0",
|
|
4212
|
+
displayIndex + 1
|
|
4213
|
+
] }),
|
|
4214
|
+
project.image ? /* @__PURE__ */ jsx6(Box6, { component: "img", src: project.image, alt: "", sx: { width: 1, height: { xs: 58, md: 74 }, objectFit: "cover" } }) : /* @__PURE__ */ jsx6(Box6, { sx: { width: 1, height: { xs: 58, md: 74 }, bgcolor: "rgba(32, 40, 32, 0.08)" } }),
|
|
4215
|
+
/* @__PURE__ */ jsxs6(Box6, { sx: { minWidth: 0 }, children: [
|
|
4216
|
+
/* @__PURE__ */ jsx6(Text2, { props, field: `project${index + 1}Type`, fallback: project.type, sx: { color: palette2.gold, fontSize: 10, fontWeight: 700, letterSpacing: ".1em", textTransform: "uppercase" } }),
|
|
4217
|
+
/* @__PURE__ */ jsx6(Text2, { className: "estate-list-title", props, field: `project${index + 1}Title`, fallback: project.title, sx: { mt: 0.5, fontFamily: displayFont2, fontSize: { xs: 22, md: 28 }, letterSpacing: "-.035em" } })
|
|
4218
|
+
] }),
|
|
4219
|
+
/* @__PURE__ */ jsxs6(Box6, { className: "estate-desktop-meta", sx: { display: { xs: "none", md: "block" }, color: palette2.muted, fontSize: 12 }, children: [
|
|
4220
|
+
/* @__PURE__ */ jsx6(Text2, { props, field: `project${index + 1}Location`, fallback: project.location }),
|
|
4221
|
+
/* @__PURE__ */ jsx6(Text2, { props, field: `project${index + 1}Year`, fallback: project.year })
|
|
4222
|
+
] }),
|
|
4223
|
+
/* @__PURE__ */ jsx6(Box6, { className: "estate-desktop-meta", sx: { display: { xs: "none", md: "block" }, color: palette2.gold, fontSize: 20 }, children: "\u2197" })
|
|
4224
|
+
]
|
|
4225
|
+
},
|
|
4226
|
+
`${project.title}-${index}`
|
|
4227
|
+
)) }),
|
|
4178
4228
|
props.editable && /* @__PURE__ */ jsx6(Box6, { sx: { display: "flex", justifyContent: "flex-end", mt: 2 }, children: /* @__PURE__ */ jsx6(AddProjectButton, { onAdd: props.onAddListItem }) })
|
|
4179
4229
|
] })
|
|
4180
4230
|
] });
|
|
@@ -4258,7 +4308,7 @@ function EstateProjectDetailRenderer(props) {
|
|
|
4258
4308
|
/* @__PURE__ */ jsxs6(Box6, { className: "estate-container estate-split", component: "section", sx: { ...containerSx, display: "grid", py: { xs: 7, md: 12 }, gap: { xs: 5, md: 12 }, gridTemplateColumns: { xs: "1fr", md: ".68fr 1.32fr" } }, children: [
|
|
4259
4309
|
/* @__PURE__ */ jsxs6(Box6, { children: [
|
|
4260
4310
|
/* @__PURE__ */ jsx6(Box6, { sx: eyebrowSx2, children: "Th\xF4ng tin d\u1EF1 \xE1n" }),
|
|
4261
|
-
/* @__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: [
|
|
4311
|
+
/* @__PURE__ */ jsx6(Box6, { sx: { mt: 3, borderTop: `1px solid ${palette2.line}` }, children: projectInformation.map((item, index) => /* @__PURE__ */ jsxs6(Box6, { "data-cms-list-field": "information", "data-cms-list-item-index": index, sx: { display: "flex", justifyContent: "space-between", gap: 2, py: 1.2, borderBottom: `1px solid ${palette2.line}` }, children: [
|
|
4262
4312
|
/* @__PURE__ */ jsx6(Box6, { sx: { color: palette2.muted, fontSize: 12 }, children: item.label || "M\u1EE5c m\u1EDBi" }),
|
|
4263
4313
|
/* @__PURE__ */ jsx6(Box6, { sx: { fontSize: 12, fontWeight: 700, textAlign: "right" }, children: item.value })
|
|
4264
4314
|
] }, `${item.label}-${index}`)) })
|
|
@@ -4279,7 +4329,7 @@ function EstateProjectDetailRenderer(props) {
|
|
|
4279
4329
|
] }) }),
|
|
4280
4330
|
/* @__PURE__ */ jsxs6(Box6, { className: "estate-container", component: "section", sx: { ...containerSx, py: { xs: 8, md: 13 } }, children: [
|
|
4281
4331
|
/* @__PURE__ */ jsx6(Text2, { className: "estate-display-lg", 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 } }),
|
|
4282
|
-
/* @__PURE__ */ jsx6(Stack4, { spacing: { xs: 5, md: 10 }, sx: { mt: { xs: 5, md: 8 } }, children: galleryIndexes.map((index) => /* @__PURE__ */ jsxs6(Box6, { className: "estate-split", sx: { display: "grid", alignItems: "center", gap: { xs: 2, md: 8 }, gridTemplateColumns: { xs: "1fr", md: index % 2 ? "1.45fr .55fr" : ".55fr 1.45fr" } }, children: [
|
|
4332
|
+
/* @__PURE__ */ jsx6(Stack4, { spacing: { xs: 5, md: 10 }, sx: { mt: { xs: 5, md: 8 } }, children: galleryIndexes.map((index) => /* @__PURE__ */ jsxs6(Box6, { className: "estate-split", "data-cms-list-field": "items", "data-cms-list-item-index": index - 1, sx: { display: "grid", alignItems: "center", gap: { xs: 2, md: 8 }, gridTemplateColumns: { xs: "1fr", md: index % 2 ? "1.45fr .55fr" : ".55fr 1.45fr" } }, children: [
|
|
4283
4333
|
/* @__PURE__ */ jsx6(Box6, { className: "estate-gallery-image", 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" }) }),
|
|
4284
4334
|
/* @__PURE__ */ jsxs6(Stack4, { className: "estate-gallery-copy", sx: { order: { md: index % 2 ? 2 : 1 }, alignItems: "flex-start", borderTop: `1px solid ${palette2.line}`, pt: 2 }, spacing: 1.5, children: [
|
|
4285
4335
|
/* @__PURE__ */ jsxs6(Box6, { sx: { color: palette2.gold, fontFamily: "monospace", fontSize: 11 }, children: [
|
|
@@ -4325,7 +4375,7 @@ function EstateProjectInformationRenderer(props) {
|
|
|
4325
4375
|
/* @__PURE__ */ jsx6(EstateProjectFonts, {}),
|
|
4326
4376
|
/* @__PURE__ */ jsxs6(Box6, { className: "estate-container", sx: { ...containerSx, py: { xs: 7, md: 10 } }, children: [
|
|
4327
4377
|
/* @__PURE__ */ jsx6(Text2, { props, field: "informationEyebrow", fallback: "Th\xF4ng tin d\u1EF1 \xE1n", sx: eyebrowSx2 }),
|
|
4328
|
-
/* @__PURE__ */ jsx6(Box6, { sx: { maxWidth: 820, mt: 3, borderTop: `1px solid ${palette2.line}` }, children: information.map((item, index) => /* @__PURE__ */ jsxs6(Box6, { sx: { display: "flex", justifyContent: "space-between", gap: 2, py: 1.5, borderBottom: `1px solid ${palette2.line}` }, children: [
|
|
4378
|
+
/* @__PURE__ */ jsx6(Box6, { sx: { maxWidth: 820, mt: 3, borderTop: `1px solid ${palette2.line}` }, children: information.map((item, index) => /* @__PURE__ */ jsxs6(Box6, { "data-cms-list-field": "items", "data-cms-list-item-index": index, sx: { display: "flex", justifyContent: "space-between", gap: 2, py: 1.5, borderBottom: `1px solid ${palette2.line}` }, children: [
|
|
4329
4379
|
/* @__PURE__ */ jsx6(Box6, { sx: { color: palette2.muted, fontSize: 12 }, children: item.label || "M\u1EE5c m\u1EDBi" }),
|
|
4330
4380
|
/* @__PURE__ */ jsx6(Box6, { sx: { fontSize: 12, fontWeight: 700, textAlign: "right" }, children: item.value })
|
|
4331
4381
|
] }, `${item.label}-${index}`)) })
|
|
@@ -4361,7 +4411,7 @@ function EstateProjectGalleryRenderer(props) {
|
|
|
4361
4411
|
/* @__PURE__ */ jsx6(EstateProjectFonts, {}),
|
|
4362
4412
|
/* @__PURE__ */ jsxs6(Box6, { className: "estate-container", sx: { ...containerSx, py: { xs: 8, md: 13 } }, children: [
|
|
4363
4413
|
/* @__PURE__ */ jsx6(Text2, { className: "estate-display-lg", 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 } }),
|
|
4364
|
-
/* @__PURE__ */ jsx6(Stack4, { spacing: { xs: 5, md: 10 }, sx: { mt: { xs: 5, md: 8 } }, children: galleryIndexes.map((index) => /* @__PURE__ */ jsxs6(Box6, { className: "estate-split", sx: { display: "grid", alignItems: "center", gap: { xs: 2, md: 8 }, gridTemplateColumns: { xs: "1fr", md: index % 2 ? "1.45fr .55fr" : ".55fr 1.45fr" } }, children: [
|
|
4414
|
+
/* @__PURE__ */ jsx6(Stack4, { spacing: { xs: 5, md: 10 }, sx: { mt: { xs: 5, md: 8 } }, children: galleryIndexes.map((index) => /* @__PURE__ */ jsxs6(Box6, { className: "estate-split", "data-cms-list-field": "items", "data-cms-list-item-index": index - 1, sx: { display: "grid", alignItems: "center", gap: { xs: 2, md: 8 }, gridTemplateColumns: { xs: "1fr", md: index % 2 ? "1.45fr .55fr" : ".55fr 1.45fr" } }, children: [
|
|
4365
4415
|
/* @__PURE__ */ jsx6(Box6, { className: "estate-gallery-image", 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" }) }),
|
|
4366
4416
|
/* @__PURE__ */ jsxs6(Stack4, { className: "estate-gallery-copy", sx: { order: { md: index % 2 ? 2 : 1 }, alignItems: "flex-start", borderTop: `1px solid ${palette2.line}`, pt: 2 }, spacing: 1.5, children: [
|
|
4367
4417
|
/* @__PURE__ */ jsxs6(Box6, { sx: { color: palette2.gold, fontFamily: "monospace", fontSize: 11 }, children: [
|
|
@@ -4465,9 +4515,16 @@ function fields2(...items) {
|
|
|
4465
4515
|
function indexed(prefix, names) {
|
|
4466
4516
|
return (content, items) => ({
|
|
4467
4517
|
...content,
|
|
4468
|
-
...Object.fromEntries(items.flatMap((item, index) => names.
|
|
4518
|
+
...Object.fromEntries(items.flatMap((item, index) => names.flatMap((name) => {
|
|
4519
|
+
const field = indexedKey(prefix, index, name);
|
|
4520
|
+
const color = item[`${name}Color`];
|
|
4521
|
+
return [[field, item[name] ?? ""], ...validTextColor2(color) ? [[`${field}Color`, color]] : []];
|
|
4522
|
+
})))
|
|
4469
4523
|
});
|
|
4470
4524
|
}
|
|
4525
|
+
function validTextColor2(value6) {
|
|
4526
|
+
return typeof value6 === "string" && /^#[0-9a-fA-F]{6}$/.test(value6);
|
|
4527
|
+
}
|
|
4471
4528
|
function indexedKey(prefix, index, name) {
|
|
4472
4529
|
return prefix ? `${prefix}${index + 1}${name[0].toUpperCase()}${name.slice(1)}` : `${name}${index + 1}`;
|
|
4473
4530
|
}
|
|
@@ -4519,11 +4576,16 @@ function sampleItem(templates, itemFields, index) {
|
|
|
4519
4576
|
function restoreEmptyItems(items, templates, itemFields) {
|
|
4520
4577
|
return items.map((item, index) => {
|
|
4521
4578
|
const sample = sampleItem(templates, itemFields, index);
|
|
4579
|
+
const backgroundColor = item.backgroundColor;
|
|
4522
4580
|
return Object.fromEntries(
|
|
4523
|
-
itemFields.
|
|
4581
|
+
itemFields.flatMap((field) => {
|
|
4524
4582
|
const currentValue = item[field.key]?.trim();
|
|
4525
|
-
|
|
4526
|
-
|
|
4583
|
+
const color = item[`${field.key}Color`];
|
|
4584
|
+
return [
|
|
4585
|
+
[field.key, currentValue || sample[field.key] || fallbackSampleValue(field, index)],
|
|
4586
|
+
...validTextColor2(color) ? [[`${field.key}Color`, color]] : []
|
|
4587
|
+
];
|
|
4588
|
+
}).concat(validTextColor2(backgroundColor) ? [["backgroundColor", backgroundColor]] : [])
|
|
4527
4589
|
);
|
|
4528
4590
|
});
|
|
4529
4591
|
}
|
|
@@ -4595,14 +4657,40 @@ function DynamicListRenderer({ base, config, ...props }) {
|
|
|
4595
4657
|
}
|
|
4596
4658
|
props.onImageRequest?.(field);
|
|
4597
4659
|
};
|
|
4660
|
+
const handleTextSelect = (target) => {
|
|
4661
|
+
for (let index = 0; index < items.length; index += 1) {
|
|
4662
|
+
const itemField = config.fields.find(
|
|
4663
|
+
(field) => field.type !== "image" && field.type !== "link" && indexedKey(config.prefix, index, field.key) === target.field
|
|
4664
|
+
);
|
|
4665
|
+
if (itemField) {
|
|
4666
|
+
props.onSelectText?.({
|
|
4667
|
+
...target,
|
|
4668
|
+
listField: "items",
|
|
4669
|
+
itemIndex: index,
|
|
4670
|
+
itemKey: itemField.key
|
|
4671
|
+
});
|
|
4672
|
+
return;
|
|
4673
|
+
}
|
|
4674
|
+
}
|
|
4675
|
+
props.onSelectText?.(target);
|
|
4676
|
+
};
|
|
4598
4677
|
return /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
4599
4678
|
/* @__PURE__ */ jsx7(
|
|
4600
|
-
|
|
4679
|
+
CmsTextColorProvider,
|
|
4601
4680
|
{
|
|
4602
|
-
...props,
|
|
4603
4681
|
content,
|
|
4604
|
-
|
|
4605
|
-
|
|
4682
|
+
editable: props.editable,
|
|
4683
|
+
onSelectText: handleTextSelect,
|
|
4684
|
+
selectedTextField: props.selectedTextField,
|
|
4685
|
+
children: /* @__PURE__ */ jsx7(
|
|
4686
|
+
BaseRenderer,
|
|
4687
|
+
{
|
|
4688
|
+
...props,
|
|
4689
|
+
content,
|
|
4690
|
+
onImageRequest: handleImageRequest,
|
|
4691
|
+
onAddListItem: props.editable && hasInlineAddAction ? () => append("items", items, config.fields, itemTemplates) : void 0
|
|
4692
|
+
}
|
|
4693
|
+
)
|
|
4606
4694
|
}
|
|
4607
4695
|
),
|
|
4608
4696
|
props.editable && !hasInlineAddAction && /* @__PURE__ */ jsx7(
|
|
@@ -5035,9 +5123,23 @@ var sourceCmsBlocks = [
|
|
|
5035
5123
|
...estateComponents,
|
|
5036
5124
|
...minimalUiComponents
|
|
5037
5125
|
];
|
|
5038
|
-
var wikexCmsBlocks = sourceCmsBlocks.map(
|
|
5039
|
-
|
|
5040
|
-
|
|
5126
|
+
var wikexCmsBlocks = sourceCmsBlocks.map((block) => {
|
|
5127
|
+
const cmsBlock = dynamicListBlockByType.get(block.definition.type) ?? block;
|
|
5128
|
+
const Renderer = cmsBlock.Renderer;
|
|
5129
|
+
return {
|
|
5130
|
+
...cmsBlock,
|
|
5131
|
+
Renderer: (props) => createElement(
|
|
5132
|
+
CmsTextColorProvider,
|
|
5133
|
+
{
|
|
5134
|
+
content: props.content,
|
|
5135
|
+
editable: props.editable,
|
|
5136
|
+
onSelectText: props.onSelectText,
|
|
5137
|
+
selectedTextField: props.selectedTextField
|
|
5138
|
+
},
|
|
5139
|
+
createElement(Renderer, props)
|
|
5140
|
+
)
|
|
5141
|
+
};
|
|
5142
|
+
});
|
|
5041
5143
|
export {
|
|
5042
5144
|
estateBlocks,
|
|
5043
5145
|
estateComponents,
|