@pdfme/ui 3.0.1 → 3.1.0-dev.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/__mocks__/assetsTransformer.js +7 -0
- package/__mocks__/pdfjs-dist.js +15 -0
- package/dist/__vite-browser-external-jWVCDlBL.js +4 -0
- package/dist/index.js +1115 -3
- package/dist/path2d-polyfill.esm-yIGK7UQJ.js +214 -0
- package/dist/style.css +1 -0
- package/dist/types/class.d.ts +3 -3
- package/dist/types/components/AppContextProvider.d.ts +11 -0
- package/dist/types/components/{CtlBar/index.d.ts → CtlBar.d.ts} +2 -2
- package/dist/types/components/Designer/Canvas/Selecto.d.ts +3 -2
- package/dist/types/components/Designer/Sidebar/DetailView/AlignWidget.d.ts +1 -1
- package/dist/types/components/Designer/Sidebar/ListView/SelectableSortableContainer.d.ts +1 -1
- package/dist/types/components/Renderer.d.ts +1 -1
- package/dist/types/components/UnitPager.d.ts +1 -1
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/contexts.d.ts +46 -4
- package/dist/types/helper.d.ts +2 -1
- package/dist/types/hooks.d.ts +19 -2
- package/dist/types/i18n.d.ts +3 -27
- package/dist/types/theme.d.ts +2 -0
- package/package.json +17 -11
- package/src/Designer.tsx +27 -53
- package/src/Form.tsx +22 -23
- package/src/Viewer.tsx +10 -11
- package/src/class.ts +5 -5
- package/src/components/AppContextProvider.tsx +63 -0
- package/src/components/CtlBar.tsx +125 -0
- package/src/components/Designer/Canvas/Guides.tsx +18 -23
- package/src/components/Designer/Canvas/Mask.tsx +2 -1
- package/src/components/Designer/Canvas/Moveable.tsx +60 -60
- package/src/components/Designer/Canvas/Selecto.tsx +33 -20
- package/src/components/Designer/Canvas/index.tsx +21 -15
- package/src/components/Designer/Sidebar/DetailView/AlignWidget.tsx +53 -89
- package/src/components/Designer/Sidebar/DetailView/index.tsx +41 -30
- package/src/components/Designer/Sidebar/ListView/Item.tsx +30 -19
- package/src/components/Designer/Sidebar/ListView/SelectableSortableContainer.tsx +9 -6
- package/src/components/Designer/Sidebar/ListView/SelectableSortableItem.tsx +4 -1
- package/src/components/Designer/Sidebar/ListView/index.tsx +76 -71
- package/src/components/Designer/Sidebar/index.tsx +25 -49
- package/src/components/Designer/index.tsx +24 -82
- package/src/components/ErrorScreen.tsx +13 -11
- package/src/components/Preview.tsx +5 -2
- package/src/components/Renderer.tsx +10 -6
- package/src/components/Root.tsx +2 -8
- package/src/components/Spinner.tsx +12 -31
- package/src/components/UnitPager.tsx +72 -55
- package/src/constants.ts +2 -0
- package/src/contexts.ts +4 -5
- package/src/helper.ts +8 -5
- package/src/hooks.ts +136 -3
- package/src/i18n.ts +168 -59
- package/src/theme.ts +20 -0
- package/tsconfig.json +35 -13
- package/vite.config.ts +27 -0
- package/dist/index.js.LICENSE.txt +0 -142
- package/dist/index.js.map +0 -1
- package/dist/types/components/CtlBar/Pager.d.ts +0 -8
- package/dist/types/components/CtlBar/Zoom.d.ts +0 -7
- package/dist/types/components/Divider.d.ts +0 -3
- package/src/components/CtlBar/Pager.tsx +0 -53
- package/src/components/CtlBar/Zoom.tsx +0 -56
- package/src/components/CtlBar/index.tsx +0 -46
- package/src/components/Divider.tsx +0 -7
- package/webpack.config.js +0 -40
@@ -0,0 +1,214 @@
|
|
1
|
+
function F(n, a, r) {
|
2
|
+
if (r || arguments.length === 2)
|
3
|
+
for (var t = 0, o = a.length, l; t < o; t++)
|
4
|
+
(l || !(t in a)) && (l || (l = Array.prototype.slice.call(a, 0, t)), l[t] = a[t]);
|
5
|
+
return n.concat(l || Array.prototype.slice.call(a));
|
6
|
+
}
|
7
|
+
var q = {
|
8
|
+
a: 7,
|
9
|
+
c: 6,
|
10
|
+
h: 1,
|
11
|
+
l: 2,
|
12
|
+
m: 2,
|
13
|
+
q: 4,
|
14
|
+
s: 4,
|
15
|
+
t: 2,
|
16
|
+
v: 1,
|
17
|
+
z: 0
|
18
|
+
}, Z = /([astvzqmhlc])([^astvzqmhlc]*)/gi, _ = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;
|
19
|
+
function U(n) {
|
20
|
+
var a = n.match(_);
|
21
|
+
return a ? a.map(Number) : [];
|
22
|
+
}
|
23
|
+
function j(n) {
|
24
|
+
var a = [], r = String(n).trim();
|
25
|
+
return r[0] !== "M" && r[0] !== "m" || r.replace(Z, function(t, o, l) {
|
26
|
+
var s = U(l), u = o.toLowerCase(), h = o;
|
27
|
+
if (u === "m" && s.length > 2 && (a.push(F([h], s.splice(0, 2), !0)), u = "l", h = h === "m" ? "l" : "L"), s.length < q[u])
|
28
|
+
return "";
|
29
|
+
for (a.push(F([h], s.splice(0, q[u]), !0)); s.length >= q[u] && s.length && q[u]; )
|
30
|
+
a.push(F([h], s.splice(0, q[u]), !0));
|
31
|
+
return "";
|
32
|
+
}), a;
|
33
|
+
}
|
34
|
+
function B(n, a) {
|
35
|
+
var r = n.x * Math.cos(a) - n.y * Math.sin(a), t = n.y * Math.cos(a) + n.x * Math.sin(a);
|
36
|
+
n.x = r, n.y = t;
|
37
|
+
}
|
38
|
+
function J(n, a, r) {
|
39
|
+
n.x += a, n.y += r;
|
40
|
+
}
|
41
|
+
function H(n, a) {
|
42
|
+
n.x *= a, n.y *= a;
|
43
|
+
}
|
44
|
+
var L = (
|
45
|
+
/** @class */
|
46
|
+
function() {
|
47
|
+
function n(a) {
|
48
|
+
var r;
|
49
|
+
this.commands = [], a && a instanceof n ? (r = this.commands).push.apply(r, a.commands) : a && (this.commands = j(a));
|
50
|
+
}
|
51
|
+
return n.prototype.addPath = function(a) {
|
52
|
+
var r;
|
53
|
+
a && a instanceof n && (r = this.commands).push.apply(r, a.commands);
|
54
|
+
}, n.prototype.moveTo = function(a, r) {
|
55
|
+
this.commands.push(["M", a, r]);
|
56
|
+
}, n.prototype.lineTo = function(a, r) {
|
57
|
+
this.commands.push(["L", a, r]);
|
58
|
+
}, n.prototype.arc = function(a, r, t, o, l, s) {
|
59
|
+
this.commands.push(["AC", a, r, t, o, l, !!s]);
|
60
|
+
}, n.prototype.arcTo = function(a, r, t, o, l) {
|
61
|
+
this.commands.push(["AT", a, r, t, o, l]);
|
62
|
+
}, n.prototype.ellipse = function(a, r, t, o, l, s, u, h) {
|
63
|
+
this.commands.push(["E", a, r, t, o, l, s, u, !!h]);
|
64
|
+
}, n.prototype.closePath = function() {
|
65
|
+
this.commands.push(["Z"]);
|
66
|
+
}, n.prototype.bezierCurveTo = function(a, r, t, o, l, s) {
|
67
|
+
this.commands.push(["C", a, r, t, o, l, s]);
|
68
|
+
}, n.prototype.quadraticCurveTo = function(a, r, t, o) {
|
69
|
+
this.commands.push(["Q", a, r, t, o]);
|
70
|
+
}, n.prototype.rect = function(a, r, t, o) {
|
71
|
+
this.commands.push(["R", a, r, t, o]);
|
72
|
+
}, n.prototype.roundRect = function(a, r, t, o, l) {
|
73
|
+
typeof l > "u" ? this.commands.push(["RR", a, r, t, o, 0]) : this.commands.push(["RR", a, r, t, o, l]);
|
74
|
+
}, n;
|
75
|
+
}()
|
76
|
+
);
|
77
|
+
function N(n, a) {
|
78
|
+
var r = 0, t = 0, o, l, s, u, h, v, P, C, I, A, S, G, D, p, f, z, d, b, m, E, Q, g = null, R = null, y = null, T = null, M = null, k = null;
|
79
|
+
n.beginPath();
|
80
|
+
for (var i = 0; i < a.length; ++i) {
|
81
|
+
b = a[i][0], b !== "S" && b !== "s" && b !== "C" && b !== "c" && (g = null, R = null), b !== "T" && b !== "t" && b !== "Q" && b !== "q" && (y = null, T = null);
|
82
|
+
var e = void 0;
|
83
|
+
switch (b) {
|
84
|
+
case "m":
|
85
|
+
case "M":
|
86
|
+
e = a[i], b === "m" ? (r += e[1], t += e[2]) : (r = e[1], t = e[2]), (b === "M" || !M) && (M = { x: r, y: t }), n.moveTo(r, t);
|
87
|
+
break;
|
88
|
+
case "l":
|
89
|
+
e = a[i], r += e[1], t += e[2], n.lineTo(r, t);
|
90
|
+
break;
|
91
|
+
case "L":
|
92
|
+
e = a[i], r = e[1], t = e[2], n.lineTo(r, t);
|
93
|
+
break;
|
94
|
+
case "H":
|
95
|
+
e = a[i], r = e[1], n.lineTo(r, t);
|
96
|
+
break;
|
97
|
+
case "h":
|
98
|
+
e = a[i], r += e[1], n.lineTo(r, t);
|
99
|
+
break;
|
100
|
+
case "V":
|
101
|
+
e = a[i], t = e[1], n.lineTo(r, t);
|
102
|
+
break;
|
103
|
+
case "v":
|
104
|
+
e = a[i], t += e[1], n.lineTo(r, t);
|
105
|
+
break;
|
106
|
+
case "a":
|
107
|
+
case "A":
|
108
|
+
if (e = a[i], k === null)
|
109
|
+
throw new Error("This should never happen");
|
110
|
+
b === "a" ? (r += e[6], t += e[7]) : (r = e[6], t = e[7]), p = e[1], f = e[2], P = e[3] * Math.PI / 180, s = !!e[4], u = !!e[5], h = { x: r, y: t }, v = {
|
111
|
+
x: (k.x - h.x) / 2,
|
112
|
+
y: (k.y - h.y) / 2
|
113
|
+
}, B(v, -P), C = v.x * v.x / (p * p) + v.y * v.y / (f * f), C > 1 && (C = Math.sqrt(C), p *= C, f *= C), m = {
|
114
|
+
x: p * v.y / f,
|
115
|
+
y: -(f * v.x) / p
|
116
|
+
}, I = p * p * f * f, A = p * p * v.y * v.y + f * f * v.x * v.x, u !== s ? H(m, Math.sqrt((I - A) / A) || 0) : H(m, -Math.sqrt((I - A) / A) || 0), l = Math.atan2((v.y - m.y) / f, (v.x - m.x) / p), o = Math.atan2(-(v.y + m.y) / f, -(v.x + m.x) / p), B(m, P), J(m, (h.x + k.x) / 2, (h.y + k.y) / 2), n.save(), n.translate(m.x, m.y), n.rotate(P), n.scale(p, f), n.arc(0, 0, 1, l, o, !u), n.restore();
|
117
|
+
break;
|
118
|
+
case "C":
|
119
|
+
e = a[i], g = e[3], R = e[4], r = e[5], t = e[6], n.bezierCurveTo(e[1], e[2], g, R, r, t);
|
120
|
+
break;
|
121
|
+
case "c":
|
122
|
+
e = a[i], n.bezierCurveTo(e[1] + r, e[2] + t, e[3] + r, e[4] + t, e[5] + r, e[6] + t), g = e[3] + r, R = e[4] + t, r += e[5], t += e[6];
|
123
|
+
break;
|
124
|
+
case "S":
|
125
|
+
e = a[i], (g === null || R === null) && (g = r, R = t), n.bezierCurveTo(2 * r - g, 2 * t - R, e[1], e[2], e[3], e[4]), g = e[1], R = e[2], r = e[3], t = e[4];
|
126
|
+
break;
|
127
|
+
case "s":
|
128
|
+
e = a[i], (g === null || R === null) && (g = r, R = t), n.bezierCurveTo(2 * r - g, 2 * t - R, e[1] + r, e[2] + t, e[3] + r, e[4] + t), g = e[1] + r, R = e[2] + t, r += e[3], t += e[4];
|
129
|
+
break;
|
130
|
+
case "Q":
|
131
|
+
e = a[i], y = e[1], T = e[2], r = e[3], t = e[4], n.quadraticCurveTo(y, T, r, t);
|
132
|
+
break;
|
133
|
+
case "q":
|
134
|
+
e = a[i], y = e[1] + r, T = e[2] + t, r += e[3], t += e[4], n.quadraticCurveTo(y, T, r, t);
|
135
|
+
break;
|
136
|
+
case "T":
|
137
|
+
e = a[i], (y === null || T === null) && (y = r, T = t), y = 2 * r - y, T = 2 * t - T, r = e[1], t = e[2], n.quadraticCurveTo(y, T, r, t);
|
138
|
+
break;
|
139
|
+
case "t":
|
140
|
+
e = a[i], (y === null || T === null) && (y = r, T = t), y = 2 * r - y, T = 2 * t - T, r += e[1], t += e[2], n.quadraticCurveTo(y, T, r, t);
|
141
|
+
break;
|
142
|
+
case "z":
|
143
|
+
case "Z":
|
144
|
+
M && (r = M.x, t = M.y), M = null, n.closePath();
|
145
|
+
break;
|
146
|
+
case "AC":
|
147
|
+
e = a[i], r = e[1], t = e[2], D = e[3], l = e[4], o = e[5], E = e[6], n.arc(r, t, D, l, o, E);
|
148
|
+
break;
|
149
|
+
case "AT":
|
150
|
+
e = a[i], S = e[1], G = e[2], r = e[3], t = e[4], D = e[5], n.arcTo(S, G, r, t, D);
|
151
|
+
break;
|
152
|
+
case "E":
|
153
|
+
e = a[i], r = e[1], t = e[2], p = e[3], f = e[4], P = e[5], l = e[6], o = e[7], E = e[8], n.save(), n.translate(r, t), n.rotate(P), n.scale(p, f), n.arc(0, 0, 1, l, o, E), n.restore();
|
154
|
+
break;
|
155
|
+
case "R":
|
156
|
+
e = a[i], r = e[1], t = e[2], z = e[3], d = e[4], M = { x: r, y: t }, n.rect(r, t, z, d);
|
157
|
+
break;
|
158
|
+
case "RR":
|
159
|
+
e = a[i], r = e[1], t = e[2], z = e[3], d = e[4], Q = e[5], M = { x: r, y: t }, n.roundRect(r, t, z, d, Q);
|
160
|
+
break;
|
161
|
+
}
|
162
|
+
k ? (k.x = r, k.y = t) : k = { x: r, y: t };
|
163
|
+
}
|
164
|
+
}
|
165
|
+
function K(n) {
|
166
|
+
if (!(!n || !n.CanvasRenderingContext2D || n.Path2D)) {
|
167
|
+
var a = n.CanvasRenderingContext2D, r = a.prototype.fill, t = a.prototype.stroke, o = a.prototype.isPointInPath;
|
168
|
+
a.prototype.fill = function() {
|
169
|
+
for (var s = [], u = 0; u < arguments.length; u++)
|
170
|
+
s[u] = arguments[u];
|
171
|
+
if (s[0] instanceof L) {
|
172
|
+
var h = s[0], v = s[1] || "nonzero";
|
173
|
+
N(this, h.commands), r.apply(this, [v]);
|
174
|
+
} else {
|
175
|
+
var v = s[0] || "nonzero";
|
176
|
+
return r.apply(this, [v]);
|
177
|
+
}
|
178
|
+
}, a.prototype.stroke = function(s) {
|
179
|
+
s && N(this, s.commands), t.apply(this);
|
180
|
+
}, a.prototype.isPointInPath = function() {
|
181
|
+
for (var s = [], u = 0; u < arguments.length; u++)
|
182
|
+
s[u] = arguments[u];
|
183
|
+
if (s[0] instanceof L) {
|
184
|
+
var h = s[0], v = s[1], P = s[2], C = s[3] || "nonzero";
|
185
|
+
return N(this, h.commands), o.apply(this, [v, P, C]);
|
186
|
+
} else
|
187
|
+
return o.apply(this, s);
|
188
|
+
}, n.Path2D = L;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
function V(n, a, r, t, o) {
|
192
|
+
var l = this;
|
193
|
+
if (o === void 0 && (o = 0), typeof o == "number" && (o = [o]), Array.isArray(o)) {
|
194
|
+
if (o.length === 0 || o.length > 4)
|
195
|
+
throw new RangeError("Failed to execute 'roundRect' on '".concat(this.constructor.name, "': ").concat(o.length, " radii provided. Between one and four radii are necessary."));
|
196
|
+
o.forEach(function(C) {
|
197
|
+
if (C < 0)
|
198
|
+
throw new RangeError("Failed to execute 'roundRect' on '".concat(l.constructor.name, "': Radius value ").concat(C, " is negative."));
|
199
|
+
});
|
200
|
+
} else
|
201
|
+
return;
|
202
|
+
if (o.length === 1 && o[0] === 0)
|
203
|
+
return this.rect(n, a, r, t);
|
204
|
+
var s = Math.min(r, t) / 2, u, h, v, P = u = h = v = Math.min(s, o[0]);
|
205
|
+
o.length === 2 && (u = v = Math.min(s, o[1])), o.length === 3 && (u = v = Math.min(s, o[1]), h = Math.min(s, o[2])), o.length === 4 && (u = Math.min(s, o[1]), h = Math.min(s, o[2]), v = Math.min(s, o[3])), this.moveTo(n, a + t - v), this.arcTo(n, a, n + P, a, P), this.arcTo(n + r, a, n + r, a + u, u), this.arcTo(n + r, a + t, n + r - h, a + t, h), this.arcTo(n, a + t, n, a + t - v, v), this.moveTo(n, a);
|
206
|
+
}
|
207
|
+
function O(n) {
|
208
|
+
if (!(!n || !n.CanvasRenderingContext2D)) {
|
209
|
+
var a = n.CanvasRenderingContext2D, r = n.Path2D;
|
210
|
+
a && !a.prototype.roundRect && (a.prototype.roundRect = V), r && !r.prototype.roundRect && (r.prototype.roundRect = V);
|
211
|
+
}
|
212
|
+
}
|
213
|
+
K(window);
|
214
|
+
O(window);
|
package/dist/style.css
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.fr-inline-field{display:inline-block;margin-right:16px}.fr-inline-container{display:inline-flex;flex-wrap:wrap}.ant-form-item-optional-hide{padding:0 8px}.ant-form-item-optional-hide .ant-form-item-label>label{font-size:16px;font-weight:#000000d9;font-weight:600}.fr-desc{word-break:break-all;color:#00000073;line-height:22px;margin-left:5px;font-weight:400;font-size:14px}.fr-hide-label>.ant-form-item-row>.ant-form-item-label{visibility:hidden}.fr-field .ant-form-item-row{flex-wrap:nowrap}.fr-field .ant-form-item-control-input-content{display:flex}.fr-field-visibility{width:0;height:0;visibility:hidden}.fr-form .ant-form-item-control{width:0}.fr-form .fr-inline-field .ant-form-item-control{width:auto}.rc-color-picker-panel-inner{position:relative;border-radius:4px;box-shadow:0 1px 5px #ccc;border:1px solid #ccc;padding-bottom:8px}.rc-color-picker-panel-wrap{margin:5px 0 0;height:30px;width:100%;position:relative}.rc-color-picker-panel-wrap-preview{position:absolute;right:8px}.rc-color-picker-panel-wrap-ribbon{position:absolute;left:8px;top:0;right:43px;height:30px}.rc-color-picker-panel-wrap-alpha{position:absolute;left:8px;right:43px;bottom:0;height:12.5px}.rc-color-picker-panel-wrap-has-alpha .rc-color-picker-panel-wrap-ribbon{height:12.5px}.rc-color-picker-trigger{border:1px solid #999;display:inline-block;padding:2px;border-radius:2px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:20px;height:20px;cursor:pointer;box-shadow:0 0 0 2px #fff inset}.rc-color-picker-trigger-open{box-shadow:0 0 3px #999}.rc-color-picker-panel{width:218px;background-color:#fff;box-sizing:border-box;outline:none;z-index:9;border-radius:4px;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.rc-color-picker-panel *{box-sizing:border-box}.rc-color-picker-panel-open{display:block}.rc-color-picker-panel-close{display:none}.rc-color-picker-panel-preview{height:30px;width:30px;overflow:hidden;border-radius:2px;background-image:url(data:image/png;base64,R0lGODdhCgAKAPAAAOXl5f///ywAAAAACgAKAEACEIQdqXt9GxyETrI279OIgwIAOw==)}.rc-color-picker-panel-preview span{box-shadow:0 0 2px gray inset}.rc-color-picker-panel-preview span,.rc-color-picker-panel-preview input[type=color]{position:absolute;display:block;height:100%;width:30px;border-radius:2px}.rc-color-picker-panel-preview input[type=color]{opacity:0}.rc-color-picker-panel-board{position:relative;font-size:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin:8px 8px 0}.rc-color-picker-panel-board span{position:absolute;border-radius:10px;border:1px solid #fff;width:9px;height:9px;margin:-4px 0 0 -4px;left:-999px;top:-999px;box-shadow:0 0 1px #787878b3;z-index:2}.rc-color-picker-panel-board-hsv{width:200px;height:150px;position:relative;z-index:1;border-radius:2px}.rc-color-picker-panel-board-value{border-radius:2px;position:absolute;width:100%;height:100%;left:0;top:0;z-index:2;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMSAxIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJub25lIj48bGluZWFyR3JhZGllbnQgaWQ9Imxlc3NoYXQtZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9InJnYigwLDAsMCkiIHN0b3Atb3BhY2l0eT0iMCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIxIi8+PC9saW5lYXJHcmFkaWVudD48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2xlc3NoYXQtZ2VuZXJhdGVkKSIgLz48L3N2Zz4=);background-image:-webkit-linear-gradient(top,transparent 0%,#000000 100%);background-image:-moz-linear-gradient(top,transparent 0%,#000000 100%);background-image:-o-linear-gradient(top,transparent 0%,#000000 100%);background-image:linear-gradient(to bottom,transparent 0%,#000000 100%)}.rc-color-picker-panel-board-saturation{border-radius:2px;position:absolute;width:100%;height:100%;left:0;top:0;z-index:1;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMSAxIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJub25lIj48bGluZWFyR3JhZGllbnQgaWQ9Imxlc3NoYXQtZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0icmdiKDAsMCwwKSIgc3RvcC1vcGFjaXR5PSIwIi8+PC9saW5lYXJHcmFkaWVudD48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2xlc3NoYXQtZ2VuZXJhdGVkKSIgLz48L3N2Zz4=);background-image:-webkit-linear-gradient(left,#ffffff 0%,transparent 100%);background-image:-moz-linear-gradient(left,#ffffff 0%,transparent 100%);background-image:-o-linear-gradient(left,#ffffff 0%,transparent 100%);background-image:linear-gradient(to right,#ffffff 0%,transparent 100%)}.rc-color-picker-panel-board-handler{box-shadow:0 0 2px gray inset;border-radius:2px;cursor:crosshair;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;top:0;left:0;width:100%;height:100%;z-index:3}.rc-color-picker-panel-ribbon{position:relative;height:100%;border-radius:2px;box-shadow:0 0 2px gray inset;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMSAxIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJub25lIj48bGluZWFyR3JhZGllbnQgaWQ9Imxlc3NoYXQtZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNmZjAwMDAiIHN0b3Atb3BhY2l0eT0iMSIvPjxzdG9wIG9mZnNldD0iMTAlIiBzdG9wLWNvbG9yPSIjZmY5OTAwIiBzdG9wLW9wYWNpdHk9IjEiLz48c3RvcCBvZmZzZXQ9IjIwJSIgc3RvcC1jb2xvcj0iI2NkZmYwMCIgc3RvcC1vcGFjaXR5PSIxIi8+PHN0b3Agb2Zmc2V0PSIzMCUiIHN0b3AtY29sb3I9IiMzNWZmMDAiIHN0b3Atb3BhY2l0eT0iMSIvPjxzdG9wIG9mZnNldD0iNDAlIiBzdG9wLWNvbG9yPSIjMDBmZjY2IiBzdG9wLW9wYWNpdHk9IjEiLz48c3RvcCBvZmZzZXQ9IjUwJSIgc3RvcC1jb2xvcj0iIzAwZmZmZCIgc3RvcC1vcGFjaXR5PSIxIi8+PHN0b3Agb2Zmc2V0PSI2MCUiIHN0b3AtY29sb3I9IiMwMDY2ZmYiIHN0b3Atb3BhY2l0eT0iMSIvPjxzdG9wIG9mZnNldD0iNzAlIiBzdG9wLWNvbG9yPSIjMzIwMGZmIiBzdG9wLW9wYWNpdHk9IjEiLz48c3RvcCBvZmZzZXQ9IjgwJSIgc3RvcC1jb2xvcj0iI2NkMDBmZiIgc3RvcC1vcGFjaXR5PSIxIi8+PHN0b3Agb2Zmc2V0PSI5MCUiIHN0b3AtY29sb3I9IiNmZjAwOTkiIHN0b3Atb3BhY2l0eT0iMSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmMDAwMCIgc3RvcC1vcGFjaXR5PSIxIi8+PC9saW5lYXJHcmFkaWVudD48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2xlc3NoYXQtZ2VuZXJhdGVkKSIgLz48L3N2Zz4=);background-image:-webkit-linear-gradient(left,#ff0000 0%,#ff9900 10%,#cdff00 20%,#35ff00 30%,#00ff66 40%,#00fffd 50%,#0066ff 60%,#3200ff 70%,#cd00ff 80%,#ff0099 90%,#ff0000 100%);background-image:-moz-linear-gradient(left,#ff0000 0%,#ff9900 10%,#cdff00 20%,#35ff00 30%,#00ff66 40%,#00fffd 50%,#0066ff 60%,#3200ff 70%,#cd00ff 80%,#ff0099 90%,#ff0000 100%);background-image:-o-linear-gradient(left,#ff0000 0%,#ff9900 10%,#cdff00 20%,#35ff00 30%,#00ff66 40%,#00fffd 50%,#0066ff 60%,#3200ff 70%,#cd00ff 80%,#ff0099 90%,#ff0000 100%);background-image:linear-gradient(to right,#ff0000 0%,#ff9900 10%,#cdff00 20%,#35ff00 30%,#00ff66 40%,#00fffd 50%,#0066ff 60%,#3200ff 70%,#cd00ff 80%,#ff0099 90%,#ff0000 100%)}.rc-color-picker-panel-ribbon span{position:absolute;top:0;height:100%;width:4px;border:1px solid #000000;padding:1px 0;margin-left:-2px;background-color:#fff;border-radius:3px}.rc-color-picker-panel-ribbon-handler{position:absolute;width:104%;height:100%;left:-2%;cursor:pointer}.rc-color-picker-panel-alpha{position:relative;height:100%;width:100%;border-radius:2px;background-image:url(data:image/png;base64,R0lGODdhCgAKAPAAAOXl5f///ywAAAAACgAKAEACEIQdqXt9GxyETrI279OIgwIAOw==);background-repeat:repeat;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.rc-color-picker-panel-alpha-bg{position:absolute;width:100%;height:100%;border-radius:2px;box-shadow:0 0 2px gray inset}.rc-color-picker-panel-alpha span{position:absolute;top:0;height:100%;width:4px;border:1px solid #000000;padding:1px 0;margin-left:-2px;background-color:#fff;border-radius:3px}.rc-color-picker-panel-alpha-handler{position:absolute;width:104%;height:100%;left:-2%;cursor:pointer}.rc-color-picker-panel-params{font-size:12px}.rc-color-picker-panel-params-input{overflow:hidden;padding:2px 8px}.rc-color-picker-panel-params input{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;text-align:center;padding:1px;margin:0;float:left;border-radius:2px;border:1px solid #CACACA;font-family:Helvetica Neue,Helvetica,sans-serif}.rc-color-picker-panel-params-hex{width:52px}.rc-color-picker-panel-params input[type=number]{margin-left:5px;width:44px}.rc-color-picker-panel-params input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none}.rc-color-picker-panel-params-lable{padding:2px 8px;height:22px;line-height:18px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.rc-color-picker-panel-params-lable label{float:left;text-align:center}.rc-color-picker-panel-params-lable-hex{width:52px}.rc-color-picker-panel-params-lable-number,.rc-color-picker-panel-params-lable-alpha{margin-left:5px;width:44px;text-transform:uppercase}.rc-color-picker-panel-params-lable-number:hover{border-radius:2px;background-color:#eee;box-shadow:0 0 0 1px #ccc inset;cursor:pointer}.rc-color-picker-panel-params-has-alpha input[type=number],.rc-color-picker-panel-params-has-alpha .rc-color-picker-panel-params-lable-number,.rc-color-picker-panel-params-has-alpha .rc-color-picker-panel-params-lable-alpha{width:32px}.rc-color-picker{position:absolute;left:-9999px;top:-9999px;z-index:1000}.rc-color-picker-wrap{display:inline-block}.rc-color-picker-slide-up-enter,.rc-color-picker-slide-up-appear{animation-duration:.3s;animation-fill-mode:both;transform-origin:0 0;display:block!important;opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-play-state:paused}.rc-color-picker-slide-up-leave{animation-duration:.3s;animation-fill-mode:both;transform-origin:0 0;display:block!important;opacity:1;animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-play-state:paused}.rc-color-picker-slide-up-enter.rc-color-picker-slide-up-enter-active.rc-color-picker-placement-bottomLeft,.rc-color-picker-slide-up-enter.rc-color-picker-slide-up-enter-active.rc-color-picker-placement-bottomRight,.rc-color-picker-slide-up-appear.rc-color-picker-slide-up-appear-active.rc-color-picker-placement-bottomLeft,.rc-color-picker-slide-up-appear.rc-color-picker-slide-up-appear-active.rc-color-picker-placement-bottomRight{animation-name:rcColorPickerSlideUpIn;animation-play-state:running}.rc-color-picker-slide-up-enter.rc-color-picker-slide-up-enter-active.rc-color-picker-placement-topLeft,.rc-color-picker-slide-up-enter.rc-color-picker-slide-up-enter-active.rc-color-picker-placement-topRight,.rc-color-picker-slide-up-appear.rc-color-picker-slide-up-appear-active.rc-color-picker-placement-topLeft,.rc-color-picker-slide-up-appear.rc-color-picker-slide-up-appear-active.rc-color-picker-placement-topRight{animation-name:rcColorPickerSlideDownIn;animation-play-state:running}.rc-color-picker-slide-up-leave.rc-color-picker-slide-up-leave-active.rc-color-picker-placement-bottomLeft,.rc-color-picker-slide-up-leave.rc-color-picker-slide-up-leave-active.rc-color-picker-placement-bottomRight{animation-name:rcColorPickerSlideUpOut;animation-play-state:running}.rc-color-picker-slide-up-leave.rc-color-picker-slide-up-leave-active.rc-color-picker-placement-topLeft,.rc-color-picker-slide-up-leave.rc-color-picker-slide-up-leave-active.rc-color-picker-placement-topRight{animation-name:rcColorPickerSlideDownOut;animation-play-state:running}@keyframes rcColorPickerSlideUpIn{0%{opacity:0;transform-origin:0% 0%;transform:scaleY(0)}to{opacity:1;transform-origin:0% 0%;transform:scaleY(1)}}@keyframes rcColorPickerSlideUpOut{0%{opacity:1;transform-origin:0% 0%;transform:scaleY(1)}to{opacity:0;transform-origin:0% 0%;transform:scaleY(0)}}@keyframes rcColorPickerSlideDownIn{0%{opacity:0;transform-origin:100% 100%;transform:scaleY(0)}to{opacity:1;transform-origin:100% 100%;transform:scaleY(1)}}@keyframes rcColorPickerSlideDownOut{0%{opacity:1;transform-origin:100% 100%;transform:scaleY(1)}to{opacity:0;transform-origin:100% 100%;transform:scaleY(0)}}.fr-color-picker{width:100%;display:flex;flex-direction:row;align-items:center;color:#666}.fr-color-picker .rc-color-picker-trigger{margin-right:12px;height:32px;width:60px;border:1px solid #e5e5e5}.fr-color-picker>p{margin:0;font-size:14px;line-height:28px}.fr-color-picker .rc-color-picker-wrap{display:flex}.fr-preview-image{width:160px}.fr-preview{position:relative;cursor:pointer}.fr-slider{display:flex;width:100%;align-items:center}.fr-upload-mod,.fr-upload-file{display:flex}.fr-upload-mod{align-items:center}.fr-upload-mod .fr-upload-preview{margin:0 12px}.fr-upload-file .ant-upload-list-item{margin:5px 0 0 8px}.fr-upload-file .ant-upload-list-item-name{margin-right:6px}.fr-upload-file .ant-upload-list-item-info{cursor:pointer}.fr-upload-file .next-upload-list-text .next-upload-list-item-done,.fr-upload-file .next-upload-list-text .next-upload-list-item .next-icon{height:28px;line-height:28px;margin-left:12px}.fr-upload-file .next-upload-list-item-name-wrap{margin-top:-4px}.fr-panel-bordered{border-radius:4px;border:1px solid #f4f4f4;padding:52px 24px 0;margin-bottom:24px}.fr-obj-card{border-radius:4px;border-color:#f4f4f4;margin-bottom:24px!important}.fr-obj-card .ant-card-head{border:none}.fr-obj-card .ant-card-body{padding:12px 24px!important}.fr-obj-card .fr-header-desc{word-break:break-all;color:#00000073;margin-left:6px;font-weight:400}.fr-obj-collapse{border-radius:4px;border:1px solid #f1f1f1;margin-bottom:24px}.fr-obj-collapse .collapse-title{height:24px;color:#000000e0;font-weight:600;font-size:16px;line-height:24px}.fr-obj-collapse .fr-header-desc{word-break:break-all;color:#00000073;margin-left:6px;font-weight:400}.fr-obj-collapse .header-item-label{height:14px;margin-left:30px;color:#000;font-weight:600;font-size:14px;line-height:14px}.fr-obj-collapse .header-item-label span{color:#141414}.fr-obj-collapse .expand-icon-desc{margin-left:4px}.fr-obj-collapse .ant-collapse-header{display:flex;align-items:center!important;padding:16px!important;background-color:#fff;border-radius:4px!important}.fr-obj-collapse .ant-collapse-header-text{display:flex;align-items:center}.fr-obj-collapse .tag-no-data{color:#000000a6}.fr-obj-collapse .ant-collapse-content-box{padding:12px 24px!important}.fr-obj-collapse .ant-collapse-content-box .ant-skeleton-title,.fr-obj-collapse .ant-collapse-content-box .ant-skeleton-paragraph>li{animation:none!important}.fr-obj-subinline-label-hidden>.ant-form-item-row>.ant-form-item-label{visibility:hidden}.fr-obj-subinline-background>.ant-form-item-row>.ant-form-item-control{background-color:#f6f6f6;padding:24px 24px 0;border-radius:4px}.fr-obj-subinline .ant-form-item-row{flex-wrap:nowrap}.fr-obj-line-title .fr-obj-header{line-height:36px;border-bottom:1px solid #e9e9e9}.fr-obj-line-title .fr-header-title{color:#000000e0;font-size:16px;font-weight:600}.fr-obj-line-title .fr-header-desc{word-break:break-all;color:#00000073;margin-left:6px;font-weight:400}.fr-obj-line-title .fr-obj-content{padding:24px 0 0}.fr-list-simple{display:inline-block}.fr-list-simple .fr-inline-field{min-width:220px;margin-bottom:24px!important}.fr-list-simple .fr-list-item{display:flex;align-items:flex-start;position:relative}.fr-list-simple .fr-list-item-operate{height:32px;gap:0!important}.fr-list-simple-background{padding:24px 24px 0;background-color:#f6f6f6;border-radius:4px}.fr-list-simple-background .add-btn{margin-bottom:24px}.fr-list-simple-column .fr-list-item{align-items:center}.fr-list-card{margin-bottom:24px}.fr-list-card .fr-list-item{display:flex;align-items:flex-start;position:relative}.fr-list-card .fr-list-item-operate{padding:0 20px;height:32px;gap:0!important}.fr-list-card .fr-list-item-operate-fixed{position:absolute;right:8px}.fr-list-card .fr-list-add-btn{padding:0 8px}.fr-table-list{margin-bottom:24px}.fr-table-list .ant-form-item{margin-bottom:0}.fr-table-list .ant-form-item-label,.fr-table-list .ant-form-item-explain-error{display:none}.fr-table-list .fr-list-item-operate{gap:0!important}.fr-table-list-no-popover .ant-table-tbody .ant-table-cell{padding:24px 8px 0!important}.fr-table-list-no-popover .ant-form-item{margin-bottom:24px}.fr-table-list-no-popover .ant-form-item-explain-error{display:block;font-size:10px}.fr-list-drawer{margin-bottom:24px}.fr-list-drawer-table-header{width:100%;display:flex;justify-content:right;align-items:center;margin-bottom:10px}.fr-list-drawer .ant-form-item{margin-bottom:0}.fr-list-drawer .fr-list-item-operate{gap:0!important}.fr-virtual-list{margin-bottom:12px}.fr-virtual-list .ant-form-item{margin-bottom:0}.fr-virtual-list .ant-form-item-label,.fr-virtual-list .ant-form-item-explain-error{display:none}.fr-virtual-list .fr-list-item-operate{gap:0!important}.fr-popover-error .ant-popover-inner-content{color:#ff4d4f!important}.fr-virtual-list-no-popover .ant-table-tbody .ant-table-cell{padding:24px 8px 0!important}.fr-virtual-list-no-popover .ant-form-item{margin-bottom:24px}.fr-virtual-list-no-popover .ant-form-item-explain-error{display:block;font-size:10px}.fr-void-title{height:24px;color:#000000e0;font-weight:600;font-size:16px;line-height:24px}.fr-search{width:100%;background:#fff;padding:24px 24px 0 0;margin-bottom:16px;box-sizing:border-box;position:relative}.fr-search .search-action-col{flex:1;display:flex;justify-content:flex-end;align-items:baseline;height:56px}.fr-search .search-action-fixed{position:absolute;right:0;bottom:0;background-color:#fff;padding-right:24px!important}.fr-search .search-action-column{height:auto}.fr-search .search-action-column-fixed{height:86px;padding-top:30px}.fr-search .fr-form>.ant-row{align-items:center}.fr-column-search{padding-left:24px}
|
package/dist/types/class.d.ts
CHANGED
@@ -10,9 +10,9 @@ export declare abstract class BaseUIClass {
|
|
10
10
|
private readonly setSize;
|
11
11
|
resizeObserver: ResizeObserver;
|
12
12
|
constructor(props: UIProps);
|
13
|
-
protected
|
13
|
+
protected getLang(): "en" | "th" | "ja" | "ar" | "pl" | "it";
|
14
14
|
protected getFont(): Record<string, {
|
15
|
-
data: (string |
|
15
|
+
data: (string | Uint8Array | ArrayBuffer) & (string | Uint8Array | ArrayBuffer | undefined);
|
16
16
|
fallback?: boolean | undefined;
|
17
17
|
subset?: boolean | undefined;
|
18
18
|
}>;
|
@@ -35,7 +35,7 @@ export declare abstract class BaseUIClass {
|
|
35
35
|
height: import("zod").ZodNumber;
|
36
36
|
rotate: import("zod").ZodOptional<import("zod").ZodNumber>;
|
37
37
|
}, import("zod").ZodTypeAny, "passthrough">>[];
|
38
|
-
basePdf: (string |
|
38
|
+
basePdf: (string | Uint8Array | ArrayBuffer) & (string | Uint8Array | ArrayBuffer | undefined);
|
39
39
|
sampledata?: Record<string, string>[] | undefined;
|
40
40
|
columns?: string[] | undefined;
|
41
41
|
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { Plugins, Font, Lang, UIOptions } from '@pdfme/common';
|
3
|
+
type Props = {
|
4
|
+
children: React.ReactNode;
|
5
|
+
lang: Lang;
|
6
|
+
font: Font;
|
7
|
+
plugins: Plugins;
|
8
|
+
options: UIOptions;
|
9
|
+
};
|
10
|
+
declare const _default: ({ children, lang, font, plugins, options }: Props) => React.JSX.Element;
|
11
|
+
export default _default;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { Size } from '@pdfme/common';
|
3
|
-
type
|
3
|
+
type CtlBarProps = {
|
4
4
|
size: Size;
|
5
5
|
pageCursor: number;
|
6
6
|
pageNum: number;
|
@@ -8,5 +8,5 @@ type Props = {
|
|
8
8
|
zoomLevel: number;
|
9
9
|
setZoomLevel: (zoom: number) => void;
|
10
10
|
};
|
11
|
-
declare const CtlBar: (props:
|
11
|
+
declare const CtlBar: (props: CtlBarProps) => React.JSX.Element;
|
12
12
|
export default CtlBar;
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { OnDragStart as _OnDragStart, OnSelect as _OnSelect } from 'react-selecto';
|
3
|
-
|
3
|
+
type Props = {
|
4
4
|
container: HTMLElement | null;
|
5
5
|
continueSelect: boolean;
|
6
6
|
onDragStart: (e: _OnDragStart) => void;
|
7
7
|
onSelect: (e: _OnSelect) => void;
|
8
|
-
}
|
8
|
+
};
|
9
|
+
declare const _Selecto: (props: Props) => React.JSX.Element;
|
9
10
|
export default _Selecto;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import type { PropPanelWidgetProps } from '@pdfme/common';
|
3
|
-
declare const AlignWidget: (
|
3
|
+
declare const AlignWidget: (props: PropPanelWidgetProps) => React.JSX.Element;
|
4
4
|
export default AlignWidget;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import type { SidebarProps } from '../../../../types';
|
3
|
-
declare const SelectableSortableContainer: (props: Pick<SidebarProps, 'schemas' | 'onEdit' | 'onSortEnd' | '
|
3
|
+
declare const SelectableSortableContainer: (props: Pick<SidebarProps, 'schemas' | 'onEdit' | 'onSortEnd' | 'hoveringSchemaId' | 'onChangeHoveringSchemaId'>) => React.JSX.Element;
|
4
4
|
export default SelectableSortableContainer;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { UIRenderProps, SchemaForUI, Schema } from '@pdfme/common';
|
3
|
-
type RendererProps = Omit<UIRenderProps<Schema>, 'value' | 'schema' | 'onChange' | 'rootElement' | 'options'> & {
|
3
|
+
type RendererProps = Omit<UIRenderProps<Schema>, 'value' | 'schema' | 'onChange' | 'rootElement' | 'options' | 'theme' | 'i18n'> & {
|
4
4
|
schema: SchemaForUI;
|
5
5
|
onChange: (value: string) => void;
|
6
6
|
outline: string;
|
@@ -6,5 +6,5 @@ type Props = {
|
|
6
6
|
unitNum: number;
|
7
7
|
setUnitCursor: (page: number) => void;
|
8
8
|
};
|
9
|
-
declare const UnitPager: ({ size, unitCursor, unitNum, setUnitCursor }: Props) => React.JSX.Element;
|
9
|
+
declare const UnitPager: ({ size, unitCursor, unitNum, setUnitCursor }: Props) => React.JSX.Element | null;
|
10
10
|
export default UnitPager;
|
package/dist/types/contexts.d.ts
CHANGED
@@ -1,10 +1,52 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Plugins } from '@pdfme/common';
|
3
|
-
export declare const I18nContext: import("react").Context<(key: "type" | "
|
2
|
+
import { Plugins, UIOptions } from '@pdfme/common';
|
3
|
+
export declare const I18nContext: import("react").Context<(key: "height" | "width" | "type" | "rotate" | "cancel" | "field" | "fieldName" | "align" | "edit" | "plsInputName" | "fieldMustUniq" | "notUniq" | "noKeyName" | "fieldsList" | "addNewField" | "editField" | "errorOccurred" | "errorBulkUpdateFieldName" | "commitBulkUpdateFieldName" | "bulkUpdateFieldName" | "schemas.textColor" | "schemas.bgColor" | "schemas.horizontal" | "schemas.vertical" | "schemas.left" | "schemas.center" | "schemas.right" | "schemas.top" | "schemas.middle" | "schemas.bottom" | "schemas.text.fontName" | "schemas.text.size" | "schemas.text.spacing" | "schemas.text.textAlign" | "schemas.text.verticalAlign" | "schemas.text.lineHeight" | "schemas.text.min" | "schemas.text.max" | "schemas.text.fit" | "schemas.text.dynamicFontSize" | "schemas.barcodes.barColor", dict?: {
|
4
|
+
cancel: string;
|
5
|
+
field: string;
|
6
|
+
fieldName: string;
|
7
|
+
align: string;
|
8
|
+
width: string;
|
9
|
+
height: string;
|
10
|
+
rotate: string;
|
11
|
+
edit: string;
|
12
|
+
plsInputName: string;
|
13
|
+
fieldMustUniq: string;
|
14
|
+
notUniq: string;
|
15
|
+
noKeyName: string;
|
16
|
+
fieldsList: string;
|
17
|
+
addNewField: string;
|
18
|
+
editField: string;
|
19
|
+
type: string;
|
20
|
+
errorOccurred: string;
|
21
|
+
errorBulkUpdateFieldName: string;
|
22
|
+
commitBulkUpdateFieldName: string;
|
23
|
+
bulkUpdateFieldName: string;
|
24
|
+
'schemas.textColor': string;
|
25
|
+
'schemas.bgColor': string;
|
26
|
+
'schemas.horizontal': string;
|
27
|
+
'schemas.vertical': string;
|
28
|
+
'schemas.left': string;
|
29
|
+
'schemas.center': string;
|
30
|
+
'schemas.right': string;
|
31
|
+
'schemas.top': string;
|
32
|
+
'schemas.middle': string;
|
33
|
+
'schemas.bottom': string;
|
34
|
+
'schemas.text.fontName': string;
|
35
|
+
'schemas.text.size': string;
|
36
|
+
'schemas.text.spacing': string;
|
37
|
+
'schemas.text.textAlign': string;
|
38
|
+
'schemas.text.verticalAlign': string;
|
39
|
+
'schemas.text.lineHeight': string;
|
40
|
+
'schemas.text.min': string;
|
41
|
+
'schemas.text.max': string;
|
42
|
+
'schemas.text.fit': string;
|
43
|
+
'schemas.text.dynamicFontSize': string;
|
44
|
+
'schemas.barcodes.barColor': string;
|
45
|
+
} | undefined) => string>;
|
4
46
|
export declare const FontContext: import("react").Context<Record<string, {
|
5
|
-
data: (string |
|
47
|
+
data: (string | Uint8Array | ArrayBuffer) & (string | Uint8Array | ArrayBuffer | undefined);
|
6
48
|
fallback?: boolean | undefined;
|
7
49
|
subset?: boolean | undefined;
|
8
50
|
}>>;
|
9
51
|
export declare const PluginsRegistry: import("react").Context<Plugins>;
|
10
|
-
export declare const OptionsContext: import("react").Context<
|
52
|
+
export declare const OptionsContext: import("react").Context<UIOptions>;
|
package/dist/types/helper.d.ts
CHANGED
@@ -25,8 +25,8 @@ export declare const getPdfPageSizes: (pdfBlob: Blob) => Promise<{
|
|
25
25
|
export declare const pdf2Pngs: (pdfBlob: Blob, width: number) => Promise<string[]>;
|
26
26
|
export declare const b64toBlob: (base64: string) => Blob;
|
27
27
|
export declare const templateSchemas2SchemasList: (_template: Template) => Promise<{
|
28
|
-
height: number;
|
29
28
|
width: number;
|
29
|
+
height: number;
|
30
30
|
type: string;
|
31
31
|
position: {
|
32
32
|
x: number;
|
@@ -57,4 +57,5 @@ export declare const getPagesScrollTopByIndex: (pageSizes: {
|
|
57
57
|
width: number;
|
58
58
|
height: number;
|
59
59
|
}[], index: number, scale: number) => number;
|
60
|
+
export declare const getSidebarContentHeight: (sidebarHeight: number) => number;
|
60
61
|
export {};
|
package/dist/types/hooks.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { RefObject } from 'react';
|
2
|
-
import { Template, Size } from '@pdfme/common';
|
2
|
+
import { Template, Size, SchemaForUI, ChangeSchemas } from '@pdfme/common';
|
3
3
|
export declare const usePrevious: <T>(value: T) => T | null;
|
4
4
|
type UIPreProcessorProps = {
|
5
5
|
template: Template;
|
@@ -9,8 +9,8 @@ type UIPreProcessorProps = {
|
|
9
9
|
export declare const useUIPreProcessor: ({ template, size, zoomLevel }: UIPreProcessorProps) => {
|
10
10
|
backgrounds: string[];
|
11
11
|
pageSizes: {
|
12
|
-
height: number;
|
13
12
|
width: number;
|
13
|
+
height: number;
|
14
14
|
}[];
|
15
15
|
scale: number;
|
16
16
|
error: Error | null;
|
@@ -24,4 +24,21 @@ type ScrollPageCursorProps = {
|
|
24
24
|
};
|
25
25
|
export declare const useScrollPageCursor: ({ ref, pageSizes, scale, pageCursor, onChangePageCursor, }: ScrollPageCursorProps) => void;
|
26
26
|
export declare const useMountStatus: () => boolean;
|
27
|
+
interface UseInitEventsParams {
|
28
|
+
pageCursor: number;
|
29
|
+
pageSizes: Size[];
|
30
|
+
activeElements: HTMLElement[];
|
31
|
+
template: Template;
|
32
|
+
schemasList: SchemaForUI[][];
|
33
|
+
changeSchemas: ChangeSchemas;
|
34
|
+
commitSchemas: (newSchemas: SchemaForUI[]) => void;
|
35
|
+
removeSchemas: (ids: string[]) => void;
|
36
|
+
onSaveTemplate: (t: Template) => void;
|
37
|
+
past: React.MutableRefObject<SchemaForUI[][]>;
|
38
|
+
future: React.MutableRefObject<SchemaForUI[][]>;
|
39
|
+
setSchemasList: React.Dispatch<React.SetStateAction<SchemaForUI[][]>>;
|
40
|
+
onEdit: (targets: HTMLElement[]) => void;
|
41
|
+
onEditEnd: () => void;
|
42
|
+
}
|
43
|
+
export declare const useInitEvents: ({ pageCursor, pageSizes, activeElements, template, schemasList, changeSchemas, commitSchemas, removeSchemas, onSaveTemplate, past, future, setSchemasList, onEdit, onEditEnd, }: UseInitEventsParams) => void;
|
27
44
|
export {};
|
package/dist/types/i18n.d.ts
CHANGED
@@ -1,27 +1,3 @@
|
|
1
|
-
import { Lang } from '@pdfme/common';
|
2
|
-
|
3
|
-
declare const
|
4
|
-
cancel: string;
|
5
|
-
field: string;
|
6
|
-
fieldName: string;
|
7
|
-
require: string;
|
8
|
-
uniq: string;
|
9
|
-
edit: string;
|
10
|
-
plsInputName: string;
|
11
|
-
fieldMustUniq: string;
|
12
|
-
notUniq: string;
|
13
|
-
noKeyName: string;
|
14
|
-
fieldsList: string;
|
15
|
-
addNewField: string;
|
16
|
-
editField: string;
|
17
|
-
type: string;
|
18
|
-
errorOccurred: string;
|
19
|
-
errorBulkUpdateFieldName: string;
|
20
|
-
commitBulkUpdateFieldName: string;
|
21
|
-
bulkUpdateFieldName: string;
|
22
|
-
barColor: string;
|
23
|
-
textColor: string;
|
24
|
-
bgColor: string;
|
25
|
-
};
|
26
|
-
export declare const curriedI18n: (lang: Lang) => (key: keyof DictEn) => string;
|
27
|
-
export {};
|
1
|
+
import type { Lang, Dict } from '@pdfme/common';
|
2
|
+
export declare const getDict: (lang: Lang) => Dict;
|
3
|
+
export declare const i18n: (key: keyof Dict, dict?: Dict) => string;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pdfme/ui",
|
3
|
-
"version": "3.0.1",
|
3
|
+
"version": "3.1.0-dev.1",
|
4
4
|
"sideEffects": false,
|
5
5
|
"author": "hand-dot",
|
6
6
|
"license": "MIT",
|
@@ -21,6 +21,7 @@
|
|
21
21
|
"bugs": {
|
22
22
|
"url": "https://github.com/pdfme/pdfme/issues"
|
23
23
|
},
|
24
|
+
"type": "module",
|
24
25
|
"main": "dist/index.js",
|
25
26
|
"module": "dist/index.js",
|
26
27
|
"types": "dist/types/index.d.ts",
|
@@ -28,8 +29,10 @@
|
|
28
29
|
"node": ">=16"
|
29
30
|
},
|
30
31
|
"scripts": {
|
31
|
-
"develop": "
|
32
|
-
"
|
32
|
+
"develop": "npm-run-all --parallel devBuild:watch devBuildType:watch",
|
33
|
+
"devBuild:watch": "esbuild src/index.ts --bundle --outfile=dist/index.js --format=esm --watch",
|
34
|
+
"devBuildType:watch": "tsc --emitDeclarationOnly --watch",
|
35
|
+
"build": "vite build && tsc --emitDeclarationOnly",
|
33
36
|
"clean": "rimraf dist",
|
34
37
|
"lint": "tsc --noEmit",
|
35
38
|
"test": "jest",
|
@@ -39,14 +42,14 @@
|
|
39
42
|
"prettier": "prettier --write 'src/**/*.{ts,tsx}'"
|
40
43
|
},
|
41
44
|
"dependencies": {
|
45
|
+
"@ant-design/icons": "^5.2.6",
|
42
46
|
"@dnd-kit/core": "^6.0.8",
|
43
47
|
"@dnd-kit/sortable": "^7.0.2",
|
44
|
-
"@heroicons/react": "^2.0.13",
|
45
48
|
"@scena/react-guides": "^0.16.0",
|
46
49
|
"antd": "^5.9.4",
|
47
50
|
"form-render": "^2.2.16",
|
48
51
|
"hotkeys-js": "^3.8.7",
|
49
|
-
"pdfjs-dist": "
|
52
|
+
"pdfjs-dist": "^4.0.189",
|
50
53
|
"react": "^16.14.0",
|
51
54
|
"react-dom": "^16.14.0",
|
52
55
|
"react-moveable": "^0.30.3",
|
@@ -57,18 +60,19 @@
|
|
57
60
|
"@pdfme/schemas": "file:../schemas",
|
58
61
|
"@testing-library/jest-dom": "^5.16.1",
|
59
62
|
"@testing-library/react": "^12.1.2",
|
60
|
-
"@types/pdfjs-dist": "^2.10.378",
|
61
63
|
"@types/react": "^17.0.52",
|
62
64
|
"@types/react-dom": "^17.0.18",
|
65
|
+
"@vitejs/plugin-react": "^4.2.0",
|
63
66
|
"css-loader": "^6.8.1",
|
64
67
|
"csstype": "^3.1.2",
|
68
|
+
"esbuild": "^0.19.5",
|
65
69
|
"eslint-plugin-react": "^7.28.0",
|
66
70
|
"eslint-plugin-react-hooks": "^4.3.0",
|
67
71
|
"jest-canvas-mock": "^2.3.1",
|
68
72
|
"process": "^0.11.10",
|
69
|
-
"
|
70
|
-
"
|
71
|
-
"
|
73
|
+
"vite": "^5.0.0",
|
74
|
+
"vite-plugin-top-level-await": "^1.3.1",
|
75
|
+
"vite-tsconfig-paths": "^4.2.1"
|
72
76
|
},
|
73
77
|
"peerDependencies": {
|
74
78
|
"@pdfme/common": "latest",
|
@@ -82,11 +86,13 @@
|
|
82
86
|
"./__tests__/test-helpers.js"
|
83
87
|
],
|
84
88
|
"moduleNameMapper": {
|
85
|
-
"\\.(png|css)$": "<rootDir
|
89
|
+
"\\.(png|css)$": "<rootDir>/__mocks__/assetsTransformer.js",
|
86
90
|
"^antd/es/": "antd/lib/",
|
87
91
|
"^form-render/es/": "form-render/lib/",
|
88
92
|
"^rc-picker/es/": "rc-picker/lib/",
|
89
|
-
"^lodash-es$": "lodash"
|
93
|
+
"^lodash-es$": "lodash",
|
94
|
+
"^pdfjs-dist$": "<rootDir>/__mocks__/pdfjs-dist.js",
|
95
|
+
"^pdfjs-dist/build/pdf.worker.mjs$": "<rootDir>/__mocks__/pdfjs-dist.js"
|
90
96
|
},
|
91
97
|
"resolver": "ts-jest-resolver",
|
92
98
|
"moduleFileExtensions": [
|