pretext-pdf 2.0.2 → 2.0.13

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 (100) hide show
  1. package/CHANGELOG.md +227 -0
  2. package/dist/assets/loaders/images.d.ts.map +1 -1
  3. package/dist/assets/loaders/images.js +4 -1
  4. package/dist/assets/loaders/images.js.map +1 -1
  5. package/dist/assets/security/path-allowlist.d.ts.map +1 -1
  6. package/dist/assets/security/path-allowlist.js +10 -1
  7. package/dist/assets/security/path-allowlist.js.map +1 -1
  8. package/dist/assets/svg/resolve-content.d.ts.map +1 -1
  9. package/dist/assets/svg/resolve-content.js +4 -1
  10. package/dist/assets/svg/resolve-content.js.map +1 -1
  11. package/dist/builder.js +1 -1
  12. package/dist/builder.js.map +1 -1
  13. package/dist/compat/normalize.d.ts +13 -0
  14. package/dist/compat/normalize.d.ts.map +1 -0
  15. package/dist/compat/normalize.js +146 -0
  16. package/dist/compat/normalize.js.map +1 -0
  17. package/dist/compat/pdfmake-types.d.ts +91 -0
  18. package/dist/compat/pdfmake-types.d.ts.map +1 -0
  19. package/dist/compat/pdfmake-types.js +8 -0
  20. package/dist/compat/pdfmake-types.js.map +1 -0
  21. package/dist/compat/translate.d.ts +7 -0
  22. package/dist/compat/translate.d.ts.map +1 -0
  23. package/dist/compat/translate.js +205 -0
  24. package/dist/compat/translate.js.map +1 -0
  25. package/dist/compat.d.ts +6 -161
  26. package/dist/compat.d.ts.map +1 -1
  27. package/dist/compat.js +13 -404
  28. package/dist/compat.js.map +1 -1
  29. package/dist/fonts/bundled-paths.d.ts +13 -0
  30. package/dist/fonts/bundled-paths.d.ts.map +1 -0
  31. package/dist/fonts/bundled-paths.js +43 -0
  32. package/dist/fonts/bundled-paths.js.map +1 -0
  33. package/dist/fonts/collect-needed.d.ts +10 -0
  34. package/dist/fonts/collect-needed.d.ts.map +1 -0
  35. package/dist/fonts/collect-needed.js +85 -0
  36. package/dist/fonts/collect-needed.js.map +1 -0
  37. package/dist/fonts/collect-text.d.ts +9 -0
  38. package/dist/fonts/collect-text.d.ts.map +1 -0
  39. package/dist/fonts/collect-text.js +162 -0
  40. package/dist/fonts/collect-text.js.map +1 -0
  41. package/dist/fonts/load-bytes.d.ts +10 -0
  42. package/dist/fonts/load-bytes.d.ts.map +1 -0
  43. package/dist/fonts/load-bytes.js +56 -0
  44. package/dist/fonts/load-bytes.js.map +1 -0
  45. package/dist/fonts.d.ts +11 -10
  46. package/dist/fonts.d.ts.map +1 -1
  47. package/dist/fonts.js +17 -421
  48. package/dist/fonts.js.map +1 -1
  49. package/dist/pipeline-footnotes.d.ts +2 -2
  50. package/dist/pipeline-footnotes.d.ts.map +1 -1
  51. package/dist/pipeline-footnotes.js +5 -2
  52. package/dist/pipeline-footnotes.js.map +1 -1
  53. package/dist/pipeline.d.ts.map +1 -1
  54. package/dist/pipeline.js +9 -5
  55. package/dist/pipeline.js.map +1 -1
  56. package/dist/render-utils.d.ts +1 -7
  57. package/dist/render-utils.d.ts.map +1 -1
  58. package/dist/render-utils.js +9 -30
  59. package/dist/render-utils.js.map +1 -1
  60. package/dist/schema/document.d.ts +2115 -0
  61. package/dist/schema/document.d.ts.map +1 -0
  62. package/dist/schema/document.js +275 -0
  63. package/dist/schema/document.js.map +1 -0
  64. package/dist/schema/elements-block.d.ts +481 -0
  65. package/dist/schema/elements-block.d.ts.map +1 -0
  66. package/dist/schema/elements-block.js +155 -0
  67. package/dist/schema/elements-block.js.map +1 -0
  68. package/dist/schema/elements-media.d.ts +282 -0
  69. package/dist/schema/elements-media.d.ts.map +1 -0
  70. package/dist/schema/elements-media.js +83 -0
  71. package/dist/schema/elements-media.js.map +1 -0
  72. package/dist/schema/elements-table.d.ts +134 -0
  73. package/dist/schema/elements-table.d.ts.map +1 -0
  74. package/dist/schema/elements-table.js +60 -0
  75. package/dist/schema/elements-table.js.map +1 -0
  76. package/dist/schema/elements-text.d.ts +782 -0
  77. package/dist/schema/elements-text.d.ts.map +1 -0
  78. package/dist/schema/elements-text.js +260 -0
  79. package/dist/schema/elements-text.js.map +1 -0
  80. package/dist/schema/shared.d.ts +84 -0
  81. package/dist/schema/shared.d.ts.map +1 -0
  82. package/dist/schema/shared.js +29 -0
  83. package/dist/schema/shared.js.map +1 -0
  84. package/dist/schema.d.ts +10 -2116
  85. package/dist/schema.d.ts.map +1 -1
  86. package/dist/schema.js +10 -852
  87. package/dist/schema.js.map +1 -1
  88. package/dist/types-public/document.d.ts +99 -101
  89. package/dist/types-public/document.d.ts.map +1 -1
  90. package/dist/validate/document.d.ts.map +1 -1
  91. package/dist/validate/document.js +5 -1
  92. package/dist/validate/document.js.map +1 -1
  93. package/dist/validate/elements/media.d.ts.map +1 -1
  94. package/dist/validate/elements/media.js +14 -0
  95. package/dist/validate/elements/media.js.map +1 -1
  96. package/dist/validate/helpers.d.ts +6 -6
  97. package/dist/validate/helpers.d.ts.map +1 -1
  98. package/dist/validate/helpers.js +7 -7
  99. package/dist/validate/helpers.js.map +1 -1
  100. package/package.json +1 -1
