canvas-editor-engine 2.0.20 → 2.1.1
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/dist/components/canvas.component.d.ts +20 -13
- package/dist/components/excretions.component.d.ts +34 -25
- package/dist/components/loading.component.d.ts +13 -8
- package/dist/components/pipette.component.d.ts +22 -15
- package/dist/components/slot.component.d.ts +7 -4
- package/dist/config.d.ts +11 -15
- package/dist/filters/collection/vague.d.ts +2 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.mjs +1215 -1146
- package/dist/services/component.service.d.ts +2 -2
- package/dist/services/crop.service.d.ts +11 -4
- package/dist/services/download.service.d.ts +5 -2
- package/dist/services/draw.service.d.ts +15 -7
- package/dist/services/event.service.d.ts +4 -4
- package/dist/services/logger.service.d.ts +7 -7
- package/dist/services/projects.service.d.ts +5 -4
- package/dist/services/pull-project.service.d.ts +10 -5
- package/dist/services/through-history.service.d.ts +13 -8
- package/dist/services/tool-layers.service.d.ts +5 -2
- package/dist/services/tool.service.d.ts +10 -7
- package/dist/store/history.state.d.ts +3 -1
- package/dist/store/image.state.d.ts +3 -1
- package/dist/store/store.d.ts +6 -2
- package/dist/store/storeRepository.d.ts +4 -0
- package/dist/utils/filter.d.ts +3 -1
- package/dist/utils/reflect.d.ts +1 -0
- package/dist/web-component.d.ts +2 -4
- package/package.json +1 -1
|
@@ -1,21 +1,28 @@
|
|
|
1
|
+
import AppConfig from "../config";
|
|
1
2
|
import { TSubscribeAction, TSubscriptionTypes } from "../types/canvas";
|
|
2
3
|
import { ICursorPosition, TCursorStyleName } from "../types/cursor";
|
|
3
4
|
import ComponentService from "../services/component.service";
|
|
5
|
+
import LoggerService from "../services/logger.service";
|
|
6
|
+
import ToolLayerService from "../services/tool-layers.service";
|
|
4
7
|
export default class CanvasComponent extends ComponentService {
|
|
5
|
-
private
|
|
6
|
-
private
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
private
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
private appConfig;
|
|
9
|
+
private loggerService;
|
|
10
|
+
private toolLayerService;
|
|
11
|
+
constructor(appConfig: AppConfig, loggerService: LoggerService, toolLayerService: ToolLayerService);
|
|
12
|
+
private template;
|
|
13
|
+
private css;
|
|
14
|
+
eventListener: HTMLDivElement;
|
|
15
|
+
canvas: HTMLCanvasElement;
|
|
16
|
+
ctx: CanvasRenderingContext2D | null;
|
|
17
|
+
private subscriptions;
|
|
18
|
+
private _cursorStyle;
|
|
19
|
+
getComponent(): {
|
|
13
20
|
canvasTemplate: HTMLElement;
|
|
14
21
|
canvasStyle: HTMLStyleElement;
|
|
15
22
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
getCanvasSelector(): string;
|
|
24
|
+
set cursorStyle(styleName: TCursorStyleName | undefined | null);
|
|
25
|
+
getCursorPosition(event: MouseEvent): ICursorPosition;
|
|
26
|
+
subscribe(eventName: TSubscriptionTypes, action: TSubscribeAction): void;
|
|
27
|
+
simulateSubscriptions(): void;
|
|
21
28
|
}
|
|
@@ -1,32 +1,41 @@
|
|
|
1
1
|
import ComponentService from "../services/component.service";
|
|
2
|
+
import ToolService from "../services/tool.service";
|
|
3
|
+
import CanvasComponent from "./canvas.component";
|
|
2
4
|
import type { IExcretionsCoords, TExcretionStyle, TExcretionToolState } from "../types/excretion";
|
|
5
|
+
import LoggerService from "../services/logger.service";
|
|
6
|
+
import ToolLayerService from "../services/tool-layers.service";
|
|
3
7
|
export default class ExcretionsComponent extends ComponentService {
|
|
4
|
-
private
|
|
5
|
-
private
|
|
6
|
-
private
|
|
7
|
-
private
|
|
8
|
-
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
private
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private
|
|
19
|
-
|
|
20
|
-
private
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
private toolService;
|
|
9
|
+
private loggerService;
|
|
10
|
+
private toolLayerService;
|
|
11
|
+
private canvasComponent;
|
|
12
|
+
constructor(toolService: ToolService, loggerService: LoggerService, toolLayerService: ToolLayerService, canvasComponent: CanvasComponent);
|
|
13
|
+
private template;
|
|
14
|
+
private templateExcretion;
|
|
15
|
+
private _excretionDefaultStyle;
|
|
16
|
+
private css;
|
|
17
|
+
excretionWrap: HTMLElement;
|
|
18
|
+
private _excretions;
|
|
19
|
+
private _excretionState;
|
|
20
|
+
private _excretionActivity;
|
|
21
|
+
private _excretionToolState;
|
|
22
|
+
private _tempCoords;
|
|
23
|
+
excretionsCoords: IExcretionsCoords[];
|
|
24
|
+
private _additionStyle;
|
|
25
|
+
get additionStyle(): TExcretionStyle;
|
|
26
|
+
set additionStyle(value: TExcretionStyle);
|
|
27
|
+
private applyExcretionStyle;
|
|
28
|
+
private determineCropStyle;
|
|
29
|
+
private determineDefaultStyle;
|
|
30
|
+
private tool;
|
|
31
|
+
getComponent(): {
|
|
23
32
|
excretionsTemplate: HTMLElement;
|
|
24
33
|
excretionsStyle: HTMLStyleElement;
|
|
25
34
|
};
|
|
26
|
-
private
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
private
|
|
30
|
-
private
|
|
31
|
-
private
|
|
35
|
+
private set excretionState(value);
|
|
36
|
+
setToolState(toolState: TExcretionToolState): void;
|
|
37
|
+
clearExcretionsCoords(): void;
|
|
38
|
+
private getTempCoords;
|
|
39
|
+
private endExcretion;
|
|
40
|
+
private emmit;
|
|
32
41
|
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import ComponentService from "../services/component.service";
|
|
2
|
+
import EventService from "../services/event.service";
|
|
3
|
+
import LoggerService from "../services/logger.service";
|
|
2
4
|
export default class LoadingComponent extends ComponentService {
|
|
3
|
-
private
|
|
4
|
-
private
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
private loggerService;
|
|
6
|
+
private eventService;
|
|
7
|
+
constructor(loggerService: LoggerService, eventService: EventService);
|
|
8
|
+
private template;
|
|
9
|
+
private css;
|
|
10
|
+
loading: HTMLElement;
|
|
11
|
+
getComponent(): {
|
|
7
12
|
loadingTemplate: HTMLElement;
|
|
8
13
|
loadingStyle: HTMLStyleElement;
|
|
9
14
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
private
|
|
13
|
-
private
|
|
15
|
+
hide(): void;
|
|
16
|
+
view(): void;
|
|
17
|
+
private subscribeLoadingStart;
|
|
18
|
+
private subscribeLoadingEnd;
|
|
14
19
|
}
|
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
import { TPipetteState } from "../types/pipette";
|
|
2
2
|
import { THEXColor } from "../types/general";
|
|
3
|
+
import CanvasComponent from "./canvas.component";
|
|
3
4
|
import ComponentService from "../services/component.service";
|
|
5
|
+
import ToolService from "../services/tool.service";
|
|
6
|
+
import LoggerService from "../services/logger.service";
|
|
4
7
|
export default class PipetteComponent extends ComponentService {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
private
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
private toolService;
|
|
9
|
+
private loggerService;
|
|
10
|
+
private canvasComponent;
|
|
11
|
+
constructor(toolService: ToolService, loggerService: LoggerService, canvasComponent: CanvasComponent);
|
|
12
|
+
template: string;
|
|
13
|
+
css: string;
|
|
14
|
+
pipette: HTMLElement;
|
|
15
|
+
private _pipetteColor;
|
|
16
|
+
set pipetteColor(color: THEXColor);
|
|
17
|
+
get pipetteColor(): THEXColor;
|
|
18
|
+
private _pipetteColorElement;
|
|
19
|
+
private _pipetteState;
|
|
20
|
+
private tool;
|
|
21
|
+
getComponent(): {
|
|
15
22
|
pipetteTemplate: HTMLElement;
|
|
16
23
|
pipetteStyle: HTMLStyleElement;
|
|
17
24
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
private
|
|
21
|
-
private
|
|
22
|
-
private
|
|
25
|
+
setState(state: TPipetteState): void;
|
|
26
|
+
emmit(): void;
|
|
27
|
+
private setColorFromChoosenPixel;
|
|
28
|
+
private show;
|
|
29
|
+
private hide;
|
|
23
30
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import ComponentService from "../services/component.service";
|
|
2
|
+
import LoggerService from "../services/logger.service";
|
|
2
3
|
export default class SlotComponent extends ComponentService {
|
|
3
|
-
private
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
private loggerService;
|
|
5
|
+
constructor(loggerService: LoggerService);
|
|
6
|
+
private template;
|
|
7
|
+
private css;
|
|
8
|
+
slot: HTMLSlotElement;
|
|
9
|
+
getComponent(slotName: string): {
|
|
7
10
|
slotTemplate: HTMLElement;
|
|
8
11
|
slotStyle: HTMLStyleElement;
|
|
9
12
|
};
|
package/dist/config.d.ts
CHANGED
|
@@ -3,21 +3,17 @@ export interface ILayer {
|
|
|
3
3
|
name: string;
|
|
4
4
|
index: number;
|
|
5
5
|
}
|
|
6
|
-
export declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
export declare class ConfigFabric implements ConfigStore {
|
|
12
|
-
protected static _WEB_COMPONENT_TAG_NAME: string;
|
|
13
|
-
protected static _CANVAS_SIZE: ICanvasSize;
|
|
14
|
-
protected static _LAYERS: ILayer[];
|
|
6
|
+
export declare class ConfigFabric {
|
|
7
|
+
protected _WEB_COMPONENT_TAG_NAME: string;
|
|
8
|
+
protected _CANVAS_SIZE: ICanvasSize;
|
|
9
|
+
protected _LAYERS: ILayer[];
|
|
15
10
|
}
|
|
16
11
|
export default class AppConfig extends ConfigFabric {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
constructor();
|
|
13
|
+
get WEB_COMPONENT_TAG_NAME(): string;
|
|
14
|
+
set WEB_COMPONENT_TAG_NAME(value: string | undefined);
|
|
15
|
+
get CANVAS_SIZE(): ICanvasSize;
|
|
16
|
+
set CANVAS_SIZE(value: ICanvasSize | undefined);
|
|
17
|
+
get LAYERS(): ILayer[];
|
|
18
|
+
set LAYERS(value: ILayer[]);
|
|
23
19
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { IFilterOptions, IImageLoggingDataVague, IImageOptions, TFilterMethod } from "../../types/image";
|
|
2
2
|
import { Filter } from "../../utils/filter";
|
|
3
|
+
import AppConfig from "../../config";
|
|
3
4
|
export default class VagueFilter extends Filter {
|
|
4
5
|
options: IImageOptions;
|
|
5
6
|
filterList: TFilterMethod[];
|
|
6
|
-
constructor(ctx: CanvasRenderingContext2D, options: IImageOptions);
|
|
7
|
+
constructor(appConfig: AppConfig, ctx: CanvasRenderingContext2D, options: IImageOptions);
|
|
7
8
|
on(action: TFilterMethod, filterOptions: IFilterOptions): Promise<IImageLoggingDataVague>;
|
|
8
9
|
pixel(imageData: ImageData, filterOptions: IFilterOptions): ImageData;
|
|
9
10
|
private getQualityProcessedRemainder;
|
package/dist/index.d.ts
CHANGED
|
@@ -17,19 +17,18 @@ import ProjectsService from "./services/projects.service";
|
|
|
17
17
|
import PullProjectService from "./services/pull-project.service";
|
|
18
18
|
import AppStore from "./store/store";
|
|
19
19
|
declare class CanvasEditorEngine {
|
|
20
|
-
|
|
20
|
+
private appConfig;
|
|
21
|
+
constructor(appConfig: AppConfig);
|
|
21
22
|
getInitial(): {
|
|
22
23
|
tag: string;
|
|
23
24
|
component: typeof WebComponent;
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
declare class StaticCanvasEditorEngine extends CanvasEditorEngine {
|
|
27
|
-
constructor(
|
|
28
|
+
constructor(appConfig: AppConfig);
|
|
28
29
|
init(): void;
|
|
29
30
|
}
|
|
30
31
|
declare class VueCanvasEditorEngine extends CanvasEditorEngine {
|
|
31
|
-
constructor(
|
|
32
|
-
getContext2D(): CanvasRenderingContext2D;
|
|
33
|
-
getCanvas(): HTMLCanvasElement;
|
|
32
|
+
constructor(appConfig: AppConfig);
|
|
34
33
|
}
|
|
35
34
|
export { AppConfig, PipetteComponent, CanvasComponent, ExcretionComponent, SlotComponent, LoadingComponent, ToolService, DrawService, LoggerService, CropService, DownloadService, ToolLayerService, EventService, ThroughHistoryService, ProjectsService, PullProjectService, StaticCanvasEditorEngine, VueCanvasEditorEngine, AppStore, };
|