eli-video-interview 1.2.39 → 1.2.40-alpha.2
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/esm/components/react-photo-view/Photo.css +14 -0
- package/esm/components/react-photo-view/Photo.d.ts +18 -0
- package/esm/components/react-photo-view/Photo.js +54 -0
- package/esm/components/react-photo-view/PhotoBox.css +18 -0
- package/esm/components/react-photo-view/PhotoBox.d.ts +22 -0
- package/esm/components/react-photo-view/PhotoBox.js +302 -0
- package/esm/components/react-photo-view/PhotoPage.d.ts +9 -0
- package/esm/components/react-photo-view/PhotoPage.js +77 -0
- package/esm/components/react-photo-view/PhotoProvider.d.ts +14 -0
- package/esm/components/react-photo-view/PhotoProvider.js +98 -0
- package/esm/components/react-photo-view/PhotoSlider.css +125 -0
- package/esm/components/react-photo-view/PhotoSlider.d.ts +12 -0
- package/esm/components/react-photo-view/PhotoSlider.js +262 -0
- package/esm/components/react-photo-view/PhotoView.d.ts +30 -0
- package/esm/components/react-photo-view/PhotoView.js +48 -0
- package/esm/components/react-photo-view/components/ArrowLeft.d.ts +3 -0
- package/esm/components/react-photo-view/components/ArrowLeft.js +18 -0
- package/esm/components/react-photo-view/components/ArrowRight.d.ts +3 -0
- package/esm/components/react-photo-view/components/ArrowRight.js +18 -0
- package/esm/components/react-photo-view/components/CloseIcon.d.ts +3 -0
- package/esm/components/react-photo-view/components/CloseIcon.js +16 -0
- package/esm/components/react-photo-view/components/PreventScroll.d.ts +1 -0
- package/esm/components/react-photo-view/components/PreventScroll.js +12 -0
- package/esm/components/react-photo-view/components/SlidePortal.css +10 -0
- package/esm/components/react-photo-view/components/SlidePortal.d.ts +7 -0
- package/esm/components/react-photo-view/components/SlidePortal.js +30 -0
- package/esm/components/react-photo-view/components/Spinner.css +23 -0
- package/esm/components/react-photo-view/components/Spinner.d.ts +4 -0
- package/esm/components/react-photo-view/components/Spinner.js +29 -0
- package/esm/components/react-photo-view/hooks/useAdjacentImages.d.ts +5 -0
- package/esm/components/react-photo-view/hooks/useAdjacentImages.js +14 -0
- package/esm/components/react-photo-view/hooks/useAnimationOrigin.d.ts +6 -0
- package/esm/components/react-photo-view/hooks/useAnimationOrigin.js +72 -0
- package/esm/components/react-photo-view/hooks/useAnimationPosition.d.ts +2 -0
- package/esm/components/react-photo-view/hooks/useAnimationPosition.js +28 -0
- package/esm/components/react-photo-view/hooks/useAnimationVisible.d.ts +6 -0
- package/esm/components/react-photo-view/hooks/useAnimationVisible.js +49 -0
- package/esm/components/react-photo-view/hooks/useContinuousTap.d.ts +8 -0
- package/esm/components/react-photo-view/hooks/useContinuousTap.js +36 -0
- package/esm/components/react-photo-view/hooks/useDebounceCallback.d.ts +10 -0
- package/esm/components/react-photo-view/hooks/useDebounceCallback.js +48 -0
- package/esm/components/react-photo-view/hooks/useEventListener.d.ts +1 -0
- package/esm/components/react-photo-view/hooks/useEventListener.js +18 -0
- package/esm/components/react-photo-view/hooks/useForkedVariable.d.ts +5 -0
- package/esm/components/react-photo-view/hooks/useForkedVariable.js +17 -0
- package/esm/components/react-photo-view/hooks/useInitial.d.ts +1 -0
- package/esm/components/react-photo-view/hooks/useInitial.js +9 -0
- package/esm/components/react-photo-view/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
- package/esm/components/react-photo-view/hooks/useIsomorphicLayoutEffect.js +3 -0
- package/esm/components/react-photo-view/hooks/useMethods.d.ts +4 -0
- package/esm/components/react-photo-view/hooks/useMethods.js +35 -0
- package/esm/components/react-photo-view/hooks/useMountedRef.d.ts +3 -0
- package/esm/components/react-photo-view/hooks/useMountedRef.js +12 -0
- package/esm/components/react-photo-view/hooks/useScrollPosition.d.ts +4 -0
- package/esm/components/react-photo-view/hooks/useScrollPosition.js +157 -0
- package/esm/components/react-photo-view/hooks/useSetState.d.ts +2 -0
- package/esm/components/react-photo-view/hooks/useSetState.js +15 -0
- package/esm/components/react-photo-view/hooks/useTargetScale.d.ts +4 -0
- package/esm/components/react-photo-view/hooks/useTargetScale.js +70 -0
- package/esm/components/react-photo-view/index.d.ts +4 -0
- package/esm/components/react-photo-view/index.js +4 -0
- package/esm/components/react-photo-view/photo-context.d.ts +11 -0
- package/esm/components/react-photo-view/photo-context.js +2 -0
- package/esm/components/react-photo-view/types.d.ts +196 -0
- package/esm/components/react-photo-view/types.js +1 -0
- package/esm/components/react-photo-view/utils/edgeHandle.d.ts +15 -0
- package/esm/components/react-photo-view/utils/edgeHandle.js +40 -0
- package/esm/components/react-photo-view/utils/getMultipleTouchPosition.d.ts +5 -0
- package/esm/components/react-photo-view/utils/getMultipleTouchPosition.js +11 -0
- package/esm/components/react-photo-view/utils/getPositionOnMoveOrScale.d.ts +9 -0
- package/esm/components/react-photo-view/utils/getPositionOnMoveOrScale.js +31 -0
- package/esm/components/react-photo-view/utils/getRotateSize.d.ts +4 -0
- package/esm/components/react-photo-view/utils/getRotateSize.js +11 -0
- package/esm/components/react-photo-view/utils/getSuitableImageSize.d.ts +10 -0
- package/esm/components/react-photo-view/utils/getSuitableImageSize.js +42 -0
- package/esm/components/react-photo-view/utils/isTouchDevice.d.ts +5 -0
- package/esm/components/react-photo-view/utils/isTouchDevice.js +5 -0
- package/esm/components/react-photo-view/utils/limitTarget.d.ts +5 -0
- package/esm/components/react-photo-view/utils/limitTarget.js +12 -0
- package/esm/components/react-photo-view/variables.d.ts +48 -0
- package/esm/components/react-photo-view/variables.js +48 -0
- package/esm/constants/ai-question.d.ts +9 -0
- package/esm/constants/ai-question.js +33 -4
- package/esm/enum/ai-question.d.ts +5 -2
- package/esm/enum/ai-question.js +3 -0
- package/esm/modules/ai-ability/Root.js +15 -4
- package/esm/modules/ai-ability-select/Root.js +2 -2
- package/esm/modules/ai-ability-select/interface.d.ts +1 -0
- package/esm/modules/ai-question/components/BootVideo/index.js +1 -1
- package/esm/modules/ai-question/components/QuestionModel/Item.js +14 -9
- package/esm/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +10 -5
- package/esm/modules/ai-question/components/QuestionUpdate/Chioce.d.ts +17 -0
- package/esm/modules/ai-question/components/QuestionUpdate/Chioce.js +96 -0
- package/esm/modules/ai-question/components/QuestionUpdate/Form.js +42 -12
- package/esm/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +14 -4
- package/esm/modules/ai-question/components/QuestionUpdate/const.js +4 -0
- package/esm/modules/ai-question/components/QuestionUpdate/index.js +12 -14
- package/esm/modules/ai-question/components/QuestionUpdate/interface.d.ts +8 -0
- package/esm/modules/ai-question/components/QuestionUpdate/styled.d.ts +15 -0
- package/esm/modules/ai-question/components/QuestionUpdate/styled.js +53 -1
- package/esm/modules/ai-report/components/ScoreReport/Score.js +4 -1
- package/esm/modules/ai-report/components/VideoQuestion/BodyImages.d.ts +7 -0
- package/esm/modules/ai-report/components/VideoQuestion/BodyImages.js +40 -0
- package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.js +5 -3
- package/esm/modules/ai-report/components/VideoQuestion/SingleChoice.d.ts +8 -0
- package/esm/modules/ai-report/components/VideoQuestion/SingleChoice.js +25 -0
- package/esm/modules/ai-report/components/VideoQuestion/styled.d.ts +1 -0
- package/esm/modules/ai-report/components/VideoQuestion/styled.js +7 -1
- package/esm/modules/ai-report/interface.d.ts +19 -0
- package/esm/services/ai-ability.d.ts +1 -1
- package/esm/services/ai-ability.js +1 -1
- package/lib/components/react-photo-view/Photo.css +14 -0
- package/lib/components/react-photo-view/Photo.d.ts +18 -0
- package/lib/components/react-photo-view/Photo.js +60 -0
- package/lib/components/react-photo-view/PhotoBox.css +18 -0
- package/lib/components/react-photo-view/PhotoBox.d.ts +22 -0
- package/lib/components/react-photo-view/PhotoBox.js +308 -0
- package/lib/components/react-photo-view/PhotoPage.d.ts +9 -0
- package/lib/components/react-photo-view/PhotoPage.js +79 -0
- package/lib/components/react-photo-view/PhotoProvider.d.ts +14 -0
- package/lib/components/react-photo-view/PhotoProvider.js +104 -0
- package/lib/components/react-photo-view/PhotoSlider.css +125 -0
- package/lib/components/react-photo-view/PhotoSlider.d.ts +12 -0
- package/lib/components/react-photo-view/PhotoSlider.js +268 -0
- package/lib/components/react-photo-view/PhotoView.d.ts +30 -0
- package/lib/components/react-photo-view/PhotoView.js +53 -0
- package/lib/components/react-photo-view/components/ArrowLeft.d.ts +3 -0
- package/lib/components/react-photo-view/components/ArrowLeft.js +20 -0
- package/lib/components/react-photo-view/components/ArrowRight.d.ts +3 -0
- package/lib/components/react-photo-view/components/ArrowRight.js +20 -0
- package/lib/components/react-photo-view/components/CloseIcon.d.ts +3 -0
- package/lib/components/react-photo-view/components/CloseIcon.js +18 -0
- package/lib/components/react-photo-view/components/PreventScroll.d.ts +1 -0
- package/lib/components/react-photo-view/components/PreventScroll.js +15 -0
- package/lib/components/react-photo-view/components/SlidePortal.css +10 -0
- package/lib/components/react-photo-view/components/SlidePortal.d.ts +7 -0
- package/lib/components/react-photo-view/components/SlidePortal.js +32 -0
- package/lib/components/react-photo-view/components/Spinner.css +23 -0
- package/lib/components/react-photo-view/components/Spinner.d.ts +4 -0
- package/lib/components/react-photo-view/components/Spinner.js +31 -0
- package/lib/components/react-photo-view/hooks/useAdjacentImages.d.ts +5 -0
- package/lib/components/react-photo-view/hooks/useAdjacentImages.js +17 -0
- package/lib/components/react-photo-view/hooks/useAnimationOrigin.d.ts +6 -0
- package/lib/components/react-photo-view/hooks/useAnimationOrigin.js +78 -0
- package/lib/components/react-photo-view/hooks/useAnimationPosition.d.ts +2 -0
- package/lib/components/react-photo-view/hooks/useAnimationPosition.js +34 -0
- package/lib/components/react-photo-view/hooks/useAnimationVisible.d.ts +6 -0
- package/lib/components/react-photo-view/hooks/useAnimationVisible.js +55 -0
- package/lib/components/react-photo-view/hooks/useContinuousTap.d.ts +8 -0
- package/lib/components/react-photo-view/hooks/useContinuousTap.js +42 -0
- package/lib/components/react-photo-view/hooks/useDebounceCallback.d.ts +10 -0
- package/lib/components/react-photo-view/hooks/useDebounceCallback.js +51 -0
- package/lib/components/react-photo-view/hooks/useEventListener.d.ts +1 -0
- package/lib/components/react-photo-view/hooks/useEventListener.js +21 -0
- package/lib/components/react-photo-view/hooks/useForkedVariable.d.ts +5 -0
- package/lib/components/react-photo-view/hooks/useForkedVariable.js +20 -0
- package/lib/components/react-photo-view/hooks/useInitial.d.ts +1 -0
- package/lib/components/react-photo-view/hooks/useInitial.js +12 -0
- package/lib/components/react-photo-view/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
- package/lib/components/react-photo-view/hooks/useIsomorphicLayoutEffect.js +5 -0
- package/lib/components/react-photo-view/hooks/useMethods.d.ts +4 -0
- package/lib/components/react-photo-view/hooks/useMethods.js +38 -0
- package/lib/components/react-photo-view/hooks/useMountedRef.d.ts +3 -0
- package/lib/components/react-photo-view/hooks/useMountedRef.js +14 -0
- package/lib/components/react-photo-view/hooks/useScrollPosition.d.ts +4 -0
- package/lib/components/react-photo-view/hooks/useScrollPosition.js +163 -0
- package/lib/components/react-photo-view/hooks/useSetState.d.ts +2 -0
- package/lib/components/react-photo-view/hooks/useSetState.js +18 -0
- package/lib/components/react-photo-view/hooks/useTargetScale.d.ts +4 -0
- package/lib/components/react-photo-view/hooks/useTargetScale.js +76 -0
- package/lib/components/react-photo-view/index.d.ts +4 -0
- package/lib/components/react-photo-view/index.js +12 -0
- package/lib/components/react-photo-view/photo-context.d.ts +11 -0
- package/lib/components/react-photo-view/photo-context.js +4 -0
- package/lib/components/react-photo-view/types.d.ts +196 -0
- package/lib/components/react-photo-view/types.js +2 -0
- package/lib/components/react-photo-view/utils/edgeHandle.d.ts +15 -0
- package/lib/components/react-photo-view/utils/edgeHandle.js +45 -0
- package/lib/components/react-photo-view/utils/getMultipleTouchPosition.d.ts +5 -0
- package/lib/components/react-photo-view/utils/getMultipleTouchPosition.js +14 -0
- package/lib/components/react-photo-view/utils/getPositionOnMoveOrScale.d.ts +9 -0
- package/lib/components/react-photo-view/utils/getPositionOnMoveOrScale.js +34 -0
- package/lib/components/react-photo-view/utils/getRotateSize.d.ts +4 -0
- package/lib/components/react-photo-view/utils/getRotateSize.js +14 -0
- package/lib/components/react-photo-view/utils/getSuitableImageSize.d.ts +10 -0
- package/lib/components/react-photo-view/utils/getSuitableImageSize.js +48 -0
- package/lib/components/react-photo-view/utils/isTouchDevice.d.ts +5 -0
- package/lib/components/react-photo-view/utils/isTouchDevice.js +7 -0
- package/lib/components/react-photo-view/utils/limitTarget.d.ts +5 -0
- package/lib/components/react-photo-view/utils/limitTarget.js +17 -0
- package/lib/components/react-photo-view/variables.d.ts +48 -0
- package/lib/components/react-photo-view/variables.js +51 -0
- package/lib/constants/ai-question.d.ts +9 -0
- package/lib/constants/ai-question.js +34 -5
- package/lib/enum/ai-question.d.ts +5 -2
- package/lib/enum/ai-question.js +3 -0
- package/lib/modules/ai-ability/Root.js +15 -4
- package/lib/modules/ai-ability-select/Root.js +2 -2
- package/lib/modules/ai-ability-select/interface.d.ts +1 -0
- package/lib/modules/ai-question/components/BootVideo/index.js +1 -1
- package/lib/modules/ai-question/components/QuestionModel/Item.js +11 -6
- package/lib/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +8 -3
- package/lib/modules/ai-question/components/QuestionUpdate/Chioce.d.ts +17 -0
- package/lib/modules/ai-question/components/QuestionUpdate/Chioce.js +103 -0
- package/lib/modules/ai-question/components/QuestionUpdate/Form.js +40 -10
- package/lib/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +12 -2
- package/lib/modules/ai-question/components/QuestionUpdate/const.js +4 -0
- package/lib/modules/ai-question/components/QuestionUpdate/index.js +11 -13
- package/lib/modules/ai-question/components/QuestionUpdate/interface.d.ts +8 -0
- package/lib/modules/ai-question/components/QuestionUpdate/styled.d.ts +15 -0
- package/lib/modules/ai-question/components/QuestionUpdate/styled.js +53 -1
- package/lib/modules/ai-report/components/ScoreReport/Score.js +4 -1
- package/lib/modules/ai-report/components/VideoQuestion/BodyImages.d.ts +7 -0
- package/lib/modules/ai-report/components/VideoQuestion/BodyImages.js +45 -0
- package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.js +4 -2
- package/lib/modules/ai-report/components/VideoQuestion/SingleChoice.d.ts +8 -0
- package/lib/modules/ai-report/components/VideoQuestion/SingleChoice.js +27 -0
- package/lib/modules/ai-report/components/VideoQuestion/styled.d.ts +1 -0
- package/lib/modules/ai-report/components/VideoQuestion/styled.js +8 -2
- package/lib/modules/ai-report/interface.d.ts +19 -0
- package/lib/services/ai-ability.d.ts +1 -1
- package/lib/services/ai-ability.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
@keyframes PhotoView__fade {
|
|
2
|
+
from {
|
|
3
|
+
opacity: 0;
|
|
4
|
+
}
|
|
5
|
+
to {
|
|
6
|
+
opacity: 1;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
.PhotoView-Slider__clean .PhotoView-Slider__BannerWrap,
|
|
10
|
+
.PhotoView-Slider__clean .PhotoView-Slider__ArrowLeft,
|
|
11
|
+
.PhotoView-Slider__clean .PhotoView-Slider__ArrowRight,
|
|
12
|
+
.PhotoView-Slider__clean .PhotoView-Slider__Overlay {
|
|
13
|
+
opacity: 0;
|
|
14
|
+
}
|
|
15
|
+
.PhotoView-Slider__willClose .PhotoView-Slider__BannerWrap:hover {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
}
|
|
18
|
+
.PhotoView-Slider__Backdrop {
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 0;
|
|
21
|
+
left: 0;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
background: #000000;
|
|
25
|
+
transition-property: background-color;
|
|
26
|
+
z-index: -1;
|
|
27
|
+
}
|
|
28
|
+
.PhotoView-Slider__fadeIn {
|
|
29
|
+
opacity: 0;
|
|
30
|
+
animation: PhotoView__fade linear both;
|
|
31
|
+
}
|
|
32
|
+
.PhotoView-Slider__fadeOut {
|
|
33
|
+
opacity: 0;
|
|
34
|
+
animation: PhotoView__fade linear both reverse;
|
|
35
|
+
}
|
|
36
|
+
.PhotoView-Slider__BannerWrap {
|
|
37
|
+
position: absolute;
|
|
38
|
+
left: 0;
|
|
39
|
+
top: 0;
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
align-items: center;
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 44px;
|
|
45
|
+
color: white;
|
|
46
|
+
transition: opacity 0.2s ease-out;
|
|
47
|
+
z-index: 20;
|
|
48
|
+
}
|
|
49
|
+
.PhotoView-Slider__BannerWrap:hover {
|
|
50
|
+
opacity: 1;
|
|
51
|
+
}
|
|
52
|
+
.PhotoView-Slider__Counter {
|
|
53
|
+
padding: 0 10px;
|
|
54
|
+
font-size: 14px;
|
|
55
|
+
opacity: 0.75;
|
|
56
|
+
}
|
|
57
|
+
.PhotoView-Slider__BannerRight {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
width: 48px;
|
|
62
|
+
height: 48px;
|
|
63
|
+
z-index: 20;
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
user-select: none;
|
|
66
|
+
border-radius: 24px;
|
|
67
|
+
margin-top: 16px;
|
|
68
|
+
margin-right: 16px;
|
|
69
|
+
background: rgba(0, 0, 0, 0.56);
|
|
70
|
+
}
|
|
71
|
+
.PhotoView-Slider__BannerRight svg {
|
|
72
|
+
box-sizing: content-box;
|
|
73
|
+
padding: 10px;
|
|
74
|
+
width: 24px;
|
|
75
|
+
height: 24px;
|
|
76
|
+
fill: white;
|
|
77
|
+
}
|
|
78
|
+
.PhotoView-Slider__toolbarIcon {
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
padding: 10px;
|
|
81
|
+
fill: white;
|
|
82
|
+
opacity: 0.75;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
transition: opacity 0.2s linear;
|
|
85
|
+
}
|
|
86
|
+
.PhotoView-Slider__toolbarIcon:hover {
|
|
87
|
+
opacity: 1;
|
|
88
|
+
}
|
|
89
|
+
.PhotoView-Slider__ArrowLeft,
|
|
90
|
+
.PhotoView-Slider__ArrowRight {
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 0;
|
|
93
|
+
bottom: 0;
|
|
94
|
+
display: flex;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
align-items: center;
|
|
97
|
+
width: 56px;
|
|
98
|
+
height: 56px;
|
|
99
|
+
margin: auto;
|
|
100
|
+
opacity: 0.75;
|
|
101
|
+
z-index: 20;
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
user-select: none;
|
|
104
|
+
transition: opacity 0.2s linear;
|
|
105
|
+
border-radius: 28px;
|
|
106
|
+
background: rgba(0, 0, 0, 0.56);
|
|
107
|
+
}
|
|
108
|
+
.PhotoView-Slider__ArrowLeft:hover,
|
|
109
|
+
.PhotoView-Slider__ArrowRight:hover {
|
|
110
|
+
opacity: 1;
|
|
111
|
+
}
|
|
112
|
+
.PhotoView-Slider__ArrowLeft svg,
|
|
113
|
+
.PhotoView-Slider__ArrowRight svg {
|
|
114
|
+
box-sizing: content-box;
|
|
115
|
+
padding: 10px;
|
|
116
|
+
width: 24px;
|
|
117
|
+
height: 24px;
|
|
118
|
+
fill: white;
|
|
119
|
+
}
|
|
120
|
+
.PhotoView-Slider__ArrowLeft {
|
|
121
|
+
left: 24px;
|
|
122
|
+
}
|
|
123
|
+
.PhotoView-Slider__ArrowRight {
|
|
124
|
+
right: 24px;
|
|
125
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './PhotoSlider.css';
|
|
3
|
+
import type { DataType, PhotoProviderBase } from './types';
|
|
4
|
+
export interface IPhotoSliderProps extends PhotoProviderBase {
|
|
5
|
+
images: DataType[];
|
|
6
|
+
index?: number;
|
|
7
|
+
onIndexChange?: (index: number) => void;
|
|
8
|
+
visible: boolean;
|
|
9
|
+
onClose: (evt?: React.MouseEvent | React.TouchEvent) => void;
|
|
10
|
+
afterClose?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export default function PhotoSlider(props: IPhotoSliderProps): JSX.Element | null;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { useRef, useState } from 'react';
|
|
14
|
+
import ArrowLeft from './components/ArrowLeft';
|
|
15
|
+
import ArrowRight from './components/ArrowRight';
|
|
16
|
+
import CloseIcon from './components/CloseIcon';
|
|
17
|
+
import PreventScroll from './components/PreventScroll';
|
|
18
|
+
import SlidePortal from './components/SlidePortal';
|
|
19
|
+
import useAdjacentImages from './hooks/useAdjacentImages';
|
|
20
|
+
import useAnimationVisible from './hooks/useAnimationVisible';
|
|
21
|
+
import useEventListener from './hooks/useEventListener';
|
|
22
|
+
import useIsomorphicLayoutEffect from './hooks/useIsomorphicLayoutEffect';
|
|
23
|
+
import useMethods from './hooks/useMethods';
|
|
24
|
+
import useSetState from './hooks/useSetState';
|
|
25
|
+
import PhotoBox from './PhotoBox';
|
|
26
|
+
import './PhotoSlider.css';
|
|
27
|
+
import isTouchDevice from './utils/isTouchDevice';
|
|
28
|
+
import { limitNumber } from './utils/limitTarget';
|
|
29
|
+
import { defaultEasing, defaultOpacity, defaultSpeed, horizontalOffset, maxMoveOffset } from './variables';
|
|
30
|
+
var initialState = {
|
|
31
|
+
x: 0,
|
|
32
|
+
touched: false,
|
|
33
|
+
pause: false,
|
|
34
|
+
lastCX: undefined,
|
|
35
|
+
lastCY: undefined,
|
|
36
|
+
bg: undefined,
|
|
37
|
+
lastBg: undefined,
|
|
38
|
+
overlay: true,
|
|
39
|
+
minimal: true,
|
|
40
|
+
scale: 1,
|
|
41
|
+
rotate: 0,
|
|
42
|
+
};
|
|
43
|
+
export default function PhotoSlider(props) {
|
|
44
|
+
var _a = props.loop, loop = _a === void 0 ? 3 : _a, speedFn = props.speed, easingFn = props.easing, photoClosable = props.photoClosable, _b = props.maskClosable, maskClosable = _b === void 0 ? true : _b, _c = props.maskOpacity, maskOpacity = _c === void 0 ? defaultOpacity : _c, _d = props.pullClosable, pullClosable = _d === void 0 ? true : _d, _e = props.bannerVisible, bannerVisible = _e === void 0 ? true : _e, overlayRender = props.overlayRender, toolbarRender = props.toolbarRender, className = props.className, maskClassName = props.maskClassName, photoClassName = props.photoClassName, photoWrapClassName = props.photoWrapClassName, loadingElement = props.loadingElement, brokenElement = props.brokenElement, images = props.images, _f = props.index, controlledIndex = _f === void 0 ? 0 : _f, controlledIndexChange = props.onIndexChange, visible = props.visible, onClose = props.onClose, afterClose = props.afterClose, portalContainer = props.portalContainer;
|
|
45
|
+
var _g = useSetState(initialState), state = _g[0], updateState = _g[1];
|
|
46
|
+
var _h = useState(0), innerIndex = _h[0], updateInnerIndex = _h[1];
|
|
47
|
+
var x = state.x, touched = state.touched, pause = state.pause, lastCX = state.lastCX, lastCY = state.lastCY, _j = state.bg, bg = _j === void 0 ? maskOpacity : _j, lastBg = state.lastBg, overlay = state.overlay, minimal = state.minimal, scale = state.scale, rotate = state.rotate, onScale = state.onScale, onRotate = state.onRotate;
|
|
48
|
+
// 受控 index
|
|
49
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
50
|
+
var isControlled = props.hasOwnProperty('index');
|
|
51
|
+
var index = isControlled ? controlledIndex : innerIndex;
|
|
52
|
+
var onIndexChange = isControlled ? controlledIndexChange : updateInnerIndex;
|
|
53
|
+
// 内部虚拟 index
|
|
54
|
+
var virtualIndexRef = useRef(index);
|
|
55
|
+
// 当前图片
|
|
56
|
+
var imageLength = images.length;
|
|
57
|
+
var currentImage = images[index];
|
|
58
|
+
// 是否开启
|
|
59
|
+
// noinspection SuspiciousTypeOfGuard
|
|
60
|
+
var enableLoop = typeof loop === 'boolean' ? loop : imageLength > loop;
|
|
61
|
+
// 显示动画处理
|
|
62
|
+
var _k = useAnimationVisible(visible, afterClose), realVisible = _k[0], activeAnimation = _k[1], onAnimationEnd = _k[2];
|
|
63
|
+
useIsomorphicLayoutEffect(function () {
|
|
64
|
+
// 显示弹出层,修正正确的指向
|
|
65
|
+
if (realVisible) {
|
|
66
|
+
updateState({
|
|
67
|
+
pause: true,
|
|
68
|
+
x: index * -(window.innerWidth + horizontalOffset),
|
|
69
|
+
});
|
|
70
|
+
virtualIndexRef.current = index;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
// 关闭后清空状态
|
|
74
|
+
updateState(initialState);
|
|
75
|
+
}, [realVisible]);
|
|
76
|
+
var _l = useMethods({
|
|
77
|
+
close: function (evt) {
|
|
78
|
+
if (onRotate) {
|
|
79
|
+
onRotate(0);
|
|
80
|
+
}
|
|
81
|
+
updateState({
|
|
82
|
+
overlay: true,
|
|
83
|
+
// 记录当前关闭时的透明度
|
|
84
|
+
lastBg: bg,
|
|
85
|
+
});
|
|
86
|
+
onClose(evt);
|
|
87
|
+
},
|
|
88
|
+
changeIndex: function (nextIndex, isPause) {
|
|
89
|
+
if (isPause === void 0) { isPause = false; }
|
|
90
|
+
// 当前索引
|
|
91
|
+
var currentIndex = enableLoop ? virtualIndexRef.current + (nextIndex - index) : nextIndex;
|
|
92
|
+
var max = imageLength - 1;
|
|
93
|
+
// 虚拟 index
|
|
94
|
+
// 非循环模式,限制区间
|
|
95
|
+
var limitIndex = limitNumber(currentIndex, 0, max);
|
|
96
|
+
var nextVirtualIndex = enableLoop ? currentIndex : limitIndex;
|
|
97
|
+
// 单个屏幕宽度
|
|
98
|
+
var singlePageWidth = window.innerWidth + horizontalOffset;
|
|
99
|
+
updateState({
|
|
100
|
+
touched: false,
|
|
101
|
+
lastCX: undefined,
|
|
102
|
+
lastCY: undefined,
|
|
103
|
+
x: -singlePageWidth * nextVirtualIndex,
|
|
104
|
+
pause: isPause,
|
|
105
|
+
});
|
|
106
|
+
virtualIndexRef.current = nextVirtualIndex;
|
|
107
|
+
// 更新真实的 index
|
|
108
|
+
var realLoopIndex = nextIndex < 0 ? max : nextIndex > max ? 0 : nextIndex;
|
|
109
|
+
if (onIndexChange) {
|
|
110
|
+
onIndexChange(enableLoop ? realLoopIndex : limitIndex);
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
}), close = _l.close, changeIndex = _l.changeIndex;
|
|
114
|
+
useEventListener('keydown', function (evt) {
|
|
115
|
+
if (visible) {
|
|
116
|
+
switch (evt.key) {
|
|
117
|
+
case 'ArrowLeft':
|
|
118
|
+
changeIndex(index - 1, true);
|
|
119
|
+
break;
|
|
120
|
+
case 'ArrowRight':
|
|
121
|
+
changeIndex(index + 1, true);
|
|
122
|
+
break;
|
|
123
|
+
case 'Escape':
|
|
124
|
+
close();
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
function handlePhotoTap(closeable) {
|
|
130
|
+
return closeable ? close() : updateState({ overlay: !overlay });
|
|
131
|
+
}
|
|
132
|
+
function handleResize() {
|
|
133
|
+
updateState({
|
|
134
|
+
x: -(window.innerWidth + horizontalOffset) * index,
|
|
135
|
+
lastCX: undefined,
|
|
136
|
+
lastCY: undefined,
|
|
137
|
+
pause: true,
|
|
138
|
+
});
|
|
139
|
+
virtualIndexRef.current = index;
|
|
140
|
+
}
|
|
141
|
+
function handleReachVerticalMove(clientY, nextScale) {
|
|
142
|
+
if (lastCY === undefined) {
|
|
143
|
+
updateState({
|
|
144
|
+
touched: true,
|
|
145
|
+
lastCY: clientY,
|
|
146
|
+
bg: bg,
|
|
147
|
+
minimal: true,
|
|
148
|
+
});
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
var opacity = maskOpacity === null ? null : limitNumber(maskOpacity, 0.01, maskOpacity - Math.abs(clientY - lastCY) / 100 / 4);
|
|
152
|
+
updateState({
|
|
153
|
+
touched: true,
|
|
154
|
+
lastCY: lastCY,
|
|
155
|
+
bg: nextScale === 1 ? opacity : maskOpacity,
|
|
156
|
+
minimal: nextScale === 1,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function handleReachHorizontalMove(clientX) {
|
|
160
|
+
if (lastCX === undefined) {
|
|
161
|
+
updateState({
|
|
162
|
+
touched: true,
|
|
163
|
+
lastCX: clientX,
|
|
164
|
+
x: x,
|
|
165
|
+
pause: false,
|
|
166
|
+
});
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
var originOffsetClientX = clientX - lastCX;
|
|
170
|
+
var offsetClientX = originOffsetClientX;
|
|
171
|
+
// 第一张和最后一张超出距离减半
|
|
172
|
+
if (!enableLoop && ((index === 0 && originOffsetClientX > 0) || (index === imageLength - 1 && originOffsetClientX < 0))) {
|
|
173
|
+
offsetClientX = originOffsetClientX / 2;
|
|
174
|
+
}
|
|
175
|
+
updateState({
|
|
176
|
+
touched: true,
|
|
177
|
+
lastCX: lastCX,
|
|
178
|
+
x: -(window.innerWidth + horizontalOffset) * virtualIndexRef.current + offsetClientX,
|
|
179
|
+
pause: false,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function handleReachMove(reachPosition, clientX, clientY, nextScale) {
|
|
183
|
+
if (reachPosition === 'x') {
|
|
184
|
+
handleReachHorizontalMove(clientX);
|
|
185
|
+
}
|
|
186
|
+
else if (reachPosition === 'y') {
|
|
187
|
+
handleReachVerticalMove(clientY, nextScale);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function handleReachUp(clientX, clientY) {
|
|
191
|
+
var offsetClientX = clientX - (lastCX !== null && lastCX !== void 0 ? lastCX : clientX);
|
|
192
|
+
var offsetClientY = clientY - (lastCY !== null && lastCY !== void 0 ? lastCY : clientY);
|
|
193
|
+
var willClose = false;
|
|
194
|
+
// 下一张
|
|
195
|
+
if (offsetClientX < -maxMoveOffset) {
|
|
196
|
+
changeIndex(index + 1);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
// 上一张
|
|
200
|
+
if (offsetClientX > maxMoveOffset) {
|
|
201
|
+
changeIndex(index - 1);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
var singlePageWidth = window.innerWidth + horizontalOffset;
|
|
205
|
+
// 当前偏移
|
|
206
|
+
var currentTranslateX = -singlePageWidth * virtualIndexRef.current;
|
|
207
|
+
if (Math.abs(offsetClientY) > 100 && minimal && pullClosable) {
|
|
208
|
+
willClose = true;
|
|
209
|
+
close();
|
|
210
|
+
}
|
|
211
|
+
updateState({
|
|
212
|
+
touched: false,
|
|
213
|
+
x: currentTranslateX,
|
|
214
|
+
lastCX: undefined,
|
|
215
|
+
lastCY: undefined,
|
|
216
|
+
bg: maskOpacity,
|
|
217
|
+
overlay: willClose ? true : overlay,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
// 截取相邻的图片
|
|
221
|
+
var adjacentImages = useAdjacentImages(images, index, enableLoop);
|
|
222
|
+
if (!realVisible) {
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
var currentOverlayVisible = overlay && !activeAnimation;
|
|
226
|
+
// 关闭过程中使用下拉保存的透明度
|
|
227
|
+
var currentOpacity = visible ? bg : lastBg;
|
|
228
|
+
// 覆盖物参数
|
|
229
|
+
var overlayParams = onScale &&
|
|
230
|
+
onRotate && {
|
|
231
|
+
images: images,
|
|
232
|
+
index: index,
|
|
233
|
+
visible: visible,
|
|
234
|
+
onClose: close,
|
|
235
|
+
onIndexChange: changeIndex,
|
|
236
|
+
overlayVisible: currentOverlayVisible,
|
|
237
|
+
overlay: currentImage && currentImage.overlay,
|
|
238
|
+
scale: scale,
|
|
239
|
+
rotate: rotate,
|
|
240
|
+
onScale: onScale,
|
|
241
|
+
onRotate: onRotate,
|
|
242
|
+
};
|
|
243
|
+
// 动画时间
|
|
244
|
+
var currentSpeed = speedFn ? speedFn(activeAnimation) : defaultSpeed;
|
|
245
|
+
var currentEasing = easingFn ? easingFn(activeAnimation) : defaultEasing;
|
|
246
|
+
var slideSpeed = speedFn ? speedFn(3) : defaultSpeed + 200;
|
|
247
|
+
var slideEasing = easingFn ? easingFn(3) : defaultEasing;
|
|
248
|
+
return (_jsxs(SlidePortal, __assign({ className: "PhotoView-Portal".concat(!currentOverlayVisible ? ' PhotoView-Slider__clean' : '').concat(!visible ? ' PhotoView-Slider__willClose' : '').concat(className ? " ".concat(className) : ''), role: "dialog", onClick: function (e) { return e.stopPropagation(); }, container: portalContainer }, { children: [visible && _jsx(PreventScroll, {}), _jsx("div", { className: "PhotoView-Slider__Backdrop".concat(maskClassName ? " ".concat(maskClassName) : '').concat(activeAnimation === 1 ? ' PhotoView-Slider__fadeIn' : activeAnimation === 2 ? ' PhotoView-Slider__fadeOut' : ''), style: {
|
|
249
|
+
background: currentOpacity ? "rgba(0, 0, 0, ".concat(currentOpacity, ")") : undefined,
|
|
250
|
+
transitionTimingFunction: currentEasing,
|
|
251
|
+
transitionDuration: "".concat(touched ? 0 : currentSpeed, "ms"),
|
|
252
|
+
animationDuration: "".concat(currentSpeed, "ms"),
|
|
253
|
+
}, onAnimationEnd: onAnimationEnd }), bannerVisible && (_jsxs("div", __assign({ className: "PhotoView-Slider__BannerWrap" }, { children: [_jsx("div", { className: "PhotoView-Slider__Counter" }), _jsxs("div", __assign({ className: "PhotoView-Slider__BannerRight" }, { children: [toolbarRender && overlayParams && toolbarRender(overlayParams), _jsx(CloseIcon, { className: "PhotoView-Slider__toolbarIcon", onClick: close })] }))] }))), adjacentImages.map(function (item, currentIndex) {
|
|
254
|
+
// 截取之前的索引位置
|
|
255
|
+
var nextIndex = !enableLoop && index === 0 ? index + currentIndex : virtualIndexRef.current - 1 + currentIndex;
|
|
256
|
+
return (_jsx(PhotoBox, { item: item, speed: currentSpeed, easing: currentEasing, visible: visible, onReachMove: handleReachMove, onReachUp: handleReachUp, onPhotoTap: function () { return handlePhotoTap(photoClosable); }, onMaskTap: function () { return handlePhotoTap(maskClosable); }, wrapClassName: photoWrapClassName, className: photoClassName, style: {
|
|
257
|
+
left: "".concat((window.innerWidth + horizontalOffset) * nextIndex, "px"),
|
|
258
|
+
transform: "translate3d(".concat(x, "px, 0px, 0)"),
|
|
259
|
+
transition: touched || pause ? undefined : "transform ".concat(slideSpeed, "ms ").concat(slideEasing),
|
|
260
|
+
}, loadingElement: loadingElement, brokenElement: brokenElement, onPhotoResize: handleResize, isActive: (currentImage && currentImage.key) === item.key, expose: updateState }, enableLoop ? "".concat(item.key, "/").concat(item.src, "/").concat(nextIndex) : item.key));
|
|
261
|
+
}), !isTouchDevice && bannerVisible && (_jsxs(_Fragment, { children: [(enableLoop || index !== 0) && (_jsx("div", __assign({ className: "PhotoView-Slider__ArrowLeft", onClick: function () { return changeIndex(index - 1, true); } }, { children: _jsx(ArrowLeft, {}) }))), (enableLoop || index + 1 < imageLength) && (_jsx("div", __assign({ className: "PhotoView-Slider__ArrowRight", onClick: function () { return changeIndex(index + 1, true); } }, { children: _jsx(ArrowRight, {}) })))] })), overlayRender && overlayParams && _jsx("div", __assign({ className: "PhotoView-Slider__Overlay" }, { children: overlayRender(overlayParams) }))] })));
|
|
262
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { PhotoRenderParams } from './types';
|
|
3
|
+
export interface PhotoViewProps {
|
|
4
|
+
/**
|
|
5
|
+
* 图片地址
|
|
6
|
+
*/
|
|
7
|
+
src?: string;
|
|
8
|
+
/**
|
|
9
|
+
* 自定义渲染,优先级比 src 低
|
|
10
|
+
*/
|
|
11
|
+
render?: (props: PhotoRenderParams) => React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* 自定义覆盖节点
|
|
14
|
+
*/
|
|
15
|
+
overlay?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* 自定义渲染节点宽度
|
|
18
|
+
*/
|
|
19
|
+
width?: number;
|
|
20
|
+
/**
|
|
21
|
+
* 自定义渲染节点高度
|
|
22
|
+
*/
|
|
23
|
+
height?: number;
|
|
24
|
+
/**
|
|
25
|
+
* 子节点,一般为缩略图
|
|
26
|
+
*/
|
|
27
|
+
children?: React.ReactElement;
|
|
28
|
+
}
|
|
29
|
+
declare const PhotoView: React.FC<PhotoViewProps>;
|
|
30
|
+
export default PhotoView;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Children, cloneElement, useContext, useEffect, useRef } from 'react';
|
|
2
|
+
import useInitial from './hooks/useInitial';
|
|
3
|
+
import useMethods from './hooks/useMethods';
|
|
4
|
+
import PhotoContext from './photo-context';
|
|
5
|
+
var PhotoView = function (_a) {
|
|
6
|
+
var src = _a.src, render = _a.render, overlay = _a.overlay, width = _a.width, height = _a.height, children = _a.children;
|
|
7
|
+
var photoContext = useContext(PhotoContext);
|
|
8
|
+
var key = useInitial(function () { return photoContext.nextId(); });
|
|
9
|
+
var originRef = useRef(null);
|
|
10
|
+
useEffect(function () {
|
|
11
|
+
return function () {
|
|
12
|
+
photoContext.remove(key);
|
|
13
|
+
};
|
|
14
|
+
}, []);
|
|
15
|
+
function invokeChildrenFn(eventName, e) {
|
|
16
|
+
if (children) {
|
|
17
|
+
var eventFn = children.props[eventName];
|
|
18
|
+
if (eventFn) {
|
|
19
|
+
eventFn(e);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
var fn = useMethods({
|
|
24
|
+
render: function (props) {
|
|
25
|
+
return render && render(props);
|
|
26
|
+
},
|
|
27
|
+
click: function (e) {
|
|
28
|
+
photoContext.show(key);
|
|
29
|
+
invokeChildrenFn('onClick', e);
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
useEffect(function () {
|
|
33
|
+
photoContext.update({
|
|
34
|
+
key: key,
|
|
35
|
+
src: src,
|
|
36
|
+
originRef: originRef,
|
|
37
|
+
render: fn.render,
|
|
38
|
+
overlay: overlay,
|
|
39
|
+
width: width,
|
|
40
|
+
height: height,
|
|
41
|
+
});
|
|
42
|
+
}, [src]);
|
|
43
|
+
if (children) {
|
|
44
|
+
return Children.only(cloneElement(children, { onClick: fn.click, ref: originRef }));
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
};
|
|
48
|
+
export default PhotoView;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
function ArrowLeft(props) {
|
|
14
|
+
return (_jsx("svg", __assign({ focusable: "false", viewBox: "0 0 24 24", "aria-hidden": "true" }, props, { children: _jsx("path", { fillRule: "evenodd",
|
|
15
|
+
// eslint-disable-next-line max-len
|
|
16
|
+
d: "M8.81116012,11.2726407 L13.7609076,6.32289322 C14.1514319,5.93236893 14.7845969,5.93236893 15.1751212,6.32289322 C15.5656454,6.71341751 15.5656454,7.34658249 15.1751212,7.73710678 L10.907,12.004 L15.1751212,16.2726407 C15.5656454,16.663165 15.5656454,17.29633 15.1751212,17.6868542 C14.7845969,18.0773785 14.1514319,18.0773785 13.7609076,17.6868542 L8.81116012,12.7371068 C8.63091814,12.5568648 8.53386477,12.324936 8.52,12.0890314 L8.52,11.9207161 C8.53386477,11.6848114 8.63091814,11.4528827 8.81116012,11.2726407 Z" }) })));
|
|
17
|
+
}
|
|
18
|
+
export default ArrowLeft;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
function ArrowRight(props) {
|
|
14
|
+
return (_jsx("svg", __assign({ focusable: "false", viewBox: "0 0 24 24", "aria-hidden": "true" }, props, { children: _jsx("path", { fillRule: "evenodd",
|
|
15
|
+
// eslint-disable-next-line max-len
|
|
16
|
+
d: "M15.1768542,12.7371068 L10.2271068,17.6868542 C9.83658249,18.0773785 9.20341751,18.0773785 8.81289322,17.6868542 C8.42236893,17.29633 8.42236893,16.663165 8.81289322,16.2726407 L13.08,12.004 L8.81289322,7.73710678 C8.42236893,7.34658249 8.42236893,6.71341751 8.81289322,6.32289322 C9.20341751,5.93236893 9.83658249,5.93236893 10.2271068,6.32289322 L15.1768542,11.2726407 C15.3570962,11.4528827 15.4541496,11.6848114 15.4680144,11.9207161 L15.4680144,12.0890314 C15.4541496,12.324936 15.3570962,12.5568648 15.1768542,12.7371068 Z" }) })));
|
|
17
|
+
}
|
|
18
|
+
export default ArrowRight;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
function CloseIcon(props) {
|
|
14
|
+
return (_jsx("svg", __assign({ width: "44", height: "44", viewBox: "0 0 768 768" }, props, { children: _jsx("path", { d: "M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z" }) })));
|
|
15
|
+
}
|
|
16
|
+
export default CloseIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function PreventScroll(): null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
export default function PreventScroll() {
|
|
3
|
+
useEffect(function () {
|
|
4
|
+
var style = document.body.style;
|
|
5
|
+
var lastOverflow = style.overflow;
|
|
6
|
+
style.overflow = 'hidden';
|
|
7
|
+
return function () {
|
|
8
|
+
style.overflow = lastOverflow;
|
|
9
|
+
};
|
|
10
|
+
}, []);
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './SlidePortal.css';
|
|
3
|
+
export interface ISliderPortalProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
container?: HTMLElement;
|
|
5
|
+
}
|
|
6
|
+
declare function SlidePortal({ container, ...rest }: ISliderPortalProps): React.ReactPortal;
|
|
7
|
+
export default SlidePortal;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { createPortal } from 'react-dom';
|
|
25
|
+
import './SlidePortal.css';
|
|
26
|
+
function SlidePortal(_a) {
|
|
27
|
+
var _b = _a.container, container = _b === void 0 ? document.body : _b, rest = __rest(_a, ["container"]);
|
|
28
|
+
return createPortal(_jsx("div", __assign({}, rest)), container);
|
|
29
|
+
}
|
|
30
|
+
export default SlidePortal;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@keyframes PhotoView__rotate {
|
|
2
|
+
from {
|
|
3
|
+
transform: rotate(0deg);
|
|
4
|
+
}
|
|
5
|
+
to {
|
|
6
|
+
transform: rotate(360deg);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
@keyframes PhotoView__delayIn {
|
|
10
|
+
0%,
|
|
11
|
+
50% {
|
|
12
|
+
opacity: 0;
|
|
13
|
+
}
|
|
14
|
+
100% {
|
|
15
|
+
opacity: 1;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
.PhotoView__Spinner {
|
|
19
|
+
animation: PhotoView__delayIn 0.4s linear both;
|
|
20
|
+
}
|
|
21
|
+
.PhotoView__Spinner svg {
|
|
22
|
+
animation: PhotoView__rotate 0.6s linear infinite;
|
|
23
|
+
}
|