js-cloudimage-360-view 3.2.1 → 4.0.0-beta.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 (99) hide show
  1. package/.prettierrc +9 -0
  2. package/README.md +318 -721
  3. package/dist/js-cloudimage-360-view.min.css +1 -0
  4. package/dist/js-cloudimage-360-view.min.js +2111 -0
  5. package/package.json +30 -17
  6. package/.env +0 -3
  7. package/CHANGELOG.md +0 -175
  8. package/bin/deploy-bundle.js +0 -63
  9. package/dist/ci360.service.js +0 -1270
  10. package/dist/ci360.utils.js +0 -78
  11. package/dist/constants/auto-play-behavior.js +0 -13
  12. package/dist/constants/falsy-values.js +0 -8
  13. package/dist/constants/index.js +0 -39
  14. package/dist/constants/orientations.js +0 -12
  15. package/dist/constants/props-require-reload.js +0 -33
  16. package/dist/constants/regex.js +0 -10
  17. package/dist/index.js +0 -102
  18. package/dist/static/css/hotspots.css +0 -222
  19. package/dist/static/css/style.css +0 -230
  20. package/dist/utils/auto-play/get-speed-factor.js +0 -12
  21. package/dist/utils/auto-play/is-completed-one-cycle.js +0 -27
  22. package/dist/utils/auto-play/loop.js +0 -56
  23. package/dist/utils/class-names/add-class.js +0 -15
  24. package/dist/utils/class-names/remove-class.js +0 -14
  25. package/dist/utils/container-elements/apply-styles-to-container.js +0 -14
  26. package/dist/utils/container-elements/create-360-view-circle-icon.js +0 -14
  27. package/dist/utils/container-elements/create-360-view-icon.js +0 -13
  28. package/dist/utils/container-elements/create-box-shadow.js +0 -14
  29. package/dist/utils/container-elements/create-canvas.js +0 -14
  30. package/dist/utils/container-elements/create-close-fullscreen-icon.js +0 -12
  31. package/dist/utils/container-elements/create-fullscreen-icon.js +0 -12
  32. package/dist/utils/container-elements/create-fullscreen-modal.js +0 -18
  33. package/dist/utils/container-elements/create-icons-container.js +0 -13
  34. package/dist/utils/container-elements/create-inner-box.js +0 -13
  35. package/dist/utils/container-elements/create-loader.js +0 -13
  36. package/dist/utils/container-elements/create-magnifier-icon.js +0 -12
  37. package/dist/utils/container-elements/index.js +0 -96
  38. package/dist/utils/container-elements/remove-child-from-parent.js +0 -14
  39. package/dist/utils/controls/get-item-skipped.js +0 -11
  40. package/dist/utils/controls/init-controls.js +0 -68
  41. package/dist/utils/hotspots/attach-events/hide-popup.js +0 -13
  42. package/dist/utils/hotspots/attach-events/show-popup.js +0 -12
  43. package/dist/utils/hotspots/configs-error-handler.js +0 -23
  44. package/dist/utils/hotspots/create-popper-instace.js +0 -29
  45. package/dist/utils/hotspots/elements/create-carousel-dot.js +0 -20
  46. package/dist/utils/hotspots/elements/create-carousel-image.js +0 -18
  47. package/dist/utils/hotspots/elements/create-hotspot-icon.js +0 -55
  48. package/dist/utils/hotspots/elements/create-hotspot-popup-link.js +0 -19
  49. package/dist/utils/hotspots/elements/create-hotspots.js +0 -20
  50. package/dist/utils/hotspots/elements/create-images-carousel.js +0 -23
  51. package/dist/utils/hotspots/elements/create-modal-description.js +0 -13
  52. package/dist/utils/hotspots/elements/create-modal-title.js +0 -13
  53. package/dist/utils/hotspots/elements/create-model-elements.js +0 -49
  54. package/dist/utils/hotspots/elements/create-popup-arrow.js +0 -14
  55. package/dist/utils/hotspots/elements/create-popup.js +0 -55
  56. package/dist/utils/hotspots/elements/create-read-more-btn.js +0 -15
  57. package/dist/utils/hotspots/fill-empty-coord-with-previous.js +0 -21
  58. package/dist/utils/hotspots/generate-hotspots-configs.js +0 -48
  59. package/dist/utils/hotspots/generate-popup-config.js +0 -27
  60. package/dist/utils/hotspots/get-hotspot-icon.js +0 -12
  61. package/dist/utils/hotspots/get-hotspot-orientation.js +0 -17
  62. package/dist/utils/hotspots/get-hotspot-popup-node.js +0 -12
  63. package/dist/utils/hotspots/get-popup-node.js +0 -12
  64. package/dist/utils/hotspots/hide-hotspot-icon.js +0 -11
  65. package/dist/utils/hotspots/hide-hotspots-icons.js +0 -15
  66. package/dist/utils/hotspots/is-mouse-on-hotspot.js +0 -12
  67. package/dist/utils/hotspots/prepare-hotspots-positions.js +0 -22
  68. package/dist/utils/hotspots/set-current-slide.js +0 -21
  69. package/dist/utils/hotspots/toggle-popup-events.js +0 -19
  70. package/dist/utils/hotspots/update-hotspot-icon-position.js +0 -19
  71. package/dist/utils/hotspots/update-hotspots.js +0 -40
  72. package/dist/utils/image-src/generate-images-path.js +0 -33
  73. package/dist/utils/image-src/is-props-change-require-reload.js +0 -18
  74. package/dist/utils/index.js +0 -211
  75. package/dist/utils/load-images/images-from-folder/prepare-images-from-folder.js +0 -25
  76. package/dist/utils/load-images/images-from-list/prepare-images-from-list.js +0 -21
  77. package/dist/utils/load-images/lazyload/init-lazyload.js +0 -41
  78. package/dist/utils/load-images/lazyload/prepare-first-image/prepare-first-image-from-folder.js +0 -14
  79. package/dist/utils/load-images/lazyload/prepare-first-image/prepare-first-image-from-list.js +0 -20
  80. package/dist/utils/load-images/load-image-as-promise.js +0 -16
  81. package/dist/utils/load-images/load-images-relative-to-container-size.js +0 -19
  82. package/dist/utils/load-images/load-original-images.js +0 -44
  83. package/dist/utils/load-images/pad.js +0 -12
  84. package/dist/utils/load-images/preload-images.js +0 -28
  85. package/dist/utils/load-images/preload-original-images.js +0 -28
  86. package/dist/utils/magnify/get-current-original-image.js +0 -23
  87. package/dist/utils/magnify/get-cursor-position.js +0 -22
  88. package/dist/utils/magnify/magnify.js +0 -47
  89. package/dist/utils/magnify/move-magnifier.js +0 -39
  90. package/dist/utils/responsive/contain.js +0 -9
  91. package/dist/utils/responsive/fit.js +0 -29
  92. package/dist/utils/responsive/get-image-aspect-ratio.js +0 -31
  93. package/dist/utils/responsive/get-responsive-width-of-container.js +0 -11
  94. package/dist/utils/responsive/get-size-according-to-pixel-ratio.js +0 -15
  95. package/dist/utils/responsive/get-size-limit.js +0 -12
  96. package/dist/utils/spin-y/get-moving-direction.js +0 -18
  97. package/dist/utils/zoom/generate-zoom-in-steps.js +0 -18
  98. package/dist/utils/zoom/generate-zoom-out-steps.js +0 -18
  99. package/yarn-error.log +0 -101
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "js-cloudimage-360-view",
3
- "version": "3.2.1",
4
- "main": "dist/index.js",
3
+ "version": "4.0.0-beta.10",
4
+ "main": "dist/js-cloudimage-360-view.min.js",
5
+ "exports": {
6
+ ".": {
7
+ "import": "./dist/js-cloudimage-360-view.min.js",
8
+ "require": "./dist/js-cloudimage-360-view.min.js"
9
+ }
10
+ },
11
+ "style": "dist/js-cloudimage-360-view.min.css",
12
+ "module": "dist/js-cloudimage-360-view.es.js",
5
13
  "description": "",
