@pdfme/schemas 5.3.8-dev.23 → 5.3.8-dev.26

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 (145) hide show
  1. package/dist/cjs/src/checkbox/index.js +3 -3
  2. package/dist/cjs/src/checkbox/index.js.map +1 -1
  3. package/dist/cjs/src/date/date.js +2 -2
  4. package/dist/cjs/src/date/date.js.map +1 -1
  5. package/dist/cjs/src/date/dateTime.js +2 -2
  6. package/dist/cjs/src/date/dateTime.js.map +1 -1
  7. package/dist/cjs/src/date/helper.js +11 -11
  8. package/dist/cjs/src/date/helper.js.map +1 -1
  9. package/dist/cjs/src/date/time.js +2 -2
  10. package/dist/cjs/src/date/time.js.map +1 -1
  11. package/dist/cjs/src/index.js +30 -30
  12. package/dist/cjs/src/index.js.map +1 -1
  13. package/dist/cjs/src/multiVariableText/helper.js +2 -2
  14. package/dist/cjs/src/multiVariableText/helper.js.map +1 -1
  15. package/dist/cjs/src/multiVariableText/pdfRender.js +5 -5
  16. package/dist/cjs/src/multiVariableText/pdfRender.js.map +1 -1
  17. package/dist/cjs/src/multiVariableText/uiRender.js +10 -10
  18. package/dist/cjs/src/multiVariableText/uiRender.js.map +1 -1
  19. package/dist/cjs/src/radioGroup/index.js +3 -3
  20. package/dist/cjs/src/radioGroup/index.js.map +1 -1
  21. package/dist/cjs/src/tables/classes.js +4 -4
  22. package/dist/cjs/src/tables/classes.js.map +1 -1
  23. package/dist/cjs/src/tables/dynamicTemplate.js +2 -2
  24. package/dist/cjs/src/tables/dynamicTemplate.js.map +1 -1
  25. package/dist/cjs/src/tables/helper.js +21 -21
  26. package/dist/cjs/src/tables/helper.js.map +1 -1
  27. package/dist/cjs/src/tables/pdfRender.js +8 -8
  28. package/dist/cjs/src/tables/pdfRender.js.map +1 -1
  29. package/dist/cjs/src/tables/tableHelper.js +5 -5
  30. package/dist/cjs/src/tables/tableHelper.js.map +1 -1
  31. package/dist/cjs/src/text/propPanel.js +2 -2
  32. package/dist/cjs/src/text/propPanel.js.map +1 -1
  33. package/dist/esm/src/checkbox/index.js +1 -1
  34. package/dist/esm/src/checkbox/index.js.map +1 -1
  35. package/dist/esm/src/date/date.js +1 -1
  36. package/dist/esm/src/date/date.js.map +1 -1
  37. package/dist/esm/src/date/dateTime.js +1 -1
  38. package/dist/esm/src/date/dateTime.js.map +1 -1
  39. package/dist/esm/src/date/helper.js +4 -4
  40. package/dist/esm/src/date/helper.js.map +1 -1
  41. package/dist/esm/src/date/time.js +1 -1
  42. package/dist/esm/src/date/time.js.map +1 -1
  43. package/dist/esm/src/index.js +14 -14
  44. package/dist/esm/src/index.js.map +1 -1
  45. package/dist/esm/src/multiVariableText/helper.js +2 -2
  46. package/dist/esm/src/multiVariableText/helper.js.map +1 -1
  47. package/dist/esm/src/multiVariableText/pdfRender.js +2 -2
  48. package/dist/esm/src/multiVariableText/pdfRender.js.map +1 -1
  49. package/dist/esm/src/multiVariableText/uiRender.js +4 -4
  50. package/dist/esm/src/multiVariableText/uiRender.js.map +1 -1
  51. package/dist/esm/src/radioGroup/index.js +1 -1
  52. package/dist/esm/src/radioGroup/index.js.map +1 -1
  53. package/dist/esm/src/tables/classes.js +1 -1
  54. package/dist/esm/src/tables/classes.js.map +1 -1
  55. package/dist/esm/src/tables/dynamicTemplate.js +1 -1
  56. package/dist/esm/src/tables/dynamicTemplate.js.map +1 -1
  57. package/dist/esm/src/tables/helper.js +1 -1
  58. package/dist/esm/src/tables/helper.js.map +1 -1
  59. package/dist/esm/src/tables/pdfRender.js +4 -4
  60. package/dist/esm/src/tables/pdfRender.js.map +1 -1
  61. package/dist/esm/src/tables/tableHelper.js +1 -1
  62. package/dist/esm/src/tables/tableHelper.js.map +1 -1
  63. package/dist/esm/src/text/propPanel.js +1 -1
  64. package/dist/esm/src/text/propPanel.js.map +1 -1
  65. package/dist/node/src/checkbox/index.js +3 -3
  66. package/dist/node/src/checkbox/index.js.map +1 -1
  67. package/dist/node/src/date/date.js +2 -2
  68. package/dist/node/src/date/date.js.map +1 -1
  69. package/dist/node/src/date/dateTime.js +2 -2
  70. package/dist/node/src/date/dateTime.js.map +1 -1
  71. package/dist/node/src/date/helper.js +11 -11
  72. package/dist/node/src/date/helper.js.map +1 -1
  73. package/dist/node/src/date/time.js +2 -2
  74. package/dist/node/src/date/time.js.map +1 -1
  75. package/dist/node/src/index.js +30 -30
  76. package/dist/node/src/index.js.map +1 -1
  77. package/dist/node/src/multiVariableText/helper.js +2 -2
  78. package/dist/node/src/multiVariableText/helper.js.map +1 -1
  79. package/dist/node/src/multiVariableText/pdfRender.js +5 -5
  80. package/dist/node/src/multiVariableText/pdfRender.js.map +1 -1
  81. package/dist/node/src/multiVariableText/uiRender.js +10 -10
  82. package/dist/node/src/multiVariableText/uiRender.js.map +1 -1
  83. package/dist/node/src/radioGroup/index.js +3 -3
  84. package/dist/node/src/radioGroup/index.js.map +1 -1
  85. package/dist/node/src/tables/classes.js +4 -4
  86. package/dist/node/src/tables/classes.js.map +1 -1
  87. package/dist/node/src/tables/dynamicTemplate.js +2 -2
  88. package/dist/node/src/tables/dynamicTemplate.js.map +1 -1
  89. package/dist/node/src/tables/helper.js +21 -21
  90. package/dist/node/src/tables/helper.js.map +1 -1
  91. package/dist/node/src/tables/pdfRender.js +8 -8
  92. package/dist/node/src/tables/pdfRender.js.map +1 -1
  93. package/dist/node/src/tables/tableHelper.js +5 -5
  94. package/dist/node/src/tables/tableHelper.js.map +1 -1
  95. package/dist/node/src/text/propPanel.js +2 -2
  96. package/dist/node/src/text/propPanel.js.map +1 -1
  97. package/dist/types/src/barcodes/pdfRender.d.ts +1 -1
  98. package/dist/types/src/barcodes/propPanel.d.ts +1 -1
  99. package/dist/types/src/barcodes/uiRender.d.ts +1 -1
  100. package/dist/types/src/date/date.d.ts +1 -1
  101. package/dist/types/src/date/dateTime.d.ts +1 -1
  102. package/dist/types/src/date/helper.d.ts +1 -1
  103. package/dist/types/src/date/time.d.ts +1 -1
  104. package/dist/types/src/date/types.d.ts +1 -1
  105. package/dist/types/src/index.d.ts +15 -15
  106. package/dist/types/src/multiVariableText/helper.d.ts +1 -1
  107. package/dist/types/src/multiVariableText/index.d.ts +1 -1
  108. package/dist/types/src/multiVariableText/pdfRender.d.ts +1 -1
  109. package/dist/types/src/multiVariableText/types.d.ts +1 -1
  110. package/dist/types/src/multiVariableText/uiRender.d.ts +1 -1
  111. package/dist/types/src/tables/cell.d.ts +1 -1
  112. package/dist/types/src/tables/classes.d.ts +1 -1
  113. package/dist/types/src/tables/helper.d.ts +4 -4
  114. package/dist/types/src/tables/pdfRender.d.ts +1 -1
  115. package/dist/types/src/tables/propPanel.d.ts +1 -1
  116. package/dist/types/src/tables/tableHelper.d.ts +1 -1
  117. package/dist/types/src/tables/types.d.ts +1 -1
  118. package/dist/types/src/text/propPanel.d.ts +1 -1
  119. package/package.json +1 -1
  120. package/src/barcodes/pdfRender.ts +1 -1
  121. package/src/barcodes/propPanel.ts +1 -1
  122. package/src/barcodes/uiRender.ts +1 -1
  123. package/src/checkbox/index.ts +1 -1
  124. package/src/date/date.ts +1 -1
  125. package/src/date/dateTime.ts +1 -1
  126. package/src/date/helper.ts +5 -5
  127. package/src/date/time.ts +1 -1
  128. package/src/date/types.ts +1 -1
  129. package/src/index.ts +14 -14
  130. package/src/multiVariableText/helper.ts +15 -7
  131. package/src/multiVariableText/index.ts +1 -1
  132. package/src/multiVariableText/pdfRender.ts +3 -3
  133. package/src/multiVariableText/types.ts +1 -1
  134. package/src/multiVariableText/uiRender.ts +5 -5
  135. package/src/radioGroup/index.ts +1 -1
  136. package/src/tables/cell.ts +1 -1
  137. package/src/tables/classes.ts +2 -2
  138. package/src/tables/dynamicTemplate.ts +2 -2
  139. package/src/tables/helper.ts +1 -1
  140. package/src/tables/pdfRender.ts +6 -6
  141. package/src/tables/propPanel.ts +1 -1
  142. package/src/tables/tableHelper.ts +2 -2
  143. package/src/tables/types.ts +1 -1
  144. package/src/text/propPanel.ts +2 -2
  145. package/tsconfig.esm.json +2 -1
