svg-scroll-draw 2.25.0 → 2.26.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.
Files changed (122) hide show
  1. package/README.md +116 -15
  2. package/dist/angular/index.cjs +3 -3
  3. package/dist/angular/index.d.mts +60 -6
  4. package/dist/angular/index.d.ts +60 -6
  5. package/dist/angular/index.mjs +1 -1
  6. package/dist/astro/index.cjs +2 -2
  7. package/dist/astro/index.d.mts +3 -3
  8. package/dist/astro/index.d.ts +3 -3
  9. package/dist/astro/index.mjs +1 -1
  10. package/dist/cdn/svg-scroll-draw.dev.global.js +69 -31
  11. package/dist/cdn/svg-scroll-draw.global.js +2 -2
  12. package/dist/chunk-5SJE7725.mjs +1 -0
  13. package/dist/{chunk-NX74KN5X.mjs → chunk-5U4JXBHR.mjs} +1 -1
  14. package/dist/chunk-7LDSB4FT.mjs +1 -0
  15. package/dist/chunk-ASCOHQQD.mjs +2 -0
  16. package/dist/chunk-GBFWTY5L.mjs +1 -0
  17. package/dist/chunk-HAGTU5EX.mjs +1 -0
  18. package/dist/chunk-HJTHOZK5.mjs +1 -0
  19. package/dist/chunk-IXR6RML7.mjs +1 -0
  20. package/dist/chunk-KN2YB54Z.mjs +1 -0
  21. package/dist/chunk-NJV6S5LD.mjs +1 -0
  22. package/dist/chunk-UBH4K5YD.mjs +1 -0
  23. package/dist/chunk-UF3MO5XQ.mjs +1 -0
  24. package/dist/chunk-XLXVGQ3P.mjs +3 -0
  25. package/dist/chunk-YOOPMYT6.mjs +1 -0
  26. package/dist/chunk-Z72TVDHY.mjs +1 -0
  27. package/dist/cinematic/index.cjs +2 -2
  28. package/dist/cinematic/index.d.mts +3 -1
  29. package/dist/cinematic/index.d.ts +3 -1
  30. package/dist/cinematic/index.mjs +1 -1
  31. package/dist/{engine-6VsjEwzb.d.ts → engine-Bi2x8-X-.d.mts} +2 -2
  32. package/dist/{engine-BLWKCfxC.d.mts → engine-DAlvk6i0.d.ts} +2 -2
  33. package/dist/frames/index.cjs +1 -1
  34. package/dist/frames/index.d.mts +2 -2
  35. package/dist/frames/index.d.ts +2 -2
  36. package/dist/frames/index.mjs +1 -1
  37. package/dist/group/index.cjs +3 -3
  38. package/dist/group/index.d.mts +3 -3
  39. package/dist/group/index.d.ts +3 -3
  40. package/dist/group/index.mjs +1 -1
  41. package/dist/horizontal/index.cjs +1 -1
  42. package/dist/horizontal/index.d.mts +2 -2
  43. package/dist/horizontal/index.d.ts +2 -2
  44. package/dist/horizontal/index.mjs +1 -1
  45. package/dist/{index-BN8yKeQ3.d.ts → index-BMMZ8aW7.d.mts} +2 -2
  46. package/dist/{index-hSQqLVbg.d.ts → index-CEMsUTEG.d.ts} +3 -3
  47. package/dist/{index-DAiRJgtF.d.mts → index-ClAFxNEp.d.mts} +3 -3
  48. package/dist/{index-DVjblK_4.d.mts → index-MdQ4ti_z.d.ts} +2 -2
  49. package/dist/index.cjs +4 -4
  50. package/dist/index.d.mts +6 -6
  51. package/dist/index.d.ts +6 -6
  52. package/dist/index.mjs +1 -1
  53. package/dist/lenis/index.cjs +1 -1
  54. package/dist/lenis/index.d.mts +15 -16
  55. package/dist/lenis/index.d.ts +15 -16
  56. package/dist/lenis/index.mjs +1 -1
  57. package/dist/nuxt/index.cjs +3 -3
  58. package/dist/nuxt/index.d.mts +4 -3
  59. package/dist/nuxt/index.d.ts +4 -3
  60. package/dist/nuxt/index.mjs +1 -1
  61. package/dist/progress/index.cjs +1 -1
  62. package/dist/progress/index.d.mts +2 -2
  63. package/dist/progress/index.d.ts +2 -2
  64. package/dist/progress/index.mjs +1 -1
  65. package/dist/react/index.cjs +2 -2
  66. package/dist/react/index.d.mts +4 -4
  67. package/dist/react/index.d.ts +4 -4
  68. package/dist/react/index.mjs +1 -1
  69. package/dist/reveal/index.cjs +1 -1
  70. package/dist/reveal/index.d.mts +2 -2
  71. package/dist/reveal/index.d.ts +2 -2
  72. package/dist/reveal/index.mjs +1 -1
  73. package/dist/{scroll-draw-Fzir8hlU.d.mts → scroll-draw-CKZysh22.d.mts} +1 -1
  74. package/dist/{scroll-draw-BsU_Ohmu.d.ts → scroll-draw-DbY8RUJE.d.ts} +1 -1
  75. package/dist/snap/index.cjs +1 -1
  76. package/dist/snap/index.d.mts +2 -2
  77. package/dist/snap/index.d.ts +2 -2
  78. package/dist/snap/index.mjs +1 -1
  79. package/dist/solid/index.cjs +3 -3
  80. package/dist/solid/index.d.mts +40 -4
  81. package/dist/solid/index.d.ts +40 -4
  82. package/dist/solid/index.mjs +1 -1
  83. package/dist/svelte/index.cjs +3 -3
  84. package/dist/svelte/index.d.mts +47 -4
  85. package/dist/svelte/index.d.ts +47 -4
  86. package/dist/svelte/index.mjs +1 -1
  87. package/dist/text/index.cjs +1 -1
  88. package/dist/text/index.d.mts +2 -2
  89. package/dist/text/index.d.ts +2 -2
  90. package/dist/text/index.mjs +1 -1
  91. package/dist/timeline/index.cjs +10 -10
  92. package/dist/timeline/index.d.mts +2 -2
  93. package/dist/timeline/index.d.ts +2 -2
  94. package/dist/timeline/index.mjs +2 -2
  95. package/dist/{types-9bcJdVcg.d.mts → types-iITMwrru.d.mts} +10 -2
  96. package/dist/{types-9bcJdVcg.d.ts → types-iITMwrru.d.ts} +10 -2
  97. package/dist/video/index.cjs +1 -1
  98. package/dist/video/index.d.mts +2 -2
  99. package/dist/video/index.d.ts +2 -2
  100. package/dist/video/index.mjs +1 -1
  101. package/dist/vue/index.cjs +3 -3
  102. package/dist/vue/index.d.mts +4 -7
  103. package/dist/vue/index.d.ts +4 -7
  104. package/dist/vue/index.mjs +1 -1
  105. package/dist/web-component/index.cjs +3 -3
  106. package/dist/web-component/index.mjs +1 -1
  107. package/dist/wrapper-BOHrDnBO.d.mts +8 -0
  108. package/dist/wrapper-Cm7JTIVl.d.ts +8 -0
  109. package/package.json +1 -1
  110. package/dist/chunk-22P4KBPG.mjs +0 -1
  111. package/dist/chunk-32ZCSGFZ.mjs +0 -1
  112. package/dist/chunk-7USW2XFB.mjs +0 -1
  113. package/dist/chunk-7XOFQCQE.mjs +0 -3
  114. package/dist/chunk-BDXWPUBJ.mjs +0 -2
  115. package/dist/chunk-BRV2B2YW.mjs +0 -1
  116. package/dist/chunk-D2BHE4F2.mjs +0 -1
  117. package/dist/chunk-QZKYGS74.mjs +0 -1
  118. package/dist/chunk-THPTANES.mjs +0 -1
  119. package/dist/chunk-U5TKLHGW.mjs +0 -1
  120. package/dist/chunk-V3Z6G5JE.mjs +0 -1
  121. package/dist/chunk-WKOT2MND.mjs +0 -1
  122. package/dist/chunk-XSVTHCLO.mjs +0 -1
