catchup-library-web 1.18.7 → 1.18.9

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
@@ -3404,8 +3404,8 @@ var ShowBodyMediaByContentType = ({
3404
3404
  if ((result.split("**").length - 1) % 2 === 1) {
3405
3405
  result = result + "**";
3406
3406
  }
3407
- if ((result.split("`").length - 1) % 2 === 1) {
3408
- result = result + "`";
3407
+ if ((result.split("$$").length - 1) % 2 === 1) {
3408
+ result = result + "$$";
3409
3409
  }
3410
3410
  return result;
3411
3411
  };
@@ -3443,6 +3443,7 @@ var ShowBodyMediaByContentType = ({
3443
3443
  );
3444
3444
  currentIndex++;
3445
3445
  const itemKey = `text-inside-${index}-${currentIndex}`;
3446
+ console.log("text inside: ", textInsideTag);
3446
3447
  valuePartList.push(
3447
3448
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xl font-bold", children: constructInputWithSpecialExpressionList(textInsideTag).map(
3448
3449
  (inputPart, inputPartIndex) => renderSpecialExpressions(inputPart, inputPartIndex)
@@ -3451,8 +3452,8 @@ var ShowBodyMediaByContentType = ({
3451
3452
  copyValue = copyValue.substring(
3452
3453
  firstIndex + checkText.length + secondIndex + checkText.length
3453
3454
  );
3454
- if ((copyValue.split("`").length - 1) % 2 === 1) {
3455
- copyValue = "`" + copyValue;
3455
+ if ((copyValue.split("$$").length - 1) % 2 === 1) {
3456
+ copyValue = "$$" + copyValue;
3456
3457
  }
3457
3458
  }
3458
3459
  };
@@ -3738,9 +3739,7 @@ var ShowBodyMediaByContentType = ({
3738
3739
  "video",
3739
3740
  {
3740
3741
  src: value,
3741
- className: `${convertToPercentage(
3742
- size || ""
3743
- )} rounded-catchup-xlarge`,
3742
+ className: `${convertToPercentage(size)} rounded-catchup-xlarge`,
3744
3743
  controls: true
3745
3744
  }
3746
3745
  ) });
@@ -3779,6 +3778,7 @@ var ActivityBodyContent = ({
3779
3778
  );
3780
3779
  } else {
3781
3780
  const trimmedAnswer = typeof answer === "string" ? answer.trim() : String(answer);
3781
+ console.log("trimmed answer: ", trimmedAnswer);
3782
3782
  switch (contentType) {
3783
3783
  case "TEXT":
3784
3784
  processedValue = processedValue.replace(
package/dist/index.mjs CHANGED
@@ -3188,8 +3188,8 @@ var ShowBodyMediaByContentType = ({
3188
3188
  if ((result.split("**").length - 1) % 2 === 1) {
3189
3189
  result = result + "**";
3190
3190
  }
3191
- if ((result.split("`").length - 1) % 2 === 1) {
3192
- result = result + "`";
3191
+ if ((result.split("$$").length - 1) % 2 === 1) {
3192
+ result = result + "$$";
3193
3193
  }
3194
3194
  return result;
3195
3195
  };
@@ -3227,6 +3227,7 @@ var ShowBodyMediaByContentType = ({
3227
3227
  );
3228
3228
  currentIndex++;
3229
3229
  const itemKey = `text-inside-${index}-${currentIndex}`;
3230
+ console.log("text inside: ", textInsideTag);
3230
3231
  valuePartList.push(
3231
3232
  /* @__PURE__ */ jsx18("span", { className: "text-xl font-bold", children: constructInputWithSpecialExpressionList(textInsideTag).map(
3232
3233
  (inputPart, inputPartIndex) => renderSpecialExpressions(inputPart, inputPartIndex)
@@ -3235,8 +3236,8 @@ var ShowBodyMediaByContentType = ({
3235
3236
  copyValue = copyValue.substring(
3236
3237
  firstIndex + checkText.length + secondIndex + checkText.length
3237
3238
  );
3238
- if ((copyValue.split("`").length - 1) % 2 === 1) {
3239
- copyValue = "`" + copyValue;
3239
+ if ((copyValue.split("$$").length - 1) % 2 === 1) {
3240
+ copyValue = "$$" + copyValue;
3240
3241
  }
3241
3242
  }
3242
3243
  };
@@ -3522,9 +3523,7 @@ var ShowBodyMediaByContentType = ({
3522
3523
  "video",
3523
3524
  {
3524
3525
  src: value,
3525
- className: `${convertToPercentage(
3526
- size || ""
3527
- )} rounded-catchup-xlarge`,
3526
+ className: `${convertToPercentage(size)} rounded-catchup-xlarge`,
3528
3527
  controls: true
3529
3528
  }
3530
3529
  ) });
@@ -3563,6 +3562,7 @@ var ActivityBodyContent = ({
3563
3562
  );
3564
3563
  } else {
3565
3564
  const trimmedAnswer = typeof answer === "string" ? answer.trim() : String(answer);
3565
+ console.log("trimmed answer: ", trimmedAnswer);
3566
3566
  switch (contentType) {
3567
3567
  case "TEXT":
3568
3568
  processedValue = processedValue.replace(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "1.18.7",
3
+ "version": "1.18.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -21,7 +21,6 @@ const ActivityBodyContent = ({
21
21
  while (processedValue.includes("@@")) {
22
22
  const answer = answerMap[currentQQIndex];
23
23
 
24
- // More specific check for empty/undefined answers
25
24
  const isEmpty =
26
25
  answer === undefined ||
27
26
  answer === null ||
@@ -35,10 +34,11 @@ const ActivityBodyContent = ({
35
34
  `----(${currentQQIndex + 1})----`
36
35
  );
37
36
  } else {
38
- // Handle different content types
39
37
  const trimmedAnswer =
40
38
  typeof answer === "string" ? answer.trim() : String(answer);
41
39
 
40
+ console.log("trimmed answer: ", trimmedAnswer);
41
+
42
42
  switch (contentType) {
43
43
  case "TEXT":
44
44
  processedValue = processedValue.replace(
@@ -77,10 +77,8 @@ const ActivityBodyContent = ({
77
77
  };
78
78
  };
79
79
 
80
- // Track the global answer index across all bodies
81
80
  let globalAnswerIndex = 0;
82
81
 
83
- // Process all bodies and their values
84
82
  const processedBodies = Object.keys(bodyMap)
85
83
  .map((key) => {
86
84
  let body;
@@ -91,7 +89,6 @@ const ActivityBodyContent = ({
91
89
  return null;
92
90
  }
93
91
 
94
- // Only process value if needed for certain template types
95
92
  if (["DROPDOWN", "FILL_IN_THE_BLANKS"].includes(templateType)) {
96
93
  const contentType = contentMap["type"];
97
94
  const result = processBodyValue(
@@ -32,7 +32,6 @@ const ShowBodyMediaByContentType = ({
32
32
  }
33
33
  };
34
34
 
35
- // Helper function to render special expressions with proper keys
36
35
  const renderSpecialExpressions = (
37
36
  inputPart: IInputPart,
38
37
  inputPartIndex: number
@@ -55,29 +54,24 @@ const ShowBodyMediaByContentType = ({
55
54
  );
56
55
  };
57
56
 
58
- // Helper function to ensure balanced special characters
59
57
  const balanceSpecialChars = (text: string) => {
60
58
  let result = text;
61
59
 
62
- // Balance underscores
63
60
  if ((result.split("__").length - 1) % 2 === 1) {
64
61
  result = result + "__";
65
62
  }
66
63
 
67
- // Balance asterisks
68
64
  if ((result.split("**").length - 1) % 2 === 1) {
69
65
  result = result + "**";
70
66
  }
71
67
 
72
- // Balance backticks
73
- if ((result.split("`").length - 1) % 2 === 1) {
74
- result = result + "`";
68
+ if ((result.split("$$").length - 1) % 2 === 1) {
69
+ result = result + "$$";
75
70
  }
76
71
 
77
72
  return result;
78
73
  };
79
74
 
80
- // Render text content with proper formatting
81
75
  const renderTextContent = (text: string, itemKey: string) => {
82
76
  const balancedText = balanceSpecialChars(text);
83
77
 
@@ -127,6 +121,8 @@ const ShowBodyMediaByContentType = ({
127
121
  currentIndex++;
128
122
  const itemKey = `text-inside-${index}-${currentIndex}`;
129
123
 
124
+ console.log("text inside: ", textInsideTag);
125
+
130
126
  valuePartList.push(
131
127
  <span key={itemKey} className="text-xl font-bold">
132
128
  {constructInputWithSpecialExpressionList(textInsideTag).map(
@@ -140,8 +136,8 @@ const ShowBodyMediaByContentType = ({
140
136
  firstIndex + checkText.length + secondIndex + checkText.length
141
137
  );
142
138
 
143
- if ((copyValue.split("`").length - 1) % 2 === 1) {
144
- copyValue = "`" + copyValue;
139
+ if ((copyValue.split("$$").length - 1) % 2 === 1) {
140
+ copyValue = "$$" + copyValue;
145
141
  }
146
142
  }
147
143
  };
@@ -419,9 +415,7 @@ const ShowBodyMediaByContentType = ({
419
415
  <div className="mb-1 flex flex-col items-center">
420
416
  <video
421
417
  src={value}
422
- className={`${convertToPercentage(
423
- size || ""
424
- )} rounded-catchup-xlarge`}
418
+ className={`${convertToPercentage(size)} rounded-catchup-xlarge`}
425
419
  controls
426
420
  />
427
421
  </div>