6
14
  "author": "scaleflex",
7
15
  "license": "MIT",
@@ -9,7 +17,7 @@
9
17
  "type": "git",
10
18
  "url": "https://github.com/scaleflex/js-cloudimage-360-view"
11
19
  },
12
- "homepage": "#readme",
20
+ "homepage": "https://scaleflex.github.io/js-cloudimage-360-view/",
13
21
  "keywords": [
14
22
  "image",
15
23
  "images",
@@ -22,27 +30,29 @@
22
30
  "360 product view"
23
31
  ],
24
32
  "scripts": {
25
- "start-demo": "webpack-dev-server --mode development --config config/webpack-demo.config.js",
26
- "clean:build": "rm -rf build",
27
- "build:bundle": "npm run clean:build && webpack --mode production --config config/webpack-build.config.js",
33
+ "dev": "vite serve demo",
34
+ "clean:build": "rm -rf dist",
35
+ "build:bundle": "npm run clean:build && vite build",
28
36
  "deploy:bundle": "npm run build:bundle && node bin/deploy-bundle",
29
37
  "clean:dist": "rm -rf dist",
30
- "dist": "npm run clean:dist && babel src -d dist --copy-files",
31
- "clean:demo": "rm -rf examples/dist",
32
- "build:demo": "npm run clean:demo && webpack --mode production --config config/webpack-demo.config.js",
33
- "deploy:demo": "gh-pages -d examples/dist",
34
- "publish:demo": "npm run build:demo && npm run deploy:demo"
38
+ "clean:demo": "rm -rf demo/dist",
39
+ "build:npm": "npm run clean:demo && vite --config vite-npm.config.js build",
40
+ "build:demo": "npm run clean:demo && vite --config vite-demo.config.js build",
41
+ "deploy:demo": "gh-pages -d dist",
42
+ "publish": "npm run build:demo && npm run deploy:demo"
35
43
  },
