@pdfme/schemas 5.3.8-dev.6 → 5.3.8-dev.61

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.
Files changed (250) hide show
  1. package/dist/cjs/__tests__/barcode.test.js +115 -116
  2. package/dist/cjs/__tests__/barcode.test.js.map +1 -1
  3. package/dist/cjs/__tests__/multiVariableText.test.js +15 -15
  4. package/dist/cjs/__tests__/multiVariableText.test.js.map +1 -1
  5. package/dist/cjs/__tests__/text.test.js +71 -71
  6. package/dist/cjs/__tests__/text.test.js.map +1 -1
  7. package/dist/cjs/__tests__/utils.test.js +76 -15
  8. package/dist/cjs/__tests__/utils.test.js.map +1 -1
  9. package/dist/cjs/src/barcodes/propPanel.js +3 -3
  10. package/dist/cjs/src/barcodes/propPanel.js.map +1 -1
  11. package/dist/cjs/src/checkbox/index.js +4 -4
  12. package/dist/cjs/src/checkbox/index.js.map +1 -1
  13. package/dist/cjs/src/date/date.js +2 -2
  14. package/dist/cjs/src/date/date.js.map +1 -1
  15. package/dist/cjs/src/date/dateTime.js +2 -2
  16. package/dist/cjs/src/date/dateTime.js.map +1 -1
  17. package/dist/cjs/src/date/helper.js +11 -11
  18. package/dist/cjs/src/date/helper.js.map +1 -1
  19. package/dist/cjs/src/date/time.js +2 -2
  20. package/dist/cjs/src/date/time.js.map +1 -1
  21. package/dist/cjs/src/graphics/svg.js +25 -2
  22. package/dist/cjs/src/graphics/svg.js.map +1 -1
  23. package/dist/cjs/src/index.js +30 -30
  24. package/dist/cjs/src/index.js.map +1 -1
  25. package/dist/cjs/src/multiVariableText/helper.js +2 -2
  26. package/dist/cjs/src/multiVariableText/helper.js.map +1 -1
  27. package/dist/cjs/src/multiVariableText/pdfRender.js +5 -5
  28. package/dist/cjs/src/multiVariableText/pdfRender.js.map +1 -1
  29. package/dist/cjs/src/multiVariableText/propPanel.js +19 -14
  30. package/dist/cjs/src/multiVariableText/propPanel.js.map +1 -1
  31. package/dist/cjs/src/multiVariableText/uiRender.js +24 -14
  32. package/dist/cjs/src/multiVariableText/uiRender.js.map +1 -1
  33. package/dist/cjs/src/radioGroup/index.js +4 -4
  34. package/dist/cjs/src/radioGroup/index.js.map +1 -1
  35. package/dist/cjs/src/select/index.js +9 -9
  36. package/dist/cjs/src/select/index.js.map +1 -1
  37. package/dist/cjs/src/shapes/line.js +1 -1
  38. package/dist/cjs/src/shapes/rectAndEllipse.js +8 -4
  39. package/dist/cjs/src/shapes/rectAndEllipse.js.map +1 -1
  40. package/dist/cjs/src/tables/classes.js +4 -4
  41. package/dist/cjs/src/tables/classes.js.map +1 -1
  42. package/dist/cjs/src/tables/dynamicTemplate.js +2 -2
  43. package/dist/cjs/src/tables/dynamicTemplate.js.map +1 -1
  44. package/dist/cjs/src/tables/helper.js +25 -25
  45. package/dist/cjs/src/tables/helper.js.map +1 -1
  46. package/dist/cjs/src/tables/pdfRender.js +8 -8
  47. package/dist/cjs/src/tables/pdfRender.js.map +1 -1
  48. package/dist/cjs/src/tables/tableHelper.js +5 -5
  49. package/dist/cjs/src/tables/tableHelper.js.map +1 -1
  50. package/dist/cjs/src/text/extraFormatter.js +14 -14
  51. package/dist/cjs/src/text/extraFormatter.js.map +1 -1
  52. package/dist/cjs/src/text/pdfRender.js +1 -1
  53. package/dist/cjs/src/text/pdfRender.js.map +1 -1
  54. package/dist/cjs/src/text/propPanel.js +2 -2
  55. package/dist/cjs/src/text/propPanel.js.map +1 -1
  56. package/dist/cjs/src/text/uiRender.js.map +1 -1
  57. package/dist/cjs/src/utils.js +52 -12
  58. package/dist/cjs/src/utils.js.map +1 -1
  59. package/dist/esm/__tests__/barcode.test.js +10 -11
  60. package/dist/esm/__tests__/barcode.test.js.map +1 -1
  61. package/dist/esm/__tests__/multiVariableText.test.js +1 -1
  62. package/dist/esm/__tests__/multiVariableText.test.js.map +1 -1
  63. package/dist/esm/__tests__/text.test.js +2 -2
  64. package/dist/esm/__tests__/text.test.js.map +1 -1
  65. package/dist/esm/__tests__/utils.test.js +65 -4
  66. package/dist/esm/__tests__/utils.test.js.map +1 -1
  67. package/dist/esm/src/barcodes/propPanel.js +3 -3
  68. package/dist/esm/src/barcodes/propPanel.js.map +1 -1
  69. package/dist/esm/src/checkbox/index.js +2 -2
  70. package/dist/esm/src/checkbox/index.js.map +1 -1
  71. package/dist/esm/src/date/date.js +1 -1
  72. package/dist/esm/src/date/date.js.map +1 -1
  73. package/dist/esm/src/date/dateTime.js +1 -1
  74. package/dist/esm/src/date/dateTime.js.map +1 -1
  75. package/dist/esm/src/date/helper.js +4 -4
  76. package/dist/esm/src/date/helper.js.map +1 -1
  77. package/dist/esm/src/date/time.js +1 -1
  78. package/dist/esm/src/date/time.js.map +1 -1
  79. package/dist/esm/src/graphics/svg.js +25 -2
  80. package/dist/esm/src/graphics/svg.js.map +1 -1
  81. package/dist/esm/src/index.js +14 -14
  82. package/dist/esm/src/index.js.map +1 -1
  83. package/dist/esm/src/multiVariableText/helper.js +2 -2
  84. package/dist/esm/src/multiVariableText/helper.js.map +1 -1
  85. package/dist/esm/src/multiVariableText/pdfRender.js +2 -2
  86. package/dist/esm/src/multiVariableText/pdfRender.js.map +1 -1
  87. package/dist/esm/src/multiVariableText/propPanel.js +15 -10
  88. package/dist/esm/src/multiVariableText/propPanel.js.map +1 -1
  89. package/dist/esm/src/multiVariableText/uiRender.js +18 -8
  90. package/dist/esm/src/multiVariableText/uiRender.js.map +1 -1
  91. package/dist/esm/src/radioGroup/index.js +2 -2
  92. package/dist/esm/src/radioGroup/index.js.map +1 -1
  93. package/dist/esm/src/select/index.js +2 -2
  94. package/dist/esm/src/select/index.js.map +1 -1
  95. package/dist/esm/src/shapes/line.js +1 -1
  96. package/dist/esm/src/shapes/rectAndEllipse.js +8 -4
  97. package/dist/esm/src/shapes/rectAndEllipse.js.map +1 -1
  98. package/dist/esm/src/tables/classes.js +1 -1
  99. package/dist/esm/src/tables/classes.js.map +1 -1
  100. package/dist/esm/src/tables/dynamicTemplate.js +1 -1
  101. package/dist/esm/src/tables/dynamicTemplate.js.map +1 -1
  102. package/dist/esm/src/tables/helper.js +5 -5
  103. package/dist/esm/src/tables/helper.js.map +1 -1
  104. package/dist/esm/src/tables/pdfRender.js +4 -4
  105. package/dist/esm/src/tables/pdfRender.js.map +1 -1
  106. package/dist/esm/src/tables/tableHelper.js +1 -1
  107. package/dist/esm/src/tables/tableHelper.js.map +1 -1
  108. package/dist/esm/src/text/extraFormatter.js +2 -2
  109. package/dist/esm/src/text/extraFormatter.js.map +1 -1
  110. package/dist/esm/src/text/pdfRender.js +1 -1
  111. package/dist/esm/src/text/pdfRender.js.map +1 -1
  112. package/dist/esm/src/text/propPanel.js +1 -1
  113. package/dist/esm/src/text/propPanel.js.map +1 -1
  114. package/dist/esm/src/text/uiRender.js.map +1 -1
  115. package/dist/esm/src/utils.js +52 -12
  116. package/dist/esm/src/utils.js.map +1 -1
  117. package/dist/node/__tests__/barcode.test.js +115 -116
  118. package/dist/node/__tests__/barcode.test.js.map +1 -1
  119. package/dist/node/__tests__/multiVariableText.test.js +15 -15
  120. package/dist/node/__tests__/multiVariableText.test.js.map +1 -1
  121. package/dist/node/__tests__/text.test.js +71 -71
  122. package/dist/node/__tests__/text.test.js.map +1 -1
  123. package/dist/node/__tests__/utils.test.js +76 -15
  124. package/dist/node/__tests__/utils.test.js.map +1 -1
  125. package/dist/node/src/barcodes/propPanel.js +3 -3
  126. package/dist/node/src/barcodes/propPanel.js.map +1 -1
  127. package/dist/node/src/checkbox/index.js +4 -4
  128. package/dist/node/src/checkbox/index.js.map +1 -1
  129. package/dist/node/src/date/date.js +2 -2
  130. package/dist/node/src/date/date.js.map +1 -1
  131. package/dist/node/src/date/dateTime.js +2 -2
  132. package/dist/node/src/date/dateTime.js.map +1 -1
  133. package/dist/node/src/date/helper.js +11 -11
  134. package/dist/node/src/date/helper.js.map +1 -1
  135. package/dist/node/src/date/time.js +2 -2
  136. package/dist/node/src/date/time.js.map +1 -1
  137. package/dist/node/src/graphics/svg.js +25 -2
  138. package/dist/node/src/graphics/svg.js.map +1 -1
  139. package/dist/node/src/index.js +30 -30
  140. package/dist/node/src/index.js.map +1 -1
  141. package/dist/node/src/multiVariableText/helper.js +2 -2
  142. package/dist/node/src/multiVariableText/helper.js.map +1 -1
  143. package/dist/node/src/multiVariableText/pdfRender.js +5 -5
  144. package/dist/node/src/multiVariableText/pdfRender.js.map +1 -1
  145. package/dist/node/src/multiVariableText/propPanel.js +19 -14
  146. package/dist/node/src/multiVariableText/propPanel.js.map +1 -1
  147. package/dist/node/src/multiVariableText/uiRender.js +24 -14
  148. package/dist/node/src/multiVariableText/uiRender.js.map +1 -1
  149. package/dist/node/src/radioGroup/index.js +4 -4
  150. package/dist/node/src/radioGroup/index.js.map +1 -1
  151. package/dist/node/src/select/index.js +9 -9
  152. package/dist/node/src/select/index.js.map +1 -1
  153. package/dist/node/src/shapes/line.js +1 -1
  154. package/dist/node/src/shapes/rectAndEllipse.js +8 -4
  155. package/dist/node/src/shapes/rectAndEllipse.js.map +1 -1
  156. package/dist/node/src/tables/classes.js +4 -4
  157. package/dist/node/src/tables/classes.js.map +1 -1
  158. package/dist/node/src/tables/dynamicTemplate.js +2 -2
  159. package/dist/node/src/tables/dynamicTemplate.js.map +1 -1
  160. package/dist/node/src/tables/helper.js +25 -25
  161. package/dist/node/src/tables/helper.js.map +1 -1
  162. package/dist/node/src/tables/pdfRender.js +8 -8
  163. package/dist/node/src/tables/pdfRender.js.map +1 -1
  164. package/dist/node/src/tables/tableHelper.js +5 -5
  165. package/dist/node/src/tables/tableHelper.js.map +1 -1
  166. package/dist/node/src/text/extraFormatter.js +14 -14
  167. package/dist/node/src/text/extraFormatter.js.map +1 -1
  168. package/dist/node/src/text/pdfRender.js +1 -1
  169. package/dist/node/src/text/pdfRender.js.map +1 -1
  170. package/dist/node/src/text/propPanel.js +2 -2
  171. package/dist/node/src/text/propPanel.js.map +1 -1
  172. package/dist/node/src/text/uiRender.js.map +1 -1
  173. package/dist/node/src/utils.js +52 -12
  174. package/dist/node/src/utils.js.map +1 -1
  175. package/dist/types/src/barcodes/helper.d.ts +1 -1
  176. package/dist/types/src/barcodes/index.d.ts +1 -1
  177. package/dist/types/src/barcodes/pdfRender.d.ts +1 -1
  178. package/dist/types/src/barcodes/propPanel.d.ts +1 -1
  179. package/dist/types/src/barcodes/uiRender.d.ts +1 -1
  180. package/dist/types/src/date/date.d.ts +1 -1
  181. package/dist/types/src/date/dateTime.d.ts +1 -1
  182. package/dist/types/src/date/helper.d.ts +1 -1
  183. package/dist/types/src/date/time.d.ts +1 -1
  184. package/dist/types/src/date/types.d.ts +6 -1
  185. package/dist/types/src/index.d.ts +15 -15
  186. package/dist/types/src/multiVariableText/helper.d.ts +1 -1
  187. package/dist/types/src/multiVariableText/index.d.ts +1 -1
  188. package/dist/types/src/multiVariableText/pdfRender.d.ts +1 -1
  189. package/dist/types/src/multiVariableText/propPanel.d.ts +1 -1
  190. package/dist/types/src/multiVariableText/types.d.ts +1 -1
  191. package/dist/types/src/multiVariableText/uiRender.d.ts +1 -1
  192. package/dist/types/src/select/index.d.ts +1 -1
  193. package/dist/types/src/tables/cell.d.ts +1 -1
  194. package/dist/types/src/tables/classes.d.ts +1 -1
  195. package/dist/types/src/tables/helper.d.ts +4 -4
  196. package/dist/types/src/tables/pdfRender.d.ts +1 -1
  197. package/dist/types/src/tables/propPanel.d.ts +1 -1
  198. package/dist/types/src/tables/tableHelper.d.ts +1 -1
  199. package/dist/types/src/tables/types.d.ts +1 -1
  200. package/dist/types/src/text/constants.d.ts +1 -1
  201. package/dist/types/src/text/helper.d.ts +1 -1
  202. package/dist/types/src/text/index.d.ts +1 -1
  203. package/dist/types/src/text/pdfRender.d.ts +1 -1
  204. package/dist/types/src/text/propPanel.d.ts +1 -1
  205. package/dist/types/src/text/uiRender.d.ts +1 -1
  206. package/eslint.config.mjs +22 -0
  207. package/package.json +3 -4
  208. package/src/barcodes/helper.ts +2 -3
  209. package/src/barcodes/index.ts +2 -2
  210. package/src/barcodes/pdfRender.ts +2 -2
  211. package/src/barcodes/propPanel.ts +4 -5
  212. package/src/barcodes/uiRender.ts +1 -1
  213. package/src/checkbox/index.ts +2 -2
  214. package/src/date/date.ts +1 -1
  215. package/src/date/dateTime.ts +1 -1
  216. package/src/date/helper.ts +20 -13
  217. package/src/date/time.ts +1 -1
  218. package/src/date/types.ts +7 -1
  219. package/src/graphics/imagehelper.ts +1 -1
  220. package/src/graphics/svg.ts +27 -2
  221. package/src/index.ts +14 -14
  222. package/src/multiVariableText/helper.ts +15 -7
  223. package/src/multiVariableText/index.ts +1 -1
  224. package/src/multiVariableText/pdfRender.ts +3 -3
  225. package/src/multiVariableText/propPanel.ts +19 -16
  226. package/src/multiVariableText/types.ts +1 -1
  227. package/src/multiVariableText/uiRender.ts +26 -23
  228. package/src/radioGroup/index.ts +3 -3
  229. package/src/select/index.ts +4 -4
  230. package/src/shapes/line.ts +1 -1
  231. package/src/shapes/rectAndEllipse.ts +10 -4
  232. package/src/tables/cell.ts +5 -5
  233. package/src/tables/classes.ts +7 -7
  234. package/src/tables/dynamicTemplate.ts +3 -3
  235. package/src/tables/helper.ts +7 -7
  236. package/src/tables/pdfRender.ts +9 -9
  237. package/src/tables/propPanel.ts +1 -1
  238. package/src/tables/tableHelper.ts +15 -12
  239. package/src/tables/types.ts +1 -1
  240. package/src/tables/uiRender.ts +6 -6
  241. package/src/text/constants.ts +1 -1
  242. package/src/text/extraFormatter.ts +2 -2
  243. package/src/text/helper.ts +6 -6
  244. package/src/text/index.ts +1 -1
  245. package/src/text/pdfRender.ts +4 -4
  246. package/src/text/propPanel.ts +2 -2
  247. package/src/text/uiRender.ts +14 -6
  248. package/src/utils.ts +60 -15
  249. package/tsconfig.esm.json +2 -1
  250. package/.eslintrc.cjs +0 -3
