aptechka 0.5.44 → 0.7.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.
- package/lib/Animation-6Na1MCtM.cjs +1 -0
- package/lib/Animation-CELiTw3n.js +132 -0
- package/lib/Composed-DmLYTh1b.js +35 -0
- package/lib/Composed-Dx2hs-va.cjs +1 -0
- package/lib/{Damped-P4MkCGoY.js → Damped-Mx_FNNVz.js} +2 -5
- package/lib/Damped-loFiBsBy.cjs +1 -0
- package/lib/{Derived-kPJs5JC5.js → Derived-DlCvc0xQ.js} +1 -1
- package/lib/{Derived-B-g8dYgh.cjs → Derived-a6MDQEPY.cjs} +1 -1
- package/lib/ElementConstructor-CAZ2ra8m.cjs +1 -0
- package/lib/ElementConstructor-OYlPJf2L.js +366 -0
- package/lib/Resource-D3TQormz.cjs +1 -0
- package/lib/Resource-DIcoALGo.js +64 -0
- package/lib/{SourceManager-Q-PB-Rkh.js → SourceManager-Bz329f90.js} +1 -1
- package/lib/{SourceManager-vSlsMKUE.cjs → SourceManager-kxr5eUyL.cjs} +1 -1
- package/lib/Store-6s0YXK4o.cjs +1 -0
- package/lib/{Store-BQXXikps.js → Store-BI2xxXOA.js} +42 -42
- package/lib/Tweened-B_mclQ61.cjs +1 -0
- package/lib/Tweened-NE8M9onF.js +48 -0
- package/lib/{Viewport-DMB0dO-s.cjs → Viewport-CJeKnL5V.cjs} +1 -1
- package/lib/{Viewport-CFFhFKqX.js → Viewport-D9IL7kUQ.js} +1 -1
- package/lib/_createStore-Cf1MyeHa.cjs +1 -0
- package/lib/_createStore-Ck9bHolX.js +12 -0
- package/lib/accordion/AccordionElement.d.ts +3 -0
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +140 -104
- package/lib/animation/Animation.d.ts +10 -18
- package/lib/animation/Damped.d.ts +3 -5
- package/lib/animation/Tweened.d.ts +0 -2
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +31 -31
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +3 -3
- package/lib/checkbox/index.cjs +1 -1
- package/lib/checkbox/index.js +3 -3
- package/lib/class-linked-status/index.cjs +1 -1
- package/lib/class-linked-status/index.js +1 -1
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +3 -3
- package/lib/counter/index.d.ts +8 -0
- package/lib/{createStylesheet-DBCEbDjI.js → createStylesheet-CR_yi5tp.js} +1 -1
- package/lib/{createStylesheet-CqHU9_qv.cjs → createStylesheet-p23sZ7Ey.cjs} +1 -1
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.d.ts +1 -0
- package/lib/css-property/index.js +36 -32
- package/lib/dev/index.cjs +1 -1
- package/lib/dev/index.js +1 -1
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +1 -1
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.js +114 -113
- package/lib/en3/core/En3Raycaster.d.ts +20 -0
- package/lib/en3/core/En3View.d.ts +1 -1
- package/lib/en3/core/en3.d.ts +5 -1
- package/lib/en3/helpers/En3Controls.d.ts +5 -0
- package/lib/en3/helpers/En3GridHelper.d.ts +8 -0
- package/lib/en3/helpers/En3Object3dManager.d.ts +12 -0
- package/lib/en3/helpers/En3OrbitControls.d.ts +8 -0
- package/lib/en3/helpers/En3TransformControls.d.ts +8 -0
- package/lib/en3/helpers/index.cjs +1 -0
- package/lib/en3/helpers/index.d.ts +2 -0
- package/lib/en3/helpers/index.js +1165 -0
- package/lib/en3/index.cjs +1 -213
- package/lib/en3/index.d.ts +1 -19
- package/lib/en3/index.js +4 -3305
- package/lib/en3/libs/index.d.ts +1 -0
- package/lib/en3/loaders/{en3GLTFLoader.d.ts → _En3GLTFLoader.d.ts} +2 -4
- package/lib/en3/loaders/_En3TextureLoader.d.ts +8 -0
- package/lib/en3/loaders/index.cjs +1 -0
- package/lib/en3/loaders/index.d.ts +3 -0
- package/lib/en3/loaders/index.js +1757 -0
- package/lib/en3/loaders/loaders.d.ts +13 -0
- package/lib/en3/misc/index.cjs +10 -0
- package/lib/en3/misc/index.d.ts +2 -0
- package/lib/en3/misc/index.js +115 -0
- package/lib/en3/objects/En3Clip.d.ts +1 -1
- package/lib/en3/objects/En3GLTF.d.ts +2 -1
- package/lib/en3/objects/En3ImageLike.d.ts +2 -1
- package/lib/en3/objects/En3SourceConsumer.d.ts +1 -1
- package/lib/en3/objects/fluid/index.d.ts +0 -3
- package/lib/en3/objects/index.d.ts +7 -0
- package/lib/en3/utils/index.cjs +1 -0
- package/lib/en3/utils/index.d.ts +5 -0
- package/lib/en3/utils/index.js +43 -0
- package/lib/en3-C4mzaF6q.cjs +8 -0
- package/lib/en3-hbkN1OPu.js +343 -0
- package/lib/globals-DMjysUXI.js +8 -0
- package/lib/globals-bYKki-b9.cjs +1 -0
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +1 -1
- package/lib/{index-BN9X-l9M.js → index-BAH_fO2N.js} +3 -3
- package/lib/{index-BbgmbQ-5.cjs → index-D1LQUR-R.cjs} +1 -1
- package/lib/instantiate-D19Uvc31.js +125 -0
- package/lib/instantiate-Db5gGSYG.cjs +1 -0
- package/lib/jsx/ComponentElement.d.ts +18 -0
- package/lib/jsx/globals.d.ts +13 -0
- package/lib/jsx/h.d.ts +7 -0
- package/lib/jsx/hooks/basic/_createStore.d.ts +4 -0
- package/lib/jsx/hooks/basic/attachInternals.d.ts +1 -0
- package/lib/jsx/hooks/basic/attachShadow.d.ts +1 -0
- package/lib/jsx/hooks/basic/attachStylesheet.d.ts +3 -0
- package/lib/jsx/hooks/basic/createContext.d.ts +2 -0
- package/lib/jsx/hooks/basic/onConnect.d.ts +3 -0
- package/lib/jsx/hooks/basic/onDisconnect.d.ts +3 -0
- package/lib/jsx/hooks/onAnimationFrame.cjs +1 -0
- package/lib/jsx/hooks/onAnimationFrame.d.ts +6 -0
- package/lib/jsx/hooks/onAnimationFrame.js +22 -0
- package/lib/jsx/hooks/onElementResize.cjs +1 -0
- package/lib/jsx/hooks/onElementResize.d.ts +5 -0
- package/lib/jsx/hooks/onElementResize.js +11 -0
- package/lib/jsx/hooks/onIntersection.cjs +1 -0
- package/lib/jsx/hooks/onIntersection.d.ts +5 -0
- package/lib/jsx/hooks/onIntersection.js +11 -0
- package/lib/jsx/hooks/onWindowResize.cjs +1 -0
- package/lib/jsx/hooks/onWindowResize.d.ts +3 -0
- package/lib/jsx/hooks/onWindowResize.js +8 -0
- package/lib/jsx/hooks/store/createArrayStore.d.ts +3 -0
- package/lib/jsx/hooks/store/createComposed.d.ts +3 -0
- package/lib/jsx/hooks/store/createDerived.d.ts +3 -0
- package/lib/jsx/hooks/store/createDerivedArray.d.ts +3 -0
- package/lib/jsx/hooks/store/createDerivedComponent.d.ts +3 -0
- package/lib/jsx/hooks/store/createDerivedComponents.d.ts +3 -0
- package/lib/jsx/hooks/store/createResource.d.ts +3 -0
- package/lib/jsx/hooks/store/createStore.d.ts +3 -0
- package/lib/jsx/hooks/store/index.cjs +1 -0
- package/lib/jsx/hooks/store/index.d.ts +7 -0
- package/lib/jsx/hooks/store/index.js +49 -0
- package/lib/jsx/hooks/watchAttribute.cjs +1 -0
- package/lib/jsx/hooks/watchAttribute.d.ts +6 -0
- package/lib/jsx/hooks/watchAttribute.js +17 -0
- package/lib/jsx/hooks/watchCSSProperty.cjs +1 -0
- package/lib/jsx/hooks/watchCSSProperty.d.ts +7 -0
- package/lib/jsx/hooks/watchCSSProperty.js +17 -0
- package/lib/jsx/index.cjs +1 -0
- package/lib/jsx/index.d.ts +13 -0
- package/lib/jsx/index.js +91 -0
- package/lib/jsx/instantiate.d.ts +5 -0
- package/lib/jsx/register.d.ts +1 -0
- package/lib/jsx/render.d.ts +6 -0
- package/lib/jsx/type.d.ts +188 -0
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.d.ts +2 -0
- package/lib/ladder/index.js +84 -66
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.d.ts +9 -0
- package/lib/layout-box/index.js +190 -164
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +1 -1
- package/lib/modal/index.cjs +1 -1
- package/lib/modal/index.js +7 -7
- package/lib/morph/Morph.d.ts +2 -2
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.d.ts +1 -1
- package/lib/morph/index.js +135 -143
- package/lib/notifier/index.d.ts +2 -2
- package/lib/notifier/index.js +3 -1
- package/lib/onConnect-DGP866cj.cjs +1 -0
- package/lib/onConnect-y5DrxJ9P.js +7 -0
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +2 -2
- package/lib/polyfills-CM4SCDTt.cjs +1 -0
- package/lib/polyfills-X6KXuHg-.js +33 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +2 -2
- package/lib/router/Router.d.ts +11 -3
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.d.ts +1 -1
- package/lib/router/index.js +185 -165
- package/lib/scroll/ScrollElement.d.ts +2 -19
- package/lib/scroll/ScrollSection.d.ts +23 -0
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +81 -77
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +1 -1
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +2 -2
- package/lib/store/ArrayStore.d.ts +21 -0
- package/lib/store/Store.d.ts +1 -7
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.d.ts +2 -2
- package/lib/store/index.js +65 -139
- package/lib/tags-BqJKcIve.js +485 -0
- package/lib/tags-ld5jemJw.cjs +1 -0
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.js +2 -2
- package/lib/tweaker/TweakerBooleanManagerElement.d.ts +1 -1
- package/lib/tweaker/TweakerColorManagerElement.d.ts +1 -1
- package/lib/tweaker/TweakerFolderElement.d.ts +2 -0
- package/lib/tweaker/TweakerLinkManagerElement.d.ts +1 -1
- package/lib/tweaker/TweakerNumberManagerElement.d.ts +4 -8
- package/lib/tweaker/TweakerSelectManagerElement.d.ts +1 -1
- package/lib/tweaker/TweakerStoreManagerElement.d.ts +7 -7
- package/lib/tweaker/TweakerStringManagerElement.d.ts +3 -5
- package/lib/tweaker/index.cjs +3 -3
- package/lib/tweaker/index.js +535 -412
- package/lib/tweaker/tweakerManagerConstructors.d.ts +2 -2
- package/lib/tweaker/tweakerStorage.d.ts +8 -1
- package/lib/url-C3dWnJQg.cjs +1 -0
- package/lib/url-DMNfW7uN.js +22 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +39 -34
- package/lib/utils/number.d.ts +1 -0
- package/lib/utils/url.d.ts +9 -0
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +1 -1
- package/package.json +107 -3
- package/lib/Animation-DDHjrbtL.cjs +0 -1
- package/lib/Animation-Dq_05jlR.js +0 -217
- package/lib/DRACOLoader-C2CFpMGS.cjs +0 -2
- package/lib/DRACOLoader-D2KY2dku.js +0 -241
- package/lib/Damped-l0mnlhar.cjs +0 -1
- package/lib/KTX2Loader-DdUl1XiY.cjs +0 -2
- package/lib/KTX2Loader-DqpAffDj.js +0 -536
- package/lib/Store-C-1ruEIm.cjs +0 -1
- package/lib/Tweened-CwDC2zl8.js +0 -51
- package/lib/Tweened-DIt9j9B-.cjs +0 -1
- package/lib/animation/AnimationLink.d.ts +0 -13
- package/lib/en3/loaders/en3TextureLoader.d.ts +0 -3
- package/lib/en3/test/En3HTML.d.ts +0 -10
- package/lib/polyfills-BA-CL_HF.js +0 -27
- package/lib/polyfills-DHs2SNbz.cjs +0 -1
- package/lib/store/CumulativeResource.d.ts +0 -13
- package/lib/tags-CMPg9ETZ.js +0 -848
- package/lib/tags-Djb6mb1o.cjs +0 -1
- package/lib/tweaker/TweakerRangeManagerElement.d.ts +0 -11
- /package/lib/en3/{loaders → core}/en3Cache.d.ts +0 -0
- /package/lib/{MeshoptDecoder-CMeN3oU0.cjs → en3/libs/index.cjs} +0 -0
- /package/lib/{MeshoptDecoder-6XfTpOG2.js → en3/libs/index.js} +0 -0
- /package/lib/en3/{test → misc}/En3ModifiedMaterial.d.ts +0 -0
- /package/lib/en3/{attachments → misc}/En3SourceManager.d.ts +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
|
|
2
|
+
import { KTX2Loader } from 'three/examples/jsm/loaders/KTX2Loader.js';
|
|
3
|
+
import { MeshoptDecoder } from '../libs/MeshoptDecoder';
|
|
4
|
+
import { En3GLTFLoader } from './_En3GLTFLoader';
|
|
5
|
+
import { En3TextureLoader } from './_En3TextureLoader';
|
|
6
|
+
|
|
7
|
+
export declare const loaders: {
|
|
8
|
+
gltfLoader: En3GLTFLoader;
|
|
9
|
+
textureLoader: En3TextureLoader;
|
|
10
|
+
dracoLoader: DRACOLoader;
|
|
11
|
+
ktx2Loader: KTX2Loader;
|
|
12
|
+
meshoptDecoder: ReturnType<typeof MeshoptDecoder>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";var D=(o,e,t)=>{if(!e.has(o))throw TypeError("Cannot "+t)};var i=(o,e,t)=>(D(o,e,"read from private field"),t?t.call(o):e.get(o)),s=(o,e,t)=>{if(e.has(o))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(o):e.set(o,t)},c=(o,e,t,r)=>(D(o,e,"write to private field"),r?r.call(o,t):e.set(o,t),t);var L=(o,e,t)=>(D(o,e,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("../../loading/index.cjs"),y=require("../../SourceManager-kxr5eUyL.cjs"),b=require("../../Store-6s0YXK4o.cjs");var u,l,v,k;class z{constructor(e){s(this,v);s(this,u,void 0);s(this,l,void 0);c(this,u,e.material),c(this,l,e.uniforms||{}),i(this,u).userData.uniforms=i(this,l);let t;const r=()=>{t==null||t()};i(this,u).addEventListener("dispose",r),i(this,u).onBeforeCompile=n=>{var d;t==null||t();for(const R in i(this,l))n.uniforms[R]=i(this,l)[R];e.vertextDeclarations&&(n.vertexShader=`
|
|
2
|
+
${e.vertextDeclarations}
|
|
3
|
+
${n.vertexShader}
|
|
4
|
+
`),e.fragmentDeclarations&&(n.fragmentShader=`
|
|
5
|
+
${e.fragmentDeclarations}
|
|
6
|
+
${n.fragmentShader}
|
|
7
|
+
`),L(this,v,k).call(this,n,"vertex",e),L(this,v,k).call(this,n,"fragment",e),t=(d=e.onReady)==null?void 0:d.call(e,this),e.log&&(console.log("VERTEX SHADER: ",n.vertexShader),console.log("FRAGMENT SHADER: ",n.fragmentShader))}}get material(){return i(this,u)}get uniforms(){return i(this,l)}}u=new WeakMap,l=new WeakMap,v=new WeakSet,k=function(e,t,r){const n=t==="vertex"?"vertexChunk":"fragmentChunk",d=t==="vertex"?"vertexShader":"fragmentShader";r[n]&&(r[n].replace?e[d]=e[d].replace(`#include <${r[n].replace}>`,r[n].content):r[n].update&&(e[d]=e[d].replace(`#include <${r[n].update}>`,`
|
|
8
|
+
#include <${r[n].update}>
|
|
9
|
+
${r[n].content}
|
|
10
|
+
`)))};var f,a,g,x,E,h,S,M;class T extends y.SourceManager{constructor(t){super(t);s(this,f,new b.Store(null));s(this,a,new b.Store(void 0));s(this,g,void 0);s(this,x,void 0);s(this,E,void 0);s(this,h,void 0);s(this,S,!1);s(this,M,()=>{if(!(i(this,h)&&!i(this,S))&&(this.current!==this.previous&&(i(this,f).current=null),this.current)){const t=i(this,E)?this.current.url:this.current.name+this.current.extension;i(this,h)||$.loading.setTotal(t,1),i(this,a).current="start",i(this,x).load(t,r=>{var n;i(this,f).current=((n=this.processData)==null?void 0:n.call(this,r))||r,i(this,a).current="complete",i(this,h)||$.loading.setLoaded(t,1)},void 0,()=>{i(this,h)||(i(this,a).current="error",$.loading.setError(t,t))})}});c(this,g,t.consumer),c(this,x,t.loader),c(this,E,t.keepSourceParameters||!1),c(this,h,t.lazy||!1),this.subscribe(i(this,M)),i(this,g).addEventListener("added",()=>{this.connect()}),i(this,g).addEventListener("removed",()=>{this.disconnect()})}get data(){return i(this,f)}get loading(){return i(this,a)}lazyLoad(){i(this,S)||(c(this,S,!0),i(this,M).call(this))}}f=new WeakMap,a=new WeakMap,g=new WeakMap,x=new WeakMap,E=new WeakMap,h=new WeakMap,S=new WeakMap,M=new WeakMap;exports.En3ModifiedMaterial=z;exports.En3SourceManager=T;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { En3ModifiedMaterial, type En3ModifiedMaterialParameters, type En3ModifiedMaterialUniforms, type En3FragmentChunk, type En3VertexChunk, } from './En3ModifiedMaterial';
|
|
2
|
+
export { En3SourceManager, type En3SourceManagerLoader, type En3SourceManagerFullParameters, type En3SourceManagerParameters, type En3SourceManagerLoadingState, } from './En3SourceManager';
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
var m = (o, i, t) => {
|
|
2
|
+
if (!i.has(o))
|
|
3
|
+
throw TypeError("Cannot " + t);
|
|
4
|
+
};
|
|
5
|
+
var e = (o, i, t) => (m(o, i, "read from private field"), t ? t.call(o) : i.get(o)), r = (o, i, t) => {
|
|
6
|
+
if (i.has(o))
|
|
7
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
+
i instanceof WeakSet ? i.add(o) : i.set(o, t);
|
|
9
|
+
}, c = (o, i, t, s) => (m(o, i, "write to private field"), s ? s.call(o, t) : i.set(o, t), t);
|
|
10
|
+
var L = (o, i, t) => (m(o, i, "access private method"), t);
|
|
11
|
+
import { loading as $ } from "../../loading/index.js";
|
|
12
|
+
import { S as z } from "../../SourceManager-Bz329f90.js";
|
|
13
|
+
import { S as R } from "../../Store-BI2xxXOA.js";
|
|
14
|
+
var h, u, S, k;
|
|
15
|
+
class b {
|
|
16
|
+
constructor(i) {
|
|
17
|
+
r(this, S);
|
|
18
|
+
r(this, h, void 0);
|
|
19
|
+
r(this, u, void 0);
|
|
20
|
+
c(this, h, i.material), c(this, u, i.uniforms || {}), e(this, h).userData.uniforms = e(this, u);
|
|
21
|
+
let t;
|
|
22
|
+
const s = () => {
|
|
23
|
+
t == null || t();
|
|
24
|
+
};
|
|
25
|
+
e(this, h).addEventListener("dispose", s), e(this, h).onBeforeCompile = (n) => {
|
|
26
|
+
var f;
|
|
27
|
+
t == null || t();
|
|
28
|
+
for (const M in e(this, u))
|
|
29
|
+
n.uniforms[M] = e(this, u)[M];
|
|
30
|
+
i.vertextDeclarations && (n.vertexShader = `
|
|
31
|
+
${i.vertextDeclarations}
|
|
32
|
+
${n.vertexShader}
|
|
33
|
+
`), i.fragmentDeclarations && (n.fragmentShader = `
|
|
34
|
+
${i.fragmentDeclarations}
|
|
35
|
+
${n.fragmentShader}
|
|
36
|
+
`), L(this, S, k).call(this, n, "vertex", i), L(this, S, k).call(this, n, "fragment", i), t = (f = i.onReady) == null ? void 0 : f.call(i, this), i.log && (console.log("VERTEX SHADER: ", n.vertexShader), console.log("FRAGMENT SHADER: ", n.fragmentShader));
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
get material() {
|
|
40
|
+
return e(this, h);
|
|
41
|
+
}
|
|
42
|
+
get uniforms() {
|
|
43
|
+
return e(this, u);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
h = new WeakMap(), u = new WeakMap(), S = new WeakSet(), k = function(i, t, s) {
|
|
47
|
+
const n = t === "vertex" ? "vertexChunk" : "fragmentChunk", f = t === "vertex" ? "vertexShader" : "fragmentShader";
|
|
48
|
+
s[n] && (s[n].replace ? i[f] = i[f].replace(
|
|
49
|
+
`#include <${s[n].replace}>`,
|
|
50
|
+
s[n].content
|
|
51
|
+
) : s[n].update && (i[f] = i[f].replace(
|
|
52
|
+
`#include <${s[n].update}>`,
|
|
53
|
+
`
|
|
54
|
+
#include <${s[n].update}>
|
|
55
|
+
${s[n].content}
|
|
56
|
+
`
|
|
57
|
+
)));
|
|
58
|
+
};
|
|
59
|
+
var a, d, g, x, E, l, v, D;
|
|
60
|
+
class w extends z {
|
|
61
|
+
constructor(t) {
|
|
62
|
+
super(t);
|
|
63
|
+
r(this, a, new R(null));
|
|
64
|
+
r(this, d, new R(void 0));
|
|
65
|
+
r(this, g, void 0);
|
|
66
|
+
r(this, x, void 0);
|
|
67
|
+
r(this, E, void 0);
|
|
68
|
+
r(this, l, void 0);
|
|
69
|
+
r(this, v, !1);
|
|
70
|
+
r(this, D, () => {
|
|
71
|
+
if (!(e(this, l) && !e(this, v)) && (this.current !== this.previous && (e(this, a).current = null), this.current)) {
|
|
72
|
+
const t = e(this, E) ? this.current.url : this.current.name + this.current.extension;
|
|
73
|
+
e(this, l) || $.setTotal(t, 1), e(this, d).current = "start", e(this, x).load(
|
|
74
|
+
t,
|
|
75
|
+
(s) => {
|
|
76
|
+
var n;
|
|
77
|
+
e(this, a).current = ((n = this.processData) == null ? void 0 : n.call(this, s)) || s, e(this, d).current = "complete", e(this, l) || $.setLoaded(t, 1);
|
|
78
|
+
},
|
|
79
|
+
void 0,
|
|
80
|
+
() => {
|
|
81
|
+
e(this, l) || (e(this, d).current = "error", $.setError(t, t));
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
c(this, g, t.consumer), c(this, x, t.loader), c(this, E, t.keepSourceParameters || !1), c(this, l, t.lazy || !1), this.subscribe(e(this, D)), e(this, g).addEventListener("added", () => {
|
|
87
|
+
this.connect();
|
|
88
|
+
}), e(this, g).addEventListener("removed", () => {
|
|
89
|
+
this.disconnect();
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Resource store.
|
|
94
|
+
*/
|
|
95
|
+
get data() {
|
|
96
|
+
return e(this, a);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Loading store.
|
|
100
|
+
*/
|
|
101
|
+
get loading() {
|
|
102
|
+
return e(this, d);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Calling this method will start loading the resource.
|
|
106
|
+
*/
|
|
107
|
+
lazyLoad() {
|
|
108
|
+
e(this, v) || (c(this, v, !0), e(this, D).call(this));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
a = new WeakMap(), d = new WeakMap(), g = new WeakMap(), x = new WeakMap(), E = new WeakMap(), l = new WeakMap(), v = new WeakMap(), D = new WeakMap();
|
|
112
|
+
export {
|
|
113
|
+
b as En3ModifiedMaterial,
|
|
114
|
+
w as En3SourceManager
|
|
115
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Group } from 'three';
|
|
2
2
|
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
3
|
+
import { En3SourceManager, En3SourceManagerParameters } from '../misc/En3SourceManager';
|
|
3
4
|
import { En3SourceConsumer } from './En3SourceConsumer';
|
|
4
|
-
import { En3SourceManager, En3SourceManagerParameters } from '../attachments/En3SourceManager';
|
|
5
5
|
|
|
6
6
|
export declare class En3GLTF extends Group implements En3SourceConsumer<GLTF> {
|
|
7
7
|
#private;
|
|
8
8
|
constructor(parameters: En3SourceManagerParameters<GLTF>);
|
|
9
9
|
get sourceManager(): En3SourceManager<GLTF>;
|
|
10
|
+
destroy(): void;
|
|
10
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BufferGeometry, Material, Mesh, Texture } from 'three';
|
|
2
|
-
import { En3SourceManager, En3SourceManagerLoader, En3SourceManagerParameters } from '../
|
|
2
|
+
import { En3SourceManager, En3SourceManagerLoader, En3SourceManagerParameters } from '../misc/En3SourceManager';
|
|
3
3
|
import { En3SourceConsumer } from './En3SourceConsumer';
|
|
4
4
|
|
|
5
5
|
export type En3ImageLikeMaterial<TTexture extends Texture> = Material & {
|
|
@@ -19,6 +19,7 @@ export declare class En3ImageLike<TTexture extends Texture, TMaterial extends En
|
|
|
19
19
|
#private;
|
|
20
20
|
constructor(parameters: En3ImageLikeParameters<TTexture, TMaterial>);
|
|
21
21
|
get sourceManager(): En3SourceManager<TTexture>;
|
|
22
|
+
destroy(): void;
|
|
22
23
|
updateTexture(): void;
|
|
23
24
|
protected onCoverResize(texture: TTexture): void;
|
|
24
25
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { En3Fluid, En3FluidElement, en3FluidPointer } from './fluid';
|
|
2
|
+
export { En3Clip, type En3ClipOptions } from './En3Clip';
|
|
3
|
+
export { En3ClipHelpers } from './En3ClipHelpers';
|
|
4
|
+
export { En3GLTF } from './En3GLTF';
|
|
5
|
+
export { En3Image, type En3ImageParameters } from './En3Image';
|
|
6
|
+
export { En3ImageLike, type En3ImageLikeParameters, type En3ImageLikeMaterial, type En3ImageLikeFit, } from './En3ImageLike';
|
|
7
|
+
export { En3Video, type En3VideoParameters } from './En3Video';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../../en3-C4mzaF6q.cjs"),c=require("three");function y(e,s,t){const r=s.x,a=s.y,o=t||e.image.width/e.image.height;let i=0,n=0,f=e.offset.x,h=e.offset.y,g=e.rotation,v=e.center.x,w=e.center.y;r/a>o?(i=1,n=a/r*o):(n=1,i=r/a/o),e.matrix.setUvTransform(f,h,i,n,g,v,w)}const l=new c.Vector3,p=new c.Vector3;function u(e,s="default"){const t=m.en3.getView(s),{width:r,height:a}=m.en3,o=r/a;e instanceof c.Vector3?l.copy(e):l.set(...e);const i=t.camera.getWorldPosition(p).distanceTo(l);if(t.camera instanceof c.OrthographicCamera)return{width:r/t.camera.zoom,height:a/t.camera.zoom,factor:1,distance:i,aspect:o};{const n=t.camera.fov*Math.PI/180,f=2*Math.tan(n/2)*i,h=f*(r/a);return{width:h,height:f,factor:r/h,distance:i,aspect:o}}}function M(e,s){e.traverse(t=>{t instanceof c.Mesh&&t.material&&(Array.isArray(t.material)?t.material:[t.material]).forEach(s)})}function d(e,s){e.traverse(t=>{t instanceof c.Mesh&&s(t)})}exports.dispose=m.dispose;exports.coverTexture=y;exports.getCurrentViewport=u;exports.traverseMaterials=M;exports.traverseMeshes=d;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { e as l } from "../../en3-hbkN1OPu.js";
|
|
2
|
+
import { d as z } from "../../en3-hbkN1OPu.js";
|
|
3
|
+
import { Vector3 as h, OrthographicCamera as y, Mesh as p } from "three";
|
|
4
|
+
function x(t, o, e) {
|
|
5
|
+
const a = o.x, s = o.y, r = e || t.image.width / t.image.height;
|
|
6
|
+
let i = 0, c = 0, n = t.offset.x, f = t.offset.y, w = t.rotation, g = t.center.x, v = t.center.y;
|
|
7
|
+
a / s > r ? (i = 1, c = s / a * r) : (c = 1, i = a / s / r), t.matrix.setUvTransform(n, f, i, c, w, g, v);
|
|
8
|
+
}
|
|
9
|
+
const m = new h(), d = new h();
|
|
10
|
+
function V(t, o = "default") {
|
|
11
|
+
const e = l.getView(o), { width: a, height: s } = l, r = a / s;
|
|
12
|
+
t instanceof h ? m.copy(t) : m.set(...t);
|
|
13
|
+
const i = e.camera.getWorldPosition(d).distanceTo(m);
|
|
14
|
+
if (e.camera instanceof y)
|
|
15
|
+
return {
|
|
16
|
+
width: a / e.camera.zoom,
|
|
17
|
+
height: s / e.camera.zoom,
|
|
18
|
+
factor: 1,
|
|
19
|
+
distance: i,
|
|
20
|
+
aspect: r
|
|
21
|
+
};
|
|
22
|
+
{
|
|
23
|
+
const c = e.camera.fov * Math.PI / 180, n = 2 * Math.tan(c / 2) * i, f = n * (a / s);
|
|
24
|
+
return { width: f, height: n, factor: a / f, distance: i, aspect: r };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function u(t, o) {
|
|
28
|
+
t.traverse((e) => {
|
|
29
|
+
e instanceof p && e.material && (Array.isArray(e.material) ? e.material : [e.material]).forEach(o);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function A(t, o) {
|
|
33
|
+
t.traverse((e) => {
|
|
34
|
+
e instanceof p && o(e);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
x as coverTexture,
|
|
39
|
+
z as dispose,
|
|
40
|
+
V as getCurrentViewport,
|
|
41
|
+
u as traverseMaterials,
|
|
42
|
+
A as traverseMeshes
|
|
43
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";var he=Object.defineProperty,ae=Object.defineProperties;var ce=Object.getOwnPropertyDescriptors;var X=Object.getOwnPropertySymbols;var le=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;var Z=(n,e,i)=>e in n?he(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i,O=(n,e)=>{for(var i in e||(e={}))le.call(e,i)&&Z(n,i,e[i]);if(X)for(var i of X(e))de.call(e,i)&&Z(n,i,e[i]);return n},J=(n,e)=>ae(n,ce(e));var Q=(n,e,i)=>{if(!e.has(n))throw TypeError("Cannot "+i)};var t=(n,e,i)=>(Q(n,e,"read from private field"),i?i.call(n):e.get(n)),s=(n,e,i)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,i)},r=(n,e,i,a)=>(Q(n,e,"write to private field"),a?a.call(n,i):e.set(n,i),i);const ee=require("./order/index.cjs"),te=require("./window-resizer/index.cjs"),ie=require("./ticker/index.cjs"),re=require("./dom-JBOkFLTh.cjs"),E=require("three"),se=require("./layout-box/index.cjs");function ne(n){const e=i=>{i.dispose();for(const a of Object.keys(i)){const c=i[a];c&&typeof c=="object"&&"minFilter"in c&&c.dispose()}};n.traverse(i=>{if(i instanceof E.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 L,l,p,y,x,C,w,R;class G{constructor(e,i){s(this,L,void 0);s(this,l,void 0);s(this,p,void 0);s(this,y,void 0);s(this,x,void 0);s(this,C,void 0);s(this,w,void 0);s(this,R,void 0);r(this,L,e),r(this,l,(i==null?void 0:i.cameraType)==="orthographic"?new E.OrthographicCamera:new E.PerspectiveCamera),r(this,p,new E.Scene),r(this,y,[]),r(this,x,(i==null?void 0:i.cameraDistance)||1e3),t(this,l).near=(i==null?void 0:i.cameraNear)||1,t(this,l).far=(i==null?void 0:i.cameraFar)||11e3,r(this,C,(i==null?void 0:i.cameraFov)||"auto"),t(this,l).position.z=t(this,x),t(this,l).name=`Cameras.${t(this,L)}`,r(this,w,re.getElement(i==null?void 0:i.sizeElement)||document.documentElement),this.beforeRenderCallback=i==null?void 0:i.beforeRender,r(this,R,new se.LayoutBox(t(this,w))),t(this,R).onResize(()=>{this.resize()})}get name(){return t(this,L)}get camera(){return t(this,l)}get scene(){return t(this,p)}get box(){return t(this,R)}get cameraDistance(){return t(this,x)}set cameraDistance(e){r(this,x,e),this.resize()}get sizeElement(){return t(this,w)}get isClipped(){return t(this,w)!==m.containerElement}resize(){const{width:e,height:i}=t(this,R);t(this,l).userData.controlled||(t(this,l).position.z=t(this,x)),t(this,l)instanceof E.PerspectiveCamera?(t(this,l).aspect=e/i,t(this,l).fov=t(this,C)==="auto"?2*Math.atan(i/2/t(this,x))*(180/Math.PI):t(this,C)):t(this,l)instanceof E.OrthographicCamera&&(t(this,l).left=e/-2,t(this,l).right=e/2,t(this,l).top=i/2,t(this,l).bottom=i/-2),t(this,l).updateProjectionMatrix()}destroy(){t(this,y).forEach(e=>{e.userData.box.destroy()}),t(this,p).clear(),ne(t(this,p)),m.destroyView(this.name),t(this,R).destroy()}attachToHTMLElement(e,i,a){const c=new se.LayoutBox(e,J(O({},a),{containerElement:t(this,w),cartesian:!0,scrollStep:!this.isClipped}));return c.bindObject(i),i.userData.box=c,t(this,y).push(i),i}detachFromHTMLElement(e){r(this,y,t(this,y).filter(i=>i===e?(e.userData.box.destroy(),!1):!0))}add(...e){const i=e[0],a=e[1],c=e[2];return a&&this.attachToHTMLElement(a,i,c),this.scene.add(i),i}remove(e,i){this.scene.remove(e),i&&this.detachFromHTMLElement(e)}}L=new WeakMap,l=new WeakMap,p=new WeakMap,y=new WeakMap,x=new WeakMap,C=new WeakMap,w=new WeakMap,R=new WeakMap;const W=new Map;var v,P,k,D,j;class oe{constructor(e){s(this,v,void 0);s(this,P,void 0);s(this,k,void 0);s(this,D,void 0);s(this,j,void 0);r(this,v,e.targetName||void 0),r(this,P,e.eventDispatcher||e.object3D),r(this,k,e.propagation||!1),r(this,D,e.object3D),r(this,j,t(this,v)?()=>t(this,D).getObjectByName(t(this,v))||t(this,D):()=>t(this,D))}get object3D(){return t(this,D)}get eventDispatcher(){return t(this,P)}get propagation(){return t(this,k)}get target(){return t(this,j).call(this)}dispatch(e,i){this.eventDispatcher.dispatchEvent(O({originalEvent:i,type:e},this.intersection))}}v=new WeakMap,P=new WeakMap,k=new WeakMap,D=new WeakMap,j=new WeakMap;var f,o,T,A,F,N,q;class ue{constructor(){s(this,f,[]);s(this,o,[]);s(this,T,new E.Vector2);s(this,A,new E.Raycaster);s(this,F,e=>{for(let i=0;i<t(this,o).length;i++)t(this,o)[i].dispatch("pointerDown",e)});s(this,N,e=>{for(let i=0;i<t(this,o).length;i++)t(this,o)[i].dispatch("pointerUp",e)});s(this,q,e=>{if(!t(this,f).length)return;t(this,T).x=e.clientX/m.width*2-1,t(this,T).y=-(e.clientY/m.height)*2+1,m.camera&&t(this,A).setFromCamera(t(this,T),m.camera);const i=[];for(const h of t(this,f)){const b=t(this,A).intersectObject(h.target);b.length&&(h.intersection=b[0],i.push(h))}let a=!1;const c=t(this,o).filter(h=>!i.find(b=>b.object3D.uuid===h.object3D.uuid)),K=i.sort((h,b)=>b.object3D.position.z-h.object3D.position.z).filter((h,b)=>a?(c.push(h),!1):(a=!h.propagation,!0)),U=K.filter(h=>!t(this,o).find(b=>b.object3D.uuid===h.object3D.uuid));for(let h=0;h<c.length;h++)c[h].dispatch("pointerLeave",e);for(let h=0;h<U.length;h++)U[h].dispatch("pointerEnter",e);r(this,o,K);for(let h=0;h<t(this,o).length;h++)t(this,o)[h].dispatch("pointerMove",e)});m.containerElement.addEventListener("pointerdown",t(this,F)),m.containerElement.addEventListener("pointerup",t(this,N)),m.containerElement.addEventListener("pointermove",t(this,q))}destroy(){m.containerElement.removeEventListener("pointerdown",t(this,F)),m.containerElement.removeEventListener("pointerup",t(this,N)),m.containerElement.removeEventListener("pointermove",t(this,q)),r(this,f,[]),r(this,o,[])}add(e,i){if(t(this,f).find(c=>c.object3D.uuid===e.uuid))return;const a=new oe(O({object3D:e},i));t(this,f).push(a)}remove(e){r(this,f,t(this,f).filter(i=>i.object3D.uuid!==e.uuid)),r(this,o,t(this,o).filter(i=>i.object3D.uuid!==e.uuid))}}f=new WeakMap,o=new WeakMap,T=new WeakMap,A=new WeakMap,F=new WeakMap,N=new WeakMap,q=new WeakMap;var $,g,d,V,u,M,S,H,I,z,_,B,Y;class me{constructor(){s(this,$,`https://unpkg.com/three@0.${E.REVISION}.x`);s(this,g,null);s(this,d,null);s(this,V,null);s(this,u,new Map);s(this,M,0);s(this,S,0);s(this,H,0);s(this,I,2);s(this,z,!1);s(this,_,!1);s(this,B,()=>{r(this,M,t(this,g).clientWidth),r(this,S,t(this,g).clientHeight),r(this,H,Math.min(t(this,I),devicePixelRatio||1)),t(this,d).setPixelRatio(t(this,H)),t(this,d).setSize(t(this,M),t(this,S))});s(this,Y,()=>{t(this,d).setRenderTarget(null),t(this,u).forEach(e=>{this.render(e)})})}get CDNVersion(){return t(this,$)}get containerElement(){return t(this,g)}get webglRenderer(){return t(this,d)}get raycaster(){return t(this,V)}get views(){return t(this,u)}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,S)}get pixelRatio(){return t(this,H)}get cacheAssets(){return t(this,_)}setup(e){if(t(this,z)){console.warn("[en3.setup]: You are trying to setup en3 again.");return}r(this,g,re.getElement(e==null?void 0:e.containerElement)||document.body),r(this,I,(e==null?void 0:e.maxPixelRatio)||2),r(this,d,new E.WebGLRenderer(e==null?void 0:e.webGLRendererParameters)),t(this,d).domElement.style.cssText=`
|
|
2
|
+
position: fixed;
|
|
3
|
+
left: 0;
|
|
4
|
+
top: 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
z-index: ${(e==null?void 0:e.zIndex)||0};
|
|
8
|
+
`,(t(this,g).shadowRoot||t(this,g)).append(t(this,d).domElement),t(this,u).set("default",new G("default",O({sizeElement:t(this,g)},e==null?void 0:e.view))),r(this,V,new ue),r(this,_,(e==null?void 0:e.cacheAssets)||!1),r(this,z,!0),te.windowResizer.subscribe(t(this,B),ee.RESIZE_ORDER.EN3),ie.ticker.subscribe(t(this,Y),{order:ee.TICK_ORDER.EN3})}destroy(){if(!t(this,z)){console.warn("[en3.setup]: You are trying to destory en3 but it has not been initialized.");return}te.windowResizer.unsubscribe(t(this,B)),ie.ticker.unsubscribe(t(this,Y)),t(this,V).destroy(),t(this,u).forEach(e=>{e.destroy()}),t(this,d).dispose(),t(this,d).domElement.remove(),r(this,d,null),r(this,z,!1),W.forEach(e=>{e.dispose()}),W.clear()}createView(e,i){const a=t(this,u).size,c=new G(e,i);return t(this,u).set(e,c),a===1&&t(this,d).setScissorTest(!0),c}getView(e){return t(this,u).get(e)}destroyView(e){const i=t(this,u).get(e);i&&(t(this,u).delete(e),i.destroy(),t(this,u).size<=1&&t(this,d).setScissorTest(!1))}render(e){var i;if(t(this,u).size>1||this.view.isClipped){const a=e.box.left+e.box.CSSTranslation.x+e.box.scrollValue.x,c=m.height-e.box.height-e.box.top+e.box.CSSTranslation.y+e.box.scrollValue.y*-1;t(this,d).setScissor(a,c,e.box.width,e.box.height),t(this,d).setViewport(a,c,e.box.width,e.box.height)}(i=e.beforeRenderCallback)==null||i.call(e),t(this,d).render(e.scene,e.camera)}}$=new WeakMap,g=new WeakMap,d=new WeakMap,V=new WeakMap,u=new WeakMap,M=new WeakMap,S=new WeakMap,H=new WeakMap,I=new WeakMap,z=new WeakMap,_=new WeakMap,B=new WeakMap,Y=new WeakMap;const m=new me;exports.En3View=G;exports.dispose=ne;exports.en3=m;exports.en3Cache=W;
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
var he = Object.defineProperty, ae = Object.defineProperties;
|
|
2
|
+
var ne = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var K = Object.getOwnPropertySymbols;
|
|
4
|
+
var ce = Object.prototype.hasOwnProperty, le = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var U = (h, e, i) => e in h ? he(h, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : h[e] = i, H = (h, e) => {
|
|
6
|
+
for (var i in e || (e = {}))
|
|
7
|
+
ce.call(e, i) && U(h, i, e[i]);
|
|
8
|
+
if (K)
|
|
9
|
+
for (var i of K(e))
|
|
10
|
+
le.call(e, i) && U(h, i, e[i]);
|
|
11
|
+
return h;
|
|
12
|
+
}, X = (h, e) => ae(h, ne(e));
|
|
13
|
+
var Z = (h, e, i) => {
|
|
14
|
+
if (!e.has(h))
|
|
15
|
+
throw TypeError("Cannot " + i);
|
|
16
|
+
};
|
|
17
|
+
var t = (h, e, i) => (Z(h, e, "read from private field"), i ? i.call(h) : e.get(h)), s = (h, e, i) => {
|
|
18
|
+
if (e.has(h))
|
|
19
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
20
|
+
e instanceof WeakSet ? e.add(h) : e.set(h, i);
|
|
21
|
+
}, r = (h, e, i, n) => (Z(h, e, "write to private field"), n ? n.call(h, i) : e.set(h, i), i);
|
|
22
|
+
import { RESIZE_ORDER as oe, TICK_ORDER as de } from "./order/index.js";
|
|
23
|
+
import { windowResizer as q } from "./window-resizer/index.js";
|
|
24
|
+
import { ticker as J } from "./ticker/index.js";
|
|
25
|
+
import { g as re } from "./dom-0S_WDL4g.js";
|
|
26
|
+
import { Mesh as ue, OrthographicCamera as Q, PerspectiveCamera as ee, Scene as me, Vector2 as fe, Raycaster as ge, REVISION as Ee, WebGLRenderer as be } from "three";
|
|
27
|
+
import { LayoutBox as te } from "./layout-box/index.js";
|
|
28
|
+
function xe(h) {
|
|
29
|
+
const e = (i) => {
|
|
30
|
+
i.dispose();
|
|
31
|
+
for (const n of Object.keys(i)) {
|
|
32
|
+
const c = i[n];
|
|
33
|
+
c && typeof c == "object" && "minFilter" in c && c.dispose();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
h.traverse((i) => {
|
|
37
|
+
if (i instanceof ue) {
|
|
38
|
+
if (i.geometry.dispose(), !Array.isArray(i.material) && i.material.isMaterial)
|
|
39
|
+
e(i.material);
|
|
40
|
+
else if (Array.isArray(i.material))
|
|
41
|
+
for (const n of i.material)
|
|
42
|
+
e(n);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
var z, l, D, x, b, L, y, w;
|
|
47
|
+
class ie {
|
|
48
|
+
constructor(e, i) {
|
|
49
|
+
s(this, z, void 0);
|
|
50
|
+
s(this, l, void 0);
|
|
51
|
+
s(this, D, void 0);
|
|
52
|
+
s(this, x, void 0);
|
|
53
|
+
s(this, b, void 0);
|
|
54
|
+
s(this, L, void 0);
|
|
55
|
+
s(this, y, void 0);
|
|
56
|
+
s(this, w, void 0);
|
|
57
|
+
r(this, z, e), r(this, l, (i == null ? void 0 : i.cameraType) === "orthographic" ? new Q() : new ee()), r(this, D, new me()), r(this, x, []), r(this, b, (i == null ? void 0 : i.cameraDistance) || 1e3), t(this, l).near = (i == null ? void 0 : i.cameraNear) || 1, t(this, l).far = (i == null ? void 0 : i.cameraFar) || 11e3, r(this, L, (i == null ? void 0 : i.cameraFov) || "auto"), t(this, l).position.z = t(this, b), t(this, l).name = `Cameras.${t(this, z)}`, r(this, y, re(i == null ? void 0 : i.sizeElement) || document.documentElement), this.beforeRenderCallback = i == null ? void 0 : i.beforeRender, r(this, w, new te(t(this, y))), t(this, w).onResize(() => {
|
|
58
|
+
this.resize();
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
get name() {
|
|
62
|
+
return t(this, z);
|
|
63
|
+
}
|
|
64
|
+
get camera() {
|
|
65
|
+
return t(this, l);
|
|
66
|
+
}
|
|
67
|
+
get scene() {
|
|
68
|
+
return t(this, D);
|
|
69
|
+
}
|
|
70
|
+
get box() {
|
|
71
|
+
return t(this, w);
|
|
72
|
+
}
|
|
73
|
+
get cameraDistance() {
|
|
74
|
+
return t(this, b);
|
|
75
|
+
}
|
|
76
|
+
set cameraDistance(e) {
|
|
77
|
+
r(this, b, e), this.resize();
|
|
78
|
+
}
|
|
79
|
+
get sizeElement() {
|
|
80
|
+
return t(this, y);
|
|
81
|
+
}
|
|
82
|
+
get isClipped() {
|
|
83
|
+
return t(this, y) !== m.containerElement;
|
|
84
|
+
}
|
|
85
|
+
resize() {
|
|
86
|
+
const { width: e, height: i } = t(this, w);
|
|
87
|
+
t(this, l).userData.controlled || (t(this, l).position.z = t(this, b)), t(this, l) instanceof ee ? (t(this, l).aspect = e / i, t(this, l).fov = t(this, L) === "auto" ? 2 * Math.atan(i / 2 / t(this, b)) * (180 / Math.PI) : t(this, L)) : t(this, l) instanceof Q && (t(this, l).left = e / -2, t(this, l).right = e / 2, t(this, l).top = i / 2, t(this, l).bottom = i / -2), t(this, l).updateProjectionMatrix();
|
|
88
|
+
}
|
|
89
|
+
destroy() {
|
|
90
|
+
t(this, x).forEach((e) => {
|
|
91
|
+
e.userData.box.destroy();
|
|
92
|
+
}), t(this, D).clear(), xe(t(this, D)), m.destroyView(this.name), t(this, w).destroy();
|
|
93
|
+
}
|
|
94
|
+
attachToHTMLElement(e, i, n) {
|
|
95
|
+
const c = new te(e, X(H({}, n), {
|
|
96
|
+
containerElement: t(this, y),
|
|
97
|
+
cartesian: !0,
|
|
98
|
+
scrollStep: !this.isClipped
|
|
99
|
+
}));
|
|
100
|
+
return c.bindObject(i), i.userData.box = c, t(this, x).push(i), i;
|
|
101
|
+
}
|
|
102
|
+
detachFromHTMLElement(e) {
|
|
103
|
+
r(this, x, t(this, x).filter((i) => i === e ? (e.userData.box.destroy(), !1) : !0));
|
|
104
|
+
}
|
|
105
|
+
add(...e) {
|
|
106
|
+
const i = e[0], n = e[1], c = e[2];
|
|
107
|
+
return n && this.attachToHTMLElement(n, i, c), this.scene.add(i), i;
|
|
108
|
+
}
|
|
109
|
+
remove(e, i) {
|
|
110
|
+
this.scene.remove(e), i && this.detachFromHTMLElement(e);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
z = new WeakMap(), l = new WeakMap(), D = new WeakMap(), x = new WeakMap(), b = new WeakMap(), L = new WeakMap(), y = new WeakMap(), w = new WeakMap();
|
|
114
|
+
const se = /* @__PURE__ */ new Map();
|
|
115
|
+
var v, O, P, p, j;
|
|
116
|
+
class ye {
|
|
117
|
+
constructor(e) {
|
|
118
|
+
s(this, v, void 0);
|
|
119
|
+
s(this, O, void 0);
|
|
120
|
+
s(this, P, void 0);
|
|
121
|
+
s(this, p, void 0);
|
|
122
|
+
s(this, j, void 0);
|
|
123
|
+
r(this, v, e.targetName || void 0), r(this, O, e.eventDispatcher || e.object3D), r(this, P, e.propagation || !1), r(this, p, e.object3D), r(this, j, t(this, v) ? () => t(this, p).getObjectByName(t(this, v)) || t(this, p) : () => t(this, p));
|
|
124
|
+
}
|
|
125
|
+
get object3D() {
|
|
126
|
+
return t(this, p);
|
|
127
|
+
}
|
|
128
|
+
get eventDispatcher() {
|
|
129
|
+
return t(this, O);
|
|
130
|
+
}
|
|
131
|
+
get propagation() {
|
|
132
|
+
return t(this, P);
|
|
133
|
+
}
|
|
134
|
+
get target() {
|
|
135
|
+
return t(this, j).call(this);
|
|
136
|
+
}
|
|
137
|
+
dispatch(e, i) {
|
|
138
|
+
this.eventDispatcher.dispatchEvent(H({
|
|
139
|
+
originalEvent: i,
|
|
140
|
+
type: e
|
|
141
|
+
}, this.intersection));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
v = new WeakMap(), O = new WeakMap(), P = new WeakMap(), p = new WeakMap(), j = new WeakMap();
|
|
145
|
+
var f, d, C, k, A, F, N;
|
|
146
|
+
class we {
|
|
147
|
+
constructor() {
|
|
148
|
+
s(this, f, []);
|
|
149
|
+
s(this, d, []);
|
|
150
|
+
s(this, C, new fe());
|
|
151
|
+
s(this, k, new ge());
|
|
152
|
+
s(this, A, (e) => {
|
|
153
|
+
for (let i = 0; i < t(this, d).length; i++)
|
|
154
|
+
t(this, d)[i].dispatch("pointerDown", e);
|
|
155
|
+
});
|
|
156
|
+
s(this, F, (e) => {
|
|
157
|
+
for (let i = 0; i < t(this, d).length; i++)
|
|
158
|
+
t(this, d)[i].dispatch("pointerUp", e);
|
|
159
|
+
});
|
|
160
|
+
s(this, N, (e) => {
|
|
161
|
+
if (!t(this, f).length)
|
|
162
|
+
return;
|
|
163
|
+
t(this, C).x = e.clientX / m.width * 2 - 1, t(this, C).y = -(e.clientY / m.height) * 2 + 1, m.camera && t(this, k).setFromCamera(t(this, C), m.camera);
|
|
164
|
+
const i = [];
|
|
165
|
+
for (const a of t(this, f)) {
|
|
166
|
+
const E = t(this, k).intersectObject(a.target);
|
|
167
|
+
E.length && (a.intersection = E[0], i.push(a));
|
|
168
|
+
}
|
|
169
|
+
let n = !1;
|
|
170
|
+
const c = t(this, d).filter(
|
|
171
|
+
(a) => !i.find((E) => E.object3D.uuid === a.object3D.uuid)
|
|
172
|
+
), W = i.sort(
|
|
173
|
+
(a, E) => E.object3D.position.z - a.object3D.position.z
|
|
174
|
+
).filter((a, E) => n ? (c.push(a), !1) : (n = !a.propagation, !0)), _ = W.filter(
|
|
175
|
+
(a) => !t(this, d).find((E) => E.object3D.uuid === a.object3D.uuid)
|
|
176
|
+
);
|
|
177
|
+
for (let a = 0; a < c.length; a++)
|
|
178
|
+
c[a].dispatch("pointerLeave", e);
|
|
179
|
+
for (let a = 0; a < _.length; a++)
|
|
180
|
+
_[a].dispatch("pointerEnter", e);
|
|
181
|
+
r(this, d, W);
|
|
182
|
+
for (let a = 0; a < t(this, d).length; a++)
|
|
183
|
+
t(this, d)[a].dispatch("pointerMove", e);
|
|
184
|
+
});
|
|
185
|
+
m.containerElement.addEventListener(
|
|
186
|
+
"pointerdown",
|
|
187
|
+
t(this, A)
|
|
188
|
+
), m.containerElement.addEventListener("pointerup", t(this, F)), m.containerElement.addEventListener(
|
|
189
|
+
"pointermove",
|
|
190
|
+
t(this, N)
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
destroy() {
|
|
194
|
+
m.containerElement.removeEventListener(
|
|
195
|
+
"pointerdown",
|
|
196
|
+
t(this, A)
|
|
197
|
+
), m.containerElement.removeEventListener(
|
|
198
|
+
"pointerup",
|
|
199
|
+
t(this, F)
|
|
200
|
+
), m.containerElement.removeEventListener(
|
|
201
|
+
"pointermove",
|
|
202
|
+
t(this, N)
|
|
203
|
+
), r(this, f, []), r(this, d, []);
|
|
204
|
+
}
|
|
205
|
+
add(e, i) {
|
|
206
|
+
if (t(this, f).find((c) => c.object3D.uuid === e.uuid))
|
|
207
|
+
return;
|
|
208
|
+
const n = new ye(H({
|
|
209
|
+
object3D: e
|
|
210
|
+
}, i));
|
|
211
|
+
t(this, f).push(n);
|
|
212
|
+
}
|
|
213
|
+
remove(e) {
|
|
214
|
+
r(this, f, t(this, f).filter(
|
|
215
|
+
(i) => i.object3D.uuid !== e.uuid
|
|
216
|
+
)), r(this, d, t(this, d).filter((i) => i.object3D.uuid !== e.uuid));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
f = new WeakMap(), d = new WeakMap(), C = new WeakMap(), k = new WeakMap(), A = new WeakMap(), F = new WeakMap(), N = new WeakMap();
|
|
220
|
+
var G, g, o, T, u, V, M, S, I, R, Y, $, B;
|
|
221
|
+
class pe {
|
|
222
|
+
constructor() {
|
|
223
|
+
s(this, G, `https://unpkg.com/three@0.${Ee}.x`);
|
|
224
|
+
s(this, g, null);
|
|
225
|
+
s(this, o, null);
|
|
226
|
+
s(this, T, null);
|
|
227
|
+
s(this, u, /* @__PURE__ */ new Map());
|
|
228
|
+
s(this, V, 0);
|
|
229
|
+
s(this, M, 0);
|
|
230
|
+
s(this, S, 0);
|
|
231
|
+
s(this, I, 2);
|
|
232
|
+
s(this, R, !1);
|
|
233
|
+
s(this, Y, !1);
|
|
234
|
+
s(this, $, () => {
|
|
235
|
+
r(this, V, t(this, g).clientWidth), r(this, M, t(this, g).clientHeight), r(this, S, Math.min(t(this, I), devicePixelRatio || 1)), t(this, o).setPixelRatio(t(this, S)), t(this, o).setSize(t(this, V), t(this, M));
|
|
236
|
+
});
|
|
237
|
+
s(this, B, () => {
|
|
238
|
+
t(this, o).setRenderTarget(null), t(this, u).forEach((e) => {
|
|
239
|
+
this.render(e);
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
get CDNVersion() {
|
|
244
|
+
return t(this, G);
|
|
245
|
+
}
|
|
246
|
+
get containerElement() {
|
|
247
|
+
return t(this, g);
|
|
248
|
+
}
|
|
249
|
+
get webglRenderer() {
|
|
250
|
+
return t(this, o);
|
|
251
|
+
}
|
|
252
|
+
get raycaster() {
|
|
253
|
+
return t(this, T);
|
|
254
|
+
}
|
|
255
|
+
get views() {
|
|
256
|
+
return t(this, u);
|
|
257
|
+
}
|
|
258
|
+
get view() {
|
|
259
|
+
return this.getView("default");
|
|
260
|
+
}
|
|
261
|
+
get camera() {
|
|
262
|
+
return this.getView("default").camera;
|
|
263
|
+
}
|
|
264
|
+
get scene() {
|
|
265
|
+
return this.getView("default").scene;
|
|
266
|
+
}
|
|
267
|
+
get width() {
|
|
268
|
+
return t(this, V);
|
|
269
|
+
}
|
|
270
|
+
get height() {
|
|
271
|
+
return t(this, M);
|
|
272
|
+
}
|
|
273
|
+
get pixelRatio() {
|
|
274
|
+
return t(this, S);
|
|
275
|
+
}
|
|
276
|
+
get cacheAssets() {
|
|
277
|
+
return t(this, Y);
|
|
278
|
+
}
|
|
279
|
+
setup(e) {
|
|
280
|
+
if (t(this, R)) {
|
|
281
|
+
console.warn("[en3.setup]: You are trying to setup en3 again.");
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
r(this, g, re(e == null ? void 0 : e.containerElement) || document.body), r(this, I, (e == null ? void 0 : e.maxPixelRatio) || 2), r(this, o, new be(e == null ? void 0 : e.webGLRendererParameters)), t(this, o).domElement.style.cssText = `
|
|
285
|
+
position: fixed;
|
|
286
|
+
left: 0;
|
|
287
|
+
top: 0;
|
|
288
|
+
width: 100%;
|
|
289
|
+
height: 100%;
|
|
290
|
+
z-index: ${(e == null ? void 0 : e.zIndex) || 0};
|
|
291
|
+
`, (t(this, g).shadowRoot || t(this, g)).append(t(this, o).domElement), t(this, u).set(
|
|
292
|
+
"default",
|
|
293
|
+
new ie("default", H({
|
|
294
|
+
sizeElement: t(this, g)
|
|
295
|
+
}, e == null ? void 0 : e.view))
|
|
296
|
+
), r(this, T, new we()), r(this, Y, (e == null ? void 0 : e.cacheAssets) || !1), r(this, R, !0), q.subscribe(t(this, $), oe.EN3), J.subscribe(t(this, B), { order: de.EN3 });
|
|
297
|
+
}
|
|
298
|
+
destroy() {
|
|
299
|
+
if (!t(this, R)) {
|
|
300
|
+
console.warn(
|
|
301
|
+
"[en3.setup]: You are trying to destory en3 but it has not been initialized."
|
|
302
|
+
);
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
q.unsubscribe(t(this, $)), J.unsubscribe(t(this, B)), t(this, T).destroy(), t(this, u).forEach((e) => {
|
|
306
|
+
e.destroy();
|
|
307
|
+
}), t(this, o).dispose(), t(this, o).domElement.remove(), r(this, o, null), r(this, R, !1), se.forEach((e) => {
|
|
308
|
+
e.dispose();
|
|
309
|
+
}), se.clear();
|
|
310
|
+
}
|
|
311
|
+
createView(e, i) {
|
|
312
|
+
const n = t(this, u).size, c = new ie(e, i);
|
|
313
|
+
return t(this, u).set(e, c), n === 1 && t(this, o).setScissorTest(!0), c;
|
|
314
|
+
}
|
|
315
|
+
getView(e) {
|
|
316
|
+
return t(this, u).get(e);
|
|
317
|
+
}
|
|
318
|
+
destroyView(e) {
|
|
319
|
+
const i = t(this, u).get(e);
|
|
320
|
+
i && (t(this, u).delete(e), i.destroy(), t(this, u).size <= 1 && t(this, o).setScissorTest(!1));
|
|
321
|
+
}
|
|
322
|
+
render(e) {
|
|
323
|
+
var i;
|
|
324
|
+
if (t(this, u).size > 1 || this.view.isClipped) {
|
|
325
|
+
const n = e.box.left + e.box.CSSTranslation.x + e.box.scrollValue.x, c = m.height - e.box.height - e.box.top + e.box.CSSTranslation.y + e.box.scrollValue.y * -1;
|
|
326
|
+
t(this, o).setScissor(n, c, e.box.width, e.box.height), t(this, o).setViewport(
|
|
327
|
+
n,
|
|
328
|
+
c,
|
|
329
|
+
e.box.width,
|
|
330
|
+
e.box.height
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
(i = e.beforeRenderCallback) == null || i.call(e), t(this, o).render(e.scene, e.camera);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
G = new WeakMap(), g = new WeakMap(), o = new WeakMap(), T = new WeakMap(), u = new WeakMap(), V = new WeakMap(), M = new WeakMap(), S = new WeakMap(), I = new WeakMap(), R = new WeakMap(), Y = new WeakMap(), $ = new WeakMap(), B = new WeakMap();
|
|
337
|
+
const m = new pe();
|
|
338
|
+
export {
|
|
339
|
+
ie as E,
|
|
340
|
+
se as a,
|
|
341
|
+
xe as d,
|
|
342
|
+
m as e
|
|
343
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t={value:null},n={value:null},e={value:[]};exports.contextStack=e;exports.currentComponentElement=t;exports.nextComponentAttributes=n;
|
package/lib/image/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../custom-element/index.cjs");require("../window-resizer/index.cjs");require("../Store-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../custom-element/index.cjs");require("../window-resizer/index.cjs");require("../Store-6s0YXK4o.cjs");const o=require("../source/index.cjs");var l=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=(n,r,m,t)=>{for(var e=t>1?void 0:t?i(r,m):r,s=n.length-1,u;s>=0;s--)(u=n[s])&&(e=(t?u(r,m,e):u(e))||e);return t&&e&&l(r,m,e),e};exports.ImageElement=class extends o.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(r){this.consumerElement.src=r||""}};exports.ImageElement=a([c.define("e-image")],exports.ImageElement);
|
package/lib/image/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { define as p } from "../custom-element/index.js";
|
|
2
2
|
import "../window-resizer/index.js";
|
|
3
|
-
import "../Store-
|
|
3
|
+
import "../Store-BI2xxXOA.js";
|
|
4
4
|
import { SourceElement as l } from "../source/index.js";
|
|
5
5
|
var u = Object.defineProperty, f = Object.getOwnPropertyDescriptor, i = (r, t, o, m) => {
|
|
6
6
|
for (var e = m > 1 ? void 0 : m ? f(t, o) : t, n = r.length - 1, s; n >= 0; n--)
|