@ecomcx/ecomweb-editor 1.21.0 → 1.22.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecomcx/ecomweb-editor",
3
- "version": "1.21.0",
3
+ "version": "1.22.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.16.0",
32
+ "@ecomcx/ecomweb-content": "^1.17.0",
33
33
  "react": ">=18",
34
34
  "react-dom": ">=18"
35
35
  },
@@ -60,7 +60,7 @@
60
60
  "prosemirror-view": "1.42.7"
61
61
  },
62
62
  "devDependencies": {
63
- "@ecomcx/ecomweb-content": "^1.16.0",
63
+ "@ecomcx/ecomweb-content": "^1.17.0",
64
64
  "@playwright/test": "1.53.0",
65
65
  "@types/react": "19.2.2",
66
66
  "@types/react-dom": "19.2.2",
@@ -25,16 +25,20 @@ const SPECS: Array<[string, LucideIcon, "none" | "blocks", Record<string, BlockA
25
25
  ["siteTagline", Text, "none", { textAlign: align }],
26
26
  ["navigation", Menu, "none", { location: s("location", { default: "primary" }), orientation: s("orientation", { enum: ["horizontal", "vertical"], enumLabels: ["horizontal", "vertical"], default: "horizontal" }), mobile: b("mobile", { default: true }) }],
27
27
  ["search", Search, "none", { placeholder: s("placeholder"), buttonText: s("buttonText") }],
28
- ["languageSwitcher", Languages, "none", {}],
28
+ ["languageSwitcher", Languages, "none", { display: s("display", { enum: ["inline", "dropdown"], enumLabels: ["inline", "dropdown"], default: "inline" }) }],
29
29
  ["copyright", Copyright, "none", { text: s("text"), textAlign: align }],
30
30
  ["postTitle", Heading1, "none", { level: i("level", { min: 1, max: 6, default: 1 }), link: b("link", { default: false }), textAlign: align }],
31
31
  ["postContent", FileText, "none", {}],
32
32
  ["postExcerpt", AlignLeft, "none", { moreText: s("moreText") }],
33
33
  ["featuredImage", Image, "none", { size: s("size", { enum: ["medium", "medium_large", "large", "full"], default: "large" }), aspect: s("aspect", { enum: ["auto", "16/9", "4/3", "1/1", "3/4"], default: "auto" }), link: b("link", { default: false }) }],
34
34
  ["postDate", Calendar, "none", { textAlign: align }],
35
- ["postAuthor", User, "none", { avatar: b("avatar", { default: false }) }],
35
+ ["postAuthor", User, "none", { avatar: b("avatar", { default: false }), showName: b("showName", { default: true }), showBio: b("showBio", { default: false }), avatarSize: i("avatarSize", { min: 16, max: 128, default: 32 }), link: b("link", { default: true }) }],
36
36
  ["postTerms", Tags, "none", { taxonomy: s("taxonomy", { default: "category" }), separator: s("separator", { default: ", " }) }],
37
- ["comments", MessageSquare, "none", {}],
37
+ ["comments", MessageSquare, "none", { title: s("title") }],
38
+ ["readMore", ChevronsRight, "none", { text: s("text"), textAlign: align }],
39
+ ["commentsCount", MessageSquare, "none", { textAlign: align }],
40
+ ["avatar", User, "none", { size: i("size", { min: 16, max: 256, default: 48 }), link: b("link", { default: true }) }],
41
+ ["queryTotal", List, "none", { textAlign: align }],
38
42
  ["queryTitle", Heading1, "none", { level: i("level", { min: 1, max: 6, default: 1 }), prefix: b("prefix", { default: false }), textAlign: align }],
39
43
  ["termDescription", AlignLeft, "none", { textAlign: align }],
40
44
  ["breadcrumbs", ChevronsRight, "none", { separator: s("separator", { default: "›" }), showHome: b("showHome", { default: true }), showCurrent: b("showCurrent", { default: true }) }],
@@ -46,7 +50,7 @@ const SPECS: Array<[string, LucideIcon, "none" | "blocks", Record<string, BlockA
46
50
  order: s("order", { enum: ["desc", "asc"], enumLabels: ["desc", "asc"], default: "desc" }),
47
51
  }],
48
52
  ["postTemplate", Repeat, "blocks", { layout: s("layout", { enum: ["list", "grid"], enumLabels: ["list", "grid"], default: "list" }), columns: i("columns", { min: 1, max: 6, default: 3 }) }],
49
- ["pagination", MoreHorizontal, "none", {}],
53
+ ["pagination", MoreHorizontal, "none", { type: s("type", { enum: ["numbers", "prevNext", "both"], enumLabels: ["numbers", "prevNext", "both"], default: "both" }), midSize: i("midSize", { min: 0, max: 5, default: 2 }) }],
50
54
  ["queryEmpty", ListX, "blocks", {}],
51
55
  ["templatePart", PanelTop, "none", { slug: s("slug"), tagName: s("tagName", { enum: ["div", "header", "footer", "aside", "section"], default: "div" }) }],
52
56
  ];
