angular-three 1.3.1 → 1.4.1

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.
@@ -1698,7 +1698,8 @@ class NgtRendererStore {
1698
1698
  return this.root.compoundPrefixes.some((prefix) => name.startsWith(prefix));
1699
1699
  }
1700
1700
  isDOM(node) {
1701
- return node instanceof Element || node instanceof Document;
1701
+ return (node['__ngt_renderer__']?.[0 /* NgtRendererClassId.type */] !== 'compound' &&
1702
+ (node instanceof Element || node instanceof Document));
1702
1703
  }
1703
1704
  get rootScene() {
1704
1705
  return this.root.store.get('scene');
@@ -2513,6 +2514,17 @@ function injectBeforeRender(cb, priority = 0) {
2513
2514
  }
2514
2515
  }
2515
2516
 
2517
+ function safeDetectChanges(cdr) {
2518
+ try {
2519
+ if (cdr['context']) {
2520
+ cdr.detectChanges();
2521
+ }
2522
+ }
2523
+ catch (e) {
2524
+ cdr.markForCheck();
2525
+ }
2526
+ }
2527
+
2516
2528
  function injectNgtRef(initialValue = null) {
2517
2529
  const ref = is.ref(initialValue) ? initialValue : new ElementRef(initialValue);
2518
2530
  let lastValue = ref.nativeElement;
@@ -2565,9 +2577,7 @@ function injectNgtRef(initialValue = null) {
2565
2577
  // during creation phase, 'context' on ViewRef will be null
2566
2578
  // we check the "context" to avoid running detectChanges during this phase.
2567
2579
  // because there's nothing to check
2568
- if (cd['context']) {
2569
- cd.detectChanges();
2570
- }
2580
+ safeDetectChanges(cd);
2571
2581
  }
2572
2582
  }
2573
2583
  },
@@ -2875,5 +2885,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImpor
2875
2885
  * Generated bundle index. Do not edit.
2876
2886
  */
2877
2887
 
2878
- export { NGT_CATALOGUE, NgtArgs, NgtCanvas, NgtPortal, NgtPortalBeforeRender, NgtPortalContent, NgtPush, NgtRepeat, NgtRxStore, NgtStore, addAfterEffect, addEffect, addTail, applyProps, checkNeedsUpdate, checkUpdate, createAttachFunction, createLoop, extend, flushGlobalEffects, getLocalState, injectBeforeRender, injectNgtDestroy, injectNgtLoader, injectNgtRef, invalidateInstance, is, makeDefaultCamera, makeDefaultRenderer, makeDpr, makeId, makeObjectGraph, prepare, rootStateMap, startWithUndefined, tapEffect, updateCamera };
2888
+ export { NGT_CATALOGUE, NgtArgs, NgtCanvas, NgtPortal, NgtPortalBeforeRender, NgtPortalContent, NgtPush, NgtRepeat, NgtRxStore, NgtStore, addAfterEffect, addEffect, addTail, applyProps, checkNeedsUpdate, checkUpdate, createAttachFunction, createLoop, extend, flushGlobalEffects, getLocalState, injectBeforeRender, injectNgtDestroy, injectNgtLoader, injectNgtRef, invalidateInstance, is, makeDefaultCamera, makeDefaultRenderer, makeDpr, makeId, makeObjectGraph, prepare, rootStateMap, safeDetectChanges, startWithUndefined, tapEffect, updateCamera };
2879
2889
  //# sourceMappingURL=angular-three.mjs.map