On this page Key rules Use when / Avoid Live preview Standard Admin Do / Don't Accessibility Target Components
Ad referral Thẻ nguồn quảng cáo của tin nhắn trong inbox.
Copy page as Markdown Read Markdown ↗
Key rules
Thẻ chỉ render khi có dữ liệu quảng cáo.
Element chatty-ad-referral ở mục Standard là chuẩn chatty-ui port theo; các mục theo surface mô tả component React đang chạy.
On this page Key rules Use when / Avoid Use instead Live preview Standard Element API Admin Import / element Anatomy Placement / order Props Sizes Tokens States Behaviour Copy Source Do / Don't Accessibility Target Use when / Avoid
Hiển thị ngữ cảnh quảng cáo của hội thoại.
Use instead
Component
Use when
AdReferralBlock
Hiển thị ngữ cảnh quảng cáo của hội thoại.
button
Caller sở hữu tương tác liên quan.
Live preview
Standard
Standard
Surface admin inbox Light Dark Desktop Mobile
Card chỉ có caption, và card có thumbnail, link bài đăng và chi tiết thu gọn.
Show code chatty-ad-referral.element.js Wrap code lines Copy <chatty-ad-referral heading="Facebook ad"
>Summer collection<br />Explore our collection</chatty-ad-referral
>
<chatty-ad-referral heading="WhatsApp ad" href="https://example.com/post">
<img slot="thumb" src="/fixtures/tote.svg" alt="" />
Canvas tote bag<br />Carry everything, every day.
<img
slot="details"
src="/fixtures/tote.svg"
alt="Canvas tote bag"
style="max-width: 100%; max-height: 240px; border-radius: 8px"
/>
</chatty-ad-referral>
Prototype (cùng ad-referral.styles.js) là chuẩn: chatty-ui port 1:1, và chatty-ui/custom-elements.json sinh từ chính prototype. Caption, thumbnail và phần chi tiết (media, sản phẩm) đi qua slot. Chưa inbox dùng element thật; mục Admin bên dưới mô tả React đang chạy.
Element
Element
Module
chatty-ad-referral
@avada/chatty-ui/elements/ad-referral.js
API
Admin
Standard
Surface admin inbox Light Dark Desktop Mobile
Card chỉ có caption, và card có thumbnail, link bài đăng và chi tiết thu gọn.
Show code chatty-ad-referral.element.js Wrap code lines Copy <chatty-ad-referral heading="Facebook ad"
>Summer collection<br />Explore our collection</chatty-ad-referral
>
<chatty-ad-referral heading="WhatsApp ad" href="https://example.com/post">
<img slot="thumb" src="/fixtures/tote.svg" alt="" />
Canvas tote bag<br />Carry everything, every day.
<img
slot="details"
src="/fixtures/tote.svg"
alt="Canvas tote bag"
style="max-width: 100%; max-height: 240px; border-radius: 8px"
/>
</chatty-ad-referral>
Standard
Surface admin inbox Light Dark Desktop Mobile
Card đã mở rộng: caption đầy đủ và ảnh chi tiết.
Show code chatty-ad-referral.element.js Wrap code lines Copy <chatty-ad-referral heading="Instagram ad" expanded>
Canvas tote bag<br />Carry everything, every day.
<img
slot="details"
src="/fixtures/tote.svg"
alt="Canvas tote bag"
style="width: 160px; border-radius: 8px"
/>
</chatty-ad-referral>
Current (React), being replaced
Surface admin inbox Light Dark Desktop Mobile
Thẻ thật với dữ liệu cục bộ, không có media ngoài.
Show code ad-referral.jsx Wrap code lines Copy import React from 'react';
import {AdReferralBlock} from '@assets/pages/InboxManagement/v2/blocks/AdReferralBlock.jsx';
import '@assets/pages/InboxManagement/v2/styles.scss';
export function Card() {
return <AdReferralBlock block={{adReferral: {platform: 'facebook', title: 'Summer collection', body: 'Explore our collection'}, i18n: text => text}} />;
}
Import / element
Component / element
Import / file
Scope root
AdReferralBlock
@assets/pages/InboxManagement/v2 /blocks/AdReferralBlock.jsx
.inbox-v2
Anatomy
Part
Element
1
Thumbnail tùy chọn, nhãn, nội dung, nút mở rộng và media.
Placement / order
Context
Order
Caller
Theo thứ tự markup của component.
Props
Sizes
Tokens
Part
Token
Light
Dark
Nền
Theo style inbox
Theo style inbox
No Dark skin
States
State
Trigger
Visual change (values)
ARIA/attribute
Mở rộng
Có media hoặc caption bị cắt
Hiện chi tiết khi nhấn.
aria-expanded
Behaviour
Interaction
Result
Toggle
Đổi expanded và dừng sự kiện hàng.
Copy
String
i18n key
Where
Ad details
Ad details
Nhãn nút mở rộng
Source
File
Evidence
Public API
Markup
Caller
Do / Don't
Accessibility
Target
Target — read the case before building
Surface
Now
Target
Source
Admin
Thẻ React trong thread của inbox
Not available — new build follows Target. Registry block của chatty-message (đợt C) ánh xạ block ad-referral sang element chatty-ad-referral , không có tag chatty-block -* riêng; dữ liệu đi qua property, không qua attribute; block không biết thì ẩn.
MDN: Web Components
Admin
Component React theo surface
Not available — new build follows Target. Port chatty-ad-referral từ mục Standard rồi chuyển caller từng surface.
Chatty UI · Chrome dùng chatty-ui theo palette light/dark của guide; specimen giữ surface riêng. Surface dùng native select để bốn nhãn vẫn vừa ở 390px.