@component-hook/pdf-canvas 0.2.1 → 0.2.3
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,13 +1,12 @@
|
|
|
1
1
|
import { Canvas } from 'fabric';
|
|
2
2
|
import { ComponentOptionsMixin } from 'vue';
|
|
3
|
+
import { ComponentProvideOptions } from 'vue';
|
|
3
4
|
import { DefineComponent } from 'vue';
|
|
4
|
-
import { ExtractPropTypes } from 'vue';
|
|
5
5
|
import { FabricObject } from 'fabric';
|
|
6
6
|
import { FabricObjectProps } from 'fabric';
|
|
7
7
|
import { ImageProps } from 'fabric';
|
|
8
8
|
import { ObjectEvents } from 'fabric';
|
|
9
9
|
import { Point } from 'fabric';
|
|
10
|
-
import { PropType } from 'vue';
|
|
11
10
|
import { PublicProps } from 'vue';
|
|
12
11
|
import { Ref } from 'vue';
|
|
13
12
|
import { SerializedObjectProps } from 'fabric';
|
|
@@ -15,27 +14,6 @@ import { TEvent } from 'fabric';
|
|
|
15
14
|
import { TextProps } from 'fabric';
|
|
16
15
|
import { TOptions } from 'fabric';
|
|
17
16
|
|
|
18
|
-
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
|
-
|
|
20
|
-
declare type __VLS_PrettifyLocal<T> = {
|
|
21
|
-
[K in keyof T]: T[K];
|
|
22
|
-
} & {};
|
|
23
|
-
|
|
24
|
-
declare type __VLS_TypePropsToOption<T> = {
|
|
25
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
26
|
-
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
27
|
-
} : {
|
|
28
|
-
type: PropType<T[K]>;
|
|
29
|
-
required: true;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
declare type __VLS_WithDefaults<P, D> = {
|
|
34
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
35
|
-
default: D[K];
|
|
36
|
-
}> : P[K];
|
|
37
|
-
};
|
|
38
|
-
|
|
39
17
|
declare function addImage(src: string, options?: TOptions<ImageProps>): void;
|
|
40
18
|
|
|
41
19
|
declare function addText(text: string, options?: TOptions<TextProps>): void;
|
|
@@ -68,29 +46,13 @@ export declare interface CreateCloseFabricArgs {
|
|
|
68
46
|
uuid?: number;
|
|
69
47
|
}
|
|
70
48
|
|
|
71
|
-
declare const _default: DefineComponent<
|
|
72
|
-
canvasId: string;
|
|
73
|
-
canvasClass: string;
|
|
74
|
-
canvasScale: number;
|
|
75
|
-
page: number;
|
|
76
|
-
fileZoom: number;
|
|
77
|
-
fileScale: number;
|
|
78
|
-
isDrop: boolean;
|
|
79
|
-
}>, {
|
|
49
|
+
declare const _default: DefineComponent<ComponentProps, {
|
|
80
50
|
addImage: typeof addImage;
|
|
81
51
|
addText: typeof addText;
|
|
82
52
|
clearActive: () => void;
|
|
83
53
|
deleteCanvas: () => void;
|
|
84
|
-
canvasRef: Ref<HTMLCanvasElement | null>;
|
|
85
|
-
},
|
|
86
|
-
canvasId: string;
|
|
87
|
-
canvasClass: string;
|
|
88
|
-
canvasScale: number;
|
|
89
|
-
page: number;
|
|
90
|
-
fileZoom: number;
|
|
91
|
-
fileScale: number;
|
|
92
|
-
isDrop: boolean;
|
|
93
|
-
}>>>, {
|
|
54
|
+
canvasRef: Ref<HTMLCanvasElement | null, HTMLCanvasElement | null>;
|
|
55
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ComponentProps> & Readonly<{}>, {
|
|
94
56
|
page: number;
|
|
95
57
|
canvasId: string;
|
|
96
58
|
fileZoom: number;
|
|
@@ -98,7 +60,7 @@ fileScale: number;
|
|
|
98
60
|
canvasScale: number;
|
|
99
61
|
canvasClass: string;
|
|
100
62
|
isDrop: boolean;
|
|
101
|
-
}, {}>;
|
|
63
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
102
64
|
export default _default;
|
|
103
65
|
|
|
104
66
|
export declare interface PDF {
|
|
@@ -152,7 +152,7 @@ const ui = () => ep || (ep = { document, window, isTouchSupported: "ontouchstart
|
|
|
152
152
|
const { perfLimitSizeTotal: t } = rt, e = Math.sqrt(t * a);
|
|
153
153
|
return [Math.floor(e), Math.floor(t / e)];
|
|
154
154
|
}
|
|
155
|
-
}(), Lu = "6.5.
|
|
155
|
+
}(), Lu = "6.5.1";
|
|
156
156
|
function no() {
|
|
157
157
|
}
|
|
158
158
|
const jn = Math.PI / 2, Zi = 2 * Math.PI, ff = Math.PI / 180, Oe = Object.freeze([1, 0, 0, 1, 0, 0]), pf = 16, rn = 0.4477152502, K = "center", lt = "left", He = "top", Ru = "bottom", Dt = "right", Ae = "none", mf = /\r?\n/, am = "moving", Xd = "scaling", hm = "rotating", bf = "rotate", lm = "skewing", wh = "resizing", qv = "modifyPoly", $v = "modifyPath", nd = "changed", zd = "scale", De = "scaleX", ts = "scaleY", Na = "skewX", Ba = "skewY", Nt = "fill", Te = "stroke", rd = "modified", yo = "json", uu = "svg", N = new class {
|
|
@@ -2083,12 +2083,12 @@ function xy(a, t, e, s, i) {
|
|
|
2083
2083
|
s = s || {};
|
|
2084
2084
|
const n = this.sizeX || s.cornerSize || i.cornerSize, r = this.sizeY || s.cornerSize || i.cornerSize, o = s.transparentCorners !== void 0 ? s.transparentCorners : i.transparentCorners, h = o ? Te : Nt, l = !o && (s.cornerStrokeColor || i.cornerStrokeColor);
|
|
2085
2085
|
let d, u = t, g = e;
|
|
2086
|
-
a.save(), a.fillStyle = s.cornerColor || i.cornerColor || "", a.strokeStyle = s.cornerStrokeColor || i.cornerStrokeColor || "", n > r ? (d = n, a.scale(1, r / n), g = e * n / r) : r > n ? (d = r, a.scale(n / r, 1), u = t * r / n) : d = n, a.
|
|
2086
|
+
a.save(), a.fillStyle = s.cornerColor || i.cornerColor || "", a.strokeStyle = s.cornerStrokeColor || i.cornerStrokeColor || "", n > r ? (d = n, a.scale(1, r / n), g = e * n / r) : r > n ? (d = r, a.scale(n / r, 1), u = t * r / n) : d = n, a.beginPath(), a.arc(u, g, d / 2, 0, Zi, !1), a[h](), l && a.stroke(), a.restore();
|
|
2087
2087
|
}
|
|
2088
2088
|
function Sy(a, t, e, s, i) {
|
|
2089
2089
|
s = s || {};
|
|
2090
2090
|
const n = this.sizeX || s.cornerSize || i.cornerSize, r = this.sizeY || s.cornerSize || i.cornerSize, o = s.transparentCorners !== void 0 ? s.transparentCorners : i.transparentCorners, h = o ? Te : Nt, l = !o && (s.cornerStrokeColor || i.cornerStrokeColor), d = n / 2, u = r / 2;
|
|
2091
|
-
a.save(), a.fillStyle = s.cornerColor || i.cornerColor || "", a.strokeStyle = s.cornerStrokeColor || i.cornerStrokeColor || "", a.
|
|
2091
|
+
a.save(), a.fillStyle = s.cornerColor || i.cornerColor || "", a.strokeStyle = s.cornerStrokeColor || i.cornerStrokeColor || "", a.translate(t, e);
|
|
2092
2092
|
const g = i.getTotalAngle();
|
|
2093
2093
|
a.rotate(Mt(g)), a["".concat(h, "Rect")](-d, -u, n, r), l && a.strokeRect(-d, -u, n, r), a.restore();
|
|
2094
2094
|
}
|
|
@@ -2278,7 +2278,7 @@ class Ch extends pi {
|
|
|
2278
2278
|
_renderControls(t) {
|
|
2279
2279
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2280
2280
|
const { hasBorders: s, hasControls: i } = this, n = T({ hasBorders: s, hasControls: i }, e), r = this.getViewportTransform(), o = n.hasBorders, h = n.hasControls, l = Pt(r, this.calcTransformMatrix()), d = oo(l);
|
|
2281
|
-
t.save(), t.translate(d.translateX, d.translateY), t.lineWidth =
|
|
2281
|
+
t.save(), t.translate(d.translateX, d.translateY), t.lineWidth = this.borderScaleFactor, this.group === this.parent && (t.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1), this.flipX && (d.angle -= 180), t.rotate(Mt(this.group ? d.angle : this.angle)), o && this.drawBorders(t, d, e), h && this.drawControls(t, e), t.restore();
|
|
2282
2282
|
}
|
|
2283
2283
|
drawBorders(t, e, s) {
|
|
2284
2284
|
let i;
|
|
@@ -21307,8 +21307,8 @@ $.setLayerDimensions;
|
|
|
21307
21307
|
$.shadow;
|
|
21308
21308
|
$.version;
|
|
21309
21309
|
const NS = {
|
|
21310
|
-
fabric: "^6.5.
|
|
21311
|
-
"pdfjs-dist": "
|
|
21310
|
+
fabric: "^6.5.1",
|
|
21311
|
+
"pdfjs-dist": "4.8.69"
|
|
21312
21312
|
};
|
|
21313
21313
|
function BS(a) {
|
|
21314
21314
|
return new Promise((t, e) => {
|