@xiping/react-components 1.0.20 → 1.0.22
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/dist/cjs/components/confetti-button/index.d.ts +24 -0
- package/dist/cjs/components/confetti-button/index.js +1 -0
- package/dist/cjs/components/txt-editor/TxtEditor.js +1 -1
- package/dist/cjs/hooks/useStayTimeReport.d.ts +6 -0
- package/dist/cjs/hooks/useStayTimeReport.js +1 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/node_modules/.pnpm/3d-force-graph@1.78.2/node_modules/3d-force-graph/dist/3d-force-graph.js +28 -0
- package/dist/cjs/node_modules/.pnpm/@tweenjs_tween.js@25.0.0/node_modules/@tweenjs/tween.js/dist/tween.esm.js +1 -0
- package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/bowser.js +6 -0
- package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/constants.js +1 -0
- package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-browsers.js +1 -0
- package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-engines.js +1 -0
- package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-os.js +1 -0
- package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-platforms.js +1 -0
- package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser.js +1 -0
- package/dist/cjs/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/utils.js +1 -0
- package/dist/cjs/node_modules/.pnpm/canvas-confetti@1.9.3/node_modules/canvas-confetti/dist/confetti.module.js +2 -0
- package/dist/cjs/node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/max.js +1 -0
- package/dist/cjs/node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/min.js +1 -0
- package/dist/cjs/node_modules/.pnpm/react-force-graph-3d@1.28.0_react@19.1.0/node_modules/react-force-graph-3d/dist/react-force-graph-3d.js +1 -0
- package/dist/cjs/node_modules/.pnpm/three-forcegraph@1.43.0_three@0.178.0/node_modules/three-forcegraph/dist/three-forcegraph.js +3 -0
- package/dist/cjs/node_modules/.pnpm/three-render-objects@1.40.4_three@0.178.0/node_modules/three-render-objects/dist/three-render-objects.js +18 -0
- package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.core.js +44 -0
- package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.module.js +3784 -0
- package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.webgpu.js +392 -0
- package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/controls/DragControls.js +1 -0
- package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/controls/FlyControls.js +1 -0
- package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/controls/OrbitControls.js +1 -0
- package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/controls/TrackballControls.js +1 -0
- package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/postprocessing/ShaderPass.js +1 -0
- package/dist/cjs/react-components.css +1 -1
- package/dist/es/components/confetti-button/index.d.ts +24 -0
- package/dist/es/components/confetti-button/index.js +77 -0
- package/dist/es/components/txt-editor/TxtEditor.js +1 -1
- package/dist/es/hooks/useStayTimeReport.d.ts +6 -0
- package/dist/es/hooks/useStayTimeReport.js +31 -0
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +31 -26
- package/dist/es/node_modules/.pnpm/{3d-force-graph@1.77.0 → 3d-force-graph@1.78.2}/node_modules/3d-force-graph/dist/3d-force-graph.js +10 -10
- package/dist/es/node_modules/.pnpm/@tweenjs_tween.js@25.0.0/node_modules/@tweenjs/tween.js/dist/tween.esm.js +396 -0
- package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/bowser.js +55 -0
- package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/constants.js +113 -0
- package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-browsers.js +404 -0
- package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-engines.js +78 -0
- package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-os.js +159 -0
- package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser-platforms.js +238 -0
- package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/parser.js +303 -0
- package/dist/es/node_modules/.pnpm/bowser@2.11.0/node_modules/bowser/src/utils.js +280 -0
- package/dist/es/node_modules/.pnpm/canvas-confetti@1.9.3/node_modules/canvas-confetti/dist/confetti.module.js +409 -0
- package/dist/es/node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/max.js +15 -0
- package/dist/es/node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/min.js +15 -0
- package/dist/es/node_modules/.pnpm/{react-force-graph-3d@1.27.0_react@18.3.1 → react-force-graph-3d@1.28.0_react@19.1.0}/node_modules/react-force-graph-3d/dist/react-force-graph-3d.js +5 -2
- package/dist/es/node_modules/.pnpm/three-forcegraph@1.43.0_three@0.178.0/node_modules/three-forcegraph/dist/three-forcegraph.js +1037 -0
- package/dist/es/node_modules/.pnpm/{three-render-objects@1.40.2_three@0.171.0 → three-render-objects@1.40.4_three@0.178.0}/node_modules/three-render-objects/dist/three-render-objects.js +30 -30
- package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.core.js +13236 -0
- package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/build/three.module.js +3379 -3325
- package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.webgpu.js +24475 -0
- package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/controls/DragControls.js +15 -8
- package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/controls/FlyControls.js +26 -20
- package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/controls/OrbitControls.js +47 -10
- package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/controls/TrackballControls.js +16 -4
- package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/EffectComposer.js +62 -0
- package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/MaskPass.js +31 -0
- package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/postprocessing/Pass.js +89 -0
- package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/RenderPass.js +21 -0
- package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/examples/jsm/postprocessing/ShaderPass.js +46 -0
- package/dist/es/react-components.css +1 -1
- package/package.json +32 -30
- package/dist/cjs/node_modules/.pnpm/3d-force-graph@1.77.0/node_modules/3d-force-graph/dist/3d-force-graph.js +0 -28
- package/dist/cjs/node_modules/.pnpm/@tweenjs_tween.js@23.1.3/node_modules/@tweenjs/tween.js/dist/tween.esm.js +0 -1
- package/dist/cjs/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/ascending.js +0 -1
- package/dist/cjs/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/bisect.js +0 -1
- package/dist/cjs/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/bisector.js +0 -1
- package/dist/cjs/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/max.js +0 -1
- package/dist/cjs/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/min.js +0 -1
- package/dist/cjs/node_modules/.pnpm/react-force-graph-3d@1.27.0_react@18.3.1/node_modules/react-force-graph-3d/dist/react-force-graph-3d.js +0 -1
- package/dist/cjs/node_modules/.pnpm/three-forcegraph@1.42.13_three@0.171.0/node_modules/three-forcegraph/dist/three-forcegraph.js +0 -3
- package/dist/cjs/node_modules/.pnpm/three-render-objects@1.40.2_three@0.171.0/node_modules/three-render-objects/dist/three-render-objects.js +0 -18
- package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/build/three.core.js +0 -44
- package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/build/three.module.js +0 -3789
- package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/build/three.webgpu.js +0 -373
- package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/controls/DragControls.js +0 -1
- package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/controls/FlyControls.js +0 -1
- package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/controls/OrbitControls.js +0 -1
- package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/controls/TrackballControls.js +0 -1
- package/dist/cjs/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/postprocessing/ShaderPass.js +0 -1
- package/dist/es/node_modules/.pnpm/@tweenjs_tween.js@23.1.3/node_modules/@tweenjs/tween.js/dist/tween.esm.js +0 -379
- package/dist/es/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/ascending.js +0 -6
- package/dist/es/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/bisect.js +0 -3
- package/dist/es/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/bisector.js +0 -27
- package/dist/es/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/max.js +0 -17
- package/dist/es/node_modules/.pnpm/d3-array@1.2.4/node_modules/d3-array/src/min.js +0 -17
- package/dist/es/node_modules/.pnpm/three-forcegraph@1.42.13_three@0.171.0/node_modules/three-forcegraph/dist/three-forcegraph.js +0 -1020
- package/dist/es/node_modules/.pnpm/three@0.171.0/node_modules/three/build/three.core.js +0 -6662
- package/dist/es/node_modules/.pnpm/three@0.171.0/node_modules/three/build/three.webgpu.js +0 -13421
- package/dist/es/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/postprocessing/Pass.js +0 -42
- package/dist/es/node_modules/.pnpm/three@0.171.0/node_modules/three/examples/jsm/postprocessing/ShaderPass.js +0 -23
- /package/dist/cjs/node_modules/.pnpm/{@monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@18.3.1_react@18.3.1__react@18.3.1 → @monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@19.1.0_react@19.1.0__react@19.1.0}/node_modules/@monaco-editor/react/dist/index.js +0 -0
- /package/dist/cjs/node_modules/.pnpm/{react-kapsule@2.5.7_react@18.3.1 → react-kapsule@2.5.7_react@19.1.0}/node_modules/react-kapsule/dist/react-kapsule.js +0 -0
- /package/dist/cjs/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/EffectComposer.js +0 -0
- /package/dist/cjs/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/MaskPass.js +0 -0
- /package/dist/cjs/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/Pass.js +0 -0
- /package/dist/cjs/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/postprocessing/RenderPass.js +0 -0
- /package/dist/cjs/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/shaders/CopyShader.js +0 -0
- /package/dist/es/node_modules/.pnpm/{@monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@18.3.1_react@18.3.1__react@18.3.1 → @monaco-editor_react@4.7.0_monaco-editor@0.52.2_react-dom@19.1.0_react@19.1.0__react@19.1.0}/node_modules/@monaco-editor/react/dist/index.js +0 -0
- /package/dist/es/node_modules/.pnpm/{react-kapsule@2.5.7_react@18.3.1 → react-kapsule@2.5.7_react@19.1.0}/node_modules/react-kapsule/dist/react-kapsule.js +0 -0
- /package/dist/es/node_modules/.pnpm/{three@0.171.0 → three@0.178.0}/node_modules/three/examples/jsm/shaders/CopyShader.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../build/three.module.js");const t=require("../../../build/three.core.js"),h=new t.Plane,a=new t.Vector2,f=new t.Vector3,p=new t.Vector2,u=new t.Vector2,m=new t.Vector3,E=new t.Vector3,b=new t.Matrix4,y=new t.Vector3,v=new t.Vector3;let s=null,i=null;const c=[],l={NONE:-1,PAN:0,ROTATE:1};class T extends t.Controls{constructor(e,o,r=null){super(o,r),this.objects=e,this.recursive=!0,this.transformGroup=!1,this.rotateSpeed=1,this.raycaster=new t.Raycaster,this.mouseButtons={LEFT:t.MOUSE.PAN,MIDDLE:t.MOUSE.PAN,RIGHT:t.MOUSE.ROTATE},this.touches={ONE:t.TOUCH.PAN},this._onPointerMove=_.bind(this),this._onPointerDown=C.bind(this),this._onPointerCancel=O.bind(this),this._onContextMenu=w.bind(this),r!==null&&this.connect()}connect(){this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerCancel),this.domElement.addEventListener("pointerleave",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerCancel),this.domElement.removeEventListener("pointerleave",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="auto",this.domElement.style.cursor=""}dispose(){this.disconnect()}_updatePointer(e){const o=this.domElement.getBoundingClientRect();a.x=(e.clientX-o.left)/o.width*2-1,a.y=-(e.clientY-o.top)/o.height*2+1}_updateState(e){let o;if(e.pointerType==="touch")o=this.touches.ONE;else switch(e.button){case 0:o=this.mouseButtons.LEFT;break;case 1:o=this.mouseButtons.MIDDLE;break;case 2:o=this.mouseButtons.RIGHT;break;default:o=null}switch(o){case t.MOUSE.PAN:case t.TOUCH.PAN:this.state=l.PAN;break;case t.MOUSE.ROTATE:case t.TOUCH.ROTATE:this.state=l.ROTATE;break;default:this.state=l.NONE}}getRaycaster(){return console.warn("THREE.DragControls: getRaycaster() has been deprecated. Use controls.raycaster instead."),this.raycaster}setObjects(e){console.warn("THREE.DragControls: setObjects() has been deprecated. Use controls.objects instead."),this.objects=e}getObjects(){return console.warn("THREE.DragControls: getObjects() has been deprecated. Use controls.objects instead."),this.objects}activate(){console.warn("THREE.DragControls: activate() has been renamed to connect()."),this.connect()}deactivate(){console.warn("THREE.DragControls: deactivate() has been renamed to disconnect()."),this.disconnect()}set mode(e){console.warn("THREE.DragControls: The .mode property has been removed. Define the type of transformation via the .mouseButtons or .touches properties.")}get mode(){console.warn("THREE.DragControls: The .mode property has been removed. Define the type of transformation via the .mouseButtons or .touches properties.")}}function _(n){const e=this.object,o=this.domElement,r=this.raycaster;if(this.enabled!==!1){if(this._updatePointer(n),r.setFromCamera(a,e),s)this.state===l.PAN?r.ray.intersectPlane(h,m)&&s.position.copy(m.sub(f).applyMatrix4(b)):this.state===l.ROTATE&&(p.subVectors(a,u).multiplyScalar(this.rotateSpeed),s.rotateOnWorldAxis(y,p.x),s.rotateOnWorldAxis(v.normalize(),-p.y)),this.dispatchEvent({type:"drag",object:s}),u.copy(a);else if(n.pointerType==="mouse"||n.pointerType==="pen")if(c.length=0,r.setFromCamera(a,e),r.intersectObjects(this.objects,this.recursive,c),c.length>0){const d=c[0].object;h.setFromNormalAndCoplanarPoint(e.getWorldDirection(h.normal),E.setFromMatrixPosition(d.matrixWorld)),i!==d&&i!==null&&(this.dispatchEvent({type:"hoveroff",object:i}),o.style.cursor="auto",i=null),i!==d&&(this.dispatchEvent({type:"hoveron",object:d}),o.style.cursor="pointer",i=d)}else i!==null&&(this.dispatchEvent({type:"hoveroff",object:i}),o.style.cursor="auto",i=null);u.copy(a)}}function C(n){const e=this.object,o=this.domElement,r=this.raycaster;this.enabled!==!1&&(this._updatePointer(n),this._updateState(n),c.length=0,r.setFromCamera(a,e),r.intersectObjects(this.objects,this.recursive,c),c.length>0&&(this.transformGroup===!0?s=P(c[0].object):s=c[0].object,h.setFromNormalAndCoplanarPoint(e.getWorldDirection(h.normal),E.setFromMatrixPosition(s.matrixWorld)),r.ray.intersectPlane(h,m)&&(this.state===l.PAN?(b.copy(s.parent.matrixWorld).invert(),f.copy(m).sub(E.setFromMatrixPosition(s.matrixWorld))):this.state===l.ROTATE&&(y.set(0,1,0).applyQuaternion(e.quaternion).normalize(),v.set(1,0,0).applyQuaternion(e.quaternion).normalize())),o.style.cursor="move",this.dispatchEvent({type:"dragstart",object:s})),u.copy(a))}function O(){this.enabled!==!1&&(s&&(this.dispatchEvent({type:"dragend",object:s}),s=null),this.domElement.style.cursor=i?"pointer":"auto",this.state=l.NONE)}function w(n){this.enabled!==!1&&n.preventDefault()}function P(n,e=null){return n.isGroup&&(e=n),n.parent===null?e:P(n.parent,e)}exports.DragControls=T;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../build/three.module.js");const n=require("../../../build/three.core.js"),h={type:"change"},a=1e-6,r=new n.Quaternion;class c extends n.Controls{constructor(o,e=null){super(o,e),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this._moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this._moveVector=new n.Vector3(0,0,0),this._rotationVector=new n.Vector3(0,0,0),this._lastQuaternion=new n.Quaternion,this._lastPosition=new n.Vector3,this._status=0,this._onKeyDown=m.bind(this),this._onKeyUp=_.bind(this),this._onPointerMove=l.bind(this),this._onPointerDown=d.bind(this),this._onPointerUp=v.bind(this),this._onPointerCancel=f.bind(this),this._onContextMenu=u.bind(this),e!==null&&this.connect()}connect(){window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu)}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu)}dispose(){this.disconnect()}update(o){if(this.enabled===!1)return;const e=this.object,i=o*this.movementSpeed,s=o*this.rollSpeed;e.translateX(this._moveVector.x*i),e.translateY(this._moveVector.y*i),e.translateZ(this._moveVector.z*i),r.set(this._rotationVector.x*s,this._rotationVector.y*s,this._rotationVector.z*s,1).normalize(),e.quaternion.multiply(r),(this._lastPosition.distanceToSquared(e.position)>a||8*(1-this._lastQuaternion.dot(e.quaternion))>a)&&(this.dispatchEvent(h),this._lastQuaternion.copy(e.quaternion),this._lastPosition.copy(e.position))}_updateMovementVector(){const o=this._moveState.forward||this.autoForward&&!this._moveState.back?1:0;this._moveVector.x=-this._moveState.left+this._moveState.right,this._moveVector.y=-this._moveState.down+this._moveState.up,this._moveVector.z=-o+this._moveState.back}_updateRotationVector(){this._rotationVector.x=-this._moveState.pitchDown+this._moveState.pitchUp,this._rotationVector.y=-this._moveState.yawRight+this._moveState.yawLeft,this._rotationVector.z=-this._moveState.rollRight+this._moveState.rollLeft}_getContainerDimensions(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}}}function m(t){if(!(t.altKey||this.enabled===!1)){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this._moveState.forward=1;break;case"KeyS":this._moveState.back=1;break;case"KeyA":this._moveState.left=1;break;case"KeyD":this._moveState.right=1;break;case"KeyR":this._moveState.up=1;break;case"KeyF":this._moveState.down=1;break;case"ArrowUp":this._moveState.pitchUp=1;break;case"ArrowDown":this._moveState.pitchDown=1;break;case"ArrowLeft":this._moveState.yawLeft=1;break;case"ArrowRight":this._moveState.yawRight=1;break;case"KeyQ":this._moveState.rollLeft=1;break;case"KeyE":this._moveState.rollRight=1;break}this._updateMovementVector(),this._updateRotationVector()}}function _(t){if(this.enabled!==!1){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this._moveState.forward=0;break;case"KeyS":this._moveState.back=0;break;case"KeyA":this._moveState.left=0;break;case"KeyD":this._moveState.right=0;break;case"KeyR":this._moveState.up=0;break;case"KeyF":this._moveState.down=0;break;case"ArrowUp":this._moveState.pitchUp=0;break;case"ArrowDown":this._moveState.pitchDown=0;break;case"ArrowLeft":this._moveState.yawLeft=0;break;case"ArrowRight":this._moveState.yawRight=0;break;case"KeyQ":this._moveState.rollLeft=0;break;case"KeyE":this._moveState.rollRight=0;break}this._updateMovementVector(),this._updateRotationVector()}}function d(t){if(this.enabled!==!1)if(this.dragToLook)this._status++;else{switch(t.button){case 0:this._moveState.forward=1;break;case 2:this._moveState.back=1;break}this._updateMovementVector()}}function l(t){if(this.enabled!==!1&&(!this.dragToLook||this._status>0)){const o=this._getContainerDimensions(),e=o.size[0]/2,i=o.size[1]/2;this._moveState.yawLeft=-(t.pageX-o.offset[0]-e)/e,this._moveState.pitchDown=(t.pageY-o.offset[1]-i)/i,this._updateRotationVector()}}function v(t){if(this.enabled!==!1){if(this.dragToLook)this._status--,this._moveState.yawLeft=this._moveState.pitchDown=0;else{switch(t.button){case 0:this._moveState.forward=0;break;case 2:this._moveState.back=0;break}this._updateMovementVector()}this._updateRotationVector()}}function f(){this.enabled!==!1&&(this.dragToLook?(this._status=0,this._moveState.yawLeft=this._moveState.pitchDown=0):(this._moveState.forward=0,this._moveState.back=0,this._updateMovementVector()),this._updateRotationVector())}function u(t){this.enabled!==!1&&t.preventDefault()}exports.FlyControls=c;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../build/three.module.js");const s=require("../../../build/three.core.js"),y={type:"change"},m={type:"start"},g={type:"end"},_=new s.Ray,b=new s.Plane,E=Math.cos(70*s.MathUtils.DEG2RAD),h=new s.Vector3,l=2*Math.PI,a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=1e-6;class P extends s.Controls{constructor(t,e=null){super(t,e),this.state=a.NONE,this.enabled=!0,this.target=new s.Vector3,this.cursor=new s.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:s.MOUSE.ROTATE,MIDDLE:s.MOUSE.DOLLY,RIGHT:s.MOUSE.PAN},this.touches={ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new s.Vector3,this._lastQuaternion=new s.Quaternion,this._lastTargetPosition=new s.Vector3,this._quat=new s.Quaternion().setFromUnitVectors(t.up,new s.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new s.Spherical,this._sphericalDelta=new s.Spherical,this._scale=1,this._panOffset=new s.Vector3,this._rotateStart=new s.Vector2,this._rotateEnd=new s.Vector2,this._rotateDelta=new s.Vector2,this._panStart=new s.Vector2,this._panEnd=new s.Vector2,this._panDelta=new s.Vector2,this._dollyStart=new s.Vector2,this._dollyEnd=new s.Vector2,this._dollyDelta=new s.Vector2,this._dollyDirection=new s.Vector3,this._mouse=new s.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=D.bind(this),this._onPointerDown=T.bind(this),this._onPointerUp=M.bind(this),this._onContextMenu=L.bind(this),this._onMouseWheel=w.bind(this),this._onKeyDown=R.bind(this),this._onTouchStart=j.bind(this),this._onTouchMove=A.bind(this),this._onMouseDown=S.bind(this),this._onMouseMove=O.bind(this),this._interceptControlDown=C.bind(this),this._interceptControlUp=x.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(y),this.update(),this.state=a.NONE}update(t=null){const e=this.object.position;h.copy(e).sub(this.target),h.applyQuaternion(this._quat),this._spherical.setFromVector3(h),this.autoRotate&&this.state===a.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let o=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(o)&&isFinite(n)&&(o<-Math.PI?o+=l:o>Math.PI&&(o-=l),n<-Math.PI?n+=l:n>Math.PI&&(n-=l),o<=n?this._spherical.theta=Math.max(o,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(o+n)/2?Math.max(o,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const c=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=c!=this._spherical.radius}if(h.setFromSpherical(this._spherical),h.applyQuaternion(this._quatInverse),e.copy(this.target).add(h),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let c=null;if(this.object.isPerspectiveCamera){const p=h.length();c=this._clampDistance(p*this._scale);const d=p-c;this.object.position.addScaledVector(this._dollyDirection,d),this.object.updateMatrixWorld(),r=!!d}else if(this.object.isOrthographicCamera){const p=new s.Vector3(this._mouse.x,this._mouse.y,0);p.unproject(this.object);const d=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=d!==this.object.zoom;const f=new s.Vector3(this._mouse.x,this._mouse.y,0);f.unproject(this.object),this.object.position.sub(f).add(p),this.object.updateMatrixWorld(),c=h.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;c!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(c).add(this.object.position):(_.origin.copy(this.object.position),_.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(_.direction))<E?this.object.lookAt(this.target):(b.setFromNormalAndCoplanarPoint(this.object.up,this.target),_.intersectPlane(b,this.target))))}else if(this.object.isOrthographicCamera){const c=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),c!==this.object.zoom&&(this.object.updateProjectionMatrix(),r=!0)}return this._scale=1,this._performCursorZoom=!1,r||this._lastPosition.distanceToSquared(this.object.position)>u||8*(1-this._lastQuaternion.dot(this.object.quaternion))>u||this._lastTargetPosition.distanceToSquared(this.target)>u?(this.dispatchEvent(y),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?l/60*this.autoRotateSpeed*t:l/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){h.setFromMatrixColumn(e,0),h.multiplyScalar(-t),this._panOffset.add(h)}_panUp(t,e){this.screenSpacePanning===!0?h.setFromMatrixColumn(e,1):(h.setFromMatrixColumn(e,0),h.crossVectors(this.object.up,h)),h.multiplyScalar(t),this._panOffset.add(h)}_pan(t,e){const o=this.domElement;if(this.object.isPerspectiveCamera){const n=this.object.position;h.copy(n).sub(this.target);let r=h.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/o.clientHeight,this.object.matrix),this._panUp(2*e*r/o.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/o.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/o.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const o=this.domElement.getBoundingClientRect(),n=t-o.left,r=e-o.top,c=o.width,p=o.height;this._mouse.x=n/c*2-1,this._mouse.y=-(r/p)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(l*this._rotateDelta.x/e.clientHeight),this._rotateUp(l*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(l*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-l*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(l*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-l*this.rotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),o=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._rotateStart.set(o,n)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),o=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._panStart.set(o,n)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),o=t.pageX-e.x,n=t.pageY-e.y,r=Math.sqrt(o*o+n*n);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const o=this._getSecondPointerPosition(t),n=.5*(t.pageX+o.x),r=.5*(t.pageY+o.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(l*this._rotateDelta.x/e.clientHeight),this._rotateUp(l*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),o=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._panEnd.set(o,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),o=t.pageX-e.x,n=t.pageY-e.y,r=Math.sqrt(o*o+n*n);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const c=(t.pageX+e.x)*.5,p=(t.pageY+e.y)*.5;this._updateZoomParameters(c,p)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId){this._pointers.splice(e,1);return}}_isTrackingPointer(t){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return!0;return!1}_trackPointer(t){let e=this._pointerPositions[t.pointerId];e===void 0&&(e=new s.Vector2,this._pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(t){const e=t.deltaMode,o={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:o.deltaY*=16;break;case 2:o.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(o.deltaY*=10),o}}function T(i){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(i.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(i)&&(this._addPointer(i),i.pointerType==="touch"?this._onTouchStart(i):this._onMouseDown(i)))}function D(i){this.enabled!==!1&&(i.pointerType==="touch"?this._onTouchMove(i):this._onMouseMove(i))}function M(i){switch(this._removePointer(i),this._pointers.length){case 0:this.domElement.releasePointerCapture(i.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(g),this.state=a.NONE;break;case 1:const t=this._pointers[0],e=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:e.x,pageY:e.y});break}}function S(i){let t;switch(i.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case s.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(i),this.state=a.DOLLY;break;case s.MOUSE.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=a.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=a.ROTATE}break;case s.MOUSE.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=a.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=a.PAN}break;default:this.state=a.NONE}this.state!==a.NONE&&this.dispatchEvent(m)}function O(i){switch(this.state){case a.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(i);break;case a.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(i);break;case a.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(i);break}}function w(i){this.enabled===!1||this.enableZoom===!1||this.state!==a.NONE||(i.preventDefault(),this.dispatchEvent(m),this._handleMouseWheel(this._customWheelEvent(i)),this.dispatchEvent(g))}function R(i){this.enabled!==!1&&this._handleKeyDown(i)}function j(i){switch(this._trackPointer(i),this._pointers.length){case 1:switch(this.touches.ONE){case s.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(i),this.state=a.TOUCH_ROTATE;break;case s.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(i),this.state=a.TOUCH_PAN;break;default:this.state=a.NONE}break;case 2:switch(this.touches.TWO){case s.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(i),this.state=a.TOUCH_DOLLY_PAN;break;case s.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(i),this.state=a.TOUCH_DOLLY_ROTATE;break;default:this.state=a.NONE}break;default:this.state=a.NONE}this.state!==a.NONE&&this.dispatchEvent(m)}function A(i){switch(this._trackPointer(i),this.state){case a.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(i),this.update();break;case a.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(i),this.update();break;case a.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(i),this.update();break;case a.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(i),this.update();break;default:this.state=a.NONE}}function L(i){this.enabled!==!1&&i.preventDefault()}function C(i){i.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function x(i){i.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}exports.OrbitControls=P;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../build/three.module.js");const o=require("../../../build/three.core.js"),l={type:"change"},y={type:"start"},E={type:"end"},g=1e-6,s={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4},a=new o.Vector2,n=new o.Vector2,P=new o.Vector3,c=new o.Vector3,d=new o.Vector3,h=new o.Quaternion,b=new o.Vector3,p=new o.Vector3,u=new o.Vector3,_=new o.Vector3;class O extends o.Controls{constructor(t,i=null){super(t,i),this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:o.MOUSE.ROTATE,MIDDLE:o.MOUSE.DOLLY,RIGHT:o.MOUSE.PAN},this.state=s.NONE,this.keyState=s.NONE,this.target=new o.Vector3,this._lastPosition=new o.Vector3,this._lastZoom=1,this._touchZoomDistanceStart=0,this._touchZoomDistanceEnd=0,this._lastAngle=0,this._eye=new o.Vector3,this._movePrev=new o.Vector2,this._moveCurr=new o.Vector2,this._lastAxis=new o.Vector3,this._zoomStart=new o.Vector2,this._zoomEnd=new o.Vector2,this._panStart=new o.Vector2,this._panEnd=new o.Vector2,this._pointers=[],this._pointerPositions={},this._onPointerMove=w.bind(this),this._onPointerDown=v.bind(this),this._onPointerUp=S.bind(this),this._onPointerCancel=M.bind(this),this._onContextMenu=A.bind(this),this._onMouseWheel=z.bind(this),this._onKeyDown=j.bind(this),this._onKeyUp=C.bind(this),this._onTouchStart=x.bind(this),this._onTouchMove=Z.bind(this),this._onTouchEnd=N.bind(this),this._onMouseDown=T.bind(this),this._onMouseMove=k.bind(this),this._onMouseUp=D.bind(this),this._target0=this.target.clone(),this._position0=this.object.position.clone(),this._up0=this.object.up.clone(),this._zoom0=this.object.zoom,i!==null&&(this.connect(),this.handleResize()),this.update()}connect(){window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}handleResize(){const t=this.domElement.getBoundingClientRect(),i=this.domElement.ownerDocument.documentElement;this.screen.left=t.left+window.pageXOffset-i.clientLeft,this.screen.top=t.top+window.pageYOffset-i.clientTop,this.screen.width=t.width,this.screen.height=t.height}update(){this._eye.subVectors(this.object.position,this.target),this.noRotate||this._rotateCamera(),this.noZoom||this._zoomCamera(),this.noPan||this._panCamera(),this.object.position.addVectors(this.target,this._eye),this.object.isPerspectiveCamera?(this._checkDistances(),this.object.lookAt(this.target),this._lastPosition.distanceToSquared(this.object.position)>g&&(this.dispatchEvent(l),this._lastPosition.copy(this.object.position))):this.object.isOrthographicCamera?(this.object.lookAt(this.target),(this._lastPosition.distanceToSquared(this.object.position)>g||this._lastZoom!==this.object.zoom)&&(this.dispatchEvent(l),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type.")}reset(){this.state=s.NONE,this.keyState=s.NONE,this.target.copy(this._target0),this.object.position.copy(this._position0),this.object.up.copy(this._up0),this.object.zoom=this._zoom0,this.object.updateProjectionMatrix(),this._eye.subVectors(this.object.position,this.target),this.object.lookAt(this.target),this.dispatchEvent(l),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom}_panCamera(){if(n.copy(this._panEnd).sub(this._panStart),n.lengthSq()){if(this.object.isOrthographicCamera){const t=(this.object.right-this.object.left)/this.object.zoom/this.domElement.clientWidth,i=(this.object.top-this.object.bottom)/this.object.zoom/this.domElement.clientWidth;n.x*=t,n.y*=i}n.multiplyScalar(this._eye.length()*this.panSpeed),c.copy(this._eye).cross(this.object.up).setLength(n.x),c.add(P.copy(this.object.up).setLength(n.y)),this.object.position.add(c),this.target.add(c),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(n.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}}_rotateCamera(){_.set(this._moveCurr.x-this._movePrev.x,this._moveCurr.y-this._movePrev.y,0);let t=_.length();t?(this._eye.copy(this.object.position).sub(this.target),b.copy(this._eye).normalize(),p.copy(this.object.up).normalize(),u.crossVectors(p,b).normalize(),p.setLength(this._moveCurr.y-this._movePrev.y),u.setLength(this._moveCurr.x-this._movePrev.x),_.copy(p.add(u)),d.crossVectors(_,this._eye).normalize(),t*=this.rotateSpeed,h.setFromAxisAngle(d,t),this._eye.applyQuaternion(h),this.object.up.applyQuaternion(h),this._lastAxis.copy(d),this._lastAngle=t):!this.staticMoving&&this._lastAngle&&(this._lastAngle*=Math.sqrt(1-this.dynamicDampingFactor),this._eye.copy(this.object.position).sub(this.target),h.setFromAxisAngle(this._lastAxis,this._lastAngle),this._eye.applyQuaternion(h),this.object.up.applyQuaternion(h)),this._movePrev.copy(this._moveCurr)}_zoomCamera(){let t;this.state===s.TOUCH_ZOOM_PAN?(t=this._touchZoomDistanceStart/this._touchZoomDistanceEnd,this._touchZoomDistanceStart=this._touchZoomDistanceEnd,this.object.isPerspectiveCamera?this._eye.multiplyScalar(t):this.object.isOrthographicCamera?(this.object.zoom=o.MathUtils.clamp(this.object.zoom/t,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(t=1+(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed,t!==1&&t>0&&(this.object.isPerspectiveCamera?this._eye.multiplyScalar(t):this.object.isOrthographicCamera?(this.object.zoom=o.MathUtils.clamp(this.object.zoom/t,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),this.staticMoving?this._zoomStart.copy(this._zoomEnd):this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor)}_getMouseOnScreen(t,i){return a.set((t-this.screen.left)/this.screen.width,(i-this.screen.top)/this.screen.height),a}_getMouseOnCircle(t,i){return a.set((t-this.screen.width*.5-this.screen.left)/(this.screen.width*.5),(this.screen.height+2*(this.screen.top-i))/this.screen.width),a}_addPointer(t){this._pointers.push(t)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let i=0;i<this._pointers.length;i++)if(this._pointers[i].pointerId==t.pointerId){this._pointers.splice(i,1);return}}_trackPointer(t){let i=this._pointerPositions[t.pointerId];i===void 0&&(i=new o.Vector2,this._pointerPositions[t.pointerId]=i),i.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const i=t.pointerId===this._pointers[0].pointerId?this._pointers[1]:this._pointers[0];return this._pointerPositions[i.pointerId]}_checkDistances(){(!this.noZoom||!this.noPan)&&(this._eye.lengthSq()>this.maxDistance*this.maxDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.maxDistance)),this._zoomStart.copy(this._zoomEnd)),this._eye.lengthSq()<this.minDistance*this.minDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.minDistance)),this._zoomStart.copy(this._zoomEnd)))}}function v(e){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),this._addPointer(e),e.pointerType==="touch"?this._onTouchStart(e):this._onMouseDown(e))}function w(e){this.enabled!==!1&&(e.pointerType==="touch"?this._onTouchMove(e):this._onMouseMove(e))}function S(e){this.enabled!==!1&&(e.pointerType==="touch"?this._onTouchEnd(e):this._onMouseUp(),this._removePointer(e),this._pointers.length===0&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp)))}function M(e){this._removePointer(e)}function C(){this.enabled!==!1&&(this.keyState=s.NONE,window.addEventListener("keydown",this._onKeyDown))}function j(e){this.enabled!==!1&&(window.removeEventListener("keydown",this._onKeyDown),this.keyState===s.NONE&&(e.code===this.keys[s.ROTATE]&&!this.noRotate?this.keyState=s.ROTATE:e.code===this.keys[s.ZOOM]&&!this.noZoom?this.keyState=s.ZOOM:e.code===this.keys[s.PAN]&&!this.noPan&&(this.keyState=s.PAN)))}function T(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case o.MOUSE.DOLLY:this.state=s.ZOOM;break;case o.MOUSE.ROTATE:this.state=s.ROTATE;break;case o.MOUSE.PAN:this.state=s.PAN;break;default:this.state=s.NONE}const i=this.keyState!==s.NONE?this.keyState:this.state;i===s.ROTATE&&!this.noRotate?(this._moveCurr.copy(this._getMouseOnCircle(e.pageX,e.pageY)),this._movePrev.copy(this._moveCurr)):i===s.ZOOM&&!this.noZoom?(this._zoomStart.copy(this._getMouseOnScreen(e.pageX,e.pageY)),this._zoomEnd.copy(this._zoomStart)):i===s.PAN&&!this.noPan&&(this._panStart.copy(this._getMouseOnScreen(e.pageX,e.pageY)),this._panEnd.copy(this._panStart)),this.dispatchEvent(y)}function k(e){const t=this.keyState!==s.NONE?this.keyState:this.state;t===s.ROTATE&&!this.noRotate?(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(e.pageX,e.pageY))):t===s.ZOOM&&!this.noZoom?this._zoomEnd.copy(this._getMouseOnScreen(e.pageX,e.pageY)):t===s.PAN&&!this.noPan&&this._panEnd.copy(this._getMouseOnScreen(e.pageX,e.pageY))}function D(){this.state=s.NONE,this.dispatchEvent(E)}function z(e){if(this.enabled!==!1&&this.noZoom!==!0){switch(e.preventDefault(),e.deltaMode){case 2:this._zoomStart.y-=e.deltaY*.025;break;case 1:this._zoomStart.y-=e.deltaY*.01;break;default:this._zoomStart.y-=e.deltaY*25e-5;break}this.dispatchEvent(y),this.dispatchEvent(E)}}function A(e){this.enabled!==!1&&e.preventDefault()}function x(e){switch(this._trackPointer(e),this._pointers.length){case 1:this.state=s.TOUCH_ROTATE,this._moveCurr.copy(this._getMouseOnCircle(this._pointers[0].pageX,this._pointers[0].pageY)),this._movePrev.copy(this._moveCurr);break;default:this.state=s.TOUCH_ZOOM_PAN;const t=this._pointers[0].pageX-this._pointers[1].pageX,i=this._pointers[0].pageY-this._pointers[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(t*t+i*i);const r=(this._pointers[0].pageX+this._pointers[1].pageX)/2,m=(this._pointers[0].pageY+this._pointers[1].pageY)/2;this._panStart.copy(this._getMouseOnScreen(r,m)),this._panEnd.copy(this._panStart);break}this.dispatchEvent(y)}function Z(e){switch(this._trackPointer(e),this._pointers.length){case 1:this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(e.pageX,e.pageY));break;default:const t=this._getSecondPointerPosition(e),i=e.pageX-t.x,r=e.pageY-t.y;this._touchZoomDistanceEnd=Math.sqrt(i*i+r*r);const m=(e.pageX+t.x)/2,f=(e.pageY+t.y)/2;this._panEnd.copy(this._getMouseOnScreen(m,f));break}}function N(e){switch(this._pointers.length){case 0:this.state=s.NONE;break;case 1:this.state=s.TOUCH_ROTATE,this._moveCurr.copy(this._getMouseOnCircle(e.pageX,e.pageY)),this._movePrev.copy(this._moveCurr);break;case 2:this.state=s.TOUCH_ZOOM_PAN;for(let t=0;t<this._pointers.length;t++)if(this._pointers[t].pointerId!==e.pointerId){const i=this._pointerPositions[this._pointers[t].pointerId];this._moveCurr.copy(this._getMouseOnCircle(i.x,i.y)),this._movePrev.copy(this._moveCurr);break}break}this.dispatchEvent(E)}exports.TrackballControls=O;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../build/three.module.js");const s=require("./Pass.js"),i=require("../../../build/three.core.js");class r extends s.Pass{constructor(e,t){super(),this.textureID=t!==void 0?t:"tDiffuse",e instanceof i.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=i.UniformsUtils.clone(e.uniforms),this.material=new i.ShaderMaterial({name:e.name!==void 0?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new s.FullScreenQuad(this.material)}render(e,t,a){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=a.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}exports.ShaderPass=r;
|
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
var g = Object.freeze({
|
|
2
|
-
Linear: Object.freeze({
|
|
3
|
-
None: function(t) {
|
|
4
|
-
return t;
|
|
5
|
-
},
|
|
6
|
-
In: function(t) {
|
|
7
|
-
return t;
|
|
8
|
-
},
|
|
9
|
-
Out: function(t) {
|
|
10
|
-
return t;
|
|
11
|
-
},
|
|
12
|
-
InOut: function(t) {
|
|
13
|
-
return t;
|
|
14
|
-
}
|
|
15
|
-
}),
|
|
16
|
-
Quadratic: Object.freeze({
|
|
17
|
-
In: function(t) {
|
|
18
|
-
return t * t;
|
|
19
|
-
},
|
|
20
|
-
Out: function(t) {
|
|
21
|
-
return t * (2 - t);
|
|
22
|
-
},
|
|
23
|
-
InOut: function(t) {
|
|
24
|
-
return (t *= 2) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1);
|
|
25
|
-
}
|
|
26
|
-
}),
|
|
27
|
-
Cubic: Object.freeze({
|
|
28
|
-
In: function(t) {
|
|
29
|
-
return t * t * t;
|
|
30
|
-
},
|
|
31
|
-
Out: function(t) {
|
|
32
|
-
return --t * t * t + 1;
|
|
33
|
-
},
|
|
34
|
-
InOut: function(t) {
|
|
35
|
-
return (t *= 2) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2);
|
|
36
|
-
}
|
|
37
|
-
}),
|
|
38
|
-
Quartic: Object.freeze({
|
|
39
|
-
In: function(t) {
|
|
40
|
-
return t * t * t * t;
|
|
41
|
-
},
|
|
42
|
-
Out: function(t) {
|
|
43
|
-
return 1 - --t * t * t * t;
|
|
44
|
-
},
|
|
45
|
-
InOut: function(t) {
|
|
46
|
-
return (t *= 2) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2);
|
|
47
|
-
}
|
|
48
|
-
}),
|
|
49
|
-
Quintic: Object.freeze({
|
|
50
|
-
In: function(t) {
|
|
51
|
-
return t * t * t * t * t;
|
|
52
|
-
},
|
|
53
|
-
Out: function(t) {
|
|
54
|
-
return --t * t * t * t * t + 1;
|
|
55
|
-
},
|
|
56
|
-
InOut: function(t) {
|
|
57
|
-
return (t *= 2) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2);
|
|
58
|
-
}
|
|
59
|
-
}),
|
|
60
|
-
Sinusoidal: Object.freeze({
|
|
61
|
-
In: function(t) {
|
|
62
|
-
return 1 - Math.sin((1 - t) * Math.PI / 2);
|
|
63
|
-
},
|
|
64
|
-
Out: function(t) {
|
|
65
|
-
return Math.sin(t * Math.PI / 2);
|
|
66
|
-
},
|
|
67
|
-
InOut: function(t) {
|
|
68
|
-
return 0.5 * (1 - Math.sin(Math.PI * (0.5 - t)));
|
|
69
|
-
}
|
|
70
|
-
}),
|
|
71
|
-
Exponential: Object.freeze({
|
|
72
|
-
In: function(t) {
|
|
73
|
-
return t === 0 ? 0 : Math.pow(1024, t - 1);
|
|
74
|
-
},
|
|
75
|
-
Out: function(t) {
|
|
76
|
-
return t === 1 ? 1 : 1 - Math.pow(2, -10 * t);
|
|
77
|
-
},
|
|
78
|
-
InOut: function(t) {
|
|
79
|
-
return t === 0 ? 0 : t === 1 ? 1 : (t *= 2) < 1 ? 0.5 * Math.pow(1024, t - 1) : 0.5 * (-Math.pow(2, -10 * (t - 1)) + 2);
|
|
80
|
-
}
|
|
81
|
-
}),
|
|
82
|
-
Circular: Object.freeze({
|
|
83
|
-
In: function(t) {
|
|
84
|
-
return 1 - Math.sqrt(1 - t * t);
|
|
85
|
-
},
|
|
86
|
-
Out: function(t) {
|
|
87
|
-
return Math.sqrt(1 - --t * t);
|
|
88
|
-
},
|
|
89
|
-
InOut: function(t) {
|
|
90
|
-
return (t *= 2) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
|
|
91
|
-
}
|
|
92
|
-
}),
|
|
93
|
-
Elastic: Object.freeze({
|
|
94
|
-
In: function(t) {
|
|
95
|
-
return t === 0 ? 0 : t === 1 ? 1 : -Math.pow(2, 10 * (t - 1)) * Math.sin((t - 1.1) * 5 * Math.PI);
|
|
96
|
-
},
|
|
97
|
-
Out: function(t) {
|
|
98
|
-
return t === 0 ? 0 : t === 1 ? 1 : Math.pow(2, -10 * t) * Math.sin((t - 0.1) * 5 * Math.PI) + 1;
|
|
99
|
-
},
|
|
100
|
-
InOut: function(t) {
|
|
101
|
-
return t === 0 ? 0 : t === 1 ? 1 : (t *= 2, t < 1 ? -0.5 * Math.pow(2, 10 * (t - 1)) * Math.sin((t - 1.1) * 5 * Math.PI) : 0.5 * Math.pow(2, -10 * (t - 1)) * Math.sin((t - 1.1) * 5 * Math.PI) + 1);
|
|
102
|
-
}
|
|
103
|
-
}),
|
|
104
|
-
Back: Object.freeze({
|
|
105
|
-
In: function(t) {
|
|
106
|
-
var i = 1.70158;
|
|
107
|
-
return t === 1 ? 1 : t * t * ((i + 1) * t - i);
|
|
108
|
-
},
|
|
109
|
-
Out: function(t) {
|
|
110
|
-
var i = 1.70158;
|
|
111
|
-
return t === 0 ? 0 : --t * t * ((i + 1) * t + i) + 1;
|
|
112
|
-
},
|
|
113
|
-
InOut: function(t) {
|
|
114
|
-
var i = 2.5949095;
|
|
115
|
-
return (t *= 2) < 1 ? 0.5 * (t * t * ((i + 1) * t - i)) : 0.5 * ((t -= 2) * t * ((i + 1) * t + i) + 2);
|
|
116
|
-
}
|
|
117
|
-
}),
|
|
118
|
-
Bounce: Object.freeze({
|
|
119
|
-
In: function(t) {
|
|
120
|
-
return 1 - g.Bounce.Out(1 - t);
|
|
121
|
-
},
|
|
122
|
-
Out: function(t) {
|
|
123
|
-
return t < 0.36363636363636365 ? 7.5625 * t * t : t < 0.7272727272727273 ? 7.5625 * (t -= 0.5454545454545454) * t + 0.75 : t < 0.9090909090909091 ? 7.5625 * (t -= 0.8181818181818182) * t + 0.9375 : 7.5625 * (t -= 0.9545454545454546) * t + 0.984375;
|
|
124
|
-
},
|
|
125
|
-
InOut: function(t) {
|
|
126
|
-
return t < 0.5 ? g.Bounce.In(t * 2) * 0.5 : g.Bounce.Out(t * 2 - 1) * 0.5 + 0.5;
|
|
127
|
-
}
|
|
128
|
-
}),
|
|
129
|
-
generatePow: function(t) {
|
|
130
|
-
return t === void 0 && (t = 4), t = t < Number.EPSILON ? Number.EPSILON : t, t = t > 1e4 ? 1e4 : t, {
|
|
131
|
-
In: function(i) {
|
|
132
|
-
return Math.pow(i, t);
|
|
133
|
-
},
|
|
134
|
-
Out: function(i) {
|
|
135
|
-
return 1 - Math.pow(1 - i, t);
|
|
136
|
-
},
|
|
137
|
-
InOut: function(i) {
|
|
138
|
-
return i < 0.5 ? Math.pow(i * 2, t) / 2 : (1 - Math.pow(2 - i * 2, t)) / 2 + 0.5;
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}), b = function() {
|
|
143
|
-
return performance.now();
|
|
144
|
-
}, w = (
|
|
145
|
-
/** @class */
|
|
146
|
-
function() {
|
|
147
|
-
function t() {
|
|
148
|
-
this._tweens = {}, this._tweensAddedDuringUpdate = {};
|
|
149
|
-
}
|
|
150
|
-
return t.prototype.getAll = function() {
|
|
151
|
-
var i = this;
|
|
152
|
-
return Object.keys(this._tweens).map(function(e) {
|
|
153
|
-
return i._tweens[e];
|
|
154
|
-
});
|
|
155
|
-
}, t.prototype.removeAll = function() {
|
|
156
|
-
this._tweens = {};
|
|
157
|
-
}, t.prototype.add = function(i) {
|
|
158
|
-
this._tweens[i.getId()] = i, this._tweensAddedDuringUpdate[i.getId()] = i;
|
|
159
|
-
}, t.prototype.remove = function(i) {
|
|
160
|
-
delete this._tweens[i.getId()], delete this._tweensAddedDuringUpdate[i.getId()];
|
|
161
|
-
}, t.prototype.update = function(i, e) {
|
|
162
|
-
i === void 0 && (i = b()), e === void 0 && (e = !1);
|
|
163
|
-
var r = Object.keys(this._tweens);
|
|
164
|
-
if (r.length === 0)
|
|
165
|
-
return !1;
|
|
166
|
-
for (; r.length > 0; ) {
|
|
167
|
-
this._tweensAddedDuringUpdate = {};
|
|
168
|
-
for (var h = 0; h < r.length; h++) {
|
|
169
|
-
var n = this._tweens[r[h]], s = !e;
|
|
170
|
-
n && n.update(i, s) === !1 && !e && delete this._tweens[r[h]];
|
|
171
|
-
}
|
|
172
|
-
r = Object.keys(this._tweensAddedDuringUpdate);
|
|
173
|
-
}
|
|
174
|
-
return !0;
|
|
175
|
-
}, t;
|
|
176
|
-
}()
|
|
177
|
-
), O = {
|
|
178
|
-
Linear: function(t, i) {
|
|
179
|
-
var e = t.length - 1, r = e * i, h = Math.floor(r), n = O.Utils.Linear;
|
|
180
|
-
return i < 0 ? n(t[0], t[1], r) : i > 1 ? n(t[e], t[e - 1], e - r) : n(t[h], t[h + 1 > e ? e : h + 1], r - h);
|
|
181
|
-
},
|
|
182
|
-
Utils: {
|
|
183
|
-
Linear: function(t, i, e) {
|
|
184
|
-
return (i - t) * e + t;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}, P = (
|
|
188
|
-
/** @class */
|
|
189
|
-
function() {
|
|
190
|
-
function t() {
|
|
191
|
-
}
|
|
192
|
-
return t.nextId = function() {
|
|
193
|
-
return t._nextId++;
|
|
194
|
-
}, t._nextId = 0, t;
|
|
195
|
-
}()
|
|
196
|
-
), I = new w(), M = (
|
|
197
|
-
/** @class */
|
|
198
|
-
function() {
|
|
199
|
-
function t(i, e) {
|
|
200
|
-
e === void 0 && (e = I), this._object = i, this._group = e, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._isDynamic = !1, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = g.Linear.None, this._interpolationFunction = O.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._id = P.nextId(), this._isChainStopped = !1, this._propertiesAreSetUp = !1, this._goToEnd = !1;
|
|
201
|
-
}
|
|
202
|
-
return t.prototype.getId = function() {
|
|
203
|
-
return this._id;
|
|
204
|
-
}, t.prototype.isPlaying = function() {
|
|
205
|
-
return this._isPlaying;
|
|
206
|
-
}, t.prototype.isPaused = function() {
|
|
207
|
-
return this._isPaused;
|
|
208
|
-
}, t.prototype.getDuration = function() {
|
|
209
|
-
return this._duration;
|
|
210
|
-
}, t.prototype.to = function(i, e) {
|
|
211
|
-
if (e === void 0 && (e = 1e3), this._isPlaying)
|
|
212
|
-
throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");
|
|
213
|
-
return this._valuesEnd = i, this._propertiesAreSetUp = !1, this._duration = e < 0 ? 0 : e, this;
|
|
214
|
-
}, t.prototype.duration = function(i) {
|
|
215
|
-
return i === void 0 && (i = 1e3), this._duration = i < 0 ? 0 : i, this;
|
|
216
|
-
}, t.prototype.dynamic = function(i) {
|
|
217
|
-
return i === void 0 && (i = !1), this._isDynamic = i, this;
|
|
218
|
-
}, t.prototype.start = function(i, e) {
|
|
219
|
-
if (i === void 0 && (i = b()), e === void 0 && (e = !1), this._isPlaying)
|
|
220
|
-
return this;
|
|
221
|
-
if (this._group && this._group.add(this), this._repeat = this._initialRepeat, this._reversed) {
|
|
222
|
-
this._reversed = !1;
|
|
223
|
-
for (var r in this._valuesStartRepeat)
|
|
224
|
-
this._swapEndStartRepeatValues(r), this._valuesStart[r] = this._valuesStartRepeat[r];
|
|
225
|
-
}
|
|
226
|
-
if (this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._onEveryStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = i, this._startTime += this._delayTime, !this._propertiesAreSetUp || e) {
|
|
227
|
-
if (this._propertiesAreSetUp = !0, !this._isDynamic) {
|
|
228
|
-
var h = {};
|
|
229
|
-
for (var n in this._valuesEnd)
|
|
230
|
-
h[n] = this._valuesEnd[n];
|
|
231
|
-
this._valuesEnd = h;
|
|
232
|
-
}
|
|
233
|
-
this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat, e);
|
|
234
|
-
}
|
|
235
|
-
return this;
|
|
236
|
-
}, t.prototype.startFromCurrentValues = function(i) {
|
|
237
|
-
return this.start(i, !0);
|
|
238
|
-
}, t.prototype._setupProperties = function(i, e, r, h, n) {
|
|
239
|
-
for (var s in r) {
|
|
240
|
-
var a = i[s], f = Array.isArray(a), l = f ? "array" : typeof a, _ = !f && Array.isArray(r[s]);
|
|
241
|
-
if (!(l === "undefined" || l === "function")) {
|
|
242
|
-
if (_) {
|
|
243
|
-
var u = r[s];
|
|
244
|
-
if (u.length === 0)
|
|
245
|
-
continue;
|
|
246
|
-
for (var S = [a], d = 0, p = u.length; d < p; d += 1) {
|
|
247
|
-
var C = this._handleRelativeValue(a, u[d]);
|
|
248
|
-
if (isNaN(C)) {
|
|
249
|
-
_ = !1, console.warn("Found invalid interpolation list. Skipping.");
|
|
250
|
-
break;
|
|
251
|
-
}
|
|
252
|
-
S.push(C);
|
|
253
|
-
}
|
|
254
|
-
_ && (r[s] = S);
|
|
255
|
-
}
|
|
256
|
-
if ((l === "object" || f) && a && !_) {
|
|
257
|
-
e[s] = f ? [] : {};
|
|
258
|
-
var v = a;
|
|
259
|
-
for (var c in v)
|
|
260
|
-
e[s][c] = v[c];
|
|
261
|
-
h[s] = f ? [] : {};
|
|
262
|
-
var u = r[s];
|
|
263
|
-
if (!this._isDynamic) {
|
|
264
|
-
var y = {};
|
|
265
|
-
for (var c in u)
|
|
266
|
-
y[c] = u[c];
|
|
267
|
-
r[s] = u = y;
|
|
268
|
-
}
|
|
269
|
-
this._setupProperties(v, e[s], u, h[s], n);
|
|
270
|
-
} else
|
|
271
|
-
(typeof e[s] > "u" || n) && (e[s] = a), f || (e[s] *= 1), _ ? h[s] = r[s].slice().reverse() : h[s] = e[s] || 0;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}, t.prototype.stop = function() {
|
|
275
|
-
return this._isChainStopped || (this._isChainStopped = !0, this.stopChainedTweens()), this._isPlaying ? (this._group && this._group.remove(this), this._isPlaying = !1, this._isPaused = !1, this._onStopCallback && this._onStopCallback(this._object), this) : this;
|
|
276
|
-
}, t.prototype.end = function() {
|
|
277
|
-
return this._goToEnd = !0, this.update(1 / 0), this;
|
|
278
|
-
}, t.prototype.pause = function(i) {
|
|
279
|
-
return i === void 0 && (i = b()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = i, this._group && this._group.remove(this), this);
|
|
280
|
-
}, t.prototype.resume = function(i) {
|
|
281
|
-
return i === void 0 && (i = b()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += i - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this);
|
|
282
|
-
}, t.prototype.stopChainedTweens = function() {
|
|
283
|
-
for (var i = 0, e = this._chainedTweens.length; i < e; i++)
|
|
284
|
-
this._chainedTweens[i].stop();
|
|
285
|
-
return this;
|
|
286
|
-
}, t.prototype.group = function(i) {
|
|
287
|
-
return i === void 0 && (i = I), this._group = i, this;
|
|
288
|
-
}, t.prototype.delay = function(i) {
|
|
289
|
-
return i === void 0 && (i = 0), this._delayTime = i, this;
|
|
290
|
-
}, t.prototype.repeat = function(i) {
|
|
291
|
-
return i === void 0 && (i = 0), this._initialRepeat = i, this._repeat = i, this;
|
|
292
|
-
}, t.prototype.repeatDelay = function(i) {
|
|
293
|
-
return this._repeatDelayTime = i, this;
|
|
294
|
-
}, t.prototype.yoyo = function(i) {
|
|
295
|
-
return i === void 0 && (i = !1), this._yoyo = i, this;
|
|
296
|
-
}, t.prototype.easing = function(i) {
|
|
297
|
-
return i === void 0 && (i = g.Linear.None), this._easingFunction = i, this;
|
|
298
|
-
}, t.prototype.interpolation = function(i) {
|
|
299
|
-
return i === void 0 && (i = O.Linear), this._interpolationFunction = i, this;
|
|
300
|
-
}, t.prototype.chain = function() {
|
|
301
|
-
for (var i = [], e = 0; e < arguments.length; e++)
|
|
302
|
-
i[e] = arguments[e];
|
|
303
|
-
return this._chainedTweens = i, this;
|
|
304
|
-
}, t.prototype.onStart = function(i) {
|
|
305
|
-
return this._onStartCallback = i, this;
|
|
306
|
-
}, t.prototype.onEveryStart = function(i) {
|
|
307
|
-
return this._onEveryStartCallback = i, this;
|
|
308
|
-
}, t.prototype.onUpdate = function(i) {
|
|
309
|
-
return this._onUpdateCallback = i, this;
|
|
310
|
-
}, t.prototype.onRepeat = function(i) {
|
|
311
|
-
return this._onRepeatCallback = i, this;
|
|
312
|
-
}, t.prototype.onComplete = function(i) {
|
|
313
|
-
return this._onCompleteCallback = i, this;
|
|
314
|
-
}, t.prototype.onStop = function(i) {
|
|
315
|
-
return this._onStopCallback = i, this;
|
|
316
|
-
}, t.prototype.update = function(i, e) {
|
|
317
|
-
var r = this, h;
|
|
318
|
-
if (i === void 0 && (i = b()), e === void 0 && (e = !0), this._isPaused)
|
|
319
|
-
return !0;
|
|
320
|
-
var n, s = this._startTime + this._duration;
|
|
321
|
-
if (!this._goToEnd && !this._isPlaying) {
|
|
322
|
-
if (i > s)
|
|
323
|
-
return !1;
|
|
324
|
-
e && this.start(i, !0);
|
|
325
|
-
}
|
|
326
|
-
if (this._goToEnd = !1, i < this._startTime)
|
|
327
|
-
return !0;
|
|
328
|
-
this._onStartCallbackFired === !1 && (this._onStartCallback && this._onStartCallback(this._object), this._onStartCallbackFired = !0), this._onEveryStartCallbackFired === !1 && (this._onEveryStartCallback && this._onEveryStartCallback(this._object), this._onEveryStartCallbackFired = !0);
|
|
329
|
-
var a = i - this._startTime, f = this._duration + ((h = this._repeatDelayTime) !== null && h !== void 0 ? h : this._delayTime), l = this._duration + this._repeat * f, _ = function() {
|
|
330
|
-
if (r._duration === 0 || a > l)
|
|
331
|
-
return 1;
|
|
332
|
-
var v = Math.trunc(a / f), c = a - v * f, y = Math.min(c / r._duration, 1);
|
|
333
|
-
return y === 0 && a === r._duration ? 1 : y;
|
|
334
|
-
}, u = _(), S = this._easingFunction(u);
|
|
335
|
-
if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, S), this._onUpdateCallback && this._onUpdateCallback(this._object, u), this._duration === 0 || a >= this._duration)
|
|
336
|
-
if (this._repeat > 0) {
|
|
337
|
-
var d = Math.min(Math.trunc((a - this._duration) / f) + 1, this._repeat);
|
|
338
|
-
isFinite(this._repeat) && (this._repeat -= d);
|
|
339
|
-
for (n in this._valuesStartRepeat)
|
|
340
|
-
!this._yoyo && typeof this._valuesEnd[n] == "string" && (this._valuesStartRepeat[n] = // eslint-disable-next-line
|
|
341
|
-
// @ts-ignore FIXME?
|
|
342
|
-
this._valuesStartRepeat[n] + parseFloat(this._valuesEnd[n])), this._yoyo && this._swapEndStartRepeatValues(n), this._valuesStart[n] = this._valuesStartRepeat[n];
|
|
343
|
-
return this._yoyo && (this._reversed = !this._reversed), this._startTime += f * d, this._onRepeatCallback && this._onRepeatCallback(this._object), this._onEveryStartCallbackFired = !1, !0;
|
|
344
|
-
} else {
|
|
345
|
-
this._onCompleteCallback && this._onCompleteCallback(this._object);
|
|
346
|
-
for (var p = 0, C = this._chainedTweens.length; p < C; p++)
|
|
347
|
-
this._chainedTweens[p].start(this._startTime + this._duration, !1);
|
|
348
|
-
return this._isPlaying = !1, !1;
|
|
349
|
-
}
|
|
350
|
-
return !0;
|
|
351
|
-
}, t.prototype._updateProperties = function(i, e, r, h) {
|
|
352
|
-
for (var n in r)
|
|
353
|
-
if (e[n] !== void 0) {
|
|
354
|
-
var s = e[n] || 0, a = r[n], f = Array.isArray(i[n]), l = Array.isArray(a), _ = !f && l;
|
|
355
|
-
_ ? i[n] = this._interpolationFunction(a, h) : typeof a == "object" && a ? this._updateProperties(i[n], s, a, h) : (a = this._handleRelativeValue(s, a), typeof a == "number" && (i[n] = s + (a - s) * h));
|
|
356
|
-
}
|
|
357
|
-
}, t.prototype._handleRelativeValue = function(i, e) {
|
|
358
|
-
return typeof e != "string" ? e : e.charAt(0) === "+" || e.charAt(0) === "-" ? i + parseFloat(e) : parseFloat(e);
|
|
359
|
-
}, t.prototype._swapEndStartRepeatValues = function(i) {
|
|
360
|
-
var e = this._valuesStartRepeat[i], r = this._valuesEnd[i];
|
|
361
|
-
typeof r == "string" ? this._valuesStartRepeat[i] = this._valuesStartRepeat[i] + parseFloat(r) : this._valuesStartRepeat[i] = this._valuesEnd[i], this._valuesEnd[i] = e;
|
|
362
|
-
}, t;
|
|
363
|
-
}()
|
|
364
|
-
);
|
|
365
|
-
P.nextId;
|
|
366
|
-
var o = I;
|
|
367
|
-
o.getAll.bind(o);
|
|
368
|
-
o.removeAll.bind(o);
|
|
369
|
-
o.add.bind(o);
|
|
370
|
-
o.remove.bind(o);
|
|
371
|
-
o.update.bind(o);
|
|
372
|
-
export {
|
|
373
|
-
g as Easing,
|
|
374
|
-
w as Group,
|
|
375
|
-
O as Interpolation,
|
|
376
|
-
P as Sequence,
|
|
377
|
-
M as Tween,
|
|
378
|
-
b as now
|
|
379
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import i from "./ascending.js";
|
|
2
|
-
function s(e) {
|
|
3
|
-
return e.length === 1 && (e = l(e)), {
|
|
4
|
-
left: function(f, u, n, t) {
|
|
5
|
-
for (n == null && (n = 0), t == null && (t = f.length); n < t; ) {
|
|
6
|
-
var r = n + t >>> 1;
|
|
7
|
-
e(f[r], u) < 0 ? n = r + 1 : t = r;
|
|
8
|
-
}
|
|
9
|
-
return n;
|
|
10
|
-
},
|
|
11
|
-
right: function(f, u, n, t) {
|
|
12
|
-
for (n == null && (n = 0), t == null && (t = f.length); n < t; ) {
|
|
13
|
-
var r = n + t >>> 1;
|
|
14
|
-
e(f[r], u) > 0 ? t = r : n = r + 1;
|
|
15
|
-
}
|
|
16
|
-
return n;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function l(e) {
|
|
21
|
-
return function(f, u) {
|
|
22
|
-
return i(e(f), u);
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export {
|
|
26
|
-
s as default
|
|
27
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
function r(n, t) {
|
|
2
|
-
var h = n.length, l = -1, i, f;
|
|
3
|
-
if (t == null) {
|
|
4
|
-
for (; ++l < h; )
|
|
5
|
-
if ((i = n[l]) != null && i >= i)
|
|
6
|
-
for (f = i; ++l < h; )
|
|
7
|
-
(i = n[l]) != null && i > f && (f = i);
|
|
8
|
-
} else
|
|
9
|
-
for (; ++l < h; )
|
|
10
|
-
if ((i = t(n[l], l, n)) != null && i >= i)
|
|
11
|
-
for (f = i; ++l < h; )
|
|
12
|
-
(i = t(n[l], l, n)) != null && i > f && (f = i);
|
|
13
|
-
return f;
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
r as default
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
function r(l, t) {
|
|
2
|
-
var h = l.length, n = -1, i, f;
|
|
3
|
-
if (t == null) {
|
|
4
|
-
for (; ++n < h; )
|
|
5
|
-
if ((i = l[n]) != null && i >= i)
|
|
6
|
-
for (f = i; ++n < h; )
|
|
7
|
-
(i = l[n]) != null && f > i && (f = i);
|
|
8
|
-
} else
|
|
9
|
-
for (; ++n < h; )
|
|
10
|
-
if ((i = t(l[n], n, l)) != null && i >= i)
|
|
11
|
-
for (f = i; ++n < h; )
|
|
12
|
-
(i = t(l[n], n, l)) != null && f > i && (f = i);
|
|
13
|
-
return f;
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
r as default
|
|
17
|
-
};
|