js-cloudimage-360-view 3.0.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +3 -0
- package/CHANGELOG.md +167 -156
- package/LICENSE +27 -33
- package/README.md +820 -806
- package/bin/deploy-bundle.js +63 -0
- package/dist/ci360.service.js +65 -245
- package/dist/ci360.utils.js +2 -14
- package/dist/constants/index.js +0 -4
- package/dist/constants/props-require-reload.js +24 -12
- package/dist/index.js +0 -27
- package/dist/static/css/hotspots.css +221 -221
- package/dist/static/css/style.css +229 -229
- package/dist/utils/auto-play/get-speed-factor.js +0 -2
- package/dist/utils/auto-play/is-completed-one-cycle.js +0 -5
- package/dist/utils/auto-play/loop.js +3 -14
- package/dist/utils/class-names/add-class.js +0 -3
- package/dist/utils/class-names/remove-class.js +0 -2
- package/dist/utils/container-elements/apply-styles-to-container.js +0 -2
- package/dist/utils/container-elements/create-360-view-circle-icon.js +0 -2
- package/dist/utils/container-elements/create-360-view-icon.js +0 -2
- package/dist/utils/container-elements/create-box-shadow.js +0 -2
- package/dist/utils/container-elements/create-canvas.js +0 -2
- package/dist/utils/container-elements/create-close-fullscreen-icon.js +0 -2
- package/dist/utils/container-elements/create-fullscreen-icon.js +0 -2
- package/dist/utils/container-elements/create-fullscreen-modal.js +0 -2
- package/dist/utils/container-elements/create-icons-container.js +0 -2
- package/dist/utils/container-elements/create-inner-box.js +0 -2
- package/dist/utils/container-elements/create-loader.js +0 -2
- package/dist/utils/container-elements/create-magnifier-icon.js +0 -2
- package/dist/utils/container-elements/index.js +0 -13
- package/dist/utils/container-elements/remove-child-from-parent.js +0 -2
- package/dist/utils/controls/get-item-skipped.js +0 -2
- package/dist/utils/controls/init-controls.js +7 -16
- package/dist/utils/hotspots/attach-events/hide-popup.js +0 -2
- package/dist/utils/hotspots/attach-events/show-popup.js +0 -2
- package/dist/utils/hotspots/configs-error-handler.js +6 -10
- package/dist/utils/hotspots/create-popper-instace.js +1 -4
- package/dist/utils/hotspots/elements/create-carousel-dot.js +0 -6
- package/dist/utils/hotspots/elements/create-carousel-image.js +0 -4
- package/dist/utils/hotspots/elements/create-hotspot-icon.js +3 -14
- package/dist/utils/hotspots/elements/create-hotspot-popup-link.js +2 -6
- package/dist/utils/hotspots/elements/create-hotspots.js +0 -5
- package/dist/utils/hotspots/elements/create-images-carousel.js +0 -4
- package/dist/utils/hotspots/elements/create-modal-description.js +0 -2
- package/dist/utils/hotspots/elements/create-modal-title.js +0 -2
- package/dist/utils/hotspots/elements/create-model-elements.js +8 -25
- package/dist/utils/hotspots/elements/create-popup-arrow.js +0 -2
- package/dist/utils/hotspots/elements/create-popup.js +6 -18
- package/dist/utils/hotspots/elements/create-read-more-btn.js +0 -2
- package/dist/utils/hotspots/fill-empty-coord-with-previous.js +1 -6
- package/dist/utils/hotspots/generate-hotspots-configs.js +11 -21
- package/dist/utils/hotspots/generate-popup-config.js +9 -11
- package/dist/utils/hotspots/get-hotspot-icon.js +0 -2
- package/dist/utils/hotspots/get-hotspot-orientation.js +0 -4
- package/dist/utils/hotspots/get-hotspot-popup-node.js +0 -2
- package/dist/utils/hotspots/get-popup-node.js +0 -2
- package/dist/utils/hotspots/hide-hotspot-icon.js +0 -2
- package/dist/utils/hotspots/hide-hotspots-icons.js +0 -3
- package/dist/utils/hotspots/is-mouse-on-hotspot.js +0 -2
- package/dist/utils/hotspots/prepare-hotspots-positions.js +0 -6
- package/dist/utils/hotspots/set-current-slide.js +0 -2
- package/dist/utils/hotspots/toggle-popup-events.js +0 -4
- package/dist/utils/hotspots/update-hotspot-icon-position.js +0 -2
- package/dist/utils/hotspots/update-hotspots.js +6 -14
- package/dist/utils/image-src/generate-images-path.js +8 -17
- package/dist/utils/image-src/is-props-change-require-reload.js +0 -5
- package/dist/utils/index.js +0 -26
- package/dist/utils/load-images/images-from-folder/prepare-images-from-folder.js +2 -11
- package/dist/utils/load-images/images-from-list/prepare-images-from-list.js +0 -8
- package/dist/utils/load-images/lazyload/init-lazyload.js +3 -11
- package/dist/utils/load-images/lazyload/prepare-first-image/prepare-first-image-from-folder.js +1 -5
- package/dist/utils/load-images/lazyload/prepare-first-image/prepare-first-image-from-list.js +0 -9
- package/dist/utils/load-images/load-image-as-promise.js +8 -46
- package/dist/utils/load-images/load-images-relative-to-container-size.js +10 -49
- package/dist/utils/load-images/load-original-images.js +23 -37
- package/dist/utils/load-images/pad.js +0 -2
- package/dist/utils/load-images/preload-images.js +2 -9
- package/dist/utils/load-images/preload-original-images.js +2 -9
- package/dist/utils/magnify/get-current-original-image.js +0 -6
- package/dist/utils/magnify/get-cursor-position.js +0 -2
- package/dist/utils/magnify/magnify.js +4 -11
- package/dist/utils/magnify/move-magnifier.js +6 -14
- package/dist/utils/responsive/contain.js +0 -2
- package/dist/utils/responsive/fit.js +0 -4
- package/dist/utils/responsive/get-image-aspect-ratio.js +0 -8
- package/dist/utils/responsive/get-responsive-width-of-container.js +0 -3
- package/dist/utils/responsive/get-size-according-to-pixel-ratio.js +0 -2
- package/dist/utils/responsive/get-size-limit.js +0 -2
- package/dist/utils/spin-y/get-moving-direction.js +0 -3
- package/dist/utils/zoom/generate-zoom-in-steps.js +0 -2
- package/dist/utils/zoom/generate-zoom-out-steps.js +0 -2
- package/package.json +67 -62
- package/yarn-error.log +101 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
require('isomorphic-fetch')
|
|
3
|
+
require('dotenv').config()
|
|
4
|
+
const FormData = require('form-data')
|
|
5
|
+
const { createReadStream } = require('fs')
|
|
6
|
+
const { join } = require('path')
|
|
7
|
+
let { version } = require('../package.json')
|
|
8
|
+
|
|
9
|
+
const splittedVersion = version.split('.')
|
|
10
|
+
version = splittedVersion.filter((v) => parseInt(v) || parseInt(v) === 0).map((v) => parseInt(v)).slice(0, 3).join('.')
|
|
11
|
+
|
|
12
|
+
const apiUrl = process.env.BUNDLE_API_URL || 'https://api.filerobot.com'
|
|
13
|
+
|
|
14
|
+
const pluginsContainer = process.env.BUNDLE_PLUGINS_CONTAINER
|
|
15
|
+
const securityTemplateId = process.env.BUNDLE_UPLOAD_SECURITY_TEMPLATE_ID
|
|
16
|
+
const pluginFolder = `${process.env.BUNDLE_FOLDER}`
|
|
17
|
+
const pluginVersion = version || 'latest'
|
|
18
|
+
const latestFolder = 'latest'
|
|
19
|
+
|
|
20
|
+
const generateSassKey = () => fetch(`${apiUrl}/${pluginsContainer}/key/${securityTemplateId}`)
|
|
21
|
+
.then((res) => res.json()).then((res) => {
|
|
22
|
+
if (res.status === 'error') {
|
|
23
|
+
console.error(`Error while generating SASS key: ${res.msg || res.hint}`)
|
|
24
|
+
} else {
|
|
25
|
+
return res.key
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
.catch(() => new Error(`Unable to get SASS key for the provided security template key ${securityTemplateId}`))
|
|
29
|
+
|
|
30
|
+
const statiUploadEndpoint = `${apiUrl}/${pluginsContainer}/v4/files?folder=${pluginFolder}`
|
|
31
|
+
|
|
32
|
+
const deploy = (sassKey, folderName = pluginVersion) => {
|
|
33
|
+
const uploadEndpoint = `${statiUploadEndpoint}/${folderName}`
|
|
34
|
+
const formData = new FormData()
|
|
35
|
+
formData.append('files[]', createReadStream(
|
|
36
|
+
join(__dirname, '../build/js-cloudimage-360-view.min.js')
|
|
37
|
+
))
|
|
38
|
+
|
|
39
|
+
return fetch(uploadEndpoint, {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
body: formData,
|
|
42
|
+
headers: {
|
|
43
|
+
'X-Filerobot-Key': sassKey
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
.then((res) => res.json())
|
|
47
|
+
.then((res) => {
|
|
48
|
+
if (res.status === 'error') {
|
|
49
|
+
console.error(`Error while deploying:${res.msg ? ` ${res.msg} ` : ''}${res.hint ? `- ${res.hint}` : ''}`)
|
|
50
|
+
} else {
|
|
51
|
+
console.log(`Plugin Bundle v${pluginVersion} deployed successfully to ${folderName}.`)
|
|
52
|
+
const uploadedFile = res.file || []
|
|
53
|
+
console.log(`- [${uploadedFile.name}] URL:`, uploadedFile.url?.cdn)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return sassKey
|
|
57
|
+
})
|
|
58
|
+
.catch(console.error)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
generateSassKey()
|
|
62
|
+
.then((sassKey) => deploy(sassKey).then((sassKey) => deploy(sassKey, latestFolder)))
|
|
63
|
+
.catch(console.error)
|