angular-three 3.7.0 → 4.0.0-next.2
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/dom/README.md +3 -0
- package/dom/index.d.ts +2 -0
- package/dom/lib/canvas.d.ts +49 -0
- package/{lib/dom → dom/lib}/events.d.ts +2 -3
- package/dom/lib/renderer.d.ts +1 -0
- package/fesm2022/angular-three-dom.mjs +278 -0
- package/fesm2022/angular-three-dom.mjs.map +1 -0
- package/fesm2022/angular-three-testing.mjs +45 -28
- package/fesm2022/angular-three-testing.mjs.map +1 -1
- package/fesm2022/angular-three.mjs +2671 -3006
- package/fesm2022/angular-three.mjs.map +1 -1
- package/index.d.ts +5 -3
- package/lib/directives/args.d.ts +4 -8
- package/lib/directives/common.d.ts +20 -0
- package/lib/directives/parent.d.ts +7 -11
- package/lib/events.d.ts +5 -5
- package/lib/html.d.ts +3 -6
- package/lib/instance.d.ts +8 -4
- package/lib/loop.d.ts +13 -25
- package/lib/portal.d.ts +26 -45
- package/lib/renderer/catalogue.d.ts +4 -12
- package/lib/renderer/constants.d.ts +11 -22
- package/lib/renderer/renderer.d.ts +53 -0
- package/lib/renderer/state.d.ts +62 -22
- package/lib/renderer/utils.d.ts +10 -10
- package/lib/roots.d.ts +2 -6
- package/lib/routed-scene.d.ts +2 -10
- package/lib/store.d.ts +7 -12
- package/lib/three-types.d.ts +225 -404
- package/lib/types.d.ts +168 -162
- package/lib/utils/apply-props.d.ts +4 -2
- package/lib/utils/attach.d.ts +5 -5
- package/lib/utils/before-render.d.ts +1 -1
- package/lib/utils/is.d.ts +12 -11
- package/lib/utils/make.d.ts +7 -7
- package/lib/utils/object-events.d.ts +4 -4
- package/lib/utils/parameters.d.ts +11 -11
- package/lib/utils/signal-state.d.ts +27 -0
- package/lib/utils/update.d.ts +2 -2
- package/package.json +5 -23
- package/testing/lib/test-bed.d.ts +12 -9
- package/testing/lib/test-canvas.d.ts +8 -5
- package/fesm2022/angular-three-nativescript.mjs +0 -134
- package/fesm2022/angular-three-nativescript.mjs.map +0 -1
- package/lib/canvas.d.ts +0 -368
- package/lib/renderer/index.d.ts +0 -65
- package/lib/utils/signal-store.d.ts +0 -26
- package/metadata.json +0 -1
- package/nativescript/README.md +0 -5
- package/nativescript/index.d.ts +0 -1
- package/nativescript/lib/canvas.d.ts +0 -359
- package/web-types.json +0 -1
package/dom/README.md
ADDED
package/dom/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { NgtCamera, NgtCameraParameters, NgtDpr, NgtEventPrefix, NgtFrameloop, NgtGLOptions, NgtPerformance, NgtShadows, NgtSize, NgtState } from 'angular-three';
|
|
3
|
+
import { ResizeResult } from 'ngxtension/resize';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { createPointerEvents } from './events';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class NgtCanvasContent {
|
|
8
|
+
constructor();
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgtCanvasContent, never>;
|
|
10
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgtCanvasContent, "ng-template[canvasContent]", never, {}, {}, never, never, true, never>;
|
|
11
|
+
}
|
|
12
|
+
export declare class NgtCanvas {
|
|
13
|
+
private store;
|
|
14
|
+
private initRoot;
|
|
15
|
+
private host;
|
|
16
|
+
private zone;
|
|
17
|
+
private injector;
|
|
18
|
+
gl: import("@angular/core").InputSignal<NgtGLOptions>;
|
|
19
|
+
size: import("@angular/core").InputSignal<NgtSize | undefined>;
|
|
20
|
+
shadows: import("@angular/core").InputSignalWithTransform<NgtShadows, unknown>;
|
|
21
|
+
legacy: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
22
|
+
linear: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
23
|
+
flat: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
24
|
+
orthographic: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
25
|
+
frameloop: import("@angular/core").InputSignal<NgtFrameloop>;
|
|
26
|
+
performance: import("@angular/core").InputSignal<Partial<Omit<NgtPerformance, "regress">> | undefined>;
|
|
27
|
+
dpr: import("@angular/core").InputSignal<NgtDpr>;
|
|
28
|
+
raycaster: import("@angular/core").InputSignal<Partial<THREE.Raycaster> | undefined>;
|
|
29
|
+
scene: import("@angular/core").InputSignal<THREE.Scene | Partial<THREE.Scene> | undefined>;
|
|
30
|
+
camera: import("@angular/core").InputSignal<NgtCamera | NgtCameraParameters | undefined>;
|
|
31
|
+
events: import("@angular/core").InputSignal<typeof createPointerEvents>;
|
|
32
|
+
eventSource: import("@angular/core").InputSignal<HTMLElement | ElementRef<HTMLElement> | undefined>;
|
|
33
|
+
eventPrefix: import("@angular/core").InputSignal<NgtEventPrefix>;
|
|
34
|
+
lookAt: import("@angular/core").InputSignal<number | THREE.Vector3 | [x: number, y: number, z: number] | undefined>;
|
|
35
|
+
created: import("@angular/core").OutputEmitterRef<NgtState>;
|
|
36
|
+
pointerMissed: import("@angular/core").OutputRef<MouseEvent>;
|
|
37
|
+
private glCanvas;
|
|
38
|
+
private glCanvasViewContainerRef;
|
|
39
|
+
private canvasContentRef;
|
|
40
|
+
protected hbPointerEvents: import("@angular/core").Signal<"none" | "auto">;
|
|
41
|
+
protected resizeResult: import("@angular/core").WritableSignal<ResizeResult>;
|
|
42
|
+
private configurator;
|
|
43
|
+
private glRef?;
|
|
44
|
+
constructor();
|
|
45
|
+
private noZoneRender;
|
|
46
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgtCanvas, never>;
|
|
47
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgtCanvas, "ngt-canvas", never, { "gl": { "alias": "gl"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "shadows": { "alias": "shadows"; "required": false; "isSignal": true; }; "legacy": { "alias": "legacy"; "required": false; "isSignal": true; }; "linear": { "alias": "linear"; "required": false; "isSignal": true; }; "flat": { "alias": "flat"; "required": false; "isSignal": true; }; "orthographic": { "alias": "orthographic"; "required": false; "isSignal": true; }; "frameloop": { "alias": "frameloop"; "required": false; "isSignal": true; }; "performance": { "alias": "performance"; "required": false; "isSignal": true; }; "dpr": { "alias": "dpr"; "required": false; "isSignal": true; }; "raycaster": { "alias": "raycaster"; "required": false; "isSignal": true; }; "scene": { "alias": "scene"; "required": false; "isSignal": true; }; "camera": { "alias": "camera"; "required": false; "isSignal": true; }; "events": { "alias": "events"; "required": false; "isSignal": true; }; "eventSource": { "alias": "eventSource"; "required": false; "isSignal": true; }; "eventPrefix": { "alias": "eventPrefix"; "required": false; "isSignal": true; }; "lookAt": { "alias": "lookAt"; "required": false; "isSignal": true; }; }, { "created": "created"; "pointerMissed": "pointerMissed"; }, ["canvasContentRef"], ["*"], true, never>;
|
|
48
|
+
}
|
|
49
|
+
export declare const NgtCanvasDeclarations: readonly [typeof NgtCanvas, typeof NgtCanvasContent];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { NgtEventManager, NgtState } from '
|
|
2
|
-
import { NgtSignalStore } from '../utils/signal-store';
|
|
1
|
+
import { NgtEventManager, NgtState, SignalState } from 'angular-three';
|
|
3
2
|
export declare const supportedEvents: readonly ["click", "contextmenu", "dblclick", "pointerup", "pointerdown", "pointerover", "pointerout", "pointerenter", "pointerleave", "pointermove", "pointermissed", "pointercancel", "wheel"];
|
|
4
|
-
export declare function createPointerEvents(store:
|
|
3
|
+
export declare function createPointerEvents(store: SignalState<NgtState>): NgtEventManager<HTMLElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function provideNgtRenderer(): import("@angular/core").EnvironmentProviders;
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ViewContainerRef, Directive, ElementRef, NgZone, Injector, input, booleanAttribute, output, viewChild, contentChild, TemplateRef, computed, signal, afterNextRender, effect, DestroyRef, untracked, Component, ChangeDetectionStrategy, makeEnvironmentProviders, RendererFactory2 } from '@angular/core';
|
|
3
|
+
import { outputFromObservable } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { createEvents, injectStore, NGT_CANVAS_CONTENT_FLAG, injectCanvasRootInitializer, is, NGT_STORE, storeFactory, NgtRendererFactory2 } from 'angular-three';
|
|
5
|
+
import { provideResizeOptions, NgxResize } from 'ngxtension/resize';
|
|
6
|
+
import { ɵDomRendererFactory2 as _DomRendererFactory2 } from '@angular/platform-browser';
|
|
7
|
+
|
|
8
|
+
const DOM_EVENTS = {
|
|
9
|
+
click: false,
|
|
10
|
+
contextmenu: false,
|
|
11
|
+
dblclick: false,
|
|
12
|
+
wheel: false, // passive wheel errors with OrbitControls
|
|
13
|
+
pointerdown: true,
|
|
14
|
+
pointerup: true,
|
|
15
|
+
pointerleave: true,
|
|
16
|
+
pointermove: true,
|
|
17
|
+
pointercancel: true,
|
|
18
|
+
lostpointercapture: true,
|
|
19
|
+
};
|
|
20
|
+
const supportedEvents = [
|
|
21
|
+
'click',
|
|
22
|
+
'contextmenu',
|
|
23
|
+
'dblclick',
|
|
24
|
+
'pointerup',
|
|
25
|
+
'pointerdown',
|
|
26
|
+
'pointerover',
|
|
27
|
+
'pointerout',
|
|
28
|
+
'pointerenter',
|
|
29
|
+
'pointerleave',
|
|
30
|
+
'pointermove',
|
|
31
|
+
'pointermissed',
|
|
32
|
+
'pointercancel',
|
|
33
|
+
'wheel',
|
|
34
|
+
];
|
|
35
|
+
function createPointerEvents(store) {
|
|
36
|
+
const { handlePointer } = createEvents(store);
|
|
37
|
+
return {
|
|
38
|
+
priority: 1,
|
|
39
|
+
enabled: true,
|
|
40
|
+
compute: (event, root) => {
|
|
41
|
+
const state = root.snapshot;
|
|
42
|
+
// https://github.com/pmndrs/react-three-fiber/pull/782
|
|
43
|
+
// Events trigger outside of canvas when moved, use offsetX/Y by default and allow overrides
|
|
44
|
+
state.pointer.set((event.offsetX / state.size.width) * 2 - 1, -(event.offsetY / state.size.height) * 2 + 1);
|
|
45
|
+
state.raycaster.setFromCamera(state.pointer, state.camera);
|
|
46
|
+
},
|
|
47
|
+
connected: undefined,
|
|
48
|
+
handlers: Object.keys(DOM_EVENTS).reduce((handlers, supportedEventName) => {
|
|
49
|
+
handlers[supportedEventName] = handlePointer(supportedEventName);
|
|
50
|
+
return handlers;
|
|
51
|
+
}, {}),
|
|
52
|
+
update: () => {
|
|
53
|
+
const { events, internal } = store.snapshot;
|
|
54
|
+
if (internal.lastEvent?.nativeElement && events.handlers)
|
|
55
|
+
events.handlers.pointermove(internal.lastEvent.nativeElement);
|
|
56
|
+
},
|
|
57
|
+
connect: (target) => {
|
|
58
|
+
const state = store.snapshot;
|
|
59
|
+
state.events.disconnect?.();
|
|
60
|
+
state.setEvents({ connected: target });
|
|
61
|
+
Object.entries(state.events.handlers ?? {}).forEach(([eventName, eventHandler]) => {
|
|
62
|
+
const passive = DOM_EVENTS[eventName];
|
|
63
|
+
target.addEventListener(eventName, eventHandler, { passive });
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
disconnect: () => {
|
|
67
|
+
const { events, setEvents } = store.snapshot;
|
|
68
|
+
if (events.connected) {
|
|
69
|
+
Object.entries(events.handlers ?? {}).forEach(([eventName, eventHandler]) => {
|
|
70
|
+
if (events.connected instanceof HTMLElement) {
|
|
71
|
+
events.connected.removeEventListener(eventName, eventHandler);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
setEvents({ connected: undefined });
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
class NgtCanvasContent {
|
|
81
|
+
constructor() {
|
|
82
|
+
const store = injectStore();
|
|
83
|
+
const vcr = inject(ViewContainerRef);
|
|
84
|
+
const commentNode = vcr.element.nativeElement;
|
|
85
|
+
// NOTE: flag this canvasContent ng-template comment node as the start
|
|
86
|
+
commentNode.data = NGT_CANVAS_CONTENT_FLAG;
|
|
87
|
+
commentNode[NGT_CANVAS_CONTENT_FLAG] = store;
|
|
88
|
+
}
|
|
89
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtCanvasContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
90
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: NgtCanvasContent, isStandalone: true, selector: "ng-template[canvasContent]", ngImport: i0 }); }
|
|
91
|
+
}
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtCanvasContent, decorators: [{
|
|
93
|
+
type: Directive,
|
|
94
|
+
args: [{ selector: 'ng-template[canvasContent]' }]
|
|
95
|
+
}], ctorParameters: () => [] });
|
|
96
|
+
class NgtCanvas {
|
|
97
|
+
constructor() {
|
|
98
|
+
this.store = injectStore();
|
|
99
|
+
this.initRoot = injectCanvasRootInitializer();
|
|
100
|
+
this.host = inject(ElementRef);
|
|
101
|
+
this.zone = inject(NgZone);
|
|
102
|
+
this.injector = inject(Injector);
|
|
103
|
+
this.gl = input();
|
|
104
|
+
this.size = input();
|
|
105
|
+
this.shadows = input(false, {
|
|
106
|
+
transform: (value) => {
|
|
107
|
+
if (value === '')
|
|
108
|
+
return booleanAttribute(value);
|
|
109
|
+
return value;
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
this.legacy = input(false, { transform: booleanAttribute });
|
|
113
|
+
this.linear = input(false, { transform: booleanAttribute });
|
|
114
|
+
this.flat = input(false, { transform: booleanAttribute });
|
|
115
|
+
this.orthographic = input(false, { transform: booleanAttribute });
|
|
116
|
+
this.frameloop = input('always');
|
|
117
|
+
this.performance = input();
|
|
118
|
+
this.dpr = input([1, 2]);
|
|
119
|
+
this.raycaster = input();
|
|
120
|
+
this.scene = input();
|
|
121
|
+
this.camera = input();
|
|
122
|
+
this.events = input(createPointerEvents);
|
|
123
|
+
this.eventSource = input();
|
|
124
|
+
this.eventPrefix = input('offset');
|
|
125
|
+
this.lookAt = input();
|
|
126
|
+
this.created = output();
|
|
127
|
+
this.pointerMissed = outputFromObservable(this.store.snapshot.pointerMissed$);
|
|
128
|
+
this.glCanvas = viewChild.required('glCanvas');
|
|
129
|
+
this.glCanvasViewContainerRef = viewChild.required('glCanvas', { read: ViewContainerRef });
|
|
130
|
+
this.canvasContentRef = contentChild.required(NgtCanvasContent, { read: TemplateRef });
|
|
131
|
+
this.hbPointerEvents = computed(() => (this.eventSource() ? 'none' : 'auto'));
|
|
132
|
+
// NOTE: this signal is updated outside of Zone
|
|
133
|
+
this.resizeResult = signal({}, { equal: Object.is });
|
|
134
|
+
this.configurator = signal(null);
|
|
135
|
+
// NOTE: this means that everything in NgtCanvas will be in afterNextRender.
|
|
136
|
+
// this allows the content of NgtCanvas to use effect instead of afterNextRender
|
|
137
|
+
afterNextRender(() => {
|
|
138
|
+
const [canvasVcr, canvasElement, canvasContent] = [
|
|
139
|
+
this.glCanvasViewContainerRef(),
|
|
140
|
+
this.glCanvas().nativeElement,
|
|
141
|
+
this.canvasContentRef(),
|
|
142
|
+
];
|
|
143
|
+
this.zone.runOutsideAngular(() => {
|
|
144
|
+
this.configurator.set(this.initRoot(canvasElement));
|
|
145
|
+
});
|
|
146
|
+
effect(() => {
|
|
147
|
+
const resizeResult = this.resizeResult();
|
|
148
|
+
if (!resizeResult.width || resizeResult.width <= 0 || !resizeResult.height || resizeResult.height <= 0)
|
|
149
|
+
return;
|
|
150
|
+
const configurator = this.configurator();
|
|
151
|
+
if (!configurator)
|
|
152
|
+
return;
|
|
153
|
+
const canvasOptions = {
|
|
154
|
+
gl: this.gl(),
|
|
155
|
+
shadows: this.shadows(),
|
|
156
|
+
legacy: this.legacy(),
|
|
157
|
+
linear: this.linear(),
|
|
158
|
+
flat: this.flat(),
|
|
159
|
+
orthographic: this.orthographic(),
|
|
160
|
+
frameloop: this.frameloop(),
|
|
161
|
+
performance: this.performance(),
|
|
162
|
+
dpr: this.dpr(),
|
|
163
|
+
raycaster: this.raycaster(),
|
|
164
|
+
scene: this.scene(),
|
|
165
|
+
camera: this.camera(),
|
|
166
|
+
events: this.events(),
|
|
167
|
+
eventSource: this.eventSource(),
|
|
168
|
+
eventPrefix: this.eventPrefix(),
|
|
169
|
+
lookAt: this.lookAt(),
|
|
170
|
+
size: resizeResult,
|
|
171
|
+
};
|
|
172
|
+
this.zone.runOutsideAngular(() => {
|
|
173
|
+
configurator.configure(canvasOptions);
|
|
174
|
+
if (this.glRef) {
|
|
175
|
+
this.glRef.detectChanges();
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
this.noZoneRender(canvasElement, canvasVcr, canvasContent);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}, { injector: this.injector });
|
|
182
|
+
});
|
|
183
|
+
inject(DestroyRef).onDestroy(() => {
|
|
184
|
+
this.glRef?.destroy();
|
|
185
|
+
this.configurator()?.destroy();
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
noZoneRender(canvasElement, canvasVcr, canvasContent) {
|
|
189
|
+
// NOTE: destroy previous instances if existed
|
|
190
|
+
this.glRef?.destroy();
|
|
191
|
+
// NOTE: Flag the canvas active, rendering will now begin
|
|
192
|
+
this.store.update((state) => ({ internal: { ...state.internal, active: true } }));
|
|
193
|
+
const [state, eventSource, eventPrefix] = [
|
|
194
|
+
this.store.snapshot,
|
|
195
|
+
untracked(this.eventSource),
|
|
196
|
+
untracked(this.eventPrefix),
|
|
197
|
+
];
|
|
198
|
+
// connect to event source
|
|
199
|
+
state.events.connect?.(eventSource ? (is.ref(eventSource) ? eventSource.nativeElement : eventSource) : this.host.nativeElement);
|
|
200
|
+
// setup compute for eventPrefix
|
|
201
|
+
if (eventPrefix) {
|
|
202
|
+
state.setEvents({
|
|
203
|
+
compute: (event, store) => {
|
|
204
|
+
const { pointer, raycaster, camera, size } = store.snapshot;
|
|
205
|
+
const x = event[(eventPrefix + 'X')];
|
|
206
|
+
const y = event[(eventPrefix + 'Y')];
|
|
207
|
+
pointer.set((x / size.width) * 2 - 1, -(y / size.height) * 2 + 1);
|
|
208
|
+
raycaster.setFromCamera(pointer, camera);
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
this.created.emit(this.store.snapshot);
|
|
213
|
+
if (!this.store.snapshot.events.connected) {
|
|
214
|
+
this.store.snapshot.events.connect?.(canvasElement);
|
|
215
|
+
}
|
|
216
|
+
this.glRef = canvasVcr.createEmbeddedView(canvasContent, {}, { injector: this.injector });
|
|
217
|
+
this.glRef.detectChanges();
|
|
218
|
+
}
|
|
219
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtCanvas, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
220
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.6", type: NgtCanvas, isStandalone: true, selector: "ngt-canvas", inputs: { gl: { classPropertyName: "gl", publicName: "gl", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shadows: { classPropertyName: "shadows", publicName: "shadows", isSignal: true, isRequired: false, transformFunction: null }, legacy: { classPropertyName: "legacy", publicName: "legacy", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null }, flat: { classPropertyName: "flat", publicName: "flat", isSignal: true, isRequired: false, transformFunction: null }, orthographic: { classPropertyName: "orthographic", publicName: "orthographic", isSignal: true, isRequired: false, transformFunction: null }, frameloop: { classPropertyName: "frameloop", publicName: "frameloop", isSignal: true, isRequired: false, transformFunction: null }, performance: { classPropertyName: "performance", publicName: "performance", isSignal: true, isRequired: false, transformFunction: null }, dpr: { classPropertyName: "dpr", publicName: "dpr", isSignal: true, isRequired: false, transformFunction: null }, raycaster: { classPropertyName: "raycaster", publicName: "raycaster", isSignal: true, isRequired: false, transformFunction: null }, scene: { classPropertyName: "scene", publicName: "scene", isSignal: true, isRequired: false, transformFunction: null }, camera: { classPropertyName: "camera", publicName: "camera", isSignal: true, isRequired: false, transformFunction: null }, events: { classPropertyName: "events", publicName: "events", isSignal: true, isRequired: false, transformFunction: null }, eventSource: { classPropertyName: "eventSource", publicName: "eventSource", isSignal: true, isRequired: false, transformFunction: null }, eventPrefix: { classPropertyName: "eventPrefix", publicName: "eventPrefix", isSignal: true, isRequired: false, transformFunction: null }, lookAt: { classPropertyName: "lookAt", publicName: "lookAt", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { created: "created", pointerMissed: "pointerMissed" }, host: { attributes: { "ngSkipHydration": "true" }, properties: { "style.pointerEvents": "hbPointerEvents()" }, styleAttribute: "display: block;position: relative;width: 100%;height: 100%;overflow: hidden;" }, providers: [
|
|
221
|
+
provideResizeOptions({
|
|
222
|
+
emitInZone: false,
|
|
223
|
+
emitInitialResult: true,
|
|
224
|
+
debounce: { scroll: 50, resize: 0 },
|
|
225
|
+
}),
|
|
226
|
+
{ provide: NGT_STORE, useFactory: storeFactory },
|
|
227
|
+
], queries: [{ propertyName: "canvasContentRef", first: true, predicate: NgtCanvasContent, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "glCanvas", first: true, predicate: ["glCanvas"], descendants: true, isSignal: true }, { propertyName: "glCanvasViewContainerRef", first: true, predicate: ["glCanvas"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: `
|
|
228
|
+
<div (ngxResize)="resizeResult.set($event)" style="height: 100%; width: 100%;">
|
|
229
|
+
<canvas #glCanvas style="display: block;"></canvas>
|
|
230
|
+
<ng-content />
|
|
231
|
+
</div>
|
|
232
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgxResize, selector: "[ngxResize]", inputs: ["ngxResizeOptions"], outputs: ["ngxResize"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
233
|
+
}
|
|
234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtCanvas, decorators: [{
|
|
235
|
+
type: Component,
|
|
236
|
+
args: [{
|
|
237
|
+
selector: 'ngt-canvas',
|
|
238
|
+
template: `
|
|
239
|
+
<div (ngxResize)="resizeResult.set($event)" style="height: 100%; width: 100%;">
|
|
240
|
+
<canvas #glCanvas style="display: block;"></canvas>
|
|
241
|
+
<ng-content />
|
|
242
|
+
</div>
|
|
243
|
+
`,
|
|
244
|
+
imports: [NgxResize],
|
|
245
|
+
providers: [
|
|
246
|
+
provideResizeOptions({
|
|
247
|
+
emitInZone: false,
|
|
248
|
+
emitInitialResult: true,
|
|
249
|
+
debounce: { scroll: 50, resize: 0 },
|
|
250
|
+
}),
|
|
251
|
+
{ provide: NGT_STORE, useFactory: storeFactory },
|
|
252
|
+
],
|
|
253
|
+
host: {
|
|
254
|
+
style: 'display: block;position: relative;width: 100%;height: 100%;overflow: hidden;',
|
|
255
|
+
'[style.pointerEvents]': 'hbPointerEvents()',
|
|
256
|
+
ngSkipHydration: 'true',
|
|
257
|
+
},
|
|
258
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
259
|
+
}]
|
|
260
|
+
}], ctorParameters: () => [] });
|
|
261
|
+
const NgtCanvasDeclarations = [NgtCanvas, NgtCanvasContent];
|
|
262
|
+
|
|
263
|
+
function provideNgtRenderer() {
|
|
264
|
+
return makeEnvironmentProviders([
|
|
265
|
+
{
|
|
266
|
+
provide: RendererFactory2,
|
|
267
|
+
useFactory: (domRendererFactory) => new NgtRendererFactory2(domRendererFactory),
|
|
268
|
+
deps: [_DomRendererFactory2],
|
|
269
|
+
},
|
|
270
|
+
]);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Generated bundle index. Do not edit.
|
|
275
|
+
*/
|
|
276
|
+
|
|
277
|
+
export { NgtCanvas, NgtCanvasContent, NgtCanvasDeclarations, provideNgtRenderer };
|
|
278
|
+
//# sourceMappingURL=angular-three-dom.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angular-three-dom.mjs","sources":["../../../../libs/core/dom/src/lib/events.ts","../../../../libs/core/dom/src/lib/canvas.ts","../../../../libs/core/dom/src/lib/renderer.ts","../../../../libs/core/dom/src/angular-three-dom.ts"],"sourcesContent":["import {\n\tcreateEvents,\n\tNgtAnyRecord,\n\tNgtDomEvent,\n\tNgtEventManager,\n\tNgtEvents,\n\tNgtState,\n\tSignalState,\n} from 'angular-three';\n\nconst DOM_EVENTS = {\n\tclick: false,\n\tcontextmenu: false,\n\tdblclick: false,\n\twheel: false, // passive wheel errors with OrbitControls\n\tpointerdown: true,\n\tpointerup: true,\n\tpointerleave: true,\n\tpointermove: true,\n\tpointercancel: true,\n\tlostpointercapture: true,\n} as const;\n\nexport const supportedEvents = [\n\t'click',\n\t'contextmenu',\n\t'dblclick',\n\t'pointerup',\n\t'pointerdown',\n\t'pointerover',\n\t'pointerout',\n\t'pointerenter',\n\t'pointerleave',\n\t'pointermove',\n\t'pointermissed',\n\t'pointercancel',\n\t'wheel',\n] as const;\n\nexport function createPointerEvents(store: SignalState<NgtState>): NgtEventManager<HTMLElement> {\n\tconst { handlePointer } = createEvents(store);\n\n\treturn {\n\t\tpriority: 1,\n\t\tenabled: true,\n\t\tcompute: (event: NgtDomEvent, root: SignalState<NgtState>) => {\n\t\t\tconst state = root.snapshot;\n\t\t\t// https://github.com/pmndrs/react-three-fiber/pull/782\n\t\t\t// Events trigger outside of canvas when moved, use offsetX/Y by default and allow overrides\n\t\t\tstate.pointer.set((event.offsetX / state.size.width) * 2 - 1, -(event.offsetY / state.size.height) * 2 + 1);\n\t\t\tstate.raycaster.setFromCamera(state.pointer, state.camera);\n\t\t},\n\t\tconnected: undefined,\n\t\thandlers: Object.keys(DOM_EVENTS).reduce((handlers: NgtAnyRecord, supportedEventName) => {\n\t\t\thandlers[supportedEventName] = handlePointer(supportedEventName);\n\t\t\treturn handlers;\n\t\t}, {}) as NgtEvents,\n\t\tupdate: () => {\n\t\t\tconst { events, internal } = store.snapshot;\n\t\t\tif (internal.lastEvent?.nativeElement && events.handlers)\n\t\t\t\tevents.handlers.pointermove(internal.lastEvent.nativeElement);\n\t\t},\n\t\tconnect: (target: HTMLElement) => {\n\t\t\tconst state = store.snapshot;\n\t\t\tstate.events.disconnect?.();\n\n\t\t\tstate.setEvents({ connected: target });\n\n\t\t\tObject.entries(state.events.handlers ?? {}).forEach(([eventName, eventHandler]: [string, EventListener]) => {\n\t\t\t\tconst passive = DOM_EVENTS[eventName as keyof typeof DOM_EVENTS];\n\t\t\t\ttarget.addEventListener(eventName, eventHandler, { passive });\n\t\t\t});\n\t\t},\n\t\tdisconnect: () => {\n\t\t\tconst { events, setEvents } = store.snapshot;\n\t\t\tif (events.connected) {\n\t\t\t\tObject.entries(events.handlers ?? {}).forEach(([eventName, eventHandler]: [string, EventListener]) => {\n\t\t\t\t\tif (events.connected instanceof HTMLElement) {\n\t\t\t\t\t\tevents.connected.removeEventListener(eventName, eventHandler);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tsetEvents({ connected: undefined });\n\t\t\t}\n\t\t},\n\t};\n}\n","import {\n\tafterNextRender,\n\tbooleanAttribute,\n\tChangeDetectionStrategy,\n\tComponent,\n\tcomputed,\n\tcontentChild,\n\tDestroyRef,\n\tDirective,\n\teffect,\n\tElementRef,\n\tEmbeddedViewRef,\n\tinject,\n\tInjector,\n\tinput,\n\tNgZone,\n\toutput,\n\tsignal,\n\tTemplateRef,\n\tuntracked,\n\tviewChild,\n\tViewContainerRef,\n} from '@angular/core';\nimport { outputFromObservable } from '@angular/core/rxjs-interop';\nimport {\n\tinjectCanvasRootInitializer,\n\tinjectStore,\n\tis,\n\tNGT_CANVAS_CONTENT_FLAG,\n\tNGT_STORE,\n\tNgtCamera,\n\tNgtCameraParameters,\n\tNgtCanvasConfigurator,\n\tNgtDomEvent,\n\tNgtDpr,\n\tNgtEventPrefix,\n\tNgtFrameloop,\n\tNgtGLOptions,\n\tNgtPerformance,\n\tNgtShadows,\n\tNgtSize,\n\tNgtState,\n\tNgtVector3,\n\tstoreFactory,\n} from 'angular-three';\nimport { NgxResize, provideResizeOptions, ResizeOptions, ResizeResult } from 'ngxtension/resize';\nimport * as THREE from 'three';\nimport { createPointerEvents } from './events';\n\n@Directive({ selector: 'ng-template[canvasContent]' })\nexport class NgtCanvasContent {\n\tconstructor() {\n\t\tconst store = injectStore();\n\t\tconst vcr = inject(ViewContainerRef);\n\t\tconst commentNode = vcr.element.nativeElement;\n\n\t\t// NOTE: flag this canvasContent ng-template comment node as the start\n\t\tcommentNode.data = NGT_CANVAS_CONTENT_FLAG;\n\t\tcommentNode[NGT_CANVAS_CONTENT_FLAG] = store;\n\t}\n}\n\n@Component({\n\tselector: 'ngt-canvas',\n\ttemplate: `\n\t\t<div (ngxResize)=\"resizeResult.set($event)\" style=\"height: 100%; width: 100%;\">\n\t\t\t<canvas #glCanvas style=\"display: block;\"></canvas>\n\t\t\t<ng-content />\n\t\t</div>\n\t`,\n\timports: [NgxResize],\n\tproviders: [\n\t\tprovideResizeOptions({\n\t\t\temitInZone: false,\n\t\t\temitInitialResult: true,\n\t\t\tdebounce: { scroll: 50, resize: 0 },\n\t\t} as ResizeOptions),\n\t\t{ provide: NGT_STORE, useFactory: storeFactory },\n\t],\n\thost: {\n\t\tstyle: 'display: block;position: relative;width: 100%;height: 100%;overflow: hidden;',\n\t\t'[style.pointerEvents]': 'hbPointerEvents()',\n\t\tngSkipHydration: 'true',\n\t},\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgtCanvas {\n\tprivate store = injectStore();\n\tprivate initRoot = injectCanvasRootInitializer();\n\n\tprivate host = inject<ElementRef<HTMLElement>>(ElementRef);\n\tprivate zone = inject(NgZone);\n\tprivate injector = inject(Injector);\n\n\tgl = input<NgtGLOptions>();\n\tsize = input<NgtSize>();\n\tshadows = input(false, {\n\t\ttransform: (value) => {\n\t\t\tif (value === '') return booleanAttribute(value);\n\t\t\treturn value as NgtShadows;\n\t\t},\n\t});\n\tlegacy = input(false, { transform: booleanAttribute });\n\tlinear = input(false, { transform: booleanAttribute });\n\tflat = input(false, { transform: booleanAttribute });\n\torthographic = input(false, { transform: booleanAttribute });\n\tframeloop = input<NgtFrameloop>('always');\n\tperformance = input<Partial<Omit<NgtPerformance, 'regress'>>>();\n\tdpr = input<NgtDpr>([1, 2]);\n\traycaster = input<Partial<THREE.Raycaster>>();\n\tscene = input<THREE.Scene | Partial<THREE.Scene>>();\n\tcamera = input<NgtCamera | NgtCameraParameters>();\n\tevents = input(createPointerEvents);\n\teventSource = input<HTMLElement | ElementRef<HTMLElement>>();\n\teventPrefix = input<NgtEventPrefix>('offset');\n\tlookAt = input<NgtVector3>();\n\n\tcreated = output<NgtState>();\n\tpointerMissed = outputFromObservable(this.store.snapshot.pointerMissed$);\n\n\tprivate glCanvas = viewChild.required<ElementRef<HTMLCanvasElement>>('glCanvas');\n\tprivate glCanvasViewContainerRef = viewChild.required('glCanvas', { read: ViewContainerRef });\n\tprivate canvasContentRef = contentChild.required(NgtCanvasContent, { read: TemplateRef });\n\n\tprotected hbPointerEvents = computed(() => (this.eventSource() ? 'none' : 'auto'));\n\n\t// NOTE: this signal is updated outside of Zone\n\tprotected resizeResult = signal<ResizeResult>({} as ResizeResult, { equal: Object.is });\n\tprivate configurator = signal<NgtCanvasConfigurator | null>(null);\n\n\tprivate glRef?: EmbeddedViewRef<unknown>;\n\n\tconstructor() {\n\t\t// NOTE: this means that everything in NgtCanvas will be in afterNextRender.\n\t\t// this allows the content of NgtCanvas to use effect instead of afterNextRender\n\t\tafterNextRender(() => {\n\t\t\tconst [canvasVcr, canvasElement, canvasContent] = [\n\t\t\t\tthis.glCanvasViewContainerRef(),\n\t\t\t\tthis.glCanvas().nativeElement,\n\t\t\t\tthis.canvasContentRef(),\n\t\t\t];\n\n\t\t\tthis.zone.runOutsideAngular(() => {\n\t\t\t\tthis.configurator.set(this.initRoot(canvasElement));\n\t\t\t});\n\n\t\t\teffect(\n\t\t\t\t() => {\n\t\t\t\t\tconst resizeResult = this.resizeResult();\n\t\t\t\t\tif (!resizeResult.width || resizeResult.width <= 0 || !resizeResult.height || resizeResult.height <= 0)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tconst configurator = this.configurator();\n\t\t\t\t\tif (!configurator) return;\n\n\t\t\t\t\tconst canvasOptions = {\n\t\t\t\t\t\tgl: this.gl(),\n\t\t\t\t\t\tshadows: this.shadows(),\n\t\t\t\t\t\tlegacy: this.legacy(),\n\t\t\t\t\t\tlinear: this.linear(),\n\t\t\t\t\t\tflat: this.flat(),\n\t\t\t\t\t\torthographic: this.orthographic(),\n\t\t\t\t\t\tframeloop: this.frameloop(),\n\t\t\t\t\t\tperformance: this.performance(),\n\t\t\t\t\t\tdpr: this.dpr(),\n\t\t\t\t\t\traycaster: this.raycaster(),\n\t\t\t\t\t\tscene: this.scene(),\n\t\t\t\t\t\tcamera: this.camera(),\n\t\t\t\t\t\tevents: this.events(),\n\t\t\t\t\t\teventSource: this.eventSource(),\n\t\t\t\t\t\teventPrefix: this.eventPrefix(),\n\t\t\t\t\t\tlookAt: this.lookAt(),\n\t\t\t\t\t\tsize: resizeResult,\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.zone.runOutsideAngular(() => {\n\t\t\t\t\t\tconfigurator.configure(canvasOptions);\n\n\t\t\t\t\t\tif (this.glRef) {\n\t\t\t\t\t\t\tthis.glRef.detectChanges();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.noZoneRender(canvasElement, canvasVcr, canvasContent);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\t{ injector: this.injector },\n\t\t\t);\n\t\t});\n\n\t\tinject(DestroyRef).onDestroy(() => {\n\t\t\tthis.glRef?.destroy();\n\t\t\tthis.configurator()?.destroy();\n\t\t});\n\t}\n\n\tprivate noZoneRender(\n\t\tcanvasElement: HTMLCanvasElement,\n\t\tcanvasVcr: ViewContainerRef,\n\t\tcanvasContent: TemplateRef<unknown>,\n\t) {\n\t\t// NOTE: destroy previous instances if existed\n\t\tthis.glRef?.destroy();\n\n\t\t// NOTE: Flag the canvas active, rendering will now begin\n\t\tthis.store.update((state) => ({ internal: { ...state.internal, active: true } }));\n\n\t\tconst [state, eventSource, eventPrefix] = [\n\t\t\tthis.store.snapshot,\n\t\t\tuntracked(this.eventSource),\n\t\t\tuntracked(this.eventPrefix),\n\t\t];\n\n\t\t// connect to event source\n\t\tstate.events.connect?.(\n\t\t\teventSource ? (is.ref(eventSource) ? eventSource.nativeElement : eventSource) : this.host.nativeElement,\n\t\t);\n\n\t\t// setup compute for eventPrefix\n\t\tif (eventPrefix) {\n\t\t\tstate.setEvents({\n\t\t\t\tcompute: (event, store) => {\n\t\t\t\t\tconst { pointer, raycaster, camera, size } = store.snapshot;\n\t\t\t\t\tconst x = event[(eventPrefix + 'X') as keyof NgtDomEvent] as number;\n\t\t\t\t\tconst y = event[(eventPrefix + 'Y') as keyof NgtDomEvent] as number;\n\t\t\t\t\tpointer.set((x / size.width) * 2 - 1, -(y / size.height) * 2 + 1);\n\t\t\t\t\traycaster.setFromCamera(pointer, camera);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\tthis.created.emit(this.store.snapshot);\n\n\t\tif (!this.store.snapshot.events.connected) {\n\t\t\tthis.store.snapshot.events.connect?.(canvasElement);\n\t\t}\n\n\t\tthis.glRef = canvasVcr.createEmbeddedView(canvasContent, {}, { injector: this.injector });\n\t\tthis.glRef.detectChanges();\n\t}\n}\n\nexport const NgtCanvasDeclarations = [NgtCanvas, NgtCanvasContent] as const;\n","import { makeEnvironmentProviders, RendererFactory2 } from '@angular/core';\nimport { ɵDomRendererFactory2 as DomRendererFactory2 } from '@angular/platform-browser';\nimport { NgtRendererFactory2 } from 'angular-three';\n\nexport function provideNgtRenderer() {\n\treturn makeEnvironmentProviders([\n\t\t{\n\t\t\tprovide: RendererFactory2,\n\t\t\tuseFactory: (domRendererFactory: RendererFactory2) => new NgtRendererFactory2(domRendererFactory),\n\t\t\tdeps: [DomRendererFactory2],\n\t\t},\n\t]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["DomRendererFactory2"],"mappings":";;;;;;;AAUA,MAAM,UAAU,GAAG;AAClB,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,KAAK;AACZ,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,kBAAkB,EAAE,IAAI;CACf;AAEH,MAAM,eAAe,GAAG;IAC9B,OAAO;IACP,aAAa;IACb,UAAU;IACV,WAAW;IACX,aAAa;IACb,aAAa;IACb,YAAY;IACZ,cAAc;IACd,cAAc;IACd,aAAa;IACb,eAAe;IACf,eAAe;IACf,OAAO;CACE;AAEJ,SAAU,mBAAmB,CAAC,KAA4B,EAAA;IAC/D,MAAM,EAAE,aAAa,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC;IAE7C,OAAO;AACN,QAAA,QAAQ,EAAE,CAAC;AACX,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,OAAO,EAAE,CAAC,KAAkB,EAAE,IAA2B,KAAI;AAC5D,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ;;;AAG3B,YAAA,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAA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,44 +1,54 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input,
|
|
2
|
+
import { input, viewChild, ViewContainerRef, effect, inject, DestroyRef, Component, ChangeDetectionStrategy, RendererFactory2, provideEnvironmentInitializer, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
3
3
|
import { TestBed } from '@angular/core/testing';
|
|
4
|
-
import {
|
|
4
|
+
import { ɵDomRendererFactory2 as _DomRendererFactory2 } from '@angular/platform-browser';
|
|
5
|
+
import { injectStore, extend, NGT_CANVAS_CONTENT_FLAG, NGT_RENDERER_NODE_FLAG, NgtRendererFactory2, NGT_STORE, storeFactory, injectCanvasRootInitializer, getInstanceState } from 'angular-three';
|
|
5
6
|
import * as THREE from 'three';
|
|
6
7
|
|
|
7
8
|
class NgtTestCanvas {
|
|
8
9
|
constructor() {
|
|
9
10
|
this.sceneGraph = input.required();
|
|
11
|
+
this.sceneGraphInputs = input({});
|
|
12
|
+
this.anchorRef = viewChild.required('anchor', { read: ViewContainerRef });
|
|
13
|
+
this.store = injectStore();
|
|
10
14
|
extend(THREE);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
effect(() => {
|
|
16
|
+
const anchor = this.anchorRef();
|
|
17
|
+
const sceneGraph = this.sceneGraph();
|
|
18
|
+
if (!sceneGraph)
|
|
19
|
+
return;
|
|
20
|
+
const sceneGraphInputs = this.sceneGraphInputs();
|
|
21
|
+
const anchorComment = anchor.element.nativeElement;
|
|
22
|
+
anchorComment.data = NGT_CANVAS_CONTENT_FLAG;
|
|
23
|
+
anchorComment[NGT_CANVAS_CONTENT_FLAG] = this.store;
|
|
24
|
+
if (anchorComment[NGT_RENDERER_NODE_FLAG]) {
|
|
25
|
+
anchorComment[NGT_RENDERER_NODE_FLAG][5] = this.store.snapshot.scene;
|
|
26
|
+
}
|
|
27
|
+
this.sceneRef = anchor.createComponent(sceneGraph);
|
|
28
|
+
for (const key in sceneGraphInputs) {
|
|
29
|
+
this.sceneRef.setInput(key, sceneGraphInputs[key]);
|
|
30
|
+
}
|
|
31
|
+
this.sceneRef.changeDetectorRef.detectChanges();
|
|
25
32
|
});
|
|
26
33
|
inject(DestroyRef).onDestroy(() => {
|
|
27
34
|
this.destroy();
|
|
28
35
|
});
|
|
29
36
|
}
|
|
30
37
|
destroy() {
|
|
31
|
-
this.
|
|
32
|
-
this.ref?.destroy();
|
|
38
|
+
this.sceneRef?.destroy();
|
|
33
39
|
}
|
|
34
40
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtTestCanvas, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
35
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
41
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.6", type: NgtTestCanvas, isStandalone: true, selector: "ngt-test-canvas", inputs: { sceneGraph: { classPropertyName: "sceneGraph", publicName: "sceneGraph", isSignal: true, isRequired: true, transformFunction: null }, sceneGraphInputs: { classPropertyName: "sceneGraphInputs", publicName: "sceneGraphInputs", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "anchorRef", first: true, predicate: ["anchor"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: `
|
|
42
|
+
<ng-container #anchor />
|
|
43
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
36
44
|
}
|
|
37
45
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtTestCanvas, decorators: [{
|
|
38
46
|
type: Component,
|
|
39
47
|
args: [{
|
|
40
48
|
selector: 'ngt-test-canvas',
|
|
41
|
-
template:
|
|
49
|
+
template: `
|
|
50
|
+
<ng-container #anchor />
|
|
51
|
+
`,
|
|
42
52
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
43
53
|
}]
|
|
44
54
|
}], ctorParameters: () => [] });
|
|
@@ -832,17 +842,24 @@ function createMockCanvas({ width = 1280, height = 800, beforeReturn, }) {
|
|
|
832
842
|
}
|
|
833
843
|
|
|
834
844
|
class NgtTestBed {
|
|
835
|
-
static create(sceneGraph, { mockCanvasOptions = {}, canvasConfiguration = {}, errorOnUnknownElements, providers, declarations, imports, teardown, deferBlockBehavior, } = {}) {
|
|
845
|
+
static create(sceneGraph, { sceneGraphInputs = {}, mockCanvasOptions = {}, canvasConfiguration = {}, errorOnUnknownElements, providers, declarations, imports, teardown, deferBlockBehavior, } = {}) {
|
|
836
846
|
const mockedCanvas = createMockCanvas(mockCanvasOptions);
|
|
837
847
|
const fixture = TestBed.configureTestingModule({
|
|
838
848
|
providers: [
|
|
839
|
-
|
|
849
|
+
{
|
|
850
|
+
provide: RendererFactory2,
|
|
851
|
+
useFactory: (delegate) => new NgtRendererFactory2(delegate),
|
|
852
|
+
deps: [_DomRendererFactory2],
|
|
853
|
+
},
|
|
854
|
+
{ provide: NGT_STORE, useFactory: storeFactory },
|
|
840
855
|
provideEnvironmentInitializer(() => {
|
|
841
856
|
const initializerFn = (() => {
|
|
842
857
|
const initRoot = injectCanvasRootInitializer();
|
|
843
858
|
return () => {
|
|
844
859
|
const configurator = initRoot(mockedCanvas);
|
|
845
860
|
configurator.configure({
|
|
861
|
+
...canvasConfiguration,
|
|
862
|
+
events: undefined,
|
|
846
863
|
frameloop: 'never',
|
|
847
864
|
size: {
|
|
848
865
|
width: mockCanvasOptions.width ?? mockedCanvas.width ?? 1280,
|
|
@@ -850,8 +867,6 @@ class NgtTestBed {
|
|
|
850
867
|
top: 0,
|
|
851
868
|
left: 0,
|
|
852
869
|
},
|
|
853
|
-
...canvasConfiguration,
|
|
854
|
-
events: undefined,
|
|
855
870
|
});
|
|
856
871
|
};
|
|
857
872
|
})();
|
|
@@ -867,14 +882,16 @@ class NgtTestBed {
|
|
|
867
882
|
deferBlockBehavior,
|
|
868
883
|
}).createComponent(NgtTestCanvas);
|
|
869
884
|
fixture.componentRef.setInput('sceneGraph', sceneGraph);
|
|
885
|
+
fixture.componentRef.setInput('sceneGraphInputs', sceneGraphInputs);
|
|
870
886
|
fixture.detectChanges();
|
|
871
887
|
const store = TestBed.inject(NGT_STORE);
|
|
872
888
|
TestBed.flushEffects();
|
|
873
889
|
return {
|
|
874
890
|
store,
|
|
875
891
|
fixture,
|
|
892
|
+
sceneGraphComponentRef: fixture.componentInstance.sceneRef,
|
|
876
893
|
scene: store.snapshot.scene,
|
|
877
|
-
sceneInstanceNode:
|
|
894
|
+
sceneInstanceNode: getInstanceState(store.snapshot.scene),
|
|
878
895
|
canvas: mockedCanvas,
|
|
879
896
|
destroy: fixture.componentInstance.destroy.bind(fixture.componentInstance),
|
|
880
897
|
fireEvent: this.createEventFirer(store, fixture),
|
|
@@ -921,12 +938,12 @@ class NgtTestBed {
|
|
|
921
938
|
static createEventFirer(store, fixture) {
|
|
922
939
|
let autoDetectChanges = true;
|
|
923
940
|
async function fireEvent(el, eventName, eventData = {}) {
|
|
924
|
-
const
|
|
925
|
-
if (!
|
|
941
|
+
const instanceState = getInstanceState(el);
|
|
942
|
+
if (!instanceState) {
|
|
926
943
|
console.warn(`[NGT Test] ${el} has no local state`);
|
|
927
944
|
return;
|
|
928
945
|
}
|
|
929
|
-
const handler =
|
|
946
|
+
const handler = instanceState.handlers[eventName];
|
|
930
947
|
if (!handler) {
|
|
931
948
|
console.warn(`[NGT Test] ${el} has no ${eventName} handler`);
|
|
932
949
|
return;
|