@pdfme/common 5.3.1-dev.7 → 5.3.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.
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_FONT_VALUE = exports.DEFAULT_FONT_NAME = exports.BLANK_PDF = exports.ZOOM = exports.MM_TO_PT_RATIO = exports.PT_TO_MM_RATIO = exports.PT_TO_PX_RATIO = void 0;
3
+ exports.DEFAULT_FONT_VALUE = exports.DEFAULT_FONT_NAME = exports.BLANK_PDF = exports.ZOOM = exports.MM_TO_PT_RATIO = exports.PT_TO_MM_RATIO = exports.PT_TO_PX_RATIO = exports.PDFME_VERSION = void 0;
4
+ // This value is auto-replaced with the latest Git tag during the build, including npm releases, so no manual updates are needed.
5
+ exports.PDFME_VERSION = '5.3.1';
4
6
  exports.PT_TO_PX_RATIO = 1.333;
5
7
  exports.PT_TO_MM_RATIO = 0.3528;
6
8
  exports.MM_TO_PT_RATIO = 2.8346; // https://www.ddc.co.jp/words/archives/20090701114500.html
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,KAAK,CAAC;AACvB,QAAA,cAAc,GAAG,MAAM,CAAC;AACxB,QAAA,cAAc,GAAG,MAAM,CAAC,CAAC,2DAA2D;AACpF,QAAA,IAAI,GAAG,YAAY,CAAC;AAEjC,6BAA6B;AAC7B,uCAAuC;AACvC,gBAAgB;AAChB,iBAAiB;AACjB,+BAA+B;AAC/B,KAAK;AAEQ,QAAA,SAAS,GACpB,8kCAA8kC,CAAC;AACpkC,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAC7B,QAAA,kBAAkB,GAC7B,mwxKAAmwxK,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":";;;AAAA,iIAAiI;AACpH,QAAA,aAAa,GAAG,OAAO,CAAC;AACxB,QAAA,cAAc,GAAG,KAAK,CAAC;AACvB,QAAA,cAAc,GAAG,MAAM,CAAC;AACxB,QAAA,cAAc,GAAG,MAAM,CAAC,CAAC,2DAA2D;AACpF,QAAA,IAAI,GAAG,YAAY,CAAC;AAEjC,6BAA6B;AAC7B,uCAAuC;AACvC,gBAAgB;AAChB,iBAAiB;AACjB,+BAA+B;AAC/B,KAAK;AAEQ,QAAA,SAAS,GACpB,8kCAA8kC,CAAC;AACpkC,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAC7B,QAAA,kBAAkB,GAC7B,mwxKAAmwxK,CAAC"}
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkGenerateProps = exports.checkDesignerProps = exports.checkPreviewProps = exports.checkUIProps = exports.checkTemplate = exports.checkUIOptions = exports.checkInputs = exports.checkFont = exports.replacePlaceholders = exports.getDynamicTemplate = exports.isBlankPdf = exports.getInputFromTemplate = exports.isHexValid = exports.px2mm = exports.pt2px = exports.pt2mm = exports.mm2pt = exports.b64toUint8Array = exports.getB64BasePdf = exports.getDefaultFont = exports.getFallbackFontName = exports.cloneDeep = exports.DEFAULT_FONT_NAME = exports.ZOOM = exports.BLANK_PDF = exports.PT_TO_PX_RATIO = exports.PT_TO_MM_RATIO = exports.MM_TO_PT_RATIO = exports.PDFME_VERSION = void 0;
4
- const version_1 = require("./version");
5
- Object.defineProperty(exports, "PDFME_VERSION", { enumerable: true, get: function () { return version_1.PDFME_VERSION; } });
6
4
  const constants_1 = require("./constants");
5
+ Object.defineProperty(exports, "PDFME_VERSION", { enumerable: true, get: function () { return constants_1.PDFME_VERSION; } });
7
6
  Object.defineProperty(exports, "MM_TO_PT_RATIO", { enumerable: true, get: function () { return constants_1.MM_TO_PT_RATIO; } });
8
7
  Object.defineProperty(exports, "PT_TO_MM_RATIO", { enumerable: true, get: function () { return constants_1.PT_TO_MM_RATIO; } });
