@ecomcx/ecomweb-editor 1.26.2 → 1.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/locales/en/attrs.ts +6 -0
- package/src/locales/en/background.ts +22 -0
- package/src/locales/en/block-desc.ts +32 -1
- package/src/locales/en/block-titles.ts +2 -0
- package/src/locales/en/blocks.ts +17 -0
- package/src/locales/en/hints.ts +17 -0
- package/src/locales/en/index.ts +2 -1
- package/src/locales/en/pattern-lib.ts +15 -1
- package/src/locales/en/patterns.ts +6 -1
- package/src/locales/en/v2.ts +5 -0
- package/src/locales/vi/attrs.ts +6 -0
- package/src/locales/vi/background.ts +22 -0
- package/src/locales/vi/block-desc.ts +32 -1
- package/src/locales/vi/block-titles.ts +2 -0
- package/src/locales/vi/blocks.ts +17 -0
- package/src/locales/vi/hints.ts +17 -0
- package/src/locales/vi/index.ts +2 -1
- package/src/locales/vi/pattern-lib.ts +15 -1
- package/src/locales/vi/patterns.ts +6 -1
- package/src/locales/vi/v2.ts +5 -0
- package/src/shared/block-defs.ts +5 -0
- package/src/shared/panel-store.ts +65 -7
- package/src/shared/patterns-library.ts +22 -2
- package/src/shared/patterns.ts +5 -2
- package/src/v2/blocks/compat.tsx +1 -0
- package/src/v2/blocks/form.tsx +129 -0
- package/src/v2/blocks/index.ts +4 -2
- package/src/v2/canvas/block-list.tsx +3 -1
- package/src/v2/canvas/canvas.tsx +80 -7
- package/src/v2/canvas/dnd.ts +15 -2
- package/src/v2/context.tsx +6 -0
- package/src/v2/core/registry.ts +2 -1
- package/src/v2/editor.css +21 -0
- package/src/v2/editor.tsx +20 -6
- package/src/v2/index.ts +3 -3
- package/src/v2/ui/attr-hints.ts +7 -0
- package/src/v2/ui/background-panel.tsx +83 -0
- package/src/v2/ui/block-menu.ts +19 -0
- package/src/v2/ui/inserter.tsx +21 -6
- package/src/v2/ui/inspector.tsx +45 -8
- package/src/v2/ui/layout-panel.tsx +5 -5
- package/src/v2/ui/section-adder.tsx +58 -0
- package/src/v2/ui/style-supports.ts +29 -0
- package/src/v2/ui/style-tab.tsx +24 -15
- package/src/v2/ui/toolbar.tsx +123 -34
- package/src/v2/ui/unit-controls.tsx +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecomcx/ecomweb-editor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"description": "Trình soạn nội dung dạng khối của CMS — dùng độc lập trong mọi dự án React (1.x: TipTap; ./v2: cây khối, khung soạn iframe, sửa header/footer tại chỗ).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"*.css"
|
|
30
30
|
],
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@ecomcx/ecomweb-content": "^1.
|
|
32
|
+
"@ecomcx/ecomweb-content": "^1.22.0",
|
|
33
33
|
"react": ">=18",
|
|
34
34
|
"react-dom": ">=18"
|
|
35
35
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"prosemirror-view": "1.42.7"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@ecomcx/ecomweb-content": "^1.
|
|
48
|
+
"@ecomcx/ecomweb-content": "^1.22.0",
|
|
49
49
|
"@playwright/test": "1.53.0",
|
|
50
50
|
"@types/react": "19.2.2",
|
|
51
51
|
"@types/react-dom": "19.2.2",
|
package/src/locales/en/attrs.ts
CHANGED
|
@@ -70,4 +70,10 @@ export const attrs = {
|
|
|
70
70
|
showTitle: "Show post titles",
|
|
71
71
|
anchor: "Anchor",
|
|
72
72
|
className: "CSS class",
|
|
73
|
+
kind: "Type",
|
|
74
|
+
help: "Help text",
|
|
75
|
+
required: "Required",
|
|
76
|
+
submitText: "Submit button text",
|
|
77
|
+
successMessage: "Thank-you message",
|
|
78
|
+
notifyEmail: "Notification email",
|
|
73
79
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Background image section of the Style tab (image, size, focal point, repeat, fixed, overlay). */
|
|
2
|
+
export const background = {
|
|
3
|
+
title: "Background image",
|
|
4
|
+
image: "Image",
|
|
5
|
+
choose: "Choose image",
|
|
6
|
+
replace: "Replace",
|
|
7
|
+
remove: "Remove",
|
|
8
|
+
url: "Image URL",
|
|
9
|
+
inherited: "Using the image of the larger screen. Choose another image to override it for this screen.",
|
|
10
|
+
size: "Fit",
|
|
11
|
+
cover: "Cover",
|
|
12
|
+
cover_help: "Fill the block, the image may be cropped",
|
|
13
|
+
contain: "Contain",
|
|
14
|
+
contain_help: "Show the whole image, may leave empty space",
|
|
15
|
+
auto: "Original",
|
|
16
|
+
auto_help: "Keep the image's original size",
|
|
17
|
+
focal: "Focal point",
|
|
18
|
+
repeat: "Repeat image",
|
|
19
|
+
fixed: "Fixed while scrolling (parallax, desktop only)",
|
|
20
|
+
overlay: "Overlay",
|
|
21
|
+
opacity: "Overlay strength",
|
|
22
|
+
};
|
|
@@ -20,7 +20,7 @@ export const blockDesc = {
|
|
|
20
20
|
file: "A downloadable file (PDF…), optionally embedded.",
|
|
21
21
|
youtube: "Embed a YouTube video.",
|
|
22
22
|
embed: "Embed content from a URL.",
|
|
23
|
-
group: "Gather blocks in a container to style them together.",
|
|
23
|
+
group: "Gather blocks in a container to style them together: background colour, gradient or background image (Styles), spacing, row / stack / grid layout.",
|
|
24
24
|
columns: "Display content in columns; drag to resize.",
|
|
25
25
|
buttons: "Prompt visitors to take action with buttons.",
|
|
26
26
|
spacer: "Add white space between blocks.",
|
|
@@ -50,4 +50,35 @@ export const blockDesc = {
|
|
|
50
50
|
postNavigation: "Links to the previous and next posts.",
|
|
51
51
|
query: "A list of posts by criteria.",
|
|
52
52
|
templatePart: "A shared part (header, footer…) — edit once, update everywhere.",
|
|
53
|
+
form: "Basic contact / sign-up form: submissions are kept in the admin and emailed. Advanced forms: plugins.",
|
|
54
|
+
formField: "One field of a form: text, email, phone, message, choice, consent…",
|
|
55
|
+
column: "One column inside Columns; set its width, can have its own background or background image.",
|
|
56
|
+
button: "A linked button (primary / secondary / outline) inside Buttons.",
|
|
57
|
+
accordion: "Collapsible items (FAQ) — each item is a Details block.",
|
|
58
|
+
tabs: "Content split into tabs; click a tab name to switch.",
|
|
59
|
+
tab: "One tab inside Tabs: its title and content.",
|
|
60
|
+
carousel: "Sliding slides (images, cards, testimonials); choose how many show at once.",
|
|
61
|
+
shortcode: "Insert a plugin feature by its shortcode.",
|
|
62
|
+
countdown: "Countdown timer to a date (sale, event).",
|
|
63
|
+
rating: "Star rating (e.g. 4.5 / 5).",
|
|
64
|
+
icon: "Small icon (check, star, phone…) with size and colour.",
|
|
65
|
+
footnotes: "Numbered footnotes at the end of the post.",
|
|
66
|
+
pageBreak: "Split the post into several pages.",
|
|
67
|
+
readMore: "“Read more” link to the post (in post lists).",
|
|
68
|
+
commentsCount: "Number of comments on the post.",
|
|
69
|
+
avatar: "The post author’s avatar.",
|
|
70
|
+
queryTotal: "Total number of posts found by the list.",
|
|
71
|
+
loginout: "Log in / Log out link depending on the visitor.",
|
|
72
|
+
termList: "List of categories / tags (list or cloud).",
|
|
73
|
+
pageList: "The site’s pages, by level.",
|
|
74
|
+
archives: "Links to posts by month.",
|
|
75
|
+
postTemplate: "How each post looks inside a post list.",
|
|
76
|
+
pagination: "Previous / next and page numbers for a post list.",
|
|
77
|
+
queryEmpty: "Content shown when the post list is empty.",
|
|
78
|
+
syncedPattern: "Shared pattern — edit once, changes on every page using it.",
|
|
79
|
+
listItem: "One list item.",
|
|
80
|
+
taskItem: "One to-do with a checkbox.",
|
|
81
|
+
tableRow: "One table row.",
|
|
82
|
+
tableHeader: "Table header cell.",
|
|
83
|
+
tableCell: "One table cell.",
|
|
53
84
|
};
|
package/src/locales/en/blocks.ts
CHANGED
|
@@ -41,4 +41,21 @@ export const blocks = {
|
|
|
41
41
|
clickToEditThe: "Click to edit the template on this post",
|
|
42
42
|
network: "Network {n}",
|
|
43
43
|
urlN: "URL {n}",
|
|
44
|
+
formSubmit: "Send",
|
|
45
|
+
fieldLabel: "Field label",
|
|
46
|
+
fieldOptions: "Options (one per line)",
|
|
47
|
+
fieldNameInvalid: "Field names use lowercase letters, digits and underscores — fixed automatically when you click away",
|
|
48
|
+
fieldText: "Text",
|
|
49
|
+
fieldEmail: "Email",
|
|
50
|
+
fieldPhone: "Phone number",
|
|
51
|
+
fieldMessage: "Message",
|
|
52
|
+
fieldSelect: "Dropdown",
|
|
53
|
+
fieldRadio: "Choose one",
|
|
54
|
+
fieldCheckbox: "Checkbox",
|
|
55
|
+
fieldConsent: "I agree to be contacted",
|
|
56
|
+
fieldNumber: "Number",
|
|
57
|
+
fieldDate: "Date",
|
|
58
|
+
fieldName: "Full name",
|
|
59
|
+
option1: "Option 1",
|
|
60
|
+
option2: "Option 2",
|
|
44
61
|
};
|
package/src/locales/en/hints.ts
CHANGED
|
@@ -184,4 +184,21 @@ export const hints = {
|
|
|
184
184
|
"icon.name.opt.info": "Info",
|
|
185
185
|
"icon.name.opt.alert": "Alert",
|
|
186
186
|
"icon.name.opt.externalLink": "External link",
|
|
187
|
+
"formField.name.label": "Field name (data key)",
|
|
188
|
+
"formField.name.help": "Lowercase letters, digits, underscores; used in submissions and CSV export.",
|
|
189
|
+
"formField.label.label": "Label",
|
|
190
|
+
"formField.label.help": "Consent field: add links with [text](path), e.g. I agree to the [terms](/terms) and the [privacy policy](/privacy).",
|
|
191
|
+
"formField.width.opt.full": "Full row",
|
|
192
|
+
"formField.width.opt.half": "Half row",
|
|
193
|
+
"form.notifyEmail.help": "Empty: sent to the site's admin email.",
|
|
194
|
+
"formField.kind.opt.text": "Text",
|
|
195
|
+
"formField.kind.opt.email": "Email",
|
|
196
|
+
"formField.kind.opt.tel": "Phone",
|
|
197
|
+
"formField.kind.opt.textarea": "Long text",
|
|
198
|
+
"formField.kind.opt.select": "Dropdown",
|
|
199
|
+
"formField.kind.opt.radio": "Choose one",
|
|
200
|
+
"formField.kind.opt.checkbox": "Checkbox",
|
|
201
|
+
"formField.kind.opt.consent": "Consent",
|
|
202
|
+
"formField.kind.opt.number": "Number",
|
|
203
|
+
"formField.kind.opt.date": "Date",
|
|
187
204
|
};
|
package/src/locales/en/index.ts
CHANGED
|
@@ -12,9 +12,10 @@ import { layout } from "./layout";
|
|
|
12
12
|
import { legacyBasic } from "./legacy-basic";
|
|
13
13
|
import { legacyDynamic } from "./legacy-dynamic";
|
|
14
14
|
import { motion } from "./motion";
|
|
15
|
+
import { background } from "./background";
|
|
15
16
|
import { patternLib } from "./pattern-lib";
|
|
16
17
|
import { patterns } from "./patterns";
|
|
17
18
|
import { shortcuts } from "./shortcuts";
|
|
18
19
|
|
|
19
20
|
/** Tiếng Anh: đủ khoá như vi/ (thiếu khoá là lỗi biên dịch) và là ngôn ngữ dự phòng của mọi ngôn ngữ khác. */
|
|
20
|
-
export const en: typeof vi = { v2, legacy, attrs, bindings, blockDesc, blockTitles, blocks, controls, hints, layout, legacyBasic, legacyDynamic, motion, patternLib, patterns, shortcuts };
|
|
21
|
+
export const en: typeof vi = { v2, legacy, attrs, background, bindings, blockDesc, blockTitles, blocks, controls, hints, layout, legacyBasic, legacyDynamic, motion, patternLib, patterns, shortcuts };
|
|
@@ -137,7 +137,7 @@ export const patternLib = {
|
|
|
137
137
|
logos: "Logo strip",
|
|
138
138
|
logosD: "A row of customer / partner logos",
|
|
139
139
|
contact_split: "Split contact",
|
|
140
|
-
contact_splitD: "Details on the left,
|
|
140
|
+
contact_splitD: "Details and social links on the left, form on the right",
|
|
141
141
|
contact_cards: "3 contact cards",
|
|
142
142
|
contact_cardsD: "Address, phone, email",
|
|
143
143
|
text_cols: "Two text columns",
|
|
@@ -148,4 +148,18 @@ export const patternLib = {
|
|
|
148
148
|
footer_simpleD: "Copyright and social links",
|
|
149
149
|
footer_cols: "3-column footer",
|
|
150
150
|
footer_colsD: "3 link groups + copyright",
|
|
151
|
+
fSend: "Send message",
|
|
152
|
+
fThanks: "Thank you! We will get back to you soon.",
|
|
153
|
+
fName: "Full name",
|
|
154
|
+
fPhone: "Phone number",
|
|
155
|
+
fEmail: "Email",
|
|
156
|
+
fTopic: "What do you need?",
|
|
157
|
+
topic1: "Advice",
|
|
158
|
+
topic2: "A quote",
|
|
159
|
+
topic3: "Other",
|
|
160
|
+
fMessage: "Message",
|
|
161
|
+
fMessageP: "Briefly describe what you need…",
|
|
162
|
+
fConsent: "I agree to be contacted by phone / email.",
|
|
163
|
+
contact_form: "Contact with form",
|
|
164
|
+
contact_formD: "Contact details on the left, message form on the right",
|
|
151
165
|
};
|
|
@@ -39,7 +39,12 @@ export const patterns = {
|
|
|
39
39
|
introTitle: "About us",
|
|
40
40
|
introText: "A short introduction to the company, its mission and values.",
|
|
41
41
|
contact: "Contact",
|
|
42
|
-
contactD: "
|
|
42
|
+
contactD: "Heading, short intro and a contact form",
|
|
43
43
|
contactTitle: "Get in touch",
|
|
44
44
|
contactText: "Address · Phone · Email",
|
|
45
|
+
send: "Send",
|
|
46
|
+
thanks: "Thank you! We will get back to you soon.",
|
|
47
|
+
name: "Full name",
|
|
48
|
+
email: "Email",
|
|
49
|
+
message: "Message",
|
|
45
50
|
};
|
package/src/locales/en/v2.ts
CHANGED
|
@@ -5,6 +5,7 @@ export const v2 = {
|
|
|
5
5
|
typeSlash: "Type / to choose a block",
|
|
6
6
|
emptyDoc: "Start writing or type / to insert a block",
|
|
7
7
|
addBlock: "Add block",
|
|
8
|
+
addSection: "Add section",
|
|
8
9
|
search: "Search blocks",
|
|
9
10
|
noResults: "No blocks found",
|
|
10
11
|
blocks: "Blocks",
|
|
@@ -20,6 +21,10 @@ export const v2 = {
|
|
|
20
21
|
group: "Group",
|
|
21
22
|
ungroup: "Ungroup",
|
|
22
23
|
copy: "Copy",
|
|
24
|
+
copyStyle: "Copy style",
|
|
25
|
+
pasteStyle: "Paste style",
|
|
26
|
+
styleCopied: "Style copied",
|
|
27
|
+
blockMenu: "Block actions",
|
|
23
28
|
more: "More",
|
|
24
29
|
transform: "Transform",
|
|
25
30
|
bold: "Bold",
|
package/src/locales/vi/attrs.ts
CHANGED
|
@@ -70,4 +70,10 @@ export const attrs = {
|
|
|
70
70
|
showTitle: "Hiện tiêu đề bài",
|
|
71
71
|
anchor: "Neo (id)",
|
|
72
72
|
className: "Class CSS",
|
|
73
|
+
kind: "Loại",
|
|
74
|
+
help: "Ghi chú dưới ô",
|
|
75
|
+
required: "Bắt buộc",
|
|
76
|
+
submitText: "Chữ trên nút gửi",
|
|
77
|
+
successMessage: "Lời cảm ơn sau khi gửi",
|
|
78
|
+
notifyEmail: "Email nhận thông báo",
|
|
73
79
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Mục Ảnh nền trong tab Kiểu dáng (ảnh, cách phủ, điểm lấy nét, lặp, cố định, lớp phủ). */
|
|
2
|
+
export const background = {
|
|
3
|
+
title: "Ảnh nền",
|
|
4
|
+
image: "Ảnh",
|
|
5
|
+
choose: "Chọn ảnh",
|
|
6
|
+
replace: "Đổi ảnh",
|
|
7
|
+
remove: "Bỏ ảnh",
|
|
8
|
+
url: "Đường dẫn ảnh",
|
|
9
|
+
inherited: "Đang dùng ảnh của khổ lớn hơn. Chọn ảnh khác để thay riêng cho khổ này.",
|
|
10
|
+
size: "Cách phủ",
|
|
11
|
+
cover: "Phủ kín",
|
|
12
|
+
cover_help: "Ảnh phủ kín khối, có thể bị cắt bớt",
|
|
13
|
+
contain: "Vừa khung",
|
|
14
|
+
contain_help: "Hiện trọn ảnh, có thể còn khoảng trống",
|
|
15
|
+
auto: "Gốc",
|
|
16
|
+
auto_help: "Giữ kích thước gốc của ảnh",
|
|
17
|
+
focal: "Điểm lấy nét",
|
|
18
|
+
repeat: "Lặp lại ảnh",
|
|
19
|
+
fixed: "Cố định khi cuộn (parallax, chỉ trên máy tính)",
|
|
20
|
+
overlay: "Lớp phủ",
|
|
21
|
+
opacity: "Độ đậm lớp phủ",
|
|
22
|
+
};
|
|
@@ -20,7 +20,7 @@ export const blockDesc = {
|
|
|
20
20
|
file: "Liên kết tải tệp (PDF…), có thể xem ngay trên trang.",
|
|
21
21
|
youtube: "Nhúng video YouTube.",
|
|
22
22
|
embed: "Nhúng nội dung từ địa chỉ (Facebook, TikTok, bản đồ…).",
|
|
23
|
-
group: "Gom nhiều khối vào một khung để tô nền, căn lề, bố cục
|
|
23
|
+
group: "Gom nhiều khối vào một khung để tô nền (màu, chuyển màu, ảnh nền trong Kiểu dáng), căn lề, bố cục hàng / cột / lưới.",
|
|
24
24
|
columns: "Chia nội dung thành nhiều cột, kéo để đổi độ rộng.",
|
|
25
25
|
buttons: "Một hoặc nhiều nút kêu gọi hành động.",
|
|
26
26
|
spacer: "Khoảng trống giữa các khối.",
|
|
@@ -50,4 +50,35 @@ export const blockDesc = {
|
|
|
50
50
|
postNavigation: "Liên kết tới bài trước và bài sau.",
|
|
51
51
|
query: "Danh sách bài theo điều kiện (chuyên mục, số bài, sắp xếp).",
|
|
52
52
|
templatePart: "Phần dùng chung (header, footer…) — sửa một nơi, đổi mọi trang.",
|
|
53
|
+
form: "Form liên hệ / đăng ký cơ bản: bài gửi lưu trong admin và báo qua email. Form nâng cao: plugin.",
|
|
54
|
+
formField: "Một ô của form: chữ, email, điện thoại, nội dung, chọn, đồng ý…",
|
|
55
|
+
column: "Một cột trong khối Cột; chỉnh độ rộng, có thể tô nền / ảnh nền riêng.",
|
|
56
|
+
button: "Một nút bấm có liên kết (chính / phụ / viền) — nằm trong khối Nút.",
|
|
57
|
+
accordion: "Nhiều mục gập / mở (câu hỏi thường gặp) — mỗi mục là khối Nội dung ẩn.",
|
|
58
|
+
tabs: "Nội dung chia thẻ, bấm tên thẻ để chuyển.",
|
|
59
|
+
tab: "Một thẻ trong khối Thẻ: tên thẻ và nội dung bên trong.",
|
|
60
|
+
carousel: "Trình chiếu nhiều trang trượt (ảnh, thẻ, lời chứng thực), chọn số trang hiện cùng lúc.",
|
|
61
|
+
shortcode: "Chèn tính năng của plugin bằng mã ngắn.",
|
|
62
|
+
countdown: "Đồng hồ đếm ngược tới một thời điểm (khuyến mãi, sự kiện).",
|
|
63
|
+
rating: "Số sao đánh giá (ví dụ 4,5 / 5).",
|
|
64
|
+
icon: "Biểu tượng nhỏ (dấu tích, sao, điện thoại…) đổi cỡ và màu.",
|
|
65
|
+
footnotes: "Danh sách chú thích cuối bài, tự đánh số.",
|
|
66
|
+
pageBreak: "Ngắt bài thành nhiều trang.",
|
|
67
|
+
readMore: "Liên kết “Đọc tiếp” tới bài (dùng trong danh sách bài).",
|
|
68
|
+
commentsCount: "Số bình luận của bài.",
|
|
69
|
+
avatar: "Ảnh đại diện của tác giả bài.",
|
|
70
|
+
queryTotal: "Tổng số bài tìm thấy của danh sách.",
|
|
71
|
+
loginout: "Liên kết Đăng nhập / Đăng xuất theo trạng thái người xem.",
|
|
72
|
+
termList: "Danh sách chuyên mục / thẻ (dạng danh sách hoặc đám mây).",
|
|
73
|
+
pageList: "Danh sách các trang của website, theo cấp.",
|
|
74
|
+
archives: "Liên kết lưu trữ bài theo tháng.",
|
|
75
|
+
postTemplate: "Khuôn hiển thị mỗi bài trong khối Danh sách bài.",
|
|
76
|
+
pagination: "Nút trang trước / sau và số trang của danh sách bài.",
|
|
77
|
+
queryEmpty: "Nội dung hiện khi danh sách bài không có bài nào.",
|
|
78
|
+
syncedPattern: "Mẫu dùng chung — sửa một nơi, đổi ở mọi trang dùng nó.",
|
|
79
|
+
listItem: "Một mục của danh sách.",
|
|
80
|
+
taskItem: "Một việc có ô đánh dấu trong danh sách việc.",
|
|
81
|
+
tableRow: "Một hàng của bảng.",
|
|
82
|
+
tableHeader: "Ô tiêu đề của bảng.",
|
|
83
|
+
tableCell: "Một ô của bảng.",
|
|
53
84
|
};
|
package/src/locales/vi/blocks.ts
CHANGED
|
@@ -41,4 +41,21 @@ export const blocks = {
|
|
|
41
41
|
clickToEditThe: "Bấm để sửa khuôn trên bài này",
|
|
42
42
|
network: "Mạng {n}",
|
|
43
43
|
urlN: "Địa chỉ {n}",
|
|
44
|
+
formSubmit: "Gửi",
|
|
45
|
+
fieldLabel: "Nhãn ô",
|
|
46
|
+
fieldOptions: "Các lựa chọn (mỗi dòng một)",
|
|
47
|
+
fieldNameInvalid: "Tên ô chỉ gồm chữ thường không dấu, số, gạch dưới — tự sửa khi bạn bấm ra ngoài",
|
|
48
|
+
fieldText: "Ô chữ",
|
|
49
|
+
fieldEmail: "Email",
|
|
50
|
+
fieldPhone: "Số điện thoại",
|
|
51
|
+
fieldMessage: "Nội dung",
|
|
52
|
+
fieldSelect: "Chọn trong danh sách",
|
|
53
|
+
fieldRadio: "Chọn một",
|
|
54
|
+
fieldCheckbox: "Ô đánh dấu",
|
|
55
|
+
fieldConsent: "Tôi đồng ý để được liên hệ lại",
|
|
56
|
+
fieldNumber: "Số",
|
|
57
|
+
fieldDate: "Ngày",
|
|
58
|
+
fieldName: "Họ và tên",
|
|
59
|
+
option1: "Lựa chọn 1",
|
|
60
|
+
option2: "Lựa chọn 2",
|
|
44
61
|
};
|
package/src/locales/vi/hints.ts
CHANGED
|
@@ -184,4 +184,21 @@ export const hints = {
|
|
|
184
184
|
"icon.name.opt.info": "Thông tin",
|
|
185
185
|
"icon.name.opt.alert": "Cảnh báo",
|
|
186
186
|
"icon.name.opt.externalLink": "Liên kết ngoài",
|
|
187
|
+
"formField.name.label": "Tên ô (khoá dữ liệu)",
|
|
188
|
+
"formField.name.help": "Chữ thường không dấu, số, gạch dưới; dùng trong bài gửi và xuất CSV.",
|
|
189
|
+
"formField.label.label": "Nhãn",
|
|
190
|
+
"formField.label.help": "Ô \"Đồng ý\": gắn link bằng [chữ](đường dẫn), vd Tôi đồng ý với [điều khoản](/dieu-khoan) và [chính sách bảo mật](/chinh-sach-bao-mat).",
|
|
191
|
+
"formField.width.opt.full": "Cả hàng",
|
|
192
|
+
"formField.width.opt.half": "Nửa hàng",
|
|
193
|
+
"form.notifyEmail.help": "Để trống: gửi về email quản trị của website.",
|
|
194
|
+
"formField.kind.opt.text": "Ô chữ",
|
|
195
|
+
"formField.kind.opt.email": "Email",
|
|
196
|
+
"formField.kind.opt.tel": "Điện thoại",
|
|
197
|
+
"formField.kind.opt.textarea": "Nội dung dài",
|
|
198
|
+
"formField.kind.opt.select": "Chọn trong danh sách",
|
|
199
|
+
"formField.kind.opt.radio": "Chọn một",
|
|
200
|
+
"formField.kind.opt.checkbox": "Ô đánh dấu",
|
|
201
|
+
"formField.kind.opt.consent": "Đồng ý (điều khoản)",
|
|
202
|
+
"formField.kind.opt.number": "Số",
|
|
203
|
+
"formField.kind.opt.date": "Ngày",
|
|
187
204
|
};
|
package/src/locales/vi/index.ts
CHANGED
|
@@ -17,8 +17,9 @@ import { layout } from "./layout";
|
|
|
17
17
|
import { legacyBasic } from "./legacy-basic";
|
|
18
18
|
import { legacyDynamic } from "./legacy-dynamic";
|
|
19
19
|
import { motion } from "./motion";
|
|
20
|
+
import { background } from "./background";
|
|
20
21
|
import { patternLib } from "./pattern-lib";
|
|
21
22
|
import { patterns } from "./patterns";
|
|
22
23
|
import { shortcuts } from "./shortcuts";
|
|
23
24
|
|
|
24
|
-
export const vi = { v2, legacy, attrs, bindings, blockDesc, blockTitles, blocks, controls, hints, layout, legacyBasic, legacyDynamic, motion, patternLib, patterns, shortcuts };
|
|
25
|
+
export const vi = { v2, legacy, attrs, background, bindings, blockDesc, blockTitles, blocks, controls, hints, layout, legacyBasic, legacyDynamic, motion, patternLib, patterns, shortcuts };
|
|
@@ -137,7 +137,7 @@ export const patternLib = {
|
|
|
137
137
|
logos: "Dải đối tác",
|
|
138
138
|
logosD: "Hàng logo khách hàng / đối tác",
|
|
139
139
|
contact_split: "Liên hệ chia đôi",
|
|
140
|
-
contact_splitD: "Thông tin
|
|
140
|
+
contact_splitD: "Thông tin và mạng xã hội bên trái, form bên phải",
|
|
141
141
|
contact_cards: "3 thẻ liên hệ",
|
|
142
142
|
contact_cardsD: "Địa chỉ, điện thoại, email",
|
|
143
143
|
text_cols: "Hai cột chữ",
|
|
@@ -148,4 +148,18 @@ export const patternLib = {
|
|
|
148
148
|
footer_simpleD: "Bản quyền và mạng xã hội",
|
|
149
149
|
footer_cols: "Chân trang 3 cột",
|
|
150
150
|
footer_colsD: "3 nhóm liên kết + bản quyền",
|
|
151
|
+
fSend: "Gửi liên hệ",
|
|
152
|
+
fThanks: "Cảm ơn bạn! Chúng tôi sẽ liên hệ lại sớm.",
|
|
153
|
+
fName: "Họ và tên",
|
|
154
|
+
fPhone: "Số điện thoại",
|
|
155
|
+
fEmail: "Email",
|
|
156
|
+
fTopic: "Bạn cần gì?",
|
|
157
|
+
topic1: "Tư vấn",
|
|
158
|
+
topic2: "Báo giá",
|
|
159
|
+
topic3: "Khác",
|
|
160
|
+
fMessage: "Nội dung",
|
|
161
|
+
fMessageP: "Mô tả ngắn nhu cầu của bạn…",
|
|
162
|
+
fConsent: "Tôi đồng ý để được liên hệ lại qua điện thoại / email.",
|
|
163
|
+
contact_form: "Liên hệ có form",
|
|
164
|
+
contact_formD: "Thông tin liên hệ bên trái, form gửi tin nhắn bên phải",
|
|
151
165
|
};
|
|
@@ -39,7 +39,12 @@ export const patterns = {
|
|
|
39
39
|
introTitle: "Về chúng tôi",
|
|
40
40
|
introText: "Giới thiệu ngắn về công ty, sứ mệnh và giá trị.",
|
|
41
41
|
contact: "Liên hệ",
|
|
42
|
-
contactD: "
|
|
42
|
+
contactD: "Tiêu đề, giới thiệu ngắn và form liên hệ",
|
|
43
43
|
contactTitle: "Liên hệ với chúng tôi",
|
|
44
44
|
contactText: "Địa chỉ · Số điện thoại · Email",
|
|
45
|
+
send: "Gửi",
|
|
46
|
+
thanks: "Cảm ơn bạn! Chúng tôi sẽ liên hệ lại sớm.",
|
|
47
|
+
name: "Họ và tên",
|
|
48
|
+
email: "Email",
|
|
49
|
+
message: "Nội dung",
|
|
45
50
|
};
|
package/src/locales/vi/v2.ts
CHANGED
|
@@ -5,6 +5,7 @@ export const v2 = {
|
|
|
5
5
|
typeSlash: "Gõ / để chọn khối",
|
|
6
6
|
emptyDoc: "Bắt đầu viết hoặc gõ / để chèn khối",
|
|
7
7
|
addBlock: "Thêm khối",
|
|
8
|
+
addSection: "Thêm section",
|
|
8
9
|
search: "Tìm khối",
|
|
9
10
|
noResults: "Không tìm thấy khối",
|
|
10
11
|
blocks: "Khối",
|
|
@@ -20,6 +21,10 @@ export const v2 = {
|
|
|
20
21
|
group: "Gom vào nhóm",
|
|
21
22
|
ungroup: "Bỏ nhóm",
|
|
22
23
|
copy: "Sao chép",
|
|
24
|
+
copyStyle: "Chép kiểu dáng",
|
|
25
|
+
pasteStyle: "Dán kiểu dáng",
|
|
26
|
+
styleCopied: "Đã chép kiểu dáng",
|
|
27
|
+
blockMenu: "Thao tác với khối",
|
|
23
28
|
more: "Thêm",
|
|
24
29
|
transform: "Đổi loại khối",
|
|
25
30
|
bold: "Đậm",
|
package/src/shared/block-defs.ts
CHANGED
|
@@ -22,6 +22,11 @@ export interface RegisterBlockOptions {
|
|
|
22
22
|
translate?(text: string): string;
|
|
23
23
|
/** Khối của theme: chỉ chèn được khi soạn template / phần dùng chung (host.scope = "template"), không chèn vào bài viết. */
|
|
24
24
|
templateOnly?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Nhóm của tab Kiểu dáng khối hiện: "typography" "color" "background" "spacing" "border" "effects" "hover" "motion" "visibility".
|
|
27
|
+
* Không khai → khối chứa có đủ, khối khác có mọi nhóm trừ ảnh nền. [] = không có tab Kiểu dáng.
|
|
28
|
+
*/
|
|
29
|
+
styleGroups?: string[];
|
|
25
30
|
/** Khối chứa khối khác: nội dung có sẵn khi chèn (mặc định một đoạn văn trống). */
|
|
26
31
|
initialContent?(): Array<Record<string, unknown>>;
|
|
27
32
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Kho panel plugin (registerBlockPanel) — đăng ký ở đây, trình soạn đọc. */
|
|
2
2
|
import type { ComponentType } from "react";
|
|
3
|
+
import { defineBlockControls, type BlockControls, type ControlSpec } from "@ecomcx/ecomweb-content";
|
|
3
4
|
|
|
4
5
|
/** Props của panel plugin trong tab "Khối". */
|
|
5
6
|
export interface BlockPanelProps {
|
|
@@ -16,27 +17,84 @@ export interface BlockPanel {
|
|
|
16
17
|
id: string;
|
|
17
18
|
/** Tiêu đề mục trong tab "Khối" (nhận "%khoá%" — admin dịch theo plugin). */
|
|
18
19
|
title: string;
|
|
19
|
-
/** Loại khối áp dụng; bỏ trống = mọi khối. */
|
|
20
|
-
blocks?: string[];
|
|
20
|
+
/** Loại khối áp dụng; bỏ trống hoặc "*" = mọi khối. */
|
|
21
|
+
blocks?: string[] | "*";
|
|
22
|
+
/** Tab đặt panel: "block" (mặc định) hoặc "style" (tab Kiểu dáng). */
|
|
23
|
+
tab?: "block" | "style";
|
|
21
24
|
/** Thứ tự (nhỏ đứng trước, mặc định 10). */
|
|
22
25
|
order?: number;
|
|
23
26
|
/**
|
|
24
27
|
* Thuộc tính thêm vào khối (kể cả khối lõi), vd { lazy: { default: true } } — cần khai báo để trình soạn lưu được.
|
|
25
28
|
* Bắt buộc có `blocks` khi khai báo thuộc tính. Website đọc được qua filter "post.blocks" hoặc renderer của plugin.
|
|
26
29
|
*/
|
|
27
|
-
attributes?: Record<string, { default?: unknown }>;
|
|
28
|
-
|
|
30
|
+
attributes?: Record<string, { default?: unknown; label?: string } | (ControlSpec & { label?: string })>;
|
|
31
|
+
/** Giao diện riêng; bỏ trống = trình soạn tự vẽ ô cho các thuộc tính có `type`. */
|
|
32
|
+
component?: ComponentType<BlockPanelProps>;
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
|
|
32
36
|
const panels = new Map<string, BlockPanel>();
|
|
33
37
|
const listeners = new Set<() => void>();
|
|
34
38
|
let snapshot: BlockPanel[] = [];
|
|
35
|
-
const changed = () => {
|
|
36
|
-
|
|
39
|
+
const changed = () => {
|
|
40
|
+
snapshot = [...panels.values()].sort((a, b) => (a.order ?? 10) - (b.order ?? 10));
|
|
41
|
+
controls = snapshot.flatMap((p) => { const t = typed(p); return Object.keys(t).length ? [{ id: p.id, blocks: p.blocks ?? "*", attributes: t }] : []; });
|
|
42
|
+
listeners.forEach((l) => l());
|
|
43
|
+
};
|
|
44
|
+
/** Thuộc tính có `type` + `css` → ô điều khiển khai CSS (kiểm khai báo ngay lúc đăng ký: sai → ném lỗi). */
|
|
45
|
+
const typed = (p: BlockPanel) => Object.fromEntries(Object.entries(p.attributes ?? {}).filter(([, s]) => "type" in s && s.type)) as Record<string, ControlSpec>;
|
|
46
|
+
let controls: BlockControls[] = [];
|
|
47
|
+
export function registerBlockPanel(panel: BlockPanel) {
|
|
48
|
+
const t = typed(panel);
|
|
49
|
+
if (Object.keys(t).length) defineBlockControls({ id: panel.id, blocks: panel.blocks ?? "*", attributes: t });
|
|
50
|
+
panels.set(panel.id, panel); changed();
|
|
51
|
+
}
|
|
37
52
|
export function unregisterBlockPanel(id: string) { const had = panels.delete(id); if (had) changed(); return had; }
|
|
38
53
|
|
|
39
54
|
/** Panel áp dụng cho một loại khối. */
|
|
40
|
-
export const blockPanelsFor = (type: string) => snapshot.filter((p) =>
|
|
55
|
+
export const blockPanelsFor = (type: string, tab: "block" | "style" = "block") => snapshot.filter((p) => (p.blocks === undefined || p.blocks === "*" || p.blocks.includes(type)) && (p.tab ?? "block") === tab);
|
|
56
|
+
/** Ô điều khiển khai CSS của mọi panel (đầu vào của controlsCss — cùng hàm website dùng). */
|
|
57
|
+
export const blockControls = () => controls;
|
|
41
58
|
export const blockPanels = () => snapshot;
|
|
42
59
|
export function onBlockPanelsChange(l: () => void) { listeners.add(l); return () => { listeners.delete(l); }; }
|
|
60
|
+
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
// Hành động trên khối (registerBlockAction) — menu ⋮ của thanh công cụ khối
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
export interface BlockActionContext {
|
|
65
|
+
/** Các khối đang chọn (id, loại, thuộc tính). */
|
|
66
|
+
blocks: Array<{ id: string; type: string; attrs: Record<string, any> }>;
|
|
67
|
+
/** Đổi thuộc tính các khối đang chọn. */
|
|
68
|
+
setAttrs(attrs: Record<string, unknown>): void;
|
|
69
|
+
}
|
|
70
|
+
export interface BlockAction {
|
|
71
|
+
/** Mã duy nhất "slug-plugin/tên". */
|
|
72
|
+
id: string;
|
|
73
|
+
/** Nhãn trong menu (nhận "%khoá%"). */
|
|
74
|
+
label: string;
|
|
75
|
+
icon?: ComponentType<{ className?: string }>;
|
|
76
|
+
/** Loại khối áp dụng; bỏ trống / "*" = mọi khối. */
|
|
77
|
+
blocks?: string[] | "*";
|
|
78
|
+
run(ctx: BlockActionContext): void | Promise<void>;
|
|
79
|
+
}
|
|
80
|
+
const actions = new Map<string, BlockAction>();
|
|
81
|
+
let actionList: BlockAction[] = [];
|
|
82
|
+
export function registerBlockAction(a: BlockAction) { actions.set(a.id, a); actionList = [...actions.values()]; listeners.forEach((l) => l()); }
|
|
83
|
+
export function unregisterBlockAction(id: string) { const had = actions.delete(id); if (had) { actionList = [...actions.values()]; listeners.forEach((l) => l()); } return had; }
|
|
84
|
+
export const blockActionsFor = (types: string[]) => actionList.filter((a) => !a.blocks || a.blocks === "*" || types.every((t) => (a.blocks as string[]).includes(t)));
|
|
85
|
+
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
// Khối sẵn sàng (onBlockReady) + asset theo nhu cầu — khung soạn (iframe) đọc
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
export type BlockReadyFn = (el: HTMLElement, attrs: Record<string, unknown>) => void | (() => void);
|
|
90
|
+
export interface BlockAsset { kind: "script" | "style"; src: string; when: { blocks?: string[]; className?: string } }
|
|
91
|
+
let ready: Array<{ type: string; fn: BlockReadyFn }> = [];
|
|
92
|
+
let assets: BlockAsset[] = [];
|
|
93
|
+
export function onBlockReady(type: string, fn: BlockReadyFn) {
|
|
94
|
+
const e = { type, fn };
|
|
95
|
+
ready = [...ready, e]; listeners.forEach((l) => l());
|
|
96
|
+
return () => { ready = ready.filter((x) => x !== e); listeners.forEach((l) => l()); };
|
|
97
|
+
}
|
|
98
|
+
export function registerBlockAssets(list: BlockAsset[]) { assets = [...assets, ...list]; listeners.forEach((l) => l()); }
|
|
99
|
+
export const blockReadyFns = () => ready;
|
|
100
|
+
export const blockAssets = () => assets;
|
|
@@ -42,6 +42,18 @@ function library(t: L): Pattern[] {
|
|
|
42
42
|
const member = (): Node => card([img(t.member), h(3, t.member), muted(t.role), p(t.bio)], { padding: { base: "lg" }, textAlign: { base: "center" } });
|
|
43
43
|
const info = (label: string, value: string): Node => card([h(3, label), p(value)], { padding: { base: "lg" } });
|
|
44
44
|
const links = (title: string, items: string[]): Node => ({ type: "column", content: [h(4, title), { type: "bulletList", content: items.map((s) => ({ type: "listItem", content: [{ type: "paragraph", content: [link(s)] }] })) }] });
|
|
45
|
+
// Form cơ bản của lõi (khối form): formId để trống — trình soạn tạo mã khi mẫu được chèn
|
|
46
|
+
const fld = (kind: string, name: string, label: string, extra: Record<string, unknown> = {}): Node => ({ type: "formField", attrs: { kind, name, label, ...extra } });
|
|
47
|
+
const contactForm = (topics = false): Node => ({ type: "form", attrs: { submitText: t.fSend, successMessage: t.fThanks }, content: [
|
|
48
|
+
fld("text", "name", t.fName, { required: true, width: "half" }), fld("tel", "phone", t.fPhone, { required: true, width: "half" }),
|
|
49
|
+
fld("email", "email", t.fEmail),
|
|
50
|
+
...(topics ? [fld("select", "topic", t.fTopic, { options: [t.topic1, t.topic2, t.topic3] })] : []),
|
|
51
|
+
fld("textarea", "message", t.fMessage, { required: true, placeholder: t.fMessageP }),
|
|
52
|
+
fld("consent", "consent", t.fConsent, { required: true }),
|
|
53
|
+
] });
|
|
54
|
+
const infoRow = (icon: string, label: string, value: string): Node => ({ type: "group", attrs: { style: { layout: { type: "flex", direction: { base: "row" }, align: { base: "start" }, wrap: false }, gap: "md" } }, content: [
|
|
55
|
+
{ type: "icon", attrs: { name: icon, size: 22, style: { color: { text: "primary" } } } },
|
|
56
|
+
{ type: "group", content: [p(label, { style: { fontWeight: "600", margin: { base: "0" } } }), muted(value, { margin: { base: "0" } })] }] });
|
|
45
57
|
const m = (id: string, category: string, keywords: string, content: Node[]): Pattern => ({ name: `core/${id}`, category, title: t[id.replace(/-/g, "_")], description: t[`${id.replace(/-/g, "_")}D`], keywords, content });
|
|
46
58
|
|
|
47
59
|
return [
|
|
@@ -127,10 +139,18 @@ function library(t: L): Pattern[] {
|
|
|
127
139
|
section([muted(t.trusted, { ...center, textTransform: "uppercase", letterSpacing: "0.08em", fontSize: { base: "sm" } }), grid(5, [1, 2, 3, 4, 5].map(() => img(t.logo)), { motion: { in: "fade", stagger: true } })])]),
|
|
128
140
|
|
|
129
141
|
// ---------------- contact ----------------
|
|
142
|
+
m("contact-form", "contact", "lien he form gui tin nhan contact form", [
|
|
143
|
+
section([{ type: "columns", attrs: { verticalAlign: "top" }, content: [
|
|
144
|
+
{ type: "column", attrs: { width: 40 }, content: [eyebrow(t.l_contact), h(2, t.contactTitle), muted(t.contactSub, { fontSize: { base: "lg" } }), { type: "spacer", attrs: { height: "sm" } },
|
|
145
|
+
{ type: "group", attrs: { style: { layout: { type: "flex", direction: { base: "column" } }, gap: "lg" } }, content: [
|
|
146
|
+
infoRow("phone", t.phone, t.phoneV), infoRow("mail", t.email, t.emailV), infoRow("mapPin", t.address, t.addressV), infoRow("clock", t.hours, t.hoursV)] }] },
|
|
147
|
+
{ type: "column", attrs: { width: 60 }, content: [card([contactForm(true)], { padding: { base: "xl", mobile: "lg" }, shadow: "md", motion: undefined })] }] }],
|
|
148
|
+
{ motion: { in: "fade" } })]),
|
|
130
149
|
m("contact-split", "contact", "lien he chia doi contact split", [
|
|
131
150
|
section([{ type: "columns", content: [
|
|
132
|
-
{ type: "column", content: [h(2, t.contactTitle), muted(t.contactSub), p(`${t.address}: ${t.addressV}`), p(`${t.phone}: ${t.phoneV}`), p(`${t.email}: ${t.emailV}`)
|
|
133
|
-
|
|
151
|
+
{ type: "column", content: [h(2, t.contactTitle), muted(t.contactSub), p(`${t.address}: ${t.addressV}`), p(`${t.phone}: ${t.phoneV}`), p(`${t.email}: ${t.emailV}`),
|
|
152
|
+
{ type: "socialLinks", attrs: { links: [{ service: "facebook", url: "https://facebook.com" }, { service: "zalo", url: "https://zalo.me" }, { service: "email", url: "mailto:hello@example.com" }] } }] },
|
|
153
|
+
{ type: "column", content: [contactForm()] }] }])]),
|
|
134
154
|
m("contact-cards", "contact", "the lien he dia chi dien thoai email contact cards", [
|
|
135
155
|
section([h(2, t.contactTitle, center), muted(t.contactSub, center), { type: "spacer", attrs: { height: "md" } }, grid(3, [info(t.address, t.addressV), info(t.phone, t.phoneV), info(t.email, t.emailV)], slideUp())])]),
|
|
136
156
|
|
package/src/shared/patterns.ts
CHANGED
|
@@ -73,9 +73,12 @@ function corePatterns(t: L): Pattern[] {
|
|
|
73
73
|
{ type: "pullquote", attrs: { citation: t.who }, content: [text(t.quote)] }] },
|
|
74
74
|
{ name: "core/intro", category: "text", title: t.intro, description: t.introD, keywords: "about gioi thieu media", content: [
|
|
75
75
|
{ type: "mediaText", attrs: { position: "left", width: 50, verticalAlign: "center" }, content: [h(2, t.introTitle), p(t.introText), buttons("left", btn(t.learn, "outline"))] }] },
|
|
76
|
-
{ name: "core/contact", category: "contact", title: t.contact, description: t.contactD, keywords: "contact lien he", content: [
|
|
76
|
+
{ name: "core/contact", category: "contact", title: t.contact, description: t.contactD, keywords: "contact lien he form", content: [
|
|
77
77
|
h(2, t.contactTitle), p(t.contactText),
|
|
78
|
-
{ type: "
|
|
78
|
+
{ type: "form", attrs: { submitText: t.send, successMessage: t.thanks }, content: [
|
|
79
|
+
{ type: "formField", attrs: { kind: "text", name: "name", label: t.name, required: true, width: "half" } },
|
|
80
|
+
{ type: "formField", attrs: { kind: "email", name: "email", label: t.email, required: true, width: "half" } },
|
|
81
|
+
{ type: "formField", attrs: { kind: "textarea", name: "message", label: t.message, required: true } }] }] },
|
|
79
82
|
];
|
|
80
83
|
}
|
|
81
84
|
|
package/src/v2/blocks/compat.tsx
CHANGED
|
@@ -37,6 +37,7 @@ export function syncPluginBlocks(registry: BlockTypeRegistry): () => void {
|
|
|
37
37
|
description: def.description ? t(def.description) : undefined,
|
|
38
38
|
icon: o.icon ?? Blocks,
|
|
39
39
|
templateOnly: o.templateOnly,
|
|
40
|
+
...(o.styleGroups ? { supports: { style: o.styleGroups.length ? o.styleGroups : false } } : {}),
|
|
40
41
|
edit: o.edit ? wrapV1Edit(o.edit) : undefined,
|
|
41
42
|
// Không có xem trước riêng và không chứa khối con → website vẽ bằng renderer của theme/plugin (viết khối một lần)
|
|
42
43
|
serverRender: !o.edit && def.content !== "blocks",
|