catchup-library-web 2.6.14 → 2.6.16
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 +44 -2
- package/dist/index.mjs +44 -2
- package/package.json +1 -1
- package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx +12 -0
- package/src/components/activities/material-contents/GroupingActivityMaterialContent.tsx +12 -1
- package/src/components/activities/material-contents/MatchingActivityMaterialContent.tsx +12 -1
- package/src/components/activities/material-contents/OrderingActivityMaterialContent.tsx +12 -0
package/dist/index.js
CHANGED
|
@@ -4987,6 +4987,16 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4987
4987
|
(0, import_react19.useEffect)(() => {
|
|
4988
4988
|
setShuffleOptionList(shuffleArray(optionList));
|
|
4989
4989
|
}, [optionList]);
|
|
4990
|
+
(0, import_react19.useEffect)(() => {
|
|
4991
|
+
if (!draggedOption) return;
|
|
4992
|
+
const preventScroll = (e) => {
|
|
4993
|
+
e.preventDefault();
|
|
4994
|
+
};
|
|
4995
|
+
document.addEventListener("touchmove", preventScroll, { passive: false });
|
|
4996
|
+
return () => {
|
|
4997
|
+
document.removeEventListener("touchmove", preventScroll);
|
|
4998
|
+
};
|
|
4999
|
+
}, [draggedOption]);
|
|
4990
5000
|
(0, import_react19.useEffect)(() => {
|
|
4991
5001
|
if (showCorrectAnswer) {
|
|
4992
5002
|
const correctAnswerMap = {};
|
|
@@ -5088,6 +5098,7 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
5088
5098
|
"div",
|
|
5089
5099
|
{
|
|
5090
5100
|
className: "flex flex-col h-full",
|
|
5101
|
+
style: { touchAction: draggedOption ? "none" : "auto" },
|
|
5091
5102
|
onMouseMove: handleMouseMove,
|
|
5092
5103
|
onMouseUp: handleMouseUp,
|
|
5093
5104
|
children: [
|
|
@@ -5410,6 +5421,16 @@ var GroupingActivityMaterialContent = ({
|
|
|
5410
5421
|
const ref = (0, import_react21.useRef)(null);
|
|
5411
5422
|
const dropZoneRefs = (0, import_react21.useRef)({});
|
|
5412
5423
|
const hasShuffledRef = (0, import_react21.useRef)(false);
|
|
5424
|
+
(0, import_react21.useEffect)(() => {
|
|
5425
|
+
if (!draggedValue) return;
|
|
5426
|
+
const preventScroll = (e) => {
|
|
5427
|
+
e.preventDefault();
|
|
5428
|
+
};
|
|
5429
|
+
document.addEventListener("touchmove", preventScroll, { passive: false });
|
|
5430
|
+
return () => {
|
|
5431
|
+
document.removeEventListener("touchmove", preventScroll);
|
|
5432
|
+
};
|
|
5433
|
+
}, [draggedValue]);
|
|
5413
5434
|
(0, import_react21.useEffect)(() => {
|
|
5414
5435
|
if (hasShuffledRef.current) return;
|
|
5415
5436
|
const shuffleArray2 = (array) => {
|
|
@@ -5576,7 +5597,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5576
5597
|
}
|
|
5577
5598
|
};
|
|
5578
5599
|
const filteredMaterialList = retrieveFilteredMaterialList(displayAnswerMap);
|
|
5579
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col h-full", onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
|
|
5600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col h-full", style: { touchAction: draggedValue ? "none" : "auto" }, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
|
|
5580
5601
|
draggedValue && mousePosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5581
5602
|
"div",
|
|
5582
5603
|
{
|
|
@@ -5863,6 +5884,16 @@ var MatchingActivityMaterialContent = ({
|
|
|
5863
5884
|
const itemsRef = (0, import_react22.useRef)(null);
|
|
5864
5885
|
const dropZoneRefs = (0, import_react22.useRef)({});
|
|
5865
5886
|
const hasShuffledRef = (0, import_react22.useRef)(false);
|
|
5887
|
+
(0, import_react22.useEffect)(() => {
|
|
5888
|
+
if (!draggedValue) return;
|
|
5889
|
+
const preventScroll = (e) => {
|
|
5890
|
+
e.preventDefault();
|
|
5891
|
+
};
|
|
5892
|
+
document.addEventListener("touchmove", preventScroll, { passive: false });
|
|
5893
|
+
return () => {
|
|
5894
|
+
document.removeEventListener("touchmove", preventScroll);
|
|
5895
|
+
};
|
|
5896
|
+
}, [draggedValue]);
|
|
5866
5897
|
(0, import_react22.useEffect)(() => {
|
|
5867
5898
|
if (hasShuffledRef.current) return;
|
|
5868
5899
|
const shuffleArray2 = (array) => {
|
|
@@ -6021,7 +6052,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
6021
6052
|
}
|
|
6022
6053
|
};
|
|
6023
6054
|
const filteredMaterialList = retrieveFilteredMaterialList(displayAnswerMap);
|
|
6024
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col h-full", onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
|
|
6055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col h-full", style: { touchAction: draggedValue ? "none" : "auto" }, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
|
|
6025
6056
|
draggedValue && mousePosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6026
6057
|
"div",
|
|
6027
6058
|
{
|
|
@@ -6829,6 +6860,16 @@ var OrderingActivityMaterialContent = ({
|
|
|
6829
6860
|
y: 0
|
|
6830
6861
|
});
|
|
6831
6862
|
const [displayAnswerMap, setDisplayAnswerMap] = (0, import_react25.useState)(answerMap);
|
|
6863
|
+
(0, import_react25.useEffect)(() => {
|
|
6864
|
+
if (!draggedKey) return;
|
|
6865
|
+
const preventScroll = (e) => {
|
|
6866
|
+
e.preventDefault();
|
|
6867
|
+
};
|
|
6868
|
+
document.addEventListener("touchmove", preventScroll, { passive: false });
|
|
6869
|
+
return () => {
|
|
6870
|
+
document.removeEventListener("touchmove", preventScroll);
|
|
6871
|
+
};
|
|
6872
|
+
}, [draggedKey]);
|
|
6832
6873
|
(0, import_react25.useEffect)(() => {
|
|
6833
6874
|
if (showCorrectAnswer) {
|
|
6834
6875
|
const correctAnswerMap = {};
|
|
@@ -6924,6 +6965,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6924
6965
|
"div",
|
|
6925
6966
|
{
|
|
6926
6967
|
className: "flex flex-col h-full",
|
|
6968
|
+
style: { touchAction: draggedKey ? "none" : "auto" },
|
|
6927
6969
|
onMouseMove: handleMouseMove,
|
|
6928
6970
|
onMouseUp: handleMouseUp,
|
|
6929
6971
|
children: [
|
package/dist/index.mjs
CHANGED
|
@@ -4749,6 +4749,16 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4749
4749
|
useEffect8(() => {
|
|
4750
4750
|
setShuffleOptionList(shuffleArray(optionList));
|
|
4751
4751
|
}, [optionList]);
|
|
4752
|
+
useEffect8(() => {
|
|
4753
|
+
if (!draggedOption) return;
|
|
4754
|
+
const preventScroll = (e) => {
|
|
4755
|
+
e.preventDefault();
|
|
4756
|
+
};
|
|
4757
|
+
document.addEventListener("touchmove", preventScroll, { passive: false });
|
|
4758
|
+
return () => {
|
|
4759
|
+
document.removeEventListener("touchmove", preventScroll);
|
|
4760
|
+
};
|
|
4761
|
+
}, [draggedOption]);
|
|
4752
4762
|
useEffect8(() => {
|
|
4753
4763
|
if (showCorrectAnswer) {
|
|
4754
4764
|
const correctAnswerMap = {};
|
|
@@ -4850,6 +4860,7 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4850
4860
|
"div",
|
|
4851
4861
|
{
|
|
4852
4862
|
className: "flex flex-col h-full",
|
|
4863
|
+
style: { touchAction: draggedOption ? "none" : "auto" },
|
|
4853
4864
|
onMouseMove: handleMouseMove,
|
|
4854
4865
|
onMouseUp: handleMouseUp,
|
|
4855
4866
|
children: [
|
|
@@ -5172,6 +5183,16 @@ var GroupingActivityMaterialContent = ({
|
|
|
5172
5183
|
const ref = useRef5(null);
|
|
5173
5184
|
const dropZoneRefs = useRef5({});
|
|
5174
5185
|
const hasShuffledRef = useRef5(false);
|
|
5186
|
+
useEffect10(() => {
|
|
5187
|
+
if (!draggedValue) return;
|
|
5188
|
+
const preventScroll = (e) => {
|
|
5189
|
+
e.preventDefault();
|
|
5190
|
+
};
|
|
5191
|
+
document.addEventListener("touchmove", preventScroll, { passive: false });
|
|
5192
|
+
return () => {
|
|
5193
|
+
document.removeEventListener("touchmove", preventScroll);
|
|
5194
|
+
};
|
|
5195
|
+
}, [draggedValue]);
|
|
5175
5196
|
useEffect10(() => {
|
|
5176
5197
|
if (hasShuffledRef.current) return;
|
|
5177
5198
|
const shuffleArray2 = (array) => {
|
|
@@ -5338,7 +5359,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5338
5359
|
}
|
|
5339
5360
|
};
|
|
5340
5361
|
const filteredMaterialList = retrieveFilteredMaterialList(displayAnswerMap);
|
|
5341
|
-
return /* @__PURE__ */ jsxs22("div", { className: "flex flex-col h-full", onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
|
|
5362
|
+
return /* @__PURE__ */ jsxs22("div", { className: "flex flex-col h-full", style: { touchAction: draggedValue ? "none" : "auto" }, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
|
|
5342
5363
|
draggedValue && mousePosition.x > 0 && /* @__PURE__ */ jsx32(
|
|
5343
5364
|
"div",
|
|
5344
5365
|
{
|
|
@@ -5625,6 +5646,16 @@ var MatchingActivityMaterialContent = ({
|
|
|
5625
5646
|
const itemsRef = useRef6(null);
|
|
5626
5647
|
const dropZoneRefs = useRef6({});
|
|
5627
5648
|
const hasShuffledRef = useRef6(false);
|
|
5649
|
+
useEffect11(() => {
|
|
5650
|
+
if (!draggedValue) return;
|
|
5651
|
+
const preventScroll = (e) => {
|
|
5652
|
+
e.preventDefault();
|
|
5653
|
+
};
|
|
5654
|
+
document.addEventListener("touchmove", preventScroll, { passive: false });
|
|
5655
|
+
return () => {
|
|
5656
|
+
document.removeEventListener("touchmove", preventScroll);
|
|
5657
|
+
};
|
|
5658
|
+
}, [draggedValue]);
|
|
5628
5659
|
useEffect11(() => {
|
|
5629
5660
|
if (hasShuffledRef.current) return;
|
|
5630
5661
|
const shuffleArray2 = (array) => {
|
|
@@ -5783,7 +5814,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5783
5814
|
}
|
|
5784
5815
|
};
|
|
5785
5816
|
const filteredMaterialList = retrieveFilteredMaterialList(displayAnswerMap);
|
|
5786
|
-
return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col h-full", onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
|
|
5817
|
+
return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col h-full", style: { touchAction: draggedValue ? "none" : "auto" }, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
|
|
5787
5818
|
draggedValue && mousePosition.x > 0 && /* @__PURE__ */ jsx34(
|
|
5788
5819
|
"div",
|
|
5789
5820
|
{
|
|
@@ -6591,6 +6622,16 @@ var OrderingActivityMaterialContent = ({
|
|
|
6591
6622
|
y: 0
|
|
6592
6623
|
});
|
|
6593
6624
|
const [displayAnswerMap, setDisplayAnswerMap] = useState24(answerMap);
|
|
6625
|
+
useEffect14(() => {
|
|
6626
|
+
if (!draggedKey) return;
|
|
6627
|
+
const preventScroll = (e) => {
|
|
6628
|
+
e.preventDefault();
|
|
6629
|
+
};
|
|
6630
|
+
document.addEventListener("touchmove", preventScroll, { passive: false });
|
|
6631
|
+
return () => {
|
|
6632
|
+
document.removeEventListener("touchmove", preventScroll);
|
|
6633
|
+
};
|
|
6634
|
+
}, [draggedKey]);
|
|
6594
6635
|
useEffect14(() => {
|
|
6595
6636
|
if (showCorrectAnswer) {
|
|
6596
6637
|
const correctAnswerMap = {};
|
|
@@ -6686,6 +6727,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6686
6727
|
"div",
|
|
6687
6728
|
{
|
|
6688
6729
|
className: "flex flex-col h-full",
|
|
6730
|
+
style: { touchAction: draggedKey ? "none" : "auto" },
|
|
6689
6731
|
onMouseMove: handleMouseMove,
|
|
6690
6732
|
onMouseUp: handleMouseUp,
|
|
6691
6733
|
children: [
|
package/package.json
CHANGED
package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx
CHANGED
|
@@ -42,6 +42,17 @@ const FillInTheBlanksActivityMaterialContent = ({
|
|
|
42
42
|
setShuffleOptionList(shuffleArray(optionList));
|
|
43
43
|
}, [optionList]);
|
|
44
44
|
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (!draggedOption) return;
|
|
47
|
+
const preventScroll = (e: TouchEvent) => {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
};
|
|
50
|
+
document.addEventListener("touchmove", preventScroll, { passive: false });
|
|
51
|
+
return () => {
|
|
52
|
+
document.removeEventListener("touchmove", preventScroll);
|
|
53
|
+
};
|
|
54
|
+
}, [draggedOption]);
|
|
55
|
+
|
|
45
56
|
useEffect(() => {
|
|
46
57
|
if (showCorrectAnswer) {
|
|
47
58
|
// Create correct answer map where each key maps to the first correct answer
|
|
@@ -177,6 +188,7 @@ const FillInTheBlanksActivityMaterialContent = ({
|
|
|
177
188
|
return (
|
|
178
189
|
<div
|
|
179
190
|
className="flex flex-col h-full"
|
|
191
|
+
style={{ touchAction: draggedOption ? "none" : "auto" }}
|
|
180
192
|
onMouseMove={handleMouseMove}
|
|
181
193
|
onMouseUp={handleMouseUp}
|
|
182
194
|
>
|
|
@@ -36,6 +36,17 @@ const GroupingActivityMaterialContent = ({
|
|
|
36
36
|
const dropZoneRefs = useRef<{ [key: string]: HTMLDivElement | null }>({});
|
|
37
37
|
const hasShuffledRef = useRef<boolean>(false);
|
|
38
38
|
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!draggedValue) return;
|
|
41
|
+
const preventScroll = (e: TouchEvent) => {
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
};
|
|
44
|
+
document.addEventListener("touchmove", preventScroll, { passive: false });
|
|
45
|
+
return () => {
|
|
46
|
+
document.removeEventListener("touchmove", preventScroll);
|
|
47
|
+
};
|
|
48
|
+
}, [draggedValue]);
|
|
49
|
+
|
|
39
50
|
useEffect(() => {
|
|
40
51
|
if (hasShuffledRef.current) return;
|
|
41
52
|
|
|
@@ -255,7 +266,7 @@ const GroupingActivityMaterialContent = ({
|
|
|
255
266
|
const filteredMaterialList = retrieveFilteredMaterialList(displayAnswerMap);
|
|
256
267
|
|
|
257
268
|
return (
|
|
258
|
-
<div className="flex flex-col h-full" onMouseMove={handleMouseMove} onMouseUp={handleMouseUp}>
|
|
269
|
+
<div className="flex flex-col h-full" style={{ touchAction: draggedValue ? "none" : "auto" }} onMouseMove={handleMouseMove} onMouseUp={handleMouseUp}>
|
|
259
270
|
{/* Floating drag preview for mouse */}
|
|
260
271
|
{draggedValue && mousePosition.x > 0 && (
|
|
261
272
|
<div
|
|
@@ -36,6 +36,17 @@ const MatchingActivityMaterialContent = ({
|
|
|
36
36
|
const dropZoneRefs = useRef<{ [key: string]: HTMLDivElement | null }>({});
|
|
37
37
|
const hasShuffledRef = useRef<boolean>(false);
|
|
38
38
|
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!draggedValue) return;
|
|
41
|
+
const preventScroll = (e: TouchEvent) => {
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
};
|
|
44
|
+
document.addEventListener("touchmove", preventScroll, { passive: false });
|
|
45
|
+
return () => {
|
|
46
|
+
document.removeEventListener("touchmove", preventScroll);
|
|
47
|
+
};
|
|
48
|
+
}, [draggedValue]);
|
|
49
|
+
|
|
39
50
|
useEffect(() => {
|
|
40
51
|
// Only shuffle once, ever
|
|
41
52
|
if (hasShuffledRef.current) return;
|
|
@@ -254,7 +265,7 @@ const MatchingActivityMaterialContent = ({
|
|
|
254
265
|
const filteredMaterialList = retrieveFilteredMaterialList(displayAnswerMap);
|
|
255
266
|
|
|
256
267
|
return (
|
|
257
|
-
<div className="flex flex-col h-full" onMouseMove={handleMouseMove} onMouseUp={handleMouseUp}>
|
|
268
|
+
<div className="flex flex-col h-full" style={{ touchAction: draggedValue ? "none" : "auto" }} onMouseMove={handleMouseMove} onMouseUp={handleMouseUp}>
|
|
258
269
|
{draggedValue && mousePosition.x > 0 && (
|
|
259
270
|
<div
|
|
260
271
|
className="fixed pointer-events-none z-50 opacity-80"
|
|
@@ -31,6 +31,17 @@ const OrderingActivityMaterialContent = ({
|
|
|
31
31
|
});
|
|
32
32
|
const [displayAnswerMap, setDisplayAnswerMap] = useState<any>(answerMap);
|
|
33
33
|
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!draggedKey) return;
|
|
36
|
+
const preventScroll = (e: TouchEvent) => {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
};
|
|
39
|
+
document.addEventListener("touchmove", preventScroll, { passive: false });
|
|
40
|
+
return () => {
|
|
41
|
+
document.removeEventListener("touchmove", preventScroll);
|
|
42
|
+
};
|
|
43
|
+
}, [draggedKey]);
|
|
44
|
+
|
|
34
45
|
useEffect(() => {
|
|
35
46
|
if (showCorrectAnswer) {
|
|
36
47
|
const correctAnswerMap: any = {};
|
|
@@ -155,6 +166,7 @@ const OrderingActivityMaterialContent = ({
|
|
|
155
166
|
return (
|
|
156
167
|
<div
|
|
157
168
|
className="flex flex-col h-full"
|
|
169
|
+
style={{ touchAction: draggedKey ? "none" : "auto" }}
|
|
158
170
|
onMouseMove={handleMouseMove}
|
|
159
171
|
onMouseUp={handleMouseUp}
|
|
160
172
|
>
|