@pdfme/schemas 3.1.5-dev.9 → 3.2.0-dev.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__/{renderUtils.test.js → utils.test.js} +38 -12
- package/dist/cjs/__tests__/utils.test.js.map +1 -0
- package/dist/cjs/src/barcodes/constants.js +2 -1
- package/dist/cjs/src/barcodes/constants.js.map +1 -1
- package/dist/cjs/src/barcodes/helper.js +1 -2
- package/dist/cjs/src/barcodes/helper.js.map +1 -1
- package/dist/cjs/src/barcodes/index.js +2 -2
- package/dist/cjs/src/barcodes/index.js.map +1 -1
- package/dist/cjs/src/barcodes/pdfRender.js +3 -3
- package/dist/cjs/src/barcodes/pdfRender.js.map +1 -1
- package/dist/cjs/src/barcodes/propPanel.js +19 -2
- package/dist/cjs/src/barcodes/propPanel.js.map +1 -1
- package/dist/cjs/src/barcodes/uiRender.js +9 -32
- package/dist/cjs/src/barcodes/uiRender.js.map +1 -1
- package/dist/cjs/src/graphics/helper.js +115 -0
- package/dist/cjs/src/graphics/helper.js.map +1 -0
- package/dist/cjs/src/graphics/image.js +179 -0
- package/dist/cjs/src/graphics/image.js.map +1 -0
- package/dist/cjs/src/graphics/svg.js +96 -0
- package/dist/cjs/src/graphics/svg.js.map +1 -0
- package/dist/cjs/src/index.js +42 -11
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/shapes/line.js +57 -0
- package/dist/cjs/src/shapes/line.js.map +1 -0
- package/dist/cjs/src/shapes/rectAndEllipse.js +100 -0
- package/dist/cjs/src/shapes/rectAndEllipse.js.map +1 -0
- package/dist/cjs/src/text/helper.js.map +1 -1
- package/dist/cjs/src/text/index.js +16 -2
- package/dist/cjs/src/text/index.js.map +1 -1
- package/dist/cjs/src/text/pdfRender.js +5 -5
- package/dist/cjs/src/text/pdfRender.js.map +1 -1
- package/dist/cjs/src/text/uiRender.js +3 -3
- package/dist/cjs/src/text/uiRender.js.map +1 -1
- package/dist/cjs/src/{renderUtils.js → utils.js} +55 -7
- package/dist/cjs/src/utils.js.map +1 -0
- package/dist/esm/__tests__/{renderUtils.test.js → utils.test.js} +34 -8
- package/dist/esm/__tests__/utils.test.js.map +1 -0
- package/dist/esm/src/barcodes/constants.js +1 -0
- package/dist/esm/src/barcodes/constants.js.map +1 -1
- package/dist/esm/src/barcodes/helper.js +2 -3
- package/dist/esm/src/barcodes/helper.js.map +1 -1
- package/dist/esm/src/barcodes/index.js +2 -2
- package/dist/esm/src/barcodes/index.js.map +1 -1
- package/dist/esm/src/barcodes/pdfRender.js +2 -2
- package/dist/esm/src/barcodes/pdfRender.js.map +1 -1
- package/dist/esm/src/barcodes/propPanel.js +20 -3
- package/dist/esm/src/barcodes/propPanel.js.map +1 -1
- package/dist/esm/src/barcodes/uiRender.js +9 -32
- package/dist/esm/src/barcodes/uiRender.js.map +1 -1
- package/dist/esm/src/graphics/helper.js +111 -0
- package/dist/esm/src/graphics/helper.js.map +1 -0
- package/dist/esm/src/graphics/image.js +176 -0
- package/dist/esm/src/graphics/image.js.map +1 -0
- package/dist/esm/src/graphics/svg.js +93 -0
- package/dist/esm/src/graphics/svg.js.map +1 -0
- package/dist/esm/src/index.js +7 -5
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/shapes/line.js +55 -0
- package/dist/esm/src/shapes/line.js.map +1 -0
- package/dist/esm/src/shapes/rectAndEllipse.js +97 -0
- package/dist/esm/src/shapes/rectAndEllipse.js.map +1 -0
- package/dist/esm/src/text/helper.js.map +1 -1
- package/dist/esm/src/text/index.js +15 -2
- package/dist/esm/src/text/index.js.map +1 -1
- package/dist/esm/src/text/pdfRender.js +1 -1
- package/dist/esm/src/text/pdfRender.js.map +1 -1
- package/dist/esm/src/text/uiRender.js +2 -2
- package/dist/esm/src/text/uiRender.js.map +1 -1
- package/dist/esm/src/{renderUtils.js → utils.js} +52 -6
- package/dist/esm/src/utils.js.map +1 -0
- package/dist/types/src/barcodes/constants.d.ts +1 -0
- package/dist/types/src/barcodes/helper.d.ts +1 -0
- package/dist/types/src/barcodes/index.d.ts +2 -2
- package/dist/types/src/barcodes/types.d.ts +1 -0
- package/dist/types/src/graphics/helper.d.ts +5 -0
- package/dist/types/src/graphics/image.d.ts +7 -0
- package/dist/types/src/graphics/svg.d.ts +6 -0
- package/dist/types/src/index.d.ts +7 -5
- package/dist/types/src/shapes/line.d.ts +6 -0
- package/dist/types/src/shapes/rectAndEllipse.d.ts +144 -0
- package/dist/types/src/text/index.d.ts +3 -2
- package/dist/types/src/text/pdfRender.d.ts +1 -1
- package/dist/types/src/{renderUtils.d.ts → utils.d.ts} +3 -1
- package/package.json +4 -3
- package/src/barcodes/constants.ts +2 -0
- package/src/barcodes/helper.ts +12 -3
- package/src/barcodes/index.ts +2 -2
- package/src/barcodes/pdfRender.ts +2 -2
- package/src/barcodes/propPanel.ts +25 -3
- package/src/barcodes/types.ts +1 -0
- package/src/barcodes/uiRender.ts +9 -36
- package/src/graphics/helper.ts +147 -0
- package/src/graphics/image.ts +207 -0
- package/src/graphics/svg.ts +98 -0
- package/src/index.ts +21 -5
- package/src/shapes/line.ts +67 -0
- package/src/shapes/rectAndEllipse.ts +110 -0
- package/src/text/helper.ts +0 -1
- package/src/text/index.ts +17 -2
- package/src/text/pdfRender.ts +2 -2
- package/src/text/uiRender.ts +2 -2
- package/src/{renderUtils.ts → utils.ts} +61 -5
- package/dist/cjs/__tests__/renderUtils.test.js.map +0 -1
- package/dist/cjs/src/image/index.js +0 -8
- package/dist/cjs/src/image/index.js.map +0 -1
- package/dist/cjs/src/image/pdfRender.js +0 -22
- package/dist/cjs/src/image/pdfRender.js.map +0 -1
- package/dist/cjs/src/image/propPanel.js +0 -19
- package/dist/cjs/src/image/propPanel.js.map +0 -1
- package/dist/cjs/src/image/types.js +0 -3
- package/dist/cjs/src/image/types.js.map +0 -1
- package/dist/cjs/src/image/uiRender.js +0 -111
- package/dist/cjs/src/image/uiRender.js.map +0 -1
- package/dist/cjs/src/line/constants.js +0 -5
- package/dist/cjs/src/line/constants.js.map +0 -1
- package/dist/cjs/src/line/index.js +0 -8
- package/dist/cjs/src/line/index.js.map +0 -1
- package/dist/cjs/src/line/pdfRender.js +0 -20
- package/dist/cjs/src/line/pdfRender.js.map +0 -1
- package/dist/cjs/src/line/propPanel.js +0 -35
- package/dist/cjs/src/line/propPanel.js.map +0 -1
- package/dist/cjs/src/line/types.js +0 -3
- package/dist/cjs/src/line/types.js.map +0 -1
- package/dist/cjs/src/line/uiRender.js +0 -14
- package/dist/cjs/src/line/uiRender.js.map +0 -1
- package/dist/cjs/src/renderUtils.js.map +0 -1
- package/dist/esm/__tests__/renderUtils.test.js.map +0 -1
- package/dist/esm/src/image/index.js +0 -6
- package/dist/esm/src/image/index.js.map +0 -1
- package/dist/esm/src/image/pdfRender.js +0 -18
- package/dist/esm/src/image/pdfRender.js.map +0 -1
- package/dist/esm/src/image/propPanel.js +0 -16
- package/dist/esm/src/image/propPanel.js.map +0 -1
- package/dist/esm/src/image/types.js +0 -2
- package/dist/esm/src/image/types.js.map +0 -1
- package/dist/esm/src/image/uiRender.js +0 -107
- package/dist/esm/src/image/uiRender.js.map +0 -1
- package/dist/esm/src/line/constants.js +0 -2
- package/dist/esm/src/line/constants.js.map +0 -1
- package/dist/esm/src/line/index.js +0 -6
- package/dist/esm/src/line/index.js.map +0 -1
- package/dist/esm/src/line/pdfRender.js +0 -16
- package/dist/esm/src/line/pdfRender.js.map +0 -1
- package/dist/esm/src/line/propPanel.js +0 -32
- package/dist/esm/src/line/propPanel.js.map +0 -1
- package/dist/esm/src/line/types.js +0 -2
- package/dist/esm/src/line/types.js.map +0 -1
- package/dist/esm/src/line/uiRender.js +0 -10
- package/dist/esm/src/line/uiRender.js.map +0 -1
- package/dist/esm/src/renderUtils.js.map +0 -1
- package/dist/types/src/image/index.d.ts +0 -4
- package/dist/types/src/image/pdfRender.d.ts +0 -3
- package/dist/types/src/image/propPanel.d.ts +0 -3
- package/dist/types/src/image/types.d.ts +0 -3
- package/dist/types/src/image/uiRender.d.ts +0 -3
- package/dist/types/src/line/constants.d.ts +0 -1
- package/dist/types/src/line/index.d.ts +0 -4
- package/dist/types/src/line/pdfRender.d.ts +0 -3
- package/dist/types/src/line/propPanel.d.ts +0 -3
- package/dist/types/src/line/types.d.ts +0 -4
- package/dist/types/src/line/uiRender.d.ts +0 -3
- package/src/image/index.ts +0 -8
- package/src/image/pdfRender.ts +0 -29
- package/src/image/propPanel.ts +0 -19
- package/src/image/types.ts +0 -3
- package/src/image/uiRender.ts +0 -121
- package/src/line/constants.ts +0 -1
- package/src/line/index.ts +0 -8
- package/src/line/pdfRender.ts +0 -24
- package/src/line/propPanel.ts +0 -34
- package/src/line/types.ts +0 -5
- package/src/line/uiRender.ts +0 -12
- /package/dist/types/__tests__/{renderUtils.test.d.ts → utils.test.d.ts} +0 -0
package/src/line/propPanel.ts
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
import { PropPanel } from '@pdfme/common';
|
2
|
-
import type { LineSchema } from './types';
|
3
|
-
import { HEX_COLOR_PATTERN } from '../constants.js';
|
4
|
-
import { DEFAULT_LINE_COLOR } from './constants.js';
|
5
|
-
|
6
|
-
export const propPanel: PropPanel<LineSchema> = {
|
7
|
-
schema: ({ i18n }) => {
|
8
|
-
return {
|
9
|
-
color: {
|
10
|
-
title: i18n('schemas.line.color'),
|
11
|
-
type: 'string',
|
12
|
-
widget: 'color',
|
13
|
-
required: true,
|
14
|
-
rules: [
|
15
|
-
{
|
16
|
-
pattern: HEX_COLOR_PATTERN,
|
17
|
-
message: i18n('hexColorPrompt'),
|
18
|
-
},
|
19
|
-
],
|
20
|
-
},
|
21
|
-
};
|
22
|
-
},
|
23
|
-
defaultValue: '',
|
24
|
-
defaultSchema: {
|
25
|
-
type: 'line',
|
26
|
-
position: { x: 0, y: 0 },
|
27
|
-
width: 50,
|
28
|
-
height: 1,
|
29
|
-
rotate: 0,
|
30
|
-
opacity: 1,
|
31
|
-
readOnly: true,
|
32
|
-
color: DEFAULT_LINE_COLOR,
|
33
|
-
},
|
34
|
-
};
|
package/src/line/types.ts
DELETED
package/src/line/uiRender.ts
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
import type { LineSchema } from './types';
|
2
|
-
import { UIRenderProps } from '@pdfme/common';
|
3
|
-
import { DEFAULT_LINE_COLOR } from './constants.js';
|
4
|
-
|
5
|
-
export const uiRender = (arg: UIRenderProps<LineSchema>) => {
|
6
|
-
const { schema, rootElement } = arg;
|
7
|
-
const div = document.createElement('div');
|
8
|
-
div.style.backgroundColor = schema.color ?? DEFAULT_LINE_COLOR;
|
9
|
-
div.style.width = '100%';
|
10
|
-
div.style.height = '100%';
|
11
|
-
rootElement.appendChild(div);
|
12
|
-
};
|
File without changes
|