9
8
  Object.defineProperty(exports, "PT_TO_PX_RATIO", { enumerable: true, get: function () { return constants_1.PT_TO_PX_RATIO; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;AAAA,uCAAwC;AAiEtC,8FAjEM,uBAAa,OAiEN;AAhEf,2CAOqB;AA0DnB,+FAhEA,0BAAc,OAgEA;AACd,+FAhEA,0BAAc,OAgEA;AACd,+FAhEA,0BAAc,OAgEA;AACd,0FAhEA,qBAAS,OAgEA;AACT,qFAhEA,gBAAI,OAgEA;AACJ,kGAhEA,6BAAiB,OAgEA;AAhCnB,qCAqBkB;AAYhB,0FAhCA,kBAAS,OAgCA;AACT,oGAhCA,4BAAmB,OAgCA;AACnB,+FAhCA,uBAAc,OAgCA;AACd,8FAhCA,sBAAa,OAgCA;AACb,gGAhCA,wBAAe,OAgCA;AAUf,0FAzCA,kBAAS,OAyCA;AACT,4FAzCA,oBAAW,OAyCA;AACX,+FAzCA,uBAAc,OAyCA;AACd,8FAzCA,sBAAa,OAyCA;AACb,6FAzCA,qBAAY,OAyCA;AACZ,kGAzCA,0BAAiB,OAyCA;AACjB,mGAzCA,2BAAkB,OAyCA;AAClB,mGAzCA,2BAAkB,OAyCA;AAhBlB,sFAxBA,cAAK,OAwBA;AACL,sFAxBA,cAAK,OAwBA;AACL,sFAxBA,cAAK,OAwBA;AACL,sFAxBA,cAAK,OAwBA;AACL,2FAxBA,mBAAU,OAwBA;AACV,qGAxBA,6BAAoB,OAwBA;AACpB,2FAxBA,mBAAU,OAwBA;AAtBZ,uDAAuD;AAuBrD,mGAvBO,oCAAkB,OAuBP;AAtBpB,6CAAmD;AAuBjD,oGAvBO,gCAAmB,OAuBP"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;AAAA,2CAQqB;AAyDnB,8FAhEA,yBAAa,OAgEA;AACb,+FAhEA,0BAAc,OAgEA;AACd,+FAhEA,0BAAc,OAgEA;AACd,+FAhEA,0BAAc,OAgEA;AACd,0FAhEA,qBAAS,OAgEA;AACT,qFAhEA,gBAAI,OAgEA;AACJ,kGAhEA,6BAAiB,OAgEA;AAhCnB,qCAqBkB;AAYhB,0FAhCA,kBAAS,OAgCA;AACT,oGAhCA,4BAAmB,OAgCA;AACnB,+FAhCA,uBAAc,OAgCA;AACd,8FAhCA,sBAAa,OAgCA;AACb,gGAhCA,wBAAe,OAgCA;AAUf,0FAzCA,kBAAS,OAyCA;AACT,4FAzCA,oBAAW,OAyCA;AACX,+FAzCA,uBAAc,OAyCA;AACd,8FAzCA,sBAAa,OAyCA;AACb,6FAzCA,qBAAY,OAyCA;AACZ,kGAzCA,0BAAiB,OAyCA;AACjB,mGAzCA,2BAAkB,OAyCA;AAClB,mGAzCA,2BAAkB,OAyCA;AAhBlB,sFAxBA,cAAK,OAwBA;AACL,sFAxBA,cAAK,OAwBA;AACL,sFAxBA,cAAK,OAwBA;AACL,sFAxBA,cAAK,OAwBA;AACL,2FAxBA,mBAAU,OAwBA;AACV,qGAxBA,6BAAoB,OAwBA;AACpB,2FAxBA,mBAAU,OAwBA;AAtBZ,uDAAuD;AAuBrD,mGAvBO,oCAAkB,OAuBP;AAtBpB,6CAAmD;AAuBjD,oGAvBO,gCAAmB,OAuBP"}
@@ -1,3 +1,5 @@
1
+ // This value is auto-replaced with the latest Git tag during the build, including npm releases, so no manual updates are needed.
2
+ export const PDFME_VERSION = '5.3.1';
1
3
  export const PT_TO_PX_RATIO = 1.333;
2
4
  export const PT_TO_MM_RATIO = 0.3528;
3
5
  export const MM_TO_PT_RATIO = 2.8346; // https://www.ddc.co.jp/words/archives/20090701114500.html
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AACpC,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,2DAA2D;AACjG,MAAM,CAAC,MAAM,IAAI,GAAG,YAAY,CAAC;AAEjC,6BAA6B;AAC7B,uCAAuC;AACvC,gBAAgB;AAChB,iBAAiB;AACjB,+BAA+B;AAC/B,KAAK;AAEL,MAAM,CAAC,MAAM,SAAS,GACpB,8kCAA8kC,CAAC;AACjlC,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAC1C,MAAM,CAAC,MAAM,kBAAkB,GAC7B,mwxKAAmwxK,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AACpC,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,2DAA2D;AACjG,MAAM,CAAC,MAAM,IAAI,GAAG,YAAY,CAAC;AAEjC,6BAA6B;AAC7B,uCAAuC;AACvC,gBAAgB;AAChB,iBAAiB;AACjB,+BAA+B;AAC/B,KAAK;AAEL,MAAM,CAAC,MAAM,SAAS,GACpB,8kCAA8kC,CAAC;AACjlC,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAC1C,MAAM,CAAC,MAAM,kBAAkB,GAC7B,mwxKAAmwxK,CAAC"}
@@ -1,5 +1,4 @@
1
- import { PDFME_VERSION } from './version';
2
- import { MM_TO_PT_RATIO, PT_TO_MM_RATIO, PT_TO_PX_RATIO, BLANK_PDF, ZOOM, DEFAULT_FONT_NAME, } from './constants';
1
+ import { PDFME_VERSION, MM_TO_PT_RATIO, PT_TO_MM_RATIO, PT_TO_PX_RATIO, BLANK_PDF, ZOOM, DEFAULT_FONT_NAME, } from './constants';
3
2
  import { cloneDeep, getFallbackFontName, getDefaultFont, getB64BasePdf, b64toUint8Array, checkFont, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, mm2pt, pt2mm, pt2px, px2mm, isHexValid, getInputFromTemplate, isBlankPdf, } from './helper';
4
3
  import { getDynamicTemplate } from './dynamicTemplate';
5
4
  import { replacePlaceholders } from './expression';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,EACT,IAAI,EACJ,iBAAiB,GAClB,MAAM,aAAa,CAAC;AA+BrB,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,eAAe,EACf,SAAS,EACT,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,UAAU,EACV,oBAAoB,EACpB,UAAU,GACX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,EACT,IAAI,EACJ,iBAAiB,EACjB,SAAS,EACT,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,eAAe,EACf,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,UAAU,EACV,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,EACT,IAAI,EACJ,iBAAiB,GAClB,MAAM,aAAa,CAAC;AA+BrB,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,eAAe,EACf,SAAS,EACT,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,UAAU,EACV,oBAAoB,EACpB,UAAU,GACX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,EACT,IAAI,EACJ,iBAAiB,EACjB,SAAS,EACT,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,eAAe,EACf,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,UAAU,EACV,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,CAAC"}
@@ -1,3 +1,4 @@
1
+ export declare const PDFME_VERSION = "5.3.1";
1
2
  export declare const PT_TO_PX_RATIO = 1.333;
2
3
  export declare const PT_TO_MM_RATIO = 0.3528;
3
4
  export declare const MM_TO_PT_RATIO = 2.8346;
@@ -1,5 +1,4 @@
1
- import { PDFME_VERSION } from './version';
2
- import { MM_TO_PT_RATIO, PT_TO_MM_RATIO, PT_TO_PX_RATIO, BLANK_PDF, ZOOM, DEFAULT_FONT_NAME } from './constants';
1
+ import { PDFME_VERSION, MM_TO_PT_RATIO, PT_TO_MM_RATIO, PT_TO_PX_RATIO, BLANK_PDF, ZOOM, DEFAULT_FONT_NAME } from './constants';
3
2
  import type { ChangeSchemaItem, ChangeSchemas, SchemaPageArray, PropPanel, PropPanelSchema, PropPanelWidgetProps, PDFRenderProps, Mode, UIRenderProps, Plugin, Lang, Dict, Size, Schema, SchemaForUI, Font, ColorType, BasePdf, BlankPdf, Template, CommonOptions, GeneratorOptions, Plugins, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps } from './types';
4
3
  import { cloneDeep, getFallbackFontName, getDefaultFont, getB64BasePdf, b64toUint8Array, checkFont, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, mm2pt, pt2mm, pt2px, px2mm, isHexValid, getInputFromTemplate, isBlankPdf } from './helper';
5
4
  import { getDynamicTemplate } from './dynamicTemplate';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfme/common",
3
- "version": "5.3.1-dev.7",
3
+ "version": "5.3.1",
4
4
  "sideEffects": false,
5
5
  "author": "hand-dot",
6
6
  "license": "MIT",
@@ -32,8 +32,8 @@
32
32
  }
33
33
  },
