@pdfme/ui 1.0.18 → 1.1.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/dist/cjs/__tests__/assets/helper.js +79 -0
- package/dist/cjs/__tests__/assets/helper.js.map +1 -0
- package/dist/cjs/__tests__/components/Designer.test.js +39 -0
- package/dist/cjs/__tests__/components/Designer.test.js.map +1 -0
- package/dist/cjs/__tests__/components/Preview.test.js +51 -0
- package/dist/cjs/__tests__/components/Preview.test.js.map +1 -0
- package/dist/cjs/__tests__/helper.test.js +94 -0
- package/dist/cjs/__tests__/helper.test.js.map +1 -0
- package/dist/cjs/src/Designer.js +62 -0
- package/dist/cjs/src/Designer.js.map +1 -0
- package/dist/cjs/src/Form.js +36 -0
- package/dist/cjs/src/Form.js.map +1 -0
- package/dist/cjs/src/Viewer.js +26 -0
- package/dist/cjs/src/Viewer.js.map +1 -0
- package/dist/cjs/src/class.js +120 -0
- package/dist/cjs/src/class.js.map +1 -0
- package/dist/cjs/src/components/CtlBar/Pager.js +49 -0
- package/dist/cjs/src/components/CtlBar/Pager.js.map +1 -0
- package/dist/cjs/src/components/CtlBar/Zoom.js +31 -0
- package/dist/cjs/src/components/CtlBar/Zoom.js.map +1 -0
- package/dist/cjs/src/components/CtlBar/index.js +33 -0
- package/dist/cjs/src/components/CtlBar/index.js.map +1 -0
- package/dist/cjs/src/components/Designer/Main/Guides.js +33 -0
- package/dist/cjs/src/components/Designer/Main/Guides.js.map +1 -0
- package/dist/cjs/src/components/Designer/Main/Mask.js +18 -0
- package/dist/cjs/src/components/Designer/Main/Mask.js.map +1 -0
- package/dist/cjs/src/components/Designer/Main/Moveable.js +37 -0
- package/dist/cjs/src/components/Designer/Main/Moveable.js.map +1 -0
- package/dist/cjs/src/components/Designer/Main/Selecto.js +11 -0
- package/dist/cjs/src/components/Designer/Main/Selecto.js.map +1 -0
- package/dist/cjs/src/components/Designer/Main/index.js +224 -0
- package/dist/cjs/src/components/Designer/Main/index.js.map +1 -0
- package/dist/cjs/src/components/Designer/Sidebar/DetailView/ExampleInputEditor.js +69 -0
- package/dist/cjs/src/components/Designer/Sidebar/DetailView/ExampleInputEditor.js.map +1 -0
- package/dist/cjs/src/components/Designer/Sidebar/DetailView/PositionAndSizeEditor.js +184 -0
- package/dist/cjs/src/components/Designer/Sidebar/DetailView/PositionAndSizeEditor.js.map +1 -0
- package/dist/cjs/src/components/Designer/Sidebar/DetailView/TextPropEditor.js +116 -0
- package/dist/cjs/src/components/Designer/Sidebar/DetailView/TextPropEditor.js.map +1 -0
- package/dist/cjs/src/components/Designer/Sidebar/DetailView/TypeAndKeyEditor.js +72 -0
- package/dist/cjs/src/components/Designer/Sidebar/DetailView/TypeAndKeyEditor.js.map +1 -0
- package/dist/cjs/src/components/Designer/Sidebar/DetailView/index.js +54 -0
- package/dist/cjs/src/components/Designer/Sidebar/DetailView/index.js.map +1 -0
- package/dist/cjs/src/components/Designer/Sidebar/ListView/Item.js +76 -0
- package/dist/cjs/src/components/Designer/Sidebar/ListView/Item.js.map +1 -0
- package/dist/cjs/src/components/Designer/Sidebar/ListView/SelectableSortableContainer.js +108 -0
- package/dist/cjs/src/components/Designer/Sidebar/ListView/SelectableSortableContainer.js.map +1 -0
- package/dist/cjs/src/components/Designer/Sidebar/ListView/SelectableSortableItem.js +62 -0
- package/dist/cjs/src/components/Designer/Sidebar/ListView/SelectableSortableItem.js.map +1 -0
- package/dist/cjs/src/components/Designer/Sidebar/ListView/index.js +84 -0
- package/dist/cjs/src/components/Designer/Sidebar/ListView/index.js.map +1 -0
- package/dist/cjs/src/components/Designer/Sidebar/index.js +105 -0
- package/dist/cjs/src/components/Designer/Sidebar/index.js.map +1 -0
- package/dist/cjs/src/components/Designer/index.js +235 -0
- package/dist/cjs/src/components/Designer/index.js.map +1 -0
- package/dist/cjs/src/components/Divider.js +9 -0
- package/dist/cjs/src/components/Divider.js.map +1 -0
- package/dist/cjs/src/components/Error.js +41 -0
- package/dist/cjs/src/components/Error.js.map +1 -0
- package/dist/cjs/src/components/Paper.js +63 -0
- package/dist/cjs/src/components/Paper.js.map +1 -0
- package/dist/cjs/src/components/Preview.js +102 -0
- package/dist/cjs/src/components/Preview.js.map +1 -0
- package/dist/cjs/src/components/Root.js +52 -0
- package/dist/cjs/src/components/Root.js.map +1 -0
- package/dist/cjs/src/components/Schemas/BarcodeSchema.js +94 -0
- package/dist/cjs/src/components/Schemas/BarcodeSchema.js.map +1 -0
- package/dist/cjs/src/components/Schemas/ImageSchema.js +72 -0
- package/dist/cjs/src/components/Schemas/ImageSchema.js.map +1 -0
- package/dist/cjs/src/components/Schemas/SchemaUI.js +55 -0
- package/dist/cjs/src/components/Schemas/SchemaUI.js.map +1 -0
- package/dist/cjs/src/components/Schemas/TextSchema.js +54 -0
- package/dist/cjs/src/components/Schemas/TextSchema.js.map +1 -0
- package/dist/cjs/src/components/Spinner.js +31 -0
- package/dist/cjs/src/components/Spinner.js.map +1 -0
- package/dist/cjs/src/components/UnitPager.js +63 -0
- package/dist/cjs/src/components/UnitPager.js.map +1 -0
- package/dist/cjs/src/constants.js +10 -0
- package/dist/cjs/src/constants.js.map +1 -0
- package/dist/cjs/src/contexts.js +10 -0
- package/dist/cjs/src/contexts.js.map +1 -0
- package/dist/cjs/src/helper.js +466 -0
- package/dist/cjs/src/helper.js.map +1 -0
- package/dist/cjs/src/hooks.js +100 -0
- package/dist/cjs/src/hooks.js.map +1 -0
- package/dist/cjs/src/i18n.js +50 -0
- package/dist/cjs/src/i18n.js.map +1 -0
- package/dist/cjs/src/index.js +24 -0
- package/dist/cjs/src/index.js.map +1 -0
- package/dist/esm/__tests__/assets/helper.js +51 -0
- package/dist/esm/__tests__/assets/helper.js.map +1 -0
- package/dist/esm/__tests__/components/Designer.test.js +34 -0
- package/dist/esm/__tests__/components/Designer.test.js.map +1 -0
- package/dist/esm/__tests__/components/Preview.test.js +46 -0
- package/dist/esm/__tests__/components/Preview.test.js.map +1 -0
- package/dist/esm/__tests__/helper.test.js +92 -0
- package/dist/esm/__tests__/helper.test.js.map +1 -0
- package/dist/esm/src/Designer.js +57 -0
- package/dist/esm/src/Designer.js.map +1 -0
- package/dist/esm/src/Form.js +31 -0
- package/dist/esm/src/Form.js.map +1 -0
- package/dist/esm/src/Viewer.js +21 -0
- package/dist/esm/src/Viewer.js.map +1 -0
- package/dist/esm/src/class.js +112 -0
- package/dist/esm/src/class.js.map +1 -0
- package/dist/esm/src/components/CtlBar/Pager.js +24 -0
- package/dist/esm/src/components/CtlBar/Pager.js.map +1 -0
- package/dist/esm/src/components/CtlBar/Zoom.js +26 -0
- package/dist/esm/src/components/CtlBar/Zoom.js.map +1 -0
- package/dist/esm/src/components/CtlBar/index.js +28 -0
- package/dist/esm/src/components/CtlBar/index.js.map +1 -0
- package/dist/esm/src/components/Designer/Main/Guides.js +28 -0
- package/dist/esm/src/components/Designer/Main/Guides.js.map +1 -0
- package/dist/esm/src/components/Designer/Main/Mask.js +13 -0
- package/dist/esm/src/components/Designer/Main/Mask.js.map +1 -0
- package/dist/esm/src/components/Designer/Main/Moveable.js +9 -0
- package/dist/esm/src/components/Designer/Main/Moveable.js.map +1 -0
- package/dist/esm/src/components/Designer/Main/Selecto.js +6 -0
- package/dist/esm/src/components/Designer/Main/Selecto.js.map +1 -0
- package/dist/esm/src/components/Designer/Main/index.js +196 -0
- package/dist/esm/src/components/Designer/Main/index.js.map +1 -0
- package/dist/esm/src/components/Designer/Sidebar/DetailView/ExampleInputEditor.js +44 -0
- package/dist/esm/src/components/Designer/Sidebar/DetailView/ExampleInputEditor.js.map +1 -0
- package/dist/esm/src/components/Designer/Sidebar/DetailView/PositionAndSizeEditor.js +179 -0
- package/dist/esm/src/components/Designer/Sidebar/DetailView/PositionAndSizeEditor.js.map +1 -0
- package/dist/esm/src/components/Designer/Sidebar/DetailView/TextPropEditor.js +91 -0
- package/dist/esm/src/components/Designer/Sidebar/DetailView/TextPropEditor.js.map +1 -0
- package/dist/esm/src/components/Designer/Sidebar/DetailView/TypeAndKeyEditor.js +47 -0
- package/dist/esm/src/components/Designer/Sidebar/DetailView/TypeAndKeyEditor.js.map +1 -0
- package/dist/esm/src/components/Designer/Sidebar/DetailView/index.js +26 -0
- package/dist/esm/src/components/Designer/Sidebar/DetailView/index.js.map +1 -0
- package/dist/esm/src/components/Designer/Sidebar/ListView/Item.js +51 -0
- package/dist/esm/src/components/Designer/Sidebar/ListView/Item.js.map +1 -0
- package/dist/esm/src/components/Designer/Sidebar/ListView/SelectableSortableContainer.js +80 -0
- package/dist/esm/src/components/Designer/Sidebar/ListView/SelectableSortableContainer.js.map +1 -0
- package/dist/esm/src/components/Designer/Sidebar/ListView/SelectableSortableItem.js +34 -0
- package/dist/esm/src/components/Designer/Sidebar/ListView/SelectableSortableItem.js.map +1 -0
- package/dist/esm/src/components/Designer/Sidebar/ListView/index.js +56 -0
- package/dist/esm/src/components/Designer/Sidebar/ListView/index.js.map +1 -0
- package/dist/esm/src/components/Designer/Sidebar/index.js +77 -0
- package/dist/esm/src/components/Designer/Sidebar/index.js.map +1 -0
- package/dist/esm/src/components/Designer/index.js +207 -0
- package/dist/esm/src/components/Designer/index.js.map +1 -0
- package/dist/esm/src/components/Divider.js +4 -0
- package/dist/esm/src/components/Divider.js.map +1 -0
- package/dist/esm/src/components/Error.js +16 -0
- package/dist/esm/src/components/Error.js.map +1 -0
- package/dist/esm/src/components/Paper.js +38 -0
- package/dist/esm/src/components/Paper.js.map +1 -0
- package/dist/esm/src/components/Preview.js +74 -0
- package/dist/esm/src/components/Preview.js.map +1 -0
- package/dist/esm/src/components/Root.js +24 -0
- package/dist/esm/src/components/Root.js.map +1 -0
- package/dist/esm/src/components/Schemas/BarcodeSchema.js +69 -0
- package/dist/esm/src/components/Schemas/BarcodeSchema.js.map +1 -0
- package/dist/esm/src/components/Schemas/ImageSchema.js +47 -0
- package/dist/esm/src/components/Schemas/ImageSchema.js.map +1 -0
- package/dist/esm/src/components/Schemas/SchemaUI.js +27 -0
- package/dist/esm/src/components/Schemas/SchemaUI.js.map +1 -0
- package/dist/esm/src/components/Schemas/TextSchema.js +29 -0
- package/dist/esm/src/components/Schemas/TextSchema.js.map +1 -0
- package/dist/esm/src/components/Spinner.js +26 -0
- package/dist/esm/src/components/Spinner.js.map +1 -0
- package/dist/esm/src/components/UnitPager.js +58 -0
- package/dist/esm/src/components/UnitPager.js.map +1 -0
- package/dist/esm/src/constants.js +7 -0
- package/dist/esm/src/constants.js.map +1 -0
- package/dist/esm/src/contexts.js +7 -0
- package/dist/esm/src/contexts.js.map +1 -0
- package/dist/esm/src/helper.js +439 -0
- package/dist/esm/src/helper.js.map +1 -0
- package/dist/esm/src/hooks.js +93 -0
- package/dist/esm/src/hooks.js.map +1 -0
- package/dist/esm/src/i18n.js +46 -0
- package/dist/esm/src/i18n.js.map +1 -0
- package/dist/esm/src/index.js +6 -0
- package/dist/esm/src/index.js.map +1 -0
- package/dist/types/__tests__/assets/helper.d.ts +3 -0
- package/dist/types/__tests__/components/Designer.test.d.ts +1 -0
- package/dist/types/__tests__/components/Preview.test.d.ts +1 -0
- package/dist/types/__tests__/helper.test.d.ts +1 -0
- package/dist/types/{Designer.d.ts → src/Designer.d.ts} +1 -1
- package/dist/types/{Form.d.ts → src/Form.d.ts} +1 -1
- package/dist/types/{Viewer.d.ts → src/Viewer.d.ts} +1 -1
- package/dist/types/{class.d.ts → src/class.d.ts} +12 -12
- package/dist/types/{components → src/components}/CtlBar/Pager.d.ts +1 -0
- package/dist/types/{components → src/components}/CtlBar/Zoom.d.ts +1 -0
- package/dist/types/{components → src/components}/CtlBar/index.d.ts +1 -0
- package/dist/types/{components → src/components}/Designer/Main/Guides.d.ts +0 -0
- package/dist/types/{components → src/components}/Designer/Main/Mask.d.ts +1 -0
- package/dist/types/{components → src/components}/Designer/Main/Moveable.d.ts +0 -0
- package/dist/types/{components → src/components}/Designer/Main/Selecto.d.ts +1 -0
- package/dist/types/{components → src/components}/Designer/Main/index.d.ts +0 -0
- package/dist/types/{components → src/components}/Designer/Sidebar/DetailView/ExampleInputEditor.d.ts +1 -0
- package/dist/types/{components → src/components}/Designer/Sidebar/DetailView/PositionAndSizeEditor.d.ts +2 -1
- package/dist/types/{components → src/components}/Designer/Sidebar/DetailView/TextPropEditor.d.ts +1 -0
- package/dist/types/{components → src/components}/Designer/Sidebar/DetailView/TypeAndKeyEditor.d.ts +2 -1
- package/dist/types/{components → src/components}/Designer/Sidebar/DetailView/index.d.ts +2 -1
- package/dist/types/{components → src/components}/Designer/Sidebar/ListView/Item.d.ts +0 -0
- package/dist/types/{components → src/components}/Designer/Sidebar/ListView/SelectableSortableContainer.d.ts +2 -1
- package/dist/types/{components → src/components}/Designer/Sidebar/ListView/SelectableSortableItem.d.ts +0 -0
- package/dist/types/{components → src/components}/Designer/Sidebar/ListView/index.d.ts +2 -1
- package/dist/types/{components → src/components}/Designer/Sidebar/index.d.ts +1 -0
- package/dist/types/{components → src/components}/Designer/index.d.ts +24 -23
- package/dist/types/{components → src/components}/Divider.d.ts +1 -0
- package/dist/types/{components → src/components}/Error.d.ts +1 -0
- package/dist/types/{components → src/components}/Paper.d.ts +0 -0
- package/dist/types/{components → src/components}/Preview.d.ts +1 -0
- package/dist/types/{components → src/components}/Root.d.ts +0 -0
- package/dist/types/{components → src/components}/Schemas/BarcodeSchema.d.ts +3 -3
- package/dist/types/{components → src/components}/Schemas/ImageSchema.d.ts +3 -3
- package/dist/types/{components → src/components}/Schemas/SchemaUI.d.ts +1 -1
- package/dist/types/{components → src/components}/Schemas/TextSchema.d.ts +7 -7
- package/dist/types/{components → src/components}/Spinner.d.ts +1 -0
- package/dist/types/{components → src/components}/UnitPager.d.ts +1 -0
- package/dist/types/{constants.d.ts → src/constants.d.ts} +0 -0
- package/dist/types/src/contexts.d.ts +7 -0
- package/dist/types/{helper.d.ts → src/helper.d.ts} +19 -19
- package/dist/types/{hooks.d.ts → src/hooks.d.ts} +1 -1
- package/dist/types/{i18n.d.ts → src/i18n.d.ts} +0 -9
- package/dist/types/{index.d.ts → src/index.d.ts} +3 -3
- package/package.json +19 -9
- package/src/Designer.tsx +5 -5
- package/src/Form.tsx +4 -4
- package/src/Viewer.tsx +4 -4
- package/src/class.ts +3 -3
- package/src/components/CtlBar/Pager.tsx +4 -5
- package/src/components/CtlBar/Zoom.tsx +4 -7
- package/src/components/CtlBar/index.tsx +2 -2
- package/src/components/Designer/Main/Guides.tsx +1 -1
- package/src/components/Designer/Main/Mask.tsx +1 -1
- package/src/components/Designer/Main/Selecto.tsx +1 -1
- package/src/components/Designer/Main/index.tsx +9 -9
- package/src/components/Designer/Sidebar/DetailView/ExampleInputEditor.tsx +4 -4
- package/src/components/Designer/Sidebar/DetailView/PositionAndSizeEditor.tsx +95 -19
- package/src/components/Designer/Sidebar/DetailView/TextPropEditor.tsx +3 -3
- package/src/components/Designer/Sidebar/DetailView/TypeAndKeyEditor.tsx +2 -2
- package/src/components/Designer/Sidebar/DetailView/index.tsx +7 -7
- package/src/components/Designer/Sidebar/ListView/Item.tsx +8 -10
- package/src/components/Designer/Sidebar/ListView/SelectableSortableContainer.tsx +3 -3
- package/src/components/Designer/Sidebar/ListView/SelectableSortableItem.tsx +3 -3
- package/src/components/Designer/Sidebar/ListView/index.tsx +5 -5
- package/src/components/Designer/Sidebar/index.tsx +11 -7
- package/src/components/Designer/index.tsx +9 -9
- package/src/components/Error.tsx +1 -1
- package/src/components/Paper.tsx +2 -2
- package/src/components/Preview.tsx +9 -9
- package/src/components/Root.tsx +2 -3
- package/src/components/Schemas/BarcodeSchema.tsx +18 -22
- package/src/components/Schemas/ImageSchema.tsx +6 -6
- package/src/components/Schemas/SchemaUI.tsx +4 -4
- package/src/components/Schemas/TextSchema.tsx +2 -2
- package/src/components/UnitPager.tsx +11 -12
- package/src/contexts.ts +2 -2
- package/src/helper.ts +2 -2
- package/src/hooks.ts +2 -2
- package/src/i18n.ts +1 -19
- package/src/index.ts +3 -3
- package/tsconfig.cjs.json +10 -0
- package/tsconfig.esm.json +10 -0
- package/declaration.d.ts +0 -8
- package/dist/index.js +0 -3
- package/dist/index.js.LICENSE.txt +0 -97
- package/dist/index.js.map +0 -1
- package/dist/types/contexts.d.ts +0 -7
- package/src/assets/barcodeExamples/code128.png +0 -0
- package/src/assets/barcodeExamples/code39.png +0 -0
- package/src/assets/barcodeExamples/ean13.png +0 -0
- package/src/assets/barcodeExamples/ean8.png +0 -0
- package/src/assets/barcodeExamples/itf14.png +0 -0
- package/src/assets/barcodeExamples/japanpost.png +0 -0
- package/src/assets/barcodeExamples/nw7.png +0 -0
- package/src/assets/barcodeExamples/qrcode.png +0 -0
- package/src/assets/barcodeExamples/upca.png +0 -0
- package/src/assets/barcodeExamples/upce.png +0 -0
- package/src/assets/icons/add.svg +0 -3
- package/src/assets/icons/align-horizontal-center.svg +0 -1
- package/src/assets/icons/align-horizontal-left.svg +0 -1
- package/src/assets/icons/align-horizontal-right.svg +0 -1
- package/src/assets/icons/align-vertical-bottom.svg +0 -1
- package/src/assets/icons/align-vertical-middle.svg +0 -1
- package/src/assets/icons/align-vertical-top.svg +0 -1
- package/src/assets/icons/back.svg +0 -4
- package/src/assets/icons/close.svg +0 -4
- package/src/assets/icons/double-left.svg +0 -11
- package/src/assets/icons/double-right.svg +0 -11
- package/src/assets/icons/drag.svg +0 -3
- package/src/assets/icons/forward.svg +0 -4
- package/src/assets/icons/horizontal-distribute.svg +0 -1
- package/src/assets/icons/left.svg +0 -4
- package/src/assets/icons/remove.svg +0 -3
- package/src/assets/icons/right.svg +0 -4
- package/src/assets/icons/vertical-distribute.svg +0 -1
- package/src/assets/icons/warning.svg +0 -4
- package/src/assets/imageExample.png +0 -0
- package/tsconfig.json +0 -22
- package/webpack.config.js +0 -54
File without changes
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export declare const I18nContext: import("react").Context<(key: "type" | "require" | "cancel" | "field" | "fieldName" | "uniq" | "inputExample" | "edit" | "plsInputName" | "fieldMustUniq" | "notUniq" | "noKeyName" | "fieldsList" | "addNewField" | "editField" | "errorOccurred" | "errorBulkUpdateFieldName" | "commitBulkUpdateFieldName" | "bulkUpdateFieldName") => string>;
|
3
|
+
export declare const FontContext: import("react").Context<Record<string, {
|
4
|
+
fallback?: boolean | undefined;
|
5
|
+
subset?: boolean | undefined;
|
6
|
+
data: ArrayBuffer | Uint8Array;
|
7
|
+
}>>;
|
@@ -27,48 +27,48 @@ export declare const getPdfPageSizes: (pdfBlob: Blob) => Promise<{
|
|
27
27
|
export declare const pdf2Pngs: (pdfBlob: Blob, width: number) => Promise<string[]>;
|
28
28
|
export declare const b64toBlob: (base64: string) => Blob;
|
29
29
|
export declare const templateSchemas2SchemasList: (_template: Template) => Promise<({
|
30
|
-
|
31
|
-
alignment?: "left" | "center" | "right" | undefined;
|
30
|
+
backgroundColor?: string | undefined;
|
32
31
|
fontSize?: number | undefined;
|
32
|
+
lineHeight?: number | undefined;
|
33
|
+
rotate?: number | undefined;
|
34
|
+
alignment?: "center" | "left" | "right" | undefined;
|
33
35
|
fontName?: string | undefined;
|
34
36
|
fontColor?: string | undefined;
|
35
|
-
backgroundColor?: string | undefined;
|
36
37
|
characterSpacing?: number | undefined;
|
37
|
-
lineHeight?: number | undefined;
|
38
38
|
type: "text";
|
39
|
+
data: string;
|
40
|
+
key: string;
|
41
|
+
id: string;
|
42
|
+
height: number;
|
43
|
+
width: number;
|
39
44
|
position: {
|
40
45
|
x: number;
|
41
46
|
y: number;
|
42
47
|
};
|
43
|
-
data: string;
|
44
|
-
width: number;
|
45
|
-
height: number;
|
46
|
-
id: string;
|
47
|
-
key: string;
|
48
48
|
} | {
|
49
49
|
rotate?: number | undefined;
|
50
50
|
type: "image";
|
51
|
+
data: string;
|
52
|
+
key: string;
|
53
|
+
id: string;
|
54
|
+
height: number;
|
55
|
+
width: number;
|
51
56
|
position: {
|
52
57
|
x: number;
|
53
58
|
y: number;
|
54
59
|
};
|
55
|
-
data: string;
|
56
|
-
width: number;
|
57
|
-
height: number;
|
58
|
-
id: string;
|
59
|
-
key: string;
|
60
60
|
} | {
|
61
61
|
rotate?: number | undefined;
|
62
62
|
type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce";
|
63
|
+
data: string;
|
64
|
+
key: string;
|
65
|
+
id: string;
|
66
|
+
height: number;
|
67
|
+
width: number;
|
63
68
|
position: {
|
64
69
|
x: number;
|
65
70
|
y: number;
|
66
71
|
};
|
67
|
-
data: string;
|
68
|
-
width: number;
|
69
|
-
height: number;
|
70
|
-
id: string;
|
71
|
-
key: string;
|
72
72
|
})[][]>;
|
73
73
|
export declare const fmtTemplate: (template: Template, schemasList: SchemaForUI[][]) => Template;
|
74
74
|
export declare const getInitialSchema: () => SchemaForUI;
|
@@ -9,8 +9,8 @@ declare type UIPreProcessorProps = {
|
|
9
9
|
export declare const useUIPreProcessor: ({ template, size, zoomLevel }: UIPreProcessorProps) => {
|
10
10
|
backgrounds: string[];
|
11
11
|
pageSizes: {
|
12
|
-
width: number;
|
13
12
|
height: number;
|
13
|
+
width: number;
|
14
14
|
}[];
|
15
15
|
scale: number;
|
16
16
|
error: Error | null;
|
@@ -8,9 +8,7 @@ declare const dictEn: {
|
|
8
8
|
uniq: string;
|
9
9
|
inputExample: string;
|
10
10
|
edit: string;
|
11
|
-
plsSelect: string;
|
12
11
|
plsInputName: string;
|
13
|
-
plsAddNewField: string;
|
14
12
|
fieldMustUniq: string;
|
15
13
|
notUniq: string;
|
16
14
|
noKeyName: string;
|
@@ -18,13 +16,6 @@ declare const dictEn: {
|
|
18
16
|
addNewField: string;
|
19
17
|
editField: string;
|
20
18
|
type: string;
|
21
|
-
goToFirst: string;
|
22
|
-
goToPrevious: string;
|
23
|
-
goToNext: string;
|
24
|
-
goToEnd: string;
|
25
|
-
select: string;
|
26
|
-
zoomIn: string;
|
27
|
-
zoomOut: string;
|
28
19
|
errorOccurred: string;
|
29
20
|
errorBulkUpdateFieldName: string;
|
30
21
|
commitBulkUpdateFieldName: string;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import Designer from './Designer';
|
2
|
-
import Form from './Form';
|
3
|
-
import Viewer from './Viewer';
|
1
|
+
import Designer from './Designer.js';
|
2
|
+
import Form from './Form.js';
|
3
|
+
import Viewer from './Viewer.js';
|
4
4
|
export { Designer, Viewer, Form };
|
5
5
|
export type { Lang, Size, Alignment, SchemaType, BarCodeType, TextSchema, ImageSchema, BarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps, } from '@pdfme/common';
|
6
6
|
export { BLANK_PDF, isTextSchema, isImageSchema, isBarcodeSchema, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, } from '@pdfme/common';
|
package/package.json
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pdfme/ui",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.1.1",
|
4
|
+
"sideEffects": false,
|
4
5
|
"author": "hand-dot",
|
5
6
|
"license": "MIT",
|
6
7
|
"keywords": [
|
@@ -20,15 +21,23 @@
|
|
20
21
|
"bugs": {
|
21
22
|
"url": "https://github.com/pdfme/pdfme/issues"
|
22
23
|
},
|
23
|
-
"main": "dist/index.js",
|
24
|
-
"module": "dist/index.js",
|
25
|
-
"types": "dist/types/index.d.ts",
|
24
|
+
"main": "dist/cjs/src/index.js",
|
25
|
+
"module": "dist/esm/src/index.js",
|
26
|
+
"types": "dist/types/src/index.d.ts",
|
27
|
+
"exports": {
|
28
|
+
".": {
|
29
|
+
"import": "./dist/esm/src/index.js",
|
30
|
+
"require": "./dist/cjs/src/index.js"
|
31
|
+
}
|
32
|
+
},
|
26
33
|
"engines": {
|
27
34
|
"node": ">=14"
|
28
35
|
},
|
29
36
|
"scripts": {
|
30
|
-
"develop": "
|
31
|
-
"build": "
|
37
|
+
"develop": "tsc -w",
|
38
|
+
"build": "npm run build:cjs && npm run build:esm",
|
39
|
+
"build:cjs": "tsc -p tsconfig.cjs.json",
|
40
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
32
41
|
"clean": "rimraf dist",
|
33
42
|
"lint": "tsc --noEmit",
|
34
43
|
"test": "jest",
|
@@ -39,6 +48,7 @@
|
|
39
48
|
"dependencies": {
|
40
49
|
"@dnd-kit/core": "^5.0.1",
|
41
50
|
"@dnd-kit/sortable": "^6.0.0",
|
51
|
+
"@heroicons/react": "^2.0.13",
|
42
52
|
"@pdfme/common": "^1.0.0",
|
43
53
|
"@scena/react-guides": "^0.16.0",
|
44
54
|
"hotkeys-js": "^3.8.7",
|
@@ -66,9 +76,9 @@
|
|
66
76
|
"jest-canvas-mock"
|
67
77
|
],
|
68
78
|
"moduleNameMapper": {
|
69
|
-
"\\.(png
|
70
|
-
"\\.(ttf)$": "<rootDir>/../../fontTransformer.js"
|
79
|
+
"\\.(png)$": "<rootDir>/../../assetsTransformer.js"
|
71
80
|
},
|
81
|
+
"resolver": "ts-jest-resolver",
|
72
82
|
"moduleFileExtensions": [
|
73
83
|
"js",
|
74
84
|
"ts",
|
@@ -80,7 +90,7 @@
|
|
80
90
|
},
|
81
91
|
"globals": {
|
82
92
|
"ts-jest": {
|
83
|
-
"tsconfig": "tsconfig.json"
|
93
|
+
"tsconfig": "tsconfig.esm.json"
|
84
94
|
}
|
85
95
|
},
|
86
96
|
"testMatch": [
|
package/src/Designer.tsx
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import ReactDOM from 'react-dom';
|
3
3
|
import { Template, DesignerProps, checkDesignerProps, checkTemplate } from '@pdfme/common';
|
4
|
-
import { BaseUIClass } from './class';
|
5
|
-
import { DESTROYED_ERR_MSG } from './constants';
|
6
|
-
import { I18nContext, FontContext } from './contexts';
|
7
|
-
import DesignerComponent from './components/Designer';
|
8
|
-
import { cloneDeep } from './helper';
|
4
|
+
import { BaseUIClass } from './class.js';
|
5
|
+
import { DESTROYED_ERR_MSG } from './constants.js';
|
6
|
+
import { I18nContext, FontContext } from './contexts.js';
|
7
|
+
import DesignerComponent from './components/Designer/index.js';
|
8
|
+
import { cloneDeep } from './helper.js';
|
9
9
|
|
10
10
|
class Designer extends BaseUIClass {
|
11
11
|
private onSaveTemplateCallback?: (template: Template) => void;
|
package/src/Form.tsx
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import ReactDOM from 'react-dom';
|
3
3
|
import { PreviewProps } from '@pdfme/common';
|
4
|
-
import { PreviewUI } from './class';
|
5
|
-
import { DESTROYED_ERR_MSG } from './constants';
|
6
|
-
import { I18nContext, FontContext } from './contexts';
|
7
|
-
import Preview from './components/Preview';
|
4
|
+
import { PreviewUI } from './class.js';
|
5
|
+
import { DESTROYED_ERR_MSG } from './constants.js';
|
6
|
+
import { I18nContext, FontContext } from './contexts.js';
|
7
|
+
import Preview from './components/Preview.js';
|
8
8
|
|
9
9
|
class Form extends PreviewUI {
|
10
10
|
private onChangeInputCallback?: (arg: { index: number; value: string; key: string }) => void;
|
package/src/Viewer.tsx
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import ReactDOM from 'react-dom';
|
3
3
|
import { PreviewProps } from '@pdfme/common';
|
4
|
-
import { PreviewUI } from './class';
|
5
|
-
import { DESTROYED_ERR_MSG } from './constants';
|
6
|
-
import { I18nContext, FontContext } from './contexts';
|
7
|
-
import Preview from './components/Preview';
|
4
|
+
import { PreviewUI } from './class.js';
|
5
|
+
import { DESTROYED_ERR_MSG } from './constants.js';
|
6
|
+
import { I18nContext, FontContext } from './contexts.js';
|
7
|
+
import Preview from './components/Preview.js';
|
8
8
|
|
9
9
|
class Viewer extends PreviewUI {
|
10
10
|
constructor(props: PreviewProps) {
|
package/src/class.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import ReactDOM from 'react-dom';
|
2
|
-
import { curriedI18n } from './i18n';
|
3
|
-
import { DESTROYED_ERR_MSG, DEFAULT_LANG } from './constants';
|
4
|
-
import { debounce, flatten, cloneDeep } from './helper';
|
2
|
+
import { curriedI18n } from './i18n.js';
|
3
|
+
import { DESTROYED_ERR_MSG, DEFAULT_LANG } from './constants.js';
|
4
|
+
import { debounce, flatten, cloneDeep } from './helper.js';
|
5
5
|
import {
|
6
6
|
Template,
|
7
7
|
Size,
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React, { useContext } from 'react';
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import { I18nContext } from '../../contexts';
|
2
|
+
import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/24/outline';
|
3
|
+
import { I18nContext } from '../../contexts.js';
|
5
4
|
|
6
5
|
const btnStyle: React.CSSProperties = {
|
7
6
|
cursor: 'pointer',
|
@@ -31,7 +30,7 @@ const Pager = ({ pageCursor, pageNum, setPageCursor }: Props) => {
|
|
31
30
|
disabled={pageCursor <= 0}
|
32
31
|
onClick={() => setPageCursor(pageCursor - 1)}
|
33
32
|
>
|
34
|
-
<
|
33
|
+
<ChevronLeftIcon width={20} height={20} color={'#fff'} />
|
35
34
|
</button>
|
36
35
|
<strong style={{ color: 'white', fontSize: '0.9rem', minWidth: 45, textAlign: 'center' }}>
|
37
36
|
{pageCursor + 1}/{pageNum}
|
@@ -45,7 +44,7 @@ const Pager = ({ pageCursor, pageNum, setPageCursor }: Props) => {
|
|
45
44
|
disabled={pageCursor + 1 >= pageNum}
|
46
45
|
onClick={() => setPageCursor(pageCursor + 1)}
|
47
46
|
>
|
48
|
-
<
|
47
|
+
<ChevronRightIcon width={20} height={20} color={'#fff'} />
|
49
48
|
</button>
|
50
49
|
</div>
|
51
50
|
);
|
@@ -1,7 +1,5 @@
|
|
1
|
-
import React
|
2
|
-
import {
|
3
|
-
import add from '../../assets/icons/add.svg';
|
4
|
-
import remove from '../../assets/icons/remove.svg';
|
1
|
+
import React from 'react';
|
2
|
+
import { MinusIcon, PlusIcon } from '@heroicons/react/24/outline';
|
5
3
|
|
6
4
|
const btnStyle: React.CSSProperties = {
|
7
5
|
cursor: 'pointer',
|
@@ -21,7 +19,6 @@ type Props = {
|
|
21
19
|
};
|
22
20
|
|
23
21
|
const Pager = ({ zoomLevel, setZoomLevel }: Props) => {
|
24
|
-
const i18n = useContext(I18nContext);
|
25
22
|
const nextZoomOut = zoomLevel - zoomStep;
|
26
23
|
const nextZoomIn = zoomLevel + zoomStep;
|
27
24
|
|
@@ -36,7 +33,7 @@ const Pager = ({ zoomLevel, setZoomLevel }: Props) => {
|
|
36
33
|
disabled={minZoom >= nextZoomOut}
|
37
34
|
onClick={() => setZoomLevel(nextZoomOut)}
|
38
35
|
>
|
39
|
-
<
|
36
|
+
<MinusIcon width={20} height={20} color={'#fff'} />
|
40
37
|
</button>
|
41
38
|
<strong style={{ color: 'white', fontSize: '0.9rem', minWidth: 50, textAlign: 'center' }}>
|
42
39
|
{Math.round(zoomLevel * 100)}%
|
@@ -50,7 +47,7 @@ const Pager = ({ zoomLevel, setZoomLevel }: Props) => {
|
|
50
47
|
disabled={maxZoom < nextZoomIn}
|
51
48
|
onClick={() => setZoomLevel(nextZoomIn)}
|
52
49
|
>
|
53
|
-
<
|
50
|
+
<PlusIcon width={20} height={20} color={'#fff'} />
|
54
51
|
</button>
|
55
52
|
</div>
|
56
53
|
);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { Ref } from 'react';
|
2
2
|
import Guides from '@scena/react-guides';
|
3
3
|
import { Size } from '@pdfme/common';
|
4
|
-
import { ZOOM, RULER_HEIGHT } from '../../../constants';
|
4
|
+
import { ZOOM, RULER_HEIGHT } from '../../../constants.js';
|
5
5
|
|
6
6
|
const _Guides = ({
|
7
7
|
paperSize,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import Selecto, { OnDragStart as _OnDragStart, OnSelect as _OnSelect } from 'react-selecto';
|
3
|
-
import { SELECTABLE_CLASSNAME } from '../../../constants';
|
3
|
+
import { SELECTABLE_CLASSNAME } from '../../../constants.js';
|
4
4
|
|
5
5
|
const _Selecto = ({
|
6
6
|
container,
|
@@ -9,15 +9,15 @@ import React, {
|
|
9
9
|
} from 'react';
|
10
10
|
import { OnDrag, OnResize, OnClick } from 'react-moveable';
|
11
11
|
import { SchemaForUI, Size } from '@pdfme/common';
|
12
|
-
import { ZOOM, RULER_HEIGHT } from '../../../constants';
|
13
|
-
import { usePrevious } from '../../../hooks';
|
14
|
-
import { uuid, round, flatten } from '../../../helper';
|
15
|
-
import Paper from '../../Paper';
|
16
|
-
import SchemaUI from '../../Schemas/SchemaUI';
|
17
|
-
import Selecto from './Selecto';
|
18
|
-
import Moveable from './Moveable';
|
19
|
-
import Guides from './Guides';
|
20
|
-
import Mask from './Mask';
|
12
|
+
import { ZOOM, RULER_HEIGHT } from '../../../constants.js';
|
13
|
+
import { usePrevious } from '../../../hooks.js';
|
14
|
+
import { uuid, round, flatten } from '../../../helper.js';
|
15
|
+
import Paper from '../../Paper.js';
|
16
|
+
import SchemaUI from '../../Schemas/SchemaUI.js';
|
17
|
+
import Selecto from './Selecto.js';
|
18
|
+
import Moveable from './Moveable.js';
|
19
|
+
import Guides from './Guides.js';
|
20
|
+
import Mask from './Mask.js';
|
21
21
|
|
22
22
|
const DELETE_BTN_ID = uuid();
|
23
23
|
const fmt4Num = (prop: string) => Number(prop.replace('px', ''));
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import React, { useContext } from 'react';
|
2
2
|
import { SchemaForUI } from '@pdfme/common';
|
3
|
-
import { readFiles } from '../../../../helper';
|
4
|
-
import { I18nContext } from '../../../../contexts';
|
3
|
+
import { readFiles } from '../../../../helper.js';
|
4
|
+
import { I18nContext } from '../../../../contexts.js';
|
5
5
|
import { SidebarProps } from '..';
|
6
|
-
import
|
6
|
+
import { XMarkIcon } from '@heroicons/react/24/outline';
|
7
7
|
|
8
8
|
const ExampleInputEditor = (
|
9
9
|
props: Pick<SidebarProps, 'changeSchemas'> & { activeSchema: SchemaForUI }
|
@@ -39,7 +39,7 @@ const ExampleInputEditor = (
|
|
39
39
|
changeSchemas([{ key: 'data', value: '', schemaId: activeSchema.id }])
|
40
40
|
}
|
41
41
|
>
|
42
|
-
<
|
42
|
+
<XMarkIcon width={10} height={10} />
|
43
43
|
</button>
|
44
44
|
<img style={{ maxHeight: 180 }} src={activeSchema.data} alt="Input Example" />
|
45
45
|
</div>
|
@@ -1,15 +1,7 @@
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
2
2
|
import { SchemaForUI } from '@pdfme/common';
|
3
|
-
import { round } from '../../../../helper';
|
4
|
-
import { SidebarProps } from '
|
5
|
-
import alignVerticalTop from '../../../../assets/icons/align-vertical-top.svg';
|
6
|
-
import alignVerticalMiddle from '../../../../assets/icons/align-vertical-middle.svg';
|
7
|
-
import alignVerticalBottom from '../../../../assets/icons/align-vertical-bottom.svg';
|
8
|
-
import alignHorizontalRight from '../../../../assets/icons/align-horizontal-right.svg';
|
9
|
-
import alignHorizontalLeft from '../../../../assets/icons/align-horizontal-left.svg';
|
10
|
-
import alignHorizontalCenter from '../../../../assets/icons/align-horizontal-center.svg';
|
11
|
-
import verticalDistribute from '../../../../assets/icons/vertical-distribute.svg';
|
12
|
-
import horizontalDistribute from '../../../../assets/icons/horizontal-distribute.svg';
|
3
|
+
import { round } from '../../../../helper.js';
|
4
|
+
import { SidebarProps } from '../index.js';
|
13
5
|
|
14
6
|
const inputSetStyle: CSSProperties = { marginRight: '1rem', display: 'flex', alignItems: 'center' };
|
15
7
|
|
@@ -30,6 +22,16 @@ const buttonStyle: CSSProperties = {
|
|
30
22
|
cursor: 'pointer',
|
31
23
|
};
|
32
24
|
|
25
|
+
const svgBaseProp = {
|
26
|
+
style: { width: '100%', height: '100%' },
|
27
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
28
|
+
enableBackground: 'new 0 0 24 24',
|
29
|
+
height: '24px',
|
30
|
+
viewBox: '0 0 24 24',
|
31
|
+
width: '24px',
|
32
|
+
fill: '#000000',
|
33
|
+
};
|
34
|
+
|
33
35
|
const PositionAndSizeEditor = (
|
34
36
|
props: Pick<SidebarProps, 'pageSize' | 'schemas' | 'changeSchemas' | 'activeElements'> & {
|
35
37
|
activeSchema: SchemaForUI;
|
@@ -99,14 +101,86 @@ const PositionAndSizeEditor = (
|
|
99
101
|
};
|
100
102
|
|
101
103
|
const layoutBtns: { id: string; icon: any; action: () => void }[] = [
|
102
|
-
{
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
104
|
+
{
|
105
|
+
id: 'left',
|
106
|
+
icon: (
|
107
|
+
<svg {...svgBaseProp}>
|
108
|
+
<rect fill="none" height="24" width="24" />
|
109
|
+
<path d="M4,22H2V2h2V22z M22,7H6v3h16V7z M16,14H6v3h10V14z" />
|
110
|
+
</svg>
|
111
|
+
),
|
112
|
+
action: () => align('left'),
|
113
|
+
},
|
114
|
+
{
|
115
|
+
id: 'center',
|
116
|
+
icon: (
|
117
|
+
<svg {...svgBaseProp}>
|
118
|
+
<rect fill="none" height="24" width="24" />
|
119
|
+
<polygon points="11,2 13,2 13,7 21,7 21,10 13,10 13,14 18,14 18,17 13,17 13,22 11,22 11,17 6,17 6,14 11,14 11,10 3,10 3,7 11,7" />
|
120
|
+
</svg>
|
121
|
+
),
|
122
|
+
action: () => align('center'),
|
123
|
+
},
|
124
|
+
{
|
125
|
+
id: 'right',
|
126
|
+
icon: (
|
127
|
+
<svg {...svgBaseProp}>
|
128
|
+
<rect fill="none" height="24" width="24" />
|
129
|
+
<path d="M20,2h2v20h-2V2z M2,10h16V7H2V10z M8,17h10v-3H8V17z" />
|
130
|
+
</svg>
|
131
|
+
),
|
132
|
+
action: () => align('right'),
|
133
|
+
},
|
134
|
+
{
|
135
|
+
id: 'top',
|
136
|
+
icon: (
|
137
|
+
<svg {...svgBaseProp}>
|
138
|
+
<rect fill="none" height="24" width="24" />
|
139
|
+
<path d="M22,2v2H2V2H22z M7,22h3V6H7V22z M14,16h3V6h-3V16z" />
|
140
|
+
</svg>
|
141
|
+
),
|
142
|
+
action: () => align('top'),
|
143
|
+
},
|
144
|
+
{
|
145
|
+
id: 'middle',
|
146
|
+
icon: (
|
147
|
+
<svg {...svgBaseProp}>
|
148
|
+
<rect fill="none" height="24" width="24" />
|
149
|
+
<polygon points="22,11 17,11 17,6 14,6 14,11 10,11 10,3 7,3 7,11 1.84,11 1.84,13 7,13 7,21 10,21 10,13 14,13 14,18 17,18 17,13 22,13" />
|
150
|
+
</svg>
|
151
|
+
),
|
152
|
+
action: () => align('middle'),
|
153
|
+
},
|
154
|
+
{
|
155
|
+
id: 'bottom',
|
156
|
+
icon: (
|
157
|
+
<svg {...svgBaseProp}>
|
158
|
+
<rect fill="none" height="24" width="24" />
|
159
|
+
<path d="M22,22H2v-2h20V22z M10,2H7v16h3V2z M17,8h-3v10h3V8z" />
|
160
|
+
</svg>
|
161
|
+
),
|
162
|
+
action: () => align('bottom'),
|
163
|
+
},
|
164
|
+
{
|
165
|
+
id: 'vertical',
|
166
|
+
icon: (
|
167
|
+
<svg {...svgBaseProp}>
|
168
|
+
<rect fill="none" height="24" width="24" />
|
169
|
+
<path d="M22,2v2H2V2H22z M7,10.5v3h10v-3H7z M2,20v2h20v-2H2z" />
|
170
|
+
</svg>
|
171
|
+
),
|
172
|
+
action: () => distribute('vertical'),
|
173
|
+
},
|
174
|
+
{
|
175
|
+
id: 'horizontal',
|
176
|
+
icon: (
|
177
|
+
<svg {...svgBaseProp}>
|
178
|
+
<rect fill="none" height="24" width="24" />
|
179
|
+
<path d="M4,22H2V2h2V22z M22,2h-2v20h2V2z M13.5,7h-3v10h3V7z" />
|
180
|
+
</svg>
|
181
|
+
),
|
182
|
+
action: () => distribute('horizontal'),
|
183
|
+
},
|
110
184
|
];
|
111
185
|
|
112
186
|
return (
|
@@ -114,7 +188,9 @@ const PositionAndSizeEditor = (
|
|
114
188
|
<div style={{ display: 'flex', alignItems: 'center', marginBottom: '0.5rem' }}>
|
115
189
|
{layoutBtns.map((b) => (
|
116
190
|
<button key={b.id} title={b.id} onClick={b.action} style={buttonStyle}>
|
117
|
-
<
|
191
|
+
<object width={15} height={15}>
|
192
|
+
{b.icon}
|
193
|
+
</object>
|
118
194
|
</button>
|
119
195
|
))}
|
120
196
|
</div>
|
@@ -7,9 +7,9 @@ import {
|
|
7
7
|
DEFAULT_CHARACTER_SPACING,
|
8
8
|
DEFAULT_FONT_COLOR,
|
9
9
|
} from '@pdfme/common';
|
10
|
-
import { FontContext } from '../../../../contexts';
|
10
|
+
import { FontContext } from '../../../../contexts.js';
|
11
11
|
import { SidebarProps } from '..';
|
12
|
-
import
|
12
|
+
import { XMarkIcon } from '@heroicons/react/24/outline';
|
13
13
|
|
14
14
|
const inputStyle = {
|
15
15
|
width: '90%',
|
@@ -60,7 +60,7 @@ const ColorInputSet = (props: {
|
|
60
60
|
cursor: 'pointer',
|
61
61
|
}}
|
62
62
|
>
|
63
|
-
<
|
63
|
+
<XMarkIcon width={10} height={10} />
|
64
64
|
</button>
|
65
65
|
</div>
|
66
66
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useContext, useRef, useCallback } from 'react';
|
2
2
|
import { schemaTypes, SchemaForUI } from '@pdfme/common';
|
3
|
-
import { SidebarProps } from '
|
4
|
-
import { I18nContext } from '../../../../contexts';
|
3
|
+
import { SidebarProps } from '../index.js';
|
4
|
+
import { I18nContext } from '../../../../contexts.js';
|
5
5
|
|
6
6
|
const ErrorLabel = ({ isError, msg }: { isError: boolean; msg: string }) => (
|
7
7
|
<span
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import React, { useContext } from 'react';
|
2
2
|
import { SchemaForUI } from '@pdfme/common';
|
3
|
-
import { I18nContext } from '../../../../contexts';
|
4
|
-
import Divider from '../../../Divider';
|
5
|
-
import { SidebarProps } from '
|
6
|
-
import TextPropEditor from './TextPropEditor';
|
7
|
-
import ExampleInputEditor from './ExampleInputEditor';
|
8
|
-
import PositionAndSizeEditor from './PositionAndSizeEditor';
|
9
|
-
import TypeAndKeyEditor from './TypeAndKeyEditor';
|
3
|
+
import { I18nContext } from '../../../../contexts.js';
|
4
|
+
import Divider from '../../../Divider.js';
|
5
|
+
import { SidebarProps } from '../index.js';
|
6
|
+
import TextPropEditor from './TextPropEditor.js';
|
7
|
+
import ExampleInputEditor from './ExampleInputEditor.js';
|
8
|
+
import PositionAndSizeEditor from './PositionAndSizeEditor.js';
|
9
|
+
import TypeAndKeyEditor from './TypeAndKeyEditor.js';
|
10
10
|
|
11
11
|
const DetailView = (
|
12
12
|
props: Pick<SidebarProps, 'schemas' | 'pageSize' | 'changeSchemas' | 'activeElements'> & {
|