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,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var react_1 = require("react");
|
|
43
|
+
var useDebounceCallback_1 = __importDefault(require("./useDebounceCallback"));
|
|
44
|
+
var useIsomorphicLayoutEffect_1 = __importDefault(require("./useIsomorphicLayoutEffect"));
|
|
45
|
+
var useSetState_1 = __importDefault(require("./useSetState"));
|
|
46
|
+
/**
|
|
47
|
+
* 目标缩放延迟处理
|
|
48
|
+
*/
|
|
49
|
+
function useTargetScale(realWidth, realHeight, realScale, speed, updateEasing) {
|
|
50
|
+
var _this = this;
|
|
51
|
+
var execRef = (0, react_1.useRef)(false);
|
|
52
|
+
var _a = (0, useSetState_1.default)({ lead: true, scale: realScale }), _b = _a[0], lead = _b.lead, scale = _b.scale, updateState = _a[1];
|
|
53
|
+
var moveScale = (0, useDebounceCallback_1.default)(function (current) { return __awaiter(_this, void 0, void 0, function () {
|
|
54
|
+
return __generator(this, function (_a) {
|
|
55
|
+
updateEasing(true);
|
|
56
|
+
updateState({ lead: false, scale: current });
|
|
57
|
+
return [2 /*return*/];
|
|
58
|
+
});
|
|
59
|
+
}); }, { wait: speed });
|
|
60
|
+
(0, useIsomorphicLayoutEffect_1.default)(function () {
|
|
61
|
+
if (!execRef.current) {
|
|
62
|
+
execRef.current = true;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
updateEasing(false);
|
|
66
|
+
updateState({ lead: true });
|
|
67
|
+
moveScale(realScale);
|
|
68
|
+
}, [realScale]);
|
|
69
|
+
// 运动开始
|
|
70
|
+
if (lead) {
|
|
71
|
+
return [realWidth * scale, realHeight * scale, realScale / scale];
|
|
72
|
+
}
|
|
73
|
+
// 运动结束
|
|
74
|
+
return [realWidth * realScale, realHeight * realScale, 1];
|
|
75
|
+
}
|
|
76
|
+
exports.default = useTargetScale;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
exports.PhotoSlider = exports.PhotoView = exports.PhotoProvider = void 0;
|
|
7
|
+
var PhotoProvider_1 = __importDefault(require("./PhotoProvider"));
|
|
8
|
+
exports.PhotoProvider = PhotoProvider_1.default;
|
|
9
|
+
var PhotoSlider_1 = __importDefault(require("./PhotoSlider"));
|
|
10
|
+
exports.PhotoSlider = PhotoSlider_1.default;
|
|
11
|
+
var PhotoView_1 = __importDefault(require("./PhotoView"));
|
|
12
|
+
exports.PhotoView = PhotoView_1.default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DataType } from './types';
|
|
3
|
+
export declare type UpdateItemType = (dataType: DataType) => void;
|
|
4
|
+
export interface PhotoContextType {
|
|
5
|
+
show: (key: number) => void;
|
|
6
|
+
update: UpdateItemType;
|
|
7
|
+
remove: (key: number) => void;
|
|
8
|
+
nextId: () => number;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: import("react").Context<PhotoContextType>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 资源数据类型
|
|
4
|
+
*/
|
|
5
|
+
export interface DataType {
|
|
6
|
+
/**
|
|
7
|
+
* 唯一标识
|
|
8
|
+
*/
|
|
9
|
+
key: number | string;
|
|
10
|
+
/**
|
|
11
|
+
* 资源地址
|
|
12
|
+
*/
|
|
13
|
+
src?: string;
|
|
14
|
+
/**
|
|
15
|
+
* 自定义渲染,优先级比 src 低
|
|
16
|
+
*/
|
|
17
|
+
render?: (props: PhotoRenderParams) => React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* 自定义覆盖节点
|
|
20
|
+
*/
|
|
21
|
+
overlay?: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* 指定渲染节点宽度
|
|
24
|
+
*/
|
|
25
|
+
width?: number;
|
|
26
|
+
/**
|
|
27
|
+
* 指定渲染节点高度
|
|
28
|
+
*/
|
|
29
|
+
height?: number;
|
|
30
|
+
/**
|
|
31
|
+
* 触发 ref
|
|
32
|
+
*/
|
|
33
|
+
originRef?: React.MutableRefObject<HTMLElement | null>;
|
|
34
|
+
}
|
|
35
|
+
export interface PhotoProviderBase {
|
|
36
|
+
/**
|
|
37
|
+
* 是否循环预览,达到该数量则启用
|
|
38
|
+
* @defaultValue 3
|
|
39
|
+
*/
|
|
40
|
+
loop?: boolean | number;
|
|
41
|
+
/**
|
|
42
|
+
* 动画速度
|
|
43
|
+
* @defaultValue 400
|
|
44
|
+
*/
|
|
45
|
+
speed?: (type: ActiveAnimationType) => number;
|
|
46
|
+
/**
|
|
47
|
+
* 动画函数
|
|
48
|
+
* @defaultValue 'cubic-bezier(0.25, 0.8, 0.25, 1)'
|
|
49
|
+
*/
|
|
50
|
+
easing?: (type: ActiveAnimationType) => string;
|
|
51
|
+
/**
|
|
52
|
+
* 图片点击是否可关闭
|
|
53
|
+
*/
|
|
54
|
+
photoClosable?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* 背景点击是否可关闭
|
|
57
|
+
* @defaultValue true
|
|
58
|
+
*/
|
|
59
|
+
maskClosable?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* 默认背景透明度
|
|
62
|
+
* 设置 null 背景不响应下拉变化
|
|
63
|
+
* @defaultValue 1
|
|
64
|
+
*/
|
|
65
|
+
maskOpacity?: number | null;
|
|
66
|
+
/**
|
|
67
|
+
* 下拉是否可关闭
|
|
68
|
+
* @defaultValue true
|
|
69
|
+
*/
|
|
70
|
+
pullClosable?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* 导航条 visible
|
|
73
|
+
* @defaultValue true
|
|
74
|
+
*/
|
|
75
|
+
bannerVisible?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* 自定义渲染覆盖物
|
|
78
|
+
*/
|
|
79
|
+
overlayRender?: (overlayProps: OverlayRenderProps) => React.ReactNode;
|
|
80
|
+
/**
|
|
81
|
+
* 自定义渲染工具栏
|
|
82
|
+
*/
|
|
83
|
+
toolbarRender?: (overlayProps: OverlayRenderProps) => React.ReactNode;
|
|
84
|
+
className?: string;
|
|
85
|
+
maskClassName?: string;
|
|
86
|
+
photoWrapClassName?: string;
|
|
87
|
+
photoClassName?: string;
|
|
88
|
+
/**
|
|
89
|
+
* 自定义 loading
|
|
90
|
+
*/
|
|
91
|
+
loadingElement?: JSX.Element;
|
|
92
|
+
/**
|
|
93
|
+
* 自定义加载失败渲染
|
|
94
|
+
*/
|
|
95
|
+
brokenElement?: JSX.Element | ((photoProps: BrokenElementParams) => JSX.Element);
|
|
96
|
+
/**
|
|
97
|
+
* @defaultValue document.body
|
|
98
|
+
*/
|
|
99
|
+
portalContainer?: HTMLElement;
|
|
100
|
+
}
|
|
101
|
+
export declare type PhotoRenderParams = {
|
|
102
|
+
/**
|
|
103
|
+
* 自定义渲染 DOM 属性
|
|
104
|
+
*/
|
|
105
|
+
attrs: Partial<React.HTMLAttributes<HTMLElement>>;
|
|
106
|
+
scale: number;
|
|
107
|
+
rotate: number;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* brokenElement 函数参数
|
|
111
|
+
*/
|
|
112
|
+
export interface BrokenElementParams {
|
|
113
|
+
src: string;
|
|
114
|
+
}
|
|
115
|
+
export interface OverlayRenderProps {
|
|
116
|
+
/**
|
|
117
|
+
* 图片列表
|
|
118
|
+
*/
|
|
119
|
+
images: DataType[];
|
|
120
|
+
/**
|
|
121
|
+
* 当前索引
|
|
122
|
+
*/
|
|
123
|
+
index: number;
|
|
124
|
+
/**
|
|
125
|
+
* 索引改变回调
|
|
126
|
+
*/
|
|
127
|
+
onIndexChange: (index: number) => void;
|
|
128
|
+
/**
|
|
129
|
+
* 是否可见
|
|
130
|
+
*/
|
|
131
|
+
visible: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* 关闭事件回调
|
|
134
|
+
*/
|
|
135
|
+
onClose: (evt?: React.MouseEvent | React.TouchEvent) => void;
|
|
136
|
+
/**
|
|
137
|
+
* 覆盖物是否可见
|
|
138
|
+
*/
|
|
139
|
+
overlayVisible: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* 自定义覆盖节点
|
|
142
|
+
*/
|
|
143
|
+
overlay?: React.ReactNode;
|
|
144
|
+
/**
|
|
145
|
+
* 当前旋转角度
|
|
146
|
+
*/
|
|
147
|
+
rotate: number;
|
|
148
|
+
/**
|
|
149
|
+
* 旋转事件回调
|
|
150
|
+
*/
|
|
151
|
+
onRotate: (rotate: number) => void;
|
|
152
|
+
/**
|
|
153
|
+
* 当前缩放
|
|
154
|
+
*/
|
|
155
|
+
scale: number;
|
|
156
|
+
/**
|
|
157
|
+
* 缩放事件回调
|
|
158
|
+
*/
|
|
159
|
+
onScale: (scale: number) => void;
|
|
160
|
+
}
|
|
161
|
+
export interface ExposedProperties {
|
|
162
|
+
scale?: number;
|
|
163
|
+
rotate?: number;
|
|
164
|
+
onScale?: (scale: number) => void;
|
|
165
|
+
onRotate?: (rotate: number) => void;
|
|
166
|
+
}
|
|
167
|
+
export declare type ReachMoveFunction = (reachPosition: ReachType, clientX: number, clientY: number, scale?: number) => void;
|
|
168
|
+
export declare type ReachFunction = (clientX: number, clientY: number) => void;
|
|
169
|
+
export declare type PhotoTapFunction = (clientX: number, clientY: number) => void;
|
|
170
|
+
/**
|
|
171
|
+
* 边缘超出状态
|
|
172
|
+
*/
|
|
173
|
+
export declare type CloseEdgeType = 1 | 2 | 3 | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* 边缘触发状态
|
|
176
|
+
*/
|
|
177
|
+
export declare type ReachType = 'x' | 'y' | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* 初始响应状态
|
|
180
|
+
*/
|
|
181
|
+
export declare type TouchStartType = 0 | 1 | 2 | 3;
|
|
182
|
+
export declare type OriginRectType = {
|
|
183
|
+
T: number;
|
|
184
|
+
L: number;
|
|
185
|
+
W: number;
|
|
186
|
+
H: number;
|
|
187
|
+
FIT: 'contain' | 'cover' | 'fill' | undefined;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* 动画状态
|
|
191
|
+
*/
|
|
192
|
+
export declare type EasingMode = 0 | 1 | 2 | 3 | 4 | 5;
|
|
193
|
+
/**
|
|
194
|
+
* 进行中的动画
|
|
195
|
+
*/
|
|
196
|
+
export declare type ActiveAnimationType = 0 | 1 | 2 | 3;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CloseEdgeType } from '../types';
|
|
2
|
+
import type { ReachType, TouchStartType } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* 获取接触边缘类型
|
|
5
|
+
*/
|
|
6
|
+
export declare const getReachType: (initialTouchState: TouchStartType, horizontalCloseEdge: CloseEdgeType, verticalCloseEdge: CloseEdgeType, reachPosition: ReachType) => ReachType;
|
|
7
|
+
/**
|
|
8
|
+
* 计算接触边缘位置
|
|
9
|
+
* @param position - x/y
|
|
10
|
+
* @param scale
|
|
11
|
+
* @param size - width/height
|
|
12
|
+
* @param innerSize - innerWidth/innerHeight
|
|
13
|
+
* @return [CloseEdgeType, position]
|
|
14
|
+
*/
|
|
15
|
+
export declare const computePositionEdge: (position: number, scale: number, size: number, innerSize: number) => readonly [CloseEdgeType, number];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.computePositionEdge = exports.getReachType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* 获取接触边缘类型
|
|
6
|
+
*/
|
|
7
|
+
var getReachType = function (initialTouchState, horizontalCloseEdge, verticalCloseEdge, reachPosition) {
|
|
8
|
+
if ((horizontalCloseEdge && initialTouchState === 1) || reachPosition === 'x') {
|
|
9
|
+
return 'x';
|
|
10
|
+
}
|
|
11
|
+
else if ((verticalCloseEdge && initialTouchState > 1) || reachPosition === 'y') {
|
|
12
|
+
return 'y';
|
|
13
|
+
}
|
|
14
|
+
return undefined;
|
|
15
|
+
};
|
|
16
|
+
exports.getReachType = getReachType;
|
|
17
|
+
/**
|
|
18
|
+
* 计算接触边缘位置
|
|
19
|
+
* @param position - x/y
|
|
20
|
+
* @param scale
|
|
21
|
+
* @param size - width/height
|
|
22
|
+
* @param innerSize - innerWidth/innerHeight
|
|
23
|
+
* @return [CloseEdgeType, position]
|
|
24
|
+
*/
|
|
25
|
+
var computePositionEdge = function (position, scale, size, innerSize) {
|
|
26
|
+
var currentWidth = size * scale;
|
|
27
|
+
// 图片超出的宽度
|
|
28
|
+
var outOffset = (currentWidth - innerSize) / 2;
|
|
29
|
+
var closedEdge = undefined;
|
|
30
|
+
var current = position;
|
|
31
|
+
if (currentWidth <= innerSize) {
|
|
32
|
+
closedEdge = 1;
|
|
33
|
+
current = 0;
|
|
34
|
+
}
|
|
35
|
+
else if (position > 0 && outOffset - position <= 0) {
|
|
36
|
+
closedEdge = 2;
|
|
37
|
+
current = outOffset;
|
|
38
|
+
}
|
|
39
|
+
else if (position < 0 && outOffset + position <= 0) {
|
|
40
|
+
closedEdge = 3;
|
|
41
|
+
current = -outOffset;
|
|
42
|
+
}
|
|
43
|
+
return [closedEdge, current];
|
|
44
|
+
};
|
|
45
|
+
exports.computePositionEdge = computePositionEdge;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* 从 Touch 事件中获取两个触控中心位置
|
|
5
|
+
*/
|
|
6
|
+
function getMultipleTouchPosition(evt) {
|
|
7
|
+
var _a = evt.touches[0], clientX = _a.clientX, clientY = _a.clientY;
|
|
8
|
+
if (evt.touches.length >= 2) {
|
|
9
|
+
var _b = evt.touches[1], nextClientX = _b.clientX, nextClientY = _b.clientY;
|
|
10
|
+
return [(clientX + nextClientX) / 2, (clientY + nextClientY) / 2, Math.sqrt(Math.pow((nextClientX - clientX), 2) + Math.pow((nextClientY - clientY), 2))];
|
|
11
|
+
}
|
|
12
|
+
return [clientX, clientY, 0];
|
|
13
|
+
}
|
|
14
|
+
exports.default = getMultipleTouchPosition;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取移动或缩放之后的中心点
|
|
3
|
+
*/
|
|
4
|
+
export default function getPositionOnMoveOrScale(x: number, y: number, width: number, height: number, scale: number, toScale: number, clientX?: number, clientY?: number, offsetX?: number, offsetY?: number): {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
lastCX: number;
|
|
8
|
+
lastCY: number;
|
|
9
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var variables_1 = require("../variables");
|
|
4
|
+
var edgeHandle_1 = require("./edgeHandle");
|
|
5
|
+
/**
|
|
6
|
+
* 获取移动或缩放之后的中心点
|
|
7
|
+
*/
|
|
8
|
+
function getPositionOnMoveOrScale(x, y, width, height, scale, toScale, clientX, clientY, offsetX, offsetY) {
|
|
9
|
+
if (clientX === void 0) { clientX = window.innerWidth / 2; }
|
|
10
|
+
if (clientY === void 0) { clientY = window.innerWidth / 2; }
|
|
11
|
+
if (offsetX === void 0) { offsetX = 0; }
|
|
12
|
+
if (offsetY === void 0) { offsetY = 0; }
|
|
13
|
+
// 是否接触边缘
|
|
14
|
+
var closedEdgeX = (0, edgeHandle_1.computePositionEdge)(x, toScale, width, window.innerWidth)[0];
|
|
15
|
+
var closedEdgeY = (0, edgeHandle_1.computePositionEdge)(y, toScale, height, window.innerWidth)[0];
|
|
16
|
+
var centerClientX = window.innerWidth / 2;
|
|
17
|
+
var centerClientY = window.innerWidth / 2;
|
|
18
|
+
// 坐标偏移
|
|
19
|
+
var lastPositionX = centerClientX + x;
|
|
20
|
+
var lastPositionY = centerClientY + y;
|
|
21
|
+
// 偏移位置
|
|
22
|
+
var originX = clientX - (clientX - lastPositionX) * (toScale / scale) - centerClientX;
|
|
23
|
+
var originY = clientY - (clientY - lastPositionY) * (toScale / scale) - centerClientY;
|
|
24
|
+
// 长图模式无左右反馈
|
|
25
|
+
var longModeEdge = height / width >= variables_1.longModeRatio && width * toScale === window.innerWidth;
|
|
26
|
+
// 超出边缘距离减半
|
|
27
|
+
return {
|
|
28
|
+
x: originX + (longModeEdge ? 0 : closedEdgeX ? offsetX / 2 : offsetX),
|
|
29
|
+
y: originY + (closedEdgeY ? offsetY / 2 : offsetY),
|
|
30
|
+
lastCX: clientX,
|
|
31
|
+
lastCY: clientY,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
exports.default = getPositionOnMoveOrScale;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* 获取旋转后的宽高
|
|
5
|
+
*/
|
|
6
|
+
function getRotateSize(rotate, width, height) {
|
|
7
|
+
var isVertical = rotate % 180 !== 0;
|
|
8
|
+
// 若图片不是水平则调换属性
|
|
9
|
+
if (isVertical) {
|
|
10
|
+
return [height, width, isVertical];
|
|
11
|
+
}
|
|
12
|
+
return [width, height, isVertical];
|
|
13
|
+
}
|
|
14
|
+
exports.default = getRotateSize;
|
|
@@ -0,0 +1,48 @@
|
|
|
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 variables_1 = require("../variables");
|
|
7
|
+
var getRotateSize_1 = __importDefault(require("./getRotateSize"));
|
|
8
|
+
/**
|
|
9
|
+
* 获取图片合适的大小
|
|
10
|
+
*/
|
|
11
|
+
function getSuitableImageSize(naturalWidth, naturalHeight, rotate) {
|
|
12
|
+
var _a = (0, getRotateSize_1.default)(rotate, window.innerWidth, window.innerHeight), currentWidth = _a[0], currentHeight = _a[1], isVertical = _a[2];
|
|
13
|
+
var y = 0;
|
|
14
|
+
var width = currentWidth;
|
|
15
|
+
var height = currentHeight;
|
|
16
|
+
// 自适应宽高
|
|
17
|
+
var autoWidth = (naturalWidth / naturalHeight) * currentHeight;
|
|
18
|
+
var autoHeight = (naturalHeight / naturalWidth) * currentWidth;
|
|
19
|
+
if (naturalWidth < currentWidth && naturalHeight < currentHeight) {
|
|
20
|
+
width = naturalWidth;
|
|
21
|
+
height = naturalHeight;
|
|
22
|
+
}
|
|
23
|
+
else if (naturalWidth < currentWidth && naturalHeight >= currentHeight) {
|
|
24
|
+
width = autoWidth;
|
|
25
|
+
}
|
|
26
|
+
else if (naturalWidth >= currentWidth && naturalHeight < currentHeight) {
|
|
27
|
+
height = autoHeight;
|
|
28
|
+
}
|
|
29
|
+
else if (naturalWidth / naturalHeight > currentWidth / currentHeight) {
|
|
30
|
+
height = autoHeight;
|
|
31
|
+
}
|
|
32
|
+
// 长图模式
|
|
33
|
+
else if (naturalHeight / naturalWidth >= variables_1.longModeRatio && !isVertical) {
|
|
34
|
+
height = autoHeight;
|
|
35
|
+
y = (height - currentHeight) / 2;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
width = autoWidth;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
width: width,
|
|
42
|
+
height: height,
|
|
43
|
+
x: 0,
|
|
44
|
+
y: y,
|
|
45
|
+
pause: true,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
exports.default = getSuitableImageSize;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.limitScale = exports.limitNumber = void 0;
|
|
4
|
+
var variables_1 = require("../variables");
|
|
5
|
+
var limitNumber = function (value, min, max) {
|
|
6
|
+
return Math.max(Math.min(value, max), min);
|
|
7
|
+
};
|
|
8
|
+
exports.limitNumber = limitNumber;
|
|
9
|
+
/**
|
|
10
|
+
* 限制最大/最小缩放
|
|
11
|
+
*/
|
|
12
|
+
var limitScale = function (scale, max, buffer) {
|
|
13
|
+
if (max === void 0) { max = 0; }
|
|
14
|
+
if (buffer === void 0) { buffer = 0; }
|
|
15
|
+
return (0, exports.limitNumber)(scale, variables_1.minScale * (1 - buffer), Math.max(variables_1.maxScale, max) * (1 + buffer));
|
|
16
|
+
};
|
|
17
|
+
exports.limitScale = limitScale;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 最大触摸时间
|
|
3
|
+
*/
|
|
4
|
+
export declare const maxTouchTime = 200;
|
|
5
|
+
/**
|
|
6
|
+
* 默认动画速度
|
|
7
|
+
*/
|
|
8
|
+
export declare const defaultSpeed = 400;
|
|
9
|
+
/**
|
|
10
|
+
* 默认动画函数
|
|
11
|
+
*/
|
|
12
|
+
export declare const defaultEasing = "cubic-bezier(0.25, 0.8, 0.25, 1)";
|
|
13
|
+
/**
|
|
14
|
+
* 最大滑动切换图片距离
|
|
15
|
+
*/
|
|
16
|
+
export declare const maxMoveOffset = 40;
|
|
17
|
+
/**
|
|
18
|
+
* 图片的间隔
|
|
19
|
+
*/
|
|
20
|
+
export declare const horizontalOffset = 20;
|
|
21
|
+
/**
|
|
22
|
+
* 最小初始响应距离
|
|
23
|
+
*/
|
|
24
|
+
export declare const minStartTouchOffset = 20;
|
|
25
|
+
/**
|
|
26
|
+
* 默认背景透明度
|
|
27
|
+
*/
|
|
28
|
+
export declare const defaultOpacity = 1;
|
|
29
|
+
/**
|
|
30
|
+
* 最小缩放度
|
|
31
|
+
*/
|
|
32
|
+
export declare const minScale = 1;
|
|
33
|
+
/**
|
|
34
|
+
* 最大缩放度(若图片足够大,则会超出)
|
|
35
|
+
*/
|
|
36
|
+
export declare const maxScale = 6;
|
|
37
|
+
/**
|
|
38
|
+
* 最小长图模式比例
|
|
39
|
+
*/
|
|
40
|
+
export declare const longModeRatio = 3;
|
|
41
|
+
/**
|
|
42
|
+
* 缩放弹性缓冲
|
|
43
|
+
*/
|
|
44
|
+
export declare const scaleBuffer = 0.2;
|
|
45
|
+
/**
|
|
46
|
+
* 最大等待动画时间
|
|
47
|
+
*/
|
|
48
|
+
export declare const maxWaitAnimationTime = 250;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.maxWaitAnimationTime = exports.scaleBuffer = exports.longModeRatio = exports.maxScale = exports.minScale = exports.defaultOpacity = exports.minStartTouchOffset = exports.horizontalOffset = exports.maxMoveOffset = exports.defaultEasing = exports.defaultSpeed = exports.maxTouchTime = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* 最大触摸时间
|
|
6
|
+
*/
|
|
7
|
+
exports.maxTouchTime = 200;
|
|
8
|
+
/**
|
|
9
|
+
* 默认动画速度
|
|
10
|
+
*/
|
|
11
|
+
exports.defaultSpeed = 400;
|
|
12
|
+
/**
|
|
13
|
+
* 默认动画函数
|
|
14
|
+
*/
|
|
15
|
+
exports.defaultEasing = 'cubic-bezier(0.25, 0.8, 0.25, 1)';
|
|
16
|
+
/**
|
|
17
|
+
* 最大滑动切换图片距离
|
|
18
|
+
*/
|
|
19
|
+
exports.maxMoveOffset = 40;
|
|
20
|
+
/**
|
|
21
|
+
* 图片的间隔
|
|
22
|
+
*/
|
|
23
|
+
exports.horizontalOffset = 20;
|
|
24
|
+
/**
|
|
25
|
+
* 最小初始响应距离
|
|
26
|
+
*/
|
|
27
|
+
exports.minStartTouchOffset = 20;
|
|
28
|
+
/**
|
|
29
|
+
* 默认背景透明度
|
|
30
|
+
*/
|
|
31
|
+
exports.defaultOpacity = 1;
|
|
32
|
+
/**
|
|
33
|
+
* 最小缩放度
|
|
34
|
+
*/
|
|
35
|
+
exports.minScale = 1;
|
|
36
|
+
/**
|
|
37
|
+
* 最大缩放度(若图片足够大,则会超出)
|
|
38
|
+
*/
|
|
39
|
+
exports.maxScale = 6;
|
|
40
|
+
/**
|
|
41
|
+
* 最小长图模式比例
|
|
42
|
+
*/
|
|
43
|
+
exports.longModeRatio = 3;
|
|
44
|
+
/**
|
|
45
|
+
* 缩放弹性缓冲
|
|
46
|
+
*/
|
|
47
|
+
exports.scaleBuffer = 0.2;
|
|
48
|
+
/**
|
|
49
|
+
* 最大等待动画时间
|
|
50
|
+
*/
|
|
51
|
+
exports.maxWaitAnimationTime = 250;
|