catchup-library-web 1.20.35 → 1.21.0
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 +1056 -823
- package/dist/index.mjs +971 -738
- package/package.json +2 -6
- package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx +62 -2
- package/src/components/activities/material-contents/GroupingActivityMaterialContent.tsx +363 -203
- package/src/components/activities/material-contents/MatchingActivityMaterialContent.tsx +318 -172
- package/src/components/activities/material-contents/OrderingActivityMaterialContent.tsx +76 -2
- package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent2.tsx +0 -306
- package/src/components/activities/material-contents/OrderingActivityMaterialContent2.tsx +0 -231
- package/src/components/dnds/DraggableDroppableItem.tsx +0 -60
- package/src/components/dnds/DraggableItem.tsx +0 -39
- package/src/components/dnds/DroppableItem.tsx +0 -33
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { useRef } from "react";
|
|
2
|
-
import { useDrag, useDrop } from "react-dnd";
|
|
3
|
-
import { IDraggableDroppableItemProps } from "../../properties/DnDProperties";
|
|
4
|
-
|
|
5
|
-
const DraggableDroppableItem = ({
|
|
6
|
-
item,
|
|
7
|
-
type,
|
|
8
|
-
component,
|
|
9
|
-
moveCardHandler,
|
|
10
|
-
dropRef,
|
|
11
|
-
target,
|
|
12
|
-
setTarget,
|
|
13
|
-
}: IDraggableDroppableItemProps) => {
|
|
14
|
-
const ref = useRef(null);
|
|
15
|
-
|
|
16
|
-
const [, drop] = useDrop({
|
|
17
|
-
accept: type,
|
|
18
|
-
hover() {
|
|
19
|
-
if (!ref.current) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (item.index && target !== item.index) {
|
|
23
|
-
setTarget(item.index);
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const [{ isDragging }, drag] = useDrag({
|
|
29
|
-
type,
|
|
30
|
-
item,
|
|
31
|
-
end: (item, monitor) => {
|
|
32
|
-
const dropResult = monitor.getDropResult();
|
|
33
|
-
if (dropResult) {
|
|
34
|
-
moveCardHandler();
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
collect: (monitor) => ({
|
|
38
|
-
isDragging: monitor.isDragging(),
|
|
39
|
-
}),
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const opacity = isDragging ? 0.4 : 1;
|
|
43
|
-
|
|
44
|
-
drag(drop(ref));
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<div
|
|
48
|
-
className={`${
|
|
49
|
-
isDragging ? "w-[0px] opacity-0" : "w-full opacity-100"
|
|
50
|
-
} transition-all duration-500`}
|
|
51
|
-
ref={dropRef}
|
|
52
|
-
>
|
|
53
|
-
<div ref={ref} className="w-full" style={{ opacity }}>
|
|
54
|
-
{component}
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export default DraggableDroppableItem;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { useDrag } from "react-dnd";
|
|
2
|
-
import { IDraggableItemProps } from "../../properties/DnDProperties";
|
|
3
|
-
|
|
4
|
-
const DraggableItem = ({
|
|
5
|
-
item,
|
|
6
|
-
type,
|
|
7
|
-
component,
|
|
8
|
-
moveCardHandler,
|
|
9
|
-
}: IDraggableItemProps) => {
|
|
10
|
-
const [{ isDragging }, drag] = useDrag({
|
|
11
|
-
type,
|
|
12
|
-
item,
|
|
13
|
-
end: (item, monitor) => {
|
|
14
|
-
const dropResult = monitor.getDropResult();
|
|
15
|
-
if (dropResult) {
|
|
16
|
-
moveCardHandler();
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
collect: (monitor) => ({
|
|
20
|
-
isDragging: monitor.isDragging(),
|
|
21
|
-
}),
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const opacity = isDragging ? 0.4 : 1;
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<div
|
|
28
|
-
className={`${
|
|
29
|
-
isDragging ? "w-[0px] opacity-0" : "opacity-100"
|
|
30
|
-
} transition-all duration-500`}
|
|
31
|
-
>
|
|
32
|
-
<div ref={drag} className="" style={{ opacity }}>
|
|
33
|
-
{component}
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default DraggableItem;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { useRef } from "react";
|
|
2
|
-
import { useDrop } from "react-dnd";
|
|
3
|
-
import { IDroppableItemProps } from "../../properties/DnDProperties";
|
|
4
|
-
|
|
5
|
-
const DroppableItem = ({
|
|
6
|
-
item,
|
|
7
|
-
type,
|
|
8
|
-
component,
|
|
9
|
-
dropRef,
|
|
10
|
-
target,
|
|
11
|
-
setTarget,
|
|
12
|
-
}: IDroppableItemProps) => {
|
|
13
|
-
const ref = useRef(null);
|
|
14
|
-
|
|
15
|
-
const [, drop] = useDrop({
|
|
16
|
-
accept: type,
|
|
17
|
-
hover() {
|
|
18
|
-
if (item.index !== null && target !== item.index) {
|
|
19
|
-
setTarget(item.index);
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
dropRef(drop(ref));
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<div className={`w-full transition-all duration-500 h-full`} ref={ref}>
|
|
28
|
-
{component}
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default DroppableItem;
|