aptechka 0.40.7 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/lib/accordion/index.d.ts +0 -1
  2. package/lib/animation/Animation.d.ts +0 -1
  3. package/lib/animation/Damped.d.ts +0 -1
  4. package/lib/animation/Tweened.d.ts +0 -1
  5. package/lib/attribute/index.d.ts +0 -1
  6. package/lib/canvas/index.d.ts +0 -1
  7. package/lib/class-linked-status/index.d.ts +0 -1
  8. package/lib/controls/AutoplayControls.d.ts +0 -1
  9. package/lib/controls/Controls.d.ts +0 -1
  10. package/lib/controls/DragControls.d.ts +0 -1
  11. package/lib/controls/KeyboardControls.d.ts +0 -1
  12. package/lib/controls/WheelControls.d.ts +0 -1
  13. package/lib/css-property/index.d.ts +0 -1
  14. package/lib/device/Viewport.d.ts +0 -1
  15. package/lib/element-resizer/react/index.d.ts +0 -1
  16. package/lib/element-resizer/vanilla/index.d.ts +0 -1
  17. package/lib/en3/En3Raycaster.d.ts +0 -1
  18. package/lib/en3/En3View.d.ts +0 -1
  19. package/lib/en3/en3.d.ts +0 -1
  20. package/lib/en3/index.cjs +2 -2
  21. package/lib/en3/index.js +91 -92
  22. package/lib/en3/utils/coverTexture.d.ts +0 -1
  23. package/lib/en3/utils/dispose.d.ts +0 -1
  24. package/lib/en3/utils/getCurrentViewport.d.ts +0 -1
  25. package/lib/en3/utils/traverseMaterials.d.ts +0 -1
  26. package/lib/en3/utils/traverseMeshes.d.ts +0 -1
  27. package/lib/intersector/react/index.d.ts +0 -1
  28. package/lib/intersector/vanilla/index.d.ts +0 -1
  29. package/lib/ladder/index.d.ts +0 -1
  30. package/lib/layout-box/index.d.ts +0 -1
  31. package/lib/media/index.d.ts +0 -1
  32. package/lib/media-elements/iframe/index.d.ts +0 -1
  33. package/lib/media-elements/image/index.d.ts +0 -1
  34. package/lib/media-elements/sequence/index.d.ts +0 -1
  35. package/lib/media-elements/source/index.d.ts +0 -1
  36. package/lib/media-elements/video/index.d.ts +0 -1
  37. package/lib/media-elements/youtube/index.d.ts +0 -1
  38. package/lib/morph/Link.d.ts +0 -1
  39. package/lib/morph/Morph.d.ts +16 -3
  40. package/lib/morph/index.cjs +1 -1
  41. package/lib/morph/index.js +176 -152
  42. package/lib/need_redo_tweaker/TweakerBooleanManagerElement.d.ts +0 -1
  43. package/lib/need_redo_tweaker/TweakerColorManagerElement.d.ts +0 -1
  44. package/lib/need_redo_tweaker/TweakerElement.d.ts +0 -1
  45. package/lib/need_redo_tweaker/TweakerFieldElement.d.ts +0 -1
  46. package/lib/need_redo_tweaker/TweakerFolderElement.d.ts +0 -1
  47. package/lib/need_redo_tweaker/TweakerLinkManagerElement.d.ts +0 -1
  48. package/lib/need_redo_tweaker/TweakerNumberManagerElement.d.ts +0 -1
  49. package/lib/need_redo_tweaker/TweakerSelectManagerElement.d.ts +0 -1
  50. package/lib/need_redo_tweaker/TweakerStoreManagerElement.d.ts +0 -1
  51. package/lib/need_redo_tweaker/TweakerStringManagerElement.d.ts +0 -1
  52. package/lib/need_redo_tweaker/element-constructor/ElementConstructor.d.ts +0 -1
  53. package/lib/need_redo_tweaker/element-constructor/createStylesheet.d.ts +0 -1
  54. package/lib/need_redo_tweaker/element-constructor/createTheme.d.ts +0 -1
  55. package/lib/need_redo_tweaker/element-constructor/tags.d.ts +0 -1
  56. package/lib/need_redo_tweaker/select/SelectHeadElement.d.ts +0 -1
  57. package/lib/need_redo_tweaker/select/SelectOptionElement.d.ts +0 -1
  58. package/lib/need_redo_tweaker/select/SelectUserElement.d.ts +0 -1
  59. package/lib/need_redo_tweaker/tweakerManagerConstructors.d.ts +0 -1
  60. package/lib/pointer/Pointer.d.ts +0 -1
  61. package/lib/pointer/PointerElement.d.ts +0 -1
  62. package/lib/popover/PopoverButtonElement.d.ts +0 -1
  63. package/lib/popover/PopoverElement.d.ts +0 -1
  64. package/lib/router/Link.d.ts +0 -1
  65. package/lib/router/Router.d.ts +0 -1
  66. package/lib/scroll/react/Scroll.d.ts +0 -1
  67. package/lib/scroll/react/ScrollBulletButtons.d.ts +0 -1
  68. package/lib/scroll/react/ScrollSegment.d.ts +0 -1
  69. package/lib/scroll/react/ScrollSetButton.d.ts +0 -1
  70. package/lib/scroll/react/ScrollStepButton.d.ts +0 -1
  71. package/lib/scroll/react/Scrollbar.d.ts +0 -1
  72. package/lib/scroll/vanilla/ScrollBulletButtonsElement.d.ts +0 -1
  73. package/lib/scroll/vanilla/ScrollButtonElement.d.ts +0 -1
  74. package/lib/scroll/vanilla/ScrollElement.d.ts +0 -1
  75. package/lib/scroll/vanilla/ScrollSection.d.ts +0 -1
  76. package/lib/scroll/vanilla/ScrollSegmentElement.d.ts +0 -1
  77. package/lib/scroll/vanilla/ScrollSetButtonElement.d.ts +0 -1
  78. package/lib/scroll/vanilla/ScrollStepButtonElement.d.ts +0 -1
  79. package/lib/scroll/vanilla/ScrollUserElement.d.ts +0 -1
  80. package/lib/scroll/vanilla/ScrollbarElement.d.ts +0 -1
  81. package/lib/scroll-entries/index.d.ts +0 -1
  82. package/lib/scroll-segment/index.d.ts +0 -1
  83. package/lib/slicer/SlicerElement.d.ts +0 -1
  84. package/lib/slicer/Word.d.ts +0 -1
  85. package/lib/source/SourceManager.d.ts +0 -1
  86. package/lib/source/SourceSet.d.ts +0 -1
  87. package/lib/store/react/useStore.d.ts +0 -1
  88. package/lib/store/vanilla/Composed.d.ts +0 -1
  89. package/lib/store/vanilla/Derived.d.ts +0 -1
  90. package/lib/store/vanilla/DerivedArray.d.ts +0 -1
  91. package/lib/store/vanilla/Resource.d.ts +0 -1
  92. package/lib/store/vanilla/StoreRegistry.d.ts +0 -1
  93. package/lib/studio/Outliner/File/index.d.ts +0 -1
  94. package/lib/studio/Outliner/Folder/index.d.ts +0 -1
  95. package/lib/studio/Outliner/index.d.ts +0 -1
  96. package/lib/studio/Studio/index.d.ts +0 -1
  97. package/lib/studio/Tweaker/index.d.ts +0 -1
  98. package/lib/studio/store.d.ts +0 -1
  99. package/lib/ticker/react/index.d.ts +0 -1
  100. package/lib/ticker/vanilla/index.d.ts +0 -1
  101. package/lib/utils/collisions.d.ts +0 -1
  102. package/lib/utils/coordinates.d.ts +0 -1
  103. package/lib/utils/events.d.ts +1 -1
  104. package/lib/utils/math.d.ts +0 -1
  105. package/lib/utils/ts-react-utility.d.ts +0 -1
  106. package/lib/window-resizer/react/index.d.ts +0 -1
  107. package/lib/window-resizer/vanilla/index.d.ts +0 -1
  108. package/package.json +4 -3
@@ -1,6 +1,5 @@
1
1
  import { Attribute } from '../attribute';
2
2
  import { Axes2D } from '../utils';
