@versoly/plugins 0.0.6 → 0.0.8

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/dist/index.mjs DELETED
@@ -1,1008 +0,0 @@
1
- // src/config.ts
2
- var defineConfig = (config) => {
3
- return config;
4
- };
5
-
6
- // src/plugins/calendly.ts
7
- var calendly_default = defineConfig({
8
- name: "calendly",
9
- cdnUrls: [
10
- {
11
- url: "https://assets.calendly.com/assets/external/widget.js",
12
- delay: true
13
- },
14
- {
15
- url: "https://assets.calendly.com/assets/external/widget.css",
16
- delay: true
17
- }
18
- ],
19
- js: `
20
- document.querySelectorAll('[data-calendly-url]').forEach(elem => {
21
- const url = elem.dataset.calendlyUrl;
22
-
23
- if (!url) {
24
- return;
25
- }
26
-
27
- elem.addEventListener('click', e => {
28
- e.preventDefault();
29
- window.Calendly.initPopupWidget({ url, parentElement: elem });
30
- })
31
- });`,
32
- checks: [{ plugin: "calendly" }, { html: "calendly" }],
33
- options: {
34
- name: "Calendly Options",
35
- isShown: {
36
- props: {
37
- "data-calendly-url": true
38
- }
39
- },
40
- fields: [
41
- {
42
- name: "Calendly Url",
43
- propsName: "data-calendly-url",
44
- type: "TextOption"
45
- }
46
- ]
47
- }
48
- });
49
-
50
- // src/plugins/swiper.ts
51
- var js = `
52
- window.vSwipers = [];
53
- window.vGetElementsByToggle('swiper').forEach((elem) => {
54
- let props = window.vGetElementOptions(elem);
55
-
56
- if (props.pagination && props.pagination.renderBullet === 'number') {
57
- props.pagination.renderBullet = function(index, className) {
58
- const span = document.createElement('span');
59
- span.className = className;
60
- span.textContent = index + 1;
61
- return span.outerHTML;
62
- }
63
- }
64
-
65
- window.vSwipers.push(new Swiper(elem, props));
66
- });`;
67
- var swiper_default = defineConfig({
68
- name: "swiper",
69
- cdnUrls: [
70
- {
71
- url: `https://cdnjs.cloudflare.com/ajax/libs/Swiper/9.3.2/swiper-bundle.min.js`,
72
- inline: false,
73
- defer: true
74
- },
75
- {
76
- url: `https://cdnjs.cloudflare.com/ajax/libs/Swiper/9.3.2/swiper-bundle.min.css`
77
- }
78
- ],
79
- js,
80
- checks: [{ plugin: "swiper" }]
81
- });
82
-
83
- // src/plugins/prism.ts
84
- var prism_default = defineConfig({
85
- name: "prism",
86
- cdnUrls: [
87
- {
88
- url: "https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/plugins/line-numbers/prism-line-numbers.min.css"
89
- },
90
- {
91
- url: "https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/prism.min.js"
92
- },
93
- {
94
- url: "https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/plugins/autoloader/prism-autoloader.min.js"
95
- },
96
- {
97
- url: "https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/plugins/line-numbers/prism-line-numbers.min.js"
98
- }
99
- ],
100
- js: `
101
- document.querySelectorAll("pre > code[class^='language-']").forEach((elem) => {
102
- elem.parentNode.innerHTML = elem.parentNode.innerHTML.trim();
103
- });
104
-
105
- let themeLink = window.vPrismTheme !== undefined ? window.vPrismTheme : 'default';
106
-
107
- if (themeLink === 'default') {
108
- themeLink = 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/themes/prism.min.css';
109
- } else if (themeLink && !themeLink.includes('https://')) {
110
- themeLink = 'https://cdnjs.cloudflare.com/ajax/libs/prism-themes/1.9.0/prism-' + themeLink + '.min.css';
111
- }
112
-
113
- if (themeLink && themeLink.includes('https://')) {
114
- const link = document.createElement('link');
115
- link.rel = 'stylesheet';
116
- link.href = themeLink;
117
- document.head.appendChild(link);
118
- }
119
-
120
- window.addEventListener('load', () => {
121
- window.Prism && window.Prism.highlightAll();
122
- });`,
123
- checks: [{ html: "prism" }]
124
- });
125
-
126
- // src/plugins/tilt.ts
127
- var js2 = `window.vTilts = [];
128
- window.vGetElementsByToggle('tilt').forEach((elem) => {
129
- VanillaTilt.init(elem, window.vGetElementOptions(elem));
130
- window.vTilts.push(elem);
131
- });`;
132
- var tilt_default = defineConfig({
133
- name: "tilt",
134
- options: {
135
- name: "Tilt",
136
- previewInEditor: true,
137
- isShown: {
138
- props: {
139
- "data-toggle": "tilt"
140
- }
141
- },
142
- fields: [
143
- {
144
- name: "Speed",
145
- type: "SliderPropOption",
146
- propsName: "data-options.speed",
147
- min: 0,
148
- max: 3e3,
149
- stepSize: 100,
150
- defaultValue: 300
151
- },
152
- {
153
- name: "Max Tilt",
154
- type: "SliderPropOption",
155
- propsName: "data-options.max",
156
- min: 0,
157
- max: 180,
158
- stepSize: 1,
159
- defaultValue: 35
160
- },
161
- {
162
- name: "Reverse",
163
- type: "BooleanPropOption",
164
- propsName: "data-options.reverse",
165
- defaultValue: false,
166
- enabledValue: true,
167
- inHeaderAction: true,
168
- headerGroup: "Core"
169
- },
170
- {
171
- name: "Transition",
172
- type: "BooleanPropOption",
173
- propsName: "data-options.transition",
174
- defaultValue: true,
175
- enabledValue: false,
176
- inHeaderAction: true,
177
- headerGroup: "Core"
178
- },
179
- {
180
- label: "Easing",
181
- name: "Easing",
182
- propsName: "data-options.easing",
183
- type: "TextOption",
184
- defaultValue: "cubic-bezier(.03,.98,.52,.99)",
185
- enabledValue: "cubic-bezier(.03,.98,.52,.99)",
186
- inHeaderAction: true,
187
- headerGroup: "Core"
188
- },
189
- {
190
- name: "Full Page Listening",
191
- type: "BooleanPropOption",
192
- propsName: "data-options.full-page-listening",
193
- defaultValue: false,
194
- enabledValue: true,
195
- inHeaderAction: true,
196
- headerGroup: "Core"
197
- },
198
- {
199
- name: "Start X",
200
- type: "SliderPropOption",
201
- propsName: "data-options.startX",
202
- min: 0,
203
- max: 180,
204
- stepSize: 1,
205
- defaultValue: 0,
206
- enabledValue: 15,
207
- inHeaderAction: true,
208
- headerGroup: "Core"
209
- },
210
- {
211
- name: "Start Y",
212
- type: "SliderPropOption",
213
- propsName: "data-options.startY",
214
- min: 0,
215
- max: 180,
216
- stepSize: 1,
217
- defaultValue: 0,
218
- enabledValue: 15,
219
- inHeaderAction: true,
220
- headerGroup: "Core"
221
- },
222
- {
223
- name: "Perspective",
224
- type: "SliderPropOption",
225
- propsName: "data-options.perspective",
226
- min: 0,
227
- max: 3e3,
228
- stepSize: 1,
229
- defaultValue: 1e3,
230
- enabledValue: 1e3,
231
- inHeaderAction: true,
232
- headerGroup: "Core"
233
- },
234
- {
235
- name: "Scale",
236
- type: "SliderPropOption",
237
- propsName: "data-options.scale",
238
- min: 0.5,
239
- max: 3,
240
- stepSize: 0.1,
241
- defaultValue: 1,
242
- enabledValue: 1.5,
243
- inHeaderAction: true,
244
- headerGroup: "Core"
245
- },
246
- {
247
- name: "Axis",
248
- type: "IconButtonOption",
249
- propsName: "data-options.axis",
250
- options: ["x", "y"],
251
- defaultValue: null,
252
- enabledValue: "x",
253
- inHeaderAction: true,
254
- headerGroup: "Core"
255
- },
256
- {
257
- name: "Glare",
258
- type: "BooleanPropOption",
259
- propsName: "data-options.glare",
260
- defaultValue: false,
261
- enabledValue: true,
262
- inHeaderAction: true,
263
- headerGroup: "Glare"
264
- },
265
- {
266
- name: "Max Glare",
267
- type: "SliderPropOption",
268
- propsName: "data-options.max-glare",
269
- min: 0.1,
270
- max: 1,
271
- stepSize: 0.1,
272
- defaultValue: 1,
273
- enabledValue: 0.5,
274
- inHeaderAction: true,
275
- headerGroup: "Glare"
276
- },
277
- {
278
- name: "Reset",
279
- type: "BooleanPropOption",
280
- propsName: "data-options.reset",
281
- defaultValue: true,
282
- enabledValue: true,
283
- inHeaderAction: true,
284
- headerGroup: "Reset"
285
- },
286
- {
287
- name: "Reset To Start",
288
- type: "BooleanPropOption",
289
- propsName: "data-options.reset-to-start",
290
- defaultValue: true,
291
- enabledValue: true,
292
- inHeaderAction: true,
293
- headerGroup: "Reset"
294
- }
295
- ]
296
- },
297
- cdnUrls: [
298
- {
299
- url: "https://cdnjs.cloudflare.com/ajax/libs/vanilla-tilt/1.8.0/vanilla-tilt.js",
300
- defer: true
301
- }
302
- ],
303
- js: js2,
304
- checks: [{ plugin: "tilt" }],
305
- components: [
306
- {
307
- name: "Tilt Image",
308
- category: "Plugins",
309
- html: `<img class="w-96" src="https://dummyimage.com/1000x600/edf2f7/0f1631&text=Placeholder" data-toggle="tilt" data-options="{'max':15,'reset':true}" />`
310
- },
311
- {
312
- name: "Tilt Div",
313
- category: "Plugins",
314
- html: `<div class="w-full h-full" data-toggle="tilt" data-options="{'max':15,'reset':true}"></div>`
315
- }
316
- ]
317
- });
318
-
319
- // src/plugins/typed.ts
320
- var typed_default = defineConfig({
321
- name: "typed",
322
- options: {
323
- name: "Typed Effect Options",
324
- previewInEditor: true,
325
- isShown: {
326
- props: {
327
- "data-toggle": "typed"
328
- }
329
- },
330
- fields: [
331
- {
332
- type: "TextOption",
333
- name: "Phrases",
334
- tooltipProps: { content: "Use commas to add new words/phrases" },
335
- placeholder: "second phrase., third phrase.",
336
- propsName: "data-options.strings",
337
- isArray: true
338
- },
339
- {
340
- name: "Loop",
341
- type: "BooleanPropOption",
342
- propsName: "data-options.loop",
343
- defaultValue: true,
344
- enabledValue: true,
345
- inHeaderAction: true,
346
- headerGroup: "Core"
347
- },
348
- {
349
- name: "Type Speed",
350
- type: "SliderPropOption",
351
- propsName: "data-options.typeSpeed",
352
- min: 10,
353
- max: 400,
354
- stepSize: 10,
355
- defaultValue: 100,
356
- enabledValue: 100,
357
- inHeaderAction: true,
358
- headerGroup: "Core"
359
- },
360
- {
361
- name: "Back Speed",
362
- type: "SliderPropOption",
363
- propsName: "data-options.backSpeed",
364
- min: 10,
365
- max: 400,
366
- stepSize: 10,
367
- defaultValue: 50,
368
- enabledValue: 50,
369
- inHeaderAction: true,
370
- headerGroup: "Core"
371
- },
372
- {
373
- name: "Start Delay",
374
- type: "SliderPropOption",
375
- propsName: "data-options.startDelay",
376
- min: 50,
377
- max: 3e3,
378
- stepSize: 50,
379
- defaultValue: 500,
380
- enabledValue: 500,
381
- inHeaderAction: true,
382
- headerGroup: "Core"
383
- },
384
- {
385
- name: "Back Delay",
386
- type: "SliderPropOption",
387
- propsName: "data-options.backDelay",
388
- min: 50,
389
- max: 3e3,
390
- stepSize: 50,
391
- defaultValue: 1e3,
392
- enabledValue: 1e3,
393
- inHeaderAction: true,
394
- headerGroup: "Core"
395
- }
396
- ]
397
- },
398
- cdnUrls: [
399
- {
400
- url: "https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.11/typed.min.js",
401
- defer: true
402
- }
403
- ],
404
- js: `
405
- window.vGetElementsByToggle('typed').forEach((elem) => {
406
- let options = window.vGetElementOptions(elem);
407
-
408
- options.strings = [elem.innerHTML, ...options.strings];
409
- elem.innerHTML = '';
410
-
411
- new Typed(elem, {
412
- typeSpeed: 100,
413
- backSpeed: 50,
414
- startDelay: 500,
415
- backDelay: 1000,
416
- loop: true,
417
- ...options
418
- });
419
- });`,
420
- checks: [{ plugin: "typed" }],
421
- components: [
422
- // {
423
- // name: 'Tilt Div',
424
- // category: 'Plugins',
425
- // html: `<div class="w-full h-full" data-toggle="tilt" data-options="{'max':15,'reset':true}"></div>`,
426
- // },
427
- ],
428
- displayNames: [
429
- {
430
- displayName: "Typed Effect",
431
- property: "data-toggle",
432
- value: "typed"
433
- }
434
- ]
435
- });
436
-
437
- // src/plugins/countup.ts
438
- var countup_default = defineConfig({
439
- name: "countup",
440
- cdnUrls: [
441
- {
442
- url: "https://cdnjs.cloudflare.com/ajax/libs/scrollReveal.js/3.4.0/scrollreveal.min.js"
443
- },
444
- {
445
- url: "https://cdnjs.cloudflare.com/ajax/libs/countup.js/2.0.8/countUp.umd.min.js"
446
- }
447
- ],
448
- js: `window.scrollReveal = ScrollReveal();
449
-
450
- window.countUpStart = (elem) => {
451
- var startVal = elem.dataset.from ? +elem.dataset.from : 0
452
- ,endVal = elem.dataset.to ? +elem.dataset.to : 0
453
- ,duration = elem.dataset.duration ? +elem.dataset.duration : 2
454
- ,options = window.vGetElementOptions(elem);
455
- const up = new countUp.CountUp(elem, endVal, {...options, startVal, duration});
456
- up.start();
457
- }
458
-
459
- window.vGetElementsByToggle('countup').forEach(elem => {
460
- scrollReveal.reveal(elem, {beforeReveal: window.countUpStart, duration: 0});
461
- });`,
462
- checks: [{ plugin: "countup" }],
463
- options: {
464
- name: "Countup Options",
465
- isShown: {
466
- props: {
467
- "data-toggle": "countup"
468
- }
469
- },
470
- fields: [
471
- {
472
- name: "Count From",
473
- propsName: "data-from",
474
- type: "NumberOption"
475
- },
476
- {
477
- name: "Count To",
478
- propsName: "data-to",
479
- type: "NumberOption"
480
- },
481
- {
482
- name: "Duration",
483
- propsName: "data-duration",
484
- type: "NumberOption",
485
- placeholder: "2",
486
- stepSize: 0.1
487
- },
488
- {
489
- name: "Countup when Visible",
490
- propsName: "data-aos",
491
- options: [false, true],
492
- type: "BooleanPropOption",
493
- defaultValue: false
494
- }
495
- ]
496
- },
497
- components: [
498
- {
499
- name: "Countup",
500
- category: "Plugins",
501
- html: `<h2 data-toggle="countup" data-aos data-aos-id="countup:in" data-from="100" data-to="800">100</h2>`
502
- }
503
- ]
504
- });
505
-
506
- // src/plugins/countdown.ts
507
- var js3 = `window.vGetElementsByToggle('countdown').forEach(elem => {
508
- const deadline = new Date(elem.dataset.countdown).getTime();
509
-
510
- let elementsByType = {};
511
- elem.querySelectorAll('[data-countdown-type]').forEach(el => {
512
- elementsByType[el.dataset.countdownType] = el;
513
- });
514
-
515
- const countdownFunc = () => {
516
- let t = (deadline - new Date().getTime()) / 1000;
517
-
518
- if (t < 0) {
519
- clearInterval(x);
520
- t = 0;
521
- }
522
-
523
- let valuesByType = {
524
- seconds: t % 60,
525
- minutes: (t / 60) % 60,
526
- hours: (t / (60 * 60)) % 24,
527
- days: t / (60 * 60 * 24),
528
- };
529
-
530
- Object.keys(valuesByType).forEach(type => {
531
- if (elementsByType[type]) {
532
- let value = Math.floor(valuesByType[type]);
533
- if (value < 10) {
534
- value = '0' + value;
535
- }
536
-
537
- elementsByType[type].innerHTML = value;
538
- }
539
- });
540
- }
541
-
542
- var x = setInterval(countdownFunc, 1000);
543
- countdownFunc();
544
- });
545
- `;
546
- var currentDate = /* @__PURE__ */ new Date();
547
- var ISODateIn5Days = new Date(currentDate.getTime() + 5 * 24 * 60 * 60 * 1234).toISOString();
548
- var countdown_default = defineConfig({
549
- name: "countdown",
550
- js: js3,
551
- checks: [{ plugin: "countdown" }],
552
- options: {
553
- name: "Countdown",
554
- isShown: {
555
- props: {
556
- "data-toggle": "countdown",
557
- "data-countdown": true
558
- }
559
- },
560
- fields: [
561
- {
562
- name: "Countdown Timer",
563
- propsName: "data-countdown",
564
- type: "DateTimePickerOption"
565
- }
566
- ]
567
- },
568
- components: [
569
- {
570
- name: "Countdown",
571
- category: "Plugins",
572
- html: `<h2 class="font-semibold" data-toggle="countdown" data-countdown="${ISODateIn5Days}">
573
- <span data-countdown-type="days">4</span>
574
- <span class="opacity-20">:</span>
575
- <span data-countdown-type="hours">1</span>
576
- <span class="opacity-20">:</span>
577
- <span data-countdown-type="minutes">0</span>
578
- <span class="opacity-20">:</span>
579
- <span data-countdown-type="seconds">0</span>
580
- </h2>`
581
- }
582
- ]
583
- });
584
-
585
- // src/plugins/finisher-header.ts
586
- var finisher_header_default = defineConfig({
587
- name: "finisher-header",
588
- cdnUrls: [
589
- {
590
- url: "https://d1pnnwteuly8z3.cloudfront.net/js/finisher-header.es5.min.js",
591
- defer: true
592
- }
593
- ],
594
- js: `document.querySelectorAll('.finisher-header').forEach(elem => {
595
- let options = window.vGetElementOptions(elem);
596
- new FinisherHeader(options);
597
- });`,
598
- checks: [{ html: "finisher-header" }],
599
- components: [
600
- {
601
- name: "Finisher Header",
602
- category: "Plugins",
603
- html: `<div class="finisher-header" data-toggle="finisher-header" data-options="{'count':15,'size':{'min':2,'max':40,'pulse':0},'speed':{'x':{'min':0,'max':0.8},'y':{'min':0,'max':0.2}},'colors':{'background':'#fff','particles':['#ff926b','#87ddfe','#acaaff','#1bffc2','#f9a5fe']},'blending':'screen','opacity':{'center':1,'edge':1},'skew':-1,'shapes':['c','s','t']}"></div>`
604
- }
605
- ]
606
- });
607
-
608
- // src/plugins/taos.ts
609
- var js4 = `!function(){const e=(e,t)=>{let s=!1;return()=>{s||(e(),s=!0,setTimeout((()=>s=!1),t))}},t=e=>{e.className!==e.dataset.taosClass&&(e.className=e.dataset.taosClass)},s=e=>e.className=e.className.replaceAll("taos:",""),a=e=>(e.className.includes("taos-init")||(e.dataset.taosClass=e.className+" taos-init",t(e)),e.className+=" !duration-[0ms] !delay-[0ms]",s(e),{element:e,once:"1"===getComputedStyle(e)["animation-iteration-count"],offset:parseInt(e.dataset.taosOffset||0)});let n=[],i=window.innerWidth,o=window.scrollY;const l=e((()=>{n.forEach((e=>e.trigger=e.element.getBoundingClientRect().top-window.innerHeight+e.offset+o))}),250),r=()=>{n=[],document.querySelectorAll('[class*="taos"]').forEach((e=>n.push(a(e)))),l(),requestAnimationFrame(c)},c=()=>{o=window.scrollY,n.forEach((({element:e,trigger:a,once:n})=>{a<o?t(e):!n&&e.className.includes("taos:")&&s(e)})),l()};r(),addEventListener("scroll",e(c,32)),addEventListener("orientationchange",r),addEventListener("resize",((e,t)=>{let s=null;return()=>{clearTimeout(s),s=setTimeout(e,t)}})((()=>{i!==window.innerWidth&&(i=window.innerWidth,r())}),250)),new MutationObserver((e=>{e.forEach((({target:e})=>{e.className&&!e.className.includes("taos-init")&&e.className.includes("taos:")&&n.push(a(e))}))})).observe(document,{attributes:!0,childList:!0,subtree:!0})}();`;
610
- var taos_default = defineConfig({
611
- name: "taos",
612
- css: `
613
- html.js :where([class*="taos:"]:not(.taos-init)) {
614
- visibility: hidden;
615
- }`,
616
- js: js4,
617
- checks: [{ plugin: "taos" }, { html: "taos:" }],
618
- safelist: ["!duration-[0ms]", "!delay-[0ms]"]
619
- });
620
-
621
- // src/plugins/tailtip.ts
622
- var js5 = `window.vTailtips = [];
623
-
624
- window.vGetElementsByToggle('tooltip').forEach((elem) => {
625
- const tailtip = Tailtip(elem, window.vGetElementOptions(elem));
626
- window.vTailtips.push(tailtip);
627
- });`;
628
- var tailtip_default = defineConfig({
629
- name: "tailtip",
630
- src: "https://d1pnnwteuly8z3.cloudfront.net/libs/tailtip/1.0.3/tailtip.js",
631
- cdnUrls: [
632
- {
633
- url: "https://d1pnnwteuly8z3.cloudfront.net/libs/tailtip/1.0.3/tailtip.js",
634
- defer: true
635
- }
636
- ],
637
- js: js5,
638
- checks: [{ plugin: "tailtip" }],
639
- components: [
640
- {
641
- name: "Info Tooltip",
642
- category: "Plugins",
643
- html: `<span class="flex w-4 h-4 bg-dark text-white items-center justify-center rounded-full text-xs font-medium" data-toggle="tooltip">i</span>
644
- <div class="tooltip" role="tooltip">
645
- <div class="tooltip-inner">
646
- <span>This is a tooltip that is shown when hovered or clicked.</span>
647
- </div>
648
- <div class="tooltip-arrow"></div>
649
- </div>`
650
- }
651
- ],
652
- options: {
653
- name: "Tailtip Options",
654
- // isShown: (element) => element['data-toggle'] === 'tooltip',
655
- isShown: {
656
- props: {
657
- "data-toggle": "tooltip"
658
- }
659
- },
660
- previewInEditor: true,
661
- fields: [
662
- {
663
- name: "tailtip",
664
- type: "TailtipOption"
665
- },
666
- {
667
- name: "Placement",
668
- propsName: "data-options.placement",
669
- type: "DropdownPropOption",
670
- inline: true,
671
- noneDisplayValue: "Default",
672
- options: [false, "top", "bottom", "left", "right"]
673
- }
674
- ]
675
- }
676
- });
677
-
678
- // src/plugins/versoly-marquee.ts
679
- var src = "https://d1pnnwteuly8z3.cloudfront.net/libs/versoly-marquee/0.0.2/versoly-marquee.iife.js";
680
- var js6 = `window.vMarquees = [];
681
- window.vGetElementsByToggle('marquee').forEach((elem) => {
682
- const marquee = new Marquee(elem, window.vGetElementOptions(elem));
683
- window.vMarquees.push(marquee);
684
- });`;
685
- var versoly_marquee_default = defineConfig({
686
- name: "versoly-marquee",
687
- js: js6,
688
- options: {
689
- name: "Marquee",
690
- previewInEditor: true,
691
- isShown: {
692
- props: {
693
- "data-toggle": "marquee"
694
- }
695
- },
696
- fields: [
697
- {
698
- name: "Loop",
699
- type: "BooleanPropOption",
700
- propsName: "data-options.loop",
701
- defaultValue: true,
702
- enabledValue: true,
703
- inHeaderAction: true,
704
- headerGroup: "Core"
705
- },
706
- {
707
- name: "Duration",
708
- type: "SliderPropOption",
709
- propsName: "data-options.duration",
710
- min: 1,
711
- max: 20,
712
- stepSize: 1,
713
- defaultValue: 5
714
- },
715
- {
716
- name: "Direction",
717
- type: "IconButtonOption",
718
- propsName: "data-options.direction",
719
- options: ["ltr", "rtl", "ttb", "btt"],
720
- defaultValue: "ltr"
721
- },
722
- {
723
- name: "Pauseable",
724
- type: "BooleanPropOption",
725
- propsName: "data-options.pauseable",
726
- defaultValue: true
727
- },
728
- {
729
- name: "Iterations",
730
- type: "SliderPropOption",
731
- propsName: "data-options.iterations",
732
- min: 1,
733
- max: 5,
734
- stepSize: 1,
735
- defaultValue: 1,
736
- enabledValue: 1,
737
- inHeaderAction: true,
738
- headerGroup: "Core"
739
- }
740
- ]
741
- },
742
- checks: [{ plugin: "marquee" }],
743
- src,
744
- cdnUrls: [
745
- {
746
- url: src,
747
- defer: true
748
- }
749
- ],
750
- displayNames: [
751
- {
752
- displayName: "Marquee",
753
- property: "data-toggle",
754
- value: "marquee"
755
- }
756
- ]
757
- });
758
-
759
- // src/plugins/versoly-ui.ts
760
- var versoly_ui_default = defineConfig({
761
- name: "versoly-ui",
762
- cdnUrls: [
763
- {
764
- url: "https://d1pnnwteuly8z3.cloudfront.net/libs/floating-ui/1.0.1/floating-ui.min.js",
765
- defer: true
766
- },
767
- {
768
- url: "https://d1pnnwteuly8z3.cloudfront.net/libs/versoly-ui/2.1.1/versoly-ui.js",
769
- delay: true
770
- }
771
- ]
772
- });
773
-
774
- // src/plugins/versoly-analytics.ts
775
- var js7 = `!function(e){e.versoly.event=function(t){if(!("visibilityState"in document&&"prerender"===document.visibilityState||/bot|google|baidu|bing|msn|duckduckbot|teoma|slurp|yandex/i.test(navigator.userAgent)||e._phantom||e.__nightmare||e.navigator.webdriver||e.Cypress||""===e.location.host)){var n=new XMLHttpRequest;n.open("POST",e.versoly.url,!0),n.setRequestHeader("Content-Type","application/json; charset=UTF-8"),n.send(JSON.stringify({siteId:e.versoly.id,referrer:document.referrer,paramReferrer:"",hostname:e.location.hostname,pathname:e.location.pathname+e.location.search,width:e.innerWidth,height:e.innerHeight,tz:Intl.DateTimeFormat().resolvedOptions().timeZone,...t}))}}}(window),window.versoly.event({name: 'pageview'});`;
776
- var versoly_analytics_default = defineConfig({
777
- name: "versoly-analytics",
778
- js: js7,
779
- checks: [{ html: "/api/event" }]
780
- });
781
-
782
- // src/plugins/versoly-events.ts
783
- var versoly_events_default = defineConfig({
784
- name: "versoly-events",
785
- js: `const eventElements = document.querySelectorAll('[data-eventid]');
786
- for (const eventElement of eventElements) {
787
- if (eventElement.tagName !== 'FORM') {
788
- eventElement.addEventListener('click', function(e) {
789
- const eventName = eventElement.getAttribute('data-eventid');
790
-
791
- if (window.versoly) {
792
- window.versoly.event({name: eventName})
793
- }
794
- if (window.gtag) {
795
- window.gtag('event', eventName)
796
- }
797
- if (window.amplitude) {
798
- window.amplitude.getInstance().logEvent(event);
799
- }
800
- })
801
- }
802
- }`,
803
- checks: [{ html: "data-eventid" }]
804
- });
805
-
806
- // src/plugins/versoly-form.ts
807
- var versoly_form_default = defineConfig({
808
- name: "versoly-form",
809
- checks: [{ plugin: "formid" }],
810
- js: `window.vPageLoadedAt = Date.now();
811
- window.vForms = window.vForms || {};
812
-
813
- setTimeout(() => {
814
- let inputs = [...document.getElementsByTagName("input")]
815
- inputs.forEach(i => {
816
- if (i.name === 'email_second' || i.name === 'name_second') {
817
- i.setAttribute('aria-hidden', 'true')
818
- i.setAttribute('tabindex', '-1')
819
- i.setAttribute('autocomplete', 'false')
820
- }
821
- })
822
- }, 3000)
823
-
824
- const sendFormData = function (e, form) {
825
- e.preventDefault();
826
- const formId = form.dataset.formid;
827
- let scriptsByForm = window.vForms[formId] || {}
828
-
829
- if (window.vPageLoadedAt + 3000 > Date.now()) {
830
- return null
831
- }
832
-
833
- let data = {
834
- created: Date.now(),
835
- url: location.pathname + location.search
836
- }
837
-
838
- const filteredForms = document.querySelectorAll('[data-formId="' + formId + '"]')
839
- let formIndex = 0
840
- filteredForms.forEach((f, index) => {
841
- if (f === form) {
842
- formIndex = index
843
- }
844
- })
845
-
846
- const errorElement = document.querySelectorAll('[data-form-errorid="' + formId + '"]')[formIndex]
847
- let inputs = [
848
- ...form.getElementsByTagName("input"),
849
- ...form.getElementsByTagName("textarea"),
850
- ...form.getElementsByTagName("select")
851
- ]
852
-
853
- inputs.forEach(input => {
854
- if (input.type === 'radio') {
855
- if (input.checked) {
856
- data[input.name] = input.value
857
- }
858
- return
859
- }
860
- if (input.tagName === 'SELECT') {
861
- data[input.name] = input.options[input.selectedIndex].value
862
- return
863
- }
864
- if (input.type === 'checkbox') {
865
- data[input.name] = input.checked + ""
866
- return
867
- }
868
- data[input.name] = input.value
869
- })
870
-
871
- if (!!data['email_second'] || !!data['name_second']) {
872
- return null
873
- }
874
- delete data['email_second'];
875
- delete data['name_second'];
876
-
877
- if (scriptsByForm.pre) {
878
- eval(scriptsByForm.pre)
879
- }
880
-
881
- const submitButton = form.querySelector(('button[type="submit"]'))
882
- const buttonInnerHTML = submitButton.innerHTML
883
- submitButton.disabled = true
884
-
885
- let loadingButtonInnerHTML = '<i class="fa fa-spinner fa-spin"></i> Loading'
886
- if (submitButton.getAttribute('data-loading-html')) {
887
- loadingButtonInnerHTML = submitButton.getAttribute('data-loading-html')
888
- }
889
- submitButton.innerHTML = loadingButtonInnerHTML
890
-
891
- data = JSON.stringify(data)
892
- fetch('https://api.versoly.com/v1/form/submit', {
893
- method: 'POST',
894
- headers: {
895
- 'Content-Type': 'application/json'
896
- },
897
- body: JSON.stringify({formId: formId, data: data})
898
- })
899
- .then(function (response){
900
- if (!response.ok) {
901
- throw new Error('Bad response from server');
902
- }
903
-
904
- if (window.versoly && form.getAttribute('data-eventid')) {
905
- window.versoly.event({name: form.getAttribute('data-eventid')})
906
- }
907
-
908
- if (scriptsByForm.post) {
909
- eval(scriptsByForm.post)
910
- }
911
-
912
- if (form.dataset["successUrl"]) {
913
- window.location.replace(form.dataset["successUrl"])
914
- return
915
- }
916
-
917
- const successElement = document.querySelectorAll('[data-form-successid="' + formId + '"]')[formIndex]
918
-
919
- if (successElement) {
920
- successElement.classList.remove("d-js");
921
- errorElement.classList.add("d-js");
922
- form.classList.add("d-js");
923
-
924
- successElement.classList.remove("d-none");
925
- errorElement.classList.add("d-none");
926
- form.classList.add("d-none");
927
- }
928
-
929
- submitButton.disabled = false
930
- submitButton.innerHTML = buttonInnerHTML
931
- })
932
- .catch(function (error){
933
- console.log(error)
934
- if (errorElement) {
935
- errorElement.classList.remove("d-js");
936
- errorElement.classList.remove("d-none");
937
- }
938
- if (scriptsByForm.failed) {
939
- eval(scriptsByForm.failed)
940
- }
941
- submitButton.disabled = false
942
- submitButton.innerHTML = buttonInnerHTML
943
- })
944
- }
945
-
946
-
947
- window.addFormListener = () => {
948
- const forms = document.querySelectorAll('[data-formid]');
949
-
950
- for (const form of forms) {
951
- if (!form.getAttribute('data-has-form-eventlistener')) {
952
- form.addEventListener("submit", function (e) {
953
- sendFormData(e, form)
954
- });
955
- form.setAttribute('data-has-form-eventlistener', 'true')
956
- }
957
- }
958
- }
959
- window.addFormListener && window.addFormListener()
960
- `
961
- });
962
-
963
- // src/plugins/versoly-modal.ts
964
- var js8 = `window.vGetElementsByToggle('modal').forEach(elem => {
965
- let options = window.vGetElementOptions(elem);
966
-
967
- if (options.globalBlockId && window.vComponents[options.globalBlockId]) {
968
- elem.dataset.html = window.vComponents[options.globalBlockId];
969
-
970
- if (window.vComponents[options.globalBlockId].includes('data-formid')) {
971
- options.beforeShown = 'addFormListener'
972
- }
973
- }
974
-
975
- elem.dataset.options = JSON.stringify(options);
976
- });`;
977
- var versoly_modal_default = defineConfig({
978
- name: "versoly-modal",
979
- js: js8,
980
- checks: [{ plugin: "modal" }]
981
- });
982
-
983
- // src/plugins/index.ts
984
- var plugins = {
985
- // external
986
- calendly: calendly_default,
987
- swiper: swiper_default,
988
- prism: prism_default,
989
- tilt: tilt_default,
990
- typed: typed_default,
991
- countup: countup_default,
992
- countdown: countdown_default,
993
- "finisher-header": finisher_header_default,
994
- taos: taos_default,
995
- tailtip: tailtip_default,
996
- // versoly packages
997
- "versoly-marquee": versoly_marquee_default,
998
- "versoly-ui": versoly_ui_default,
999
- // internal
1000
- "versoly-analytics": versoly_analytics_default,
1001
- "versoly-events": versoly_events_default,
1002
- "versoly-form": versoly_form_default,
1003
- "versoly-modal": versoly_modal_default
1004
- };
1005
- export {
1006
- defineConfig,
1007
- plugins
1008
- };