@pdfme/ui 2.0.1 → 2.0.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.
@@ -98,7 +98,7 @@ declare const TemplateEditor: ({ template, size, onSaveTemplate, onChangeTemplat
|
|
98
98
|
fallback?: boolean | undefined;
|
99
99
|
subset?: boolean | undefined;
|
100
100
|
}> | undefined;
|
101
|
-
lang?: "th" | "en" | "ja" | "ar" | undefined;
|
101
|
+
lang?: "th" | "en" | "ja" | "ar" | "pl" | undefined;
|
102
102
|
} | undefined;
|
103
103
|
} & {
|
104
104
|
onChangeTemplate: (t: Template) => void;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pdfme/ui",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.2",
|
4
4
|
"sideEffects": false,
|
5
5
|
"author": "hand-dot",
|
6
6
|
"license": "MIT",
|
@@ -41,7 +41,6 @@
|
|
41
41
|
"@dnd-kit/core": "^5.0.1",
|
42
42
|
"@dnd-kit/sortable": "^6.0.0",
|
43
43
|
"@heroicons/react": "^2.0.13",
|
44
|
-
"@pdfme/common": "file:../common",
|
45
44
|
"@scena/react-guides": "^0.16.0",
|
46
45
|
"hotkeys-js": "^3.8.7",
|
47
46
|
"pdfjs-dist": "2.12.313",
|
@@ -51,6 +50,7 @@
|
|
51
50
|
"react-selecto": "^1.12.0"
|
52
51
|
},
|
53
52
|
"devDependencies": {
|
53
|
+
"@pdfme/common": "file:../common",
|
54
54
|
"@testing-library/jest-dom": "^5.16.1",
|
55
55
|
"@testing-library/react": "^12.1.2",
|
56
56
|
"@types/pdfjs-dist": "^2.10.378",
|
@@ -63,6 +63,9 @@
|
|
63
63
|
"webpack": "^5.75.0",
|
64
64
|
"webpack-cli": "^5.0.1"
|
65
65
|
},
|
66
|
+
"peerDependencies": {
|
67
|
+
"@pdfme/common": "^2.0.0"
|
68
|
+
},
|
66
69
|
"jest": {
|
67
70
|
"setupFiles": [
|
68
71
|
"jest-canvas-mock"
|
@@ -110,7 +110,7 @@ const Main = (props: Props, ref: Ref<HTMLDivElement>) => {
|
|
110
110
|
if (e.shiftKey) setIsPressShiftKey(true);
|
111
111
|
};
|
112
112
|
const onKeyup = (e: KeyboardEvent) => {
|
113
|
-
if (e.key === 'Shift') setIsPressShiftKey(false);
|
113
|
+
if (e.key === 'Shift' || !e.shiftKey) setIsPressShiftKey(false);
|
114
114
|
if (e.key === 'Escape' || e.key === 'Esc') setEditing(false);
|
115
115
|
};
|
116
116
|
|
@@ -197,11 +197,11 @@ const Main = (props: Props, ref: Ref<HTMLDivElement>) => {
|
|
197
197
|
|
198
198
|
const currentlyEditingThisTextSchema = (target: EventTarget | null) => {
|
199
199
|
if (!target) return false;
|
200
|
-
if (target instanceof HTMLTextAreaElement)
|
200
|
+
if (target instanceof HTMLTextAreaElement) {
|
201
201
|
return activeElements.map((ae) => ae.id).includes(target.parentElement?.id || '');
|
202
202
|
}
|
203
203
|
return false;
|
204
|
-
}
|
204
|
+
};
|
205
205
|
|
206
206
|
const onResize = ({ target, width, height, direction }: OnResize) => {
|
207
207
|
if (!target) return;
|
@@ -246,6 +246,10 @@ const Main = (props: Props, ref: Ref<HTMLDivElement>) => {
|
|
246
246
|
if (!currentlyEditingThisTextSchema(e.target)) {
|
247
247
|
setEditing(false);
|
248
248
|
}
|
249
|
+
// For MacOS CMD+SHIFT+3/4 screenshots where the keydown event is never received, check mouse too
|
250
|
+
if (!e.shiftKey) {
|
251
|
+
setIsPressShiftKey(false);
|
252
|
+
}
|
249
253
|
}}
|
250
254
|
style={{ overflow: 'overlay' }}
|
251
255
|
>
|
package/src/i18n.ts
CHANGED
@@ -91,8 +91,33 @@ const dictTh: { [key in keyof DictEn]: string } = {
|
|
91
91
|
bulkUpdateFieldName: 'แก้ไขชื่อฟิลด์เป็นชุด',
|
92
92
|
};
|
93
93
|
|
94
|
+
const dictPl: {[key in keyof DictEn]: string} = {
|
95
|
+
cancel: 'Anuluj',
|
96
|
+
field: 'pole',
|
97
|
+
fieldName: 'Klucz pola',
|
98
|
+
require: 'wymagany',
|
99
|
+
uniq: 'unikalny',
|
100
|
+
inputExample: 'Przykład',
|
101
|
+
edit: 'Edytuj',
|
102
|
+
plsInputName: 'Wymagane wprowadzenie klucza pola',
|
103
|
+
fieldMustUniq: 'Klucz pola nie jest unikalny',
|
104
|
+
notUniq: '(Klucz pola nie jest unikalny)',
|
105
|
+
noKeyName: 'Brak nazwy klucza pola',
|
106
|
+
fieldsList: 'Lista pól',
|
107
|
+
addNewField: 'Dodaj nowe pole',
|
108
|
+
editField: 'Edytuj pole',
|
109
|
+
type: 'Typ pola',
|
110
|
+
errorOccurred: 'Wystąpił błąd',
|
111
|
+
errorBulkUpdateFieldName:
|
112
|
+
'Nie można wprowadzić zmian ponieważ liczba elementów uległa zmianie.',
|
113
|
+
commitBulkUpdateFieldName: 'Zaakceptuj zmiany',
|
114
|
+
bulkUpdateFieldName: 'Masowo aktualizuj klucze pól',
|
115
|
+
}
|
116
|
+
|
94
117
|
const i18n = (lang: Lang, key: keyof DictEn) => {
|
95
118
|
switch (lang) {
|
119
|
+
case 'pl':
|
120
|
+
return dictPl[key];
|
96
121
|
case 'th':
|
97
122
|
return dictTh[key];
|
98
123
|
|