angular-three 1.4.1 → 1.4.3

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,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { ElementRef, Injectable, inject, InjectionToken, ViewContainerRef, TemplateRef, Directive, Input, EventEmitter, getDebugNode, RendererFactory2, ChangeDetectorRef, makeEnvironmentProviders, EnvironmentInjector, createEnvironmentInjector, Component, HostBinding, Output, ViewChild, Pipe, SkipSelf, ContentChild } from '@angular/core';
3
3
  import { provideNgxResizeOptions, NgxResize } from 'ngx-resize';
4
- import { isObservable, of, map, from, tap, retry, catchError, share, ReplaySubject, switchMap, forkJoin, take, BehaviorSubject, startWith, filter, distinctUntilChanged, takeUntil, merge } from 'rxjs';
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';
6
6
  import { DOCUMENT, NgForOf, NgIf } from '@angular/common';
7
7
  import { RxState, selectSlice } from '@rx-angular/state';
@@ -546,6 +546,15 @@ class NgtRxStore extends RxState {
546
546
  effect(obs, sideEffectFn) {
547
547
  return this.hold(obs.pipe(tapEffect(sideEffectFn)));
548
548
  }
549
+ triggerChangeDetection(cdr, keys = []) {
550
+ let $ = this.$;
551
+ if (keys.length) {
552
+ $ = combineLatest(keys.map((key) => this.select(key).pipe(startWith(this.get(key) ?? undefined))));
553
+ }
554
+ this.hold($, () => {
555
+ requestAnimationFrame(() => void cdr.detectChanges());
556
+ });
557
+ }
549
558
  }
550
559
  NgtRxStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: NgtRxStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
551
560
  NgtRxStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: NgtRxStore });
@@ -1516,7 +1525,6 @@ class NgtRendererStore {
1516
1525
  constructor(root) {
1517
1526
  this.root = root;
1518
1527
  this.comments = [];
1519
- this.portals = [];
1520
1528
  }
1521
1529
  createNode(type, node) {
1522
1530
  const state = [
@@ -1707,6 +1715,9 @@ class NgtRendererStore {
1707
1715
  get rootCdr() {
1708
1716
  return this.root.cdr;
1709
1717
  }
1718
+ get portals() {
1719
+ return this.root.portals;
1720
+ }
1710
1721
  getClosestParentWithInstance(node) {
1711
1722
  let parent = node.__ngt_renderer__[1 /* NgtRendererClassId.parent */];
1712
1723
  while (parent && parent.__ngt_renderer__[0 /* NgtRendererClassId.type */] !== 'three') {
@@ -1882,6 +1893,7 @@ class NgtRendererFactory {
1882
1893
  this.compoundPrefixes = inject(NGT_COMPOUND_PREFIXES);
1883
1894
  this.document = inject(DOCUMENT);
1884
1895
  this.rendererMap = new Map();
1896
+ this.portals = [];
1885
1897
  }
1886
1898
  createRenderer(hostElement, type) {
1887
1899
  const delegateRenderer = this.delegateRendererFactory.createRenderer(hostElement, type);
@@ -1894,6 +1906,7 @@ class NgtRendererFactory {
1894
1906
  const store = new NgtRendererStore({
1895
1907
  store: this.store,
1896
1908
  cdr: this.cdr,
1909
+ portals: this.portals,
1897
1910
  compoundPrefixes: this.compoundPrefixes,
1898
1911
  document: this.document,
1899
1912
  });
@@ -1904,6 +1917,7 @@ class NgtRendererFactory {
1904
1917
  const store = new NgtRendererStore({
1905
1918
  store: this.store,
1906
1919
  cdr: this.cdr,
1920
+ portals: this.portals,
1907
1921
  compoundPrefixes: this.compoundPrefixes,
1908
1922
  document: this.document,
1909
1923
  });