@pdfme/ui 4.0.0-alpha.0 → 4.0.0-dev.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.
Files changed (38) hide show
  1. package/README.md +1 -0
  2. package/dist/index.es.js +55912 -55715
  3. package/dist/index.umd.js +93 -94
  4. package/dist/types/Designer.d.ts +2 -0
  5. package/dist/types/class.d.ts +4 -1
  6. package/dist/types/components/Designer/LeftSidebar.d.ts +8 -0
  7. package/dist/types/components/Designer/index.d.ts +4 -1
  8. package/dist/types/components/Renderer.d.ts +1 -1
  9. package/dist/types/constants.d.ts +1 -1
  10. package/dist/types/contexts.d.ts +1 -2
  11. package/dist/types/helper.d.ts +1 -0
  12. package/dist/types/types.d.ts +0 -1
  13. package/package.json +1 -1
  14. package/src/Designer.tsx +8 -0
  15. package/src/components/Designer/Canvas/index.tsx +4 -3
  16. package/src/components/Designer/LeftSidebar.tsx +81 -0
  17. package/src/components/Designer/{Sidebar → RightSidebar}/DetailView/index.tsx +1 -2
  18. package/src/components/Designer/{Sidebar → RightSidebar}/ListView/index.tsx +3 -11
  19. package/src/components/Designer/{Sidebar → RightSidebar}/index.tsx +5 -20
  20. package/src/components/Designer/index.tsx +123 -76
  21. package/src/components/Renderer.tsx +3 -1
  22. package/src/constants.ts +1 -1
  23. package/src/helper.ts +1 -1
  24. package/src/i18n.ts +122 -7
  25. package/src/types.ts +0 -1
  26. /package/dist/types/components/Designer/{Sidebar → RightSidebar}/DetailView/AlignWidget.d.ts +0 -0
  27. /package/dist/types/components/Designer/{Sidebar → RightSidebar}/DetailView/WidgetRenderer.d.ts +0 -0
  28. /package/dist/types/components/Designer/{Sidebar → RightSidebar}/DetailView/index.d.ts +0 -0
  29. /package/dist/types/components/Designer/{Sidebar → RightSidebar}/ListView/Item.d.ts +0 -0
  30. /package/dist/types/components/Designer/{Sidebar → RightSidebar}/ListView/SelectableSortableContainer.d.ts +0 -0
  31. /package/dist/types/components/Designer/{Sidebar → RightSidebar}/ListView/SelectableSortableItem.d.ts +0 -0
  32. /package/dist/types/components/Designer/{Sidebar → RightSidebar}/ListView/index.d.ts +0 -0
  33. /package/dist/types/components/Designer/{Sidebar → RightSidebar}/index.d.ts +0 -0
  34. /package/src/components/Designer/{Sidebar → RightSidebar}/DetailView/AlignWidget.tsx +0 -0
  35. /package/src/components/Designer/{Sidebar → RightSidebar}/DetailView/WidgetRenderer.tsx +0 -0
  36. /package/src/components/Designer/{Sidebar → RightSidebar}/ListView/Item.tsx +0 -0
  37. /package/src/components/Designer/{Sidebar → RightSidebar}/ListView/SelectableSortableContainer.tsx +0 -0
  38. /package/src/components/Designer/{Sidebar → RightSidebar}/ListView/SelectableSortableItem.tsx +0 -0
@@ -7,12 +7,14 @@ import {
7
7
  ChangeSchemas,
8
8
  DesignerProps,
9
9
  Size,
10
- Plugin,
11
10
  isBlankPdf,
11
+ px2mm,
12
12
  } from '@pdfme/common';
13
- import Sidebar from './Sidebar/index';
13
+ import { DndContext } from '@dnd-kit/core';
14
+ import RightSidebar from './RightSidebar/index';
15
+ import LeftSidebar from './LeftSidebar';
14
16
  import Canvas from './Canvas/index';
15
- import { RULER_HEIGHT, SIDEBAR_WIDTH } from '../../constants';
17
+ import { RULER_HEIGHT, RIGHT_SIDEBAR_WIDTH } from '../../constants';
16
18
  import { I18nContext, PluginsRegistry } from '../../contexts';
