aptechka 0.2.0 → 0.2.2
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/lib/ComponentElement-BUesLP4b.cjs +1 -0
- package/lib/ComponentElement-NMlh1Ptn.js +92 -0
- package/lib/Composed-ClTo1f0b.js +79 -0
- package/lib/Composed-Mdr4ZFbI.cjs +1 -0
- package/lib/ElementConstructor-B61ZFTEB.cjs +1 -0
- package/lib/{ElementConstructor-1bvPqYNa.js → ElementConstructor-CvNdPKJy.js} +6 -5
- package/lib/abstract-elements/index.cjs +1 -1
- package/lib/abstract-elements/index.js +1 -1
- package/lib/animation/hooks/index.cjs +1 -0
- package/lib/animation/hooks/index.d.ts +8 -0
- package/lib/animation/hooks/index.js +38 -0
- package/lib/attribute/hooks/index.d.ts +2 -0
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.d.ts +0 -2
- package/lib/attribute/index.js +35 -50
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +2 -2
- package/lib/controls/hooks/index.d.ts +1 -0
- package/lib/{createStylesheet-B5Nhxdpo.cjs → createStylesheet-C0OnN0Br.cjs} +1 -1
- package/lib/{createStylesheet-DpGvTRP3.js → createStylesheet-CD11E4C8.js} +1 -1
- package/lib/{createTheme-CLqJF9Pw.cjs → createTheme-B_W5dUY9.cjs} +1 -1
- package/lib/{createTheme-WJyOPh-q.js → createTheme-D0IoYkYN.js} +1 -1
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.js +4 -4
- package/lib/element-resizer/hooks/index.cjs +1 -0
- package/lib/element-resizer/hooks/index.d.ts +4 -0
- package/lib/element-resizer/hooks/index.js +12 -0
- package/lib/en3/index.cjs +7 -7
- package/lib/en3/index.d.ts +1 -0
- package/lib/en3/index.js +639 -620
- package/lib/en3/utils/getCurrentViewport.d.ts +7 -0
- package/lib/{index-BNZNGmrW.cjs → index--wI4MTuv.cjs} +1 -1
- package/lib/{index-DMIfOO2r.js → index-Dq6GRJ9W.js} +2 -2
- package/lib/instantiate-BAz2WZtO.cjs +1 -0
- package/lib/instantiate-BDteLwW6.js +55 -0
- package/lib/intersector/hooks/index.cjs +1 -0
- package/lib/intersector/hooks/index.d.ts +4 -0
- package/lib/intersector/hooks/index.js +12 -0
- package/lib/jsx/hooks/index.cjs +1 -0
- package/lib/jsx/hooks/index.d.ts +7 -0
- package/lib/jsx/hooks/index.js +76 -0
- package/lib/jsx/hooks/useContext.d.ts +2 -2
- package/lib/jsx/index.cjs +1 -1
- package/lib/jsx/index.d.ts +2 -9
- package/lib/jsx/index.js +11 -95
- package/lib/jsx/instantiate.d.ts +1 -0
- package/lib/jsx/register.d.ts +1 -0
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +82 -81
- package/lib/modal/index.cjs +1 -1
- package/lib/modal/index.js +2 -2
- package/lib/object-BZELAoVj.cjs +1 -0
- package/lib/object-R34VLqhp.js +85 -0
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +21 -21
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +2 -2
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/slicer/DecoderElement.d.ts +10 -0
- package/lib/slicer/Letter.d.ts +11 -0
- package/lib/slicer/SlicerElement.d.ts +21 -0
- package/lib/slicer/Word.d.ts +16 -0
- package/lib/slicer/index.cjs +11 -0
- package/lib/slicer/index.d.ts +4 -0
- package/lib/slicer/index.js +165 -0
- package/lib/store/hooks/index.cjs +1 -0
- package/lib/{jsx/hooks/useStore.d.ts → store/hooks/index.d.ts} +1 -1
- package/lib/store/hooks/index.js +31 -0
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +48 -111
- package/lib/string-3lAkpJJP.js +51 -0
- package/lib/string-vBu90jhV.cjs +1 -0
- package/lib/studio/index.cjs +1 -1
- package/lib/studio/index.js +6 -5
- package/lib/{tags-D0k7-iVY.js → tags-C2jg1zYB.js} +1 -1
- package/lib/{tags-DGIuh1Hi.cjs → tags-DX-eNxbA.cjs} +1 -1
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.d.ts +1 -1
- package/lib/theme/index.js +3 -3
- package/lib/ticker/hooks/index.cjs +1 -0
- package/lib/ticker/hooks/index.d.ts +5 -0
- package/lib/ticker/hooks/index.js +23 -0
- package/lib/ticker/index.d.ts +1 -1
- package/lib/useConnect-CXdqKdRX.js +9 -0
- package/lib/useConnect-DcfeqwzW.cjs +1 -0
- package/lib/useCreate-ClGKVMeG.cjs +1 -0
- package/lib/useCreate-DQSfJu7r.js +7 -0
- package/lib/useDisconnect-D5cBD1bq.js +9 -0
- package/lib/useDisconnect-sA74z4IZ.cjs +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +28 -27
- package/lib/utils/ts-utility.d.ts +5 -0
- package/lib/window-resizer/hooks/index.cjs +1 -0
- package/lib/window-resizer/hooks/index.d.ts +2 -0
- package/lib/window-resizer/hooks/index.js +9 -0
- package/package.json +67 -2
- package/lib/ElementConstructor-CdUaQS-S.cjs +0 -1
- package/lib/getComponentElement-B0Qb2RbZ.js +0 -145
- package/lib/getComponentElement-BcreYwFe.cjs +0 -1
- package/lib/jsx/getComponentElement.d.ts +0 -2
- package/lib/string-Cgp_uJvP.cjs +0 -1
- package/lib/string-DCGBU6em.js +0 -134
package/lib/scroll/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Ct=(s,e,i)=>{if(!e.has(s))throw TypeError("Cannot "+i)};var h=(s,e,i)=>(Ct(s,e,"read from private field"),i?i.call(s):e.get(s)),D=(s,e,i)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,i)},O=(s,e,i,n)=>(Ct(s,e,"write to private field"),n?n.call(s,i):e.set(s,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const qt=require("../Store-D0_rDIsE.cjs"),Dt=require("../Derived-SjPdLJiZ.cjs"),At=require("../browser-CpzFX2xg.cjs"),I=require("../layout-8ryRAMGJ.cjs"),zt=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const Tt=require("../Damped-mdFs8WSd.cjs"),x=require("../attribute/index.cjs"),Mt=require("../WheelControls-Dc1xcVG6.cjs"),gt=require("../custom-element/index.cjs"),xt=require("../order/index.cjs"),pt=require("../window-resizer/index.cjs"),H=require("../scroll-entries/index.cjs"),P=require("../tags-DGIuh1Hi.cjs"),Lt=require("../createStylesheet-B5Nhxdpo.cjs"),Vt=require("../dom-qY2LdCVL.cjs");var It=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,Ft=(s,e,i,n)=>{for(var r=n>1?void 0:n?Ht(e,i):e,d=s.length-1,g;d>=0;d--)(g=s[d])&&(r=(n?g(e,i,r):g(r))||r);return n&&r&&It(e,i,r),r},yt=(s,e,i)=>{if(!e.has(s))throw TypeError("Cannot "+i)},t=(s,e,i)=>(yt(s,e,"read from private field"),i?i.call(s):e.get(s)),l=(s,e,i)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,i)},m=(s,e,i,n)=>(yt(s,e,"write to private field"),n?n.call(s,i):e.set(s,i),i),f=(s,e,i)=>(yt(s,e,"access private method"),i),a,M,T,$,V,X,y,Y,j,tt,u,dt,c,et,it,_,p,k,F,b,G,R,N,ft,B,U,mt,kt,bt,Wt,st,vt,rt,_t,q,wt,St,Ot,nt,ht,Et,S,w,L,W;class Bt{constructor(e,i){D(this,S,void 0);D(this,w,void 0);D(this,L,0);D(this,W,0);O(this,S,e),O(this,w,i),H.scrollEntries.register(h(this,S))}get size(){return h(this,L)}get position(){return h(this,W)}destroy(){H.scrollEntries.unregister(h(this,S)),h(this,S).style.transform=""}resize(){O(this,L,h(this,w).vertical?h(this,S).offsetHeight:h(this,S).offsetWidth),O(this,W,h(this,w).vertical?I.getCumulativeOffsetTop(h(this,S)):I.getCumulativeOffsetLeft(h(this,S))),O(this,W,h(this,W)-h(this,w).contentPosition)}transform(){let e=0;h(this,w).infiniteAttribute.current&&h(this,w).overscroll&&h(this,W)+h(this,L)<h(this,w).currentScrollValue&&(e=h(this,w).distance*-1),H.scrollEntries.update(h(this,S),h(this,w).axisAttibute.current,e);const i=h(this,w).viewportSize-h(this,L),n=zt.clamp(h(this,w).currentScrollValue+e,h(this,W)-h(this,w).viewportSize-i,h(this,W)+h(this,L)+i);h(this,w).vertical?h(this,S).style.transform=`translate3d(0px, ${n*-1}px, 0px)`:h(this,S).style.transform=`translate3d(${n*-1}px, 0px, 0px)`}}S=new WeakMap,w=new WeakMap,L=new WeakMap,W=new WeakMap;const Gt=Lt.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},':host([hibernated="true"])':{display:"contents"},".static":{position:"absolute",top:"0",left:"0",zIndex:"1",width:"100%",height:"100%"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)"},':host([hibernated="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});exports.ScrollElement=class extends gt.CustomElement{constructor(e){if(super(),l(this,N),l(this,B),l(this,mt),l(this,bt),l(this,st),l(this,rt),l(this,St),l(this,ht),l(this,a,null),l(this,M,new x.Attribute(this,"axis","y")),l(this,T,new x.Attribute(this,"pages",0,{validate:i=>Math.max(0,i-1)})),l(this,$,new x.Attribute(this,"split",!1)),l(this,V,new x.Attribute(this,"sectional",!1)),l(this,X,new x.Attribute(this,"wheel-max-delta",!1)),l(this,y,new x.Attribute(this,"infinite",!1)),l(this,Y,new x.Attribute(this,"damping",.03)),l(this,j,new x.Attribute(this,"disabled",!1)),l(this,tt,new x.Attribute(this,"hibernated",!1)),l(this,u,null),l(this,dt,null),l(this,c,[]),l(this,et,0),l(this,it,0),l(this,_,0),l(this,p,0),l(this,k,null),l(this,F,null),l(this,b,new qt.Store(0)),l(this,G,0),l(this,R,0),l(this,q,()=>{const i=this.currentScrollValue/t(this,p);if(m(this,et,this.vertical?I.getCumulativeOffsetTop(this):I.getCumulativeOffsetLeft(this)),m(this,it,this.vertical?I.getCumulativeOffsetTop(t(this,u)):I.getCumulativeOffsetLeft(t(this,u))),m(this,_,this.vertical?this.offsetHeight:this.offsetWidth),t(this,T).current){m(this,p,t(this,_)*t(this,T).current);const n=t(this,p)+t(this,_);this.vertical?(t(this,u).style.width=n+"px",t(this,u).style.height="100%"):(t(this,u).style.height=n+"px",t(this,u).style.width="100%")}else this.vertical?(t(this,u).style.width="100%",t(this,u).style.height="max-content",m(this,p,t(this,u).offsetHeight-t(this,_))):(t(this,u).style.width="max-content",t(this,u).style.height="100%",m(this,p,t(this,u).offsetWidth-t(this,_)));if(!t(this,y).current){const n=getComputedStyle(this);m(this,p,t(this,p)+(this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd))),t(this,a).max.current=t(this,p)}if(t(this,c).forEach(n=>{n.resize(),n.transform()}),t(this,y).current&&t(this,c).length){const n=t(this,c)[t(this,c).length-1],r=n.position+n.size-t(this,_),d=t(this,p)-r;m(this,R,n.position+n.size+d)}else m(this,R,t(this,p));if(t(this,V).current&&t(this,c).length){const n=t(this,c)[t(this,b).current];t(this,a).set(n.position,!0)}else t(this,a).set(i*t(this,p),!0)}),l(this,wt,()=>{const i=this.currentScrollValue;if(m(this,G,Math.max(0,i-t(this,p))),t(this,c).length){let n=0;for(let r=0;r<t(this,c).length;r++){const d=t(this,c)[r];d.transform(),this.targetScrollValue+this.viewportSize/2>=d.position&&(n=r)}t(this,b).current=n}else this.vertical?t(this,u).style.transform=`translate3d(0px, ${i*-1}px, 0px)`:t(this,u).style.transform=`translate3d(${i*-1}px, 0px, 0px)`;H.scrollEntries.update(this,t(this,M).current,i)}),l(this,nt,i=>{if(typeof i=="number")if(t(this,V).current){const n=Math.sign(i);t(this,c).length?this.shiftSections(n):t(this,a).shift(n*t(this,_))}else t(this,a).shift(i);else i==="min"?t(this,a).set(t(this,a).min.current):i==="max"&&t(this,a).set(t(this,a).delta)}),At.isBrowser){let i,n=e||this.getAttribute("name");n&&(i={name:n}),m(this,a,new Tt.Damped({damping:.01,min:0,order:xt.TICK_ORDER.SCROLL,passport:i})),this.openShadow(Gt),P.element(this,{tabIndex:0,children:[P.div({class:"static",children:[P.slot({name:"static"})]}),P.div({class:"content",children:[P.slot({ref:r=>m(this,dt,r)})],style:{flexDirection:new Dt.Derived(t(this,M),r=>r==="x"?"row":"column")},ref:r=>m(this,u,r)})]}),m(this,k,new Mt.WheelControls({element:this})),t(this,k).changeEvent.subscribe(t(this,nt)),m(this,F,new Mt.KeyboardControls({element:this})),t(this,F).changeEvent.subscribe(t(this,nt)),t(this,M).subscribe(({current:r})=>{t(this,u).style.flexDirection=r==="x"?"row":"column",t(this,k).axis=t(this,X).current?"max":r,this.isConnected&&t(this,q).call(this)}),t(this,X).subscribe(r=>{t(this,k).axis=r.current?"max":t(this,M).current}),t(this,T).subscribe(()=>{this.isConnected&&t(this,q).call(this)}),t(this,$).subscribe(({current:r})=>{this.isConnected&&(r?f(this,N,ft).call(this):f(this,B,U).call(this))}),t(this,V).subscribe(r=>{t(this,b).current=0,t(this,k).debounce=r.current,t(this,a).reset(),this.isConnected&&(r.current&&!r.previous?f(this,N,ft).call(this):!r.current&&r.previous&&f(this,B,U).call(this))}),t(this,y).subscribe(r=>{r.current?(this.isConnected&&(t(this,c).length||(t(this,$).current=!0)),t(this,c).length&&(t(this,a).max.current=1/0,t(this,a).min.current=-1/0)):(m(this,G,0),t(this,a).max.current=t(this,p),t(this,a).min.current=0)}),t(this,Y).subscribe(r=>{t(this,a).damping=r.current}),t(this,j).subscribe(r=>{r.current&&!r.previous?f(this,mt,kt).call(this):!r.current&&r.previous&&f(this,bt,Wt).call(this)}),t(this,tt).subscribe(r=>{r.current&&!r.previous?f(this,st,vt).call(this):!r.current&&r.previous&&f(this,rt,_t).call(this)})}}get currentScrollValue(){return f(this,ht,Et).call(this,"current")}get targetScrollValue(){return f(this,ht,Et).call(this,"target")}get damped(){return t(this,a)}get dampedAttibute(){return t(this,a)}get axisAttibute(){return t(this,M)}get pagesAttibute(){return t(this,T)}get splitAttibute(){return t(this,$)}get sectionalAttibute(){return t(this,V)}get infiniteAttribute(){return t(this,y)}get dampingAttibute(){return t(this,Y)}get disabledAttibute(){return t(this,j)}get hibernatedAttibute(){return t(this,tt)}get contentElement(){return t(this,u)}get position(){return t(this,et)}get contentPosition(){return t(this,it)}get viewportSize(){return t(this,_)}get scrollSize(){return t(this,p)}get counter(){return t(this,b)}get distance(){return t(this,R)}get overscroll(){return t(this,G)}get vertical(){return t(this,M).current==="y"}get currentProgress(){return this.currentScrollValue/t(this,R)}get targetProgress(){return this.targetScrollValue/t(this,R)}scrollToSection(e,i="smooth"){if(!t(this,c).length)return;const n=t(this,b).current;f(this,St,Ot).call(this,e);const r=t(this,c)[n],d=t(this,c)[t(this,b).current];if(r&&d){let g=0;const Q=t(this,c).length-1;t(this,y).current?t(this,b).current===0&&n===Q?g=t(this,p)+t(this,_)-r.position:t(this,b).current===Q&&n===0?g=d.position-(t(this,p)+t(this,_)):g=d.position-r.position:g=d.position-r.position,t(this,a).shift(g,i==="instant")}}shiftSections(e,i="smooth"){t(this,c).length&&this.scrollToSection(t(this,b).current+e,i)}connectedCallback(){f(this,rt,_t).call(this)}disconnectedCallback(){f(this,st,vt).call(this)}};a=new WeakMap;M=new WeakMap;T=new WeakMap;$=new WeakMap;V=new WeakMap;X=new WeakMap;y=new WeakMap;Y=new WeakMap;j=new WeakMap;tt=new WeakMap;u=new WeakMap;dt=new WeakMap;c=new WeakMap;et=new WeakMap;it=new WeakMap;_=new WeakMap;p=new WeakMap;k=new WeakMap;F=new WeakMap;b=new WeakMap;G=new WeakMap;R=new WeakMap;N=new WeakSet;ft=function(){f(this,B,U).call(this),t(this,dt).assignedElements().forEach(s=>{s instanceof HTMLElement&&t(this,c).push(new Bt(s,this))}),t(this,u).style.transform="",t(this,q).call(this)};B=new WeakSet;U=function(){t(this,c).forEach(s=>{s.destroy()}),m(this,c,[])};mt=new WeakSet;kt=function(){t(this,a).unsubscribe(t(this,wt)),t(this,a).unlistenAnimationFrame(),t(this,k).disconnect(),t(this,F).disconnect()};bt=new WeakSet;Wt=function(){t(this,a).subscribe(t(this,wt)),t(this,k).connect(),t(this,F).connect()};st=new WeakSet;vt=function(){pt.windowResizer.unsubscribe(t(this,q)),t(this,a).reset(),f(this,mt,kt).call(this),t(this,u).style.transform="",t(this,$).current&&f(this,B,U).call(this),H.scrollEntries.unregister(this)};rt=new WeakSet;_t=function(){t(this,$).current&&f(this,N,ft).call(this),H.scrollEntries.register(this),pt.windowResizer.subscribe(t(this,q),xt.RESIZE_ORDER.SCROLL),f(this,bt,Wt).call(this)};q=new WeakMap;wt=new WeakMap;St=new WeakSet;Ot=function(s){t(this,y).current?(t(this,b).current=s%t(this,c).length,t(this,b).current=t(this,b).current<0?t(this,c).length+t(this,b).current:t(this,b).current):t(this,b).current=zt.clamp(s,0,t(this,c).length-1)};nt=new WeakMap;ht=new WeakSet;Et=function(s="current"){if(t(this,y).current&&t(this,c).length){const e=t(this,a)[s]%(t(this,p)+t(this,_));return e<0?t(this,p)+e+t(this,_):e}else return t(this,a)[s]};exports.ScrollElement=Ft([gt.define("e-scroll")],exports.ScrollElement);var J;class Kt extends gt.CustomElement{constructor(){super(...arguments);D(this,J,null)}get scrollElement(){return h(this,J)}connectedCallback(){const i=Vt.findParentElement(this,exports.ScrollElement);i instanceof exports.ScrollElement?O(this,J,i):console.error(this,"e-scroll not found")}}J=new WeakMap;var Zt=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,Ut=(s,e,i,n)=>{for(var r=n>1?void 0:n?Nt(e,i):e,d=s.length-1,g;d>=0;d--)(g=s[d])&&(r=(n?g(e,i,r):g(r))||r);return n&&r&&Zt(e,i,r),r},Rt=(s,e,i)=>{if(!e.has(s))throw TypeError("Cannot "+i)},o=(s,e,i)=>(Rt(s,e,"read from private field"),i?i.call(s):e.get(s)),E=(s,e,i)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,i)},C=(s,e,i,n)=>(Rt(s,e,"write to private field"),n?n.call(s,i):e.set(s,i),i),lt,v,A,z,K,Z,ot,at,ct,ut;const Jt=Lt.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#efefef"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"#181818",borderRadius:"1vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}});exports.ScrollbarElement=class extends Kt{constructor(){super(),E(this,lt,null),E(this,v,null),E(this,A,!1),E(this,z,0),E(this,K,0),E(this,Z,0),E(this,ot,()=>{C(this,A,this.offsetWidth>this.offsetHeight);const e=o(this,A)?this.offsetWidth:this.offsetHeight;C(this,z,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),C(this,z,Math.max(o(this,z),30)),o(this,A)?(o(this,v).style.width=o(this,z)+"px",o(this,v).style.height="100%"):(o(this,v).style.width="100%",o(this,v).style.height=o(this,z)+"px"),C(this,K,e-o(this,z)),this.scrollElement.scrollSize||(this.style.display="none")}),E(this,at,()=>{C(this,Z,this.scrollElement.currentProgress*o(this,K)),o(this,A)?o(this,v).style.transform=`translate3d(${o(this,Z)}px, 0px, 0px)`:o(this,v).style.transform=`translate3d(0px, ${o(this,Z)}px, 0px)`}),E(this,ct,()=>{this.setAttribute("axis",this.scrollElement.axisAttibute.current)}),E(this,ut,e=>{const i=g=>{const Q=o(this,A)?g.x:g.y,Pt=this.scrollElement.distance/o(this,K),$t=(Q-d)*Pt;this.scrollElement.damped.set(r+$t)},n=()=>{removeEventListener("pointermove",i),removeEventListener("pointerup",n),removeEventListener("touchend",n)};addEventListener("pointermove",i),addEventListener("pointerup",n),addEventListener("touchend",n);const r=this.scrollElement.damped.target,d=o(this,A)?e.x:e.y}),At.isBrowser&&(this.openShadow(Jt),P.element(this,{children:[P.slot({ref:e=>C(this,lt,e)})]}))}get thumbElement(){return o(this,v)}connectedCallback(){super.connectedCallback();const e=o(this,lt).assignedElements()[0];e instanceof HTMLElement?C(this,v,e):(C(this,v,document.createElement("div")),o(this,v).classList.add("default-thumb"),this.shadowRoot.appendChild(o(this,v))),o(this,v).addEventListener("pointerdown",o(this,ut)),pt.windowResizer.subscribe(o(this,ot),xt.RESIZE_ORDER.SCROLL+1),this.scrollElement.damped.subscribe(o(this,at)),this.scrollElement.axisAttibute.subscribe(o(this,ct))}disconnectedCallback(){o(this,v).removeEventListener("pointerdown",o(this,ut)),pt.windowResizer.unsubscribe(o(this,ot)),this.scrollElement.damped.unsubscribe(o(this,at)),this.scrollElement.axisAttibute.unsubscribe(o(this,ct))}};lt=new WeakMap;v=new WeakMap;A=new WeakMap;z=new WeakMap;K=new WeakMap;Z=new WeakMap;ot=new WeakMap;at=new WeakMap;ct=new WeakMap;ut=new WeakMap;exports.ScrollbarElement=Ut([gt.define("e-scrollbar")],exports.ScrollbarElement);
|
|
1
|
+
"use strict";var Ct=(s,e,i)=>{if(!e.has(s))throw TypeError("Cannot "+i)};var h=(s,e,i)=>(Ct(s,e,"read from private field"),i?i.call(s):e.get(s)),D=(s,e,i)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,i)},O=(s,e,i,n)=>(Ct(s,e,"write to private field"),n?n.call(s,i):e.set(s,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const qt=require("../Store-D0_rDIsE.cjs"),Dt=require("../Derived-SjPdLJiZ.cjs"),At=require("../browser-CpzFX2xg.cjs"),I=require("../layout-8ryRAMGJ.cjs"),zt=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const Tt=require("../Damped-mdFs8WSd.cjs"),x=require("../attribute/index.cjs"),Mt=require("../WheelControls-Dc1xcVG6.cjs"),gt=require("../custom-element/index.cjs"),xt=require("../order/index.cjs"),pt=require("../window-resizer/index.cjs"),H=require("../scroll-entries/index.cjs"),P=require("../tags-DX-eNxbA.cjs"),Lt=require("../createStylesheet-C0OnN0Br.cjs"),Vt=require("../dom-qY2LdCVL.cjs");var It=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,Ft=(s,e,i,n)=>{for(var r=n>1?void 0:n?Ht(e,i):e,d=s.length-1,g;d>=0;d--)(g=s[d])&&(r=(n?g(e,i,r):g(r))||r);return n&&r&&It(e,i,r),r},yt=(s,e,i)=>{if(!e.has(s))throw TypeError("Cannot "+i)},t=(s,e,i)=>(yt(s,e,"read from private field"),i?i.call(s):e.get(s)),l=(s,e,i)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,i)},m=(s,e,i,n)=>(yt(s,e,"write to private field"),n?n.call(s,i):e.set(s,i),i),f=(s,e,i)=>(yt(s,e,"access private method"),i),a,M,T,$,V,X,y,Y,j,tt,u,dt,c,et,it,_,p,k,F,b,G,R,N,ft,B,U,mt,kt,bt,Wt,st,vt,rt,_t,q,wt,St,Ot,nt,ht,Et,S,w,L,W;class Bt{constructor(e,i){D(this,S,void 0);D(this,w,void 0);D(this,L,0);D(this,W,0);O(this,S,e),O(this,w,i),H.scrollEntries.register(h(this,S))}get size(){return h(this,L)}get position(){return h(this,W)}destroy(){H.scrollEntries.unregister(h(this,S)),h(this,S).style.transform=""}resize(){O(this,L,h(this,w).vertical?h(this,S).offsetHeight:h(this,S).offsetWidth),O(this,W,h(this,w).vertical?I.getCumulativeOffsetTop(h(this,S)):I.getCumulativeOffsetLeft(h(this,S))),O(this,W,h(this,W)-h(this,w).contentPosition)}transform(){let e=0;h(this,w).infiniteAttribute.current&&h(this,w).overscroll&&h(this,W)+h(this,L)<h(this,w).currentScrollValue&&(e=h(this,w).distance*-1),H.scrollEntries.update(h(this,S),h(this,w).axisAttibute.current,e);const i=h(this,w).viewportSize-h(this,L),n=zt.clamp(h(this,w).currentScrollValue+e,h(this,W)-h(this,w).viewportSize-i,h(this,W)+h(this,L)+i);h(this,w).vertical?h(this,S).style.transform=`translate3d(0px, ${n*-1}px, 0px)`:h(this,S).style.transform=`translate3d(${n*-1}px, 0px, 0px)`}}S=new WeakMap,w=new WeakMap,L=new WeakMap,W=new WeakMap;const Gt=Lt.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},':host([hibernated="true"])':{display:"contents"},".static":{position:"absolute",top:"0",left:"0",zIndex:"1",width:"100%",height:"100%"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)"},':host([hibernated="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});exports.ScrollElement=class extends gt.CustomElement{constructor(e){if(super(),l(this,N),l(this,B),l(this,mt),l(this,bt),l(this,st),l(this,rt),l(this,St),l(this,ht),l(this,a,null),l(this,M,new x.Attribute(this,"axis","y")),l(this,T,new x.Attribute(this,"pages",0,{validate:i=>Math.max(0,i-1)})),l(this,$,new x.Attribute(this,"split",!1)),l(this,V,new x.Attribute(this,"sectional",!1)),l(this,X,new x.Attribute(this,"wheel-max-delta",!1)),l(this,y,new x.Attribute(this,"infinite",!1)),l(this,Y,new x.Attribute(this,"damping",.03)),l(this,j,new x.Attribute(this,"disabled",!1)),l(this,tt,new x.Attribute(this,"hibernated",!1)),l(this,u,null),l(this,dt,null),l(this,c,[]),l(this,et,0),l(this,it,0),l(this,_,0),l(this,p,0),l(this,k,null),l(this,F,null),l(this,b,new qt.Store(0)),l(this,G,0),l(this,R,0),l(this,q,()=>{const i=this.currentScrollValue/t(this,p);if(m(this,et,this.vertical?I.getCumulativeOffsetTop(this):I.getCumulativeOffsetLeft(this)),m(this,it,this.vertical?I.getCumulativeOffsetTop(t(this,u)):I.getCumulativeOffsetLeft(t(this,u))),m(this,_,this.vertical?this.offsetHeight:this.offsetWidth),t(this,T).current){m(this,p,t(this,_)*t(this,T).current);const n=t(this,p)+t(this,_);this.vertical?(t(this,u).style.width=n+"px",t(this,u).style.height="100%"):(t(this,u).style.height=n+"px",t(this,u).style.width="100%")}else this.vertical?(t(this,u).style.width="100%",t(this,u).style.height="max-content",m(this,p,t(this,u).offsetHeight-t(this,_))):(t(this,u).style.width="max-content",t(this,u).style.height="100%",m(this,p,t(this,u).offsetWidth-t(this,_)));if(!t(this,y).current){const n=getComputedStyle(this);m(this,p,t(this,p)+(this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd))),t(this,a).max.current=t(this,p)}if(t(this,c).forEach(n=>{n.resize(),n.transform()}),t(this,y).current&&t(this,c).length){const n=t(this,c)[t(this,c).length-1],r=n.position+n.size-t(this,_),d=t(this,p)-r;m(this,R,n.position+n.size+d)}else m(this,R,t(this,p));if(t(this,V).current&&t(this,c).length){const n=t(this,c)[t(this,b).current];t(this,a).set(n.position,!0)}else t(this,a).set(i*t(this,p),!0)}),l(this,wt,()=>{const i=this.currentScrollValue;if(m(this,G,Math.max(0,i-t(this,p))),t(this,c).length){let n=0;for(let r=0;r<t(this,c).length;r++){const d=t(this,c)[r];d.transform(),this.targetScrollValue+this.viewportSize/2>=d.position&&(n=r)}t(this,b).current=n}else this.vertical?t(this,u).style.transform=`translate3d(0px, ${i*-1}px, 0px)`:t(this,u).style.transform=`translate3d(${i*-1}px, 0px, 0px)`;H.scrollEntries.update(this,t(this,M).current,i)}),l(this,nt,i=>{if(typeof i=="number")if(t(this,V).current){const n=Math.sign(i);t(this,c).length?this.shiftSections(n):t(this,a).shift(n*t(this,_))}else t(this,a).shift(i);else i==="min"?t(this,a).set(t(this,a).min.current):i==="max"&&t(this,a).set(t(this,a).delta)}),At.isBrowser){let i,n=e||this.getAttribute("name");n&&(i={name:n}),m(this,a,new Tt.Damped({damping:.01,min:0,order:xt.TICK_ORDER.SCROLL,passport:i})),this.openShadow(Gt),P.element(this,{tabIndex:0,children:[P.div({class:"static",children:[P.slot({name:"static"})]}),P.div({class:"content",children:[P.slot({ref:r=>m(this,dt,r)})],style:{flexDirection:new Dt.Derived(t(this,M),r=>r==="x"?"row":"column")},ref:r=>m(this,u,r)})]}),m(this,k,new Mt.WheelControls({element:this})),t(this,k).changeEvent.subscribe(t(this,nt)),m(this,F,new Mt.KeyboardControls({element:this})),t(this,F).changeEvent.subscribe(t(this,nt)),t(this,M).subscribe(({current:r})=>{t(this,u).style.flexDirection=r==="x"?"row":"column",t(this,k).axis=t(this,X).current?"max":r,this.isConnected&&t(this,q).call(this)}),t(this,X).subscribe(r=>{t(this,k).axis=r.current?"max":t(this,M).current}),t(this,T).subscribe(()=>{this.isConnected&&t(this,q).call(this)}),t(this,$).subscribe(({current:r})=>{this.isConnected&&(r?f(this,N,ft).call(this):f(this,B,U).call(this))}),t(this,V).subscribe(r=>{t(this,b).current=0,t(this,k).debounce=r.current,t(this,a).reset(),this.isConnected&&(r.current&&!r.previous?f(this,N,ft).call(this):!r.current&&r.previous&&f(this,B,U).call(this))}),t(this,y).subscribe(r=>{r.current?(this.isConnected&&(t(this,c).length||(t(this,$).current=!0)),t(this,c).length&&(t(this,a).max.current=1/0,t(this,a).min.current=-1/0)):(m(this,G,0),t(this,a).max.current=t(this,p),t(this,a).min.current=0)}),t(this,Y).subscribe(r=>{t(this,a).damping=r.current}),t(this,j).subscribe(r=>{r.current&&!r.previous?f(this,mt,kt).call(this):!r.current&&r.previous&&f(this,bt,Wt).call(this)}),t(this,tt).subscribe(r=>{r.current&&!r.previous?f(this,st,vt).call(this):!r.current&&r.previous&&f(this,rt,_t).call(this)})}}get currentScrollValue(){return f(this,ht,Et).call(this,"current")}get targetScrollValue(){return f(this,ht,Et).call(this,"target")}get damped(){return t(this,a)}get dampedAttibute(){return t(this,a)}get axisAttibute(){return t(this,M)}get pagesAttibute(){return t(this,T)}get splitAttibute(){return t(this,$)}get sectionalAttibute(){return t(this,V)}get infiniteAttribute(){return t(this,y)}get dampingAttibute(){return t(this,Y)}get disabledAttibute(){return t(this,j)}get hibernatedAttibute(){return t(this,tt)}get contentElement(){return t(this,u)}get position(){return t(this,et)}get contentPosition(){return t(this,it)}get viewportSize(){return t(this,_)}get scrollSize(){return t(this,p)}get counter(){return t(this,b)}get distance(){return t(this,R)}get overscroll(){return t(this,G)}get vertical(){return t(this,M).current==="y"}get currentProgress(){return this.currentScrollValue/t(this,R)}get targetProgress(){return this.targetScrollValue/t(this,R)}scrollToSection(e,i="smooth"){if(!t(this,c).length)return;const n=t(this,b).current;f(this,St,Ot).call(this,e);const r=t(this,c)[n],d=t(this,c)[t(this,b).current];if(r&&d){let g=0;const Q=t(this,c).length-1;t(this,y).current?t(this,b).current===0&&n===Q?g=t(this,p)+t(this,_)-r.position:t(this,b).current===Q&&n===0?g=d.position-(t(this,p)+t(this,_)):g=d.position-r.position:g=d.position-r.position,t(this,a).shift(g,i==="instant")}}shiftSections(e,i="smooth"){t(this,c).length&&this.scrollToSection(t(this,b).current+e,i)}connectedCallback(){f(this,rt,_t).call(this)}disconnectedCallback(){f(this,st,vt).call(this)}};a=new WeakMap;M=new WeakMap;T=new WeakMap;$=new WeakMap;V=new WeakMap;X=new WeakMap;y=new WeakMap;Y=new WeakMap;j=new WeakMap;tt=new WeakMap;u=new WeakMap;dt=new WeakMap;c=new WeakMap;et=new WeakMap;it=new WeakMap;_=new WeakMap;p=new WeakMap;k=new WeakMap;F=new WeakMap;b=new WeakMap;G=new WeakMap;R=new WeakMap;N=new WeakSet;ft=function(){f(this,B,U).call(this),t(this,dt).assignedElements().forEach(s=>{s instanceof HTMLElement&&t(this,c).push(new Bt(s,this))}),t(this,u).style.transform="",t(this,q).call(this)};B=new WeakSet;U=function(){t(this,c).forEach(s=>{s.destroy()}),m(this,c,[])};mt=new WeakSet;kt=function(){t(this,a).unsubscribe(t(this,wt)),t(this,a).unlistenAnimationFrame(),t(this,k).disconnect(),t(this,F).disconnect()};bt=new WeakSet;Wt=function(){t(this,a).subscribe(t(this,wt)),t(this,k).connect(),t(this,F).connect()};st=new WeakSet;vt=function(){pt.windowResizer.unsubscribe(t(this,q)),t(this,a).reset(),f(this,mt,kt).call(this),t(this,u).style.transform="",t(this,$).current&&f(this,B,U).call(this),H.scrollEntries.unregister(this)};rt=new WeakSet;_t=function(){t(this,$).current&&f(this,N,ft).call(this),H.scrollEntries.register(this),pt.windowResizer.subscribe(t(this,q),xt.RESIZE_ORDER.SCROLL),f(this,bt,Wt).call(this)};q=new WeakMap;wt=new WeakMap;St=new WeakSet;Ot=function(s){t(this,y).current?(t(this,b).current=s%t(this,c).length,t(this,b).current=t(this,b).current<0?t(this,c).length+t(this,b).current:t(this,b).current):t(this,b).current=zt.clamp(s,0,t(this,c).length-1)};nt=new WeakMap;ht=new WeakSet;Et=function(s="current"){if(t(this,y).current&&t(this,c).length){const e=t(this,a)[s]%(t(this,p)+t(this,_));return e<0?t(this,p)+e+t(this,_):e}else return t(this,a)[s]};exports.ScrollElement=Ft([gt.define("e-scroll")],exports.ScrollElement);var J;class Kt extends gt.CustomElement{constructor(){super(...arguments);D(this,J,null)}get scrollElement(){return h(this,J)}connectedCallback(){const i=Vt.findParentElement(this,exports.ScrollElement);i instanceof exports.ScrollElement?O(this,J,i):console.error(this,"e-scroll not found")}}J=new WeakMap;var Zt=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,Ut=(s,e,i,n)=>{for(var r=n>1?void 0:n?Nt(e,i):e,d=s.length-1,g;d>=0;d--)(g=s[d])&&(r=(n?g(e,i,r):g(r))||r);return n&&r&&Zt(e,i,r),r},Rt=(s,e,i)=>{if(!e.has(s))throw TypeError("Cannot "+i)},o=(s,e,i)=>(Rt(s,e,"read from private field"),i?i.call(s):e.get(s)),E=(s,e,i)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,i)},C=(s,e,i,n)=>(Rt(s,e,"write to private field"),n?n.call(s,i):e.set(s,i),i),lt,v,A,z,K,Z,ot,at,ct,ut;const Jt=Lt.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#efefef"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"#181818",borderRadius:"1vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}});exports.ScrollbarElement=class extends Kt{constructor(){super(),E(this,lt,null),E(this,v,null),E(this,A,!1),E(this,z,0),E(this,K,0),E(this,Z,0),E(this,ot,()=>{C(this,A,this.offsetWidth>this.offsetHeight);const e=o(this,A)?this.offsetWidth:this.offsetHeight;C(this,z,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),C(this,z,Math.max(o(this,z),30)),o(this,A)?(o(this,v).style.width=o(this,z)+"px",o(this,v).style.height="100%"):(o(this,v).style.width="100%",o(this,v).style.height=o(this,z)+"px"),C(this,K,e-o(this,z)),this.scrollElement.scrollSize||(this.style.display="none")}),E(this,at,()=>{C(this,Z,this.scrollElement.currentProgress*o(this,K)),o(this,A)?o(this,v).style.transform=`translate3d(${o(this,Z)}px, 0px, 0px)`:o(this,v).style.transform=`translate3d(0px, ${o(this,Z)}px, 0px)`}),E(this,ct,()=>{this.setAttribute("axis",this.scrollElement.axisAttibute.current)}),E(this,ut,e=>{const i=g=>{const Q=o(this,A)?g.x:g.y,Pt=this.scrollElement.distance/o(this,K),$t=(Q-d)*Pt;this.scrollElement.damped.set(r+$t)},n=()=>{removeEventListener("pointermove",i),removeEventListener("pointerup",n),removeEventListener("touchend",n)};addEventListener("pointermove",i),addEventListener("pointerup",n),addEventListener("touchend",n);const r=this.scrollElement.damped.target,d=o(this,A)?e.x:e.y}),At.isBrowser&&(this.openShadow(Jt),P.element(this,{children:[P.slot({ref:e=>C(this,lt,e)})]}))}get thumbElement(){return o(this,v)}connectedCallback(){super.connectedCallback();const e=o(this,lt).assignedElements()[0];e instanceof HTMLElement?C(this,v,e):(C(this,v,document.createElement("div")),o(this,v).classList.add("default-thumb"),this.shadowRoot.appendChild(o(this,v))),o(this,v).addEventListener("pointerdown",o(this,ut)),pt.windowResizer.subscribe(o(this,ot),xt.RESIZE_ORDER.SCROLL+1),this.scrollElement.damped.subscribe(o(this,at)),this.scrollElement.axisAttibute.subscribe(o(this,ct))}disconnectedCallback(){o(this,v).removeEventListener("pointerdown",o(this,ut)),pt.windowResizer.unsubscribe(o(this,ot)),this.scrollElement.damped.unsubscribe(o(this,at)),this.scrollElement.axisAttibute.unsubscribe(o(this,ct))}};lt=new WeakMap;v=new WeakMap;A=new WeakMap;z=new WeakMap;K=new WeakMap;Z=new WeakMap;ot=new WeakMap;at=new WeakMap;ct=new WeakMap;ut=new WeakMap;exports.ScrollbarElement=Ut([gt.define("e-scrollbar")],exports.ScrollbarElement);
|
package/lib/scroll/index.js
CHANGED
|
@@ -20,8 +20,8 @@ import { CustomElement as Lt, define as $t } from "../custom-element/index.js";
|
|
|
20
20
|
import { TICK_ORDER as Nt, RESIZE_ORDER as Pt } from "../order/index.js";
|
|
21
21
|
import { windowResizer as ot } from "../window-resizer/index.js";
|
|
22
22
|
import { scrollEntries as I } from "../scroll-entries/index.js";
|
|
23
|
-
import { e as Ot, D as Mt, ax as bt } from "../tags-
|
|
24
|
-
import { c as Dt } from "../createStylesheet-
|
|
23
|
+
import { e as Ot, D as Mt, ax as bt } from "../tags-C2jg1zYB.js";
|
|
24
|
+
import { c as Dt } from "../createStylesheet-CD11E4C8.js";
|
|
25
25
|
import { f as Ut } from "../dom-BY7JhTx5.js";
|
|
26
26
|
var Zt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, Jt = (i, s, e, n) => {
|
|
27
27
|
for (var a = n > 1 ? void 0 : n ? qt(s, e) : s, g = i.length - 1, x; g >= 0; g--)
|
package/lib/select/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index--wI4MTuv.cjs");Object.defineProperty(exports,"SelectElement",{enumerable:!0,get:()=>e.SelectElement});Object.defineProperty(exports,"SelectHeadElement",{enumerable:!0,get:()=>e.SelectHeadElement});Object.defineProperty(exports,"SelectOptionElement",{enumerable:!0,get:()=>e.SelectOptionElement});exports.SelectUserElement=e.SelectUserElement;
|
package/lib/select/index.js
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Word } from './Word.js';
|
|
2
|
+
import { Letter } from './Letter';
|
|
3
|
+
import { CustomElement } from '../custom-element';
|
|
4
|
+
export interface SlicerParameters {
|
|
5
|
+
wordConstructor?: typeof Word;
|
|
6
|
+
letterConstructor?: typeof Letter;
|
|
7
|
+
}
|
|
8
|
+
export declare class SlicerElement extends CustomElement {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(parameters?: SlicerParameters);
|
|
11
|
+
get wordsArray(): Word[];
|
|
12
|
+
get lettersArray(): Letter[];
|
|
13
|
+
get originalText(): string;
|
|
14
|
+
protected connectedCallback(): void;
|
|
15
|
+
protected disconnectedCallback(): void;
|
|
16
|
+
}
|
|
17
|
+
declare global {
|
|
18
|
+
interface HTMLElementTagNameMap {
|
|
19
|
+
'e-slicer': SlicerElement;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Letter } from './Letter';
|
|
2
|
+
export interface WordParameters {
|
|
3
|
+
index: number;
|
|
4
|
+
text: string;
|
|
5
|
+
letters?: boolean;
|
|
6
|
+
lettersAcc?: number;
|
|
7
|
+
letterConstructor?: typeof Letter;
|
|
8
|
+
clone?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class Word {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(parameters: WordParameters);
|
|
13
|
+
get index(): number;
|
|
14
|
+
get element(): HTMLSpanElement;
|
|
15
|
+
get letters(): Letter[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";var L=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)};var i=(n,t,e)=>(L(n,t,"read from private field"),e?e.call(n):t.get(n)),p=(n,t,e)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,e)},d=(n,t,e,s)=>(L(n,t,"write to private field"),s?s.call(n,e):t.set(n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../custom-element/index.cjs"),$=require("../string-vBu90jhV.cjs");var w,h,f;class T{constructor(t){p(this,w,void 0);p(this,h,void 0);p(this,f,void 0);d(this,w,t.index),d(this,h,document.createElement("span")),d(this,f,[]),t.letters&&t.letterConstructor&&t.lettersAcc!==void 0?(d(this,f,t.text.split("").map((e,s)=>new t.letterConstructor({index:t.lettersAcc+s,text:e,clone:t.clone}))),i(this,h).append(...i(this,f).map(e=>e.element))):t.clone?i(this,h).innerHTML=`
|
|
2
|
+
<span class="original">${t.text}</span>
|
|
3
|
+
<span class="clone" aria-hidden>${t.text}</span>
|
|
4
|
+
`:i(this,h).innerHTML=`
|
|
5
|
+
<span class="value">${t.text}</span>
|
|
6
|
+
`,i(this,h).classList.add("word")}get index(){return i(this,w)}get element(){return i(this,h)}get letters(){return i(this,f)}}w=new WeakMap,h=new WeakMap,f=new WeakMap;var C,a;class S{constructor(t){p(this,C,void 0);p(this,a,void 0);d(this,C,t.index),d(this,a,document.createElement("span")),i(this,a).classList.add("letter"),t.clone?i(this,a).innerHTML=`
|
|
7
|
+
<span class="original">${t.text}</span>
|
|
8
|
+
<span class="clone" aria-hidden>${t.text}</span>
|
|
9
|
+
`:i(this,a).innerHTML=`
|
|
10
|
+
<span class="value">${t.text}</span>
|
|
11
|
+
`}get index(){return i(this,C)}get element(){return i(this,a)}}C=new WeakMap,a=new WeakMap;var D=Object.defineProperty,O=Object.getOwnPropertyDescriptor,W=(n,t,e,s)=>{for(var r=s>1?void 0:s?O(t,e):t,l=n.length-1,u;l>=0;l--)(u=n[l])&&(r=(s?u(t,e,r):u(r))||r);return s&&r&&D(t,e,r),r},A=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)},o=(n,t,e)=>(A(n,t,"read from private field"),e?e.call(n):t.get(n)),_=(n,t,e)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,e)},y=(n,t,e,s)=>(A(n,t,"write to private field"),s?s.call(n,e):t.set(n,e),e),g,c,x,E,M;exports.SlicerElement=class extends P.CustomElement{constructor(t){super(),_(this,g,""),_(this,c,[]),_(this,x,[]),_(this,E,void 0),_(this,M,void 0),y(this,E,(t==null?void 0:t.wordConstructor)||T),y(this,M,(t==null?void 0:t.letterConstructor)||S)}get wordsArray(){return o(this,c)}get lettersArray(){return o(this,x)}get originalText(){return o(this,g)}connectedCallback(){var e;y(this,g,((e=this.textContent)==null?void 0:e.trim())||""),this.innerHTML="";let t=0;y(this,c,o(this,g).replace(/ +/g," ").split(" ").map((s,r)=>{const l=new(o(this,E))({index:r,text:s,letters:this.hasAttribute("letters"),lettersAcc:t,letterConstructor:o(this,M),clone:this.hasAttribute("clone")});return t+=l.letters.length,o(this,x).push(...l.letters),l})),this.hasAttribute("index")&&(o(this,c).forEach(s=>{s.element.style.setProperty("--word-index",s.index.toString())}),o(this,x).forEach(s=>{s.element.style.setProperty("--letter-index",s.index.toString())})),o(this,c).forEach((s,r)=>{if(this.appendChild(s.element),r!==o(this,c).length-1){const l=document.createElement("span");l.innerHTML=" ",this.appendChild(l)}}),this.style.setProperty("--words-length",o(this,c).length.toString()),this.style.setProperty("--letters-length",o(this,x).length.toString())}disconnectedCallback(){y(this,c,[]),this.textContent=o(this,g),this.style.removeProperty("--words-length"),this.style.removeProperty("--letters-length")}};g=new WeakMap;c=new WeakMap;x=new WeakMap;E=new WeakMap;M=new WeakMap;exports.SlicerElement=W([P.define("e-slicer")],exports.SlicerElement);var m=Object.defineProperty,H=Object.getOwnPropertyDescriptor,b=(n,t,e,s)=>{for(var r=s>1?void 0:s?H(t,e):t,l=n.length-1,u;l>=0;l--)(u=n[l])&&(r=(s?u(t,e,r):u(r))||r);return s&&r&&m(t,e,r),r},v;class q extends S{constructor(e){super(e);p(this,v,void 0);d(this,v,$.generateId(2+Math.floor(Math.random()*15),"abcdefghijklmnopqrstuvwxyz0123456789#!%$^&*+=?")+e.text),this.play(0)}play(e){const s=Math.floor(e*(i(this,v).length-1));this.element.textContent=i(this,v)[s]}}v=new WeakMap;exports.DecoderElement=class extends exports.SlicerElement{constructor(){super({letterConstructor:q})}play(t){this.lettersArray.forEach(e=>{e.play(t)})}};exports.DecoderElement=b([P.define("e-decoder")],exports.DecoderElement);exports.Letter=S;exports.Word=T;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
var A = (e, t, s) => {
|
|
2
|
+
if (!t.has(e))
|
|
3
|
+
throw TypeError("Cannot " + s);
|
|
4
|
+
};
|
|
5
|
+
var i = (e, t, s) => (A(e, t, "read from private field"), s ? s.call(e) : t.get(e)), u = (e, t, s) => {
|
|
6
|
+
if (t.has(e))
|
|
7
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
+
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
9
|
+
}, c = (e, t, s, n) => (A(e, t, "write to private field"), n ? n.call(e, s) : t.set(e, s), s);
|
|
10
|
+
import { CustomElement as S, define as T } from "../custom-element/index.js";
|
|
11
|
+
import { g as W } from "../string-3lAkpJJP.js";
|
|
12
|
+
var y, h, f;
|
|
13
|
+
class D {
|
|
14
|
+
constructor(t) {
|
|
15
|
+
u(this, y, void 0);
|
|
16
|
+
u(this, h, void 0);
|
|
17
|
+
u(this, f, void 0);
|
|
18
|
+
c(this, y, t.index), c(this, h, document.createElement("span")), c(this, f, []), t.letters && t.letterConstructor && t.lettersAcc !== void 0 ? (c(this, f, t.text.split("").map((s, n) => new t.letterConstructor({
|
|
19
|
+
index: t.lettersAcc + n,
|
|
20
|
+
text: s,
|
|
21
|
+
clone: t.clone
|
|
22
|
+
}))), i(this, h).append(...i(this, f).map((s) => s.element))) : t.clone ? i(this, h).innerHTML = `
|
|
23
|
+
<span class="original">${t.text}</span>
|
|
24
|
+
<span class="clone" aria-hidden>${t.text}</span>
|
|
25
|
+
` : i(this, h).innerHTML = `
|
|
26
|
+
<span class="value">${t.text}</span>
|
|
27
|
+
`, i(this, h).classList.add("word");
|
|
28
|
+
}
|
|
29
|
+
get index() {
|
|
30
|
+
return i(this, y);
|
|
31
|
+
}
|
|
32
|
+
get element() {
|
|
33
|
+
return i(this, h);
|
|
34
|
+
}
|
|
35
|
+
get letters() {
|
|
36
|
+
return i(this, f);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
y = new WeakMap(), h = new WeakMap(), f = new WeakMap();
|
|
40
|
+
var C, a;
|
|
41
|
+
class $ {
|
|
42
|
+
constructor(t) {
|
|
43
|
+
u(this, C, void 0);
|
|
44
|
+
u(this, a, void 0);
|
|
45
|
+
c(this, C, t.index), c(this, a, document.createElement("span")), i(this, a).classList.add("letter"), t.clone ? i(this, a).innerHTML = `
|
|
46
|
+
<span class="original">${t.text}</span>
|
|
47
|
+
<span class="clone" aria-hidden>${t.text}</span>
|
|
48
|
+
` : i(this, a).innerHTML = `
|
|
49
|
+
<span class="value">${t.text}</span>
|
|
50
|
+
`;
|
|
51
|
+
}
|
|
52
|
+
get index() {
|
|
53
|
+
return i(this, C);
|
|
54
|
+
}
|
|
55
|
+
get element() {
|
|
56
|
+
return i(this, a);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
C = new WeakMap(), a = new WeakMap();
|
|
60
|
+
var H = Object.defineProperty, b = Object.getOwnPropertyDescriptor, m = (e, t, s, n) => {
|
|
61
|
+
for (var r = n > 1 ? void 0 : n ? b(t, s) : t, d = e.length - 1, p; d >= 0; d--)
|
|
62
|
+
(p = e[d]) && (r = (n ? p(t, s, r) : p(r)) || r);
|
|
63
|
+
return n && r && H(t, s, r), r;
|
|
64
|
+
}, O = (e, t, s) => {
|
|
65
|
+
if (!t.has(e))
|
|
66
|
+
throw TypeError("Cannot " + s);
|
|
67
|
+
}, l = (e, t, s) => (O(e, t, "read from private field"), s ? s.call(e) : t.get(e)), _ = (e, t, s) => {
|
|
68
|
+
if (t.has(e))
|
|
69
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
70
|
+
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
71
|
+
}, w = (e, t, s, n) => (O(e, t, "write to private field"), n ? n.call(e, s) : t.set(e, s), s), x, o, g, M, P;
|
|
72
|
+
let E = class extends S {
|
|
73
|
+
constructor(e) {
|
|
74
|
+
super(), _(this, x, ""), _(this, o, []), _(this, g, []), _(this, M, void 0), _(this, P, void 0), w(this, M, (e == null ? void 0 : e.wordConstructor) || D), w(this, P, (e == null ? void 0 : e.letterConstructor) || $);
|
|
75
|
+
}
|
|
76
|
+
get wordsArray() {
|
|
77
|
+
return l(this, o);
|
|
78
|
+
}
|
|
79
|
+
get lettersArray() {
|
|
80
|
+
return l(this, g);
|
|
81
|
+
}
|
|
82
|
+
get originalText() {
|
|
83
|
+
return l(this, x);
|
|
84
|
+
}
|
|
85
|
+
connectedCallback() {
|
|
86
|
+
var t;
|
|
87
|
+
w(this, x, ((t = this.textContent) == null ? void 0 : t.trim()) || ""), this.innerHTML = "";
|
|
88
|
+
let e = 0;
|
|
89
|
+
w(this, o, l(this, x).replace(/ +/g, " ").split(" ").map((s, n) => {
|
|
90
|
+
const r = new (l(this, M))({
|
|
91
|
+
index: n,
|
|
92
|
+
text: s,
|
|
93
|
+
letters: this.hasAttribute("letters"),
|
|
94
|
+
lettersAcc: e,
|
|
95
|
+
letterConstructor: l(this, P),
|
|
96
|
+
clone: this.hasAttribute("clone")
|
|
97
|
+
});
|
|
98
|
+
return e += r.letters.length, l(this, g).push(...r.letters), r;
|
|
99
|
+
})), this.hasAttribute("index") && (l(this, o).forEach((s) => {
|
|
100
|
+
s.element.style.setProperty("--word-index", s.index.toString());
|
|
101
|
+
}), l(this, g).forEach((s) => {
|
|
102
|
+
s.element.style.setProperty(
|
|
103
|
+
"--letter-index",
|
|
104
|
+
s.index.toString()
|
|
105
|
+
);
|
|
106
|
+
})), l(this, o).forEach((s, n) => {
|
|
107
|
+
if (this.appendChild(s.element), n !== l(this, o).length - 1) {
|
|
108
|
+
const r = document.createElement("span");
|
|
109
|
+
r.innerHTML = " ", this.appendChild(r);
|
|
110
|
+
}
|
|
111
|
+
}), this.style.setProperty("--words-length", l(this, o).length.toString()), this.style.setProperty("--letters-length", l(this, g).length.toString());
|
|
112
|
+
}
|
|
113
|
+
disconnectedCallback() {
|
|
114
|
+
w(this, o, []), this.textContent = l(this, x), this.style.removeProperty("--words-length"), this.style.removeProperty("--letters-length");
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
x = /* @__PURE__ */ new WeakMap();
|
|
118
|
+
o = /* @__PURE__ */ new WeakMap();
|
|
119
|
+
g = /* @__PURE__ */ new WeakMap();
|
|
120
|
+
M = /* @__PURE__ */ new WeakMap();
|
|
121
|
+
P = /* @__PURE__ */ new WeakMap();
|
|
122
|
+
E = m([
|
|
123
|
+
T("e-slicer")
|
|
124
|
+
], E);
|
|
125
|
+
var q = Object.defineProperty, z = Object.getOwnPropertyDescriptor, G = (e, t, s, n) => {
|
|
126
|
+
for (var r = n > 1 ? void 0 : n ? z(t, s) : t, d = e.length - 1, p; d >= 0; d--)
|
|
127
|
+
(p = e[d]) && (r = (n ? p(t, s, r) : p(r)) || r);
|
|
128
|
+
return n && r && q(t, s, r), r;
|
|
129
|
+
}, v;
|
|
130
|
+
class I extends $ {
|
|
131
|
+
constructor(s) {
|
|
132
|
+
super(s);
|
|
133
|
+
u(this, v, void 0);
|
|
134
|
+
c(this, v, W(
|
|
135
|
+
2 + Math.floor(Math.random() * 15),
|
|
136
|
+
"abcdefghijklmnopqrstuvwxyz0123456789#!%$^&*+=?"
|
|
137
|
+
) + s.text), this.play(0);
|
|
138
|
+
}
|
|
139
|
+
play(s) {
|
|
140
|
+
const n = Math.floor(s * (i(this, v).length - 1));
|
|
141
|
+
this.element.textContent = i(this, v)[n];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
v = new WeakMap();
|
|
145
|
+
let L = class extends E {
|
|
146
|
+
constructor() {
|
|
147
|
+
super({
|
|
148
|
+
letterConstructor: I
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
play(e) {
|
|
152
|
+
this.lettersArray.forEach((t) => {
|
|
153
|
+
t.play(e);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
L = G([
|
|
158
|
+
T("e-decoder")
|
|
159
|
+
], L);
|
|
160
|
+
export {
|
|
161
|
+
L as DecoderElement,
|
|
162
|
+
$ as Letter,
|
|
163
|
+
E as SlicerElement,
|
|
164
|
+
D as Word
|
|
165
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../Store-D0_rDIsE.cjs"),t=require("../../Derived-SjPdLJiZ.cjs"),r=require("../../Composed-Mdr4ZFbI.cjs"),o=require("../../useDisconnect-sA74z4IZ.cjs");function c(...s){const e=new n.Store(...s);return o.useDisconnect(()=>e.close()),e}function u(...s){const e=new t.Derived(...s);return o.useDisconnect(()=>e.close()),e}function i(...s){const e=new r.DerivedArray(...s);return o.useDisconnect(()=>e.close()),e}function d(...s){const e=new r.Composed(...s);return o.useDisconnect(()=>e.close()),e}function D(...s){const e=new r.Resource(...s);return o.useDisconnect(()=>e.close()),e}exports.useComposed=d;exports.useDerived=u;exports.useDerivedArray=i;exports.useResource=D;exports.useStore=c;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StoreManagerType, StoreEntry, Store, Derived, DerivedArray, Composed, Resource } from '
|
|
1
|
+
import { StoreManagerType, StoreEntry, Store, Derived, DerivedArray, Composed, Resource } from '..';
|
|
2
2
|
export declare function useStore<StoreType = unknown, StoreManager extends StoreManagerType = StoreManagerType, Entry extends StoreEntry<StoreType> = StoreEntry<StoreType>>(...parameters: ConstructorParameters<typeof Store<StoreType, StoreManager, Entry>>): Store<StoreType, StoreManager, StoreEntry<StoreType>>;
|
|
3
3
|
export declare function useDerived<DerivedType, StoreType>(...parameters: ConstructorParameters<typeof Derived<DerivedType, StoreType>>): Derived<DerivedType, StoreType>;
|
|
4
4
|
export declare function useDerivedArray<DerivedType, StoreType extends Array<any> = Array<any>>(...parameters: ConstructorParameters<typeof DerivedArray<DerivedType, StoreType>>): DerivedArray<DerivedType, StoreType>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { S as s } from "../../Store-JOKrNVEr.js";
|
|
2
|
+
import { D as t } from "../../Derived-Bc88XJ8J.js";
|
|
3
|
+
import { D as n, C as c, R as u } from "../../Composed-ClTo1f0b.js";
|
|
4
|
+
import { u as r } from "../../useDisconnect-D5cBD1bq.js";
|
|
5
|
+
function p(...o) {
|
|
6
|
+
const e = new s(...o);
|
|
7
|
+
return r(() => e.close()), e;
|
|
8
|
+
}
|
|
9
|
+
function D(...o) {
|
|
10
|
+
const e = new t(...o);
|
|
11
|
+
return r(() => e.close()), e;
|
|
12
|
+
}
|
|
13
|
+
function d(...o) {
|
|
14
|
+
const e = new n(...o);
|
|
15
|
+
return r(() => e.close()), e;
|
|
16
|
+
}
|
|
17
|
+
function l(...o) {
|
|
18
|
+
const e = new c(...o);
|
|
19
|
+
return r(() => e.close()), e;
|
|
20
|
+
}
|
|
21
|
+
function w(...o) {
|
|
22
|
+
const e = new u(...o);
|
|
23
|
+
return r(() => e.close()), e;
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
l as useComposed,
|
|
27
|
+
D as useDerived,
|
|
28
|
+
d as useDerivedArray,
|
|
29
|
+
w as useResource,
|
|
30
|
+
p as useStore
|
|
31
|
+
};
|
package/lib/store/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var g=(e,r,t)=>{if(!r.has(e))throw TypeError("Cannot "+t)};var u=(e,r,t)=>(g(e,r,"read from private field"),t?t.call(e):r.get(e)),l=(e,r,t)=>{if(r.has(e))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(e):r.set(e,t)},v=(e,r,t,s)=>(g(e,r,"write to private field"),s?s.call(e,t):r.set(e,t),t);var S=(e,r,t,s)=>({set _(o){v(e,r,o,t)},get _(){return u(e,r,s)}});var y=(e,r,t)=>new Promise((s,o)=>{var R=i=>{try{p(t.next(i))}catch(m){o(m)}},C=i=>{try{p(t.throw(i))}catch(m){o(m)}},p=i=>i.done?s(i.value):Promise.resolve(i.value).then(R,C);p((t=t.apply(e,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../Store-D0_rDIsE.cjs"),A=require("../Derived-SjPdLJiZ.cjs"),d=require("../Composed-Mdr4ZFbI.cjs");var c,a,n;class D extends d.Resource{constructor(t,s,o=100){super(t,s,{manualControl:!0,skipSubscribeNotification:!0});l(this,c,void 0);l(this,a,void 0);l(this,n,0);v(this,a,o)}get step(){return u(this,n)}startAccumulating(){v(this,c,setInterval(()=>y(this,null,function*(){++S(this,n)._,this.refetch()}),u(this,a)))}stopAccumulating(){clearInterval(u(this,c))}close(){super.close(),this.stopAccumulating()}}c=new WeakMap,a=new WeakMap,n=new WeakMap;exports.Store=h.Store;exports.activeStores=h.activeStores;exports.storeRegistry=h.storeRegistry;exports.Derived=A.Derived;exports.Composed=d.Composed;exports.DerivedArray=d.DerivedArray;exports.Resource=d.Resource;exports.CumulativeResource=D;
|
package/lib/store/index.js
CHANGED
|
@@ -1,138 +1,75 @@
|
|
|
1
|
-
var
|
|
2
|
-
if (!
|
|
3
|
-
throw TypeError("Cannot " +
|
|
1
|
+
var v = (t, s, e) => {
|
|
2
|
+
if (!s.has(t))
|
|
3
|
+
throw TypeError("Cannot " + e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
if (
|
|
5
|
+
var i = (t, s, e) => (v(t, s, "read from private field"), e ? e.call(t) : s.get(t)), n = (t, s, e) => {
|
|
6
|
+
if (s.has(t))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
var
|
|
11
|
-
set _(
|
|
12
|
-
|
|
8
|
+
s instanceof WeakSet ? s.add(t) : s.set(t, e);
|
|
9
|
+
}, p = (t, s, e, r) => (v(t, s, "write to private field"), r ? r.call(t, e) : s.set(t, e), e);
|
|
10
|
+
var f = (t, s, e, r) => ({
|
|
11
|
+
set _(a) {
|
|
12
|
+
p(t, s, a, e);
|
|
13
13
|
},
|
|
14
14
|
get _() {
|
|
15
|
-
return
|
|
15
|
+
return i(t, s, r);
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
var
|
|
19
|
-
var
|
|
18
|
+
var d = (t, s, e) => new Promise((r, a) => {
|
|
19
|
+
var g = (o) => {
|
|
20
20
|
try {
|
|
21
|
-
|
|
22
|
-
} catch (
|
|
23
|
-
|
|
21
|
+
m(e.next(o));
|
|
22
|
+
} catch (h) {
|
|
23
|
+
a(h);
|
|
24
24
|
}
|
|
25
|
-
},
|
|
25
|
+
}, x = (o) => {
|
|
26
26
|
try {
|
|
27
|
-
|
|
28
|
-
} catch (
|
|
29
|
-
|
|
27
|
+
m(e.throw(o));
|
|
28
|
+
} catch (h) {
|
|
29
|
+
a(h);
|
|
30
30
|
}
|
|
31
|
-
},
|
|
32
|
-
|
|
31
|
+
}, m = (o) => o.done ? r(o.value) : Promise.resolve(o.value).then(g, x);
|
|
32
|
+
m((e = e.apply(t, s)).next());
|
|
33
33
|
});
|
|
34
|
-
import { S as
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
var
|
|
39
|
-
class
|
|
40
|
-
constructor(
|
|
41
|
-
super(
|
|
42
|
-
n(this, m, void 0);
|
|
43
|
-
h(this, m, s.subscribe((o) => {
|
|
44
|
-
const a = [];
|
|
45
|
-
o.current.forEach((d, i) => {
|
|
46
|
-
var f;
|
|
47
|
-
o.current[i] === ((f = o.previous) == null ? void 0 : f[i]) && this.current[i] ? a.push(this.current[i]) : a.push(r(d, i));
|
|
48
|
-
}), this.current = a;
|
|
49
|
-
}));
|
|
50
|
-
}
|
|
51
|
-
close() {
|
|
52
|
-
super.close(), u(this, m).call(this);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
m = new WeakMap();
|
|
56
|
-
var b, l, p;
|
|
57
|
-
class E extends A {
|
|
58
|
-
constructor(s, r, c) {
|
|
59
|
-
super(s, c);
|
|
60
|
-
n(this, b, void 0);
|
|
61
|
-
n(this, l, void 0);
|
|
62
|
-
n(this, p, 0);
|
|
63
|
-
h(this, l, new A(!1)), h(this, b, r), c != null && c.manualControl || this.refetch();
|
|
64
|
-
}
|
|
65
|
-
get isPending() {
|
|
66
|
-
return u(this, l);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Calls fetcher again and sets isPending to true.
|
|
70
|
-
*/
|
|
71
|
-
refetch() {
|
|
72
|
-
u(this, l).current = !0, h(this, p, u(this, p) + 1);
|
|
73
|
-
const s = u(this, p);
|
|
74
|
-
u(this, b).call(this).then((r) => {
|
|
75
|
-
s === u(this, p) && (u(this, l).current = !1, this.current = r);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
b = new WeakMap(), l = new WeakMap(), p = new WeakMap();
|
|
80
|
-
var v, x, g;
|
|
81
|
-
class N extends E {
|
|
82
|
-
constructor(s, r, c = 100) {
|
|
83
|
-
super(s, r, {
|
|
34
|
+
import { S as I, a as b, s as k } from "../Store-JOKrNVEr.js";
|
|
35
|
+
import { D as j } from "../Derived-Bc88XJ8J.js";
|
|
36
|
+
import { R as A } from "../Composed-ClTo1f0b.js";
|
|
37
|
+
import { C as w, D as z } from "../Composed-ClTo1f0b.js";
|
|
38
|
+
var c, u, l;
|
|
39
|
+
class R extends A {
|
|
40
|
+
constructor(e, r, a = 100) {
|
|
41
|
+
super(e, r, {
|
|
84
42
|
manualControl: !0,
|
|
85
43
|
skipSubscribeNotification: !0
|
|
86
44
|
});
|
|
87
|
-
n(this,
|
|
88
|
-
n(this,
|
|
89
|
-
n(this,
|
|
90
|
-
|
|
45
|
+
n(this, c, void 0);
|
|
46
|
+
n(this, u, void 0);
|
|
47
|
+
n(this, l, 0);
|
|
48
|
+
p(this, u, a);
|
|
91
49
|
}
|
|
92
50
|
get step() {
|
|
93
|
-
return
|
|
51
|
+
return i(this, l);
|
|
94
52
|
}
|
|
95
53
|
startAccumulating() {
|
|
96
|
-
|
|
97
|
-
++
|
|
98
|
-
}),
|
|
54
|
+
p(this, c, setInterval(() => d(this, null, function* () {
|
|
55
|
+
++f(this, l)._, this.refetch();
|
|
56
|
+
}), i(this, u)));
|
|
99
57
|
}
|
|
100
58
|
stopAccumulating() {
|
|
101
|
-
clearInterval(
|
|
59
|
+
clearInterval(i(this, c));
|
|
102
60
|
}
|
|
103
61
|
close() {
|
|
104
62
|
super.close(), this.stopAccumulating();
|
|
105
63
|
}
|
|
106
64
|
}
|
|
107
|
-
|
|
108
|
-
var I;
|
|
109
|
-
class j extends A {
|
|
110
|
-
constructor(s, r, c) {
|
|
111
|
-
super(null, c);
|
|
112
|
-
n(this, I, []);
|
|
113
|
-
const o = D(() => {
|
|
114
|
-
this.current = r();
|
|
115
|
-
}, 0);
|
|
116
|
-
s.forEach((a) => {
|
|
117
|
-
u(this, I).push(
|
|
118
|
-
a.subscribe(() => {
|
|
119
|
-
o();
|
|
120
|
-
})
|
|
121
|
-
);
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
close() {
|
|
125
|
-
super.close(), u(this, I).forEach((s) => s());
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
I = new WeakMap();
|
|
65
|
+
c = new WeakMap(), u = new WeakMap(), l = new WeakMap();
|
|
129
66
|
export {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
67
|
+
w as Composed,
|
|
68
|
+
R as CumulativeResource,
|
|
69
|
+
j as Derived,
|
|
70
|
+
z as DerivedArray,
|
|
71
|
+
A as Resource,
|
|
72
|
+
I as Store,
|
|
73
|
+
b as activeStores,
|
|
74
|
+
k as storeRegistry
|
|
138
75
|
};
|