@ecomcx/ecomweb-editor 1.25.0 → 1.25.1
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 +1 -1
- package/src/v2/blocks/layout.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecomcx/ecomweb-editor",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.1",
|
|
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": {
|
package/src/v2/blocks/layout.tsx
CHANGED
|
@@ -176,9 +176,9 @@ function CoverEdit({ block, blockProps, setAttrs, labels }: BlockEditProps) {
|
|
|
176
176
|
const { host } = useEditor();
|
|
177
177
|
const select = (items: MediaItem[]) => setAttrs({ src: items[0].url, alt: items[0].alt || undefined, mediaId: items[0].id });
|
|
178
178
|
const drop = useFileDrop("image", select);
|
|
179
|
+
const t = useMsgs("blocks"); // hook phải gọi trước mọi return sớm: chọn ảnh/màu làm đổi nhánh render
|
|
179
180
|
// Chưa có ảnh lẫn màu: chỗ chọn ảnh nền hoặc màu nền (không để khối trắng trơn vô hình)
|
|
180
181
|
if (!src && !a.overlay) {
|
|
181
|
-
const t = useMsgs("blocks");
|
|
182
182
|
return (
|
|
183
183
|
<div {...merge(blockProps, cx("ecx-media-placeholder ecx-cover-placeholder", drop.over && "is-drop-target"))} {...drop.props}>
|
|
184
184
|
<span className="ecx-placeholder-title"><ImageIcon className="ecx-icon" />{t.cover}</span>
|