@pushwoosh/dumb-components 4.8.0 → 4.9.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/ChatPreview/ChatPreview.js +4 -3
- package/ChatPreview/components/ButtonLabel/ButtonLabel.d.ts +4 -0
- package/ChatPreview/components/ButtonLabel/ButtonLabel.js +20 -0
- package/ChatPreview/components/ButtonLabel/index.d.ts +1 -0
- package/ChatPreview/components/ButtonLabel/index.js +1 -0
- package/ChatPreview/components/ButtonLabel/styles.d.ts +3 -0
- package/ChatPreview/components/ButtonLabel/styles.js +5 -0
- package/ChatPreview/components/ButtonLabel/types.d.ts +5 -0
- package/ChatPreview/components/ButtonLabel/types.js +1 -0
- package/ChatPreview/components/ChatCardView/ChatCardView.js +5 -1
- package/ChatPreview/components/Deliverable/Deliverable.d.ts +2 -2
- package/ChatPreview/components/Deliverable/Deliverable.js +6 -17
- package/ChatPreview/components/MessageBubble/MessageBubble.js +4 -1
- package/ChatPreview/helpers.d.ts +3 -1
- package/ChatPreview/helpers.js +26 -1
- package/ChatPreview/polyglot/messages_ar.js +0 -1
- package/ChatPreview/polyglot/messages_bn.js +0 -1
- package/ChatPreview/polyglot/messages_de.js +0 -1
- package/ChatPreview/polyglot/messages_en.js +0 -1
- package/ChatPreview/polyglot/messages_es.js +0 -1
- package/ChatPreview/polyglot/messages_fr.js +0 -1
- package/ChatPreview/polyglot/messages_he.js +0 -1
- package/ChatPreview/polyglot/messages_hi.js +0 -1
- package/ChatPreview/polyglot/messages_ja.js +0 -1
- package/ChatPreview/polyglot/messages_ko.js +0 -1
- package/ChatPreview/polyglot/messages_pt.js +0 -1
- package/ChatPreview/polyglot/messages_ru.js +0 -1
- package/ChatPreview/polyglot/messages_th.js +0 -1
- package/ChatPreview/polyglot/messages_zh.js +0 -1
- package/ChatPreview/polyglot/types.d.ts +0 -1
- package/ChatPreview/types.d.ts +1 -1
- package/package.json +1 -1
- package/ChatPreview/components/Deliverable/styles.d.ts +0 -6
- package/ChatPreview/components/Deliverable/styles.js +0 -10
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { PlatformLogoIcon } from '@pushwoosh/kit-icons';
|
|
3
3
|
import { ChatText, NativeMessage, NoFallback, StatusNotice } from './components';
|
|
4
4
|
import { CHAT_CHANNELS } from './constants';
|
|
5
|
-
import { droppedPathsOf, errorsOf, fallbackTextOf, hasNativeContent, viewOf } from './helpers';
|
|
5
|
+
import { deliveredContent, droppedPathsOf, errorsOf, fallbackTextOf, hasNativeContent, viewOf } from './helpers';
|
|
6
6
|
import { Lang } from './polyglot';
|
|
7
7
|
import { BlockedMessage, Bubble, EmptyText, Header, Screen, Thread } from './styles';
|
|
8
8
|
/** Renders a rich chat message the way the recipient sees it in RCS, WhatsApp, Messenger or LINE. */
|
|
@@ -17,11 +17,12 @@ export function ChatPreview(props) {
|
|
|
17
17
|
const look = CHAT_CHANNELS[channel];
|
|
18
18
|
const view = viewOf(channel, status);
|
|
19
19
|
const dropped = droppedPathsOf(issues);
|
|
20
|
+
const delivered = deliveredContent(content, dropped);
|
|
20
21
|
const fallbackText = fallbackTextOf(content);
|
|
21
|
-
const drawable = view === 'fallback' ? Boolean(fallbackText) : hasNativeContent(
|
|
22
|
+
const drawable = view === 'fallback' ? Boolean(fallbackText) : hasNativeContent(delivered);
|
|
22
23
|
const native = _jsx(NativeMessage, {
|
|
23
24
|
channel: channel,
|
|
24
|
-
content:
|
|
25
|
+
content: delivered,
|
|
25
26
|
dropped: dropped,
|
|
26
27
|
look: look,
|
|
27
28
|
rcs: channel === 'rcs' ? content.rcs : undefined
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { ButtonLabelProps } from './types';
|
|
3
|
+
/** A button title with the glyph chats put on link and phone buttons, so they don't read as quick replies. */
|
|
4
|
+
export declare function ButtonLabel(props: ButtonLabelProps): ReactElement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CallIcon, OpenIcon } from '@pushwoosh/kit-icons';
|
|
3
|
+
import { Label } from './styles';
|
|
4
|
+
/** A button title with the glyph chats put on link and phone buttons, so they don't read as quick replies. */
|
|
5
|
+
export function ButtonLabel(props) {
|
|
6
|
+
const {
|
|
7
|
+
button
|
|
8
|
+
} = props;
|
|
9
|
+
return _jsxs(Label, {
|
|
10
|
+
children: [button.kind === 'url' && _jsx(OpenIcon, {
|
|
11
|
+
"data-testid": "chat-button-url",
|
|
12
|
+
size: "small",
|
|
13
|
+
view: "lined"
|
|
14
|
+
}), button.kind === 'phone' && _jsx(CallIcon, {
|
|
15
|
+
"data-testid": "chat-button-phone",
|
|
16
|
+
size: "small",
|
|
17
|
+
view: "lined"
|
|
18
|
+
}), button.title]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ButtonLabel } from './ButtonLabel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ButtonLabel } from './ButtonLabel';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
2
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
3
|
+
}> & string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import { CardBody, CardButton, CardButtons, CardFrame, CardTitle, Thumbnail } fr
|
|
|
3
3
|
import { RCS_MEDIA_HEIGHT } from '../../constants';
|
|
4
4
|
import { rcsLayoutOf } from '../../helpers';
|
|
5
5
|
import { Footer } from '../../styles';
|
|
6
|
+
import { ButtonLabel } from '../ButtonLabel';
|
|
6
7
|
import { ChatMediaView } from '../ChatMediaView';
|
|
7
8
|
import { ChatText } from '../ChatText';
|
|
8
9
|
import { Deliverable } from '../Deliverable';
|
|
@@ -32,6 +33,7 @@ export function ChatCardView(props) {
|
|
|
32
33
|
media: card.media
|
|
33
34
|
})
|
|
34
35
|
}), (card.title || card.body || card.footer) && _jsxs(CardBody, {
|
|
36
|
+
"data-testid": "chat-card-body",
|
|
35
37
|
children: [card.title && _jsx(Deliverable, {
|
|
36
38
|
dropped: isDropped('title'),
|
|
37
39
|
children: _jsx(CardTitle, {
|
|
@@ -54,7 +56,9 @@ export function ChatCardView(props) {
|
|
|
54
56
|
}), Boolean(card.buttons?.length) && _jsx(CardButtons, {
|
|
55
57
|
children: card.buttons?.map(button => _jsx(CardButton, {
|
|
56
58
|
"$skin": look.skin,
|
|
57
|
-
children:
|
|
59
|
+
children: _jsx(ButtonLabel, {
|
|
60
|
+
button: button
|
|
61
|
+
})
|
|
58
62
|
}, button.id))
|
|
59
63
|
})]
|
|
60
64
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { DeliverableProps } from './types';
|
|
3
|
-
/** Draws a field
|
|
4
|
-
export declare function Deliverable(props: DeliverableProps): ReactElement;
|
|
3
|
+
/** Draws a field only when the channel delivers it: the preview shows what the recipient gets. */
|
|
4
|
+
export declare function Deliverable(props: DeliverableProps): ReactElement | null;
|
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx
|
|
2
|
-
|
|
3
|
-
import { Lang } from '../../polyglot';
|
|
4
|
-
/** Draws a field as is, or dimmed with a "not delivered" mark when the channel drops it. */
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** Draws a field only when the channel delivers it: the preview shows what the recipient gets. */
|
|
5
3
|
export function Deliverable(props) {
|
|
6
4
|
const {
|
|
7
5
|
dropped,
|
|
8
6
|
children
|
|
9
7
|
} = props;
|
|
10
|
-
if (
|
|
11
|
-
return
|
|
12
|
-
children: children
|
|
13
|
-
});
|
|
8
|
+
if (dropped) {
|
|
9
|
+
return null;
|
|
14
10
|
}
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
children: [_jsx(DroppedField, {
|
|
18
|
-
children: children
|
|
19
|
-
}), _jsx(DroppedTag, {
|
|
20
|
-
children: _jsx(Lang, {
|
|
21
|
-
message: "DUMB.CHAT_PREVIEW.NOT_DELIVERED"
|
|
22
|
-
})
|
|
23
|
-
})]
|
|
11
|
+
return _jsx(_Fragment, {
|
|
12
|
+
children: children
|
|
24
13
|
});
|
|
25
14
|
}
|
|
@@ -3,6 +3,7 @@ import { ListIcon } from '@pushwoosh/kit-icons';
|
|
|
3
3
|
import { InlineButton, InlineButtons } from './styles';
|
|
4
4
|
import { bubbleButtonsOf } from '../../helpers';
|
|
5
5
|
import { Bubble, Footer, HeaderText } from '../../styles';
|
|
6
|
+
import { ButtonLabel } from '../ButtonLabel';
|
|
6
7
|
import { ChatMediaView } from '../ChatMediaView';
|
|
7
8
|
import { ChatText } from '../ChatText';
|
|
8
9
|
import { Deliverable } from '../Deliverable';
|
|
@@ -54,7 +55,9 @@ export function MessageBubble(props) {
|
|
|
54
55
|
}), (inlineButtons.length > 0 || content.list) && _jsxs(InlineButtons, {
|
|
55
56
|
children: [inlineButtons.map(button => _jsx(InlineButton, {
|
|
56
57
|
"$skin": look.skin,
|
|
57
|
-
children:
|
|
58
|
+
children: _jsx(ButtonLabel, {
|
|
59
|
+
button: button
|
|
60
|
+
})
|
|
58
61
|
}, button.id)), content.list && _jsxs(InlineButton, {
|
|
59
62
|
"$skin": look.skin,
|
|
60
63
|
children: [_jsx(ListIcon, {
|
package/ChatPreview/helpers.d.ts
CHANGED
|
@@ -15,7 +15,9 @@ export declare function cardsOf(content: ChatContent): ChatCard[];
|
|
|
15
15
|
export declare function hasHeader(header: ChatHeader | undefined): boolean;
|
|
16
16
|
/** Whether the native message has anything to draw; a card message draws only its card. */
|
|
17
17
|
export declare function hasNativeContent(content: ChatContent): boolean;
|
|
18
|
-
/**
|
|
18
|
+
/** The content as delivered: dropped fields are removed, so emptiness checks and rendering agree. */
|
|
19
|
+
export declare function deliveredContent(content: ChatContent, dropped: Set<string>): ChatContent;
|
|
20
|
+
/** Content paths the channel drops; the preview leaves them out. */
|
|
19
21
|
export declare function droppedPathsOf(issues: ChatIssue[] | undefined): Set<string>;
|
|
20
22
|
export declare function errorsOf(issues: ChatIssue[] | undefined): ChatIssue[];
|
|
21
23
|
/** RCS card layout with the Twilio defaults filled in. */
|
package/ChatPreview/helpers.js
CHANGED
|
@@ -40,7 +40,32 @@ export function hasNativeContent(content) {
|
|
|
40
40
|
}
|
|
41
41
|
return Boolean(content.body || content.footer || content.media?.url || hasHeader(content.header) || cardsOf(content).some(hasCardContent) || content.list || content.buttons?.length);
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
const CARD_FIELDS = ['media', 'title', 'body', 'footer'];
|
|
44
|
+
/** The content as delivered: dropped fields are removed, so emptiness checks and rendering agree. */
|
|
45
|
+
export function deliveredContent(content, dropped) {
|
|
46
|
+
if (dropped.size === 0) {
|
|
47
|
+
return content;
|
|
48
|
+
}
|
|
49
|
+
const delivered = {
|
|
50
|
+
...content
|
|
51
|
+
};
|
|
52
|
+
if (dropped.has('header')) delete delivered.header;
|
|
53
|
+
if (dropped.has('body')) delete delivered.body;
|
|
54
|
+
if (dropped.has('footer')) delete delivered.footer;
|
|
55
|
+
if (content.cards) {
|
|
56
|
+
delivered.cards = content.cards.map((card, index) => {
|
|
57
|
+
const kept = {
|
|
58
|
+
...card
|
|
59
|
+
};
|
|
60
|
+
CARD_FIELDS.forEach(field => {
|
|
61
|
+
if (dropped.has(`cards[${String(index)}].${field}`)) delete kept[field];
|
|
62
|
+
});
|
|
63
|
+
return kept;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return delivered;
|
|
67
|
+
}
|
|
68
|
+
/** Content paths the channel drops; the preview leaves them out. */
|
|
44
69
|
export function droppedPathsOf(issues) {
|
|
45
70
|
return new Set((issues ?? []).filter(issue => issue.code === 'field_dropped').map(issue => issue.path));
|
|
46
71
|
}
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'يحتوي على أخطاء — لن يُرسل',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'يُرسل فقط ضمن نافذة الـ 24 ساعة',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'لا يوجد نص بديل — لن يُرسل شيء',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'لا يتم تسليمه',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} مشكلات أخرى',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'رسالة LINE Flex',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': 'الرسالة فارغة…',
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'ত্রুটি আছে — পাঠানো হবে না',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'শুধু ২৪ ঘণ্টার উইন্ডোর মধ্যে পাঠানো হবে',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'কোনো ফলব্যাক টেক্সট নেই — কিছুই পাঠানো হবে না',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'ডেলিভার হবে না',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': 'আরও {{count}}টি সমস্যা',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'LINE Flex বার্তা',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': 'বার্তা খালি…',
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'Fehlerhaft – wird nicht gesendet',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'Wird nur innerhalb des 24-Stunden-Fensters gesendet',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'Kein Ersatztext – es wird nichts gesendet',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'Wird nicht zugestellt',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} {{count | pluralize: "weiterer Fehler", "weitere Fehler"}}',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'LINE-Flex-Nachricht',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': 'Nachricht ist leer…',
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'Has errors — won’t be sent',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'Sent only within the 24-hour window',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'No fallback text — nothing will be sent',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'Not delivered',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} more {{count | pluralize: "issue", "issues"}}',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'LINE Flex message',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': 'Message is empty…',
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'Tiene errores: no se enviará',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'Solo se envía dentro de la ventana de 24 horas',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'Sin texto alternativo: no se enviará nada',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'No se entrega',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} {{count | pluralize: "problema", "problemas"}} más',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'Mensaje Flex de LINE',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': 'El mensaje está vacío…',
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'Contient des erreurs : ne sera pas envoyé',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'Envoyé uniquement dans la fenêtre de 24 heures',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'Pas de texte de secours : rien ne sera envoyé',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'Non distribué',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} {{count | pluralize: "problème", "problèmes"}}',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'Message Flex LINE',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': 'Le message est vide…',
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'יש שגיאות — לא יישלח',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'נשלח רק בתוך חלון 24 השעות',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'אין טקסט חלופי — שום דבר לא יישלח',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'לא נמסר',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} בעיות נוספות',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'הודעת LINE Flex',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': 'ההודעה ריקה…',
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'त्रुटियाँ हैं — नहीं भेजा जाएगा',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'केवल 24 घंटे की विंडो में भेजा जाएगा',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'कोई फ़ॉलबैक टेक्स्ट नहीं — कुछ नहीं भेजा जाएगा',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'डिलीवर नहीं होगा',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} और समस्याएँ',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'LINE Flex संदेश',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': 'संदेश खाली है…',
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'エラーがあります — 送信されません',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': '24時間のウィンドウ内でのみ送信されます',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': '代替テキストがありません — 何も送信されません',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': '配信されません',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': 'ほか {{count}} 件の問題',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'LINE Flexメッセージ',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': 'メッセージが空です…',
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': '오류가 있어 전송되지 않습니다',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': '24시간 창 안에서만 전송됩니다',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': '대체 텍스트가 없어 아무것도 전송되지 않습니다',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': '전달되지 않음',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': '외 {{count}}개 문제',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'LINE Flex 메시지',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': '메시지가 비어 있습니다…',
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'Tem erros — não será enviado',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'Enviado apenas dentro da janela de 24 horas',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'Sem texto alternativo — nada será enviado',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'Não é entregue',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} {{count | pluralize: "problema", "problemas"}}',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'Mensagem Flex do LINE',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': 'A mensagem está vazia…',
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'Есть ошибки — не будет отправлено',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'Уйдёт только в 24-часовом окне',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'Нет текста фолбэка — ничего не уйдёт',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'Не доставляется',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': 'ещё {{count}} {{count | pluralize: "ошибка", "ошибки", "ошибок"}}',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'Flex-сообщение LINE',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': 'Сообщение пустое…',
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'มีข้อผิดพลาด — จะไม่ถูกส่ง',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'ส่งได้เฉพาะภายในช่วง 24 ชั่วโมง',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'ไม่มีข้อความสำรอง — จะไม่มีการส่งอะไร',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'ไม่ถูกส่งถึง',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+อีก {{count}} ปัญหา',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'ข้อความ LINE Flex',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': 'ข้อความว่างเปล่า…',
|
|
@@ -3,7 +3,6 @@ export const messages = {
|
|
|
3
3
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': '存在错误 — 不会发送',
|
|
4
4
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': '仅在 24 小时窗口内发送',
|
|
5
5
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': '没有备用文本 — 不会发送任何内容',
|
|
6
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': '不会送达',
|
|
7
6
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': '另有 {{count}} 个问题',
|
|
8
7
|
'DUMB.CHAT_PREVIEW.FLEX': 'LINE Flex 消息',
|
|
9
8
|
'DUMB.CHAT_PREVIEW.EMPTY': '消息为空…',
|
|
@@ -4,7 +4,6 @@ export type ChatPreviewMessages = {
|
|
|
4
4
|
'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': NoParams;
|
|
5
5
|
'DUMB.CHAT_PREVIEW.SESSION_ONLY': NoParams;
|
|
6
6
|
'DUMB.CHAT_PREVIEW.NO_FALLBACK': NoParams;
|
|
7
|
-
'DUMB.CHAT_PREVIEW.NOT_DELIVERED': NoParams;
|
|
8
7
|
'DUMB.CHAT_PREVIEW.MORE_ISSUES': {
|
|
9
8
|
count: number;
|
|
10
9
|
};
|
package/ChatPreview/types.d.ts
CHANGED
|
@@ -127,7 +127,7 @@ export interface ChatPreviewProps {
|
|
|
127
127
|
content: ChatContent;
|
|
128
128
|
/** `partial` sends the fallback text (WhatsApp: only inside the 24h window); `incompatible` is not sent. */
|
|
129
129
|
status?: ChatCompatibility;
|
|
130
|
-
/** Validator issues of the channel; `field_dropped` fields are
|
|
130
|
+
/** Validator issues of the channel; `field_dropped` fields are left out of the preview, errors are listed. */
|
|
131
131
|
issues?: ChatIssue[];
|
|
132
132
|
/** Sender shown in the chat header. */
|
|
133
133
|
senderName?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const DroppedField: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
2
|
-
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
3
|
-
}> & string;
|
|
4
|
-
export declare const DroppedTag: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
5
|
-
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
6
|
-
}> & string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { Color, FontSize, FontWeight } from '@pushwoosh/kit-constants';
|
|
3
|
-
export const DroppedField = styled.div.withConfig({
|
|
4
|
-
displayName: "DroppedField",
|
|
5
|
-
componentId: "sc-rsezkh-0"
|
|
6
|
-
})(["opacity:0.45;text-decoration:line-through;"]);
|
|
7
|
-
export const DroppedTag = styled.div.withConfig({
|
|
8
|
-
displayName: "DroppedTag",
|
|
9
|
-
componentId: "sc-rsezkh-1"
|
|
10
|
-
})(["color:", ";font-size:", ";font-weight:", ";text-decoration:none;"], Color.WARNING, FontSize.SMALL, FontWeight.MEDIUM);
|