@enyxs/wikex-components 0.8.15 → 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 +175 -75
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +158 -56
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41,9 +41,10 @@ __export(index_exports, {
|
|
|
41
41
|
wikexComponents: () => wikexComponents
|
|
42
42
|
});
|
|
43
43
|
module.exports = __toCommonJS(index_exports);
|
|
44
|
+
var import_react7 = require("react");
|
|
44
45
|
|
|
45
46
|
// src/minimal-ui/blocks.tsx
|
|
46
|
-
var
|
|
47
|
+
var import_react2 = require("react");
|
|
47
48
|
var import_Box2 = __toESM(require("@mui/material/Box"));
|
|
48
49
|
var import_Button2 = __toESM(require("@mui/material/Button"));
|
|
49
50
|
var import_Link = __toESM(require("@mui/material/Link"));
|
|
@@ -51,10 +52,29 @@ var import_Pagination = __toESM(require("@mui/material/Pagination"));
|
|
|
51
52
|
var import_Typography2 = __toESM(require("@mui/material/Typography"));
|
|
52
53
|
|
|
53
54
|
// src/shared/editable.tsx
|
|
55
|
+
var import_react = require("react");
|
|
54
56
|
var import_Box = __toESM(require("@mui/material/Box"));
|
|
55
57
|
var import_Button = __toESM(require("@mui/material/Button"));
|
|
56
58
|
var import_Typography = __toESM(require("@mui/material/Typography"));
|
|
57
59
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
60
|
+
var textColorContext;
|
|
61
|
+
function getTextColorContext() {
|
|
62
|
+
textColorContext ?? (textColorContext = (0, import_react.createContext)(null));
|
|
63
|
+
return textColorContext;
|
|
64
|
+
}
|
|
65
|
+
function CmsTextColorProvider({
|
|
66
|
+
children,
|
|
67
|
+
content,
|
|
68
|
+
editable,
|
|
69
|
+
onSelectText,
|
|
70
|
+
selectedTextField
|
|
71
|
+
}) {
|
|
72
|
+
const TextColorContext = getTextColorContext();
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextColorContext.Provider, { value: { content, editable, onSelectText, selectedTextField }, children });
|
|
74
|
+
}
|
|
75
|
+
function validTextColor(value6) {
|
|
76
|
+
return typeof value6 === "string" && /^#[0-9a-fA-F]{6}$/.test(value6);
|
|
77
|
+
}
|
|
58
78
|
function EditableText({
|
|
59
79
|
className,
|
|
60
80
|
field,
|
|
@@ -65,6 +85,10 @@ function EditableText({
|
|
|
65
85
|
sx,
|
|
66
86
|
variant
|
|
67
87
|
}) {
|
|
88
|
+
const colorContext = (0, import_react.useContext)(getTextColorContext());
|
|
89
|
+
const colorValue = colorContext?.content[`${field}Color`];
|
|
90
|
+
const color = validTextColor(colorValue) ? colorValue : void 0;
|
|
91
|
+
const selected = editable && colorContext?.selectedTextField === field;
|
|
68
92
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
93
|
import_Typography.default,
|
|
70
94
|
{
|
|
@@ -74,18 +98,29 @@ function EditableText({
|
|
|
74
98
|
contentEditable: editable,
|
|
75
99
|
suppressContentEditableWarning: true,
|
|
76
100
|
onBlur: (event) => onChange?.(field, event.currentTarget.textContent ?? ""),
|
|
77
|
-
onClick: (event) =>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"&:hover": { boxShadow: "0 0 0 2px rgba(0, 167, 111, 0.22)" },
|
|
85
|
-
"&:focus": { boxShadow: "0 0 0 2px #00A76F" }
|
|
86
|
-
},
|
|
87
|
-
...sx
|
|
101
|
+
onClick: (event) => {
|
|
102
|
+
if (!editable) return;
|
|
103
|
+
event.stopPropagation();
|
|
104
|
+
colorContext?.onSelectText?.({
|
|
105
|
+
field,
|
|
106
|
+
currentColor: getComputedStyle(event.currentTarget).color
|
|
107
|
+
});
|
|
88
108
|
},
|
|
109
|
+
sx: [
|
|
110
|
+
{
|
|
111
|
+
outline: "none",
|
|
112
|
+
...editable && {
|
|
113
|
+
borderRadius: 0.75,
|
|
114
|
+
cursor: "text",
|
|
115
|
+
transition: "box-shadow 150ms ease",
|
|
116
|
+
"&:hover": { boxShadow: "0 0 0 2px rgba(0, 167, 111, 0.22)" },
|
|
117
|
+
"&:focus": { boxShadow: "0 0 0 2px #00A76F" }
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
...Array.isArray(sx) ? sx : sx ? [sx] : [],
|
|
121
|
+
...color ? [{ color }] : [],
|
|
122
|
+
...selected ? [{ outline: "2px solid #00A76F", outlineOffset: 2 }] : []
|
|
123
|
+
],
|
|
89
124
|
children: value6
|
|
90
125
|
}
|
|
91
126
|
);
|
|
@@ -309,11 +344,11 @@ function parseFeatureGridItems(value6) {
|
|
|
309
344
|
}
|
|
310
345
|
}
|
|
311
346
|
function FeatureGrid({ content, editable, readOnlyFields, onChange }) {
|
|
312
|
-
const dynamicItems = (0,
|
|
347
|
+
const dynamicItems = (0, import_react2.useMemo)(() => parseFeatureGridItems(content.itemsJson), [content.itemsJson]);
|
|
313
348
|
const isDynamic = content.dataMode === "data-source" && dynamicItems.length > 0;
|
|
314
349
|
const pageCount = Math.ceil(dynamicItems.length / 6);
|
|
315
|
-
const [page, setPage] = (0,
|
|
316
|
-
(0,
|
|
350
|
+
const [page, setPage] = (0, import_react2.useState)(1);
|
|
351
|
+
(0, import_react2.useEffect)(() => setPage(1), [content.itemsJson]);
|
|
317
352
|
const visibleItems = isDynamic ? dynamicItems.slice((page - 1) * 6, page * 6) : [];
|
|
318
353
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
319
354
|
import_Box2.default,
|
|
@@ -735,7 +770,7 @@ var minimalUiBlocks = [
|
|
|
735
770
|
];
|
|
736
771
|
|
|
737
772
|
// src/minimal-ui/marketing-blocks.tsx
|
|
738
|
-
var
|
|
773
|
+
var import_react3 = require("react");
|
|
739
774
|
|
|
740
775
|
// src/list-items.ts
|
|
741
776
|
function cmsListItems(content, fallback, field = "items") {
|
|
@@ -929,6 +964,8 @@ function TestimonialGrid({ content, editable, onChange }) {
|
|
|
929
964
|
children: listIndexes.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
930
965
|
import_Box3.default,
|
|
931
966
|
{
|
|
967
|
+
"data-cms-list-field": "items",
|
|
968
|
+
"data-cms-list-item-index": item - 1,
|
|
932
969
|
sx: {
|
|
933
970
|
display: "flex",
|
|
934
971
|
minHeight: 240,
|
|
@@ -993,7 +1030,7 @@ function TestimonialGrid({ content, editable, onChange }) {
|
|
|
993
1030
|
);
|
|
994
1031
|
}
|
|
995
1032
|
function FaqSection({ content, editable, onChange }) {
|
|
996
|
-
const [expanded, setExpanded] = (0,
|
|
1033
|
+
const [expanded, setExpanded] = (0, import_react3.useState)(1);
|
|
997
1034
|
const listIndexes = cmsListItems(content, Array.from({ length: 3 }, () => ({}))).map((_, index) => index + 1);
|
|
998
1035
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
999
1036
|
import_Box3.default,
|
|
@@ -1051,6 +1088,8 @@ function FaqSection({ content, editable, onChange }) {
|
|
|
1051
1088
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Box3.default, { children: listIndexes.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1052
1089
|
import_Accordion.default,
|
|
1053
1090
|
{
|
|
1091
|
+
"data-cms-list-field": "items",
|
|
1092
|
+
"data-cms-list-item-index": item - 1,
|
|
1054
1093
|
expanded: expanded === item,
|
|
1055
1094
|
onChange: (_event, isExpanded) => setExpanded(isExpanded ? item : 0),
|
|
1056
1095
|
square: false,
|
|
@@ -1500,9 +1539,9 @@ var minimalMarketingBlocks = [
|
|
|
1500
1539
|
];
|
|
1501
1540
|
|
|
1502
1541
|
// src/minimal-ui/site-chrome.tsx
|
|
1503
|
-
var
|
|
1542
|
+
var import_react4 = require("react");
|
|
1504
1543
|
var import_lucide = require("lucide");
|
|
1505
|
-
var
|
|
1544
|
+
var import_react5 = require("morphicons/react");
|
|
1506
1545
|
var import_Box4 = __toESM(require("@mui/material/Box"));
|
|
1507
1546
|
var import_Button4 = __toESM(require("@mui/material/Button"));
|
|
1508
1547
|
var import_Divider = __toESM(require("@mui/material/Divider"));
|
|
@@ -1581,8 +1620,8 @@ function MobileNavigation({
|
|
|
1581
1620
|
count,
|
|
1582
1621
|
buttonVariant = "contained"
|
|
1583
1622
|
}) {
|
|
1584
|
-
const [open, setOpen] = (0,
|
|
1585
|
-
(0,
|
|
1623
|
+
const [open, setOpen] = (0, import_react4.useState)(false);
|
|
1624
|
+
(0, import_react4.useEffect)(() => {
|
|
1586
1625
|
if (!open) return void 0;
|
|
1587
1626
|
const closeOnEscape = (event) => {
|
|
1588
1627
|
if (event.key === "Escape") setOpen(false);
|
|
@@ -1606,7 +1645,7 @@ function MobileNavigation({
|
|
|
1606
1645
|
"@container (max-width: 767px)": { display: "inline-flex" }
|
|
1607
1646
|
},
|
|
1608
1647
|
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_Box4.default, { component: "span", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1609
|
-
|
|
1648
|
+
import_react5.MorphIcon,
|
|
1610
1649
|
{
|
|
1611
1650
|
icon: open ? import_lucide.X : import_lucide.Menu,
|
|
1612
1651
|
size: 22,
|
|
@@ -1666,7 +1705,7 @@ function MobileNavigation({
|
|
|
1666
1705
|
},
|
|
1667
1706
|
"aria-label": "\u0110\xF3ng menu \u0111i\u1EC1u h\u01B0\u1EDBng",
|
|
1668
1707
|
sx: mobileMenuButtonSx,
|
|
1669
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_Box4.default, { component: "span", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1708
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_Box4.default, { component: "span", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react5.MorphIcon, { icon: import_lucide.X, size: 22, strokeWidth: 2, reducedMotion: "user" }) })
|
|
1670
1709
|
}
|
|
1671
1710
|
) }),
|
|
1672
1711
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_Stack2.default, { component: "nav", spacing: 0.5, children: Array.from({ length: count }, (_, index) => index + 1).map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
@@ -3200,7 +3239,7 @@ function FeaturedProjectsRenderer(props) {
|
|
|
3200
3239
|
] }),
|
|
3201
3240
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "intro", fallback: projectDefaults.intro, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: { maxWidth: 420, color: palette.muted, fontSize: 16, lineHeight: 1.8 }, children: node }) })
|
|
3202
3241
|
] }),
|
|
3203
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { className: "estate-featured-grid", sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(12, 1fr)" }, gap: 2 }, children: listIndexes.map((index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Box5.default, { 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: [
|
|
3242
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { className: "estate-featured-grid", sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(12, 1fr)" }, gap: 2 }, children: listIndexes.map((index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Box5.default, { 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: [
|
|
3204
3243
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Image, { props, field: `project${index}Image`, fallback: projectDefaults[`project${index}Image`], alt: "D\u1EF1 \xE1n n\u1ED5i b\u1EADt" }),
|
|
3205
3244
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: { position: "absolute", inset: 0, zIndex: 1, pointerEvents: "none", background: "linear-gradient(0deg, rgba(17,24,18,.88), transparent 64%)" } }),
|
|
3206
3245
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { 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" }),
|
|
@@ -3245,7 +3284,7 @@ function EstateProcessRenderer(props) {
|
|
|
3245
3284
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "heading", fallback: processDefaults.heading, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { className: "estate-display-lg", component: "h2", sx: { ...headingSx, fontSize: { xs: 48, md: 78 } }, children: node }) }),
|
|
3246
3285
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "body", fallback: processDefaults.body, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: { maxWidth: 450, color: palette.muted, fontSize: 16, lineHeight: 1.85 }, children: node }) })
|
|
3247
3286
|
] }),
|
|
3248
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Stack3.default, { component: "ol", sx: { m: 0, p: 0, listStyle: "none", borderTop: `1px solid ${palette.line}` }, children: listIndexes.map((index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Box5.default, { 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: [
|
|
3287
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Stack3.default, { component: "ol", sx: { m: 0, p: 0, listStyle: "none", borderTop: `1px solid ${palette.line}` }, children: listIndexes.map((index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Box5.default, { 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: [
|
|
3249
3288
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Box5.default, { sx: { color: palette.gold, fontFamily: "monospace", fontSize: 12, pt: 0.5 }, children: [
|
|
3250
3289
|
"0",
|
|
3251
3290
|
index
|
|
@@ -3295,7 +3334,7 @@ function EstateServicesRenderer(props) {
|
|
|
3295
3334
|
] }),
|
|
3296
3335
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "intro", fallback: servicesDefaults.intro, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: { maxWidth: 480, justifySelf: { md: "end" }, color: "rgba(255,255,255,.58)", fontSize: 16, lineHeight: 1.85 }, children: node }) })
|
|
3297
3336
|
] }),
|
|
3298
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { 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__ */ (0, import_jsx_runtime5.jsxs)(import_Stack3.default, { 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: [
|
|
3337
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { 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__ */ (0, import_jsx_runtime5.jsxs)(import_Stack3.default, { 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: [
|
|
3299
3338
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Box5.default, { sx: { display: "flex", justifyContent: "space-between", color: "#D8BD8A", fontFamily: "monospace", fontSize: 11 }, children: [
|
|
3300
3339
|
"0",
|
|
3301
3340
|
index,
|
|
@@ -3347,7 +3386,7 @@ function EstateArticlesRenderer(props) {
|
|
|
3347
3386
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "eyebrow", fallback: articlesDefaults.eyebrow, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: outlinedEyebrowSx, children: node }) }),
|
|
3348
3387
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "heading", fallback: articlesDefaults.heading, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { className: "estate-display-md", component: "h2", sx: headingSx, children: node }) })
|
|
3349
3388
|
] }),
|
|
3350
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { 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__ */ (0, import_jsx_runtime5.jsxs)(import_Stack3.default, { 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: [
|
|
3389
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { 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__ */ (0, import_jsx_runtime5.jsxs)(import_Stack3.default, { 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: [
|
|
3351
3390
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: `article${index}Meta`, fallback: articlesDefaults[`article${index}Meta`], children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: { color: palette.gold, fontSize: 11, fontWeight: 800, letterSpacing: ".13em", textTransform: "uppercase" }, children: node }) }),
|
|
3352
3391
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: `article${index}Title`, fallback: articlesDefaults[`article${index}Title`], children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { component: "h3", sx: { mt: 5, fontFamily: displayFont, fontSize: { xs: 31, md: 36 }, fontWeight: 400, letterSpacing: "-.04em", lineHeight: 1.06 }, children: node }) }),
|
|
3353
3392
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: `article${index}Excerpt`, fallback: articlesDefaults[`article${index}Excerpt`], children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: { mt: 2, color: palette.muted, fontSize: 14, lineHeight: 1.75 }, children: node }) }),
|
|
@@ -3385,7 +3424,7 @@ function PropertyGalleryRenderer(props) {
|
|
|
3385
3424
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "eyebrow", fallback: galleryDefaults.eyebrow, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: eyebrowSx, children: node }) }),
|
|
3386
3425
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "heading", fallback: galleryDefaults.heading, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { className: "estate-display-md", component: "h2", sx: headingSx, children: node }) })
|
|
3387
3426
|
] }),
|
|
3388
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { 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__ */ (0, import_jsx_runtime5.jsxs)(import_Box5.default, { children: [
|
|
3427
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { 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__ */ (0, import_jsx_runtime5.jsxs)(import_Box5.default, { "data-cms-list-field": "items", "data-cms-list-item-index": index - 1, children: [
|
|
3389
3428
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: { aspectRatio: "4 / 3" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Image, { props, field: `image${index}`, fallback: galleryDefaults[`image${index}`], alt: "B\u1ED9 s\u01B0u t\u1EADp b\u1EA5t \u0111\u1ED9ng s\u1EA3n" }) }),
|
|
3390
3429
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: `caption${index}`, fallback: galleryDefaults[`caption${index}`], children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: { pt: 1, color: palette.muted, fontSize: 12 }, children: node }) })
|
|
3391
3430
|
] }, index)) })
|
|
@@ -3422,7 +3461,7 @@ function AmenitiesRenderer(props) {
|
|
|
3422
3461
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "eyebrow", fallback: amenitiesDefaults.eyebrow, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: { ...eyebrowSx, color: "#D5B77E" }, children: node }) }),
|
|
3423
3462
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "heading", fallback: amenitiesDefaults.heading, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { className: "estate-display-md", component: "h2", sx: { ...headingSx, color: "#F7F2E8" }, children: node }) })
|
|
3424
3463
|
] }),
|
|
3425
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { 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__ */ (0, import_jsx_runtime5.jsxs)(import_Stack3.default, { 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: [
|
|
3464
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { 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__ */ (0, import_jsx_runtime5.jsxs)(import_Stack3.default, { 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: [
|
|
3426
3465
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Stack3.default, { direction: "row", justifyContent: "space-between", children: [
|
|
3427
3466
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Box5.default, { sx: { color: "#C9AA72", fontFamily: "monospace", fontSize: 11 }, children: [
|
|
3428
3467
|
"0",
|
|
@@ -3465,7 +3504,7 @@ function TestimonialsRenderer(props) {
|
|
|
3465
3504
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "eyebrow", fallback: testimonialsDefaults.eyebrow, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: eyebrowSx, children: node }) }),
|
|
3466
3505
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "heading", fallback: testimonialsDefaults.heading, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { className: "estate-display-md", component: "h2", sx: headingSx, children: node }) })
|
|
3467
3506
|
] }),
|
|
3468
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { className: "estate-card-grid-3", sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(3, 1fr)" }, gap: 2 }, children: listIndexes.map((index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Stack3.default, { className: "estate-testimonial-card", sx: { minHeight: 340, p: 3, bgcolor: palette.cream, border: `1px solid ${palette.line}` }, children: [
|
|
3507
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { className: "estate-card-grid-3", sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "repeat(3, 1fr)" }, gap: 2 }, children: listIndexes.map((index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Stack3.default, { 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: [
|
|
3469
3508
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: { color: "#A17C43", fontFamily: displayFont, fontSize: 40, lineHeight: 0.6 }, children: "\u201C" }),
|
|
3470
3509
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: `quote${index}`, fallback: testimonialsDefaults[`quote${index}`], children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: { mt: 3, fontFamily: displayFont, fontSize: 25, letterSpacing: "-.025em", lineHeight: 1.3 }, children: node }) }),
|
|
3471
3510
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Box5.default, { sx: { mt: "auto", pt: 3 }, children: [
|
|
@@ -3502,7 +3541,7 @@ function FAQRenderer(props) {
|
|
|
3502
3541
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "eyebrow", fallback: faqDefaults.eyebrow, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: eyebrowSx, children: node }) }),
|
|
3503
3542
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: "heading", fallback: faqDefaults.heading, children: (node) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { className: "estate-display-md", component: "h2", sx: { ...headingSx, fontSize: { xs: 38, md: 56 } }, children: node }) })
|
|
3504
3543
|
] }),
|
|
3505
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { children: listIndexes.map((index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { sx: { py: 2.5, borderTop: `1px solid ${palette.line}`, ...index === listIndexes.length && { borderBottom: `1px solid ${palette.line}` } }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Stack3.default, { direction: "row", spacing: 2, children: [
|
|
3544
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { children: listIndexes.map((index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { "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__ */ (0, import_jsx_runtime5.jsxs)(import_Stack3.default, { direction: "row", spacing: 2, children: [
|
|
3506
3545
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Box5.default, { sx: { color: palette.gold, fontFamily: "monospace", fontSize: 11, pt: 0.5 }, children: [
|
|
3507
3546
|
"0",
|
|
3508
3547
|
index
|
|
@@ -3576,7 +3615,7 @@ var headerDefaults = {
|
|
|
3576
3615
|
ctaUrl: "#lien-he"
|
|
3577
3616
|
};
|
|
3578
3617
|
function EstateHeaderRenderer(props) {
|
|
3579
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { component: "header", sx: { ...estateResponsiveSx, position: "relative", zIndex: 10, borderBottom: "1px solid rgba(255,255,255,.16)", bgcolor: palette.dark, color: "white", px: { xs: 2, md: 4 } }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Box5.default, { className: "estate-container", sx: { display: "flex", minHeight: { xs: 76, md: 96 }, maxWidth: 1376, mx: "auto", alignItems: "center", justifyContent: "space-between", gap: 2 }, children: [
|
|
3618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Box5.default, { component: "header", sx: { ...estateResponsiveSx, position: "relative", zIndex: props.editable ? 1 : 10, borderBottom: "1px solid rgba(255,255,255,.16)", bgcolor: palette.dark, color: "white", px: { xs: 2, md: 4 } }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Box5.default, { className: "estate-container", sx: { display: "flex", minHeight: { xs: 76, md: 96 }, maxWidth: 1376, mx: "auto", alignItems: "center", justifyContent: "space-between", gap: 2 }, children: [
|
|
3580
3619
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(EstateLogo, { props, fallback: headerDefaults.logo }),
|
|
3581
3620
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_Stack3.default, { component: "nav", direction: "row", spacing: { md: 3, lg: 4 }, sx: { alignItems: "center", "@container (max-width: 767px)": { display: "none" } }, children: [
|
|
3582
3621
|
[1, 2, 3, 4].map((index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Button5.default, { component: "a", href: String(value4(props.content, `nav${index}Url`, headerDefaults[`nav${index}Url`])), sx: { minWidth: 0, p: 0, color: "inherit", fontSize: 12, fontWeight: 600, textTransform: "none", "&:hover": { bgcolor: "transparent", opacity: 0.6 } }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { props, field: `nav${index}Label`, fallback: headerDefaults[`nav${index}Label`], children: (node) => node }) }, index)),
|
|
@@ -3669,7 +3708,7 @@ var estateBlocks = [
|
|
|
3669
3708
|
];
|
|
3670
3709
|
|
|
3671
3710
|
// src/estate/project-pages.tsx
|
|
3672
|
-
var
|
|
3711
|
+
var import_react6 = require("react");
|
|
3673
3712
|
var import_Box6 = __toESM(require("@mui/material/Box"));
|
|
3674
3713
|
var import_Button6 = __toESM(require("@mui/material/Button"));
|
|
3675
3714
|
var import_GlobalStyles2 = __toESM(require("@mui/material/GlobalStyles"));
|
|
@@ -3897,11 +3936,11 @@ function AddProjectButton({ onAdd }) {
|
|
|
3897
3936
|
);
|
|
3898
3937
|
}
|
|
3899
3938
|
function EstateProjectsArchiveRenderer(props) {
|
|
3900
|
-
const [query, setQuery] = (0,
|
|
3901
|
-
const [filter, setFilter] = (0,
|
|
3939
|
+
const [query, setQuery] = (0, import_react6.useState)("");
|
|
3940
|
+
const [filter, setFilter] = (0, import_react6.useState)("T\u1EA5t c\u1EA3");
|
|
3902
3941
|
const projects = archiveProjects(props);
|
|
3903
3942
|
const filters = ["T\u1EA5t c\u1EA3", ...Array.from(new Set(projects.map((project) => project.type)))];
|
|
3904
|
-
const filtered = (0,
|
|
3943
|
+
const filtered = (0, import_react6.useMemo)(() => {
|
|
3905
3944
|
const search = query.trim().toLocaleLowerCase("vi");
|
|
3906
3945
|
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)));
|
|
3907
3946
|
}, [filter, projects, query]);
|
|
@@ -3922,7 +3961,7 @@ function EstateProjectsArchiveRenderer(props) {
|
|
|
3922
3961
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text2, { props, field: "catalogEyebrow", fallback: archiveDefaults.catalogEyebrow, sx: eyebrowSx2 }),
|
|
3923
3962
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text2, { props, field: "catalogIntro", fallback: archiveDefaults.catalogIntro, sx: { maxWidth: 470, color: palette2.muted, fontSize: 15, lineHeight: 1.7 } })
|
|
3924
3963
|
] }),
|
|
3925
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { className: "estate-card-grid", sx: { display: "grid", gap: 2, gridTemplateColumns: { xs: "1fr", md: "repeat(2, minmax(0, 1fr))" } }, children: projects.map((project, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { 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: [
|
|
3964
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { className: "estate-card-grid", sx: { display: "grid", gap: 2, gridTemplateColumns: { xs: "1fr", md: "repeat(2, minmax(0, 1fr))" } }, children: projects.map((project, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { 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: [
|
|
3926
3965
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { className: "estate-card-image", sx: { position: "relative", height: { xs: 300, sm: 380, md: index === 0 ? 540 : 360 } }, children: [
|
|
3927
3966
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Image2, { props, field: `project${index + 1}Image`, fallback: project.image, alt: project.title }),
|
|
3928
3967
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { 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: [
|
|
@@ -4091,7 +4130,7 @@ function EstateProjectsArchiveRenderer(props) {
|
|
|
4091
4130
|
]
|
|
4092
4131
|
}
|
|
4093
4132
|
),
|
|
4094
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { children: filtered.map((project, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { 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: [
|
|
4133
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { children: filtered.map((project, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { 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: [
|
|
4095
4134
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { sx: { color: palette2.gold, fontFamily: "monospace", fontSize: 11 }, children: [
|
|
4096
4135
|
"0",
|
|
4097
4136
|
index + 1
|
|
@@ -4136,7 +4175,7 @@ function EstateProjectCatalogRenderer(props) {
|
|
|
4136
4175
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text2, { props, field: "catalogEyebrow", fallback: archiveDefaults.catalogEyebrow, sx: eyebrowSx2 }),
|
|
4137
4176
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text2, { props, field: "catalogIntro", fallback: archiveDefaults.catalogIntro, sx: { maxWidth: 470, color: palette2.muted, fontSize: 15, lineHeight: 1.7 } })
|
|
4138
4177
|
] }),
|
|
4139
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { className: "estate-card-grid", sx: { display: "grid", gap: 2, gridTemplateColumns: { xs: "1fr", md: "repeat(2, minmax(0, 1fr))" } }, children: projects.map((project, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { 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: [
|
|
4178
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { className: "estate-card-grid", sx: { display: "grid", gap: 2, gridTemplateColumns: { xs: "1fr", md: "repeat(2, minmax(0, 1fr))" } }, children: projects.map((project, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { 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: [
|
|
4140
4179
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { className: "estate-card-image", sx: { position: "relative", height: { xs: 300, sm: 380, md: index === 0 ? 540 : 360 } }, children: [
|
|
4141
4180
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Image2, { props, field: `project${index + 1}Image`, fallback: project.image, alt: project.title }),
|
|
4142
4181
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { 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: [
|
|
@@ -4167,13 +4206,13 @@ function EstateProjectCatalogRenderer(props) {
|
|
|
4167
4206
|
] });
|
|
4168
4207
|
}
|
|
4169
4208
|
function EstateProjectExplorerRenderer(props) {
|
|
4170
|
-
const [query, setQuery] = (0,
|
|
4171
|
-
const [filter, setFilter] = (0,
|
|
4209
|
+
const [query, setQuery] = (0, import_react6.useState)("");
|
|
4210
|
+
const [filter, setFilter] = (0, import_react6.useState)("T\u1EA5t c\u1EA3");
|
|
4172
4211
|
const projects = archiveProjects(props);
|
|
4173
4212
|
const filters = ["T\u1EA5t c\u1EA3", ...Array.from(new Set(projects.map((project) => project.type)))];
|
|
4174
|
-
const filtered = (0,
|
|
4213
|
+
const filtered = (0, import_react6.useMemo)(() => {
|
|
4175
4214
|
const search = query.trim().toLocaleLowerCase("vi");
|
|
4176
|
-
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)));
|
|
4215
|
+
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)));
|
|
4177
4216
|
}, [filter, projects, query]);
|
|
4178
4217
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { sx: { ...estateResponsiveSx2, py: { xs: 8, md: 12 }, borderTop: `1px solid ${palette2.line}`, bgcolor: palette2.pale, color: palette2.ink }, children: [
|
|
4179
4218
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EstateProjectFonts, {}),
|
|
@@ -4202,23 +4241,32 @@ function EstateProjectExplorerRenderer(props) {
|
|
|
4202
4241
|
filter
|
|
4203
4242
|
] })
|
|
4204
4243
|
] }),
|
|
4205
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { children: filtered.map((project, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4244
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { children: filtered.map(({ project, index }, displayIndex) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
4245
|
+
import_Box6.default,
|
|
4246
|
+
{
|
|
4247
|
+
className: "estate-list-row",
|
|
4248
|
+
"data-cms-list-field": "items",
|
|
4249
|
+
"data-cms-list-item-index": index,
|
|
4250
|
+
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" } },
|
|
4251
|
+
children: [
|
|
4252
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { sx: { color: palette2.gold, fontFamily: "monospace", fontSize: 11 }, children: [
|
|
4253
|
+
"0",
|
|
4254
|
+
displayIndex + 1
|
|
4255
|
+
] }),
|
|
4256
|
+
project.image ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { component: "img", src: project.image, alt: "", sx: { width: 1, height: { xs: 58, md: 74 }, objectFit: "cover" } }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { sx: { width: 1, height: { xs: 58, md: 74 }, bgcolor: "rgba(32, 40, 32, 0.08)" } }),
|
|
4257
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { sx: { minWidth: 0 }, children: [
|
|
4258
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text2, { props, field: `project${index + 1}Type`, fallback: project.type, sx: { color: palette2.gold, fontSize: 10, fontWeight: 700, letterSpacing: ".1em", textTransform: "uppercase" } }),
|
|
4259
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(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" } })
|
|
4260
|
+
] }),
|
|
4261
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { className: "estate-desktop-meta", sx: { display: { xs: "none", md: "block" }, color: palette2.muted, fontSize: 12 }, children: [
|
|
4262
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text2, { props, field: `project${index + 1}Location`, fallback: project.location }),
|
|
4263
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text2, { props, field: `project${index + 1}Year`, fallback: project.year })
|
|
4264
|
+
] }),
|
|
4265
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { className: "estate-desktop-meta", sx: { display: { xs: "none", md: "block" }, color: palette2.gold, fontSize: 20 }, children: "\u2197" })
|
|
4266
|
+
]
|
|
4267
|
+
},
|
|
4268
|
+
`${project.title}-${index}`
|
|
4269
|
+
)) }),
|
|
4222
4270
|
props.editable && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { sx: { display: "flex", justifyContent: "flex-end", mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AddProjectButton, { onAdd: props.onAddListItem }) })
|
|
4223
4271
|
] })
|
|
4224
4272
|
] });
|
|
@@ -4302,7 +4350,7 @@ function EstateProjectDetailRenderer(props) {
|
|
|
4302
4350
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { 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: [
|
|
4303
4351
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { children: [
|
|
4304
4352
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { sx: eyebrowSx2, children: "Th\xF4ng tin d\u1EF1 \xE1n" }),
|
|
4305
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { sx: { mt: 3, borderTop: `1px solid ${palette2.line}` }, children: projectInformation.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { sx: { display: "flex", justifyContent: "space-between", gap: 2, py: 1.2, borderBottom: `1px solid ${palette2.line}` }, children: [
|
|
4353
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { sx: { mt: 3, borderTop: `1px solid ${palette2.line}` }, children: projectInformation.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { "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: [
|
|
4306
4354
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { sx: { color: palette2.muted, fontSize: 12 }, children: item.label || "M\u1EE5c m\u1EDBi" }),
|
|
4307
4355
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { sx: { fontSize: 12, fontWeight: 700, textAlign: "right" }, children: item.value })
|
|
4308
4356
|
] }, `${item.label}-${index}`)) })
|
|
@@ -4323,7 +4371,7 @@ function EstateProjectDetailRenderer(props) {
|
|
|
4323
4371
|
] }) }),
|
|
4324
4372
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { className: "estate-container", component: "section", sx: { ...containerSx, py: { xs: 8, md: 13 } }, children: [
|
|
4325
4373
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(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 } }),
|
|
4326
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Stack4.default, { spacing: { xs: 5, md: 10 }, sx: { mt: { xs: 5, md: 8 } }, children: galleryIndexes.map((index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { 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: [
|
|
4374
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Stack4.default, { spacing: { xs: 5, md: 10 }, sx: { mt: { xs: 5, md: 8 } }, children: galleryIndexes.map((index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { 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: [
|
|
4327
4375
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { className: "estate-gallery-image", sx: { order: { md: index % 2 ? 1 : 2 }, minHeight: { xs: 330, md: index === 2 ? 520 : 430 } }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Image2, { props, field: `gallery${index}Image`, fallback: detailDefaults[`gallery${index}Image`], alt: "H\xECnh \u1EA3nh d\u1EF1 \xE1n" }) }),
|
|
4328
4376
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Stack4.default, { 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: [
|
|
4329
4377
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { sx: { color: palette2.gold, fontFamily: "monospace", fontSize: 11 }, children: [
|
|
@@ -4369,7 +4417,7 @@ function EstateProjectInformationRenderer(props) {
|
|
|
4369
4417
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EstateProjectFonts, {}),
|
|
4370
4418
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { className: "estate-container", sx: { ...containerSx, py: { xs: 7, md: 10 } }, children: [
|
|
4371
4419
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text2, { props, field: "informationEyebrow", fallback: "Th\xF4ng tin d\u1EF1 \xE1n", sx: eyebrowSx2 }),
|
|
4372
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { sx: { maxWidth: 820, mt: 3, borderTop: `1px solid ${palette2.line}` }, children: information.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { sx: { display: "flex", justifyContent: "space-between", gap: 2, py: 1.5, borderBottom: `1px solid ${palette2.line}` }, children: [
|
|
4420
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { sx: { maxWidth: 820, mt: 3, borderTop: `1px solid ${palette2.line}` }, children: information.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { "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: [
|
|
4373
4421
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { sx: { color: palette2.muted, fontSize: 12 }, children: item.label || "M\u1EE5c m\u1EDBi" }),
|
|
4374
4422
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { sx: { fontSize: 12, fontWeight: 700, textAlign: "right" }, children: item.value })
|
|
4375
4423
|
] }, `${item.label}-${index}`)) })
|
|
@@ -4405,7 +4453,7 @@ function EstateProjectGalleryRenderer(props) {
|
|
|
4405
4453
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EstateProjectFonts, {}),
|
|
4406
4454
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { className: "estate-container", sx: { ...containerSx, py: { xs: 8, md: 13 } }, children: [
|
|
4407
4455
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(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 } }),
|
|
4408
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Stack4.default, { spacing: { xs: 5, md: 10 }, sx: { mt: { xs: 5, md: 8 } }, children: galleryIndexes.map((index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { 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: [
|
|
4456
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Stack4.default, { spacing: { xs: 5, md: 10 }, sx: { mt: { xs: 5, md: 8 } }, children: galleryIndexes.map((index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { 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: [
|
|
4409
4457
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Box6.default, { className: "estate-gallery-image", sx: { order: { md: index % 2 ? 1 : 2 }, minHeight: { xs: 330, md: index === 2 ? 520 : 430 } }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Image2, { props, field: `gallery${index}Image`, fallback: detailDefaults[`gallery${index}Image`], alt: "H\xECnh \u1EA3nh d\u1EF1 \xE1n" }) }),
|
|
4410
4458
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Stack4.default, { 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: [
|
|
4411
4459
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Box6.default, { sx: { color: palette2.gold, fontFamily: "monospace", fontSize: 11 }, children: [
|
|
@@ -4509,9 +4557,16 @@ function fields2(...items) {
|
|
|
4509
4557
|
function indexed(prefix, names) {
|
|
4510
4558
|
return (content, items) => ({
|
|
4511
4559
|
...content,
|
|
4512
|
-
...Object.fromEntries(items.flatMap((item, index) => names.
|
|
4560
|
+
...Object.fromEntries(items.flatMap((item, index) => names.flatMap((name) => {
|
|
4561
|
+
const field = indexedKey(prefix, index, name);
|
|
4562
|
+
const color = item[`${name}Color`];
|
|
4563
|
+
return [[field, item[name] ?? ""], ...validTextColor2(color) ? [[`${field}Color`, color]] : []];
|
|
4564
|
+
})))
|
|
4513
4565
|
});
|
|
4514
4566
|
}
|
|
4567
|
+
function validTextColor2(value6) {
|
|
4568
|
+
return typeof value6 === "string" && /^#[0-9a-fA-F]{6}$/.test(value6);
|
|
4569
|
+
}
|
|
4515
4570
|
function indexedKey(prefix, index, name) {
|
|
4516
4571
|
return prefix ? `${prefix}${index + 1}${name[0].toUpperCase()}${name.slice(1)}` : `${name}${index + 1}`;
|
|
4517
4572
|
}
|
|
@@ -4563,11 +4618,16 @@ function sampleItem(templates, itemFields, index) {
|
|
|
4563
4618
|
function restoreEmptyItems(items, templates, itemFields) {
|
|
4564
4619
|
return items.map((item, index) => {
|
|
4565
4620
|
const sample = sampleItem(templates, itemFields, index);
|
|
4621
|
+
const backgroundColor = item.backgroundColor;
|
|
4566
4622
|
return Object.fromEntries(
|
|
4567
|
-
itemFields.
|
|
4623
|
+
itemFields.flatMap((field) => {
|
|
4568
4624
|
const currentValue = item[field.key]?.trim();
|
|
4569
|
-
|
|
4570
|
-
|
|
4625
|
+
const color = item[`${field.key}Color`];
|
|
4626
|
+
return [
|
|
4627
|
+
[field.key, currentValue || sample[field.key] || fallbackSampleValue(field, index)],
|
|
4628
|
+
...validTextColor2(color) ? [[`${field.key}Color`, color]] : []
|
|
4629
|
+
];
|
|
4630
|
+
}).concat(validTextColor2(backgroundColor) ? [["backgroundColor", backgroundColor]] : [])
|
|
4571
4631
|
);
|
|
4572
4632
|
});
|
|
4573
4633
|
}
|
|
@@ -4639,14 +4699,40 @@ function DynamicListRenderer({ base, config, ...props }) {
|
|
|
4639
4699
|
}
|
|
4640
4700
|
props.onImageRequest?.(field);
|
|
4641
4701
|
};
|
|
4702
|
+
const handleTextSelect = (target) => {
|
|
4703
|
+
for (let index = 0; index < items.length; index += 1) {
|
|
4704
|
+
const itemField = config.fields.find(
|
|
4705
|
+
(field) => field.type !== "image" && field.type !== "link" && indexedKey(config.prefix, index, field.key) === target.field
|
|
4706
|
+
);
|
|
4707
|
+
if (itemField) {
|
|
4708
|
+
props.onSelectText?.({
|
|
4709
|
+
...target,
|
|
4710
|
+
listField: "items",
|
|
4711
|
+
itemIndex: index,
|
|
4712
|
+
itemKey: itemField.key
|
|
4713
|
+
});
|
|
4714
|
+
return;
|
|
4715
|
+
}
|
|
4716
|
+
}
|
|
4717
|
+
props.onSelectText?.(target);
|
|
4718
|
+
};
|
|
4642
4719
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
4643
4720
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
4644
|
-
|
|
4721
|
+
CmsTextColorProvider,
|
|
4645
4722
|
{
|
|
4646
|
-
...props,
|
|
4647
4723
|
content,
|
|
4648
|
-
|
|
4649
|
-
|
|
4724
|
+
editable: props.editable,
|
|
4725
|
+
onSelectText: handleTextSelect,
|
|
4726
|
+
selectedTextField: props.selectedTextField,
|
|
4727
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
4728
|
+
BaseRenderer,
|
|
4729
|
+
{
|
|
4730
|
+
...props,
|
|
4731
|
+
content,
|
|
4732
|
+
onImageRequest: handleImageRequest,
|
|
4733
|
+
onAddListItem: props.editable && hasInlineAddAction ? () => append("items", items, config.fields, itemTemplates) : void 0
|
|
4734
|
+
}
|
|
4735
|
+
)
|
|
4650
4736
|
}
|
|
4651
4737
|
),
|
|
4652
4738
|
props.editable && !hasInlineAddAction && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
@@ -5079,9 +5165,23 @@ var sourceCmsBlocks = [
|
|
|
5079
5165
|
...estateComponents,
|
|
5080
5166
|
...minimalUiComponents
|
|
5081
5167
|
];
|
|
5082
|
-
var wikexCmsBlocks = sourceCmsBlocks.map(
|
|
5083
|
-
|
|
5084
|
-
|
|
5168
|
+
var wikexCmsBlocks = sourceCmsBlocks.map((block) => {
|
|
5169
|
+
const cmsBlock = dynamicListBlockByType.get(block.definition.type) ?? block;
|
|
5170
|
+
const Renderer = cmsBlock.Renderer;
|
|
5171
|
+
return {
|
|
5172
|
+
...cmsBlock,
|
|
5173
|
+
Renderer: (props) => (0, import_react7.createElement)(
|
|
5174
|
+
CmsTextColorProvider,
|
|
5175
|
+
{
|
|
5176
|
+
content: props.content,
|
|
5177
|
+
editable: props.editable,
|
|
5178
|
+
onSelectText: props.onSelectText,
|
|
5179
|
+
selectedTextField: props.selectedTextField
|
|
5180
|
+
},
|
|
5181
|
+
(0, import_react7.createElement)(Renderer, props)
|
|
5182
|
+
)
|
|
5183
|
+
};
|
|
5184
|
+
});
|
|
5085
5185
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5086
5186
|
0 && (module.exports = {
|
|
5087
5187
|
estateBlocks,
|