@@ -1,4 +1,4 @@
1
- import type { BarcodeSchema } from './types';
1
+ import type { BarcodeSchema } from './types.js';
2
2
  import { Plugin } from '@pdfme/common';
3
3
  declare const barcodes: Record<"qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce" | "gs1datamatrix", Plugin<BarcodeSchema>>;
4
4
  export default barcodes;
@@ -1,3 +1,3 @@
1
1
  import { PDFRenderProps } from '@pdfme/common';
2
- import type { BarcodeSchema } from './types';
2
+ import type { BarcodeSchema } from './types.js';
3
3
  export declare const pdfRender: (arg: PDFRenderProps<BarcodeSchema>) => Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import type { PropPanel } from '@pdfme/common';
2
- import type { BarcodeSchema } from './types';
2
+ import type { BarcodeSchema } from './types.js';
3
3
  export declare const getPropPanelByBarcodeType: (barcodeType: string) => PropPanel<BarcodeSchema>;
@@ -1,3 +1,3 @@
1
1
  import { UIRenderProps } from '@pdfme/common';
2
- import type { BarcodeSchema } from './types';
2
+ import type { BarcodeSchema } from './types.js';
3
3
  export declare const uiRender: (arg: UIRenderProps<BarcodeSchema>) => Promise<void>;