@@ -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;
@@ -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,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,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,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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfme/schemas",
3
- "version": "5.3.8-dev.23",
3
+ "version": "5.3.8-dev.26",
4
4
  "sideEffects": false,
5
5
  "author": "hand-dot",
6
6
  "license": "MIT",
@@ -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) => {
@@ -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,
@@ -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';
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
 
@@ -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,9 @@ 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
57
 
58
58
  type PickerType = 'date' | 'time' | 'dateTime';
59
59
 
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;
package/src/index.ts CHANGED
@@ -1,17 +1,17 @@
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
 
16
16
  const builtInPlugins = { Text: text };
17
17
 
@@ -1,14 +1,18 @@
1
- import { MultiVariableTextSchema } from "./types";
1
+ import { MultiVariableTextSchema } from './types.js';
2
2
 
3
- export const substituteVariables = (text: string, variablesIn: string | Record<string, string>): string => {
3
+ export const substituteVariables = (
4
+ text: string,
5
+ variablesIn: string | Record<string, string>
6
+ ): string => {
4
7
  if (!text) {
5
- return "";
8
+ return '';
6
9
  }
7
10
 
8
11
  let substitutedText = text;
9
12
 
10
13
  if (variablesIn) {
11
- const variables: Record<string, string> = (typeof variablesIn === "string") ? JSON.parse(variablesIn) || {} : variablesIn;
14
+ const variables: Record<string, string> =
15
+ typeof variablesIn === 'string' ? JSON.parse(variablesIn) || {} : variablesIn;
12
16
 
13
17
  Object.keys(variables).forEach((variableName) => {
14
18
  // handle special characters in variable name
@@ -33,13 +37,17 @@ export const validateVariables = (value: string, schema: MultiVariableTextSchema
33
37
  try {
34
38
  values = value ? JSON.parse(value) : {};
35
39
  } catch (e) {
36
- throw new SyntaxError(`[@pdfme/generator] invalid JSON string '${value}' for variables in field ${schema.name}`);
40
+ throw new SyntaxError(
41
+ `[@pdfme/generator] invalid JSON string '${value}' for variables in field ${schema.name}`
42
+ );
37
43
  }
38
44
 
39
45
  for (const variable of schema.variables) {
40
46
  if (!values[variable]) {
41
47
  if (schema.required) {
42
- throw new Error(`[@pdfme/generator] variable ${variable} is missing for field ${schema.name}`);
48
+ throw new Error(
49
+ `[@pdfme/generator] variable ${variable} is missing for field ${schema.name}`
50
+ );
43
51
  }
44
52
  // If not required, then simply don't render this field if an input is missing
45
53
  return false;
@@ -47,4 +55,4 @@ export const validateVariables = (value: string, schema: MultiVariableTextSchema
47
55
  }
48
56
 
49
57
  return true;
50
- }
58
+ };
@@ -2,7 +2,7 @@ import type { Plugin } from '@pdfme/common';
2
2
  import { pdfRender } from './pdfRender.js';
3
3
  import { propPanel } from './propPanel.js';
4
4
  import { uiRender } from './uiRender.js';
5
- import type { MultiVariableTextSchema } from './types';
5
+ import type { MultiVariableTextSchema } from './types.js';
6
6
  import { Type } from 'lucide';
7
7
  import { createSvgStr } from '../utils.js';
8
8
 
@@ -1,7 +1,7 @@
1
1
  import { PDFRenderProps } from '@pdfme/common';
2
- import { MultiVariableTextSchema } from './types';
3
- import { pdfRender as parentPdfRender } from '../text/pdfRender';
4
- import { substituteVariables, validateVariables } from './helper';
2
+ import { MultiVariableTextSchema } from './types.js';
3
+ import { pdfRender as parentPdfRender } from '../text/pdfRender.js';
4
+ import { substituteVariables, validateVariables } from './helper.js';
5
5
 
6
6
  export const pdfRender = async (arg: PDFRenderProps<MultiVariableTextSchema>) => {
7
7
  const { value, schema, ...rest } = arg;
@@ -1,4 +1,4 @@
1
- import type { TextSchema } from '../text/types';
1
+ import type { TextSchema } from '../text/types.js';
2
2
 
3
3
  export interface MultiVariableTextSchema extends TextSchema {
4
4
  text: string;
@@ -1,13 +1,13 @@
1
1
  import { getDefaultFont, UIRenderProps } from '@pdfme/common';
2
- import { MultiVariableTextSchema } from './types';
2
+ import { MultiVariableTextSchema } from './types.js';
3
3
  import {
4
4
  uiRender as parentUiRender,
5
5
  buildStyledTextContainer,
6
6
  makeElementPlainTextContentEditable
7
- } from '../text/uiRender';
8
- import { isEditable } from '../utils';
9
- import { getFontKitFont } from '../text/helper';
10
- import { substituteVariables } from './helper';
7
+ } from '../text/uiRender.js';
8
+ import { isEditable } from '../utils.js';
9
+ import { getFontKitFont } from '../text/helper.js';
10
+ import { substituteVariables } from './helper.js';
11
11
 
12
12
  export const uiRender = async (arg: UIRenderProps<MultiVariableTextSchema>) => {
13
13
  const { value, schema, rootElement, mode, onChange, ...rest } = arg;
@@ -1,7 +1,7 @@
1
1
  import { Plugin } from '@pdfme/common';
2
2
  import { Schema } from '@pdfme/common';
3
3
  import { Circle, CircleDot } from 'lucide';
4
- import svg from '../graphics/svg';
4
+ import svg from '../graphics/svg.js';
5
5
  import { isEditable, createSvgStr } from '../utils.js';
6
6
  import { HEX_COLOR_PATTERN } from '../constants.js';
7
7
 
@@ -9,7 +9,7 @@ import { uiRender as textUiRender } from '../text/uiRender.js';
9
9
  import { pdfRender as textPdfRender } from '../text/pdfRender.js';
10
10
  import line from '../shapes/line.js';
11
11
  import { rectangle } from '../shapes/rectAndEllipse.js';
12
- import type { CellSchema } from './types';
12
+ import type { CellSchema } from './types.js';
13
13
  import { getCellPropPanelSchema, getDefaultCellStyles } from './helper.js';
14
14
  const linePdfRender = line.pdf;
15
15
  const rectanglePdfRender = rectangle.pdf;
@@ -1,7 +1,7 @@
1
1
  import { Font, mm2pt, pt2mm } from '@pdfme/common';
2
2
  import type { Font as FontKitFont } from 'fontkit';
3
- import { splitTextToSize, getFontKitFont, widthOfTextAtSize } from '../text/helper';
4
- import type { Styles, TableInput, Settings, Section, StylesProps } from './types';
3
+ import { splitTextToSize, getFontKitFont, widthOfTextAtSize } from '../text/helper.js';
4
+ import type { Styles, TableInput, Settings, Section, StylesProps } from './types.js';
5
5
 
6
6
  type ContentSettings = { body: Row[]; head: Row[]; columns: Column[] };
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { Schema, BasePdf, CommonOptions } from '@pdfme/common';
2
- import { createSingleTable } from './tableHelper';
2
+ import { createSingleTable } from './tableHelper.js';
3
3
  import { getBodyWithRange, getBody } from './helper.js';
4
- import { TableSchema } from './types';
4
+ import { TableSchema } from './types.js';
5
5
 
6
6
  export const getDynamicHeightsForTable = async (
7
7
  value: string,
@@ -10,7 +10,7 @@ import {
10
10
  VERTICAL_ALIGN_TOP,
11
11
  VERTICAL_ALIGN_MIDDLE,
12
12
  VERTICAL_ALIGN_BOTTOM,
13
- } from '../text/constants';
13
+ } from '../text/constants.js';
14
14
  import { HEX_COLOR_PATTERN } from '../constants.js';
15
15
 
16
16
  export const getDefaultCellStyles = () => ({
@@ -1,10 +1,10 @@
1
- import type { TableSchema } from './types';
1
+ import type { TableSchema } from './types.js';
2
2
  import type { PDFRenderProps } from '@pdfme/common';
3
- import { Cell, Table, Row, Column } from './classes';
4
- import { rectangle } from '../shapes/rectAndEllipse';
5
- import cell from './cell';
6
- import { getBodyWithRange } from './helper';
7
- import { createSingleTable } from './tableHelper';
3
+ import { Cell, Table, Row, Column } from './classes.js';
4
+ import { rectangle } from '../shapes/rectAndEllipse.js';
5
+ import cell from './cell.js';
6
+ import { getBodyWithRange } from './helper.js';
7
+ import { createSingleTable } from './tableHelper.js';
8
8
 
9
9
  type Pos = { x: number; y: number };
10
10
 
@@ -1,5 +1,5 @@
1
1
  import type { PropPanel } from '@pdfme/common';
2
- import type { TableSchema } from './types';
2
+ import type { TableSchema } from './types.js';
3
3
  import { getFallbackFontName, DEFAULT_FONT_NAME } from '@pdfme/common';
4
4
  import {
5
5
  getDefaultCellStyles,
@@ -15,8 +15,8 @@ import type {
15
15
  TableInput,
16
16
  StylesProps,
17
17
  Section,
18
- } from './types';
19
- import { Cell, Column, Row, Table } from './classes';
18
+ } from './types.js';
19
+ import { Cell, Column, Row, Table } from './classes.js';
20
20
 
21
21
  type StyleProp = 'styles' | 'headStyles' | 'bodyStyles' | 'alternateRowStyles' | 'columnStyles';
22
22
 
@@ -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
 
4
4
  export type Spacing = { top: number; right: number; bottom: number; left: number };
@@ -5,7 +5,7 @@ import {
5
5
  PropPanelSchema,
6
6
  getFallbackFontName,
7
7
  } from '@pdfme/common';
8
- import type { TextSchema } from './types';
8
+ import type { TextSchema } from './types.js';
9
9
  import {
10
10
  DEFAULT_FONT_SIZE,
11
11
  DEFAULT_ALIGNMENT,
@@ -20,7 +20,7 @@ import {
20
20
  DEFAULT_DYNAMIC_MAX_FONT_SIZE,
21
21
  } from './constants.js';
22
22
  import { DEFAULT_OPACITY, HEX_COLOR_PATTERN } from '../constants.js';
23
- import { getExtraFormatterSchema } from './extraFormatter';
23
+ import { getExtraFormatterSchema } from './extraFormatter.js';
24
24
 
25
25
  const UseDynamicFontSize = (props: PropPanelWidgetProps) => {
26
26
  const { rootElement, changeSchemas, activeSchema, i18n } = props;
package/tsconfig.esm.json CHANGED
@@ -2,9 +2,10 @@
2
2
  "extends": "../../tsconfig.base",
3
3
  "compilerOptions": {
4
4
  "module": "ESNext",
5
+ "moduleResolution": "nodenext",
5
6
  "outDir": "./dist/esm",
6
7
  "declaration": true,
7
8
  "declarationDir": "dist/types",
8
9
  "skipLibCheck": true
9
10
  }
10
- }
11
+ }