@@ -129,6 +129,41 @@ function DetailsEdit({ block, blockProps, setAttrs, editable }: BlockEditProps)
129
129
  );
130
130
  }
131
131
 
132
+ function AccordionEdit({ block, blockProps }: BlockEditProps) {
133
+ return <div {...(merge(blockProps, "ecx-accordion") as object)}><InnerBlocks parent={block} /></div>;
134
+ }
135
+
136
+ function TabsEdit({ block, blockProps }: BlockEditProps) {
137
+ return <div {...(merge(blockProps, "ecx-tabs") as object)}><InnerBlocks parent={block} /></div>;
138
+ }
139
+
140
+ function TabEdit({ block, blockProps, setAttrs, editable }: BlockEditProps) {
141
+ return (
142
+ <div {...(merge(blockProps, "ecx-tab", { borderLeft: "3px solid rgba(127,127,127,.4)", paddingLeft: 12, marginBlock: 8 }) as object)}>
143
+ <RichText blockId={block.id} field="title" tagName="strong" value={String(block.attrs.title ?? "")} onChange={(v) => setAttrs({ title: v })} placeholder="Tab…" placeholderAlways editable={editable} />
144
+ <InnerBlocks parent={block} />
145
+ </div>
146
+ );
147
+ }
148
+
149
+ function CarouselEdit({ block, blockProps }: BlockEditProps) {
150
+ return <div {...(merge(blockProps, "ecx-carousel") as object)}><InnerBlocks parent={block} /></div>;
151
+ }
152
+
153
+ function ShortcodeEdit({ block, blockProps }: BlockEditProps) {
154
+ return <div {...(merge(blockProps, "ecx-shortcode", { fontFamily: "monospace", opacity: 0.8 }) as object)}>[{String(block.attrs.name || "shortcode")}]</div>;
155
+ }
156
+
157
+ function CountdownEdit({ block, blockProps }: BlockEditProps) {
158
+ const a = block.attrs;
159
+ return <div {...(merge(blockProps, "ecx-countdown", { textAlign: "center" }) as object)}>{a.label ? <p style={{ margin: 0 }}>{String(a.label)}</p> : null}<strong>{a.target ? String(a.target) : "00 : 00 : 00 : 00"}</strong></div>;
160
+ }
161
+
162
+ function RatingEdit({ block, blockProps }: BlockEditProps) {
163
+ const max = Math.min(10, Math.max(1, Number(block.attrs.max) || 5)), v = Number(block.attrs.value) || 0;
164
+ return <div {...(merge(blockProps, "ecx-rating") as object)} aria-label={`${v}/${max}`}>{Array.from({ length: max }, (_, i) => <span key={i} style={{ color: i < Math.round(v) ? "#f59e0b" : "#d4d4d8" }}>★</span>)}</div>;
165
+ }
166
+
132
167
  function CoverEdit({ block, blockProps, setAttrs, labels }: BlockEditProps) {
133
168
  const a = block.attrs;
134
169
  const src = typeof a.src === "string" ? a.src : "";
@@ -262,6 +297,36 @@ export function layoutBlocks(): BlockType[] {
262
297
  attributes: { summary: { type: "string" }, open: { type: "boolean", default: false } },
263
298
  create: () => makeBlock("details", {}, [makeBlock("paragraph")]), supports: { style: true, anchor: true, className: true },
264
299
  },
300
+ {
301
+ name: "accordion", title: "Accordion", icon: PanelTop, category: "text", keywords: "accordion faq hoi dap nhieu muc", kind: "container", edit: AccordionEdit,
302
+ attributes: { multiple: { type: "boolean", default: false } },
303
+ create: () => makeBlock("accordion", {}, [makeBlock("details", { summary: "" }, [makeBlock("paragraph")]), makeBlock("details", { summary: "" }, [makeBlock("paragraph")])]), supports: { style: true, anchor: true, className: true },
304
+ },
305
+ {
306
+ name: "tabs", title: "Tabs", icon: PanelTop, category: "text", keywords: "tabs the tab chuyen doi noi dung", kind: "container", edit: TabsEdit,
307
+ create: () => makeBlock("tabs", {}, [makeBlock("tab", { title: "" }, [makeBlock("paragraph")]), makeBlock("tab", { title: "" }, [makeBlock("paragraph")])]), supports: { style: true, anchor: true, className: true },
308
+ },
309
+ {
310
+ name: "tab", title: "Tab", icon: PanelTop, category: "text", keywords: "tab", kind: "container", edit: TabEdit, hidden: true, structure: { parents: ["tabs"] },
311
+ attributes: { title: { type: "string" } }, create: () => makeBlock("tab", { title: "" }, [makeBlock("paragraph")]),
312
+ },
313
+ {
314
+ name: "carousel", title: "Carousel", icon: Columns3, category: "design", keywords: "carousel slider slide truot anh", kind: "container", edit: CarouselEdit,
315
+ attributes: { slidesPerView: { type: "integer", default: 1, min: 1, max: 4 } },
316
+ create: () => makeBlock("carousel", { slidesPerView: 1 }, [makeBlock("group", {}, [makeBlock("paragraph")]), makeBlock("group", {}, [makeBlock("paragraph")])]), supports: { style: true, anchor: true, className: true },
317
+ },
318
+ {
319
+ name: "shortcode", title: "Shortcode", icon: Square, category: "design", keywords: "shortcode ma nhung plugin", kind: "atom", edit: ShortcodeEdit,
320
+ attributes: { name: { type: "string" }, args: { type: "json", default: {} } }, supports: { style: true, anchor: true, className: true },
321
+ },
322
+ {
323
+ name: "countdown", title: "Đếm ngược", icon: Square, category: "design", keywords: "dem nguoc countdown khuyen mai sale", kind: "atom", edit: CountdownEdit,
324
+ attributes: { target: { type: "string" }, label: { type: "string" }, expiredText: { type: "string" } }, supports: { style: true, anchor: true, className: true },
325
+ },
326
+ {
327
+ name: "rating", title: "Đánh giá sao", icon: Square, category: "design", keywords: "danh gia sao rating review", kind: "atom", edit: RatingEdit,
328
+ attributes: { value: { type: "number", default: 5, min: 0, max: 10 }, max: { type: "integer", default: 5, min: 1, max: 10 }, label: { type: "string" } }, supports: { style: true, anchor: true, className: true },
329
+ },
265
330
  {
266
331
  name: "cover", title: "Ảnh bìa", icon: ImageIcon, category: "media", keywords: "anh bia cover banner hero", kind: "container", edit: CoverEdit,
267
332
  attributes: { src: { type: "url", control: "media" }, alt: { type: "string" }, overlay: { type: "string", control: "color" }, opacity: { type: "integer", default: 50, min: 0, max: 100 }, minHeight: { type: "string", default: "400px" }, contentAlign: { type: "string", enum: ["top", "center", "bottom"], default: "center" }, fixed: { type: "boolean", default: false } },
@@ -222,10 +222,10 @@ export function mediaBlocks(): BlockType[] {
222
222
  return [
223
223
  {
224
224
  name: "image", title: "Ảnh", icon: ImageIcon, category: "media", keywords: "anh hinh image photo", kind: "atom", edit: ImageEdit,
225
- attributes: { ...media, alt: { type: "string", control: "textarea" }, title: { type: "string" }, width: { type: "number" }, height: { type: "number" }, size: { type: "string", default: "large" }, align: { type: "string", enum: ["left", "right", "center", "wide", "full"] }, href: { type: "url" }, linkTarget: { type: "string", enum: ["_self", "_blank"] } },
225
+ attributes: { ...media, alt: { type: "string", control: "textarea" }, title: { type: "string" }, width: { type: "number" }, height: { type: "number" }, size: { type: "string", default: "large" }, align: { type: "string", enum: ["left", "right", "center", "wide", "full"] }, href: { type: "url" }, linkTarget: { type: "string", enum: ["_self", "_blank"] }, lightbox: { type: "boolean", default: false } },
226
226
  supports: { style: true, anchor: true, className: true, blockStyle: true }, summary: (a) => a.alt || a.src,
227
227
  },
228
- { name: "gallery", title: "Gallery", icon: Images, category: "media", keywords: "gallery bo suu tap nhieu anh album", kind: "atom", edit: GalleryEdit, attributes: { images: { type: "json", default: [] }, columns: { type: "integer", default: 3, min: 1, max: 6 }, caption: { type: "string" } }, supports: { style: true, anchor: true, className: true } },
228
+ { name: "gallery", title: "Gallery", icon: Images, category: "media", keywords: "gallery bo suu tap nhieu anh album", kind: "atom", edit: GalleryEdit, attributes: { images: { type: "json", default: [] }, columns: { type: "integer", default: 3, min: 1, max: 6 }, caption: { type: "string" }, linkTo: { type: "string", enum: ["none", "media"], default: "media" }, imageCrop: { type: "boolean", default: true }, lightbox: { type: "boolean", default: false } }, supports: { style: true, anchor: true, className: true } },
229
229
  { name: "video", title: "Video", icon: Video, category: "media", keywords: "video mp4 phim", kind: "atom", edit: VideoEdit, attributes: { ...media, name: { type: "string" }, mime: { type: "string" }, poster: { type: "url", control: "media" }, autoplay: { type: "boolean", default: false }, loop: { type: "boolean", default: false }, muted: { type: "boolean", default: false }, controls: { type: "boolean", default: true }, playsInline: { type: "boolean", default: true }, preload: { type: "string", enum: ["none", "metadata", "auto"], default: "metadata" } }, supports: { style: true, anchor: true } },
230
230
  { name: "audio", title: "Âm thanh", icon: Music, category: "media", keywords: "am thanh audio nhac mp3 podcast", kind: "atom", edit: AudioEdit, attributes: { ...media, name: { type: "string" }, mime: { type: "string" }, autoplay: { type: "boolean", default: false }, loop: { type: "boolean", default: false }, preload: { type: "string", enum: ["none", "metadata", "auto"], default: "metadata" } }, supports: { style: true, anchor: true } },
231
231
  { name: "file", title: "Tệp", icon: FileIcon, category: "media", keywords: "tep file pdf tai xuong download tai lieu", kind: "atom", edit: FileEdit, attributes: { ...media, name: { type: "string" }, mime: { type: "string" }, size: { type: "number" }, embed: { type: "boolean", default: true }, download: { type: "boolean" } }, supports: { style: true, anchor: true } },
@@ -100,6 +100,20 @@ function PostTermsEdit({ block, blockProps }: BlockEditProps) {
100
100
  const d = useDynamic();
101
101
  return <p {...merge(blockProps, "ecx-post-terms")}>{(d.post?.terms?.length ? d.post.terms : block.attrs.taxonomy === "post_tag" ? ["Thẻ A", "Thẻ B"] : ["Chuyên mục A", "Chuyên mục B"]).join(String(block.attrs.separator ?? ", "))}</p>;
102
102
  }
103
+ function ReadMoreEdit({ block, blockProps }: BlockEditProps) {
104
+ return <p {...merge(blockProps, "ecx-read-more", align(block.attrs))}><a href="#" onClick={(e) => e.preventDefault()}>{String(block.attrs.text || "Đọc tiếp")}</a></p>;
105
+ }
106
+ function CommentsCountEdit({ block, blockProps }: BlockEditProps) {
107
+ const d = useDynamic();
108
+ return <p {...merge(blockProps, "ecx-comments-count", align(block.attrs))}>{d.post?.comments ?? 0}</p>;
109
+ }
110
+ function AvatarEdit({ block, blockProps }: BlockEditProps) {
111
+ const size = Math.min(256, Math.max(16, Number(block.attrs.size) || 48));
112
+ return <span {...merge(blockProps, "ecx-avatar")}><span style={{ display: "inline-block", width: size, height: size, borderRadius: "50%", background: "rgba(127,127,127,.3)" }} /></span>;
113
+ }
114
+ function QueryTotalEdit({ blockProps, block }: BlockEditProps) {
115
+ return <p {...merge(blockProps, "ecx-query-total", align(block.attrs))}>0</p>;
116
+ }
103
117
  function CommentsEdit({ blockProps }: BlockEditProps) {
104
118
  const d = useDynamic();
105
119
  return <div {...merge(blockProps, "ecx-comments")}><MessageSquare className="ecx-icon" /> {d.post?.comments ?? 0}</div>;
@@ -265,18 +279,22 @@ export function themeBlocks(): BlockType[] {
265
279
  { name: "siteTitle", title: "Tên website", icon: Type, category: theme, keywords: "ten website site title", kind: "atom", edit: SiteTitleEdit, attributes: { level: { type: "integer", default: 0, min: 0, max: 6 }, link: { type: "boolean", default: true }, textAlign: TEXT_ALIGN }, supports: { style: true, className: true } },
266
280
  { name: "siteLogo", title: "Logo", icon: ImageIcon, category: theme, keywords: "logo", kind: "atom", edit: SiteLogoEdit, attributes: { width: { type: "number", default: 120 }, link: { type: "boolean", default: true } }, supports: { style: true, className: true } },
267
281
  { name: "siteTagline", title: "Khẩu hiệu", icon: Type, category: theme, keywords: "khau hieu tagline mo ta", kind: "atom", edit: SiteTaglineEdit, attributes: { textAlign: TEXT_ALIGN }, supports: { style: true, className: true } },
268
- { name: "navigation", title: "Menu", icon: Menu, category: theme, keywords: "menu dieu huong navigation", kind: "atom", edit: NavigationEdit, attributes: { location: { type: "string", default: "primary" }, orientation: { type: "string", enum: ["horizontal", "vertical"], default: "horizontal" }, mobile: { type: "boolean", default: true } }, supports: { style: true, className: true }, summary: (a) => a.location },
282
+ { name: "navigation", title: "Menu", icon: Menu, category: theme, keywords: "menu dieu huong navigation", kind: "atom", edit: NavigationEdit, attributes: { location: { type: "string", default: "primary" }, orientation: { type: "string", enum: ["horizontal", "vertical"], default: "horizontal" }, mobile: { type: "boolean", default: true }, overlayMenu: { type: "string", enum: ["never", "mobile", "always"], default: "mobile" } }, supports: { style: true, className: true }, summary: (a) => a.location },
269
283
  { name: "search", title: "Tìm kiếm", icon: Search, category: theme, keywords: "tim kiem search", kind: "atom", edit: SearchEdit, attributes: { placeholder: { type: "string" }, buttonText: { type: "string" } }, supports: { style: true, className: true } },
270
- { name: "languageSwitcher", title: "Chọn ngôn ngữ", icon: Globe2, category: theme, keywords: "ngon ngu language", kind: "atom", edit: LanguageEdit, supports: { style: true, className: true } },
284
+ { name: "languageSwitcher", title: "Chọn ngôn ngữ", icon: Globe2, category: theme, keywords: "ngon ngu language", kind: "atom", edit: LanguageEdit, attributes: { display: { type: "string", enum: ["inline", "dropdown"], default: "inline" } }, supports: { style: true, className: true } },
271
285
  { name: "copyright", title: "Bản quyền", icon: Copyright, category: theme, keywords: "ban quyen copyright", kind: "atom", edit: CopyrightEdit, attributes: { text: { type: "string" }, textAlign: TEXT_ALIGN }, supports: { style: true, className: true } },
272
286
  { name: "postTitle", title: "Tiêu đề bài", icon: Type, category: theme, keywords: "tieu de bai post title", kind: "atom", edit: PostTitleEdit, attributes: { level: { type: "integer", default: 1, min: 1, max: 6 }, link: { type: "boolean", default: false }, textAlign: TEXT_ALIGN }, supports: { style: true, className: true } },
273
287
  { name: "postContent", title: "Nội dung bài", icon: FileText, category: theme, keywords: "noi dung bai post content", kind: "atom", edit: PostContentEdit },
274
288
  { name: "postExcerpt", title: "Tóm tắt bài", icon: FileText, category: theme, keywords: "tom tat excerpt", kind: "atom", edit: PostExcerptEdit, attributes: { moreText: { type: "string" } }, supports: { style: true, className: true } },
275
289
  { name: "featuredImage", title: "Ảnh đại diện", icon: ImageIcon, category: theme, keywords: "anh dai dien featured image thumbnail", kind: "atom", edit: FeaturedImageEdit, attributes: { size: { type: "string", default: "large" }, link: { type: "boolean", default: false }, aspect: { type: "string", enum: ["auto", "16/9", "4/3", "1/1", "3/4"], default: "auto" } }, supports: { style: true, className: true } },
276
290
  { name: "postDate", title: "Ngày đăng", icon: CalendarDays, category: theme, keywords: "ngay dang date", kind: "atom", edit: PostDateEdit, attributes: { textAlign: TEXT_ALIGN, displayType: { type: "string", enum: ["published", "modified"], default: "published" } }, supports: { style: true, className: true } },
277
- { name: "postAuthor", title: "Tác giả", icon: User, category: theme, keywords: "tac gia author", kind: "atom", edit: PostAuthorEdit, attributes: { avatar: { type: "boolean", default: false } }, supports: { style: true, className: true } },
291
+ { name: "postAuthor", title: "Tác giả", icon: User, category: theme, keywords: "tac gia author", kind: "atom", edit: PostAuthorEdit, attributes: { avatar: { type: "boolean", default: false }, showName: { type: "boolean", default: true }, showBio: { type: "boolean", default: false }, avatarSize: { type: "integer", default: 32, min: 16, max: 128 }, link: { type: "boolean", default: true } }, supports: { style: true, className: true } },
278
292
  { name: "postTerms", title: "Chuyên mục / thẻ", icon: Tag, category: theme, keywords: "chuyen muc the category tag terms", kind: "atom", edit: PostTermsEdit, attributes: { taxonomy: { type: "string", default: "category" }, separator: { type: "string", default: ", " } }, supports: { style: true, className: true } },
279
- { name: "comments", title: "Bình luận", icon: MessageSquare, category: theme, keywords: "binh luan comments", kind: "atom", edit: CommentsEdit },
293
+ { name: "comments", title: "Bình luận", icon: MessageSquare, category: theme, keywords: "binh luan comments", kind: "atom", edit: CommentsEdit, attributes: { title: { type: "string" } } },
294
+ { name: "readMore", title: "Đọc tiếp", icon: ChevronsRight, category: theme, keywords: "doc tiep read more", kind: "atom", edit: ReadMoreEdit, attributes: { text: { type: "string" }, textAlign: TEXT_ALIGN }, supports: { style: true, className: true } },
295
+ { name: "commentsCount", title: "Số bình luận", icon: MessageSquare, category: theme, keywords: "so binh luan comments count", kind: "atom", edit: CommentsCountEdit, attributes: { textAlign: TEXT_ALIGN }, supports: { style: true, className: true } },
296
+ { name: "avatar", title: "Ảnh đại diện tác giả", icon: ImageIcon, category: theme, keywords: "avatar anh dai dien tac gia", kind: "atom", edit: AvatarEdit, attributes: { size: { type: "integer", default: 48, min: 16, max: 256 }, link: { type: "boolean", default: true } }, supports: { style: true, className: true } },
297
+ { name: "queryTotal", title: "Tổng số bài", icon: ListOrdered, category: theme, keywords: "tong so bai total", kind: "atom", edit: QueryTotalEdit, attributes: { textAlign: TEXT_ALIGN }, supports: { style: true, className: true }, structure: { parents: ["query"] } },
280
298
  { name: "queryTitle", title: "Tiêu đề trang lưu trữ", icon: Heading1, category: theme, keywords: "tieu de luu tru chuyen muc archive query title h1", kind: "atom", edit: QueryTitleEdit, attributes: { level: { type: "integer", default: 1, min: 1, max: 6 }, prefix: { type: "boolean", default: false }, textAlign: TEXT_ALIGN }, supports: { style: true, className: true } },
281
299
  { name: "termDescription", title: "Mô tả chuyên mục", icon: AlignLeft, category: theme, keywords: "mo ta chuyen muc term description", kind: "atom", edit: TermDescriptionEdit, attributes: { textAlign: TEXT_ALIGN }, supports: { style: true, className: true } },
282
300
  { name: "breadcrumbs", title: "Breadcrumb", icon: ChevronsRight, category: theme, keywords: "breadcrumb duong dan dieu huong", kind: "atom", edit: BreadcrumbsEdit, attributes: { separator: { type: "string", default: "›" }, showHome: { type: "boolean", default: true }, showCurrent: { type: "boolean", default: true } }, supports: { style: true, className: true } },
@@ -288,7 +306,7 @@ export function themeBlocks(): BlockType[] {
288
306
  supports: { style: true, className: true },
289
307
  },
290
308
  { name: "postTemplate", title: "Khuôn mỗi bài", icon: LayoutTemplate, kind: "container", edit: PostTemplateEdit, hidden: true, attributes: { layout: { type: "string", enum: ["list", "grid"], default: "list" }, columns: { type: "integer", default: 3, min: 1, max: 6 } }, structure: { parents: ["query"] } },
291
- { name: "pagination", title: "Phân trang", icon: ListOrdered, kind: "atom", edit: PaginationEdit, hidden: true, structure: { parents: ["query"] } },
309
+ { name: "pagination", title: "Phân trang", icon: ListOrdered, kind: "atom", edit: PaginationEdit, attributes: { type: { type: "string", enum: ["numbers", "prevNext", "both"], default: "both" }, midSize: { type: "integer", default: 2, min: 0, max: 5 } }, hidden: true, structure: { parents: ["query"] } },
292
310
  { name: "queryEmpty", title: "Khi không có bài", icon: SquareDashed, kind: "container", edit: QueryEmptyEdit, hidden: true, structure: { parents: ["query"] } },
293
311
  { name: "templatePart", title: "Phần dùng chung", icon: PanelTop, category: theme, keywords: "phan dung chung template part header footer", kind: "atom", edit: TemplatePartEdit, attributes: { slug: { type: "string" }, tagName: { type: "string", enum: ["div", "header", "footer", "aside", "section"], default: "div" } }, summary: (a) => a.slug },
294
312
  { name: "syncedPattern", title: "Mẫu đồng bộ", icon: Repeat2, category: "widgets", keywords: "mau dong bo synced pattern reusable", kind: "atom", edit: SyncedPatternEdit, attributes: { ref: { type: "integer" } }, hidden: true },
@@ -31,11 +31,11 @@ const CORE_KINDS: Record<string, BlockKind> = {
31
31
  paragraph: "text", heading: "text", codeBlock: "text", preformatted: "text",
32
32
  bulletList: "container", orderedList: "container", listItem: "container", taskList: "container", taskItem: "container",
33
33
  blockquote: "container", columns: "container", column: "container", group: "container", callout: "container",
34
- buttons: "container", cover: "container", mediaText: "container", pullquote: "text", details: "container",
34
+ buttons: "container", cover: "container", mediaText: "container", pullquote: "text", details: "container", accordion: "container", tabs: "container", tab: "container", carousel: "container",
35
35
  table: "container", tableRow: "container", tableCell: "container", tableHeader: "container",
36
36
  query: "container", postTemplate: "container", queryEmpty: "container", stack: "container",
37
37
  horizontalRule: "atom", image: "atom", gallery: "atom", video: "atom", audio: "atom", file: "atom", youtube: "atom",
38
- button: "atom", embed: "atom", spacer: "atom", customHtml: "atom", socialLinks: "atom", tableOfContents: "atom",
38
+ button: "atom", embed: "atom", spacer: "atom", customHtml: "atom", socialLinks: "atom", tableOfContents: "atom", countdown: "atom", rating: "atom", shortcode: "atom",
39
39
  };
40
40
  const kindOverrides = new Map<string, BlockKind>();
41
41
  export function setBlockKind(type: string, kind: BlockKind) { kindOverrides.set(type, kind); }
@@ -90,6 +90,9 @@ export const ATTR_HINTS: Record<string, AttrHint> = {
90
90
  "socialLinks.align": { control: "segmented", options: ALIGN },
91
91
  "navigation.location": { control: "choice", choice: { kind: "menuLocation" }, help: true },
92
92
  "navigation.orientation": { control: "segmented", options: ["horizontal", "vertical"] },
93
+ "navigation.overlayMenu": { control: "segmented", options: ["never", "mobile", "always"] },
94
+ "languageSwitcher.display": { control: "segmented", options: ["inline", "dropdown"] },
95
+ "gallery.linkTo": { control: "segmented", options: ["none", "media"] },
93
96
  "postTerms.taxonomy": { control: "choice", choice: { kind: "taxonomy" } },
94
97
  "query.postType": { control: "choice", choice: { kind: "postType" }, when: notInherit },
95
98
  "query.category": { control: "choice", choice: { kind: "term", args: () => ({ taxonomy: "category" }) }, when: notInherit },