@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.
Files changed (173) hide show
  1. package/dist/cjs/__tests__/{renderUtils.test.js → utils.test.js} +38 -12
  2. package/dist/cjs/__tests__/utils.test.js.map +1 -0
  3. package/dist/cjs/src/barcodes/constants.js +2 -1
  4. package/dist/cjs/src/barcodes/constants.js.map +1 -1
  5. package/dist/cjs/src/barcodes/helper.js +1 -2
  6. package/dist/cjs/src/barcodes/helper.js.map +1 -1
  7. package/dist/cjs/src/barcodes/index.js +2 -2
  8. package/dist/cjs/src/barcodes/index.js.map +1 -1
  9. package/dist/cjs/src/barcodes/pdfRender.js +3 -3
  10. package/dist/cjs/src/barcodes/pdfRender.js.map +1 -1
  11. package/dist/cjs/src/barcodes/propPanel.js +19 -2
  12. package/dist/cjs/src/barcodes/propPanel.js.map +1 -1
  13. package/dist/cjs/src/barcodes/uiRender.js +9 -32
  14. package/dist/cjs/src/barcodes/uiRender.js.map +1 -1
  15. package/dist/cjs/src/graphics/helper.js +115 -0
  16. package/dist/cjs/src/graphics/helper.js.map +1 -0
  17. package/dist/cjs/src/graphics/image.js +179 -0
  18. package/dist/cjs/src/graphics/image.js.map +1 -0
  19. package/dist/cjs/src/graphics/svg.js +96 -0
  20. package/dist/cjs/src/graphics/svg.js.map +1 -0
  21. package/dist/cjs/src/index.js +42 -11
  22. package/dist/cjs/src/index.js.map +1 -1
  23. package/dist/cjs/src/shapes/line.js +57 -0
  24. package/dist/cjs/src/shapes/line.js.map +1 -0
  25. package/dist/cjs/src/shapes/rectAndEllipse.js +100 -0
  26. package/dist/cjs/src/shapes/rectAndEllipse.js.map +1 -0
  27. package/dist/cjs/src/text/helper.js.map +1 -1
  28. package/dist/cjs/src/text/index.js +16 -2
  29. package/dist/cjs/src/text/index.js.map +1 -1
  30. package/dist/cjs/src/text/pdfRender.js +5 -5
  31. package/dist/cjs/src/text/pdfRender.js.map +1 -1
  32. package/dist/cjs/src/text/uiRender.js +3 -3
  33. package/dist/cjs/src/text/uiRender.js.map +1 -1
  34. package/dist/cjs/src/{renderUtils.js → utils.js} +55 -7
  35. package/dist/cjs/src/utils.js.map +1 -0
  36. package/dist/esm/__tests__/{renderUtils.test.js → utils.test.js} +34 -8
  37. package/dist/esm/__tests__/utils.test.js.map +1 -0
  38. package/dist/esm/src/barcodes/constants.js +1 -0
  39. package/dist/esm/src/barcodes/constants.js.map +1 -1
  40. package/dist/esm/src/barcodes/helper.js +2 -3
  41. package/dist/esm/src/barcodes/helper.js.map +1 -1
  42. package/dist/esm/src/barcodes/index.js +2 -2
  43. package/dist/esm/src/barcodes/index.js.map +1 -1
  44. package/dist/esm/src/barcodes/pdfRender.js +2 -2
  45. package/dist/esm/src/barcodes/pdfRender.js.map +1 -1
  46. package/dist/esm/src/barcodes/propPanel.js +20 -3
  47. package/dist/esm/src/barcodes/propPanel.js.map +1 -1
  48. package/dist/esm/src/barcodes/uiRender.js +9 -32
  49. package/dist/esm/src/barcodes/uiRender.js.map +1 -1
  50. package/dist/esm/src/graphics/helper.js +111 -0
  51. package/dist/esm/src/graphics/helper.js.map +1 -0
  52. package/dist/esm/src/graphics/image.js +176 -0
  53. package/dist/esm/src/graphics/image.js.map +1 -0
  54. package/dist/esm/src/graphics/svg.js +93 -0
  55. package/dist/esm/src/graphics/svg.js.map +1 -0
  56. package/dist/esm/src/index.js +7 -5
  57. package/dist/esm/src/index.js.map +1 -1
  58. package/dist/esm/src/shapes/line.js +55 -0
  59. package/dist/esm/src/shapes/line.js.map +1 -0
  60. package/dist/esm/src/shapes/rectAndEllipse.js +97 -0
  61. package/dist/esm/src/shapes/rectAndEllipse.js.map +1 -0
  62. package/dist/esm/src/text/helper.js.map +1 -1
  63. package/dist/esm/src/text/index.js +15 -2
  64. package/dist/esm/src/text/index.js.map +1 -1
  65. package/dist/esm/src/text/pdfRender.js +1 -1
  66. package/dist/esm/src/text/pdfRender.js.map +1 -1
  67. package/dist/esm/src/text/uiRender.js +2 -2
  68. package/dist/esm/src/text/uiRender.js.map +1 -1
  69. package/dist/esm/src/{renderUtils.js → utils.js} +52 -6
  70. package/dist/esm/src/utils.js.map +1 -0
  71. package/dist/types/src/barcodes/constants.d.ts +1 -0
  72. package/dist/types/src/barcodes/helper.d.ts +1 -0
  73. package/dist/types/src/barcodes/index.d.ts +2 -2
  74. package/dist/types/src/barcodes/types.d.ts +1 -0
  75. package/dist/types/src/graphics/helper.d.ts +5 -0
  76. package/dist/types/src/graphics/image.d.ts +7 -0
  77. package/dist/types/src/graphics/svg.d.ts +6 -0
  78. package/dist/types/src/index.d.ts +7 -5
  79. package/dist/types/src/shapes/line.d.ts +6 -0
  80. package/dist/types/src/shapes/rectAndEllipse.d.ts +144 -0
  81. package/dist/types/src/text/index.d.ts +3 -2
  82. package/dist/types/src/text/pdfRender.d.ts +1 -1
  83. package/dist/types/src/{renderUtils.d.ts → utils.d.ts} +3 -1
  84. package/package.json +4 -3
  85. package/src/barcodes/constants.ts +2 -0
  86. package/src/barcodes/helper.ts +12 -3
  87. package/src/barcodes/index.ts +2 -2
  88. package/src/barcodes/pdfRender.ts +2 -2
  89. package/src/barcodes/propPanel.ts +25 -3
  90. package/src/barcodes/types.ts +1 -0
  91. package/src/barcodes/uiRender.ts +9 -36
  92. package/src/graphics/helper.ts +147 -0
  93. package/src/graphics/image.ts +207 -0
  94. package/src/graphics/svg.ts +98 -0
  95. package/src/index.ts +21 -5
  96. package/src/shapes/line.ts +67 -0
  97. package/src/shapes/rectAndEllipse.ts +110 -0
  98. package/src/text/helper.ts +0 -1
  99. package/src/text/index.ts +17 -2
  100. package/src/text/pdfRender.ts +2 -2
  101. package/src/text/uiRender.ts +2 -2
  102. package/src/{renderUtils.ts → utils.ts} +61 -5
  103. package/dist/cjs/__tests__/renderUtils.test.js.map +0 -1
  104. package/dist/cjs/src/image/index.js +0 -8
  105. package/dist/cjs/src/image/index.js.map +0 -1
  106. package/dist/cjs/src/image/pdfRender.js +0 -22
  107. package/dist/cjs/src/image/pdfRender.js.map +0 -1
  108. package/dist/cjs/src/image/propPanel.js +0 -19
  109. package/dist/cjs/src/image/propPanel.js.map +0 -1
  110. package/dist/cjs/src/image/types.js +0 -3
  111. package/dist/cjs/src/image/types.js.map +0 -1
  112. package/dist/cjs/src/image/uiRender.js +0 -111
  113. package/dist/cjs/src/image/uiRender.js.map +0 -1
  114. package/dist/cjs/src/line/constants.js +0 -5
  115. package/dist/cjs/src/line/constants.js.map +0 -1
  116. package/dist/cjs/src/line/index.js +0 -8
  117. package/dist/cjs/src/line/index.js.map +0 -1
  118. package/dist/cjs/src/line/pdfRender.js +0 -20
  119. package/dist/cjs/src/line/pdfRender.js.map +0 -1
  120. package/dist/cjs/src/line/propPanel.js +0 -35
  121. package/dist/cjs/src/line/propPanel.js.map +0 -1
  122. package/dist/cjs/src/line/types.js +0 -3
  123. package/dist/cjs/src/line/types.js.map +0 -1
  124. package/dist/cjs/src/line/uiRender.js +0 -14
  125. package/dist/cjs/src/line/uiRender.js.map +0 -1
  126. package/dist/cjs/src/renderUtils.js.map +0 -1
  127. package/dist/esm/__tests__/renderUtils.test.js.map +0 -1
  128. package/dist/esm/src/image/index.js +0 -6
  129. package/dist/esm/src/image/index.js.map +0 -1
  130. package/dist/esm/src/image/pdfRender.js +0 -18
  131. package/dist/esm/src/image/pdfRender.js.map +0 -1
  132. package/dist/esm/src/image/propPanel.js +0 -16
  133. package/dist/esm/src/image/propPanel.js.map +0 -1
  134. package/dist/esm/src/image/types.js +0 -2
  135. package/dist/esm/src/image/types.js.map +0 -1
  136. package/dist/esm/src/image/uiRender.js +0 -107
  137. package/dist/esm/src/image/uiRender.js.map +0 -1
  138. package/dist/esm/src/line/constants.js +0 -2
  139. package/dist/esm/src/line/constants.js.map +0 -1
  140. package/dist/esm/src/line/index.js +0 -6
  141. package/dist/esm/src/line/index.js.map +0 -1
  142. package/dist/esm/src/line/pdfRender.js +0 -16
  143. package/dist/esm/src/line/pdfRender.js.map +0 -1
  144. package/dist/esm/src/line/propPanel.js +0 -32
  145. package/dist/esm/src/line/propPanel.js.map +0 -1
  146. package/dist/esm/src/line/types.js +0 -2
  147. package/dist/esm/src/line/types.js.map +0 -1
  148. package/dist/esm/src/line/uiRender.js +0 -10
  149. package/dist/esm/src/line/uiRender.js.map +0 -1
  150. package/dist/esm/src/renderUtils.js.map +0 -1
  151. package/dist/types/src/image/index.d.ts +0 -4
  152. package/dist/types/src/image/pdfRender.d.ts +0 -3
  153. package/dist/types/src/image/propPanel.d.ts +0 -3
  154. package/dist/types/src/image/types.d.ts +0 -3
  155. package/dist/types/src/image/uiRender.d.ts +0 -3
  156. package/dist/types/src/line/constants.d.ts +0 -1
  157. package/dist/types/src/line/index.d.ts +0 -4
  158. package/dist/types/src/line/pdfRender.d.ts +0 -3
  159. package/dist/types/src/line/propPanel.d.ts +0 -3
  160. package/dist/types/src/line/types.d.ts +0 -4
  161. package/dist/types/src/line/uiRender.d.ts +0 -3
  162. package/src/image/index.ts +0 -8
  163. package/src/image/pdfRender.ts +0 -29
  164. package/src/image/propPanel.ts +0 -19
  165. package/src/image/types.ts +0 -3
  166. package/src/image/uiRender.ts +0 -121
  167. package/src/line/constants.ts +0 -1
  168. package/src/line/index.ts +0 -8
  169. package/src/line/pdfRender.ts +0 -24
  170. package/src/line/propPanel.ts +0 -34
  171. package/src/line/types.ts +0 -5
  172. package/src/line/uiRender.ts +0 -12
  173. /package/dist/types/__tests__/{renderUtils.test.d.ts → utils.test.d.ts} +0 -0
@@ -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
@@ -1,5 +0,0 @@
1
- import { Schema } from '@pdfme/common';
2
-
3
- export interface LineSchema extends Schema {
4
- color: string;
5
- }
@@ -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
- };