ngx-vflow 2.1.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/fesm2022/ngx-vflow.mjs +239 -39
- package/fesm2022/ngx-vflow.mjs.map +1 -1
- package/lib/vflow/components/background/background.component.d.ts +2 -1
- package/lib/vflow/directives/node-handles-controller.directive.d.ts +2 -1
- package/lib/vflow/directives/node-resize-controller.directive.d.ts +4 -4
- package/lib/vflow/models/handle.model.d.ts +4 -1
- package/lib/vflow/public-components/handle/handle.component.d.ts +2 -0
- package/lib/vflow/services/offset-batching-cache.service.d.ts +20 -0
- package/lib/vflow/services/request-animation-frame-batching.service.d.ts +8 -0
- package/lib/vflow/services/resize-observer.service.d.ts +13 -0
- package/lib/vflow/types/background.type.d.ts +20 -1
- package/package.json +1 -1
|
@@ -4,11 +4,12 @@ export declare class BackgroundComponent {
|
|
|
4
4
|
private rootSvg;
|
|
5
5
|
private settingsService;
|
|
6
6
|
protected backgroundSignal: import("@angular/core").WritableSignal<import("ngx-vflow").Background>;
|
|
7
|
-
protected scaledGap: import("@angular/core").Signal<number>;
|
|
8
7
|
protected x: import("@angular/core").Signal<number>;
|
|
9
8
|
protected y: import("@angular/core").Signal<number>;
|
|
10
9
|
protected patternColor: import("@angular/core").Signal<string>;
|
|
11
10
|
protected patternSize: import("@angular/core").Signal<number>;
|
|
11
|
+
protected scaledGap: import("@angular/core").Signal<number>;
|
|
12
|
+
protected strokeWidth: import("@angular/core").Signal<number>;
|
|
12
13
|
protected bgImageSrc: import("@angular/core").Signal<string>;
|
|
13
14
|
protected imageSize: import("@angular/core").Signal<{
|
|
14
15
|
width: number;
|
|
@@ -2,9 +2,10 @@ import { OnInit } from '@angular/core';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class NodeHandlesControllerDirective implements OnInit {
|
|
4
4
|
private nodeAccessor;
|
|
5
|
-
private zone;
|
|
6
5
|
private destroyRef;
|
|
7
6
|
private hostElementRef;
|
|
7
|
+
private resizeObserverService;
|
|
8
|
+
private requestAnimationFrameBatchingService;
|
|
8
9
|
ngOnInit(): void;
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<NodeHandlesControllerDirective, never>;
|
|
10
11
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NodeHandlesControllerDirective, "[nodeHandlesController]", never, {}, {}, never, never, true, never>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
/**
|
|
4
4
|
* Only suitable for HTML nodes
|
|
5
5
|
*/
|
|
6
|
-
export declare class NodeResizeControllerDirective implements OnInit {
|
|
6
|
+
export declare class NodeResizeControllerDirective implements OnInit, OnDestroy {
|
|
7
7
|
private nodeAccessor;
|
|
8
|
-
private
|
|
9
|
-
private destroyRef;
|
|
8
|
+
private resizeObserverService;
|
|
10
9
|
private hostElementRef;
|
|
11
10
|
ngOnInit(): void;
|
|
11
|
+
ngOnDestroy(): void;
|
|
12
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<NodeResizeControllerDirective, never>;
|
|
13
13
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NodeResizeControllerDirective, "[nodeResizeController]", never, {}, {}, never, never, true, never>;
|
|
14
14
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { NodeHandle } from '../services/handle.service';
|
|
2
2
|
import { NodeModel } from './node.model';
|
|
3
|
+
import { OffsetBatchingCacheService } from '../services/offset-batching-cache.service';
|
|
3
4
|
export type HandleState = 'valid' | 'invalid' | 'idle';
|
|
4
5
|
export declare class HandleModel {
|
|
5
6
|
rawHandle: NodeHandle;
|
|
6
7
|
parentNode: NodeModel;
|
|
8
|
+
batchingService: OffsetBatchingCacheService;
|
|
7
9
|
readonly strokeWidth = 2;
|
|
8
10
|
/**
|
|
9
11
|
* Pre-computed size for default handle, changed dynamically
|
|
@@ -38,7 +40,8 @@ export declare class HandleModel {
|
|
|
38
40
|
node: import("ngx-vflow").Node<unknown>;
|
|
39
41
|
};
|
|
40
42
|
};
|
|
41
|
-
constructor(rawHandle: NodeHandle, parentNode: NodeModel);
|
|
43
|
+
constructor(rawHandle: NodeHandle, parentNode: NodeModel, batchingService: OffsetBatchingCacheService);
|
|
44
|
+
onDestroy(): void;
|
|
42
45
|
updateHost(): void;
|
|
43
46
|
private getHostSize;
|
|
44
47
|
}
|
|
@@ -6,6 +6,8 @@ export declare class HandleComponent implements OnInit {
|
|
|
6
6
|
private handleService;
|
|
7
7
|
private element;
|
|
8
8
|
private destroyRef;
|
|
9
|
+
private requestAnimationFrameBatchingService;
|
|
10
|
+
private offsetBatchingCacheService;
|
|
9
11
|
/**
|
|
10
12
|
* At what side of node this component should be placed
|
|
11
13
|
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
interface OffsetCacheEntry {
|
|
3
|
+
offsetWidth: number;
|
|
4
|
+
offsetHeight: number;
|
|
5
|
+
offsetLeft: number;
|
|
6
|
+
offsetTop: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class OffsetBatchingCacheService {
|
|
9
|
+
private elementOffsetCache;
|
|
10
|
+
private cacheIsDirty;
|
|
11
|
+
private minMsBetweenDirty;
|
|
12
|
+
private lastDirty;
|
|
13
|
+
addElementCache(element: HTMLElement): void;
|
|
14
|
+
removeElementCache(element: HTMLElement): void;
|
|
15
|
+
getElementOffsets(requestedElement: HTMLElement): OffsetCacheEntry | undefined;
|
|
16
|
+
markCacheAsDirty(): void;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OffsetBatchingCacheService, never>;
|
|
18
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<OffsetBatchingCacheService>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class RequestAnimationFrameBatchingService {
|
|
3
|
+
private callbacks;
|
|
4
|
+
private requestAnimationFrameStarted;
|
|
5
|
+
batchAnimationFrame(callback: () => void): void;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RequestAnimationFrameBatchingService, never>;
|
|
7
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RequestAnimationFrameBatchingService>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class ResizeObserverService implements OnDestroy {
|
|
4
|
+
private zone;
|
|
5
|
+
private readonly thingsToObserve;
|
|
6
|
+
private resizeObserver;
|
|
7
|
+
constructor();
|
|
8
|
+
addObserver(element: Element, callback: (resizeEntry: ResizeObserverEntry) => void): void;
|
|
9
|
+
removeObserver(element: Element): void;
|
|
10
|
+
ngOnDestroy(): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ResizeObserverService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ResizeObserverService>;
|
|
13
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type Background = ColorBackground | DotsBackground | ImageBackground;
|
|
1
|
+
export type Background = ColorBackground | DotsBackground | ImageBackground | GridBackground;
|
|
2
2
|
export interface ColorBackground {
|
|
3
3
|
type: 'solid';
|
|
4
4
|
color: string;
|
|
@@ -45,3 +45,22 @@ export interface ImageBackground {
|
|
|
45
45
|
*/
|
|
46
46
|
scale?: number;
|
|
47
47
|
}
|
|
48
|
+
export interface GridBackground {
|
|
49
|
+
type: 'grid';
|
|
50
|
+
/**
|
|
51
|
+
* Color of the grid lines
|
|
52
|
+
*/
|
|
53
|
+
color?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Size of the grid squares
|
|
56
|
+
*/
|
|
57
|
+
size?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Width of the grid lines
|
|
60
|
+
*/
|
|
61
|
+
strokeWidth?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Color behind tha dot pattern
|
|
64
|
+
*/
|
|
65
|
+
backgroundColor?: string;
|
|
66
|
+
}
|