eli-video-interview 1.2.39 → 1.2.40-alpha.10

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.
Files changed (241) hide show
  1. package/esm/components/react-photo-view/Photo.css +14 -0
  2. package/esm/components/react-photo-view/Photo.d.ts +18 -0
  3. package/esm/components/react-photo-view/Photo.js +54 -0
  4. package/esm/components/react-photo-view/PhotoBox.css +18 -0
  5. package/esm/components/react-photo-view/PhotoBox.d.ts +22 -0
  6. package/esm/components/react-photo-view/PhotoBox.js +302 -0
  7. package/esm/components/react-photo-view/PhotoPage.d.ts +9 -0
  8. package/esm/components/react-photo-view/PhotoPage.js +77 -0
  9. package/esm/components/react-photo-view/PhotoProvider.d.ts +14 -0
  10. package/esm/components/react-photo-view/PhotoProvider.js +98 -0
  11. package/esm/components/react-photo-view/PhotoSlider.css +125 -0
  12. package/esm/components/react-photo-view/PhotoSlider.d.ts +12 -0
  13. package/esm/components/react-photo-view/PhotoSlider.js +262 -0
  14. package/esm/components/react-photo-view/PhotoView.d.ts +30 -0
  15. package/esm/components/react-photo-view/PhotoView.js +48 -0
  16. package/esm/components/react-photo-view/components/ArrowLeft.d.ts +3 -0
  17. package/esm/components/react-photo-view/components/ArrowLeft.js +18 -0
  18. package/esm/components/react-photo-view/components/ArrowRight.d.ts +3 -0
  19. package/esm/components/react-photo-view/components/ArrowRight.js +18 -0
  20. package/esm/components/react-photo-view/components/CloseIcon.d.ts +3 -0
  21. package/esm/components/react-photo-view/components/CloseIcon.js +16 -0
  22. package/esm/components/react-photo-view/components/PreventScroll.d.ts +1 -0
  23. package/esm/components/react-photo-view/components/PreventScroll.js +12 -0
  24. package/esm/components/react-photo-view/components/SlidePortal.css +10 -0
  25. package/esm/components/react-photo-view/components/SlidePortal.d.ts +7 -0
  26. package/esm/components/react-photo-view/components/SlidePortal.js +30 -0
  27. package/esm/components/react-photo-view/components/Spinner.css +23 -0
  28. package/esm/components/react-photo-view/components/Spinner.d.ts +4 -0
  29. package/esm/components/react-photo-view/components/Spinner.js +29 -0
  30. package/esm/components/react-photo-view/hooks/useAdjacentImages.d.ts +5 -0
  31. package/esm/components/react-photo-view/hooks/useAdjacentImages.js +14 -0
  32. package/esm/components/react-photo-view/hooks/useAnimationOrigin.d.ts +6 -0
  33. package/esm/components/react-photo-view/hooks/useAnimationOrigin.js +72 -0
  34. package/esm/components/react-photo-view/hooks/useAnimationPosition.d.ts +2 -0
  35. package/esm/components/react-photo-view/hooks/useAnimationPosition.js +28 -0
  36. package/esm/components/react-photo-view/hooks/useAnimationVisible.d.ts +6 -0
  37. package/esm/components/react-photo-view/hooks/useAnimationVisible.js +49 -0
  38. package/esm/components/react-photo-view/hooks/useContinuousTap.d.ts +8 -0
  39. package/esm/components/react-photo-view/hooks/useContinuousTap.js +36 -0
  40. package/esm/components/react-photo-view/hooks/useDebounceCallback.d.ts +10 -0
  41. package/esm/components/react-photo-view/hooks/useDebounceCallback.js +48 -0
  42. package/esm/components/react-photo-view/hooks/useEventListener.d.ts +1 -0
  43. package/esm/components/react-photo-view/hooks/useEventListener.js +18 -0
  44. package/esm/components/react-photo-view/hooks/useForkedVariable.d.ts +5 -0
  45. package/esm/components/react-photo-view/hooks/useForkedVariable.js +17 -0
  46. package/esm/components/react-photo-view/hooks/useInitial.d.ts +1 -0
  47. package/esm/components/react-photo-view/hooks/useInitial.js +9 -0
  48. package/esm/components/react-photo-view/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  49. package/esm/components/react-photo-view/hooks/useIsomorphicLayoutEffect.js +3 -0
  50. package/esm/components/react-photo-view/hooks/useMethods.d.ts +4 -0
  51. package/esm/components/react-photo-view/hooks/useMethods.js +35 -0
  52. package/esm/components/react-photo-view/hooks/useMountedRef.d.ts +3 -0
  53. package/esm/components/react-photo-view/hooks/useMountedRef.js +12 -0
  54. package/esm/components/react-photo-view/hooks/useScrollPosition.d.ts +4 -0
  55. package/esm/components/react-photo-view/hooks/useScrollPosition.js +157 -0
  56. package/esm/components/react-photo-view/hooks/useSetState.d.ts +2 -0
  57. package/esm/components/react-photo-view/hooks/useSetState.js +15 -0
  58. package/esm/components/react-photo-view/hooks/useTargetScale.d.ts +4 -0
  59. package/esm/components/react-photo-view/hooks/useTargetScale.js +70 -0
  60. package/esm/components/react-photo-view/index.d.ts +4 -0
  61. package/esm/components/react-photo-view/index.js +4 -0
  62. package/esm/components/react-photo-view/photo-context.d.ts +11 -0
  63. package/esm/components/react-photo-view/photo-context.js +2 -0
  64. package/esm/components/react-photo-view/types.d.ts +196 -0
  65. package/esm/components/react-photo-view/types.js +1 -0
  66. package/esm/components/react-photo-view/utils/edgeHandle.d.ts +15 -0
  67. package/esm/components/react-photo-view/utils/edgeHandle.js +40 -0
  68. package/esm/components/react-photo-view/utils/getMultipleTouchPosition.d.ts +5 -0
  69. package/esm/components/react-photo-view/utils/getMultipleTouchPosition.js +11 -0
  70. package/esm/components/react-photo-view/utils/getPositionOnMoveOrScale.d.ts +9 -0
  71. package/esm/components/react-photo-view/utils/getPositionOnMoveOrScale.js +31 -0
  72. package/esm/components/react-photo-view/utils/getRotateSize.d.ts +4 -0
  73. package/esm/components/react-photo-view/utils/getRotateSize.js +11 -0
  74. package/esm/components/react-photo-view/utils/getSuitableImageSize.d.ts +10 -0
  75. package/esm/components/react-photo-view/utils/getSuitableImageSize.js +42 -0
  76. package/esm/components/react-photo-view/utils/isTouchDevice.d.ts +5 -0
  77. package/esm/components/react-photo-view/utils/isTouchDevice.js +5 -0
  78. package/esm/components/react-photo-view/utils/limitTarget.d.ts +5 -0
  79. package/esm/components/react-photo-view/utils/limitTarget.js +12 -0
  80. package/esm/components/react-photo-view/variables.d.ts +48 -0
  81. package/esm/components/react-photo-view/variables.js +48 -0
  82. package/esm/constants/ai-question.d.ts +9 -0
  83. package/esm/constants/ai-question.js +33 -4
  84. package/esm/enum/ai-question.d.ts +5 -2
  85. package/esm/enum/ai-question.js +3 -0
  86. package/esm/modules/ai-ability/Root.js +15 -4
  87. package/esm/modules/ai-ability-select/Root.js +2 -2
  88. package/esm/modules/ai-ability-select/interface.d.ts +1 -0
  89. package/esm/modules/ai-question/components/AiAnalysis/index.js +4 -1
  90. package/esm/modules/ai-question/components/BootVideo/index.js +1 -1
  91. package/esm/modules/ai-question/components/QuestionModel/Item.js +14 -9
  92. package/esm/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +17 -6
  93. package/esm/modules/ai-question/components/QuestionUpdate/Chioce.d.ts +17 -0
  94. package/esm/modules/ai-question/components/QuestionUpdate/Chioce.js +97 -0
  95. package/esm/modules/ai-question/components/QuestionUpdate/Form.js +37 -12
  96. package/esm/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +14 -4
  97. package/esm/modules/ai-question/components/QuestionUpdate/Score.d.ts +15 -0
  98. package/esm/modules/ai-question/components/QuestionUpdate/Score.js +53 -0
  99. package/esm/modules/ai-question/components/QuestionUpdate/const.js +4 -0
  100. package/esm/modules/ai-question/components/QuestionUpdate/index.js +35 -17
  101. package/esm/modules/ai-question/components/QuestionUpdate/interface.d.ts +10 -0
  102. package/esm/modules/ai-question/components/QuestionUpdate/styled.d.ts +15 -0
  103. package/esm/modules/ai-question/components/QuestionUpdate/styled.js +56 -1
  104. package/esm/modules/ai-report/Root.js +1 -1
  105. package/esm/modules/ai-report/components/ScoreReport/Score.js +4 -1
  106. package/esm/modules/ai-report/components/VideoQuestion/Abilities.js +5 -3
  107. package/esm/modules/ai-report/components/VideoQuestion/BodyImages.d.ts +7 -0
  108. package/esm/modules/ai-report/components/VideoQuestion/BodyImages.js +40 -0
  109. package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.js +9 -4
  110. package/esm/modules/ai-report/components/VideoQuestion/ScoreSlider.js +4 -4
  111. package/esm/modules/ai-report/components/VideoQuestion/SingleChoice.d.ts +8 -0
  112. package/esm/modules/ai-report/components/VideoQuestion/SingleChoice.js +31 -0
  113. package/esm/modules/ai-report/components/VideoQuestion/index.js +1 -1
  114. package/esm/modules/ai-report/components/VideoQuestion/interface.d.ts +2 -0
  115. package/esm/modules/ai-report/components/VideoQuestion/styled.d.ts +1 -0
  116. package/esm/modules/ai-report/components/VideoQuestion/styled.js +7 -1
  117. package/esm/modules/ai-report/interface.d.ts +19 -0
  118. package/esm/services/ai-ability.d.ts +1 -1
  119. package/esm/services/ai-ability.js +1 -1
  120. package/esm/store/ai-question/ai-analysis-store.js +0 -1
  121. package/lib/components/react-photo-view/Photo.css +14 -0
  122. package/lib/components/react-photo-view/Photo.d.ts +18 -0
  123. package/lib/components/react-photo-view/Photo.js +60 -0
  124. package/lib/components/react-photo-view/PhotoBox.css +18 -0
  125. package/lib/components/react-photo-view/PhotoBox.d.ts +22 -0
  126. package/lib/components/react-photo-view/PhotoBox.js +308 -0
  127. package/lib/components/react-photo-view/PhotoPage.d.ts +9 -0
  128. package/lib/components/react-photo-view/PhotoPage.js +79 -0
  129. package/lib/components/react-photo-view/PhotoProvider.d.ts +14 -0
  130. package/lib/components/react-photo-view/PhotoProvider.js +104 -0
  131. package/lib/components/react-photo-view/PhotoSlider.css +125 -0
  132. package/lib/components/react-photo-view/PhotoSlider.d.ts +12 -0
  133. package/lib/components/react-photo-view/PhotoSlider.js +268 -0
  134. package/lib/components/react-photo-view/PhotoView.d.ts +30 -0
  135. package/lib/components/react-photo-view/PhotoView.js +53 -0
  136. package/lib/components/react-photo-view/components/ArrowLeft.d.ts +3 -0
  137. package/lib/components/react-photo-view/components/ArrowLeft.js +20 -0
  138. package/lib/components/react-photo-view/components/ArrowRight.d.ts +3 -0
  139. package/lib/components/react-photo-view/components/ArrowRight.js +20 -0
  140. package/lib/components/react-photo-view/components/CloseIcon.d.ts +3 -0
  141. package/lib/components/react-photo-view/components/CloseIcon.js +18 -0
  142. package/lib/components/react-photo-view/components/PreventScroll.d.ts +1 -0
  143. package/lib/components/react-photo-view/components/PreventScroll.js +15 -0
  144. package/lib/components/react-photo-view/components/SlidePortal.css +10 -0
  145. package/lib/components/react-photo-view/components/SlidePortal.d.ts +7 -0
  146. package/lib/components/react-photo-view/components/SlidePortal.js +32 -0
  147. package/lib/components/react-photo-view/components/Spinner.css +23 -0
  148. package/lib/components/react-photo-view/components/Spinner.d.ts +4 -0
  149. package/lib/components/react-photo-view/components/Spinner.js +31 -0
  150. package/lib/components/react-photo-view/hooks/useAdjacentImages.d.ts +5 -0
  151. package/lib/components/react-photo-view/hooks/useAdjacentImages.js +17 -0
  152. package/lib/components/react-photo-view/hooks/useAnimationOrigin.d.ts +6 -0
  153. package/lib/components/react-photo-view/hooks/useAnimationOrigin.js +78 -0
  154. package/lib/components/react-photo-view/hooks/useAnimationPosition.d.ts +2 -0
  155. package/lib/components/react-photo-view/hooks/useAnimationPosition.js +34 -0
  156. package/lib/components/react-photo-view/hooks/useAnimationVisible.d.ts +6 -0
  157. package/lib/components/react-photo-view/hooks/useAnimationVisible.js +55 -0
  158. package/lib/components/react-photo-view/hooks/useContinuousTap.d.ts +8 -0
  159. package/lib/components/react-photo-view/hooks/useContinuousTap.js +42 -0
  160. package/lib/components/react-photo-view/hooks/useDebounceCallback.d.ts +10 -0
  161. package/lib/components/react-photo-view/hooks/useDebounceCallback.js +51 -0
  162. package/lib/components/react-photo-view/hooks/useEventListener.d.ts +1 -0
  163. package/lib/components/react-photo-view/hooks/useEventListener.js +21 -0
  164. package/lib/components/react-photo-view/hooks/useForkedVariable.d.ts +5 -0
  165. package/lib/components/react-photo-view/hooks/useForkedVariable.js +20 -0
  166. package/lib/components/react-photo-view/hooks/useInitial.d.ts +1 -0
  167. package/lib/components/react-photo-view/hooks/useInitial.js +12 -0
  168. package/lib/components/react-photo-view/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  169. package/lib/components/react-photo-view/hooks/useIsomorphicLayoutEffect.js +5 -0
  170. package/lib/components/react-photo-view/hooks/useMethods.d.ts +4 -0
  171. package/lib/components/react-photo-view/hooks/useMethods.js +38 -0
  172. package/lib/components/react-photo-view/hooks/useMountedRef.d.ts +3 -0
  173. package/lib/components/react-photo-view/hooks/useMountedRef.js +14 -0
  174. package/lib/components/react-photo-view/hooks/useScrollPosition.d.ts +4 -0
  175. package/lib/components/react-photo-view/hooks/useScrollPosition.js +163 -0
  176. package/lib/components/react-photo-view/hooks/useSetState.d.ts +2 -0
  177. package/lib/components/react-photo-view/hooks/useSetState.js +18 -0
  178. package/lib/components/react-photo-view/hooks/useTargetScale.d.ts +4 -0
  179. package/lib/components/react-photo-view/hooks/useTargetScale.js +76 -0
  180. package/lib/components/react-photo-view/index.d.ts +4 -0
  181. package/lib/components/react-photo-view/index.js +12 -0
  182. package/lib/components/react-photo-view/photo-context.d.ts +11 -0
  183. package/lib/components/react-photo-view/photo-context.js +4 -0
  184. package/lib/components/react-photo-view/types.d.ts +196 -0
  185. package/lib/components/react-photo-view/types.js +2 -0
  186. package/lib/components/react-photo-view/utils/edgeHandle.d.ts +15 -0
  187. package/lib/components/react-photo-view/utils/edgeHandle.js +45 -0
  188. package/lib/components/react-photo-view/utils/getMultipleTouchPosition.d.ts +5 -0
  189. package/lib/components/react-photo-view/utils/getMultipleTouchPosition.js +14 -0
  190. package/lib/components/react-photo-view/utils/getPositionOnMoveOrScale.d.ts +9 -0
  191. package/lib/components/react-photo-view/utils/getPositionOnMoveOrScale.js +34 -0
  192. package/lib/components/react-photo-view/utils/getRotateSize.d.ts +4 -0
  193. package/lib/components/react-photo-view/utils/getRotateSize.js +14 -0
  194. package/lib/components/react-photo-view/utils/getSuitableImageSize.d.ts +10 -0
  195. package/lib/components/react-photo-view/utils/getSuitableImageSize.js +48 -0
  196. package/lib/components/react-photo-view/utils/isTouchDevice.d.ts +5 -0
  197. package/lib/components/react-photo-view/utils/isTouchDevice.js +7 -0
  198. package/lib/components/react-photo-view/utils/limitTarget.d.ts +5 -0
  199. package/lib/components/react-photo-view/utils/limitTarget.js +17 -0
  200. package/lib/components/react-photo-view/variables.d.ts +48 -0
  201. package/lib/components/react-photo-view/variables.js +51 -0
  202. package/lib/constants/ai-question.d.ts +9 -0
  203. package/lib/constants/ai-question.js +34 -5
  204. package/lib/enum/ai-question.d.ts +5 -2
  205. package/lib/enum/ai-question.js +3 -0
  206. package/lib/modules/ai-ability/Root.js +15 -4
  207. package/lib/modules/ai-ability-select/Root.js +2 -2
  208. package/lib/modules/ai-ability-select/interface.d.ts +1 -0
  209. package/lib/modules/ai-question/components/AiAnalysis/index.js +4 -1
  210. package/lib/modules/ai-question/components/BootVideo/index.js +1 -1
  211. package/lib/modules/ai-question/components/QuestionModel/Item.js +11 -6
  212. package/lib/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +15 -4
  213. package/lib/modules/ai-question/components/QuestionUpdate/Chioce.d.ts +17 -0
  214. package/lib/modules/ai-question/components/QuestionUpdate/Chioce.js +104 -0
  215. package/lib/modules/ai-question/components/QuestionUpdate/Form.js +35 -10
  216. package/lib/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +12 -2
  217. package/lib/modules/ai-question/components/QuestionUpdate/Score.d.ts +15 -0
  218. package/lib/modules/ai-question/components/QuestionUpdate/Score.js +57 -0
  219. package/lib/modules/ai-question/components/QuestionUpdate/const.js +4 -0
  220. package/lib/modules/ai-question/components/QuestionUpdate/index.js +34 -16
  221. package/lib/modules/ai-question/components/QuestionUpdate/interface.d.ts +10 -0
  222. package/lib/modules/ai-question/components/QuestionUpdate/styled.d.ts +15 -0
  223. package/lib/modules/ai-question/components/QuestionUpdate/styled.js +56 -1
  224. package/lib/modules/ai-report/Root.js +1 -1
  225. package/lib/modules/ai-report/components/ScoreReport/Score.js +4 -1
  226. package/lib/modules/ai-report/components/VideoQuestion/Abilities.js +5 -3
  227. package/lib/modules/ai-report/components/VideoQuestion/BodyImages.d.ts +7 -0
  228. package/lib/modules/ai-report/components/VideoQuestion/BodyImages.js +45 -0
  229. package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.js +8 -3
  230. package/lib/modules/ai-report/components/VideoQuestion/ScoreSlider.js +4 -4
  231. package/lib/modules/ai-report/components/VideoQuestion/SingleChoice.d.ts +8 -0
  232. package/lib/modules/ai-report/components/VideoQuestion/SingleChoice.js +33 -0
  233. package/lib/modules/ai-report/components/VideoQuestion/index.js +1 -1
  234. package/lib/modules/ai-report/components/VideoQuestion/interface.d.ts +2 -0
  235. package/lib/modules/ai-report/components/VideoQuestion/styled.d.ts +1 -0
  236. package/lib/modules/ai-report/components/VideoQuestion/styled.js +8 -2
  237. package/lib/modules/ai-report/interface.d.ts +19 -0
  238. package/lib/services/ai-ability.d.ts +1 -1
  239. package/lib/services/ai-ability.js +1 -1
  240. package/lib/store/ai-question/ai-analysis-store.js +0 -1
  241. package/package.json +2 -2
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ var jsx_runtime_1 = require("react/jsx-runtime");
29
+ var react_1 = require("react");
30
+ var useMethods_1 = __importDefault(require("./hooks/useMethods"));
31
+ var useSetState_1 = __importDefault(require("./hooks/useSetState"));
32
+ var photo_context_1 = __importDefault(require("./photo-context"));
33
+ var PhotoSlider_1 = __importDefault(require("./PhotoSlider"));
34
+ var initialState = {
35
+ images: [],
36
+ visible: false,
37
+ index: 0,
38
+ };
39
+ function PhotoProvider(_a) {
40
+ var children = _a.children, onIndexChange = _a.onIndexChange, onVisibleChange = _a.onVisibleChange, restProps = __rest(_a, ["children", "onIndexChange", "onVisibleChange"]);
41
+ var _b = (0, useSetState_1.default)(initialState), state = _b[0], updateState = _b[1];
42
+ var uniqueIdRef = (0, react_1.useRef)(0);
43
+ var images = state.images, visible = state.visible, index = state.index;
44
+ var methods = (0, useMethods_1.default)({
45
+ nextId: function () {
46
+ return (uniqueIdRef.current += 1);
47
+ },
48
+ update: function (imageItem) {
49
+ var currentIndex = images.findIndex(function (n) { return n.key === imageItem.key; });
50
+ if (currentIndex > -1) {
51
+ var nextImages = images.slice();
52
+ nextImages.splice(currentIndex, 1, imageItem);
53
+ updateState({
54
+ images: nextImages,
55
+ });
56
+ return;
57
+ }
58
+ updateState(function (prev) { return ({
59
+ images: prev.images.concat(imageItem),
60
+ }); });
61
+ },
62
+ remove: function (key) {
63
+ updateState(function (prev) {
64
+ var nextImages = prev.images.filter(function (item) { return item.key !== key; });
65
+ var nextEndIndex = nextImages.length - 1;
66
+ return {
67
+ images: nextImages,
68
+ index: Math.min(nextEndIndex, index),
69
+ };
70
+ });
71
+ },
72
+ show: function (key) {
73
+ var currentIndex = images.findIndex(function (item) { return item.key === key; });
74
+ updateState({
75
+ visible: true,
76
+ index: currentIndex,
77
+ });
78
+ if (onVisibleChange) {
79
+ onVisibleChange(true, currentIndex, state);
80
+ }
81
+ },
82
+ });
83
+ var fn = (0, useMethods_1.default)({
84
+ close: function () {
85
+ updateState({
86
+ visible: false,
87
+ });
88
+ if (onVisibleChange) {
89
+ onVisibleChange(false, index, state);
90
+ }
91
+ },
92
+ changeIndex: function (nextIndex) {
93
+ updateState({
94
+ index: nextIndex,
95
+ });
96
+ if (onIndexChange) {
97
+ onIndexChange(nextIndex, state);
98
+ }
99
+ },
100
+ });
101
+ var value = (0, react_1.useMemo)(function () { return (__assign(__assign({}, state), methods)); }, [state, methods]);
102
+ return ((0, jsx_runtime_1.jsxs)(photo_context_1.default.Provider, __assign({ value: value }, { children: [children, (0, jsx_runtime_1.jsx)(PhotoSlider_1.default, __assign({ images: images, visible: visible, index: index, onIndexChange: fn.changeIndex, onClose: fn.close }, restProps))] })));
103
+ }
104
+ exports.default = PhotoProvider;
@@ -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,268 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var jsx_runtime_1 = require("react/jsx-runtime");
18
+ var react_1 = require("react");
19
+ var ArrowLeft_1 = __importDefault(require("./components/ArrowLeft"));
20
+ var ArrowRight_1 = __importDefault(require("./components/ArrowRight"));
21
+ var CloseIcon_1 = __importDefault(require("./components/CloseIcon"));
22
+ var PreventScroll_1 = __importDefault(require("./components/PreventScroll"));
23
+ var SlidePortal_1 = __importDefault(require("./components/SlidePortal"));
24
+ var useAdjacentImages_1 = __importDefault(require("./hooks/useAdjacentImages"));
25
+ var useAnimationVisible_1 = __importDefault(require("./hooks/useAnimationVisible"));
26
+ var useEventListener_1 = __importDefault(require("./hooks/useEventListener"));
27
+ var useIsomorphicLayoutEffect_1 = __importDefault(require("./hooks/useIsomorphicLayoutEffect"));
28
+ var useMethods_1 = __importDefault(require("./hooks/useMethods"));
29
+ var useSetState_1 = __importDefault(require("./hooks/useSetState"));
30
+ var PhotoBox_1 = __importDefault(require("./PhotoBox"));
31
+ require("./PhotoSlider.css");
32
+ var isTouchDevice_1 = __importDefault(require("./utils/isTouchDevice"));
33
+ var limitTarget_1 = require("./utils/limitTarget");
34
+ var variables_1 = require("./variables");
35
+ var initialState = {
36
+ x: 0,
37
+ touched: false,
38
+ pause: false,
39
+ lastCX: undefined,
40
+ lastCY: undefined,
41
+ bg: undefined,
42
+ lastBg: undefined,
43
+ overlay: true,
44
+ minimal: true,
45
+ scale: 1,
46
+ rotate: 0,
47
+ };
48
+ function PhotoSlider(props) {
49
+ 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 ? variables_1.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;
50
+ var _g = (0, useSetState_1.default)(initialState), state = _g[0], updateState = _g[1];
51
+ var _h = (0, react_1.useState)(0), innerIndex = _h[0], updateInnerIndex = _h[1];
52
+ 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;
53
+ // 受控 index
54
+ // eslint-disable-next-line no-prototype-builtins
55
+ var isControlled = props.hasOwnProperty('index');
56
+ var index = isControlled ? controlledIndex : innerIndex;
57
+ var onIndexChange = isControlled ? controlledIndexChange : updateInnerIndex;
58
+ // 内部虚拟 index
59
+ var virtualIndexRef = (0, react_1.useRef)(index);
60
+ // 当前图片
61
+ var imageLength = images.length;
62
+ var currentImage = images[index];
63
+ // 是否开启
64
+ // noinspection SuspiciousTypeOfGuard
65
+ var enableLoop = typeof loop === 'boolean' ? loop : imageLength > loop;
66
+ // 显示动画处理
67
+ var _k = (0, useAnimationVisible_1.default)(visible, afterClose), realVisible = _k[0], activeAnimation = _k[1], onAnimationEnd = _k[2];
68
+ (0, useIsomorphicLayoutEffect_1.default)(function () {
69
+ // 显示弹出层,修正正确的指向
70
+ if (realVisible) {
71
+ updateState({
72
+ pause: true,
73
+ x: index * -(window.innerWidth + variables_1.horizontalOffset),
74
+ });
75
+ virtualIndexRef.current = index;
76
+ return;
77
+ }
78
+ // 关闭后清空状态
79
+ updateState(initialState);
80
+ }, [realVisible]);
81
+ var _l = (0, useMethods_1.default)({
82
+ close: function (evt) {
83
+ if (onRotate) {
84
+ onRotate(0);
85
+ }
86
+ updateState({
87
+ overlay: true,
88
+ // 记录当前关闭时的透明度
89
+ lastBg: bg,
90
+ });
91
+ onClose(evt);
92
+ },
93
+ changeIndex: function (nextIndex, isPause) {
94
+ if (isPause === void 0) { isPause = false; }
95
+ // 当前索引
96
+ var currentIndex = enableLoop ? virtualIndexRef.current + (nextIndex - index) : nextIndex;
97
+ var max = imageLength - 1;
98
+ // 虚拟 index
99
+ // 非循环模式,限制区间
100
+ var limitIndex = (0, limitTarget_1.limitNumber)(currentIndex, 0, max);
101
+ var nextVirtualIndex = enableLoop ? currentIndex : limitIndex;
102
+ // 单个屏幕宽度
103
+ var singlePageWidth = window.innerWidth + variables_1.horizontalOffset;
104
+ updateState({
105
+ touched: false,
106
+ lastCX: undefined,
107
+ lastCY: undefined,
108
+ x: -singlePageWidth * nextVirtualIndex,
109
+ pause: isPause,
110
+ });
111
+ virtualIndexRef.current = nextVirtualIndex;
112
+ // 更新真实的 index
113
+ var realLoopIndex = nextIndex < 0 ? max : nextIndex > max ? 0 : nextIndex;
114
+ if (onIndexChange) {
115
+ onIndexChange(enableLoop ? realLoopIndex : limitIndex);
116
+ }
117
+ },
118
+ }), close = _l.close, changeIndex = _l.changeIndex;
119
+ (0, useEventListener_1.default)('keydown', function (evt) {
120
+ if (visible) {
121
+ switch (evt.key) {
122
+ case 'ArrowLeft':
123
+ changeIndex(index - 1, true);
124
+ break;
125
+ case 'ArrowRight':
126
+ changeIndex(index + 1, true);
127
+ break;
128
+ case 'Escape':
129
+ close();
130
+ break;
131
+ }
132
+ }
133
+ });
134
+ function handlePhotoTap(closeable) {
135
+ return closeable ? close() : updateState({ overlay: !overlay });
136
+ }
137
+ function handleResize() {
138
+ updateState({
139
+ x: -(window.innerWidth + variables_1.horizontalOffset) * index,
140
+ lastCX: undefined,
141
+ lastCY: undefined,
142
+ pause: true,
143
+ });
144
+ virtualIndexRef.current = index;
145
+ }
146
+ function handleReachVerticalMove(clientY, nextScale) {
147
+ if (lastCY === undefined) {
148
+ updateState({
149
+ touched: true,
150
+ lastCY: clientY,
151
+ bg: bg,
152
+ minimal: true,
153
+ });
154
+ return;
155
+ }
156
+ var opacity = maskOpacity === null ? null : (0, limitTarget_1.limitNumber)(maskOpacity, 0.01, maskOpacity - Math.abs(clientY - lastCY) / 100 / 4);
157
+ updateState({
158
+ touched: true,
159
+ lastCY: lastCY,
160
+ bg: nextScale === 1 ? opacity : maskOpacity,
161
+ minimal: nextScale === 1,
162
+ });
163
+ }
164
+ function handleReachHorizontalMove(clientX) {
165
+ if (lastCX === undefined) {
166
+ updateState({
167
+ touched: true,
168
+ lastCX: clientX,
169
+ x: x,
170
+ pause: false,
171
+ });
172
+ return;
173
+ }
174
+ var originOffsetClientX = clientX - lastCX;
175
+ var offsetClientX = originOffsetClientX;
176
+ // 第一张和最后一张超出距离减半
177
+ if (!enableLoop && ((index === 0 && originOffsetClientX > 0) || (index === imageLength - 1 && originOffsetClientX < 0))) {
178
+ offsetClientX = originOffsetClientX / 2;
179
+ }
180
+ updateState({
181
+ touched: true,
182
+ lastCX: lastCX,
183
+ x: -(window.innerWidth + variables_1.horizontalOffset) * virtualIndexRef.current + offsetClientX,
184
+ pause: false,
185
+ });
186
+ }
187
+ function handleReachMove(reachPosition, clientX, clientY, nextScale) {
188
+ if (reachPosition === 'x') {
189
+ handleReachHorizontalMove(clientX);
190
+ }
191
+ else if (reachPosition === 'y') {
192
+ handleReachVerticalMove(clientY, nextScale);
193
+ }
194
+ }
195
+ function handleReachUp(clientX, clientY) {
196
+ var offsetClientX = clientX - (lastCX !== null && lastCX !== void 0 ? lastCX : clientX);
197
+ var offsetClientY = clientY - (lastCY !== null && lastCY !== void 0 ? lastCY : clientY);
198
+ var willClose = false;
199
+ // 下一张
200
+ if (offsetClientX < -variables_1.maxMoveOffset) {
201
+ changeIndex(index + 1);
202
+ return;
203
+ }
204
+ // 上一张
205
+ if (offsetClientX > variables_1.maxMoveOffset) {
206
+ changeIndex(index - 1);
207
+ return;
208
+ }
209
+ var singlePageWidth = window.innerWidth + variables_1.horizontalOffset;
210
+ // 当前偏移
211
+ var currentTranslateX = -singlePageWidth * virtualIndexRef.current;
212
+ if (Math.abs(offsetClientY) > 100 && minimal && pullClosable) {
213
+ willClose = true;
214
+ close();
215
+ }
216
+ updateState({
217
+ touched: false,
218
+ x: currentTranslateX,
219
+ lastCX: undefined,
220
+ lastCY: undefined,
221
+ bg: maskOpacity,
222
+ overlay: willClose ? true : overlay,
223
+ });
224
+ }
225
+ // 截取相邻的图片
226
+ var adjacentImages = (0, useAdjacentImages_1.default)(images, index, enableLoop);
227
+ if (!realVisible) {
228
+ return null;
229
+ }
230
+ var currentOverlayVisible = overlay && !activeAnimation;
231
+ // 关闭过程中使用下拉保存的透明度
232
+ var currentOpacity = visible ? bg : lastBg;
233
+ // 覆盖物参数
234
+ var overlayParams = onScale &&
235
+ onRotate && {
236
+ images: images,
237
+ index: index,
238
+ visible: visible,
239
+ onClose: close,
240
+ onIndexChange: changeIndex,
241
+ overlayVisible: currentOverlayVisible,
242
+ overlay: currentImage && currentImage.overlay,
243
+ scale: scale,
244
+ rotate: rotate,
245
+ onScale: onScale,
246
+ onRotate: onRotate,
247
+ };
248
+ // 动画时间
249
+ var currentSpeed = speedFn ? speedFn(activeAnimation) : variables_1.defaultSpeed;
250
+ var currentEasing = easingFn ? easingFn(activeAnimation) : variables_1.defaultEasing;
251
+ var slideSpeed = speedFn ? speedFn(3) : variables_1.defaultSpeed + 200;
252
+ var slideEasing = easingFn ? easingFn(3) : variables_1.defaultEasing;
253
+ return ((0, jsx_runtime_1.jsxs)(SlidePortal_1.default, __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 && (0, jsx_runtime_1.jsx)(PreventScroll_1.default, {}), (0, jsx_runtime_1.jsx)("div", { className: "PhotoView-Slider__Backdrop".concat(maskClassName ? " ".concat(maskClassName) : '').concat(activeAnimation === 1 ? ' PhotoView-Slider__fadeIn' : activeAnimation === 2 ? ' PhotoView-Slider__fadeOut' : ''), style: {
254
+ background: currentOpacity ? "rgba(0, 0, 0, ".concat(currentOpacity, ")") : undefined,
255
+ transitionTimingFunction: currentEasing,
256
+ transitionDuration: "".concat(touched ? 0 : currentSpeed, "ms"),
257
+ animationDuration: "".concat(currentSpeed, "ms"),
258
+ }, onAnimationEnd: onAnimationEnd }), bannerVisible && ((0, jsx_runtime_1.jsxs)("div", __assign({ className: "PhotoView-Slider__BannerWrap" }, { children: [(0, jsx_runtime_1.jsx)("div", { className: "PhotoView-Slider__Counter" }), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "PhotoView-Slider__BannerRight" }, { children: [toolbarRender && overlayParams && toolbarRender(overlayParams), (0, jsx_runtime_1.jsx)(CloseIcon_1.default, { className: "PhotoView-Slider__toolbarIcon", onClick: close })] }))] }))), adjacentImages.map(function (item, currentIndex) {
259
+ // 截取之前的索引位置
260
+ var nextIndex = !enableLoop && index === 0 ? index + currentIndex : virtualIndexRef.current - 1 + currentIndex;
261
+ return ((0, jsx_runtime_1.jsx)(PhotoBox_1.default, { 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: {
262
+ left: "".concat((window.innerWidth + variables_1.horizontalOffset) * nextIndex, "px"),
263
+ transform: "translate3d(".concat(x, "px, 0px, 0)"),
264
+ transition: touched || pause ? undefined : "transform ".concat(slideSpeed, "ms ").concat(slideEasing),
265
+ }, 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));
266
+ }), !isTouchDevice_1.default && bannerVisible && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(enableLoop || index !== 0) && ((0, jsx_runtime_1.jsx)("div", __assign({ className: "PhotoView-Slider__ArrowLeft", onClick: function () { return changeIndex(index - 1, true); } }, { children: (0, jsx_runtime_1.jsx)(ArrowLeft_1.default, {}) }))), (enableLoop || index + 1 < imageLength) && ((0, jsx_runtime_1.jsx)("div", __assign({ className: "PhotoView-Slider__ArrowRight", onClick: function () { return changeIndex(index + 1, true); } }, { children: (0, jsx_runtime_1.jsx)(ArrowRight_1.default, {}) })))] })), overlayRender && overlayParams && (0, jsx_runtime_1.jsx)("div", __assign({ className: "PhotoView-Slider__Overlay" }, { children: overlayRender(overlayParams) }))] })));
267
+ }
268
+ exports.default = PhotoSlider;
@@ -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,53 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var react_1 = require("react");
7
+ var useInitial_1 = __importDefault(require("./hooks/useInitial"));
8
+ var useMethods_1 = __importDefault(require("./hooks/useMethods"));
9
+ var photo_context_1 = __importDefault(require("./photo-context"));
10
+ var PhotoView = function (_a) {
11
+ var src = _a.src, render = _a.render, overlay = _a.overlay, width = _a.width, height = _a.height, children = _a.children;
12
+ var photoContext = (0, react_1.useContext)(photo_context_1.default);
13
+ var key = (0, useInitial_1.default)(function () { return photoContext.nextId(); });
14
+ var originRef = (0, react_1.useRef)(null);
15
+ (0, react_1.useEffect)(function () {
16
+ return function () {
17
+ photoContext.remove(key);
18
+ };
19
+ }, []);
20
+ function invokeChildrenFn(eventName, e) {
21
+ if (children) {
22
+ var eventFn = children.props[eventName];
23
+ if (eventFn) {
24
+ eventFn(e);
25
+ }
26
+ }
27
+ }
28
+ var fn = (0, useMethods_1.default)({
29
+ render: function (props) {
30
+ return render && render(props);
31
+ },
32
+ click: function (e) {
33
+ photoContext.show(key);
34
+ invokeChildrenFn('onClick', e);
35
+ },
36
+ });
37
+ (0, react_1.useEffect)(function () {
38
+ photoContext.update({
39
+ key: key,
40
+ src: src,
41
+ originRef: originRef,
42
+ render: fn.render,
43
+ overlay: overlay,
44
+ width: width,
45
+ height: height,
46
+ });
47
+ }, [src]);
48
+ if (children) {
49
+ return react_1.Children.only((0, react_1.cloneElement)(children, { onClick: fn.click, ref: originRef }));
50
+ }
51
+ return null;
52
+ };
53
+ exports.default = PhotoView;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare function ArrowLeft(props: React.HTMLAttributes<SVGElement>): JSX.Element;
3
+ export default ArrowLeft;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ var jsx_runtime_1 = require("react/jsx-runtime");
15
+ function ArrowLeft(props) {
16
+ return ((0, jsx_runtime_1.jsx)("svg", __assign({ focusable: "false", viewBox: "0 0 24 24", "aria-hidden": "true" }, props, { children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd",
17
+ // eslint-disable-next-line max-len
18
+ 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" }) })));
19
+ }
20
+ exports.default = ArrowLeft;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare function ArrowRight(props: React.HTMLAttributes<SVGElement>): JSX.Element;
3
+ export default ArrowRight;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ var jsx_runtime_1 = require("react/jsx-runtime");
15
+ function ArrowRight(props) {
16
+ return ((0, jsx_runtime_1.jsx)("svg", __assign({ focusable: "false", viewBox: "0 0 24 24", "aria-hidden": "true" }, props, { children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd",
17
+ // eslint-disable-next-line max-len
18
+ 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" }) })));
19
+ }
20
+ exports.default = ArrowRight;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare function CloseIcon(props: React.HTMLAttributes<SVGElement>): JSX.Element;
3
+ export default CloseIcon;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ var jsx_runtime_1 = require("react/jsx-runtime");
15
+ function CloseIcon(props) {
16
+ return ((0, jsx_runtime_1.jsx)("svg", __assign({ width: "44", height: "44", viewBox: "0 0 768 768" }, props, { children: (0, jsx_runtime_1.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" }) })));
17
+ }
18
+ exports.default = CloseIcon;
@@ -0,0 +1 @@
1
+ export default function PreventScroll(): null;