34
34
  "scripts": {
35
- "dev": "node set-version.js && tsc -p tsconfig.esm.json -w",
36
- "prebuild": "node set-version.js",
35
+ "dev": "tsc -p tsconfig.esm.json -w",
36
+ "prebuild": "node replace-version.js",
37
37
  "build": "npm-run-all --parallel build:cjs build:esm",
38
38
  "build:cjs": "tsc -p tsconfig.cjs.json",
39
39
  "build:esm": "tsc -p tsconfig.esm.json",
@@ -0,0 +1,20 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const { execSync } = require('child_process');
4
+
5
+ try {
6
+ const gitTag = execSync('git describe --tags $(git rev-list --tags --max-count=1)', { encoding: 'utf8' }).trim();
7
+
8
+ const filePath = path.join(__dirname, 'src/constants.ts');
9
+
10
+ let content = fs.readFileSync(filePath, 'utf8');
11
+
12
+ content = content.replace(/export const PDFME_VERSION = '.*';/, `export const PDFME_VERSION = '${gitTag}';`);
13
+
14
+ fs.writeFileSync(filePath, content, 'utf8');
15
+
16
+ console.log(`Replaced PDFME_VERSION with '${gitTag}' in ${filePath}`);
17
+ } catch (error) {
18
+ console.error('Error replacing PDFME_VERSION:', error);
19
+ process.exit(1);
20
+ }
package/src/constants.ts CHANGED
@@ -1,3 +1,5 @@
1
+ // This value is auto-replaced with the latest Git tag during the build, including npm releases, so no manual updates are needed.
2
+ export const PDFME_VERSION = '5.3.1';
1
3
  export const PT_TO_PX_RATIO = 1.333;
2
4
  export const PT_TO_MM_RATIO = 0.3528;
3
5
  export const MM_TO_PT_RATIO = 2.8346; // https://www.ddc.co.jp/words/archives/20090701114500.html
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- import {PDFME_VERSION} from './version';
2
1
  import {
2
+ PDFME_VERSION,
3
3
  MM_TO_PT_RATIO,
4
4
  PT_TO_MM_RATIO,
5
5
  PT_TO_PX_RATIO,
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PDFME_VERSION = void 0;
4
- exports.PDFME_VERSION = '5.3.1';
5
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,OAAO,CAAC"}
@@ -1,2 +0,0 @@
1
- export const PDFME_VERSION = '5.3.1';
2
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC"}
@@ -1 +0,0 @@
1
- export declare const PDFME_VERSION = "5.3.1";
package/set-version.js DELETED
@@ -1,29 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const { execSync } = require('child_process');
4
-
5
- try {
6
- const gitTag = execSync('git describe --tags $(git rev-list --tags --max-count=1)', { encoding: 'utf8' }).trim();
7
-
8
- const filePath = path.join(__dirname, 'src/version.ts');
9
- let content = '';
10
-
11
- if (!fs.existsSync(filePath)) {
12
- content = `export const PDFME_VERSION = '${gitTag}';\n`;
13
- } else {
14
- content = fs.readFileSync(filePath, 'utf8');
15
- const versionRegex = /export const PDFME_VERSION = '.*';/;
16
-
17
- if (versionRegex.test(content)) {
18
- content = content.replace(versionRegex, `export const PDFME_VERSION = '${gitTag}';`);
19
- } else {
20
- content += `\nexport const PDFME_VERSION = '${gitTag}';\n`;
21
- }
22
- }
23
-
24
- fs.writeFileSync(filePath, content, 'utf8');
25
- console.log(`Replaced PDFME_VERSION with '${gitTag}' in ${filePath}`);
26
- } catch (error) {
27
- console.error('Error replacing PDFME_VERSION:', error);
28
- process.exit(1);
29
- }
package/src/version.ts DELETED
@@ -1 +0,0 @@
1
- export const PDFME_VERSION = '5.3.1';