@versoly/plugins 0.0.2 → 0.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.
@@ -5,119 +5,54 @@
5
5
  return config;
6
6
  };
7
7
 
8
- // src/plugins/headroom.ts
9
- var headroom = defineConfig({
10
- name: "Headroom",
8
+ // src/plugins/calendly.ts
9
+ var calendly_default = defineConfig({
10
+ name: "calendly",
11
11
  cdnUrls: [
12
12
  {
13
- url: "https://cdnjs.cloudflare.com/ajax/libs/headroom/0.12.0/headroom.min.js",
14
- inline: false,
15
- defer: true
13
+ url: "https://assets.calendly.com/assets/external/widget.js",
14
+ delay: true
15
+ },
16
+ {
17
+ url: "https://assets.calendly.com/assets/external/widget.css",
18
+ delay: true
16
19
  }
17
20
  ],
18
- js: `window.vGetElementsByToggle('headroom').forEach((elem, index) => {
19
- let options = window.vGetElementOptions(elem);
21
+ js: `
22
+ document.querySelectorAll('[data-calendly-url]').forEach(elem => {
23
+ const url = elem.dataset.calendlyUrl;
20
24
 
21
- var headroom = new Headroom(elem, {
22
- classes: {
23
- pinned: "d-block block",
24
- unpinned: 'd-none hidden'
25
- },
26
- ...options
27
- });
25
+ if (!url) {
26
+ return;
27
+ }
28
28
 
29
- headroom.init();
29
+ elem.addEventListener('click', e => {
30
+ e.preventDefault();
31
+ window.Calendly.initPopupWidget({ url, parentElement: elem });
32
+ })
30
33
  });`,
31
- checks: [{ plugin: "headroom" }],
32
- components: []
33
- });
34
-
35
- // src/plugins/marquee.ts
36
- var src = "https://d1pnnwteuly8z3.cloudfront.net/libs/versoly-marquee/0.0.2/versoly-marquee.iife.js";
37
- var marquee = defineConfig({
38
- name: "Marquee",
34
+ checks: [{ plugin: "calendly" }, { html: "calendly" }],
39
35
  options: {
40
- name: "Marquee",
41
- previewInEditor: true,
36
+ name: "Calendly Options",
42
37
  isShown: {
43
38
  props: {
44
- "data-toggle": "marquee"
39
+ "data-calendly-url": true
45
40
  }
46
41
  },
47
42
  fields: [
48
43
  {
49
- name: "Loop",
50
- type: "BooleanPropOption",
51
- propsName: "data-options.loop",
52
- defaultValue: true,
53
- enabledValue: true,
54
- inHeaderAction: true,
55
- headerGroup: "Core"
56
- },
57
- {
58
- name: "Duration",
59
- type: "SliderPropOption",
60
- propsName: "data-options.duration",
61
- min: 1,
62
- max: 20,
63
- stepSize: 1,
64
- defaultValue: 5
65
- },
66
- {
67
- name: "Direction",
68
- type: "IconButtonOption",
69
- propsName: "data-options.direction",
70
- options: ["ltr", "rtl", "ttb", "btt"],
71
- defaultValue: "ltr"
72
- },
73
- {
74
- name: "Pauseable",
75
- type: "BooleanPropOption",
76
- propsName: "data-options.pauseable",
77
- defaultValue: true
78
- },
79
- {
80
- name: "Iterations",
81
- type: "SliderPropOption",
82
- propsName: "data-options.iterations",
83
- min: 1,
84
- max: 5,
85
- stepSize: 1,
86
- defaultValue: 1,
87
- enabledValue: 1,
88
- inHeaderAction: true,
89
- headerGroup: "Core"
44
+ name: "Calendly Url",
45
+ propsName: "data-calendly-url",
46
+ type: "TextOption"
90
47
  }
91
48
  ]
92
- },
93
- checks: [{ plugin: "marquee" }],
94
- src,
95
- cdnUrls: [
96
- {
97
- url: src,
98
- defer: true
99
- }
100
- ],
101
- js: `window.vMarquees = [];
102
- window.vGetElementsByToggle('marquee').forEach((elem, index) => {
103
- const options = window.vGetElementOptions(elem);
104
- const marquee = new Marquee(elem, options);
105
- elem.setAttribute('data-marquee-index', index);
106
- window.vMarquees.push(elem);
107
- });`,
108
- displayNames: [
109
- {
110
- displayName: "Marquee",
111
- property: "data-toggle",
112
- value: "marquee"
113
- }
114
- ]
49
+ }
115
50
  });
116
51
 
117
52
  // src/plugins/swiper.ts
118
53
  var js = `
119
54
  window.vSwipers = [];
120
- window.vGetElementsByToggle('swiper').forEach((elem, index) => {
55
+ window.vGetElementsByToggle('swiper').forEach((elem) => {
121
56
  let props = window.vGetElementOptions(elem);
122
57
 
123
58
  if (props.pagination && props.pagination.renderBullet === 'number') {
@@ -129,11 +64,10 @@ window.vGetElementsByToggle('swiper').forEach((elem, index) => {
129
64
  }
130
65
  }
131
66
 
132
- elem.setAttribute('data-swiper-index', index);
133
67
  window.vSwipers.push(new Swiper(elem, props));
134
68
  });`;
135
- var swiper = defineConfig({
136
- name: "Swiper",
69
+ var swiper_default = defineConfig({
70
+ name: "swiper",
137
71
  cdnUrls: [
138
72
  {
139
73
  url: `https://cdnjs.cloudflare.com/ajax/libs/Swiper/9.3.2/swiper-bundle.min.js`,
@@ -149,8 +83,8 @@ window.vGetElementsByToggle('swiper').forEach((elem, index) => {
149
83
  });
150
84
 
151
85
  // src/plugins/prism.ts
152
- var prism = defineConfig({
153
- name: "Prism",
86
+ var prism_default = defineConfig({
87
+ name: "prism",
154
88
  cdnUrls: [
155
89
  {
156
90
  url: "https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/plugins/line-numbers/prism-line-numbers.min.css"
@@ -191,86 +125,14 @@ window.addEventListener('load', () => {
191
125
  checks: [{ html: "prism" }]
192
126
  });
193
127
 
194
- // src/plugins/tailtip.ts
195
- var js2 = `window.vTailtips = [];
196
-
197
- document.querySelectorAll('[data-toggle="tooltip"]').forEach((elem) => {
198
- const tailtip = Tailtip(elem, window.vGetElementOptions(elem));
199
- window.vTailtips.push(tailtip);
200
- });`;
201
- var tailtip = defineConfig({
202
- name: "Tailtip",
203
- src: "https://d1pnnwteuly8z3.cloudfront.net/libs/tailtip/1.0.3/tailtip.js",
204
- cdnUrls: [
205
- {
206
- url: "https://d1pnnwteuly8z3.cloudfront.net/libs/tailtip/1.0.3/tailtip.js",
207
- defer: true
208
- }
209
- ],
210
- js: js2,
211
- checks: [{ plugin: "tailtip" }],
212
- components: [
213
- {
214
- name: "Info Tooltip",
215
- category: "Plugins",
216
- 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>
217
- <div class="tooltip" role="tooltip">
218
- <div class="tooltip-inner">
219
- <span>This is a tooltip that is shown when hovered or clicked.</span>
220
- </div>
221
- <div class="tooltip-arrow"></div>
222
- </div>`
223
- }
224
- ],
225
- options: {
226
- name: "Tailtip Options",
227
- // isShown: (element) => element['data-toggle'] === 'tooltip',
228
- isShown: {
229
- props: {
230
- "data-toggle": "tooltip"
231
- }
232
- },
233
- previewInEditor: true,
234
- fields: [
235
- {
236
- name: "tailtip",
237
- type: "TailtipOption"
238
- },
239
- {
240
- name: "Placement",
241
- propsName: "data-options.placement",
242
- type: "DropdownPropOption",
243
- inline: true,
244
- noneDisplayValue: "Default",
245
- options: [false, "top", "bottom", "left", "right"]
246
- }
247
- ]
248
- }
249
- });
250
-
251
- // src/plugins/taos.ts
252
- var js3 = `!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})}();`;
253
- var taos = defineConfig({
254
- name: "TAOS",
255
- css: `
256
- html.js :where([class*="taos:"]:not(.taos-init)) {
257
- visibility: hidden;
258
- }`,
259
- js: js3,
260
- checks: [{ plugin: "taos" }, { html: "taos:" }],
261
- safelist: ["!duration-[0ms]", "!delay-[0ms]"]
262
- });
263
-
264
128
  // src/plugins/tilt.ts
265
- var js4 = `window.vTilts = [];
266
- window.vGetElementsByToggle('tilt').forEach((tiltEle, index) => {
267
- const options = window.vGetElementOptions(elem);
268
- VanillaTilt.init(tiltEle, options)
269
- tiltEle.setAttribute('data-tilt-index', index);
270
- window.vTilts.push(tiltEle);
129
+ var js2 = `window.vTilts = [];
130
+ window.vGetElementsByToggle('tilt').forEach((elem) => {
131
+ VanillaTilt.init(elem, window.vGetElementOptions(elem));
132
+ window.vTilts.push(elem);
271
133
  });`;
272
- var tilt = defineConfig({
273
- name: "Tilt",
134
+ var tilt_default = defineConfig({
135
+ name: "tilt",
274
136
  options: {
275
137
  name: "Tilt",
276
138
  previewInEditor: true,
@@ -440,7 +302,7 @@ window.vGetElementsByToggle('tilt').forEach((tiltEle, index) => {
440
302
  defer: true
441
303
  }
442
304
  ],
443
- js: js4,
305
+ js: js2,
444
306
  checks: [{ plugin: "tilt" }],
445
307
  components: [
446
308
  {
@@ -457,8 +319,8 @@ window.vGetElementsByToggle('tilt').forEach((tiltEle, index) => {
457
319
  });
458
320
 
459
321
  // src/plugins/typed.ts
460
- var typed = defineConfig({
461
- name: "Typed",
322
+ var typed_default = defineConfig({
323
+ name: "typed",
462
324
  options: {
463
325
  name: "Typed Effect Options",
464
326
  previewInEditor: true,
@@ -542,7 +404,7 @@ window.vGetElementsByToggle('tilt').forEach((tiltEle, index) => {
542
404
  }
543
405
  ],
544
406
  js: `
545
- window.vGetElementsByToggle('typed').forEach((elem, index) => {
407
+ window.vGetElementsByToggle('typed').forEach((elem) => {
546
408
  let options = window.vGetElementOptions(elem);
547
409
 
548
410
  options.strings = [elem.innerHTML, ...options.strings];
@@ -574,67 +436,385 @@ window.vGetElementsByToggle('typed').forEach((elem, index) => {
574
436
  ]
575
437
  });
576
438
 
577
- // src/plugins/eventAnalytics.ts
578
- var eventAnalytics = defineConfig({
579
- name: "Event Analytics",
580
- js: `const eventElements = document.querySelectorAll('[data-eventid]');
581
- for (const eventElement of eventElements) {
582
- if (eventElement.tagName !== 'FORM') {
583
- eventElement.addEventListener('click', function(e) {
584
- const eventName = eventElement.getAttribute('data-eventid');
585
-
586
- if (window.versoly) {
587
- window.versoly.event({name: eventName})
588
- }
589
- if (window.gtag) {
590
- window.gtag('event', eventName)
439
+ // src/plugins/countup.ts
440
+ var countup_default = defineConfig({
441
+ name: "countup",
442
+ cdnUrls: [
443
+ {
444
+ url: "https://cdnjs.cloudflare.com/ajax/libs/scrollReveal.js/3.4.0/scrollreveal.min.js"
445
+ },
446
+ {
447
+ url: "https://cdnjs.cloudflare.com/ajax/libs/countup.js/2.0.8/countUp.umd.min.js"
591
448
  }
592
- if (window.amplitude) {
593
- window.amplitude.getInstance().logEvent(event);
449
+ ],
450
+ js: `window.scrollReveal = ScrollReveal();
451
+
452
+ window.countUpStart = (elem) => {
453
+ var startVal = elem.dataset.from ? +elem.dataset.from : 0
454
+ ,endVal = elem.dataset.to ? +elem.dataset.to : 0
455
+ ,duration = elem.dataset.duration ? +elem.dataset.duration : 2
456
+ ,options = window.vGetElementOptions(elem);
457
+ const up = new countUp.CountUp(elem, endVal, {...options, startVal, duration});
458
+ up.start();
459
+ }
460
+
461
+ window.vGetElementsByToggle('countup').forEach(elem => {
462
+ scrollReveal.reveal(elem, {beforeReveal: window.countUpStart, duration: 0});
463
+ });`,
464
+ checks: [{ plugin: "countup" }],
465
+ options: {
466
+ name: "Countup Options",
467
+ isShown: {
468
+ props: {
469
+ "data-toggle": "countup"
470
+ }
471
+ },
472
+ fields: [
473
+ {
474
+ name: "Count From",
475
+ propsName: "data-from",
476
+ type: "NumberOption"
477
+ },
478
+ {
479
+ name: "Count To",
480
+ propsName: "data-to",
481
+ type: "NumberOption"
482
+ },
483
+ {
484
+ name: "Duration",
485
+ propsName: "data-duration",
486
+ type: "NumberOption",
487
+ placeholder: "2",
488
+ stepSize: 0.1
489
+ },
490
+ {
491
+ name: "Countup when Visible",
492
+ propsName: "data-aos",
493
+ options: [false, true],
494
+ type: "BooleanPropOption",
495
+ defaultValue: false
496
+ }
497
+ ]
498
+ },
499
+ components: [
500
+ {
501
+ name: "Countup",
502
+ category: "Plugins",
503
+ html: `<h2 data-toggle="countup" data-aos data-aos-id="countup:in" data-from="100" data-to="800">100</h2>`
594
504
  }
595
- })
596
- }
597
- }`,
598
- checks: [{ html: "data-eventid" }]
505
+ ]
599
506
  });
600
507
 
601
- // src/plugins/versolyAnalytics.ts
602
- var js5 = `!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'});`;
603
- var versolyAnalytics = defineConfig({
604
- name: "Versoly Analytics",
605
- js: js5,
606
- checks: [{ html: "/api/event" }]
607
- });
508
+ // src/plugins/countdown.ts
509
+ var js3 = `window.vGetElementsByToggle('countdown').forEach(elem => {
510
+ const deadline = new Date(elem.dataset.countdown).getTime();
608
511
 
609
- // src/plugins/modal.ts
610
- var modal = defineConfig({
611
- name: "Versoly UI Modal",
612
- js: `window.vGetElementsByToggle('modal').forEach(elem => {
613
- let options = window.vGetElementOptions(elem);
512
+ let elementsByType = {};
513
+ elem.querySelectorAll('[data-countdown-type]').forEach(el => {
514
+ elementsByType[el.dataset.countdownType] = el;
515
+ });
614
516
 
615
- if (options.globalBlockId && window.vComponents[options.globalBlockId]) {
616
- elem.dataset.html = window.vComponents[options.globalBlockId];
517
+ const countdownFunc = () => {
518
+ let t = (deadline - new Date().getTime()) / 1000;
617
519
 
618
- if (window.vComponents[options.globalBlockId].includes('data-formid')) {
619
- options.beforeShown = 'addFormListener'
520
+ if (t < 0) {
521
+ clearInterval(x);
522
+ t = 0;
620
523
  }
621
- }
622
524
 
623
- elem.dataset.options = JSON.stringify(options);
624
- });`,
625
- checks: [{ plugin: "modal" }]
626
- });
525
+ let valuesByType = {
526
+ seconds: t % 60,
527
+ minutes: (t / 60) % 60,
528
+ hours: (t / (60 * 60)) % 24,
529
+ days: t / (60 * 60 * 24),
530
+ };
531
+
532
+ Object.keys(valuesByType).forEach(type => {
533
+ if (elementsByType[type]) {
534
+ let value = Math.floor(valuesByType[type]);
535
+ if (value < 10) {
536
+ value = '0' + value;
537
+ }
627
538
 
628
- // src/plugins/form.ts
629
- var form = defineConfig({
630
- name: "versoly-form",
631
- checks: [{ plugin: "formid" }],
632
- js: `window.vPageLoadedAt = Date.now()
539
+ elementsByType[type].innerHTML = value;
540
+ }
541
+ });
542
+ }
633
543
 
634
- setTimeout(() => {
635
- let inputs = [...document.getElementsByTagName("input")]
636
- inputs.forEach(i => {
637
- if (i.name === 'email_second' || i.name === 'name_second') {
544
+ var x = setInterval(countdownFunc, 1000);
545
+ countdownFunc();
546
+ });
547
+ `;
548
+ var currentDate = /* @__PURE__ */ new Date();
549
+ var ISODateIn5Days = new Date(currentDate.getTime() + 5 * 24 * 60 * 60 * 1234).toISOString();
550
+ var countdown_default = defineConfig({
551
+ name: "countdown",
552
+ js: js3,
553
+ checks: [{ plugin: "countdown" }],
554
+ options: {
555
+ name: "Countdown",
556
+ isShown: {
557
+ props: {
558
+ "data-toggle": "countdown",
559
+ "data-countdown": true
560
+ }
561
+ },
562
+ fields: [
563
+ {
564
+ name: "Countdown Timer",
565
+ propsName: "data-countdown",
566
+ type: "DateTimePickerOption"
567
+ }
568
+ ]
569
+ },
570
+ components: [
571
+ {
572
+ name: "Countdown",
573
+ category: "Plugins",
574
+ html: `<h2 class="font-semibold" data-toggle="countdown" data-countdown="${ISODateIn5Days}">
575
+ <span data-countdown-type="days">4</span>
576
+ <span class="opacity-20">:</span>
577
+ <span data-countdown-type="hours">1</span>
578
+ <span class="opacity-20">:</span>
579
+ <span data-countdown-type="minutes">0</span>
580
+ <span class="opacity-20">:</span>
581
+ <span data-countdown-type="seconds">0</span>
582
+ </h2>`
583
+ }
584
+ ]
585
+ });
586
+
587
+ // src/plugins/finisher-header.ts
588
+ var finisher_header_default = defineConfig({
589
+ name: "finisher-header",
590
+ cdnUrls: [
591
+ {
592
+ url: "https://d1pnnwteuly8z3.cloudfront.net/js/finisher-header.es5.min.js",
593
+ defer: true
594
+ }
595
+ ],
596
+ js: `document.querySelectorAll('.finisher-header').forEach(elem => {
597
+ let options = window.vGetElementOptions(elem);
598
+ new FinisherHeader(options);
599
+ });`,
600
+ checks: [{ html: "finisher-header" }],
601
+ components: [
602
+ {
603
+ name: "Finisher Header",
604
+ category: "Plugins",
605
+ 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>`
606
+ }
607
+ ]
608
+ });
609
+
610
+ // src/plugins/taos.ts
611
+ 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})}();`;
612
+ var taos_default = defineConfig({
613
+ name: "taos",
614
+ css: `
615
+ html.js :where([class*="taos:"]:not(.taos-init)) {
616
+ visibility: hidden;
617
+ }`,
618
+ js: js4,
619
+ checks: [{ plugin: "taos" }, { html: "taos:" }],
620
+ safelist: ["!duration-[0ms]", "!delay-[0ms]"]
621
+ });
622
+
623
+ // src/plugins/tailtip.ts
624
+ var js5 = `window.vTailtips = [];
625
+
626
+ window.vGetElementsByToggle('tooltip').forEach((elem) => {
627
+ const tailtip = Tailtip(elem, window.vGetElementOptions(elem));
628
+ window.vTailtips.push(tailtip);
629
+ });`;
630
+ var tailtip_default = defineConfig({
631
+ name: "tailtip",
632
+ src: "https://d1pnnwteuly8z3.cloudfront.net/libs/tailtip/1.0.3/tailtip.js",
633
+ cdnUrls: [
634
+ {
635
+ url: "https://d1pnnwteuly8z3.cloudfront.net/libs/tailtip/1.0.3/tailtip.js",
636
+ defer: true
637
+ }
638
+ ],
639
+ js: js5,
640
+ checks: [{ plugin: "tailtip" }],
641
+ components: [
642
+ {
643
+ name: "Info Tooltip",
644
+ category: "Plugins",
645
+ 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>
646
+ <div class="tooltip" role="tooltip">
647
+ <div class="tooltip-inner">
648
+ <span>This is a tooltip that is shown when hovered or clicked.</span>
649
+ </div>
650
+ <div class="tooltip-arrow"></div>
651
+ </div>`
652
+ }
653
+ ],
654
+ options: {
655
+ name: "Tailtip Options",
656
+ // isShown: (element) => element['data-toggle'] === 'tooltip',
657
+ isShown: {
658
+ props: {
659
+ "data-toggle": "tooltip"
660
+ }
661
+ },
662
+ previewInEditor: true,
663
+ fields: [
664
+ {
665
+ name: "tailtip",
666
+ type: "TailtipOption"
667
+ },
668
+ {
669
+ name: "Placement",
670
+ propsName: "data-options.placement",
671
+ type: "DropdownPropOption",
672
+ inline: true,
673
+ noneDisplayValue: "Default",
674
+ options: [false, "top", "bottom", "left", "right"]
675
+ }
676
+ ]
677
+ }
678
+ });
679
+
680
+ // src/plugins/versoly-marquee.ts
681
+ var src = "https://d1pnnwteuly8z3.cloudfront.net/libs/versoly-marquee/0.0.2/versoly-marquee.iife.js";
682
+ var versoly_marquee_default = defineConfig({
683
+ name: "versoly-marquee",
684
+ options: {
685
+ name: "Marquee",
686
+ js: `window.vMarquees = [];
687
+ window.vGetElementsByToggle('marquee').forEach((elem) => {
688
+ const marquee = new Marquee(elem, window.vGetElementOptions(elem));
689
+ window.vMarquees.push(marquee);
690
+ });`,
691
+ previewInEditor: true,
692
+ isShown: {
693
+ props: {
694
+ "data-toggle": "marquee"
695
+ }
696
+ },
697
+ fields: [
698
+ {
699
+ name: "Loop",
700
+ type: "BooleanPropOption",
701
+ propsName: "data-options.loop",
702
+ defaultValue: true,
703
+ enabledValue: true,
704
+ inHeaderAction: true,
705
+ headerGroup: "Core"
706
+ },
707
+ {
708
+ name: "Duration",
709
+ type: "SliderPropOption",
710
+ propsName: "data-options.duration",
711
+ min: 1,
712
+ max: 20,
713
+ stepSize: 1,
714
+ defaultValue: 5
715
+ },
716
+ {
717
+ name: "Direction",
718
+ type: "IconButtonOption",
719
+ propsName: "data-options.direction",
720
+ options: ["ltr", "rtl", "ttb", "btt"],
721
+ defaultValue: "ltr"
722
+ },
723
+ {
724
+ name: "Pauseable",
725
+ type: "BooleanPropOption",
726
+ propsName: "data-options.pauseable",
727
+ defaultValue: true
728
+ },
729
+ {
730
+ name: "Iterations",
731
+ type: "SliderPropOption",
732
+ propsName: "data-options.iterations",
733
+ min: 1,
734
+ max: 5,
735
+ stepSize: 1,
736
+ defaultValue: 1,
737
+ enabledValue: 1,
738
+ inHeaderAction: true,
739
+ headerGroup: "Core"
740
+ }
741
+ ]
742
+ },
743
+ checks: [{ plugin: "marquee" }],
744
+ src,
745
+ cdnUrls: [
746
+ {
747
+ url: src,
748
+ defer: true
749
+ }
750
+ ],
751
+ displayNames: [
752
+ {
753
+ displayName: "Marquee",
754
+ property: "data-toggle",
755
+ value: "marquee"
756
+ }
757
+ ]
758
+ });
759
+
760
+ // src/plugins/versoly-ui.ts
761
+ var versoly_ui_default = defineConfig({
762
+ name: "versoly-ui",
763
+ cdnUrls: [
764
+ {
765
+ url: "https://d1pnnwteuly8z3.cloudfront.net/libs/floating-ui/1.0.1/floating-ui.min.js",
766
+ defer: true
767
+ },
768
+ {
769
+ url: "https://d1pnnwteuly8z3.cloudfront.net/libs/versoly-ui/2.1.1/versoly-ui.js",
770
+ delay: true
771
+ }
772
+ ]
773
+ });
774
+
775
+ // src/plugins/versoly-analytics.ts
776
+ var js6 = `!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'});`;
777
+ var versoly_analytics_default = defineConfig({
778
+ name: "Versoly Analytics",
779
+ js: js6,
780
+ checks: [{ html: "/api/event" }]
781
+ });
782
+
783
+ // src/plugins/versoly-events.ts
784
+ var versoly_events_default = defineConfig({
785
+ name: "versoly-events",
786
+ js: `const eventElements = document.querySelectorAll('[data-eventid]');
787
+ for (const eventElement of eventElements) {
788
+ if (eventElement.tagName !== 'FORM') {
789
+ eventElement.addEventListener('click', function(e) {
790
+ const eventName = eventElement.getAttribute('data-eventid');
791
+
792
+ if (window.versoly) {
793
+ window.versoly.event({name: eventName})
794
+ }
795
+ if (window.gtag) {
796
+ window.gtag('event', eventName)
797
+ }
798
+ if (window.amplitude) {
799
+ window.amplitude.getInstance().logEvent(event);
800
+ }
801
+ })
802
+ }
803
+ }`,
804
+ checks: [{ html: "data-eventid" }]
805
+ });
806
+
807
+ // src/plugins/versoly-form.ts
808
+ var versoly_form_default = defineConfig({
809
+ name: "versoly-form",
810
+ checks: [{ plugin: "formid" }],
811
+ js: `window.vPageLoadedAt = Date.now();
812
+ window.vForms = window.vForms || {};
813
+
814
+ setTimeout(() => {
815
+ let inputs = [...document.getElementsByTagName("input")]
816
+ inputs.forEach(i => {
817
+ if (i.name === 'email_second' || i.name === 'name_second') {
638
818
  i.setAttribute('aria-hidden', 'true')
639
819
  i.setAttribute('tabindex', '-1')
640
820
  i.setAttribute('autocomplete', 'false')
@@ -781,252 +961,45 @@ window.addFormListener && window.addFormListener()
781
961
  `
782
962
  });
783
963
 
784
- // src/plugins/countup.ts
785
- var countup = defineConfig({
786
- name: "Countup",
787
- cdnUrls: [
788
- {
789
- url: "https://cdnjs.cloudflare.com/ajax/libs/scrollReveal.js/3.4.0/scrollreveal.min.js"
790
- },
791
- {
792
- url: "https://cdnjs.cloudflare.com/ajax/libs/countup.js/2.0.8/countUp.umd.min.js"
793
- }
794
- ],
795
- js: `window.scrollReveal = ScrollReveal();
796
-
797
- window.countStart = e => {
798
- var startVal = e.dataset.from ? +e.dataset.from : 0
799
- ,endVal = e.dataset.to ? +e.dataset.to : 0
800
- ,duration = e.dataset.duration ? +e.dataset.duration : 2
801
- ,options = e.dataset.options ? JSON.parse(e.dataset.options) : {}
802
- const up = new countUp.CountUp(e, endVal, {...options, startVal, duration});
803
- up.start()
804
- }
805
-
806
- window.vGetElementsByToggle('countup').forEach(e => {
807
- scrollReveal.reveal(e, {beforeReveal: window.countStart, duration: 0});
808
- });`,
809
- checks: [{ plugin: "countup" }],
810
- options: {
811
- name: "Countup Options",
812
- isShown: {
813
- props: {
814
- "data-toggle": "countup"
815
- }
816
- },
817
- fields: [
818
- {
819
- name: "Count From",
820
- propsName: "data-from",
821
- type: "NumberOption"
822
- },
823
- {
824
- name: "Count To",
825
- propsName: "data-to",
826
- type: "NumberOption"
827
- },
828
- {
829
- name: "Duration",
830
- propsName: "data-duration",
831
- type: "NumberOption",
832
- placeholder: "2",
833
- stepSize: 0.1
834
- },
835
- {
836
- name: "Countup when Visible",
837
- propsName: "data-aos",
838
- options: [false, true],
839
- type: "BooleanPropOption",
840
- defaultValue: false
841
- }
842
- ]
843
- },
844
- components: [
845
- {
846
- name: "Countup",
847
- category: "Plugins",
848
- html: `<h2 data-toggle="countup" data-aos data-aos-id="countup:in" data-from="100" data-to="800">100</h2>`
849
- }
850
- ]
851
- });
852
-
853
- // src/plugins/countdown.ts
854
- var js6 = `window.vGetElementsByToggle('countdown').forEach(e => {
855
- const deadline = new Date(e.dataset.countdown).getTime();
856
-
857
- const daysEl = e.querySelector('[data-countdown-type="days"]'),
858
- hoursEl = e.querySelector('[data-countdown-type="hours"]'),
859
- minutesEl = e.querySelector('[data-countdown-type="minutes"]'),
860
- secondsEl = e.querySelector('[data-countdown-type="seconds"]');
964
+ // src/plugins/versoly-modal.ts
965
+ var versoly_modal_default = defineConfig({
966
+ name: "versoly-modal",
967
+ js: `window.vGetElementsByToggle('modal').forEach(elem => {
968
+ let options = window.vGetElementOptions(elem);
861
969
 
862
- const countdownFunc = () => {
863
- const now = new Date().getTime();
864
- let t = deadline - now;
970
+ if (options.globalBlockId && window.vComponents[options.globalBlockId]) {
971
+ elem.dataset.html = window.vComponents[options.globalBlockId];
865
972
 
866
- if (t < 0) {
867
- clearInterval(x);
868
- t = 0;
973
+ if (window.vComponents[options.globalBlockId].includes('data-formid')) {
974
+ options.beforeShown = 'addFormListener'
869
975
  }
870
-
871
- let seconds = ''+Math.floor((t / 1000) % 60),
872
- minutes = ''+Math.floor((t / 1000 / 60) % 60),
873
- hours = ''+Math.floor((t / (1000 * 60 * 60)) % 24),
874
- days = ''+Math.floor(t / (1000 * 60 * 60 * 24));
875
-
876
- if (seconds.length === 1) seconds = '0' + seconds;
877
- if (minutes.length === 1) minutes = '0' + minutes;
878
- if (hours.length === 1) hours = '0' + hours;
879
- if (days.length === 1) days = '0' + days;
880
-
881
- if (secondsEl) secondsEl.innerHTML = seconds;
882
- if (minutesEl) minutesEl.innerHTML = minutes;
883
- if (hoursEl) hoursEl.innerHTML = hours;
884
- if (daysEl) daysEl.innerHTML = days;
885
- }
886
-
887
- var x = setInterval(countdownFunc, 1000);
888
- countdownFunc();
889
- })
890
- `;
891
- var currentDate = /* @__PURE__ */ new Date();
892
- var ISODateIn5Days = new Date(currentDate.getTime() + 5 * 24 * 60 * 60 * 1234).toISOString();
893
- var countdown = defineConfig({
894
- name: "Countdown Options",
895
- js: js6,
896
- checks: [{ plugin: "countdown" }],
897
- options: {
898
- name: "Countdown",
899
- isShown: {
900
- props: {
901
- "data-toggle": "countdown",
902
- "data-countdown": true
903
- }
904
- },
905
- fields: [
906
- {
907
- name: "Countdown Timer",
908
- propsName: "data-countdown",
909
- type: "DateTimePickerOption"
910
- }
911
- ]
912
- },
913
- components: [
914
- {
915
- name: "Countdown",
916
- category: "Plugins",
917
- html: `<h2 class="font-semibold" data-toggle="countdown" data-countdown="${ISODateIn5Days}">
918
- <span data-countdown-type="days">4</span>
919
- <span class="opacity-20">:</span>
920
- <span data-countdown-type="hours">1</span>
921
- <span class="opacity-20">:</span>
922
- <span data-countdown-type="minutes">0</span>
923
- <span class="opacity-20">:</span>
924
- <span data-countdown-type="seconds">0</span>
925
- </h2>`
926
- }
927
- ]
928
- });
929
-
930
- // src/plugins/calendly.ts
931
- var calendly = defineConfig({
932
- name: "Calendly",
933
- cdnUrls: [
934
- {
935
- url: "https://assets.calendly.com/assets/external/widget.js",
936
- delay: true
937
- },
938
- {
939
- url: "https://assets.calendly.com/assets/external/widget.css",
940
- delay: true
941
- }
942
- ],
943
- js: `
944
- document.querySelectorAll('[data-calendly-url]').forEach(a => {
945
- const url = a.getAttribute('data-calendly-url')
946
-
947
- if (!url) {
948
- return;
949
976
  }
950
977
 
951
- a.addEventListener('click', e => {
952
- e.preventDefault();
953
- window.Calendly.initPopupWidget({ url, parentElement: a})
954
- })
955
- });`,
956
- checks: [{ plugin: "calendly" }, { html: "calendly" }],
957
- options: {
958
- name: "Calendly Options",
959
- isShown: {
960
- props: {
961
- "data-calendly-url": true
962
- }
963
- },
964
- fields: [
965
- {
966
- name: "Calendly Url",
967
- propsName: "data-calendly-url",
968
- type: "TextOption"
969
- }
970
- ]
971
- }
972
- });
973
-
974
- // src/plugins/versolyUI.ts
975
- var versolyUI = defineConfig({
976
- name: "Versoly UI",
977
- cdnUrls: [
978
- {
979
- url: "https://d1pnnwteuly8z3.cloudfront.net/libs/floating-ui/1.0.1/floating-ui.min.js",
980
- defer: true
981
- },
982
- {
983
- url: "https://d1pnnwteuly8z3.cloudfront.net/libs/versoly-ui/2.1.1/versoly-ui.js",
984
- delay: true
985
- }
986
- ]
987
- });
988
-
989
- // src/plugins/finisherHeader.ts
990
- var finisherHeader = defineConfig({
991
- name: "Finisher Header",
992
- cdnUrls: [
993
- {
994
- url: "https://d1pnnwteuly8z3.cloudfront.net/js/finisher-header.es5.min.js",
995
- defer: true
996
- }
997
- ],
998
- js: `document.querySelectorAll('.finisher-header').forEach(elem => {
999
- let options = window.vGetElementOptions(elem);
1000
- new FinisherHeader(options);
978
+ elem.dataset.options = JSON.stringify(options);
1001
979
  });`,
1002
- checks: [{ html: "finisher-header" }],
1003
- components: [
1004
- {
1005
- name: "Finisher Header",
1006
- category: "Plugins",
1007
- 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>`
1008
- }
1009
- ]
980
+ checks: [{ plugin: "modal" }]
1010
981
  });
1011
982
 
1012
983
  // src/plugins/index.ts
1013
984
  var plugins = {
1014
- headroom,
1015
- marquee,
1016
- swiper,
1017
- prism,
1018
- tailtip,
1019
- taos,
1020
- tilt,
1021
- typed,
1022
- modal,
1023
- form,
1024
- finisherHeader,
1025
- countup,
1026
- countdown,
1027
- eventAnalytics,
1028
- versolyAnalytics,
1029
- versolyUI,
1030
- calendly
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
1031
1004
  };
1032
1005
  })();