@pdfme/ui 1.0.18 → 1.1.0
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/declaration.d.ts +0 -4
- 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/assets/barcodeExamples/code128.png +0 -0
- package/dist/cjs/src/assets/barcodeExamples/code39.png +0 -0
- package/dist/cjs/src/assets/barcodeExamples/ean13.png +0 -0
- package/dist/cjs/src/assets/barcodeExamples/ean8.png +0 -0
- package/dist/cjs/src/assets/barcodeExamples/itf14.png +0 -0
- package/dist/cjs/src/assets/barcodeExamples/japanpost.png +0 -0
- package/dist/cjs/src/assets/barcodeExamples/nw7.png +0 -0
- package/dist/cjs/src/assets/barcodeExamples/qrcode.png +0 -0
- package/dist/cjs/src/assets/barcodeExamples/upca.png +0 -0
- package/dist/cjs/src/assets/barcodeExamples/upce.png +0 -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 +107 -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/assets/barcodeExamples/code128.png +0 -0
- package/dist/esm/src/assets/barcodeExamples/code39.png +0 -0
- package/dist/esm/src/assets/barcodeExamples/ean13.png +0 -0
- package/dist/esm/src/assets/barcodeExamples/ean8.png +0 -0
- package/dist/esm/src/assets/barcodeExamples/itf14.png +0 -0
- package/dist/esm/src/assets/barcodeExamples/japanpost.png +0 -0
- package/dist/esm/src/assets/barcodeExamples/nw7.png +0 -0
- package/dist/esm/src/assets/barcodeExamples/qrcode.png +0 -0
- package/dist/esm/src/assets/barcodeExamples/upca.png +0 -0
- package/dist/esm/src/assets/barcodeExamples/upce.png +0 -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 +79 -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 +22 -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 +2 -2
- 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/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/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
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'> & {
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import React, { useEffect, useContext } from 'react';
|
2
2
|
import { DraggableSyntheticListeners } from '@dnd-kit/core';
|
3
|
-
import { I18nContext } from '../../../../contexts';
|
4
|
-
import
|
5
|
-
import warningIcon from '../../../../assets/icons/warning.svg';
|
3
|
+
import { I18nContext } from '../../../../contexts.js';
|
4
|
+
import { ExclamationTriangleIcon } from '@heroicons/react/24/outline';
|
6
5
|
|
7
6
|
interface Props {
|
8
7
|
value: React.ReactNode;
|
@@ -73,7 +72,11 @@ const Item = React.memo(
|
|
73
72
|
{...listeners}
|
74
73
|
style={{ padding: '0.5rem', background: 'none', border: 'none', display: 'flex' }}
|
75
74
|
>
|
76
|
-
<
|
75
|
+
<object style={{ cursor: 'grab' }} width={15}>
|
76
|
+
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="16" height="16">
|
77
|
+
<path d="M10 13a1 1 0 100-2 1 1 0 000 2zm-4 0a1 1 0 100-2 1 1 0 000 2zm1-5a1 1 0 11-2 0 1 1 0 012 0zm3 1a1 1 0 100-2 1 1 0 000 2zm1-5a1 1 0 11-2 0 1 1 0 012 0zM6 5a1 1 0 100-2 1 1 0 000 2z"></path>
|
78
|
+
</svg>
|
79
|
+
</object>
|
77
80
|
</button>
|
78
81
|
<div
|
79
82
|
style={{
|
@@ -92,12 +95,7 @@ const Item = React.memo(
|
|
92
95
|
value
|
93
96
|
) : (
|
94
97
|
<span style={{ display: 'flex', alignItems: 'center' }}>
|
95
|
-
<
|
96
|
-
alt="Warning icon"
|
97
|
-
src={warningIcon}
|
98
|
-
width={15}
|
99
|
-
style={{ marginRight: '0.5rem' }}
|
100
|
-
/>
|
98
|
+
<ExclamationTriangleIcon width={15} style={{ marginRight: '0.5rem' }} />
|
101
99
|
{status === 'is-warning' ? i18n('noKeyName') : value}
|
102
100
|
{status === 'is-danger' ? i18n('notUniq') : ''}
|
103
101
|
</span>
|
@@ -16,9 +16,9 @@ import {
|
|
16
16
|
verticalListSortingStrategy,
|
17
17
|
} from '@dnd-kit/sortable';
|
18
18
|
import { SchemaForUI } from '@pdfme/common';
|
19
|
-
import Item from './Item';
|
20
|
-
import SelectableSortableItem from './SelectableSortableItem';
|
21
|
-
import { SidebarProps } from '../';
|
19
|
+
import Item from './Item.js';
|
20
|
+
import SelectableSortableItem from './SelectableSortableItem.js';
|
21
|
+
import { SidebarProps } from '../index.js';
|
22
22
|
|
23
23
|
const SelectableSortableContainer = (
|
24
24
|
props: Pick<
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import React, { useContext } from 'react';
|
2
2
|
import { useSortable } from '@dnd-kit/sortable';
|
3
3
|
import { SchemaForUI } from '@pdfme/common';
|
4
|
-
import { I18nContext } from '../../../../contexts';
|
5
|
-
import Item from './Item';
|
6
|
-
import { useMountStatus } from '../../../../hooks';
|
4
|
+
import { I18nContext } from '../../../../contexts.js';
|
5
|
+
import Item from './Item.js';
|
6
|
+
import { useMountStatus } from '../../../../hooks.js';
|
7
7
|
|
8
8
|
interface Props {
|
9
9
|
isSelected: boolean;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import React, { useContext, useState } from 'react';
|
2
|
-
import {
|
3
|
-
import { I18nContext } from '../../../../contexts';
|
4
|
-
import Divider from '../../../Divider';
|
5
|
-
import SelectableSortableContainer from './SelectableSortableContainer';
|
6
|
-
import { SidebarProps } from '
|
2
|
+
import { RULER_HEIGHT, SIDEBAR_WIDTH } from '../../../../constants.js';
|
3
|
+
import { I18nContext } from '../../../../contexts.js';
|
4
|
+
import Divider from '../../../Divider.js';
|
5
|
+
import SelectableSortableContainer from './SelectableSortableContainer.js';
|
6
|
+
import { SidebarProps } from '../index.js';
|
7
7
|
|
8
8
|
const ListView = (
|
9
9
|
props: Pick<
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import React, { useState, useContext } from 'react';
|
2
2
|
import { SchemaForUI, Size } from '@pdfme/common';
|
3
|
-
import {
|
4
|
-
import { I18nContext } from '../../../contexts';
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import DetailView from './DetailView';
|
3
|
+
import { RULER_HEIGHT, SIDEBAR_WIDTH } from '../../../constants.js';
|
4
|
+
import { I18nContext } from '../../../contexts.js';
|
5
|
+
import { ArrowLeftIcon, ArrowRightIcon } from '@heroicons/react/24/outline';
|
6
|
+
import ListView from './ListView/index.js';
|
7
|
+
import DetailView from './DetailView/index.js';
|
9
8
|
|
10
9
|
export type SidebarProps = {
|
11
10
|
height: number;
|
@@ -61,10 +60,15 @@ const Sidebar = (props: SidebarProps) => {
|
|
61
60
|
cursor: 'pointer',
|
62
61
|
background: '#eee',
|
63
62
|
width: 30,
|
63
|
+
height: 30,
|
64
64
|
}}
|
65
65
|
onClick={() => setOpen(!open)}
|
66
66
|
>
|
67
|
-
|
67
|
+
{open ? (
|
68
|
+
<ArrowRightIcon width={15} height={15} />
|
69
|
+
) : (
|
70
|
+
<ArrowLeftIcon width={15} height={15} />
|
71
|
+
)}
|
68
72
|
</button>
|
69
73
|
<div
|
70
74
|
style={{
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import React, { useRef, useState, useEffect, useContext, useCallback } from 'react';
|
2
2
|
import { DesignerReactProps, Template, SchemaForUI } from '@pdfme/common';
|
3
|
-
import Sidebar from './Sidebar';
|
4
|
-
import Main from './Main';
|
5
|
-
import { ZOOM, RULER_HEIGHT } from '../../constants';
|
6
|
-
import { I18nContext } from '../../contexts';
|
3
|
+
import Sidebar from './Sidebar/index.js';
|
4
|
+
import Main from './Main/index.js';
|
5
|
+
import { ZOOM, RULER_HEIGHT } from '../../constants.js';
|
6
|
+
import { I18nContext } from '../../contexts.js';
|
7
7
|
import {
|
8
8
|
uuid,
|
9
9
|
set,
|
@@ -18,11 +18,11 @@ import {
|
|
18
18
|
getUniqSchemaKey,
|
19
19
|
moveCommandToChangeSchemasArg,
|
20
20
|
getPagesScrollTopByIndex,
|
21
|
-
} from '../../helper';
|
22
|
-
import { useUIPreProcessor, useScrollPageCursor } from '../../hooks';
|
23
|
-
import Root from '../Root';
|
24
|
-
import Error from '../Error';
|
25
|
-
import CtlBar from '../CtlBar';
|
21
|
+
} from '../../helper.js';
|
22
|
+
import { useUIPreProcessor, useScrollPageCursor } from '../../hooks.js';
|
23
|
+
import Root from '../Root.js';
|
24
|
+
import Error from '../Error.js';
|
25
|
+
import CtlBar from '../CtlBar/index.js';
|
26
26
|
|
27
27
|
const TemplateEditor = ({
|
28
28
|
template,
|
package/src/components/Error.tsx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useContext } from 'react';
|
2
2
|
import { Size } from '@pdfme/common';
|
3
|
-
import { I18nContext } from '../contexts';
|
3
|
+
import { I18nContext } from '../contexts.js';
|
4
4
|
|
5
5
|
const Error = ({ size, error }: { size: Size; error: Error }) => {
|
6
6
|
const i18n = useContext(I18nContext);
|
package/src/components/Paper.tsx
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { MutableRefObject, ReactNode, useContext } from 'react';
|
2
2
|
import { SchemaForUI, Size, getFallbackFontName } from '@pdfme/common';
|
3
|
-
import { FontContext } from '../contexts';
|
4
|
-
import { ZOOM, RULER_HEIGHT } from '../constants';
|
3
|
+
import { FontContext } from '../contexts.js';
|
4
|
+
import { ZOOM, RULER_HEIGHT } from '../constants.js';
|
5
5
|
|
6
6
|
const Paper = (porps: {
|
7
7
|
paperRefs: MutableRefObject<HTMLDivElement[]>;
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import React, { useCallback, useRef, useState, useEffect } from 'react';
|
2
2
|
import { PreviewReactProps, SchemaForUI } from '@pdfme/common';
|
3
|
-
import { ZOOM, RULER_HEIGHT } from '../constants';
|
4
|
-
import UnitPager from './UnitPager';
|
5
|
-
import Root from './Root';
|
6
|
-
import Error from './Error';
|
7
|
-
import CtlBar from './CtlBar';
|
8
|
-
import Paper from './Paper';
|
9
|
-
import SchemaUI from './Schemas/SchemaUI';
|
10
|
-
import { useUIPreProcessor, useScrollPageCursor } from '../hooks';
|
11
|
-
import { templateSchemas2SchemasList, getPagesScrollTopByIndex } from '../helper';
|
3
|
+
import { ZOOM, RULER_HEIGHT } from '../constants.js';
|
4
|
+
import UnitPager from './UnitPager.js';
|
5
|
+
import Root from './Root.js';
|
6
|
+
import Error from './Error.js';
|
7
|
+
import CtlBar from './CtlBar/index.js';
|
8
|
+
import Paper from './Paper.js';
|
9
|
+
import SchemaUI from './Schemas/SchemaUI.js';
|
10
|
+
import { useUIPreProcessor, useScrollPageCursor } from '../hooks.js';
|
11
|
+
import { templateSchemas2SchemasList, getPagesScrollTopByIndex } from '../helper.js';
|
12
12
|
|
13
13
|
const Preview = ({ template, inputs, size, onChangeInput }: PreviewReactProps) => {
|
14
14
|
const rootRef = useRef<HTMLDivElement>(null);
|
package/src/components/Root.tsx
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
import type {} from 'css-font-loading-module';
|
2
2
|
import React, { useContext, forwardRef, ReactNode, Ref, useEffect } from 'react';
|
3
3
|
import { Size } from '@pdfme/common';
|
4
|
-
import {
|
5
|
-
import
|
6
|
-
import Spinner from './Spinner';
|
4
|
+
import { FontContext } from '../contexts.js';
|
5
|
+
import Spinner from './Spinner.js';
|
7
6
|
|
8
7
|
type Props = { size: Size; scale: number; children: ReactNode };
|
9
8
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { forwardRef, Ref } from 'react';
|
2
2
|
import { validateBarcodeInput, BarCodeType, BarcodeSchema } from '@pdfme/common';
|
3
|
-
import { ZOOM } from '../../constants';
|
4
|
-
import { SchemaUIProps } from './SchemaUI';
|
3
|
+
import { ZOOM } from '../../constants.js';
|
4
|
+
import { SchemaUIProps } from './SchemaUI.js';
|
5
5
|
import ean8 from '../../assets/barcodeExamples/ean8.png';
|
6
6
|
import ean13 from '../../assets/barcodeExamples/ean13.png';
|
7
7
|
import code39 from '../../assets/barcodeExamples/code39.png';
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import React, { useState, forwardRef, ChangeEvent,
|
1
|
+
import React, { useState, forwardRef, ChangeEvent, Ref } from 'react';
|
2
2
|
import { ImageSchema } from '@pdfme/common';
|
3
|
-
import { SchemaUIProps } from './SchemaUI';
|
4
|
-
import { readFiles } from '../../helper';
|
5
|
-
import { ZOOM } from '../../constants';
|
6
|
-
import
|
3
|
+
import { SchemaUIProps } from './SchemaUI.js';
|
4
|
+
import { readFiles } from '../../helper.js';
|
5
|
+
import { ZOOM } from '../../constants.js';
|
6
|
+
import { XMarkIcon } from '@heroicons/react/24/outline';
|
7
7
|
|
8
8
|
type Props = SchemaUIProps & { schema: ImageSchema };
|
9
9
|
|
@@ -55,7 +55,7 @@ const ImageSchemaUI = (props: Props, ref: Ref<HTMLInputElement>) => {
|
|
55
55
|
onChange('');
|
56
56
|
}}
|
57
57
|
>
|
58
|
-
<
|
58
|
+
<XMarkIcon width={10} height={10} />
|
59
59
|
</button>
|
60
60
|
)}
|
61
61
|
</div>
|