@capillarytech/creatives-library 8.0.345-alpha.14 → 8.0.345-alpha.15
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 +13 -0
- package/utils/commonUtils.js +19 -1
- package/utils/rcsPayloadUtils.js +92 -0
- package/utils/templateVarUtils.js +201 -0
- package/utils/tests/templateVarUtils.test.js +204 -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 +10 -0
- package/v2Components/CommonTestAndPreview/CustomValuesEditor.js +70 -49
- package/v2Components/CommonTestAndPreview/DeliverySettings/DeliverySettings.scss +8 -2
- package/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.js +207 -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 +160 -15
- package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js.rej +18 -0
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +341 -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 +676 -186
- package/v2Components/CommonTestAndPreview/messages.js +49 -3
- package/v2Components/CommonTestAndPreview/previewApiUtils.js +59 -0
- package/v2Components/CommonTestAndPreview/sagas.js +15 -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 +2 -2
- package/v2Components/FormBuilder/index.js +8 -10
- package/v2Components/SmsFallback/SmsFallbackLocalSelector.js +87 -0
- package/v2Components/SmsFallback/constants.js +73 -0
- package/v2Components/SmsFallback/index.js +955 -0
- package/v2Components/SmsFallback/index.scss +265 -0
- package/v2Components/SmsFallback/messages.js +78 -0
- package/v2Components/SmsFallback/smsFallbackUtils.js +118 -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 +197 -0
- package/v2Components/SmsFallback/tests/smsFallbackUtils.test.js +277 -0
- package/v2Components/SmsFallback/tests/useLocalTemplateList.test.js +422 -0
- package/v2Components/SmsFallback/useLocalTemplateList.js +92 -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 +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 +67 -0
- package/v2Containers/CreativesContainer/index.js +300 -103
- 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/reducer.js +3 -11
- package/v2Containers/Email/sagas.js +5 -9
- package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +0 -4
- package/v2Containers/Email/tests/sagas.test.js +3 -21
- package/v2Containers/Rcs/constants.js +119 -8
- package/v2Containers/Rcs/index.js +2379 -807
- package/v2Containers/Rcs/index.js.rej +1336 -0
- package/v2Containers/Rcs/index.scss +276 -6
- package/v2Containers/Rcs/index.scss.rej +74 -0
- package/v2Containers/Rcs/messages.js +38 -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/__snapshots__/utils.test.js.snap.rej +128 -0
- 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 +100 -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 +636 -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 +163 -2
- package/v2Containers/Templates/actions.js +11 -0
- package/v2Containers/Templates/constants.js +2 -0
- package/v2Containers/Templates/index.js +119 -54
- package/v2Containers/Templates/sagas.js +57 -12
- package/v2Containers/Templates/tests/TemplatesActionBar.test.js +120 -0
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +1043 -1079
- package/v2Containers/Templates/tests/sagas.test.js +193 -123
- 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/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,6 +179,31 @@ 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
209
|
width: 770,
|
|
@@ -149,6 +211,8 @@ export const RCS_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
|
149
211
|
type: 'SHORT_HEIGHT',
|
|
150
212
|
heightType: 'SHORT',
|
|
151
213
|
label: 'Vertical Short',
|
|
214
|
+
width: 1140,
|
|
215
|
+
height: 448,
|
|
152
216
|
description: 'Thumbnail (770 x 257)',
|
|
153
217
|
orientation: 'VERTICAL',
|
|
154
218
|
maxFileSize: 100 * 1024,
|
|
@@ -189,6 +253,29 @@ export const RCS_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
|
189
253
|
},
|
|
190
254
|
};
|
|
191
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
|
+
|
|
192
279
|
const prefix = 'app/v2Containers/Rcs';
|
|
193
280
|
export const UPLOAD_RCS_ASSET_REQUEST = `${prefix}/UPLOAD_RCS_ASSET_REQUEST`;
|
|
194
281
|
export const UPLOAD_RCS_ASSET_SUCCESS = `${prefix}/UPLOAD_RCS_ASSET_SUCCESS`;
|
|
@@ -215,6 +302,7 @@ export const CLEAR_EDIT_RESPONSE_REQUEST = `${prefix}/Edit/CLEAR_EDIT_RESPONSE_R
|
|
|
215
302
|
export const AI_CONTENT_BOT_DISABLED = "AI_CONTENT_BOT_DISABLED";
|
|
216
303
|
|
|
217
304
|
export const RCS_TEXT_MESSAGE_MAX_LENGTH = 160;
|
|
305
|
+
export const RCS_TEXT_MESSAGE_MAX_LENGTH_INFOBIP = 3072;
|
|
218
306
|
export const RCS_RICH_CARD_MAX_LENGTH = 2000;
|
|
219
307
|
export const MAX_BUTTONS = 4;
|
|
220
308
|
|
|
@@ -250,3 +338,26 @@ export const RCS_BUTTON_TYPES = {
|
|
|
250
338
|
PHONE_NUMBER: 'PHONE_NUMBER',
|
|
251
339
|
CTA: 'CTA',
|
|
252
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
|
+
];
|