@kvass/widgets 1.2.7 → 1.2.9

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 (46) hide show
  1. package/package.json +4 -1
  2. package/.github/workflows/semantic-release.yml +0 -21
  3. package/.prettierrc +0 -6
  4. package/.releaserc +0 -3
  5. package/index.html +0 -38
  6. package/src/contact/README.md +0 -80
  7. package/src/contact/api.js +0 -82
  8. package/src/contact/components/Checkbox.ce.vue +0 -127
  9. package/src/contact/components/Field.ce.vue +0 -156
  10. package/src/contact/components/Fieldset.ce.vue +0 -63
  11. package/src/contact/components/Form.ce.vue +0 -407
  12. package/src/contact/main.js +0 -9
  13. package/src/contact/utils.js +0 -14
  14. package/src/flatfinder/README.md +0 -58
  15. package/src/flatfinder/components/Flatfinder.ce.vue +0 -34
  16. package/src/flatfinder/main.js +0 -4
  17. package/src/font-selector/README.md +0 -60
  18. package/src/font-selector/components/FontSelector.ce.vue +0 -246
  19. package/src/font-selector/main.js +0 -4
  20. package/src/font-selector/providers.js +0 -48
  21. package/src/font-selector/selector.svg +0 -7
  22. package/src/img-comparison-slider/README.md +0 -69
  23. package/src/img-comparison-slider/components/ImgComparisonSlider.ce.vue +0 -139
  24. package/src/img-comparison-slider/main.js +0 -7
  25. package/src/map/README.md +0 -59
  26. package/src/map/components/Map.ce.vue +0 -66
  27. package/src/map/main.js +0 -4
  28. package/src/project-portal/App.ce.vue +0 -308
  29. package/src/project-portal/api.js +0 -48
  30. package/src/project-portal/assets/logo.png +0 -0
  31. package/src/project-portal/assets/map-pin-solid.svg +0 -1
  32. package/src/project-portal/components/Card.ce.vue +0 -110
  33. package/src/project-portal/components/Category.ce.vue +0 -87
  34. package/src/project-portal/components/CategorySelector.ce.vue +0 -43
  35. package/src/project-portal/components/ProjectTypeSelector.ce.vue +0 -70
  36. package/src/project-portal/main.js +0 -16
  37. package/src/project-portal/styles/_variables.scss +0 -19
  38. package/src/project-portal/styles/components/_card.scss +0 -178
  39. package/src/utils/index.js +0 -40
  40. package/src/vimeo/README.md +0 -58
  41. package/src/vimeo/components/Vimeo.ce.vue +0 -311
  42. package/src/vimeo/main.js +0 -4
  43. package/src/youtube/README.md +0 -58
  44. package/src/youtube/components/Youtube.ce.vue +0 -322
  45. package/src/youtube/main.js +0 -4
  46. package/vite.config.js +0 -51
