aptechka 0.26.5 → 0.27.1

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.
@@ -0,0 +1 @@
1
+ "use strict";var nt=a=>{throw TypeError(a)};var et=(a,f,r)=>f.has(a)||nt("Cannot "+r);var t=(a,f,r)=>(et(a,f,"read from private field"),r?r.call(a):f.get(a)),i=(a,f,r)=>f.has(a)?nt("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(a):f.set(a,r),e=(a,f,r,s)=>(et(a,f,"write to private field"),s?s.call(a,r):f.set(a,r),r),c=(a,f,r)=>(et(a,f,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../css-property/index.cjs"),ct=require("../order/index.cjs"),ot=require("../window-resizer/vanilla/index.cjs"),U=require("../events-KVanG9sR.cjs"),vt=require("../function-MthRj-GJ.cjs"),ut=require("../layout-8ryRAMGJ.cjs"),Pt=require("../math-GDWEqu7y.cjs"),X=require("../Store-CDb6RMce.cjs"),Ft=require("../scroll-entries/index.cjs");require("../ticker/vanilla/index.cjs");const Vt=require("../Damped-CTsV8tl_.cjs");var p,H,I,j,G,D,T,k,_,d,y,g,v,M,S,R,z,Z,O,q,x,l,P,F,L,E,V,Y,n,K,N,tt,m,A,C,b,w,B,$,u,h,rt,it,St,pt,ft,dt,mt,bt,st,J,W,Ct,yt,ht,at;let lt=(at=class extends HTMLElement{constructor(){super();i(this,h);i(this,p);i(this,H);i(this,I);i(this,j);i(this,G);i(this,D);i(this,T);i(this,k);i(this,_);i(this,d);i(this,y);i(this,g);i(this,v);i(this,M);i(this,S);i(this,R);i(this,z);i(this,Z);i(this,O);i(this,q);i(this,x);i(this,l);i(this,P);i(this,F);i(this,L);i(this,E);i(this,V);i(this,Y);i(this,n);i(this,K);i(this,N);i(this,tt);i(this,m);i(this,A);i(this,C);i(this,b);i(this,w);i(this,B);i(this,$);i(this,u);i(this,st);i(this,J);e(this,p,null),e(this,H,new o.CSSProperty(this,"--damping",20)),e(this,I,new o.CSSProperty(this,"--mass",0)),e(this,j,new o.CSSProperty(this,"--stiffness",0)),e(this,G,new o.CSSProperty(this,"--target","")),e(this,D,new o.CSSProperty(this,"--disabled",!1)),e(this,T,new o.CSSProperty(this,"--distance-offset",0,{rawValueCheck:!1})),e(this,k,new o.CSSProperty(this,"--start-offset",0,{rawValueCheck:!1})),e(this,_,new o.CSSProperty(this,"--capture-once",!1)),e(this,d,new o.CSSProperty(this,"--captured","")),e(this,y,new o.CSSProperty(this,"--released","")),e(this,g,new o.CSSProperty(this,"--captured-from-start","")),e(this,v,new o.CSSProperty(this,"--captured-from-finish","")),e(this,M,new o.CSSProperty(this,"--released-from-start","")),e(this,S,new o.CSSProperty(this,"--released-from-finish","")),e(this,R,new o.CSSProperty(this,"--passed-var","")),e(this,z,new o.CSSProperty(this,"--progress-var","")),e(this,Z,new o.CSSProperty(this,"--animation-var-type","current")),e(this,O,new o.CSSProperty(this,"--distance-var","")),e(this,q,new o.CSSProperty(this,"--start-var","")),e(this,x,new o.CSSProperty(this,"--finish-var","")),e(this,l,new X.Store(!1)),e(this,P,new X.Store(!1)),e(this,F,new X.Store(!1)),e(this,L,new X.Store(!1)),e(this,E,new X.Store(!1)),e(this,V,new X.Store(!1)),e(this,Y,[]),e(this,n,this),e(this,K,0),e(this,N,0),e(this,tt,0),e(this,m,new Vt.Damped(0,{order:ct.TICK_ORDER.SEGMENT,min:0,max:1})),e(this,A,0),e(this,C,0),e(this,b,0),e(this,w,0),e(this,B,!1),e(this,$,!1),e(this,u,!0),this.findAnotherScrollEntries=vt.debounce(()=>{const r=Ft.scrollEntries.getAll(this).reverse();let s=0;r.forEach((Q,gt)=>{Q.element===t(this,p)&&(s=gt)}),e(this,Y,r.slice(s+1))},0),e(this,st,()=>{t(this,u)||(this.resize(),t(this,J).call(this))}),e(this,J,()=>{!t(this,u)&&t(this,B)&&this.tick()})}get scrollContainer(){return t(this,p)}set scrollContainer(r){c(this,h,it).call(this),e(this,p,r),c(this,h,rt).call(this)}get distanceOffsetCSSProperty(){return t(this,T)}get startOffsetCSSProperty(){return t(this,k)}get captureOnceCSSProperty(){return t(this,_)}get capturedCSSProperty(){return t(this,d)}get releasedCSSProperty(){return t(this,y)}get capturedFromStartCSSProperty(){return t(this,g)}get capturedFromFinishCSSProperty(){return t(this,v)}get releasedFromStartCSSProperty(){return t(this,M)}get releasedFromFinishCSSProperty(){return t(this,S)}get passedVarCSSProperty(){return t(this,R)}get progressVarCSSProperty(){return t(this,z)}get animationVarTypeCSSProperty(){return t(this,Z)}get distanceVarCSSProperty(){return t(this,O)}get startVarCSSProperty(){return t(this,q)}get finishVarCSSProperty(){return t(this,x)}get disabledCSSProperty(){return t(this,D)}get dampingCSSProperty(){return t(this,H)}get massCSSProperty(){return t(this,I)}get stiffnessCSSProperty(){return t(this,j)}get targetCSSProperty(){return t(this,G)}get isCaptured(){return t(this,l)}get isReleased(){return t(this,P)}get isCapturedFromStart(){return t(this,F)}get isReleasedFromStart(){return t(this,L)}get isCapturedFromFinish(){return t(this,E)}get isReleasedFromFinish(){return t(this,V)}get directionPosition(){return t(this,K)}get directionSize(){return t(this,N)}get passed(){return t(this,m)}get progress(){return t(this,A)}get start(){return t(this,C)}get finish(){return t(this,w)}get distance(){return t(this,b)}get isCapturedOnce(){return t(this,$)}get isDisabled(){return t(this,u)}resize(){e(this,N,t(this,p).vertical?this.offsetHeight:this.offsetWidth);const r=t(this,p)instanceof HTMLElement?t(this,p):t(this,p).element;e(this,K,t(this,p).vertical?ut.getCumulativeOffsetTop(this,r):ut.getCumulativeOffsetLeft(this,r)),e(this,C,this.getStart()),e(this,b,this.getDistance()),e(this,C,t(this,C)+t(this,k).current),e(this,b,t(this,b)+t(this,T).current),e(this,w,t(this,C)+t(this,b)),t(this,p).currentScrollValue>t(this,w)&&!t(this,l).current&&!t(this,P).current&&(t(this,l).current=!0),this.setVar(t(this,q).current,t(this,C)),this.setVar(t(this,x).current,t(this,w)),this.setVar(t(this,O).current,t(this,b)),t(this,m).max=t(this,b),e(this,B,!0)}tick(){let r=t(this,p).currentScrollValue;t(this,Y).forEach(Q=>{r+=Q.value}),t(this,m).set(r-t(this,C));const s=Math.round(r);t(this,l).current&&(s>=t(this,C)?t(this,F).current||c(this,h,ft).call(this):t(this,F).current&&!t(this,L).current&&c(this,h,mt).call(this),s<t(this,w)?t(this,V).current&&!t(this,E).current&&c(this,h,dt).call(this):t(this,F).current&&!t(this,V).current&&c(this,h,bt).call(this)),s>=t(this,C)&&s<t(this,w)?t(this,l).current||c(this,h,St).call(this):t(this,l).current&&(t(this,m).set(Pt.step(t(this,b)/2,t(this,m).target,0,t(this,b))),c(this,h,pt).call(this)),t(this,$)&&t(this,_).current&&(t(this,d).current&&t(this,n).classList.add(t(this,d).current),e(this,u,!0))}disable(){this.style.cssText="",e(this,K,0),e(this,N,0),t(this,m).reset(),e(this,A,0),e(this,C,0),e(this,b,0),e(this,w,0),e(this,B,!1),t(this,l).current=!1,t(this,P).current=!1,t(this,F).current=!1,t(this,L).current=!1,t(this,E).current=!1,t(this,V).current=!1,e(this,$,!1),e(this,u,!0),c(this,h,ht).call(this)}enable(){e(this,u,!1)}connectedCallback(){c(this,h,rt).call(this)}disconnectedCallback(){c(this,h,it).call(this)}removeVar(r){r&&t(this,n).style.removeProperty(`--${r}`)}setVar(r,s){r&&t(this,n).style.setProperty(`--${r}`,s.toString())}getDistance(){return t(this,N)+t(this,tt)}getStart(){return t(this,K)-t(this,tt)}},p=new WeakMap,H=new WeakMap,I=new WeakMap,j=new WeakMap,G=new WeakMap,D=new WeakMap,T=new WeakMap,k=new WeakMap,_=new WeakMap,d=new WeakMap,y=new WeakMap,g=new WeakMap,v=new WeakMap,M=new WeakMap,S=new WeakMap,R=new WeakMap,z=new WeakMap,Z=new WeakMap,O=new WeakMap,q=new WeakMap,x=new WeakMap,l=new WeakMap,P=new WeakMap,F=new WeakMap,L=new WeakMap,E=new WeakMap,V=new WeakMap,Y=new WeakMap,n=new WeakMap,K=new WeakMap,N=new WeakMap,tt=new WeakMap,m=new WeakMap,A=new WeakMap,C=new WeakMap,b=new WeakMap,w=new WeakMap,B=new WeakMap,$=new WeakMap,u=new WeakMap,h=new WeakSet,rt=function(){if(!t(this,p))return;t(this,l).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCapture",{composed:!0,custom:!0})}),t(this,F).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromStart",{composed:!0,custom:!0})}),t(this,E).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentCaptureFromFinish",{composed:!0,custom:!0})}),t(this,P).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentRelease",{composed:!0,custom:!0})}),t(this,L).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromStart",{composed:!0,custom:!0})}),t(this,V).subscribe(s=>{s.current&&U.dispatchEvent(this,"scrollSegmentReleaseFromFinish",{composed:!0,custom:!0})}),t(this,H).observe(),t(this,I).observe(),t(this,j).observe(),t(this,G).observe(),t(this,D).observe(),t(this,T).observe(),t(this,k).observe(),t(this,_).observe(),t(this,d).observe(),t(this,y).observe(),t(this,g).observe(),t(this,v).observe(),t(this,M).observe(),t(this,S).observe(),t(this,R).observe(),t(this,z).observe(),t(this,Z).observe(),t(this,O).observe(),t(this,q).observe(),t(this,x).observe();let r=!1;this.findAnotherScrollEntries(),t(this,D).current||this.enable(),t(this,H).subscribe(s=>{t(this,m).damping=s.current}),t(this,I).subscribe(s=>{t(this,m).mass=s.current}),t(this,j).subscribe(s=>{t(this,m).stiffness=s.current}),t(this,G).subscribe(s=>{s.previous&&c(this,h,ht).call(this),s.current?s.current==="parent"?e(this,n,this.parentElement||this):e(this,n,document.querySelector(s.current)||this):e(this,n,this)}),t(this,D).subscribe(s=>{s.current&&!s.previous?this.disable():!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,k).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,T).subscribe(()=>{r&&!t(this,u)&&this.resize()}),t(this,d).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,g).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,v).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,y).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,M).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,S).subscribe(s=>{c(this,h,W).call(this,s)}),t(this,_).subscribe(s=>{t(this,u)||!s.current&&s.previous&&(this.resize(),this.enable())}),t(this,R).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,this.passed.current))}),t(this,z).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,A)))}),t(this,q).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,C)))}),t(this,x).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,w)))}),t(this,O).subscribe(s=>{t(this,u)||(this.removeVar(s.previous),this.setVar(s.current,t(this,b)))}),t(this,m).subscribe(s=>{const Q=t(this,m)[t(this,Z).current];e(this,A,Q/t(this,b)||0),this.setVar(t(this,R).current,Q.toFixed(6)),this.setVar(t(this,z).current,t(this,A).toFixed(6))}),ot.windowResizer.subscribe(t(this,st),ct.RESIZE_ORDER.SCROLL),this.scrollContainer.onScroll(t(this,J)),r=!0},it=function(){t(this,p)&&(ot.windowResizer.unsubscribe(t(this,st)),this.scrollContainer.offScroll(t(this,J)),t(this,H).close(),t(this,I).close(),t(this,j).close(),t(this,G).close(),t(this,D).close(),t(this,T).close(),t(this,k).close(),t(this,_).close(),t(this,d).close(),t(this,y).close(),t(this,g).close(),t(this,v).close(),t(this,M).close(),t(this,S).close(),t(this,R).close(),t(this,z).close(),t(this,O).close(),t(this,q).close(),t(this,x).close(),t(this,l).close(),t(this,P).close(),t(this,F).close(),t(this,L).close(),t(this,E).close(),t(this,V).close(),this.disable())},St=function(){t(this,l).current=!0,t(this,P).current=!1,e(this,$,!0),t(this,y).current&&t(this,n).classList.remove(t(this,y).current),t(this,S).current&&t(this,n).classList.remove(t(this,S).current),t(this,S).current&&t(this,n).classList.remove(t(this,S).current),t(this,d).current&&t(this,n).classList.add(t(this,d).current)},pt=function(){t(this,P).current=!0,t(this,l).current=!1,e(this,$,!0),t(this,d).current&&t(this,n).classList.remove(t(this,d).current),t(this,g).current&&t(this,n).classList.remove(t(this,g).current),t(this,v).current&&t(this,n).classList.remove(t(this,v).current),t(this,y).current&&t(this,n).classList.add(t(this,y).current)},ft=function(){t(this,l).current=!0,t(this,F).current=!0,t(this,L).current=!1,t(this,g).current&&t(this,n).classList.add(t(this,g).current)},dt=function(){t(this,l).current=!0,t(this,E).current=!0,t(this,V).current=!1,t(this,v).current&&t(this,n).classList.add(t(this,v).current)},mt=function(){t(this,P).current=!0,t(this,L).current=!0,t(this,F).current=!1,t(this,S).current&&t(this,n).classList.add(t(this,S).current)},bt=function(){t(this,P).current=!0,t(this,V).current=!0,t(this,E).current=!1,t(this,S).current&&t(this,n).classList.add(t(this,S).current)},st=new WeakMap,J=new WeakMap,W=function(r){if(t(this,u)){r.previous&&t(this,n).classList.remove(r.previous),r.current&&t(this,n).classList.remove(r.current);return}r.current&&t(this,l).current?(r.previous&&t(this,n).classList.remove(r.previous),t(this,n).classList.add(r.current)):!r.current&&r.previous&&t(this,n).classList.remove(r.previous)},Ct=function(...r){r.forEach(s=>{s&&t(this,n).classList.remove(s)})},yt=function(...r){r.forEach(s=>{s&&t(this,n).style.removeProperty(`--${s}`)})},ht=function(){c(this,h,Ct).call(this,t(this,d).current,t(this,g).current,t(this,v).current,t(this,y).current,t(this,M).current,t(this,S).current),c(this,h,yt).call(this,t(this,R).current,t(this,z).current,t(this,O).current,t(this,q).current,t(this,x).current)},at);customElements.get("scroll-segment")||customElements.define("scroll-segment",lt);exports.ScrollSegmentElement=lt;
@@ -0,0 +1,80 @@
1
+ import { CSSProperty } from '../css-property';
2
+ import { Store } from '../store/vanilla';
3
+ import { Damped } from '../animation';
4
+
5
+ export interface ScrollSegmentEvents {
6
+ scrollSegmentCapture: CustomEvent;
7
+ scrollSegmentCaptureFromStart: CustomEvent;
8
+ scrollSegmentCaptureFromFinish: CustomEvent;
9
+ scrollSegmentRelease: CustomEvent;
10
+ scrollSegmentReleaseFromStart: CustomEvent;
11
+ scrollSegmentReleaseFromFinish: CustomEvent;
12
+ }
13
+ export interface ScrollSegmentContainer {
14
+ element: HTMLElement;
15
+ currentScrollValue: number;
16
+ vertical: boolean;
17
+ onScroll(callback: Function): void;
18
+ offScroll(callback: Function): void;
19
+ }
20
+ export interface ScrollSegmentContainerElement extends Omit<ScrollSegmentContainer, 'element'>, HTMLElement {
21
+ }
22
+ export declare class ScrollSegmentElement extends HTMLElement {
23
+ #private;
24
+ constructor();
25
+ get scrollContainer(): ScrollSegmentContainerElement | ScrollSegmentContainer;
26
+ set scrollContainer(value: ScrollSegmentContainerElement | ScrollSegmentContainer);
27
+ get distanceOffsetCSSProperty(): CSSProperty<number>;
28
+ get startOffsetCSSProperty(): CSSProperty<number>;
29
+ get captureOnceCSSProperty(): CSSProperty<boolean>;
30
+ get capturedCSSProperty(): CSSProperty<string>;
31
+ get releasedCSSProperty(): CSSProperty<string>;
32
+ get capturedFromStartCSSProperty(): CSSProperty<string>;
33
+ get capturedFromFinishCSSProperty(): CSSProperty<string>;
34
+ get releasedFromStartCSSProperty(): CSSProperty<string>;
35
+ get releasedFromFinishCSSProperty(): CSSProperty<string>;
36
+ get passedVarCSSProperty(): CSSProperty<string>;
37
+ get progressVarCSSProperty(): CSSProperty<string>;
38
+ get animationVarTypeCSSProperty(): CSSProperty<"target" | "current">;
39
+ get distanceVarCSSProperty(): CSSProperty<string>;
40
+ get startVarCSSProperty(): CSSProperty<string>;
41
+ get finishVarCSSProperty(): CSSProperty<string>;
42
+ get disabledCSSProperty(): CSSProperty<boolean>;
43
+ get dampingCSSProperty(): CSSProperty<number>;
44
+ get massCSSProperty(): CSSProperty<number>;
45
+ get stiffnessCSSProperty(): CSSProperty<number>;
46
+ get targetCSSProperty(): CSSProperty<string>;
47
+ get isCaptured(): Store<boolean>;
48
+ get isReleased(): Store<boolean>;
49
+ get isCapturedFromStart(): Store<boolean>;
50
+ get isReleasedFromStart(): Store<boolean>;
51
+ get isCapturedFromFinish(): Store<boolean>;
52
+ get isReleasedFromFinish(): Store<boolean>;
53
+ get directionPosition(): number;
54
+ get directionSize(): number;
55
+ get passed(): Damped;
56
+ get progress(): number;
57
+ get start(): number;
58
+ get finish(): number;
59
+ get distance(): number;
60
+ get isCapturedOnce(): boolean;
61
+ get isDisabled(): boolean;
62
+ resize(): void;
63
+ tick(): void;
64
+ disable(): void;
65
+ enable(): void;
66
+ protected connectedCallback(): void;
67
+ protected disconnectedCallback(): void;
68
+ protected removeVar(name: string | undefined): void;
69
+ protected setVar(name: string | undefined, value: string | number): void;
70
+ protected getDistance(): number;
71
+ protected getStart(): number;
72
+ protected findAnotherScrollEntries: () => void;
73
+ }
74
+ declare global {
75
+ interface HTMLElementTagNameMap {
76
+ 'scroll-segment': ScrollSegmentElement;
77
+ }
78
+ interface HTMLElementEventMap extends ScrollSegmentEvents {
79
+ }
80
+ }
@@ -0,0 +1,387 @@
1
+ var nt = (a) => {
2
+ throw TypeError(a);
3
+ };
4
+ var et = (a, S, r) => S.has(a) || nt("Cannot " + r);
5
+ var t = (a, S, r) => (et(a, S, "read from private field"), r ? r.call(a) : S.get(a)), i = (a, S, r) => S.has(a) ? nt("Cannot add the same private member more than once") : S instanceof WeakSet ? S.add(a) : S.set(a, r), e = (a, S, r, s) => (et(a, S, "write to private field"), s ? s.call(a, r) : S.set(a, r), r), c = (a, S, r) => (et(a, S, "access private method"), r);
6
+ import { CSSProperty as u } from "../css-property/index.js";
7
+ import { TICK_ORDER as gt, RESIZE_ORDER as Ct } from "../order/index.js";
8
+ import { windowResizer as ct } from "../window-resizer/vanilla/index.js";
9
+ import { d as U } from "../events-CsVF98U6.js";
10
+ import { d as vt } from "../function-C10DGppn.js";
11
+ import { a as yt, g as Pt } from "../layout-HoBT_Da2.js";
12
+ import { s as Ft } from "../math-BOBiC4TN.js";
13
+ import { S as X } from "../Store-OTdcl6SX.js";
14
+ import { scrollEntries as Vt } from "../scroll-entries/index.js";
15
+ import "../ticker/vanilla/index.js";
16
+ import { D as Lt } from "../Damped-Chu29wn-.js";
17
+ var p, _, q, G, K, x, T, M, A, m, C, v, y, $, f, R, O, j, z, D, k, l, P, F, w, E, V, Y, n, N, W, tt, d, H, g, b, L, B, I, o, h, rt, it, ot, at, lt, ft, pt, St, st, J, Z, mt, dt, ht, ut;
18
+ let wt = (ut = class extends HTMLElement {
19
+ constructor() {
20
+ super();
21
+ i(this, h);
22
+ i(this, p);
23
+ i(this, _);
24
+ i(this, q);
25
+ i(this, G);
26
+ i(this, K);
27
+ i(this, x);
28
+ i(this, T);
29
+ i(this, M);
30
+ i(this, A);
31
+ i(this, m);
32
+ i(this, C);
33
+ i(this, v);
34
+ i(this, y);
35
+ i(this, $);
36
+ i(this, f);
37
+ i(this, R);
38
+ i(this, O);
39
+ i(this, j);
40
+ i(this, z);
41
+ i(this, D);
42
+ i(this, k);
43
+ i(this, l);
44
+ i(this, P);
45
+ i(this, F);
46
+ i(this, w);
47
+ i(this, E);
48
+ i(this, V);
49
+ i(this, Y);
50
+ i(this, n);
51
+ i(this, N);
52
+ i(this, W);
53
+ i(this, tt);
54
+ i(this, d);
55
+ i(this, H);
56
+ i(this, g);
57
+ i(this, b);
58
+ i(this, L);
59
+ i(this, B);
60
+ i(this, I);
61
+ i(this, o);
62
+ i(this, st);
63
+ i(this, J);
64
+ e(this, p, null), e(this, _, new u(this, "--damping", 20)), e(this, q, new u(this, "--mass", 0)), e(this, G, new u(this, "--stiffness", 0)), e(this, K, new u(this, "--target", "")), e(this, x, new u(this, "--disabled", !1)), e(this, T, new u(
65
+ this,
66
+ "--distance-offset",
67
+ 0,
68
+ { rawValueCheck: !1 }
69
+ )), e(this, M, new u(this, "--start-offset", 0, {
70
+ rawValueCheck: !1
71
+ })), e(this, A, new u(
72
+ this,
73
+ "--capture-once",
74
+ !1
75
+ )), e(this, m, new u(this, "--captured", "")), e(this, C, new u(this, "--released", "")), e(this, v, new u(
76
+ this,
77
+ "--captured-from-start",
78
+ ""
79
+ )), e(this, y, new u(
80
+ this,
81
+ "--captured-from-finish",
82
+ ""
83
+ )), e(this, $, new u(
84
+ this,
85
+ "--released-from-start",
86
+ ""
87
+ )), e(this, f, new u(
88
+ this,
89
+ "--released-from-finish",
90
+ ""
91
+ )), e(this, R, new u(this, "--passed-var", "")), e(this, O, new u(this, "--progress-var", "")), e(this, j, new u(
92
+ this,
93
+ "--animation-var-type",
94
+ "current"
95
+ )), e(this, z, new u(this, "--distance-var", "")), e(this, D, new u(this, "--start-var", "")), e(this, k, new u(this, "--finish-var", "")), e(this, l, new X(!1)), e(this, P, new X(!1)), e(this, F, new X(!1)), e(this, w, new X(!1)), e(this, E, new X(!1)), e(this, V, new X(!1)), e(this, Y, []), e(this, n, this), e(this, N, 0), e(this, W, 0), e(this, tt, 0), e(this, d, new Lt(0, { order: gt.SEGMENT, min: 0, max: 1 })), e(this, H, 0), e(this, g, 0), e(this, b, 0), e(this, L, 0), e(this, B, !1), e(this, I, !1), e(this, o, !0), this.findAnotherScrollEntries = vt(() => {
96
+ const r = Vt.getAll(this).reverse();
97
+ let s = 0;
98
+ r.forEach((Q, bt) => {
99
+ Q.element === t(this, p) && (s = bt);
100
+ }), e(this, Y, r.slice(s + 1));
101
+ }, 0), e(this, st, () => {
102
+ t(this, o) || (this.resize(), t(this, J).call(this));
103
+ }), e(this, J, () => {
104
+ !t(this, o) && t(this, B) && this.tick();
105
+ });
106
+ }
107
+ get scrollContainer() {
108
+ return t(this, p);
109
+ }
110
+ set scrollContainer(r) {
111
+ c(this, h, it).call(this), e(this, p, r), c(this, h, rt).call(this);
112
+ }
113
+ get distanceOffsetCSSProperty() {
114
+ return t(this, T);
115
+ }
116
+ get startOffsetCSSProperty() {
117
+ return t(this, M);
118
+ }
119
+ get captureOnceCSSProperty() {
120
+ return t(this, A);
121
+ }
122
+ get capturedCSSProperty() {
123
+ return t(this, m);
124
+ }
125
+ get releasedCSSProperty() {
126
+ return t(this, C);
127
+ }
128
+ get capturedFromStartCSSProperty() {
129
+ return t(this, v);
130
+ }
131
+ get capturedFromFinishCSSProperty() {
132
+ return t(this, y);
133
+ }
134
+ get releasedFromStartCSSProperty() {
135
+ return t(this, $);
136
+ }
137
+ get releasedFromFinishCSSProperty() {
138
+ return t(this, f);
139
+ }
140
+ get passedVarCSSProperty() {
141
+ return t(this, R);
142
+ }
143
+ get progressVarCSSProperty() {
144
+ return t(this, O);
145
+ }
146
+ get animationVarTypeCSSProperty() {
147
+ return t(this, j);
148
+ }
149
+ get distanceVarCSSProperty() {
150
+ return t(this, z);
151
+ }
152
+ get startVarCSSProperty() {
153
+ return t(this, D);
154
+ }
155
+ get finishVarCSSProperty() {
156
+ return t(this, k);
157
+ }
158
+ get disabledCSSProperty() {
159
+ return t(this, x);
160
+ }
161
+ get dampingCSSProperty() {
162
+ return t(this, _);
163
+ }
164
+ get massCSSProperty() {
165
+ return t(this, q);
166
+ }
167
+ get stiffnessCSSProperty() {
168
+ return t(this, G);
169
+ }
170
+ get targetCSSProperty() {
171
+ return t(this, K);
172
+ }
173
+ get isCaptured() {
174
+ return t(this, l);
175
+ }
176
+ get isReleased() {
177
+ return t(this, P);
178
+ }
179
+ get isCapturedFromStart() {
180
+ return t(this, F);
181
+ }
182
+ get isReleasedFromStart() {
183
+ return t(this, w);
184
+ }
185
+ get isCapturedFromFinish() {
186
+ return t(this, E);
187
+ }
188
+ get isReleasedFromFinish() {
189
+ return t(this, V);
190
+ }
191
+ get directionPosition() {
192
+ return t(this, N);
193
+ }
194
+ get directionSize() {
195
+ return t(this, W);
196
+ }
197
+ get passed() {
198
+ return t(this, d);
199
+ }
200
+ get progress() {
201
+ return t(this, H);
202
+ }
203
+ get start() {
204
+ return t(this, g);
205
+ }
206
+ get finish() {
207
+ return t(this, L);
208
+ }
209
+ get distance() {
210
+ return t(this, b);
211
+ }
212
+ get isCapturedOnce() {
213
+ return t(this, I);
214
+ }
215
+ get isDisabled() {
216
+ return t(this, o);
217
+ }
218
+ resize() {
219
+ e(this, W, t(this, p).vertical ? this.offsetHeight : this.offsetWidth);
220
+ const r = t(this, p) instanceof HTMLElement ? t(this, p) : t(this, p).element;
221
+ e(this, N, t(this, p).vertical ? yt(this, r) : Pt(this, r)), e(this, g, this.getStart()), e(this, b, this.getDistance()), e(this, g, t(this, g) + t(this, M).current), e(this, b, t(this, b) + t(this, T).current), e(this, L, t(this, g) + t(this, b)), t(this, p).currentScrollValue > t(this, L) && !t(this, l).current && !t(this, P).current && (t(this, l).current = !0), this.setVar(t(this, D).current, t(this, g)), this.setVar(t(this, k).current, t(this, L)), this.setVar(t(this, z).current, t(this, b)), t(this, d).max = t(this, b), e(this, B, !0);
222
+ }
223
+ tick() {
224
+ let r = t(this, p).currentScrollValue;
225
+ t(this, Y).forEach((Q) => {
226
+ r += Q.value;
227
+ }), t(this, d).set(r - t(this, g));
228
+ const s = Math.round(r);
229
+ t(this, l).current && (s >= t(this, g) ? t(this, F).current || c(this, h, lt).call(this) : t(this, F).current && !t(this, w).current && c(this, h, pt).call(this), s < t(this, L) ? t(this, V).current && !t(this, E).current && c(this, h, ft).call(this) : t(this, F).current && !t(this, V).current && c(this, h, St).call(this)), s >= t(this, g) && s < t(this, L) ? t(this, l).current || c(this, h, ot).call(this) : t(this, l).current && (t(this, d).set(
230
+ Ft(t(this, b) / 2, t(this, d).target, 0, t(this, b))
231
+ ), c(this, h, at).call(this)), t(this, I) && t(this, A).current && (t(this, m).current && t(this, n).classList.add(t(this, m).current), e(this, o, !0));
232
+ }
233
+ disable() {
234
+ this.style.cssText = "", e(this, N, 0), e(this, W, 0), t(this, d).reset(), e(this, H, 0), e(this, g, 0), e(this, b, 0), e(this, L, 0), e(this, B, !1), t(this, l).current = !1, t(this, P).current = !1, t(this, F).current = !1, t(this, w).current = !1, t(this, E).current = !1, t(this, V).current = !1, e(this, I, !1), e(this, o, !0), c(this, h, ht).call(this);
235
+ }
236
+ enable() {
237
+ e(this, o, !1);
238
+ }
239
+ connectedCallback() {
240
+ c(this, h, rt).call(this);
241
+ }
242
+ disconnectedCallback() {
243
+ c(this, h, it).call(this);
244
+ }
245
+ removeVar(r) {
246
+ r && t(this, n).style.removeProperty(`--${r}`);
247
+ }
248
+ setVar(r, s) {
249
+ r && t(this, n).style.setProperty(`--${r}`, s.toString());
250
+ }
251
+ getDistance() {
252
+ return t(this, W) + t(this, tt);
253
+ }
254
+ getStart() {
255
+ return t(this, N) - t(this, tt);
256
+ }
257
+ }, p = new WeakMap(), _ = new WeakMap(), q = new WeakMap(), G = new WeakMap(), K = new WeakMap(), x = new WeakMap(), T = new WeakMap(), M = new WeakMap(), A = new WeakMap(), m = new WeakMap(), C = new WeakMap(), v = new WeakMap(), y = new WeakMap(), $ = new WeakMap(), f = new WeakMap(), R = new WeakMap(), O = new WeakMap(), j = new WeakMap(), z = new WeakMap(), D = new WeakMap(), k = new WeakMap(), l = new WeakMap(), P = new WeakMap(), F = new WeakMap(), w = new WeakMap(), E = new WeakMap(), V = new WeakMap(), Y = new WeakMap(), n = new WeakMap(), N = new WeakMap(), W = new WeakMap(), tt = new WeakMap(), d = new WeakMap(), H = new WeakMap(), g = new WeakMap(), b = new WeakMap(), L = new WeakMap(), B = new WeakMap(), I = new WeakMap(), o = new WeakMap(), h = new WeakSet(), rt = function() {
258
+ if (!t(this, p))
259
+ return;
260
+ t(this, l).subscribe((s) => {
261
+ s.current && U(this, "scrollSegmentCapture", {
262
+ composed: !0,
263
+ custom: !0
264
+ });
265
+ }), t(this, F).subscribe((s) => {
266
+ s.current && U(this, "scrollSegmentCaptureFromStart", {
267
+ composed: !0,
268
+ custom: !0
269
+ });
270
+ }), t(this, E).subscribe((s) => {
271
+ s.current && U(this, "scrollSegmentCaptureFromFinish", {
272
+ composed: !0,
273
+ custom: !0
274
+ });
275
+ }), t(this, P).subscribe((s) => {
276
+ s.current && U(this, "scrollSegmentRelease", {
277
+ composed: !0,
278
+ custom: !0
279
+ });
280
+ }), t(this, w).subscribe((s) => {
281
+ s.current && U(this, "scrollSegmentReleaseFromStart", {
282
+ composed: !0,
283
+ custom: !0
284
+ });
285
+ }), t(this, V).subscribe((s) => {
286
+ s.current && U(this, "scrollSegmentReleaseFromFinish", {
287
+ composed: !0,
288
+ custom: !0
289
+ });
290
+ }), t(this, _).observe(), t(this, q).observe(), t(this, G).observe(), t(this, K).observe(), t(this, x).observe(), t(this, T).observe(), t(this, M).observe(), t(this, A).observe(), t(this, m).observe(), t(this, C).observe(), t(this, v).observe(), t(this, y).observe(), t(this, $).observe(), t(this, f).observe(), t(this, R).observe(), t(this, O).observe(), t(this, j).observe(), t(this, z).observe(), t(this, D).observe(), t(this, k).observe();
291
+ let r = !1;
292
+ this.findAnotherScrollEntries(), t(this, x).current || this.enable(), t(this, _).subscribe((s) => {
293
+ t(this, d).damping = s.current;
294
+ }), t(this, q).subscribe((s) => {
295
+ t(this, d).mass = s.current;
296
+ }), t(this, G).subscribe((s) => {
297
+ t(this, d).stiffness = s.current;
298
+ }), t(this, K).subscribe((s) => {
299
+ s.previous && c(this, h, ht).call(this), s.current ? s.current === "parent" ? e(this, n, this.parentElement || this) : e(this, n, document.querySelector(s.current) || this) : e(this, n, this);
300
+ }), t(this, x).subscribe((s) => {
301
+ s.current && !s.previous ? this.disable() : !s.current && s.previous && (this.resize(), this.enable());
302
+ }), t(this, M).subscribe(() => {
303
+ r && !t(this, o) && this.resize();
304
+ }), t(this, T).subscribe(() => {
305
+ r && !t(this, o) && this.resize();
306
+ }), t(this, m).subscribe((s) => {
307
+ c(this, h, Z).call(this, s);
308
+ }), t(this, v).subscribe((s) => {
309
+ c(this, h, Z).call(this, s);
310
+ }), t(this, y).subscribe((s) => {
311
+ c(this, h, Z).call(this, s);
312
+ }), t(this, C).subscribe((s) => {
313
+ c(this, h, Z).call(this, s);
314
+ }), t(this, $).subscribe((s) => {
315
+ c(this, h, Z).call(this, s);
316
+ }), t(this, f).subscribe((s) => {
317
+ c(this, h, Z).call(this, s);
318
+ }), t(this, A).subscribe((s) => {
319
+ t(this, o) || !s.current && s.previous && (this.resize(), this.enable());
320
+ }), t(this, R).subscribe((s) => {
321
+ t(this, o) || (this.removeVar(s.previous), this.setVar(s.current, this.passed.current));
322
+ }), t(this, O).subscribe((s) => {
323
+ t(this, o) || (this.removeVar(s.previous), this.setVar(s.current, t(this, H)));
324
+ }), t(this, D).subscribe((s) => {
325
+ t(this, o) || (this.removeVar(s.previous), this.setVar(s.current, t(this, g)));
326
+ }), t(this, k).subscribe((s) => {
327
+ t(this, o) || (this.removeVar(s.previous), this.setVar(s.current, t(this, L)));
328
+ }), t(this, z).subscribe((s) => {
329
+ t(this, o) || (this.removeVar(s.previous), this.setVar(s.current, t(this, b)));
330
+ }), t(this, d).subscribe((s) => {
331
+ const Q = t(this, d)[t(this, j).current];
332
+ e(this, H, Q / t(this, b) || 0), this.setVar(t(this, R).current, Q.toFixed(6)), this.setVar(
333
+ t(this, O).current,
334
+ t(this, H).toFixed(6)
335
+ );
336
+ }), ct.subscribe(t(this, st), Ct.SCROLL), this.scrollContainer.onScroll(t(this, J)), r = !0;
337
+ }, it = function() {
338
+ t(this, p) && (ct.unsubscribe(t(this, st)), this.scrollContainer.offScroll(t(this, J)), t(this, _).close(), t(this, q).close(), t(this, G).close(), t(this, K).close(), t(this, x).close(), t(this, T).close(), t(this, M).close(), t(this, A).close(), t(this, m).close(), t(this, C).close(), t(this, v).close(), t(this, y).close(), t(this, $).close(), t(this, f).close(), t(this, R).close(), t(this, O).close(), t(this, z).close(), t(this, D).close(), t(this, k).close(), t(this, l).close(), t(this, P).close(), t(this, F).close(), t(this, w).close(), t(this, E).close(), t(this, V).close(), this.disable());
339
+ }, ot = function() {
340
+ t(this, l).current = !0, t(this, P).current = !1, e(this, I, !0), t(this, C).current && t(this, n).classList.remove(t(this, C).current), t(this, f).current && t(this, n).classList.remove(
341
+ t(this, f).current
342
+ ), t(this, f).current && t(this, n).classList.remove(
343
+ t(this, f).current
344
+ ), t(this, m).current && t(this, n).classList.add(t(this, m).current);
345
+ }, at = function() {
346
+ t(this, P).current = !0, t(this, l).current = !1, e(this, I, !0), t(this, m).current && t(this, n).classList.remove(t(this, m).current), t(this, v).current && t(this, n).classList.remove(
347
+ t(this, v).current
348
+ ), t(this, y).current && t(this, n).classList.remove(
349
+ t(this, y).current
350
+ ), t(this, C).current && t(this, n).classList.add(t(this, C).current);
351
+ }, lt = function() {
352
+ t(this, l).current = !0, t(this, F).current = !0, t(this, w).current = !1, t(this, v).current && t(this, n).classList.add(
353
+ t(this, v).current
354
+ );
355
+ }, ft = function() {
356
+ t(this, l).current = !0, t(this, E).current = !0, t(this, V).current = !1, t(this, y).current && t(this, n).classList.add(
357
+ t(this, y).current
358
+ );
359
+ }, pt = function() {
360
+ t(this, P).current = !0, t(this, w).current = !0, t(this, F).current = !1, t(this, f).current && t(this, n).classList.add(
361
+ t(this, f).current
362
+ );
363
+ }, St = function() {
364
+ t(this, P).current = !0, t(this, V).current = !0, t(this, E).current = !1, t(this, f).current && t(this, n).classList.add(
365
+ t(this, f).current
366
+ );
367
+ }, st = new WeakMap(), J = new WeakMap(), Z = function(r) {
368
+ if (t(this, o)) {
369
+ r.previous && t(this, n).classList.remove(r.previous), r.current && t(this, n).classList.remove(r.current);
370
+ return;
371
+ }
372
+ r.current && t(this, l).current ? (r.previous && t(this, n).classList.remove(r.previous), t(this, n).classList.add(r.current)) : !r.current && r.previous && t(this, n).classList.remove(r.previous);
373
+ }, mt = function(...r) {
374
+ r.forEach((s) => {
375
+ s && t(this, n).classList.remove(s);
376
+ });
377
+ }, dt = function(...r) {
378
+ r.forEach((s) => {
379
+ s && t(this, n).style.removeProperty(`--${s}`);
380
+ });
381
+ }, ht = function() {
382
+ c(this, h, mt).call(this, t(this, m).current, t(this, v).current, t(this, y).current, t(this, C).current, t(this, $).current, t(this, f).current), c(this, h, dt).call(this, t(this, R).current, t(this, O).current, t(this, z).current, t(this, D).current, t(this, k).current);
383
+ }, ut);
384
+ customElements.get("scroll-segment") || customElements.define("scroll-segment", wt);
385
+ export {
386
+ wt as ScrollSegmentElement
387
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.26.5",
3
+ "version": "0.27.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -73,10 +73,15 @@
73
73
  "default": "./lib/device/index.js",
74
74
  "types": "./lib/device/index.d.ts"
75
75
  },
