@pushwoosh/dumb-components 4.5.1 → 4.6.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.
Files changed (133) hide show
  1. package/ChatPreview/ChatPreview.d.ts +4 -0
  2. package/ChatPreview/ChatPreview.js +65 -0
  3. package/ChatPreview/components/ChatCardView/ChatCardView.d.ts +4 -0
  4. package/ChatPreview/components/ChatCardView/ChatCardView.js +61 -0
  5. package/ChatPreview/components/ChatCardView/index.d.ts +1 -0
  6. package/ChatPreview/components/ChatCardView/index.js +1 -0
  7. package/ChatPreview/components/ChatCardView/styles.d.ts +24 -0
  8. package/ChatPreview/components/ChatCardView/styles.js +40 -0
  9. package/ChatPreview/components/ChatCardView/types.d.ts +15 -0
  10. package/ChatPreview/components/ChatMediaView/ChatMediaView.d.ts +4 -0
  11. package/ChatPreview/components/ChatMediaView/ChatMediaView.js +49 -0
  12. package/ChatPreview/components/ChatMediaView/index.d.ts +1 -0
  13. package/ChatPreview/components/ChatMediaView/index.js +1 -0
  14. package/ChatPreview/components/ChatMediaView/styles.d.ts +13 -0
  15. package/ChatPreview/components/ChatMediaView/styles.js +18 -0
  16. package/ChatPreview/components/ChatMediaView/types.d.ts +8 -0
  17. package/ChatPreview/components/ChatMediaView/types.js +1 -0
  18. package/ChatPreview/components/ChatText/ChatText.d.ts +4 -0
  19. package/ChatPreview/components/ChatText/ChatText.js +18 -0
  20. package/ChatPreview/components/ChatText/index.d.ts +1 -0
  21. package/ChatPreview/components/ChatText/index.js +1 -0
  22. package/ChatPreview/components/ChatText/types.d.ts +8 -0
  23. package/ChatPreview/components/ChatText/types.js +1 -0
  24. package/ChatPreview/components/Deliverable/Deliverable.d.ts +4 -0
  25. package/ChatPreview/components/Deliverable/Deliverable.js +25 -0
  26. package/ChatPreview/components/Deliverable/index.d.ts +1 -0
  27. package/ChatPreview/components/Deliverable/index.js +1 -0
  28. package/ChatPreview/components/Deliverable/styles.d.ts +6 -0
  29. package/ChatPreview/components/Deliverable/styles.js +10 -0
  30. package/ChatPreview/components/Deliverable/types.d.ts +8 -0
  31. package/ChatPreview/components/Deliverable/types.js +1 -0
  32. package/ChatPreview/components/ListSheet/ListSheet.d.ts +4 -0
  33. package/ChatPreview/components/ListSheet/ListSheet.js +27 -0
  34. package/ChatPreview/components/ListSheet/index.d.ts +1 -0
  35. package/ChatPreview/components/ListSheet/index.js +1 -0
  36. package/ChatPreview/components/ListSheet/styles.d.ts +13 -0
  37. package/ChatPreview/components/ListSheet/styles.js +20 -0
  38. package/ChatPreview/components/ListSheet/types.d.ts +9 -0
  39. package/ChatPreview/components/ListSheet/types.js +1 -0
  40. package/ChatPreview/components/MessageBubble/MessageBubble.d.ts +4 -0
  41. package/ChatPreview/components/MessageBubble/MessageBubble.js +67 -0
  42. package/ChatPreview/components/MessageBubble/index.d.ts +1 -0
  43. package/ChatPreview/components/MessageBubble/index.js +1 -0
  44. package/ChatPreview/components/MessageBubble/styles.d.ts +7 -0
  45. package/ChatPreview/components/MessageBubble/styles.js +11 -0
  46. package/ChatPreview/components/MessageBubble/types.d.ts +3 -0
  47. package/ChatPreview/components/MessageBubble/types.js +1 -0
  48. package/ChatPreview/components/NativeMessage/NativeMessage.d.ts +4 -0
  49. package/ChatPreview/components/NativeMessage/NativeMessage.js +55 -0
  50. package/ChatPreview/components/NativeMessage/index.d.ts +1 -0
  51. package/ChatPreview/components/NativeMessage/index.js +1 -0
  52. package/ChatPreview/components/NativeMessage/styles.d.ts +6 -0
  53. package/ChatPreview/components/NativeMessage/styles.js +11 -0
  54. package/ChatPreview/components/NativeMessage/types.d.ts +7 -0
  55. package/ChatPreview/components/NativeMessage/types.js +1 -0
  56. package/ChatPreview/components/ReplyChips/ReplyChips.d.ts +4 -0
  57. package/ChatPreview/components/ReplyChips/ReplyChips.js +18 -0
  58. package/ChatPreview/components/ReplyChips/index.d.ts +1 -0
  59. package/ChatPreview/components/ReplyChips/index.js +1 -0
  60. package/ChatPreview/components/ReplyChips/styles.d.ts +7 -0
  61. package/ChatPreview/components/ReplyChips/styles.js +15 -0
  62. package/ChatPreview/components/ReplyChips/types.d.ts +3 -0
  63. package/ChatPreview/components/ReplyChips/types.js +1 -0
  64. package/ChatPreview/components/StatusNotice/StatusNotice.d.ts +4 -0
  65. package/ChatPreview/components/StatusNotice/StatusNotice.js +44 -0
  66. package/ChatPreview/components/StatusNotice/index.d.ts +2 -0
  67. package/ChatPreview/components/StatusNotice/index.js +2 -0
  68. package/ChatPreview/components/StatusNotice/styles.d.ts +15 -0
  69. package/ChatPreview/components/StatusNotice/styles.js +22 -0
  70. package/ChatPreview/components/StatusNotice/types.d.ts +9 -0
  71. package/ChatPreview/components/StatusNotice/types.js +1 -0
  72. package/ChatPreview/components/index.d.ts +4 -0
  73. package/ChatPreview/components/index.js +3 -0
  74. package/ChatPreview/components/types.d.ts +13 -0
  75. package/ChatPreview/components/types.js +1 -0
  76. package/ChatPreview/constants.d.ts +47 -0
  77. package/ChatPreview/constants.js +89 -0
  78. package/ChatPreview/helpers.d.ts +22 -0
  79. package/ChatPreview/helpers.js +57 -0
  80. package/ChatPreview/index.d.ts +2 -0
  81. package/ChatPreview/index.js +1 -0
  82. package/ChatPreview/polyglot/index.d.ts +2 -0
  83. package/ChatPreview/polyglot/index.js +34 -0
  84. package/ChatPreview/polyglot/messages_ar.d.ts +3 -0
  85. package/ChatPreview/polyglot/messages_ar.js +14 -0
  86. package/ChatPreview/polyglot/messages_bn.d.ts +3 -0
  87. package/ChatPreview/polyglot/messages_bn.js +14 -0
  88. package/ChatPreview/polyglot/messages_de.d.ts +3 -0
  89. package/ChatPreview/polyglot/messages_de.js +14 -0
  90. package/ChatPreview/polyglot/messages_en.d.ts +3 -0
  91. package/ChatPreview/polyglot/messages_en.js +14 -0
  92. package/ChatPreview/polyglot/messages_es.d.ts +3 -0
  93. package/ChatPreview/polyglot/messages_es.js +14 -0
  94. package/ChatPreview/polyglot/messages_fr.d.ts +3 -0
  95. package/ChatPreview/polyglot/messages_fr.js +14 -0
  96. package/ChatPreview/polyglot/messages_he.d.ts +3 -0
  97. package/ChatPreview/polyglot/messages_he.js +14 -0
  98. package/ChatPreview/polyglot/messages_hi.d.ts +3 -0
  99. package/ChatPreview/polyglot/messages_hi.js +14 -0
  100. package/ChatPreview/polyglot/messages_ja.d.ts +3 -0
  101. package/ChatPreview/polyglot/messages_ja.js +14 -0
  102. package/ChatPreview/polyglot/messages_ko.d.ts +3 -0
  103. package/ChatPreview/polyglot/messages_ko.js +14 -0
  104. package/ChatPreview/polyglot/messages_pt.d.ts +3 -0
  105. package/ChatPreview/polyglot/messages_pt.js +14 -0
  106. package/ChatPreview/polyglot/messages_ru.d.ts +3 -0
  107. package/ChatPreview/polyglot/messages_ru.js +14 -0
  108. package/ChatPreview/polyglot/messages_th.d.ts +3 -0
  109. package/ChatPreview/polyglot/messages_th.js +14 -0
  110. package/ChatPreview/polyglot/messages_zh.d.ts +3 -0
  111. package/ChatPreview/polyglot/messages_zh.js +14 -0
  112. package/ChatPreview/polyglot/types.d.ts +17 -0
  113. package/ChatPreview/polyglot/types.js +1 -0
  114. package/ChatPreview/styles.d.ts +33 -0
  115. package/ChatPreview/styles.js +54 -0
  116. package/ChatPreview/types.d.ts +134 -0
  117. package/ChatPreview/types.js +1 -0
  118. package/WhatsAppPreview/components/WhatsAppMessageContent/WhatsAppMessageContent.js +1 -1
  119. package/WhatsAppPreview/helpers.d.ts +0 -3
  120. package/WhatsAppPreview/helpers.js +0 -56
  121. package/index.d.ts +2 -0
  122. package/index.js +1 -0
  123. package/package.json +1 -1
  124. package/{WhatsAppPreview/components/WhatsAppFormattedText → shared/whatsAppMarkup}/WhatsAppFormattedText.js +2 -2
  125. package/shared/whatsAppMarkup/index.d.ts +3 -0
  126. package/{WhatsAppPreview/components/WhatsAppFormattedText/index.d.ts → shared/whatsAppMarkup/index.js} +1 -0
  127. package/shared/whatsAppMarkup/parse.d.ts +3 -0
  128. package/shared/whatsAppMarkup/parse.js +56 -0
  129. package/shared/whatsAppMarkup/types.js +1 -0
  130. package/WhatsAppPreview/components/WhatsAppFormattedText/index.js +0 -1
  131. /package/{WhatsAppPreview/components/WhatsAppFormattedText → ChatPreview/components/ChatCardView}/types.js +0 -0
  132. /package/{WhatsAppPreview/components/WhatsAppFormattedText → shared/whatsAppMarkup}/WhatsAppFormattedText.d.ts +0 -0
  133. /package/{WhatsAppPreview/components/WhatsAppFormattedText → shared/whatsAppMarkup}/types.d.ts +0 -0
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': 'আংশিকভাবে সমর্থিত — ফলব্যাক টেক্সট পাঠানো হবে',
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'ত্রুটি আছে — পাঠানো হবে না',
4
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'শুধু ২৪ ঘণ্টার উইন্ডোর মধ্যে পাঠানো হবে',
5
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'কোনো ফলব্যাক টেক্সট নেই — কিছুই পাঠানো হবে না',
6
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'ডেলিভার হবে না',
7
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': 'আরও {{count}}টি সমস্যা',
8
+ 'DUMB.CHAT_PREVIEW.FLEX': 'LINE Flex বার্তা',
9
+ 'DUMB.CHAT_PREVIEW.EMPTY': 'বার্তা খালি…',
10
+ 'DUMB.CHAT_PREVIEW.SENDER': 'আপনার ব্র্যান্ড',
11
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': 'নথি',
12
+ 'DUMB.CHAT_PREVIEW.AUDIO': 'অডিও বার্তা',
13
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': 'সংযুক্ত ছবি'
14
+ };
@@ -0,0 +1,3 @@
1
+ import { type ChatPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ChatPreviewMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': 'Teilweise unterstützt – wird als Ersatztext gesendet',
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'Fehlerhaft – wird nicht gesendet',
4
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'Wird nur innerhalb des 24-Stunden-Fensters gesendet',
5
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'Kein Ersatztext – es wird nichts gesendet',
6
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'Wird nicht zugestellt',
7
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} {{count | pluralize: "weiterer Fehler", "weitere Fehler"}}',
8
+ 'DUMB.CHAT_PREVIEW.FLEX': 'LINE-Flex-Nachricht',
9
+ 'DUMB.CHAT_PREVIEW.EMPTY': 'Nachricht ist leer…',
10
+ 'DUMB.CHAT_PREVIEW.SENDER': 'Ihre Marke',
11
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': 'Dokument',
12
+ 'DUMB.CHAT_PREVIEW.AUDIO': 'Sprachnachricht',
13
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': 'Angehängtes Bild'
14
+ };
@@ -0,0 +1,3 @@
1
+ import { type ChatPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ChatPreviewMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': 'Partly supported — sent as the fallback text',
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'Has errors — won’t be sent',
4
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'Sent only within the 24-hour window',
5
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'No fallback text — nothing will be sent',
6
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'Not delivered',
7
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} more {{count | pluralize: "issue", "issues"}}',
8
+ 'DUMB.CHAT_PREVIEW.FLEX': 'LINE Flex message',
9
+ 'DUMB.CHAT_PREVIEW.EMPTY': 'Message is empty…',
10
+ 'DUMB.CHAT_PREVIEW.SENDER': 'Your brand',
11
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': 'Document',
12
+ 'DUMB.CHAT_PREVIEW.AUDIO': 'Audio message',
13
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': 'Attached image'
14
+ };
@@ -0,0 +1,3 @@
1
+ import { type ChatPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ChatPreviewMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': 'Compatible en parte: se envía el texto alternativo',
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'Tiene errores: no se enviará',
4
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'Solo se envía dentro de la ventana de 24 horas',
5
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'Sin texto alternativo: no se enviará nada',
6
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'No se entrega',
7
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} {{count | pluralize: "problema", "problemas"}} más',
8
+ 'DUMB.CHAT_PREVIEW.FLEX': 'Mensaje Flex de LINE',
9
+ 'DUMB.CHAT_PREVIEW.EMPTY': 'El mensaje está vacío…',
10
+ 'DUMB.CHAT_PREVIEW.SENDER': 'Tu marca',
11
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': 'Documento',
12
+ 'DUMB.CHAT_PREVIEW.AUDIO': 'Mensaje de audio',
13
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': 'Imagen adjunta'
14
+ };
@@ -0,0 +1,3 @@
1
+ import { type ChatPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ChatPreviewMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': 'Prise en charge partielle : le texte de secours est envoyé',
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'Contient des erreurs : ne sera pas envoyé',
4
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'Envoyé uniquement dans la fenêtre de 24 heures',
5
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'Pas de texte de secours : rien ne sera envoyé',
6
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'Non distribué',
7
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} {{count | pluralize: "problème", "problèmes"}}',
8
+ 'DUMB.CHAT_PREVIEW.FLEX': 'Message Flex LINE',
9
+ 'DUMB.CHAT_PREVIEW.EMPTY': 'Le message est vide…',
10
+ 'DUMB.CHAT_PREVIEW.SENDER': 'Votre marque',
11
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': 'Document',
12
+ 'DUMB.CHAT_PREVIEW.AUDIO': 'Message audio',
13
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': 'Image jointe'
14
+ };
@@ -0,0 +1,3 @@
1
+ import { type ChatPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ChatPreviewMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': 'נתמך חלקית — נשלח טקסט החלופה',
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'יש שגיאות — לא יישלח',
4
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'נשלח רק בתוך חלון 24 השעות',
5
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'אין טקסט חלופי — שום דבר לא יישלח',
6
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'לא נמסר',
7
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} בעיות נוספות',
8
+ 'DUMB.CHAT_PREVIEW.FLEX': 'הודעת LINE Flex',
9
+ 'DUMB.CHAT_PREVIEW.EMPTY': 'ההודעה ריקה…',
10
+ 'DUMB.CHAT_PREVIEW.SENDER': 'המותג שלך',
11
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': 'מסמך',
12
+ 'DUMB.CHAT_PREVIEW.AUDIO': 'הודעה קולית',
13
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': 'תמונה מצורפת'
14
+ };
@@ -0,0 +1,3 @@
1
+ import { type ChatPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ChatPreviewMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': 'आंशिक रूप से समर्थित — फ़ॉलबैक टेक्स्ट भेजा जाएगा',
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'त्रुटियाँ हैं — नहीं भेजा जाएगा',
4
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'केवल 24 घंटे की विंडो में भेजा जाएगा',
5
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'कोई फ़ॉलबैक टेक्स्ट नहीं — कुछ नहीं भेजा जाएगा',
6
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'डिलीवर नहीं होगा',
7
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} और समस्याएँ',
8
+ 'DUMB.CHAT_PREVIEW.FLEX': 'LINE Flex संदेश',
9
+ 'DUMB.CHAT_PREVIEW.EMPTY': 'संदेश खाली है…',
10
+ 'DUMB.CHAT_PREVIEW.SENDER': 'आपका ब्रांड',
11
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': 'दस्तावेज़',
12
+ 'DUMB.CHAT_PREVIEW.AUDIO': 'ऑडियो संदेश',
13
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': 'संलग्न छवि'
14
+ };
@@ -0,0 +1,3 @@
1
+ import { type ChatPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ChatPreviewMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': '一部のみ対応 — 代替テキストが送信されます',
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'エラーがあります — 送信されません',
4
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': '24時間のウィンドウ内でのみ送信されます',
5
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': '代替テキストがありません — 何も送信されません',
6
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': '配信されません',
7
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': 'ほか {{count}} 件の問題',
8
+ 'DUMB.CHAT_PREVIEW.FLEX': 'LINE Flexメッセージ',
9
+ 'DUMB.CHAT_PREVIEW.EMPTY': 'メッセージが空です…',
10
+ 'DUMB.CHAT_PREVIEW.SENDER': 'あなたのブランド',
11
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': 'ドキュメント',
12
+ 'DUMB.CHAT_PREVIEW.AUDIO': '音声メッセージ',
13
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': '添付画像'
14
+ };
@@ -0,0 +1,3 @@
1
+ import { type ChatPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ChatPreviewMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': '일부만 지원 — 대체 텍스트가 전송됩니다',
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': '오류가 있어 전송되지 않습니다',
4
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': '24시간 창 안에서만 전송됩니다',
5
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': '대체 텍스트가 없어 아무것도 전송되지 않습니다',
6
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': '전달되지 않음',
7
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': '외 {{count}}개 문제',
8
+ 'DUMB.CHAT_PREVIEW.FLEX': 'LINE Flex 메시지',
9
+ 'DUMB.CHAT_PREVIEW.EMPTY': '메시지가 비어 있습니다…',
10
+ 'DUMB.CHAT_PREVIEW.SENDER': '내 브랜드',
11
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': '문서',
12
+ 'DUMB.CHAT_PREVIEW.AUDIO': '음성 메시지',
13
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': '첨부 이미지'
14
+ };
@@ -0,0 +1,3 @@
1
+ import { type ChatPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ChatPreviewMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': 'Suporte parcial — é enviado o texto alternativo',
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'Tem erros — não será enviado',
4
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'Enviado apenas dentro da janela de 24 horas',
5
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'Sem texto alternativo — nada será enviado',
6
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'Não é entregue',
7
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+{{count}} {{count | pluralize: "problema", "problemas"}}',
8
+ 'DUMB.CHAT_PREVIEW.FLEX': 'Mensagem Flex do LINE',
9
+ 'DUMB.CHAT_PREVIEW.EMPTY': 'A mensagem está vazia…',
10
+ 'DUMB.CHAT_PREVIEW.SENDER': 'Sua marca',
11
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': 'Documento',
12
+ 'DUMB.CHAT_PREVIEW.AUDIO': 'Mensagem de áudio',
13
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': 'Imagem anexada'
14
+ };
@@ -0,0 +1,3 @@
1
+ import { type ChatPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ChatPreviewMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': 'Поддерживается частично — уйдёт текстом фолбэка',
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'Есть ошибки — не будет отправлено',
4
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'Уйдёт только в 24-часовом окне',
5
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'Нет текста фолбэка — ничего не уйдёт',
6
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'Не доставляется',
7
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': 'ещё {{count}} {{count | pluralize: "ошибка", "ошибки", "ошибок"}}',
8
+ 'DUMB.CHAT_PREVIEW.FLEX': 'Flex-сообщение LINE',
9
+ 'DUMB.CHAT_PREVIEW.EMPTY': 'Сообщение пустое…',
10
+ 'DUMB.CHAT_PREVIEW.SENDER': 'Ваш бренд',
11
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': 'Документ',
12
+ 'DUMB.CHAT_PREVIEW.AUDIO': 'Аудиосообщение',
13
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': 'Прикреплённое изображение'
14
+ };
@@ -0,0 +1,3 @@
1
+ import { type ChatPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ChatPreviewMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': 'รองรับบางส่วน — จะส่งข้อความสำรองแทน',
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': 'มีข้อผิดพลาด — จะไม่ถูกส่ง',
4
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': 'ส่งได้เฉพาะภายในช่วง 24 ชั่วโมง',
5
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': 'ไม่มีข้อความสำรอง — จะไม่มีการส่งอะไร',
6
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': 'ไม่ถูกส่งถึง',
7
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': '+อีก {{count}} ปัญหา',
8
+ 'DUMB.CHAT_PREVIEW.FLEX': 'ข้อความ LINE Flex',
9
+ 'DUMB.CHAT_PREVIEW.EMPTY': 'ข้อความว่างเปล่า…',
10
+ 'DUMB.CHAT_PREVIEW.SENDER': 'แบรนด์ของคุณ',
11
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': 'เอกสาร',
12
+ 'DUMB.CHAT_PREVIEW.AUDIO': 'ข้อความเสียง',
13
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': 'รูปภาพที่แนบ'
14
+ };
@@ -0,0 +1,3 @@
1
+ import { type ChatPreviewMessages } from './types';
2
+ import type { LangMessages } from '../../polyglot';
3
+ export declare const messages: LangMessages<ChatPreviewMessages>;
@@ -0,0 +1,14 @@
1
+ export const messages = {
2
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': '部分支持 — 将发送备用文本',
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': '存在错误 — 不会发送',
4
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': '仅在 24 小时窗口内发送',
5
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': '没有备用文本 — 不会发送任何内容',
6
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': '不会送达',
7
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': '另有 {{count}} 个问题',
8
+ 'DUMB.CHAT_PREVIEW.FLEX': 'LINE Flex 消息',
9
+ 'DUMB.CHAT_PREVIEW.EMPTY': '消息为空…',
10
+ 'DUMB.CHAT_PREVIEW.SENDER': '您的品牌',
11
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': '文档',
12
+ 'DUMB.CHAT_PREVIEW.AUDIO': '语音消息',
13
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': '附加图片'
14
+ };
@@ -0,0 +1,17 @@
1
+ import type { NoParams } from '../../polyglot';
2
+ export type ChatPreviewMessages = {
3
+ 'DUMB.CHAT_PREVIEW.FALLBACK_PARTIAL': NoParams;
4
+ 'DUMB.CHAT_PREVIEW.FALLBACK_INCOMPATIBLE': NoParams;
5
+ 'DUMB.CHAT_PREVIEW.SESSION_ONLY': NoParams;
6
+ 'DUMB.CHAT_PREVIEW.NO_FALLBACK': NoParams;
7
+ 'DUMB.CHAT_PREVIEW.NOT_DELIVERED': NoParams;
8
+ 'DUMB.CHAT_PREVIEW.MORE_ISSUES': {
9
+ count: number;
10
+ };
11
+ 'DUMB.CHAT_PREVIEW.FLEX': NoParams;
12
+ 'DUMB.CHAT_PREVIEW.EMPTY': NoParams;
13
+ 'DUMB.CHAT_PREVIEW.SENDER': NoParams;
14
+ 'DUMB.CHAT_PREVIEW.DOCUMENT': NoParams;
15
+ 'DUMB.CHAT_PREVIEW.AUDIO': NoParams;
16
+ 'DUMB.CHAT_PREVIEW.IMAGE_ALT': NoParams;
17
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ import { type ChatSkin } from './constants';
2
+ export type Skinned = {
3
+ $skin: ChatSkin;
4
+ };
5
+ /** Message surface shared by bubbles and cards. */
6
+ export declare const surface: import("styled-components").RuleSet<NoInfer<Skinned>>;
7
+ /** Tappable row shared by in-bubble buttons and card buttons. */
8
+ export declare const action: import("styled-components").RuleSet<NoInfer<Skinned>>;
9
+ export declare const Screen: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
10
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
11
+ }, Skinned>> & string;
12
+ export declare const Header: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
13
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
14
+ }, Skinned>> & string;
15
+ export declare const Thread: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
16
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
17
+ }> & string;
18
+ export declare const Bubble: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
19
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
20
+ }, Skinned>> & string;
21
+ export declare const HeaderText: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
22
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
23
+ }> & string;
24
+ export declare const Footer: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
25
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
26
+ }> & string;
27
+ export declare const EmptyText: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
28
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
29
+ }> & string;
30
+ /** A message with errors is drawn for context only: it is not sent. */
31
+ export declare const BlockedMessage: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
32
+ style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
33
+ }> & string;
@@ -0,0 +1,54 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { Color, FontFamily, FontSize, FontWeight, Shadow } from '@pushwoosh/kit-constants';
3
+ import { CHAT_BUBBLE_MAX_WIDTH, CHAT_BUBBLE_PADDING, CHAT_BUBBLE_RADIUS, CHAT_GAP, CHAT_SCREEN_HEIGHT, CHAT_SCREEN_RADIUS, CHAT_SCREEN_WIDTH, CHAT_SMALL_GAP, CHAT_THREAD_PADDING } from './constants';
4
+ /** Message surface shared by bubbles and cards. */
5
+ export const surface = css(["display:flex;flex-direction:column;overflow:hidden;border-radius:", "px;background:", ";color:", ";font-size:", ";overflow-wrap:anywhere;white-space:pre-wrap;"], CHAT_BUBBLE_RADIUS, ({
6
+ $skin
7
+ }) => $skin.bubble, ({
8
+ $skin
9
+ }) => $skin.bubbleText, FontSize.REGULAR);
10
+ /** Tappable row shared by in-bubble buttons and card buttons. */
11
+ export const action = css(["padding:", "px;border-top:1px solid ", ";color:", ";font-weight:", ";text-align:center;"], CHAT_GAP, ({
12
+ $skin
13
+ }) => $skin.chipBorder, ({
14
+ $skin
15
+ }) => $skin.accent, FontWeight.MEDIUM);
16
+ export const Screen = styled.div.withConfig({
17
+ displayName: "Screen",
18
+ componentId: "sc-1nj7qb8-0"
19
+ })(["display:flex;flex-direction:column;box-sizing:border-box;width:", "px;height:", "px;overflow:hidden;border:1px solid ", ";border-radius:", "px;background:", ";box-shadow:", ";font-family:", ";-webkit-font-smoothing:antialiased;*{box-sizing:border-box;}"], CHAT_SCREEN_WIDTH, CHAT_SCREEN_HEIGHT, Color.DIVIDER, CHAT_SCREEN_RADIUS, ({
20
+ $skin
21
+ }) => $skin.chatBackground, Shadow.LARGE, FontFamily.MAIN);
22
+ export const Header = styled.div.withConfig({
23
+ displayName: "Header",
24
+ componentId: "sc-1nj7qb8-1"
25
+ })(["display:flex;gap:", "px;align-items:center;padding:", "px 16px;border-bottom:1px solid ", ";background:", ";color:", ";font-size:", ";font-weight:", ";svg{display:block;}"], CHAT_GAP, CHAT_THREAD_PADDING, Color.DIVIDER, ({
26
+ $skin
27
+ }) => $skin.headerBackground, ({
28
+ $skin
29
+ }) => $skin.headerText, FontSize.REGULAR, FontWeight.MEDIUM);
30
+ export const Thread = styled.div.withConfig({
31
+ displayName: "Thread",
32
+ componentId: "sc-1nj7qb8-2"
33
+ })(["display:flex;flex:1;flex-direction:column;gap:", "px;align-items:flex-start;padding:", "px;overflow-y:auto;"], CHAT_GAP, CHAT_THREAD_PADDING);
34
+ export const Bubble = styled.div.withConfig({
35
+ displayName: "Bubble",
36
+ componentId: "sc-1nj7qb8-3"
37
+ })(["", " gap:", "px;max-width:", "px;padding:", "px ", "px;line-height:19px;"], surface, CHAT_SMALL_GAP, CHAT_BUBBLE_MAX_WIDTH, CHAT_BUBBLE_PADDING.vertical, CHAT_BUBBLE_PADDING.horizontal);
38
+ export const HeaderText = styled.div.withConfig({
39
+ displayName: "HeaderText",
40
+ componentId: "sc-1nj7qb8-4"
41
+ })(["font-weight:", ";"], FontWeight.BOLD);
42
+ export const Footer = styled.div.withConfig({
43
+ displayName: "Footer",
44
+ componentId: "sc-1nj7qb8-5"
45
+ })(["color:", ";font-size:", ";"], Color.LOCKED, FontSize.SMALL);
46
+ export const EmptyText = styled.div.withConfig({
47
+ displayName: "EmptyText",
48
+ componentId: "sc-1nj7qb8-6"
49
+ })(["color:", ";font-size:", ";"], Color.LOCKED, FontSize.SMALL);
50
+ /** A message with errors is drawn for context only: it is not sent. */
51
+ export const BlockedMessage = styled.div.withConfig({
52
+ displayName: "BlockedMessage",
53
+ componentId: "sc-1nj7qb8-7"
54
+ })(["display:flex;flex-direction:column;gap:", "px;align-items:flex-start;opacity:0.5;"], CHAT_GAP);
@@ -0,0 +1,134 @@
1
+ /** Chat channel a {@link ChatPreview} is drawn for. */
2
+ export type ChatChannel = 'rcs' | 'whatsapp' | 'fbmessenger' | 'line';
3
+ /** How far a channel can render the content, as computed by the rich content validator. */
4
+ export type ChatCompatibility = 'compatible' | 'partial' | 'incompatible';
5
+ /** Content types of the rich message model (`channels/sdk` `richcontent.Type`). */
6
+ export type ChatContentType = 'text' | 'media' | 'quick_reply' | 'call_to_action' | 'list_picker' | 'card' | 'carousel' | 'custom_flex';
7
+ /** Kind of an attached media file. */
8
+ export type ChatMediaKind = 'image' | 'video' | 'document' | 'audio';
9
+ /** Media file referenced by URL. */
10
+ export interface ChatMedia {
11
+ /** File address; a personalization token is allowed. */
12
+ url: string;
13
+ /** What the file is. */
14
+ kind: ChatMediaKind;
15
+ /** Poster image of a video. */
16
+ preview_url?: string;
17
+ }
18
+ /** Text or media header above the body. */
19
+ export interface ChatHeader {
20
+ /** Header text. */
21
+ text?: string;
22
+ /** Header media; wins over `text` when both are set. */
23
+ media?: ChatMedia;
24
+ }
25
+ /** What tapping a button does. */
26
+ export type ChatButtonKind = 'quick_reply' | 'url' | 'phone';
27
+ /** A button or a quick reply chip. */
28
+ export interface ChatButton {
29
+ /** Stable identifier the reply comes back with. */
30
+ id: string;
31
+ /** What tapping the button does. */
32
+ kind: ChatButtonKind;
33
+ /** Button label. */
34
+ title: string;
35
+ /** Link opened by a `url` button. */
36
+ url?: string;
37
+ /** Number dialled by a `phone` button. */
38
+ phone?: string;
39
+ }
40
+ /** One row of a list picker. */
41
+ export interface ChatListItem {
42
+ /** Stable identifier the reply comes back with. */
43
+ id: string;
44
+ /** Row title. */
45
+ title: string;
46
+ /** Secondary line under the title. */
47
+ description?: string;
48
+ }
49
+ /** A list picker: one button that opens the rows. */
50
+ export interface ChatList {
51
+ /** Label of the button that opens the list. */
52
+ button_text: string;
53
+ /** Rows of the list. */
54
+ items: ChatListItem[];
55
+ }
56
+ /** One rich card, alone or as a carousel slide. */
57
+ export interface ChatCard {
58
+ /** Card media on top. */
59
+ media?: ChatMedia;
60
+ /** Card title. */
61
+ title?: string;
62
+ /** Card text. */
63
+ body?: string;
64
+ /** Small text under the card text; RCS sends it as the card subtitle. */
65
+ footer?: string;
66
+ /** Buttons at the bottom of the card. */
67
+ buttons?: ChatButton[];
68
+ }
69
+ /** Orientation of an RCS card (`channels/sdk` `RCSOrientation*`). */
70
+ export type ChatRcsOrientation = 'VERTICAL' | 'HORIZONTAL';
71
+ /** Media height of a vertical RCS card (`channels/sdk` `RCSHeight*`). */
72
+ export type ChatRcsHeight = 'SHORT' | 'MEDIUM' | 'TALL';
73
+ /** Side of the image in a horizontal RCS card (`channels/sdk` `RCSThumbnail*`). */
74
+ export type ChatRcsThumbnailAlignment = 'LEFT' | 'RIGHT';
75
+ /** RCS-only card layout; an absent value means the Twilio default. */
76
+ export interface ChatRcsLayout {
77
+ /** Card orientation, vertical by default. */
78
+ orientation?: ChatRcsOrientation;
79
+ /** Media height of a vertical card, medium by default. */
80
+ height?: ChatRcsHeight;
81
+ /** Side of the image in a horizontal card, left by default. */
82
+ thumbnail_alignment?: ChatRcsThumbnailAlignment;
83
+ }
84
+ /** Channel-agnostic rich message — the TypeScript mirror of `channels/sdk` `richcontent.Content`. */
85
+ export interface ChatContent {
86
+ /** Content type. */
87
+ type: ChatContentType;
88
+ /** Message text. */
89
+ body?: string;
90
+ /** Header above the body. */
91
+ header?: ChatHeader;
92
+ /** Small text under the body. */
93
+ footer?: string;
94
+ /** Media of a `media` message. */
95
+ media?: ChatMedia;
96
+ /** Buttons or quick replies. */
97
+ buttons?: ChatButton[];
98
+ /** List of a `list_picker` message. */
99
+ list?: ChatList;
100
+ /** One card for `card`, the slides for `carousel`. */
101
+ cards?: ChatCard[];
102
+ /** RCS card layout. */
103
+ rcs?: ChatRcsLayout;
104
+ /** LINE Flex JSON of a `custom_flex` message; the preview only labels it, it does not lay Flex out. */
105
+ flex?: unknown;
106
+ /** Plain text sent where the channel cannot render the content. */
107
+ fallback?: string;
108
+ }
109
+ /** How bad a validator issue is (`channels/sdk` `richcontent.Severity`). */
110
+ export type ChatIssueSeverity = 'error' | 'warning' | 'fallback';
111
+ /** One finding of the rich content validator for a channel (`channels/sdk` `richcontent.Issue`). */
112
+ export interface ChatIssue {
113
+ /** Content path the issue is about, e.g. `footer` or `cards[0].title`. */
114
+ path: string;
115
+ /** Machine code, e.g. `field_dropped` or `max_length`. */
116
+ code: string;
117
+ /** How bad the issue is. */
118
+ severity: ChatIssueSeverity;
119
+ /** Extra detail from the validator. */
120
+ detail?: string;
121
+ }
122
+ /** Props of {@link ChatPreview}. */
123
+ export interface ChatPreviewProps {
124
+ /** Channel whose look is replicated. */
125
+ channel: ChatChannel;
126
+ /** Message to draw. */
127
+ content: ChatContent;
128
+ /** `partial` sends the fallback text (WhatsApp: only inside the 24h window); `incompatible` is not sent. */
129
+ status?: ChatCompatibility;
130
+ /** Validator issues of the channel; `field_dropped` fields are marked as not delivered, errors are listed. */
131
+ issues?: ChatIssue[];
132
+ /** Sender shown in the chat header. */
133
+ senderName?: string;
134
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { MessageText } from './styles';
3
+ import { WhatsAppFormattedText } from '../../../shared/whatsAppMarkup';
3
4
  import { drawableAttachments } from '../../helpers';
4
5
  import { WhatsAppAttachment } from '../WhatsAppAttachment';
5
- import { WhatsAppFormattedText } from '../WhatsAppFormattedText';
6
6
  /** Card body: attachments on top, message text underneath. */
7
7
  export function WhatsAppMessageContent(props) {
8
8
  const {
@@ -1,7 +1,4 @@
1
- import type { WhatsAppTextNode } from './components/WhatsAppFormattedText/types';
2
1
  import type { WhatsAppAttachment, WhatsAppAttachmentKind, WhatsAppMessage } from './types';
3
- /** Splits WhatsApp markup (`*bold*`, `_italic_`, `~strike~`, backtick monospace) into a render tree. */
4
- export declare function parseWhatsAppMarkup(text: string): WhatsAppTextNode[];
5
2
  /** File type shown on a document card: the name extension, or the MIME subtype when the name carries none. */
6
3
  export declare function getAttachmentExtension(attachment: WhatsAppAttachment): string;
7
4
  /** Picks how the attachment is drawn: explicit `kind` first, then the MIME type, then the extension. */
@@ -1,60 +1,4 @@
1
1
  import { WHATSAPP_ATTACHMENT_EXTENSIONS } from './constants';
2
- const MARKERS = [{
3
- style: 'mono',
4
- marker: '```'
5
- }, {
6
- style: 'mono',
7
- marker: '`'
8
- }, {
9
- style: 'bold',
10
- marker: '*'
11
- }, {
12
- style: 'italic',
13
- marker: '_'
14
- }, {
15
- style: 'strike',
16
- marker: '~'
17
- }];
18
- function findMarkerAt(text, index) {
19
- return MARKERS.find(({
20
- marker
21
- }) => text.startsWith(marker, index)) || null;
22
- }
23
- /** Splits WhatsApp markup (`*bold*`, `_italic_`, `~strike~`, backtick monospace) into a render tree. */
24
- export function parseWhatsAppMarkup(text) {
25
- const nodes = [];
26
- let plain = '';
27
- let index = 0;
28
- const flush = () => {
29
- if (plain) {
30
- nodes.push({
31
- text: plain
32
- });
33
- plain = '';
34
- }
35
- };
36
- while (index < text.length) {
37
- const found = findMarkerAt(text, index);
38
- const openEnd = found ? index + found.marker.length : index;
39
- const closeStart = found ? text.indexOf(found.marker, openEnd) : -1;
40
- if (!found || closeStart <= openEnd) {
41
- plain += text[index];
42
- index += 1;
43
- continue;
44
- }
45
- const inner = text.slice(openEnd, closeStart);
46
- flush();
47
- nodes.push({
48
- style: found.style,
49
- children: found.style === 'mono' ? [{
50
- text: inner
51
- }] : parseWhatsAppMarkup(inner)
52
- });
53
- index = closeStart + found.marker.length;
54
- }
55
- flush();
56
- return nodes;
57
- }
58
2
  /** File type shown on a document card: the name extension, or the MIME subtype when the name carries none. */
59
3
  export function getAttachmentExtension(attachment) {
60
4
  const {
package/index.d.ts CHANGED
@@ -37,6 +37,8 @@ export { PushStoriesPreview, hasStoryButton, normalizeStoryDuration, PUSH_STORIE
37
37
  export { InboxPreview, resolveInboxLayout, MAX_CAROUSEL_SLIDES, type InboxLayoutType, type InboxPreviewPlatform, type InboxPreviewContent, type InboxPreviewProps, type InboxPreviewSlide, } from './InboxPreview';
38
38
  export { WhatsAppPreview } from './WhatsAppPreview';
39
39
  export type { WhatsAppAttachment, WhatsAppAttachmentKind, WhatsAppMessage, WhatsAppPreviewProps, } from './WhatsAppPreview';
40
+ export { ChatPreview } from './ChatPreview';
41
+ export type { ChatButton, ChatButtonKind, ChatCard, ChatChannel, ChatCompatibility, ChatContent, ChatContentType, ChatHeader, ChatList, ChatListItem, ChatMedia, ChatMediaKind, ChatPreviewProps, ChatRcsLayout, } from './ChatPreview';
40
42
  export { Toast, ToastProvider, useToast } from './Toast';
41
43
  export { AutosizeInput, PageHeader, PageHeaderEditable, Rename, } from './PageHeader';
42
44
  export { Steps, useSteps } from './Steps';
package/index.js CHANGED
@@ -36,6 +36,7 @@ export { PushPreview } from './PushPreview';
36
36
  export { PushStoriesPreview, hasStoryButton, normalizeStoryDuration, PUSH_STORIES_ASPECT_RATIO, PUSH_STORIES_DEFAULT_DURATION, PUSH_STORIES_MAX_DURATION } from './PushStoriesPreview';
37
37
  export { InboxPreview, resolveInboxLayout, MAX_CAROUSEL_SLIDES } from './InboxPreview';
38
38
  export { WhatsAppPreview } from './WhatsAppPreview';
39
+ export { ChatPreview } from './ChatPreview';
39
40
  export { Toast, ToastProvider, useToast } from './Toast';
40
41
  export { AutosizeInput, PageHeader, PageHeaderEditable, Rename } from './PageHeader';
41
42
  export { Steps, useSteps } from './Steps';