v-onboarding 2.10.2 → 2.12.0

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/README.md CHANGED
@@ -9,6 +9,7 @@ A fully-typed, customizable onboarding component for Vue 3
9
9
  [![Version](https://img.shields.io/npm/v/v-onboarding.svg?style=flat-square)](https://www.npmjs.com/package/v-onboarding)
10
10
  [![License](https://img.shields.io/npm/l/v-onboarding.svg?style=flat-square)](https://www.npmjs.com/package/v-onboarding)
11
11
  [![Downloads](https://img.shields.io/npm/dm/v-onboarding.svg?style=flat-square)](https://www.npmjs.com/package/v-onboarding)
12
+ [![Nuxt](https://img.shields.io/badge/Nuxt-00DC82?style=flat-square&logo=nuxt.js&logoColor=white)](https://v-onboarding-docs.fatihsolhan.com/guide/nuxt)
12
13
 
13
14
  [Demo](https://v-onboarding.fatihsolhan.com/) · [Documentation](https://v-onboarding-docs.fatihsolhan.com/)
14
15
 
@@ -40,6 +41,19 @@ yarn add v-onboarding
40
41
  pnpm add v-onboarding
41
42
  ```
42
43
 
44
+ ## Nuxt
45
+
46
+ For Nuxt 3+ applications, use the built-in module:
47
+
48
+ ```ts
49
+ // nuxt.config.ts
50
+ export default defineNuxtConfig({
51
+ modules: ['v-onboarding/nuxt']
52
+ })
53
+ ```
54
+
55
+ Components, composables, and styles are auto-imported. See the [Nuxt guide](https://v-onboarding-docs.fatihsolhan.com/guide/nuxt) for configuration options.
56
+
43
57
  ## Quick Start
44
58
 
45
59
  ```vue
@@ -71,6 +85,33 @@ const steps = [
71
85
  </template>
72
86
  ```
73
87
 
88
+ ## Using Vue Template Refs
89
+
90
+ You can attach steps to elements using Vue template refs:
91
+
92
+ ```vue
93
+ <script setup lang="ts">
94
+ import { ref } from 'vue'
95
+ import { VOnboardingWrapper } from 'v-onboarding'
96
+ import 'v-onboarding/dist/style.css'
97
+
98
+ const wrapper = ref(null)
99
+ const buttonRef = ref(null)
100
+
101
+ const steps = [
102
+ {
103
+ attachTo: { element: buttonRef },
104
+ content: { title: 'Click me!', description: 'This button uses a template ref.' }
105
+ }
106
+ ]
107
+ </script>
108
+
109
+ <template>
110
+ <VOnboardingWrapper ref="wrapper" :steps="steps" />
111
+ <button ref="buttonRef" @click="wrapper?.start()">Start Tour</button>
112
+ </template>
113
+ ```
114
+
74
115
  ## Custom Step UI
75
116
 
76
117
  Use the default slot to create your own step UI:
@@ -111,7 +152,7 @@ Customize the overlay and tooltips with CSS variables:
111
152
 
112
153
  ## Documentation
113
154
 
114
- For full documentation including all props, events, hooks, and examples, visit the [documentation site](https://docs.v-onboarding.fatihsolhan.com/).
155
+ For full documentation including all props, events, hooks, and examples, visit the [documentation site](https://v-onboarding-docs.fatihsolhan.com/).
115
156
 
116
157
  ## License
117
158
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { createPopper } from "@popperjs/core/lib/createPopper";
2
- import type { DefineComponent } from 'vue';
2
+ import type { DefineComponent, Ref } from 'vue';
3
3
  declare const VOnboardingWrapper: DefineComponent<{
4
4
  steps: StepEntity[];
5
5
  options?: VOnboardingWrapperOptions;
@@ -46,7 +46,7 @@ interface VOnboardingWrapperOptions {
46
46
  };
47
47
  hideNextStepDuringHook?: boolean;
48
48
  }
49
- type AttachableElement = string | (() => Element | null);
49
+ type AttachableElement = string | (() => Element | null) | Ref<Element | null | undefined>;
50
50
  interface onGlobalOptions {
51
51
  index: number;
52
52
  step: StepEntity;
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ const kit = require('@nuxt/kit');
4
+
5
+ const module$1 = kit.defineNuxtModule({
6
+ meta: {
7
+ name: "v-onboarding",
8
+ configKey: "vOnboarding",
9
+ compatibility: {
10
+ nuxt: ">=3.0.0"
11
+ }
12
+ },
13
+ defaults: {
14
+ components: true,
15
+ composables: true,
16
+ css: true
17
+ },
18
+ setup(options, nuxt) {
19
+ if (options.css) {
20
+ nuxt.options.css.push("v-onboarding/dist/style.css");
21
+ }
22
+ if (options.components) {
23
+ kit.addComponent({
24
+ name: "VOnboardingWrapper",
25
+ filePath: "v-onboarding",
26
+ export: "VOnboardingWrapper",
27
+ mode: "client"
28
+ });
29
+ kit.addComponent({
30
+ name: "VOnboardingStep",
31
+ filePath: "v-onboarding",
32
+ export: "VOnboardingStep",
33
+ mode: "client"
34
+ });
35
+ }
36
+ if (options.composables) {
37
+ kit.addImports({
38
+ name: "useVOnboarding",
39
+ as: "useVOnboarding",
40
+ from: "v-onboarding"
41
+ });
42
+ }
43
+ }
44
+ });
45
+
46
+ module.exports = module$1;
@@ -0,0 +1,13 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ interface ModuleOptions {
4
+ /** @default true */
5
+ components?: boolean;
6
+ /** @default true */
7
+ composables?: boolean;
8
+ /** @default true */
9
+ css?: boolean;
10
+ }
11
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
12
+
13
+ export { ModuleOptions, _default as default };
@@ -0,0 +1,44 @@
1
+ import { defineNuxtModule, addComponent, addImports } from '@nuxt/kit';
2
+
3
+ const module = defineNuxtModule({
4
+ meta: {
5
+ name: "v-onboarding",
6
+ configKey: "vOnboarding",
7
+ compatibility: {
8
+ nuxt: ">=3.0.0"
9
+ }
10
+ },
11
+ defaults: {
12
+ components: true,
13
+ composables: true,
14
+ css: true
15
+ },
16
+ setup(options, nuxt) {
17
+ if (options.css) {
18
+ nuxt.options.css.push("v-onboarding/dist/style.css");
19
+ }
20
+ if (options.components) {
21
+ addComponent({
22
+ name: "VOnboardingWrapper",
23
+ filePath: "v-onboarding",
24
+ export: "VOnboardingWrapper",
25
+ mode: "client"
26
+ });
27
+ addComponent({
28
+ name: "VOnboardingStep",
29
+ filePath: "v-onboarding",
30
+ export: "VOnboardingStep",
31
+ mode: "client"
32
+ });
33
+ }
34
+ if (options.composables) {
35
+ addImports({
36
+ name: "useVOnboarding",
37
+ as: "useVOnboarding",
38
+ from: "v-onboarding"
39
+ });
40
+ }
41
+ }
42
+ });
43
+
44
+ export { module as default };
@@ -1,4 +1,4 @@
1
- import { getCurrentScope, onScopeDispose, unref, ref, watch, onMounted, onUnmounted, defineComponent, inject, computed, nextTick, onBeforeUnmount, withDirectives, openBlock, createElementBlock, normalizeStyle, createElementVNode, renderSlot, toDisplayString, createCommentVNode, vShow, provide, createBlock } from "vue";
1
+ import { getCurrentScope, onScopeDispose, unref, ref, watch, isRef, onMounted, onUnmounted, defineComponent, inject, computed, nextTick, onBeforeUnmount, withDirectives, openBlock, createElementBlock, normalizeStyle, createElementVNode, renderSlot, toDisplayString, createCommentVNode, vShow, provide, createBlock } from "vue";
2
2
  import { createPopper } from "@popperjs/core";
3
3
  import { createFocusTrap } from "focus-trap";
4
4
  const STATE_INJECT_KEY = Symbol("onboardingState");
@@ -769,6 +769,10 @@ function querySelectorDeep(selector, root = document) {
769
769
  return null;
770
770
  }
771
771
  function useGetElement(element) {
772
+ var _a;
773
+ if (isRef(element)) {
774
+ return (_a = element.value) != null ? _a : null;
775
+ }
772
776
  if (typeof element === "string") {
773
777
  const found = document.querySelector(element);
774
778
  if (found)
@@ -1,4 +1,4 @@
1
- (function(F,r){typeof exports=="object"&&typeof module!="undefined"?r(exports,require("vue"),require("@popperjs/core"),require("focus-trap")):typeof define=="function"&&define.amd?define(["exports","vue","@popperjs/core","focus-trap"],r):(F=typeof globalThis!="undefined"?globalThis:F||self,r(F["v-onboarding"]={},F.Vue,F.core,F.focusTrap))})(this,function(F,r,ae,se){"use strict";const $t=Symbol("onboardingState"),jt={IDLE:-1,FINISHED:-2},H={BACKWARD:-1,FORWARD:1};function le(o){return r.getCurrentScope()?(r.onScopeDispose(o),!0):!1}function ce(o){return typeof o=="function"?o():r.unref(o)}typeof WorkerGlobalScope!="undefined"&&globalThis instanceof WorkerGlobalScope;function ue(o){var u;const l=ce(o);return(u=l==null?void 0:l.$el)!=null?u:l}function fe(o,u={}){let l;const{immediate:g,...d}=u,a=r.ref(!1),w=r.ref(!1),b=E=>l&&l.activate(E),D=E=>l&&l.deactivate(E),V=()=>{l&&(l.pause(),w.value=!0)},$=()=>{l&&(l.unpause(),w.value=!1)};return r.watch(()=>ue(o),E=>{!E||(l=se.createFocusTrap(E,{...d,onActivate(){a.value=!0,u.onActivate&&u.onActivate()},onDeactivate(){a.value=!1,u.onDeactivate&&u.onDeactivate()}}),g&&b())},{flush:"post"}),le(()=>D()),{hasFocus:a,isPaused:w,activate:b,deactivate:D,pause:V,unpause:$}}var st=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},vt={exports:{}};(function(o,u){var l=200,g="__lodash_hash_undefined__",d=800,a=16,w=9007199254740991,b="[object Arguments]",D="[object Array]",V="[object AsyncFunction]",$="[object Boolean]",E="[object Date]",P="[object Error]",O="[object Function]",B="[object GeneratorFunction]",R="[object Map]",k="[object Number]",Q="[object Null]",M="[object Object]",Z="[object Proxy]",U="[object RegExp]",J="[object Set]",Y="[object String]",X="[object Undefined]",h="[object WeakMap]",i="[object ArrayBuffer]",c="[object DataView]",y="[object Float32Array]",v="[object Float64Array]",T="[object Int8Array]",A="[object Int16Array]",C="[object Int32Array]",N="[object Uint8Array]",W="[object Uint8ClampedArray]",Ee="[object Uint16Array]",Ce="[object Uint32Array]",Ie=/[\\^$.*+?()[\]{}|]/g,De=/^\[object .+?Constructor\]$/,$e=/^(?:0|[1-9]\d*)$/,_={};_[y]=_[v]=_[T]=_[A]=_[C]=_[N]=_[W]=_[Ee]=_[Ce]=!0,_[b]=_[D]=_[i]=_[$]=_[c]=_[E]=_[P]=_[O]=_[R]=_[k]=_[M]=_[U]=_[J]=_[Y]=_[h]=!1;var Vt=typeof st=="object"&&st&&st.Object===Object&&st,je=typeof self=="object"&&self&&self.Object===Object&&self,nt=Vt||je||Function("return this")(),Pt=u&&!u.nodeType&&u,rt=Pt&&!0&&o&&!o.nodeType&&o,Mt=rt&&rt.exports===Pt,_t=Mt&&Vt.process,Lt=function(){try{var t=rt&&rt.require&&rt.require("util").types;return t||_t&&_t.binding&&_t.binding("util")}catch{}}(),zt=Lt&&Lt.isTypedArray;function Fe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ne(t,e){for(var n=-1,s=Array(t);++n<t;)s[n]=e(n);return s}function Ve(t){return function(e){return t(e)}}function Pe(t,e){return t==null?void 0:t[e]}function Me(t,e){return function(n){return t(e(n))}}var Le=Array.prototype,ze=Function.prototype,ct=Object.prototype,Tt=nt["__core-js_shared__"],ut=ze.toString,L=ct.hasOwnProperty,Rt=function(){var t=/[^.]+$/.exec(Tt&&Tt.keys&&Tt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ht=ct.toString,Re=ut.call(Object),He=RegExp("^"+ut.call(L).replace(Ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ft=Mt?nt.Buffer:void 0,kt=nt.Symbol,Ut=nt.Uint8Array,Wt=ft?ft.allocUnsafe:void 0,Gt=Me(Object.getPrototypeOf,Object),qt=Object.create,ke=ct.propertyIsEnumerable,Ue=Le.splice,G=kt?kt.toStringTag:void 0,pt=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),We=ft?ft.isBuffer:void 0,Kt=Math.max,Ge=Date.now,Qt=wt(nt,"Map"),ot=wt(Object,"create"),qe=function(){function t(){}return function(e){if(!K(e))return{};if(qt)return qt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function q(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function Ke(){this.__data__=ot?ot(null):{},this.size=0}function Qe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Ze(t){var e=this.__data__;if(ot){var n=e[t];return n===g?void 0:n}return L.call(e,t)?e[t]:void 0}function Je(t){var e=this.__data__;return ot?e[t]!==void 0:L.call(e,t)}function Ye(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ot&&e===void 0?g:e,this}q.prototype.clear=Ke,q.prototype.delete=Qe,q.prototype.get=Ze,q.prototype.has=Je,q.prototype.set=Ye;function z(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function Xe(){this.__data__=[],this.size=0}function tn(t){var e=this.__data__,n=dt(e,t);if(n<0)return!1;var s=e.length-1;return n==s?e.pop():Ue.call(e,n,1),--this.size,!0}function en(t){var e=this.__data__,n=dt(e,t);return n<0?void 0:e[n][1]}function nn(t){return dt(this.__data__,t)>-1}function rn(t,e){var n=this.__data__,s=dt(n,t);return s<0?(++this.size,n.push([t,e])):n[s][1]=e,this}z.prototype.clear=Xe,z.prototype.delete=tn,z.prototype.get=en,z.prototype.has=nn,z.prototype.set=rn;function tt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function on(){this.size=0,this.__data__={hash:new q,map:new(Qt||z),string:new q}}function an(t){var e=gt(this,t).delete(t);return this.size-=e?1:0,e}function sn(t){return gt(this,t).get(t)}function ln(t){return gt(this,t).has(t)}function cn(t,e){var n=gt(this,t),s=n.size;return n.set(t,e),this.size+=n.size==s?0:1,this}tt.prototype.clear=on,tt.prototype.delete=an,tt.prototype.get=sn,tt.prototype.has=ln,tt.prototype.set=cn;function et(t){var e=this.__data__=new z(t);this.size=e.size}function un(){this.__data__=new z,this.size=0}function fn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function pn(t){return this.__data__.get(t)}function dn(t){return this.__data__.has(t)}function hn(t,e){var n=this.__data__;if(n instanceof z){var s=n.__data__;if(!Qt||s.length<l-1)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new tt(s)}return n.set(t,e),this.size=n.size,this}et.prototype.clear=un,et.prototype.delete=fn,et.prototype.get=pn,et.prototype.has=dn,et.prototype.set=hn;function gn(t,e){var n=Bt(t),s=!n&&Ot(t),p=!n&&!s&&te(t),m=!n&&!s&&!p&&ne(t),S=n||s||p||m,f=S?Ne(t.length,String):[],x=f.length;for(var j in t)(e||L.call(t,j))&&!(S&&(j=="length"||p&&(j=="offset"||j=="parent")||m&&(j=="buffer"||j=="byteLength"||j=="byteOffset")||Yt(j,x)))&&f.push(j);return f}function St(t,e,n){(n!==void 0&&!bt(t[e],n)||n===void 0&&!(e in t))&&xt(t,e,n)}function bn(t,e,n){var s=t[e];(!(L.call(t,e)&&bt(s,n))||n===void 0&&!(e in t))&&xt(t,e,n)}function dt(t,e){for(var n=t.length;n--;)if(bt(t[n][0],e))return n;return-1}function xt(t,e,n){e=="__proto__"&&pt?pt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var vn=In();function ht(t){return t==null?t===void 0?X:Q:G&&G in Object(t)?Dn(t):Pn(t)}function Zt(t){return it(t)&&ht(t)==b}function mn(t){if(!K(t)||Nn(t))return!1;var e=Ct(t)?He:De;return e.test(Rn(t))}function yn(t){return it(t)&&ee(t.length)&&!!_[ht(t)]}function _n(t){if(!K(t))return Vn(t);var e=Xt(t),n=[];for(var s in t)s=="constructor"&&(e||!L.call(t,s))||n.push(s);return n}function Jt(t,e,n,s,p){t!==e&&vn(e,function(m,S){if(p||(p=new et),K(m))Tn(t,e,S,n,Jt,s,p);else{var f=s?s(At(t,S),m,S+"",t,e,p):void 0;f===void 0&&(f=m),St(t,S,f)}},re)}function Tn(t,e,n,s,p,m,S){var f=At(t,n),x=At(e,n),j=S.get(x);if(j){St(t,n,j);return}var I=m?m(f,x,n+"",t,e,S):void 0,at=I===void 0;if(at){var It=Bt(x),Dt=!It&&te(x),ie=!It&&!Dt&&ne(x);I=x,It||Dt||ie?Bt(f)?I=f:Hn(f)?I=Bn(f):Dt?(at=!1,I=wn(x,!0)):ie?(at=!1,I=On(x,!0)):I=[]:kn(x)||Ot(x)?(I=f,Ot(f)?I=Un(f):(!K(f)||Ct(f))&&(I=$n(x))):at=!1}at&&(S.set(x,I),p(I,x,s,m,S),S.delete(x)),St(t,n,I)}function Sn(t,e){return Ln(Mn(t,e,oe),t+"")}var xn=pt?function(t,e){return pt(t,"toString",{configurable:!0,enumerable:!1,value:Gn(e),writable:!0})}:oe;function wn(t,e){if(e)return t.slice();var n=t.length,s=Wt?Wt(n):new t.constructor(n);return t.copy(s),s}function An(t){var e=new t.constructor(t.byteLength);return new Ut(e).set(new Ut(t)),e}function On(t,e){var n=e?An(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Bn(t,e){var n=-1,s=t.length;for(e||(e=Array(s));++n<s;)e[n]=t[n];return e}function En(t,e,n,s){var p=!n;n||(n={});for(var m=-1,S=e.length;++m<S;){var f=e[m],x=s?s(n[f],t[f],f,n,t):void 0;x===void 0&&(x=t[f]),p?xt(n,f,x):bn(n,f,x)}return n}function Cn(t){return Sn(function(e,n){var s=-1,p=n.length,m=p>1?n[p-1]:void 0,S=p>2?n[2]:void 0;for(m=t.length>3&&typeof m=="function"?(p--,m):void 0,S&&jn(n[0],n[1],S)&&(m=p<3?void 0:m,p=1),e=Object(e);++s<p;){var f=n[s];f&&t(e,f,s,m)}return e})}function In(t){return function(e,n,s){for(var p=-1,m=Object(e),S=s(e),f=S.length;f--;){var x=S[t?f:++p];if(n(m[x],x,m)===!1)break}return e}}function gt(t,e){var n=t.__data__;return Fn(e)?n[typeof e=="string"?"string":"hash"]:n.map}function wt(t,e){var n=Pe(t,e);return mn(n)?n:void 0}function Dn(t){var e=L.call(t,G),n=t[G];try{t[G]=void 0;var s=!0}catch{}var p=Ht.call(t);return s&&(e?t[G]=n:delete t[G]),p}function $n(t){return typeof t.constructor=="function"&&!Xt(t)?qe(Gt(t)):{}}function Yt(t,e){var n=typeof t;return e=e==null?w:e,!!e&&(n=="number"||n!="symbol"&&$e.test(t))&&t>-1&&t%1==0&&t<e}function jn(t,e,n){if(!K(n))return!1;var s=typeof e;return(s=="number"?Et(n)&&Yt(e,n.length):s=="string"&&e in n)?bt(n[e],t):!1}function Fn(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Nn(t){return!!Rt&&Rt in t}function Xt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||ct;return t===n}function Vn(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function Pn(t){return Ht.call(t)}function Mn(t,e,n){return e=Kt(e===void 0?t.length-1:e,0),function(){for(var s=arguments,p=-1,m=Kt(s.length-e,0),S=Array(m);++p<m;)S[p]=s[e+p];p=-1;for(var f=Array(e+1);++p<e;)f[p]=s[p];return f[e]=n(S),Fe(t,this,f)}}function At(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Ln=zn(xn);function zn(t){var e=0,n=0;return function(){var s=Ge(),p=a-(s-n);if(n=s,p>0){if(++e>=d)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Rn(t){if(t!=null){try{return ut.call(t)}catch{}try{return t+""}catch{}}return""}function bt(t,e){return t===e||t!==t&&e!==e}var Ot=Zt(function(){return arguments}())?Zt:function(t){return it(t)&&L.call(t,"callee")&&!ke.call(t,"callee")},Bt=Array.isArray;function Et(t){return t!=null&&ee(t.length)&&!Ct(t)}function Hn(t){return it(t)&&Et(t)}var te=We||qn;function Ct(t){if(!K(t))return!1;var e=ht(t);return e==O||e==B||e==V||e==Z}function ee(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=w}function K(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function it(t){return t!=null&&typeof t=="object"}function kn(t){if(!it(t)||ht(t)!=M)return!1;var e=Gt(t);if(e===null)return!0;var n=L.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ut.call(n)==Re}var ne=zt?Ve(zt):yn;function Un(t){return En(t,re(t))}function re(t){return Et(t)?gn(t,!0):_n(t)}var Wn=Cn(function(t,e,n){Jt(t,e,n)});function Gn(t){return function(){return t}}function oe(t){return t}function qn(){return!1}o.exports=Wn})(vt,vt.exports);var mt=vt.exports;function Ft(o,u=document){const l=u.querySelector(o);if(l)return l;const g=u.querySelectorAll("*");for(const d of g)if(d.shadowRoot){const a=Ft(o,d.shadowRoot);if(a)return a}return null}function yt(o){if(typeof o=="string"){const u=document.querySelector(o);return u||Ft(o)}else if(typeof o=="function")return o();return null}const pe=o=>{var u,l,g,d;return typeof o=="number"?{top:o,right:o,bottom:o,left:o}:{top:(u=o==null?void 0:o.top)!=null?u:0,right:(l=o==null?void 0:o.right)!=null?l:0,bottom:(g=o==null?void 0:o.bottom)!=null?g:0,left:(d=o==null?void 0:o.left)!=null?d:0}},de=o=>{var u,l,g,d;return typeof o=="number"?{leftTop:o,rightTop:o,rightBottom:o,leftBottom:o}:{leftTop:(u=o==null?void 0:o.leftTop)!=null?u:0,rightTop:(l=o==null?void 0:o.rightTop)!=null?l:0,rightBottom:(g=o==null?void 0:o.rightBottom)!=null?g:0,leftBottom:(d=o==null?void 0:o.leftBottom)!=null?d:0}},he=(o,u,l)=>{const{innerWidth:g,innerHeight:d}=window,a={top:o.top-u.top,right:o.left+o.width+u.right,bottom:o.top+o.height+u.bottom,left:o.left-u.left},w=Math.min((a.right-a.left)/2,(a.bottom-a.top)/2),b={lt:Math.min(l.leftTop,w),rt:Math.min(l.rightTop,w),rb:Math.min(l.rightBottom,w),lb:Math.min(l.leftBottom,w)};return`
1
+ (function(F,r){typeof exports=="object"&&typeof module!="undefined"?r(exports,require("vue"),require("@popperjs/core"),require("focus-trap")):typeof define=="function"&&define.amd?define(["exports","vue","@popperjs/core","focus-trap"],r):(F=typeof globalThis!="undefined"?globalThis:F||self,r(F["v-onboarding"]={},F.Vue,F.core,F.focusTrap))})(this,function(F,r,ae,se){"use strict";const $t=Symbol("onboardingState"),jt={IDLE:-1,FINISHED:-2},H={BACKWARD:-1,FORWARD:1};function le(o){return r.getCurrentScope()?(r.onScopeDispose(o),!0):!1}function ce(o){return typeof o=="function"?o():r.unref(o)}typeof WorkerGlobalScope!="undefined"&&globalThis instanceof WorkerGlobalScope;function ue(o){var u;const l=ce(o);return(u=l==null?void 0:l.$el)!=null?u:l}function fe(o,u={}){let l;const{immediate:g,...d}=u,a=r.ref(!1),w=r.ref(!1),b=E=>l&&l.activate(E),D=E=>l&&l.deactivate(E),V=()=>{l&&(l.pause(),w.value=!0)},$=()=>{l&&(l.unpause(),w.value=!1)};return r.watch(()=>ue(o),E=>{!E||(l=se.createFocusTrap(E,{...d,onActivate(){a.value=!0,u.onActivate&&u.onActivate()},onDeactivate(){a.value=!1,u.onDeactivate&&u.onDeactivate()}}),g&&b())},{flush:"post"}),le(()=>D()),{hasFocus:a,isPaused:w,activate:b,deactivate:D,pause:V,unpause:$}}var st=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},vt={exports:{}};(function(o,u){var l=200,g="__lodash_hash_undefined__",d=800,a=16,w=9007199254740991,b="[object Arguments]",D="[object Array]",V="[object AsyncFunction]",$="[object Boolean]",E="[object Date]",P="[object Error]",O="[object Function]",B="[object GeneratorFunction]",R="[object Map]",k="[object Number]",Q="[object Null]",M="[object Object]",Z="[object Proxy]",U="[object RegExp]",J="[object Set]",Y="[object String]",X="[object Undefined]",h="[object WeakMap]",i="[object ArrayBuffer]",c="[object DataView]",y="[object Float32Array]",v="[object Float64Array]",T="[object Int8Array]",A="[object Int16Array]",C="[object Int32Array]",N="[object Uint8Array]",W="[object Uint8ClampedArray]",Ee="[object Uint16Array]",Ce="[object Uint32Array]",Ie=/[\\^$.*+?()[\]{}|]/g,De=/^\[object .+?Constructor\]$/,$e=/^(?:0|[1-9]\d*)$/,_={};_[y]=_[v]=_[T]=_[A]=_[C]=_[N]=_[W]=_[Ee]=_[Ce]=!0,_[b]=_[D]=_[i]=_[$]=_[c]=_[E]=_[P]=_[O]=_[R]=_[k]=_[M]=_[U]=_[J]=_[Y]=_[h]=!1;var Vt=typeof st=="object"&&st&&st.Object===Object&&st,je=typeof self=="object"&&self&&self.Object===Object&&self,nt=Vt||je||Function("return this")(),Pt=u&&!u.nodeType&&u,rt=Pt&&!0&&o&&!o.nodeType&&o,Mt=rt&&rt.exports===Pt,_t=Mt&&Vt.process,Lt=function(){try{var t=rt&&rt.require&&rt.require("util").types;return t||_t&&_t.binding&&_t.binding("util")}catch{}}(),zt=Lt&&Lt.isTypedArray;function Fe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ne(t,e){for(var n=-1,s=Array(t);++n<t;)s[n]=e(n);return s}function Ve(t){return function(e){return t(e)}}function Pe(t,e){return t==null?void 0:t[e]}function Me(t,e){return function(n){return t(e(n))}}var Le=Array.prototype,ze=Function.prototype,ct=Object.prototype,Tt=nt["__core-js_shared__"],ut=ze.toString,L=ct.hasOwnProperty,Rt=function(){var t=/[^.]+$/.exec(Tt&&Tt.keys&&Tt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ht=ct.toString,Re=ut.call(Object),He=RegExp("^"+ut.call(L).replace(Ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ft=Mt?nt.Buffer:void 0,kt=nt.Symbol,Ut=nt.Uint8Array,Wt=ft?ft.allocUnsafe:void 0,Gt=Me(Object.getPrototypeOf,Object),qt=Object.create,ke=ct.propertyIsEnumerable,Ue=Le.splice,G=kt?kt.toStringTag:void 0,pt=function(){try{var t=wt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),We=ft?ft.isBuffer:void 0,Kt=Math.max,Ge=Date.now,Qt=wt(nt,"Map"),ot=wt(Object,"create"),qe=function(){function t(){}return function(e){if(!K(e))return{};if(qt)return qt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function q(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function Ke(){this.__data__=ot?ot(null):{},this.size=0}function Qe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Ze(t){var e=this.__data__;if(ot){var n=e[t];return n===g?void 0:n}return L.call(e,t)?e[t]:void 0}function Je(t){var e=this.__data__;return ot?e[t]!==void 0:L.call(e,t)}function Ye(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ot&&e===void 0?g:e,this}q.prototype.clear=Ke,q.prototype.delete=Qe,q.prototype.get=Ze,q.prototype.has=Je,q.prototype.set=Ye;function z(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function Xe(){this.__data__=[],this.size=0}function tn(t){var e=this.__data__,n=dt(e,t);if(n<0)return!1;var s=e.length-1;return n==s?e.pop():Ue.call(e,n,1),--this.size,!0}function en(t){var e=this.__data__,n=dt(e,t);return n<0?void 0:e[n][1]}function nn(t){return dt(this.__data__,t)>-1}function rn(t,e){var n=this.__data__,s=dt(n,t);return s<0?(++this.size,n.push([t,e])):n[s][1]=e,this}z.prototype.clear=Xe,z.prototype.delete=tn,z.prototype.get=en,z.prototype.has=nn,z.prototype.set=rn;function tt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function on(){this.size=0,this.__data__={hash:new q,map:new(Qt||z),string:new q}}function an(t){var e=gt(this,t).delete(t);return this.size-=e?1:0,e}function sn(t){return gt(this,t).get(t)}function ln(t){return gt(this,t).has(t)}function cn(t,e){var n=gt(this,t),s=n.size;return n.set(t,e),this.size+=n.size==s?0:1,this}tt.prototype.clear=on,tt.prototype.delete=an,tt.prototype.get=sn,tt.prototype.has=ln,tt.prototype.set=cn;function et(t){var e=this.__data__=new z(t);this.size=e.size}function un(){this.__data__=new z,this.size=0}function fn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function pn(t){return this.__data__.get(t)}function dn(t){return this.__data__.has(t)}function hn(t,e){var n=this.__data__;if(n instanceof z){var s=n.__data__;if(!Qt||s.length<l-1)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new tt(s)}return n.set(t,e),this.size=n.size,this}et.prototype.clear=un,et.prototype.delete=fn,et.prototype.get=pn,et.prototype.has=dn,et.prototype.set=hn;function gn(t,e){var n=Bt(t),s=!n&&Ot(t),p=!n&&!s&&te(t),m=!n&&!s&&!p&&ne(t),S=n||s||p||m,f=S?Ne(t.length,String):[],x=f.length;for(var j in t)(e||L.call(t,j))&&!(S&&(j=="length"||p&&(j=="offset"||j=="parent")||m&&(j=="buffer"||j=="byteLength"||j=="byteOffset")||Yt(j,x)))&&f.push(j);return f}function St(t,e,n){(n!==void 0&&!bt(t[e],n)||n===void 0&&!(e in t))&&xt(t,e,n)}function bn(t,e,n){var s=t[e];(!(L.call(t,e)&&bt(s,n))||n===void 0&&!(e in t))&&xt(t,e,n)}function dt(t,e){for(var n=t.length;n--;)if(bt(t[n][0],e))return n;return-1}function xt(t,e,n){e=="__proto__"&&pt?pt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var vn=In();function ht(t){return t==null?t===void 0?X:Q:G&&G in Object(t)?Dn(t):Pn(t)}function Zt(t){return it(t)&&ht(t)==b}function mn(t){if(!K(t)||Nn(t))return!1;var e=Ct(t)?He:De;return e.test(Rn(t))}function yn(t){return it(t)&&ee(t.length)&&!!_[ht(t)]}function _n(t){if(!K(t))return Vn(t);var e=Xt(t),n=[];for(var s in t)s=="constructor"&&(e||!L.call(t,s))||n.push(s);return n}function Jt(t,e,n,s,p){t!==e&&vn(e,function(m,S){if(p||(p=new et),K(m))Tn(t,e,S,n,Jt,s,p);else{var f=s?s(At(t,S),m,S+"",t,e,p):void 0;f===void 0&&(f=m),St(t,S,f)}},re)}function Tn(t,e,n,s,p,m,S){var f=At(t,n),x=At(e,n),j=S.get(x);if(j){St(t,n,j);return}var I=m?m(f,x,n+"",t,e,S):void 0,at=I===void 0;if(at){var It=Bt(x),Dt=!It&&te(x),ie=!It&&!Dt&&ne(x);I=x,It||Dt||ie?Bt(f)?I=f:Hn(f)?I=Bn(f):Dt?(at=!1,I=wn(x,!0)):ie?(at=!1,I=On(x,!0)):I=[]:kn(x)||Ot(x)?(I=f,Ot(f)?I=Un(f):(!K(f)||Ct(f))&&(I=$n(x))):at=!1}at&&(S.set(x,I),p(I,x,s,m,S),S.delete(x)),St(t,n,I)}function Sn(t,e){return Ln(Mn(t,e,oe),t+"")}var xn=pt?function(t,e){return pt(t,"toString",{configurable:!0,enumerable:!1,value:Gn(e),writable:!0})}:oe;function wn(t,e){if(e)return t.slice();var n=t.length,s=Wt?Wt(n):new t.constructor(n);return t.copy(s),s}function An(t){var e=new t.constructor(t.byteLength);return new Ut(e).set(new Ut(t)),e}function On(t,e){var n=e?An(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Bn(t,e){var n=-1,s=t.length;for(e||(e=Array(s));++n<s;)e[n]=t[n];return e}function En(t,e,n,s){var p=!n;n||(n={});for(var m=-1,S=e.length;++m<S;){var f=e[m],x=s?s(n[f],t[f],f,n,t):void 0;x===void 0&&(x=t[f]),p?xt(n,f,x):bn(n,f,x)}return n}function Cn(t){return Sn(function(e,n){var s=-1,p=n.length,m=p>1?n[p-1]:void 0,S=p>2?n[2]:void 0;for(m=t.length>3&&typeof m=="function"?(p--,m):void 0,S&&jn(n[0],n[1],S)&&(m=p<3?void 0:m,p=1),e=Object(e);++s<p;){var f=n[s];f&&t(e,f,s,m)}return e})}function In(t){return function(e,n,s){for(var p=-1,m=Object(e),S=s(e),f=S.length;f--;){var x=S[t?f:++p];if(n(m[x],x,m)===!1)break}return e}}function gt(t,e){var n=t.__data__;return Fn(e)?n[typeof e=="string"?"string":"hash"]:n.map}function wt(t,e){var n=Pe(t,e);return mn(n)?n:void 0}function Dn(t){var e=L.call(t,G),n=t[G];try{t[G]=void 0;var s=!0}catch{}var p=Ht.call(t);return s&&(e?t[G]=n:delete t[G]),p}function $n(t){return typeof t.constructor=="function"&&!Xt(t)?qe(Gt(t)):{}}function Yt(t,e){var n=typeof t;return e=e==null?w:e,!!e&&(n=="number"||n!="symbol"&&$e.test(t))&&t>-1&&t%1==0&&t<e}function jn(t,e,n){if(!K(n))return!1;var s=typeof e;return(s=="number"?Et(n)&&Yt(e,n.length):s=="string"&&e in n)?bt(n[e],t):!1}function Fn(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Nn(t){return!!Rt&&Rt in t}function Xt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||ct;return t===n}function Vn(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function Pn(t){return Ht.call(t)}function Mn(t,e,n){return e=Kt(e===void 0?t.length-1:e,0),function(){for(var s=arguments,p=-1,m=Kt(s.length-e,0),S=Array(m);++p<m;)S[p]=s[e+p];p=-1;for(var f=Array(e+1);++p<e;)f[p]=s[p];return f[e]=n(S),Fe(t,this,f)}}function At(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Ln=zn(xn);function zn(t){var e=0,n=0;return function(){var s=Ge(),p=a-(s-n);if(n=s,p>0){if(++e>=d)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Rn(t){if(t!=null){try{return ut.call(t)}catch{}try{return t+""}catch{}}return""}function bt(t,e){return t===e||t!==t&&e!==e}var Ot=Zt(function(){return arguments}())?Zt:function(t){return it(t)&&L.call(t,"callee")&&!ke.call(t,"callee")},Bt=Array.isArray;function Et(t){return t!=null&&ee(t.length)&&!Ct(t)}function Hn(t){return it(t)&&Et(t)}var te=We||qn;function Ct(t){if(!K(t))return!1;var e=ht(t);return e==O||e==B||e==V||e==Z}function ee(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=w}function K(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function it(t){return t!=null&&typeof t=="object"}function kn(t){if(!it(t)||ht(t)!=M)return!1;var e=Gt(t);if(e===null)return!0;var n=L.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ut.call(n)==Re}var ne=zt?Ve(zt):yn;function Un(t){return En(t,re(t))}function re(t){return Et(t)?gn(t,!0):_n(t)}var Wn=Cn(function(t,e,n){Jt(t,e,n)});function Gn(t){return function(){return t}}function oe(t){return t}function qn(){return!1}o.exports=Wn})(vt,vt.exports);var mt=vt.exports;function Ft(o,u=document){const l=u.querySelector(o);if(l)return l;const g=u.querySelectorAll("*");for(const d of g)if(d.shadowRoot){const a=Ft(o,d.shadowRoot);if(a)return a}return null}function yt(o){var u;if(r.isRef(o))return(u=o.value)!=null?u:null;if(typeof o=="string"){const l=document.querySelector(o);return l||Ft(o)}else if(typeof o=="function")return o();return null}const pe=o=>{var u,l,g,d;return typeof o=="number"?{top:o,right:o,bottom:o,left:o}:{top:(u=o==null?void 0:o.top)!=null?u:0,right:(l=o==null?void 0:o.right)!=null?l:0,bottom:(g=o==null?void 0:o.bottom)!=null?g:0,left:(d=o==null?void 0:o.left)!=null?d:0}},de=o=>{var u,l,g,d;return typeof o=="number"?{leftTop:o,rightTop:o,rightBottom:o,leftBottom:o}:{leftTop:(u=o==null?void 0:o.leftTop)!=null?u:0,rightTop:(l=o==null?void 0:o.rightTop)!=null?l:0,rightBottom:(g=o==null?void 0:o.rightBottom)!=null?g:0,leftBottom:(d=o==null?void 0:o.leftBottom)!=null?d:0}},he=(o,u,l)=>{const{innerWidth:g,innerHeight:d}=window,a={top:o.top-u.top,right:o.left+o.width+u.right,bottom:o.top+o.height+u.bottom,left:o.left-u.left},w=Math.min((a.right-a.left)/2,(a.bottom-a.top)/2),b={lt:Math.min(l.leftTop,w),rt:Math.min(l.rightTop,w),rb:Math.min(l.rightBottom,w),lb:Math.min(l.leftBottom,w)};return`
2
2
  M${g},${d} H0 V0 H${g} Z
3
3
  M${a.left+b.lt},${a.top}
4
4
  Q${a.left},${a.top} ${a.left},${a.top+b.lt}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v-onboarding",
3
- "version": "2.10.2",
3
+ "version": "2.12.0",
4
4
  "description": "A fully-typed, customizable onboarding component for Vue 3",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,10 +33,15 @@
33
33
  "import": "./dist/v-onboarding.es.js",
34
34
  "require": "./dist/v-onboarding.umd.js"
35
35
  },
36
- "./dist/style.css": "./dist/style.css"
36
+ "./dist/style.css": "./dist/style.css",
37
+ "./nuxt": {
38
+ "types": "./dist/module.d.ts",
39
+ "import": "./dist/module.mjs"
40
+ }
37
41
  },
38
42
  "scripts": {
39
- "build": "yarn update-web-types && vite build",
43
+ "build": "yarn update-web-types && vite build && yarn build:nuxt",
44
+ "build:nuxt": "unbuild",
40
45
  "update-web-types": "vue-docgen-web-types",
41
46
  "docs:dev": "cd docs && npm run dev",
42
47
  "docs:generate": "cd docs && npm run generate",
@@ -56,7 +61,10 @@
56
61
  "vue": "^3.2.21"
57
62
  },
58
63
  "devDependencies": {
64
+ "@nuxt/kit": "^3.8.0",
65
+ "@nuxt/schema": "^4.2.2",
59
66
  "@rollup/plugin-typescript": "^8.3.0",
67
+ "@semantic-release/git": "^10.0.1",
60
68
  "@types/lodash.merge": "^4.6.6",
61
69
  "@types/node": "^16.11.7",
62
70
  "@vitejs/plugin-vue": "^1.9.4",
@@ -67,7 +75,6 @@
67
75
  "minimist": "^1.2.5",
68
76
  "rollup-plugin-vue": "^6.0.0",
69
77
  "sass": "^1.45.0",
70
- "@semantic-release/git": "^10.0.1",
71
78
  "semantic-release": "^19.0.2",
72
79
  "tsup": "^5.7.0",
73
80
  "unbuild": "^0.5.11",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "v-onboarding",
4
- "version": "2.10.1",
4
+ "version": "2.11.0",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",