@vueuse/integrations 10.4.1 → 10.5.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/index.cjs CHANGED
@@ -298,7 +298,8 @@ function useDrauu(target, options) {
298
298
  cornerRadius: 0,
299
299
  dasharray: void 0,
300
300
  fill: "transparent",
301
- mode: "draw"
301
+ mode: "draw",
302
+ ...options == null ? void 0 : options.brush
302
303
  });
303
304
  vueDemi.watch(brush, () => {
304
305
  const instance = drauuInstance.value;
package/index.d.cts CHANGED
@@ -170,7 +170,7 @@ declare function useChangeCase(input: MaybeRefOrGetter<string>, type: ChangeCase
170
170
 
171
171
  /**
172
172
  * Creates a new {@link useCookies} function
173
- * @param {Object} req - incoming http request (for SSR)
173
+ * @param req - incoming http request (for SSR)
174
174
  * @see https://github.com/reactivestack/cookies/tree/master/packages/universal-cookie universal-cookie
175
175
  * @description Creates universal-cookie instance using request (default is window.document.cookie) and returns {@link useCookies} function with provided universal-cookie instance
176
176
  */
@@ -193,11 +193,11 @@ declare function createCookies(req?: IncomingMessage): (dependencies?: string[]
193
193
  };
194
194
  /**
195
195
  * Reactive methods to work with cookies (use {@link createCookies} method instead if you are using SSR)
196
- * @param {string[]|null|undefined} dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
197
- * @param {Object} options
198
- * @param {boolean} options.doNotParse - don't try parse value as JSON
199
- * @param {boolean} options.autoUpdateDependencies - automatically update watching dependencies
200
- * @param {Object} cookies - universal-cookie instance
196
+ * @param dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
197
+ * @param options
198
+ * @param options.doNotParse - don't try parse value as JSON
199
+ * @param options.autoUpdateDependencies - automatically update watching dependencies
200
+ * @param cookies - universal-cookie instance
201
201
  */
202
202
  declare function useCookies(dependencies?: string[] | null, { doNotParse, autoUpdateDependencies }?: {
203
203
  doNotParse?: boolean | undefined;
@@ -290,9 +290,6 @@ interface UseFocusTrapReturn {
290
290
  * Reactive focus-trap
291
291
  *
292
292
  * @see https://vueuse.org/useFocusTrap
293
- * @param target The target element to trap focus within
294
- * @param options Focus trap options
295
- * @param autoFocus Focus trap automatically when mounted
296
293
  */
297
294
  declare function useFocusTrap(target: MaybeElementRef, options?: UseFocusTrapOptions): UseFocusTrapReturn;
298
295
 
@@ -374,7 +371,6 @@ interface UseJwtReturn<Payload, Header, Fallback> {
374
371
  * Reactive decoded jwt token.
375
372
  *
376
373
  * @see https://vueuse.org/useJwt
377
- * @param jwt
378
374
  */
379
375
  declare function useJwt<Payload extends object = JwtPayload, Header extends object = JwtHeader, Fallback = null>(encodedJwt: MaybeRefOrGetter<string>, options?: UseJwtOptions<Fallback>): UseJwtReturn<Payload, Header, Fallback>;
380
376
 
package/index.d.mts CHANGED
@@ -170,7 +170,7 @@ declare function useChangeCase(input: MaybeRefOrGetter<string>, type: ChangeCase
170
170
 
171
171
  /**
172
172
  * Creates a new {@link useCookies} function
173
- * @param {Object} req - incoming http request (for SSR)
173
+ * @param req - incoming http request (for SSR)
174
174
  * @see https://github.com/reactivestack/cookies/tree/master/packages/universal-cookie universal-cookie
175
175
  * @description Creates universal-cookie instance using request (default is window.document.cookie) and returns {@link useCookies} function with provided universal-cookie instance
176
176
  */
@@ -193,11 +193,11 @@ declare function createCookies(req?: IncomingMessage): (dependencies?: string[]
193
193
  };
194
194
  /**
195
195
  * Reactive methods to work with cookies (use {@link createCookies} method instead if you are using SSR)
196
- * @param {string[]|null|undefined} dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
197
- * @param {Object} options
198
- * @param {boolean} options.doNotParse - don't try parse value as JSON
199
- * @param {boolean} options.autoUpdateDependencies - automatically update watching dependencies
200
- * @param {Object} cookies - universal-cookie instance
196
+ * @param dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
197
+ * @param options
198
+ * @param options.doNotParse - don't try parse value as JSON
199
+ * @param options.autoUpdateDependencies - automatically update watching dependencies
200
+ * @param cookies - universal-cookie instance
201
201
  */
202
202
  declare function useCookies(dependencies?: string[] | null, { doNotParse, autoUpdateDependencies }?: {
203
203
  doNotParse?: boolean | undefined;
@@ -290,9 +290,6 @@ interface UseFocusTrapReturn {
290
290
  * Reactive focus-trap
291
291
  *
292
292
  * @see https://vueuse.org/useFocusTrap
293
- * @param target The target element to trap focus within
294
- * @param options Focus trap options
295
- * @param autoFocus Focus trap automatically when mounted
296
293
  */
297
294
  declare function useFocusTrap(target: MaybeElementRef, options?: UseFocusTrapOptions): UseFocusTrapReturn;
298
295
 
@@ -374,7 +371,6 @@ interface UseJwtReturn<Payload, Header, Fallback> {
374
371
  * Reactive decoded jwt token.
375
372
  *
376
373
  * @see https://vueuse.org/useJwt
377
- * @param jwt
378
374
  */
379
375
  declare function useJwt<Payload extends object = JwtPayload, Header extends object = JwtHeader, Fallback = null>(encodedJwt: MaybeRefOrGetter<string>, options?: UseJwtOptions<Fallback>): UseJwtReturn<Payload, Header, Fallback>;
380
376
 
package/index.d.ts CHANGED
@@ -170,7 +170,7 @@ declare function useChangeCase(input: MaybeRefOrGetter<string>, type: ChangeCase
170
170
 
171
171
  /**
172
172
  * Creates a new {@link useCookies} function
173
- * @param {Object} req - incoming http request (for SSR)
173
+ * @param req - incoming http request (for SSR)
174
174
  * @see https://github.com/reactivestack/cookies/tree/master/packages/universal-cookie universal-cookie
175
175
  * @description Creates universal-cookie instance using request (default is window.document.cookie) and returns {@link useCookies} function with provided universal-cookie instance
176
176
  */
@@ -193,11 +193,11 @@ declare function createCookies(req?: IncomingMessage): (dependencies?: string[]
193
193
  };
194
194
  /**
195
195
  * Reactive methods to work with cookies (use {@link createCookies} method instead if you are using SSR)
196
- * @param {string[]|null|undefined} dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
197
- * @param {Object} options
198
- * @param {boolean} options.doNotParse - don't try parse value as JSON
199
- * @param {boolean} options.autoUpdateDependencies - automatically update watching dependencies
200
- * @param {Object} cookies - universal-cookie instance
196
+ * @param dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
197
+ * @param options
198
+ * @param options.doNotParse - don't try parse value as JSON
199
+ * @param options.autoUpdateDependencies - automatically update watching dependencies
200
+ * @param cookies - universal-cookie instance
201
201
  */
202
202
  declare function useCookies(dependencies?: string[] | null, { doNotParse, autoUpdateDependencies }?: {
203
203
  doNotParse?: boolean | undefined;
@@ -290,9 +290,6 @@ interface UseFocusTrapReturn {
290
290
  * Reactive focus-trap
291
291
  *
292
292
  * @see https://vueuse.org/useFocusTrap
293
- * @param target The target element to trap focus within
294
- * @param options Focus trap options
295
- * @param autoFocus Focus trap automatically when mounted
296
293
  */
297
294
  declare function useFocusTrap(target: MaybeElementRef, options?: UseFocusTrapOptions): UseFocusTrapReturn;
298
295
 
@@ -374,7 +371,6 @@ interface UseJwtReturn<Payload, Header, Fallback> {
374
371
  * Reactive decoded jwt token.
375
372
  *
376
373
  * @see https://vueuse.org/useJwt
377
- * @param jwt
378
374
  */
379
375
  declare function useJwt<Payload extends object = JwtPayload, Header extends object = JwtHeader, Fallback = null>(encodedJwt: MaybeRefOrGetter<string>, options?: UseJwtOptions<Fallback>): UseJwtReturn<Payload, Header, Fallback>;
380
376
 
package/index.iife.js CHANGED
@@ -399,7 +399,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
399
399
  cornerRadius: 0,
400
400
  dasharray: void 0,
401
401
  fill: "transparent",
402
- mode: "draw"
402
+ mode: "draw",
403
+ ...options == null ? void 0 : options.brush
403
404
  });
404
405
  vueDemi.watch(brush, () => {
405
406
  const instance = drauuInstance.value;
package/index.iife.min.js CHANGED
@@ -1 +1 @@
1
- var VueDemi=function(r,o,H){if(r.install)return r;if(!o)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),r;if(o.version.slice(0,4)==="2.7."){let h=function(b,P){var C,N={},B={config:o.config,use:o.use.bind(o),mixin:o.mixin.bind(o),component:o.component.bind(o),provide:function(E,k){return N[E]=k,this},directive:function(E,k){return k?(o.directive(E,k),B):o.directive(E)},mount:function(E,k){return C||(C=new o(Object.assign({propsData:P},b,{provide:Object.assign(N,b.provide)})),C.$mount(E,k),C)},unmount:function(){C&&(C.$destroy(),C=void 0)}};return B};var j=h;for(var n in o)r[n]=o[n];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=o,r.Vue2=o,r.version=o.version,r.warn=o.util.warn,r.hasInjectionContext=()=>!!r.getCurrentInstance(),r.createApp=h}else if(o.version.slice(0,2)==="2.")if(H){for(var n in H)r[n]=H[n];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=o,r.Vue2=o,r.version=o.version,r.hasInjectionContext=()=>!!r.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(o.version.slice(0,2)==="3."){for(var n in o)r[n]=o[n];r.isVue2=!1,r.isVue3=!0,r.install=function(){},r.Vue=o,r.Vue2=void 0,r.version=o.version,r.set=function(h,b,P){return Array.isArray(h)?(h.length=Math.max(h.length,b),h.splice(b,1,P),P):(h[b]=P,P)},r.del=function(h,b){if(Array.isArray(h)){h.splice(b,1);return}delete h[b]}}else console.error("[vue-demi] Vue version "+o.version+" is unsupported.");return r}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(r,o,H,n,j,h,b,P,C,N,B,E,k,S,V,$){"use strict";const D=H.default||H;function ee(t,l,e={}){const{validateOption:a={},immediate:s=!0,manual:i=!1}=e,c=o.toRef(t),f=n.shallowRef(null),u=n.ref(!0),p=n.ref(!s||i),w=n.computed(()=>{var v;return((v=f.value)==null?void 0:v.errors)||[]}),y=n.computed(()=>{var v;return((v=f.value)==null?void 0:v.fields)||{}}),O=n.computed(()=>new D(o.toValue(l))),_=async()=>{u.value=!1,p.value=!1;try{await O.value.validate(c.value,a),p.value=!0,f.value=null}catch(v){f.value=v}finally{u.value=!0}return{pass:p.value,errorInfo:f.value,errors:w.value,errorFields:y.value}};i||n.watch([c,O],()=>_(),{immediate:s,deep:!0});const R={isFinished:u,pass:p,errors:w,errorInfo:f,errorFields:y,execute:_};function g(){return new Promise((v,F)=>{o.until(u).toBe(!0).then(()=>v(R)).catch(I=>F(I))})}return{...R,then(v,F){return g().then(v,F)}}}function te(...t){const l=typeof t[0]=="string"?t[0]:void 0,e=typeof l=="string"?1:0;let a={},s=j,i={immediate:!!e,shallow:!0};const c=A=>!!A?.request;t.length>0+e&&(c(t[0+e])?s=t[0+e]:a=t[0+e]),t.length>1+e&&c(t[1+e])&&(s=t[1+e]),(t.length===2+e&&!c(t[1+e])||t.length===3+e)&&(i=t[t.length-1]);const{initialData:f,shallow:u,onSuccess:p=o.noop,onError:w=o.noop,immediate:y,resetOnExecute:O=!1}=i,_=n.shallowRef(),R=(u?n.shallowRef:n.ref)(f),g=n.ref(!1),v=n.ref(!1),F=n.ref(!1),I=n.shallowRef(),G=j.CancelToken.source;let T=G();const U=A=>{g.value||!v.value||(T.cancel(A),T=G(),F.value=!0,v.value=!1,g.value=!1)},d=A=>{v.value=A,g.value=!A},L=()=>{O&&(R.value=f)},q=()=>new Promise((A,W)=>{o.until(g).toBe(!0).then(()=>I.value?W(I.value):A(Y))}),J={then:(...A)=>q().then(...A),catch:(...A)=>q().catch(...A)};let Q=0;const X=(A=l,W={})=>{I.value=void 0;const Z=typeof A=="string"?A:l??W.url;if(Z===void 0)return I.value=new j.AxiosError(j.AxiosError.ERR_INVALID_URL),g.value=!0,J;L(),U(),d(!0),Q+=1;const ve=Q;return s(Z,{...a,...typeof A=="object"?A:W,cancelToken:T.token}).then(m=>{_.value=m;const K=m.data;R.value=K,p(K)}).catch(m=>{I.value=m,w(m)}).finally(()=>{var m;(m=i.onFinish)==null||m.call(i),ve===Q&&d(!1)}),J};y&&l&&X();const Y={response:_,data:R,error:I,isFinished:g,isLoading:v,cancel:U,isAborted:F,isCanceled:F,abort:U,execute:X};return{...Y,...J}}var x=Object.freeze({__proto__:null,camelCase:h.camelCase,capitalCase:h.capitalCase,constantCase:h.constantCase,dotCase:h.dotCase,headerCase:h.headerCase,noCase:h.noCase,paramCase:h.paramCase,pascalCase:h.pascalCase,pathCase:h.pathCase,sentenceCase:h.sentenceCase,snakeCase:h.snakeCase});function ne(t,l,e){if(typeof t=="function")return n.computed(()=>x[l](o.toValue(t),e));const a=n.ref(t);return n.computed({get(){return x[l](a.value,e)},set(s){a.value=s}})}function oe(t){const l=new b(t?t.headers.cookie:null);return(e,{doNotParse:a=!1,autoUpdateDependencies:s=!1}={})=>z(e,{doNotParse:a,autoUpdateDependencies:s},l)}function z(t,{doNotParse:l=!1,autoUpdateDependencies:e=!1}={},a=new b){const s=e?[...t||[]]:t;let i=a.getAll({doNotParse:!0});const c=n.ref(0),f=()=>{const u=a.getAll({doNotParse:!0});ae(s||null,u,i)&&c.value++,i=u};return a.addChangeListener(f),o.tryOnScopeDispose(()=>{a.removeChangeListener(f)}),{get:(...u)=>(e&&s&&!s.includes(u[0])&&s.push(u[0]),c.value,a.get(u[0],{doNotParse:l,...u[1]})),getAll:(...u)=>(c.value,a.getAll({doNotParse:l,...u[0]})),set:(...u)=>a.set(...u),remove:(...u)=>a.remove(...u),addChangeListener:(...u)=>a.addChangeListener(...u),removeChangeListener:(...u)=>a.removeChangeListener(...u)}}function ae(t,l,e){if(!t)return!0;for(const a of t)if(l[a]!==e[a])return!0;return!1}function re(t,l){const e=n.ref();let a=[];const s=C.createEventHook(),i=C.createEventHook(),c=C.createEventHook(),f=C.createEventHook(),u=C.createEventHook(),p=n.ref(!1),w=n.ref(!1),y=n.ref(!1),O=n.ref(!1),_=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw"});n.watch(_,()=>{const d=e.value;d&&(d.brush=_.value,d.mode=_.value.mode)},{deep:!0});const R=()=>{var d;return(d=e.value)==null?void 0:d.undo()},g=()=>{var d;return(d=e.value)==null?void 0:d.redo()},v=()=>{var d;return(d=e.value)==null?void 0:d.clear()},F=()=>{var d;return(d=e.value)==null?void 0:d.cancel()},I=d=>{var L;return(L=e.value)==null?void 0:L.load(d)},G=()=>{var d;return(d=e.value)==null?void 0:d.dump()},T=()=>{var d;a.forEach(L=>L()),(d=e.value)==null||d.unmount()},U=()=>{e.value&&(p.value=e.value.canUndo(),w.value=e.value.canRedo(),y.value=e.value.altPressed,O.value=e.value.shiftPressed)};return n.watch(()=>C.unrefElement(t),d=>{!d||typeof SVGSVGElement>"u"||!(d instanceof SVGSVGElement)||(e.value&&T(),e.value=P.createDrauu({el:d,...l}),U(),a=[e.value.on("canceled",()=>i.trigger()),e.value.on("committed",L=>c.trigger(L)),e.value.on("start",()=>f.trigger()),e.value.on("end",()=>u.trigger()),e.value.on("changed",()=>{U(),s.trigger()})])},{flush:"post"}),o.tryOnScopeDispose(()=>T()),{drauuInstance:e,load:I,dump:G,clear:v,cancel:F,undo:R,redo:g,canUndo:p,canRedo:w,brush:_,onChanged:s.on,onCommitted:c.on,onStart:f.on,onEnd:u.on,onCanceled:i.on}}function le(t,l={}){let e;const{immediate:a,...s}=l,i=n.ref(!1),c=n.ref(!1),f=y=>e&&e.activate(y),u=y=>e&&e.deactivate(y),p=()=>{e&&(e.pause(),c.value=!0)},w=()=>{e&&(e.unpause(),c.value=!1)};return n.watch(()=>C.unrefElement(t),y=>{y&&(e=N.createFocusTrap(y,{...s,onActivate(){i.value=!0,l.onActivate&&l.onActivate()},onDeactivate(){i.value=!1,l.onDeactivate&&l.onDeactivate()}}),a&&f())},{flush:"post"}),C.tryOnScopeDispose(()=>u()),{hasFocus:i,isPaused:c,activate:f,deactivate:u,pause:p,unpause:w}}function se(t,l,e){const a=()=>{var c,f;return new B((c=o.toValue(l))!=null?c:[],(f=o.toValue(e))==null?void 0:f.fuseOptions)},s=n.ref(a());n.watch(()=>{var c;return(c=o.toValue(e))==null?void 0:c.fuseOptions},()=>{s.value=a()},{deep:!0}),n.watch(()=>o.toValue(l),c=>{s.value.setCollection(c)},{deep:!0});const i=n.computed(()=>{const c=o.toValue(e);if(c?.matchAllWhenSearchEmpty&&!o.toValue(t))return o.toValue(l).map((u,p)=>({item:u,refIndex:p}));const f=c?.resultLimit;return s.value.search(o.toValue(t),f?{limit:f}:void 0)});return{fuse:s,results:i}}function ue(t,l,e={}){const{flush:a="pre",deep:s=!0,shallow:i=!1,onError:c=v=>{console.error(v)},writeDefaults:f=!0}=e,u=n.ref(!1),p=(i?n.shallowRef:n.ref)(l),w=o.toValue(l);async function y(){try{const v=await E.get(t);v===void 0?w!=null&&f&&await E.set(t,w):p.value=v}catch(v){c(v)}u.value=!0}y();async function O(){try{p.value==null?await E.del(t):Array.isArray(p.value)?await E.update(t,()=>JSON.parse(JSON.stringify(p.value))):typeof p.value=="object"?await E.update(t,()=>({...p.value})):await E.update(t,()=>p.value)}catch(v){c(v)}}const{pause:_,resume:R}=C.watchPausable(p,()=>O(),{flush:a,deep:s});async function g(v){_(),p.value=v,await O(),R()}return{set:g,isFinished:u,data:p}}function ce(t,l={}){const{onError:e,fallbackValue:a=null}=l,s=(f,u)=>{try{return k(f,u)}catch(p){return e?.(p),a}},i=n.computed(()=>s(o.toValue(t),{header:!0})),c=n.computed(()=>s(o.toValue(t)));return{header:i,payload:c}}function ie(t=null,l){const e=n.ref(t),a=n.computed({set:i=>i?S.start():S.done(),get:()=>typeof e.value=="number"&&e.value<1});l&&S.configure(l);const s=S.set;return S.set=i=>(e.value=i,s.call(S,i)),n.watchEffect(()=>{typeof e.value=="number"&&o.isClient&&s.call(S,e.value)}),o.tryOnScopeDispose(S.remove),{isLoading:a,progress:e,start:S.start,done:S.done,remove:()=>{e.value=null,S.remove()}}}function fe(t,l){const e=o.toRef(t),a=n.ref("");return n.watch(e,async s=>{e.value&&o.isClient&&(a.value=await V.toDataURL(s,l))},{immediate:!0}),a}function de(t,l,e={}){let a;const{document:s=C.defaultDocument,...i}=e,c={onUpdate:w=>{M(l,w.oldIndex,w.newIndex)}},f=()=>{const w=typeof t=="string"?s?.querySelector(t):C.unrefElement(t);w&&(a=new $(w,{...c,...i}))},u=()=>a?.destroy(),p=(w,y)=>{if(y!==void 0)a?.option(w,y);else return a?.option(w)};return C.tryOnMounted(f),C.tryOnScopeDispose(u),{stop:u,start:f,option:p}}function M(t,l,e){const a=n.isRef(t),s=a?[...C.toValue(t)]:C.toValue(t);if(e>=0&&e<s.length){const i=s.splice(l,1)[0];n.nextTick(()=>{s.splice(e,0,i),a&&(t.value=s)})}}r.createCookies=oe,r.moveArrayElement=M,r.useAsyncValidator=ee,r.useAxios=te,r.useChangeCase=ne,r.useCookies=z,r.useDrauu=re,r.useFocusTrap=le,r.useFuse=se,r.useIDBKeyval=ue,r.useJwt=ce,r.useNProgress=ie,r.useQRCode=fe,r.useSortable=de})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,VueDemi,axios,changeCase,UniversalCookie,Drauu,VueUse,focusTrap,Fuse,idbKeyval,jwt_decode,nprogress,QRCode,Sortable);
1
+ var VueDemi=function(l,o,H){if(l.install)return l;if(!o)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),l;if(o.version.slice(0,4)==="2.7."){let h=function(b,P){var C,N={},B={config:o.config,use:o.use.bind(o),mixin:o.mixin.bind(o),component:o.component.bind(o),provide:function(E,k){return N[E]=k,this},directive:function(E,k){return k?(o.directive(E,k),B):o.directive(E)},mount:function(E,k){return C||(C=new o(Object.assign({propsData:P},b,{provide:Object.assign(N,b.provide)})),C.$mount(E,k),C)},unmount:function(){C&&(C.$destroy(),C=void 0)}};return B};var j=h;for(var n in o)l[n]=o[n];l.isVue2=!0,l.isVue3=!1,l.install=function(){},l.Vue=o,l.Vue2=o,l.version=o.version,l.warn=o.util.warn,l.hasInjectionContext=()=>!!l.getCurrentInstance(),l.createApp=h}else if(o.version.slice(0,2)==="2.")if(H){for(var n in H)l[n]=H[n];l.isVue2=!0,l.isVue3=!1,l.install=function(){},l.Vue=o,l.Vue2=o,l.version=o.version,l.hasInjectionContext=()=>!!l.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(o.version.slice(0,2)==="3."){for(var n in o)l[n]=o[n];l.isVue2=!1,l.isVue3=!0,l.install=function(){},l.Vue=o,l.Vue2=void 0,l.version=o.version,l.set=function(h,b,P){return Array.isArray(h)?(h.length=Math.max(h.length,b),h.splice(b,1,P),P):(h[b]=P,P)},l.del=function(h,b){if(Array.isArray(h)){h.splice(b,1);return}delete h[b]}}else console.error("[vue-demi] Vue version "+o.version+" is unsupported.");return l}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(l,o,H,n,j,h,b,P,C,N,B,E,k,S,V,$){"use strict";const D=H.default||H;function ee(t,r,e={}){const{validateOption:a={},immediate:s=!0,manual:i=!1}=e,c=o.toRef(t),f=n.shallowRef(null),u=n.ref(!0),p=n.ref(!s||i),w=n.computed(()=>{var v;return((v=f.value)==null?void 0:v.errors)||[]}),y=n.computed(()=>{var v;return((v=f.value)==null?void 0:v.fields)||{}}),O=n.computed(()=>new D(o.toValue(r))),_=async()=>{u.value=!1,p.value=!1;try{await O.value.validate(c.value,a),p.value=!0,f.value=null}catch(v){f.value=v}finally{u.value=!0}return{pass:p.value,errorInfo:f.value,errors:w.value,errorFields:y.value}};i||n.watch([c,O],()=>_(),{immediate:s,deep:!0});const R={isFinished:u,pass:p,errors:w,errorInfo:f,errorFields:y,execute:_};function g(){return new Promise((v,F)=>{o.until(u).toBe(!0).then(()=>v(R)).catch(I=>F(I))})}return{...R,then(v,F){return g().then(v,F)}}}function te(...t){const r=typeof t[0]=="string"?t[0]:void 0,e=typeof r=="string"?1:0;let a={},s=j,i={immediate:!!e,shallow:!0};const c=A=>!!A?.request;t.length>0+e&&(c(t[0+e])?s=t[0+e]:a=t[0+e]),t.length>1+e&&c(t[1+e])&&(s=t[1+e]),(t.length===2+e&&!c(t[1+e])||t.length===3+e)&&(i=t[t.length-1]);const{initialData:f,shallow:u,onSuccess:p=o.noop,onError:w=o.noop,immediate:y,resetOnExecute:O=!1}=i,_=n.shallowRef(),R=(u?n.shallowRef:n.ref)(f),g=n.ref(!1),v=n.ref(!1),F=n.ref(!1),I=n.shallowRef(),G=j.CancelToken.source;let T=G();const U=A=>{g.value||!v.value||(T.cancel(A),T=G(),F.value=!0,v.value=!1,g.value=!1)},d=A=>{v.value=A,g.value=!A},L=()=>{O&&(R.value=f)},q=()=>new Promise((A,W)=>{o.until(g).toBe(!0).then(()=>I.value?W(I.value):A(Y))}),J={then:(...A)=>q().then(...A),catch:(...A)=>q().catch(...A)};let Q=0;const X=(A=r,W={})=>{I.value=void 0;const Z=typeof A=="string"?A:r??W.url;if(Z===void 0)return I.value=new j.AxiosError(j.AxiosError.ERR_INVALID_URL),g.value=!0,J;L(),U(),d(!0),Q+=1;const ve=Q;return s(Z,{...a,...typeof A=="object"?A:W,cancelToken:T.token}).then(m=>{_.value=m;const K=m.data;R.value=K,p(K)}).catch(m=>{I.value=m,w(m)}).finally(()=>{var m;(m=i.onFinish)==null||m.call(i),ve===Q&&d(!1)}),J};y&&r&&X();const Y={response:_,data:R,error:I,isFinished:g,isLoading:v,cancel:U,isAborted:F,isCanceled:F,abort:U,execute:X};return{...Y,...J}}var x=Object.freeze({__proto__:null,camelCase:h.camelCase,capitalCase:h.capitalCase,constantCase:h.constantCase,dotCase:h.dotCase,headerCase:h.headerCase,noCase:h.noCase,paramCase:h.paramCase,pascalCase:h.pascalCase,pathCase:h.pathCase,sentenceCase:h.sentenceCase,snakeCase:h.snakeCase});function ne(t,r,e){if(typeof t=="function")return n.computed(()=>x[r](o.toValue(t),e));const a=n.ref(t);return n.computed({get(){return x[r](a.value,e)},set(s){a.value=s}})}function oe(t){const r=new b(t?t.headers.cookie:null);return(e,{doNotParse:a=!1,autoUpdateDependencies:s=!1}={})=>z(e,{doNotParse:a,autoUpdateDependencies:s},r)}function z(t,{doNotParse:r=!1,autoUpdateDependencies:e=!1}={},a=new b){const s=e?[...t||[]]:t;let i=a.getAll({doNotParse:!0});const c=n.ref(0),f=()=>{const u=a.getAll({doNotParse:!0});ae(s||null,u,i)&&c.value++,i=u};return a.addChangeListener(f),o.tryOnScopeDispose(()=>{a.removeChangeListener(f)}),{get:(...u)=>(e&&s&&!s.includes(u[0])&&s.push(u[0]),c.value,a.get(u[0],{doNotParse:r,...u[1]})),getAll:(...u)=>(c.value,a.getAll({doNotParse:r,...u[0]})),set:(...u)=>a.set(...u),remove:(...u)=>a.remove(...u),addChangeListener:(...u)=>a.addChangeListener(...u),removeChangeListener:(...u)=>a.removeChangeListener(...u)}}function ae(t,r,e){if(!t)return!0;for(const a of t)if(r[a]!==e[a])return!0;return!1}function le(t,r){const e=n.ref();let a=[];const s=C.createEventHook(),i=C.createEventHook(),c=C.createEventHook(),f=C.createEventHook(),u=C.createEventHook(),p=n.ref(!1),w=n.ref(!1),y=n.ref(!1),O=n.ref(!1),_=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...r?.brush});n.watch(_,()=>{const d=e.value;d&&(d.brush=_.value,d.mode=_.value.mode)},{deep:!0});const R=()=>{var d;return(d=e.value)==null?void 0:d.undo()},g=()=>{var d;return(d=e.value)==null?void 0:d.redo()},v=()=>{var d;return(d=e.value)==null?void 0:d.clear()},F=()=>{var d;return(d=e.value)==null?void 0:d.cancel()},I=d=>{var L;return(L=e.value)==null?void 0:L.load(d)},G=()=>{var d;return(d=e.value)==null?void 0:d.dump()},T=()=>{var d;a.forEach(L=>L()),(d=e.value)==null||d.unmount()},U=()=>{e.value&&(p.value=e.value.canUndo(),w.value=e.value.canRedo(),y.value=e.value.altPressed,O.value=e.value.shiftPressed)};return n.watch(()=>C.unrefElement(t),d=>{!d||typeof SVGSVGElement>"u"||!(d instanceof SVGSVGElement)||(e.value&&T(),e.value=P.createDrauu({el:d,...r}),U(),a=[e.value.on("canceled",()=>i.trigger()),e.value.on("committed",L=>c.trigger(L)),e.value.on("start",()=>f.trigger()),e.value.on("end",()=>u.trigger()),e.value.on("changed",()=>{U(),s.trigger()})])},{flush:"post"}),o.tryOnScopeDispose(()=>T()),{drauuInstance:e,load:I,dump:G,clear:v,cancel:F,undo:R,redo:g,canUndo:p,canRedo:w,brush:_,onChanged:s.on,onCommitted:c.on,onStart:f.on,onEnd:u.on,onCanceled:i.on}}function re(t,r={}){let e;const{immediate:a,...s}=r,i=n.ref(!1),c=n.ref(!1),f=y=>e&&e.activate(y),u=y=>e&&e.deactivate(y),p=()=>{e&&(e.pause(),c.value=!0)},w=()=>{e&&(e.unpause(),c.value=!1)};return n.watch(()=>C.unrefElement(t),y=>{y&&(e=N.createFocusTrap(y,{...s,onActivate(){i.value=!0,r.onActivate&&r.onActivate()},onDeactivate(){i.value=!1,r.onDeactivate&&r.onDeactivate()}}),a&&f())},{flush:"post"}),C.tryOnScopeDispose(()=>u()),{hasFocus:i,isPaused:c,activate:f,deactivate:u,pause:p,unpause:w}}function se(t,r,e){const a=()=>{var c,f;return new B((c=o.toValue(r))!=null?c:[],(f=o.toValue(e))==null?void 0:f.fuseOptions)},s=n.ref(a());n.watch(()=>{var c;return(c=o.toValue(e))==null?void 0:c.fuseOptions},()=>{s.value=a()},{deep:!0}),n.watch(()=>o.toValue(r),c=>{s.value.setCollection(c)},{deep:!0});const i=n.computed(()=>{const c=o.toValue(e);if(c?.matchAllWhenSearchEmpty&&!o.toValue(t))return o.toValue(r).map((u,p)=>({item:u,refIndex:p}));const f=c?.resultLimit;return s.value.search(o.toValue(t),f?{limit:f}:void 0)});return{fuse:s,results:i}}function ue(t,r,e={}){const{flush:a="pre",deep:s=!0,shallow:i=!1,onError:c=v=>{console.error(v)},writeDefaults:f=!0}=e,u=n.ref(!1),p=(i?n.shallowRef:n.ref)(r),w=o.toValue(r);async function y(){try{const v=await E.get(t);v===void 0?w!=null&&f&&await E.set(t,w):p.value=v}catch(v){c(v)}u.value=!0}y();async function O(){try{p.value==null?await E.del(t):Array.isArray(p.value)?await E.update(t,()=>JSON.parse(JSON.stringify(p.value))):typeof p.value=="object"?await E.update(t,()=>({...p.value})):await E.update(t,()=>p.value)}catch(v){c(v)}}const{pause:_,resume:R}=C.watchPausable(p,()=>O(),{flush:a,deep:s});async function g(v){_(),p.value=v,await O(),R()}return{set:g,isFinished:u,data:p}}function ce(t,r={}){const{onError:e,fallbackValue:a=null}=r,s=(f,u)=>{try{return k(f,u)}catch(p){return e?.(p),a}},i=n.computed(()=>s(o.toValue(t),{header:!0})),c=n.computed(()=>s(o.toValue(t)));return{header:i,payload:c}}function ie(t=null,r){const e=n.ref(t),a=n.computed({set:i=>i?S.start():S.done(),get:()=>typeof e.value=="number"&&e.value<1});r&&S.configure(r);const s=S.set;return S.set=i=>(e.value=i,s.call(S,i)),n.watchEffect(()=>{typeof e.value=="number"&&o.isClient&&s.call(S,e.value)}),o.tryOnScopeDispose(S.remove),{isLoading:a,progress:e,start:S.start,done:S.done,remove:()=>{e.value=null,S.remove()}}}function fe(t,r){const e=o.toRef(t),a=n.ref("");return n.watch(e,async s=>{e.value&&o.isClient&&(a.value=await V.toDataURL(s,r))},{immediate:!0}),a}function de(t,r,e={}){let a;const{document:s=C.defaultDocument,...i}=e,c={onUpdate:w=>{M(r,w.oldIndex,w.newIndex)}},f=()=>{const w=typeof t=="string"?s?.querySelector(t):C.unrefElement(t);w&&(a=new $(w,{...c,...i}))},u=()=>a?.destroy(),p=(w,y)=>{if(y!==void 0)a?.option(w,y);else return a?.option(w)};return C.tryOnMounted(f),C.tryOnScopeDispose(u),{stop:u,start:f,option:p}}function M(t,r,e){const a=n.isRef(t),s=a?[...C.toValue(t)]:C.toValue(t);if(e>=0&&e<s.length){const i=s.splice(r,1)[0];n.nextTick(()=>{s.splice(e,0,i),a&&(t.value=s)})}}l.createCookies=oe,l.moveArrayElement=M,l.useAsyncValidator=ee,l.useAxios=te,l.useChangeCase=ne,l.useCookies=z,l.useDrauu=le,l.useFocusTrap=re,l.useFuse=se,l.useIDBKeyval=ue,l.useJwt=ce,l.useNProgress=ie,l.useQRCode=fe,l.useSortable=de})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,VueDemi,axios,changeCase,UniversalCookie,Drauu,VueUse,focusTrap,Fuse,idbKeyval,jwt_decode,nprogress,QRCode,Sortable);
package/index.mjs CHANGED
@@ -296,7 +296,8 @@ function useDrauu(target, options) {
296
296
  cornerRadius: 0,
297
297
  dasharray: void 0,
298
298
  fill: "transparent",
299
- mode: "draw"
299
+ mode: "draw",
300
+ ...options == null ? void 0 : options.brush
300
301
  });
301
302
  watch(brush, () => {
302
303
  const instance = drauuInstance.value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vueuse/integrations",
3
- "version": "10.4.1",
3
+ "version": "10.5.0",
4
4
  "description": "Integration wrappers for utility libraries",
5
5
  "author": "Anthony Fu <https://github.com/antfu>",
6
6
  "license": "MIT",
@@ -145,25 +145,25 @@
145
145
  }
146
146
  },
147
147
  "dependencies": {
148
- "@vueuse/core": "10.4.1",
149
- "@vueuse/shared": "10.4.1",
150
- "vue-demi": ">=0.14.5"
148
+ "@vueuse/core": "10.5.0",
149
+ "@vueuse/shared": "10.5.0",
150
+ "vue-demi": ">=0.14.6"
151
151
  },
152
152
  "devDependencies": {
153
- "@types/nprogress": "^0.2.0",
154
- "@types/qrcode": "^1.5.1",
155
- "@types/sortablejs": "^1.15.1",
153
+ "@types/nprogress": "^0.2.1",
154
+ "@types/qrcode": "^1.5.2",
155
+ "@types/sortablejs": "^1.15.3",
156
156
  "async-validator": "^4.2.5",
157
- "axios": "^1.4.0",
157
+ "axios": "^1.5.1",
158
158
  "change-case": "^4.1.2",
159
- "drauu": "^0.3.3",
160
- "focus-trap": "^7.5.2",
159
+ "drauu": "^0.3.7",
160
+ "focus-trap": "^7.5.3",
161
161
  "fuse.js": "^6.6.2",
162
162
  "idb-keyval": "^6.2.1",
163
163
  "jwt-decode": "^3.1.2",
164
164
  "nprogress": "^0.2.0",
165
165
  "qrcode": "^1.5.3",
166
166
  "sortablejs": "^1.15.0",
167
- "universal-cookie": "^6.1.0"
167
+ "universal-cookie": "^6.1.1"
168
168
  }
169
169
  }
package/useCookies.d.cts CHANGED
@@ -4,7 +4,7 @@ import { IncomingMessage } from 'node:http';
4
4
 
5
5
  /**
6
6
  * Creates a new {@link useCookies} function
7
- * @param {Object} req - incoming http request (for SSR)
7
+ * @param req - incoming http request (for SSR)
8
8
  * @see https://github.com/reactivestack/cookies/tree/master/packages/universal-cookie universal-cookie
9
9
  * @description Creates universal-cookie instance using request (default is window.document.cookie) and returns {@link useCookies} function with provided universal-cookie instance
10
10
  */
@@ -27,11 +27,11 @@ declare function createCookies(req?: IncomingMessage): (dependencies?: string[]
27
27
  };
28
28
  /**
29
29
  * Reactive methods to work with cookies (use {@link createCookies} method instead if you are using SSR)
30
- * @param {string[]|null|undefined} dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
31
- * @param {Object} options
32
- * @param {boolean} options.doNotParse - don't try parse value as JSON
33
- * @param {boolean} options.autoUpdateDependencies - automatically update watching dependencies
34
- * @param {Object} cookies - universal-cookie instance
30
+ * @param dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
31
+ * @param options
32
+ * @param options.doNotParse - don't try parse value as JSON
33
+ * @param options.autoUpdateDependencies - automatically update watching dependencies
34
+ * @param cookies - universal-cookie instance
35
35
  */
36
36
  declare function useCookies(dependencies?: string[] | null, { doNotParse, autoUpdateDependencies }?: {
37
37
  doNotParse?: boolean | undefined;
package/useCookies.d.mts CHANGED
@@ -4,7 +4,7 @@ import { IncomingMessage } from 'node:http';
4
4
 
5
5
  /**
6
6
  * Creates a new {@link useCookies} function
7
- * @param {Object} req - incoming http request (for SSR)
7
+ * @param req - incoming http request (for SSR)
8
8
  * @see https://github.com/reactivestack/cookies/tree/master/packages/universal-cookie universal-cookie
9
9
  * @description Creates universal-cookie instance using request (default is window.document.cookie) and returns {@link useCookies} function with provided universal-cookie instance
10
10
  */
@@ -27,11 +27,11 @@ declare function createCookies(req?: IncomingMessage): (dependencies?: string[]
27
27
  };
28
28
  /**
29
29
  * Reactive methods to work with cookies (use {@link createCookies} method instead if you are using SSR)
30
- * @param {string[]|null|undefined} dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
31
- * @param {Object} options
32
- * @param {boolean} options.doNotParse - don't try parse value as JSON
33
- * @param {boolean} options.autoUpdateDependencies - automatically update watching dependencies
34
- * @param {Object} cookies - universal-cookie instance
30
+ * @param dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
31
+ * @param options
32
+ * @param options.doNotParse - don't try parse value as JSON
33
+ * @param options.autoUpdateDependencies - automatically update watching dependencies
34
+ * @param cookies - universal-cookie instance
35
35
  */
36
36
  declare function useCookies(dependencies?: string[] | null, { doNotParse, autoUpdateDependencies }?: {
37
37
  doNotParse?: boolean | undefined;
package/useCookies.d.ts CHANGED
@@ -4,7 +4,7 @@ import { IncomingMessage } from 'node:http';
4
4
 
5
5
  /**
6
6
  * Creates a new {@link useCookies} function
7
- * @param {Object} req - incoming http request (for SSR)
7
+ * @param req - incoming http request (for SSR)
8
8
  * @see https://github.com/reactivestack/cookies/tree/master/packages/universal-cookie universal-cookie
9
9
  * @description Creates universal-cookie instance using request (default is window.document.cookie) and returns {@link useCookies} function with provided universal-cookie instance
10
10
  */
@@ -27,11 +27,11 @@ declare function createCookies(req?: IncomingMessage): (dependencies?: string[]
27
27
  };
28
28
  /**
29
29
  * Reactive methods to work with cookies (use {@link createCookies} method instead if you are using SSR)
30
- * @param {string[]|null|undefined} dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
31
- * @param {Object} options
32
- * @param {boolean} options.doNotParse - don't try parse value as JSON
33
- * @param {boolean} options.autoUpdateDependencies - automatically update watching dependencies
34
- * @param {Object} cookies - universal-cookie instance
30
+ * @param dependencies - array of watching cookie's names. Pass empty array if don't want to watch cookies changes.
31
+ * @param options
32
+ * @param options.doNotParse - don't try parse value as JSON
33
+ * @param options.autoUpdateDependencies - automatically update watching dependencies
34
+ * @param cookies - universal-cookie instance
35
35
  */
36
36
  declare function useCookies(dependencies?: string[] | null, { doNotParse, autoUpdateDependencies }?: {
37
37
  doNotParse?: boolean | undefined;
package/useDrauu.cjs CHANGED
@@ -24,7 +24,8 @@ function useDrauu(target, options) {
24
24
  cornerRadius: 0,
25
25
  dasharray: void 0,
26
26
  fill: "transparent",
27
- mode: "draw"
27
+ mode: "draw",
28
+ ...options == null ? void 0 : options.brush
28
29
  });
29
30
  vueDemi.watch(brush, () => {
30
31
  const instance = drauuInstance.value;
package/useDrauu.iife.js CHANGED
@@ -136,7 +136,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
136
136
  cornerRadius: 0,
137
137
  dasharray: void 0,
138
138
  fill: "transparent",
139
- mode: "draw"
139
+ mode: "draw",
140
+ ...options == null ? void 0 : options.brush
140
141
  });
141
142
  vueDemi.watch(brush, () => {
142
143
  const instance = drauuInstance.value;
@@ -1 +1 @@
1
- var VueDemi=function(e,n,d){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let s=function(a,c){var o,f={},v={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(i,l){return f[i]=l,this},directive:function(i,l){return l?(n.directive(i,l),v):n.directive(i)},mount:function(i,l){return o||(o=new n(Object.assign({propsData:c},a,{provide:Object.assign(f,a.provide)})),o.$mount(i,l),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return v};var h=s;for(var t in n)e[t]=n[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.warn=n.util.warn,e.hasInjectionContext=()=>!!e.getCurrentInstance(),e.createApp=s}else if(n.version.slice(0,2)==="2.")if(d){for(var t in d)e[t]=d[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.hasInjectionContext=()=>!!e.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(n.version.slice(0,2)==="3."){for(var t in n)e[t]=n[t];e.isVue2=!1,e.isVue3=!0,e.install=function(){},e.Vue=n,e.Vue2=void 0,e.version=n.version,e.set=function(s,a,c){return Array.isArray(s)?(s.length=Math.max(s.length,a),s.splice(a,1,c),c):(s[a]=c,c)},e.del=function(s,a){if(Array.isArray(s)){s.splice(a,1);return}delete s[a]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return e}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(e,n,d,t,h){"use strict";function s(a,c){const o=n.ref();let f=[];const v=t.createEventHook(),i=t.createEventHook(),l=t.createEventHook(),g=t.createEventHook(),b=t.createEventHook(),E=n.ref(!1),C=n.ref(!1),k=n.ref(!1),S=n.ref(!1),p=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw"});n.watch(p,()=>{const r=o.value;r&&(r.brush=p.value,r.mode=p.value.mode)},{deep:!0});const w=()=>{var r;return(r=o.value)==null?void 0:r.undo()},A=()=>{var r;return(r=o.value)==null?void 0:r.redo()},I=()=>{var r;return(r=o.value)==null?void 0:r.clear()},_=()=>{var r;return(r=o.value)==null?void 0:r.cancel()},P=r=>{var u;return(u=o.value)==null?void 0:u.load(r)},U=()=>{var r;return(r=o.value)==null?void 0:r.dump()},y=()=>{var r;f.forEach(u=>u()),(r=o.value)==null||r.unmount()},H=()=>{o.value&&(E.value=o.value.canUndo(),C.value=o.value.canRedo(),k.value=o.value.altPressed,S.value=o.value.shiftPressed)};return n.watch(()=>t.unrefElement(a),r=>{!r||typeof SVGSVGElement>"u"||!(r instanceof SVGSVGElement)||(o.value&&y(),o.value=d.createDrauu({el:r,...c}),H(),f=[o.value.on("canceled",()=>i.trigger()),o.value.on("committed",u=>l.trigger(u)),o.value.on("start",()=>g.trigger()),o.value.on("end",()=>b.trigger()),o.value.on("changed",()=>{H(),v.trigger()})])},{flush:"post"}),h.tryOnScopeDispose(()=>y()),{drauuInstance:o,load:P,dump:U,clear:I,cancel:_,undo:w,redo:A,canUndo:E,canRedo:C,brush:p,onChanged:v.on,onCommitted:l.on,onStart:g.on,onEnd:b.on,onCanceled:i.on}}e.useDrauu=s})(this.VueUse=this.VueUse||{},VueDemi,Drauu,VueUse,VueUse);
1
+ var VueDemi=function(e,n,d){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let s=function(a,i){var o,f={},v={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(l,c){return f[l]=c,this},directive:function(l,c){return c?(n.directive(l,c),v):n.directive(l)},mount:function(l,c){return o||(o=new n(Object.assign({propsData:i},a,{provide:Object.assign(f,a.provide)})),o.$mount(l,c),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return v};var h=s;for(var t in n)e[t]=n[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.warn=n.util.warn,e.hasInjectionContext=()=>!!e.getCurrentInstance(),e.createApp=s}else if(n.version.slice(0,2)==="2.")if(d){for(var t in d)e[t]=d[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.hasInjectionContext=()=>!!e.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(n.version.slice(0,2)==="3."){for(var t in n)e[t]=n[t];e.isVue2=!1,e.isVue3=!0,e.install=function(){},e.Vue=n,e.Vue2=void 0,e.version=n.version,e.set=function(s,a,i){return Array.isArray(s)?(s.length=Math.max(s.length,a),s.splice(a,1,i),i):(s[a]=i,i)},e.del=function(s,a){if(Array.isArray(s)){s.splice(a,1);return}delete s[a]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return e}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(e,n,d,t,h){"use strict";function s(a,i){const o=n.ref();let f=[];const v=t.createEventHook(),l=t.createEventHook(),c=t.createEventHook(),g=t.createEventHook(),b=t.createEventHook(),E=n.ref(!1),C=n.ref(!1),k=n.ref(!1),S=n.ref(!1),p=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...i?.brush});n.watch(p,()=>{const r=o.value;r&&(r.brush=p.value,r.mode=p.value.mode)},{deep:!0});const w=()=>{var r;return(r=o.value)==null?void 0:r.undo()},A=()=>{var r;return(r=o.value)==null?void 0:r.redo()},I=()=>{var r;return(r=o.value)==null?void 0:r.clear()},_=()=>{var r;return(r=o.value)==null?void 0:r.cancel()},P=r=>{var u;return(u=o.value)==null?void 0:u.load(r)},U=()=>{var r;return(r=o.value)==null?void 0:r.dump()},y=()=>{var r;f.forEach(u=>u()),(r=o.value)==null||r.unmount()},H=()=>{o.value&&(E.value=o.value.canUndo(),C.value=o.value.canRedo(),k.value=o.value.altPressed,S.value=o.value.shiftPressed)};return n.watch(()=>t.unrefElement(a),r=>{!r||typeof SVGSVGElement>"u"||!(r instanceof SVGSVGElement)||(o.value&&y(),o.value=d.createDrauu({el:r,...i}),H(),f=[o.value.on("canceled",()=>l.trigger()),o.value.on("committed",u=>c.trigger(u)),o.value.on("start",()=>g.trigger()),o.value.on("end",()=>b.trigger()),o.value.on("changed",()=>{H(),v.trigger()})])},{flush:"post"}),h.tryOnScopeDispose(()=>y()),{drauuInstance:o,load:P,dump:U,clear:I,cancel:_,undo:w,redo:A,canUndo:E,canRedo:C,brush:p,onChanged:v.on,onCommitted:c.on,onStart:g.on,onEnd:b.on,onCanceled:l.on}}e.useDrauu=s})(this.VueUse=this.VueUse||{},VueDemi,Drauu,VueUse,VueUse);
package/useDrauu.mjs CHANGED
@@ -22,7 +22,8 @@ function useDrauu(target, options) {
22
22
  cornerRadius: 0,
23
23
  dasharray: void 0,
24
24
  fill: "transparent",
25
- mode: "draw"
25
+ mode: "draw",
26
+ ...options == null ? void 0 : options.brush
26
27
  });
27
28
  watch(brush, () => {
28
29
  const instance = drauuInstance.value;
@@ -48,9 +48,6 @@ interface UseFocusTrapReturn {
48
48
  * Reactive focus-trap
49
49
  *
50
50
  * @see https://vueuse.org/useFocusTrap
51
- * @param target The target element to trap focus within
52
- * @param options Focus trap options
53
- * @param autoFocus Focus trap automatically when mounted
54
51
  */
55
52
  declare function useFocusTrap(target: MaybeElementRef, options?: UseFocusTrapOptions): UseFocusTrapReturn;
56
53
 
@@ -48,9 +48,6 @@ interface UseFocusTrapReturn {
48
48
  * Reactive focus-trap
49
49
  *
50
50
  * @see https://vueuse.org/useFocusTrap
51
- * @param target The target element to trap focus within
52
- * @param options Focus trap options
53
- * @param autoFocus Focus trap automatically when mounted
54
51
  */
55
52
  declare function useFocusTrap(target: MaybeElementRef, options?: UseFocusTrapOptions): UseFocusTrapReturn;
56
53
 
package/useFocusTrap.d.ts CHANGED
@@ -48,9 +48,6 @@ interface UseFocusTrapReturn {
48
48
  * Reactive focus-trap
49
49
  *
50
50
  * @see https://vueuse.org/useFocusTrap
51
- * @param target The target element to trap focus within
52
- * @param options Focus trap options
53
- * @param autoFocus Focus trap automatically when mounted
54
51
  */
55
52
  declare function useFocusTrap(target: MaybeElementRef, options?: UseFocusTrapOptions): UseFocusTrapReturn;
56
53
 
package/useJwt.d.cts CHANGED
@@ -22,7 +22,6 @@ interface UseJwtReturn<Payload, Header, Fallback> {
22
22
  * Reactive decoded jwt token.
23
23
  *
24
24
  * @see https://vueuse.org/useJwt
25
- * @param jwt
26
25
  */
27
26
  declare function useJwt<Payload extends object = JwtPayload, Header extends object = JwtHeader, Fallback = null>(encodedJwt: MaybeRefOrGetter<string>, options?: UseJwtOptions<Fallback>): UseJwtReturn<Payload, Header, Fallback>;
28
27
 
package/useJwt.d.mts CHANGED
@@ -22,7 +22,6 @@ interface UseJwtReturn<Payload, Header, Fallback> {
22
22
  * Reactive decoded jwt token.
23
23
  *
24
24
  * @see https://vueuse.org/useJwt
25
- * @param jwt
26
25
  */
27
26
  declare function useJwt<Payload extends object = JwtPayload, Header extends object = JwtHeader, Fallback = null>(encodedJwt: MaybeRefOrGetter<string>, options?: UseJwtOptions<Fallback>): UseJwtReturn<Payload, Header, Fallback>;
28
27
 
package/useJwt.d.ts CHANGED
@@ -22,7 +22,6 @@ interface UseJwtReturn<Payload, Header, Fallback> {
22
22
  * Reactive decoded jwt token.
23
23
  *
24
24
  * @see https://vueuse.org/useJwt
25
- * @param jwt
26
25
  */
27
26
  declare function useJwt<Payload extends object = JwtPayload, Header extends object = JwtHeader, Fallback = null>(encodedJwt: MaybeRefOrGetter<string>, options?: UseJwtOptions<Fallback>): UseJwtReturn<Payload, Header, Fallback>;
28
27