angular-three 1.0.0-beta.0 → 1.0.0-beta.10
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/README.md +55 -4
- package/esm2020/index.mjs +12 -2
- package/esm2020/lib/canvas.mjs +24 -29
- package/esm2020/lib/di/before-render.mjs +15 -0
- package/esm2020/lib/di/destroy.mjs +24 -0
- package/esm2020/lib/di/ref.mjs +71 -0
- package/esm2020/lib/loader.mjs +2 -2
- package/esm2020/lib/pipes/push.mjs +54 -0
- package/esm2020/lib/stores/store.mjs +2 -2
- package/fesm2015/angular-three.mjs +275 -128
- package/fesm2015/angular-three.mjs.map +1 -1
- package/fesm2020/angular-three.mjs +280 -134
- package/fesm2020/angular-three.mjs.map +1 -1
- package/index.d.ts +11 -1
- package/lib/canvas.d.ts +3 -7
- package/lib/di/before-render.d.ts +2 -0
- package/lib/di/destroy.d.ts +9 -0
- package/lib/di/ref.d.ts +12 -0
- package/lib/loader.d.ts +1 -1
- package/lib/pipes/push.d.ts +15 -0
- package/package.json +3 -4
package/index.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
export * from './lib/canvas';
|
|
2
|
-
export * from './lib/
|
|
2
|
+
export * from './lib/di/before-render';
|
|
3
3
|
export * from './lib/di/catalogue';
|
|
4
|
+
export * from './lib/di/destroy';
|
|
5
|
+
export * from './lib/di/ref';
|
|
4
6
|
export * from './lib/directives/args';
|
|
5
7
|
export * from './lib/directives/repeat';
|
|
8
|
+
export * from './lib/loader';
|
|
9
|
+
export * from './lib/pipes/push';
|
|
10
|
+
export * from './lib/stores/rx-store';
|
|
11
|
+
export * from './lib/stores/store';
|
|
12
|
+
export * from './lib/types';
|
|
13
|
+
export * from './lib/utils/instance';
|
|
14
|
+
export * from './lib/utils/is';
|
|
15
|
+
export * from './lib/utils/update';
|
package/lib/canvas.d.ts
CHANGED
|
@@ -3,11 +3,6 @@ import { NgxResizeResult } from 'ngx-resize';
|
|
|
3
3
|
import { NgtRxStore } from './stores/rx-store';
|
|
4
4
|
import type { NgtCanvasInputs, NgtDpr, NgtState } from './types';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class NgtCanvasContainer {
|
|
7
|
-
canvasResize: import("rxjs").Observable<NgxResizeResult>;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgtCanvasContainer, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgtCanvasContainer, "ngt-canvas-container", never, {}, { "canvasResize": "canvasResize"; }, never, ["*"], true, never>;
|
|
10
|
-
}
|
|
11
6
|
export declare class NgtCanvas extends NgtRxStore<NgtCanvasInputs> implements OnInit, OnDestroy {
|
|
12
7
|
private readonly cdr;
|
|
13
8
|
private readonly envInjector;
|
|
@@ -16,7 +11,7 @@ export declare class NgtCanvas extends NgtRxStore<NgtCanvasInputs> implements On
|
|
|
16
11
|
initialize(): void;
|
|
17
12
|
readonly hostClass = true;
|
|
18
13
|
get pointerEvents(): "none" | "auto";
|
|
19
|
-
|
|
14
|
+
sceneGraph: Type<any>;
|
|
20
15
|
compoundPrefixes: string[];
|
|
21
16
|
set linear(linear: boolean);
|
|
22
17
|
set legacy(legacy: boolean);
|
|
@@ -42,6 +37,7 @@ export declare class NgtCanvas extends NgtRxStore<NgtCanvasInputs> implements On
|
|
|
42
37
|
onResize({ width, height }: NgxResizeResult): void;
|
|
43
38
|
private storeReady;
|
|
44
39
|
ngOnDestroy(): void;
|
|
40
|
+
private overrideDetectChanges;
|
|
45
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgtCanvas, never>;
|
|
46
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgtCanvas, "ngt-canvas", never, { "
|
|
42
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgtCanvas, "ngt-canvas", never, { "sceneGraph": "sceneGraph"; "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"; }, { "created": "created"; "pointerMissed": "pointerMissed"; }, never, never, true, never>;
|
|
47
43
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
/**
|
|
4
|
+
* A utility injection fn that can be used in other injection fn to provide the destroy capability.
|
|
5
|
+
*/
|
|
6
|
+
export declare function injectNgtDestroy(cb?: () => void): {
|
|
7
|
+
destroy$: Observable<void>;
|
|
8
|
+
cdr: ChangeDetectorRef;
|
|
9
|
+
};
|
package/lib/di/ref.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChangeDetectorRef, ElementRef } from '@angular/core';
|
|
2
|
+
import { Observable, Subscription } from 'rxjs';
|
|
3
|
+
import type { NgtInstanceNode } from '../types';
|
|
4
|
+
type Subscribe<T> = (callback: (current: T, previous: T | null) => void) => Subscription;
|
|
5
|
+
export type NgtInjectedRef<T> = ElementRef<T> & {
|
|
6
|
+
subscribe: Subscribe<T>;
|
|
7
|
+
$: Observable<T>;
|
|
8
|
+
children$: (type?: 'objects' | 'nonObjects' | 'both') => Observable<NgtInstanceNode[]>;
|
|
9
|
+
useCDR: (cdr: ChangeDetectorRef) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function injectNgtRef<T>(initialValue?: NgtInjectedRef<T> | (T | null)): NgtInjectedRef<T>;
|
|
12
|
+
export {};
|
package/lib/loader.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import type { GLTF } from 'three
|
|
2
|
+
import type { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
3
3
|
import type { NgtBranchingReturn, NgtLoaderExtensions, NgtLoaderResult, NgtObjectMap } from './types';
|
|
4
4
|
interface NgtLoader {
|
|
5
5
|
<TReturnType, TUrl extends string | string[] | Record<string, string>>(loaderConstructorFactory: (inputs: TUrl) => new (...args: any[]) => NgtLoaderResult<TReturnType>, input: TUrl | Observable<TUrl>, extensions?: NgtLoaderExtensions, onProgress?: (event: ProgressEvent) => void): Observable<TUrl extends string[] ? Array<NgtBranchingReturn<TReturnType, GLTF, GLTF & NgtObjectMap>> : TUrl extends object ? {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnDestroy, PipeTransform } from '@angular/core';
|
|
2
|
+
import { ObservableInput } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class NgtPush<T> implements PipeTransform, OnDestroy {
|
|
5
|
+
private readonly cdr;
|
|
6
|
+
private readonly parentCdr;
|
|
7
|
+
private sub?;
|
|
8
|
+
private obj?;
|
|
9
|
+
private latestValue?;
|
|
10
|
+
transform(value: ObservableInput<T>, defaultValue?: T): T;
|
|
11
|
+
updateValue(val: T): void;
|
|
12
|
+
ngOnDestroy(): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgtPush<any>, never>;
|
|
14
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<NgtPush<any>, "ngtPush", true>;
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-three",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,12 +25,11 @@
|
|
|
25
25
|
"@angular/core": "^15.1.0",
|
|
26
26
|
"three": "0.148.0",
|
|
27
27
|
"rxjs": "7.5.7",
|
|
28
|
-
"
|
|
29
|
-
"@angular/platform-browser": "15.1.1",
|
|
30
|
-
"@rx-angular/state": "1.7.0"
|
|
28
|
+
"@angular/platform-browser": "15.1.1"
|
|
31
29
|
},
|
|
32
30
|
"dependencies": {
|
|
33
31
|
"ngx-resize": "^1.0.0",
|
|
32
|
+
"@rx-angular/state": "^1.7.0",
|
|
34
33
|
"tslib": "^2.3.0"
|
|
35
34
|
},
|
|
36
35
|
"sideEffects": false,
|