catchup-library-web 2.6.14 → 2.6.15

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
@@ -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 = {};
@@ -5410,6 +5420,16 @@ var GroupingActivityMaterialContent = ({
5410
5420
  const ref = (0, import_react21.useRef)(null);
5411
5421
  const dropZoneRefs = (0, import_react21.useRef)({});
5412
5422
  const hasShuffledRef = (0, import_react21.useRef)(false);
5423
+ (0, import_react21.useEffect)(() => {
5424
+ if (!draggedValue) return;
5425
+ const preventScroll = (e) => {
5426
+ e.preventDefault();
5427
+ };
5428
+ document.addEventListener("touchmove", preventScroll, { passive: false });
5429
+ return () => {
5430
+ document.removeEventListener("touchmove", preventScroll);
5431
+ };
5432
+ }, [draggedValue]);
5413
5433
  (0, import_react21.useEffect)(() => {
5414
5434
  if (hasShuffledRef.current) return;
5415
5435
  const shuffleArray2 = (array) => {
@@ -5863,6 +5883,16 @@ var MatchingActivityMaterialContent = ({
5863
5883
  const itemsRef = (0, import_react22.useRef)(null);
5864
5884
  const dropZoneRefs = (0, import_react22.useRef)({});
5865
5885
  const hasShuffledRef = (0, import_react22.useRef)(false);
5886
+ (0, import_react22.useEffect)(() => {
5887
+ if (!draggedValue) return;
5888
+ const preventScroll = (e) => {
5889
+ e.preventDefault();
5890
+ };
5891
+ document.addEventListener("touchmove", preventScroll, { passive: false });
5892
+ return () => {
5893
+ document.removeEventListener("touchmove", preventScroll);
5894
+ };
5895
+ }, [draggedValue]);
5866
5896
  (0, import_react22.useEffect)(() => {
5867
5897
  if (hasShuffledRef.current) return;
5868
5898
  const shuffleArray2 = (array) => {
@@ -6829,6 +6859,16 @@ var OrderingActivityMaterialContent = ({
6829
6859
  y: 0
6830
6860
  });
6831
6861
  const [displayAnswerMap, setDisplayAnswerMap] = (0, import_react25.useState)(answerMap);
6862
+ (0, import_react25.useEffect)(() => {
6863
+ if (!draggedKey) return;
6864
+ const preventScroll = (e) => {
6865
+ e.preventDefault();
6866
+ };
6867
+ document.addEventListener("touchmove", preventScroll, { passive: false });
6868
+ return () => {
6869
+ document.removeEventListener("touchmove", preventScroll);
6870
+ };
6871
+ }, [draggedKey]);
6832
6872
  (0, import_react25.useEffect)(() => {
6833
6873
  if (showCorrectAnswer) {
6834
6874
  const correctAnswerMap = {};
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 = {};
@@ -5172,6 +5182,16 @@ var GroupingActivityMaterialContent = ({
5172
5182
  const ref = useRef5(null);
5173
5183
  const dropZoneRefs = useRef5({});
5174
5184
  const hasShuffledRef = useRef5(false);
5185
+ useEffect10(() => {
5186
+ if (!draggedValue) return;
5187
+ const preventScroll = (e) => {
5188
+ e.preventDefault();
5189
+ };
5190
+ document.addEventListener("touchmove", preventScroll, { passive: false });
5191
+ return () => {
5192
+ document.removeEventListener("touchmove", preventScroll);
5193
+ };
5194
+ }, [draggedValue]);
5175
5195
  useEffect10(() => {
5176
5196
  if (hasShuffledRef.current) return;
5177
5197
  const shuffleArray2 = (array) => {
@@ -5625,6 +5645,16 @@ var MatchingActivityMaterialContent = ({
5625
5645
  const itemsRef = useRef6(null);
5626
5646
  const dropZoneRefs = useRef6({});
5627
5647
  const hasShuffledRef = useRef6(false);
5648
+ useEffect11(() => {
5649
+ if (!draggedValue) return;
5650
+ const preventScroll = (e) => {
5651
+ e.preventDefault();
5652
+ };
5653
+ document.addEventListener("touchmove", preventScroll, { passive: false });
5654
+ return () => {
5655
+ document.removeEventListener("touchmove", preventScroll);
5656
+ };
5657
+ }, [draggedValue]);
5628
5658
  useEffect11(() => {
5629
5659
  if (hasShuffledRef.current) return;
5630
5660
  const shuffleArray2 = (array) => {
@@ -6591,6 +6621,16 @@ var OrderingActivityMaterialContent = ({
6591
6621
  y: 0
6592
6622
  });
6593
6623
  const [displayAnswerMap, setDisplayAnswerMap] = useState24(answerMap);
6624
+ useEffect14(() => {
6625
+ if (!draggedKey) return;
6626
+ const preventScroll = (e) => {
6627
+ e.preventDefault();
6628
+ };
6629
+ document.addEventListener("touchmove", preventScroll, { passive: false });
6630
+ return () => {
6631
+ document.removeEventListener("touchmove", preventScroll);
6632
+ };
6633
+ }, [draggedKey]);
6594
6634
  useEffect14(() => {
6595
6635
  if (showCorrectAnswer) {
6596
6636
  const correctAnswerMap = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "2.6.14",
3
+ "version": "2.6.15",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -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
@@ -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
 
@@ -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;
@@ -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 = {};