@pairbo/ui-kit 0.4.0 → 0.4.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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSResultGroup } from 'lit';
|
|
2
2
|
import { default as PairboElement } from '../../internal/pairbo-element.js';
|
|
3
3
|
import { Canvas, FabricImage, Rect, Group, Textbox } from 'fabric';
|
|
4
|
+
type DisplayType = "default" | "fullSize";
|
|
4
5
|
type Size = {
|
|
5
6
|
width: number;
|
|
6
7
|
height: number;
|
|
@@ -32,6 +33,7 @@ export default class PboHandwrittenCanvas extends PairboElement {
|
|
|
32
33
|
imageWidth: number | null;
|
|
33
34
|
imageLeft: number | null;
|
|
34
35
|
imageTop: number | null;
|
|
36
|
+
displayType: DisplayType;
|
|
35
37
|
baseCanvas: HTMLCanvasElement;
|
|
36
38
|
canvas: Canvas;
|
|
37
39
|
backgroundFabImg: FabricImage | undefined;
|
|
@@ -41,21 +43,53 @@ export default class PboHandwrittenCanvas extends PairboElement {
|
|
|
41
43
|
handwrittenImage: FabricImage | undefined;
|
|
42
44
|
clipMaskOverlay: Group | undefined;
|
|
43
45
|
areaSize: Size;
|
|
44
|
-
handleBackgroundImageUrlChange(): Promise<void>;
|
|
45
|
-
handleHandwrittenImageUrlChange(_: string | undefined, newValue: string | undefined): Promise<void>;
|
|
46
|
-
createClipMaskOverlay(): Group;
|
|
47
|
-
updateProcessedImgAreaPosition(): void;
|
|
48
46
|
private _dimensionsUpdateTimeout;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}): void;
|
|
47
|
+
private readonly DEFAULT_BACKGROUND_URL;
|
|
48
|
+
private readonly AREA_PERCENTAGES;
|
|
49
|
+
private readonly HANDWRITTEN_IMAGE_STYLES;
|
|
50
|
+
private readonly CONTROL_VISIBILITY;
|
|
51
|
+
handleBackgroundImageUrlChange(): Promise<void>;
|
|
52
|
+
handleHandwrittenImageUrlChange(): Promise<void>;
|
|
53
|
+
handleHandwrittenImageDimensionsChange(): void;
|
|
57
54
|
firstUpdated(): void;
|
|
58
|
-
appendBackgroundImageToCanvas(url: string, callback?: Function): Promise<void>;
|
|
59
55
|
render(): import('lit-html').TemplateResult<1>;
|
|
56
|
+
private initializeCanvas;
|
|
57
|
+
private setupEventListeners;
|
|
58
|
+
private loadInitialContent;
|
|
59
|
+
private removeBackgroundImage;
|
|
60
|
+
private loadBackgroundImage;
|
|
61
|
+
private appendBackgroundImageToCanvas;
|
|
62
|
+
private removeHandwrittenImage;
|
|
63
|
+
private loadHandwrittenImage;
|
|
64
|
+
private configureHandwrittenImage;
|
|
65
|
+
private calculateImageScale;
|
|
66
|
+
private calculateCornerSize;
|
|
67
|
+
private calculateTouchCornerSize;
|
|
68
|
+
private createClipRect;
|
|
69
|
+
private updateHandwrittenImageDimensions;
|
|
70
|
+
private setupHandwrittenImageEvents;
|
|
71
|
+
private handleImageScaling;
|
|
72
|
+
private handleImageMoving;
|
|
73
|
+
private handleImageSelected;
|
|
74
|
+
private handleImageDeselected;
|
|
75
|
+
private showSelectionUI;
|
|
76
|
+
private hideSelectionUI;
|
|
77
|
+
private createClipMaskOverlay;
|
|
78
|
+
private createMaskRect;
|
|
79
|
+
updateClipMaskOverlay(): void;
|
|
80
|
+
resetHandwrittenImagePosition(): void;
|
|
81
|
+
private updateProcessedImgAreaPosition;
|
|
82
|
+
private getAreaPercentages;
|
|
83
|
+
private updateAreaRect;
|
|
84
|
+
private createAreaRect;
|
|
85
|
+
private debounceUpdateDimensions;
|
|
86
|
+
private applyHandwrittenImageDimensions;
|
|
87
|
+
private isValidForDimensionUpdate;
|
|
88
|
+
private setHandwrittenImageDimensions;
|
|
89
|
+
private hasValidDimensions;
|
|
90
|
+
private updateDimensionIfChanged;
|
|
91
|
+
private emitDimensionsChangedEvent;
|
|
92
|
+
private createUploadingText;
|
|
93
|
+
private handleImageProcessing;
|
|
60
94
|
}
|
|
61
95
|
export {};
|