3
-
4
3
  export interface AccordionToggleOptions {
5
4
  skipTransition?: boolean;
6
5
  exclude?: HTMLElement;
@@ -1,6 +1,5 @@
1
1
  import { Store, StoreOptions } from '../store/vanilla';
2
2
  import { TickerAddOptions, TickerCallbackEntry } from '../ticker/vanilla';
3
-
4
3
  export interface AnimationOptions extends TickerAddOptions {
5
4
  min?: number;
6
5
  max?: number;
@@ -1,6 +1,5 @@
1
1
  import { TickerCallbackEntry } from '../ticker/vanilla';
2
2
  import { Animation, AnimationConstructorOptions, AnimationOptions } from './Animation';
3
-
4
3
  export interface DampedOptions extends AnimationOptions {
5
4
  stiffness?: number;
6
5
  damping?: number;
@@ -1,7 +1,6 @@
1
1
  import { TickerCallbackEntry } from '../ticker/vanilla';
2
2
  import { EasingFunction } from '../utils';
3
3
  import { Animation, AnimationConstructorOptions, AnimationOptions } from './Animation';
4
-
5
4
  import * as easings from '@packages/utils/easings';
6
5
  export type TweenEasingName = keyof typeof easings;
7
6
  export interface TweenedOptions extends AnimationOptions {
@@ -1,6 +1,5 @@
1
1
  import { Store, StoreSubscribeCallback, StoreOptions } from '../store/vanilla';
2
2
  import { ElementOrSelector } from '../utils';
3
-
4
3
  export interface AttributeOptions<T> extends StoreOptions<T> {
5
4
  sync?: boolean;
6
5
  }
@@ -1,5 +1,4 @@
1
1
  import { CSSProperty } from '../css-property';
2
-
3
2
  export interface CanvasRenderDetail {
4
3
  pixelRatio: number;
5
4
  width: number;
@@ -1,5 +1,4 @@
1
1
  import { Store } from '../store/vanilla';
2
-
3
2
  export declare class ClassLinkedStatus<T extends {
4
3
  [key in string]: boolean;
5
4
  }> extends Store<T> {
@@ -1,6 +1,5 @@
1
1
  import { TickerAddOptions } from '../ticker/vanilla';
2
2
  import { Controls } from './Controls';
3
-
4
3
  export interface AutoplayControlsOptions extends TickerAddOptions {
5
4
  speed?: number;
6
5
  interval?: boolean;
@@ -1,5 +1,4 @@
1
1
  import { Notifier } from '../notifier';
2
-
3
2
  export type ControlsCallback = (type: string, value: number) => void;
4
3
  export declare abstract class Controls {
5
4
  #private;
@@ -1,6 +1,5 @@
1
1
  import { Axes2D } from '../utils';
2
2
  import { Controls } from './Controls';
3
-
4
3
  export interface DragControlsOptions {
5
4
  element?: HTMLElement;
6
5
  axis?: Axes2D;
@@ -1,5 +1,4 @@
1
1
  import { Controls } from './Controls';
2
-
3
2
  export type KeyboardControlsDimension = 'height' | 'width';
4
3
  export interface KeyboardControlsOptions {
5
4
  element?: HTMLElement;
@@ -1,6 +1,5 @@
1
1
  import { Axes2D } from '../utils';
2
2
  import { Controls } from './Controls';
3
-
4
3
  export type WheelControlsAxis = Axes2D | 'max';
5
4
  export interface WheelControlsOptions {
6
5
  axis?: WheelControlsAxis;
@@ -1,6 +1,5 @@
1
1
  import { Store, StoreSubscribeCallback, StoreOptions } from '../store/vanilla';
2
2
  import { ElementOrSelector } from '../utils';
3
-
4
3
  export interface CSSPropertyOptions<StoreType extends number | boolean | string> extends StoreOptions<StoreType> {
5
4
  rawValueCheck?: boolean;
6
5
  }
@@ -1,5 +1,4 @@
1
1
  import { Store } from '../store/vanilla';
2
-
3
2
  export declare enum ViewportBreakpoints {
4
3
  'mobile' = "600px",
5
4
  'tablet' = "1024px",
@@ -1,3 +1,2 @@
1
1
  import { ElementResizer } from '../vanilla';
2
-
3
2
  export declare function useElementResizer([callback, order]: Parameters<ElementResizer['subscribe']>): void;
@@ -1,5 +1,4 @@
1
1
  import { ElementOrSelector } from '../../utils';
2
-
3
2
  export type ElementResizerCallback = (entry: ResizeObserverEntry) => void;
4
3
  export declare class ElementResizer {
5
4
  #private;
@@ -1,5 +1,4 @@
1
1
  import { Intersection, Object3D } from 'three';
2
-
3
2
  export type En3RaycasterEventType = 'pointerDown' | 'pointerUp' | 'pointerMove' | 'pointerLeave' | 'pointerEnter' | 'pointerMove';
4
3
  export type En3RaycasterEvent = {
5
4
  type: En3RaycasterEventType;
@@ -1,7 +1,6 @@
1
1
  import { LayoutBox, LayoutBoxOptions } from '../layout-box';
2
2
  import { ElementOrSelector } from '../utils';
3
3
  import { Object3D, OrthographicCamera, PerspectiveCamera, Scene } from 'three';
4
-
5
4
  export interface En3ViewOptions {
6
5
  cameraType?: 'perspective' | 'orthographic';
7
6
  cameraDistance?: number;
package/lib/en3/en3.d.ts CHANGED
@@ -3,7 +3,6 @@ import { WebGLRenderer, WebGLRendererParameters } from 'three';
3
3
  import { En3View, En3ViewOptions } from './En3View';
4
4
  import { En3Raycaster } from './En3Raycaster';
5
5
  import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
6
-
7
6
  export interface En3Options {
8
7
  webGLRendererParameters?: WebGLRendererParameters;
9
8
  maxPixelRatio?: number;
package/lib/en3/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var ue=Object.defineProperty,me=Object.defineProperties;var fe=Object.getOwnPropertyDescriptors;var J=Object.getOwnPropertySymbols;var ge=Object.prototype.hasOwnProperty,xe=Object.prototype.propertyIsEnumerable;var ee=s=>{throw TypeError(s)};var Q=(s,e,i)=>e in s?ue(s,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[e]=i,k=(s,e)=>{for(var i in e||(e={}))ge.call(e,i)&&Q(s,i,e[i]);if(J)for(var i of J(e))xe.call(e,i)&&Q(s,i,e[i]);return s},te=(s,e)=>me(s,fe(e));var ie=(s,e,i)=>e.has(s)||ee("Cannot "+i);var t=(s,e,i)=>(ie(s,e,"read from private field"),i?i.call(s):e.get(s)),r=(s,e,i)=>e.has(s)?ee("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,i),a=(s,e,i,n)=>(ie(s,e,"write to private field"),n?n.call(s,i):e.set(s,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("../order/index.cjs"),re=require("../window-resizer/vanilla/index.cjs"),ae=require("../ticker/vanilla/index.cjs"),he=require("../dom-JBOkFLTh.cjs"),u=require("three"),ne=require("../layout-box/index.cjs");function ce(s){const e=i=>{i.dispose();for(const n of Object.keys(i)){const h=i[n];h&&typeof h=="object"&&"minFilter"in h&&h.dispose()}};s.traverse(i=>{if(i instanceof u.Mesh){if(i.geometry.dispose(),!Array.isArray(i.material)&&i.material.isMaterial)e(i.material);else if(Array.isArray(i.material))for(const n of i.material)e(n)}})}var P,o,C,v,w,O,D,R;class X{constructor(e,i){r(this,P);r(this,o);r(this,C);r(this,v);r(this,w);r(this,O);r(this,D);r(this,R);a(this,P,e),a(this,o,(i==null?void 0:i.cameraType)==="orthographic"?new u.OrthographicCamera:new u.PerspectiveCamera),a(this,C,new u.Scene),a(this,v,[]),a(this,w,(i==null?void 0:i.cameraDistance)||1e3),t(this,o).near=(i==null?void 0:i.cameraNear)||1,t(this,o).far=(i==null?void 0:i.cameraFar)||11e3,a(this,O,(i==null?void 0:i.cameraFov)||"auto"),t(this,o).position.z=t(this,w),t(this,o).name=`Cameras.${t(this,P)}`,a(this,D,he.getElement(i==null?void 0:i.sizeElement)||document.documentElement),this.beforeRenderCallback=i==null?void 0:i.beforeRender,a(this,R,new ne.LayoutBox(t(this,D))),t(this,R).onResize(()=>{this.resize()})}get name(){return t(this,P)}get camera(){return t(this,o)}get scene(){return t(this,C)}get box(){return t(this,R)}get cameraDistance(){return t(this,w)}set cameraDistance(e){a(this,w,e),this.resize()}get sizeElement(){return t(this,D)}get isClipped(){return t(this,D)!==d.containerElement}resize(){const{width:e,height:i}=t(this,R);t(this,o).userData.controlled||(t(this,o).position.z=t(this,w)),t(this,o)instanceof u.PerspectiveCamera?(t(this,o).aspect=e/i,t(this,o).fov=t(this,O)==="auto"?2*Math.atan(i/2/t(this,w))*(180/Math.PI):t(this,o).userData.controlled?t(this,o).fov:t(this,O)):t(this,o)instanceof u.OrthographicCamera&&(t(this,o).left=e/-2,t(this,o).right=e/2,t(this,o).top=i/2,t(this,o).bottom=i/-2),t(this,o).updateProjectionMatrix()}destroy(){t(this,v).forEach(e=>{e.userData.box.destroy()}),t(this,C).clear(),ce(t(this,C)),d.destroyView(this.name),t(this,R).destroy()}attachToHTMLElement(e,i,n){const h=new ne.LayoutBox(e,te(k({},n),{containerElement:t(this,D),cartesian:!0,scrollStep:!this.isClipped}));return h.bindObject(i),i.userData.box=h,t(this,v).push(i),i}detachFromHTMLElement(e){a(this,v,t(this,v).filter(i=>i===e?(e.userData.box.destroy(),!1):!0))}add(...e){const i=e[0],n=e[1],h=e[2];return n&&this.attachToHTMLElement(n,i,h),this.scene.add(i),i}remove(e,i){this.scene.remove(e),i&&this.detachFromHTMLElement(e)}}P=new WeakMap,o=new WeakMap,C=new WeakMap,v=new WeakMap,w=new WeakMap,O=new WeakMap,D=new WeakMap,R=new WeakMap;var A,_,F,z,I;class ye{constructor(e){r(this,A);r(this,_);r(this,F);r(this,z);r(this,I);a(this,A,e.targetName||void 0),a(this,_,e.eventDispatcher||e.object3D),a(this,F,e.propagation||!1),a(this,z,e.object3D),a(this,I,t(this,A)?()=>t(this,z).getObjectByName(t(this,A))||t(this,z):()=>t(this,z))}get object3D(){return t(this,z)}get eventDispatcher(){return t(this,_)}get propagation(){return t(this,F)}get target(){return t(this,I).call(this)}dispatch(e,i){this.eventDispatcher.dispatchEvent(k({originalEvent:i,type:e},this.intersection))}}A=new WeakMap,_=new WeakMap,F=new WeakMap,z=new WeakMap,I=new WeakMap;var E,m,H,N,q,B,W;class Ee{constructor(){r(this,E,[]);r(this,m,[]);r(this,H,new u.Vector2);r(this,N,new u.Raycaster);r(this,q,e=>{for(let i=0;i<t(this,m).length;i++)t(this,m)[i].dispatch("pointerDown",e)});r(this,B,e=>{for(let i=0;i<t(this,m).length;i++)t(this,m)[i].dispatch("pointerUp",e)});r(this,W,e=>{if(!t(this,E).length)return;t(this,H).x=e.clientX/d.width*2-1,t(this,H).y=-(e.clientY/d.height)*2+1,d.camera&&t(this,N).setFromCamera(t(this,H),d.camera);const i=[];for(const c of t(this,E)){const f=t(this,N).intersectObject(c.target);f.length&&(c.intersection=f[0],i.push(c))}let n=!1;const h=t(this,m).filter(c=>!i.find(f=>f.object3D.uuid===c.object3D.uuid)),y=i.sort((c,f)=>f.object3D.position.z-c.object3D.position.z).filter((c,f)=>n?(h.push(c),!1):(n=!c.propagation,!0)),p=y.filter(c=>!t(this,m).find(f=>f.object3D.uuid===c.object3D.uuid));for(let c=0;c<h.length;c++)h[c].dispatch("pointerLeave",e);for(let c=0;c<p.length;c++)p[c].dispatch("pointerEnter",e);a(this,m,y);for(let c=0;c<t(this,m).length;c++)t(this,m)[c].dispatch("pointerMove",e)});d.containerElement.addEventListener("pointerdown",t(this,q)),d.containerElement.addEventListener("pointerup",t(this,B)),d.containerElement.addEventListener("pointermove",t(this,W))}destroy(){d.containerElement.removeEventListener("pointerdown",t(this,q)),d.containerElement.removeEventListener("pointerup",t(this,B)),d.containerElement.removeEventListener("pointermove",t(this,W)),a(this,E,[]),a(this,m,[])}add(e,i){if(t(this,E).find(h=>h.object3D.uuid===e.uuid))return;const n=new ye(k({object3D:e},i));t(this,E).push(n)}remove(e){a(this,E,t(this,E).filter(i=>i.object3D.uuid!==e.uuid)),a(this,m,t(this,m).filter(i=>i.object3D.uuid!==e.uuid))}}E=new WeakMap,m=new WeakMap,H=new WeakMap,N=new WeakMap,q=new WeakMap,B=new WeakMap,W=new WeakMap;var U,b,l,j,g,M,T,L,Y,S,Z,x,$,G;class be{constructor(){r(this,U,`https://unpkg.com/three@0.${u.REVISION}.x`);r(this,b,null);r(this,l,null);r(this,j,null);r(this,g,new Map);r(this,M,0);r(this,T,0);r(this,L,0);r(this,Y,2);r(this,S,!1);r(this,Z,!1);r(this,x,null);r(this,$,()=>{a(this,M,t(this,b).clientWidth),a(this,T,t(this,b).clientHeight),a(this,L,Math.min(t(this,Y),devicePixelRatio||1)),t(this,l).setPixelRatio(t(this,L)),t(this,l).setSize(t(this,M),t(this,T)),t(this,x)&&(t(this,x).setPixelRatio(t(this,L)),t(this,x).setSize(t(this,M),t(this,T)))});r(this,G,()=>{t(this,l).setRenderTarget(null),t(this,g).forEach(e=>{this.render(e)})})}get CDNVersion(){return t(this,U)}get containerElement(){return t(this,b)}get webglRenderer(){return t(this,l)}get raycaster(){return t(this,j)}get views(){return t(this,g)}get view(){return this.getView("default")}get camera(){return this.getView("default").camera}get scene(){return this.getView("default").scene}get width(){return t(this,M)}get height(){return t(this,T)}get pixelRatio(){return t(this,L)}get composer(){return t(this,x)}setup(e){if(t(this,S)){console.warn("[en3.setup]: You are trying to setup en3 again.");return}a(this,b,he.getElement(e==null?void 0:e.containerElement)||document.body),a(this,Y,(e==null?void 0:e.maxPixelRatio)||2),a(this,l,new u.WebGLRenderer(e==null?void 0:e.webGLRendererParameters)),t(this,l).domElement.style.cssText=`
1
+ "use strict";var de=Object.defineProperty,ue=Object.defineProperties;var me=Object.getOwnPropertyDescriptors;var Z=Object.getOwnPropertySymbols;var fe=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var Q=s=>{throw TypeError(s)};var J=(s,e,i)=>e in s?de(s,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[e]=i,k=(s,e)=>{for(var i in e||(e={}))fe.call(e,i)&&J(s,i,e[i]);if(Z)for(var i of Z(e))ge.call(e,i)&&J(s,i,e[i]);return s},ee=(s,e)=>ue(s,me(e));var te=(s,e,i)=>e.has(s)||Q("Cannot "+i);var t=(s,e,i)=>(te(s,e,"read from private field"),i?i.call(s):e.get(s)),r=(s,e,i)=>e.has(s)?Q("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,i),n=(s,e,i,a)=>(te(s,e,"write to private field"),a?a.call(s,i):e.set(s,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ie=require("../order/index.cjs"),se=require("../window-resizer/vanilla/index.cjs"),re=require("../ticker/vanilla/index.cjs"),ae=require("../dom-JBOkFLTh.cjs"),u=require("three"),ne=require("../layout-box/index.cjs");function he(s){const e=i=>{i.dispose();for(const a of Object.keys(i)){const h=i[a];h&&typeof h=="object"&&"minFilter"in h&&h.dispose()}};s.traverse(i=>{if(i instanceof u.Mesh){if(i.geometry.dispose(),!Array.isArray(i.material)&&i.material.isMaterial)e(i.material);else if(Array.isArray(i.material))for(const a of i.material)e(a)}})}var P,o,C,v,w,O,D,R;class X{constructor(e,i){r(this,P);r(this,o);r(this,C);r(this,v);r(this,w);r(this,O);r(this,D);r(this,R);n(this,P,e),n(this,o,(i==null?void 0:i.cameraType)==="orthographic"?new u.OrthographicCamera:new u.PerspectiveCamera),n(this,C,new u.Scene),n(this,v,[]),n(this,w,(i==null?void 0:i.cameraDistance)||1e3),t(this,o).near=(i==null?void 0:i.cameraNear)||1,t(this,o).far=(i==null?void 0:i.cameraFar)||11e3,n(this,O,(i==null?void 0:i.cameraFov)||"auto"),t(this,o).position.z=t(this,w),t(this,o).name=`Cameras.${t(this,P)}`,n(this,D,ae.getElement(i==null?void 0:i.sizeElement)||document.documentElement),this.beforeRenderCallback=i==null?void 0:i.beforeRender,n(this,R,new ne.LayoutBox(t(this,D))),t(this,R).onResize(()=>{this.resize()})}get name(){return t(this,P)}get camera(){return t(this,o)}get scene(){return t(this,C)}get box(){return t(this,R)}get cameraDistance(){return t(this,w)}set cameraDistance(e){n(this,w,e),this.resize()}get sizeElement(){return t(this,D)}get isClipped(){return t(this,D)!==d.containerElement}resize(){const{width:e,height:i}=t(this,R);t(this,o).userData.controlled||(t(this,o).position.z=t(this,w)),t(this,o)instanceof u.PerspectiveCamera?(t(this,o).aspect=e/i,t(this,o).fov=t(this,O)==="auto"?2*Math.atan(i/2/t(this,w))*(180/Math.PI):t(this,o).userData.controlled?t(this,o).fov:t(this,O)):t(this,o)instanceof u.OrthographicCamera&&(t(this,o).left=e/-2,t(this,o).right=e/2,t(this,o).top=i/2,t(this,o).bottom=i/-2),t(this,o).updateProjectionMatrix()}destroy(){t(this,v).forEach(e=>{e.userData.box.destroy()}),t(this,C).clear(),he(t(this,C)),d.destroyView(this.name),t(this,R).destroy()}attachToHTMLElement(e,i,a){const h=new ne.LayoutBox(e,ee(k({},a),{containerElement:t(this,D),cartesian:!0,scrollStep:!this.isClipped}));return h.bindObject(i),i.userData.box=h,t(this,v).push(i),i}detachFromHTMLElement(e){n(this,v,t(this,v).filter(i=>i===e?(e.userData.box.destroy(),!1):!0))}add(...e){const i=e[0],a=e[1],h=e[2];return a&&this.attachToHTMLElement(a,i,h),this.scene.add(i),i}remove(e,i){this.scene.remove(e),i&&this.detachFromHTMLElement(e)}}P=new WeakMap,o=new WeakMap,C=new WeakMap,v=new WeakMap,w=new WeakMap,O=new WeakMap,D=new WeakMap,R=new WeakMap;var A,_,F,z,I;class xe{constructor(e){r(this,A);r(this,_);r(this,F);r(this,z);r(this,I);n(this,A,e.targetName||void 0),n(this,_,e.eventDispatcher||e.object3D),n(this,F,e.propagation||!1),n(this,z,e.object3D),n(this,I,t(this,A)?()=>t(this,z).getObjectByName(t(this,A))||t(this,z):()=>t(this,z))}get object3D(){return t(this,z)}get eventDispatcher(){return t(this,_)}get propagation(){return t(this,F)}get target(){return t(this,I).call(this)}dispatch(e,i){this.eventDispatcher.dispatchEvent(k({originalEvent:i,type:e},this.intersection))}}A=new WeakMap,_=new WeakMap,F=new WeakMap,z=new WeakMap,I=new WeakMap;var E,m,H,N,q,B,W;class ye{constructor(){r(this,E,[]);r(this,m,[]);r(this,H,new u.Vector2);r(this,N,new u.Raycaster);r(this,q,e=>{for(let i=0;i<t(this,m).length;i++)t(this,m)[i].dispatch("pointerDown",e)});r(this,B,e=>{for(let i=0;i<t(this,m).length;i++)t(this,m)[i].dispatch("pointerUp",e)});r(this,W,e=>{if(!t(this,E).length)return;t(this,H).x=e.clientX/d.width*2-1,t(this,H).y=-(e.clientY/d.height)*2+1,d.camera&&t(this,N).setFromCamera(t(this,H),d.camera);const i=[];for(const c of t(this,E)){const f=t(this,N).intersectObject(c.target);f.length&&(c.intersection=f[0],i.push(c))}let a=!1;const h=t(this,m).filter(c=>!i.find(f=>f.object3D.uuid===c.object3D.uuid)),y=i.sort((c,f)=>f.object3D.position.z-c.object3D.position.z).filter((c,f)=>a?(h.push(c),!1):(a=!c.propagation,!0)),p=y.filter(c=>!t(this,m).find(f=>f.object3D.uuid===c.object3D.uuid));for(let c=0;c<h.length;c++)h[c].dispatch("pointerLeave",e);for(let c=0;c<p.length;c++)p[c].dispatch("pointerEnter",e);n(this,m,y);for(let c=0;c<t(this,m).length;c++)t(this,m)[c].dispatch("pointerMove",e)});d.containerElement.addEventListener("pointerdown",t(this,q)),d.containerElement.addEventListener("pointerup",t(this,B)),d.containerElement.addEventListener("pointermove",t(this,W))}destroy(){d.containerElement.removeEventListener("pointerdown",t(this,q)),d.containerElement.removeEventListener("pointerup",t(this,B)),d.containerElement.removeEventListener("pointermove",t(this,W)),n(this,E,[]),n(this,m,[])}add(e,i){if(t(this,E).find(h=>h.object3D.uuid===e.uuid))return;const a=new xe(k({object3D:e},i));t(this,E).push(a)}remove(e){n(this,E,t(this,E).filter(i=>i.object3D.uuid!==e.uuid)),n(this,m,t(this,m).filter(i=>i.object3D.uuid!==e.uuid))}}E=new WeakMap,m=new WeakMap,H=new WeakMap,N=new WeakMap,q=new WeakMap,B=new WeakMap,W=new WeakMap;var U,b,l,j,g,M,T,L,Y,S,x,$,G;class Ee{constructor(){r(this,U,`https://unpkg.com/three@0.${u.REVISION}.x`);r(this,b,null);r(this,l,null);r(this,j,null);r(this,g,new Map);r(this,M,0);r(this,T,0);r(this,L,0);r(this,Y,2);r(this,S,!1);r(this,x,null);r(this,$,()=>{n(this,M,t(this,b).clientWidth),n(this,T,t(this,b).clientHeight),n(this,L,Math.min(t(this,Y),devicePixelRatio||1)),t(this,l).setPixelRatio(t(this,L)),t(this,l).setSize(t(this,M),t(this,T)),t(this,x)&&(t(this,x).setPixelRatio(t(this,L)),t(this,x).setSize(t(this,M),t(this,T)))});r(this,G,()=>{t(this,l).setRenderTarget(null),t(this,g).forEach(e=>{this.render(e)})})}get CDNVersion(){return t(this,U)}get containerElement(){return t(this,b)}get webglRenderer(){return t(this,l)}get raycaster(){return t(this,j)}get views(){return t(this,g)}get view(){return this.getView("default")}get camera(){return this.getView("default").camera}get scene(){return this.getView("default").scene}get width(){return t(this,M)}get height(){return t(this,T)}get pixelRatio(){return t(this,L)}get composer(){return t(this,x)}setup(e){if(t(this,S)){console.warn("[en3.setup]: You are trying to setup en3 again.");return}n(this,b,ae.getElement(e==null?void 0:e.containerElement)||document.body),n(this,Y,(e==null?void 0:e.maxPixelRatio)||2),n(this,l,new u.WebGLRenderer(e==null?void 0:e.webGLRendererParameters)),t(this,l).domElement.style.cssText=`
2
2
  position: fixed;
3
3
  left: 0;
4
4
  top: 0;
5
5
  width: 100%;
6
6
  height: 100%;
7
7
  z-index: ${(e==null?void 0:e.zIndex)||0};
8
- `,(t(this,b).shadowRoot||t(this,b)).append(t(this,l).domElement),t(this,g).set("default",new X("default",k({sizeElement:t(this,b)},e==null?void 0:e.view))),a(this,j,new Ee),e!=null&&e.composer&&(a(this,x,new e.composer(t(this,l))),this.render=()=>{t(this,x).render()}),a(this,S,!0),re.windowResizer.subscribe(t(this,$),se.RESIZE_ORDER.CANVAS),ae.ticker.subscribe(t(this,G),{order:se.TICK_ORDER.CANVAS})}destroy(){if(!t(this,S)){console.warn("[en3.setup]: You are trying to destory en3 but it has not been initialized.");return}re.windowResizer.unsubscribe(t(this,$)),ae.ticker.unsubscribe(t(this,G)),t(this,j).destroy(),t(this,g).forEach(e=>{e.destroy()}),t(this,l).dispose(),t(this,l).domElement.remove(),a(this,l,null),t(this,x).dispose(),a(this,x,null),a(this,S,!1)}createView(e,i){const n=t(this,g).size,h=new X(e,i);return t(this,g).set(e,h),n===1&&t(this,l).setScissorTest(!0),h}getView(e){return t(this,g).get(e)}destroyView(e){const i=t(this,g).get(e);i&&(t(this,g).delete(e),i.destroy(),t(this,g).size<=1&&t(this,l).setScissorTest(!1))}render(e){var i;if(t(this,g).size>1||this.view.isClipped){const n=e.box.left+e.box.CSSTranslation.x+e.box.scrollValue.x,h=d.height-e.box.height-e.box.top+e.box.CSSTranslation.y+e.box.scrollValue.y*-1;t(this,l).setScissor(n,h,e.box.width,e.box.height),t(this,l).setViewport(n,h,e.box.width,e.box.height)}(i=e.beforeRenderCallback)==null||i.call(e),t(this,l).render(e.scene,e.camera)}}U=new WeakMap,b=new WeakMap,l=new WeakMap,j=new WeakMap,g=new WeakMap,M=new WeakMap,T=new WeakMap,L=new WeakMap,Y=new WeakMap,S=new WeakMap,Z=new WeakMap,x=new WeakMap,$=new WeakMap,G=new WeakMap;const d=new be;function we(s,e,i){const n=e.x,h=e.y,V=i||s.image.width/s.image.height;let y=0,p=0,c=s.offset.x,f=s.offset.y,oe=s.rotation,le=s.center.x,de=s.center.y;n/h>V?(y=1,p=h/n*V):(p=1,y=n/h/V),s.matrix.setUvTransform(c,f,y,p,oe,le,de)}const K=new u.Vector3,pe=new u.Vector3;function ve(s,e="default"){const i=d.getView(e),{width:n,height:h}=d,V=n/h;s instanceof u.Vector3?K.copy(s):K.set(...s);const y=i.camera.getWorldPosition(pe).distanceTo(K);if(i.camera instanceof u.OrthographicCamera)return{width:n/i.camera.zoom,height:h/i.camera.zoom,factor:1,distance:y,aspect:V};{const p=i.camera.fov*Math.PI/180,c=2*Math.tan(p/2)*y,f=c*(n/h);return{width:f,height:c,factor:n/f,distance:y,aspect:V}}}function De(s,e){s.traverse(i=>{i instanceof u.Mesh&&i.material&&(Array.isArray(i.material)?i.material:[i.material]).forEach(e)})}function Re(s,e){s.traverse(i=>{i instanceof u.Mesh&&e(i)})}exports.En3View=X;exports.coverTexture=we;exports.dispose=ce;exports.en3=d;exports.getCurrentViewport=ve;exports.traverseMaterials=De;exports.traverseMeshes=Re;
8
+ `,(t(this,b).shadowRoot||t(this,b)).append(t(this,l).domElement),t(this,g).set("default",new X("default",k({sizeElement:t(this,b)},e==null?void 0:e.view))),n(this,j,new ye),e!=null&&e.composer&&(n(this,x,new e.composer(t(this,l))),this.render=()=>{t(this,x).render()}),n(this,S,!0),se.windowResizer.subscribe(t(this,$),ie.RESIZE_ORDER.CANVAS),re.ticker.subscribe(t(this,G),{order:ie.TICK_ORDER.CANVAS})}destroy(){if(!t(this,S)){console.warn("[en3.setup]: You are trying to destory en3 but it has not been initialized.");return}se.windowResizer.unsubscribe(t(this,$)),re.ticker.unsubscribe(t(this,G)),t(this,j).destroy(),t(this,g).forEach(e=>{e.destroy()}),t(this,l).dispose(),t(this,l).domElement.remove(),n(this,l,null),t(this,x).dispose(),n(this,x,null),n(this,S,!1)}createView(e,i){const a=t(this,g).size,h=new X(e,i);return t(this,g).set(e,h),a===1&&t(this,l).setScissorTest(!0),h}getView(e){return t(this,g).get(e)}destroyView(e){const i=t(this,g).get(e);i&&(t(this,g).delete(e),i.destroy(),t(this,g).size<=1&&t(this,l).setScissorTest(!1))}render(e){var i;if(t(this,g).size>1||this.view.isClipped){const a=e.box.left+e.box.CSSTranslation.x+e.box.scrollValue.x,h=d.height-e.box.height-e.box.top+e.box.CSSTranslation.y+e.box.scrollValue.y*-1;t(this,l).setScissor(a,h,e.box.width,e.box.height),t(this,l).setViewport(a,h,e.box.width,e.box.height)}(i=e.beforeRenderCallback)==null||i.call(e),t(this,l).render(e.scene,e.camera)}}U=new WeakMap,b=new WeakMap,l=new WeakMap,j=new WeakMap,g=new WeakMap,M=new WeakMap,T=new WeakMap,L=new WeakMap,Y=new WeakMap,S=new WeakMap,x=new WeakMap,$=new WeakMap,G=new WeakMap;const d=new Ee;function be(s,e,i){const a=e.x,h=e.y,V=i||s.image.width/s.image.height;let y=0,p=0,c=s.offset.x,f=s.offset.y,ce=s.rotation,oe=s.center.x,le=s.center.y;a/h>V?(y=1,p=h/a*V):(p=1,y=a/h/V),s.matrix.setUvTransform(c,f,y,p,ce,oe,le)}const K=new u.Vector3,we=new u.Vector3;function pe(s,e="default"){const i=d.getView(e),{width:a,height:h}=d,V=a/h;s instanceof u.Vector3?K.copy(s):K.set(...s);const y=i.camera.getWorldPosition(we).distanceTo(K);if(i.camera instanceof u.OrthographicCamera)return{width:a/i.camera.zoom,height:h/i.camera.zoom,factor:1,distance:y,aspect:V};{const p=i.camera.fov*Math.PI/180,c=2*Math.tan(p/2)*y,f=c*(a/h);return{width:f,height:c,factor:a/f,distance:y,aspect:V}}}function ve(s,e){s.traverse(i=>{i instanceof u.Mesh&&i.material&&(Array.isArray(i.material)?i.material:[i.material]).forEach(e)})}function De(s,e){s.traverse(i=>{i instanceof u.Mesh&&e(i)})}exports.En3View=X;exports.coverTexture=be;exports.dispose=he;exports.en3=d;exports.getCurrentViewport=pe;exports.traverseMaterials=ve;exports.traverseMeshes=De;
package/lib/en3/index.js CHANGED
@@ -1,45 +1,45 @@
1
- var me = Object.defineProperty, fe = Object.defineProperties;
2
- var ge = Object.getOwnPropertyDescriptors;
3
- var Q = Object.getOwnPropertySymbols;
4
- var Ee = Object.prototype.hasOwnProperty, be = Object.prototype.propertyIsEnumerable;
5
- var te = (s) => {
1
+ var ue = Object.defineProperty, me = Object.defineProperties;
2
+ var fe = Object.getOwnPropertyDescriptors;
3
+ var J = Object.getOwnPropertySymbols;
4
+ var ge = Object.prototype.hasOwnProperty, Ee = Object.prototype.propertyIsEnumerable;
5
+ var ee = (s) => {
6
6
  throw TypeError(s);
7
7
  };
8
- var ee = (s, e, i) => e in s ? me(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i, j = (s, e) => {
8
+ var Q = (s, e, i) => e in s ? ue(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i, j = (s, e) => {
9
9
  for (var i in e || (e = {}))
10
- Ee.call(e, i) && ee(s, i, e[i]);
11
- if (Q)
12
- for (var i of Q(e))
13
- be.call(e, i) && ee(s, i, e[i]);
10
+ ge.call(e, i) && Q(s, i, e[i]);
11
+ if (J)
12
+ for (var i of J(e))
13
+ Ee.call(e, i) && Q(s, i, e[i]);
14
14
  return s;
15
- }, ie = (s, e) => fe(s, ge(e));
16
- var se = (s, e, i) => e.has(s) || te("Cannot " + i);
17
- var t = (s, e, i) => (se(s, e, "read from private field"), i ? i.call(s) : e.get(s)), r = (s, e, i) => e.has(s) ? te("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, i), a = (s, e, i, h) => (se(s, e, "write to private field"), h ? h.call(s, i) : e.set(s, i), i);
18
- import { RESIZE_ORDER as ye, TICK_ORDER as xe } from "../order/index.js";
19
- import { windowResizer as re } from "../window-resizer/vanilla/index.js";
20
- import { ticker as ae } from "../ticker/vanilla/index.js";
21
- import { g as oe } from "../dom-0S_WDL4g.js";
22
- import { Mesh as q, OrthographicCamera as X, PerspectiveCamera as he, Scene as we, Vector2 as pe, Raycaster as De, REVISION as Re, WebGLRenderer as ve, Vector3 as J } from "three";
15
+ }, te = (s, e) => me(s, fe(e));
16
+ var ie = (s, e, i) => e.has(s) || ee("Cannot " + i);
17
+ var t = (s, e, i) => (ie(s, e, "read from private field"), i ? i.call(s) : e.get(s)), r = (s, e, i) => e.has(s) ? ee("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, i), h = (s, e, i, n) => (ie(s, e, "write to private field"), n ? n.call(s, i) : e.set(s, i), i);
18
+ import { RESIZE_ORDER as be, TICK_ORDER as ye } from "../order/index.js";
19
+ import { windowResizer as se } from "../window-resizer/vanilla/index.js";
20
+ import { ticker as re } from "../ticker/vanilla/index.js";
21
+ import { g as ce } from "../dom-0S_WDL4g.js";
22
+ import { Mesh as Z, OrthographicCamera as X, PerspectiveCamera as he, Scene as xe, Vector2 as we, Raycaster as pe, REVISION as De, WebGLRenderer as Re, Vector3 as q } from "three";
23
23
  import { LayoutBox as ne } from "../layout-box/index.js";
24
- function ze(s) {
24
+ function ve(s) {
25
25
  const e = (i) => {
26
26
  i.dispose();
27
- for (const h of Object.keys(i)) {
28
- const n = i[h];
29
- n && typeof n == "object" && "minFilter" in n && n.dispose();
27
+ for (const n of Object.keys(i)) {
28
+ const a = i[n];
29
+ a && typeof a == "object" && "minFilter" in a && a.dispose();
30
30
  }
31
31
  };
32
32
  s.traverse((i) => {
33
- if (i instanceof q) {
33
+ if (i instanceof Z) {
34
34
  if (i.geometry.dispose(), !Array.isArray(i.material) && i.material.isMaterial)
35
35
  e(i.material);
36
36
  else if (Array.isArray(i.material))
37
- for (const h of i.material) e(h);
37
+ for (const n of i.material) e(n);
38
38
  }
39
39
  });
40
40
  }
41
41
  var S, o, V, p, x, P, D, R;
42
- class ce {
42
+ class ae {
43
43
  constructor(e, i) {
44
44
  r(this, S);
45
45
  r(this, o);
@@ -49,7 +49,7 @@ class ce {
49
49
  r(this, P);
50
50
  r(this, D);
51
51
  r(this, R);
52
- a(this, S, e), a(this, o, (i == null ? void 0 : i.cameraType) === "orthographic" ? new X() : new he()), a(this, V, new we()), a(this, p, []), a(this, x, (i == null ? void 0 : i.cameraDistance) || 1e3), t(this, o).near = (i == null ? void 0 : i.cameraNear) || 1, t(this, o).far = (i == null ? void 0 : i.cameraFar) || 11e3, a(this, P, (i == null ? void 0 : i.cameraFov) || "auto"), t(this, o).position.z = t(this, x), t(this, o).name = `Cameras.${t(this, S)}`, a(this, D, oe(i == null ? void 0 : i.sizeElement) || document.documentElement), this.beforeRenderCallback = i == null ? void 0 : i.beforeRender, a(this, R, new ne(t(this, D))), t(this, R).onResize(() => {
52
+ h(this, S, e), h(this, o, (i == null ? void 0 : i.cameraType) === "orthographic" ? new X() : new he()), h(this, V, new xe()), h(this, p, []), h(this, x, (i == null ? void 0 : i.cameraDistance) || 1e3), t(this, o).near = (i == null ? void 0 : i.cameraNear) || 1, t(this, o).far = (i == null ? void 0 : i.cameraFar) || 11e3, h(this, P, (i == null ? void 0 : i.cameraFov) || "auto"), t(this, o).position.z = t(this, x), t(this, o).name = `Cameras.${t(this, S)}`, h(this, D, ce(i == null ? void 0 : i.sizeElement) || document.documentElement), this.beforeRenderCallback = i == null ? void 0 : i.beforeRender, h(this, R, new ne(t(this, D))), t(this, R).onResize(() => {
53
53
  this.resize();
54
54
  });
55
55
  }
@@ -69,7 +69,7 @@ class ce {
69
69
  return t(this, x);
70
70
  }
71
71
  set cameraDistance(e) {
72
- a(this, x, e), this.resize();
72
+ h(this, x, e), this.resize();
73
73
  }
74
74
  get sizeElement() {
75
75
  return t(this, D);
@@ -84,22 +84,22 @@ class ce {
84
84
  destroy() {
85
85
  t(this, p).forEach((e) => {
86
86
  e.userData.box.destroy();
87
- }), t(this, V).clear(), ze(t(this, V)), u.destroyView(this.name), t(this, R).destroy();
87
+ }), t(this, V).clear(), ve(t(this, V)), u.destroyView(this.name), t(this, R).destroy();
88
88
  }
89
- attachToHTMLElement(e, i, h) {
90
- const n = new ne(e, ie(j({}, h), {
89
+ attachToHTMLElement(e, i, n) {
90
+ const a = new ne(e, te(j({}, n), {
91
91
  containerElement: t(this, D),
92
92
  cartesian: !0,
93
93
  scrollStep: !this.isClipped
94
94
  }));
95
- return n.bindObject(i), i.userData.box = n, t(this, p).push(i), i;
95
+ return a.bindObject(i), i.userData.box = a, t(this, p).push(i), i;
96
96
  }
97
97
  detachFromHTMLElement(e) {
98
- a(this, p, t(this, p).filter((i) => i === e ? (e.userData.box.destroy(), !1) : !0));
98
+ h(this, p, t(this, p).filter((i) => i === e ? (e.userData.box.destroy(), !1) : !0));
99
99
  }
100
100
  add(...e) {
101
- const i = e[0], h = e[1], n = e[2];
102
- return h && this.attachToHTMLElement(h, i, n), this.scene.add(i), i;
101
+ const i = e[0], n = e[1], a = e[2];
102
+ return n && this.attachToHTMLElement(n, i, a), this.scene.add(i), i;
103
103
  }
104
104
  remove(e, i) {
105
105
  this.scene.remove(e), i && this.detachFromHTMLElement(e);
@@ -107,14 +107,14 @@ class ce {
107
107
  }
108
108
  S = new WeakMap(), o = new WeakMap(), V = new WeakMap(), p = new WeakMap(), x = new WeakMap(), P = new WeakMap(), D = new WeakMap(), R = new WeakMap();
109
109
  var A, k, F, v, I;
110
- class Ve {
110
+ class ze {
111
111
  constructor(e) {
112
112
  r(this, A);
113
113
  r(this, k);
114
114
  r(this, F);
115
115
  r(this, v);
116
116
  r(this, I);
117
- a(this, A, e.targetName || void 0), a(this, k, e.eventDispatcher || e.object3D), a(this, F, e.propagation || !1), a(this, v, e.object3D), a(this, I, t(this, A) ? () => t(this, v).getObjectByName(t(this, A)) || t(this, v) : () => t(this, v));
117
+ h(this, A, e.targetName || void 0), h(this, k, e.eventDispatcher || e.object3D), h(this, F, e.propagation || !1), h(this, v, e.object3D), h(this, I, t(this, A) ? () => t(this, v).getObjectByName(t(this, A)) || t(this, v) : () => t(this, v));
118
118
  }
119
119
  get object3D() {
120
120
  return t(this, v);
@@ -137,12 +137,12 @@ class Ve {
137
137
  }
138
138
  A = new WeakMap(), k = new WeakMap(), F = new WeakMap(), v = new WeakMap(), I = new WeakMap();
139
139
  var b, d, H, N, W, Y, _;
140
- class Le {
140
+ class Ve {
141
141
  constructor() {
142
142
  r(this, b, []);
143
143
  r(this, d, []);
144
- r(this, H, new pe());
145
- r(this, N, new De());
144
+ r(this, H, new we());
145
+ r(this, N, new pe());
146
146
  r(this, W, (e) => {
147
147
  for (let i = 0; i < t(this, d).length; i++)
148
148
  t(this, d)[i].dispatch("pointerDown", e);
@@ -160,19 +160,19 @@ class Le {
160
160
  const m = t(this, N).intersectObject(c.target);
161
161
  m.length && (c.intersection = m[0], i.push(c));
162
162
  }
163
- let h = !1;
164
- const n = t(this, d).filter(
163
+ let n = !1;
164
+ const a = t(this, d).filter(
165
165
  (c) => !i.find((m) => m.object3D.uuid === c.object3D.uuid)
166
166
  ), E = i.sort(
167
167
  (c, m) => m.object3D.position.z - c.object3D.position.z
168
- ).filter((c, m) => h ? (n.push(c), !1) : (h = !c.propagation, !0)), w = E.filter(
168
+ ).filter((c, m) => n ? (a.push(c), !1) : (n = !c.propagation, !0)), w = E.filter(
169
169
  (c) => !t(this, d).find((m) => m.object3D.uuid === c.object3D.uuid)
170
170
  );
171
- for (let c = 0; c < n.length; c++)
172
- n[c].dispatch("pointerLeave", e);
171
+ for (let c = 0; c < a.length; c++)
172
+ a[c].dispatch("pointerLeave", e);
173
173
  for (let c = 0; c < w.length; c++)
174
174
  w[c].dispatch("pointerEnter", e);
175
- a(this, d, E);
175
+ h(this, d, E);
176
176
  for (let c = 0; c < t(this, d).length; c++)
177
177
  t(this, d)[c].dispatch("pointerMove", e);
178
178
  });
@@ -194,27 +194,27 @@ class Le {
194
194
  ), u.containerElement.removeEventListener(
195
195
  "pointermove",
196
196
  t(this, _)
197
- ), a(this, b, []), a(this, d, []);
197
+ ), h(this, b, []), h(this, d, []);
198
198
  }
199
199
  add(e, i) {
200
- if (t(this, b).find((n) => n.object3D.uuid === e.uuid))
200
+ if (t(this, b).find((a) => a.object3D.uuid === e.uuid))
201
201
  return;
202
- const h = new Ve(j({
202
+ const n = new ze(j({
203
203
  object3D: e
204
204
  }, i));
205
- t(this, b).push(h);
205
+ t(this, b).push(n);
206
206
  }
207
207
  remove(e) {
208
- a(this, b, t(this, b).filter(
208
+ h(this, b, t(this, b).filter(
209
209
  (i) => i.object3D.uuid !== e.uuid
210
- )), a(this, d, t(this, d).filter((i) => i.object3D.uuid !== e.uuid));
210
+ )), h(this, d, t(this, d).filter((i) => i.object3D.uuid !== e.uuid));
211
211
  }
212
212
  }
213
213
  b = new WeakMap(), d = new WeakMap(), H = new WeakMap(), N = new WeakMap(), W = new WeakMap(), Y = new WeakMap(), _ = new WeakMap();
214
- var U, y, l, O, f, L, T, C, $, M, Z, g, B, G;
215
- class Te {
214
+ var U, y, l, O, f, L, T, C, $, M, g, B, G;
215
+ class Le {
216
216
  constructor() {
217
- r(this, U, `https://unpkg.com/three@0.${Re}.x`);
217
+ r(this, U, `https://unpkg.com/three@0.${De}.x`);
218
218
  r(this, y, null);
219
219
  r(this, l, null);
220
220
  r(this, O, null);
@@ -224,10 +224,9 @@ class Te {
224
224
  r(this, C, 0);
225
225
  r(this, $, 2);
226
226
  r(this, M, !1);
227
- r(this, Z, !1);
228
227
  r(this, g, null);
229
228
  r(this, B, () => {
230
- a(this, L, t(this, y).clientWidth), a(this, T, t(this, y).clientHeight), a(this, C, Math.min(t(this, $), devicePixelRatio || 1)), t(this, l).setPixelRatio(t(this, C)), t(this, l).setSize(t(this, L), t(this, T)), t(this, g) && (t(this, g).setPixelRatio(t(this, C)), t(this, g).setSize(t(this, L), t(this, T)));
229
+ h(this, L, t(this, y).clientWidth), h(this, T, t(this, y).clientHeight), h(this, C, Math.min(t(this, $), devicePixelRatio || 1)), t(this, l).setPixelRatio(t(this, C)), t(this, l).setSize(t(this, L), t(this, T)), t(this, g) && (t(this, g).setPixelRatio(t(this, C)), t(this, g).setSize(t(this, L), t(this, T)));
231
230
  });
232
231
  r(this, G, () => {
233
232
  t(this, l).setRenderTarget(null), t(this, f).forEach((e) => {
@@ -276,7 +275,7 @@ class Te {
276
275
  console.warn("[en3.setup]: You are trying to setup en3 again.");
277
276
  return;
278
277
  }
279
- a(this, y, oe(e == null ? void 0 : e.containerElement) || document.body), a(this, $, (e == null ? void 0 : e.maxPixelRatio) || 2), a(this, l, new ve(e == null ? void 0 : e.webGLRendererParameters)), t(this, l).domElement.style.cssText = `
278
+ h(this, y, ce(e == null ? void 0 : e.containerElement) || document.body), h(this, $, (e == null ? void 0 : e.maxPixelRatio) || 2), h(this, l, new Re(e == null ? void 0 : e.webGLRendererParameters)), t(this, l).domElement.style.cssText = `
280
279
  position: fixed;
281
280
  left: 0;
282
281
  top: 0;
@@ -285,12 +284,12 @@ class Te {
285
284
  z-index: ${(e == null ? void 0 : e.zIndex) || 0};
286
285
  `, (t(this, y).shadowRoot || t(this, y)).append(t(this, l).domElement), t(this, f).set(
287
286
  "default",
288
- new ce("default", j({
287
+ new ae("default", j({
289
288
  sizeElement: t(this, y)
290
289
  }, e == null ? void 0 : e.view))
291
- ), a(this, O, new Le()), e != null && e.composer && (a(this, g, new e.composer(t(this, l))), this.render = () => {
290
+ ), h(this, O, new Ve()), e != null && e.composer && (h(this, g, new e.composer(t(this, l))), this.render = () => {
292
291
  t(this, g).render();
293
- }), a(this, M, !0), re.subscribe(t(this, B), ye.CANVAS), ae.subscribe(t(this, G), { order: xe.CANVAS });
292
+ }), h(this, M, !0), se.subscribe(t(this, B), be.CANVAS), re.subscribe(t(this, G), { order: ye.CANVAS });
294
293
  }
295
294
  destroy() {
296
295
  if (!t(this, M)) {
@@ -299,13 +298,13 @@ class Te {
299
298
  );
300
299
  return;
301
300
  }
302
- re.unsubscribe(t(this, B)), ae.unsubscribe(t(this, G)), t(this, O).destroy(), t(this, f).forEach((e) => {
301
+ se.unsubscribe(t(this, B)), re.unsubscribe(t(this, G)), t(this, O).destroy(), t(this, f).forEach((e) => {
303
302
  e.destroy();
304
- }), t(this, l).dispose(), t(this, l).domElement.remove(), a(this, l, null), t(this, g).dispose(), a(this, g, null), a(this, M, !1);
303
+ }), t(this, l).dispose(), t(this, l).domElement.remove(), h(this, l, null), t(this, g).dispose(), h(this, g, null), h(this, M, !1);
305
304
  }
306
305
  createView(e, i) {
307
- const h = t(this, f).size, n = new ce(e, i);
308
- return t(this, f).set(e, n), h === 1 && t(this, l).setScissorTest(!0), n;
306
+ const n = t(this, f).size, a = new ae(e, i);
307
+ return t(this, f).set(e, a), n === 1 && t(this, l).setScissorTest(!0), a;
309
308
  }
310
309
  getView(e) {
311
310
  return t(this, f).get(e);
@@ -317,10 +316,10 @@ class Te {
317
316
  render(e) {
318
317
  var i;
319
318
  if (t(this, f).size > 1 || this.view.isClipped) {
320
- const h = e.box.left + e.box.CSSTranslation.x + e.box.scrollValue.x, n = u.height - e.box.height - e.box.top + e.box.CSSTranslation.y + e.box.scrollValue.y * -1;
321
- t(this, l).setScissor(h, n, e.box.width, e.box.height), t(this, l).setViewport(
322
- h,
319
+ const n = e.box.left + e.box.CSSTranslation.x + e.box.scrollValue.x, a = u.height - e.box.height - e.box.top + e.box.CSSTranslation.y + e.box.scrollValue.y * -1;
320
+ t(this, l).setScissor(n, a, e.box.width, e.box.height), t(this, l).setViewport(
323
321
  n,
322
+ a,
324
323
  e.box.width,
325
324
  e.box.height
326
325
  );
@@ -328,47 +327,47 @@ class Te {
328
327
  (i = e.beforeRenderCallback) == null || i.call(e), t(this, l).render(e.scene, e.camera);
329
328
  }
330
329
  }
331
- U = new WeakMap(), y = new WeakMap(), l = new WeakMap(), O = new WeakMap(), f = new WeakMap(), L = new WeakMap(), T = new WeakMap(), C = new WeakMap(), $ = new WeakMap(), M = new WeakMap(), Z = new WeakMap(), g = new WeakMap(), B = new WeakMap(), G = new WeakMap();
332
- const u = new Te();
333
- function ke(s, e, i) {
334
- const h = e.x, n = e.y, z = i || s.image.width / s.image.height;
335
- let E = 0, w = 0, c = s.offset.x, m = s.offset.y, le = s.rotation, de = s.center.x, ue = s.center.y;
336
- h / n > z ? (E = 1, w = n / h * z) : (w = 1, E = h / n / z), s.matrix.setUvTransform(c, m, E, w, le, de, ue);
330
+ U = new WeakMap(), y = new WeakMap(), l = new WeakMap(), O = new WeakMap(), f = new WeakMap(), L = new WeakMap(), T = new WeakMap(), C = new WeakMap(), $ = new WeakMap(), M = new WeakMap(), g = new WeakMap(), B = new WeakMap(), G = new WeakMap();
331
+ const u = new Le();
332
+ function je(s, e, i) {
333
+ const n = e.x, a = e.y, z = i || s.image.width / s.image.height;
334
+ let E = 0, w = 0, c = s.offset.x, m = s.offset.y, oe = s.rotation, le = s.center.x, de = s.center.y;
335
+ n / a > z ? (E = 1, w = a / n * z) : (w = 1, E = n / a / z), s.matrix.setUvTransform(c, m, E, w, oe, le, de);
337
336
  }
338
- const K = new J(), Ce = new J();
339
- function Fe(s, e = "default") {
340
- const i = u.getView(e), { width: h, height: n } = u, z = h / n;
341
- s instanceof J ? K.copy(s) : K.set(...s);
342
- const E = i.camera.getWorldPosition(Ce).distanceTo(K);
337
+ const K = new q(), Te = new q();
338
+ function ke(s, e = "default") {
339
+ const i = u.getView(e), { width: n, height: a } = u, z = n / a;
340
+ s instanceof q ? K.copy(s) : K.set(...s);
341
+ const E = i.camera.getWorldPosition(Te).distanceTo(K);
343
342
  if (i.camera instanceof X)
344
343
  return {
345
- width: h / i.camera.zoom,
346
- height: n / i.camera.zoom,
344
+ width: n / i.camera.zoom,
345
+ height: a / i.camera.zoom,
347
346
  factor: 1,
348
347
  distance: E,
349
348
  aspect: z
350
349
  };
351
350
  {
352
- const w = i.camera.fov * Math.PI / 180, c = 2 * Math.tan(w / 2) * E, m = c * (h / n);
353
- return { width: m, height: c, factor: h / m, distance: E, aspect: z };
351
+ const w = i.camera.fov * Math.PI / 180, c = 2 * Math.tan(w / 2) * E, m = c * (n / a);
352
+ return { width: m, height: c, factor: n / m, distance: E, aspect: z };
354
353
  }
355
354
  }
356
- function Ie(s, e) {
355
+ function Fe(s, e) {
357
356
  s.traverse((i) => {
358
- i instanceof q && i.material && (Array.isArray(i.material) ? i.material : [i.material]).forEach(e);
357
+ i instanceof Z && i.material && (Array.isArray(i.material) ? i.material : [i.material]).forEach(e);
359
358
  });
360
359
  }
361
- function Ne(s, e) {
360
+ function Ie(s, e) {
362
361
  s.traverse((i) => {
363
- i instanceof q && e(i);
362
+ i instanceof Z && e(i);
364
363
  });
365
364
  }
366
365
  export {
367
- ce as En3View,
368
- ke as coverTexture,
369
- ze as dispose,
366
+ ae as En3View,
367
+ je as coverTexture,
368
+ ve as dispose,
370
369
  u as en3,
371
- Fe as getCurrentViewport,
372
- Ie as traverseMaterials,
373
- Ne as traverseMeshes
370
+ ke as getCurrentViewport,
371
+ Fe as traverseMaterials,
372
+ Ie as traverseMeshes
374
373
  };
@@ -1,6 +1,5 @@
1
1
  import { Dot2D } from '../../utils';
2
2
  import { Texture } from 'three';
3
-
4
3
  /**
5
4
  * texture.matrixAutoUpdate must be false
6
5
  */
@@ -1,3 +1,2 @@
1
1
  import { Object3D } from 'three';
2
-
3
2
  export declare function dispose(object3d: Object3D): void;
@@ -1,5 +1,4 @@
1
1
  import { Vector3 } from 'three';
2
-
3
2
  export declare function getCurrentViewport(target: Vector3 | [number, number, number], viewName?: string): {
4
3
  width: number;
5
4
  height: number;
@@ -1,3 +1,2 @@
1
1
  import { Material, Object3D } from 'three';
2
-
3
2
  export declare function traverseMaterials(object: Object3D, callback: (material: Material) => void): void;
@@ -1,3 +1,2 @@
1
1
  import { Mesh, Object3D } from 'three';
2
-
3
2
  export declare function traverseMeshes(object: Object3D, callback: (mesh: Mesh) => void): void;
@@ -1,5 +1,4 @@
1
1
  import { Ref } from 'react';
2
2
  import { IntersectorCallback } from '../vanilla';
3
3
  import { ElementOrSelector } from '../../utils';
4
-
5
4
  export declare function useIntersection(element: Ref<HTMLElement> | ElementOrSelector, callback: IntersectorCallback): void;
@@ -1,5 +1,4 @@
1
1
  import { ElementOrSelector } from '../../utils';
2
-
3
2
  export type IntersectorCallback = (entry: IntersectionObserverEntry) => void;
4
3
  export declare class Intersector {
5
4
  #private;
@@ -1,5 +1,4 @@
1
1
  import { Store } from '../store/vanilla';
2
-
3
2
  export type LadderDefaultStepName = number | string;
4
3
  export type LadderOperation = '+' | '*' | '/' | '-';
5
4
  export type LadderStep<T> = [LadderOperation, T];
@@ -2,7 +2,6 @@ import { Ladder } from '../ladder';
2
2
  import { StoreSubscribeCallback } from '../store/vanilla';
3
3
  import { ElementOrSelector, Axes3D, Axes2D } from '../utils';
4
4
  import { Notifier } from '../notifier';
5
-
6
5
  export declare function decomposeCSSMatrix(matrix: WebKitCSSMatrix): {
7
6
  scaleX: number;
8
7
  scaleY: number;