@capillarytech/creatives-library 8.0.353-alpha.4 → 8.0.353-alpha.6
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/constants/unified.js +29 -0
- package/package.json +1 -1
- package/services/tests/api.test.js +35 -20
- package/utils/commonUtils.js +19 -1
- package/utils/rcsPayloadUtils.js +92 -0
- package/utils/templateVarUtils.js +201 -0
- package/utils/tests/rcsPayloadUtils.test.js +226 -0
- package/utils/tests/templateVarUtils.test.js +204 -0
- package/v2Components/CapActionButton/constants.js +7 -0
- package/v2Components/CapActionButton/index.js +166 -108
- package/v2Components/CapActionButton/index.scss +157 -6
- package/v2Components/CapActionButton/messages.js +19 -3
- package/v2Components/CapActionButton/tests/index.test.js +41 -17
- package/v2Components/CapTagList/index.js +10 -0
- package/v2Components/CommonTestAndPreview/CustomValuesEditor.js +72 -49
- package/v2Components/CommonTestAndPreview/DeliverySettings/DeliverySettings.scss +8 -2
- package/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.js +213 -21
- package/v2Components/CommonTestAndPreview/DeliverySettings/constants.js +16 -0
- package/v2Components/CommonTestAndPreview/DeliverySettings/index.js +85 -10
- package/v2Components/CommonTestAndPreview/DeliverySettings/messages.js +30 -0
- package/v2Components/CommonTestAndPreview/DeliverySettings/utils/parseSenderDetailsResponse.js +79 -11
- package/v2Components/CommonTestAndPreview/SendTestMessage.js +10 -5
- package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js +157 -15
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +346 -76
- package/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +133 -4
- package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +11 -0
- package/v2Components/CommonTestAndPreview/constants.js +38 -2
- package/v2Components/CommonTestAndPreview/index.js +691 -186
- package/v2Components/CommonTestAndPreview/messages.js +45 -3
- package/v2Components/CommonTestAndPreview/previewApiUtils.js +59 -0
- package/v2Components/CommonTestAndPreview/sagas.js +25 -6
- package/v2Components/CommonTestAndPreview/tests/CustomValuesEditor.test.js +308 -284
- package/v2Components/CommonTestAndPreview/tests/DeliverySettings/ModifyDeliverySettings.test.js +231 -65
- package/v2Components/CommonTestAndPreview/tests/DeliverySettings/index.test.js +118 -5
- package/v2Components/CommonTestAndPreview/tests/DeliverySettings/utils/parseSenderDetailsResponse.test.js +341 -0
- package/v2Components/CommonTestAndPreview/tests/PreviewSection.test.js +8 -1
- package/v2Components/CommonTestAndPreview/tests/SendTestMessage.test.js +34 -13
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/RcsPreviewContent.test.js +281 -283
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/index.test.js +199 -1
- package/v2Components/CommonTestAndPreview/tests/index.test.js +132 -4
- package/v2Components/CommonTestAndPreview/tests/previewApiUtils.test.js +67 -0
- package/v2Components/CommonTestAndPreview/tests/sagas.test.js +36 -26
- package/v2Components/FormBuilder/index.js +74 -166
- package/v2Components/SmsFallback/SmsFallbackLocalSelector.js +91 -0
- package/v2Components/SmsFallback/constants.js +73 -0
- package/v2Components/SmsFallback/index.js +956 -0
- package/v2Components/SmsFallback/index.scss +265 -0
- package/v2Components/SmsFallback/messages.js +78 -0
- package/v2Components/SmsFallback/smsFallbackUtils.js +119 -0
- package/v2Components/SmsFallback/tests/SmsFallbackLocalSelector.test.js +50 -0
- package/v2Components/SmsFallback/tests/rcsSmsFallback.acceptance.test.js +147 -0
- package/v2Components/SmsFallback/tests/smsFallbackHandlers.test.js +304 -0
- package/v2Components/SmsFallback/tests/smsFallbackUi.test.js +223 -0
- package/v2Components/SmsFallback/tests/smsFallbackUtils.test.js +309 -0
- package/v2Components/SmsFallback/tests/useLocalTemplateList.test.js +422 -0
- package/v2Components/SmsFallback/useLocalTemplateList.js +92 -0
- package/v2Components/TemplatePreview/_templatePreview.scss +38 -23
- package/v2Components/TemplatePreview/constants.js +2 -0
- package/v2Components/TemplatePreview/index.js +143 -31
- package/v2Components/TemplatePreview/tests/index.test.js +142 -0
- package/v2Components/TestAndPreviewSlidebox/index.js +13 -1
- package/v2Components/TestAndPreviewSlidebox/sagas.js +11 -4
- package/v2Components/TestAndPreviewSlidebox/tests/saga.test.js +3 -1
- package/v2Components/VarSegmentMessageEditor/constants.js +2 -0
- package/v2Components/VarSegmentMessageEditor/index.js +125 -0
- package/v2Components/VarSegmentMessageEditor/index.scss +46 -0
- package/v2Containers/CreativesContainer/CreativesSlideBoxWrapper.js +43 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +36 -4
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +10 -1
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +29 -4
- package/v2Containers/CreativesContainer/constants.js +9 -0
- package/v2Containers/CreativesContainer/embeddedSlideboxUtils.js +79 -0
- package/v2Containers/CreativesContainer/index.js +346 -163
- package/v2Containers/CreativesContainer/index.scss +51 -1
- package/v2Containers/CreativesContainer/tests/SlideBoxContent.localTemplates.test.js +90 -0
- package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +78 -34
- package/v2Containers/CreativesContainer/tests/SlideBoxHeader.test.js +79 -16
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +8 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +357 -98
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +20 -15
- package/v2Containers/CreativesContainer/tests/embeddedSlideboxUtils.test.js +258 -0
- package/v2Containers/CreativesContainer/tests/index.test.js +71 -9
- package/v2Containers/CreativesContainer/tests/useLocalTemplatesProp.test.js +125 -0
- package/v2Containers/Email/index.js +1 -1
- package/v2Containers/MobilePush/Create/test/saga.test.js +2 -2
- package/v2Containers/Rcs/constants.js +119 -10
- package/v2Containers/Rcs/index.js +2445 -813
- package/v2Containers/Rcs/index.scss +280 -8
- package/v2Containers/Rcs/messages.js +34 -3
- package/v2Containers/Rcs/rcsLibraryHydrationUtils.js +225 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +98018 -70073
- package/v2Containers/Rcs/tests/__snapshots__/utils.test.js.snap +0 -5
- package/v2Containers/Rcs/tests/index.test.js +152 -121
- package/v2Containers/Rcs/tests/mockData.js +38 -0
- package/v2Containers/Rcs/tests/rcsLibraryHydrationUtils.test.js +318 -0
- package/v2Containers/Rcs/tests/utils.test.js +646 -30
- package/v2Containers/Rcs/utils.js +478 -11
- package/v2Containers/Sms/Create/index.js +106 -40
- package/v2Containers/Sms/smsFormDataHelpers.js +67 -0
- package/v2Containers/Sms/tests/smsFormDataHelpers.test.js +253 -0
- package/v2Containers/SmsTrai/Create/index.js +9 -4
- package/v2Containers/SmsTrai/Edit/constants.js +2 -0
- package/v2Containers/SmsTrai/Edit/index.js +640 -130
- package/v2Containers/SmsTrai/Edit/index.scss +121 -0
- package/v2Containers/SmsTrai/Edit/messages.js +14 -4
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +4328 -2375
- package/v2Containers/SmsWrapper/index.js +37 -8
- package/v2Containers/TagList/index.js +6 -0
- package/v2Containers/Templates/TemplatesActionBar.js +101 -0
- package/v2Containers/Templates/_templates.scss +166 -9
- package/v2Containers/Templates/actions.js +11 -0
- package/v2Containers/Templates/constants.js +2 -0
- package/v2Containers/Templates/index.js +120 -52
- package/v2Containers/Templates/sagas.js +56 -12
- package/v2Containers/Templates/tests/TemplatesActionBar.test.js +120 -0
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +1062 -1017
- package/v2Containers/Templates/tests/sagas.test.js +199 -16
- package/v2Containers/Templates/tests/smsTemplatesListApi.test.js +180 -0
- package/v2Containers/Templates/utils/smsTemplatesListApi.js +79 -0
- package/v2Containers/TemplatesV2/TemplatesV2.style.js +72 -1
- package/v2Containers/TemplatesV2/index.js +86 -23
- package/v2Containers/TemplatesV2/tests/TemplatesV2.localTemplates.test.js +131 -0
- package/v2Containers/WeChat/MapTemplates/test/saga.test.js +9 -9
- package/v2Containers/Whatsapp/index.js +3 -20
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +578 -34
|
@@ -34,18 +34,32 @@ export const RCS_STATUSES = {
|
|
|
34
34
|
awaitingApproval: 'awaitingApproval',
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
export const HOST_ICS="rcsicsbulk";
|
|
38
|
+
export const HOST_INFOBIP="rcsinfobipbulk";
|
|
39
|
+
|
|
37
40
|
export const contentType = {
|
|
38
41
|
text_message: 'text_message',
|
|
39
42
|
rich_card: 'rich_card',
|
|
40
43
|
carousel: 'carousel',
|
|
41
44
|
};
|
|
42
45
|
|
|
46
|
+
export const CHANNELS = [
|
|
47
|
+
'email',
|
|
48
|
+
'mPush',
|
|
49
|
+
'viber',
|
|
50
|
+
'whatsapp',
|
|
51
|
+
'zalo',
|
|
52
|
+
'facebook',
|
|
53
|
+
'rcs',
|
|
54
|
+
'inApp',
|
|
55
|
+
'line',
|
|
56
|
+
'weChat',
|
|
57
|
+
'callTask',
|
|
58
|
+
'FTP',
|
|
59
|
+
'webpush',
|
|
60
|
+
];
|
|
61
|
+
|
|
43
62
|
export const STATUS_OPTIONS = [
|
|
44
|
-
// {
|
|
45
|
-
// key: 'created',
|
|
46
|
-
// value: RCS_STATUSES.awaitingApproval,
|
|
47
|
-
// label: <FormattedMessage {...messages.created} />,
|
|
48
|
-
// },
|
|
49
63
|
{
|
|
50
64
|
key: 'approved',
|
|
51
65
|
value: RCS_STATUSES.approved,
|
|
@@ -74,10 +88,31 @@ export const RCS_MEDIA_TYPES = {
|
|
|
74
88
|
VIDEO: 'VIDEO',
|
|
75
89
|
};
|
|
76
90
|
|
|
77
|
-
|
|
78
|
-
export const
|
|
91
|
+
/** Match `{{…}}` placeholders including Liquid-style names (e.g. `tag.FORMAT_1`). Must align with split + `isAnyTemplateVarToken` / SMS fallback. */
|
|
92
|
+
export const rcsVarRegex = /\{\{[^}]+\}\}/g;
|
|
93
|
+
/** True when the whole string is a single RCS/mustache token (used when testing segment tokens). */
|
|
94
|
+
export const rcsVarTestRegex = /^\{\{[^}]+\}\}$/;
|
|
95
|
+
|
|
96
|
+
/** Matches all `{{N}}` numeric-index variable tokens in a template string (global). */
|
|
97
|
+
export const RCS_NUMERIC_VAR_TOKEN_REGEX = /\{\{(\d+)\}\}/g;
|
|
98
|
+
/** `cardVarMapped` slot keys that are numeric only (legacy ordering). */
|
|
99
|
+
export const RCS_NUMERIC_VAR_NAME_REGEX = /^\d+$/;
|
|
100
|
+
/** Semantic Liquid-style keys on RCS `cardVarMapped` (same class as `{{…}}` inner names in the editor). */
|
|
101
|
+
export const RCS_CARD_VAR_MAPPED_SEMANTIC_KEY_REGEX = /^[\w.]+$/;
|
|
102
|
+
/** Escape `RegExp` metacharacters when building a pattern from user/tag text. */
|
|
103
|
+
export const RCS_REGEX_META_CHARS_PATTERN = /[.*+?^${}()|[\]\\]/g;
|
|
104
|
+
/** Entire string is a single `{{tag}}` token (value still a placeholder). */
|
|
105
|
+
export const RCS_SINGLE_MUSTACHE_PLACEHOLDER_REGEX = /^\{\{[^}]+\}\}$/;
|
|
106
|
+
/** Strip leading `{{` and trailing `}}` from a token. */
|
|
107
|
+
export const RCS_STRIP_MUSTACHE_DELIMITERS_REGEX = /^\{\{|\}\}$/g;
|
|
108
|
+
|
|
109
|
+
/** Tag-popover target: title vs description field (matches `onTagSelect` `field` argument). */
|
|
110
|
+
export const RCS_TAG_AREA_FIELD_TITLE = 'title';
|
|
111
|
+
export const RCS_TAG_AREA_FIELD_DESC = 'desc';
|
|
112
|
+
|
|
79
113
|
export const TEMPLATE_DESC_MAX_LENGTH = 2500;
|
|
80
|
-
|
|
114
|
+
/** Resolved SMS fallback body cap. Must allow multi-segment DLT (>160); aligns with TRAI / `TEMPLATE_MESSAGE_MAX_LENGTH`. */
|
|
115
|
+
export const FALLBACK_MESSAGE_MAX_LENGTH = TEMPLATE_MESSAGE_MAX_LENGTH;
|
|
81
116
|
export const TEMPLATE_TITLE_MAX_LENGTH = 200;
|
|
82
117
|
export const TEMPLATE_BUTTON_TEXT_MAX_LENGTH = 25;
|
|
83
118
|
export const CTA = 'CTA';
|
|
@@ -92,10 +127,12 @@ export const ALLOWED_IMAGE_EXTENSIONS_REGEX = (/\.(png|jpg|jpeg|gif)$/i);
|
|
|
92
127
|
export const RCS_IMG_WIDTH = 1440;
|
|
93
128
|
export const RCS_IMG_HEIGHT = 1024;
|
|
94
129
|
export const RCS_IMG_SIZE = 2000000; // 2MB
|
|
130
|
+
export const RCS_CAROUSEL_IMG_SIZE = 1 * 1024 * 1024; // 1MB
|
|
95
131
|
export const MAX_FILE_SIZE_MB = 10;
|
|
96
132
|
export const MAX_FILE_SIZE_BYTES = MAX_FILE_SIZE_MB * 1024 * 1024;
|
|
97
133
|
export const ALLOWED_EXTENSIONS_VIDEO_REGEX = (/\.(mp4)$/i);
|
|
98
134
|
export const RCS_VIDEO_SIZE = 10 * 1024 * 1024;
|
|
135
|
+
export const RCS_CAROUSEL_VIDEO_SIZE = 5 * 1024 * 1024; // 5MB
|
|
99
136
|
export const RCS_THUMBNAIL_MIN_SIZE = 40 * 1024;
|
|
100
137
|
export const RCS_THUMBNAIL_MAX_SIZE = 100 * 1024;
|
|
101
138
|
|
|
@@ -142,13 +179,38 @@ export const RCS_IMAGE_DIMENSIONS = {
|
|
|
142
179
|
},
|
|
143
180
|
};
|
|
144
181
|
|
|
182
|
+
// Carousel image dimensions (pixel values shown in UI). Keys follow `${HEIGHT}_${WIDTH}`.
|
|
183
|
+
// HEIGHT: SHORT|MEDIUM, WIDTH: SMALL|MEDIUM
|
|
184
|
+
export const RCS_CAROUSEL_IMAGE_DIMENSIONS = {
|
|
185
|
+
SHORT_SMALL: {
|
|
186
|
+
width: 1160,
|
|
187
|
+
height: 720,
|
|
188
|
+
description: 'Image (1160 x 720)',
|
|
189
|
+
},
|
|
190
|
+
SHORT_MEDIUM: {
|
|
191
|
+
width: 1800,
|
|
192
|
+
height: 720,
|
|
193
|
+
description: 'Image (1800 x 720)',
|
|
194
|
+
},
|
|
195
|
+
MEDIUM_SMALL: {
|
|
196
|
+
width: 770,
|
|
197
|
+
height: 720,
|
|
198
|
+
description: 'Image (770 x 720)',
|
|
199
|
+
},
|
|
200
|
+
MEDIUM_MEDIUM: {
|
|
201
|
+
width: 1280,
|
|
202
|
+
height: 720,
|
|
203
|
+
description: 'Image (1280 x 720)',
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
|
|
145
207
|
export const RCS_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
146
208
|
SHORT_HEIGHT: {
|
|
147
|
-
width: 770,
|
|
148
|
-
height: 257,
|
|
149
209
|
type: 'SHORT_HEIGHT',
|
|
150
210
|
heightType: 'SHORT',
|
|
151
211
|
label: 'Vertical Short',
|
|
212
|
+
width: 1140,
|
|
213
|
+
height: 448,
|
|
152
214
|
description: 'Thumbnail (770 x 257)',
|
|
153
215
|
orientation: 'VERTICAL',
|
|
154
216
|
maxFileSize: 100 * 1024,
|
|
@@ -189,6 +251,29 @@ export const RCS_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
|
189
251
|
},
|
|
190
252
|
};
|
|
191
253
|
|
|
254
|
+
// Carousel thumbnail dimensions for video cards (pixel values shown in UI).
|
|
255
|
+
// Keys follow `${HEIGHT}_${WIDTH}`.
|
|
256
|
+
// Human-readable labels: formatMessage(messages.rcsCarouselVideoThumbnailLabel, { width, height })
|
|
257
|
+
// or formatRcsCarouselVideoThumbnailLabel(formatMessage, entry) from ./utils.
|
|
258
|
+
export const RCS_CAROUSEL_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
259
|
+
SHORT_SMALL: {
|
|
260
|
+
width: 718,
|
|
261
|
+
height: 448,
|
|
262
|
+
},
|
|
263
|
+
SHORT_MEDIUM: {
|
|
264
|
+
width: 1140,
|
|
265
|
+
height: 448,
|
|
266
|
+
},
|
|
267
|
+
MEDIUM_SMALL: {
|
|
268
|
+
width: 480,
|
|
269
|
+
height: 448,
|
|
270
|
+
},
|
|
271
|
+
MEDIUM_MEDIUM: {
|
|
272
|
+
width: 796,
|
|
273
|
+
height: 448,
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
|
|
192
277
|
const prefix = 'app/v2Containers/Rcs';
|
|
193
278
|
export const UPLOAD_RCS_ASSET_REQUEST = `${prefix}/UPLOAD_RCS_ASSET_REQUEST`;
|
|
194
279
|
export const UPLOAD_RCS_ASSET_SUCCESS = `${prefix}/UPLOAD_RCS_ASSET_SUCCESS`;
|
|
@@ -215,6 +300,7 @@ export const CLEAR_EDIT_RESPONSE_REQUEST = `${prefix}/Edit/CLEAR_EDIT_RESPONSE_R
|
|
|
215
300
|
export const AI_CONTENT_BOT_DISABLED = "AI_CONTENT_BOT_DISABLED";
|
|
216
301
|
|
|
217
302
|
export const RCS_TEXT_MESSAGE_MAX_LENGTH = 160;
|
|
303
|
+
export const RCS_TEXT_MESSAGE_MAX_LENGTH_INFOBIP = 3072;
|
|
218
304
|
export const RCS_RICH_CARD_MAX_LENGTH = 2000;
|
|
219
305
|
export const MAX_BUTTONS = 4;
|
|
220
306
|
|
|
@@ -250,3 +336,26 @@ export const RCS_BUTTON_TYPES = {
|
|
|
250
336
|
PHONE_NUMBER: 'PHONE_NUMBER',
|
|
251
337
|
CTA: 'CTA',
|
|
252
338
|
};
|
|
339
|
+
|
|
340
|
+
/** Default action row for carousel card 1 (mandatory button UX): phone CTA, unsaved until user completes + Save. */
|
|
341
|
+
export const RCS_CAROUSEL_FIRST_CARD_DEFAULT_SUGGESTIONS = [
|
|
342
|
+
{
|
|
343
|
+
index: 0,
|
|
344
|
+
type: RCS_BUTTON_TYPES.PHONE_NUMBER,
|
|
345
|
+
text: '',
|
|
346
|
+
phoneNumber: '',
|
|
347
|
+
url: null,
|
|
348
|
+
postback: '',
|
|
349
|
+
isSaved: false,
|
|
350
|
+
},
|
|
351
|
+
];
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
export const CAROUSEL_HEIGHT_OPTIONS = [
|
|
355
|
+
{ value: 'SHORT', label: 'Short' },
|
|
356
|
+
{ value: 'MEDIUM', label: 'Medium' },
|
|
357
|
+
];
|
|
358
|
+
export const CAROUSEL_WIDTH_OPTIONS = [
|
|
359
|
+
{ value: 'SMALL', label: 'Small' },
|
|
360
|
+
{ value: 'MEDIUM', label: 'Medium' },
|
|
361
|
+
];
|