@@ -0,0 +1,282 @@
1
+ export declare const imageSchema: {
2
+ readonly type: "object";
3
+ readonly required: readonly ["type", "src"];
4
+ readonly properties: {
5
+ readonly type: {
6
+ readonly type: "string";
7
+ readonly const: "image";
8
+ };
9
+ readonly src: {
10
+ readonly type: "string";
11
+ readonly description: "Absolute file path or URL";
12
+ };
13
+ readonly format: {
14
+ readonly type: "string";
15
+ readonly enum: readonly ["png", "jpg", "auto"];
16
+ };
17
+ readonly width: {
18
+ readonly type: "number";
19
+ };
20
+ readonly height: {
21
+ readonly type: "number";
22
+ };
23
+ readonly align: {
24
+ readonly type: "string";
25
+ readonly enum: readonly ["left", "center", "right"];
26
+ };
27
+ readonly spaceAfter: {
28
+ readonly type: "number";
29
+ readonly description: "Space in points (pt)";
30
+ };
31
+ readonly spaceBefore: {
32
+ readonly type: "number";
33
+ readonly description: "Space in points (pt)";
34
+ };
35
+ readonly float: {
36
+ readonly type: "string";
37
+ readonly enum: readonly ["left", "right"];
38
+ };
39
+ readonly floatText: {
40
+ readonly type: "string";
41
+ };
42
+ readonly floatWidth: {
43
+ readonly type: "number";
44
+ readonly description: "Image column width in pt. Default: 35% of content width.";
45
+ };
46
+ readonly floatGap: {
47
+ readonly type: "number";
48
+ readonly description: "Gap between image and text columns in pt. Default: 12";
49
+ };
50
+ readonly floatSpans: {
51
+ readonly type: "array";
52
+ readonly items: {
53
+ readonly type: "object";
54
+ readonly required: readonly ["text"];
55
+ readonly properties: {
56
+ readonly text: {
57
+ readonly type: "string";
58
+ };
59
+ readonly dir: {
60
+ readonly type: "string";
61
+ readonly enum: readonly ["ltr", "rtl", "auto"];
62
+ };
63
+ readonly fontFamily: {
64
+ readonly type: "string";
65
+ };
66
+ readonly fontWeight: {
67
+ readonly type: "number";
68
+ readonly enum: readonly [400, 700];
69
+ };
70
+ readonly fontStyle: {
71
+ readonly type: "string";
72
+ readonly enum: readonly ["normal", "italic"];
73
+ };
74
+ readonly color: {
75
+ readonly type: "string";
76
+ readonly pattern: "^#[0-9A-Fa-f]{6}$";
77
+ readonly description: "6-digit hex color e.g. #FF0000";
78
+ };
79
+ readonly fontSize: {
80
+ readonly type: "number";
81
+ };
82
+ readonly underline: {
83
+ readonly type: "boolean";
84
+ };
85
+ readonly strikethrough: {
86
+ readonly type: "boolean";
87
+ };
88
+ readonly url: {
89
+ readonly type: "string";
90
+ };
91
+ readonly href: {
92
+ readonly type: "string";
93
+ };
94
+ readonly verticalAlign: {
95
+ readonly type: "string";
96
+ readonly enum: readonly ["superscript", "subscript"];
97
+ };
98
+ readonly smallCaps: {
99
+ readonly type: "boolean";
100
+ };
101
+ readonly letterSpacing: {
102
+ readonly type: "number";
103
+ };
104
+ readonly footnoteRef: {
105
+ readonly type: "string";
106
+ };
107
+ };
108
+ };
109
+ readonly description: "Rich-text spans rendered alongside the image. Alternative to floatText.";
110
+ };
111
+ readonly floatFontSize: {
112
+ readonly type: "number";
113
+ readonly description: "Font size for floatText in pt.";
114
+ };
115
+ readonly floatFontFamily: {
116
+ readonly type: "string";
117
+ readonly description: "Font family for floatText.";
118
+ };
119
+ readonly floatColor: {
120
+ readonly type: "string";
121
+ readonly pattern: "^#[0-9A-Fa-f]{6}$";
122
+ readonly description: "6-digit hex color e.g. #FF0000";
123
+ };
124
+ };
125
+ };
126
+ export declare const svgSchema: {
127
+ readonly type: "object";
128
+ readonly required: readonly ["type"];
129
+ readonly properties: {
130
+ readonly type: {
131
+ readonly type: "string";
132
+ readonly const: "svg";
133
+ };
134
+ readonly svg: {
135
+ readonly type: "string";
136
+ readonly description: "Inline SVG markup string";
137
+ };
138
+ readonly src: {
139
+ readonly type: "string";
140
+ readonly description: "Absolute path or https:// URL to an SVG file";
141
+ };
142
+ readonly width: {
143
+ readonly type: "number";
144
+ };
145
+ readonly height: {
146
+ readonly type: "number";
147
+ };
148
+ readonly align: {
149
+ readonly type: "string";
150
+ readonly enum: readonly ["left", "center", "right"];
151
+ };
152
+ readonly spaceBefore: {
153
+ readonly type: "number";
154
+ readonly description: "Space in points (pt)";
155
+ };
156
+ readonly spaceAfter: {
157
+ readonly type: "number";
158
+ readonly description: "Space in points (pt)";
159
+ };
160
+ };
161
+ };
162
+ export declare const qrCodeSchema: {
163
+ readonly type: "object";
164
+ readonly required: readonly ["type", "data"];
165
+ readonly properties: {
166
+ readonly type: {
167
+ readonly type: "string";
168
+ readonly const: "qr-code";
169
+ };
170
+ readonly data: {
171
+ readonly type: "string";
172
+ };
173
+ readonly size: {
174
+ readonly type: "number";
175
+ };
176
+ readonly errorCorrectionLevel: {
177
+ readonly type: "string";
178
+ readonly enum: readonly ["L", "M", "Q", "H"];
179
+ };
180
+ readonly foreground: {
181
+ readonly type: "string";
182
+ readonly pattern: "^#[0-9A-Fa-f]{6}$";
183
+ readonly description: "6-digit hex color e.g. #FF0000";
184
+ };
185
+ readonly background: {
186
+ readonly type: "string";
187
+ readonly pattern: "^#[0-9A-Fa-f]{6}$";
188
+ readonly description: "6-digit hex color e.g. #FF0000";
189
+ };
190
+ readonly margin: {
191
+ readonly type: "number";
192
+ readonly description: "Quiet-zone modules around the symbol. Default: 4";
193
+ };
194
+ readonly align: {
195
+ readonly type: "string";
196
+ readonly enum: readonly ["left", "center", "right"];
197
+ };
198
+ readonly spaceBefore: {
199
+ readonly type: "number";
200
+ readonly description: "Space in points (pt)";
201
+ };
202
+ readonly spaceAfter: {
203
+ readonly type: "number";
204
+ readonly description: "Space in points (pt)";
205
+ };
206
+ };
207
+ };
208
+ export declare const barcodeSchema: {
209
+ readonly type: "object";
210
+ readonly required: readonly ["type", "symbology", "data"];
211
+ readonly properties: {
212
+ readonly type: {
213
+ readonly type: "string";
214
+ readonly const: "barcode";
215
+ };
216
+ readonly symbology: {
217
+ readonly type: "string";
218
+ readonly description: "e.g. 'code128', 'ean13', 'qrcode'";
219
+ };
220
+ readonly data: {
221
+ readonly type: "string";
222
+ };
223
+ readonly width: {
224
+ readonly type: "number";
225
+ };
226
+ readonly height: {
227
+ readonly type: "number";
228
+ };
229
+ readonly includeText: {
230
+ readonly type: "boolean";
231
+ };
232
+ readonly align: {
233
+ readonly type: "string";
234
+ readonly enum: readonly ["left", "center", "right"];
235
+ };
236
+ readonly spaceBefore: {
237
+ readonly type: "number";
238
+ readonly description: "Space in points (pt)";
239
+ };
240
+ readonly spaceAfter: {
241
+ readonly type: "number";
242
+ readonly description: "Space in points (pt)";
243
+ };
244
+ };
245
+ };
246
+ export declare const chartSchema: {
247
+ readonly type: "object";
248
+ readonly required: readonly ["type", "spec"];
249
+ readonly properties: {
250
+ readonly type: {
251
+ readonly type: "string";
252
+ readonly const: "chart";
253
+ };
254
+ readonly spec: {
255
+ readonly type: "object";
256
+ readonly description: "Vega-Lite JSON specification. Requires vega and vega-lite peer deps.";
257
+ };
258
+ readonly width: {
259
+ readonly type: "number";
260
+ };
261
+ readonly height: {
262
+ readonly type: "number";
263
+ };
264
+ readonly caption: {
265
+ readonly type: "string";
266
+ readonly description: "Optional figure caption rendered below the chart.";
267
+ };
268
+ readonly align: {
269
+ readonly type: "string";
270
+ readonly enum: readonly ["left", "center", "right"];
271
+ };
272
+ readonly spaceBefore: {
273
+ readonly type: "number";
274
+ readonly description: "Space in points (pt)";
275
+ };
276
+ readonly spaceAfter: {
277
+ readonly type: "number";
278
+ readonly description: "Space in points (pt)";
279
+ };
280
+ };
281
+ };
282
+ //# sourceMappingURL=elements-media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements-media.d.ts","sourceRoot":"","sources":["../../src/schema/elements-media.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBd,CAAA;AAEV,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAaZ,CAAA;AAEV,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAef,CAAA;AAEV,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAchB,CAAA;AAEV,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAad,CAAA"}
@@ -0,0 +1,83 @@
1
+ import { alignNoJustify, colorSchema, spaceSchema, inlineSpanSchema } from './shared.js';
2
+ export const imageSchema = {
3
+ type: 'object',
4
+ required: ['type', 'src'],
5
+ properties: {
6
+ type: { type: 'string', const: 'image' },
7
+ src: { type: 'string', description: 'Absolute file path or URL' },
8
+ format: { type: 'string', enum: ['png', 'jpg', 'auto'] },
9
+ width: { type: 'number' },
10
+ height: { type: 'number' },
11
+ align: alignNoJustify,
12
+ spaceAfter: spaceSchema,
13
+ spaceBefore: spaceSchema,
14
+ float: { type: 'string', enum: ['left', 'right'] },
15
+ floatText: { type: 'string' },
16
+ floatWidth: { type: 'number', description: 'Image column width in pt. Default: 35% of content width.' },
17
+ floatGap: { type: 'number', description: 'Gap between image and text columns in pt. Default: 12' },
18
+ floatSpans: { type: 'array', items: inlineSpanSchema, description: 'Rich-text spans rendered alongside the image. Alternative to floatText.' },
19
+ floatFontSize: { type: 'number', description: 'Font size for floatText in pt.' },
20
+ floatFontFamily: { type: 'string', description: 'Font family for floatText.' },
21
+ floatColor: colorSchema,
22
+ },
23
+ };
24
+ export const svgSchema = {
25
+ type: 'object',
26
+ required: ['type'],
27
+ properties: {
28
+ type: { type: 'string', const: 'svg' },
29
+ svg: { type: 'string', description: 'Inline SVG markup string' },
30
+ src: { type: 'string', description: 'Absolute path or https:// URL to an SVG file' },
31
+ width: { type: 'number' },
32
+ height: { type: 'number' },
33
+ align: alignNoJustify,
34
+ spaceBefore: spaceSchema,
35
+ spaceAfter: spaceSchema,
36
+ },
37
+ };
38
+ export const qrCodeSchema = {
39
+ type: 'object',
40
+ required: ['type', 'data'],
41
+ properties: {
42
+ type: { type: 'string', const: 'qr-code' },
43
+ data: { type: 'string' },
44
+ size: { type: 'number' },
45
+ errorCorrectionLevel: { type: 'string', enum: ['L', 'M', 'Q', 'H'] },
46
+ foreground: colorSchema,
47
+ background: colorSchema,
48
+ margin: { type: 'number', description: 'Quiet-zone modules around the symbol. Default: 4' },
49
+ align: alignNoJustify,
50
+ spaceBefore: spaceSchema,
51
+ spaceAfter: spaceSchema,
52
+ },
53
+ };
54
+ export const barcodeSchema = {
55
+ type: 'object',
56
+ required: ['type', 'symbology', 'data'],
57
+ properties: {
58
+ type: { type: 'string', const: 'barcode' },
59
+ symbology: { type: 'string', description: "e.g. 'code128', 'ean13', 'qrcode'" },
60
+ data: { type: 'string' },
61
+ width: { type: 'number' },
62
+ height: { type: 'number' },
63
+ includeText: { type: 'boolean' },
64
+ align: alignNoJustify,
65
+ spaceBefore: spaceSchema,
66
+ spaceAfter: spaceSchema,
67
+ },
68
+ };
69
+ export const chartSchema = {
70
+ type: 'object',
71
+ required: ['type', 'spec'],
72
+ properties: {
73
+ type: { type: 'string', const: 'chart' },
74
+ spec: { type: 'object', description: 'Vega-Lite JSON specification. Requires vega and vega-lite peer deps.' },
75
+ width: { type: 'number' },
76
+ height: { type: 'number' },
77
+ caption: { type: 'string', description: 'Optional figure caption rendered below the chart.' },
78
+ align: alignNoJustify,
79
+ spaceBefore: spaceSchema,
80
+ spaceAfter: spaceSchema,
81
+ },
82
+ };
83
+ //# sourceMappingURL=elements-media.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements-media.js","sourceRoot":"","sources":["../../src/schema/elements-media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAExF,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;IACzB,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;QACxC,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE;QACjE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE;QACxD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,KAAK,EAAE,cAAc;QACrB,UAAU,EAAE,WAAW;QACvB,WAAW,EAAE,WAAW;QACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QAClD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC7B,UAAU,EAAE,EAAE,IA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EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mDAAmD,EAAE;QAC7F,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,WAAW;QACxB,UAAU,EAAE,WAAW;KACxB;CACO,CAAA"}
@@ -0,0 +1,134 @@
1
+ export declare const tableSchema: {
2
+ readonly type: "object";
3
+ readonly required: readonly ["type", "columns", "rows"];
4
+ readonly properties: {
5
+ readonly type: {
6
+ readonly type: "string";
7
+ readonly const: "table";
8
+ };
9
+ readonly columns: {
10
+ readonly type: "array";
11
+ readonly items: {
12
+ readonly type: "object";
13
+ readonly required: readonly ["width"];
14
+ readonly properties: {
15
+ readonly width: {
16
+ readonly oneOf: readonly [{
17
+ readonly type: "number";
18
+ }, {
19
+ readonly type: "string";
20
+ readonly description: "Fraction e.g. '2*', '*', or 'auto'";
21
+ }];
22
+ };
23
+ readonly align: {
24
+ readonly type: "string";
25
+ readonly enum: readonly ["left", "center", "right"];
26
+ };
27
+ };
28
+ };
29
+ };
30
+ readonly rows: {
31
+ readonly type: "array";
32
+ readonly items: {
33
+ readonly type: "object";
34
+ readonly required: readonly ["cells"];
35
+ readonly properties: {
36
+ readonly cells: {
37
+ readonly type: "array";
38
+ readonly items: {
39
+ readonly type: "object";
40
+ readonly required: readonly ["text"];
41
+ readonly properties: {
42
+ readonly text: {
43
+ readonly type: "string";
44
+ };
45
+ readonly align: {
46
+ readonly type: "string";
47
+ readonly enum: readonly ["left", "center", "right"];
48
+ };
49
+ readonly fontWeight: {
50
+ readonly type: "number";
51
+ readonly enum: readonly [400, 700];
52
+ };
53
+ readonly fontFamily: {
54
+ readonly type: "string";
55
+ };
56
+ readonly fontSize: {
57
+ readonly type: "number";
58
+ };
59
+ readonly color: {
60
+ readonly type: "string";
61
+ readonly pattern: "^#[0-9A-Fa-f]{6}$";
62
+ readonly description: "6-digit hex color e.g. #FF0000";
63
+ };
64
+ readonly bgColor: {
65
+ readonly type: "string";
66
+ readonly pattern: "^#[0-9A-Fa-f]{6}$";
67
+ readonly description: "6-digit hex color e.g. #FF0000";
68
+ };
69
+ readonly colspan: {
70
+ readonly type: "number";
71
+ };
72
+ readonly rowspan: {
73
+ readonly type: "number";
74
+ };
75
+ readonly dir: {
76
+ readonly type: "string";
77
+ readonly enum: readonly ["ltr", "rtl", "auto"];
78
+ };
79
+ readonly tabularNumbers: {
80
+ readonly type: "boolean";
81
+ readonly description: "Render digits at fixed slot width.";
82
+ };
83
+ };
84
+ };
85
+ };
86
+ readonly isHeader: {
87
+ readonly type: "boolean";
88
+ };
89
+ };
90
+ };
91
+ };
92
+ readonly borderColor: {
93
+ readonly type: "string";
94
+ readonly pattern: "^#[0-9A-Fa-f]{6}$";
95
+ readonly description: "6-digit hex color e.g. #FF0000";
96
+ };
97
+ readonly borderWidth: {
98
+ readonly type: "number";
99
+ };
100
+ readonly headerBgColor: {
101
+ readonly type: "string";
102
+ readonly pattern: "^#[0-9A-Fa-f]{6}$";
103
+ readonly description: "6-digit hex color e.g. #FF0000";
104
+ };
105
+ readonly fontSize: {
106
+ readonly type: "number";
107
+ };
108
+ readonly cellPaddingH: {
109
+ readonly type: "number";
110
+ readonly description: "Horizontal cell padding in pt. Default: 8";
111
+ };
112
+ readonly cellPaddingV: {
113
+ readonly type: "number";
114
+ readonly description: "Vertical cell padding in pt. Default: 6";
115
+ };
116
+ readonly spaceAfter: {
117
+ readonly type: "number";
118
+ readonly description: "Space in points (pt)";
119
+ };
120
+ readonly spaceBefore: {
121
+ readonly type: "number";
122
+ readonly description: "Space in points (pt)";
123
+ };
124
+ readonly dir: {
125
+ readonly type: "string";
126
+ readonly enum: readonly ["ltr", "rtl", "auto"];
127
+ };
128
+ readonly headerRows: {
129
+ readonly type: "number";
130
+ readonly description: "Number of header rows (repeated on continuation pages).";
131
+ };
132
+ };
133
+ };
134
+ //# sourceMappingURL=elements-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements-table.d.ts","sourceRoot":"","sources":["../../src/schema/elements-table.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDd,CAAA"}
@@ -0,0 +1,60 @@
1
+ import { alignNoJustify, fontWeightSchema, colorSchema, dirSchema, spaceSchema } from './shared.js';
2
+ export const tableSchema = {
3
+ type: 'object',
4
+ required: ['type', 'columns', 'rows'],
5
+ properties: {
6
+ type: { type: 'string', const: 'table' },
7
+ columns: {
8
+ type: 'array',
9
+ items: {
10
+ type: 'object',
11
+ required: ['width'],
12
+ properties: {
13
+ width: { oneOf: [{ type: 'number' }, { type: 'string', description: "Fraction e.g. '2*', '*', or 'auto'" }] },
14
+ align: alignNoJustify,
15
+ },
16
+ },
17
+ },
18
+ rows: {
19
+ type: 'array',
20
+ items: {
21
+ type: 'object',
22
+ required: ['cells'],
23
+ properties: {
24
+ cells: {
25
+ type: 'array',
26
+ items: {
27
+ type: 'object',
28
+ required: ['text'],
29
+ properties: {
30
+ text: { type: 'string' },
31
+ align: alignNoJustify,
32
+ fontWeight: fontWeightSchema,
33
+ fontFamily: { type: 'string' },
34
+ fontSize: { type: 'number' },
35
+ color: colorSchema,
36
+ bgColor: colorSchema,
37
+ colspan: { type: 'number' },
38
+ rowspan: { type: 'number' },
39
+ dir: dirSchema,
40
+ tabularNumbers: { type: 'boolean', description: 'Render digits at fixed slot width.' },
41
+ },
42
+ },
43
+ },
44
+ isHeader: { type: 'boolean' },
45
+ },
46
+ },
47
+ },
48
+ borderColor: colorSchema,
49
+ borderWidth: { type: 'number' },
50
+ headerBgColor: colorSchema,
51
+ fontSize: { type: 'number' },
52
+ cellPaddingH: { type: 'number', description: 'Horizontal cell padding in pt. Default: 8' },
53
+ cellPaddingV: { type: 'number', description: 'Vertical cell padding in pt. Default: 6' },
54
+ spaceAfter: spaceSchema,
55
+ spaceBefore: spaceSchema,
56
+ dir: dirSchema,
57
+ headerRows: { type: 'number', description: 'Number of header rows (repeated on continuation pages).' },
58
+ },
59
+ };
60
+ //# sourceMappingURL=elements-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements-table.js","sourceRoot":"","sources":["../../src/schema/elements-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEnG,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC;IACrC,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;QACxC,OAAO,EAAE;YACP,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,CAAC,OAAO,CAAC;gBACnB,UAAU,EAAE;oBACV,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC,EAAE;oBAC7G,KAAK,EAAE,cAAc;iBACtB;aACF;SACF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,CAAC,OAAO,CAAC;gBACnB,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,QAAQ,EAAE,CAAC,MAAM,CAAC;4BA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