angular-three 3.2.2 → 3.2.4
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/fesm2022/angular-three.mjs +13 -5
- package/fesm2022/angular-three.mjs.map +1 -1
- package/lib/canvas.d.ts +58 -58
- package/lib/html.d.ts +1 -1
- package/lib/portal.d.ts +1 -1
- package/lib/renderer/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -786,6 +786,10 @@ class NgtArgs {
|
|
|
786
786
|
const value = this.args();
|
|
787
787
|
if (value == null || !Array.isArray(value) || (value.length === 1 && value[0] === null))
|
|
788
788
|
return;
|
|
789
|
+
if (is.equ(value, this.injectedArgs)) {
|
|
790
|
+
// we have the same value as before, no need to update
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
789
793
|
this.injected = false;
|
|
790
794
|
this.injectedArgs = value;
|
|
791
795
|
this.createView();
|
|
@@ -1780,7 +1784,11 @@ class NgtRenderer {
|
|
|
1780
1784
|
return;
|
|
1781
1785
|
this.appendChild(parent, newChild);
|
|
1782
1786
|
}
|
|
1783
|
-
removeChild(parent, oldChild, isHostElement) {
|
|
1787
|
+
removeChild(parent, oldChild, isHostElement, calledByNgt = false) {
|
|
1788
|
+
if (!calledByNgt && parent == null) {
|
|
1789
|
+
parent = this.parentNode(oldChild);
|
|
1790
|
+
return this.removeChild(parent, oldChild, isHostElement, true);
|
|
1791
|
+
}
|
|
1784
1792
|
if (parent == null) {
|
|
1785
1793
|
parent = (untracked(() => getLocalState(oldChild)?.parent?.()) ||
|
|
1786
1794
|
oldChild.__ngt_renderer__?.[1 /* NgtRendererClassId.parent */]);
|
|
@@ -1790,12 +1798,12 @@ class NgtRenderer {
|
|
|
1790
1798
|
// we'll just remove the child and destroy it
|
|
1791
1799
|
if (parent == null) {
|
|
1792
1800
|
if (cRS) {
|
|
1793
|
-
if (cRS[0 /* NgtRendererClassId.type */] === 'three') {
|
|
1794
|
-
removeThreeChild(oldChild, undefined, true);
|
|
1795
|
-
}
|
|
1796
1801
|
// if the child is the root scene, we don't want to destroy it
|
|
1797
1802
|
if (is.scene(oldChild) && oldChild.name === '__ngt_root_scene__')
|
|
1798
1803
|
return;
|
|
1804
|
+
if (cRS[0 /* NgtRendererClassId.type */] === 'three') {
|
|
1805
|
+
removeThreeChild(oldChild, undefined, true);
|
|
1806
|
+
}
|
|
1799
1807
|
// otherwise, we'll destroy it
|
|
1800
1808
|
this.destroyInternal(oldChild, undefined);
|
|
1801
1809
|
}
|
|
@@ -3269,7 +3277,7 @@ function omit(objFn, keysToOmit) {
|
|
|
3269
3277
|
Object.assign(result, { [key]: obj[key] });
|
|
3270
3278
|
}
|
|
3271
3279
|
return result;
|
|
3272
|
-
});
|
|
3280
|
+
}, { equal: (a, b) => is.equ(a, b, { objects: 'shallow', arrays: 'shallow' }) });
|
|
3273
3281
|
}
|
|
3274
3282
|
function pick(objFn, keyOrKeys) {
|
|
3275
3283
|
if (Array.isArray(keyOrKeys)) {
|