@@ -1 +0,0 @@
1
- import {a}from'./chunk-7USW2XFB.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';var n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function b(e,o){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;return r?a(r,o):(b$1("scrollAnimate: element not found:",e),n)}function P(e,o={}){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return b$1("scrollParallax: element not found:",e),n;let{speed:c=.3,axis:p="y",easing:f="linear",trigger:u,onProgress:g}=o,i=-c*100,s=r.style,m=!!r.ownerSVGElement,y=s.getPropertyValue("transform-box");m&&s.setProperty("transform-box","fill-box");let l=a(r,{props:p==="x"?{transform:["translateX(0%)",`translateX(${i}%)`]}:{transform:["translateY(0%)",`translateY(${i}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:f,native:false,onProgress:g});return m?{...l,destroy(){l.destroy(),s.setProperty("transform-box",y);}}:l}export{b as a,P as b};
@@ -1 +0,0 @@
1
- function M({tension:n=2.5,friction:a=2.2}={}){return t=>1-Math.cos(t*Math.PI*n)*Math.pow(1-t,a)}function p({bounces:n=3,decay:a=.5}={}){let t=Math.max(1,Math.round(n)),o=Math.max(.01,Math.min(.99,a)),c=Math.sqrt(o),u=0,m=[];for(let r=0;r<t;r++){let e=Math.pow(c,r);m.push(e),u+=e;}let s=[0],b=0;for(let r=0;r<t;r++)b+=m[r]/u,s.push(b);return r=>{if(r<=0)return 0;if(r>=1)return 1;for(let e=0;e<t;e++)if(r<=s[e+1]){let i=(r-s[e])/(s[e+1]-s[e]);if(e===0)return i*(2-i);let h=1-Math.pow(o,e);return h+(1-h)*(2*i-1)*(2*i-1)}return 1}}function f({amplitude:n=1,period:a=.4}={}){let t=Math.max(1,n),o=Math.max(.1,a),c=t<=1?o/4:o/(2*Math.PI)*Math.asin(1/t);return u=>u<=0?0:u>=1?1:t*Math.pow(2,-10*u)*Math.sin((u-c)*(2*Math.PI)/o)+1}var l={linear:n=>n,"ease-in":n=>n*n,"ease-out":n=>n*(2-n),"ease-in-out":n=>n<.5?2*n*n:-1+(4-2*n)*n,spring:M(),bounce:p(),elastic:f()};export{M as a,p as b,f as c,l as d};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,b as b$1,e,c}from'./chunk-NV6YTPHI.mjs';import {d}from'./chunk-THPTANES.mjs';import {a as a$2,b as b$2}from'./chunk-EBU6E26L.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var C={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function U(t,p){if(typeof window>"u")return C;let a$1=typeof t=="string"?document.querySelector(t):t;return a$1?a(p,(l,c)=>B(a$1,l,c)):(b("scrollCounter: element not found:",t),C)}function B(t,p,a){let{from:l=0,to:c$1,format:F,easing:f="ease-out",trigger:P={},once:E=true,decimals:M,onComplete:v}=p,x=M!==void 0?e=>e.toFixed(M):F??(e=>String(Math.round(e))),d$1=typeof f=="function"?f:d[f]??d["ease-out"],G=a$1(P.start||"top 80%"),L=a$1(P.end||"top 20%");if(a)return t.textContent=x(c$1),v?.(),{...C,getProgress:()=>1};let s=0,i=0,T=false,h=-1,o=0,n=0,u=false,w=()=>window.scrollY,V=()=>window.innerHeight;function A(){let e=t.getBoundingClientRect(),r=c({top:e.top,height:e.height},w(),V(),G,L);T&&Math.abs(r.tStart-s)<1&&Math.abs(r.tEnd-i)<1||(T=true,s=r.tStart,i=r.tEnd);}let _=t.style.getPropertyValue("--scroll-draw-progress");function m(e){t.textContent=x(l+(c$1-l)*e),t.style.setProperty("--scroll-draw-progress",String(e));}let I=()=>b$1(w(),s,i,1);function q(){let e=I(),r=E?Math.max(h,d$1(o=Math.max(o,e))):d$1(e);n=r,m(r),r>=1&&!u?(u=true,v?.()):r<1&&!E&&(u=false);}A();{o=b$1(w(),s,i,1);let e=d$1(o);n=e,m(e);}let g=e(window,[t],I,q,A);a$2(t,{type:"counter",getProgress:()=>n,getTrigger:()=>({tStart:s,tEnd:i})});let O=()=>g.hold(false);return {destroy(){g.off(),t.style.setProperty("--scroll-draw-progress",_),b$2(t);},replay(){h=-1,o=0,u=false,n=0,m(0),O();},pause:()=>g.hold(true),resume:O,seek(e){let r=Math.min(1,Math.max(0,e));n=r,h=r,o=0,g.hold(true),m(r);},getProgress(){return n}}}export{U as a};
@@ -1 +0,0 @@
1
- import {d}from'./chunk-THPTANES.mjs';function u(t){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(t);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let e=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(e)return [parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(t);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function l(t,r,e){let n=u(t),s=u(r);return !n||!s?t:`rgb(${Math.round(n[0]+(s[0]-n[0])*e)},${Math.round(n[1]+(s[1]-n[1])*e)},${Math.round(n[2]+(s[2]-n[2])*e)})`}var o="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",c="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",a=33;function p(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function f(t){let r=[];for(let e=0;e<a;e++){let n=e/(a-1);r.push(String(Math.round(t(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function g(t){switch(t){case "linear":return "linear";case "ease-in":return o;case "ease-out":return c;case "ease-in-out":return p()?f(d["ease-in-out"]):null;default:return null}}export{l as a,g as b};
@@ -1 +0,0 @@
1
- import {b,a as a$4}from'./chunk-22P4KBPG.mjs';import {a as a$6}from'./chunk-D2BHE4F2.mjs';import {a,b as b$1}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-BRV2B2YW.mjs';import {a as a$5}from'./chunk-32ZCSGFZ.mjs';import {a as a$2}from'./chunk-U5TKLHGW.mjs';import {a as a$1}from'./chunk-7USW2XFB.mjs';import {b as b$2}from'./chunk-7XOFQCQE.mjs';import {b as b$3}from'./chunk-LFSU6LR3.mjs';import {defineComponent,ref,h,onMounted,watch,onUnmounted,unref}from'vue';var u=e=>typeof e=="function"?e():unref(e);function l(e,t,n,s=a){let o=null,i=t(),O=()=>{o?.destroy(),o=e.value?n(e.value,b$1(i,()=>i),i):null;};onMounted(O),watch(()=>s(i=t()),O),onUnmounted(()=>{o?.destroy(),o=null;});}function K(e={}){let t=ref(null);return l(t,()=>u(e),b$2),t}var C={preset:0,selector:0,speed:0,fade:1,easing:0,trigger:0,stagger:0,direction:0,once:1,debug:1,axis:0,scrollContainer:0,autoReverse:1,delay:0,strokeColor:0,strokeWidth:0,fillOpacity:0,clip:2,waypoints:0,velocityScale:3,threshold:0,rootMargin:0,repeat:0,repeatDelay:0,morphTo:0,onProgress:0,onStart:0,onComplete:0,onEnter:0,onLeave:0,onEnterBack:0,onLeaveBack:0,autoplay:1,duration:0,native:1},H=[null,Boolean,[Boolean,String],[Boolean,Number]],y=e=>({type:e,default:void 0}),P=defineComponent({name:"ScrollDraw",props:Object.fromEntries(Object.entries(C).map(([e,t])=>[e,t?y(H[t]):null])),setup(e,{slots:t}){let n=ref(null);return l(n,()=>{let s={};for(let o in C){let i=e[o];i!=null&&(s[o]=i);}return s},b$2),()=>h("div",{ref:n},t.default?.())}});function Y(e){let t=ref(null);return l(t,()=>u(e),a$1),t}var _=defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:t}){let n=ref(null);return l(n,()=>e.options,a$1),()=>h("div",{ref:n},t.default?.())}});function W(e){let t=ref(null);return l(t,()=>u(e),a$2),t}var U=defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:y(Boolean),decimals:{type:Number},onComplete:{type:Function}},setup(e){let t=ref(null);return l(t,()=>{let n={to:e.to};return e.from!=null&&(n.from=e.from),e.format!=null&&(n.format=e.format),e.easing!=null&&(n.easing=e.easing),e.trigger!=null&&(n.trigger=e.trigger),e.once!=null&&(n.once=e.once),e.decimals!=null&&(n.decimals=e.decimals),e.onComplete!=null&&(n.onComplete=e.onComplete),n},a$2),()=>h("span",{ref:t})}});function $(e={}){let t=ref(null);return l(t,()=>u(e),a$3),t}var z=defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let t=ref(null);return l(t,()=>e.options??{},a$3),()=>h("video",{ref:t,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}}),F=(e,{triggerElement:t,...n},s)=>{let o=typeof t=="string"?document.querySelector(t):t;return typeof t=="string"&&!o&&b$3(`<ScrollFrames>: triggerElement "${t}" matches nothing; measuring the canvas.`),a$6(e,{...n,frames:s.frames,triggerElement:o??void 0})};function J(e){let t=ref(null);return l(t,()=>u(e),F,a$4),t}var M={frames:0,count:0,trigger:0,easing:0,once:1,axis:0,triggerElement:0,fit:0,concurrency:0,onReady:0,onLoad:0,onComplete:0,onProgress:0},Q=defineComponent({name:"ScrollFrames",props:Object.fromEntries(Object.entries(M).map(([e,t])=>[e,t?y(Boolean):e==="frames"?{required:true}:null])),setup(e){let t=ref(null);return l(t,()=>{let n={};for(let s in M){let o=e[s];o!=null&&(n[s]=o);}return n},F,a$4),onMounted(()=>b(t.value)),()=>h("canvas",{ref:t,role:"img"})}});function X(e={}){let t=ref(null);return l(t,()=>u(e),a$5),t}var Z=defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:t}){let n=ref(null);return l(n,()=>e.options??{},a$5),()=>h(e.tag,{ref:n},t.default?.())}});export{K as a,P as b,Y as c,_ as d,W as e,U as f,$ as g,z as h,J as i,Q as j,X as k,Z as l};
@@ -1 +0,0 @@
1
- var i=new WeakMap,u=0;function f(t){return JSON.stringify(t,(o,n)=>{if(typeof n=="function")return "\u0192";if(typeof Element<"u"&&n instanceof Element){let e=i.get(n);return e===void 0&&i.set(n,e=++u),`el#${e}`}return n})}function s(t,o){let n={...t};for(let e of Object.keys(n))typeof n[e]=="function"&&(n[e]=(...r)=>o()[e]?.(...r));return n}export{f as a,s as b};