js-cloudimage-360-view 3.0.2 → 3.0.4

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.
@@ -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)
@@ -1,222 +1,222 @@
1
- .cloudimage-360-hotspot-link-icon {
2
- width: 42px;
3
- height: 42px;
4
- background: rgba(12, 109, 199, 0.2);
5
- border: 1px solid rgba(255, 255, 255, 0.2);
6
- border-radius: 50%;
7
- box-sizing: border-box;
8
- transition: opacity 600ms ease-in-out;
9
- cursor: auto;
10
- }
11
-
12
- .cloudimage-360-hotspot-link-icon::before {
13
- content: '';
14
- position: absolute;
15
- width: 16px;
16
- height: 16px;
17
- background-image: url('https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/assets/img/link-hotspot.svg');
18
- background-color: #0C6DC7;
19
- background-repeat: no-repeat;
20
- background-size: 17px 7px;
21
- background-position: center;
22
- left: 50%;
23
- top: 50%;
24
- transform: translate(-50%, -50%);
25
- box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.25);
26
- border-radius: 50%;
27
- animation: pulse 2s infinite;
28
- cursor: auto;
29
- }
30
-
31
- .cloudimage-360-hotspot-custom-icon {
32
- width: 42px;
33
- height: 42px;
34
- background: #76AD0133;
35
- border: 1px solid #FFFFFF33;
36
- border-radius: 50%;
37
- box-sizing: border-box;
38
- transition: opacity 300ms ease-in-out;
39
- cursor: auto;
40
- }
41
-
42
- .cloudimage-360-hotspot-custom-icon::before {
43
- content: '';
44
- position: absolute;
45
- width: 16px;
46
- height: 16px;
47
- background-image: url('https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/assets/img/plus.svg');
48
- background-color: #76AD01;
49
- background-repeat: no-repeat;
50
- background-size: 17px 7px;
51
- background-position: center;
52
- left: 50%;
53
- top: 50%;
54
- transform: translate(-50%, -50%);
55
- box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.25);
56
- border-radius: 50%;
57
- animation: pulse 2s infinite;
58
- cursor: auto;
59
- }
60
-
61
- .cloudimage-360-hotspot-popup {
62
- visibility: hidden;
63
- opacity: 0;
64
- background-color: #FFFFFF;
65
- padding: 6px;
66
- border-radius: 2px;
67
- box-shadow: 0px 4px 4px 0px #00000040;
68
- z-index: 999;
69
- }
70
-
71
- .cloudimage-360-hotspot-popup[data-show] {
72
- visibility: visible;
73
- opacity: 1;
74
- }
75
-
76
- .cloudimage-360-popup-arrow,
77
- .cloudimage-360-popup-arrow::before {
78
- position: absolute;
79
- width: 8px;
80
- height: 8px;
81
- background: inherit;
82
- cursor: 'auto';
83
- }
84
-
85
- .cloudimage-360-popup-arrow {
86
- visibility: hidden;
87
- }
88
-
89
- .cloudimage-360-popup-arrow::before {
90
- visibility: visible;
91
- content: '';
92
- transform: rotate(45deg);
93
- }
94
-
95
- .cloudimage-360-hotspot-popup[data-popper-placement^='top']
96
- > .cloudimage-360-popup-arrow {
97
- bottom: -4px;
98
- }
99
-
100
- .cloudimage-360-hotspot-popup[data-popper-placement^='bottom']
101
- > .cloudimage-360-popup-arrow {
102
- top: -4px;
103
- }
104
-
105
- .cloudimage-360-hotspot-popup[data-popper-placement^='left']
106
- > .cloudimage-360-popup-arrow {
107
- right: -4px;
108
- }
109
-
110
- .cloudimage-360-hotspot-popup[data-popper-placement^='right']
111
- > .cloudimage-360-popup-arrow {
112
- left: -4px;
113
- }
114
-
115
- .cloudimage-360-modal-wrapper {
116
- max-width: 222px;
117
- }
118
-
119
- .cloudimage-360-images-carousel-wrapper {
120
- margin: 0 auto;
121
- }
122
-
123
- .cloudimage-360-images-carousel {
124
- background-color: #f5f4f4;
125
- border-radius: 2px;
126
- }
127
-
128
- .cloudimage-360-images-carousel .cloudimage-360-carousel-image {
129
- display: none;
130
- object-fit: contain;
131
- min-height: 187px;
132
- max-width: 100%;
133
- max-height: 100%;
134
- }
135
-
136
- .cloudimage-360-images-carousel .cloudimage-360-carousel-image.active-image {
137
- display: block;
138
- animation-name: fade-active-image;
139
- animation-duration: 1.5s;
140
- }
141
-
142
- .cloudimage-360-carousel-dots {
143
- display: flex;
144
- column-gap: 6px;
145
- justify-content: center;
146
- flex-wrap: wrap;
147
- margin: 5px auto;
148
- row-gap: 3px;
149
- padding: 0 6px;
150
- width: 50%;
151
- }
152
-
153
- .cloudimage-360-carousel-dot {
154
- width: 6px;
155
- height: 6px;
156
- background-color: #C9D0DE;
157
- border-radius: 50%;
158
- cursor: pointer;
159
- transition: background-color 0.6s ease;
160
- border: 0;
161
- padding: 0;
162
- }
163
-
164
- .cloudimage-360-carousel-dot.active-dot {
165
- background-color: #76AD01;
166
- }
167
-
168
- .cloudimage-360-carousel-dot:focus,
169
- .cloudimage-360-carousel-dot:focus-visible {
170
- border: 0;
171
- outline: 0;
172
- }
173
-
174
- .cloudimage-360-modal-title {
175
- font-size: 12px;
176
- font-weight: 700;
177
- line-height: 16px;
178
- margin: 4px 0;
179
- }
180
-
181
- .cloudimage-360-modal-description {
182
- font-size: 10px;
183
- font-weight: 400;
184
- line-height: 16px;
185
- margin: 4px 0;
186
- }
187
-
188
- .cloudimage-360-modal-more-details {
189
- color: #76AD01;
190
- background-color: #ECFAE6;
191
- font-size: 10px;
192
- line-height: 16px;
193
- font-weight: 400;
194
- padding: 4px 8px;
195
- transition: background-color 200ms ease-in-out;
196
- border-radius: 2px;
197
- text-decoration: none;
198
- }
199
-
200
- .cloudimage-360-modal-more-details:hover {
201
- color: #76AD01;
202
- background-color: #e1f5d8;
203
- }
204
-
205
- @keyframes pulse {
206
- 0% {
207
- box-shadow: 0 0 0 0 rgba(99, 99, 99, 0.7);
208
- }
209
-
210
- 70% {
211
- box-shadow: 0 0 0 10px rgba(99, 99, 99, 0);
212
- }
213
-
214
- 100% {
215
- box-shadow: 0 0 0 0 rgba(99, 99, 99, 0);
216
- }
217
- }
218
-
219
- @keyframes fade-active-image {
220
- from { opacity: 0.7 }
221
- to { opacity: 1 }
1
+ .cloudimage-360-hotspot-link-icon {
2
+ width: 42px;
3
+ height: 42px;
4
+ background: rgba(12, 109, 199, 0.2);
5
+ border: 1px solid rgba(255, 255, 255, 0.2);
6
+ border-radius: 50%;
7
+ box-sizing: border-box;
8
+ transition: opacity 600ms ease-in-out;
9
+ cursor: auto;
10
+ }
11
+
12
+ .cloudimage-360-hotspot-link-icon::before {
13
+ content: '';
14
+ position: absolute;
15
+ width: 16px;
16
+ height: 16px;
17
+ background-image: url('https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/assets/img/link-hotspot.svg');
18
+ background-color: #0C6DC7;
19
+ background-repeat: no-repeat;
20
+ background-size: 9px;
21
+ background-position: center;
22
+ left: 50%;
23
+ top: 50%;
24
+ transform: translate(-50%, -50%);
25
+ box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.25);
26
+ border-radius: 50%;
27
+ animation: pulse 2s infinite;
28
+ cursor: auto;
29
+ }
30
+
31
+ .cloudimage-360-hotspot-custom-icon {
32
+ width: 42px;
33
+ height: 42px;
34
+ background: #76AD0133;
35
+ border: 1px solid #FFFFFF33;
36
+ border-radius: 50%;
37
+ box-sizing: border-box;
38
+ transition: opacity 300ms ease-in-out;
39
+ cursor: auto;
40
+ }
41
+
42
+ .cloudimage-360-hotspot-custom-icon::before {
43
+ content: '';
44
+ position: absolute;
45
+ width: 16px;
46
+ height: 16px;
47
+ background-image: url('https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/assets/img/plus.svg');
48
+ background-color: #76AD01;
49
+ background-repeat: no-repeat;
50
+ background-size: 9px;
51
+ background-position: center;
52
+ left: 50%;
53
+ top: 50%;
54
+ transform: translate(-50%, -50%);
55
+ box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.25);
56
+ border-radius: 50%;
57
+ animation: pulse 2s infinite;
58
+ cursor: auto;
59
+ }
60
+
61
+ .cloudimage-360-hotspot-popup {
62
+ visibility: hidden;
63
+ opacity: 0;
64
+ background-color: #FFFFFF;
65
+ padding: 6px;
66
+ border-radius: 2px;
67
+ box-shadow: 0px 4px 4px 0px #00000040;
68
+ z-index: 999;
69
+ }
70
+
71
+ .cloudimage-360-hotspot-popup[data-show] {
72
+ visibility: visible;
73
+ opacity: 1;
74
+ }
75
+
76
+ .cloudimage-360-popup-arrow,
77
+ .cloudimage-360-popup-arrow::before {
78
+ position: absolute;
79
+ width: 8px;
80
+ height: 8px;
81
+ background: inherit;
82
+ cursor: 'auto';
83
+ }
84
+
85
+ .cloudimage-360-popup-arrow {
86
+ visibility: hidden;
87
+ }
88
+
89
+ .cloudimage-360-popup-arrow::before {
90
+ visibility: visible;
91
+ content: '';
92
+ transform: rotate(45deg);
93
+ }
94
+
95
+ .cloudimage-360-hotspot-popup[data-popper-placement^='top']
96
+ > .cloudimage-360-popup-arrow {
97
+ bottom: -4px;
98
+ }
99
+
100
+ .cloudimage-360-hotspot-popup[data-popper-placement^='bottom']
101
+ > .cloudimage-360-popup-arrow {
102
+ top: -4px;
103
+ }
104
+
105
+ .cloudimage-360-hotspot-popup[data-popper-placement^='left']
106
+ > .cloudimage-360-popup-arrow {
107
+ right: -4px;
108
+ }
109
+
110
+ .cloudimage-360-hotspot-popup[data-popper-placement^='right']
111
+ > .cloudimage-360-popup-arrow {
112
+ left: -4px;
113
+ }
114
+
115
+ .cloudimage-360-modal-wrapper {
116
+ max-width: 222px;
117
+ }
118
+
119
+ .cloudimage-360-images-carousel-wrapper {
120
+ margin: 0 auto;
121
+ }
122
+
123
+ .cloudimage-360-images-carousel {
124
+ background-color: #f5f4f4;
125
+ border-radius: 2px;
126
+ }
127
+
128
+ .cloudimage-360-images-carousel .cloudimage-360-carousel-image {
129
+ display: none;
130
+ object-fit: contain;
131
+ min-height: 187px;
132
+ max-width: 100%;
133
+ max-height: 100%;
134
+ }
135
+
136
+ .cloudimage-360-images-carousel .cloudimage-360-carousel-image.active-image {
137
+ display: block;
138
+ animation-name: fade-active-image;
139
+ animation-duration: 1.5s;
140
+ }
141
+
142
+ .cloudimage-360-carousel-dots {
143
+ display: flex;
144
+ column-gap: 6px;
145
+ justify-content: center;
146
+ flex-wrap: wrap;
147
+ margin: 5px auto;
148
+ row-gap: 3px;
149
+ padding: 0 6px;
150
+ width: 50%;
151
+ }
152
+
153
+ .cloudimage-360-carousel-dot {
154
+ width: 6px;
155
+ height: 6px;
156
+ background-color: #C9D0DE;
157
+ border-radius: 50%;
158
+ cursor: pointer;
159
+ transition: background-color 0.6s ease;
160
+ border: 0;
161
+ padding: 0;
162
+ }
163
+
164
+ .cloudimage-360-carousel-dot.active-dot {
165
+ background-color: #76AD01;
166
+ }
167
+
168
+ .cloudimage-360-carousel-dot:focus,
169
+ .cloudimage-360-carousel-dot:focus-visible {
170
+ border: 0;
171
+ outline: 0;
172
+ }
173
+
174
+ .cloudimage-360-modal-title {
175
+ font-size: 12px;
176
+ font-weight: 700;
177
+ line-height: 16px;
178
+ margin: 4px 0;
179
+ }
180
+
181
+ .cloudimage-360-modal-description {
182
+ font-size: 10px;
183
+ font-weight: 400;
184
+ line-height: 16px;
185
+ margin: 4px 0;
186
+ }
187
+
188
+ .cloudimage-360-modal-more-details {
189
+ color: #76AD01;
190
+ background-color: #ECFAE6;
191
+ font-size: 10px;
192
+ line-height: 16px;
193
+ font-weight: 400;
194
+ padding: 4px 8px;
195
+ transition: background-color 200ms ease-in-out;
196
+ border-radius: 2px;
197
+ text-decoration: none;
198
+ }
199
+
200
+ .cloudimage-360-modal-more-details:hover {
201
+ color: #76AD01;
202
+ background-color: #e1f5d8;
203
+ }
204
+
205
+ @keyframes pulse {
206
+ 0% {
207
+ box-shadow: 0 0 0 0 rgba(99, 99, 99, 0.7);
208
+ }
209
+
210
+ 70% {
211
+ box-shadow: 0 0 0 10px rgba(99, 99, 99, 0);
212
+ }
213
+
214
+ 100% {
215
+ box-shadow: 0 0 0 0 rgba(99, 99, 99, 0);
216
+ }
217
+ }
218
+
219
+ @keyframes fade-active-image {
220
+ from { opacity: 0.7 }
221
+ to { opacity: 1 }
222
222
  }