@capillarytech/creatives-library 9.0.46 → 9.0.47
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 +0 -1
- package/package.json +1 -1
- package/v2Components/CommonTestAndPreview/UnifiedPreview/SmsPreviewContent.js +1 -21
- package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberPreviewContent.js +15 -106
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +1 -144
- package/v2Components/CommonTestAndPreview/constants.js +0 -2
- package/v2Components/CommonTestAndPreview/index.js +26 -240
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/SmsPreviewContent.test.js +0 -32
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/ViberPreviewContent.test.js +0 -364
- package/v2Components/CommonTestAndPreview/tests/utils.test.js +0 -49
- package/v2Components/CommonTestAndPreview/utils.js +0 -20
- package/v2Components/SmsFallback/constants.js +0 -19
- package/v2Components/SmsFallback/index.js +3 -0
- package/v2Containers/SmsTrai/Edit/constants.js +0 -2
- package/v2Containers/SmsTrai/Edit/index.js +96 -206
- package/v2Containers/SmsTrai/Edit/index.scss +1 -117
- package/v2Containers/SmsTrai/Edit/messages.js +0 -40
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +4591 -21196
- package/v2Containers/Templates/_templates.scss +1 -202
- package/v2Containers/Templates/index.js +42 -193
- package/v2Containers/Templates/messages.js +0 -12
- package/v2Containers/Viber/constants.js +0 -21
- package/v2Containers/Viber/index.js +49 -719
- package/v2Containers/Viber/index.scss +0 -175
- package/v2Containers/Viber/messages.js +0 -121
- package/v2Containers/Viber/tests/index.test.js +0 -80
- package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberCarouselPreviewCards.js +0 -127
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_viberCarouselPreviewCards.scss +0 -133
- package/v2Containers/SmsTrai/Edit/dltVarTypes.js +0 -88
- package/v2Containers/SmsTrai/Edit/tests/dltVarTypes.test.js +0 -100
|
@@ -19,14 +19,11 @@ import CapNotification from '@capillarytech/cap-ui-library/CapNotification';
|
|
|
19
19
|
import CapError from '@capillarytech/cap-ui-library/CapError';
|
|
20
20
|
import CapCheckbox from '@capillarytech/cap-ui-library/CapCheckbox';
|
|
21
21
|
import CapInfoNote from '@capillarytech/cap-ui-library/CapInfoNote';
|
|
22
|
-
import CapAlert from '@capillarytech/cap-ui-library/CapAlert';
|
|
23
|
-
import CapIcon from '@capillarytech/cap-ui-library/CapIcon';
|
|
24
22
|
import injectSaga from '../../../utils/injectSaga';
|
|
25
23
|
import injectReducer from '../../../utils/injectReducer';
|
|
26
24
|
import {
|
|
27
25
|
CAP_SPACE_16,
|
|
28
26
|
CAP_SPACE_12,
|
|
29
|
-
CAP_SPACE_08,
|
|
30
27
|
CAP_SPACE_24,
|
|
31
28
|
CAP_SPACE_32,
|
|
32
29
|
CAP_SPACE_04,
|
|
@@ -54,7 +51,6 @@ import {
|
|
|
54
51
|
FULL,
|
|
55
52
|
ALL,
|
|
56
53
|
LIBRARY,
|
|
57
|
-
HORIZONTAL_WHITESPACE_ONLY_REGEX,
|
|
58
54
|
} from './constants';
|
|
59
55
|
import v2EditSmsReducer from '../../Sms/Edit/reducer';
|
|
60
56
|
import { v2SmsEditSagas } from '../../Sms/Edit/sagas';
|
|
@@ -72,15 +68,6 @@ import {
|
|
|
72
68
|
} from '../../../utils/templateVarUtils';
|
|
73
69
|
import VarSegmentMessageEditor from '../../../v2Components/VarSegmentMessageEditor';
|
|
74
70
|
import rcsMessages from '../../Rcs/messages';
|
|
75
|
-
import {
|
|
76
|
-
ANY_DLT_HASH_TOKEN_GLOBAL_REGEX,
|
|
77
|
-
ANY_DLT_HASH_TOKEN_PROBE_REGEX,
|
|
78
|
-
DLT_LEGACY_VAR_REGEX,
|
|
79
|
-
DLT_LEGACY_VAR_TOKEN,
|
|
80
|
-
isAnyDltVarToken,
|
|
81
|
-
getDltVarTypeMeta,
|
|
82
|
-
getDltVarCharLimit,
|
|
83
|
-
} from './dltVarTypes';
|
|
84
71
|
|
|
85
72
|
import './index.scss';
|
|
86
73
|
|
|
@@ -270,8 +257,8 @@ export const SmsTraiEdit = (props) => {
|
|
|
270
257
|
<span className="sms-trai-rcs-fallback-var-hint" style={dltVarSlotHintStyle}>
|
|
271
258
|
{formatMessage(messages.textAreaCounts, {
|
|
272
259
|
varCounts,
|
|
273
|
-
var:
|
|
274
|
-
charCounts: varCounts *
|
|
260
|
+
var: SMS_TRAI_VAR,
|
|
261
|
+
charCounts: varCounts * CHARLIMIT,
|
|
275
262
|
})}
|
|
276
263
|
</span>
|
|
277
264
|
);
|
|
@@ -301,13 +288,9 @@ export const SmsTraiEdit = (props) => {
|
|
|
301
288
|
}
|
|
302
289
|
`;
|
|
303
290
|
const TraiEditTemplateDetails = styled.div`
|
|
304
|
-
display: flex;
|
|
305
|
-
flex-wrap: wrap;
|
|
306
|
-
align-items: center;
|
|
307
|
-
gap: ${CAP_SPACE_08};
|
|
308
291
|
margin-bottom: ${CAP_SPACE_16};
|
|
309
292
|
.cap-label-span {
|
|
310
|
-
margin-right:
|
|
293
|
+
margin-right: ${CAP_SPACE_12};
|
|
311
294
|
}
|
|
312
295
|
`;
|
|
313
296
|
|
|
@@ -432,21 +415,18 @@ export const SmsTraiEdit = (props) => {
|
|
|
432
415
|
if (isRcsSmsFallback) return;
|
|
433
416
|
traiDataRef.current = isFullMode ? templateDetails : templateData;
|
|
434
417
|
if (traiDataRef.current && !isEmpty(traiDataRef.current)) {
|
|
435
|
-
|
|
418
|
+
let msg = get(traiDataRef.current, `versions.base.sms-editor`, '');
|
|
436
419
|
const templateMessageArray = [];
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
420
|
+
while (msg.length !== 0) {
|
|
421
|
+
const index = msg.search(SMS_TRAI_VAR);
|
|
422
|
+
if (index !== -1) {
|
|
423
|
+
templateMessageArray.push(msg.substring(0, index));
|
|
424
|
+
templateMessageArray.push(SMS_TRAI_VAR);
|
|
425
|
+
msg = msg.substring(index + 7, msg.length);
|
|
426
|
+
} else {
|
|
427
|
+
templateMessageArray.push(msg);
|
|
428
|
+
break;
|
|
443
429
|
}
|
|
444
|
-
templateMessageArray.push(match[0]);
|
|
445
|
-
cursor = match.index + match[0].length;
|
|
446
|
-
match = ANY_DLT_HASH_TOKEN_GLOBAL_REGEX.exec(msg);
|
|
447
|
-
}
|
|
448
|
-
if (cursor < msg.length) {
|
|
449
|
-
templateMessageArray.push(msg.substring(cursor));
|
|
450
430
|
}
|
|
451
431
|
const filteredTemplateMessageArray = templateMessageArray.filter((i) => i === 0 || i);
|
|
452
432
|
updateTempMsgArray(filteredTemplateMessageArray);
|
|
@@ -508,18 +488,16 @@ export const SmsTraiEdit = (props) => {
|
|
|
508
488
|
let varCount = 1;
|
|
509
489
|
let horizontalSpaceCount = 0;
|
|
510
490
|
for (let i = 0; i < tempMsgArray.length; i += 1) {
|
|
511
|
-
if (
|
|
491
|
+
if (tempMsgArray[i] === SMS_TRAI_VAR) {
|
|
512
492
|
const nextElem =
|
|
513
493
|
tempMsgArray[i === tempMsgArray.length - 1 ? -1 : i + 1];
|
|
514
|
-
if (nextElem?.replace(
|
|
494
|
+
if (nextElem?.replace(/[^\S\r\n]/gm, '') === '') {
|
|
515
495
|
horizontalSpaceCount += 1;
|
|
516
496
|
}
|
|
517
|
-
if (tempMsgArray[i] !== nextElem && nextElem?.replace(
|
|
518
|
-
|
|
519
|
-
varMapRef.current[`${SMS_TRAI_VAR}_${slotStartIndex}`] = {
|
|
497
|
+
if (tempMsgArray[i] !== nextElem && nextElem?.replace(/[^\S\r\n]/gm, '') !== '') {
|
|
498
|
+
varMapRef.current[`${tempMsgArray[i]}_${(i - varCount - horizontalSpaceCount) + 1}`] = {
|
|
520
499
|
data: '',
|
|
521
500
|
count: varCount,
|
|
522
|
-
token: tempMsgArray[slotStartIndex] || tempMsgArray[i],
|
|
523
501
|
};
|
|
524
502
|
varCount = 1;
|
|
525
503
|
horizontalSpaceCount = 0;
|
|
@@ -589,7 +567,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
589
567
|
if (
|
|
590
568
|
!isFullMode &&
|
|
591
569
|
updatedSmsEditor?.length > 0 &&
|
|
592
|
-
!updatedSmsEditor.
|
|
570
|
+
!updatedSmsEditor.includes(SMS_TRAI_VAR)
|
|
593
571
|
) {
|
|
594
572
|
tagValidationResponseRef.current = runValidateTags(updatedSmsEditor.join(''));
|
|
595
573
|
const missing = (tagValidationResponseRef.current.missingTags || []).length > 0;
|
|
@@ -622,7 +600,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
622
600
|
for (let i = _id; i < loopIndex; i += 1) {
|
|
623
601
|
if (i === _id) {
|
|
624
602
|
arr[i] = varMapRef.current[key].data; //data for first #var# of the textbox
|
|
625
|
-
} else if (
|
|
603
|
+
} else if (arr[i] === SMS_TRAI_VAR) {
|
|
626
604
|
arr[i] = ''; //'' for remaining #var# of a textbox
|
|
627
605
|
}
|
|
628
606
|
}
|
|
@@ -720,7 +698,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
720
698
|
const editorJoined = Array.isArray(updatedSmsEditor)
|
|
721
699
|
? updatedSmsEditor.join('')
|
|
722
700
|
: String(updatedSmsEditor || '');
|
|
723
|
-
if (!isRcsSmsFallback &&
|
|
701
|
+
if (!isRcsSmsFallback && editorJoined.includes(SMS_TRAI_VAR) && !isFullMode) {
|
|
724
702
|
updateIsValidationError(true);
|
|
725
703
|
} else {
|
|
726
704
|
// Only show full-screen spinner when waiting on full-mode SMS edit API — not for RCS SMS fallback
|
|
@@ -829,7 +807,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
829
807
|
const varMapKeys = Object.keys(varMapRef.current)?.map((key) => Number(key.slice(8)))?.sort((a, b) => a - b) || [];
|
|
830
808
|
const loopIndex = varMapKeys[varMapKeys?.indexOf(textAreaId) + 1] || arr.length;
|
|
831
809
|
for (let i = textAreaId; i < loopIndex; i += 1) {
|
|
832
|
-
if (
|
|
810
|
+
if (arr[i] === SMS_TRAI_VAR) {
|
|
833
811
|
arr[i] = '';
|
|
834
812
|
}
|
|
835
813
|
}
|
|
@@ -852,18 +830,17 @@ export const SmsTraiEdit = (props) => {
|
|
|
852
830
|
const loopIndex = varMapKeys[varMapKeys?.indexOf(_id) + 1] || arr.length;
|
|
853
831
|
|
|
854
832
|
varMapRef.current[`${SMS_TRAI_VAR}_${_id}`].data = value;
|
|
855
|
-
const slotToken = varMapRef.current[`${SMS_TRAI_VAR}_${_id}`]?.token || SMS_TRAI_VAR;
|
|
856
833
|
if (value === '') {
|
|
857
834
|
for (let i = _id; i < loopIndex; i += 1) {
|
|
858
835
|
if (i === _id || arr[i] === '') {
|
|
859
|
-
arr[i] =
|
|
836
|
+
arr[i] = SMS_TRAI_VAR;
|
|
860
837
|
}
|
|
861
838
|
}
|
|
862
839
|
} else {
|
|
863
840
|
for (let i = _id; i < loopIndex; i += 1) {
|
|
864
841
|
if (i === _id) {
|
|
865
842
|
arr[i] = varMapRef.current[`${SMS_TRAI_VAR}_${_id}`].data;
|
|
866
|
-
} else if (
|
|
843
|
+
} else if (arr[i] === SMS_TRAI_VAR) {
|
|
867
844
|
arr[i] = '';
|
|
868
845
|
}
|
|
869
846
|
}
|
|
@@ -876,7 +853,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
876
853
|
if (idValue >= 0 && updatedSmsEditor) {
|
|
877
854
|
if (
|
|
878
855
|
updatedSmsEditor[idValue] &&
|
|
879
|
-
|
|
856
|
+
updatedSmsEditor[idValue] !== SMS_TRAI_VAR
|
|
880
857
|
) {
|
|
881
858
|
return updatedSmsEditor[idValue];
|
|
882
859
|
}
|
|
@@ -885,86 +862,62 @@ export const SmsTraiEdit = (props) => {
|
|
|
885
862
|
return '';
|
|
886
863
|
};
|
|
887
864
|
|
|
888
|
-
const
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
865
|
+
const capHeading = (index, varCount) => {
|
|
866
|
+
if ((index, varCount)) {
|
|
867
|
+
return (
|
|
868
|
+
<CapHeading
|
|
869
|
+
key={`label${index}`}
|
|
870
|
+
type="h6"
|
|
871
|
+
style={{ margin: `${CAP_SPACE_04} 0`, float: 'right' }}
|
|
872
|
+
>
|
|
873
|
+
{formatMessage(messages.textAreaCounts, {
|
|
874
|
+
varCounts: varCount,
|
|
875
|
+
var: SMS_TRAI_VAR,
|
|
876
|
+
charCounts: varCount * CHARLIMIT,
|
|
877
|
+
})}
|
|
878
|
+
</CapHeading>
|
|
879
|
+
);
|
|
895
880
|
}
|
|
896
|
-
return
|
|
897
|
-
placeholder: formatMessage(messages[meta.placeholderKey]),
|
|
898
|
-
charLimit: meta.charLimit,
|
|
899
|
-
};
|
|
881
|
+
return <></>;
|
|
900
882
|
};
|
|
901
883
|
|
|
902
|
-
const renderSlotCounter = (currentValue, charLimit) => (
|
|
903
|
-
<CapLabelInline type="label4" className="sms-trai-slot-counter">
|
|
904
|
-
{formatMessage(messages.slotCharCounter, {
|
|
905
|
-
current: (currentValue || '').length,
|
|
906
|
-
max: charLimit,
|
|
907
|
-
})}
|
|
908
|
-
</CapLabelInline>
|
|
909
|
-
);
|
|
910
|
-
|
|
911
884
|
const renderedContent = () => {
|
|
912
885
|
const renderArray = [];
|
|
913
886
|
if (tempMsgArray?.length !== 0) {
|
|
914
887
|
let varCount = 0;
|
|
915
|
-
let slotStartIndex = -1;
|
|
916
|
-
let slotToken = SMS_TRAI_VAR;
|
|
917
888
|
tempMsgArray.forEach((elem, index) => {
|
|
918
889
|
let prevElem = '';
|
|
919
890
|
prevElem =
|
|
920
891
|
tempMsgArray[[index === 0 ? -1 : index - 1]];
|
|
921
|
-
if (
|
|
922
|
-
if (varCount === 0) {
|
|
923
|
-
slotStartIndex = index;
|
|
924
|
-
slotToken = elem;
|
|
925
|
-
}
|
|
892
|
+
if (elem.includes(SMS_TRAI_VAR)) {
|
|
926
893
|
varCount += 1;
|
|
927
|
-
if (
|
|
928
|
-
const currentSlotToken = slotToken;
|
|
929
|
-
const currentSlotIndex = slotStartIndex;
|
|
930
|
-
const { placeholder, charLimit: baseLimit } = getSlotDisplayMeta(currentSlotToken);
|
|
931
|
-
const slotValue = textAreaValue(currentSlotIndex);
|
|
894
|
+
if (prevElem !== SMS_TRAI_VAR && prevElem?.replace(/[^\S\r\n]/gm, '') !== '') {
|
|
932
895
|
renderArray.push(
|
|
933
|
-
<
|
|
934
|
-
|
|
935
|
-
key={
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
onFocus={setTextAreaId}
|
|
950
|
-
errorMessage={
|
|
951
|
-
isValidationError &&
|
|
952
|
-
isAnyDltVarToken(updatedSmsEditor[currentSlotIndex]) &&
|
|
953
|
-
formatMessage(messages.textAreaError)
|
|
954
|
-
}
|
|
955
|
-
/>
|
|
956
|
-
</CapColumn>
|
|
957
|
-
</CapRow>
|
|
958
|
-
{renderSlotCounter(slotValue, baseLimit * varCount)}
|
|
959
|
-
</CapRow>,
|
|
896
|
+
<TextArea
|
|
897
|
+
id={index}
|
|
898
|
+
key={`${elem}${index}`}
|
|
899
|
+
placeholder={props.intl.formatMessage(
|
|
900
|
+
messages.inputplaceHolderText,
|
|
901
|
+
)}
|
|
902
|
+
autosize={{ minRows: 1, maxRows: 3 }}
|
|
903
|
+
onChange={textAreaValueChange}
|
|
904
|
+
value={textAreaValue(index)}
|
|
905
|
+
onFocus={setTextAreaId}
|
|
906
|
+
errorMessage={
|
|
907
|
+
isValidationError &&
|
|
908
|
+
updatedSmsEditor[index] === SMS_TRAI_VAR &&
|
|
909
|
+
formatMessage(messages.textAreaError)
|
|
910
|
+
}
|
|
911
|
+
/>,
|
|
960
912
|
);
|
|
961
913
|
}
|
|
962
914
|
if (index === tempMsgArray.length - 1) {
|
|
915
|
+
renderArray.push(capHeading(index, varCount));
|
|
963
916
|
varCount = 0;
|
|
964
|
-
slotStartIndex = -1;
|
|
965
917
|
}
|
|
966
|
-
} else if (varCount > 0 && elem
|
|
918
|
+
} else if (varCount > 0 && elem.replace(/[^\S\r\n]/gm, '') !== '') {
|
|
967
919
|
renderArray.push(
|
|
920
|
+
capHeading(index, varCount),
|
|
968
921
|
<CapHeading
|
|
969
922
|
key={`${elem}${index}`}
|
|
970
923
|
style={{ margin: `${CAP_SPACE_16} 0`, clear: 'both' }}
|
|
@@ -973,8 +926,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
973
926
|
</CapHeading>,
|
|
974
927
|
);
|
|
975
928
|
varCount = 0;
|
|
976
|
-
|
|
977
|
-
} else if (elem?.replace(HORIZONTAL_WHITESPACE_ONLY_REGEX, '') !== '') {
|
|
929
|
+
} else if (elem.replace(/[^\S\r\n]/gm, '') !== '') {
|
|
978
930
|
renderArray.push(
|
|
979
931
|
<CapHeading
|
|
980
932
|
key={`${elem}${index}`}
|
|
@@ -1017,7 +969,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
1017
969
|
return;
|
|
1018
970
|
}
|
|
1019
971
|
const msgLenWithoutVar = tempMsgArray
|
|
1020
|
-
?.filter((i) =>
|
|
972
|
+
?.filter((i) => i !== SMS_TRAI_VAR)
|
|
1021
973
|
.join('');
|
|
1022
974
|
const varLen = calculateLenForTextBox();
|
|
1023
975
|
const totalMsgLen = msgLenWithoutVar?.length + varLen;
|
|
@@ -1027,15 +979,13 @@ export const SmsTraiEdit = (props) => {
|
|
|
1027
979
|
const calculateLenForTextBox = () => {
|
|
1028
980
|
let countVarChar = 0;
|
|
1029
981
|
Object.keys(varMapRef.current).forEach((i) => {
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
countVarChar += slot.data?.length;
|
|
1034
|
-
if (!showMsgLengthNote && slot.data?.length > slotLimit) {
|
|
982
|
+
if (varMapRef.current[i].data) {
|
|
983
|
+
countVarChar += varMapRef.current[i].data?.length;
|
|
984
|
+
if (!showMsgLengthNote && varMapRef.current[i].data?.length > varMapRef.current[i].count * CHARLIMIT) {
|
|
1035
985
|
updateshowMsgLengthNote(true);
|
|
1036
986
|
}
|
|
1037
987
|
} else {
|
|
1038
|
-
countVarChar +=
|
|
988
|
+
countVarChar += varMapRef.current[i].count * CHARLIMIT;
|
|
1039
989
|
}
|
|
1040
990
|
});
|
|
1041
991
|
return countVarChar;
|
|
@@ -1064,8 +1014,12 @@ export const SmsTraiEdit = (props) => {
|
|
|
1064
1014
|
const disablehandler = () => {
|
|
1065
1015
|
if (isRcsSmsFallback) return false;
|
|
1066
1016
|
if (traiDataRef.current && !isEmpty(traiDataRef.current)) {
|
|
1067
|
-
const msg = get(traiDataRef.current, `versions.base.sms-editor`, '')
|
|
1068
|
-
|
|
1017
|
+
const msg = get(traiDataRef.current, `versions.base.sms-editor`, '');
|
|
1018
|
+
const index = msg.search(SMS_TRAI_VAR);
|
|
1019
|
+
if (index === -1) {
|
|
1020
|
+
return true;
|
|
1021
|
+
}
|
|
1022
|
+
return false;
|
|
1069
1023
|
}
|
|
1070
1024
|
return true;
|
|
1071
1025
|
};
|
|
@@ -1115,7 +1069,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
1115
1069
|
const shouldShowPreview =
|
|
1116
1070
|
!isRcsSmsFallback || (showPreviewInRcsFallback && !hidePreview);
|
|
1117
1071
|
const smsSidePreviewColumn = (
|
|
1118
|
-
<CapColumn span={
|
|
1072
|
+
<CapColumn span={8} offset={0}>
|
|
1119
1073
|
<UnifiedPreview
|
|
1120
1074
|
channel={SMS}
|
|
1121
1075
|
content={updatedSmsEditor.join('')}
|
|
@@ -1143,35 +1097,25 @@ export const SmsTraiEdit = (props) => {
|
|
|
1143
1097
|
<CapRow typeof='flex' align='top' noWrap fullWidth>
|
|
1144
1098
|
<CapRow type='flex' vertical fullWidth>
|
|
1145
1099
|
{traiDataRef.current && !isEmpty(traiDataRef.current) && !isRcsSmsFallback && (
|
|
1146
|
-
|
|
1147
|
-
<
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
/>
|
|
1166
|
-
<CapLabelInline type="label2">
|
|
1167
|
-
{[...get(traiDataRef.current, 'versions.base.header', [])].join(', ')}
|
|
1168
|
-
</CapLabelInline>
|
|
1169
|
-
</CapLabelInline>
|
|
1170
|
-
<CapLabelInline type="label1" className="sms-trai-sender-id-locked-note">
|
|
1171
|
-
{formatMessage(messages.senderIdLockedNote)}
|
|
1172
|
-
</CapLabelInline>
|
|
1173
|
-
</TraiEditTemplateDetails>
|
|
1174
|
-
</>
|
|
1100
|
+
<TraiEditTemplateDetails>
|
|
1101
|
+
<CapLabelInline type="label1">
|
|
1102
|
+
{formatMessage(messages.templateLabel)}
|
|
1103
|
+
</CapLabelInline>
|
|
1104
|
+
<CapLabelInline type="label2">
|
|
1105
|
+
{get(traiDataRef.current, `versions.base.template_name`, '')}
|
|
1106
|
+
</CapLabelInline>
|
|
1107
|
+
|
|
1108
|
+
<CapLabelInline type="label1">
|
|
1109
|
+
{formatMessage(messages.traiEditSeperator)}
|
|
1110
|
+
</CapLabelInline>
|
|
1111
|
+
|
|
1112
|
+
<CapLabelInline type="label1">
|
|
1113
|
+
{formatMessage(messages.senderIdlabel)}
|
|
1114
|
+
</CapLabelInline>
|
|
1115
|
+
<CapLabelInline type="label2">
|
|
1116
|
+
{[...get(traiDataRef.current, `versions.base.header`, [])].join(', ')}
|
|
1117
|
+
</CapLabelInline>
|
|
1118
|
+
</TraiEditTemplateDetails>
|
|
1175
1119
|
)}
|
|
1176
1120
|
{isRcsSmsFallback &&
|
|
1177
1121
|
traiDataRef.current &&
|
|
@@ -1193,68 +1137,14 @@ export const SmsTraiEdit = (props) => {
|
|
|
1193
1137
|
<CapLabelInline type="label1">
|
|
1194
1138
|
{formatMessage(messages.senderIdlabel)}
|
|
1195
1139
|
</CapLabelInline>
|
|
1196
|
-
<CapLabelInline
|
|
1197
|
-
|
|
1198
|
-
<CapLabelInline type="label2">
|
|
1199
|
-
{[...get(traiDataRef.current, 'versions.base.header', [])].join(', ')}
|
|
1200
|
-
</CapLabelInline>
|
|
1201
|
-
</CapLabelInline>
|
|
1202
|
-
<CapLabelInline type="label1" className="sms-trai-sender-id-locked-note">
|
|
1203
|
-
{formatMessage(messages.senderIdLockedNote)}
|
|
1140
|
+
<CapLabelInline type="label2">
|
|
1141
|
+
{[...get(traiDataRef.current, 'versions.base.header', [])].join(', ')}
|
|
1204
1142
|
</CapLabelInline>
|
|
1205
1143
|
</>
|
|
1206
1144
|
) : null}
|
|
1207
1145
|
</TraiEditTemplateDetails>
|
|
1208
1146
|
)}
|
|
1209
|
-
{
|
|
1210
|
-
&& traiDltEnabled
|
|
1211
|
-
&& !isEmpty(traiDataRef.current)
|
|
1212
|
-
&& get(traiDataRef.current, 'versions.base.type', '')
|
|
1213
|
-
?.toLowerCase()
|
|
1214
|
-
?.includes('promo') && (
|
|
1215
|
-
<CapInfoNote
|
|
1216
|
-
type="clock-circle"
|
|
1217
|
-
className="sms-trai-promotional-window-banner"
|
|
1218
|
-
noteText={formatMessage(messages.promotionalWindowBanner)}
|
|
1219
|
-
/>
|
|
1220
|
-
)}
|
|
1221
|
-
{isRcsSmsFallback
|
|
1222
|
-
&& traiDltEnabled
|
|
1223
|
-
&& DLT_LEGACY_VAR_REGEX.test(
|
|
1224
|
-
get(traiDataRef.current, 'versions.base.sms-editor', '') || '',
|
|
1225
|
-
) && (
|
|
1226
|
-
<CapInfoNote
|
|
1227
|
-
type="warning"
|
|
1228
|
-
className="sms-trai-legacy-warning-banner"
|
|
1229
|
-
noteText={formatMessage(messages.smsLegacyFormatWarning, {
|
|
1230
|
-
legacyToken: DLT_LEGACY_VAR_TOKEN,
|
|
1231
|
-
})}
|
|
1232
|
-
/>
|
|
1233
|
-
)}
|
|
1234
|
-
<CapColumn span={shouldShowPreview ? 18 : 24}>
|
|
1235
|
-
{!isRcsSmsFallback
|
|
1236
|
-
&& !isEmpty(traiDataRef.current)
|
|
1237
|
-
&& get(traiDataRef.current, 'versions.base.type', '')
|
|
1238
|
-
?.toLowerCase()
|
|
1239
|
-
?.includes('promo') && (
|
|
1240
|
-
<CapInfoNote
|
|
1241
|
-
type="clock-circle"
|
|
1242
|
-
className="sms-trai-promotional-window-banner"
|
|
1243
|
-
noteText={formatMessage(messages.promotionalWindowBanner)}
|
|
1244
|
-
/>
|
|
1245
|
-
)}
|
|
1246
|
-
{!isRcsSmsFallback
|
|
1247
|
-
&& DLT_LEGACY_VAR_REGEX.test(
|
|
1248
|
-
get(traiDataRef.current, 'versions.base.sms-editor', '') || '',
|
|
1249
|
-
) && (
|
|
1250
|
-
<CapInfoNote
|
|
1251
|
-
type="warning"
|
|
1252
|
-
className="sms-trai-legacy-warning-banner"
|
|
1253
|
-
noteText={formatMessage(messages.smsLegacyFormatWarning, {
|
|
1254
|
-
legacyToken: DLT_LEGACY_VAR_TOKEN,
|
|
1255
|
-
})}
|
|
1256
|
-
/>
|
|
1257
|
-
)}
|
|
1147
|
+
<CapColumn span={shouldShowPreview ? 16 : 24}>
|
|
1258
1148
|
<CapRow useLegacy>
|
|
1259
1149
|
<CapHeader
|
|
1260
1150
|
title={formatMessage(messages.traiEditTitle)}
|
|
@@ -107,9 +107,7 @@
|
|
|
107
107
|
/* Non–RCS fallback: segmented editor shell + character count row (was inline styles on CapRow) */
|
|
108
108
|
.sms-trai-editor-segment-row {
|
|
109
109
|
background-color: $CAP_G10;
|
|
110
|
-
padding: $
|
|
111
|
-
border-radius: 0.375rem;
|
|
112
|
-
margin-right: $CAP_SPACE_16;
|
|
110
|
+
padding: $CAP_SPACE_16;
|
|
113
111
|
}
|
|
114
112
|
|
|
115
113
|
.sms-trai-length-row {
|
|
@@ -126,117 +124,3 @@
|
|
|
126
124
|
.sms-trai-edit-bottom-spacer {
|
|
127
125
|
margin-bottom: 6.25rem;
|
|
128
126
|
}
|
|
129
|
-
|
|
130
|
-
.sms-trai-slot {
|
|
131
|
-
display: flex;
|
|
132
|
-
flex-direction: column;
|
|
133
|
-
margin: 0 0 $CAP_SPACE_16 0;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.sms-trai-slot__field {
|
|
137
|
-
display: flex;
|
|
138
|
-
align-items: stretch;
|
|
139
|
-
background-color: $CAP_WHITE;
|
|
140
|
-
border: 1px solid $CAP_G07;
|
|
141
|
-
border-radius: 0.375rem;
|
|
142
|
-
overflow: hidden;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.sms-trai-slot__chip {
|
|
146
|
-
flex-shrink: 0;
|
|
147
|
-
display: flex;
|
|
148
|
-
align-items: center;
|
|
149
|
-
justify-content: center;
|
|
150
|
-
min-width: 4.5rem;
|
|
151
|
-
padding: 0 $CAP_SPACE_08;
|
|
152
|
-
background-color: $CAP_G10;
|
|
153
|
-
border-right: 1px solid $CAP_G07;
|
|
154
|
-
color: $FONT_COLOR_02;
|
|
155
|
-
font-family: Menlo, Monaco, 'Courier New', monospace;
|
|
156
|
-
font-size: 0.75rem;
|
|
157
|
-
line-height: 1.125rem;
|
|
158
|
-
white-space: nowrap;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.sms-trai-slot__input-wrap {
|
|
162
|
-
flex: 1;
|
|
163
|
-
min-width: 0;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.sms-trai-slot__input-wrap .ant-input,
|
|
167
|
-
.sms-trai-slot__input-wrap textarea.ant-input {
|
|
168
|
-
background-color: transparent;
|
|
169
|
-
border: none;
|
|
170
|
-
border-radius: 0;
|
|
171
|
-
padding: $CAP_SPACE_08 $CAP_SPACE_12;
|
|
172
|
-
min-height: 2.5rem;
|
|
173
|
-
box-shadow: none;
|
|
174
|
-
overflow-x: auto;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.sms-trai-slot__input-wrap .ant-input::placeholder,
|
|
178
|
-
.sms-trai-slot__input-wrap textarea.ant-input::placeholder {
|
|
179
|
-
white-space: nowrap;
|
|
180
|
-
overflow: hidden;
|
|
181
|
-
text-overflow: ellipsis;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.sms-trai-slot__input-wrap .ant-input:focus,
|
|
185
|
-
.sms-trai-slot__input-wrap .ant-input:active,
|
|
186
|
-
.sms-trai-slot__input-wrap textarea.ant-input:focus,
|
|
187
|
-
.sms-trai-slot__input-wrap textarea.ant-input:active {
|
|
188
|
-
border: none;
|
|
189
|
-
box-shadow: none;
|
|
190
|
-
outline: none;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.sms-trai-slot-counter {
|
|
194
|
-
align-self: flex-end;
|
|
195
|
-
margin-top: $CAP_SPACE_04;
|
|
196
|
-
color: $FONT_COLOR_02;
|
|
197
|
-
font-size: 0.75rem;
|
|
198
|
-
line-height: 1rem;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.sms-trai-sender-id-chip {
|
|
202
|
-
display: inline-flex;
|
|
203
|
-
align-items: center;
|
|
204
|
-
gap: $CAP_SPACE_04;
|
|
205
|
-
padding: $CAP_SPACE_02 $CAP_SPACE_08;
|
|
206
|
-
border: 1px solid $CAP_G07;
|
|
207
|
-
border-radius: 0.25rem;
|
|
208
|
-
background-color: $CAP_G10;
|
|
209
|
-
line-height: 1.25rem;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.sms-trai-sender-id-chip__lock {
|
|
213
|
-
display: inline-flex;
|
|
214
|
-
align-items: center;
|
|
215
|
-
font-size: 0.75rem;
|
|
216
|
-
line-height: 1;
|
|
217
|
-
color: $FONT_COLOR_02;
|
|
218
|
-
}
|
|
219
|
-
.sms-trai-sender-id-chip__lock svg {
|
|
220
|
-
width: 0.75rem;
|
|
221
|
-
height: 0.75rem;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.sms-trai-sender-id-locked-note {
|
|
225
|
-
margin-left: $CAP_SPACE_08;
|
|
226
|
-
color: $FONT_COLOR_02;
|
|
227
|
-
font-style: italic;
|
|
228
|
-
font-size: 0.75rem;
|
|
229
|
-
line-height: 1rem;
|
|
230
|
-
font-weight: 400;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.sms-trai-promotional-window-banner.ant-alert,
|
|
234
|
-
.sms-trai-legacy-warning-banner.ant-alert {
|
|
235
|
-
margin: 0 $CAP_SPACE_16 $CAP_SPACE_16 0;
|
|
236
|
-
|
|
237
|
-
.ant-alert-title,
|
|
238
|
-
.ant-alert-title span {
|
|
239
|
-
font-weight: $FONT_WEIGHT_REGULAR;
|
|
240
|
-
white-space: normal;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
@@ -82,44 +82,4 @@ export default defineMessages({
|
|
|
82
82
|
id: `${prefix}.incompleteOrInvalidTagsError`,
|
|
83
83
|
defaultMessage: 'Incomplete or invalid tags. Please provide values for all variables (e.g. {{optout}}, {{fullname}}).',
|
|
84
84
|
},
|
|
85
|
-
slotCharCounter: {
|
|
86
|
-
id: `${prefix}.slotCharCounter`,
|
|
87
|
-
defaultMessage: '{current}/{max}',
|
|
88
|
-
},
|
|
89
|
-
senderIdLockedNote: {
|
|
90
|
-
id: `${prefix}.senderIdLockedNote`,
|
|
91
|
-
defaultMessage: "— locked to this template, can't be overridden",
|
|
92
|
-
},
|
|
93
|
-
promotionalWindowBanner: {
|
|
94
|
-
id: `${prefix}.promotionalWindowBanner`,
|
|
95
|
-
defaultMessage: 'Promotional template — can only be delivered between 10:00 AM and 9:00 PM IST.',
|
|
96
|
-
},
|
|
97
|
-
smsLegacyFormatWarning: {
|
|
98
|
-
id: `${prefix}.smsLegacyFormatWarning`,
|
|
99
|
-
defaultMessage: "Uses old {legacyToken} placeholders — can't be used until re-registered with typed variables on the DLT portal.",
|
|
100
|
-
},
|
|
101
|
-
dltVarPlaceholderNumeric: {
|
|
102
|
-
id: `${prefix}.dltVarPlaceholderNumeric`,
|
|
103
|
-
defaultMessage: 'Digits 0–9 only. No letters, spaces, symbols or links.',
|
|
104
|
-
},
|
|
105
|
-
dltVarPlaceholderAlphanumeric: {
|
|
106
|
-
id: `${prefix}.dltVarPlaceholderAlphanumeric`,
|
|
107
|
-
defaultMessage: 'Letters & digits, common punctuation and spaces. No links, numbers as CTA, or email.',
|
|
108
|
-
},
|
|
109
|
-
dltVarPlaceholderUrl: {
|
|
110
|
-
id: `${prefix}.dltVarPlaceholderUrl`,
|
|
111
|
-
defaultMessage: 'A valid web link that matches a Call-To-Action (CTA) registered for this template.',
|
|
112
|
-
},
|
|
113
|
-
dltVarPlaceholderUrlott: {
|
|
114
|
-
id: `${prefix}.dltVarPlaceholderUrlott`,
|
|
115
|
-
defaultMessage: 'A valid app / OTT deep link that matches a registered CTA for this template.',
|
|
116
|
-
},
|
|
117
|
-
dltVarPlaceholderCbn: {
|
|
118
|
-
id: `${prefix}.dltVarPlaceholderCbn`,
|
|
119
|
-
defaultMessage: 'A valid phone number — digits with an optional +/country code. No free text.',
|
|
120
|
-
},
|
|
121
|
-
dltVarPlaceholderEmail: {
|
|
122
|
-
id: `${prefix}.dltVarPlaceholderEmail`,
|
|
123
|
-
defaultMessage: 'A valid email address in the form name@domain.tld.',
|
|
124
|
-
},
|
|
125
85
|
});
|