aptechka 0.5.4 → 0.5.6
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/en3/core/En3View.d.ts +1 -0
- package/lib/en3/index.cjs +7 -7
- package/lib/en3/index.js +178 -172
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +4 -4
- package/package.json +1 -1
package/lib/layout-box/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var G=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var t=(i,e,s)=>(G(i,e,"read from private field"),s?s.call(i):e.get(i)),h=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},r=(i,e,s,n)=>(G(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s);var L=(i,e,s)=>(G(i,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const dt=require("../css-unit-parser/index.cjs"),J=require("../ladder/index.cjs"),j=require("../order/index.cjs"),N=require("../scroll-entries/index.cjs"),tt=require("../ticker/index.cjs"),et=require("../browser-CpzFX2xg.cjs"),st=require("../dom-JBOkFLTh.cjs"),P=require("../layout-8ryRAMGJ.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const it=require("../element-resizer/index.cjs"),ht=require("../window-resizer/index.cjs");function rt(i){const e=Math.sqrt(i.m11*i.m11+i.m12*i.m12+i.m13*i.m13),s=Math.sqrt(i.m21*i.m21+i.m22*i.m22+i.m23*i.m23),n=Math.sqrt(i.m31*i.m31+i.m32*i.m32+i.m33*i.m33),y=Math.atan2(i.m32,i.m33),B=Math.atan2(-i.m31,Math.sqrt(i.m32*i.m32+i.m33*i.m33)),F=Math.atan2(i.m21,i.m11),u=i.m41,q=i.m42*-1,O=i.m43;return{scaleX:e,scaleY:s,scaleZ:n,rotationX:y,rotationY:B,rotationZ:F,translationX:u,translationY:q,translationZ:O}}var a,p,m,v,V,T,w,C,A,W,b,_,X,S,d,R,Y,H,k,f,g,z,o,l,c,x,M,U,Q,I,nt,K,lt,$,ct,E,D,Z;class ft{constructor(e,s){h(this,U);h(this,I);h(this,K);h(this,$);h(this,a,null);h(this,p,null);h(this,m,[]);h(this,v,"auto");h(this,V,"top");h(this,T,!1);h(this,w,!0);h(this,C,!0);h(this,A,!0);h(this,W,!0);h(this,b,0);h(this,_,0);h(this,X,0);h(this,S,0);h(this,d,0);h(this,R,0);h(this,Y,0);h(this,H,0);h(this,k,0);h(this,f,{x:0,y:0,z:0});h(this,g,{x:0,y:0,z:0});h(this,z,{x:1,y:1,z:1});h(this,o,new J.Ladder({x:0,y:0,z:0}));h(this,l,new J.Ladder({x:0,y:0,z:0}));h(this,c,new J.Ladder({x:0,y:0,z:0}));h(this,x,{x:0,y:0,z:0});h(this,M,new Map);h(this,E,()=>{et.isBrowser&&L(this,K,lt).call(this)});h(this,D,()=>{L(this,$,ct).call(this),L(this,U,Q).call(this)});h(this,Z,()=>{const e=N.scrollEntries.getAll(this.element);t(this,M).forEach((s,n)=>{e.includes(n)||(this.deleteScrollStep(s),t(this,M).delete(n))}),e.forEach(s=>{if(!t(this,M).has(s)){const n=()=>s;t(this,M).set(s,n),this.setScrollStep(n)}})});et.isBrowser&&(r(this,a,st.getElement(e)||document.body),r(this,p,st.getElement(s==null?void 0:s.containerElement)||document.body),r(this,v,(s==null?void 0:s.scrollAxis)||"auto"),r(this,V,(s==null?void 0:s.frontSide)||"top"),r(this,T,(s==null?void 0:s.cartesian)||!1),r(this,w,(s==null?void 0:s.sizeStep)!==void 0?s.sizeStep:!0),r(this,C,(s==null?void 0:s.positionStep)!==void 0?s.positionStep:!0),r(this,A,(s==null?void 0:s.transformStep)!==void 0?s.transformStep:!0),r(this,W,(s==null?void 0:s.scrollStep)!==void 0?s.scrollStep:!0),t(this,c).setStep("_size","+",{x:1,y:1,z:1}),t(this,l).setStep("_position","+",{x:0,y:0,z:0}),t(this,c).setStep("_scale","*",{x:1,y:1,z:1}),t(this,l).setStep("_translation","+",{x:0,y:0,z:0}),t(this,o).setStep("_rotation","+",{x:0,y:0,z:0}),t(this,W)&&(N.scrollEntries.notifier.subscribe(t(this,Z)),t(this,Z).call(this)),tt.ticker.subscribe(t(this,D),{order:j.TICK_ORDER.LAYOUT_BOX,culling:s!=null&&s.culling?this.element:void 0})
|
|
1
|
+
"use strict";var G=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var t=(i,e,s)=>(G(i,e,"read from private field"),s?s.call(i):e.get(i)),h=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},r=(i,e,s,n)=>(G(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s);var L=(i,e,s)=>(G(i,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const dt=require("../css-unit-parser/index.cjs"),J=require("../ladder/index.cjs"),j=require("../order/index.cjs"),N=require("../scroll-entries/index.cjs"),tt=require("../ticker/index.cjs"),et=require("../browser-CpzFX2xg.cjs"),st=require("../dom-JBOkFLTh.cjs"),P=require("../layout-8ryRAMGJ.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const it=require("../element-resizer/index.cjs"),ht=require("../window-resizer/index.cjs");function rt(i){const e=Math.sqrt(i.m11*i.m11+i.m12*i.m12+i.m13*i.m13),s=Math.sqrt(i.m21*i.m21+i.m22*i.m22+i.m23*i.m23),n=Math.sqrt(i.m31*i.m31+i.m32*i.m32+i.m33*i.m33),y=Math.atan2(i.m32,i.m33),B=Math.atan2(-i.m31,Math.sqrt(i.m32*i.m32+i.m33*i.m33)),F=Math.atan2(i.m21,i.m11),u=i.m41,q=i.m42*-1,O=i.m43;return{scaleX:e,scaleY:s,scaleZ:n,rotationX:y,rotationY:B,rotationZ:F,translationX:u,translationY:q,translationZ:O}}var a,p,m,v,V,T,w,C,A,W,b,_,X,S,d,R,Y,H,k,f,g,z,o,l,c,x,M,U,Q,I,nt,K,lt,$,ct,E,D,Z;class ft{constructor(e,s){h(this,U);h(this,I);h(this,K);h(this,$);h(this,a,null);h(this,p,null);h(this,m,[]);h(this,v,"auto");h(this,V,"top");h(this,T,!1);h(this,w,!0);h(this,C,!0);h(this,A,!0);h(this,W,!0);h(this,b,0);h(this,_,0);h(this,X,0);h(this,S,0);h(this,d,0);h(this,R,0);h(this,Y,0);h(this,H,0);h(this,k,0);h(this,f,{x:0,y:0,z:0});h(this,g,{x:0,y:0,z:0});h(this,z,{x:1,y:1,z:1});h(this,o,new J.Ladder({x:0,y:0,z:0}));h(this,l,new J.Ladder({x:0,y:0,z:0}));h(this,c,new J.Ladder({x:0,y:0,z:0}));h(this,x,{x:0,y:0,z:0});h(this,M,new Map);h(this,E,()=>{et.isBrowser&&L(this,K,lt).call(this)});h(this,D,()=>{L(this,$,ct).call(this),L(this,U,Q).call(this)});h(this,Z,()=>{const e=N.scrollEntries.getAll(this.element);t(this,M).forEach((s,n)=>{e.includes(n)||(this.deleteScrollStep(s),t(this,M).delete(n))}),e.forEach(s=>{if(!t(this,M).has(s)){const n=()=>s;t(this,M).set(s,n),this.setScrollStep(n)}})});et.isBrowser&&(r(this,a,st.getElement(e)||document.body),r(this,p,st.getElement(s==null?void 0:s.containerElement)||document.body),r(this,v,(s==null?void 0:s.scrollAxis)||"auto"),r(this,V,(s==null?void 0:s.frontSide)||"top"),r(this,T,(s==null?void 0:s.cartesian)||!1),r(this,w,(s==null?void 0:s.sizeStep)!==void 0?s.sizeStep:!0),r(this,C,(s==null?void 0:s.positionStep)!==void 0?s.positionStep:!0),r(this,A,(s==null?void 0:s.transformStep)!==void 0?s.transformStep:!0),r(this,W,(s==null?void 0:s.scrollStep)!==void 0?s.scrollStep:!0),t(this,c).setStep("_size","+",{x:1,y:1,z:1}),t(this,l).setStep("_position","+",{x:0,y:0,z:0}),t(this,c).setStep("_scale","*",{x:1,y:1,z:1}),t(this,l).setStep("_translation","+",{x:0,y:0,z:0}),t(this,o).setStep("_rotation","+",{x:0,y:0,z:0}),t(this,W)&&(N.scrollEntries.notifier.subscribe(t(this,Z)),t(this,Z).call(this)),it.elementResizer.subscribe(this.element,t(this,E)),ht.windowResizer.subscribe(t(this,E),j.RESIZE_ORDER.LAYOUT_BOX),tt.ticker.subscribe(t(this,D),{order:j.TICK_ORDER.LAYOUT_BOX,culling:s!=null&&s.culling?this.element:void 0}))}get element(){return t(this,a)}get containerElement(){return t(this,p)}get position(){return t(this,l).current}get rotation(){return t(this,o).current}get scale(){return t(this,c).current}get scrollValue(){return t(this,x)}get left(){return t(this,d)}get top(){return t(this,S)}get CSSTranslation(){return t(this,f)}get CSSRotation(){return t(this,g)}get CSSScale(){return t(this,z)}get front(){return t(this,R)}get width(){return t(this,b)}get height(){return t(this,_)}get depth(){return t(this,X)}destroy(){tt.ticker.unsubscribe(t(this,D)),it.elementResizer.unsubscribe(t(this,E)),ht.windowResizer.unsubscribe(t(this,E)),N.scrollEntries.notifier.unsubscribe(t(this,Z)),t(this,M).clear(),t(this,l).close(),t(this,o).close(),t(this,c).close()}bindObject(e){e.position&&t(this,l).bind(e.position),e.rotation&&t(this,o).bind(e.rotation),e.scale&&t(this,c).bind(e.scale)}unbindObject(e){e.position&&t(this,l).unbind(e.position),e.rotation&&t(this,o).unbind(e.rotation),e.scale&&t(this,c).unbind(e.scale)}setScrollStep(e){return t(this,m).includes(e)||t(this,m).push(e),()=>this.deleteScrollStep(e)}deleteScrollStep(e){r(this,m,t(this,m).filter(s=>s!==e))}setPositionStep(...e){t(this,l).setStep(...e)}getPositionStep(...e){return t(this,l).getStepValue(...e)}setRotationStep(...e){t(this,o).setStep(...e)}getRotationStep(...e){return t(this,o).getStepValue(...e)}setScaleStep(...e){t(this,c).setStep(...e)}getScaleStep(...e){return t(this,c).getStepValue(...e)}deletePositionStep(...e){t(this,l).deleteStep(...e)}deleteRotationStep(...e){t(this,o).deleteStep(...e)}deleteScaleStep(...e){t(this,c).deleteStep(...e)}onPosition(...e){return t(this,l).subscribe(...e)}offPosition(...e){t(this,l).unsubscribe(...e)}onScale(...e){return t(this,c).subscribe(...e)}offScale(...e){t(this,c).unsubscribe(...e)}onRotation(...e){return t(this,o).subscribe(...e)}offRotation(...e){t(this,o).unsubscribe(...e)}}a=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,V=new WeakMap,T=new WeakMap,w=new WeakMap,C=new WeakMap,A=new WeakMap,W=new WeakMap,b=new WeakMap,_=new WeakMap,X=new WeakMap,S=new WeakMap,d=new WeakMap,R=new WeakMap,Y=new WeakMap,H=new WeakMap,k=new WeakMap,f=new WeakMap,g=new WeakMap,z=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,x=new WeakMap,M=new WeakMap,U=new WeakSet,Q=function(){t(this,c).calculate(),t(this,l).calculate(),t(this,o).calculate()},I=new WeakSet,nt=function(){t(this,c).setStep("_size","+",{x:t(this,w)?t(this,b):1,y:t(this,w)?t(this,_):1,z:t(this,w)?t(this,X):1});const e=t(this,C)?t(this,Y):0,s=t(this,C)?t(this,H):0,n=t(this,C)?t(this,k):0;t(this,l).setStep("_position","+",{x:e,y:s,z:n}),t(this,A)?(t(this,c).setStep("_scale","*",{x:t(this,z).x,y:t(this,z).y,z:t(this,z).z}),t(this,l).setStep("_translation","+",{x:t(this,f).x,y:t(this,f).y,z:t(this,f).z}),t(this,o).setStep("_rotation","+",{x:t(this,g).x,y:t(this,g).y,z:t(this,g).z})):(t(this,c).setStep("_scale","*",{x:1,y:1,z:1}),t(this,l).setStep("_translation","+",{x:0,y:0,z:0}),t(this,o).setStep("_rotation","+",{x:0,y:0,z:0}))},K=new WeakSet,lt=function(){const e=getComputedStyle(t(this,a));r(this,b,Math.max(t(this,a).clientWidth,1)),r(this,_,Math.max(t(this,a).clientHeight,1)),r(this,X,Math.max(dt.cssUnitParser.parse(e.getPropertyValue("--depth")||"0px"),1));const s=P.getCumulativeOffsetLeft(t(this,p)),n=P.getCumulativeOffsetTop(t(this,p)),y=t(this,p).clientWidth,B=t(this,p).clientHeight;if(r(this,d,P.getCumulativeOffsetLeft(t(this,a))-s),r(this,S,P.getCumulativeOffsetTop(t(this,a))-n),t(this,v)==="z"){const q=t(this,d)/y,O=t(this,S)/B;r(this,d,(q-Math.floor(q))*y),r(this,S,(O-Math.floor(O))*B),t(this,V)==="left"?r(this,R,P.getCumulativeOffsetLeft(t(this,a))-s-t(this,d)):r(this,R,P.getCumulativeOffsetTop(t(this,a))-n-t(this,S))}if(r(this,d,t(this,d)+t(this,a).clientLeft),r(this,S,t(this,S)+t(this,a).clientTop),t(this,T)){const q=Math.round(y/2),O=Math.round(B/2),ot=t(this,b)?Math.round(t(this,b)/2):0,at=t(this,_)?Math.round(t(this,_)/2):0,ut=t(this,d)-q+ot,St=(t(this,S)-O+at)*-1;r(this,Y,ut),r(this,H,St)}else r(this,Y,t(this,d)),r(this,H,t(this,S));r(this,k,t(this,R)*-1);const F=new WebKitCSSMatrix(e.transform),u=rt(F);t(this,f).x=u.translationX,t(this,f).y=u.translationY,t(this,f).z=u.translationZ,t(this,z).x=u.scaleX,t(this,z).y=u.scaleY,t(this,z).z=u.scaleZ,t(this,g).x=u.rotationX,t(this,g).y=u.rotationY,t(this,g).z=u.rotationZ,L(this,I,nt).call(this),L(this,U,Q).call(this)},$=new WeakSet,ct=function(){t(this,x).x=0,t(this,x).y=0,t(this,x).z=0;for(let e=0;e<t(this,m).length;e++){const s=t(this,m)[e]();let n=s.axis;t(this,v)!=="auto"&&(n=t(this,v));const y=s.value*(n==="x"?-1:t(this,T)?1:-1);t(this,x)[n]+=y,t(this,l).setStep(`_scroll_${e}`,"+",{[n]:y})}},E=new WeakMap,D=new WeakMap,Z=new WeakMap;exports.LayoutBox=ft;exports.decomposeCSSMatrix=rt;
|
package/lib/layout-box/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var t = (i, s, e) => (F(i, s, "read from private field"), e ? e.call(i) : s.get(
|
|
|
10
10
|
var L = (i, s, e) => (F(i, s, "access private method"), e);
|
|
11
11
|
import { cssUnitParser as St } from "../css-unit-parser/index.js";
|
|
12
12
|
import { Ladder as G } from "../ladder/index.js";
|
|
13
|
-
import {
|
|
13
|
+
import { RESIZE_ORDER as ft, TICK_ORDER as dt } from "../order/index.js";
|
|
14
14
|
import { scrollEntries as J } from "../scroll-entries/index.js";
|
|
15
15
|
import { ticker as tt } from "../ticker/index.js";
|
|
16
16
|
import { i as st } from "../browser-0zX67oeU.js";
|
|
@@ -113,10 +113,10 @@ class wt {
|
|
|
113
113
|
x: 0,
|
|
114
114
|
y: 0,
|
|
115
115
|
z: 0
|
|
116
|
-
}), t(this, q) && (J.notifier.subscribe(t(this, Z)), t(this, Z).call(this)), tt.subscribe(t(this, U), {
|
|
117
|
-
order:
|
|
116
|
+
}), t(this, q) && (J.notifier.subscribe(t(this, Z)), t(this, Z).call(this)), it.subscribe(this.element, t(this, w)), ht.subscribe(t(this, w), ft.LAYOUT_BOX), tt.subscribe(t(this, U), {
|
|
117
|
+
order: dt.LAYOUT_BOX,
|
|
118
118
|
culling: e != null && e.culling ? this.element : void 0
|
|
119
|
-
})
|
|
119
|
+
}));
|
|
120
120
|
}
|
|
121
121
|
get element() {
|
|
122
122
|
return t(this, c);
|