@enyxs/wikex-components 0.11.28 → 0.11.30

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/README.md CHANGED
@@ -173,3 +173,18 @@ Mặc định “Mở Tài khoản” trỏ tới `/#register`; “Đăng nhập
173
173
  Host CMS có thể đặt `CmsButtonLinkControl` trong thanh công cụ element, truyền
174
174
  `field`, `content` và `onChange(changes)` để cập nhật các khóa trong cùng một
175
175
  transaction undo/autosave. Hai nút vẫn chọn và sửa được trong chế độ editor.
176
+
177
+ ### Liên kết nút tải ứng dụng
178
+
179
+ `CmsButtonLinkControl` cũng hỗ trợ App Store, Google Play và Web Trading/Desktop
180
+ trong `download-section` và `commodity-footer`. Trong Select element, bấm vào
181
+ nút, chọn biểu tượng liên kết, chọn Internal/External, nhập đường dẫn và Áp dụng.
182
+
183
+ Khối tải lưu `{vi|en}.landing.download.{appStore|googlePlay|web}Href` và
184
+ `LinkType`; các field chọn trên canvas là `...appStorePrefix`, `...googlePlayPrefix`
185
+ và `...webPrefix`. Footer giữ `href` và `linkType` trong item của danh sách
186
+ `{vi|en}.footer.downloads`; chọn `label` hoặc `prefix` đều sửa link của cả nút.
187
+ Các URL footer cũ tự nhận loại liên kết theo URL khi chưa có `linkType`.
188
+
189
+ Chạy `node scripts/check-download-button-links.cjs` sau build để kiểm tra liên kết
190
+ hai ngôn ngữ, HTML editor, lưu danh sách, bỏ liên kết và URL không hợp lệ.
package/dist/index.d.mts CHANGED
@@ -110,12 +110,14 @@ declare function CmsButtonLinkControl({ field, content, onChange }: CmsButtonLin
110
110
 
111
111
  type CmsButtonLinkType = 'internal' | 'external';
112
112
  declare function isCmsHeaderButtonField(field: string): boolean;
113
+ declare function isCmsButtonField(field: string): boolean;
113
114
  declare function safeCmsButtonHref(value: string, type: CmsButtonLinkType): string | undefined;
114
115
  declare function getCmsButtonLink(content: Record<string, string | number>, field: string): {
115
116
  type: CmsButtonLinkType;
116
117
  value: string;
117
118
  href: string | undefined;
118
119
  };
120
+ declare function cmsButtonLinkChanges(content: Record<string, string | number>, field: string, value: string, type: CmsButtonLinkType): Record<string, string>;
119
121
 
120
122
  declare const minimalUiComponents: CmsBlock[];
121
123
  declare const wikexComponents: CmsBlock[];
@@ -131,4 +133,4 @@ declare const wikexCmsBlocks: {
131
133
  definition: CmsComponentDefinition;
132
134
  }[];
133
135
 
134
- export { CMS_ELEMENTS_FIELD, CMS_LIST_MARKERS, CMS_TEXT_FONTS, CMS_TEXT_LAYOUT_SUFFIX, CmsBlock, CmsButtonLinkControl, type CmsButtonLinkControlProps, type CmsButtonLinkType, CmsComponentDefinition, type CmsElementState, type CmsListMarker, CmsRendererProps, type CmsRichText, type CmsTextLayout, type CmsTextMark, CmsTextTarget, CmsTextToolbar, type CmsTextToolbarProps, applyCmsTextLayout, cmsListAnchor, cmsListMarkerType, cmsTextLayoutStyle, getCmsButtonLink, isCmsHeaderButtonField, minimalMarketingBlocks, minimalUiBlocks, minimalUiComponents, parseCmsElements, parseCmsRichText, parseCmsTextLayout, patchCmsRichText, readCmsEditableText, rebaseCmsRichText, rebaseCmsTextLayouts, renderCmsRichText, safeCmsButtonHref, safeCmsTextHref, siteChromeBlocks, wikexCmsBlocks, wikexCommodityBlocks, wikexComponents };
136
+ export { CMS_ELEMENTS_FIELD, CMS_LIST_MARKERS, CMS_TEXT_FONTS, CMS_TEXT_LAYOUT_SUFFIX, CmsBlock, CmsButtonLinkControl, type CmsButtonLinkControlProps, type CmsButtonLinkType, CmsComponentDefinition, type CmsElementState, type CmsListMarker, CmsRendererProps, type CmsRichText, type CmsTextLayout, type CmsTextMark, CmsTextTarget, CmsTextToolbar, type CmsTextToolbarProps, applyCmsTextLayout, cmsButtonLinkChanges, cmsListAnchor, cmsListMarkerType, cmsTextLayoutStyle, getCmsButtonLink, isCmsButtonField, isCmsHeaderButtonField, minimalMarketingBlocks, minimalUiBlocks, minimalUiComponents, parseCmsElements, parseCmsRichText, parseCmsTextLayout, patchCmsRichText, readCmsEditableText, rebaseCmsRichText, rebaseCmsTextLayouts, renderCmsRichText, safeCmsButtonHref, safeCmsTextHref, siteChromeBlocks, wikexCmsBlocks, wikexCommodityBlocks, wikexComponents };
package/dist/index.d.ts CHANGED
@@ -110,12 +110,14 @@ declare function CmsButtonLinkControl({ field, content, onChange }: CmsButtonLin
110
110
 
111
111
  type CmsButtonLinkType = 'internal' | 'external';
112
112
  declare function isCmsHeaderButtonField(field: string): boolean;
113
+ declare function isCmsButtonField(field: string): boolean;
113
114
  declare function safeCmsButtonHref(value: string, type: CmsButtonLinkType): string | undefined;
114
115
  declare function getCmsButtonLink(content: Record<string, string | number>, field: string): {
115
116
  type: CmsButtonLinkType;
116
117
  value: string;
117
118
  href: string | undefined;
118
119
  };
120
+ declare function cmsButtonLinkChanges(content: Record<string, string | number>, field: string, value: string, type: CmsButtonLinkType): Record<string, string>;
119
121
 
120
122
  declare const minimalUiComponents: CmsBlock[];
121
123
  declare const wikexComponents: CmsBlock[];
@@ -131,4 +133,4 @@ declare const wikexCmsBlocks: {
131
133
  definition: CmsComponentDefinition;
132
134
  }[];
133
135
 
134
- export { CMS_ELEMENTS_FIELD, CMS_LIST_MARKERS, CMS_TEXT_FONTS, CMS_TEXT_LAYOUT_SUFFIX, CmsBlock, CmsButtonLinkControl, type CmsButtonLinkControlProps, type CmsButtonLinkType, CmsComponentDefinition, type CmsElementState, type CmsListMarker, CmsRendererProps, type CmsRichText, type CmsTextLayout, type CmsTextMark, CmsTextTarget, CmsTextToolbar, type CmsTextToolbarProps, applyCmsTextLayout, cmsListAnchor, cmsListMarkerType, cmsTextLayoutStyle, getCmsButtonLink, isCmsHeaderButtonField, minimalMarketingBlocks, minimalUiBlocks, minimalUiComponents, parseCmsElements, parseCmsRichText, parseCmsTextLayout, patchCmsRichText, readCmsEditableText, rebaseCmsRichText, rebaseCmsTextLayouts, renderCmsRichText, safeCmsButtonHref, safeCmsTextHref, siteChromeBlocks, wikexCmsBlocks, wikexCommodityBlocks, wikexComponents };
136
+ export { CMS_ELEMENTS_FIELD, CMS_LIST_MARKERS, CMS_TEXT_FONTS, CMS_TEXT_LAYOUT_SUFFIX, CmsBlock, CmsButtonLinkControl, type CmsButtonLinkControlProps, type CmsButtonLinkType, CmsComponentDefinition, type CmsElementState, type CmsListMarker, CmsRendererProps, type CmsRichText, type CmsTextLayout, type CmsTextMark, CmsTextTarget, CmsTextToolbar, type CmsTextToolbarProps, applyCmsTextLayout, cmsButtonLinkChanges, cmsListAnchor, cmsListMarkerType, cmsTextLayoutStyle, getCmsButtonLink, isCmsButtonField, isCmsHeaderButtonField, minimalMarketingBlocks, minimalUiBlocks, minimalUiComponents, parseCmsElements, parseCmsRichText, parseCmsTextLayout, patchCmsRichText, readCmsEditableText, rebaseCmsRichText, rebaseCmsTextLayouts, renderCmsRichText, safeCmsButtonHref, safeCmsTextHref, siteChromeBlocks, wikexCmsBlocks, wikexCommodityBlocks, wikexComponents };