catchup-library-web 1.18.9 → 1.18.11
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/dist/index.js
CHANGED
|
@@ -3396,22 +3396,8 @@ var ShowBodyMediaByContentType = ({
|
|
|
3396
3396
|
inputPartIndex
|
|
3397
3397
|
);
|
|
3398
3398
|
};
|
|
3399
|
-
const balanceSpecialChars = (text) => {
|
|
3400
|
-
let result = text;
|
|
3401
|
-
if ((result.split("__").length - 1) % 2 === 1) {
|
|
3402
|
-
result = result + "__";
|
|
3403
|
-
}
|
|
3404
|
-
if ((result.split("**").length - 1) % 2 === 1) {
|
|
3405
|
-
result = result + "**";
|
|
3406
|
-
}
|
|
3407
|
-
if ((result.split("$$").length - 1) % 2 === 1) {
|
|
3408
|
-
result = result + "$$";
|
|
3409
|
-
}
|
|
3410
|
-
return result;
|
|
3411
|
-
};
|
|
3412
3399
|
const renderTextContent = (text, itemKey) => {
|
|
3413
|
-
|
|
3414
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xl", children: constructInputWithSpecialExpressionList(balancedText).map(
|
|
3400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xl", children: constructInputWithSpecialExpressionList(text).map(
|
|
3415
3401
|
(inputPart, inputPartIndex) => renderSpecialExpressions(inputPart, inputPartIndex)
|
|
3416
3402
|
) }, itemKey);
|
|
3417
3403
|
};
|
|
@@ -3428,13 +3414,14 @@ var ShowBodyMediaByContentType = ({
|
|
|
3428
3414
|
while (copyValue.includes(checkText)) {
|
|
3429
3415
|
const firstIndex = copyValue.indexOf(checkText);
|
|
3430
3416
|
const textBeforeTag = copyValue.substring(0, firstIndex);
|
|
3417
|
+
console.log("text before: ", textBeforeTag);
|
|
3431
3418
|
if (textBeforeTag.trim() !== "") {
|
|
3432
|
-
const balancedText = balanceSpecialChars(textBeforeTag);
|
|
3433
3419
|
currentIndex++;
|
|
3434
3420
|
const itemKey2 = `text-before-${index}-${currentIndex}`;
|
|
3435
|
-
valuePartList.push(renderTextContent(
|
|
3421
|
+
valuePartList.push(renderTextContent(textBeforeTag, itemKey2));
|
|
3436
3422
|
}
|
|
3437
3423
|
const subValue = copyValue.substring(firstIndex + checkText.length);
|
|
3424
|
+
console.log("sub value: ", subValue);
|
|
3438
3425
|
const secondIndex = subValue.indexOf(checkText);
|
|
3439
3426
|
if (secondIndex === -1) break;
|
|
3440
3427
|
const textInsideTag = copyValue.substring(
|
|
@@ -3452,9 +3439,6 @@ var ShowBodyMediaByContentType = ({
|
|
|
3452
3439
|
copyValue = copyValue.substring(
|
|
3453
3440
|
firstIndex + checkText.length + secondIndex + checkText.length
|
|
3454
3441
|
);
|
|
3455
|
-
if ((copyValue.split("$$").length - 1) % 2 === 1) {
|
|
3456
|
-
copyValue = "$$" + copyValue;
|
|
3457
|
-
}
|
|
3458
3442
|
}
|
|
3459
3443
|
};
|
|
3460
3444
|
const processImageTags = () => {
|
|
@@ -3614,7 +3598,6 @@ var ShowBodyMediaByContentType = ({
|
|
|
3614
3598
|
processAudioTags();
|
|
3615
3599
|
if (copyValue.trim() !== "") {
|
|
3616
3600
|
currentIndex++;
|
|
3617
|
-
copyValue = balanceSpecialChars(copyValue);
|
|
3618
3601
|
const regexMatchImageText = copyValue.match(/<image>([\s\S]*?)<\/image>/);
|
|
3619
3602
|
if (regexMatchImageText) {
|
|
3620
3603
|
const imageText = regexMatchImageText[1];
|
package/dist/index.mjs
CHANGED
|
@@ -3180,22 +3180,8 @@ var ShowBodyMediaByContentType = ({
|
|
|
3180
3180
|
inputPartIndex
|
|
3181
3181
|
);
|
|
3182
3182
|
};
|
|
3183
|
-
const balanceSpecialChars = (text) => {
|
|
3184
|
-
let result = text;
|
|
3185
|
-
if ((result.split("__").length - 1) % 2 === 1) {
|
|
3186
|
-
result = result + "__";
|
|
3187
|
-
}
|
|
3188
|
-
if ((result.split("**").length - 1) % 2 === 1) {
|
|
3189
|
-
result = result + "**";
|
|
3190
|
-
}
|
|
3191
|
-
if ((result.split("$$").length - 1) % 2 === 1) {
|
|
3192
|
-
result = result + "$$";
|
|
3193
|
-
}
|
|
3194
|
-
return result;
|
|
3195
|
-
};
|
|
3196
3183
|
const renderTextContent = (text, itemKey) => {
|
|
3197
|
-
|
|
3198
|
-
return /* @__PURE__ */ jsx18("span", { className: "text-xl", children: constructInputWithSpecialExpressionList(balancedText).map(
|
|
3184
|
+
return /* @__PURE__ */ jsx18("span", { className: "text-xl", children: constructInputWithSpecialExpressionList(text).map(
|
|
3199
3185
|
(inputPart, inputPartIndex) => renderSpecialExpressions(inputPart, inputPartIndex)
|
|
3200
3186
|
) }, itemKey);
|
|
3201
3187
|
};
|
|
@@ -3212,13 +3198,14 @@ var ShowBodyMediaByContentType = ({
|
|
|
3212
3198
|
while (copyValue.includes(checkText)) {
|
|
3213
3199
|
const firstIndex = copyValue.indexOf(checkText);
|
|
3214
3200
|
const textBeforeTag = copyValue.substring(0, firstIndex);
|
|
3201
|
+
console.log("text before: ", textBeforeTag);
|
|
3215
3202
|
if (textBeforeTag.trim() !== "") {
|
|
3216
|
-
const balancedText = balanceSpecialChars(textBeforeTag);
|
|
3217
3203
|
currentIndex++;
|
|
3218
3204
|
const itemKey2 = `text-before-${index}-${currentIndex}`;
|
|
3219
|
-
valuePartList.push(renderTextContent(
|
|
3205
|
+
valuePartList.push(renderTextContent(textBeforeTag, itemKey2));
|
|
3220
3206
|
}
|
|
3221
3207
|
const subValue = copyValue.substring(firstIndex + checkText.length);
|
|
3208
|
+
console.log("sub value: ", subValue);
|
|
3222
3209
|
const secondIndex = subValue.indexOf(checkText);
|
|
3223
3210
|
if (secondIndex === -1) break;
|
|
3224
3211
|
const textInsideTag = copyValue.substring(
|
|
@@ -3236,9 +3223,6 @@ var ShowBodyMediaByContentType = ({
|
|
|
3236
3223
|
copyValue = copyValue.substring(
|
|
3237
3224
|
firstIndex + checkText.length + secondIndex + checkText.length
|
|
3238
3225
|
);
|
|
3239
|
-
if ((copyValue.split("$$").length - 1) % 2 === 1) {
|
|
3240
|
-
copyValue = "$$" + copyValue;
|
|
3241
|
-
}
|
|
3242
3226
|
}
|
|
3243
3227
|
};
|
|
3244
3228
|
const processImageTags = () => {
|
|
@@ -3398,7 +3382,6 @@ var ShowBodyMediaByContentType = ({
|
|
|
3398
3382
|
processAudioTags();
|
|
3399
3383
|
if (copyValue.trim() !== "") {
|
|
3400
3384
|
currentIndex++;
|
|
3401
|
-
copyValue = balanceSpecialChars(copyValue);
|
|
3402
3385
|
const regexMatchImageText = copyValue.match(/<image>([\s\S]*?)<\/image>/);
|
|
3403
3386
|
if (regexMatchImageText) {
|
|
3404
3387
|
const imageText = regexMatchImageText[1];
|
package/package.json
CHANGED
|
@@ -54,30 +54,10 @@ const ShowBodyMediaByContentType = ({
|
|
|
54
54
|
);
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
const balanceSpecialChars = (text: string) => {
|
|
58
|
-
let result = text;
|
|
59
|
-
|
|
60
|
-
if ((result.split("__").length - 1) % 2 === 1) {
|
|
61
|
-
result = result + "__";
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if ((result.split("**").length - 1) % 2 === 1) {
|
|
65
|
-
result = result + "**";
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if ((result.split("$$").length - 1) % 2 === 1) {
|
|
69
|
-
result = result + "$$";
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return result;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
57
|
const renderTextContent = (text: string, itemKey: string) => {
|
|
76
|
-
const balancedText = balanceSpecialChars(text);
|
|
77
|
-
|
|
78
58
|
return (
|
|
79
59
|
<span key={itemKey} className="text-xl">
|
|
80
|
-
{constructInputWithSpecialExpressionList(
|
|
60
|
+
{constructInputWithSpecialExpressionList(text).map(
|
|
81
61
|
(inputPart: IInputPart, inputPartIndex: number) =>
|
|
82
62
|
renderSpecialExpressions(inputPart, inputPartIndex)
|
|
83
63
|
)}
|
|
@@ -102,15 +82,16 @@ const ShowBodyMediaByContentType = ({
|
|
|
102
82
|
while (copyValue.includes(checkText)) {
|
|
103
83
|
const firstIndex = copyValue.indexOf(checkText);
|
|
104
84
|
const textBeforeTag = copyValue.substring(0, firstIndex);
|
|
85
|
+
console.log("text before: ", textBeforeTag);
|
|
105
86
|
|
|
106
87
|
if (textBeforeTag.trim() !== "") {
|
|
107
|
-
const balancedText = balanceSpecialChars(textBeforeTag);
|
|
108
88
|
currentIndex++;
|
|
109
89
|
const itemKey = `text-before-${index}-${currentIndex}`;
|
|
110
|
-
valuePartList.push(renderTextContent(
|
|
90
|
+
valuePartList.push(renderTextContent(textBeforeTag, itemKey));
|
|
111
91
|
}
|
|
112
92
|
|
|
113
93
|
const subValue = copyValue.substring(firstIndex + checkText.length);
|
|
94
|
+
console.log("sub value: ", subValue);
|
|
114
95
|
const secondIndex = subValue.indexOf(checkText);
|
|
115
96
|
if (secondIndex === -1) break;
|
|
116
97
|
|
|
@@ -135,10 +116,6 @@ const ShowBodyMediaByContentType = ({
|
|
|
135
116
|
copyValue = copyValue.substring(
|
|
136
117
|
firstIndex + checkText.length + secondIndex + checkText.length
|
|
137
118
|
);
|
|
138
|
-
|
|
139
|
-
if ((copyValue.split("$$").length - 1) % 2 === 1) {
|
|
140
|
-
copyValue = "$$" + copyValue;
|
|
141
|
-
}
|
|
142
119
|
}
|
|
143
120
|
};
|
|
144
121
|
|
|
@@ -294,7 +271,6 @@ const ShowBodyMediaByContentType = ({
|
|
|
294
271
|
|
|
295
272
|
if (copyValue.trim() !== "") {
|
|
296
273
|
currentIndex++;
|
|
297
|
-
copyValue = balanceSpecialChars(copyValue);
|
|
298
274
|
|
|
299
275
|
const regexMatchImageText = copyValue.match(/<image>([\s\S]*?)<\/image>/);
|
|
300
276
|
if (regexMatchImageText) {
|