76
- "./element-resizer": {
77
- "require": "./lib/element-resizer/index.cjs",
78
- "default": "./lib/element-resizer/index.js",
79
- "types": "./lib/element-resizer/index.d.ts"
76
+ "./element-resizer/vanilla": {
77
+ "require": "./lib/element-resizer/vanilla/index.cjs",
78
+ "default": "./lib/element-resizer/vanilla/index.js",
79
+ "types": "./lib/element-resizer/vanilla/index.d.ts"
80
+ },
81
+ "./element-resizer/react": {
82
+ "require": "./lib/element-resizer/react/index.cjs",
83
+ "default": "./lib/element-resizer/react/index.js",
84
+ "types": "./lib/element-resizer/react/index.d.ts"
80
85
  },
81
86
  "./en3": {
82
87
  "require": "./lib/en3/index.cjs",
@@ -158,6 +163,11 @@
158
163
  "default": "./lib/scroll-entries/index.js",
159
164
  "types": "./lib/scroll-entries/index.d.ts"
160
165
  },
166
+ "./scroll-segment": {
167
+ "require": "./lib/scroll-segment/index.cjs",
168
+ "default": "./lib/scroll-segment/index.js",
169
+ "types": "./lib/scroll-segment/index.d.ts"
170
+ },
161
171
  "./slicer": {
162
172
  "require": "./lib/slicer/index.cjs",
163
173
  "default": "./lib/slicer/index.js",
@@ -301,6 +311,9 @@
301
311
  "scroll-entries": [
302
312
  "lib/scroll-entries/index.d.ts"
303
313
  ],
314
+ "scroll-segment": [
315
+ "lib/scroll-segment/index.d.ts"
316
+ ],
304
317
  "slicer": [
305
318
  "lib/slicer/index.d.ts"
306
319
  ],