36
44
  "dependencies": {
37
- "@babel/runtime": "^7.17.0",
38
45
  "@popperjs/core": "^2.11.2",
39
- "core-js": "^3.0.0"
46
+ "js-cloudimage-360-view": "4.0.0-beta.7",
47
+ "lodash.debounce": "^4.0.8",
48
+ "lodash.throttle": "^4.1.1"
40
49
  },
41
50
  "devDependencies": {
42
51
  "@babel/cli": "^7.16.7",
43
52
  "@babel/core": "^7.16.7",
44
53
  "@babel/plugin-transform-runtime": "^7.16.5",
45
54
  "@babel/preset-env": "^7.16.5",
55
+ "@eslint/js": "^9.12.0",
46
56
  "babel-loader": "^8.2.3",
47
57
  "babel-plugin-array-includes": "^2.0.3",
48
58
  "babel-preset-env": "^1.7.0",
@@ -51,16 +61,19 @@
51
61
  "babel-preset-stage-0": "^6.24.1",
52
62
  "css-loader": "^2.1.1",
53
63
  "dotenv": "^16.0.3",
64
+ "eslint": "^9.12.0",
54
65
  "form-data": "^4.0.0",
55
- "fs": "^0.0.1-security",
56
66
  "gh-pages": "^2.0.1",
57
67
  "highlight.js": "^10.4.1",
58
- "html-webpack-plugin": "^5.5.1",
59
- "isomorphic-fetch": "^3.0.0",
60
68
  "mini-css-extract-plugin": "^0.9.0",
61
69
  "mobile-detect": "^1.4.3",
70
+ "prettier": "3.3.3",
62
71
  "style-loader": "^3.3.2",
63
- "webpack": "^5.79.0",
72
+ "vite": "^5.4.10",
73
+ "vite-plugin-dts": "^4.3.0",
74
+ "vite-plugin-html": "^3.2.2",
75
+ "vite-plugin-lib-inject-css": "^2.1.1",
76
+ "webpack": "^5.95.0",
64
77
  "webpack-cli": "^5.0.1",
65
78
  "webpack-dev-server": "^4.13.3"
66
79
  }
