catchup-library-web 1.14.4 → 1.14.6
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
|
@@ -3270,14 +3270,14 @@ var ShowBodyMediaByContentType = ({
|
|
|
3270
3270
|
return "";
|
|
3271
3271
|
}
|
|
3272
3272
|
};
|
|
3273
|
-
const renderSpecialExpressions = (inputPart
|
|
3273
|
+
const renderSpecialExpressions = (inputPart) => {
|
|
3274
3274
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3275
3275
|
"span",
|
|
3276
3276
|
{
|
|
3277
3277
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
3278
3278
|
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_katex.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
3279
3279
|
},
|
|
3280
|
-
|
|
3280
|
+
index
|
|
3281
3281
|
);
|
|
3282
3282
|
};
|
|
3283
3283
|
const balanceSpecialChars = (text) => {
|
|
@@ -3295,8 +3295,8 @@ var ShowBodyMediaByContentType = ({
|
|
|
3295
3295
|
};
|
|
3296
3296
|
const renderTextContent = (text, itemKey) => {
|
|
3297
3297
|
const balancedText = balanceSpecialChars(text);
|
|
3298
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-xl
|
|
3299
|
-
(inputPart
|
|
3298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-xl", children: constructInputWithSpecialExpressionList(balancedText).map(
|
|
3299
|
+
(inputPart) => renderSpecialExpressions(inputPart)
|
|
3300
3300
|
) }, itemKey);
|
|
3301
3301
|
};
|
|
3302
3302
|
const handleOpenFullScreen = (imageSource) => {
|
|
@@ -3328,8 +3328,8 @@ var ShowBodyMediaByContentType = ({
|
|
|
3328
3328
|
currentIndex++;
|
|
3329
3329
|
const itemKey = `text-inside-${index}-${currentIndex}`;
|
|
3330
3330
|
valuePartList.push(
|
|
3331
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-xl font-bold
|
|
3332
|
-
(inputPart
|
|
3331
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-xl font-bold", children: constructInputWithSpecialExpressionList(textInsideTag).map(
|
|
3332
|
+
(inputPart) => renderSpecialExpressions(inputPart)
|
|
3333
3333
|
) }, itemKey)
|
|
3334
3334
|
);
|
|
3335
3335
|
copyValue = copyValue.substring(
|
|
@@ -3508,7 +3508,7 @@ var ShowBodyMediaByContentType = ({
|
|
|
3508
3508
|
className: "bg-catchup-gray-50 relative px-4 py-4 rounded-catchup-small mt-2",
|
|
3509
3509
|
children: [
|
|
3510
3510
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "absolute -top-3 bg-catchup-white border rounded-catchup-small px-2 left-2", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "font-bold", children: i18n_default.t("image_description") }) }),
|
|
3511
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-xl
|
|
3511
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-xl", children: imageText })
|
|
3512
3512
|
]
|
|
3513
3513
|
},
|
|
3514
3514
|
`img-desc-${index}-${currentIndex}`
|
|
@@ -3580,9 +3580,9 @@ var ShowBodyMediaByContentType = ({
|
|
|
3580
3580
|
const RenderMainContent = () => {
|
|
3581
3581
|
switch (type) {
|
|
3582
3582
|
case "TEXT":
|
|
3583
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mb-
|
|
3583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mb-1 flex flex-row flex-wrap items-center mx-auto w-full", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "whitespace-pre-wrap", children: retrieveValueParts(value) }) });
|
|
3584
3584
|
case "IMAGE":
|
|
3585
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mb-
|
|
3585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mb-1 flex flex-col items-center relative", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3586
3586
|
"div",
|
|
3587
3587
|
{
|
|
3588
3588
|
className: `${convertToPercentage(
|
|
@@ -3618,7 +3618,7 @@ var ShowBodyMediaByContentType = ({
|
|
|
3618
3618
|
}
|
|
3619
3619
|
) });
|
|
3620
3620
|
case "VIDEO":
|
|
3621
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mb-
|
|
3621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mb-1 flex flex-col items-center", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3622
3622
|
"video",
|
|
3623
3623
|
{
|
|
3624
3624
|
src: value,
|
|
@@ -3629,7 +3629,7 @@ var ShowBodyMediaByContentType = ({
|
|
|
3629
3629
|
}
|
|
3630
3630
|
) });
|
|
3631
3631
|
case "AUDIO":
|
|
3632
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mb-
|
|
3632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mb-1 flex flex-col items-center", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("audio", { src: value, controls: true, className: "rounded-catchup-xlarge" }) });
|
|
3633
3633
|
default:
|
|
3634
3634
|
return null;
|
|
3635
3635
|
}
|
|
@@ -6745,10 +6745,10 @@ var ActivityEvaluationRubricContent = ({
|
|
|
6745
6745
|
Object.keys(evaluationRubricMap).map((key, index) => {
|
|
6746
6746
|
const currentItem = JSON.parse(evaluationRubricMap[key]);
|
|
6747
6747
|
const { value } = currentItem;
|
|
6748
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6749
|
-
"
|
|
6748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6749
|
+
"p",
|
|
6750
6750
|
{
|
|
6751
|
-
className: "text-xl whitespace-pre-wrap",
|
|
6751
|
+
className: "my-1 text-xl whitespace-pre-wrap",
|
|
6752
6752
|
children: constructInputWithSpecialExpressionList(value).map(
|
|
6753
6753
|
(inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6754
6754
|
"span",
|
|
@@ -6761,7 +6761,7 @@ var ActivityEvaluationRubricContent = ({
|
|
|
6761
6761
|
)
|
|
6762
6762
|
},
|
|
6763
6763
|
`${key}_${index}`
|
|
6764
|
-
)
|
|
6764
|
+
);
|
|
6765
6765
|
})
|
|
6766
6766
|
] }) });
|
|
6767
6767
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -3061,14 +3061,14 @@ var ShowBodyMediaByContentType = ({
|
|
|
3061
3061
|
return "";
|
|
3062
3062
|
}
|
|
3063
3063
|
};
|
|
3064
|
-
const renderSpecialExpressions = (inputPart
|
|
3064
|
+
const renderSpecialExpressions = (inputPart) => {
|
|
3065
3065
|
return /* @__PURE__ */ jsx16(
|
|
3066
3066
|
"span",
|
|
3067
3067
|
{
|
|
3068
3068
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
3069
3069
|
children: inputPart.isEquation ? /* @__PURE__ */ jsx16("span", { className: "text-2xl", children: /* @__PURE__ */ jsx16(InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
3070
3070
|
},
|
|
3071
|
-
|
|
3071
|
+
index
|
|
3072
3072
|
);
|
|
3073
3073
|
};
|
|
3074
3074
|
const balanceSpecialChars = (text) => {
|
|
@@ -3086,8 +3086,8 @@ var ShowBodyMediaByContentType = ({
|
|
|
3086
3086
|
};
|
|
3087
3087
|
const renderTextContent = (text, itemKey) => {
|
|
3088
3088
|
const balancedText = balanceSpecialChars(text);
|
|
3089
|
-
return /* @__PURE__ */ jsx16("span", { className: "text-xl
|
|
3090
|
-
(inputPart
|
|
3089
|
+
return /* @__PURE__ */ jsx16("span", { className: "text-xl", children: constructInputWithSpecialExpressionList(balancedText).map(
|
|
3090
|
+
(inputPart) => renderSpecialExpressions(inputPart)
|
|
3091
3091
|
) }, itemKey);
|
|
3092
3092
|
};
|
|
3093
3093
|
const handleOpenFullScreen = (imageSource) => {
|
|
@@ -3119,8 +3119,8 @@ var ShowBodyMediaByContentType = ({
|
|
|
3119
3119
|
currentIndex++;
|
|
3120
3120
|
const itemKey = `text-inside-${index}-${currentIndex}`;
|
|
3121
3121
|
valuePartList.push(
|
|
3122
|
-
/* @__PURE__ */ jsx16("span", { className: "text-xl font-bold
|
|
3123
|
-
(inputPart
|
|
3122
|
+
/* @__PURE__ */ jsx16("span", { className: "text-xl font-bold", children: constructInputWithSpecialExpressionList(textInsideTag).map(
|
|
3123
|
+
(inputPart) => renderSpecialExpressions(inputPart)
|
|
3124
3124
|
) }, itemKey)
|
|
3125
3125
|
);
|
|
3126
3126
|
copyValue = copyValue.substring(
|
|
@@ -3299,7 +3299,7 @@ var ShowBodyMediaByContentType = ({
|
|
|
3299
3299
|
className: "bg-catchup-gray-50 relative px-4 py-4 rounded-catchup-small mt-2",
|
|
3300
3300
|
children: [
|
|
3301
3301
|
/* @__PURE__ */ jsx16("div", { className: "absolute -top-3 bg-catchup-white border rounded-catchup-small px-2 left-2", children: /* @__PURE__ */ jsx16("p", { className: "font-bold", children: i18n_default.t("image_description") }) }),
|
|
3302
|
-
/* @__PURE__ */ jsx16("span", { className: "text-xl
|
|
3302
|
+
/* @__PURE__ */ jsx16("span", { className: "text-xl", children: imageText })
|
|
3303
3303
|
]
|
|
3304
3304
|
},
|
|
3305
3305
|
`img-desc-${index}-${currentIndex}`
|
|
@@ -3371,9 +3371,9 @@ var ShowBodyMediaByContentType = ({
|
|
|
3371
3371
|
const RenderMainContent = () => {
|
|
3372
3372
|
switch (type) {
|
|
3373
3373
|
case "TEXT":
|
|
3374
|
-
return /* @__PURE__ */ jsx16("div", { className: "mb-
|
|
3374
|
+
return /* @__PURE__ */ jsx16("div", { className: "mb-1 flex flex-row flex-wrap items-center mx-auto w-full", children: /* @__PURE__ */ jsx16("p", { className: "whitespace-pre-wrap", children: retrieveValueParts(value) }) });
|
|
3375
3375
|
case "IMAGE":
|
|
3376
|
-
return /* @__PURE__ */ jsx16("div", { className: "mb-
|
|
3376
|
+
return /* @__PURE__ */ jsx16("div", { className: "mb-1 flex flex-col items-center relative", children: /* @__PURE__ */ jsxs10(
|
|
3377
3377
|
"div",
|
|
3378
3378
|
{
|
|
3379
3379
|
className: `${convertToPercentage(
|
|
@@ -3409,7 +3409,7 @@ var ShowBodyMediaByContentType = ({
|
|
|
3409
3409
|
}
|
|
3410
3410
|
) });
|
|
3411
3411
|
case "VIDEO":
|
|
3412
|
-
return /* @__PURE__ */ jsx16("div", { className: "mb-
|
|
3412
|
+
return /* @__PURE__ */ jsx16("div", { className: "mb-1 flex flex-col items-center", children: /* @__PURE__ */ jsx16(
|
|
3413
3413
|
"video",
|
|
3414
3414
|
{
|
|
3415
3415
|
src: value,
|
|
@@ -3420,7 +3420,7 @@ var ShowBodyMediaByContentType = ({
|
|
|
3420
3420
|
}
|
|
3421
3421
|
) });
|
|
3422
3422
|
case "AUDIO":
|
|
3423
|
-
return /* @__PURE__ */ jsx16("div", { className: "mb-
|
|
3423
|
+
return /* @__PURE__ */ jsx16("div", { className: "mb-1 flex flex-col items-center", children: /* @__PURE__ */ jsx16("audio", { src: value, controls: true, className: "rounded-catchup-xlarge" }) });
|
|
3424
3424
|
default:
|
|
3425
3425
|
return null;
|
|
3426
3426
|
}
|
|
@@ -6536,10 +6536,10 @@ var ActivityEvaluationRubricContent = ({
|
|
|
6536
6536
|
Object.keys(evaluationRubricMap).map((key, index) => {
|
|
6537
6537
|
const currentItem = JSON.parse(evaluationRubricMap[key]);
|
|
6538
6538
|
const { value } = currentItem;
|
|
6539
|
-
return /* @__PURE__ */ jsx45(
|
|
6540
|
-
"
|
|
6539
|
+
return /* @__PURE__ */ jsx45(
|
|
6540
|
+
"p",
|
|
6541
6541
|
{
|
|
6542
|
-
className: "text-xl whitespace-pre-wrap",
|
|
6542
|
+
className: "my-1 text-xl whitespace-pre-wrap",
|
|
6543
6543
|
children: constructInputWithSpecialExpressionList(value).map(
|
|
6544
6544
|
(inputPart, index2) => /* @__PURE__ */ jsx45(
|
|
6545
6545
|
"span",
|
|
@@ -6552,7 +6552,7 @@ var ActivityEvaluationRubricContent = ({
|
|
|
6552
6552
|
)
|
|
6553
6553
|
},
|
|
6554
6554
|
`${key}_${index}`
|
|
6555
|
-
)
|
|
6555
|
+
);
|
|
6556
6556
|
})
|
|
6557
6557
|
] }) });
|
|
6558
6558
|
};
|
package/package.json
CHANGED
|
@@ -33,14 +33,10 @@ const ShowBodyMediaByContentType = ({
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
// Helper function to render special expressions with proper keys
|
|
36
|
-
const renderSpecialExpressions = (
|
|
37
|
-
inputPart: IInputPart,
|
|
38
|
-
partIndex: number,
|
|
39
|
-
parentKey: string
|
|
40
|
-
) => {
|
|
36
|
+
const renderSpecialExpressions = (inputPart: IInputPart) => {
|
|
41
37
|
return (
|
|
42
38
|
<span
|
|
43
|
-
key={
|
|
39
|
+
key={index}
|
|
44
40
|
className={`${inputPart.isBold ? "font-bold" : ""} ${
|
|
45
41
|
inputPart.isUnderline ? "underline" : ""
|
|
46
42
|
}`}
|
|
@@ -83,10 +79,9 @@ const ShowBodyMediaByContentType = ({
|
|
|
83
79
|
const balancedText = balanceSpecialChars(text);
|
|
84
80
|
|
|
85
81
|
return (
|
|
86
|
-
<span key={itemKey} className="text-xl
|
|
82
|
+
<span key={itemKey} className="text-xl">
|
|
87
83
|
{constructInputWithSpecialExpressionList(balancedText).map(
|
|
88
|
-
(inputPart: IInputPart
|
|
89
|
-
renderSpecialExpressions(inputPart, exprIndex, itemKey)
|
|
84
|
+
(inputPart: IInputPart) => renderSpecialExpressions(inputPart)
|
|
90
85
|
)}
|
|
91
86
|
</span>
|
|
92
87
|
);
|
|
@@ -131,10 +126,9 @@ const ShowBodyMediaByContentType = ({
|
|
|
131
126
|
const itemKey = `text-inside-${index}-${currentIndex}`;
|
|
132
127
|
|
|
133
128
|
valuePartList.push(
|
|
134
|
-
<span key={itemKey} className="text-xl font-bold
|
|
129
|
+
<span key={itemKey} className="text-xl font-bold">
|
|
135
130
|
{constructInputWithSpecialExpressionList(textInsideTag).map(
|
|
136
|
-
(inputPart: IInputPart
|
|
137
|
-
renderSpecialExpressions(inputPart, exprIndex, itemKey)
|
|
131
|
+
(inputPart: IInputPart) => renderSpecialExpressions(inputPart)
|
|
138
132
|
)}
|
|
139
133
|
</span>
|
|
140
134
|
);
|
|
@@ -331,7 +325,7 @@ const ShowBodyMediaByContentType = ({
|
|
|
331
325
|
<div className="absolute -top-3 bg-catchup-white border rounded-catchup-small px-2 left-2">
|
|
332
326
|
<p className="font-bold">{i18n.t("image_description")}</p>
|
|
333
327
|
</div>
|
|
334
|
-
<span className="text-xl
|
|
328
|
+
<span className="text-xl">{imageText}</span>
|
|
335
329
|
</div>
|
|
336
330
|
);
|
|
337
331
|
} else {
|
|
@@ -403,13 +397,13 @@ const ShowBodyMediaByContentType = ({
|
|
|
403
397
|
switch (type) {
|
|
404
398
|
case "TEXT":
|
|
405
399
|
return (
|
|
406
|
-
<div className="mb-
|
|
407
|
-
{retrieveValueParts(value)}
|
|
400
|
+
<div className="mb-1 flex flex-row flex-wrap items-center mx-auto w-full">
|
|
401
|
+
<p className="whitespace-pre-wrap">{retrieveValueParts(value)}</p>
|
|
408
402
|
</div>
|
|
409
403
|
);
|
|
410
404
|
case "IMAGE":
|
|
411
405
|
return (
|
|
412
|
-
<div className="mb-
|
|
406
|
+
<div className="mb-1 flex flex-col items-center relative">
|
|
413
407
|
<div
|
|
414
408
|
className={`${convertToPercentage(
|
|
415
409
|
size || ""
|
|
@@ -437,7 +431,7 @@ const ShowBodyMediaByContentType = ({
|
|
|
437
431
|
);
|
|
438
432
|
case "VIDEO":
|
|
439
433
|
return (
|
|
440
|
-
<div className="mb-
|
|
434
|
+
<div className="mb-1 flex flex-col items-center">
|
|
441
435
|
<video
|
|
442
436
|
src={value}
|
|
443
437
|
className={`${convertToPercentage(
|
|
@@ -449,7 +443,7 @@ const ShowBodyMediaByContentType = ({
|
|
|
449
443
|
);
|
|
450
444
|
case "AUDIO":
|
|
451
445
|
return (
|
|
452
|
-
<div className="mb-
|
|
446
|
+
<div className="mb-1 flex flex-col items-center">
|
|
453
447
|
<audio src={value} controls className="rounded-catchup-xlarge" />
|
|
454
448
|
</div>
|
|
455
449
|
);
|
package/src/components/activities/evaluation-rubric-content/ActivityEvaluationRubricContent.tsx
CHANGED
|
@@ -44,30 +44,28 @@ const ActivityEvaluationRubricContent = ({
|
|
|
44
44
|
const currentItem = JSON.parse(evaluationRubricMap[key]);
|
|
45
45
|
const { value } = currentItem;
|
|
46
46
|
return (
|
|
47
|
-
<p
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
)}
|
|
70
|
-
</span>
|
|
47
|
+
<p
|
|
48
|
+
key={`${key}_${index}`}
|
|
49
|
+
className="my-1 text-xl whitespace-pre-wrap"
|
|
50
|
+
>
|
|
51
|
+
{constructInputWithSpecialExpressionList(value).map(
|
|
52
|
+
(inputPart, index) => (
|
|
53
|
+
<span
|
|
54
|
+
key={index}
|
|
55
|
+
className={`${inputPart.isBold ? "font-bold" : ""} ${
|
|
56
|
+
inputPart.isUnderline ? "underline" : ""
|
|
57
|
+
}`}
|
|
58
|
+
>
|
|
59
|
+
{inputPart.isEquation ? (
|
|
60
|
+
<span className="text-2xl">
|
|
61
|
+
<InlineMath math={inputPart.value} />
|
|
62
|
+
</span>
|
|
63
|
+
) : (
|
|
64
|
+
inputPart.value
|
|
65
|
+
)}
|
|
66
|
+
</span>
|
|
67
|
+
)
|
|
68
|
+
)}
|
|
71
69
|
</p>
|
|
72
70
|
);
|
|
73
71
|
})}
|