angular-three 2.0.0-beta.285 → 2.0.0-beta.286
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/esm2022/lib/loop.mjs +1 -1
- package/esm2022/lib/renderer/index.mjs +3 -3
- package/esm2022/lib/renderer/utils.mjs +1 -2
- package/esm2022/lib/roots.mjs +18 -16
- package/esm2022/lib/utils/attach.mjs +2 -2
- package/esm2022/testing/lib/utils/mock-canvas.mjs +6 -5
- package/fesm2022/angular-three-testing.mjs +5 -4
- package/fesm2022/angular-three-testing.mjs.map +1 -1
- package/fesm2022/angular-three.mjs +20 -19
- package/fesm2022/angular-three.mjs.map +1 -1
- package/lib/utils/attach.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1316,7 +1316,7 @@ function attach(object, value, paths = [], useApplyProps = false) {
|
|
|
1316
1316
|
attach(object[base], value, remaining, useApplyProps);
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
1319
|
-
function detach(parent, child, attachProp
|
|
1319
|
+
function detach(parent, child, attachProp) {
|
|
1320
1320
|
const childLocalState = getLocalState(child);
|
|
1321
1321
|
if (childLocalState) {
|
|
1322
1322
|
if (Array.isArray(attachProp))
|
|
@@ -1358,7 +1358,6 @@ function attachThreeChild(parent, child) {
|
|
|
1358
1358
|
}
|
|
1359
1359
|
// whether the child is added to the parent with parent.add()
|
|
1360
1360
|
let added = false;
|
|
1361
|
-
let attached = false;
|
|
1362
1361
|
// assign store on child if not already exist
|
|
1363
1362
|
// or child store is not the same as parent store
|
|
1364
1363
|
// or child store is the parent of parent store
|
|
@@ -1610,7 +1609,7 @@ class NgtRenderer {
|
|
|
1610
1609
|
if (!injectedArgs[0])
|
|
1611
1610
|
throw new Error(`[NGT] ngt-primitive without args is invalid`);
|
|
1612
1611
|
const object = injectedArgs[0];
|
|
1613
|
-
|
|
1612
|
+
const localState = getLocalState(object);
|
|
1614
1613
|
if (!localState) {
|
|
1615
1614
|
// NOTE: if an object isn't already "prepared", we prepare it
|
|
1616
1615
|
prepare(object, { store: this.rootStore, primitive: true });
|
|
@@ -1771,7 +1770,7 @@ class NgtRenderer {
|
|
|
1771
1770
|
return rS[1 /* NgtRendererClassId.parent */];
|
|
1772
1771
|
return this.delegate.parentNode(node);
|
|
1773
1772
|
}
|
|
1774
|
-
setAttributeInternal(el, name, value,
|
|
1773
|
+
setAttributeInternal(el, name, value, _namespace) {
|
|
1775
1774
|
const rS = el.__ngt_renderer__;
|
|
1776
1775
|
if (rS[3 /* NgtRendererClassId.destroyed */])
|
|
1777
1776
|
return false;
|
|
@@ -2078,19 +2077,21 @@ function injectCanvasRootInitializer(injector) {
|
|
|
2078
2077
|
const root = roots.get(canvas);
|
|
2079
2078
|
if (root) {
|
|
2080
2079
|
root.update((state) => ({ internal: { ...state.internal, active: false } }));
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
state.xr
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2080
|
+
setTimeout(() => {
|
|
2081
|
+
try {
|
|
2082
|
+
const state = root.get();
|
|
2083
|
+
state.events.disconnect?.();
|
|
2084
|
+
state.gl?.renderLists?.dispose?.();
|
|
2085
|
+
state.gl?.forceContextLoss?.();
|
|
2086
|
+
if (state.gl?.xr)
|
|
2087
|
+
state.xr.disconnect();
|
|
2088
|
+
dispose(state);
|
|
2089
|
+
roots.delete(canvas);
|
|
2090
|
+
}
|
|
2091
|
+
catch (e) {
|
|
2092
|
+
console.error('[NGT] Unexpected error while destroying Canvas Root', e);
|
|
2093
|
+
}
|
|
2094
|
+
}, timeout);
|
|
2094
2095
|
}
|
|
2095
2096
|
},
|
|
2096
2097
|
configure: (inputs) => {
|
|
@@ -2235,9 +2236,9 @@ function injectCanvasRootInitializer(injector) {
|
|
|
2235
2236
|
if (ColorManagement) {
|
|
2236
2237
|
const colorManagement = ColorManagement;
|
|
2237
2238
|
if ('enabled' in colorManagement)
|
|
2238
|
-
colorManagement['enabled'] = !legacy
|
|
2239
|
+
colorManagement['enabled'] = !legacy;
|
|
2239
2240
|
else if ('legacyMode' in colorManagement)
|
|
2240
|
-
colorManagement['legacyMode'] = legacy
|
|
2241
|
+
colorManagement['legacyMode'] = legacy;
|
|
2241
2242
|
}
|
|
2242
2243
|
if (!isConfigured) {
|
|
2243
2244
|
// set color space and tonemapping preferences once
|