@capillarytech/creatives-library 8.0.329 → 8.0.330-alpha.1
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 +4 -0
- package/package.json +1 -1
- package/utils/commonUtils.js +19 -1
- package/utils/templateVarUtils.js +35 -6
- package/utils/tests/tagValidations.test.js +20 -0
- package/utils/tests/templateVarUtils.test.js +44 -0
- package/v2Components/CapActionButton/constants.js +7 -0
- package/v2Components/CapActionButton/index.js +167 -109
- 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 +28 -23
- package/v2Components/CapTagList/style.scss +29 -0
- package/v2Components/CapTagListWithInput/__tests__/CapTagListWithInput.test.js +63 -0
- package/v2Components/CapTagListWithInput/index.js +4 -0
- package/v2Components/CapWhatsappCTA/index.js +2 -0
- package/v2Components/CommonTestAndPreview/ExistingCustomerModal.js +1 -0
- package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js +160 -15
- package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js.rej +18 -0
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +323 -77
- package/v2Components/CommonTestAndPreview/index.js +49 -57
- package/v2Components/CommonTestAndPreview/messages.js +8 -0
- package/v2Components/CommonTestAndPreview/reducer.js +3 -1
- package/v2Components/CommonTestAndPreview/sagas.js +2 -1
- package/v2Components/CommonTestAndPreview/tests/PreviewSection.test.js +8 -1
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/RcsPreviewContent.test.js +281 -283
- package/v2Components/FormBuilder/index.js +1 -0
- package/v2Components/HtmlEditor/HTMLEditor.js +6 -1
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +1 -0
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +927 -2
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +3 -0
- package/v2Components/SmsFallback/smsFallbackUtils.js +14 -3
- package/v2Components/SmsFallback/tests/smsFallbackUtils.test.js +16 -0
- package/v2Components/TemplatePreview/_templatePreview.scss +33 -23
- package/v2Components/TemplatePreview/constants.js +2 -0
- package/v2Components/TemplatePreview/index.js +143 -28
- package/v2Components/TemplatePreview/tests/index.test.js +142 -0
- package/v2Components/TestAndPreviewSlidebox/index.js +5 -0
- package/v2Components/mockdata.js +1 -0
- package/v2Containers/BeeEditor/index.js +19 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +28 -1
- package/v2Containers/CreativesContainer/index.js +9 -3
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +5 -0
- package/v2Containers/Email/index.js +78 -39
- package/v2Containers/Email/reducer.js +2 -2
- package/v2Containers/Email/sagas.js +3 -1
- package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +2 -2
- package/v2Containers/Email/tests/sagas.test.js +230 -0
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +6 -1
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +3 -0
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +20 -2
- package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +16 -1
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +3 -1
- package/v2Containers/EmailWrapper/index.js +4 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +1 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +9 -0
- package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +1 -0
- package/v2Containers/MobilePush/Create/index.js +2 -0
- package/v2Containers/MobilePush/Edit/index.js +2 -0
- package/v2Containers/MobilepushWrapper/index.js +3 -1
- package/v2Containers/Rcs/constants.js +85 -7
- package/v2Containers/Rcs/index.js +1592 -156
- package/v2Containers/Rcs/index.js.rej +1336 -0
- package/v2Containers/Rcs/index.scss +191 -0
- package/v2Containers/Rcs/index.scss.rej +74 -0
- package/v2Containers/Rcs/messages.js +28 -2
- package/v2Containers/Rcs/rcsLibraryHydrationUtils.js +20 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +69178 -117691
- package/v2Containers/Rcs/tests/__snapshots__/utils.test.js.snap.rej +128 -0
- package/v2Containers/Rcs/tests/index.test.js +132 -94
- package/v2Containers/Rcs/tests/rcsLibraryHydrationUtils.test.js +67 -0
- package/v2Containers/Rcs/tests/utils.test.js +276 -38
- package/v2Containers/Rcs/utils.js +130 -7
- package/v2Containers/Sms/Edit/index.js +2 -0
- package/v2Containers/SmsTrai/Edit/index.js +27 -0
- package/v2Containers/SmsTrai/Edit/messages.js +5 -0
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +6 -6
- package/v2Containers/SmsWrapper/index.js +2 -0
- package/v2Containers/TagList/index.js +73 -20
- package/v2Containers/TagList/messages.js +4 -0
- package/v2Containers/TagList/tests/TagList.test.js +124 -20
- package/v2Containers/TagList/tests/mockdata.js +17 -0
- package/v2Containers/Templates/_templates.scss +99 -0
- package/v2Containers/Templates/index.js +29 -14
- package/v2Containers/Viber/index.js +3 -0
- package/v2Containers/WebPush/Create/hooks/useTagManagement.js +0 -2
- package/v2Containers/WebPush/Create/index.js +10 -2
- package/v2Containers/Whatsapp/index.js +5 -0
- package/v2Containers/Zalo/index.js +2 -0
|
@@ -34,6 +34,9 @@ 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',
|
|
@@ -57,11 +60,6 @@ export const CHANNELS = [
|
|
|
57
60
|
];
|
|
58
61
|
|
|
59
62
|
export const STATUS_OPTIONS = [
|
|
60
|
-
// {
|
|
61
|
-
// key: 'created',
|
|
62
|
-
// value: RCS_STATUSES.awaitingApproval,
|
|
63
|
-
// label: <FormattedMessage {...messages.created} />,
|
|
64
|
-
// },
|
|
65
63
|
{
|
|
66
64
|
key: 'approved',
|
|
67
65
|
value: RCS_STATUSES.approved,
|
|
@@ -90,13 +88,17 @@ export const RCS_MEDIA_TYPES = {
|
|
|
90
88
|
VIDEO: 'VIDEO',
|
|
91
89
|
};
|
|
92
90
|
|
|
93
|
-
|
|
94
|
-
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
95
|
|
|
96
96
|
/** Matches all `{{N}}` numeric-index variable tokens in a template string (global). */
|
|
97
97
|
export const RCS_NUMERIC_VAR_TOKEN_REGEX = /\{\{(\d+)\}\}/g;
|
|
98
98
|
/** `cardVarMapped` slot keys that are numeric only (legacy ordering). */
|
|
99
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.]+$/;
|
|
100
102
|
/** Escape `RegExp` metacharacters when building a pattern from user/tag text. */
|
|
101
103
|
export const RCS_REGEX_META_CHARS_PATTERN = /[.*+?^${}()|[\]\\]/g;
|
|
102
104
|
/** Entire string is a single `{{tag}}` token (value still a placeholder). */
|
|
@@ -125,10 +127,12 @@ export const ALLOWED_IMAGE_EXTENSIONS_REGEX = (/\.(png|jpg|jpeg|gif)$/i);
|
|
|
125
127
|
export const RCS_IMG_WIDTH = 1440;
|
|
126
128
|
export const RCS_IMG_HEIGHT = 1024;
|
|
127
129
|
export const RCS_IMG_SIZE = 2000000; // 2MB
|
|
130
|
+
export const RCS_CAROUSEL_IMG_SIZE = 1 * 1024 * 1024; // 1MB
|
|
128
131
|
export const MAX_FILE_SIZE_MB = 10;
|
|
129
132
|
export const MAX_FILE_SIZE_BYTES = MAX_FILE_SIZE_MB * 1024 * 1024;
|
|
130
133
|
export const ALLOWED_EXTENSIONS_VIDEO_REGEX = (/\.(mp4)$/i);
|
|
131
134
|
export const RCS_VIDEO_SIZE = 10 * 1024 * 1024;
|
|
135
|
+
export const RCS_CAROUSEL_VIDEO_SIZE = 5 * 1024 * 1024; // 5MB
|
|
132
136
|
export const RCS_THUMBNAIL_MIN_SIZE = 40 * 1024;
|
|
133
137
|
export const RCS_THUMBNAIL_MAX_SIZE = 100 * 1024;
|
|
134
138
|
|
|
@@ -175,6 +179,31 @@ export const RCS_IMAGE_DIMENSIONS = {
|
|
|
175
179
|
},
|
|
176
180
|
};
|
|
177
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
|
+
|
|
178
207
|
export const RCS_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
179
208
|
SHORT_HEIGHT: {
|
|
180
209
|
width: 770,
|
|
@@ -182,6 +211,8 @@ export const RCS_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
|
182
211
|
type: 'SHORT_HEIGHT',
|
|
183
212
|
heightType: 'SHORT',
|
|
184
213
|
label: 'Vertical Short',
|
|
214
|
+
width: 1140,
|
|
215
|
+
height: 448,
|
|
185
216
|
description: 'Thumbnail (770 x 257)',
|
|
186
217
|
orientation: 'VERTICAL',
|
|
187
218
|
maxFileSize: 100 * 1024,
|
|
@@ -222,6 +253,29 @@ export const RCS_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
|
222
253
|
},
|
|
223
254
|
};
|
|
224
255
|
|
|
256
|
+
// Carousel thumbnail dimensions for video cards (pixel values shown in UI).
|
|
257
|
+
// Keys follow `${HEIGHT}_${WIDTH}`.
|
|
258
|
+
// Human-readable labels: formatMessage(messages.rcsCarouselVideoThumbnailLabel, { width, height })
|
|
259
|
+
// or formatRcsCarouselVideoThumbnailLabel(formatMessage, entry) from ./utils.
|
|
260
|
+
export const RCS_CAROUSEL_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
261
|
+
SHORT_SMALL: {
|
|
262
|
+
width: 718,
|
|
263
|
+
height: 448,
|
|
264
|
+
},
|
|
265
|
+
SHORT_MEDIUM: {
|
|
266
|
+
width: 1140,
|
|
267
|
+
height: 448,
|
|
268
|
+
},
|
|
269
|
+
MEDIUM_SMALL: {
|
|
270
|
+
width: 480,
|
|
271
|
+
height: 448,
|
|
272
|
+
},
|
|
273
|
+
MEDIUM_MEDIUM: {
|
|
274
|
+
width: 796,
|
|
275
|
+
height: 448,
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
|
|
225
279
|
const prefix = 'app/v2Containers/Rcs';
|
|
226
280
|
export const UPLOAD_RCS_ASSET_REQUEST = `${prefix}/UPLOAD_RCS_ASSET_REQUEST`;
|
|
227
281
|
export const UPLOAD_RCS_ASSET_SUCCESS = `${prefix}/UPLOAD_RCS_ASSET_SUCCESS`;
|
|
@@ -248,6 +302,7 @@ export const CLEAR_EDIT_RESPONSE_REQUEST = `${prefix}/Edit/CLEAR_EDIT_RESPONSE_R
|
|
|
248
302
|
export const AI_CONTENT_BOT_DISABLED = "AI_CONTENT_BOT_DISABLED";
|
|
249
303
|
|
|
250
304
|
export const RCS_TEXT_MESSAGE_MAX_LENGTH = 160;
|
|
305
|
+
export const RCS_TEXT_MESSAGE_MAX_LENGTH_INFOBIP = 3072;
|
|
251
306
|
export const RCS_RICH_CARD_MAX_LENGTH = 2000;
|
|
252
307
|
export const MAX_BUTTONS = 4;
|
|
253
308
|
|
|
@@ -283,3 +338,26 @@ export const RCS_BUTTON_TYPES = {
|
|
|
283
338
|
PHONE_NUMBER: 'PHONE_NUMBER',
|
|
284
339
|
CTA: 'CTA',
|
|
285
340
|
};
|
|
341
|
+
|
|
342
|
+
/** Default action row for carousel card 1 (mandatory button UX): phone CTA, unsaved until user completes + Save. */
|
|
343
|
+
export const RCS_CAROUSEL_FIRST_CARD_DEFAULT_SUGGESTIONS = [
|
|
344
|
+
{
|
|
345
|
+
index: 0,
|
|
346
|
+
type: RCS_BUTTON_TYPES.PHONE_NUMBER,
|
|
347
|
+
text: '',
|
|
348
|
+
phoneNumber: '',
|
|
349
|
+
url: null,
|
|
350
|
+
postback: '',
|
|
351
|
+
isSaved: false,
|
|
352
|
+
},
|
|
353
|
+
];
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
export const CAROUSEL_HEIGHT_OPTIONS = [
|
|
357
|
+
{ value: 'SHORT', label: 'Short' },
|
|
358
|
+
{ value: 'MEDIUM', label: 'Medium' },
|
|
359
|
+
];
|
|
360
|
+
export const CAROUSEL_WIDTH_OPTIONS = [
|
|
361
|
+
{ value: 'SMALL', label: 'Small' },
|
|
362
|
+
{ value: 'MEDIUM', label: 'Medium' },
|
|
363
|
+
];
|