angular-three 1.6.5 → 1.6.7

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { ElementRef, Injectable, inject, InjectionToken, ViewContainerRef, TemplateRef, Directive, Input, EventEmitter, getDebugNode, RendererFactory2, ChangeDetectorRef, makeEnvironmentProviders, EnvironmentInjector, createEnvironmentInjector, Component, HostBinding, Output, ViewChild, Injector, Pipe, SkipSelf, ContentChild } from '@angular/core';
2
+ import { ElementRef, inject, ChangeDetectorRef, Injectable, InjectionToken, ViewContainerRef, TemplateRef, Directive, Input, EventEmitter, getDebugNode, RendererFactory2, makeEnvironmentProviders, EnvironmentInjector, createEnvironmentInjector, Component, HostBinding, Output, ViewChild, Injector, Pipe, SkipSelf, ContentChild } from '@angular/core';
3
3
  import { provideNgxResizeOptions, NgxResize } from 'ngx-resize';
4
4
  import { isObservable, of, map, from, tap, retry, catchError, share, ReplaySubject, switchMap, forkJoin, take, BehaviorSubject, startWith, combineLatest, filter, distinctUntilChanged, takeUntil, merge } from 'rxjs';
5
5
  import * as THREE from 'three';
@@ -516,6 +516,7 @@ function tapEffect(effectFn) {
516
516
  class NgtRxStore extends RxState {
517
517
  constructor() {
518
518
  super();
519
+ const cdr = inject(ChangeDetectorRef, { optional: true });
519
520
  // set a dummy property so that initial this.get() won't return undefined
520
521
  this.set({ __ngt_dummy__: '__ngt_dummy__' });
521
522
  // call initialize that might be setup by derived Stores
@@ -532,10 +533,14 @@ class NgtRxStore extends RxState {
532
533
  modded[key] = value === undefined ? this.get(key) : value;
533
534
  return modded;
534
535
  }, {});
535
- return originalSet(modArgs);
536
+ const value = originalSet(modArgs);
537
+ cdr?.detectChanges();
538
+ return value;
536
539
  }
537
540
  // @ts-expect-error not sure why ...args here doesn't pass tuple check
538
- return originalSet(...args);
541
+ const value = originalSet(...args);
542
+ cdr?.detectChanges();
543
+ return value;
539
544
  };
540
545
  },
541
546
  });
@@ -2111,8 +2116,12 @@ class NgtRenderer {
2111
2116
  // if child is three but haven't been attached to a parent yet
2112
2117
  (newChild.__ngt_renderer__[0 /* NgtRendererClassId.type */] === 'three' && !getLocalState(newChild).parent) ||
2113
2118
  // or both parent and child are DOM elements
2114
- (parent.__ngt_renderer__[0 /* NgtRendererClassId.type */] === 'dom' &&
2115
- newChild.__ngt_renderer__[0 /* NgtRendererClassId.type */] === 'dom');
2119
+ ((parent.__ngt_renderer__[0 /* NgtRendererClassId.type */] === 'dom' ||
2120
+ (parent.__ngt_renderer__[0 /* NgtRendererClassId.type */] === 'compound' &&
2121
+ !parent.__ngt_renderer__[6 /* NgtRendererClassId.compounded */])) &&
2122
+ (newChild.__ngt_renderer__[0 /* NgtRendererClassId.type */] === 'dom' ||
2123
+ (newChild.__ngt_renderer__[0 /* NgtRendererClassId.type */] === 'compound' &&
2124
+ !newChild.__ngt_renderer__[6 /* NgtRendererClassId.compounded */])));
2116
2125
  if (shouldFindGrandparentInstance) {
2117
2126
  // we'll try to get the grandparent instance here so that we can run appendChild with both instances
2118
2127
  const closestGrandparentInstance = this.store.getClosestParentWithInstance(parent);
@@ -2653,7 +2662,7 @@ function injectNgtRef(initialValue = null) {
2653
2662
  function createRunInContext() {
2654
2663
  const nodeInjector = inject(Injector);
2655
2664
  const envInjector = inject(EnvironmentInjector);
2656
- const originalGet = envInjector.get;
2665
+ const originalGet = envInjector.get.bind(envInjector);
2657
2666
  return (cb) => {
2658
2667
  envInjector.get = (...args) => {
2659
2668
  try {