@pdfme/ui 1.0.17 → 1.0.18
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/package.json
CHANGED
@@ -118,7 +118,7 @@ const TemplateEditor = ({
|
|
118
118
|
|
119
119
|
return schemasList[pageCursor].filter((s) => ids.includes(s.id));
|
120
120
|
};
|
121
|
-
const
|
121
|
+
const timeTravel = (mode: 'undo' | 'redo') => {
|
122
122
|
const isUndo = mode === 'undo';
|
123
123
|
const stack = isUndo ? past : future;
|
124
124
|
if (stack.current.length <= 0) return;
|
@@ -160,8 +160,8 @@ const TemplateEditor = ({
|
|
160
160
|
onEdit(pasteSchemas.map((s) => document.getElementById(s.id)!));
|
161
161
|
copiedSchemas.current = pasteSchemas;
|
162
162
|
},
|
163
|
-
redo: () =>
|
164
|
-
undo: () =>
|
163
|
+
redo: () => timeTravel('redo'),
|
164
|
+
undo: () => timeTravel('undo'),
|
165
165
|
save: () => onSaveTemplate && onSaveTemplate(modifiedTemplate),
|
166
166
|
remove: () => removeSchemas(getActiveSchemas().map((s) => s.id)),
|
167
167
|
esc: onEditEnd,
|
@@ -20,7 +20,7 @@ const TextSchemaUI = (
|
|
20
20
|
padding: 0,
|
21
21
|
resize: 'none',
|
22
22
|
position: 'absolute',
|
23
|
-
fontFamily: schema.fontName
|
23
|
+
fontFamily: schema.fontName ? `'${schema.fontName}'` : 'inherit',
|
24
24
|
height: schema.height * ZOOM,
|
25
25
|
// Increase the width by 1 point. (0.75 pixels)
|
26
26
|
width: (schema.width + (schema.characterSpacing ?? DEFAULT_CHARACTER_SPACING) * 0.75) * ZOOM,
|