@@ -1,2 +1,2 @@
1
- declare const _default: import("@pdfme/common").Plugin<import("./types").DateSchema>;
1
+ declare const _default: import("@pdfme/common").Plugin<import("./types.js").DateSchema>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("@pdfme/common").Plugin<import("./types").DateSchema>;
1
+ declare const _default: import("@pdfme/common").Plugin<import("./types.js").DateSchema>;
2
2
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from '@pdfme/common';
2
- import { DateSchema } from './types';
2
+ import { DateSchema } from './types.js';
3
3
  type PickerType = 'date' | 'time' | 'dateTime';
4
4
  export declare const getPlugin: ({ type, icon }: {
5
5
  type: PickerType;
@@ -1,2 +1,2 @@
1
- declare const _default: import("@pdfme/common").Plugin<import("./types").DateSchema>;
1
+ declare const _default: import("@pdfme/common").Plugin<import("./types.js").DateSchema>;
2
2
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { Schema } from '@pdfme/common';
2
- import { ALIGNMENT } from '../text/types';
2
+ import { ALIGNMENT } from '../text/types.js';
3
3
  export interface DateSchema extends Schema {
4
4
  format: string;
5
5
  fontName?: string;
@@ -9,4 +9,9 @@ export interface DateSchema extends Schema {
9
9
  fontColor: string;
10
10
  backgroundColor: string;
11
11
  locale?: string;
12
+ width: number;
13
+ height: number;
14
+ name: string;
15
+ type: string;
16
+ content?: string;
12
17
  }
@@ -1,18 +1,18 @@
1
- import multiVariableText from './multiVariableText/index';
2
- import text from './text/index';
3
- import image from './graphics/image';
4
- import svg from './graphics/svg';
5
- import barcodes from './barcodes/index';
6
- import line from './shapes/line';
7
- import table from './tables/index';
8
- import { rectangle, ellipse } from './shapes/rectAndEllipse';
9
- import dateTime from './date/dateTime';
10
- import date from './date/date';
11
- import time from './date/time';
12
- import select from './select/index';
13
- import radioGroup from './radioGroup/index';
14
- import checkbox from './checkbox/index';
1
+ import multiVariableText from './multiVariableText/index.js';
2
+ import text from './text/index.js';
3
+ import image from './graphics/image.js';
4
+ import svg from './graphics/svg.js';
5
+ import barcodes from './barcodes/index.js';
6
+ import line from './shapes/line.js';
7
+ import table from './tables/index.js';
8
+ import { rectangle, ellipse } from './shapes/rectAndEllipse.js';
9
+ import dateTime from './date/dateTime.js';
10
+ import date from './date/date.js';
11
+ import time from './date/time.js';
12
+ import select from './select/index.js';
13
+ import radioGroup from './radioGroup/index.js';
14
+ import checkbox from './checkbox/index.js';
15
15
  declare const builtInPlugins: {
16
- Text: import("@pdfme/common").Plugin<import("./text/types").TextSchema>;
16
+ Text: import("@pdfme/common").Plugin<import("./text/types.js").TextSchema>;
17
17
  };
18
18
  export { builtInPlugins, text, multiVariableText, image, svg, table, barcodes, line, rectangle, ellipse, dateTime, date, time, select, radioGroup, checkbox, };
@@ -1,3 +1,3 @@
1
- import { MultiVariableTextSchema } from "./types";
1
+ import { MultiVariableTextSchema } from './types.js';
2
2
  export declare const substituteVariables: (text: string, variablesIn: string | Record<string, string>) => string;
3
3
  export declare const validateVariables: (value: string, schema: MultiVariableTextSchema) => boolean;
@@ -1,4 +1,4 @@
1
1
  import type { Plugin } from '@pdfme/common';
2
- import type { MultiVariableTextSchema } from './types';
2
+ import type { MultiVariableTextSchema } from './types.js';
3
3
  declare const schema: Plugin<MultiVariableTextSchema>;
4
4
  export default schema;
@@ -1,3 +1,3 @@
1
1
  import { PDFRenderProps } from '@pdfme/common';
2
- import { MultiVariableTextSchema } from './types';
2
+ import { MultiVariableTextSchema } from './types.js';
3
3
  export declare const pdfRender: (arg: PDFRenderProps<MultiVariableTextSchema>) => Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import { PropPanel } from '@pdfme/common';
2
- import { MultiVariableTextSchema } from './types';
2
+ import { MultiVariableTextSchema } from './types.js';
3
3
  export declare const propPanel: PropPanel<MultiVariableTextSchema>;
@@ -1,4 +1,4 @@
1
- import type { TextSchema } from '../text/types';
1
+ import type { TextSchema } from '../text/types.js';
2
2
  export interface MultiVariableTextSchema extends TextSchema {
3
3
  text: string;
4
4
  variables: string[];
@@ -1,3 +1,3 @@
1
1
  import { UIRenderProps } from '@pdfme/common';
2
- import { MultiVariableTextSchema } from './types';
2
+ import { MultiVariableTextSchema } from './types.js';
3
3
  export declare const uiRender: (arg: UIRenderProps<MultiVariableTextSchema>) => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from '@pdfme/common';
2
- import { TextSchema } from '../text/types';
2
+ import { TextSchema } from '../text/types.js';
3
3
  interface Select extends TextSchema {
4
4
  options: string[];
5
5
  }
@@ -1,4 +1,4 @@
1
1
  import { Plugin } from '@pdfme/common';
2
- import type { CellSchema } from './types';
2
+ import type { CellSchema } from './types.js';
3
3
  declare const cellSchema: Plugin<CellSchema>;
4
4
  export default cellSchema;
@@ -1,5 +1,5 @@
1
1
  import { Font } from '@pdfme/common';
2
- import type { Styles, TableInput, Settings, Section, StylesProps } from './types';
2
+ import type { Styles, TableInput, Settings, Section, StylesProps } from './types.js';
3
3
  type ContentSettings = {
4
4
  body: Row[];
5
5
  head: Row[];
@@ -1,7 +1,7 @@
1
1
  export declare const getDefaultCellStyles: () => {
2
2
  fontName: undefined;
3
- alignment: import("../text/types").ALIGNMENT;
4
- verticalAlignment: import("../text/types").VERTICAL_ALIGNMENT;
3
+ alignment: import("../text/types.js").ALIGNMENT;
4
+ verticalAlignment: import("../text/types.js").VERTICAL_ALIGNMENT;
5
5
  fontSize: number;
6
6
  lineHeight: number;
7
7
  characterSpacing: number;
@@ -182,7 +182,7 @@ export declare const getCellPropPanelSchema: (arg: {
182
182
  props: {
183
183
  options: {
184
184
  label: string;
185
- value: import("../text/types").ALIGNMENT;
185
+ value: import("../text/types.js").ALIGNMENT;
186
186
  }[];
187
187
  };
188
188
  span: number;
@@ -194,7 +194,7 @@ export declare const getCellPropPanelSchema: (arg: {
194
194
  props: {
195
195
  options: {
196
196
  label: string;
197
- value: import("../text/types").VERTICAL_ALIGNMENT;
197
+ value: import("../text/types.js").VERTICAL_ALIGNMENT;
198
198
  }[];
199
199
  };
200
200
  span: number;
@@ -1,3 +1,3 @@
1
- import type { TableSchema } from './types';
1
+ import type { TableSchema } from './types.js';
2
2
  import type { PDFRenderProps } from '@pdfme/common';
3
3
  export declare const pdfRender: (arg: PDFRenderProps<TableSchema>) => Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import type { PropPanel } from '@pdfme/common';
2
- import type { TableSchema } from './types';
2
+ import type { TableSchema } from './types.js';
3
3
  export declare const propPanel: PropPanel<TableSchema>;
@@ -1,5 +1,5 @@
1
1
  import { Schema, BasePdf, CommonOptions } from '@pdfme/common';
2
- import { Table } from './classes';
2
+ import { Table } from './classes.js';
3
3
  interface CreateTableArgs {
4
4
  schema: Schema;
5
5
  basePdf: BasePdf;
@@ -1,4 +1,4 @@
1
- import type { ALIGNMENT, VERTICAL_ALIGNMENT } from '../text/types';
1
+ import type { ALIGNMENT, VERTICAL_ALIGNMENT } from '../text/types.js';
2
2
  import type { Schema } from '@pdfme/common';
3
3
  export type Spacing = {
4
4
  top: number;
@@ -1,4 +1,4 @@
1
- import { ALIGNMENT, VERTICAL_ALIGNMENT, DYNAMIC_FONT_SIZE_FIT } from './types';
1
+ import { ALIGNMENT, VERTICAL_ALIGNMENT, DYNAMIC_FONT_SIZE_FIT } from './types.js';
2
2
  export declare const DEFAULT_FONT_SIZE = 13;
3
3
  export declare const ALIGN_LEFT: ALIGNMENT;
4
4
  export declare const ALIGN_CENTER: ALIGNMENT;
@@ -1,7 +1,7 @@
1
1
  import * as fontkit from 'fontkit';
2
2
  import type { Font as FontKitFont } from 'fontkit';
3
3
  import { Font } from '@pdfme/common';
4
- import type { TextSchema, FontWidthCalcValues } from './types';
4
+ import type { TextSchema, FontWidthCalcValues } from './types.js';
5
5
  export declare const getBrowserVerticalFontAdjustments: (fontKitFont: FontKitFont, fontSize: number, lineHeight: number, verticalAlignment: string) => {
6
6
  topAdj: number;
7
7
  bottomAdj: number;
@@ -1,4 +1,4 @@
1
1
  import type { Plugin } from '@pdfme/common';
2
- import type { TextSchema } from './types';
2
+ import type { TextSchema } from './types.js';
3
3
  declare const textSchema: Plugin<TextSchema>;
4
4
  export default textSchema;
@@ -1,3 +1,3 @@
1
- import type { TextSchema } from './types';
1
+ import type { TextSchema } from './types.js';
2
2
  import { PDFRenderProps } from '@pdfme/common';
3
3
  export declare const pdfRender: (arg: PDFRenderProps<TextSchema>) => Promise<void>;
@@ -1,3 +1,3 @@
1
1
  import { PropPanel } from '@pdfme/common';
2
- import type { TextSchema } from './types';
2
+ import type { TextSchema } from './types.js';
3
3
  export declare const propPanel: PropPanel<TextSchema>;
@@ -1,6 +1,6 @@
1
1
  import type { Font as FontKitFont } from 'fontkit';
2
2
  import { UIRenderProps } from '@pdfme/common';
3
- import type { TextSchema } from './types';
3
+ import type { TextSchema } from './types.js';
4
4
  export declare const uiRender: (arg: UIRenderProps<TextSchema>) => Promise<void>;
5
5
  export declare const buildStyledTextContainer: (arg: UIRenderProps<TextSchema>, fontKitFont: FontKitFont, value: string) => HTMLDivElement;
6
6
  /**
@@ -0,0 +1,22 @@
1
+ import { fileURLToPath } from 'url';
2
+ import { dirname, resolve } from 'path';
3
+
4
+ const __filename = fileURLToPath(import.meta.url);
5
+ const __dirname = dirname(__filename);
6
+
7
+ // Import the root config
8
+ const rootConfigPath = resolve(__dirname, '../../eslint.config.mjs');
9
+ const rootConfig = await import(rootConfigPath);
10
+
11
+ export default [
12
+ ...rootConfig.default,
13
+ {
14
+ files: ['src/**/*.ts'],
15
+ languageOptions: {
16
+ parserOptions: {
17
+ project: ['./tsconfig.esm.json'],
18
+ tsconfigRootDir: __dirname,
19
+ },
20
+ },
21
+ },
22
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfme/schemas",
3
- "version": "5.3.8-dev.6",
3
+ "version": "5.3.8-dev.61",
4
4
  "sideEffects": false,
5
5
  "author": "hand-dot",
6
6
  "license": "MIT",
@@ -49,7 +49,7 @@
49
49
  "build:esm": "tsc -p tsconfig.esm.json",
50
50
  "build:node": "tsc -p tsconfig.node.json",
51
51
  "clean": "rimraf dist",
52
- "lint": "eslint --ext .ts src",
52
+ "lint": "eslint --ext .ts src --config eslint.config.mjs --no-error-on-unmatched-pattern",
53
53
  "test": "jest",
54
54
  "prune": "ts-prune src",
55
55
  "prettier": "prettier --write 'src/**/*.ts'"
@@ -59,9 +59,8 @@
59
59
  "air-datepicker": "^3.5.3",
60
60
  "bwip-js": "^4.1.1",
61
61
  "date-fns": "^4.1.0",
62
- "fast-xml-parser": "^4.3.2",
63
62
  "fontkit": "^2.0.2",
64
- "lucide": "^0.460.0"
63
+ "lucide": "^0.477.0"
65
64
  },
66
65
  "devDependencies": {
67
66
  "@pdfme/common": "file:../common",
@@ -2,7 +2,7 @@ import { b64toUint8Array } from '@pdfme/common';
2
2
  import bwipjs, { RenderOptions } from 'bwip-js';
3
3
  import { Buffer } from 'buffer';
4
4
  import { BARCODE_TYPES, DEFAULT_BARCODE_INCLUDETEXT } from './constants.js';
5
- import { BarcodeTypes } from './types';
5
+ import { BarcodeTypes } from './types.js';
6
6
 
7
7
  // GTIN-13, GTIN-8, GTIN-12, GTIN-14
8
8
  const validateCheckDigit = (input: string, checkDigitPos: number) => {
@@ -63,7 +63,7 @@ export const validateBarcodeInput = (type: BarcodeTypes, input: string) => {
63
63
  // 有効文字は漢字、ひらがな、カタカナ以外。
64
64
  // https://qiita.com/graminume/items/2ac8dd9c32277fa9da64
65
65
  return !input.match(
66
- /([\u30a0-\u30ff\u3040-\u309f\u3005-\u3006\u30e0-\u9fcf]|[A-Za-z0-9!"#$%&'()*+,-./:;<=>?@[\]^_`{|}〜 ])+/
66
+ /([\u30a0-\u30ff\u3040-\u309f\u3005-\u3006\u30e0-\u9fcf]|[A-Za-z0-9!"#$%&'()*+,-./:;<=>?@[\]^_`{|}〜 ])+/,
67
67
  );
68
68
  }
69
69
  if (type === 'nw7') {
@@ -176,4 +176,3 @@ export const createBarCode = async (arg: {
176
176
 
177
177
  return res;
178
178
  };
179
-
@@ -1,7 +1,7 @@
1
1
  import { pdfRender } from './pdfRender.js';
2
2
  import { getPropPanelByBarcodeType } from './propPanel.js';
3
3
  import { uiRender } from './uiRender.js';
4
- import type { BarcodeSchema, BarcodeTypes } from './types';
4
+ import type { BarcodeSchema, BarcodeTypes } from './types.js';
5
5
  import { BARCODE_TYPES } from './constants.js';
6
6
  import { createSvgStr } from '../utils.js';
7
7
  import { Plugin } from '@pdfme/common';
@@ -17,7 +17,7 @@ const barcodes = BARCODE_TYPES.reduce(
17
17
  icon: createSvgStr(type == 'qrcode' ? QrCode : Barcode),
18
18
  },
19
19
  }),
20
- {} as Record<BarcodeTypes, Plugin<BarcodeSchema>>
20
+ {} as Record<BarcodeTypes, Plugin<BarcodeSchema>>,
21
21
  );
22
22
 
23
23
  export default barcodes;
@@ -1,6 +1,6 @@
1
1
  import { PDFRenderProps } from '@pdfme/common';
2
2
  import { convertForPdfLayoutProps } from '../utils.js';
3
- import type { BarcodeSchema } from './types';
3
+ import type { BarcodeSchema } from './types.js';
4
4
  import { createBarCode, validateBarcodeInput } from './helper.js';
5
5
 
6
6
  const getBarcodeCacheKey = (schema: BarcodeSchema, value: string) => {
@@ -15,7 +15,7 @@ export const pdfRender = async (arg: PDFRenderProps<BarcodeSchema>) => {
15
15
  let image = _cache.get(inputBarcodeCacheKey);
16
16
  if (!image) {
17
17
  const imageBuf = await createBarCode(
18
- Object.assign(schema, { type: schema.type, input: value })
18
+ Object.assign(schema, { type: schema.type, input: value }),
19
19
  );
20
20
  image = await pdfDoc.embedPng(imageBuf);
21
21
  _cache.set(inputBarcodeCacheKey, image);
@@ -1,5 +1,5 @@
1
1
  import type { PropPanel } from '@pdfme/common';
2
- import type { BarcodeSchema } from './types';
2
+ import type { BarcodeSchema } from './types.js';
3
3
  import {
4
4
  DEFAULT_BARCODE_COLOR,
5
5
  DEFAULT_BARCODE_BG_COLOR,
@@ -16,7 +16,6 @@ const defaultIncludetext = { includetext: DEFAULT_BARCODE_INCLUDETEXT };
16
16
  const position = { x: 0, y: 0 };
17
17
  const default40x20 = { width: 40, height: 20 };
18
18
 
19
-
20
19
  const barcodeDefaults: { defaultSchema: BarcodeSchema }[] = [
21
20
  {
22
21
  defaultSchema: {
@@ -190,7 +189,7 @@ export const getPropPanelByBarcodeType = (barcodeType: string): PropPanel<Barcod
190
189
  type: 'string',
191
190
  widget: 'color',
192
191
  props: {
193
- disabledAlpha: true
192
+ disabledAlpha: true,
194
193
  },
195
194
  rules: [
196
195
  {
@@ -204,7 +203,7 @@ export const getPropPanelByBarcodeType = (barcodeType: string): PropPanel<Barcod
204
203
  type: 'string',
205
204
  widget: 'color',
206
205
  props: {
207
- disabledAlpha: true
206
+ disabledAlpha: true,
208
207
  },
209
208
  rules: [
210
209
  {
@@ -220,7 +219,7 @@ export const getPropPanelByBarcodeType = (barcodeType: string): PropPanel<Barcod
220
219
  type: 'string',
221
220
  widget: 'color',
222
221
  props: {
223
- disabledAlpha: true
222
+ disabledAlpha: true,
224
223
  },
225
224
  },
226
225
  includetext: {
@@ -1,6 +1,6 @@
1
1
  import type * as CSS from 'csstype';
2
2
  import { UIRenderProps } from '@pdfme/common';
3
- import type { BarcodeSchema } from './types';
3
+ import type { BarcodeSchema } from './types.js';
4
4
  import { validateBarcodeInput, createBarCode } from './helper.js';
5
5
  import { addAlphaToHex, isEditable, createErrorElm } from '../utils.js';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { Plugin } from '@pdfme/common';
2
2
  import { Schema } from '@pdfme/common';
3
- import svg from '../graphics/svg';
3
+ import svg from '../graphics/svg.js';
4
4
  import { isEditable } from '../utils.js';
5
5
  import { HEX_COLOR_PATTERN } from '../constants.js';
6
6
  import { Square, SquareCheck } from 'lucide';
@@ -49,7 +49,7 @@ const schema: Plugin<Checkbox> = {
49
49
  type: 'string',
50
50
  widget: 'color',
51
51
  props: {
52
- disabledAlpha: true
52
+ disabledAlpha: true,
53
53
  },
54
54
  required: true,
55
55
  rules: [{ pattern: HEX_COLOR_PATTERN, message: i18n('validation.hexColor') }],
package/src/date/date.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { getPlugin } from './helper';
1
+ import { getPlugin } from './helper.js';
2
2
  import { createSvgStr } from '../utils.js';
3
3
  import { Calendar } from 'lucide';
4
4
 
@@ -1,4 +1,4 @@
1
- import { getPlugin } from './helper';
1
+ import { getPlugin } from './helper.js';
2
2
  import { createSvgStr } from '../utils.js';
3
3
  import { CalendarClock } from 'lucide';
4
4
 
@@ -1,7 +1,7 @@
1
1
  import type * as CSS from 'csstype';
2
2
 
3
3
  import AirDatepicker from 'air-datepicker';
4
- import type { AirDatepickerLocale, AirDatepickerButton } from 'air-datepicker';
4
+ import type { AirDatepickerLocale, AirDatepickerButton, AirDatepickerDate } from 'air-datepicker';
5
5
  import localeAr from 'air-datepicker/locale/ar';
6
6
  import localeBg from 'air-datepicker/locale/bg';
7
7
  import localeCa from 'air-datepicker/locale/ca';
@@ -40,9 +40,9 @@ import * as dateFns from 'date-fns/locale';
40
40
  import { format } from 'date-fns';
41
41
 
42
42
  import { Plugin, getFallbackFontName, DEFAULT_FONT_NAME, PropPanelSchema } from '@pdfme/common';
43
- import text from '../text';
43
+ import text from '../text/index.js';
44
44
  import { DEFAULT_OPACITY, HEX_COLOR_PATTERN } from '../constants.js';
45
- import { mapVerticalAlignToFlex } from '../text/uiRender';
45
+ import { mapVerticalAlignToFlex } from '../text/uiRender.js';
46
46
  import {
47
47
  DEFAULT_FONT_SIZE,
48
48
  DEFAULT_ALIGNMENT,
@@ -51,9 +51,16 @@ import {
51
51
  DEFAULT_CHARACTER_SPACING,
52
52
  DEFAULT_FONT_COLOR,
53
53
  } from '../text/constants.js';
54
- import { DateSchema } from './types';
55
- import { getExtraFormatterSchema, Formatter } from '../text/extraFormatter';
56
- import { isEditable } from '../utils';
54
+ import { DateSchema } from './types.js';
55
+ import { getExtraFormatterSchema, Formatter } from '../text/extraFormatter.js';
56
+ import { isEditable } from '../utils.js';
57
+
58
+ interface AirDatepickerInstance {
59
+ selectedDates: Date[];
60
+ hide: () => void;
61
+ destroy: () => void;
62
+ show: () => void;
63
+ }
57
64
 
58
65
  type PickerType = 'date' | 'time' | 'dateTime';
59
66
 
@@ -162,7 +169,7 @@ const getFmtValue = (
162
169
  value: string,
163
170
  type: PickerType,
164
171
  schema: DateSchema,
165
- locale: Locale
172
+ locale: Locale,
166
173
  ): string => {
167
174
  return value
168
175
  ? format(strDateToDate(value, type), schema.format, {
@@ -259,16 +266,16 @@ export const getPlugin = ({ type, icon }: { type: PickerType; icon: string }) =>
259
266
  },
260
267
  });
261
268
  }
262
-
263
269
  const airDatepicker = new AirDatepicker(input, {
264
270
  locale: locale.adLocale,
265
271
  selectedDates: [strDateToDate(value, type)],
266
- dateFormat: (date) => format(date, schema.format, { locale: locale.formatLocale }),
272
+ dateFormat: (date: AirDatepickerDate) =>
273
+ format(date, schema.format, { locale: locale.formatLocale }),
267
274
  timepicker: type !== 'date',
268
275
  onlyTimepicker: type === 'time',
269
276
  isMobile: window.innerWidth < 768,
270
277
  buttons: adButtons,
271
- onSelect: ({ datepicker }) => {
278
+ onSelect: ({ datepicker }: { datepicker: AirDatepickerInstance }) => {
272
279
  if (type === 'date') {
273
280
  commitChange(datepicker.selectedDates.length ? datepicker.selectedDates[0] : null);
274
281
  datepicker.hide();
@@ -311,7 +318,7 @@ export const getPlugin = ({ type, icon }: { type: PickerType; icon: string }) =>
311
318
  const fallbackFontName = getFallbackFontName(font);
312
319
 
313
320
  const locale = getAirDatepickerLocale(
314
- (activeSchema as any).locale || options.lang || defaultLocale
321
+ (activeSchema as any).locale || options.lang || defaultLocale,
315
322
  );
316
323
 
317
324
  if (
@@ -326,7 +333,7 @@ export const getPlugin = ({ type, icon }: { type: PickerType; icon: string }) =>
326
333
 
327
334
  const formatter = getExtraFormatterSchema(i18n);
328
335
  formatter.buttons = formatter.buttons.filter(
329
- (button) => button.key === Formatter.ALIGNMENT
336
+ (button) => button.key === Formatter.ALIGNMENT,
330
337
  );
331
338
 
332
339
  const validateDateTimeFormat = (_rule: any, formatString: string): boolean => {
@@ -441,7 +448,7 @@ export const getPlugin = ({ type, icon }: { type: PickerType; icon: string }) =>
441
448
  backgroundColor: '',
442
449
  locale: undefined,
443
450
  opacity: DEFAULT_OPACITY,
444
- },
451
+ } as DateSchema,
445
452
  },
446
453
  icon,
447
454
  };
package/src/date/time.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { getPlugin } from './helper';
1
+ import { getPlugin } from './helper.js';
2
2
  import { createSvgStr } from '../utils.js';
3
3
  import { Clock } from 'lucide';
4
4
 
package/src/date/types.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Schema } from '@pdfme/common';
2
- import { ALIGNMENT } from '../text/types';
2
+ import { ALIGNMENT } from '../text/types.js';
3
3
 
4
4
  export interface DateSchema extends Schema {
5
5
  format: string;
@@ -10,4 +10,10 @@ export interface DateSchema extends Schema {
10
10
  fontColor: string;
11
11
  backgroundColor: string;
12
12
  locale?: string;
13
+ // Explicitly include these properties from Schema for TypeScript
14
+ width: number;
15
+ height: number;
16
+ name: string;
17
+ type: string;
18
+ content?: string;
13
19
  }
@@ -150,7 +150,7 @@ const imageSize = (imgBuffer: Buffer): { height: number; width: number } => {
150
150
  }
151
151
 
152
152
  throw new TypeError(
153
- '[@pdfme/schemas/images] Unsupported file type: ' + (type === undefined ? 'undefined' : type)
153
+ '[@pdfme/schemas/images] Unsupported file type: ' + (type === undefined ? 'undefined' : type),
154
154
  );
155
155
  };
156
156
  // ----------------------------
@@ -1,5 +1,4 @@
1
1
  import { Plugin, Schema } from '@pdfme/common';
2
- import { XMLValidator } from 'fast-xml-parser';
3
2
  import {
4
3
  convertForPdfLayoutProps,
5
4
  isEditable,
@@ -9,7 +8,33 @@ import {
9
8
  } from '../utils.js';
10
9
  import { Route } from 'lucide';
11
10
 
12
- const isValidSVG = (svgString: string) => XMLValidator.validate(svgString) === true;
11
+ const isValidSVG = (svgString: string): boolean => {
12
+ try {
13
+ // Basic validation checks that work in both Node.js and browser
14
+ if (!svgString || typeof svgString !== 'string') {
15
+ return false;
16
+ }
17
+
18
+ // Check for basic SVG structure
19
+ if (!svgString.includes('<svg') || !svgString.includes('</svg>')) {
20
+ return false;
21
+ }
22
+
23
+ // Additional browser-specific validation if DOMParser is available
24
+ if (typeof DOMParser !== 'undefined') {
25
+ const parser = new DOMParser();
26
+ const doc = parser.parseFromString(svgString, 'image/svg+xml');
27
+ const parserError = doc.querySelector('parsererror');
28
+ if (parserError !== null) {
29
+ return false;
30
+ }
31
+ }
32
+
33
+ return true;
34
+ } catch (error) {
35
+ return false;
36
+ }
37
+ };
13
38
 
14
39
  const defaultValue = `<svg viewBox="0 0 488 600" version="1.1" xmlns="http://www.w3.org/2000/svg">
15
40
  <g transform="matrix(1,0,0,1,-56,0)" fill="#000000" stroke="none">