@enyxs/wikex-components 0.11.15 → 0.11.16

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.
@@ -2,9 +2,19 @@
2
2
 
3
3
  // src/wikex/consultation-manager.tsx
4
4
  import { useState } from "react";
5
- import { Alert, Box, Button, Card, Chip, Dialog, DialogActions, DialogContent, DialogTitle, MenuItem, Stack, Table, TableBody, TableCell, TableHead, TablePagination, TableRow, TextField, Typography } from "@mui/material";
5
+ import { Alert, Avatar, Box, Button, Card, Chip, Dialog, DialogActions, DialogContent, DialogTitle, Divider, Link, MenuItem, Stack, Table, TableBody, TableCell, TableHead, TablePagination, TableRow, TextField, Typography } from "@mui/material";
6
6
 
7
7
  // src/consultation-model.ts
8
+ var registrationRegions = {
9
+ north: "Khu v\u1EF1c mi\u1EC1n B\u1EAFc",
10
+ "north-central": "Khu v\u1EF1c B\u1EAFc Trung B\u1ED9",
11
+ central: "Khu v\u1EF1c mi\u1EC1n Trung",
12
+ highlands: "Khu v\u1EF1c T\xE2y Nguy\xEAn",
13
+ south: "Khu v\u1EF1c mi\u1EC1n Nam",
14
+ mekong: "Khu v\u1EF1c mi\u1EC1n T\xE2y"
15
+ };
16
+ var partnerTypes = { individual: "C\xE1 nh\xE2n", broker: "M\xF4i gi\u1EDBi t\xE0i ch\xEDnh", professional: "Chuy\xEAn vi\xEAn m\xF4i gi\u1EDBi", other: "Kh\xE1c" };
17
+ var partnerExperiences = { none: "Ch\u01B0a c\xF3 kinh nghi\u1EC7m", under1: "D\u01B0\u1EDBi 1 n\u0103m", oneTo3: "1\u20133 n\u0103m", over3: "Tr\xEAn 3 n\u0103m", other: "Kh\xE1c" };
8
18
  var consultationStatuses = {
9
19
  new: "M\u1EDBi",
10
20
  contacted: "\u0110\xE3 li\xEAn h\u1EC7",
@@ -15,11 +25,12 @@ var consultationCities = { "ho-chi-minh-city": "TP. H\u1ED3 Ch\xED Minh", hanoi:
15
25
  var consultationCapitals = { "under-10m": "D\u01B0\u1EDBi 10 tri\u1EC7u", "10m-30m": "10\u201330 tri\u1EC7u", "30m-100m": "30\u2013100 tri\u1EC7u", "over-100m": "Tr\xEAn 100 tri\u1EC7u" };
16
26
 
17
27
  // src/wikex/consultation-manager.tsx
18
- import { jsx, jsxs } from "react/jsx-runtime";
28
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
19
29
  var date = (value) => new Intl.DateTimeFormat("vi-VN", { timeZone: "Asia/Ho_Chi_Minh", dateStyle: "short", timeStyle: "short" }).format(new Date(value));
20
30
  var city = (value) => consultationCities[value] || value || "Ch\u01B0a cung c\u1EA5p";
21
31
  var capital = (value) => consultationCapitals[value] || value || "Ch\u01B0a cung c\u1EA5p";
22
32
  function ConsultationManager({
33
+ kind = "consultation",
23
34
  data,
24
35
  search,
25
36
  status,
@@ -36,6 +47,8 @@ function ConsultationManager({
36
47
  onDelete,
37
48
  onDismissNotice
38
49
  }) {
50
+ const isPartner = kind === "partner";
51
+ const title = isPartner ? "\u0110\u0103ng k\xFD \u0111\u1ED1i t\xE1c \u2014 Wikex VN" : "\u0110\u0103ng k\xFD t\u01B0 v\u1EA5n \u2014 Trang ch\u1EE7";
39
52
  const [editing, setEditing] = useState(null);
40
53
  const [deleting, setDeleting] = useState(null);
41
54
  const [draftStatus, setDraftStatus] = useState("new");
@@ -43,12 +56,12 @@ function ConsultationManager({
43
56
  return /* @__PURE__ */ jsxs(Stack, { spacing: 3, sx: { minWidth: 0 }, children: [
44
57
  /* @__PURE__ */ jsxs(Stack, { direction: { xs: "column", sm: "row" }, gap: 2, justifyContent: "space-between", alignItems: { sm: "center" }, children: [
45
58
  /* @__PURE__ */ jsxs(Stack, { spacing: 1, children: [
46
- /* @__PURE__ */ jsx(Typography, { variant: "h4", children: "\u0110\u0103ng k\xFD t\u01B0 v\u1EA5n" }),
59
+ /* @__PURE__ */ jsx(Typography, { variant: "h4", children: title }),
47
60
  /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", children: "Th\xF4ng tin t\u1EEB form \u0111\u0103ng k\xFD tr\xEAn website. Theo d\xF5i li\xEAn h\u1EC7 v\xE0 ghi ch\xFA x\u1EED l\xFD." })
48
61
  ] }),
49
62
  /* @__PURE__ */ jsx(Button, { variant: "outlined", disabled: loading || busy, onClick: onReload, children: "T\u1EA3i l\u1EA1i danh s\xE1ch" })
50
63
  ] }),
51
- !canWrite && /* @__PURE__ */ jsx(Alert, { severity: "info", children: "B\u1EA1n c\xF3 quy\u1EC1n xem \u0111\u0103ng k\xFD. C\u1EA7n quy\u1EC1n ch\u1EC9nh s\u1EEDa \u0111\u0103ng k\xFD t\u01B0 v\u1EA5n \u0111\u1EC3 c\u1EADp nh\u1EADt ho\u1EB7c x\xF3a." }),
64
+ !canWrite && /* @__PURE__ */ jsx(Alert, { severity: "info", children: "B\u1EA1n c\xF3 quy\u1EC1n xem \u0111\u0103ng k\xFD. C\u1EA7n quy\u1EC1n ch\u1EC9nh s\u1EEDa \u0111\u0103ng k\xFD \u0111\u1EC3 c\u1EADp nh\u1EADt ho\u1EB7c x\xF3a." }),
52
65
  notice && /* @__PURE__ */ jsx(Alert, { severity: notice.severity, onClose: onDismissNotice, children: notice.message }),
53
66
  /* @__PURE__ */ jsx(Card, { sx: { p: 3 }, children: /* @__PURE__ */ jsxs(Stack, { direction: { xs: "column", sm: "row" }, spacing: 2, children: [
54
67
  /* @__PURE__ */ jsx(TextField, { size: "small", fullWidth: true, label: "T\xECm theo t\xEAn, \u0111i\u1EC7n tho\u1EA1i ho\u1EB7c email", value: search, disabled: busy, onChange: (event) => onSearch(event.target.value) }),
@@ -58,8 +71,8 @@ function ConsultationManager({
58
71
  ] })
59
72
  ] }) }),
60
73
  /* @__PURE__ */ jsxs(Card, { "aria-busy": loading, sx: { opacity: loading ? 0.65 : 1 }, children: [
61
- /* @__PURE__ */ jsx(Box, { sx: { overflowX: "auto" }, children: /* @__PURE__ */ jsxs(Table, { "aria-label": "Danh s\xE1ch \u0111\u0103ng k\xFD t\u01B0 v\u1EA5n", sx: { minWidth: 1050 }, children: [
62
- /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(TableRow, { children: ["Kh\xE1ch h\xE0ng", "\u0110i\u1EC7n tho\u1EA1i / Email", "Khu v\u1EF1c", "Th\u1ECB tr\u01B0\u1EDDng / V\u1ED1n", "Tr\u1EA1ng th\xE1i", "Ng\xE0y g\u1EEDi", "Thao t\xE1c"].map((title) => /* @__PURE__ */ jsx(TableCell, { children: title }, title)) }) }),
74
+ /* @__PURE__ */ jsx(Box, { sx: { overflowX: "auto" }, children: /* @__PURE__ */ jsxs(Table, { "aria-label": title, sx: { minWidth: 1050 }, children: [
75
+ /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(TableRow, { children: ["Kh\xE1ch h\xE0ng", "\u0110i\u1EC7n tho\u1EA1i / Email", "Khu v\u1EF1c", isPartner ? "\u0110\u1ED1i t\xE1c / Kinh nghi\u1EC7m" : "Th\u1ECB tr\u01B0\u1EDDng / V\u1ED1n", "Tr\u1EA1ng th\xE1i", "Ng\xE0y g\u1EEDi", "Thao t\xE1c"].map((title2) => /* @__PURE__ */ jsx(TableCell, { children: title2 }, title2)) }) }),
63
76
  /* @__PURE__ */ jsxs(TableBody, { children: [
64
77
  data.items.map((item) => /* @__PURE__ */ jsxs(TableRow, { children: [
65
78
  /* @__PURE__ */ jsxs(TableCell, { sx: { maxWidth: 220, overflowWrap: "anywhere" }, children: [
@@ -70,15 +83,18 @@ function ConsultationManager({
70
83
  /* @__PURE__ */ jsx(Typography, { variant: "body2", children: item.phone }),
71
84
  /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", children: item.email })
72
85
  ] }),
73
- /* @__PURE__ */ jsx(TableCell, { children: city(item.city) }),
74
- /* @__PURE__ */ jsxs(TableCell, { sx: { maxWidth: 220, overflowWrap: "anywhere" }, children: [
86
+ /* @__PURE__ */ jsx(TableCell, { children: isPartner ? registrationRegions[item.region] || "Ch\u01B0a cung c\u1EA5p" : city(item.city) }),
87
+ /* @__PURE__ */ jsx(TableCell, { sx: { maxWidth: 220, overflowWrap: "anywhere" }, children: isPartner ? /* @__PURE__ */ jsxs(Fragment, { children: [
88
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: partnerTypes[item.partner] || "Ch\u01B0a cung c\u1EA5p" }),
89
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", children: partnerExperiences[item.experience] || "Ch\u01B0a cung c\u1EA5p" })
90
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
75
91
  /* @__PURE__ */ jsx(Typography, { variant: "body2", children: item.markets.join(", ") || "Ch\u01B0a cung c\u1EA5p" }),
76
92
  item.otherMarket && /* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
77
93
  "Kh\xE1c: ",
78
94
  item.otherMarket
79
95
  ] }),
80
96
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: capital(item.capital) })
81
- ] }),
97
+ ] }) }),
82
98
  /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Chip, { size: "small", label: consultationStatuses[item.status], color: item.status === "new" ? "warning" : item.status === "completed" ? "success" : "default" }) }),
83
99
  /* @__PURE__ */ jsx(TableCell, { sx: { whiteSpace: "nowrap" }, children: date(item.createdAt) }),
84
100
  /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, children: [
@@ -110,70 +126,123 @@ function ConsultationManager({
110
126
  }
111
127
  )
112
128
  ] }),
113
- /* @__PURE__ */ jsxs(Dialog, { open: Boolean(editing), onClose: () => !busy && setEditing(null), fullWidth: true, maxWidth: "sm", children: [
114
- /* @__PURE__ */ jsx(DialogTitle, { children: "Chi ti\u1EBFt \u0111\u0103ng k\xFD t\u01B0 v\u1EA5n" }),
115
- /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsxs(Stack, { spacing: 2, sx: { pt: 1 }, children: [
116
- notice?.severity === "error" && /* @__PURE__ */ jsx(Alert, { severity: "error", children: notice.message }),
117
- editing && /* @__PURE__ */ jsxs(Stack, { spacing: 0.75, sx: { overflowWrap: "anywhere" }, children: [
118
- /* @__PURE__ */ jsxs(Typography, { children: [
119
- /* @__PURE__ */ jsx("strong", { children: "H\u1ECD v\xE0 t\xEAn:" }),
120
- " ",
121
- editing.name
122
- ] }),
123
- /* @__PURE__ */ jsxs(Typography, { children: [
124
- /* @__PURE__ */ jsx("strong", { children: "\u0110i\u1EC7n tho\u1EA1i:" }),
125
- " ",
126
- editing.phone
127
- ] }),
128
- /* @__PURE__ */ jsxs(Typography, { children: [
129
- /* @__PURE__ */ jsx("strong", { children: "Email:" }),
130
- " ",
131
- editing.email
132
- ] }),
133
- /* @__PURE__ */ jsxs(Typography, { children: [
134
- /* @__PURE__ */ jsx("strong", { children: "Khu v\u1EF1c:" }),
135
- " ",
136
- city(editing.city)
137
- ] }),
138
- /* @__PURE__ */ jsxs(Typography, { children: [
139
- /* @__PURE__ */ jsx("strong", { children: "Th\u1ECB tr\u01B0\u1EDDng:" }),
140
- " ",
141
- editing.markets.join(", ") || "Ch\u01B0a cung c\u1EA5p",
142
- editing.otherMarket ? ` \xB7 Kh\xE1c: ${editing.otherMarket}` : ""
143
- ] }),
144
- /* @__PURE__ */ jsxs(Typography, { children: [
145
- /* @__PURE__ */ jsx("strong", { children: "S\u1ED1 v\u1ED1n:" }),
146
- " ",
147
- capital(editing.capital)
129
+ /* @__PURE__ */ jsxs(
130
+ Dialog,
131
+ {
132
+ open: Boolean(editing),
133
+ onClose: () => !busy && setEditing(null),
134
+ fullWidth: true,
135
+ maxWidth: "md",
136
+ "aria-labelledby": "registration-detail-title",
137
+ slotProps: { paper: { sx: { borderRadius: 3, m: { xs: 1.5, sm: 4 }, width: { xs: "calc(100% - 24px)", sm: "100%" }, maxHeight: "calc(100% - 32px)" } } },
138
+ children: [
139
+ /* @__PURE__ */ jsxs(DialogTitle, { id: "registration-detail-title", sx: { px: { xs: 2.5, sm: 3 }, pt: 3, pb: 2 }, children: [
140
+ /* @__PURE__ */ jsx(Typography, { component: "span", variant: "overline", color: "text.secondary", children: isPartner ? "\u0110\u0103ng k\xFD \u0111\u1ED1i t\xE1c" : "\u0110\u0103ng k\xFD t\u01B0 v\u1EA5n" }),
141
+ /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 2, alignItems: "center", sx: { mt: 1 }, children: [
142
+ /* @__PURE__ */ jsx(Avatar, { sx: { width: 52, height: 52, bgcolor: "primary.lighter", color: "primary.dark", fontWeight: 700 }, children: editing?.name.trim().split(/\s+/).slice(-2).map((part) => part[0]).join("").toUpperCase() }),
143
+ /* @__PURE__ */ jsxs(Box, { sx: { minWidth: 0, flex: 1 }, children: [
144
+ /* @__PURE__ */ jsx(Typography, { component: "span", variant: "h5", sx: { display: "block", overflowWrap: "anywhere" }, children: editing?.name }),
145
+ /* @__PURE__ */ jsxs(Typography, { component: "span", variant: "body2", color: "text.secondary", children: [
146
+ isPartner ? "Wikex VN" : "Trang ch\u1EE7",
147
+ " \xB7 ",
148
+ editing && date(editing.createdAt)
149
+ ] })
150
+ ] })
151
+ ] })
148
152
  ] }),
149
- /* @__PURE__ */ jsxs(Typography, { children: [
150
- /* @__PURE__ */ jsx("strong", { children: "Trang g\u1EEDi:" }),
151
- " ",
152
- editing.sourcePath
153
+ /* @__PURE__ */ jsxs(DialogContent, { dividers: true, sx: { px: { xs: 2.5, sm: 3 }, py: 3, bgcolor: "background.neutral" }, children: [
154
+ notice?.severity === "error" && /* @__PURE__ */ jsx(Alert, { severity: "error", sx: { mb: 2 }, children: notice.message }),
155
+ editing && /* @__PURE__ */ jsxs(Box, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "minmax(0, 1.2fr) minmax(0, 1fr)" }, gap: 2.5 }, children: [
156
+ /* @__PURE__ */ jsxs(Stack, { spacing: 2.5, sx: { minWidth: 0 }, children: [
157
+ /* @__PURE__ */ jsxs(Card, { variant: "outlined", sx: { p: 2.5, boxShadow: "none" }, children: [
158
+ /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", sx: { mb: 2 }, children: "Th\xF4ng tin li\xEAn h\u1EC7" }),
159
+ /* @__PURE__ */ jsx(Box, { component: "dl", sx: { m: 0, display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr" }, gap: 2 }, children: [
160
+ { label: "\u0110i\u1EC7n tho\u1EA1i", value: /* @__PURE__ */ jsx(Link, { href: `tel:${editing.phone.replace(/[^+0-9]/g, "")}`, underline: "hover", color: "text.primary", children: editing.phone }) },
161
+ { label: "Khu v\u1EF1c", value: isPartner ? registrationRegions[editing.region] || "Ch\u01B0a cung c\u1EA5p" : city(editing.city) },
162
+ { label: "Email", value: /* @__PURE__ */ jsx(Link, { href: `mailto:${editing.email}`, underline: "hover", color: "text.primary", children: editing.email }), full: true }
163
+ ].map((field) => /* @__PURE__ */ jsxs(Box, { sx: { minWidth: 0, gridColumn: field.full ? "1 / -1" : void 0 }, children: [
164
+ /* @__PURE__ */ jsx(Typography, { component: "dt", variant: "caption", color: "text.secondary", sx: { mb: 0.5 }, children: field.label }),
165
+ /* @__PURE__ */ jsx(Typography, { component: "dd", variant: "body2", sx: { m: 0, fontWeight: 600, overflowWrap: "anywhere" }, children: field.value })
166
+ ] }, field.label)) })
167
+ ] }),
168
+ /* @__PURE__ */ jsxs(Card, { variant: "outlined", sx: { p: 2.5, boxShadow: "none" }, children: [
169
+ /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", sx: { mb: 2 }, children: isPartner ? "Th\xF4ng tin h\u1EE3p t\xE1c" : "Nhu c\u1EA7u t\u01B0 v\u1EA5n" }),
170
+ /* @__PURE__ */ jsxs(Box, { component: "dl", sx: { m: 0, display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr" }, gap: 2 }, children: [
171
+ (isPartner ? [
172
+ { label: "\u0110\u1ED1i t\xE1c", value: partnerTypes[editing.partner] || "Ch\u01B0a cung c\u1EA5p" },
173
+ { label: "Kinh nghi\u1EC7m", value: partnerExperiences[editing.experience] || "Ch\u01B0a cung c\u1EA5p" }
174
+ ] : [{ label: "S\u1ED1 v\u1ED1n d\u1EF1 ki\u1EBFn", value: capital(editing.capital) }]).map((field) => /* @__PURE__ */ jsxs(Box, { children: [
175
+ /* @__PURE__ */ jsx(Typography, { component: "dt", variant: "caption", color: "text.secondary", sx: { mb: 0.5 }, children: field.label }),
176
+ /* @__PURE__ */ jsx(Typography, { component: "dd", variant: "body2", sx: { m: 0, fontWeight: 600, overflowWrap: "anywhere" }, children: field.value })
177
+ ] }, field.label)),
178
+ /* @__PURE__ */ jsxs(Box, { sx: { gridColumn: "1 / -1", minWidth: 0 }, children: [
179
+ /* @__PURE__ */ jsx(Typography, { component: "dt", variant: "caption", color: "text.secondary", sx: { mb: 1 }, children: isPartner ? "K\xEAnh \u0111ang c\xF3 s\u1EB5n" : "Th\u1ECB tr\u01B0\u1EDDng quan t\xE2m" }),
180
+ /* @__PURE__ */ jsx(Stack, { component: "dd", direction: "row", flexWrap: "wrap", gap: 0.75, sx: { m: 0 }, children: (isPartner ? editing.sources : editing.markets).length ? (isPartner ? editing.sources : editing.markets).map(
181
+ (value, index) => /* @__PURE__ */ jsx(Chip, { label: value, size: "small", variant: "outlined", sx: { maxWidth: "100%", height: "auto", "& .MuiChip-label": { whiteSpace: "normal", py: 0.5, overflowWrap: "anywhere" } } }, `${value}-${index}`)
182
+ ) : /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", children: "Ch\u01B0a cung c\u1EA5p" }) }),
183
+ (isPartner ? editing.otherSource : editing.otherMarket) && /* @__PURE__ */ jsxs(Typography, { variant: "body2", sx: { mt: 1, overflowWrap: "anywhere" }, children: [
184
+ "Kh\xE1c: ",
185
+ isPartner ? editing.otherSource : editing.otherMarket
186
+ ] })
187
+ ] })
188
+ ] }),
189
+ /* @__PURE__ */ jsx(Divider, { sx: { my: 2 } }),
190
+ /* @__PURE__ */ jsxs(Stack, { spacing: 0.5, children: [
191
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "text.secondary", children: [
192
+ "Trang g\u1EEDi: ",
193
+ /* @__PURE__ */ jsx(Box, { component: "span", sx: { overflowWrap: "anywhere" }, children: editing.sourcePath })
194
+ ] }),
195
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "text.secondary", children: [
196
+ "Ng\xF4n ng\u1EEF: ",
197
+ editing.language === "en" ? "Ti\u1EBFng Anh" : "Ti\u1EBFng Vi\u1EC7t"
198
+ ] })
199
+ ] })
200
+ ] })
201
+ ] }),
202
+ /* @__PURE__ */ jsxs(Card, { variant: "outlined", sx: { p: 2.5, boxShadow: "none", alignSelf: "start", minWidth: 0 }, children: [
203
+ /* @__PURE__ */ jsxs(Stack, { direction: "row", gap: 1, justifyContent: "space-between", alignItems: "center", sx: { mb: 1 }, children: [
204
+ /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", children: "X\u1EED l\xFD \u0111\u0103ng k\xFD" }),
205
+ /* @__PURE__ */ jsx(Chip, { size: "small", label: consultationStatuses[draftStatus], color: draftStatus === "new" ? "warning" : draftStatus === "completed" ? "success" : draftStatus === "contacted" ? "info" : "default" })
206
+ ] }),
207
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", sx: { mb: 3 }, children: "C\u1EADp nh\u1EADt ti\u1EBFn \u0111\u1ED9 li\xEAn h\u1EC7 v\xE0 ghi ch\xFA cho \u0111\u1ED9i ng\u0169." }),
208
+ /* @__PURE__ */ jsxs(Stack, { spacing: 2.5, children: [
209
+ /* @__PURE__ */ jsx(TextField, { fullWidth: true, select: true, label: "Tr\u1EA1ng th\xE1i x\u1EED l\xFD", value: draftStatus, disabled: busy || !canWrite, onChange: (event) => setDraftStatus(event.target.value), children: Object.entries(consultationStatuses).map(([key, label]) => /* @__PURE__ */ jsx(MenuItem, { value: key, children: label }, key)) }),
210
+ /* @__PURE__ */ jsx(
211
+ TextField,
212
+ {
213
+ fullWidth: true,
214
+ label: "Ghi ch\xFA n\u1ED9i b\u1ED9",
215
+ placeholder: "N\u1ED9i dung trao \u0111\u1ED5i, nhu c\u1EA7u v\xE0 l\u1ECBch h\u1EB9n ti\u1EBFp theo\u2026",
216
+ value: notes,
217
+ disabled: busy || !canWrite,
218
+ multiline: true,
219
+ minRows: 5,
220
+ inputProps: { maxLength: 5e3 },
221
+ helperText: `${notes.length.toLocaleString("vi-VN")} / 5.000 k\xFD t\u1EF1 \xB7 Ch\u1EC9 hi\u1EC3n th\u1ECB trong CMS`,
222
+ onChange: (event) => setNotes(event.target.value)
223
+ }
224
+ ),
225
+ !canWrite && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "B\u1EA1n ch\u1EC9 c\xF3 quy\u1EC1n xem th\xF4ng tin \u0111\u0103ng k\xFD." })
226
+ ] })
227
+ ] })
228
+ ] })
153
229
  ] }),
154
- /* @__PURE__ */ jsxs(Typography, { children: [
155
- /* @__PURE__ */ jsx("strong", { children: "Ng\xE0y g\u1EEDi:" }),
156
- " ",
157
- date(editing.createdAt)
230
+ /* @__PURE__ */ jsxs(DialogActions, { sx: { px: { xs: 2.5, sm: 3 }, py: 2, gap: 1 }, children: [
231
+ /* @__PURE__ */ jsx(Button, { disabled: busy, onClick: () => setEditing(null), children: "\u0110\xF3ng" }),
232
+ canWrite && /* @__PURE__ */ jsx(Button, { variant: "contained", loading: busy, disabled: busy, onClick: async () => {
233
+ if (!editing) return;
234
+ try {
235
+ await onSave(editing, draftStatus, notes);
236
+ setEditing(null);
237
+ } catch {
238
+ }
239
+ }, children: "L\u01B0u x\u1EED l\xFD" })
158
240
  ] })
159
- ] }),
160
- /* @__PURE__ */ jsx(TextField, { select: true, label: "Tr\u1EA1ng th\xE1i x\u1EED l\xFD", value: draftStatus, disabled: busy || !canWrite, onChange: (event) => setDraftStatus(event.target.value), children: Object.entries(consultationStatuses).map(([key, label]) => /* @__PURE__ */ jsx(MenuItem, { value: key, children: label }, key)) }),
161
- /* @__PURE__ */ jsx(TextField, { label: "Ghi ch\xFA n\u1ED9i b\u1ED9", value: notes, disabled: busy || !canWrite, multiline: true, minRows: 4, inputProps: { maxLength: 5e3 }, onChange: (event) => setNotes(event.target.value) })
162
- ] }) }),
163
- /* @__PURE__ */ jsxs(DialogActions, { children: [
164
- /* @__PURE__ */ jsx(Button, { disabled: busy, onClick: () => setEditing(null), children: "\u0110\xF3ng" }),
165
- canWrite && /* @__PURE__ */ jsx(Button, { variant: "contained", loading: busy, disabled: busy, onClick: async () => {
166
- if (!editing) return;
167
- try {
168
- await onSave(editing, draftStatus, notes);
169
- setEditing(null);
170
- } catch {
171
- }
172
- }, children: "L\u01B0u x\u1EED l\xFD" })
173
- ] })
174
- ] }),
241
+ ]
242
+ }
243
+ ),
175
244
  /* @__PURE__ */ jsxs(Dialog, { open: Boolean(deleting), onClose: () => !busy && setDeleting(null), children: [
176
- /* @__PURE__ */ jsx(DialogTitle, { children: "X\xF3a \u0111\u0103ng k\xFD t\u01B0 v\u1EA5n?" }),
245
+ /* @__PURE__ */ jsx(DialogTitle, { children: "X\xF3a \u0111\u0103ng k\xFD?" }),
177
246
  /* @__PURE__ */ jsxs(DialogContent, { children: [
178
247
  notice?.severity === "error" && /* @__PURE__ */ jsx(Alert, { severity: "error", sx: { mb: 2 }, children: notice.message }),
179
248
  "Th\xF4ng tin \u0111\u0103ng k\xFD c\u1EE7a ",
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/wikex/consultation-manager.tsx","../src/consultation-model.ts"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { Alert, Box, Button, Card, Chip, Dialog, DialogActions, DialogContent, DialogTitle, MenuItem, Stack, Table, TableBody, TableCell, TableHead, TablePagination, TableRow, TextField, Typography } from '@mui/material';\nimport { consultationStatuses, consultationCities, consultationCapitals } from '../consultation-model';\nimport type { Consultation, ConsultationList, ConsultationStatus } from '../consultation-model';\n\nexport type ConsultationManagerProps = {\n data: ConsultationList;\n search: string;\n status: ConsultationStatus | '';\n loading: boolean;\n busy: boolean;\n canWrite: boolean;\n notice: { severity: 'success' | 'error'; message: string } | null;\n onSearch: (value: string) => void;\n onStatus: (value: ConsultationStatus | '') => void;\n onPage: (page: number) => void;\n onPageSize: (size: number) => void;\n onReload: () => void;\n onSave: (item: Consultation, status: ConsultationStatus, notes: string) => Promise<void>;\n onDelete: (item: Consultation) => Promise<void>;\n onDismissNotice: () => void;\n};\nconst date = (value: string) => new Intl.DateTimeFormat('vi-VN', { timeZone: 'Asia/Ho_Chi_Minh', dateStyle: 'short', timeStyle: 'short' }).format(new Date(value));\nconst city = (value: string) => consultationCities[value] || value || 'Chưa cung cấp';\nconst capital = (value: string) => consultationCapitals[value] || value || 'Chưa cung cấp';\n\nexport function ConsultationManager({ data, search, status, loading, busy, canWrite, notice, onSearch, onStatus,\n onPage, onPageSize, onReload, onSave, onDelete, onDismissNotice }: ConsultationManagerProps) {\n const [editing, setEditing] = useState<Consultation | null>(null);\n const [deleting, setDeleting] = useState<Consultation | null>(null);\n const [draftStatus, setDraftStatus] = useState<ConsultationStatus>('new');\n const [notes, setNotes] = useState('');\n return <Stack spacing={3} sx={{ minWidth: 0 }}>\n <Stack direction={{ xs: 'column', sm: 'row' }} gap={2} justifyContent=\"space-between\" alignItems={{ sm: 'center' }}>\n <Stack spacing={1}><Typography variant=\"h4\">Đăng ký tư vấn</Typography>\n <Typography variant=\"body2\" color=\"text.secondary\">Thông tin từ form đăng ký trên website. Theo dõi liên hệ và ghi chú xử lý.</Typography></Stack>\n <Button variant=\"outlined\" disabled={loading || busy} onClick={onReload}>Tải lại danh sách</Button>\n </Stack>\n {!canWrite && <Alert severity=\"info\">Bạn có quyền xem đăng ký. Cần quyền chỉnh sửa đăng ký tư vấn để cập nhật hoặc xóa.</Alert>}\n {notice && <Alert severity={notice.severity} onClose={onDismissNotice}>{notice.message}</Alert>}\n <Card sx={{ p: 3 }}><Stack direction={{ xs: 'column', sm: 'row' }} spacing={2}>\n <TextField size=\"small\" fullWidth label=\"Tìm theo tên, điện thoại hoặc email\" value={search} disabled={busy} onChange={event => onSearch(event.target.value)} />\n <TextField select size=\"small\" label=\"Trạng thái\" value={status} disabled={busy} sx={{ minWidth: 200 }} onChange={event => onStatus(event.target.value as ConsultationStatus | '')}>\n <MenuItem value=\"\">Tất cả</MenuItem>{Object.entries(consultationStatuses).map(([key, label]) => <MenuItem key={key} value={key}>{label}</MenuItem>)}\n </TextField>\n </Stack></Card>\n <Card aria-busy={loading} sx={{ opacity: loading ? 0.65 : 1 }}>\n <Box sx={{ overflowX: 'auto' }}><Table aria-label=\"Danh sách đăng ký tư vấn\" sx={{ minWidth: 1050 }}>\n <TableHead><TableRow>{['Khách hàng', 'Điện thoại / Email', 'Khu vực', 'Thị trường / Vốn', 'Trạng thái', 'Ngày gửi', 'Thao tác'].map(title => <TableCell key={title}>{title}</TableCell>)}</TableRow></TableHead>\n <TableBody>{data.items.map(item => <TableRow key={item.id}>\n <TableCell sx={{ maxWidth: 220, overflowWrap: 'anywhere' }}><Typography variant=\"subtitle2\">{item.name}</Typography><Typography variant=\"caption\" color=\"text.secondary\">{item.language.toUpperCase()}</Typography></TableCell>\n <TableCell sx={{ maxWidth: 260, overflowWrap: 'anywhere' }}><Typography variant=\"body2\">{item.phone}</Typography><Typography variant=\"body2\" color=\"text.secondary\">{item.email}</Typography></TableCell>\n <TableCell>{city(item.city)}</TableCell>\n <TableCell sx={{ maxWidth: 220, overflowWrap: 'anywhere' }}><Typography variant=\"body2\">{item.markets.join(', ') || 'Chưa cung cấp'}</Typography>{item.otherMarket && <Typography variant=\"body2\">Khác: {item.otherMarket}</Typography>}<Typography variant=\"caption\" color=\"text.secondary\">{capital(item.capital)}</Typography></TableCell>\n <TableCell><Chip size=\"small\" label={consultationStatuses[item.status]} color={item.status === 'new' ? 'warning' : item.status === 'completed' ? 'success' : 'default'} /></TableCell>\n <TableCell sx={{ whiteSpace: 'nowrap' }}>{date(item.createdAt)}</TableCell>\n <TableCell><Stack direction=\"row\" spacing={1}><Button size=\"small\" disabled={busy} onClick={() => { setEditing(item); setDraftStatus(item.status); setNotes(item.notes); }}>Xem / xử lý</Button>{canWrite && <Button size=\"small\" color=\"error\" disabled={busy} onClick={() => setDeleting(item)}>Xóa</Button>}</Stack></TableCell>\n </TableRow>)}{!data.items.length && <TableRow><TableCell colSpan={7} align=\"center\" sx={{ py: 6 }}>{loading ? 'Đang tải đăng ký…' : 'Chưa có đăng ký phù hợp.'}</TableCell></TableRow>}</TableBody>\n </Table></Box>\n <TablePagination component=\"div\" count={data.total} page={data.page - 1} rowsPerPage={data.pageSize}\n rowsPerPageOptions={[10, 25, 50, 100]} labelRowsPerPage=\"Số dòng mỗi trang\" labelDisplayedRows={({ from, to, count }) => `${from}–${to} / ${count}`}\n onPageChange={(_, next) => onPage(next + 1)} onRowsPerPageChange={event => onPageSize(Number(event.target.value))}\n disabled={loading || busy} slotProps={{ select: { native: false }, actions: { previousButton: { 'aria-label': 'Trang trước' }, nextButton: { 'aria-label': 'Trang sau' } } }} />\n </Card>\n <Dialog open={Boolean(editing)} onClose={() => !busy && setEditing(null)} fullWidth maxWidth=\"sm\">\n <DialogTitle>Chi tiết đăng ký tư vấn</DialogTitle><DialogContent><Stack spacing={2} sx={{ pt: 1 }}>\n {notice?.severity === 'error' && <Alert severity=\"error\">{notice.message}</Alert>}\n {editing && <Stack spacing={0.75} sx={{ overflowWrap: 'anywhere' }}>\n <Typography><strong>Họ và tên:</strong> {editing.name}</Typography><Typography><strong>Điện thoại:</strong> {editing.phone}</Typography><Typography><strong>Email:</strong> {editing.email}</Typography>\n <Typography><strong>Khu vực:</strong> {city(editing.city)}</Typography><Typography><strong>Thị trường:</strong> {editing.markets.join(', ') || 'Chưa cung cấp'}{editing.otherMarket ? ` · Khác: ${editing.otherMarket}` : ''}</Typography>\n <Typography><strong>Số vốn:</strong> {capital(editing.capital)}</Typography><Typography><strong>Trang gửi:</strong> {editing.sourcePath}</Typography><Typography><strong>Ngày gửi:</strong> {date(editing.createdAt)}</Typography>\n </Stack>}\n <TextField select label=\"Trạng thái xử lý\" value={draftStatus} disabled={busy || !canWrite} onChange={event => setDraftStatus(event.target.value as ConsultationStatus)}>\n {Object.entries(consultationStatuses).map(([key, label]) => <MenuItem key={key} value={key}>{label}</MenuItem>)}\n </TextField>\n <TextField label=\"Ghi chú nội bộ\" value={notes} disabled={busy || !canWrite} multiline minRows={4} inputProps={{ maxLength: 5000 }} onChange={event => setNotes(event.target.value)} />\n </Stack></DialogContent><DialogActions><Button disabled={busy} onClick={() => setEditing(null)}>Đóng</Button>{canWrite && <Button variant=\"contained\" loading={busy} disabled={busy} onClick={async () => {\n if (!editing) return;\n try { await onSave(editing, draftStatus, notes); setEditing(null); } catch { /* Host reports the error and retains the draft. */ }\n }}>Lưu xử lý</Button>}</DialogActions>\n </Dialog>\n <Dialog open={Boolean(deleting)} onClose={() => !busy && setDeleting(null)}><DialogTitle>Xóa đăng ký tư vấn?</DialogTitle><DialogContent>\n {notice?.severity === 'error' && <Alert severity=\"error\" sx={{ mb: 2 }}>{notice.message}</Alert>}\n Thông tin đăng ký của {deleting?.name} sẽ bị xóa vĩnh viễn.\n </DialogContent><DialogActions><Button disabled={busy} onClick={() => setDeleting(null)}>Hủy</Button><Button color=\"error\" disabled={busy} onClick={async () => {\n if (!deleting) return;\n try { await onDelete(deleting); setDeleting(null); } catch { /* Host reports the error. */ }\n }}>Xóa đăng ký</Button></DialogActions></Dialog>\n </Stack>;\n}\n","export type ConsultationSubmission = {\n submissionId: string;\n name: string;\n phone: string;\n email: string;\n city: string;\n markets: string[];\n otherMarket: string;\n capital: string;\n language: 'vi' | 'en';\n sourcePath: string;\n website: string;\n};\n\nexport const consultationStatuses = {\n new: 'Mới', contacted: 'Đã liên hệ', completed: 'Hoàn tất', cancelled: 'Không tiếp tục',\n} as const;\nexport type ConsultationStatus = keyof typeof consultationStatuses;\nexport const consultationCities: Record<string, string> = { 'ho-chi-minh-city': 'TP. Hồ Chí Minh', hanoi: 'Hà Nội', other: 'Khác' };\nexport const consultationCapitals: Record<string, string> = { 'under-10m': 'Dưới 10 triệu', '10m-30m': '10–30 triệu', '30m-100m': '30–100 triệu', 'over-100m': 'Trên 100 triệu' };\nexport type Consultation = Omit<ConsultationSubmission, 'website' | 'submissionId'> & {\n id: string; status: ConsultationStatus; notes: string; createdAt: string; updatedAt: string;\n};\nexport type ConsultationList = { items: Consultation[]; total: number; page: number; pageSize: number };\n"],"mappings":";;;AAEA,SAAS,gBAAgB;AACzB,SAAS,OAAO,KAAK,QAAQ,MAAM,MAAM,QAAQ,eAAe,eAAe,aAAa,UAAU,OAAO,OAAO,WAAW,WAAW,WAAW,iBAAiB,UAAU,WAAW,kBAAkB;;;ACWtM,IAAM,uBAAuB;AAAA,EAClC,KAAK;AAAA,EAAO,WAAW;AAAA,EAAc,WAAW;AAAA,EAAY,WAAW;AACzE;AAEO,IAAM,qBAA6C,EAAE,oBAAoB,2BAAmB,OAAO,kBAAU,OAAO,UAAO;AAC3H,IAAM,uBAA+C,EAAE,aAAa,gCAAiB,WAAW,yBAAe,YAAY,0BAAgB,aAAa,yBAAiB;;;ADiB1K,SAAmB,KAAnB;AAZN,IAAM,OAAO,CAAC,UAAkB,IAAI,KAAK,eAAe,SAAS,EAAE,UAAU,oBAAoB,WAAW,SAAS,WAAW,QAAQ,CAAC,EAAE,OAAO,IAAI,KAAK,KAAK,CAAC;AACjK,IAAM,OAAO,CAAC,UAAkB,mBAAmB,KAAK,KAAK,SAAS;AACtE,IAAM,UAAU,CAAC,UAAkB,qBAAqB,KAAK,KAAK,SAAS;AAEpE,SAAS,oBAAoB;AAAA,EAAE;AAAA,EAAM;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAM;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAU;AAAA,EACrG;AAAA,EAAQ;AAAA,EAAY;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAU;AAAgB,GAA6B;AAC7F,QAAM,CAAC,SAAS,UAAU,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AE,GAAI,iBAAO,SAAQ;AAAA,QAAS;AAAA,QAC1E,UAAU;AAAA,QAAK;AAAA,SACxC;AAAA,MAAgB,qBAAC,iBAAc;AAAA,4BAAC,UAAO,UAAU,MAAM,SAAS,MAAM,YAAY,IAAI,GAAG,sBAAG;AAAA,QAAS,oBAAC,UAAO,OAAM,SAAQ,UAAU,MAAM,SAAS,YAAY;AAC9J,cAAI,CAAC,SAAU;AACf,cAAI;AAAE,kBAAM,SAAS,QAAQ;AAAG,wBAAY,IAAI;AAAA,UAAG,QAAQ;AAAA,UAAgC;AAAA,QAC7F,GAAG,yCAAW;AAAA,SAAS;AAAA,OAAgB;AAAA,KACzC;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/wikex/consultation-manager.tsx","../src/consultation-model.ts"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { Alert, Avatar, Box, Button, Card, Chip, Dialog, DialogActions, DialogContent, DialogTitle, Divider, Link, MenuItem, Stack, Table, TableBody, TableCell, TableHead, TablePagination, TableRow, TextField, Typography } from '@mui/material';\nimport { consultationStatuses, consultationCities, consultationCapitals, registrationRegions, partnerTypes, partnerExperiences } from '../consultation-model';\nimport type { Consultation, ConsultationList, ConsultationStatus } from '../consultation-model';\n\nexport type ConsultationManagerProps = {\n kind?: 'consultation' | 'partner';\n data: ConsultationList;\n search: string;\n status: ConsultationStatus | '';\n loading: boolean;\n busy: boolean;\n canWrite: boolean;\n notice: { severity: 'success' | 'error'; message: string } | null;\n onSearch: (value: string) => void;\n onStatus: (value: ConsultationStatus | '') => void;\n onPage: (page: number) => void;\n onPageSize: (size: number) => void;\n onReload: () => void;\n onSave: (item: Consultation, status: ConsultationStatus, notes: string) => Promise<void>;\n onDelete: (item: Consultation) => Promise<void>;\n onDismissNotice: () => void;\n};\nconst date = (value: string) => new Intl.DateTimeFormat('vi-VN', { timeZone: 'Asia/Ho_Chi_Minh', dateStyle: 'short', timeStyle: 'short' }).format(new Date(value));\nconst city = (value: string) => consultationCities[value] || value || 'Chưa cung cấp';\nconst capital = (value: string) => consultationCapitals[value] || value || 'Chưa cung cấp';\n\nexport function ConsultationManager({ kind = 'consultation', data, search, status, loading, busy, canWrite, notice, onSearch, onStatus,\n onPage, onPageSize, onReload, onSave, onDelete, onDismissNotice }: ConsultationManagerProps) {\n const isPartner = kind === 'partner';\n const title = isPartner ? 'Đăng ký đối tác — Wikex VN' : 'Đăng ký tư vấn — Trang chủ';\n const [editing, setEditing] = useState<Consultation | null>(null);\n const [deleting, setDeleting] = useState<Consultation | null>(null);\n const [draftStatus, setDraftStatus] = useState<ConsultationStatus>('new');\n const [notes, setNotes] = useState('');\n return <Stack spacing={3} sx={{ minWidth: 0 }}>\n <Stack direction={{ xs: 'column', sm: 'row' }} gap={2} justifyContent=\"space-between\" alignItems={{ sm: 'center' }}>\n <Stack spacing={1}><Typography variant=\"h4\">{title}</Typography>\n <Typography variant=\"body2\" color=\"text.secondary\">Thông tin từ form đăng ký trên website. Theo dõi liên hệ và ghi chú xử lý.</Typography></Stack>\n <Button variant=\"outlined\" disabled={loading || busy} onClick={onReload}>Tải lại danh sách</Button>\n </Stack>\n {!canWrite && <Alert severity=\"info\">Bạn có quyền xem đăng ký. Cần quyền chỉnh sửa đăng ký để cập nhật hoặc xóa.</Alert>}\n {notice && <Alert severity={notice.severity} onClose={onDismissNotice}>{notice.message}</Alert>}\n <Card sx={{ p: 3 }}><Stack direction={{ xs: 'column', sm: 'row' }} spacing={2}>\n <TextField size=\"small\" fullWidth label=\"Tìm theo tên, điện thoại hoặc email\" value={search} disabled={busy} onChange={event => onSearch(event.target.value)} />\n <TextField select size=\"small\" label=\"Trạng thái\" value={status} disabled={busy} sx={{ minWidth: 200 }} onChange={event => onStatus(event.target.value as ConsultationStatus | '')}>\n <MenuItem value=\"\">Tất cả</MenuItem>{Object.entries(consultationStatuses).map(([key, label]) => <MenuItem key={key} value={key}>{label}</MenuItem>)}\n </TextField>\n </Stack></Card>\n <Card aria-busy={loading} sx={{ opacity: loading ? 0.65 : 1 }}>\n <Box sx={{ overflowX: 'auto' }}><Table aria-label={title} sx={{ minWidth: 1050 }}>\n <TableHead><TableRow>{['Khách hàng', 'Điện thoại / Email', 'Khu vực', isPartner ? 'Đối tác / Kinh nghiệm' : 'Thị trường / Vốn', 'Trạng thái', 'Ngày gửi', 'Thao tác'].map(title => <TableCell key={title}>{title}</TableCell>)}</TableRow></TableHead>\n <TableBody>{data.items.map(item => <TableRow key={item.id}>\n <TableCell sx={{ maxWidth: 220, overflowWrap: 'anywhere' }}><Typography variant=\"subtitle2\">{item.name}</Typography><Typography variant=\"caption\" color=\"text.secondary\">{item.language.toUpperCase()}</Typography></TableCell>\n <TableCell sx={{ maxWidth: 260, overflowWrap: 'anywhere' }}><Typography variant=\"body2\">{item.phone}</Typography><Typography variant=\"body2\" color=\"text.secondary\">{item.email}</Typography></TableCell>\n <TableCell>{isPartner ? registrationRegions[item.region] || 'Chưa cung cấp' : city(item.city)}</TableCell>\n <TableCell sx={{ maxWidth: 220, overflowWrap: 'anywhere' }}>{isPartner ? <><Typography variant=\"body2\">{partnerTypes[item.partner] || 'Chưa cung cấp'}</Typography><Typography variant=\"caption\">{partnerExperiences[item.experience] || 'Chưa cung cấp'}</Typography></> : <><Typography variant=\"body2\">{item.markets.join(', ') || 'Chưa cung cấp'}</Typography>{item.otherMarket && <Typography variant=\"body2\">Khác: {item.otherMarket}</Typography>}<Typography variant=\"caption\" color=\"text.secondary\">{capital(item.capital)}</Typography></>}</TableCell>\n <TableCell><Chip size=\"small\" label={consultationStatuses[item.status]} color={item.status === 'new' ? 'warning' : item.status === 'completed' ? 'success' : 'default'} /></TableCell>\n <TableCell sx={{ whiteSpace: 'nowrap' }}>{date(item.createdAt)}</TableCell>\n <TableCell><Stack direction=\"row\" spacing={1}><Button size=\"small\" disabled={busy} onClick={() => { setEditing(item); setDraftStatus(item.status); setNotes(item.notes); }}>Xem / xử lý</Button>{canWrite && <Button size=\"small\" color=\"error\" disabled={busy} onClick={() => setDeleting(item)}>Xóa</Button>}</Stack></TableCell>\n </TableRow>)}{!data.items.length && <TableRow><TableCell colSpan={7} align=\"center\" sx={{ py: 6 }}>{loading ? 'Đang tải đăng ký…' : 'Chưa có đăng ký phù hợp.'}</TableCell></TableRow>}</TableBody>\n </Table></Box>\n <TablePagination component=\"div\" count={data.total} page={data.page - 1} rowsPerPage={data.pageSize}\n rowsPerPageOptions={[10, 25, 50, 100]} labelRowsPerPage=\"Số dòng mỗi trang\" labelDisplayedRows={({ from, to, count }) => `${from}–${to} / ${count}`}\n onPageChange={(_, next) => onPage(next + 1)} onRowsPerPageChange={event => onPageSize(Number(event.target.value))}\n disabled={loading || busy} slotProps={{ select: { native: false }, actions: { previousButton: { 'aria-label': 'Trang trước' }, nextButton: { 'aria-label': 'Trang sau' } } }} />\n </Card>\n <Dialog open={Boolean(editing)} onClose={() => !busy && setEditing(null)} fullWidth maxWidth=\"md\"\n aria-labelledby=\"registration-detail-title\"\n slotProps={{ paper: { sx: { borderRadius: 3, m: { xs: 1.5, sm: 4 }, width: { xs: 'calc(100% - 24px)', sm: '100%' }, maxHeight: 'calc(100% - 32px)' } } }}>\n <DialogTitle id=\"registration-detail-title\" sx={{ px: { xs: 2.5, sm: 3 }, pt: 3, pb: 2 }}>\n <Typography component=\"span\" variant=\"overline\" color=\"text.secondary\">{isPartner ? 'Đăng ký đối tác' : 'Đăng ký tư vấn'}</Typography>\n <Stack direction=\"row\" spacing={2} alignItems=\"center\" sx={{ mt: 1 }}>\n <Avatar sx={{ width: 52, height: 52, bgcolor: 'primary.lighter', color: 'primary.dark', fontWeight: 700 }}>\n {editing?.name.trim().split(/\\s+/).slice(-2).map(part => part[0]).join('').toUpperCase()}\n </Avatar>\n <Box sx={{ minWidth: 0, flex: 1 }}>\n <Typography component=\"span\" variant=\"h5\" sx={{ display: 'block', overflowWrap: 'anywhere' }}>{editing?.name}</Typography>\n <Typography component=\"span\" variant=\"body2\" color=\"text.secondary\">{isPartner ? 'Wikex VN' : 'Trang chủ'} · {editing && date(editing.createdAt)}</Typography>\n </Box>\n </Stack>\n </DialogTitle>\n <DialogContent dividers sx={{ px: { xs: 2.5, sm: 3 }, py: 3, bgcolor: 'background.neutral' }}>\n {notice?.severity === 'error' && <Alert severity=\"error\" sx={{ mb: 2 }}>{notice.message}</Alert>}\n {editing && <Box sx={{ display: 'grid', gridTemplateColumns: { xs: '1fr', md: 'minmax(0, 1.2fr) minmax(0, 1fr)' }, gap: 2.5 }}>\n <Stack spacing={2.5} sx={{ minWidth: 0 }}>\n <Card variant=\"outlined\" sx={{ p: 2.5, boxShadow: 'none' }}>\n <Typography variant=\"subtitle1\" sx={{ mb: 2 }}>Thông tin liên hệ</Typography>\n <Box component=\"dl\" sx={{ m: 0, display: 'grid', gridTemplateColumns: { xs: '1fr', sm: '1fr 1fr' }, gap: 2 }}>\n {[\n { label: 'Điện thoại', value: <Link href={`tel:${editing.phone.replace(/[^+0-9]/g, '')}`} underline=\"hover\" color=\"text.primary\">{editing.phone}</Link> },\n { label: 'Khu vực', value: isPartner ? registrationRegions[editing.region] || 'Chưa cung cấp' : city(editing.city) },\n { label: 'Email', value: <Link href={`mailto:${editing.email}`} underline=\"hover\" color=\"text.primary\">{editing.email}</Link>, full: true },\n ].map(field => <Box key={field.label} sx={{ minWidth: 0, gridColumn: field.full ? '1 / -1' : undefined }}>\n <Typography component=\"dt\" variant=\"caption\" color=\"text.secondary\" sx={{ mb: 0.5 }}>{field.label}</Typography>\n <Typography component=\"dd\" variant=\"body2\" sx={{ m: 0, fontWeight: 600, overflowWrap: 'anywhere' }}>{field.value}</Typography>\n </Box>)}\n </Box>\n </Card>\n <Card variant=\"outlined\" sx={{ p: 2.5, boxShadow: 'none' }}>\n <Typography variant=\"subtitle1\" sx={{ mb: 2 }}>{isPartner ? 'Thông tin hợp tác' : 'Nhu cầu tư vấn'}</Typography>\n <Box component=\"dl\" sx={{ m: 0, display: 'grid', gridTemplateColumns: { xs: '1fr', sm: '1fr 1fr' }, gap: 2 }}>\n {(isPartner ? [\n { label: 'Đối tác', value: partnerTypes[editing.partner] || 'Chưa cung cấp' },\n { label: 'Kinh nghiệm', value: partnerExperiences[editing.experience] || 'Chưa cung cấp' },\n ] : [{ label: 'Số vốn dự kiến', value: capital(editing.capital) }]).map(field => <Box key={field.label}>\n <Typography component=\"dt\" variant=\"caption\" color=\"text.secondary\" sx={{ mb: 0.5 }}>{field.label}</Typography>\n <Typography component=\"dd\" variant=\"body2\" sx={{ m: 0, fontWeight: 600, overflowWrap: 'anywhere' }}>{field.value}</Typography>\n </Box>)}\n <Box sx={{ gridColumn: '1 / -1', minWidth: 0 }}>\n <Typography component=\"dt\" variant=\"caption\" color=\"text.secondary\" sx={{ mb: 1 }}>{isPartner ? 'Kênh đang có sẵn' : 'Thị trường quan tâm'}</Typography>\n <Stack component=\"dd\" direction=\"row\" flexWrap=\"wrap\" gap={0.75} sx={{ m: 0 }}>\n {(isPartner ? editing.sources : editing.markets).length ? (isPartner ? editing.sources : editing.markets).map((value, index) =>\n <Chip key={`${value}-${index}`} label={value} size=\"small\" variant=\"outlined\" sx={{ maxWidth: '100%', height: 'auto', '& .MuiChip-label': { whiteSpace: 'normal', py: 0.5, overflowWrap: 'anywhere' } }} />\n ) : <Typography variant=\"body2\" color=\"text.secondary\">Chưa cung cấp</Typography>}\n </Stack>\n {(isPartner ? editing.otherSource : editing.otherMarket) && <Typography variant=\"body2\" sx={{ mt: 1, overflowWrap: 'anywhere' }}>Khác: {isPartner ? editing.otherSource : editing.otherMarket}</Typography>}\n </Box>\n </Box>\n <Divider sx={{ my: 2 }} />\n <Stack spacing={0.5}>\n <Typography variant=\"caption\" color=\"text.secondary\">Trang gửi: <Box component=\"span\" sx={{ overflowWrap: 'anywhere' }}>{editing.sourcePath}</Box></Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">Ngôn ngữ: {editing.language === 'en' ? 'Tiếng Anh' : 'Tiếng Việt'}</Typography>\n </Stack>\n </Card>\n </Stack>\n <Card variant=\"outlined\" sx={{ p: 2.5, boxShadow: 'none', alignSelf: 'start', minWidth: 0 }}>\n <Stack direction=\"row\" gap={1} justifyContent=\"space-between\" alignItems=\"center\" sx={{ mb: 1 }}>\n <Typography variant=\"subtitle1\">Xử lý đăng ký</Typography>\n <Chip size=\"small\" label={consultationStatuses[draftStatus]} color={draftStatus === 'new' ? 'warning' : draftStatus === 'completed' ? 'success' : draftStatus === 'contacted' ? 'info' : 'default'} />\n </Stack>\n <Typography variant=\"body2\" color=\"text.secondary\" sx={{ mb: 3 }}>Cập nhật tiến độ liên hệ và ghi chú cho đội ngũ.</Typography>\n <Stack spacing={2.5}>\n <TextField fullWidth select label=\"Trạng thái xử lý\" value={draftStatus} disabled={busy || !canWrite} onChange={event => setDraftStatus(event.target.value as ConsultationStatus)}>\n {Object.entries(consultationStatuses).map(([key, label]) => <MenuItem key={key} value={key}>{label}</MenuItem>)}\n </TextField>\n <TextField fullWidth label=\"Ghi chú nội bộ\" placeholder=\"Nội dung trao đổi, nhu cầu và lịch hẹn tiếp theo…\" value={notes} disabled={busy || !canWrite} multiline minRows={5}\n inputProps={{ maxLength: 5000 }} helperText={`${notes.length.toLocaleString('vi-VN')} / 5.000 ký tự · Chỉ hiển thị trong CMS`}\n onChange={event => setNotes(event.target.value)} />\n {!canWrite && <Typography variant=\"caption\" color=\"text.secondary\">Bạn chỉ có quyền xem thông tin đăng ký.</Typography>}\n </Stack>\n </Card>\n </Box>}\n </DialogContent>\n <DialogActions sx={{ px: { xs: 2.5, sm: 3 }, py: 2, gap: 1 }}>\n <Button disabled={busy} onClick={() => setEditing(null)}>Đóng</Button>{canWrite && <Button variant=\"contained\" loading={busy} disabled={busy} onClick={async () => {\n if (!editing) return;\n try { await onSave(editing, draftStatus, notes); setEditing(null); } catch { /* Host retains the draft. */ }\n }}>Lưu xử lý</Button>}\n </DialogActions>\n </Dialog>\n <Dialog open={Boolean(deleting)} onClose={() => !busy && setDeleting(null)}><DialogTitle>Xóa đăng ký?</DialogTitle><DialogContent>\n {notice?.severity === 'error' && <Alert severity=\"error\" sx={{ mb: 2 }}>{notice.message}</Alert>}\n Thông tin đăng ký của {deleting?.name} sẽ bị xóa vĩnh viễn.\n </DialogContent><DialogActions><Button disabled={busy} onClick={() => setDeleting(null)}>Hủy</Button><Button color=\"error\" disabled={busy} onClick={async () => {\n if (!deleting) return;\n try { await onDelete(deleting); setDeleting(null); } catch { /* Host reports the error. */ }\n }}>Xóa đăng ký</Button></DialogActions></Dialog>\n </Stack>;\n}\n","export type RegistrationKind = 'consultation' | 'partner';\nexport const registrationRegions: Record<string, string> = {\n north: 'Khu vực miền Bắc', 'north-central': 'Khu vực Bắc Trung Bộ', central: 'Khu vực miền Trung',\n highlands: 'Khu vực Tây Nguyên', south: 'Khu vực miền Nam', mekong: 'Khu vực miền Tây',\n};\nexport const partnerTypes: Record<string, string> = { individual: 'Cá nhân', broker: 'Môi giới tài chính', professional: 'Chuyên viên môi giới', other: 'Khác' };\nexport const partnerExperiences: Record<string, string> = { none: 'Chưa có kinh nghiệm', under1: 'Dưới 1 năm', oneTo3: '1–3 năm', over3: 'Trên 3 năm', other: 'Khác' };\nexport type ConsultationSubmission = {\n kind: RegistrationKind;\n region: string;\n partner: string;\n experience: string;\n sources: string[];\n otherSource: string;\n submissionId: string;\n name: string;\n phone: string;\n email: string;\n city: string;\n markets: string[];\n otherMarket: string;\n capital: string;\n language: 'vi' | 'en';\n sourcePath: string;\n website: string;\n};\n\nexport const consultationStatuses = {\n new: 'Mới', contacted: 'Đã liên hệ', completed: 'Hoàn tất', cancelled: 'Không tiếp tục',\n} as const;\nexport type ConsultationStatus = keyof typeof consultationStatuses;\nexport const consultationCities: Record<string, string> = { 'ho-chi-minh-city': 'TP. Hồ Chí Minh', hanoi: 'Hà Nội', other: 'Khác' };\nexport const consultationCapitals: Record<string, string> = { 'under-10m': 'Dưới 10 triệu', '10m-30m': '10–30 triệu', '30m-100m': '30–100 triệu', 'over-100m': 'Trên 100 triệu' };\nexport type Consultation = Omit<ConsultationSubmission, 'website' | 'submissionId'> & {\n id: string; status: ConsultationStatus; notes: string; createdAt: string; updatedAt: string;\n};\nexport type ConsultationList = { items: Consultation[]; total: number; page: number; pageSize: number };\n"],"mappings":";;;AAEA,SAAS,gBAAgB;AACzB,SAAS,OAAO,QAAQ,KAAK,QAAQ,MAAM,MAAM,QAAQ,eAAe,eAAe,aAAa,SAAS,MAAM,UAAU,OAAO,OAAO,WAAW,WAAW,WAAW,iBAAiB,UAAU,WAAW,kBAAkB;;;ACF7N,IAAM,sBAA8C;AAAA,EACzD,OAAO;AAAA,EAAoB,iBAAiB;AAAA,EAAwB,SAAS;AAAA,EAC7E,WAAW;AAAA,EAAsB,OAAO;AAAA,EAAoB,QAAQ;AACtE;AACO,IAAM,eAAuC,EAAE,YAAY,iBAAW,QAAQ,oCAAsB,cAAc,sCAAwB,OAAO,UAAO;AACxJ,IAAM,qBAA6C,EAAE,MAAM,oCAAuB,QAAQ,6BAAc,QAAQ,qBAAW,OAAO,sBAAc,OAAO,UAAO;AAqB9J,IAAM,uBAAuB;AAAA,EAClC,KAAK;AAAA,EAAO,WAAW;AAAA,EAAc,WAAW;AAAA,EAAY,WAAW;AACzE;AAEO,IAAM,qBAA6C,EAAE,oBAAoB,2BAAmB,OAAO,kBAAU,OAAO,UAAO;AAC3H,IAAM,uBAA+C,EAAE,aAAa,gCAAiB,WAAW,yBAAe,YAAY,0BAAgB,aAAa,yBAAiB;;;ADO1K,SAmB6E,UAnB1D,KAAnB;AAdN,IAAM,OAAO,CAAC,UAAkB,IAAI,KAAK,eAAe,SAAS,EAAE,UAAU,oBAAoB,WAAW,SAAS,WAAW,QAAQ,CAAC,EAAE,OAAO,IAAI,KAAK,KAAK,CAAC;AACjK,IAAM,OAAO,CAAC,UAAkB,mBAAmB,KAAK,KAAK,SAAS;AACtE,IAAM,UAAU,CAAC,UAAkB,qBAAqB,KAAK,KAAK,SAAS;AAEpE,SAAS,oBAAoB;AAAA,EAAE,OAAO;AAAA,EAAgB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AAQ,aAAa,WAAW,oBAAC,SAAM,UAAS,SAAQ,IAAI,EAAE,IAAI,EAAE,GAAI,iBAAO,SAAQ;AAAA,QAAS;AAAA,QAC1E,UAAU;AAAA,QAAK;AAAA,SACxC;AAAA,MAAgB,qBAAC,iBAAc;AAAA,4BAAC,UAAO,UAAU,MAAM,SAAS,MAAM,YAAY,IAAI,GAAG,sBAAG;AAAA,QAAS,oBAAC,UAAO,OAAM,SAAQ,UAAU,MAAM,SAAS,YAAY;AAC9J,cAAI,CAAC,SAAU;AACf,cAAI;AAAE,kBAAM,SAAS,QAAQ;AAAG,wBAAY,IAAI;AAAA,UAAG,QAAQ;AAAA,UAAgC;AAAA,QAC7F,GAAG,yCAAW;AAAA,SAAS;AAAA,OAAgB;AAAA,KACzC;AACF;","names":["title"]}
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ComponentType } from 'react';
2
+ import { ComponentType, ReactNode, CSSProperties } from 'react';
3
3
  import { ConsultationSubmission } from './consultation-model.mjs';
4
4
  export { WikexCommodityPageTemplate, wikexCommodityPageTemplates, wikexCommodityRoutes } from './page-templates.mjs';
5
5
  export { F as FeesTable, a as FeesTableProps } from './fees-table-BxHiMpdc.mjs';
@@ -80,6 +80,56 @@ declare const siteChromeBlocks: CmsBlock[];
80
80
 
81
81
  declare const wikexCommodityBlocks: CmsBlock[];
82
82
 
83
+ type CmsTextMark = {
84
+ start: number;
85
+ end: number;
86
+ bold?: boolean;
87
+ underline?: boolean;
88
+ href?: string;
89
+ newTab?: boolean;
90
+ };
91
+ type CmsRichText = {
92
+ text: string;
93
+ marks: CmsTextMark[];
94
+ };
95
+ declare function safeCmsTextHref(value: string): string | undefined;
96
+ declare function parseCmsRichText(value: unknown): CmsRichText | undefined;
97
+ declare function rebaseCmsRichText(value: unknown, text: string): CmsRichText;
98
+ declare function patchCmsRichText(value: unknown, text: string, start: number, end: number, patch: Partial<Pick<CmsTextMark, 'bold' | 'underline' | 'href'>>): CmsRichText;
99
+ declare function renderCmsRichText(children: ReactNode, value: unknown, allowLinks?: boolean): ReactNode;
100
+
101
+ declare const CMS_TEXT_FONTS: {
102
+ readonly 'Arial, sans-serif': "Arial";
103
+ readonly 'Georgia, serif': "Georgia";
104
+ readonly '"Times New Roman", serif': "Times New Roman";
105
+ readonly '"Courier New", monospace': "Courier New";
106
+ readonly '"Public Sans Variable", Arial, sans-serif': "Public Sans";
107
+ };
108
+ type CmsTextLayout = {
109
+ width?: number;
110
+ height?: number;
111
+ fontFamily?: string;
112
+ fontSize?: number;
113
+ richText?: CmsRichText;
114
+ };
115
+ declare const CMS_TEXT_LAYOUT_SUFFIX = "TextLayout";
116
+ declare function parseCmsTextLayout(value: unknown): CmsTextLayout;
117
+ declare function cmsTextLayoutStyle(value: unknown): CSSProperties;
118
+ declare function applyCmsTextLayout(element: HTMLElement, value: unknown): () => void;
119
+ declare function readCmsEditableText(element: HTMLElement): string;
120
+ declare function rebaseCmsTextLayouts<T extends Record<string, unknown>>(content: T, depth?: number): T;
121
+
122
+ type CmsTextToolbarProps = {
123
+ layout: CmsTextLayout;
124
+ color: string;
125
+ colorPicker: ReactNode;
126
+ inlineControls?: ReactNode;
127
+ onLayoutChange: (change: Pick<CmsTextLayout, "fontFamily" | "fontSize">) => void;
128
+ onColorChange: (color: string) => void;
129
+ onReset: () => void;
130
+ };
131
+ declare function CmsTextToolbar({ layout, color, colorPicker, inlineControls, onLayoutChange, onColorChange, onReset }: CmsTextToolbarProps): react.JSX.Element;
132
+
83
133
  declare const minimalUiComponents: CmsBlock[];
84
134
  declare const wikexComponents: CmsBlock[];
85
135
  declare const wikexCmsBlocks: {
@@ -94,4 +144,4 @@ declare const wikexCmsBlocks: {
94
144
  definition: CmsComponentDefinition;
95
145
  }[];
96
146
 
97
- export { type CmsBlock, type CmsComponentCategory, type CmsComponentDefinition, type CmsComponentPlacement, type CmsFieldDefinition, type CmsFieldType, type CmsListItemField, type CmsRendererProps, type CmsTextTarget, ConsultationSubmission, minimalMarketingBlocks, minimalUiBlocks, minimalUiComponents, siteChromeBlocks, wikexCmsBlocks, wikexCommodityBlocks, wikexComponents };
147
+ export { CMS_TEXT_FONTS, CMS_TEXT_LAYOUT_SUFFIX, type CmsBlock, type CmsComponentCategory, type CmsComponentDefinition, type CmsComponentPlacement, type CmsFieldDefinition, type CmsFieldType, type CmsListItemField, type CmsRendererProps, type CmsRichText, type CmsTextLayout, type CmsTextMark, type CmsTextTarget, CmsTextToolbar, type CmsTextToolbarProps, ConsultationSubmission, applyCmsTextLayout, cmsTextLayoutStyle, minimalMarketingBlocks, minimalUiBlocks, minimalUiComponents, parseCmsRichText, parseCmsTextLayout, patchCmsRichText, readCmsEditableText, rebaseCmsRichText, rebaseCmsTextLayouts, renderCmsRichText, safeCmsTextHref, siteChromeBlocks, wikexCmsBlocks, wikexCommodityBlocks, wikexComponents };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ComponentType } from 'react';
2
+ import { ComponentType, ReactNode, CSSProperties } from 'react';
3
3
  import { ConsultationSubmission } from './consultation-model.js';
4
4
  export { WikexCommodityPageTemplate, wikexCommodityPageTemplates, wikexCommodityRoutes } from './page-templates.js';
5
5
  export { F as FeesTable, a as FeesTableProps } from './fees-table-i7g0SHgV.js';
@@ -80,6 +80,56 @@ declare const siteChromeBlocks: CmsBlock[];
80
80
 
81
81
  declare const wikexCommodityBlocks: CmsBlock[];
82
82
 
83
+ type CmsTextMark = {
84
+ start: number;
85
+ end: number;
86
+ bold?: boolean;
87
+ underline?: boolean;
88
+ href?: string;
89
+ newTab?: boolean;
90
+ };
91
+ type CmsRichText = {
92
+ text: string;
93
+ marks: CmsTextMark[];
94
+ };
95
+ declare function safeCmsTextHref(value: string): string | undefined;
96
+ declare function parseCmsRichText(value: unknown): CmsRichText | undefined;
97
+ declare function rebaseCmsRichText(value: unknown, text: string): CmsRichText;
98
+ declare function patchCmsRichText(value: unknown, text: string, start: number, end: number, patch: Partial<Pick<CmsTextMark, 'bold' | 'underline' | 'href'>>): CmsRichText;
99
+ declare function renderCmsRichText(children: ReactNode, value: unknown, allowLinks?: boolean): ReactNode;
100
+
101
+ declare const CMS_TEXT_FONTS: {
102
+ readonly 'Arial, sans-serif': "Arial";
103
+ readonly 'Georgia, serif': "Georgia";
104
+ readonly '"Times New Roman", serif': "Times New Roman";
105
+ readonly '"Courier New", monospace': "Courier New";
106
+ readonly '"Public Sans Variable", Arial, sans-serif': "Public Sans";
107
+ };
108
+ type CmsTextLayout = {
109
+ width?: number;
110
+ height?: number;
111
+ fontFamily?: string;
112
+ fontSize?: number;
113
+ richText?: CmsRichText;
114
+ };
115
+ declare const CMS_TEXT_LAYOUT_SUFFIX = "TextLayout";
116
+ declare function parseCmsTextLayout(value: unknown): CmsTextLayout;
117
+ declare function cmsTextLayoutStyle(value: unknown): CSSProperties;
118
+ declare function applyCmsTextLayout(element: HTMLElement, value: unknown): () => void;
119
+ declare function readCmsEditableText(element: HTMLElement): string;
120
+ declare function rebaseCmsTextLayouts<T extends Record<string, unknown>>(content: T, depth?: number): T;
121
+
122
+ type CmsTextToolbarProps = {
123
+ layout: CmsTextLayout;
124
+ color: string;
125
+ colorPicker: ReactNode;
126
+ inlineControls?: ReactNode;
127
+ onLayoutChange: (change: Pick<CmsTextLayout, "fontFamily" | "fontSize">) => void;
128
+ onColorChange: (color: string) => void;
129
+ onReset: () => void;
130
+ };
131
+ declare function CmsTextToolbar({ layout, color, colorPicker, inlineControls, onLayoutChange, onColorChange, onReset }: CmsTextToolbarProps): react.JSX.Element;
132
+
83
133
  declare const minimalUiComponents: CmsBlock[];
84
134
  declare const wikexComponents: CmsBlock[];
85
135
  declare const wikexCmsBlocks: {
@@ -94,4 +144,4 @@ declare const wikexCmsBlocks: {
94
144
  definition: CmsComponentDefinition;
95
145
  }[];
96
146
 
97
- export { type CmsBlock, type CmsComponentCategory, type CmsComponentDefinition, type CmsComponentPlacement, type CmsFieldDefinition, type CmsFieldType, type CmsListItemField, type CmsRendererProps, type CmsTextTarget, ConsultationSubmission, minimalMarketingBlocks, minimalUiBlocks, minimalUiComponents, siteChromeBlocks, wikexCmsBlocks, wikexCommodityBlocks, wikexComponents };
147
+ export { CMS_TEXT_FONTS, CMS_TEXT_LAYOUT_SUFFIX, type CmsBlock, type CmsComponentCategory, type CmsComponentDefinition, type CmsComponentPlacement, type CmsFieldDefinition, type CmsFieldType, type CmsListItemField, type CmsRendererProps, type CmsRichText, type CmsTextLayout, type CmsTextMark, type CmsTextTarget, CmsTextToolbar, type CmsTextToolbarProps, ConsultationSubmission, applyCmsTextLayout, cmsTextLayoutStyle, minimalMarketingBlocks, minimalUiBlocks, minimalUiComponents, parseCmsRichText, parseCmsTextLayout, patchCmsRichText, readCmsEditableText, rebaseCmsRichText, rebaseCmsTextLayouts, renderCmsRichText, safeCmsTextHref, siteChromeBlocks, wikexCmsBlocks, wikexCommodityBlocks, wikexComponents };