angular-three 2.0.0 → 2.2.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/esm2022/index.mjs +2 -2
- package/esm2022/lib/canvas.mjs +1 -1
- package/esm2022/lib/directives/selection.mjs +4 -4
- package/esm2022/lib/instance.mjs +7 -7
- package/esm2022/lib/portal.mjs +1 -1
- package/esm2022/lib/renderer/constants.mjs +3 -1
- package/esm2022/lib/renderer/index.mjs +5 -4
- package/esm2022/lib/renderer/utils.mjs +14 -2
- package/esm2022/lib/three-types.mjs +1 -1
- package/esm2022/lib/utils/apply-props.mjs +9 -2
- package/esm2022/lib/utils/attach.mjs +15 -4
- package/esm2022/lib/utils/output-ref.mjs +9 -0
- package/fesm2022/angular-three.mjs +58 -21
- package/fesm2022/angular-three.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/lib/canvas.d.ts +3 -3
- package/lib/portal.d.ts +6 -6
- package/lib/renderer/constants.d.ts +2 -0
- package/lib/renderer/index.d.ts +1 -1
- package/lib/three-types.d.ts +29 -1
- package/lib/utils/apply-props.d.ts +1 -0
- package/lib/utils/output-ref.d.ts +3 -0
- package/package.json +1 -1
- package/esm2022/lib/utils/non-nullish.mjs +0 -7
- package/lib/utils/non-nullish.d.ts +0 -4
package/index.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ export * from './lib/utils/attach';
|
|
|
16
16
|
export * from './lib/utils/before-render';
|
|
17
17
|
export * from './lib/utils/is';
|
|
18
18
|
export * from './lib/utils/make';
|
|
19
|
-
export * from './lib/utils/non-nullish';
|
|
20
19
|
export * from './lib/utils/object-events';
|
|
20
|
+
export * from './lib/utils/output-ref';
|
|
21
21
|
export * from './lib/utils/parameters';
|
|
22
22
|
export * from './lib/utils/resolve-ref';
|
|
23
23
|
export * from './lib/utils/signal-store';
|
package/lib/canvas.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementRef, Type
|
|
1
|
+
import { ElementRef, Type } from '@angular/core';
|
|
2
2
|
import { ResizeResult } from 'ngxtension/resize';
|
|
3
3
|
import { Raycaster, Scene, Vector3 } from 'three';
|
|
4
4
|
import { createPointerEvents } from './dom/events';
|
|
@@ -353,8 +353,8 @@ export declare class NgtCanvas {
|
|
|
353
353
|
lookAt: import("@angular/core").InputSignal<Vector3 | [x: number, y: number, z: number] | undefined>;
|
|
354
354
|
created: import("@angular/core").OutputEmitterRef<NgtState>;
|
|
355
355
|
pointerMissed: import("@angular/core").OutputRef<MouseEvent>;
|
|
356
|
-
glCanvas
|
|
357
|
-
glCanvasViewContainerRef
|
|
356
|
+
private glCanvas;
|
|
357
|
+
private glCanvasViewContainerRef;
|
|
358
358
|
protected hbPointerEvents: import("@angular/core").Signal<"none" | "auto">;
|
|
359
359
|
protected resizeResult: import("@angular/core").WritableSignal<ResizeResult>;
|
|
360
360
|
private configurator?;
|
package/lib/portal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Injector
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
2
2
|
import { Camera, Object3D, Scene } from 'three';
|
|
3
3
|
import { NgtComputeFunction, NgtSize, NgtState } from './types';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
@@ -48,17 +48,17 @@ export declare class NgtPortal {
|
|
|
48
48
|
*/
|
|
49
49
|
autoRender: import("@angular/core").InputSignal<boolean>;
|
|
50
50
|
autoRenderPriority: import("@angular/core").InputSignal<number>;
|
|
51
|
-
portalContent
|
|
52
|
-
portalAnchor
|
|
51
|
+
private portalContent;
|
|
52
|
+
private portalAnchor;
|
|
53
53
|
private injector;
|
|
54
54
|
private portalStore;
|
|
55
55
|
private parentStore;
|
|
56
|
-
parentScene: import("@angular/core").Signal<Scene>;
|
|
57
|
-
parentCamera: import("@angular/core").Signal<import("./types").NgtCameraManual>;
|
|
56
|
+
protected parentScene: import("@angular/core").Signal<Scene>;
|
|
57
|
+
protected parentCamera: import("@angular/core").Signal<import("./types").NgtCameraManual>;
|
|
58
58
|
private raycaster;
|
|
59
59
|
private pointer;
|
|
60
60
|
private portalRendered;
|
|
61
|
-
renderAutoBeforeRender: import("@angular/core").Signal<boolean>;
|
|
61
|
+
protected renderAutoBeforeRender: import("@angular/core").Signal<boolean>;
|
|
62
62
|
private portalView?;
|
|
63
63
|
constructor();
|
|
64
64
|
private inject;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const ROUTED_SCENE = "__ngt_renderer_is_routed_scene__";
|
|
2
2
|
export declare const HTML = "__ngt_renderer_is_html";
|
|
3
|
+
export declare const NON_ROOT = "__ngt_renderer_is_non_root__";
|
|
3
4
|
export declare const SPECIAL_INTERNAL_ADD_COMMENT = "__ngt_renderer_add_comment__";
|
|
4
5
|
export declare const SPECIAL_DOM_TAG: {
|
|
5
6
|
readonly NGT_PORTAL: "ngt-portal";
|
|
@@ -17,3 +18,4 @@ export declare const SPECIAL_EVENTS: {
|
|
|
17
18
|
readonly UPDATED: "updated";
|
|
18
19
|
readonly ATTACHED: "attached";
|
|
19
20
|
};
|
|
21
|
+
export declare const THREE_NATIVE_EVENTS: string[];
|
package/lib/renderer/index.d.ts
CHANGED
|
@@ -61,4 +61,4 @@ export declare class NgtRenderer implements Renderer2 {
|
|
|
61
61
|
}
|
|
62
62
|
export declare function provideNgtRenderer(store: NgtSignalStore<NgtState>): import("@angular/core").EnvironmentProviders;
|
|
63
63
|
export { extend } from './catalogue';
|
|
64
|
-
export { HTML, ROUTED_SCENE } from './constants';
|
|
64
|
+
export { HTML, NON_ROOT, ROUTED_SCENE } from './constants';
|
package/lib/three-types.d.ts
CHANGED
|
@@ -26,10 +26,33 @@ export type NgtVector3 = NgtVectorLike<Vector3>;
|
|
|
26
26
|
export type NgtVector4 = NgtVectorLike<Vector4>;
|
|
27
27
|
export type NgtLayers = Layers | Parameters<Layers['set']>[0];
|
|
28
28
|
export type NgtQuaternion = Quaternion | Parameters<Quaternion['set']>;
|
|
29
|
+
export type ThreeDisposeEvent = {
|
|
30
|
+
type: 'dispose';
|
|
31
|
+
target: NgtInstanceNode;
|
|
32
|
+
};
|
|
33
|
+
export type ThreeAddedEvent = {
|
|
34
|
+
type: 'added';
|
|
35
|
+
target: NgtInstanceNode;
|
|
36
|
+
};
|
|
37
|
+
export type ThreeRemovedEvent = {
|
|
38
|
+
type: 'removed';
|
|
39
|
+
target: NgtInstanceNode;
|
|
40
|
+
};
|
|
41
|
+
export type ThreeChildAddedEvent = {
|
|
42
|
+
type: 'childadded';
|
|
43
|
+
target: NgtInstanceNode;
|
|
44
|
+
child: NgtInstanceNode;
|
|
45
|
+
};
|
|
46
|
+
export type ThreeChildRemovedEvent = {
|
|
47
|
+
type: 'childremoved';
|
|
48
|
+
target: NgtInstanceNode;
|
|
49
|
+
child: NgtInstanceNode;
|
|
50
|
+
};
|
|
29
51
|
export interface NgtNodeEventMap<TOriginal> {
|
|
30
52
|
attached: NgtAfterAttach<NgtInstanceNode, TOriginal>;
|
|
31
53
|
updated: TOriginal;
|
|
32
54
|
beforeRender: NgtBeforeRenderEvent<TOriginal>;
|
|
55
|
+
disposed: ThreeDisposeEvent;
|
|
33
56
|
}
|
|
34
57
|
export type NgtNodeElement<TOriginal, TConstructor> = {
|
|
35
58
|
attach: string | string[] | NgtAttachFunction;
|
|
@@ -40,6 +63,11 @@ export type NgtNodeElement<TOriginal, TConstructor> = {
|
|
|
40
63
|
export type NgtNode<TOriginal, TConstructor, TNoEvent = NoEvent<TOriginal>> = Expand<NgtExtendedColors<NgtOverwrite<Partial<TNoEvent>, NgtNodeElement<TOriginal, TConstructor>>>>;
|
|
41
64
|
export type NgtObject3DEventsMap = {
|
|
42
65
|
[TEvent in keyof NgtEventHandlers]-?: Parameters<NonNullable<NgtEventHandlers[TEvent]>>[0];
|
|
66
|
+
} & {
|
|
67
|
+
added: ThreeAddedEvent;
|
|
68
|
+
removed: ThreeRemovedEvent;
|
|
69
|
+
childadded: ThreeChildAddedEvent;
|
|
70
|
+
childremoved: ThreeChildRemovedEvent;
|
|
43
71
|
};
|
|
44
72
|
export type NgtAllObject3DEventsMap = NgtObject3DEventsMap & NgtNodeEventMap<NgtInstanceNode>;
|
|
45
73
|
export type NgtObject3DNode<TOriginal, TConstructor, TNoEvent = NoEvent<TOriginal>> = Expand<NgtOverwrite<NgtNode<TOriginal, TConstructor, TNoEvent>, {
|
|
@@ -653,7 +681,7 @@ export interface ThreeElements {
|
|
|
653
681
|
declare global {
|
|
654
682
|
interface HTMLElementTagNameMap extends ThreeElements {
|
|
655
683
|
}
|
|
656
|
-
interface HTMLElementEventMap extends
|
|
684
|
+
interface HTMLElementEventMap extends NgtAllObject3DEventsMap {
|
|
657
685
|
}
|
|
658
686
|
}
|
|
659
687
|
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { OutputEmitterRef } from '@angular/core';
|
|
2
|
+
export declare function getEmitter<T>(emitterRef: OutputEmitterRef<T> | undefined): ((value: T) => void) | undefined;
|
|
3
|
+
export declare function hasListener(...emitterRefs: (OutputEmitterRef<unknown> | undefined)[]): boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { toObservable } from '@angular/core/rxjs-interop';
|
|
2
|
-
import { assertInjector } from 'ngxtension/assert-injector';
|
|
3
|
-
import { map } from 'rxjs';
|
|
4
|
-
export function injectNonNullish$(sig, { injector } = {}) {
|
|
5
|
-
return assertInjector(injectNonNullish$, injector, () => toObservable(sig).pipe(map((val) => val != null)));
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9uLW51bGxpc2guanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvc3JjL2xpYi91dGlscy9ub24tbnVsbGlzaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sNE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