angular-three 1.9.10 → 1.9.12
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/lib/canvas.mjs +13 -16
- package/esm2020/lib/di/ref.mjs +4 -2
- package/esm2020/lib/di/run-in-context.mjs +6 -1
- package/esm2020/lib/directives/args.mjs +3 -3
- package/esm2020/lib/directives/common.mjs +6 -5
- package/esm2020/lib/directives/parent.mjs +3 -3
- package/esm2020/lib/directives/repeat.mjs +3 -3
- package/esm2020/lib/loader.mjs +10 -6
- package/esm2020/lib/pipes/push.mjs +16 -21
- package/esm2020/lib/portal.mjs +40 -43
- package/esm2020/lib/renderer/renderer.mjs +7 -7
- package/esm2020/lib/renderer/utils.mjs +4 -4
- package/esm2020/lib/routed-scene.mjs +6 -7
- package/esm2020/lib/stores/rx-store.mjs +10 -25
- package/esm2020/lib/stores/store.mjs +18 -14
- package/esm2020/lib/utils/instance.mjs +3 -1
- package/esm2020/lib/utils/safe-detect-changes.mjs +4 -2
- package/fesm2015/angular-three.mjs +139 -154
- package/fesm2015/angular-three.mjs.map +1 -1
- package/fesm2020/angular-three.mjs +145 -160
- package/fesm2020/angular-three.mjs.map +1 -1
- package/lib/di/run-in-context.d.ts +5 -0
- package/lib/pipes/push.d.ts +1 -0
- package/lib/portal.d.ts +1 -1
- package/lib/stores/rx-store.d.ts +2 -8
- package/lib/utils/safe-detect-changes.d.ts +1 -1
- package/package.json +5 -5
- package/plugin/package.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, ChangeDetectorRef, ElementRef, 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
|
-
import { isObservable, of, map, from, tap, retry, catchError, share, ReplaySubject, switchMap, forkJoin, take, BehaviorSubject, startWith, combineLatest,
|
|
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
|
-
import { __rest
|
|
6
|
+
import { __rest } from 'tslib';
|
|
7
7
|
import { DOCUMENT, NgForOf, NgIf } from '@angular/common';
|
|
8
|
-
import { RxState
|
|
8
|
+
import { RxState } from '@rx-angular/state';
|
|
9
9
|
import * as i1 from '@angular/router';
|
|
10
10
|
import { ActivationEnd, RouterOutlet } from '@angular/router';
|
|
11
11
|
|
|
@@ -52,10 +52,24 @@ function makeObjectGraph(object) {
|
|
|
52
52
|
return data;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
function safeDetectChanges(cdr) {
|
|
56
|
+
if (!cdr)
|
|
57
|
+
return;
|
|
58
|
+
try {
|
|
59
|
+
// dynamic created component with ViewContainerRef#createComponent does not have Context
|
|
60
|
+
// but it has _attachedToViewContainer
|
|
61
|
+
if (cdr['context'] || cdr['_attachedToViewContainer']) {
|
|
62
|
+
cdr.detectChanges();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
cdr.markForCheck();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
55
70
|
const cached = new Map();
|
|
56
|
-
function
|
|
71
|
+
function load(loaderConstructorFactory, input, extensions, onProgress) {
|
|
57
72
|
const urls$ = isObservable(input) ? input : of(input);
|
|
58
|
-
const cdr = inject(ChangeDetectorRef);
|
|
59
73
|
return urls$.pipe(map((inputs) => {
|
|
60
74
|
const loaderConstructor = loaderConstructorFactory(inputs);
|
|
61
75
|
const loader = new loaderConstructor();
|
|
@@ -77,7 +91,11 @@ function injectLoader(loaderConstructorFactory, input, extensions, onProgress) {
|
|
|
77
91
|
}),
|
|
78
92
|
inputs,
|
|
79
93
|
];
|
|
80
|
-
})
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
function injectLoader(loaderConstructorFactory, input, extensions, onProgress) {
|
|
97
|
+
const cdr = inject(ChangeDetectorRef);
|
|
98
|
+
return load(loaderConstructorFactory, input, extensions, onProgress).pipe(switchMap(([observables$, inputs]) => {
|
|
81
99
|
return forkJoin(observables$).pipe(map((results) => {
|
|
82
100
|
if (Array.isArray(inputs))
|
|
83
101
|
return results;
|
|
@@ -89,7 +107,7 @@ function injectLoader(loaderConstructorFactory, input, extensions, onProgress) {
|
|
|
89
107
|
return result;
|
|
90
108
|
}, {});
|
|
91
109
|
}), tap(() => {
|
|
92
|
-
requestAnimationFrame(() => cdr
|
|
110
|
+
requestAnimationFrame(() => void safeDetectChanges(cdr));
|
|
93
111
|
}));
|
|
94
112
|
}));
|
|
95
113
|
}
|
|
@@ -97,7 +115,7 @@ injectLoader.destroy = () => {
|
|
|
97
115
|
cached.clear();
|
|
98
116
|
};
|
|
99
117
|
injectLoader.preLoad = (loaderConstructorFactory, inputs, extensions) => {
|
|
100
|
-
|
|
118
|
+
load(loaderConstructorFactory, inputs, extensions).pipe(take(1)).subscribe();
|
|
101
119
|
};
|
|
102
120
|
const injectNgtLoader = injectLoader;
|
|
103
121
|
|
|
@@ -341,6 +359,8 @@ function prepare(object, localState) {
|
|
|
341
359
|
const current = instance.__ngt__[type].value;
|
|
342
360
|
const foundIndex = current.indexOf((obj) => obj === object);
|
|
343
361
|
if (foundIndex > -1) {
|
|
362
|
+
// if we add an object with the same reference, then we switch it out
|
|
363
|
+
// and update the BehaviorSubject
|
|
344
364
|
current.splice(foundIndex, 1, object);
|
|
345
365
|
instance.__ngt__[type].next(current);
|
|
346
366
|
}
|
|
@@ -461,7 +481,6 @@ const startWithUndefined = () => startWith(undefined);
|
|
|
461
481
|
* - can optionally return a `cleanUp` function that
|
|
462
482
|
* invokes from the 2nd `next` notification onward and on `unsubscribe` (destroyed)
|
|
463
483
|
*
|
|
464
|
-
*
|
|
465
484
|
* @example
|
|
466
485
|
* ```typescript
|
|
467
486
|
* source$.pipe(
|
|
@@ -491,17 +510,14 @@ function tapEffect(effectFn) {
|
|
|
491
510
|
};
|
|
492
511
|
return tap({
|
|
493
512
|
next: (value) => {
|
|
494
|
-
if (cleanupFn && firstRun)
|
|
513
|
+
if (cleanupFn && firstRun)
|
|
495
514
|
cleanupFn({ prev, complete: false, error: false });
|
|
496
|
-
}
|
|
497
515
|
const cleanUpOrVoid = effectFn(value);
|
|
498
|
-
if (cleanUpOrVoid)
|
|
516
|
+
if (cleanUpOrVoid)
|
|
499
517
|
cleanupFn = cleanUpOrVoid;
|
|
500
|
-
}
|
|
501
518
|
prev = value;
|
|
502
|
-
if (!firstRun)
|
|
519
|
+
if (!firstRun)
|
|
503
520
|
firstRun = true;
|
|
504
|
-
}
|
|
505
521
|
},
|
|
506
522
|
complete: teardown(false),
|
|
507
523
|
unsubscribe: teardown(false),
|
|
@@ -511,7 +527,6 @@ function tapEffect(effectFn) {
|
|
|
511
527
|
class NgtRxStore extends RxState {
|
|
512
528
|
constructor() {
|
|
513
529
|
super();
|
|
514
|
-
this.cache = {};
|
|
515
530
|
// set a dummy property so that initial this.get() won't return undefined
|
|
516
531
|
this.set({ __ngt_dummy__: '__ngt_dummy__' });
|
|
517
532
|
// override set so our consumers don't have to handle undefined for state that already have default values
|
|
@@ -559,25 +574,13 @@ class NgtRxStore extends RxState {
|
|
|
559
574
|
$ = combineLatest(keys.map((key) => { var _a; return this.select(key).pipe(startWith((_a = this.get(key)) !== null && _a !== void 0 ? _a : undefined)); }));
|
|
560
575
|
}
|
|
561
576
|
this.hold($, () => {
|
|
562
|
-
requestAnimationFrame(() => void cdr
|
|
577
|
+
requestAnimationFrame(() => void safeDetectChanges(cdr));
|
|
563
578
|
});
|
|
564
579
|
}
|
|
565
|
-
key$(...keys) {
|
|
566
|
-
var _a;
|
|
567
|
-
const key = keys.join('.');
|
|
568
|
-
if (!this.cache[key]) {
|
|
569
|
-
this.cache[key] = this.select(...keys).pipe(startWith((_a = this.get(...keys)) !== null && _a !== void 0 ? _a : undefined), distinctUntilChanged());
|
|
570
|
-
}
|
|
571
|
-
return this.cache[key];
|
|
572
|
-
}
|
|
573
|
-
ngOnDestroy() {
|
|
574
|
-
this.cache = {};
|
|
575
|
-
super.ngOnDestroy();
|
|
576
|
-
}
|
|
577
580
|
}
|
|
578
|
-
NgtRxStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1
|
|
579
|
-
NgtRxStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1
|
|
580
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1
|
|
581
|
+
NgtRxStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtRxStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
582
|
+
NgtRxStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtRxStore });
|
|
583
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtRxStore, decorators: [{
|
|
581
584
|
type: Injectable
|
|
582
585
|
}], ctorParameters: function () { return []; } });
|
|
583
586
|
|
|
@@ -620,7 +623,6 @@ class NgtStore extends NgtRxStore {
|
|
|
620
623
|
const w = h * aspect;
|
|
621
624
|
return { width: w, height: h, top, left, factor: width / w, distance, aspect };
|
|
622
625
|
};
|
|
623
|
-
const pointer = new THREE.Vector2();
|
|
624
626
|
let performanceTimeout;
|
|
625
627
|
const setPerformanceCurrent = (current) => {
|
|
626
628
|
this.set((state) => ({ performance: Object.assign(Object.assign({}, state.performance), { current }) }));
|
|
@@ -639,7 +641,7 @@ class NgtStore extends NgtRxStore {
|
|
|
639
641
|
flat: false,
|
|
640
642
|
controls: null,
|
|
641
643
|
clock: new THREE.Clock(),
|
|
642
|
-
pointer,
|
|
644
|
+
pointer: new THREE.Vector2(),
|
|
643
645
|
frameloop: 'always',
|
|
644
646
|
performance: {
|
|
645
647
|
current: 1,
|
|
@@ -749,6 +751,7 @@ class NgtStore extends NgtRxStore {
|
|
|
749
751
|
}
|
|
750
752
|
}
|
|
751
753
|
configure(inputs, canvasElement) {
|
|
754
|
+
var _a;
|
|
752
755
|
const { gl: glOptions, size: sizeOptions, camera: cameraOptions, raycaster: raycasterOptions, events, orthographic, lookAt, shadows, linear, legacy, flat, dpr, frameloop, performance, } = inputs;
|
|
753
756
|
const state = this.get();
|
|
754
757
|
const stateToUpdate = {};
|
|
@@ -763,7 +766,7 @@ class NgtStore extends NgtRxStore {
|
|
|
763
766
|
stateToUpdate.raycaster = raycaster = new THREE.Raycaster();
|
|
764
767
|
}
|
|
765
768
|
// set raycaster options
|
|
766
|
-
const
|
|
769
|
+
const _b = raycasterOptions || {}, { params } = _b, options = __rest(_b, ["params"]);
|
|
767
770
|
if (!is.equ(options, raycaster, shallowLoose))
|
|
768
771
|
applyProps(raycaster, Object.assign({}, options));
|
|
769
772
|
if (!is.equ(params, raycaster.params, shallowLoose)) {
|
|
@@ -844,8 +847,13 @@ class NgtStore extends NgtRxStore {
|
|
|
844
847
|
}
|
|
845
848
|
// Safely set color management if available.
|
|
846
849
|
// Avoid accessing THREE.ColorManagement to play nice with older versions
|
|
847
|
-
if (THREE.ColorManagement)
|
|
848
|
-
|
|
850
|
+
if (THREE.ColorManagement) {
|
|
851
|
+
const ColorManagement = THREE.ColorManagement;
|
|
852
|
+
if ('enabled' in ColorManagement)
|
|
853
|
+
ColorManagement['enabled'] = (_a = !legacy) !== null && _a !== void 0 ? _a : false;
|
|
854
|
+
else if ('legacyMode' in ColorManagement)
|
|
855
|
+
ColorManagement['legacyMode'] = legacy !== null && legacy !== void 0 ? legacy : true;
|
|
856
|
+
}
|
|
849
857
|
const outputEncoding = linear ? THREE.LinearEncoding : THREE.sRGBEncoding;
|
|
850
858
|
const toneMapping = flat ? THREE.NoToneMapping : THREE.ACESFilmicToneMapping;
|
|
851
859
|
if (gl.outputEncoding !== outputEncoding)
|
|
@@ -917,8 +925,7 @@ class NgtStore extends NgtRxStore {
|
|
|
917
925
|
let oldSize = state.size;
|
|
918
926
|
let oldDpr = state.viewport.dpr;
|
|
919
927
|
let oldCamera = state.camera;
|
|
920
|
-
this.hold(this.select(
|
|
921
|
-
const { camera, size, viewport, gl, set } = this.get();
|
|
928
|
+
this.hold(combineLatest([this.select('camera'), this.select('size'), this.select('viewport'), this.select('gl')]), ([camera, size, viewport, gl]) => {
|
|
922
929
|
// resize camera and renderer on changes to size and dpr
|
|
923
930
|
if (size !== oldSize || viewport.dpr !== oldDpr) {
|
|
924
931
|
oldSize = size;
|
|
@@ -932,7 +939,9 @@ class NgtStore extends NgtRxStore {
|
|
|
932
939
|
if (camera !== oldCamera) {
|
|
933
940
|
updateCamera(camera, size);
|
|
934
941
|
oldCamera = camera;
|
|
935
|
-
set((state) => ({
|
|
942
|
+
this.set((state) => ({
|
|
943
|
+
viewport: Object.assign(Object.assign({}, state.viewport), state.viewport.getCurrentViewport(camera)),
|
|
944
|
+
}));
|
|
936
945
|
}
|
|
937
946
|
});
|
|
938
947
|
}
|
|
@@ -940,9 +949,9 @@ class NgtStore extends NgtRxStore {
|
|
|
940
949
|
this.hold(this.select(), () => invalidate(this));
|
|
941
950
|
}
|
|
942
951
|
}
|
|
943
|
-
NgtStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1
|
|
944
|
-
NgtStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1
|
|
945
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1
|
|
952
|
+
NgtStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtStore, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
953
|
+
NgtStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtStore });
|
|
954
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtStore, decorators: [{
|
|
946
955
|
type: Injectable
|
|
947
956
|
}] });
|
|
948
957
|
function computeInitialSize(canvas, defaultSize) {
|
|
@@ -950,8 +959,7 @@ function computeInitialSize(canvas, defaultSize) {
|
|
|
950
959
|
return defaultSize;
|
|
951
960
|
}
|
|
952
961
|
if (canvas instanceof HTMLCanvasElement && canvas.parentElement) {
|
|
953
|
-
|
|
954
|
-
return { width, height, top, left };
|
|
962
|
+
return canvas.parentElement.getBoundingClientRect();
|
|
955
963
|
}
|
|
956
964
|
return { width: 0, height: 0, top: 0, left: 0 };
|
|
957
965
|
}
|
|
@@ -992,13 +1000,13 @@ class NgtCommonDirective {
|
|
|
992
1000
|
this.view.destroy();
|
|
993
1001
|
}
|
|
994
1002
|
this.view = this.vcr.createEmbeddedView(this.template);
|
|
995
|
-
this.view
|
|
1003
|
+
safeDetectChanges(this.view);
|
|
996
1004
|
}
|
|
997
1005
|
}
|
|
998
1006
|
}
|
|
999
|
-
NgtCommonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1
|
|
1000
|
-
NgtCommonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1
|
|
1001
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1
|
|
1007
|
+
NgtCommonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtCommonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1008
|
+
NgtCommonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.1", type: NgtCommonDirective, ngImport: i0 });
|
|
1009
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtCommonDirective, decorators: [{
|
|
1002
1010
|
type: Directive
|
|
1003
1011
|
}], ctorParameters: function () { return []; } });
|
|
1004
1012
|
|
|
@@ -1027,9 +1035,9 @@ class NgtArgs extends NgtCommonDirective {
|
|
|
1027
1035
|
return !this.injected && !!this.injectedArgs.length;
|
|
1028
1036
|
}
|
|
1029
1037
|
}
|
|
1030
|
-
NgtArgs.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1
|
|
1031
|
-
NgtArgs.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1
|
|
1032
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1
|
|
1038
|
+
NgtArgs.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtArgs, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1039
|
+
NgtArgs.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.1", type: NgtArgs, isStandalone: true, selector: "[args]", inputs: { args: "args" }, usesInheritance: true, ngImport: i0 });
|
|
1040
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtArgs, decorators: [{
|
|
1033
1041
|
type: Directive,
|
|
1034
1042
|
args: [{ selector: '[args]', standalone: true }]
|
|
1035
1043
|
}], propDecorators: { args: [{
|
|
@@ -1059,9 +1067,9 @@ class NgtParent extends NgtCommonDirective {
|
|
|
1059
1067
|
return !this.injected && !!this.injectedParent;
|
|
1060
1068
|
}
|
|
1061
1069
|
}
|
|
1062
|
-
NgtParent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1
|
|
1063
|
-
NgtParent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1
|
|
1064
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1
|
|
1070
|
+
NgtParent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtParent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1071
|
+
NgtParent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.1", type: NgtParent, isStandalone: true, selector: "[parent]", inputs: { parent: "parent" }, usesInheritance: true, ngImport: i0 });
|
|
1072
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtParent, decorators: [{
|
|
1065
1073
|
type: Directive,
|
|
1066
1074
|
args: [{ selector: '[parent]', standalone: true }]
|
|
1067
1075
|
}], propDecorators: { parent: [{
|
|
@@ -1592,9 +1600,8 @@ function processThreeEvent(instance, priority, eventName, callback, cdr, targetC
|
|
|
1592
1600
|
function eventToHandler(callback, cdr, targetCdr) {
|
|
1593
1601
|
return (event) => {
|
|
1594
1602
|
callback(event);
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
cdr.detectChanges();
|
|
1603
|
+
safeDetectChanges(targetCdr);
|
|
1604
|
+
safeDetectChanges(cdr);
|
|
1598
1605
|
};
|
|
1599
1606
|
}
|
|
1600
1607
|
function kebabToPascal(str) {
|
|
@@ -2014,9 +2021,9 @@ class NgtRendererFactory {
|
|
|
2014
2021
|
return renderer;
|
|
2015
2022
|
}
|
|
2016
2023
|
}
|
|
2017
|
-
NgtRendererFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1
|
|
2018
|
-
NgtRendererFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1
|
|
2019
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1
|
|
2024
|
+
NgtRendererFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtRendererFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2025
|
+
NgtRendererFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtRendererFactory });
|
|
2026
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtRendererFactory, decorators: [{
|
|
2020
2027
|
type: Injectable
|
|
2021
2028
|
}] });
|
|
2022
2029
|
/**
|
|
@@ -2286,9 +2293,8 @@ class NgtRenderer {
|
|
|
2286
2293
|
// if target is DOM node, then we pass that to delegate Renderer
|
|
2287
2294
|
const callbackWithCdr = (event) => {
|
|
2288
2295
|
const value = callback(event);
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
this.store.rootCdr.detectChanges();
|
|
2296
|
+
safeDetectChanges(targetCdr);
|
|
2297
|
+
safeDetectChanges(this.store.rootCdr);
|
|
2292
2298
|
return value;
|
|
2293
2299
|
};
|
|
2294
2300
|
if (this.store.isDOM(target)) {
|
|
@@ -2496,7 +2502,7 @@ class NgtCanvas extends NgtRxStore {
|
|
|
2496
2502
|
this.store.set({
|
|
2497
2503
|
onPointerMissed: (event) => {
|
|
2498
2504
|
this.pointerMissed.emit(event);
|
|
2499
|
-
this.cdr
|
|
2505
|
+
safeDetectChanges(this.cdr);
|
|
2500
2506
|
},
|
|
2501
2507
|
});
|
|
2502
2508
|
}
|
|
@@ -2537,20 +2543,16 @@ class NgtCanvas extends NgtRxStore {
|
|
|
2537
2543
|
// emit created event if observed
|
|
2538
2544
|
if (this.created.observed) {
|
|
2539
2545
|
this.created.emit(this.store.get());
|
|
2540
|
-
this.cdr.detectChanges();
|
|
2541
2546
|
}
|
|
2542
2547
|
// render
|
|
2543
2548
|
if (this.glRef)
|
|
2544
2549
|
this.glRef.destroy();
|
|
2545
2550
|
requestAnimationFrame(() => {
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
store: this.store,
|
|
2549
|
-
changeDetectorRef: this.cdr,
|
|
2550
|
-
compoundPrefixes: this.compoundPrefixes,
|
|
2551
|
-
}),
|
|
2552
|
-
], this.envInjector);
|
|
2551
|
+
const { store, cdr: changeDetectorRef, compoundPrefixes } = this;
|
|
2552
|
+
this.glEnvInjector = createEnvironmentInjector([provideNgtRenderer({ store, changeDetectorRef, compoundPrefixes })], this.envInjector);
|
|
2553
2553
|
this.glRef = this.glAnchor.createComponent(this.sceneGraph, { environmentInjector: this.glEnvInjector });
|
|
2554
|
+
// detach the Scene graph from Change Detection mechanism
|
|
2555
|
+
// everything from this point forward will trigger CD manually with detectChanges
|
|
2554
2556
|
this.glRef.changeDetectorRef.detach();
|
|
2555
2557
|
this.setSceneGraphInputs();
|
|
2556
2558
|
// here, we override the detectChanges to also call detectChanges on the ComponentRef
|
|
@@ -2572,24 +2574,23 @@ class NgtCanvas extends NgtRxStore {
|
|
|
2572
2574
|
this.cdr.detectChanges = () => {
|
|
2573
2575
|
var _a;
|
|
2574
2576
|
originalDetectChanges();
|
|
2575
|
-
(_a = this.glRef) === null || _a === void 0 ? void 0 : _a.changeDetectorRef
|
|
2577
|
+
safeDetectChanges((_a = this.glRef) === null || _a === void 0 ? void 0 : _a.changeDetectorRef);
|
|
2576
2578
|
};
|
|
2577
2579
|
}
|
|
2578
2580
|
setSceneGraphInputs() {
|
|
2579
|
-
var _a;
|
|
2580
2581
|
for (const key of Object.keys(this.sceneGraphInputs)) {
|
|
2581
|
-
|
|
2582
|
+
this.glRef.setInput(key, this.sceneGraphInputs[key]);
|
|
2582
2583
|
}
|
|
2583
|
-
this.cdr
|
|
2584
|
+
safeDetectChanges(this.cdr);
|
|
2584
2585
|
}
|
|
2585
2586
|
}
|
|
2586
|
-
NgtCanvas.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1
|
|
2587
|
-
NgtCanvas.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1
|
|
2587
|
+
NgtCanvas.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtCanvas, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2588
|
+
NgtCanvas.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: NgtCanvas, isStandalone: true, selector: "ngt-canvas", inputs: { sceneGraph: "sceneGraph", sceneGraphInputs: "sceneGraphInputs", compoundPrefixes: "compoundPrefixes", linear: "linear", legacy: "legacy", flat: "flat", orthographic: "orthographic", frameloop: "frameloop", dpr: "dpr", raycaster: "raycaster", shadows: "shadows", camera: "camera", gl: "gl", eventSource: "eventSource", eventPrefix: "eventPrefix", lookAt: "lookAt", performance: "performance" }, outputs: { created: "created", pointerMissed: "pointerMissed" }, host: { properties: { "class.ngt-canvas": "this.hostClass", "style.pointerEvents": "this.pointerEvents" } }, providers: [NgtStore, provideNgxResizeOptions({ emitInZone: false })], viewQueries: [{ propertyName: "glCanvas", first: true, predicate: ["glCanvas"], descendants: true, static: true }, { propertyName: "glAnchor", first: true, predicate: ["glCanvas"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
2588
2589
|
<div (ngxResize)="onResize($event)" style="height: 100%; width: 100%;">
|
|
2589
2590
|
<canvas #glCanvas style="display: block;"></canvas>
|
|
2590
2591
|
</div>
|
|
2591
2592
|
`, isInline: true, styles: [":host{display:block;position:relative;width:100%;height:100%;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgxResize, selector: "[ngxResize]", inputs: ["ngxResizeOptions"], outputs: ["ngxResize"] }] });
|
|
2592
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1
|
|
2593
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtCanvas, decorators: [{
|
|
2593
2594
|
type: Component,
|
|
2594
2595
|
args: [{ selector: 'ngt-canvas', standalone: true, template: `
|
|
2595
2596
|
<div (ngxResize)="onResize($event)" style="height: 100%; width: 100%;">
|
|
@@ -2681,19 +2682,6 @@ function injectBeforeRender(cb, priority = 0) {
|
|
|
2681
2682
|
}
|
|
2682
2683
|
}
|
|
2683
2684
|
|
|
2684
|
-
function safeDetectChanges(cdr) {
|
|
2685
|
-
if (!cdr)
|
|
2686
|
-
return;
|
|
2687
|
-
try {
|
|
2688
|
-
if (cdr['context']) {
|
|
2689
|
-
cdr.detectChanges();
|
|
2690
|
-
}
|
|
2691
|
-
}
|
|
2692
|
-
catch (e) {
|
|
2693
|
-
cdr.markForCheck();
|
|
2694
|
-
}
|
|
2695
|
-
}
|
|
2696
|
-
|
|
2697
2685
|
function injectNgtRef(initialValue = null) {
|
|
2698
2686
|
const ref = is.ref(initialValue) ? initialValue : new ElementRef(initialValue);
|
|
2699
2687
|
let lastValue = ref.nativeElement;
|
|
@@ -2710,6 +2698,7 @@ function injectNgtRef(initialValue = null) {
|
|
|
2710
2698
|
lastValue = current;
|
|
2711
2699
|
});
|
|
2712
2700
|
};
|
|
2701
|
+
const useCDR = (cdr) => void cdRefs.push(cdr);
|
|
2713
2702
|
const $ = obs$.pipe(filter((value, index) => index > 0 || value != null), takeUntil(destroy$));
|
|
2714
2703
|
const children$ = (type = 'objects') => $.pipe(switchMap((instance) => {
|
|
2715
2704
|
const localState = getLocalState(instance);
|
|
@@ -2728,6 +2717,7 @@ function injectNgtRef(initialValue = null) {
|
|
|
2728
2717
|
}
|
|
2729
2718
|
return of([]);
|
|
2730
2719
|
}), filter((children, index) => index > 0 || children.length > 0), takeUntil(destroy$));
|
|
2720
|
+
// here, we override nativeElement to add more functionalities to nativeElement
|
|
2731
2721
|
Object.defineProperty(ref, 'nativeElement', {
|
|
2732
2722
|
set: (newVal) => {
|
|
2733
2723
|
if (ref.nativeElement !== newVal) {
|
|
@@ -2752,9 +2742,14 @@ function injectNgtRef(initialValue = null) {
|
|
|
2752
2742
|
},
|
|
2753
2743
|
get: () => ref$.value,
|
|
2754
2744
|
});
|
|
2755
|
-
return Object.assign(ref, { subscribe, $, children$, useCDR
|
|
2745
|
+
return Object.assign(ref, { subscribe, $, children$, useCDR });
|
|
2756
2746
|
}
|
|
2757
2747
|
|
|
2748
|
+
/**
|
|
2749
|
+
* Please use this sparringly and know what you're doing.
|
|
2750
|
+
*
|
|
2751
|
+
* Create a runInContext function that has access to the NodeInjector as well
|
|
2752
|
+
*/
|
|
2758
2753
|
function createRunInContext() {
|
|
2759
2754
|
const nodeInjector = inject(Injector);
|
|
2760
2755
|
const envInjector = inject(EnvironmentInjector);
|
|
@@ -2794,9 +2789,9 @@ class NgtRepeat extends NgForOf {
|
|
|
2794
2789
|
this.ngForOf = Number.isInteger(count) ? Array.from({ length: count }, (_, i) => i) : [];
|
|
2795
2790
|
}
|
|
2796
2791
|
}
|
|
2797
|
-
NgtRepeat.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1
|
|
2798
|
-
NgtRepeat.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1
|
|
2799
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1
|
|
2792
|
+
NgtRepeat.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtRepeat, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
2793
|
+
NgtRepeat.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.1", type: NgtRepeat, isStandalone: true, selector: "[ngFor][ngForRepeat]", inputs: { ngForRepeat: "ngForRepeat" }, usesInheritance: true, ngImport: i0 });
|
|
2794
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtRepeat, decorators: [{
|
|
2800
2795
|
type: Directive,
|
|
2801
2796
|
args: [{ selector: '[ngFor][ngForRepeat]', standalone: true }]
|
|
2802
2797
|
}], propDecorators: { ngForRepeat: [{
|
|
@@ -2811,50 +2806,43 @@ class NgtPush {
|
|
|
2811
2806
|
constructor() {
|
|
2812
2807
|
this.cdr = inject(ChangeDetectorRef);
|
|
2813
2808
|
this.parentCdr = inject(ChangeDetectorRef, { skipSelf: true, optional: true });
|
|
2809
|
+
this.envCdr = inject(EnvironmentInjector).get(ChangeDetectorRef, null);
|
|
2814
2810
|
}
|
|
2815
2811
|
transform(value, defaultValue = null) {
|
|
2816
|
-
if (this.obj === value)
|
|
2812
|
+
if (this.obj === value)
|
|
2817
2813
|
return this.latestValue;
|
|
2818
|
-
}
|
|
2819
2814
|
this.obj = value;
|
|
2820
2815
|
this.latestValue = defaultValue;
|
|
2821
|
-
if (this.sub)
|
|
2816
|
+
if (this.sub)
|
|
2822
2817
|
this.sub.unsubscribe();
|
|
2823
|
-
|
|
2824
|
-
if (isObservable(this.obj)) {
|
|
2818
|
+
if (isObservable(this.obj))
|
|
2825
2819
|
this.sub = this.obj.subscribe(this.updateValue.bind(this));
|
|
2826
|
-
|
|
2827
|
-
else if (isPromise(this.obj)) {
|
|
2820
|
+
else if (isPromise(this.obj))
|
|
2828
2821
|
this.obj.then(this.updateValue.bind(this));
|
|
2829
|
-
|
|
2830
|
-
else {
|
|
2822
|
+
else
|
|
2831
2823
|
throw new Error(`[NGT] Invalid value passed to ngtPush pipe`);
|
|
2832
|
-
}
|
|
2833
2824
|
return this.latestValue;
|
|
2834
2825
|
}
|
|
2835
2826
|
updateValue(val) {
|
|
2836
2827
|
this.latestValue = val;
|
|
2837
|
-
this.cdr
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
}
|
|
2828
|
+
safeDetectChanges(this.cdr);
|
|
2829
|
+
safeDetectChanges(this.parentCdr);
|
|
2830
|
+
safeDetectChanges(this.envCdr);
|
|
2841
2831
|
}
|
|
2842
2832
|
ngOnDestroy() {
|
|
2843
|
-
if (this.sub)
|
|
2833
|
+
if (this.sub)
|
|
2844
2834
|
this.sub.unsubscribe();
|
|
2845
|
-
}
|
|
2846
2835
|
this.latestValue = undefined;
|
|
2847
2836
|
this.obj = undefined;
|
|
2848
2837
|
}
|
|
2849
2838
|
}
|
|
2850
|
-
NgtPush.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1
|
|
2851
|
-
NgtPush.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1
|
|
2852
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1
|
|
2839
|
+
NgtPush.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtPush, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2840
|
+
NgtPush.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.1", ngImport: i0, type: NgtPush, isStandalone: true, name: "ngtPush", pure: false });
|
|
2841
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtPush, decorators: [{
|
|
2853
2842
|
type: Pipe,
|
|
2854
2843
|
args: [{ name: 'ngtPush', pure: false, standalone: true }]
|
|
2855
2844
|
}] });
|
|
2856
2845
|
|
|
2857
|
-
var _NgtPortal_instances, _NgtPortal_inject;
|
|
2858
2846
|
const privateKeys = [
|
|
2859
2847
|
'get',
|
|
2860
2848
|
'set',
|
|
@@ -2900,9 +2888,9 @@ class NgtPortalBeforeRender {
|
|
|
2900
2888
|
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
2901
2889
|
}
|
|
2902
2890
|
}
|
|
2903
|
-
NgtPortalBeforeRender.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1
|
|
2904
|
-
NgtPortalBeforeRender.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1
|
|
2905
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1
|
|
2891
|
+
NgtPortalBeforeRender.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtPortalBeforeRender, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2892
|
+
NgtPortalBeforeRender.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.1", type: NgtPortalBeforeRender, isStandalone: true, selector: "ngt-portal-before-render", inputs: { renderPriority: "renderPriority", parentScene: "parentScene", parentCamera: "parentCamera" }, outputs: { beforeRender: "beforeRender" }, ngImport: i0 });
|
|
2893
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtPortalBeforeRender, decorators: [{
|
|
2906
2894
|
type: Directive,
|
|
2907
2895
|
args: [{
|
|
2908
2896
|
selector: 'ngt-portal-before-render',
|
|
@@ -2926,9 +2914,9 @@ class NgtPortalContent {
|
|
|
2926
2914
|
}
|
|
2927
2915
|
}
|
|
2928
2916
|
}
|
|
2929
|
-
NgtPortalContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1
|
|
2930
|
-
NgtPortalContent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1
|
|
2931
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1
|
|
2917
|
+
NgtPortalContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtPortalContent, deps: [{ token: i0.ViewContainerRef }, { token: i0.ViewContainerRef, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2918
|
+
NgtPortalContent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.1", type: NgtPortalContent, isStandalone: true, selector: "ng-template[ngtPortalContent]", ngImport: i0 });
|
|
2919
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtPortalContent, decorators: [{
|
|
2932
2920
|
type: Directive,
|
|
2933
2921
|
args: [{ selector: 'ng-template[ngtPortalContent]', standalone: true }]
|
|
2934
2922
|
}], ctorParameters: function () {
|
|
@@ -2939,7 +2927,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
|
|
|
2939
2927
|
class NgtPortal extends NgtRxStore {
|
|
2940
2928
|
constructor() {
|
|
2941
2929
|
super(...arguments);
|
|
2942
|
-
_NgtPortal_instances.add(this);
|
|
2943
2930
|
this.autoRender = true;
|
|
2944
2931
|
this.autoRenderPriority = 1;
|
|
2945
2932
|
this.beforeRender = new EventEmitter();
|
|
@@ -2975,9 +2962,9 @@ class NgtPortal extends NgtRxStore {
|
|
|
2975
2962
|
localState.store = this.portalStore;
|
|
2976
2963
|
}
|
|
2977
2964
|
this.portalStore.set(Object.assign(Object.assign(Object.assign(Object.assign({}, previousState), { scene: container, raycaster: this.raycaster, pointer: this.pointer, previousStore: this.parentStore, events: Object.assign(Object.assign({}, previousState.events), (events || {})), size: Object.assign(Object.assign({}, previousState.size), (size || {})) }), restInputsState), { get: this.portalStore.get.bind(this.portalStore), set: this.portalStore.set.bind(this.portalStore), select: this.portalStore.select.bind(this.portalStore), setEvents: (events) => this.portalStore.set((state) => (Object.assign(Object.assign({}, state), { events: Object.assign(Object.assign({}, state.events), events) }))) }));
|
|
2978
|
-
this.hold(this.parentStore.select(), (previous) => this.portalStore.set((state) =>
|
|
2965
|
+
this.hold(this.parentStore.select(), (previous) => this.portalStore.set((state) => this.inject(previous, state)));
|
|
2979
2966
|
requestAnimationFrame(() => {
|
|
2980
|
-
this.portalStore.set((injectState) =>
|
|
2967
|
+
this.portalStore.set((injectState) => this.inject(this.parentStore.get(), injectState));
|
|
2981
2968
|
});
|
|
2982
2969
|
this.portalContentView = this.portalContentAnchor.createEmbeddedView(this.portalContentTemplate);
|
|
2983
2970
|
this.portalContentView.detectChanges();
|
|
@@ -2995,28 +2982,28 @@ class NgtPortal extends NgtRxStore {
|
|
|
2995
2982
|
}
|
|
2996
2983
|
super.ngOnDestroy();
|
|
2997
2984
|
}
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
2985
|
+
inject(rootState, injectState) {
|
|
2986
|
+
const intersect = Object.assign({}, rootState);
|
|
2987
|
+
Object.keys(intersect).forEach((key) => {
|
|
2988
|
+
if (privateKeys.includes(key) ||
|
|
2989
|
+
rootState[key] !== injectState[key]) {
|
|
2990
|
+
delete intersect[key];
|
|
2991
|
+
}
|
|
2992
|
+
});
|
|
2993
|
+
const inputs = this.get();
|
|
2994
|
+
const _a = inputs.state || {}, { size, events } = _a, restInputsState = __rest(_a, ["size", "events"]);
|
|
2995
|
+
let viewport = undefined;
|
|
2996
|
+
if (injectState && size) {
|
|
2997
|
+
const camera = injectState.camera;
|
|
2998
|
+
viewport = rootState.viewport.getCurrentViewport(camera, new THREE.Vector3(), size);
|
|
2999
|
+
if (camera !== rootState.camera)
|
|
3000
|
+
updateCamera(camera, size);
|
|
3005
3001
|
}
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
const camera = injectState.camera;
|
|
3012
|
-
viewport = rootState.viewport.getCurrentViewport(camera, new THREE.Vector3(), size);
|
|
3013
|
-
if (camera !== rootState.camera)
|
|
3014
|
-
updateCamera(camera, size);
|
|
3015
|
-
}
|
|
3016
|
-
return Object.assign(Object.assign(Object.assign({}, intersect), { scene: is.ref(inputs.container) ? inputs.container.nativeElement : inputs.container, raycaster: this.raycaster, pointer: this.pointer, previousStore: this.parentStore, events: Object.assign(Object.assign(Object.assign({}, rootState.events), ((injectState === null || injectState === void 0 ? void 0 : injectState.events) || {})), events), size: Object.assign(Object.assign({}, rootState.size), size), viewport: Object.assign(Object.assign({}, rootState.viewport), (viewport || {})) }), restInputsState);
|
|
3017
|
-
};
|
|
3018
|
-
NgtPortal.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: NgtPortal, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3019
|
-
NgtPortal.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: NgtPortal, isStandalone: true, selector: "ngt-portal", inputs: { container: "container", state: "state", autoRender: "autoRender", autoRenderPriority: "autoRenderPriority" }, outputs: { beforeRender: "beforeRender" }, providers: [NgtStore], queries: [{ propertyName: "portalContentTemplate", first: true, predicate: NgtPortalContent, descendants: true, read: TemplateRef, static: true }], viewQueries: [{ propertyName: "portalContentAnchor", first: true, predicate: ["portalContentAnchor"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
3002
|
+
return Object.assign(Object.assign(Object.assign({}, intersect), { scene: is.ref(inputs.container) ? inputs.container.nativeElement : inputs.container, raycaster: this.raycaster, pointer: this.pointer, previousStore: this.parentStore, events: Object.assign(Object.assign(Object.assign({}, rootState.events), ((injectState === null || injectState === void 0 ? void 0 : injectState.events) || {})), events), size: Object.assign(Object.assign({}, rootState.size), size), viewport: Object.assign(Object.assign({}, rootState.viewport), (viewport || {})) }), restInputsState);
|
|
3003
|
+
}
|
|
3004
|
+
}
|
|
3005
|
+
NgtPortal.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtPortal, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3006
|
+
NgtPortal.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: NgtPortal, isStandalone: true, selector: "ngt-portal", inputs: { container: "container", state: "state", autoRender: "autoRender", autoRenderPriority: "autoRenderPriority" }, outputs: { beforeRender: "beforeRender" }, providers: [NgtStore], queries: [{ propertyName: "portalContentTemplate", first: true, predicate: NgtPortalContent, descendants: true, read: TemplateRef, static: true }], viewQueries: [{ propertyName: "portalContentAnchor", first: true, predicate: ["portalContentAnchor"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
3020
3007
|
<ng-container #portalContentAnchor>
|
|
3021
3008
|
<ngt-portal-before-render
|
|
3022
3009
|
*ngIf="autoRender && portalContentRendered"
|
|
@@ -3027,7 +3014,7 @@ NgtPortal.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15
|
|
|
3027
3014
|
/>
|
|
3028
3015
|
</ng-container>
|
|
3029
3016
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgtPortalBeforeRender, selector: "ngt-portal-before-render", inputs: ["renderPriority", "parentScene", "parentCamera"], outputs: ["beforeRender"] }] });
|
|
3030
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1
|
|
3017
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtPortal, decorators: [{
|
|
3031
3018
|
type: Component,
|
|
3032
3019
|
args: [{
|
|
3033
3020
|
selector: 'ngt-portal',
|
|
@@ -3069,15 +3056,13 @@ class NgtRoutedScene {
|
|
|
3069
3056
|
const { destroy$, cdr } = injectNgtDestroy();
|
|
3070
3057
|
router.events
|
|
3071
3058
|
.pipe(filter((event) => event instanceof ActivationEnd), takeUntil(destroy$))
|
|
3072
|
-
.subscribe(() =>
|
|
3073
|
-
cdr.detectChanges();
|
|
3074
|
-
});
|
|
3059
|
+
.subscribe(() => safeDetectChanges(cdr));
|
|
3075
3060
|
}
|
|
3076
3061
|
}
|
|
3077
3062
|
NgtRoutedScene.isRoutedScene = true;
|
|
3078
|
-
NgtRoutedScene.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1
|
|
3079
|
-
NgtRoutedScene.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1
|
|
3080
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1
|
|
3063
|
+
NgtRoutedScene.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtRoutedScene, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
3064
|
+
NgtRoutedScene.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: NgtRoutedScene, isStandalone: true, selector: "ngt-routed-scene", ngImport: i0, template: `<router-outlet />`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
|
|
3065
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: NgtRoutedScene, decorators: [{
|
|
3081
3066
|
type: Component,
|
|
3082
3067
|
args: [{
|
|
3083
3068
|
standalone: true,
|