17
19
  import {
18
20
  schemasList2template,
@@ -27,19 +29,34 @@ import Root from '../Root';
27
29
  import ErrorScreen from '../ErrorScreen';
28
30
  import CtlBar from '../CtlBar';
29
31
 
32
+ /**
33
+ * When the canvas scales there is a displacement of the starting position of the dragged schema.
34
+ * It moves left or right from the top-left corner of the drag icon depending on the scale.
35
+ * This function calculates the adjustment needed to compensate for this displacement.
36
+ */
37
+ const scaleDragPosAdjustment = (adjustment: number, scale: number): number => {
38
+ if (scale > 1) return adjustment * (scale - 1);
39
+ if (scale < 1) return adjustment * -(1 - scale);
40
+ return 0;
41
+ }
42
+
30
43
  const TemplateEditor = ({
31
44
  template,
32
45
  size,
33
46
  onSaveTemplate,
34
47
  onChangeTemplate,
48
+ onPageCursorChange,
35
49
  }: Omit<DesignerProps, 'domContainer'> & {
36
50
  size: Size;
37
51
  onSaveTemplate: (t: Template) => void;
38
52
  onChangeTemplate: (t: Template) => void;
53
+ } & {
54
+ onChangeTemplate: (t: Template) => void
55
+ onPageCursorChange: (newPageCursor: number) => void
39
56
  }) => {
40
57
  const past = useRef<SchemaForUI[][]>([]);
41
58
  const future = useRef<SchemaForUI[][]>([]);
42
- const mainRef = useRef<HTMLDivElement>(null);
59
+ const canvasRef = useRef<HTMLDivElement>(null);
43
60
  const paperRefs = useRef<HTMLDivElement[]>([]);
44
61
 
45
62
  const i18n = useContext(I18nContext);
@@ -67,12 +84,13 @@ const TemplateEditor = ({
67
84
  };
68
85
 
69
86
  useScrollPageCursor({
70
- ref: mainRef,
87
+ ref: canvasRef,
71
88
  pageSizes,
72
89
  scale,
73
90
  pageCursor,
74
91
  onChangePageCursor: (p) => {
75
92
  setPageCursor(p);
93
+ onPageCursorChange(p)
76
94
  onEditEnd();
77
95
  },
78
96
  });
@@ -133,32 +151,32 @@ const TemplateEditor = ({
133
151
  setSchemasList(sl);
134
152
  onEditEnd();
135
153
  setPageCursor(0);
136
- if (mainRef.current?.scroll) {
137
- mainRef.current.scroll({ top: 0, behavior: 'smooth' });
154
+ if (canvasRef.current?.scroll) {
155
+ canvasRef.current.scroll({ top: 0, behavior: 'smooth' });
138
156
  }
139
157
  }, []);
140
158
 
141
- const addSchema = () => {
142
- const propPanel = (Object.values(pluginsRegistry)[0] as Plugin<Schema>)?.propPanel;
159
+ const addSchema = (defaultSchema: Schema) => {
160
+ const [paddingTop, paddingRight, paddingBottom, paddingLeft] = isBlankPdf(template.basePdf) ? template.basePdf.padding : [0, 0, 0, 0];
161
+ const pageSize = pageSizes[pageCursor];
143
162
 
144
- if (!propPanel) {
145
- throw new Error(`[@pdfme/ui] addSchema failed: propPanel is empty.
146
- Check this document: https://pdfme.com/docs/custom-schemas`);
147
- }
163
+ const ensureMiddleValue = (min: number, value: number, max: number) => Math.min(Math.max(min, value), max)
148
164
 
149
165
  const s = {
150
166
  id: uuid(),
151
167
  key: `${i18n('field')}${schemasList[pageCursor].length + 1}`,
152
- ...propPanel.defaultSchema,
168
+ ...defaultSchema,
169
+ position: {
170
+ x: ensureMiddleValue(paddingLeft, defaultSchema.position.x, pageSize.width - paddingRight - defaultSchema.width),
171
+ y: ensureMiddleValue(paddingTop, defaultSchema.position.y, pageSize.height - paddingBottom - defaultSchema.height),
172
+ },
153
173
  } as SchemaForUI;
154
174
 
155
- const paper = paperRefs.current[pageCursor];
156
- const rectTop = paper ? paper.getBoundingClientRect().top : 0;
157
- const [paddingTop, , , paddingLeft] = isBlankPdf(template.basePdf)
158
- ? template.basePdf.padding
159
- : [0, 0, 0, 0];
160
- s.position.y = rectTop > 0 ? paddingTop : pageSizes[pageCursor].height / 2;
161
- s.position.x = paddingLeft;
175
+ if (defaultSchema.position.y === 0) {
176
+ const paper = paperRefs.current[pageCursor];
177
+ const rectTop = paper ? paper.getBoundingClientRect().top : 0;
178
+ s.position.y = rectTop > 0 ? paddingTop : pageSizes[pageCursor].height / 2;
179
+ }
162
180
 
163
181
  commitSchemas(schemasList[pageCursor].concat(s));
164
182
  setTimeout(() => onEdit([document.getElementById(s.id)!]));
@@ -180,8 +198,8 @@ Check this document: https://pdfme.com/docs/custom-schemas`);
180
198
  void refresh(newTemplate);
181
199
  setTimeout(
182
200
  () =>
183
- mainRef.current &&
184
- ((mainRef.current.scrollTop = getPagesScrollTopByIndex(pageSizes, newPageCursor, scale)), 0)
201
+ canvasRef.current &&
202
+ ((canvasRef.current.scrollTop = getPagesScrollTopByIndex(pageSizes, newPageCursor, scale)), 0)
185
203
  );
186
204
  };
187
205
 
@@ -206,7 +224,7 @@ Check this document: https://pdfme.com/docs/custom-schemas`);
206
224
  }
207
225
 
208
226
  const sizeExcSidebar = {
209
- width: sidebarOpen ? size.width - SIDEBAR_WIDTH : size.width,
227
+ width: sidebarOpen ? size.width - RIGHT_SIDEBAR_WIDTH : size.width,
210
228
  height: size.height,
211
229
  };
212
230
 
@@ -219,59 +237,88 @@ Check this document: https://pdfme.com/docs/custom-schemas`);
219
237
 
220
238
  return (
221
239
  <Root size={size} scale={scale}>
222
- <CtlBar
223
- size={sizeExcSidebar}
224
- pageCursor={pageCursor}
225
- pageNum={schemasList.length}
226
- setPageCursor={(p) => {
227
- if (!mainRef.current) return;
228
- mainRef.current.scrollTop = getPagesScrollTopByIndex(pageSizes, p, scale);
229
- setPageCursor(p);
230
- onEditEnd();
231
- }}
232
- zoomLevel={zoomLevel}
233
- setZoomLevel={setZoomLevel}
234
- {...pageManipulation}
235
- />
236
- <Sidebar
237
- hoveringSchemaId={hoveringSchemaId}
238
- onChangeHoveringSchemaId={onChangeHoveringSchemaId}
239
- height={mainRef.current ? mainRef.current.clientHeight : 0}
240
- size={size}
241
- pageSize={pageSizes[pageCursor] ?? []}
242
- activeElements={activeElements}
243
- schemas={schemasList[pageCursor] ?? []}
244
- changeSchemas={changeSchemas}
245
- onSortEnd={onSortEnd}
246
- onEdit={(id: string) => {
247
- const editingElem = document.getElementById(id);
248
- editingElem && onEdit([editingElem]);
240
+ <DndContext
241
+ onDragEnd={(event) => {
242
+ // Triggered after a schema is dragged & dropped from the left sidebar.
243
+ if (!event.active) return;
244
+ const active = event.active;
245
+ const pageRect = paperRefs.current[pageCursor].getBoundingClientRect();
246
+
247
+ const dragStartLeft = active.rect.current.initial?.left || 0;
248
+ const dragStartTop = active.rect.current.initial?.top || 0;
249
+
250
+ const canvasLeftOffsetFromPageCorner = pageRect.left - dragStartLeft + scaleDragPosAdjustment(20, scale);
251
+ const canvasTopOffsetFromPageCorner = pageRect.top - dragStartTop;
252
+
253
+ const moveY = (event.delta.y - canvasTopOffsetFromPageCorner) / scale;
254
+ const moveX = (event.delta.x - canvasLeftOffsetFromPageCorner) / scale;
255
+
256
+ const position = { x: px2mm(Math.max(0, moveX)), y: px2mm(Math.max(0, moveY)) }
257
+
258
+ addSchema({ ...(active.data.current as Schema), position });
249
259
  }}
250
- onEditEnd={onEditEnd}
251
- addSchema={addSchema}
252
- deselectSchema={onEditEnd}
253
- sidebarOpen={sidebarOpen}
254
- setSidebarOpen={setSidebarOpen}
255
- />
256
- <Canvas
257
- ref={mainRef}
258
- paperRefs={paperRefs}
259
- basePdf={template.basePdf}
260
- hoveringSchemaId={hoveringSchemaId}
261
- onChangeHoveringSchemaId={onChangeHoveringSchemaId}
262
- height={size.height - RULER_HEIGHT * ZOOM}
263
- pageCursor={pageCursor}
264
- scale={scale}
265
- size={sizeExcSidebar}
266
- pageSizes={pageSizes}
267
- backgrounds={backgrounds}
268
- activeElements={activeElements}
269
- schemasList={schemasList}
270
- changeSchemas={changeSchemas}
271
- removeSchemas={removeSchemas}
272
- sidebarOpen={sidebarOpen}
273
- onEdit={onEdit}
274
- />
260
+ onDragStart={onEditEnd}
261
+ >
262
+ <CtlBar
263
+ size={sizeExcSidebar}
264
+ pageCursor={pageCursor}
265
+ pageNum={schemasList.length}
266
+ setPageCursor={(p) => {
267
+ if (!canvasRef.current) return;
268
+ canvasRef.current.scrollTop = getPagesScrollTopByIndex(pageSizes, p, scale);
269
+ setPageCursor(p);
270
+ onEditEnd();
271
+ }}
272
+ zoomLevel={zoomLevel}
273
+ setZoomLevel={setZoomLevel}
274
+ {...pageManipulation}
275
+ />
276
+ <LeftSidebar
277
+ height={canvasRef.current ? canvasRef.current.clientHeight : 0}
278
+ scale={scale}
279
+ basePdf={template.basePdf}
280
+ />
281
+
282
+ <RightSidebar
283
+ hoveringSchemaId={hoveringSchemaId}
284
+ onChangeHoveringSchemaId={onChangeHoveringSchemaId}
285
+ height={canvasRef.current ? canvasRef.current.clientHeight : 0}
286
+ size={size}
287
+ pageSize={pageSizes[pageCursor] ?? []}
288
+ activeElements={activeElements}
289
+ schemas={schemasList[pageCursor] ?? []}
290
+ changeSchemas={changeSchemas}
291
+ onSortEnd={onSortEnd}
292
+ onEdit={id => {
293
+ const editingElem = document.getElementById(id);
294
+ editingElem && onEdit([editingElem]);
295
+ }}
296
+ onEditEnd={onEditEnd}
297
+ deselectSchema={onEditEnd}
298
+ sidebarOpen={sidebarOpen}
299
+ setSidebarOpen={setSidebarOpen}
300
+ />
301
+
302
+ <Canvas
303
+ ref={canvasRef}
304
+ paperRefs={paperRefs}
305
+ basePdf={template.basePdf}
306
+ hoveringSchemaId={hoveringSchemaId}
307
+ onChangeHoveringSchemaId={onChangeHoveringSchemaId}
308
+ height={size.height - RULER_HEIGHT * ZOOM}
309
+ pageCursor={pageCursor}
310
+ scale={scale}
311
+ size={sizeExcSidebar}
312
+ pageSizes={pageSizes}
313
+ backgrounds={backgrounds}
314
+ activeElements={activeElements}
315
+ schemasList={schemasList}
316
+ changeSchemas={changeSchemas}
317
+ removeSchemas={removeSchemas}
318
+ sidebarOpen={sidebarOpen}
319
+ onEdit={onEdit}
320
+ />
321
+ </DndContext>
275
322
  </Root>
276
323
  );
277
324
  };
@@ -3,10 +3,11 @@ import { Dict, ZOOM, UIRenderProps, SchemaForUI, BasePdf, Schema } from '@pdfme/
3
3
  import { theme as antdTheme } from 'antd';
4
4
  import { SELECTABLE_CLASSNAME } from '../constants';
5
5
  import { PluginsRegistry, OptionsContext, I18nContext } from '../contexts';
6
+ import * as pdfJs from 'pdfjs-dist/legacy/build/pdf.js';
6
7
 
7
8
  type RendererProps = Omit<
8
9
  UIRenderProps<Schema>,
9
- 'schema' | 'rootElement' | 'options' | 'theme' | 'i18n' | '_cache'
10
+ 'schema' | 'rootElement' | 'options' | 'theme' | 'i18n' | 'pdfJs' | '_cache'
10
11
  > & {
11
12
  basePdf: BasePdf;
12
13
  schema: SchemaForUI;
@@ -84,6 +85,7 @@ Check this document: https://pdfme.com/docs/custom-schemas`);
84
85
  options,
85
86
  theme,
86
87
  i18n,
88
+ pdfJs,
87
89
  _cache: _cache.current,
88
90
  });
89
91
  }
package/src/constants.ts CHANGED
@@ -8,6 +8,6 @@ export const RULER_HEIGHT = 30;
8
8
 
9
9
  export const PAGE_GAP = 10;
10
10
 
11
- export const SIDEBAR_WIDTH = 400;
11
+ export const RIGHT_SIDEBAR_WIDTH = 400;
12
12
 
13
13
  export const BACKGROUND_COLOR = 'rgb(74, 74, 74)';
package/src/helper.ts CHANGED
@@ -417,7 +417,7 @@ export const getPagesScrollTopByIndex = (pageSizes: Size[], index: number, scale
417
417
  };
418
418
 
419
419
  export const getSidebarContentHeight = (sidebarHeight: number) =>
420
- sidebarHeight - RULER_HEIGHT - RULER_HEIGHT / 2 - 115;
420
+ sidebarHeight - RULER_HEIGHT - RULER_HEIGHT / 2 - 30;
421
421
 
422
422
  const handlePositionSizeChange = (
423
423
  schema: SchemaForUI,
package/src/i18n.ts CHANGED
@@ -16,7 +16,6 @@ const dictEn: { [key in keyof Dict]: string } = {
16
16
  notUniq: '(Not unique name)',
17
17
  noKeyName: 'No name',
18
18
  fieldsList: 'Field List',
19
- addNewField: 'Add new field',
20
19
  editField: 'Edit Field',
21
20
  type: 'Type',
22
21
  errorOccurred: 'An error occurred',
@@ -77,7 +76,6 @@ const dictJa: { [key in keyof Dict]: string } = {
77
76
  notUniq: '(他の項目名と重複しています)',
78
77
  noKeyName: '項目名なし',
79
78
  fieldsList: '入力項目一覧',
80
- addNewField: '入力項目を追加',
81
79
  editField: '入力項目を編集',
82
80
  type: 'タイプ',
83
81
  errorOccurred: 'エラーが発生しました',
@@ -137,7 +135,6 @@ const dictAr: { [key in keyof Dict]: string } = {
137
135
  notUniq: '(غير فريد)',
138
136
  noKeyName: 'لا يوجد اسم للحقل',
139
137
  fieldsList: 'قائمة الحقول',
140
- addNewField: 'إضافة حقل جديد',
141
138
  editField: 'تعديل الحقل',
142
139
  type: 'النوع',
143
140
  errorOccurred: 'حدث خطأ',
@@ -197,7 +194,6 @@ const dictTh: { [key in keyof Dict]: string } = {
197
194
  notUniq: '(ชื่อฟิลด์ซ้ำกัน)',
198
195
  noKeyName: 'ไม่มีชื่อ',
199
196
  fieldsList: 'รายการฟิลด์ทั้งหมด',
200
- addNewField: 'เพิ่มฟิลด์ใหม่',
201
197
  editField: 'แก้ไขฟิลด์',
202
198
  type: 'ประเภท',
203
199
  errorOccurred: 'เกิดข้อผิดพลาด',
@@ -257,7 +253,6 @@ const dictIt: { [key in keyof Dict]: string } = {
257
253
  notUniq: '(Nome non univoco)',
258
254
  noKeyName: 'Nessun nome',
259
255
  fieldsList: 'Lista campi',
260
- addNewField: 'Aggiungi un campo',
261
256
  editField: 'Modifica campo',
262
257
  type: 'Tipo',
263
258
  errorOccurred: 'Riscontrato errore',
@@ -319,7 +314,6 @@ const dictPl: { [key in keyof Dict]: string } = {
319
314
  notUniq: '(Klucz pola nie jest unikalny)',
320
315
  noKeyName: 'Brak nazwy klucza pola',
321
316
  fieldsList: 'Lista pól',
322
- addNewField: 'Dodaj nowe pole',
323
317
  editField: 'Edytuj pole',
324
318
  type: 'Typ pola',
325
319
  errorOccurred: 'Wystąpił błąd',
@@ -379,7 +373,6 @@ const dictDe: { [key in keyof Dict]: string } = {
379
373
  notUniq: '(Nicht eindeutiger Name)',
380
374
  noKeyName: 'Kein Name',
381
375
  fieldsList: 'Feldliste',
382
- addNewField: 'Neues Feld hinzufügen',
383
376
  editField: 'Feld bearbeiten',
384
377
  type: 'Typ',
385
378
  errorOccurred: 'Ein Fehler ist aufgetreten',
@@ -426,6 +419,126 @@ const dictDe: { [key in keyof Dict]: string } = {
426
419
  'schemas.table.columnStyle': 'Spaltenstil',
427
420
  };
428
421
 
422
+ const dictEs: { [key in keyof Dict]: string } = {
423
+ cancel: 'Cancelar',
424
+ field: 'campo',
425
+ fieldName: 'Nombre',
426
+ align: 'Alinear',
427
+ width: 'Anchura',
428
+ height: 'Altura',
429
+ opacity: 'Opacidad',
430
+ rotate: 'Rotar',
431
+ edit: 'Editar',
432
+ plsInputName: 'Introduce el nombre',
433
+ fieldMustUniq: 'El nombre del campo no es único',
434
+ notUniq: '(Nombre no único)',
435
+ noKeyName: 'Sin nombre',
436
+ fieldsList: 'Lista de campos',
437
+ editField: 'Editar campo',
438
+ type: 'Tipo',
439
+ errorOccurred: 'Ocurrió un error',
440
+ errorBulkUpdateFieldName:
441
+ 'No se puede confirmar el cambio porque el número de elementos ha cambiado.',
442
+ commitBulkUpdateFieldName: 'Confirmar cambios',
443
+ bulkUpdateFieldName: 'Actualizar en bloque el nombre de los campos',
444
+ addPageAfter: 'Insertar página',
445
+ removePage: 'Eliminar página actual',
446
+ removePageConfirm:
447
+ '¿Estás seguro de que quieres eliminar esta página? Esta acción no se puede deshacer.',
448
+ hexColorPrompt: 'Introduce un código de color hexadecimal válido.',
449
+ 'schemas.color': 'Color',
450
+ 'schemas.borderWidth': 'Ancho del borde',
451
+ 'schemas.borderColor': 'Color del borde',
452
+ 'schemas.backgroundColor': 'Color de fondo',
453
+ 'schemas.textColor': 'Color del texto',
454
+ 'schemas.bgColor': 'Color del fondo',
455
+ 'schemas.horizontal': 'Horizontal',
456
+ 'schemas.vertical': 'Vertical',
457
+ 'schemas.left': 'Izquierda',
458
+ 'schemas.center': 'Centro',
459
+ 'schemas.right': 'Derecha',
460
+ 'schemas.top': 'Arriba',
461
+ 'schemas.middle': 'Medio',
462
+ 'schemas.bottom': 'Abajo',
463
+ 'schemas.padding': 'Relleno',
464
+ 'schemas.text.fontName': 'Nombre de la fuente',
465
+ 'schemas.text.size': 'Tamaño',
466
+ 'schemas.text.spacing': 'Espaciado',
467
+ 'schemas.text.textAlign': 'Alineación del texto',
468
+ 'schemas.text.verticalAlign': 'Alineación vertical',
469
+ 'schemas.text.lineHeight': 'Altura de línea',
470
+ 'schemas.text.min': 'Mín',
471
+ 'schemas.text.max': 'Máx',
472
+ 'schemas.text.fit': 'Ajustar',
473
+ 'schemas.text.dynamicFontSize': 'Tamaño de fuente dinámico',
474
+ 'schemas.barcodes.barColor': 'Color de la barra',
475
+ 'schemas.barcodes.includetext': 'Incluir texto',
476
+ 'schemas.table.alternateBackgroundColor': 'Color de fondo alternativo',
477
+ 'schemas.table.tableStyle': 'Estilo de tabla',
478
+ 'schemas.table.headStyle': 'Estilo de cabecera',
479
+ 'schemas.table.bodyStyle': 'Estilo de cuerpo',
480
+ 'schemas.table.columnStyle': 'Estilo de columna',
481
+ };
482
+
483
+ const dictFr: { [key in keyof Dict]: string } = {
484
+ cancel: 'Annuler',
485
+ field: 'Champ',
486
+ fieldName: 'Nom',
487
+ align: 'Aligner',
488
+ width: 'Largeur',
489
+ height: 'Hauteur',
490
+ opacity: 'Opacité',
491
+ rotate: 'Rotation',
492
+ edit: 'Éditer',
493
+ plsInputName: 'Veuillez saisir le nom',
494
+ fieldMustUniq:"Le nom du champ n'est pas unique",
495
+ notUniq: '(Nombre non unique)',
496
+ noKeyName: 'Pas de nom',
497
+ fieldsList: 'Liste des champs',
498
+ editField: 'Éditer le champ',
499
+ type: 'Type',
500
+ errorOccurred:' Une erreur est survenue',
501
+ errorBulkUpdateFieldName: "Impossible de confirmer le changement car le nombre d'éléments a changé.",
502
+ commitBulkUpdateFieldName: 'Confirmer les changements',
503
+ bulkUpdateFieldName: 'Modifier les noms de champs en masse',
504
+ addPageAfter: 'Ajouter une page après',
505
+ removePage: 'Supprimer la page actuelle',
506
+ removePageConfirm: 'Êtes-vous sûr de vouloir supprimer cette page ? Cette action est irréversible.',
507
+ hexColorPrompt: 'Veuillez entrer un code couleur hexadécimal valide.',
508
+ 'schemas.color': 'Couleur',
509
+ 'schemas.borderWidth': 'Largeur de la bordure',
510
+ 'schemas.borderColor': 'Couleur de la bordure',
511
+ 'schemas.backgroundColor': 'Couleur de fond',
512
+ 'schemas.textColor': 'Couleur du texte',
513
+ 'schemas.bgColor': 'Couleur de fond',
514
+ 'schemas.horizontal': 'Horizontal',
515
+ 'schemas.vertical': 'Vertical',
516
+ 'schemas.left': 'Gauche',
517
+ 'schemas.center': 'Centre',
518
+ 'schemas.right': 'Droite',
519
+ 'schemas.top': 'Haut',
520
+ 'schemas.middle': 'Milieu',
521
+ 'schemas.bottom': 'Bas',
522
+ 'schemas.padding': 'Zone de remplissage',
523
+ 'schemas.text.fontName': 'Nom de la police',
524
+ 'schemas.text.size': 'Taille',
525
+ 'schemas.text.spacing': 'Espacement',
526
+ 'schemas.text.textAlign': 'Alignement du texte',
527
+ 'schemas.text.verticalAlign': 'Alignement vertical',
528
+ 'schemas.text.lineHeight': 'Hauteur de ligne',
529
+ 'schemas.text.min': 'Min',
530
+ 'schemas.text.max': 'Max',
531
+ 'schemas.text.fit': 'Ajustement',
532
+ 'schemas.text.dynamicFontSize': 'Taille de police dynamique',
533
+ 'schemas.barcodes.barColor': 'Couleur de la barre',
534
+ 'schemas.barcodes.includetext': 'Inclure le texte',
535
+ 'schemas.table.alternateBackgroundColor': 'Couleur de fond alternative',
536
+ 'schemas.table.tableStyle': 'Style de tableau',
537
+ 'schemas.table.headStyle': "Style d'en-tête",
538
+ 'schemas.table.bodyStyle': 'Style de corps',
539
+ 'schemas.table.columnStyle': 'Style de colonne'
540
+ };
541
+
429
542
  const dictionaries: { [key in Lang]: Dict } = {
430
543
  en: dictEn,
431
544
  ja: dictJa,
@@ -434,6 +547,8 @@ const dictionaries: { [key in Lang]: Dict } = {
434
547
  it: dictIt,
435
548
  pl: dictPl,
436
549
  de: dictDe,
550
+ es: dictEs,
551
+ fr: dictFr,
437
552
  };
438
553
 
439
554
  export const getDict = (lang: Lang): Dict => dictionaries[lang] || dictionaries[DEFAULT_LANG];
package/src/types.ts CHANGED
@@ -12,7 +12,6 @@ export type SidebarProps = {
12
12
  onEdit: (id: string) => void;
13
13
  onEditEnd: () => void;
14
14
  changeSchemas: ChangeSchemas;
15
- addSchema: () => void;
16
15
  deselectSchema: () => void;
17
16
  sidebarOpen: boolean;
18
17
  setSidebarOpen: (sidebarOpen: boolean) => void;