catchup-library-web 1.11.1 → 1.11.3
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.d.mts +50 -2
- package/dist/index.d.ts +50 -2
- package/dist/index.js +320 -61
- package/dist/index.mjs +319 -61
- package/package.json +2 -1
- package/src/components/groups/InputGroup.tsx +112 -0
- package/src/index.ts +1 -0
- package/src/properties/GroupProperties.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -3418,9 +3418,11 @@ var InputGroup = ({
|
|
|
3418
3418
|
theme,
|
|
3419
3419
|
useMinHeight,
|
|
3420
3420
|
disabled,
|
|
3421
|
-
limit
|
|
3421
|
+
limit,
|
|
3422
|
+
useMath
|
|
3422
3423
|
}) => {
|
|
3423
3424
|
const textAreaRef = useRef(null);
|
|
3425
|
+
const mathFieldRef = useRef(null);
|
|
3424
3426
|
useEffect2(() => {
|
|
3425
3427
|
if (!textAreaRef) return;
|
|
3426
3428
|
if (!textAreaRef.current) return;
|
|
@@ -3430,6 +3432,14 @@ var InputGroup = ({
|
|
|
3430
3432
|
textAreaRef.current.style.height = `44px`;
|
|
3431
3433
|
}
|
|
3432
3434
|
}, [textAreaRef, value]);
|
|
3435
|
+
useEffect2(() => {
|
|
3436
|
+
if (!useMath) return;
|
|
3437
|
+
import("mathlive").then(({ MathfieldElement }) => {
|
|
3438
|
+
if (!customElements.get("math-field")) {
|
|
3439
|
+
customElements.define("math-field", MathfieldElement);
|
|
3440
|
+
}
|
|
3441
|
+
});
|
|
3442
|
+
}, [useMath, type, placeholder, title]);
|
|
3433
3443
|
const retrieveNullableOptionList = () => {
|
|
3434
3444
|
if (!optionList) return [];
|
|
3435
3445
|
const currentOptionList = {
|
|
@@ -3457,6 +3467,22 @@ var InputGroup = ({
|
|
|
3457
3467
|
onChange && onChange(e);
|
|
3458
3468
|
}
|
|
3459
3469
|
};
|
|
3470
|
+
const handleMathFieldChange = (event) => {
|
|
3471
|
+
const mathField = event.currentTarget;
|
|
3472
|
+
const syntheticEvent = {
|
|
3473
|
+
target: {
|
|
3474
|
+
value: mathField.value,
|
|
3475
|
+
type: "text"
|
|
3476
|
+
}
|
|
3477
|
+
};
|
|
3478
|
+
onChange && onChange(syntheticEvent);
|
|
3479
|
+
};
|
|
3480
|
+
const handleMathFieldFocus = (event) => {
|
|
3481
|
+
const syntheticEvent = {
|
|
3482
|
+
target: event.currentTarget
|
|
3483
|
+
};
|
|
3484
|
+
onFocus && onFocus(syntheticEvent);
|
|
3485
|
+
};
|
|
3460
3486
|
const CheckboxInputGroup = () => {
|
|
3461
3487
|
return /* @__PURE__ */ jsxs9(
|
|
3462
3488
|
"div",
|
|
@@ -3609,6 +3635,44 @@ var InputGroup = ({
|
|
|
3609
3635
|
] });
|
|
3610
3636
|
};
|
|
3611
3637
|
const TextInputGroup = () => {
|
|
3638
|
+
if (useMath) {
|
|
3639
|
+
return /* @__PURE__ */ jsxs9("div", { className: "my-1 relative", children: [
|
|
3640
|
+
title ? /* @__PURE__ */ jsx16("p", { className: "text-md font-semibold pl-2 py-1 text-catchup-gray-400", children: title }) : null,
|
|
3641
|
+
/* @__PURE__ */ jsx16(
|
|
3642
|
+
"div",
|
|
3643
|
+
{
|
|
3644
|
+
className: `w-full border ${errorText ? "border-catchup-red shadow-error" : "border-catchup-gray-100"} rounded-catchup-large focus-within:border-catchup-blue-400 focus-within:shadow-input ${disabled ? "bg-catchup-lighter-gray" : "bg-white"}`,
|
|
3645
|
+
children: /* @__PURE__ */ jsx16(
|
|
3646
|
+
"math-field",
|
|
3647
|
+
{
|
|
3648
|
+
ref: mathFieldRef,
|
|
3649
|
+
value: value || "",
|
|
3650
|
+
onInput: handleMathFieldChange,
|
|
3651
|
+
onFocus: handleMathFieldFocus,
|
|
3652
|
+
placeholder: errorText ? errorText : placeholder,
|
|
3653
|
+
disabled,
|
|
3654
|
+
"virtual-keyboard-mode": "onfocus",
|
|
3655
|
+
"smart-fence": true,
|
|
3656
|
+
"smart-mode": true,
|
|
3657
|
+
"smart-superscript": true,
|
|
3658
|
+
style: {
|
|
3659
|
+
fontSize: "16px",
|
|
3660
|
+
padding: "8px 16px",
|
|
3661
|
+
border: "none",
|
|
3662
|
+
outline: "none",
|
|
3663
|
+
width: "100%",
|
|
3664
|
+
minHeight: "44px",
|
|
3665
|
+
backgroundColor: disabled ? "#f5f5f5" : "transparent",
|
|
3666
|
+
borderRadius: "16px",
|
|
3667
|
+
fontFamily: "inherit",
|
|
3668
|
+
color: disabled ? "#9ca3af" : "#000000"
|
|
3669
|
+
}
|
|
3670
|
+
}
|
|
3671
|
+
)
|
|
3672
|
+
}
|
|
3673
|
+
)
|
|
3674
|
+
] });
|
|
3675
|
+
}
|
|
3612
3676
|
return /* @__PURE__ */ jsxs9("div", { className: "my-1 relative", children: [
|
|
3613
3677
|
title ? /* @__PURE__ */ jsx16("p", { className: "text-md font-semibold pl-2 py-1 text-catchup-gray-400", children: title }) : null,
|
|
3614
3678
|
/* @__PURE__ */ jsx16(
|
|
@@ -6512,10 +6576,203 @@ var ActivityPreviewByData = ({
|
|
|
6512
6576
|
};
|
|
6513
6577
|
var ActivityPreviewByData_default = ActivityPreviewByData;
|
|
6514
6578
|
|
|
6579
|
+
// src/components/activities/ActivityPreviewByAnswerData.tsx
|
|
6580
|
+
import { useEffect as useEffect14, useState as useState22 } from "react";
|
|
6581
|
+
import { jsx as jsx44, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
6582
|
+
var ActivityPreviewByAnswerData = ({
|
|
6583
|
+
data,
|
|
6584
|
+
showType = true,
|
|
6585
|
+
showDescription = true,
|
|
6586
|
+
lockedType = null,
|
|
6587
|
+
typeOptionList = [],
|
|
6588
|
+
showSolution = false,
|
|
6589
|
+
showEvaluationRubric = false,
|
|
6590
|
+
showTaxonomy = true,
|
|
6591
|
+
isFullScreen = false,
|
|
6592
|
+
showCorrectAnswer = false
|
|
6593
|
+
}) => {
|
|
6594
|
+
var _a;
|
|
6595
|
+
const [key, setKey] = useState22((/* @__PURE__ */ new Date()).getTime());
|
|
6596
|
+
const [selectedType, setSelectedType] = useState22(null);
|
|
6597
|
+
const [optionList, setOptionList] = useState22([]);
|
|
6598
|
+
const [answer, setAnswer] = useState22({ data: [] });
|
|
6599
|
+
useEffect14(() => {
|
|
6600
|
+
if (!data) return;
|
|
6601
|
+
setKey((/* @__PURE__ */ new Date()).getTime());
|
|
6602
|
+
}, [data]);
|
|
6603
|
+
const checkAnswerMapExists = (type) => {
|
|
6604
|
+
if (data && data.answerMap && Array.isArray(data.answerMap)) {
|
|
6605
|
+
const foundAnswer = data.answerMap.find(
|
|
6606
|
+
(answer2) => answer2.type === type
|
|
6607
|
+
);
|
|
6608
|
+
return foundAnswer || null;
|
|
6609
|
+
}
|
|
6610
|
+
return null;
|
|
6611
|
+
};
|
|
6612
|
+
const retrieveTaxonomyNameFromActivityType = (type) => {
|
|
6613
|
+
if (!data) return "";
|
|
6614
|
+
let taxonomyMap = { name: "" };
|
|
6615
|
+
const taxonomyMapNames = {
|
|
6616
|
+
ORDERING: "orderingTaxonomyMap",
|
|
6617
|
+
DROPDOWN: "dropdownTaxonomyMap",
|
|
6618
|
+
MCSA: "MCSATaxonomyMap",
|
|
6619
|
+
MCMA: "MCMATaxonomyMap",
|
|
6620
|
+
MATCHING: "matchingTaxonomyMap",
|
|
6621
|
+
GROUPING: "groupingTaxonomyMap",
|
|
6622
|
+
FILL_IN_THE_BLANKS: "fillInTheBlanksTaxonomyMap",
|
|
6623
|
+
OPEN_ENDED: "openEndedTaxonomyMap",
|
|
6624
|
+
TRUE_FALSE: "trueFalseTaxonomyMap"
|
|
6625
|
+
};
|
|
6626
|
+
const mapName = taxonomyMapNames[type];
|
|
6627
|
+
if (mapName && data[mapName]) {
|
|
6628
|
+
try {
|
|
6629
|
+
taxonomyMap = JSON.parse(data[mapName]);
|
|
6630
|
+
} catch (error) {
|
|
6631
|
+
console.error(`Error parsing taxonomy map for ${type}:`, error);
|
|
6632
|
+
}
|
|
6633
|
+
}
|
|
6634
|
+
return taxonomyMap.name || "";
|
|
6635
|
+
};
|
|
6636
|
+
useEffect14(() => {
|
|
6637
|
+
if (!data) return;
|
|
6638
|
+
const constructAnswerBasedOnData2 = () => {
|
|
6639
|
+
const newAnswer = { data: [] };
|
|
6640
|
+
const activityTypes = [
|
|
6641
|
+
{ type: "ORDERING", materialMap: "orderingMaterialMap" },
|
|
6642
|
+
{ type: "DROPDOWN", materialMap: "dropdownMaterialMap" },
|
|
6643
|
+
{ type: "MCSA", materialMap: "MCSAMaterialMap" },
|
|
6644
|
+
{ type: "MCMA", materialMap: "MCMAMaterialMap" },
|
|
6645
|
+
{ type: "MATCHING", materialMap: "matchingMaterialMap" },
|
|
6646
|
+
{ type: "GROUPING", materialMap: "groupingMaterialMap" },
|
|
6647
|
+
{
|
|
6648
|
+
type: "FILL_IN_THE_BLANKS",
|
|
6649
|
+
materialMap: "fillInTheBlanksMaterialMap"
|
|
6650
|
+
},
|
|
6651
|
+
{ type: "OPEN_ENDED", materialMap: "openEndedMaterialMap" },
|
|
6652
|
+
{ type: "TRUE_FALSE", materialMap: "trueFalseMaterialMap" }
|
|
6653
|
+
];
|
|
6654
|
+
activityTypes.forEach(({ type, materialMap }) => {
|
|
6655
|
+
if (data[materialMap]) {
|
|
6656
|
+
const foundAnswer = checkAnswerMapExists(type);
|
|
6657
|
+
const answerItem = foundAnswer || constructActivityAnswerMap(
|
|
6658
|
+
{ type },
|
|
6659
|
+
JSON.parse(JSON.stringify(data))
|
|
6660
|
+
);
|
|
6661
|
+
newAnswer.data.push(answerItem);
|
|
6662
|
+
}
|
|
6663
|
+
});
|
|
6664
|
+
setAnswer(newAnswer);
|
|
6665
|
+
if (newAnswer.data.length > 0) {
|
|
6666
|
+
if (lockedType && newAnswer.data.find((item) => item.type === lockedType)) {
|
|
6667
|
+
setSelectedType(lockedType);
|
|
6668
|
+
} else {
|
|
6669
|
+
setSelectedType(newAnswer.data[0].type);
|
|
6670
|
+
}
|
|
6671
|
+
}
|
|
6672
|
+
};
|
|
6673
|
+
constructAnswerBasedOnData2();
|
|
6674
|
+
}, [data, lockedType]);
|
|
6675
|
+
useEffect14(() => {
|
|
6676
|
+
if (!data || !answer.data.length) return;
|
|
6677
|
+
let currentTypeOptionList = typeOptionList || answer.data.map((item) => ({
|
|
6678
|
+
id: item.type,
|
|
6679
|
+
text: i18n_default.t(item.type)
|
|
6680
|
+
}));
|
|
6681
|
+
if (lockedType) {
|
|
6682
|
+
currentTypeOptionList = currentTypeOptionList.filter(
|
|
6683
|
+
(typeOption) => typeOption.id === lockedType
|
|
6684
|
+
);
|
|
6685
|
+
}
|
|
6686
|
+
if (showTaxonomy) {
|
|
6687
|
+
setOptionList(
|
|
6688
|
+
currentTypeOptionList.map((typeOption) => __spreadProps(__spreadValues({}, typeOption), {
|
|
6689
|
+
subText: i18n_default.t(retrieveTaxonomyNameFromActivityType(typeOption.id))
|
|
6690
|
+
}))
|
|
6691
|
+
);
|
|
6692
|
+
} else {
|
|
6693
|
+
setOptionList(currentTypeOptionList);
|
|
6694
|
+
}
|
|
6695
|
+
}, [data, answer.data, lockedType, typeOptionList, showTaxonomy]);
|
|
6696
|
+
const RenderSelectedActivityContent = () => {
|
|
6697
|
+
const commonProps = {
|
|
6698
|
+
answer,
|
|
6699
|
+
data,
|
|
6700
|
+
canAnswerQuestion: () => true,
|
|
6701
|
+
changeAnswer: (newAnswer) => setAnswer(JSON.parse(JSON.stringify(newAnswer))),
|
|
6702
|
+
isPreview: true,
|
|
6703
|
+
showCorrectAnswer,
|
|
6704
|
+
isFullScreen
|
|
6705
|
+
};
|
|
6706
|
+
switch (selectedType) {
|
|
6707
|
+
case "ORDERING":
|
|
6708
|
+
return data.orderingBodyMap && data.orderingMaterialMap ? /* @__PURE__ */ jsx44(OrderingActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
6709
|
+
case "DROPDOWN":
|
|
6710
|
+
return data.dropdownBodyMap && data.dropdownMaterialMap ? /* @__PURE__ */ jsx44(DropdownActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
6711
|
+
case "MCSA":
|
|
6712
|
+
return data.MCSABodyMap && data.MCSAMaterialMap ? /* @__PURE__ */ jsx44(MCSAActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
6713
|
+
case "MCMA":
|
|
6714
|
+
return data.MCMABodyMap && data.MCMAMaterialMap ? /* @__PURE__ */ jsx44(MCMAActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
6715
|
+
case "MATCHING":
|
|
6716
|
+
return data.matchingBodyMap && data.matchingMaterialMap ? /* @__PURE__ */ jsx44(MatchingActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
6717
|
+
case "GROUPING":
|
|
6718
|
+
return data.groupingBodyMap && data.groupingMaterialMap ? /* @__PURE__ */ jsx44(GroupingActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
6719
|
+
case "FILL_IN_THE_BLANKS":
|
|
6720
|
+
return data.fillInTheBlanksBodyMap && data.fillInTheBlanksMaterialMap ? /* @__PURE__ */ jsx44(FillInTheBlanksActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
6721
|
+
case "OPEN_ENDED":
|
|
6722
|
+
return data.openEndedBodyMap ? /* @__PURE__ */ jsx44(
|
|
6723
|
+
OpenEndedActivityContent_default,
|
|
6724
|
+
__spreadProps(__spreadValues({}, commonProps), {
|
|
6725
|
+
showMaterialContent: true
|
|
6726
|
+
})
|
|
6727
|
+
) : null;
|
|
6728
|
+
case "TRUE_FALSE":
|
|
6729
|
+
return data.trueFalseBodyMap && data.trueFalseMaterialMap ? /* @__PURE__ */ jsx44(TrueFalseActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
6730
|
+
default:
|
|
6731
|
+
return null;
|
|
6732
|
+
}
|
|
6733
|
+
};
|
|
6734
|
+
if (!data) return null;
|
|
6735
|
+
return /* @__PURE__ */ jsxs34("div", { children: [
|
|
6736
|
+
showType && optionList.length > 0 ? /* @__PURE__ */ jsxs34("div", { className: "mb-4", children: [
|
|
6737
|
+
showDescription ? /* @__PURE__ */ jsx44("div", { className: "my-2", children: /* @__PURE__ */ jsx44("p", { className: "font-semibold text-lg", children: i18n_default.t("activity_template") }) }) : null,
|
|
6738
|
+
/* @__PURE__ */ jsx44(
|
|
6739
|
+
SelectionBox_default,
|
|
6740
|
+
{
|
|
6741
|
+
optionList,
|
|
6742
|
+
selectedId: selectedType,
|
|
6743
|
+
handleSelectOnClick: (itemId) => {
|
|
6744
|
+
setSelectedType(itemId);
|
|
6745
|
+
}
|
|
6746
|
+
}
|
|
6747
|
+
)
|
|
6748
|
+
] }) : null,
|
|
6749
|
+
/* @__PURE__ */ jsx44(DividerLine_default, {}),
|
|
6750
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex flex-col my-2 w-full p-5", children: [
|
|
6751
|
+
((_a = answer == null ? void 0 : answer.data[0]) == null ? void 0 : _a.isEmpty) ? /* @__PURE__ */ jsx44(ActivityEmptyContent_default, {}) : null,
|
|
6752
|
+
selectedType ? /* @__PURE__ */ jsx44("div", { children: RenderSelectedActivityContent() }, selectedType) : null
|
|
6753
|
+
] }),
|
|
6754
|
+
selectedType && showSolution ? /* @__PURE__ */ jsx44("div", { className: "my-4", children: /* @__PURE__ */ jsx44(
|
|
6755
|
+
ActivitySolutionContent_default,
|
|
6756
|
+
{
|
|
6757
|
+
activityTemplateType: selectedType,
|
|
6758
|
+
data
|
|
6759
|
+
}
|
|
6760
|
+
) }) : null,
|
|
6761
|
+
selectedType && showEvaluationRubric ? /* @__PURE__ */ jsx44("div", { className: "my-4", children: /* @__PURE__ */ jsx44(
|
|
6762
|
+
ActivityEvaluationRubricContent_default,
|
|
6763
|
+
{
|
|
6764
|
+
activityTemplateType: selectedType,
|
|
6765
|
+
data
|
|
6766
|
+
}
|
|
6767
|
+
) }) : null
|
|
6768
|
+
] }, key);
|
|
6769
|
+
};
|
|
6770
|
+
var ActivityPreviewByAnswerData_default = ActivityPreviewByAnswerData;
|
|
6771
|
+
|
|
6515
6772
|
// src/components/dividers/BlueVerticalDividerLine.tsx
|
|
6516
|
-
import { jsx as
|
|
6773
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
6517
6774
|
var BlueVerticalDividerLine = ({ opacity }) => {
|
|
6518
|
-
return /* @__PURE__ */
|
|
6775
|
+
return /* @__PURE__ */ jsx45(
|
|
6519
6776
|
"div",
|
|
6520
6777
|
{
|
|
6521
6778
|
className: `w-[2px] h-[40px] my-4 bg-catchup-blue ${opacity === "medium" ? "opacity-50" : ""}`
|
|
@@ -6525,7 +6782,7 @@ var BlueVerticalDividerLine = ({ opacity }) => {
|
|
|
6525
6782
|
var BlueVerticalDividerLine_default = BlueVerticalDividerLine;
|
|
6526
6783
|
|
|
6527
6784
|
// src/components/groups/LeftTextRightInputGroup.tsx
|
|
6528
|
-
import { jsx as
|
|
6785
|
+
import { jsx as jsx46, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
6529
6786
|
var LeftTextRightInputGroup = ({
|
|
6530
6787
|
type,
|
|
6531
6788
|
title,
|
|
@@ -6535,9 +6792,9 @@ var LeftTextRightInputGroup = ({
|
|
|
6535
6792
|
disabled,
|
|
6536
6793
|
errorText
|
|
6537
6794
|
}) => {
|
|
6538
|
-
return /* @__PURE__ */
|
|
6539
|
-
/* @__PURE__ */
|
|
6540
|
-
/* @__PURE__ */
|
|
6795
|
+
return /* @__PURE__ */ jsxs35("div", { className: "w-full flex flex-row mx-2", children: [
|
|
6796
|
+
/* @__PURE__ */ jsx46("div", { className: "w-catchup-input-group-title py-5", children: /* @__PURE__ */ jsx46("p", { children: title }) }),
|
|
6797
|
+
/* @__PURE__ */ jsx46("div", { className: "flex-1", children: /* @__PURE__ */ jsx46(
|
|
6541
6798
|
InputGroup_default,
|
|
6542
6799
|
{
|
|
6543
6800
|
type,
|
|
@@ -6553,14 +6810,14 @@ var LeftTextRightInputGroup = ({
|
|
|
6553
6810
|
var LeftTextRightInputGroup_default = LeftTextRightInputGroup;
|
|
6554
6811
|
|
|
6555
6812
|
// src/components/boxes/SelectionCheckbox.tsx
|
|
6556
|
-
import { jsx as
|
|
6813
|
+
import { jsx as jsx47, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
6557
6814
|
var SelectionCheckbox = ({
|
|
6558
6815
|
optionList,
|
|
6559
6816
|
selectedIdList,
|
|
6560
6817
|
handleSelectOnClick,
|
|
6561
6818
|
handleRemoveOnClick
|
|
6562
6819
|
}) => {
|
|
6563
|
-
return /* @__PURE__ */
|
|
6820
|
+
return /* @__PURE__ */ jsx47("div", { className: "flex flex-row items-center gap-x-4 gap-y-2 flex-wrap text-center", children: optionList.map((option, index) => /* @__PURE__ */ jsx47(
|
|
6564
6821
|
"div",
|
|
6565
6822
|
{
|
|
6566
6823
|
className: `${selectedIdList.findIndex(
|
|
@@ -6575,14 +6832,14 @@ var SelectionCheckbox = ({
|
|
|
6575
6832
|
handleRemoveOnClick(option.id);
|
|
6576
6833
|
}
|
|
6577
6834
|
},
|
|
6578
|
-
children: /* @__PURE__ */
|
|
6835
|
+
children: /* @__PURE__ */ jsxs36(
|
|
6579
6836
|
"div",
|
|
6580
6837
|
{
|
|
6581
6838
|
className: `flex flex-row items-center gap-x-1 ${selectedIdList.findIndex(
|
|
6582
6839
|
(selectedId) => selectedId === option.id
|
|
6583
6840
|
) > -1 ? "opacity-100" : "opacity-50"}`,
|
|
6584
6841
|
children: [
|
|
6585
|
-
/* @__PURE__ */
|
|
6842
|
+
/* @__PURE__ */ jsx47(
|
|
6586
6843
|
BaseImage_default,
|
|
6587
6844
|
{
|
|
6588
6845
|
src: selectedIdList.findIndex(
|
|
@@ -6592,7 +6849,7 @@ var SelectionCheckbox = ({
|
|
|
6592
6849
|
size: "small"
|
|
6593
6850
|
}
|
|
6594
6851
|
),
|
|
6595
|
-
/* @__PURE__ */
|
|
6852
|
+
/* @__PURE__ */ jsx47("div", { className: "flex-1", children: /* @__PURE__ */ jsx47("p", { children: option.text }) })
|
|
6596
6853
|
]
|
|
6597
6854
|
}
|
|
6598
6855
|
)
|
|
@@ -6603,7 +6860,7 @@ var SelectionCheckbox = ({
|
|
|
6603
6860
|
var SelectionCheckbox_default = SelectionCheckbox;
|
|
6604
6861
|
|
|
6605
6862
|
// src/components/tabs/SelectionTab.tsx
|
|
6606
|
-
import { jsx as
|
|
6863
|
+
import { jsx as jsx48, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
6607
6864
|
var SelectionTab = ({
|
|
6608
6865
|
optionList,
|
|
6609
6866
|
selectedId,
|
|
@@ -6613,7 +6870,7 @@ var SelectionTab = ({
|
|
|
6613
6870
|
textColor,
|
|
6614
6871
|
borderColor
|
|
6615
6872
|
}) => {
|
|
6616
|
-
return /* @__PURE__ */
|
|
6873
|
+
return /* @__PURE__ */ jsx48("div", { className: "flex flex-row items-center gap-x-4 gap-y-2 flex-wrap mb-2 text-center", children: optionList.map((option, index) => /* @__PURE__ */ jsxs37(
|
|
6617
6874
|
"div",
|
|
6618
6875
|
{
|
|
6619
6876
|
className: `${selectedId === option.id ? selectedTextColor ? selectedTextColor : "text-catchup-blue-500" : textColor ? textColor : "text-catchup-gray-300"} ${selectedId === option.id ? selectedBorderColor ? selectedBorderColor : "border-catchup-blue-500" : borderColor ? borderColor : "border-catchup-gray-50"} border-b-2 transition-all duration-300 p-3 cursor-pointer`,
|
|
@@ -6621,8 +6878,8 @@ var SelectionTab = ({
|
|
|
6621
6878
|
handleSelectOnClick(option.id);
|
|
6622
6879
|
},
|
|
6623
6880
|
children: [
|
|
6624
|
-
/* @__PURE__ */
|
|
6625
|
-
option.subTitle ? /* @__PURE__ */
|
|
6881
|
+
/* @__PURE__ */ jsx48("p", { className: "text-lg", children: option.title }),
|
|
6882
|
+
option.subTitle ? /* @__PURE__ */ jsx48("p", { className: "text-md", children: option.subTitle }) : null
|
|
6626
6883
|
]
|
|
6627
6884
|
},
|
|
6628
6885
|
index
|
|
@@ -6631,20 +6888,20 @@ var SelectionTab = ({
|
|
|
6631
6888
|
var SelectionTab_default = SelectionTab;
|
|
6632
6889
|
|
|
6633
6890
|
// src/components/tabs/SelectionTabFill.tsx
|
|
6634
|
-
import { jsx as
|
|
6891
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
6635
6892
|
var SelectionTabFill = ({
|
|
6636
6893
|
optionList,
|
|
6637
6894
|
selectedId,
|
|
6638
6895
|
handleSelectOnClick
|
|
6639
6896
|
}) => {
|
|
6640
|
-
return /* @__PURE__ */
|
|
6897
|
+
return /* @__PURE__ */ jsx49("div", { className: "w-full flex flex-row bg-catchup-gray-50 gap-x-2 rounded-catchup-medium px-4 py-2 justify-center text-center", children: optionList.map((option, index) => /* @__PURE__ */ jsx49(
|
|
6641
6898
|
"div",
|
|
6642
6899
|
{
|
|
6643
6900
|
className: "cursor-pointer",
|
|
6644
6901
|
onClick: () => {
|
|
6645
6902
|
handleSelectOnClick(option.id);
|
|
6646
6903
|
},
|
|
6647
|
-
children: /* @__PURE__ */
|
|
6904
|
+
children: /* @__PURE__ */ jsx49(
|
|
6648
6905
|
"p",
|
|
6649
6906
|
{
|
|
6650
6907
|
className: `${selectedId === option.id ? "text-catchup-white bg-catchup-blue-500" : "text-catchup-gray-300"} transition-all duration-300 rounded-catchup-medium px-2 py-1`,
|
|
@@ -6658,57 +6915,57 @@ var SelectionTabFill = ({
|
|
|
6658
6915
|
var SelectionTabFill_default = SelectionTabFill;
|
|
6659
6916
|
|
|
6660
6917
|
// src/components/labels/ActivityTemplateLabel.tsx
|
|
6661
|
-
import { jsx as
|
|
6918
|
+
import { jsx as jsx50, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
6662
6919
|
var ActivityTemplateLabel = ({
|
|
6663
6920
|
title,
|
|
6664
6921
|
font
|
|
6665
6922
|
}) => {
|
|
6666
|
-
return /* @__PURE__ */
|
|
6667
|
-
/* @__PURE__ */
|
|
6668
|
-
/* @__PURE__ */
|
|
6923
|
+
return /* @__PURE__ */ jsx50("div", { className: "px-3 py-1 gap-x-3 border border-grade-label-border bg-grade-label text-grade-label-text rounded-catchup-3xlarge", children: /* @__PURE__ */ jsxs38("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
6924
|
+
/* @__PURE__ */ jsx50(BaseImage_default, { src: "/icons/activity.webp", alt: "label", size: "xsmall" }),
|
|
6925
|
+
/* @__PURE__ */ jsx50("p", { className: font ? font : "text-sm", children: title })
|
|
6669
6926
|
] }) });
|
|
6670
6927
|
};
|
|
6671
6928
|
var ActivityTemplateLabel_default = ActivityTemplateLabel;
|
|
6672
6929
|
|
|
6673
6930
|
// src/components/labels/BrandLabel.tsx
|
|
6674
|
-
import { jsx as
|
|
6931
|
+
import { jsx as jsx51, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
6675
6932
|
var BrandLabel = ({ title, icon, font }) => {
|
|
6676
|
-
return /* @__PURE__ */
|
|
6677
|
-
icon ? icon : /* @__PURE__ */
|
|
6678
|
-
/* @__PURE__ */
|
|
6933
|
+
return /* @__PURE__ */ jsx51("div", { className: "px-3 py-1 gap-x-3 border border-brand-label-border bg-brand-label text-brand-label-text rounded-catchup-3xlarge", children: /* @__PURE__ */ jsxs39("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
6934
|
+
icon ? icon : /* @__PURE__ */ jsx51(BaseImage_default, { src: "/icons/brand-label.webp", alt: "label", size: "xsmall" }),
|
|
6935
|
+
/* @__PURE__ */ jsx51("p", { className: font ? font : "text-sm", children: title })
|
|
6679
6936
|
] }) });
|
|
6680
6937
|
};
|
|
6681
6938
|
var BrandLabel_default = BrandLabel;
|
|
6682
6939
|
|
|
6683
6940
|
// src/components/labels/CoterieLabel.tsx
|
|
6684
|
-
import { jsx as
|
|
6941
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
6685
6942
|
var CoterieLabel = ({ title, font }) => {
|
|
6686
|
-
return /* @__PURE__ */
|
|
6943
|
+
return /* @__PURE__ */ jsx52("div", { className: "px-3 py-1 gap-x-3 border border-brand-label-border bg-brand-label text-brand-label-text rounded-catchup-3xlarge", children: /* @__PURE__ */ jsx52("p", { className: font ? font : "text-sm", children: title }) });
|
|
6687
6944
|
};
|
|
6688
6945
|
var CoterieLabel_default = CoterieLabel;
|
|
6689
6946
|
|
|
6690
6947
|
// src/components/labels/GradeLabel.tsx
|
|
6691
|
-
import { jsx as
|
|
6948
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
6692
6949
|
var GradeLabel = ({ title, font }) => {
|
|
6693
|
-
return /* @__PURE__ */
|
|
6950
|
+
return /* @__PURE__ */ jsx53("div", { className: "px-3 py-1 gap-x-3 border border-grade-label-border bg-grade-label text-grade-label-text rounded-catchup-3xlarge", children: /* @__PURE__ */ jsx53("p", { className: font ? font : "text-sm", children: title }) });
|
|
6694
6951
|
};
|
|
6695
6952
|
var GradeLabel_default = GradeLabel;
|
|
6696
6953
|
|
|
6697
6954
|
// src/components/labels/OutcomeLabel.tsx
|
|
6698
|
-
import { jsx as
|
|
6955
|
+
import { jsx as jsx54, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
6699
6956
|
var OutcomeLabel = ({ title, font }) => {
|
|
6700
|
-
return /* @__PURE__ */
|
|
6701
|
-
/* @__PURE__ */
|
|
6702
|
-
/* @__PURE__ */
|
|
6957
|
+
return /* @__PURE__ */ jsx54("div", { className: "px-3 py-1 gap-x-3 border border-brand-label-border bg-brand-label text-brand-label-text rounded-catchup-3xlarge", children: /* @__PURE__ */ jsxs40("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
6958
|
+
/* @__PURE__ */ jsx54(BaseImage_default, { src: "/icons/category.webp", alt: "label", size: "xsmall" }),
|
|
6959
|
+
/* @__PURE__ */ jsx54("p", { className: font ? font : "text-sm", children: title })
|
|
6703
6960
|
] }) });
|
|
6704
6961
|
};
|
|
6705
6962
|
var OutcomeLabel_default = OutcomeLabel;
|
|
6706
6963
|
|
|
6707
6964
|
// src/components/labels/PersonalLabel.tsx
|
|
6708
|
-
import { jsx as
|
|
6965
|
+
import { jsx as jsx55, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
6709
6966
|
var PersonalLabel = ({ title, icon, font }) => {
|
|
6710
|
-
return /* @__PURE__ */
|
|
6711
|
-
icon ? icon : /* @__PURE__ */
|
|
6967
|
+
return /* @__PURE__ */ jsx55("div", { className: "px-3 py-1 gap-x-3 border border-personal-label-border bg-personal-label text-personal-label-text rounded-catchup-3xlarge", children: /* @__PURE__ */ jsxs41("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
6968
|
+
icon ? icon : /* @__PURE__ */ jsx55(
|
|
6712
6969
|
BaseImage_default,
|
|
6713
6970
|
{
|
|
6714
6971
|
src: "/icons/personal-label.webp",
|
|
@@ -6716,16 +6973,16 @@ var PersonalLabel = ({ title, icon, font }) => {
|
|
|
6716
6973
|
size: "xsmall"
|
|
6717
6974
|
}
|
|
6718
6975
|
),
|
|
6719
|
-
/* @__PURE__ */
|
|
6976
|
+
/* @__PURE__ */ jsx55("p", { className: font ? font : "text-sm", children: title })
|
|
6720
6977
|
] }) });
|
|
6721
6978
|
};
|
|
6722
6979
|
var PersonalLabel_default = PersonalLabel;
|
|
6723
6980
|
|
|
6724
6981
|
// src/components/labels/PublishingHouseLabel.tsx
|
|
6725
|
-
import { jsx as
|
|
6982
|
+
import { jsx as jsx56, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6726
6983
|
var PublishingHouseLabel = ({ title, icon, font }) => {
|
|
6727
|
-
return /* @__PURE__ */
|
|
6728
|
-
icon ? icon : /* @__PURE__ */
|
|
6984
|
+
return /* @__PURE__ */ jsx56("div", { className: "px-3 py-1 gap-x-3 border border-publishing-house-label-border bg-publishing-house-label text-publishing-house-label-text rounded-catchup-3xlarge", children: /* @__PURE__ */ jsxs42("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
6985
|
+
icon ? icon : /* @__PURE__ */ jsx56(
|
|
6729
6986
|
BaseImage_default,
|
|
6730
6987
|
{
|
|
6731
6988
|
src: "/icons/publishing-house-label.webp",
|
|
@@ -6733,79 +6990,79 @@ var PublishingHouseLabel = ({ title, icon, font }) => {
|
|
|
6733
6990
|
size: "xsmall"
|
|
6734
6991
|
}
|
|
6735
6992
|
),
|
|
6736
|
-
/* @__PURE__ */
|
|
6993
|
+
/* @__PURE__ */ jsx56("p", { className: font ? font : "text-sm", children: title })
|
|
6737
6994
|
] }) });
|
|
6738
6995
|
};
|
|
6739
6996
|
var PublishingHouseLabel_default = PublishingHouseLabel;
|
|
6740
6997
|
|
|
6741
6998
|
// src/components/labels/ActivityLabel.tsx
|
|
6742
|
-
import { jsx as
|
|
6999
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
6743
7000
|
var ActivityLabel = ({ title, font }) => {
|
|
6744
|
-
return /* @__PURE__ */
|
|
7001
|
+
return /* @__PURE__ */ jsx57("div", { className: "px-3 py-1 gap-x-3 border border-publishing-house-label-border bg-publishing-house-label text-publishing-house-label-text rounded-catchup-3xlarge", children: /* @__PURE__ */ jsx57("p", { className: font ? font : "text-sm", children: title }) });
|
|
6745
7002
|
};
|
|
6746
7003
|
var ActivityLabel_default = ActivityLabel;
|
|
6747
7004
|
|
|
6748
7005
|
// src/components/infos/InfoWithText.tsx
|
|
6749
|
-
import { jsx as
|
|
7006
|
+
import { jsx as jsx58, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6750
7007
|
var InfoWithText = (props) => {
|
|
6751
7008
|
const { value } = props;
|
|
6752
|
-
return /* @__PURE__ */
|
|
6753
|
-
/* @__PURE__ */
|
|
6754
|
-
/* @__PURE__ */
|
|
7009
|
+
return /* @__PURE__ */ jsxs43("div", { className: "w-full flex flex-row items-center gap-x-2 my-2", children: [
|
|
7010
|
+
/* @__PURE__ */ jsx58(BaseImage_default, { src: "/icons/info.webp", alt: "info", size: "small" }),
|
|
7011
|
+
/* @__PURE__ */ jsx58("div", { className: "flex-1", children: /* @__PURE__ */ jsx58("p", { className: "", children: value }) })
|
|
6755
7012
|
] });
|
|
6756
7013
|
};
|
|
6757
7014
|
var InfoWithText_default = InfoWithText;
|
|
6758
7015
|
|
|
6759
7016
|
// src/components/texts/InputWithSpecialExpression.tsx
|
|
6760
7017
|
import { InlineMath as InlineMath12 } from "react-katex";
|
|
6761
|
-
import { jsx as
|
|
7018
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
6762
7019
|
var InputWithSpecialExpression = ({
|
|
6763
7020
|
value,
|
|
6764
7021
|
showSpecialOnly
|
|
6765
7022
|
}) => {
|
|
6766
7023
|
const inputWithSpecialExpressionList = constructInputWithSpecialExpressionList(value);
|
|
6767
|
-
return showSpecialOnly ? inputWithSpecialExpressionList.length > 1 ? /* @__PURE__ */
|
|
7024
|
+
return showSpecialOnly ? inputWithSpecialExpressionList.length > 1 ? /* @__PURE__ */ jsx59("div", { className: "m-2", children: /* @__PURE__ */ jsx59("span", { className: "whitespace-pre-wrap", children: inputWithSpecialExpressionList.map((inputPart, index) => /* @__PURE__ */ jsx59(
|
|
6768
7025
|
"span",
|
|
6769
7026
|
{
|
|
6770
7027
|
className: `${inputPart.isBold ? "font-semibold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6771
|
-
children: inputPart.isEquation ? /* @__PURE__ */
|
|
7028
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx59("span", { className: "text-lg", children: /* @__PURE__ */ jsx59(InlineMath12, { math: inputPart.value }, index) }) : inputPart.value
|
|
6772
7029
|
}
|
|
6773
|
-
)) }) }) : null : /* @__PURE__ */
|
|
7030
|
+
)) }) }) : null : /* @__PURE__ */ jsx59("div", { className: "m-2", children: /* @__PURE__ */ jsx59("span", { className: "whitespace-pre-wrap", children: inputWithSpecialExpressionList.map((inputPart, index) => /* @__PURE__ */ jsx59(
|
|
6774
7031
|
"span",
|
|
6775
7032
|
{
|
|
6776
7033
|
className: `${inputPart.isBold ? "font-semibold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6777
|
-
children: inputPart.isEquation ? /* @__PURE__ */
|
|
7034
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx59("span", { className: "text-lg", children: /* @__PURE__ */ jsx59(InlineMath12, { math: inputPart.value }, index) }) : inputPart.value
|
|
6778
7035
|
}
|
|
6779
7036
|
)) }) });
|
|
6780
7037
|
};
|
|
6781
7038
|
var InputWithSpecialExpression_default = InputWithSpecialExpression;
|
|
6782
7039
|
|
|
6783
7040
|
// src/components/titles/BaseTitle.tsx
|
|
6784
|
-
import { jsx as
|
|
7041
|
+
import { jsx as jsx60, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6785
7042
|
var BaseTitle = ({
|
|
6786
7043
|
title,
|
|
6787
7044
|
totalItemCount,
|
|
6788
7045
|
itemName,
|
|
6789
7046
|
description
|
|
6790
7047
|
}) => {
|
|
6791
|
-
return /* @__PURE__ */
|
|
6792
|
-
/* @__PURE__ */
|
|
7048
|
+
return /* @__PURE__ */ jsxs44("div", { className: "flex flex-col gap-y-2", children: [
|
|
7049
|
+
/* @__PURE__ */ jsxs44("p", { className: "text-2xl font-medium", children: [
|
|
6793
7050
|
title,
|
|
6794
|
-
totalItemCount && itemName ? /* @__PURE__ */
|
|
7051
|
+
totalItemCount && itemName ? /* @__PURE__ */ jsxs44("span", { className: "p-2 text-base text-catchup-blue-600 border border-catchup-blue-300 rounded-catchup-3xlarge mx-2 bg-catchup-blue-100", children: [
|
|
6795
7052
|
totalItemCount,
|
|
6796
7053
|
" ",
|
|
6797
7054
|
itemName
|
|
6798
7055
|
] }) : null
|
|
6799
7056
|
] }),
|
|
6800
|
-
description ? /* @__PURE__ */
|
|
7057
|
+
description ? /* @__PURE__ */ jsx60("p", { className: "", children: description }) : null
|
|
6801
7058
|
] });
|
|
6802
7059
|
};
|
|
6803
7060
|
var BaseTitle_default = BaseTitle;
|
|
6804
7061
|
|
|
6805
7062
|
// src/components/titles/SubTitle.tsx
|
|
6806
|
-
import { jsx as
|
|
7063
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
6807
7064
|
var SubTitle = ({ title }) => {
|
|
6808
|
-
return /* @__PURE__ */
|
|
7065
|
+
return /* @__PURE__ */ jsx61("p", { className: "text-xl font-medium text-catchup-darker-blue", children: title });
|
|
6809
7066
|
};
|
|
6810
7067
|
var SubTitle_default = SubTitle;
|
|
6811
7068
|
|
|
@@ -9255,6 +9512,7 @@ export {
|
|
|
9255
9512
|
ActivityEmptyContent_default as ActivityEmptyContent,
|
|
9256
9513
|
ActivityEvaluationRubricContent_default as ActivityEvaluationRubricContent,
|
|
9257
9514
|
ActivityLabel_default as ActivityLabel,
|
|
9515
|
+
ActivityPreviewByAnswerData_default as ActivityPreviewByAnswerData,
|
|
9258
9516
|
ActivityPreviewByData_default as ActivityPreviewByData,
|
|
9259
9517
|
ActivitySolutionContent_default as ActivitySolutionContent,
|
|
9260
9518
|
ActivityTemplateLabel_default as ActivityTemplateLabel,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "catchup-library-web",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"license": "ISC",
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"i18next": "^24.2.2",
|
|
15
|
+
"mathlive": "^0.105.3",
|
|
15
16
|
"react": "^18.3.0",
|
|
16
17
|
"react-dnd": "^16.0.1",
|
|
17
18
|
"react-dom": "^18.3.0",
|