js-cloudimage-360-view 2.7.2-beta.8 → 2.7.6
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/CHANGELOG.md +32 -3
- package/LICENSE +13 -1
- package/README.md +169 -88
- package/dist/ci360.service.js +132 -121
- package/dist/ci360.utils.js +4 -6
- package/dist/constants/auto-play-behavior.js +13 -0
- package/dist/constants/falsy-values.js +8 -0
- package/dist/constants/image-src-props.js +8 -0
- package/dist/constants/index.js +43 -0
- package/dist/constants/orientations.js +12 -0
- package/dist/constants/regex.js +10 -0
- package/dist/index.js +28 -2
- package/dist/utils/auto-play/get-speed-factor.js +14 -0
- package/dist/utils/auto-play/is-completed-one-cycle.js +32 -0
- package/dist/utils/auto-play/loop.js +67 -0
- package/dist/utils/common/add-class.js +18 -0
- package/dist/utils/common/remove-class.js +16 -0
- package/dist/utils/container-elements/apply-styles-to-container.js +16 -0
- package/dist/utils/container-elements/create-360-view-circle-icon.js +16 -0
- package/dist/utils/container-elements/create-360-view-icon.js +15 -0
- package/dist/utils/container-elements/create-box-shadow.js +16 -0
- package/dist/utils/container-elements/create-canvas.js +16 -0
- package/dist/utils/container-elements/create-close-fullscreen-icon.js +14 -0
- package/dist/utils/container-elements/create-fullscreen-icon.js +14 -0
- package/dist/utils/container-elements/create-fullscreen-modal.js +20 -0
- package/dist/utils/container-elements/create-icons-container.js +15 -0
- package/dist/utils/container-elements/create-inner-box.js +15 -0
- package/dist/utils/container-elements/create-loader.js +15 -0
- package/dist/utils/container-elements/create-magnifier-icon.js +14 -0
- package/dist/utils/container-elements/index.js +101 -0
- package/dist/utils/controls/get-item-skipped.js +13 -0
- package/dist/utils/controls/init-controls.js +77 -0
- package/dist/utils/hotspot/attach-popup-events.js +63 -0
- package/dist/utils/hotspot/configs-error-handler.js +30 -0
- package/dist/utils/hotspot/create-popper-instace.js +32 -0
- package/dist/utils/hotspot/elements/create-carousel-dot.js +26 -0
- package/dist/utils/hotspot/elements/create-carousel-image.js +21 -0
- package/dist/utils/hotspot/elements/create-hotspot-icon.js +42 -0
- package/dist/utils/hotspot/elements/create-hotspot-popup-link.js +23 -0
- package/dist/utils/hotspot/elements/create-hotspots.js +20 -0
- package/dist/utils/hotspot/elements/create-images-carousel.js +27 -0
- package/dist/utils/hotspot/elements/create-modal-description.js +15 -0
- package/dist/utils/hotspot/elements/create-modal-title.js +15 -0
- package/dist/utils/hotspot/elements/create-model-elements.js +49 -0
- package/dist/utils/hotspot/elements/create-popup-arrow.js +16 -0
- package/dist/utils/hotspot/elements/create-popup.js +60 -0
- package/dist/utils/hotspot/fill-previous-coord-with-previous.js +26 -0
- package/dist/utils/hotspot/generate-hotspots-configs.js +41 -0
- package/dist/utils/hotspot/generate-popup-config.js +34 -0
- package/dist/utils/hotspot/get-hotspot-icon.js +14 -0
- package/dist/utils/hotspot/get-hotspot-orientation.js +21 -0
- package/dist/utils/hotspot/get-hotspot-popup-node.js +19 -0
- package/dist/utils/hotspot/get-hotspot-variant.js +20 -0
- package/dist/utils/hotspot/get-popup-node.js +14 -0
- package/dist/utils/hotspot/hide-hotspot-icon.js +13 -0
- package/dist/utils/hotspot/hide-hotspots-icons.js +18 -0
- package/dist/utils/hotspot/is-mouse-on-hotspot.js +14 -0
- package/dist/utils/hotspot/prepare-hotspots-positions.js +28 -0
- package/dist/utils/hotspot/set-current-slide.js +23 -0
- package/dist/utils/hotspot/update-hotspot-icon-position.js +21 -0
- package/dist/utils/hotspot/update-hotspots.js +60 -0
- package/dist/utils/image-src/generate-images-path.js +40 -0
- package/dist/utils/image-src/is-src-props-changed.js +23 -0
- package/dist/utils/index.js +228 -0
- package/dist/utils/load-images/images-from-folder/prepare-images-from-folder.js +36 -0
- package/dist/utils/load-images/images-from-list/prepare-images-from-list.js +37 -0
- package/dist/utils/load-images/load-image-as-promise.js +79 -0
- package/dist/utils/load-images/load-image.js +26 -0
- package/dist/utils/load-images/load-images-relative-to-container-size.js +58 -0
- package/dist/utils/load-images/load-original-images.js +58 -0
- package/dist/utils/load-images/pad.js +14 -0
- package/dist/utils/load-images/preload-images.js +38 -0
- package/dist/utils/load-images/preload-original-images.js +38 -0
- package/dist/utils/magnify/get-current-original-image.js +29 -0
- package/dist/utils/magnify/get-cursor-position.js +24 -0
- package/dist/utils/magnify/magnify.js +54 -0
- package/dist/utils/magnify/move-magnifier.js +47 -0
- package/dist/utils/responsive/contain.js +11 -0
- package/dist/utils/responsive/fit.js +33 -0
- package/dist/utils/responsive/get-image-aspect-ratio.js +39 -0
- package/dist/utils/responsive/get-responsive-width-of-container.js +14 -0
- package/dist/utils/responsive/get-size-according-to-pixel-ratio.js +17 -0
- package/dist/utils/responsive/get-size-limit.js +14 -0
- package/dist/utils/spin-y/get-moving-direction.js +21 -0
- package/dist/utils/zoom/generate-zoom-in-steps.js +20 -0
- package/dist/utils/zoom/generate-zoom-out-steps.js +20 -0
- package/package.json +4 -3
- package/.vscode/settings.json +0 -2
- package/dist/ci360.constants.js +0 -34
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getHotspotPopupNode = void 0;
|
|
7
|
+
|
|
8
|
+
var getHotspotPopupNode = function getHotspotPopupNode(anchorId, open) {
|
|
9
|
+
var hotspotPopupSelector = "[data-hotspot-popup-id=".concat(anchorId, "]");
|
|
10
|
+
var hotspotPopup = document.querySelector(hotspotPopupSelector);
|
|
11
|
+
|
|
12
|
+
if (open) {
|
|
13
|
+
hotspotPopup.setAttribute('data-show', '');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return hotspotPopup;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.getHotspotPopupNode = getHotspotPopupNode;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getHotspotVariant = void 0;
|
|
7
|
+
|
|
8
|
+
var getHotspotVariant = function getHotspotVariant(variant) {
|
|
9
|
+
if (variant.toLowerCase() === 'link') {
|
|
10
|
+
return 'link';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (variant.toLowerCase() === 'custom') {
|
|
14
|
+
return 'custom';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return 'link';
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.getHotspotVariant = getHotspotVariant;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getPopupNode = void 0;
|
|
7
|
+
|
|
8
|
+
var getPopupNode = function getPopupNode(popupId) {
|
|
9
|
+
var popupSelector = 'data-CI-360-anchor';
|
|
10
|
+
var popupNode = document.querySelector("[".concat(popupSelector, "=").concat(popupId, "]"));
|
|
11
|
+
return popupNode;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.getPopupNode = getPopupNode;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.hideHotspotIcon = void 0;
|
|
7
|
+
|
|
8
|
+
var hideHotspotIcon = function hideHotspotIcon(icon) {
|
|
9
|
+
icon.style.visibility = 'hidden';
|
|
10
|
+
icon.style.opacity = 0;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.hideHotspotIcon = hideHotspotIcon;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.hideHotspotsIcons = void 0;
|
|
7
|
+
|
|
8
|
+
var _hideHotspotIcon = require("./hide-hotspot-icon");
|
|
9
|
+
|
|
10
|
+
var hideHotspotsIcons = function hideHotspotsIcons() {
|
|
11
|
+
var hotspotIconSelector = '[data-hotspot-icon-id]';
|
|
12
|
+
var hotspotIcons = document.querySelectorAll(hotspotIconSelector) || [];
|
|
13
|
+
hotspotIcons.forEach(function (hotspotIcon) {
|
|
14
|
+
(0, _hideHotspotIcon.hideHotspotIcon)(hotspotIcon);
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.hideHotspotsIcons = hideHotspotsIcons;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isMouseOnHotspot = void 0;
|
|
7
|
+
|
|
8
|
+
var isMouseOnHotspot = function isMouseOnHotspot() {
|
|
9
|
+
var hotspotElementsSelector = '[data-cloudimage-360-show]';
|
|
10
|
+
var hostpotElements = document.querySelectorAll(hotspotElementsSelector);
|
|
11
|
+
return !!hostpotElements.length;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.isMouseOnHotspot = isMouseOnHotspot;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.prepareHotspotsPositions = void 0;
|
|
7
|
+
|
|
8
|
+
var _fillPreviousCoordWithPrevious = require("./fill-previous-coord-with-previous");
|
|
9
|
+
|
|
10
|
+
var prepareHotspotsPositions = function prepareHotspotsPositions(hotspots) {
|
|
11
|
+
return hotspots.reduce(function (accumulate, current, currentIndex) {
|
|
12
|
+
var isIncludesXcoord = !!(current !== null && current !== void 0 && current.xCoord);
|
|
13
|
+
var isIncludesYcoord = !!(current !== null && current !== void 0 && current.yCoord);
|
|
14
|
+
|
|
15
|
+
if (!isIncludesXcoord) {
|
|
16
|
+
current.xCoord = (0, _fillPreviousCoordWithPrevious.fillPreviousCoordWithPrevious)(hotspots, currentIndex, 'xCoord');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (!isIncludesYcoord) {
|
|
20
|
+
current.yCoord = (0, _fillPreviousCoordWithPrevious.fillPreviousCoordWithPrevious)(hotspots, currentIndex, 'yCoord');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
accumulate.push(current);
|
|
24
|
+
return accumulate;
|
|
25
|
+
}, []);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.prepareHotspotsPositions = prepareHotspotsPositions;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setCurrentSlide = void 0;
|
|
7
|
+
|
|
8
|
+
var setCurrentSlide = function setCurrentSlide(image, imageDot, popup) {
|
|
9
|
+
var activeDotSelector = '[data-active-dot]';
|
|
10
|
+
var activeImageSelector = '[data-active-image]';
|
|
11
|
+
var previousActiveDot = popup.querySelector(activeDotSelector);
|
|
12
|
+
var previousActiveImage = popup.querySelector(activeImageSelector);
|
|
13
|
+
previousActiveDot.classList.remove('active-dot');
|
|
14
|
+
previousActiveDot.removeAttribute('data-active-dot');
|
|
15
|
+
previousActiveImage.classList.remove('active-image');
|
|
16
|
+
previousActiveImage.removeAttribute('data-active-image');
|
|
17
|
+
image.className += ' active-image';
|
|
18
|
+
image.setAttribute('data-active-image', '');
|
|
19
|
+
imageDot.className += ' active-dot';
|
|
20
|
+
imageDot.setAttribute('data-active-dot', '');
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.setCurrentSlide = setCurrentSlide;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.updateHotspotIconPosition = void 0;
|
|
7
|
+
|
|
8
|
+
var updateHotspotIconPosition = function updateHotspotIconPosition(container, initialDimensions, icon, xCoord, yCoord) {
|
|
9
|
+
icon.style.visibility = 'visible';
|
|
10
|
+
icon.style.opacity = 1;
|
|
11
|
+
icon.style.zIndex = 100;
|
|
12
|
+
icon.style.left = "".concat(-icon.offsetWidth / 2, "px");
|
|
13
|
+
icon.style.top = "".concat(-icon.offsetHeight / 2, "px");
|
|
14
|
+
var positionXRatio = container.offsetWidth / initialDimensions[0];
|
|
15
|
+
var positionYRatio = container.offsetHeight / initialDimensions[1];
|
|
16
|
+
var translateX = "".concat(positionXRatio * xCoord, "px");
|
|
17
|
+
var translateY = "".concat(positionYRatio * yCoord, "px");
|
|
18
|
+
icon.style.transform = "translate3d(".concat(translateX, ", ").concat(translateY, ", 0)");
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.updateHotspotIconPosition = updateHotspotIconPosition;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.updateHotspots = void 0;
|
|
7
|
+
|
|
8
|
+
var _getHotspotPopupNode = require("./get-hotspot-popup-node");
|
|
9
|
+
|
|
10
|
+
var _createPopperInstace = require("./create-popper-instace");
|
|
11
|
+
|
|
12
|
+
var _attachPopupEvents = require("./attach-popup-events");
|
|
13
|
+
|
|
14
|
+
var _prepareHotspotsPositions = require("./prepare-hotspots-positions");
|
|
15
|
+
|
|
16
|
+
var _getHotspotIcon = require("./get-hotspot-icon");
|
|
17
|
+
|
|
18
|
+
var _updateHotspotIconPosition = require("./update-hotspot-icon-position");
|
|
19
|
+
|
|
20
|
+
var _hideHotspotIcon = require("./hide-hotspot-icon");
|
|
21
|
+
|
|
22
|
+
var _getHotspotOrientation = require("./get-hotspot-orientation");
|
|
23
|
+
|
|
24
|
+
var updateHotspots = function updateHotspots(container, hotspotsProps) {
|
|
25
|
+
var activeImageX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
26
|
+
var activeImageY = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
27
|
+
var movingDirection = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'x-axis';
|
|
28
|
+
hotspotsProps.forEach(function (hotspotProps) {
|
|
29
|
+
var popupProps = hotspotProps.popupProps,
|
|
30
|
+
hotspots = hotspotProps.hotspots,
|
|
31
|
+
initialDimensions = hotspotProps.initialDimensions,
|
|
32
|
+
orientation = hotspotProps.orientation;
|
|
33
|
+
var hotspotOriantaion = (0, _getHotspotOrientation.getHotspotOriantaion)(movingDirection);
|
|
34
|
+
var currentImage = orientation === 'x' ? activeImageX : activeImageY;
|
|
35
|
+
var anchorId = popupProps.anchorId,
|
|
36
|
+
open = popupProps.open;
|
|
37
|
+
var popup = (0, _getHotspotPopupNode.getHotspotPopupNode)(anchorId, open);
|
|
38
|
+
var hotspotIcon = (0, _getHotspotIcon.getHotspotIcon)(anchorId);
|
|
39
|
+
var hotspotsPositions = (0, _prepareHotspotsPositions.prepareHotspotsPositions)(hotspots);
|
|
40
|
+
var popperInstance = (0, _createPopperInstace.createPopperInstance)(popup, popupProps, container);
|
|
41
|
+
popperInstance.state.elements.reference = hotspotIcon;
|
|
42
|
+
popperInstance.update();
|
|
43
|
+
(0, _attachPopupEvents.attachPopupEvents)(hotspotIcon, popup, popperInstance, open);
|
|
44
|
+
var currentPosition = hotspotsPositions.find(function (hotspotPosition) {
|
|
45
|
+
return hotspotPosition.imageIndex === currentImage;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (currentPosition && hotspotOriantaion === orientation) {
|
|
49
|
+
var _currentPosition$xCoo = currentPosition.xCoord,
|
|
50
|
+
xCoord = _currentPosition$xCoo === void 0 ? 0 : _currentPosition$xCoo,
|
|
51
|
+
_currentPosition$yCoo = currentPosition.yCoord,
|
|
52
|
+
yCoord = _currentPosition$yCoo === void 0 ? 0 : _currentPosition$yCoo;
|
|
53
|
+
(0, _updateHotspotIconPosition.updateHotspotIconPosition)(container, initialDimensions, hotspotIcon, xCoord, yCoord);
|
|
54
|
+
} else {
|
|
55
|
+
(0, _hideHotspotIcon.hideHotspotIcon)(hotspotIcon);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
exports.updateHotspots = updateHotspots;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.generateImagesPath = void 0;
|
|
7
|
+
|
|
8
|
+
var _falsyValues = require("../../constants/falsy-values");
|
|
9
|
+
|
|
10
|
+
var _getResponsiveWidthOfContainer = require("../responsive/get-responsive-width-of-container");
|
|
11
|
+
|
|
12
|
+
var _getSizeAccordingToPixelRatio = require("../responsive/get-size-according-to-pixel-ratio");
|
|
13
|
+
|
|
14
|
+
var generateImagesPath = function generateImagesPath(srcConfig) {
|
|
15
|
+
var container = srcConfig.container,
|
|
16
|
+
folder = srcConfig.folder,
|
|
17
|
+
apiVersion = srcConfig.apiVersion,
|
|
18
|
+
_srcConfig$filename = srcConfig.filename,
|
|
19
|
+
filename = _srcConfig$filename === void 0 ? '' : _srcConfig$filename,
|
|
20
|
+
ciParams = srcConfig.ciParams;
|
|
21
|
+
|
|
22
|
+
var _ref = ciParams || {},
|
|
23
|
+
ciToken = _ref.ciToken,
|
|
24
|
+
ciFilters = _ref.ciFilters,
|
|
25
|
+
ciTransformation = _ref.ciTransformation;
|
|
26
|
+
|
|
27
|
+
var src = "".concat(folder).concat(filename);
|
|
28
|
+
|
|
29
|
+
if (ciToken) {
|
|
30
|
+
var imageOffsetWidth = container.offsetWidth;
|
|
31
|
+
var vesrion = _falsyValues.FALSY_VALUES.indexOf(apiVersion) !== -1 ? null : apiVersion;
|
|
32
|
+
var finalApiVersion = vesrion ? "".concat(vesrion, "/") : '';
|
|
33
|
+
var ciSizeNext = (0, _getSizeAccordingToPixelRatio.getSizeAccordingToPixelRatio)((0, _getResponsiveWidthOfContainer.getResponsiveWidthOfContainer)(imageOffsetWidth));
|
|
34
|
+
src = "https://".concat(ciToken, ".cloudimg.io/").concat(finalApiVersion).concat(src, "?").concat(ciTransformation || "width=".concat(ciSizeNext)).concat(ciFilters ? "&f=".concat(ciFilters) : '');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return src;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
exports.generateImagesPath = generateImagesPath;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isSrcPropsChanged = void 0;
|
|
7
|
+
|
|
8
|
+
var _imageSrcProps = require("../../constants/image-src-props");
|
|
9
|
+
|
|
10
|
+
var isSrcPropsChanged = function isSrcPropsChanged(currentProps, changedProps) {
|
|
11
|
+
return Object.keys(changedProps).reduce(function (acc, current) {
|
|
12
|
+
var isPropChanged = currentProps[current] !== changedProps[current];
|
|
13
|
+
var isSrcProp = _imageSrcProps.IMAGE_SRC_PROPS.indexOf(current) !== -1;
|
|
14
|
+
|
|
15
|
+
if (isSrcProp && isPropChanged) {
|
|
16
|
+
acc = true;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return acc;
|
|
20
|
+
}, false);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.isSrcPropsChanged = isSrcPropsChanged;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
isSrcPropsChanged: true,
|
|
8
|
+
generateImagesPath: true,
|
|
9
|
+
preloadImages: true,
|
|
10
|
+
preloadOriginalImages: true,
|
|
11
|
+
contain: true,
|
|
12
|
+
getImageAspectRatio: true,
|
|
13
|
+
getCurrentOriginalImage: true,
|
|
14
|
+
magnify: true,
|
|
15
|
+
generateZoomInSteps: true,
|
|
16
|
+
generateZoomOutSteps: true,
|
|
17
|
+
loop: true,
|
|
18
|
+
getSpeedFactor: true,
|
|
19
|
+
isCompletedOneCycle: true,
|
|
20
|
+
addClass: true,
|
|
21
|
+
removeClass: true,
|
|
22
|
+
getMovingDirection: true,
|
|
23
|
+
getItemSkipped: true,
|
|
24
|
+
initControls: true,
|
|
25
|
+
updateHotspots: true,
|
|
26
|
+
createHotspots: true,
|
|
27
|
+
generateHotspotsConfigs: true,
|
|
28
|
+
isMouseOnHotspot: true,
|
|
29
|
+
hideHotspotsIcons: true
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "addClass", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function get() {
|
|
34
|
+
return _addClass.addClass;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "contain", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function get() {
|
|
40
|
+
return _contain.contain;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "createHotspots", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function get() {
|
|
46
|
+
return _createHotspots.createHotspots;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "generateHotspotsConfigs", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function get() {
|
|
52
|
+
return _generateHotspotsConfigs.generateHotspotsConfigs;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, "generateImagesPath", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function get() {
|
|
58
|
+
return _generateImagesPath.generateImagesPath;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "generateZoomInSteps", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function get() {
|
|
64
|
+
return _generateZoomInSteps.generateZoomInSteps;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
Object.defineProperty(exports, "generateZoomOutSteps", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function get() {
|
|
70
|
+
return _generateZoomOutSteps.generateZoomOutSteps;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "getCurrentOriginalImage", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function get() {
|
|
76
|
+
return _getCurrentOriginalImage.getCurrentOriginalImage;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(exports, "getImageAspectRatio", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function get() {
|
|
82
|
+
return _getImageAspectRatio.getImageAspectRatio;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(exports, "getItemSkipped", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function get() {
|
|
88
|
+
return _getItemSkipped.getItemSkipped;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
Object.defineProperty(exports, "getMovingDirection", {
|
|
92
|
+
enumerable: true,
|
|
93
|
+
get: function get() {
|
|
94
|
+
return _getMovingDirection.getMovingDirection;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
Object.defineProperty(exports, "getSpeedFactor", {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function get() {
|
|
100
|
+
return _getSpeedFactor.getSpeedFactor;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
Object.defineProperty(exports, "hideHotspotsIcons", {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
get: function get() {
|
|
106
|
+
return _hideHotspotsIcons.hideHotspotsIcons;
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(exports, "initControls", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function get() {
|
|
112
|
+
return _initControls.initControls;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
Object.defineProperty(exports, "isCompletedOneCycle", {
|
|
116
|
+
enumerable: true,
|
|
117
|
+
get: function get() {
|
|
118
|
+
return _isCompletedOneCycle.isCompletedOneCycle;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
Object.defineProperty(exports, "isMouseOnHotspot", {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
get: function get() {
|
|
124
|
+
return _isMouseOnHotspot.isMouseOnHotspot;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
Object.defineProperty(exports, "isSrcPropsChanged", {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
get: function get() {
|
|
130
|
+
return _isSrcPropsChanged.isSrcPropsChanged;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(exports, "loop", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: function get() {
|
|
136
|
+
return _loop.loop;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(exports, "magnify", {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
get: function get() {
|
|
142
|
+
return _magnify.magnify;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
Object.defineProperty(exports, "preloadImages", {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function get() {
|
|
148
|
+
return _preloadImages.preloadImages;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
Object.defineProperty(exports, "preloadOriginalImages", {
|
|
152
|
+
enumerable: true,
|
|
153
|
+
get: function get() {
|
|
154
|
+
return _preloadOriginalImages.preloadOriginalImages;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
Object.defineProperty(exports, "removeClass", {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
get: function get() {
|
|
160
|
+
return _removeClass.removeClass;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
Object.defineProperty(exports, "updateHotspots", {
|
|
164
|
+
enumerable: true,
|
|
165
|
+
get: function get() {
|
|
166
|
+
return _updateHotspots.updateHotspots;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
var _isSrcPropsChanged = require("./image-src/is-src-props-changed");
|
|
171
|
+
|
|
172
|
+
var _generateImagesPath = require("./image-src/generate-images-path");
|
|
173
|
+
|
|
174
|
+
var _preloadImages = require("./load-images/preload-images");
|
|
175
|
+
|
|
176
|
+
var _preloadOriginalImages = require("./load-images/preload-original-images");
|
|
177
|
+
|
|
178
|
+
var _contain = require("./responsive/contain");
|
|
179
|
+
|
|
180
|
+
var _getImageAspectRatio = require("./responsive/get-image-aspect-ratio");
|
|
181
|
+
|
|
182
|
+
var _getCurrentOriginalImage = require("./magnify/get-current-original-image");
|
|
183
|
+
|
|
184
|
+
var _magnify = require("./magnify/magnify");
|
|
185
|
+
|
|
186
|
+
var _generateZoomInSteps = require("./zoom/generate-zoom-in-steps");
|
|
187
|
+
|
|
188
|
+
var _generateZoomOutSteps = require("./zoom/generate-zoom-out-steps");
|
|
189
|
+
|
|
190
|
+
var _loop = require("./auto-play/loop");
|
|
191
|
+
|
|
192
|
+
var _getSpeedFactor = require("./auto-play/get-speed-factor");
|
|
193
|
+
|
|
194
|
+
var _isCompletedOneCycle = require("./auto-play/is-completed-one-cycle");
|
|
195
|
+
|
|
196
|
+
var _addClass = require("./common/add-class");
|
|
197
|
+
|
|
198
|
+
var _removeClass = require("./common/remove-class");
|
|
199
|
+
|
|
200
|
+
var _getMovingDirection = require("./spin-y/get-moving-direction");
|
|
201
|
+
|
|
202
|
+
var _getItemSkipped = require("./controls/get-item-skipped");
|
|
203
|
+
|
|
204
|
+
var _initControls = require("./controls/init-controls");
|
|
205
|
+
|
|
206
|
+
var _containerElements = require("./container-elements");
|
|
207
|
+
|
|
208
|
+
Object.keys(_containerElements).forEach(function (key) {
|
|
209
|
+
if (key === "default" || key === "__esModule") return;
|
|
210
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
211
|
+
if (key in exports && exports[key] === _containerElements[key]) return;
|
|
212
|
+
Object.defineProperty(exports, key, {
|
|
213
|
+
enumerable: true,
|
|
214
|
+
get: function get() {
|
|
215
|
+
return _containerElements[key];
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
var _updateHotspots = require("./hotspot/update-hotspots");
|
|
221
|
+
|
|
222
|
+
var _createHotspots = require("./hotspot/elements/create-hotspots");
|
|
223
|
+
|
|
224
|
+
var _generateHotspotsConfigs = require("./hotspot/generate-hotspots-configs");
|
|
225
|
+
|
|
226
|
+
var _isMouseOnHotspot = require("./hotspot/is-mouse-on-hotspot");
|
|
227
|
+
|
|
228
|
+
var _hideHotspotsIcons = require("./hotspot/hide-hotspots-icons");
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.prepareImagesFromFolder = void 0;
|
|
9
|
+
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
+
|
|
12
|
+
var _regex = require("../../../constants/regex");
|
|
13
|
+
|
|
14
|
+
var _pad = require("../pad");
|
|
15
|
+
|
|
16
|
+
var prepareImagesFromFolder = function prepareImagesFromFolder(imagesSrc, srcConfig) {
|
|
17
|
+
var _ref = srcConfig || {},
|
|
18
|
+
amount = _ref.amount,
|
|
19
|
+
indexZeroBase = _ref.indexZeroBase;
|
|
20
|
+
|
|
21
|
+
var resultSrc = [];
|
|
22
|
+
var originalSrc = [];
|
|
23
|
+
(0, _toConsumableArray2.default)(new Array(amount)).forEach(function (_item, index) {
|
|
24
|
+
var nextZeroFilledIndex = (0, _pad.pad)(index + 1, indexZeroBase);
|
|
25
|
+
var imageResultSrc = imagesSrc.replace('{index}', nextZeroFilledIndex);
|
|
26
|
+
var imageOriginalSrc = imageResultSrc.replace(_regex.ORGINAL_SIZE_REGEX, '').replace(_regex.AND_SYMBOL_REGEX, '?');
|
|
27
|
+
resultSrc.push(imageResultSrc);
|
|
28
|
+
originalSrc.push(imageOriginalSrc);
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
resultSrc: resultSrc,
|
|
32
|
+
originalSrc: originalSrc
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.prepareImagesFromFolder = prepareImagesFromFolder;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.prepareImagesFromList = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _generateImagesPath = require("../../image-src/generate-images-path");
|
|
13
|
+
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
+
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
+
|
|
18
|
+
var prepareImagesFromList = function prepareImagesFromList(images, srcConfig) {
|
|
19
|
+
var folder = srcConfig.folder;
|
|
20
|
+
var resultSrc = [];
|
|
21
|
+
var originalSrc = [];
|
|
22
|
+
images.forEach(function (src) {
|
|
23
|
+
var nextSrcConfig = _objectSpread({}, srcConfig);
|
|
24
|
+
|
|
25
|
+
nextSrcConfig.folder = /(http(s?)):\/\//gi.test(src) ? '' : folder;
|
|
26
|
+
nextSrcConfig.filename = src;
|
|
27
|
+
var lastIndex = resultSrc.lastIndexOf('//');
|
|
28
|
+
resultSrc.push((0, _generateImagesPath.generateImagesPath)(nextSrcConfig));
|
|
29
|
+
originalSrc.push(resultSrc.slice(lastIndex));
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
resultSrc: resultSrc,
|
|
33
|
+
originalSrc: originalSrc
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports.prepareImagesFromList = prepareImagesFromList;
|