@pdfme/common 3.0.1-dev.14 → 3.0.1-dev.16
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/src/helper.js +13 -13
- package/dist/cjs/src/helper.js.map +1 -1
- package/dist/esm/src/helper.js +2 -2
- package/dist/esm/src/helper.js.map +1 -1
- package/package.json +4 -2
- package/src/helper.ts +2 -2
package/dist/cjs/src/helper.js
CHANGED
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkGenerateProps = exports.checkDesignerProps = exports.checkPreviewProps = exports.checkUIProps = exports.checkTemplate = exports.checkUIOptions = exports.checkInputs = exports.checkPlugins = exports.checkFont = exports.b64toUint8Array = exports.getB64BasePdf = exports.pt2px = exports.pt2mm = exports.mm2pt = exports.getDefaultFont = exports.getFallbackFontName = void 0;
|
4
4
|
const zod_1 = require("zod");
|
5
5
|
const buffer_1 = require("buffer");
|
6
|
-
const
|
7
|
-
const
|
6
|
+
const schema_js_1 = require("./schema.js");
|
7
|
+
const constants_js_1 = require("./constants.js");
|
8
8
|
const uniq = (array) => Array.from(new Set(array));
|
9
9
|
const getFallbackFontName = (font) => {
|
10
10
|
const initial = '';
|
@@ -19,19 +19,19 @@ const getFallbackFontName = (font) => {
|
|
19
19
|
};
|
20
20
|
exports.getFallbackFontName = getFallbackFontName;
|
21
21
|
const getDefaultFont = () => ({
|
22
|
-
[
|
22
|
+
[constants_js_1.DEFAULT_FONT_NAME]: { data: (0, exports.b64toUint8Array)(constants_js_1.DEFAULT_FONT_VALUE), fallback: true },
|
23
23
|
});
|
24
24
|
exports.getDefaultFont = getDefaultFont;
|
25
25
|
const mm2pt = (mm) => {
|
26
|
-
return parseFloat(String(mm)) *
|
26
|
+
return parseFloat(String(mm)) * constants_js_1.MM_TO_PT_RATIO;
|
27
27
|
};
|
28
28
|
exports.mm2pt = mm2pt;
|
29
29
|
const pt2mm = (pt) => {
|
30
|
-
return pt *
|
30
|
+
return pt * constants_js_1.PT_TO_MM_RATIO;
|
31
31
|
};
|
32
32
|
exports.pt2mm = pt2mm;
|
33
33
|
const pt2px = (pt) => {
|
34
|
-
return pt *
|
34
|
+
return pt * constants_js_1.PT_TO_PX_RATIO;
|
35
35
|
};
|
36
36
|
exports.pt2px = pt2px;
|
37
37
|
const blob2Base64Pdf = (blob) => {
|
@@ -139,18 +139,18 @@ ${message}`);
|
|
139
139
|
}
|
140
140
|
}
|
141
141
|
};
|
142
|
-
const checkInputs = (data) => checkProps(data,
|
142
|
+
const checkInputs = (data) => checkProps(data, schema_js_1.Inputs);
|
143
143
|
exports.checkInputs = checkInputs;
|
144
|
-
const checkUIOptions = (data) => checkProps(data,
|
144
|
+
const checkUIOptions = (data) => checkProps(data, schema_js_1.UIOptions);
|
145
145
|
exports.checkUIOptions = checkUIOptions;
|
146
|
-
const checkTemplate = (data) => checkProps(data,
|
146
|
+
const checkTemplate = (data) => checkProps(data, schema_js_1.Template);
|
147
147
|
exports.checkTemplate = checkTemplate;
|
148
|
-
const checkUIProps = (data) => checkProps(data,
|
148
|
+
const checkUIProps = (data) => checkProps(data, schema_js_1.UIProps);
|
149
149
|
exports.checkUIProps = checkUIProps;
|
150
|
-
const checkPreviewProps = (data) => checkProps(data,
|
150
|
+
const checkPreviewProps = (data) => checkProps(data, schema_js_1.PreviewProps);
|
151
151
|
exports.checkPreviewProps = checkPreviewProps;
|
152
|
-
const checkDesignerProps = (data) => checkProps(data,
|
152
|
+
const checkDesignerProps = (data) => checkProps(data, schema_js_1.DesignerProps);
|
153
153
|
exports.checkDesignerProps = checkDesignerProps;
|
154
|
-
const checkGenerateProps = (data) => checkProps(data,
|
154
|
+
const checkGenerateProps = (data) => checkProps(data, schema_js_1.GenerateProps);
|
155
155
|
exports.checkGenerateProps = checkGenerateProps;
|
156
156
|
//# sourceMappingURL=helper.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":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AAC,UAAU,CAAC,IAAI,EAAE,wBAAkB,CAAC,CAAC;AAA5E,QAAA,iBAAiB,qBAA2D;AAClF,MAAM,kBAAkB,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,yBAAmB,CAAC,CAAC;AAA9E,QAAA,kBAAkB,sBAA4D;AACpF,MAAM,kBAAkB,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,yBAAmB,CAAC,CAAC;AAA9E,QAAA,kBAAkB,sBAA4D"}
|
package/dist/esm/src/helper.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { z } from 'zod';
|
2
2
|
import { Buffer } from 'buffer';
|
3
|
-
import { Inputs as InputsSchema, UIOptions as UIOptionsSchema, Template as TemplateSchema, PreviewProps as PreviewPropsSchema, DesignerProps as DesignerPropsSchema, GenerateProps as GeneratePropsSchema, UIProps as UIPropsSchema, } from './schema';
|
4
|
-
import { MM_TO_PT_RATIO, PT_TO_MM_RATIO, PT_TO_PX_RATIO, DEFAULT_FONT_NAME, DEFAULT_FONT_VALUE, } from './constants';
|
3
|
+
import { Inputs as InputsSchema, UIOptions as UIOptionsSchema, Template as TemplateSchema, PreviewProps as PreviewPropsSchema, DesignerProps as DesignerPropsSchema, GenerateProps as GeneratePropsSchema, UIProps as UIPropsSchema, } from './schema.js';
|
4
|
+
import { MM_TO_PT_RATIO, PT_TO_MM_RATIO, PT_TO_PX_RATIO, DEFAULT_FONT_NAME, DEFAULT_FONT_VALUE, } from './constants.js';
|
5
5
|
const uniq = (array) => Array.from(new Set(array));
|
6
6
|
export const getFallbackFontName = (font) => {
|
7
7
|
const initial = '';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAA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ACnF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;AACjF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AAC/E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;AACzF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;AAC3F,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pdfme/common",
|
3
|
-
"version": "3.0.1-dev.
|
3
|
+
"version": "3.0.1-dev.16",
|
4
4
|
"sideEffects": false,
|
5
5
|
"author": "hand-dot",
|
6
6
|
"license": "MIT",
|
@@ -21,13 +21,15 @@
|
|
21
21
|
"bugs": {
|
22
22
|
"url": "https://github.com/pdfme/pdfme/issues"
|
23
23
|
},
|
24
|
+
"type": "module",
|
24
25
|
"main": "dist/cjs/src/index.js",
|
25
26
|
"module": "dist/esm/src/index.js",
|
26
27
|
"types": "dist/types/src/index.d.ts",
|
27
28
|
"exports": {
|
28
29
|
".": {
|
29
30
|
"import": "./dist/esm/src/index.js",
|
30
|
-
"require": "./dist/cjs/src/index.js"
|
31
|
+
"require": "./dist/cjs/src/index.js",
|
32
|
+
"types": "./dist/types/src/index.d.ts"
|
31
33
|
}
|
32
34
|
},
|
33
35
|
"engines": {
|
package/src/helper.ts
CHANGED
@@ -9,14 +9,14 @@ import {
|
|
9
9
|
DesignerProps as DesignerPropsSchema,
|
10
10
|
GenerateProps as GeneratePropsSchema,
|
11
11
|
UIProps as UIPropsSchema,
|
12
|
-
} from './schema';
|
12
|
+
} from './schema.js';
|
13
13
|
import {
|
14
14
|
MM_TO_PT_RATIO,
|
15
15
|
PT_TO_MM_RATIO,
|
16
16
|
PT_TO_PX_RATIO,
|
17
17
|
DEFAULT_FONT_NAME,
|
18
18
|
DEFAULT_FONT_VALUE,
|
19
|
-
} from './constants';
|
19
|
+
} from './constants.js';
|
20
20
|
|
21
21
|
const uniq = <T>(array: Array<T>) => Array.from(new Set(array));
|
22
22
|
|