package/.env DELETED
@@ -1,3 +0,0 @@
1
- BUNDLE_PLUGINS_CONTAINER=scaleflex
2
- BUNDLE_UPLOAD_SECURITY_TEMPLATE_ID=SECU_083E16FC6CD549C4A172E9CC561740CF
3
- BUNDLE_FOLDER=plugins/js-cloudimage-360-view
package/CHANGELOG.md DELETED
@@ -1,175 +0,0 @@
1
- # Changelog
2
- All notable changes to this project will be documented in this file.
3
-
4
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
-
7
- Types of changes:
8
- - `Added` for new features.
9
- - `Changed` for changes in existing functionality.
10
- - `Deprecated` for soon-to-be removed features.
11
- - `Removed` for now removed features.
12
- - `Fixed` for any bug fixes.
13
- - `Security` in case of vulnerabilities.
14
-
15
- > Date format: YYYY-MM-DD
16
-
17
- > If we have some "Breaking changes" we can mark it in message by `**BREAKING**` preffix, like:
18
- > `- **BREAKING**: Some message`
19
-
20
- -------------
21
-
22
- ## TODOs
23
- > Todo list for future
24
-
25
- - ...
26
-
27
- -------------
28
- ## 3.2.0 - 2023-09-25
29
- ### Added
30
- - Possibility to add hotspots dynamically
31
-
32
- ## 3.1.1 - 2023-04-19
33
- ### Fixed
34
- - Remove CVE vulnerabilities
35
-
36
- ## 3.1.0 - 2023-04-10
37
- ### Added
38
- - possibility to enable/disable the request of new image on resize using `data-request-responsive-images`
39
-
40
- ### Fixed
41
- - Page scroll, even spin-y is not active
42
-
43
- ## 3.0.4 - 2022-10-19
44
- ### Fixed
45
- - Hotspot icons width
46
-
47
- ## 3.0.3 - 2022-05-04
48
- ### Fixed
49
- - Error on loading original images from image list
50
-
51
- ## 3.0.2 - 2022-05-04
52
- ### Changed
53
- - documentation
54
-
55
- ## 3.0.1 - 2022-03-28
56
- ### Changed
57
- - hotspots icons
58
-
59
- ### Fixed
60
- - loader is hidden if hide-360-logo is active
61
-
62
- ## 3.0.0 - 2022-03-25
63
- ### Added
64
- - possibility to add makers or hotspots to each image
65
- - possibility add views after init the plugin
66
- - possibility to update views
67
- ### Fixed
68
- - hide 360 logo after play once
69
-
70
- ## 2.7.12 - 2022-03-19
71
- ### Changed
72
- - hotspots init method
73
-
74
- ## 2.7.11 - 2022-03-17
75
- ### Fixed
76
- - canvas aspect ratio
77
- - initialization of lazyloading
78
-
79
- ## 2.7.10 - 2022-03-01
80
- ### Fixed
81
- - image quality in fullscreen
82
- - resized image loading
83
-
84
- ## 2.7.9 - 2022-02-27
85
- ### Fixed
86
- - typo in documentation
87
-
88
- ## 2.7.8 - 2022-02-27
89
- ### Added
90
- - possibility to add new view to CI360 views
91
- ### Fixed
92
- - re-render method
93
-
94
- ## 2.7.7 - 2022-02-24
95
- ### Fixed
96
- - container width on mobile
97
- - re-render method
98
-
99
- ## 2.7.6 - 2022-02-20
100
- ### Fixed
101
- - drag speed
102
- - responsive canvas width and height
103
-
104
- ## 2.7.5 - 2022-02-08
105
- ### Added
106
- - update method to re-render or re-init the plugin
107
- ### Fixed
108
- - drag speed on mobile
109
- - error when drag speed is too high
110
- - error in dependencies
111
-
112
- ## 2.7.4 - 2022-01-26
113
- ### Fixed
114
- - typo in documentation file
115
- ## 2.7.3 - 2022-01-26
116
- ### Fixed
117
- - typo in documentation file
118
-
119
- ## 2.7.2 - 2022-01-26
120
- ### Added
121
- - possibility to fit container relative to its width or height and maintain the aspect ratio
122
- - possibility to reverse the directions of the keys on the keyboard
123
- ### Fixed
124
- - pointer zoom behavior
125
- - error while loading images from lists
126
- - get the active image index
127
-
128
- ## 2.7.1 - 2021-11-06
129
- ### Added
130
- - click to reset mouse zoom
131
- - show 360 logo after play once
132
- ### Fixed
133
- - set click as default value to start zoom
134
- - Sass error
135
- ### Changed
136
- - pointer zoom behavior
137
-
138
- ## 2.7.0 - 2021-11-04
139
- ### Added
140
- - play once then stop auto-play
141
- - spin in the y-direction
142
- - zoom with mouse wheel
143
- - zoom with fingers on mobile
144
- - possibility to change icons styles
145
-
146
- ### Fixed
147
- - hide scrollbar in fullscreen mode
148
- - auto-play not working on mobile
149
- - error on init the plugin inside a modal
150
- - removed chrome warning about non-passive events
151
- - images are not resized when window size changes
152
-
153
- ### Changed
154
- - migrate CDN URL to V7
155
-
156
- ## 2.6.0 - 2020-09-03
157
-
158
- ### Feat
159
- - add ability to specify custom 360 view logo
160
-
161
- ## 2.5.0 - 2020-07-05
162
-
163
- ### Feat
164
- - possibility to hide 360 view icon
165
-
166
- ## 2.4.1 - 2020-04-11
167
-
168
- ### Fixed
169
- - initialize first image using data-image-list #33
170
-
171
-
172
- ## 2.4.0 - 2020-04-09
173
-
174
- ### Fixed
175
- - problem with first preview image is random #28, #29
@@ -1,63 +0,0 @@
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)