angular-three 1.3.0 → 1.4.0
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/esm2020/index.mjs +2 -1
- package/esm2020/lib/di/ref.mjs +3 -4
- package/esm2020/lib/renderer/provider.mjs +4 -4
- package/esm2020/lib/renderer/renderer.mjs +2 -2
- package/esm2020/lib/utils/safe-detect-changes.mjs +11 -0
- package/fesm2015/angular-three.mjs +17 -8
- package/fesm2015/angular-three.mjs.map +1 -1
- package/fesm2020/angular-three.mjs +17 -8
- package/fesm2020/angular-three.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/renderer/provider.d.ts +2 -19
- package/lib/utils/safe-detect-changes.d.ts +2 -0
- package/package.json +1 -1
- package/plugin/package.json +1 -1
|
@@ -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, EnvironmentInjector, createEnvironmentInjector, Component, HostBinding, Output, ViewChild, Pipe, SkipSelf, ContentChild } from '@angular/core';
|
|
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
4
|
import { isObservable, of, map, from, tap, retry, catchError, share, ReplaySubject, switchMap, forkJoin, take, BehaviorSubject, startWith, filter, distinctUntilChanged, takeUntil, merge } from 'rxjs';
|
|
5
5
|
import * as THREE from 'three';
|
|
@@ -2081,7 +2081,7 @@ class NgtRenderer {
|
|
|
2081
2081
|
// refChild: NgtRendererNode
|
|
2082
2082
|
// isMove?: boolean | undefined
|
|
2083
2083
|
) {
|
|
2084
|
-
if (!parent.__ngt_renderer__)
|
|
2084
|
+
if (!parent.__ngt_renderer__ || parent === newChild)
|
|
2085
2085
|
return;
|
|
2086
2086
|
this.appendChild(parent, newChild);
|
|
2087
2087
|
}
|
|
@@ -2183,12 +2183,12 @@ function provideNgtRenderer({ store, changeDetectorRef, compoundPrefixes = [] })
|
|
|
2183
2183
|
if (!compoundPrefixes.includes('ngtp')) {
|
|
2184
2184
|
compoundPrefixes.push('ngtp');
|
|
2185
2185
|
}
|
|
2186
|
-
return [
|
|
2186
|
+
return makeEnvironmentProviders([
|
|
2187
2187
|
{ provide: RendererFactory2, useClass: NgtRendererFactory },
|
|
2188
2188
|
{ provide: NgtStore, useValue: store },
|
|
2189
2189
|
{ provide: ChangeDetectorRef, useValue: changeDetectorRef },
|
|
2190
2190
|
{ provide: NGT_COMPOUND_PREFIXES, useValue: compoundPrefixes },
|
|
2191
|
-
];
|
|
2191
|
+
]);
|
|
2192
2192
|
}
|
|
2193
2193
|
|
|
2194
2194
|
const DOM_EVENTS = {
|
|
@@ -2513,6 +2513,17 @@ function injectBeforeRender(cb, priority = 0) {
|
|
|
2513
2513
|
}
|
|
2514
2514
|
}
|
|
2515
2515
|
|
|
2516
|
+
function safeDetectChanges(cdr) {
|
|
2517
|
+
try {
|
|
2518
|
+
if (cdr['context']) {
|
|
2519
|
+
cdr.detectChanges();
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2522
|
+
catch (e) {
|
|
2523
|
+
cdr.markForCheck();
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2516
2527
|
function injectNgtRef(initialValue = null) {
|
|
2517
2528
|
const ref = is.ref(initialValue) ? initialValue : new ElementRef(initialValue);
|
|
2518
2529
|
let lastValue = ref.nativeElement;
|
|
@@ -2565,9 +2576,7 @@ function injectNgtRef(initialValue = null) {
|
|
|
2565
2576
|
// during creation phase, 'context' on ViewRef will be null
|
|
2566
2577
|
// we check the "context" to avoid running detectChanges during this phase.
|
|
2567
2578
|
// because there's nothing to check
|
|
2568
|
-
|
|
2569
|
-
cd.detectChanges();
|
|
2570
|
-
}
|
|
2579
|
+
safeDetectChanges(cd);
|
|
2571
2580
|
}
|
|
2572
2581
|
}
|
|
2573
2582
|
},
|
|
@@ -2875,5 +2884,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImpor
|
|
|
2875
2884
|
* Generated bundle index. Do not edit.
|
|
2876
2885
|
*/
|
|
2877
2886
|
|
|
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 };
|
|
2887
|
+
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
2888
|
//# sourceMappingURL=angular-three.mjs.map
|