@@ -1,322 +0,0 @@
1
- <script>
2
- import { WaitUntil, LoadScript, ExtractString } from '../../utils'
3
-
4
- export default {
5
- props: {
6
- url: {
7
- type: String,
8
- default: '',
9
- },
10
- videoState: {
11
- type: String,
12
- default: 'ready',
13
- enums: ['ready ', 'play', 'pause'],
14
- },
15
-
16
- loop: {
17
- type: [String, Boolean],
18
- default: true,
19
- },
20
- autoplay: {
21
- type: [String, Boolean],
22
- default: false,
23
- },
24
-
25
- controls: {
26
- type: [String, Boolean],
27
- default: true,
28
- },
29
- mute: {
30
- type: [String, Boolean],
31
- default: false,
32
- },
33
- displayThumbnail: {
34
- type: [String, Boolean],
35
- default: true,
36
- },
37
-
38
- ignoreConsent: {
39
- type: [String, Boolean],
40
- default: false,
41
- },
42
- hideConsent: {
43
- type: [String, Boolean],
44
- default: false,
45
- },
46
- thumbnailSource: {
47
- type: String,
48
- default: '',
49
- },
50
-
51
- consentBlockMessage: {
52
- type: String,
53
- default: 'The video is blocked due to lack of consent to cookies',
54
- },
55
-
56
- consentButtonLabel: {
57
- type: String,
58
- default: 'Edit consents',
59
- },
60
-
61
- aspectRatio: {
62
- type: String,
63
- default: '16/9',
64
- },
65
- },
66
-
67
- watch: {
68
- videoState: {
69
- handler(newValue, oldValue) {
70
- if (newValue === oldValue) return
71
- switch (newValue) {
72
- case 'play':
73
- return this.play()
74
- case 'pause':
75
- return this.pause()
76
- default:
77
- return
78
- }
79
- },
80
- },
81
- },
82
- data() {
83
- return {
84
- ready: false,
85
- thumbnail: null,
86
- consents: [],
87
- }
88
- },
89
- computed: {
90
- kvassDefined() {
91
- return typeof Kvass !== 'undefined'
92
- },
93
- showConsent() {
94
- if (this.hideConsent || !this.kvassDefined) return false
95
- return !this.ignoreConsent && !this.consents.includes('statistics')
96
- },
97
-
98
- videoId() {
99
- if (!this.url) return
100
- let value = this.url
101
- let id = [
102
- ExtractString(
103
- value,
104
- /https\:\/\/(w{3}\.)?youtube\.com\/watch\?v=(.+)\/?/,
105
- { group: 2 },
106
- ),
107
- ExtractString(
108
- value,
109
- /https\:\/\/(w{3}\.)?youtube\.com\/embed\/(.+)\/?/,
110
- { group: 2 },
111
- ),
112
- ExtractString(
113
- value,
114
- /https\:\/\/(w{3}\.)?youtube\.com\/watch\/(.+)\/?/,
115
- { group: 2 },
116
- ),
117
- ExtractString(value, /https\:\/\/(w{3}\.)?youtu\.be\/(.+)\/?/, {
118
- group: 2,
119
- }),
120
- ].find((e) => {
121
- return Boolean(e)
122
- })
123
-
124
- if (id) return id.split('&')[0]
125
- },
126
- },
127
-
128
- methods: {
129
- openConsent() {
130
- if (!this.kvassDefined) return
131
- Kvass.emit('consent:show')
132
- },
133
- play() {
134
- this.player.mute()
135
- this.player.playVideo()
136
- },
137
- pause() {
138
- this.player.pauseVideo()
139
- },
140
-
141
- async init() {
142
- const mergeOptions = {
143
- loop: this.loop,
144
- autoplay: this.autoplay,
145
- controls: this.controls,
146
- muted: this.mute || this.autoplay,
147
- enablejsapi: 1,
148
- playsinline: 1,
149
- }
150
-
151
- function stringToBoolean(value) {
152
- if (value === 'false') return false
153
- if (value === 'true') return true
154
- return value
155
- }
156
-
157
- Object.entries(mergeOptions).map(([key, value]) => {
158
- return (mergeOptions[key] = Number(stringToBoolean(value)))
159
- })
160
-
161
- LoadScript('https://www.youtube.com/iframe_api')
162
-
163
- await WaitUntil(() => window.YT && window.YT.Player, { limit: 200 })
164
- this.player = new YT.Player(this.$refs.youtubePlayer, {
165
- videoId: this.videoId,
166
- playerVars: {
167
- ...mergeOptions,
168
- videoId: this.videoId,
169
- origin: window.location.host,
170
- },
171
- events: {
172
- onReady: (event) => {
173
- this.ready = true
174
-
175
- if (Boolean(mergeOptions.mute)) this.player.mute()
176
- if (Boolean(mergeOptions.autoplay)) this.play()
177
- },
178
- },
179
- })
180
- },
181
- },
182
-
183
- async mounted() {
184
- if (this.displayThumbnail)
185
- this.thumbnail =
186
- !this.thumbnailSource && this.kvassDefined
187
- ? `/api/media/thumbnail?url=${this.url}`
188
- : this.thumbnailSource
189
-
190
- if (this.ignoreConsent || !this.kvassDefined) return this.init()
191
-
192
- let onChange = (consents) => {
193
- this.consents = consents || []
194
- if (!this.consents || !this.consents.length) return
195
-
196
- if (this.consents.includes('statistics')) return this.init()
197
- }
198
-
199
- if (this.kvassDefined) {
200
- Kvass.emit('consent:get', (c) => onChange(c))
201
- Kvass.on('consent:change', onChange)
202
- }
203
- },
204
- }
205
- </script>
206
-
207
- <template>
208
- <div
209
- class="widget-kvass-media-render-youtube"
210
- :style="`aspect-ratio: ${aspectRatio};`"
211
- >
212
- <div
213
- ref="youtubePlayer"
214
- class="kvass-media-render-youtube__embed"
215
- frameborder="0"
216
- allow="autoplay; fullscreen;"
217
- webkitallowfullscreen
218
- mozallowfullscreen
219
- />
220
-
221
- <transition name="fade" mode="in-out">
222
- <div
223
- v-show="!ready && thumbnail"
224
- class="widget-kvass-media-render-youtube__thumbnail"
225
- :style="{ backgroundImage: `url(${thumbnail})` }"
226
- />
227
- </transition>
228
- <div v-if="showConsent" class="widget-kvass-media-render-youtube__blocked">
229
- <div class="widget-kvass-media-render-youtube__blocked-warning">
230
- {{ consentBlockMessage }}
231
- <button
232
- class="widget-kvass-media-render-youtube__blocked-warning-button"
233
- @click="openConsent"
234
- >
235
- {{ consentButtonLabel }}
236
- </button>
237
- </div>
238
- </div>
239
- </div>
240
- </template>
241
-
242
- <style lang="scss">
243
- .widget-kvass-media-render-youtube {
244
- height: 100%;
245
- width: 100%;
246
- position: relative;
247
-
248
- iframe {
249
- height: 100%;
250
- width: 100%;
251
- }
252
-
253
- & > * {
254
- position: absolute;
255
- top: 0;
256
- left: 0;
257
- width: 100%;
258
- height: 100%;
259
- }
260
-
261
- &__thumbnail {
262
- background-size: cover;
263
- background-repeat: no-repeat;
264
- background-position: center;
265
- filter: blur(10px);
266
- opacity: 0.7;
267
- }
268
-
269
- &__blocked {
270
- display: flex;
271
- justify-content: center;
272
- align-items: center;
273
- left: 50%;
274
- top: 50%;
275
- transform: translate(-50%, -50%);
276
- svg {
277
- opacity: 0.3;
278
- }
279
-
280
- @media (max-width: 992px) {
281
- svg {
282
- font-size: 2.5em;
283
- }
284
- }
285
- &-warning {
286
- pointer-events: initial;
287
- position: absolute;
288
- bottom: 0;
289
- text-align: center;
290
- background-color: #f2f2f2;
291
- font-size: 0.6em;
292
- bottom: 3rem;
293
- left: 3rem;
294
- max-width: 400px;
295
- font-size: 0.8em;
296
- padding: 1.5em 2em;
297
-
298
- &-button {
299
- padding: 0.5rem;
300
- border: 1px solid #818181;
301
- backdrop-filter: none;
302
- background-color: transparent;
303
- }
304
-
305
- @media (max-width: 992px) {
306
- left: 0.5rem;
307
- bottom: 0.5rem;
308
- font-size: 0.6em;
309
- max-width: 200px;
310
- }
311
- }
312
- }
313
- .fade-enter-active,
314
- .fade-leave-active {
315
- transition: opacity 500ms;
316
- }
317
- .fade-enter,
318
- .fade-leave-to {
319
- opacity: 0;
320
- }
321
- }
322
- </style>
@@ -1,4 +0,0 @@
1
- import { defineCustomElement } from 'vue'
2
- import Youtube from './components/Youtube.ce.vue'
3
-
4
- customElements.define('kvass-youtube', defineCustomElement(Youtube))
package/vite.config.js DELETED
@@ -1,51 +0,0 @@
1
- import vue from '@vitejs/plugin-vue'
2
- import { fileURLToPath } from 'url'
3
- import { defineConfig } from 'vite'
4
-
5
- // https://vitejs.dev/config/
6
- export default defineConfig({
7
- plugins: [vue({ customElement: true })],
8
- optimizeDeps: {
9
- include: ['@kvass/vue3-flatfinder'],
10
- esbuildOptions: {
11
- supported: {
12
- 'top-level-await': true,
13
- },
14
- },
15
- },
16
- build: {
17
- target: 'esnext',
18
- rollupOptions: {
19
- output: {
20
- entryFileNames: `[name].js`,
21
- chunkFileNames: `[name].js`,
22
- assetFileNames: `[name].[ext]`,
23
- },
24
- input: {
25
- contact: fileURLToPath(
26
- new URL('./src/contact/main.js', import.meta.url),
27
- ),
28
- 'img-comparison-slider': fileURLToPath(
29
- new URL('./src/img-comparison-slider/main.js', import.meta.url),
30
- ),
31
- 'project-portal': fileURLToPath(
32
- new URL('./src/project-portal/main.js', import.meta.url),
33
- ),
34
- vimeo: fileURLToPath(new URL('./src/vimeo/main.js', import.meta.url)),
35
- youtube: fileURLToPath(
36
- new URL('./src/youtube/main.js', import.meta.url),
37
- ),
38
- map: fileURLToPath(new URL('./src/map/main.js', import.meta.url)),
39
- flatfinder: fileURLToPath(
40
- new URL('./src/flatfinder/main.js', import.meta.url),
41
- ),
42
- 'font-selector': fileURLToPath(
43
- new URL('./src/font-selector/main.js', import.meta.url),
44
- ),
45
- },
46
- },
47
- },
48
- server: {
49
- port: 3001,
50
- },
51
- })