@tresjs/core
Advanced tools
Comparing version 3.7.0-next.0 to 4.0.0-next.0
import type { WebGLRendererParameters, ColorSpace, ShadowMapType, ToneMapping } from 'three'; | ||
import type { Ref } from 'vue'; | ||
import { type TresContext } from '../composables'; | ||
@@ -32,3 +31,3 @@ import type { RendererPresetsType } from '../composables/useRenderer/const'; | ||
}>, { | ||
context: Ref<TresContext | null> | import("vue").ShallowRef<TresContext | null>; | ||
context: import("vue").ShallowRef<TresContext | null>; | ||
dispose: () => void; | ||
@@ -61,3 +60,5 @@ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TresCanvasProps>, { | ||
default(): any; | ||
}>>; | ||
}> & { | ||
default(): any; | ||
}>; | ||
export default _default; | ||
@@ -64,0 +65,0 @@ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T; |
@@ -86,5 +86,5 @@ import { WebGLRenderer } from 'three'; | ||
}): { | ||
renderer: import("vue").Ref<WebGLRenderer> | import("vue").ShallowRef<WebGLRenderer>; | ||
renderer: import("vue").ShallowRef<WebGLRenderer>; | ||
}; | ||
export type UseRendererReturn = ReturnType<typeof useRenderer>; | ||
export {}; |
import type { App } from 'vue'; | ||
import { normalizeColor, normalizeVectorFlexibleParam } from './utils/normalize'; | ||
import { dispose } from './utils/'; | ||
import templateCompilerOptions from './utils/template-compiler-options'; | ||
@@ -18,2 +17,2 @@ export * from './composables'; | ||
export default plugin; | ||
export { normalizeColor, normalizeVectorFlexibleParam, templateCompilerOptions, dispose, }; | ||
export { normalizeColor, normalizeVectorFlexibleParam, templateCompilerOptions, }; |
1236
dist/tres.js
/** | ||
* name: @tresjs/core | ||
* version: v3.7.0-next.0 | ||
* version: v4.0.0-next.0 | ||
* (c) 2023 | ||
@@ -8,260 +8,306 @@ * description: Declarative ThreeJS using Vue Components | ||
*/ | ||
import { ref as L, computed as D, watchEffect as k, onUnmounted as O, shallowRef as S, watch as ae, reactive as ge, readonly as ye, provide as G, inject as he, createRenderer as we, defineComponent as J, useSlots as Ee, getCurrentInstance as K, onMounted as _e, openBlock as Ce, createElementBlock as Me, normalizeClass as Pe, normalizeStyle as Ae, h as X, Fragment as be } from "vue"; | ||
import * as De from "three"; | ||
import { PerspectiveCamera as W, OrthographicCamera as ke, Camera as Te, Clock as Se, Vector3 as xe, Color as F, REVISION as Le, SRGBColorSpace as Oe, ACESFilmicToneMapping as Be, PCFSoftShadowMap as Re, WebGLRenderer as N, LoadingManager as je, TextureLoader as He, Vector2 as Fe, Raycaster as ze, BufferAttribute as $e, Scene as Ie } from "three"; | ||
import { createEventHook as x, useRafFn as ne, toValue as C, unrefElement as Ne, useDevicePixelRatio as Ve, usePointer as Ge, useElementBounding as We, useWindowSize as qe, useElementSize as Ue, useFps as Ye, useMemory as Je } from "@vueuse/core"; | ||
const Ke = ({ sizes: e, scene: n }) => { | ||
const t = L([]), r = D( | ||
var Me = Object.defineProperty; | ||
var Pe = (e, r, t) => r in e ? Me(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t; | ||
var G = (e, r, t) => (Pe(e, typeof r != "symbol" ? r + "" : r, t), t); | ||
import { ref as B, computed as k, watchEffect as A, onUnmounted as U, shallowRef as D, watch as ie, reactive as le, readonly as Se, provide as Q, inject as ke, createRenderer as Te, defineComponent as Z, useSlots as Oe, getCurrentInstance as ee, onMounted as Ae, openBlock as xe, createElementBlock as De, normalizeClass as Le, normalizeStyle as Be, h as te, Fragment as je } from "vue"; | ||
import * as ue from "three"; | ||
import { PerspectiveCamera as Y, OrthographicCamera as Ie, Camera as Re, Clock as He, Vector3 as Ne, Color as N, MeshBasicMaterial as Ve, DoubleSide as $e, REVISION as Ue, SRGBColorSpace as Fe, ACESFilmicToneMapping as Ge, PCFSoftShadowMap as ze, WebGLRenderer as z, LoadingManager as We, TextureLoader as Qe, Vector2 as Ye, Raycaster as Je, BufferAttribute as Ke, Scene as qe } from "three"; | ||
import { createEventHook as L, useRafFn as ce, toValue as E, unrefElement as Xe, useDevicePixelRatio as Ze, usePointer as et, useElementBounding as tt, useWindowSize as rt, useElementSize as nt, useFps as ot, useMemory as at } from "@vueuse/core"; | ||
const st = ({ sizes: e, scene: r }) => { | ||
const t = B([]), n = k( | ||
() => t.value[0] | ||
), a = (l, c = !1) => { | ||
t.value.some(({ uuid: m }) => m === l.uuid) || (c ? u(l) : t.value.push(l)); | ||
}, o = (l) => { | ||
t.value = t.value.filter(({ uuid: c }) => c !== l.uuid); | ||
}, u = (l) => { | ||
const c = l instanceof Te ? l : t.value.find((h) => h.uuid === l); | ||
if (!c) | ||
), a = (i, l = !1) => { | ||
t.value.some(({ uuid: c }) => c === i.uuid) || (l ? o(i) : t.value.push(i)); | ||
}, s = (i) => { | ||
t.value = t.value.filter(({ uuid: l }) => l !== i.uuid); | ||
}, o = (i) => { | ||
const l = i instanceof Re ? i : t.value.find((m) => m.uuid === i); | ||
if (!l) | ||
return; | ||
const m = t.value.filter(({ uuid: h }) => h !== c.uuid); | ||
t.value = [c, ...m]; | ||
const c = t.value.filter(({ uuid: m }) => m !== l.uuid); | ||
t.value = [l, ...c]; | ||
}; | ||
return k(() => { | ||
e.aspectRatio.value && t.value.forEach((l) => { | ||
l instanceof W && (l.aspect = e.aspectRatio.value), (l instanceof W || l instanceof ke) && l.updateProjectionMatrix(); | ||
return A(() => { | ||
e.aspectRatio.value && t.value.forEach((i) => { | ||
i instanceof Y && (i.aspect = e.aspectRatio.value), (i instanceof Y || i instanceof Ie) && i.updateProjectionMatrix(); | ||
}); | ||
}), n.userData.tres__registerCamera = a, n.userData.tres__deregisterCamera = o, O(() => { | ||
}), r.userData.tres__registerCamera = a, r.userData.tres__deregisterCamera = s, U(() => { | ||
t.value = []; | ||
}), { | ||
camera: r, | ||
camera: n, | ||
cameras: t, | ||
registerCamera: a, | ||
deregisterCamera: o, | ||
setCameraActive: u | ||
deregisterCamera: s, | ||
setCameraActive: o | ||
}; | ||
}, oe = x(), se = x(), U = x(), T = new Se(); | ||
let z = 0, $ = 0; | ||
const { pause: Xe, resume: Qe, isActive: Ze } = ne( | ||
}, fe = L(), de = L(), q = L(), x = new He(); | ||
let V = 0, $ = 0; | ||
const { pause: it, resume: lt, isActive: ut } = ce( | ||
() => { | ||
oe.trigger({ delta: z, elapsed: $, clock: T }), se.trigger({ delta: z, elapsed: $, clock: T }), U.trigger({ delta: z, elapsed: $, clock: T }); | ||
fe.trigger({ delta: V, elapsed: $, clock: x }), de.trigger({ delta: V, elapsed: $, clock: x }), q.trigger({ delta: V, elapsed: $, clock: x }); | ||
}, | ||
{ immediate: !1 } | ||
); | ||
U.on(() => { | ||
z = T.getDelta(), $ = T.getElapsedTime(); | ||
q.on(() => { | ||
V = x.getDelta(), $ = x.getElapsedTime(); | ||
}); | ||
const ie = () => ({ | ||
onBeforeLoop: oe.on, | ||
onLoop: se.on, | ||
onAfterLoop: U.on, | ||
pause: Xe, | ||
resume: Qe, | ||
isActive: Ze | ||
}), bt = !0, Q = "[TresJS ▲ ■ ●] "; | ||
function B() { | ||
function e(r, a) { | ||
console.error(`${Q} ${r}`, a || ""); | ||
const me = () => ({ | ||
onBeforeLoop: fe.on, | ||
onLoop: de.on, | ||
onAfterLoop: q.on, | ||
pause: it, | ||
resume: lt, | ||
isActive: ut | ||
}), Zt = !0, re = "[TresJS ▲ ■ ●] "; | ||
function j() { | ||
function e(n, a) { | ||
console.error(`${re} ${n}`, a || ""); | ||
} | ||
function n(r) { | ||
console.warn(`${Q} ${r}`); | ||
function r(n) { | ||
console.warn(`${re} ${n}`); | ||
} | ||
function t(r, a) { | ||
function t(n, a) { | ||
} | ||
return { | ||
logError: e, | ||
logWarning: n, | ||
logWarning: r, | ||
logMessage: t | ||
}; | ||
} | ||
function Dt(e) { | ||
return typeof e == "number" ? [e, e, e] : e instanceof xe ? [e.x, e.y, e.z] : e; | ||
function er(e) { | ||
return typeof e == "number" ? [e, e, e] : e instanceof Ne ? [e.x, e.y, e.z] : e; | ||
} | ||
function et(e) { | ||
return e instanceof F ? e : Array.isArray(e) ? new F(...e) : new F(e); | ||
function ct(e) { | ||
return e instanceof N ? e : Array.isArray(e) ? new N(...e) : new N(e); | ||
} | ||
const le = (e, n) => { | ||
for (const t of Object.keys(n)) | ||
n[t] instanceof Object && Object.assign(n[t], le(e[t], n[t])); | ||
return Object.assign(e || {}, n), e; | ||
}, tt = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot", rt = /* @__PURE__ */ at(tt); | ||
function Z(e) { | ||
class ft extends ue.Mesh { | ||
constructor(...t) { | ||
super(...t); | ||
G(this, "type", "HightlightMesh"); | ||
G(this, "createTime"); | ||
this.createTime = Date.now(); | ||
} | ||
onBeforeRender() { | ||
const n = (Date.now() - this.createTime) / 1e3, o = 1 + 0.07 * Math.sin(2.5 * n); | ||
this.scale.set(o, o, o); | ||
} | ||
} | ||
const pe = (e, r) => { | ||
for (const t of Object.keys(r)) | ||
r[t] instanceof Object && Object.assign(r[t], pe(e[t], r[t])); | ||
return Object.assign(e || {}, r), e; | ||
}, dt = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot", mt = /* @__PURE__ */ pt(dt); | ||
function ne(e) { | ||
return e && e.nodeType === 1; | ||
} | ||
function j(e) { | ||
return e.replace(/-([a-z])/g, (n, t) => t.toUpperCase()); | ||
function R(e) { | ||
return e.replace(/-([a-z])/g, (r, t) => t.toUpperCase()); | ||
} | ||
function at(e, n) { | ||
const t = /* @__PURE__ */ Object.create(null), r = e.split(","); | ||
for (let a = 0; a < r.length; a++) | ||
t[r[a]] = !0; | ||
return n ? (a) => !!t[a.toLowerCase()] : (a) => !!t[a]; | ||
function pt(e, r) { | ||
const t = /* @__PURE__ */ Object.create(null), n = e.split(","); | ||
for (let a = 0; a < n.length; a++) | ||
t[n[a]] = !0; | ||
return r ? (a) => !!t[a.toLowerCase()] : (a) => !!t[a]; | ||
} | ||
const nt = (e, n) => { | ||
const t = /* @__PURE__ */ new Set(), r = []; | ||
const gt = (e, r) => { | ||
const t = /* @__PURE__ */ new Set(), n = []; | ||
for (const a of e) { | ||
const o = n(a); | ||
t.has(o) || (t.add(o), r.push(a)); | ||
const s = r(a); | ||
t.has(s) || (t.add(s), n.push(a)); | ||
} | ||
return r; | ||
}, ee = (e, n) => { | ||
if (!n) | ||
return n; | ||
}, oe = (e, r) => { | ||
if (!r) | ||
return; | ||
const t = Array.isArray(n) ? n : n.match(/([^[.\]])+/g); | ||
return t == null ? void 0 : t.reduce((r, a) => r && r[a], e); | ||
}, ot = (e, n, t) => { | ||
const r = Array.isArray(n) ? n : n.match(/([^[.\]])+/g); | ||
r && r.reduce((a, o, u) => (a[o] === void 0 && (a[o] = {}), u === r.length - 1 && (a[o] = t), a[o]), e); | ||
const t = Array.isArray(r) ? r : r.match(/([^[.\]])+/g); | ||
return t == null ? void 0 : t.reduce((n, a) => n && n[a], e); | ||
}, vt = (e, r, t) => { | ||
const n = Array.isArray(r) ? r : r.match(/([^[.\]])+/g); | ||
n && n.reduce((a, s, o) => (a[s] === void 0 && (a[s] = {}), o === n.length - 1 && (a[s] = t), a[s]), e); | ||
}; | ||
function ue(e, n) { | ||
if (Z(e) && Z(n)) { | ||
const a = e.attributes, o = n.attributes; | ||
return a.length !== o.length ? !1 : Array.from(a).every(({ name: u, value: l }) => n.getAttribute(u) === l); | ||
function ge(e, r) { | ||
if (ne(e) && ne(r)) { | ||
const a = e.attributes, s = r.attributes; | ||
return a.length !== s.length ? !1 : Array.from(a).every(({ name: o, value: i }) => r.getAttribute(o) === i); | ||
} | ||
if (e === n) | ||
if (e === r) | ||
return !0; | ||
if (e === null || typeof e != "object" || n === null || typeof n != "object") | ||
if (e === null || typeof e != "object" || r === null || typeof r != "object") | ||
return !1; | ||
const t = Object.keys(e), r = Object.keys(n); | ||
if (t.length !== r.length) | ||
const t = Object.keys(e), n = Object.keys(r); | ||
if (t.length !== n.length) | ||
return !1; | ||
for (const a of t) | ||
if (!r.includes(a) || !ue(e[a], n[a])) | ||
if (!n.includes(a) || !ge(e[a], r[a])) | ||
return !1; | ||
return !0; | ||
} | ||
function st(e, n) { | ||
if (!Array.isArray(e) || !Array.isArray(n) || e.length !== n.length) | ||
function ht(e, r) { | ||
if (!Array.isArray(e) || !Array.isArray(r) || e.length !== r.length) | ||
return !1; | ||
for (let t = 0; t < e.length; t++) | ||
if (!ue(e[t], n[t])) | ||
if (!ge(e[t], r[t])) | ||
return !1; | ||
return !0; | ||
} | ||
const it = Array.isArray; | ||
function ce(e) { | ||
var n, t; | ||
e.children && e.children.forEach((r) => ce(r)); | ||
for (const r in e) | ||
(t = (n = e[r]) == null ? void 0 : n.dispose) == null || t.call(n), delete e[r]; | ||
e.dispose && e.type !== "Scene" && e.dispose(); | ||
const yt = Array.isArray; | ||
function _t(e, r, t, n) { | ||
const a = (l) => { | ||
if (l.uuid === r) | ||
return l; | ||
for (const c of l.children) { | ||
const m = a(c); | ||
if (m) | ||
return m; | ||
} | ||
}, s = a(e); | ||
if (!s) { | ||
console.warn("Object with UUID not found in the scene."); | ||
return; | ||
} | ||
let o = s; | ||
for (let l = 0; l < t.length - 1; l++) | ||
if (o[t[l]] !== void 0) | ||
o = o[t[l]]; | ||
else { | ||
console.warn(`Property path is not valid: ${t.join(".")}`); | ||
return; | ||
} | ||
const i = t[t.length - 1]; | ||
o[i] !== void 0 ? o[i] = n : console.warn(`Property path is not valid: ${t.join(".")}`); | ||
} | ||
const lt = Number.parseInt(Le.replace("dev", "")), H = { | ||
function wt(e) { | ||
const r = new Ve({ | ||
color: 11003607, | ||
// Highlight color, e.g., yellow | ||
transparent: !0, | ||
opacity: 0.2, | ||
depthTest: !1, | ||
// So the highlight is always visible | ||
side: $e | ||
// To e | ||
}); | ||
return new ft(e.geometry.clone(), r); | ||
} | ||
const bt = Number.parseInt(Ue.replace("dev", "")), H = { | ||
realistic: { | ||
shadows: !0, | ||
physicallyCorrectLights: !0, | ||
outputColorSpace: Oe, | ||
toneMapping: Be, | ||
outputColorSpace: Fe, | ||
toneMapping: Ge, | ||
toneMappingExposure: 3, | ||
shadowMap: { | ||
enabled: !0, | ||
type: Re | ||
type: ze | ||
} | ||
} | ||
}; | ||
function ut({ | ||
function Et({ | ||
scene: e, | ||
canvas: n, | ||
canvas: r, | ||
options: t, | ||
disableRender: r, | ||
contextParts: { sizes: a, camera: o } | ||
disableRender: n, | ||
contextParts: { sizes: a, camera: s } | ||
}) { | ||
const u = D(() => ({ | ||
alpha: C(t.alpha), | ||
depth: C(t.depth), | ||
canvas: Ne(n), | ||
context: C(t.context), | ||
stencil: C(t.stencil), | ||
antialias: C(t.antialias) === void 0 ? !0 : C(t.antialias), | ||
precision: C(t.precision), | ||
powerPreference: C(t.powerPreference), | ||
premultipliedAlpha: C(t.premultipliedAlpha), | ||
preserveDrawingBuffer: C(t.preserveDrawingBuffer), | ||
logarithmicDepthBuffer: C(t.logarithmicDepthBuffer), | ||
failIfMajorPerformanceCaveat: C(t.failIfMajorPerformanceCaveat) | ||
})), l = S(new N(u.value)); | ||
ae(u, () => { | ||
l.value.dispose(), l.value = new N(u.value); | ||
}), k(() => { | ||
l.value.setSize(a.width.value, a.height.value); | ||
const o = k(() => ({ | ||
alpha: E(t.alpha), | ||
depth: E(t.depth), | ||
canvas: Xe(r), | ||
context: E(t.context), | ||
stencil: E(t.stencil), | ||
antialias: E(t.antialias) === void 0 ? !0 : E(t.antialias), | ||
precision: E(t.precision), | ||
powerPreference: E(t.powerPreference), | ||
premultipliedAlpha: E(t.premultipliedAlpha), | ||
preserveDrawingBuffer: E(t.preserveDrawingBuffer), | ||
logarithmicDepthBuffer: E(t.logarithmicDepthBuffer), | ||
failIfMajorPerformanceCaveat: E(t.failIfMajorPerformanceCaveat) | ||
})), i = D(new z(o.value)); | ||
ie(o, () => { | ||
i.value.dispose(), i.value = new z(o.value); | ||
}), A(() => { | ||
i.value.setSize(a.width.value, a.height.value); | ||
}); | ||
const { pixelRatio: c } = Ve(); | ||
k(() => { | ||
l.value.setPixelRatio(c.value); | ||
const { pixelRatio: l } = Ze(); | ||
A(() => { | ||
i.value.setPixelRatio(l.value); | ||
}); | ||
const { logError: m } = B(), i = (() => { | ||
const p = new N(), w = { | ||
const { logError: c } = j(), f = (() => { | ||
const d = new z(), y = { | ||
shadowMap: { | ||
enabled: p.shadowMap.enabled, | ||
type: p.shadowMap.type | ||
enabled: d.shadowMap.enabled, | ||
type: d.shadowMap.type | ||
}, | ||
toneMapping: p.toneMapping, | ||
toneMappingExposure: p.toneMappingExposure, | ||
outputColorSpace: p.outputColorSpace | ||
toneMapping: d.toneMapping, | ||
toneMappingExposure: d.toneMappingExposure, | ||
outputColorSpace: d.outputColorSpace | ||
}; | ||
return p.dispose(), w; | ||
return d.dispose(), y; | ||
})(); | ||
k(() => { | ||
const p = C(t.preset); | ||
p && (p in H || m(`Renderer Preset must be one of these: ${Object.keys(H).join(", ")}`), le(l.value, H[p])); | ||
const w = (P, A) => { | ||
const E = C(P), b = () => { | ||
if (p) | ||
return ee(H[p], A); | ||
A(() => { | ||
const d = E(t.preset); | ||
d && (d in H || c(`Renderer Preset must be one of these: ${Object.keys(H).join(", ")}`), pe(i.value, H[d])); | ||
const y = (M, P) => { | ||
const w = E(M), S = () => { | ||
if (d) | ||
return oe(H[d], P); | ||
}; | ||
if (E !== void 0) | ||
return E; | ||
const g = b(); | ||
return g !== void 0 ? g : ee(i, A); | ||
}, v = (P, A) => ot(l.value, A, w(P, A)); | ||
v(t.shadows, "shadowMap.enabled"), v(t.toneMapping, "toneMapping"), v(t.shadowMapType, "shadowMap.type"), lt < 150 && v(!t.useLegacyLights, "physicallyCorrectLights"), v(t.outputColorSpace, "outputColorSpace"), v(t.toneMappingExposure, "toneMappingExposure"); | ||
const M = w(t.clearColor, "clearColor"); | ||
M && l.value.setClearColor( | ||
M ? et(M) : new F(0) | ||
if (w !== void 0) | ||
return w; | ||
const v = S(); | ||
return v !== void 0 ? v : oe(f, P); | ||
}, p = (M, P) => vt(i.value, P, y(M, P)); | ||
p(t.shadows, "shadowMap.enabled"), p(t.toneMapping, "toneMapping"), p(t.shadowMapType, "shadowMap.type"), bt < 150 && p(!t.useLegacyLights, "physicallyCorrectLights"), p(t.outputColorSpace, "outputColorSpace"), p(t.toneMappingExposure, "toneMappingExposure"); | ||
const C = y(t.clearColor, "clearColor"); | ||
C && i.value.setClearColor( | ||
C ? ct(C) : new N(0) | ||
// default clear color is not easily/efficiently retrievable from three | ||
); | ||
}); | ||
const { pause: s, resume: f, onLoop: d } = ie(); | ||
return d(() => { | ||
o.value && !C(r) && l.value.render(e, o.value); | ||
}), f(), O(() => { | ||
s(), l.value.dispose(), l.value.forceContextLoss(); | ||
const { pause: u, resume: g, onLoop: _ } = me(); | ||
return _(() => { | ||
s.value && !E(n) && i.value.render(e, s.value); | ||
}), g(), U(() => { | ||
u(), i.value.dispose(), i.value.forceContextLoss(); | ||
}), { | ||
renderer: l | ||
renderer: i | ||
}; | ||
} | ||
const te = (e) => typeof e == "function", ct = (e) => !!e && e.constructor === Array; | ||
function ft(e) { | ||
const n = { nodes: {}, materials: {} }; | ||
const ae = (e) => typeof e == "function", Ct = (e) => !!e && e.constructor === Array; | ||
function Mt(e) { | ||
const r = { nodes: {}, materials: {} }; | ||
return e && e.traverse((t) => { | ||
t.name && (n.nodes[t.name] = t), t.material && !n.materials[t.material.name] && (n.materials[t.material.name] = t.material); | ||
}), n; | ||
t.name && (r.nodes[t.name] = t), t.material && !r.materials[t.material.name] && (r.materials[t.material.name] = t.material); | ||
}), r; | ||
} | ||
async function kt(e, n, t, r, a) { | ||
const { logError: o } = B(), u = new e(); | ||
a && a(u), t && t(u); | ||
const c = (Array.isArray(n) ? n : [n]).map( | ||
(m) => new Promise((h, i) => { | ||
u.load( | ||
m, | ||
(s) => { | ||
s.scene && Object.assign(s, ft(s.scene)), h(s); | ||
async function tr(e, r, t, n, a) { | ||
const { logError: s } = j(), o = new e(); | ||
a && a(o), t && t(o); | ||
const l = (Array.isArray(r) ? r : [r]).map( | ||
(c) => new Promise((m, f) => { | ||
o.load( | ||
c, | ||
(u) => { | ||
u.scene && Object.assign(u, Mt(u.scene)), m(u); | ||
}, | ||
r, | ||
(s) => i(o("[useLoader] - Failed to load resource", s)) | ||
n, | ||
(u) => f(s("[useLoader] - Failed to load resource", u)) | ||
); | ||
}) | ||
); | ||
return ct(n) ? await Promise.all(c) : await c[0]; | ||
return Ct(r) ? await Promise.all(l) : await l[0]; | ||
} | ||
async function Tt(e) { | ||
const n = new je(), t = new He(n), r = (a) => new Promise((o, u) => { | ||
async function rr(e) { | ||
const r = new We(), t = new Qe(r), n = (a) => new Promise((s, o) => { | ||
t.load( | ||
a, | ||
(l) => o(l), | ||
(i) => s(i), | ||
() => null, | ||
() => { | ||
u(new Error("[useTextures] - Failed to load texture")); | ||
o(new Error("[useTextures] - Failed to load texture")); | ||
} | ||
); | ||
}); | ||
if (it(e)) { | ||
const a = await Promise.all(e.map((o) => r(o))); | ||
if (yt(e)) { | ||
const a = await Promise.all(e.map((s) => n(s))); | ||
return e.length > 1 ? a : a[0]; | ||
@@ -271,82 +317,82 @@ } else { | ||
map: a, | ||
displacementMap: o, | ||
normalMap: u, | ||
roughnessMap: l, | ||
metalnessMap: c, | ||
aoMap: m, | ||
alphaMap: h, | ||
matcap: i | ||
displacementMap: s, | ||
normalMap: o, | ||
roughnessMap: i, | ||
metalnessMap: l, | ||
aoMap: c, | ||
alphaMap: m, | ||
matcap: f | ||
} = e; | ||
return { | ||
map: a ? await r(a) : null, | ||
displacementMap: o ? await r(o) : null, | ||
normalMap: u ? await r(u) : null, | ||
roughnessMap: l ? await r(l) : null, | ||
metalnessMap: c ? await r(c) : null, | ||
aoMap: m ? await r(m) : null, | ||
alphaMap: h ? await r(h) : null, | ||
matcap: i ? await r(i) : null | ||
map: a ? await n(a) : null, | ||
displacementMap: s ? await n(s) : null, | ||
normalMap: o ? await n(o) : null, | ||
roughnessMap: i ? await n(i) : null, | ||
metalnessMap: l ? await n(l) : null, | ||
aoMap: c ? await n(c) : null, | ||
alphaMap: m ? await n(m) : null, | ||
matcap: f ? await n(f) : null | ||
}; | ||
} | ||
} | ||
const mt = (e, { renderer: n, camera: t, raycaster: r }) => { | ||
const a = D(() => n.value.domElement), { x: o, y: u } = Ge({ target: a }), { width: l, height: c, top: m, left: h } = We(a), i = ({ x: g, y: _ }) => { | ||
const Pt = (e, { renderer: r, camera: t, raycaster: n }) => { | ||
const a = k(() => r.value.domElement), { x: s, y: o } = et({ target: a }), { width: i, height: l, top: c, left: m } = tt(a), f = ({ x: v, y: b }) => { | ||
if (a.value) | ||
return { | ||
x: (g - h.value) / l.value * 2 - 1, | ||
y: -((_ - m.value) / c.value) * 2 + 1 | ||
x: (v - m.value) / i.value * 2 - 1, | ||
y: -((b - c.value) / l.value) * 2 + 1 | ||
}; | ||
}, s = ({ x: g, y: _ }) => { | ||
}, u = ({ x: v, y: b }) => { | ||
if (t.value) | ||
return r.value.setFromCamera(new Fe(g, _), t.value), r.value.intersectObjects(e.value, !1); | ||
}, f = (g) => { | ||
const _ = i({ | ||
x: (g == null ? void 0 : g.clientX) ?? o.value, | ||
y: (g == null ? void 0 : g.clientY) ?? u.value | ||
return n.value.setFromCamera(new Ye(v, b), t.value), n.value.intersectObjects(e.value, !1); | ||
}, g = (v) => { | ||
const b = f({ | ||
x: (v == null ? void 0 : v.clientX) ?? s.value, | ||
y: (v == null ? void 0 : v.clientY) ?? o.value | ||
}); | ||
return _ ? s(_) || [] : []; | ||
}, d = D(() => f()), p = x(), w = x(), v = (g, _) => { | ||
g.trigger({ event: _, intersects: f(_) }); | ||
}, M = (g) => { | ||
v(w, g); | ||
return b ? u(b) || [] : []; | ||
}, _ = k(() => g()), d = L(), y = L(), p = (v, b) => { | ||
v.trigger({ event: b, intersects: g(b) }); | ||
}, C = (v) => { | ||
p(y, v); | ||
}; | ||
let P; | ||
const A = (g) => { | ||
var _; | ||
P = (_ = f(g)[0]) == null ? void 0 : _.object; | ||
}, E = (g) => { | ||
var _; | ||
g instanceof PointerEvent && P === ((_ = f(g)[0]) == null ? void 0 : _.object) && v(p, g); | ||
}, b = (g) => w.trigger({ event: g, intersects: [] }); | ||
return a.value.addEventListener("pointerup", E), a.value.addEventListener("pointerdown", A), a.value.addEventListener("pointermove", M), a.value.addEventListener("pointerleave", b), O(() => { | ||
a != null && a.value && (a.value.removeEventListener("pointerup", E), a.value.removeEventListener("pointerdown", A), a.value.removeEventListener("pointermove", M), a.value.removeEventListener("pointerleave", b)); | ||
let M; | ||
const P = (v) => { | ||
var b; | ||
M = (b = g(v)[0]) == null ? void 0 : b.object; | ||
}, w = (v) => { | ||
var b; | ||
v instanceof PointerEvent && M === ((b = g(v)[0]) == null ? void 0 : b.object) && p(d, v); | ||
}, S = (v) => y.trigger({ event: v, intersects: [] }); | ||
return a.value.addEventListener("pointerup", w), a.value.addEventListener("pointerdown", P), a.value.addEventListener("pointermove", C), a.value.addEventListener("pointerleave", S), U(() => { | ||
a != null && a.value && (a.value.removeEventListener("pointerup", w), a.value.removeEventListener("pointerdown", P), a.value.removeEventListener("pointermove", C), a.value.removeEventListener("pointerleave", S)); | ||
}), { | ||
intersects: d, | ||
onClick: (g) => p.on(g).off, | ||
onPointerMove: (g) => w.on(g).off | ||
intersects: _, | ||
onClick: (v) => d.on(v).off, | ||
onPointerMove: (v) => y.on(v).off | ||
}; | ||
}; | ||
function St() { | ||
const { logWarning: e } = B(); | ||
function n(o, u, l) { | ||
let c = null; | ||
return o.traverse((m) => { | ||
m[u] === l && (c = m); | ||
}), c || e(`Child with ${u} '${l}' not found.`), c; | ||
function nr() { | ||
const { logWarning: e } = j(); | ||
function r(s, o, i) { | ||
let l = null; | ||
return s.traverse((c) => { | ||
c[o] === i && (l = c); | ||
}), l || e(`Child with ${o} '${i}' not found.`), l; | ||
} | ||
function t(o, u, l) { | ||
const c = []; | ||
return o.traverse((m) => { | ||
m[u].includes(l) && c.push(m); | ||
}), c.length || e(`Children with ${u} '${l}' not found.`), c; | ||
function t(s, o, i) { | ||
const l = []; | ||
return s.traverse((c) => { | ||
c[o].includes(i) && l.push(c); | ||
}), l.length || e(`Children with ${o} '${i}' not found.`), l; | ||
} | ||
function r(o, u) { | ||
return n(o, "name", u); | ||
function n(s, o) { | ||
return r(s, "name", o); | ||
} | ||
function a(o, u) { | ||
return t(o, "name", u); | ||
function a(s, o) { | ||
return t(s, "name", o); | ||
} | ||
return { | ||
seek: n, | ||
seekByName: r, | ||
seek: r, | ||
seekByName: n, | ||
seekAll: t, | ||
@@ -356,4 +402,4 @@ seekAllByName: a | ||
} | ||
const pt = ({ scene: e, contextParts: n }) => { | ||
const t = ge({ | ||
const St = ({ scene: e, contextParts: r }) => { | ||
const t = le({ | ||
click: /* @__PURE__ */ new Map(), | ||
@@ -363,81 +409,84 @@ pointerMove: /* @__PURE__ */ new Map(), | ||
pointerLeave: /* @__PURE__ */ new Map() | ||
}), r = L(/* @__PURE__ */ new Set()), a = (s) => { | ||
r.value.add(s); | ||
}, o = (s) => { | ||
r.value.delete(s); | ||
}, u = (s) => { | ||
Object.values(t).forEach((f) => f.delete(s)), o(s); | ||
}, l = (s) => { | ||
const { onClick: f, onPointerMove: d, onPointerEnter: p, onPointerLeave: w } = s; | ||
f && t.click.set(s, f), d && t.pointerMove.set(s, d), p && t.pointerEnter.set(s, p), w && t.pointerLeave.set(s, w); | ||
}), n = B(/* @__PURE__ */ new Set()), a = (u) => { | ||
n.value.add(u); | ||
}, s = (u) => { | ||
n.value.delete(u); | ||
}, o = (u) => { | ||
Object.values(t).forEach((g) => g.delete(u)), s(u); | ||
}, i = (u) => { | ||
const { onClick: g, onPointerMove: _, onPointerEnter: d, onPointerLeave: y } = u; | ||
g && t.click.set(u, g), _ && t.pointerMove.set(u, _), d && t.pointerEnter.set(u, d), y && t.pointerLeave.set(u, y); | ||
}; | ||
e.userData.tres__registerAtPointerEventHandler = l, e.userData.tres__deregisterAtPointerEventHandler = u, e.userData.tres__registerBlockingObjectAtPointerEventHandler = a, e.userData.tres__deregisterBlockingObjectAtPointerEventHandler = o; | ||
const c = D( | ||
() => nt( | ||
e.userData.tres__registerAtPointerEventHandler = i, e.userData.tres__deregisterAtPointerEventHandler = o, e.userData.tres__registerBlockingObjectAtPointerEventHandler = a, e.userData.tres__deregisterBlockingObjectAtPointerEventHandler = s; | ||
const l = k( | ||
() => gt( | ||
[ | ||
...Array.from(r.value), | ||
...Object.values(t).map((s) => Array.from(s.keys())).flat() | ||
...Array.from(n.value), | ||
...Object.values(t).map((u) => Array.from(u.keys())).flat() | ||
], | ||
({ uuid: s }) => s | ||
({ uuid: u }) => u | ||
) | ||
), { onClick: m, onPointerMove: h } = mt(c, n); | ||
m(({ intersects: s, event: f }) => { | ||
var d; | ||
s.length && ((d = t.click.get(s[0].object)) == null || d(s[0], f)); | ||
), { onClick: c, onPointerMove: m } = Pt(l, r); | ||
c(({ intersects: u, event: g }) => { | ||
var _; | ||
u.length && ((_ = t.click.get(u[0].object)) == null || _(u[0], g)); | ||
}); | ||
let i; | ||
return h(({ intersects: s, event: f }) => { | ||
var M, P, A, E; | ||
const d = (M = s == null ? void 0 : s[0]) == null ? void 0 : M.object, { pointerLeave: p, pointerEnter: w, pointerMove: v } = t; | ||
i && i !== d && ((P = p.get(i)) == null || P(i, f)), d && (i !== d && ((A = w.get(d)) == null || A(s[0], f)), (E = v.get(d)) == null || E(s[0], f)), i = d || null; | ||
let f; | ||
return m(({ intersects: u, event: g }) => { | ||
var C, M, P, w; | ||
const _ = (C = u == null ? void 0 : u[0]) == null ? void 0 : C.object, { pointerLeave: d, pointerEnter: y, pointerMove: p } = t; | ||
f && f !== _ && ((M = d.get(f)) == null || M(f, g)), _ && (f !== _ && ((P = y.get(_)) == null || P(u[0], g)), (w = p.get(_)) == null || w(u[0], g)), f = _ || null; | ||
}), { | ||
registerObject: l, | ||
deregisterObject: u | ||
registerObject: i, | ||
deregisterObject: o | ||
}; | ||
}; | ||
function dt(e) { | ||
let n = 0; | ||
function ve(e) { | ||
let r = 0; | ||
return e.traverse((t) => { | ||
if (t.isMesh && t.geometry) { | ||
const r = t.geometry, a = r.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, o = r.index ? r.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, u = r.attributes.normal ? r.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, l = r.attributes.uv ? r.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, c = a + o + u + l; | ||
n += c; | ||
const n = t.geometry, a = n.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, s = n.index ? n.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, o = n.attributes.normal ? n.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, i = n.attributes.uv ? n.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, l = a + s + o + i; | ||
r += l; | ||
} | ||
}), n; | ||
}), r; | ||
} | ||
const q = L({}), Y = (e) => Object.assign(q.value, e); | ||
function vt({ | ||
function kt(e) { | ||
return (e / 1024).toFixed(2); | ||
} | ||
const J = B({}), X = (e) => Object.assign(J.value, e); | ||
function Tt({ | ||
scene: e, | ||
canvas: n, | ||
canvas: r, | ||
windowSize: t, | ||
disableRender: r, | ||
disableRender: n, | ||
rendererOptions: a | ||
}) { | ||
const o = D( | ||
() => C(t) ? qe() : Ue(C(n).parentElement) | ||
), u = D(() => o.value.width.value), l = D(() => o.value.height.value), c = D(() => u.value / l.value), m = { | ||
height: l, | ||
width: u, | ||
aspectRatio: c | ||
}, h = S(e), { | ||
camera: i, | ||
cameras: s, | ||
registerCamera: f, | ||
deregisterCamera: d, | ||
setCameraActive: p | ||
} = Ke({ sizes: m, scene: e }), { renderer: w } = ut( | ||
const s = k( | ||
() => E(t) ? rt() : nt(E(r).parentElement) | ||
), o = k(() => s.value.width.value), i = k(() => s.value.height.value), l = k(() => o.value / i.value), c = { | ||
height: i, | ||
width: o, | ||
aspectRatio: l | ||
}, m = D(e), { | ||
camera: f, | ||
cameras: u, | ||
registerCamera: g, | ||
deregisterCamera: _, | ||
setCameraActive: d | ||
} = st({ sizes: c, scene: e }), { renderer: y } = Et( | ||
{ | ||
scene: e, | ||
canvas: n, | ||
canvas: r, | ||
options: a, | ||
contextParts: { sizes: m, camera: i }, | ||
disableRender: r | ||
contextParts: { sizes: c, camera: f }, | ||
disableRender: n | ||
} | ||
), v = { | ||
sizes: m, | ||
scene: h, | ||
camera: i, | ||
cameras: ye(s), | ||
renderer: w, | ||
raycaster: S(new ze()), | ||
controls: L(null), | ||
), p = { | ||
sizes: c, | ||
scene: m, | ||
camera: f, | ||
cameras: Se(u), | ||
renderer: y, | ||
raycaster: D(new Je()), | ||
controls: B(null), | ||
perf: { | ||
@@ -455,23 +504,23 @@ maxFrames: 160, | ||
}, | ||
extend: Y, | ||
registerCamera: f, | ||
setCameraActive: p, | ||
deregisterCamera: d | ||
extend: X, | ||
registerCamera: g, | ||
setCameraActive: d, | ||
deregisterCamera: _ | ||
}; | ||
G("useTres", v); | ||
const M = 100, P = Ye({ every: M }), { isSupported: A, memory: E } = Je({ interval: M }), b = 160; | ||
let g = performance.now(); | ||
const _ = ({ timestamp: R }) => { | ||
v.scene.value && (v.perf.memory.allocatedMem = dt(v.scene.value)), R - g >= M && (g = R, v.perf.fps.accumulator.push(P.value), v.perf.fps.accumulator.length > b && v.perf.fps.accumulator.shift(), v.perf.fps.value = P.value, A.value && E.value && (v.perf.memory.accumulator.push(E.value.usedJSHeapSize / 1024 / 1024), v.perf.memory.accumulator.length > b && v.perf.memory.accumulator.shift(), v.perf.memory.currentMem = v.perf.memory.accumulator.reduce((de, ve) => de + ve, 0) / v.perf.memory.accumulator.length)); | ||
Q("useTres", p); | ||
const C = 100, M = ot({ every: C }), { isSupported: P, memory: w } = at({ interval: C }), S = 160; | ||
let v = performance.now(); | ||
const b = ({ timestamp: I }) => { | ||
p.scene.value && (p.perf.memory.allocatedMem = ve(p.scene.value)), I - v >= C && (v = I, p.perf.fps.accumulator.push(M.value), p.perf.fps.accumulator.length > S && p.perf.fps.accumulator.shift(), p.perf.fps.value = M.value, P.value && w.value && (p.perf.memory.accumulator.push(w.value.usedJSHeapSize / 1024 / 1024), p.perf.memory.accumulator.length > S && p.perf.memory.accumulator.shift(), p.perf.memory.currentMem = p.perf.memory.accumulator.reduce((Ee, Ce) => Ee + Ce, 0) / p.perf.memory.accumulator.length)); | ||
}; | ||
let I = 0; | ||
const me = 1, { pause: pe, resume: Ct } = ne(({ delta: R }) => { | ||
window.__TRES__DEVTOOLS__ && (_({ timestamp: performance.now() }), I += R, I >= me && (window.__TRES__DEVTOOLS__.cb(v), I = 0)); | ||
let F = 0; | ||
const we = 1, { pause: be, resume: Yt } = ce(({ delta: I }) => { | ||
window.__TRES__DEVTOOLS__ && (b({ timestamp: performance.now() }), F += I, F >= we && (window.__TRES__DEVTOOLS__.cb(p), F = 0)); | ||
}, { immediate: !0 }); | ||
return O(() => { | ||
pe(); | ||
}), v; | ||
return U(() => { | ||
be(); | ||
}), p; | ||
} | ||
function gt() { | ||
const e = he("useTres"); | ||
function Ot() { | ||
const e = ke("useTres"); | ||
if (!e) | ||
@@ -481,5 +530,5 @@ throw new Error("useTresContext must be used together with useTresContextProvider"); | ||
} | ||
const xt = gt; | ||
let y = null; | ||
const { logError: re } = B(), V = [ | ||
const or = Ot; | ||
let h = null; | ||
const { logError: se } = j(), W = [ | ||
"onClick", | ||
@@ -489,35 +538,35 @@ "onPointerMove", | ||
"onPointerLeave" | ||
], fe = { | ||
createElement(e, n, t, r) { | ||
var u, l; | ||
if (r || (r = {}), r.args || (r.args = []), e === "template" || rt(e)) | ||
], At = { | ||
createElement(e, r, t, n) { | ||
var o, i; | ||
if (n || (n = {}), n.args || (n.args = []), e === "template" || mt(e)) | ||
return null; | ||
let a = e.replace("Tres", ""), o; | ||
let a = e.replace("Tres", ""), s; | ||
if (e === "primitive") { | ||
(r == null ? void 0 : r.object) === void 0 && re("Tres primitives need a prop 'object'"); | ||
const c = r.object; | ||
a = c.type, o = Object.assign(c, { type: a, attach: r.attach, primitive: !0 }); | ||
(n == null ? void 0 : n.object) === void 0 && se("Tres primitives need a prop 'object'"); | ||
const l = n.object; | ||
a = l.type, s = Object.assign(l, { type: a, attach: n.attach, primitive: !0 }); | ||
} else { | ||
const c = q.value[a]; | ||
c || re(`${a} is not defined on the THREE namespace. Use extend to add it to the catalog.`), o = new c(...r.args); | ||
const l = J.value[a]; | ||
l || se(`${a} is not defined on the THREE namespace. Use extend to add it to the catalog.`), s = new l(...n.args); | ||
} | ||
return o.isCamera && (r != null && r.position || o.position.set(3, 3, 3), r != null && r.lookAt || o.lookAt(0, 0, 0)), (r == null ? void 0 : r.attach) === void 0 && (o.isMaterial ? o.attach = "material" : o.isBufferGeometry && (o.attach = "geometry")), o.isObject3D && ((u = r == null ? void 0 : r.material) != null && u.isMaterial && (o.userData.tres__materialViaProp = !0), (l = r == null ? void 0 : r.geometry) != null && l.isBufferGeometry && (o.userData.tres__geometryViaProp = !0)), o.userData = { | ||
...o.userData, | ||
return s.isCamera && (n != null && n.position || s.position.set(3, 3, 3), n != null && n.lookAt || s.lookAt(0, 0, 0)), (n == null ? void 0 : n.attach) === void 0 && (s.isMaterial ? s.attach = "material" : s.isBufferGeometry && (s.attach = "geometry")), s.isObject3D && ((o = n == null ? void 0 : n.material) != null && o.isMaterial && (s.userData.tres__materialViaProp = !0), (i = n == null ? void 0 : n.geometry) != null && i.isBufferGeometry && (s.userData.tres__geometryViaProp = !0)), s.userData = { | ||
...s.userData, | ||
tres__name: a | ||
}, o; | ||
}, s; | ||
}, | ||
insert(e, n) { | ||
var r, a, o, u; | ||
n && n.isScene && (y = n); | ||
const t = n || y; | ||
insert(e, r) { | ||
var n, a, s, o; | ||
r && r.isScene && (h = r); | ||
const t = r || h; | ||
if (e != null && e.isObject3D) { | ||
if (e != null && e.isCamera) { | ||
if (!(y != null && y.userData.tres__registerCamera)) | ||
if (!(h != null && h.userData.tres__registerCamera)) | ||
throw "could not find tres__registerCamera on scene's userData"; | ||
(a = y == null ? void 0 : (r = y.userData).tres__registerCamera) == null || a.call(r, e); | ||
(a = h == null ? void 0 : (n = h.userData).tres__registerCamera) == null || a.call(n, e); | ||
} | ||
if (e && V.some((l) => e[l])) { | ||
if (!(y != null && y.userData.tres__registerAtPointerEventHandler)) | ||
if (e && W.some((i) => e[i])) { | ||
if (!(h != null && h.userData.tres__registerAtPointerEventHandler)) | ||
throw "could not find tres__registerAtPointerEventHandler on scene's userData"; | ||
(u = y == null ? void 0 : (o = y.userData).tres__registerAtPointerEventHandler) == null || u.call(o, e); | ||
(o = h == null ? void 0 : (s = h.userData).tres__registerAtPointerEventHandler) == null || o.call(s, e); | ||
} | ||
@@ -528,62 +577,62 @@ } | ||
remove(e) { | ||
var c, m, h; | ||
if (!e) | ||
return; | ||
const n = (i) => { | ||
var f, d; | ||
const s = i; | ||
i.userData.tres__materialViaProp || ((f = s.material) == null || f.dispose(), delete s.material), i.userData.tres__geometryViaProp || ((d = s.geometry) == null || d.dispose(), delete s.geometry); | ||
}, t = y == null ? void 0 : y.userData.tres__deregisterAtPointerEventHandler, r = y == null ? void 0 : y.userData.tres__deregisterBlockingObjectAtPointerEventHandler, a = (i) => { | ||
var s, f; | ||
if (!r) | ||
throw "could not find tres__deregisterBlockingObjectAtPointerEventHandler on scene's userData"; | ||
if ((f = y == null ? void 0 : (s = y.userData).tres__deregisterBlockingObjectAtPointerEventHandler) == null || f.call(s, i), !t) | ||
throw "could not find tres__deregisterAtPointerEventHandler on scene's userData"; | ||
i && V.some((d) => i[d]) && (t == null || t(i)); | ||
}, o = (i) => { | ||
const s = y == null ? void 0 : y.userData.tres__deregisterCamera; | ||
if (!s) | ||
throw "could not find tres__deregisterCamera on scene's userData"; | ||
i.isCamera && (s == null || s(i)); | ||
}, u = e == null ? void 0 : e.primitive, l = !u && (e.dispose === void 0 ? e.dispose !== null : !1); | ||
if (e != null && e.isObject3D && ((c = e.parent) != null && c.isObject3D) && (e.parent.remove(e), (m = e.removeFromParent) == null || m.call(e)), !u && (e != null && e.isObject3D)) { | ||
e.children.forEach((i) => fe.remove(i)), n(e), o(e), a == null || a(e); | ||
for (const i in e) | ||
i !== "geometry" && i !== "material" && ((h = i.dispose) == null || h.call(i), delete e[i]); | ||
var r, t; | ||
if (e) { | ||
if (e.isObject3D) { | ||
const n = e, a = (c) => { | ||
var f, u; | ||
const m = c; | ||
c.userData.tres__materialViaProp || ((f = m.material) == null || f.dispose(), m.material = void 0), c.userData.tres__geometryViaProp || ((u = m.geometry) == null || u.dispose(), m.geometry = void 0); | ||
}, s = h == null ? void 0 : h.userData.tres__deregisterAtPointerEventHandler, o = h == null ? void 0 : h.userData.tres__deregisterBlockingObjectAtPointerEventHandler, i = (c) => { | ||
var m, f; | ||
if (!o) | ||
throw "could not find tres__deregisterBlockingObjectAtPointerEventHandler on scene's userData"; | ||
if ((f = h == null ? void 0 : (m = h.userData).tres__deregisterBlockingObjectAtPointerEventHandler) == null || f.call(m, c), !s) | ||
throw "could not find tres__deregisterAtPointerEventHandler on scene's userData"; | ||
c && W.some((u) => c[u]) && (s == null || s(c)); | ||
}, l = (c) => { | ||
const m = h == null ? void 0 : h.userData.tres__deregisterCamera; | ||
if (!m) | ||
throw "could not find tres__deregisterCamera on scene's userData"; | ||
c.isCamera && (m == null || m(c)); | ||
}; | ||
(r = e.removeFromParent) == null || r.call(e), n.traverse((c) => { | ||
a(c), l(c), i == null || i(c); | ||
}), a(n), l(n), i == null || i(n); | ||
} | ||
(t = e.dispose) == null || t.call(e); | ||
} | ||
l && e.dispose && e.type !== "Scene" && e.dispose(); | ||
}, | ||
patchProp(e, n, t, r) { | ||
var a, o, u, l; | ||
patchProp(e, r, t, n) { | ||
var a, s, o, i; | ||
if (e) { | ||
let c = e, m = n; | ||
if (e.isObject3D && m === "blocks-pointer-events") { | ||
r || r === "" ? (o = y == null ? void 0 : (a = y.userData).tres__registerBlockingObjectAtPointerEventHandler) == null || o.call(a, e) : (l = y == null ? void 0 : (u = y.userData).tres__deregisterBlockingObjectAtPointerEventHandler) == null || l.call(u, e); | ||
let l = e, c = r; | ||
if (e.isObject3D && c === "blocks-pointer-events") { | ||
n || n === "" ? (s = h == null ? void 0 : (a = h.userData).tres__registerBlockingObjectAtPointerEventHandler) == null || s.call(a, e) : (i = h == null ? void 0 : (o = h.userData).tres__deregisterBlockingObjectAtPointerEventHandler) == null || i.call(o, e); | ||
return; | ||
} | ||
let h = j(m), i = c == null ? void 0 : c[h]; | ||
if (m === "args") { | ||
const f = e, d = t ?? [], p = r ?? [], w = e.userData.tres__name || e.type; | ||
w && d.length && !st(d, p) && (c = Object.assign(f, new q.value[w](...r))); | ||
let m = R(c), f = l == null ? void 0 : l[m]; | ||
if (c === "args") { | ||
const g = e, _ = t ?? [], d = n ?? [], y = e.userData.tres__name || e.type; | ||
y && _.length && !ht(_, d) && (l = Object.assign(g, new J.value[y](...n))); | ||
return; | ||
} | ||
if (c.type === "BufferGeometry") { | ||
if (m === "args") | ||
if (l.type === "BufferGeometry") { | ||
if (c === "args") | ||
return; | ||
c.setAttribute( | ||
j(m), | ||
new $e(...r) | ||
l.setAttribute( | ||
R(c), | ||
new Ke(...n) | ||
); | ||
return; | ||
} | ||
if (m.includes("-") && i === void 0) { | ||
const f = m.split("-"); | ||
i = f.reduce((d, p) => d[j(p)], c), m = f.pop(), h = m.toLowerCase(), i != null && i.set || (c = f.reduce((d, p) => d[j(p)], c)); | ||
if (c.includes("-") && f === void 0) { | ||
const g = c.split("-"); | ||
f = g.reduce((_, d) => _[R(d)], l), c = g.pop(), m = c.toLowerCase(), f != null && f.set || (l = g.reduce((_, d) => _[R(d)], l)); | ||
} | ||
let s = r; | ||
if (s === "" && (s = !0), te(i)) { | ||
V.includes(n) || (Array.isArray(s) ? e[h](...s) : e[h](s)); | ||
let u = n; | ||
if (u === "" && (u = !0), ae(f)) { | ||
W.includes(r) || (Array.isArray(u) ? e[m](...u) : e[m](u)); | ||
return; | ||
} | ||
!(i != null && i.set) && !te(i) ? c[h] = s : i.constructor === s.constructor && (i != null && i.copy) ? i == null || i.copy(s) : Array.isArray(s) ? i.set(...s) : !i.isColor && i.setScalar ? i.setScalar(s) : i.set(s); | ||
!(f != null && f.set) && !ae(f) ? l[m] = u : f.constructor === u.constructor && (f != null && f.copy) ? f == null || f.copy(u) : Array.isArray(u) ? f.set(...u) : !f.isColor && f.setScalar ? f.setScalar(u) : f.set(u); | ||
} | ||
@@ -603,5 +652,284 @@ }, | ||
insertStaticContent: () => void 0 | ||
}, { render: yt } = we(fe); | ||
Y(De); | ||
const ht = ["data-scene"], wt = /* @__PURE__ */ J({ | ||
}, { render: xt } = Te(At); | ||
X(ue); | ||
function Dt() { | ||
return he().__VUE_DEVTOOLS_GLOBAL_HOOK__; | ||
} | ||
function he() { | ||
return typeof navigator < "u" && typeof window < "u" ? window : typeof global < "u" ? global : {}; | ||
} | ||
const Lt = typeof Proxy == "function", Bt = "devtools-plugin:setup", jt = "plugin:settings:set"; | ||
let T, K; | ||
function It() { | ||
var e; | ||
return T !== void 0 || (typeof window < "u" && window.performance ? (T = !0, K = window.performance) : typeof global < "u" && (!((e = global.perf_hooks) === null || e === void 0) && e.performance) ? (T = !0, K = global.perf_hooks.performance) : T = !1), T; | ||
} | ||
function Rt() { | ||
return It() ? K.now() : Date.now(); | ||
} | ||
class Ht { | ||
constructor(r, t) { | ||
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = r, this.hook = t; | ||
const n = {}; | ||
if (r.settings) | ||
for (const o in r.settings) { | ||
const i = r.settings[o]; | ||
n[o] = i.defaultValue; | ||
} | ||
const a = `__vue-devtools-plugin-settings__${r.id}`; | ||
let s = Object.assign({}, n); | ||
try { | ||
const o = localStorage.getItem(a), i = JSON.parse(o); | ||
Object.assign(s, i); | ||
} catch { | ||
} | ||
this.fallbacks = { | ||
getSettings() { | ||
return s; | ||
}, | ||
setSettings(o) { | ||
try { | ||
localStorage.setItem(a, JSON.stringify(o)); | ||
} catch { | ||
} | ||
s = o; | ||
}, | ||
now() { | ||
return Rt(); | ||
} | ||
}, t && t.on(jt, (o, i) => { | ||
o === this.plugin.id && this.fallbacks.setSettings(i); | ||
}), this.proxiedOn = new Proxy({}, { | ||
get: (o, i) => this.target ? this.target.on[i] : (...l) => { | ||
this.onQueue.push({ | ||
method: i, | ||
args: l | ||
}); | ||
} | ||
}), this.proxiedTarget = new Proxy({}, { | ||
get: (o, i) => this.target ? this.target[i] : i === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(i) ? (...l) => (this.targetQueue.push({ | ||
method: i, | ||
args: l, | ||
resolve: () => { | ||
} | ||
}), this.fallbacks[i](...l)) : (...l) => new Promise((c) => { | ||
this.targetQueue.push({ | ||
method: i, | ||
args: l, | ||
resolve: c | ||
}); | ||
}) | ||
}); | ||
} | ||
async setRealTarget(r) { | ||
this.target = r; | ||
for (const t of this.onQueue) | ||
this.target.on[t.method](...t.args); | ||
for (const t of this.targetQueue) | ||
t.resolve(await this.target[t.method](...t.args)); | ||
} | ||
} | ||
function Nt(e, r) { | ||
const t = e, n = he(), a = Dt(), s = Lt && t.enableEarlyProxy; | ||
if (a && (n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !s)) | ||
a.emit(Bt, e, r); | ||
else { | ||
const o = s ? new Ht(t, a) : null; | ||
(n.__VUE_DEVTOOLS_PLUGINS__ = n.__VUE_DEVTOOLS_PLUGINS__ || []).push({ | ||
pluginDescriptor: t, | ||
setupFn: r, | ||
proxy: o | ||
}), o && r(o.proxiedTarget); | ||
} | ||
} | ||
function Vt(e, r) { | ||
const t = `▲ ■ ●${e}`; | ||
typeof __VUE_DEVTOOLS_TOAST__ == "function" ? __VUE_DEVTOOLS_TOAST__(t, r) : r === "error" ? console.error(t) : r === "warn" ? console.warn(t) : console.log(t); | ||
} | ||
const ye = (e) => { | ||
const r = { | ||
id: e.uuid, | ||
label: e.type, | ||
children: [], | ||
tags: [] | ||
}; | ||
e.name !== "" && r.tags.push({ | ||
label: e.name, | ||
textColor: 5750629, | ||
backgroundColor: 15793395 | ||
}); | ||
const t = ve(e); | ||
return t > 0 && r.tags.push({ | ||
label: `${kt(t)} KB`, | ||
textColor: 15707189, | ||
backgroundColor: 16775644, | ||
tooltip: "Memory usage" | ||
}), e.type.includes("Light") && (r.tags.push({ | ||
label: `${e.intensity}`, | ||
textColor: 9738662, | ||
backgroundColor: 16316922, | ||
tooltip: "Intensity" | ||
}), r.tags.push({ | ||
label: `#${e.color.getHexString()}`, | ||
textColor: 9738662, | ||
backgroundColor: 16316922, | ||
tooltip: "Color" | ||
})), e.type.includes("Camera") && (r.tags.push({ | ||
label: `${e.fov}°`, | ||
textColor: 9738662, | ||
backgroundColor: 16316922, | ||
tooltip: "Field of view" | ||
}), r.tags.push({ | ||
// eslint-disable-next-line max-len | ||
label: `x: ${Math.round(e.position.x)} y: ${Math.round(e.position.y)} z: ${Math.round(e.position.z)}`, | ||
textColor: 9738662, | ||
backgroundColor: 16316922, | ||
tooltip: "Position" | ||
})), r; | ||
}; | ||
function _e(e, r) { | ||
e.children.forEach((t) => { | ||
if (t.type === "HightlightMesh") | ||
return; | ||
const n = ye(t); | ||
r.children.push(n), _e(t, n); | ||
}); | ||
} | ||
const $t = [], O = "tres:inspector", Ut = le({ | ||
sceneGraph: null | ||
}); | ||
function Ft(e, r) { | ||
Nt( | ||
{ | ||
id: "dev.esm.tres", | ||
label: "TresJS 🪐", | ||
logo: "https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg", | ||
packageName: "tresjs", | ||
homepage: "https://tresjs.org", | ||
componentStateTypes: $t, | ||
app: e | ||
}, | ||
(t) => { | ||
typeof t.now != "function" && Vt( | ||
// eslint-disable-next-line max-len | ||
"You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html." | ||
), t.addInspector({ | ||
id: O, | ||
label: "TresJS 🪐", | ||
icon: "account_tree", | ||
treeFilterPlaceholder: "Search instances" | ||
}), setInterval(() => { | ||
t.sendInspectorTree(O); | ||
}, 1e3), setInterval(() => { | ||
t.notifyComponentUpdate(); | ||
}, 5e3), t.on.getInspectorTree((s) => { | ||
if (s.inspectorId === O) { | ||
const o = ye(r.scene.value); | ||
_e(r.scene.value, o), Ut.sceneGraph = o, s.rootNodes = [o]; | ||
} | ||
}); | ||
let n = null, a = null; | ||
t.on.getInspectorState((s) => { | ||
if (s.inspectorId === O) { | ||
const [o] = r.scene.value.getObjectsByProperty("uuid", s.nodeId); | ||
if (!o) | ||
return; | ||
if (a && n && n.parent && a.remove(n), o.isMesh) { | ||
const i = wt(o); | ||
o.add(i), n = i, a = o; | ||
} | ||
s.state = { | ||
object: [ | ||
{ | ||
key: "uuid", | ||
editable: !0, | ||
value: o.uuid | ||
}, | ||
{ | ||
key: "name", | ||
editable: !0, | ||
value: o.name | ||
}, | ||
{ | ||
key: "type", | ||
editable: !0, | ||
value: o.type | ||
}, | ||
{ | ||
key: "position", | ||
editable: !0, | ||
value: o.position | ||
}, | ||
{ | ||
key: "rotation", | ||
editable: !0, | ||
value: o.rotation | ||
}, | ||
{ | ||
key: "scale", | ||
editable: !0, | ||
value: o.scale | ||
}, | ||
{ | ||
key: "geometry", | ||
value: o.geometry | ||
}, | ||
{ | ||
key: "material", | ||
value: o.material | ||
}, | ||
{ | ||
key: "color", | ||
editable: !0, | ||
value: o.color | ||
}, | ||
{ | ||
key: "intensity", | ||
editable: !0, | ||
value: o.intensity | ||
}, | ||
{ | ||
key: "castShadow", | ||
editable: !0, | ||
value: o.castShadow | ||
}, | ||
{ | ||
key: "receiveShadow", | ||
editable: !0, | ||
value: o.receiveShadow | ||
}, | ||
{ | ||
key: "frustumCulled", | ||
editable: !0, | ||
value: o.frustumCulled | ||
}, | ||
{ | ||
key: "matrixAutoUpdate", | ||
editable: !0, | ||
value: o.matrixAutoUpdate | ||
}, | ||
{ | ||
key: "matrixWorldNeedsUpdate", | ||
editable: !0, | ||
value: o.matrixWorldNeedsUpdate | ||
}, | ||
{ | ||
key: "matrixWorld", | ||
value: o.matrixWorld | ||
}, | ||
{ | ||
key: "visible", | ||
editable: !0, | ||
value: o.visible | ||
} | ||
] | ||
}; | ||
} | ||
}), t.on.editInspectorState((s) => { | ||
s.inspectorId === O && _t(r.scene.value, s.nodeId, s.path, s.state.value); | ||
}); | ||
} | ||
); | ||
} | ||
const Gt = ["data-scene"], zt = /* @__PURE__ */ Z({ | ||
__name: "TresCanvas", | ||
@@ -632,32 +960,29 @@ props: { | ||
}, | ||
setup(e, { expose: n }) { | ||
var d; | ||
const t = e, { logWarning: r } = B(), a = L(), o = S(new Ie()); | ||
ie(); | ||
const u = Ee(), l = (d = K()) == null ? void 0 : d.appContext.app; | ||
let c = null; | ||
const m = (p) => J({ | ||
setup(e, { expose: r }) { | ||
var _; | ||
const t = e, { logWarning: n } = j(), a = B(), s = D(new qe()), { resume: o } = me(), i = Oe(), l = (_ = ee()) == null ? void 0 : _.appContext.app, c = (d) => Z({ | ||
setup() { | ||
var v; | ||
const w = (v = K()) == null ? void 0 : v.appContext; | ||
return w && (w.app = l), G("useTres", p), G("extend", Y), () => X(be, null, u != null && u.default ? u.default() : []); | ||
var p; | ||
const y = (p = ee()) == null ? void 0 : p.appContext; | ||
return y && (y.app = l), Q("useTres", d), Q("extend", X), typeof window < "u" && Ft(y.app, d), () => te(je, null, i != null && i.default ? i.default() : []); | ||
} | ||
}), h = (p) => { | ||
c = m(p), yt(X(c), o.value); | ||
}, i = (p) => { | ||
ce(o.value), o.value = null; | ||
}, s = D(() => t.disableRender), f = S(null); | ||
return n({ context: f, dispose: () => i(f.value) }), _e(() => { | ||
const p = a; | ||
f.value = vt({ | ||
scene: o.value, | ||
canvas: p, | ||
}), m = (d) => { | ||
const y = c(d); | ||
xt(te(y), s.value); | ||
}, f = (d, y = !1) => { | ||
s.value.children = [], y && (d.renderer.value.dispose(), d.renderer.value.renderLists.dispose(), d.renderer.value.forceContextLoss()), m(d), o(); | ||
}, u = k(() => t.disableRender), g = D(null); | ||
return r({ context: g, dispose: () => f(g.value, !0) }), Ae(() => { | ||
const d = a; | ||
g.value = Tt({ | ||
scene: s.value, | ||
canvas: d, | ||
windowSize: t.windowSize, | ||
disableRender: s, | ||
disableRender: u, | ||
rendererOptions: t | ||
}), pt({ scene: o.value, contextParts: f.value }); | ||
const { registerCamera: w, camera: v, cameras: M, deregisterCamera: P } = f.value; | ||
h(f.value); | ||
const A = () => { | ||
const E = new W( | ||
}), St({ scene: s.value, contextParts: g.value }); | ||
const { registerCamera: y, camera: p, cameras: C, deregisterCamera: M } = g.value; | ||
m(g.value); | ||
const P = () => { | ||
const w = new Y( | ||
45, | ||
@@ -668,11 +993,11 @@ window.innerWidth / window.innerHeight, | ||
); | ||
E.position.set(3, 3, 3), E.lookAt(0, 0, 0), w(E); | ||
const b = k(() => { | ||
M.value.length >= 2 && (E.removeFromParent(), P(E), b == null || b()); | ||
w.position.set(3, 3, 3), w.lookAt(0, 0, 0), y(w); | ||
const S = A(() => { | ||
C.value.length >= 2 && (w.removeFromParent(), M(w), S == null || S()); | ||
}); | ||
}; | ||
ae( | ||
ie( | ||
() => t.camera, | ||
(E, b) => { | ||
E && w(E), b && (b.removeFromParent(), P(b)); | ||
(w, S) => { | ||
w && y(w), S && (S.removeFromParent(), M(S)); | ||
}, | ||
@@ -682,17 +1007,15 @@ { | ||
} | ||
), v.value || (r( | ||
), p.value || (n( | ||
"No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene." | ||
), A()); | ||
}), O(() => { | ||
f.value && i(f.value); | ||
}), (p, w) => (Ce(), Me("canvas", { | ||
), P()); | ||
}), (d, y) => (xe(), De("canvas", { | ||
ref_key: "canvas", | ||
ref: a, | ||
"data-scene": o.value.uuid, | ||
class: Pe(p.$attrs.class), | ||
style: Ae({ | ||
"data-scene": s.value.uuid, | ||
class: Le(d.$attrs.class), | ||
style: Be({ | ||
display: "block", | ||
width: "100%", | ||
height: "100%", | ||
position: p.windowSize ? "fixed" : "relative", | ||
position: d.windowSize ? "fixed" : "relative", | ||
top: 0, | ||
@@ -702,44 +1025,43 @@ left: 0, | ||
touchAction: "none", | ||
...p.$attrs.style | ||
...d.$attrs.style | ||
}) | ||
}, null, 14, ht)); | ||
}, null, 14, Gt)); | ||
} | ||
}), Et = [ | ||
}), Wt = [ | ||
"TresCanvas", | ||
"TresLeches", | ||
"TresScene" | ||
], _t = { | ||
], Qt = { | ||
template: { | ||
compilerOptions: { | ||
isCustomElement: (e) => e.startsWith("Tres") && !Et.includes(e) || e === "primitive" | ||
isCustomElement: (e) => e.startsWith("Tres") && !Wt.includes(e) || e === "primitive" | ||
} | ||
} | ||
}, Lt = _t, Ot = { | ||
}, ar = Qt, sr = { | ||
install(e) { | ||
e.component("TresCanvas", wt); | ||
e.component("TresCanvas", zt); | ||
} | ||
}; | ||
export { | ||
wt as TresCanvas, | ||
q as catalogue, | ||
Ot as default, | ||
ce as dispose, | ||
Y as extend, | ||
bt as isProd, | ||
et as normalizeColor, | ||
Dt as normalizeVectorFlexibleParam, | ||
Lt as templateCompilerOptions, | ||
ft as trasverseObjects, | ||
Ke as useCamera, | ||
kt as useLoader, | ||
B as useLogger, | ||
pt as usePointerEventHandler, | ||
mt as useRaycaster, | ||
ie as useRenderLoop, | ||
ut as useRenderer, | ||
St as useSeek, | ||
Tt as useTexture, | ||
xt as useTres, | ||
gt as useTresContext, | ||
vt as useTresContextProvider | ||
zt as TresCanvas, | ||
J as catalogue, | ||
sr as default, | ||
X as extend, | ||
Zt as isProd, | ||
ct as normalizeColor, | ||
er as normalizeVectorFlexibleParam, | ||
ar as templateCompilerOptions, | ||
Mt as trasverseObjects, | ||
st as useCamera, | ||
tr as useLoader, | ||
j as useLogger, | ||
St as usePointerEventHandler, | ||
Pt as useRaycaster, | ||
me as useRenderLoop, | ||
Et as useRenderer, | ||
nr as useSeek, | ||
rr as useTexture, | ||
or as useTres, | ||
Ot as useTresContext, | ||
Tt as useTresContextProvider | ||
}; |
@@ -1,2 +0,3 @@ | ||
import { Object3D } from 'three'; | ||
import { MeshBasicMaterial } from 'three'; | ||
import type { Mesh, type Scene, type Object3D } from 'three'; | ||
export declare function toSetMethodName(key: string): string; | ||
@@ -17,8 +18,6 @@ export declare const merge: (target: any, source: any) => any; | ||
export declare const isArray: (a: any) => a is any[] | readonly any[]; | ||
export declare function dispose<TresObj extends { | ||
dispose?: () => void; | ||
type?: string; | ||
[key: string]: any; | ||
}>(obj: TresObj): void; | ||
export declare function disposeObject3D(object: Object3D): void; | ||
export default disposeObject3D; | ||
export declare function editSceneObject(scene: Scene, objectUuid: string, propertyPath: string[], value: any): void; | ||
export declare function createHighlightMaterial(): MeshBasicMaterial; | ||
export declare function animateHighlight(highlightMesh: Mesh, startTime: number): void; | ||
export declare function stopHighlightAnimation(): void; | ||
export declare function createHighlightMesh(object: Object3D): Mesh; |
{ | ||
"name": "@tresjs/core", | ||
"type": "module", | ||
"version": "3.7.0-next.0", | ||
"version": "4.0.0-next.0", | ||
"packageManager": "pnpm@8.10.2", | ||
@@ -6,0 +6,0 @@ "description": "Declarative ThreeJS using Vue Components", |
Sorry, the diff of this file is not supported yet
436476
38
6289