pretext-pdf 1.9.0 → 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.
- package/CHANGELOG.md +414 -0
- package/dist/allowed-props.d.ts +23 -8
- package/dist/allowed-props.d.ts.map +1 -1
- package/dist/allowed-props.js +38 -6
- package/dist/allowed-props.js.map +1 -1
- package/dist/assets/index.d.ts +1 -1
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/loaders/images.d.ts.map +1 -1
- package/dist/assets/loaders/images.js +4 -1
- package/dist/assets/loaders/images.js.map +1 -1
- package/dist/assets/security/path-allowlist.d.ts.map +1 -1
- package/dist/assets/security/path-allowlist.js +10 -1
- package/dist/assets/security/path-allowlist.js.map +1 -1
- package/dist/assets/svg/resolve-content.d.ts.map +1 -1
- package/dist/assets/svg/resolve-content.js +4 -1
- package/dist/assets/svg/resolve-content.js.map +1 -1
- package/dist/assets/svg/sanitize.d.ts +2 -0
- package/dist/assets/svg/sanitize.d.ts.map +1 -1
- package/dist/assets/svg/sanitize.js +41 -10
- package/dist/assets/svg/sanitize.js.map +1 -1
- package/dist/builder.js +2 -2
- package/dist/builder.js.map +1 -1
- package/dist/compat/normalize.d.ts +13 -0
- package/dist/compat/normalize.d.ts.map +1 -0
- package/dist/compat/normalize.js +146 -0
- package/dist/compat/normalize.js.map +1 -0
- package/dist/compat/pdfmake-types.d.ts +91 -0
- package/dist/compat/pdfmake-types.d.ts.map +1 -0
- package/dist/compat/pdfmake-types.js +8 -0
- package/dist/compat/pdfmake-types.js.map +1 -0
- package/dist/compat/translate.d.ts +7 -0
- package/dist/compat/translate.d.ts.map +1 -0
- package/dist/compat/translate.js +205 -0
- package/dist/compat/translate.js.map +1 -0
- package/dist/compat.d.ts +6 -161
- package/dist/compat.d.ts.map +1 -1
- package/dist/compat.js +13 -404
- package/dist/compat.js.map +1 -1
- package/dist/fonts/bundled-paths.d.ts +13 -0
- package/dist/fonts/bundled-paths.d.ts.map +1 -0
- package/dist/fonts/bundled-paths.js +43 -0
- package/dist/fonts/bundled-paths.js.map +1 -0
- package/dist/fonts/collect-needed.d.ts +10 -0
- package/dist/fonts/collect-needed.d.ts.map +1 -0
- package/dist/fonts/collect-needed.js +85 -0
- package/dist/fonts/collect-needed.js.map +1 -0
- package/dist/fonts/collect-text.d.ts +9 -0
- package/dist/fonts/collect-text.d.ts.map +1 -0
- package/dist/fonts/collect-text.js +162 -0
- package/dist/fonts/collect-text.js.map +1 -0
- package/dist/fonts/load-bytes.d.ts +10 -0
- package/dist/fonts/load-bytes.d.ts.map +1 -0
- package/dist/fonts/load-bytes.js +56 -0
- package/dist/fonts/load-bytes.js.map +1 -0
- package/dist/fonts.d.ts +11 -10
- package/dist/fonts.d.ts.map +1 -1
- package/dist/fonts.js +17 -419
- package/dist/fonts.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/measure-blocks/simple-blocks.js +3 -3
- package/dist/measure-blocks/simple-blocks.js.map +1 -1
- package/dist/measure-text.d.ts.map +1 -1
- package/dist/measure-text.js +7 -0
- package/dist/measure-text.js.map +1 -1
- package/dist/pipeline-footnotes.d.ts +2 -2
- package/dist/pipeline-footnotes.d.ts.map +1 -1
- package/dist/pipeline-footnotes.js +5 -2
- package/dist/pipeline-footnotes.js.map +1 -1
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +45 -12
- package/dist/pipeline.js.map +1 -1
- package/dist/plugin-types.d.ts +3 -3
- package/dist/plugin-types.d.ts.map +1 -1
- package/dist/render-blocks/hr.d.ts.map +1 -1
- package/dist/render-blocks/hr.js +2 -3
- package/dist/render-blocks/hr.js.map +1 -1
- package/dist/render-extras.d.ts +0 -2
- package/dist/render-extras.d.ts.map +1 -1
- package/dist/render-extras.js +15 -78
- package/dist/render-extras.js.map +1 -1
- package/dist/render-utils.d.ts +1 -7
- package/dist/render-utils.d.ts.map +1 -1
- package/dist/render-utils.js +18 -35
- package/dist/render-utils.js.map +1 -1
- package/dist/render.js +2 -1
- package/dist/render.js.map +1 -1
- package/dist/schema/document.d.ts +2115 -0
- package/dist/schema/document.d.ts.map +1 -0
- package/dist/schema/document.js +275 -0
- package/dist/schema/document.js.map +1 -0
- package/dist/schema/elements-block.d.ts +481 -0
- package/dist/schema/elements-block.d.ts.map +1 -0
- package/dist/schema/elements-block.js +155 -0
- package/dist/schema/elements-block.js.map +1 -0
- package/dist/schema/elements-media.d.ts +282 -0
- package/dist/schema/elements-media.d.ts.map +1 -0
- package/dist/schema/elements-media.js +83 -0
- package/dist/schema/elements-media.js.map +1 -0
- package/dist/schema/elements-table.d.ts +134 -0
- package/dist/schema/elements-table.d.ts.map +1 -0
- package/dist/schema/elements-table.js +60 -0
- package/dist/schema/elements-table.js.map +1 -0
- package/dist/schema/elements-text.d.ts +782 -0
- package/dist/schema/elements-text.d.ts.map +1 -0
- package/dist/schema/elements-text.js +260 -0
- package/dist/schema/elements-text.js.map +1 -0
- package/dist/schema/shared.d.ts +84 -0
- package/dist/schema/shared.d.ts.map +1 -0
- package/dist/schema/shared.js +29 -0
- package/dist/schema/shared.js.map +1 -0
- package/dist/schema.d.ts +10 -1869
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +10 -793
- package/dist/schema.js.map +1 -1
- package/dist/signing/index.d.ts +3 -0
- package/dist/signing/index.d.ts.map +1 -0
- package/dist/signing/index.js +3 -0
- package/dist/signing/index.js.map +1 -0
- package/dist/signing/placeholder.d.ts +5 -0
- package/dist/signing/placeholder.d.ts.map +1 -0
- package/dist/signing/placeholder.js +75 -0
- package/dist/signing/placeholder.js.map +1 -0
- package/dist/signing/post-process.d.ts +16 -0
- package/dist/signing/post-process.d.ts.map +1 -0
- package/dist/signing/post-process.js +125 -0
- package/dist/signing/post-process.js.map +1 -0
- package/dist/types-public/document.d.ts +106 -110
- package/dist/types-public/document.d.ts.map +1 -1
- package/dist/types-public/elements-block.d.ts +54 -35
- package/dist/types-public/elements-block.d.ts.map +1 -1
- package/dist/types-public/validation.d.ts +9 -15
- package/dist/types-public/validation.d.ts.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/validate/document.d.ts.map +1 -1
- package/dist/validate/document.js +5 -1
- package/dist/validate/document.js.map +1 -1
- package/dist/validate/elements/forms-floats.d.ts +1 -1
- package/dist/validate/elements/forms-floats.d.ts.map +1 -1
- package/dist/validate/elements/forms-floats.js +44 -6
- package/dist/validate/elements/forms-floats.js.map +1 -1
- package/dist/validate/elements/media.d.ts.map +1 -1
- package/dist/validate/elements/media.js +14 -0
- package/dist/validate/elements/media.js.map +1 -1
- package/dist/validate/elements/structural-simple.js +4 -4
- package/dist/validate/elements/structural-simple.js.map +1 -1
- package/dist/validate/helpers.d.ts +6 -6
- package/dist/validate/helpers.d.ts.map +1 -1
- package/dist/validate/helpers.js +7 -7
- package/dist/validate/helpers.js.map +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +4 -6
- package/dist/validate/index.js.map +1 -1
- package/package.json +7 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements-text.d.ts","sourceRoot":"","sources":["../../src/schema/elements-text.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqClB,CAAA;AAEV,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsChB,CAAA;AAEV,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BnB,CAAA;AAEV,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCb,CAAA;AAEV,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBhB,CAAA;AAEV,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBtB,CAAA;AAEV,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Cb,CAAA;AAEV,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBZ,CAAA;AAEV,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;CAWpB,CAAA"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { alignSchema, fontWeightSchema, colorSchema, dirSchema, spaceSchema, inlineSpanSchema } from './shared.js';
|
|
2
|
+
export const paragraphSchema = {
|
|
3
|
+
type: 'object',
|
|
4
|
+
required: ['type', 'text'],
|
|
5
|
+
properties: {
|
|
6
|
+
type: { type: 'string', const: 'paragraph' },
|
|
7
|
+
text: { type: 'string' },
|
|
8
|
+
dir: dirSchema,
|
|
9
|
+
fontSize: { type: 'number' },
|
|
10
|
+
lineHeight: { type: 'number' },
|
|
11
|
+
fontFamily: { type: 'string' },
|
|
12
|
+
fontWeight: fontWeightSchema,
|
|
13
|
+
color: colorSchema,
|
|
14
|
+
align: alignSchema,
|
|
15
|
+
bgColor: colorSchema,
|
|
16
|
+
spaceAfter: spaceSchema,
|
|
17
|
+
spaceBefore: spaceSchema,
|
|
18
|
+
keepTogether: { type: 'boolean' },
|
|
19
|
+
underline: { type: 'boolean' },
|
|
20
|
+
strikethrough: { type: 'boolean' },
|
|
21
|
+
url: { type: 'string', format: 'uri' },
|
|
22
|
+
letterSpacing: { type: 'number' },
|
|
23
|
+
smallCaps: { type: 'boolean' },
|
|
24
|
+
tabularNumbers: { type: 'boolean', description: 'Render digits at fixed slot width for aligned numeric columns.' },
|
|
25
|
+
columns: { type: 'number', description: 'Number of columns for multi-column layout. Default: 1' },
|
|
26
|
+
columnGap: { type: 'number', description: 'Gap between columns in pt. Default: 24' },
|
|
27
|
+
hyphenate: { type: 'boolean', const: false, description: 'Set to false to disable hyphenation for this element.' },
|
|
28
|
+
annotation: {
|
|
29
|
+
type: 'object',
|
|
30
|
+
required: ['contents'],
|
|
31
|
+
properties: {
|
|
32
|
+
contents: { type: 'string' },
|
|
33
|
+
author: { type: 'string' },
|
|
34
|
+
color: colorSchema,
|
|
35
|
+
open: { type: 'boolean' },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export const headingSchema = {
|
|
41
|
+
type: 'object',
|
|
42
|
+
required: ['type', 'level', 'text'],
|
|
43
|
+
properties: {
|
|
44
|
+
type: { type: 'string', const: 'heading' },
|
|
45
|
+
level: { type: 'number', enum: [1, 2, 3, 4] },
|
|
46
|
+
text: { type: 'string' },
|
|
47
|
+
dir: dirSchema,
|
|
48
|
+
fontFamily: { type: 'string' },
|
|
49
|
+
fontWeight: fontWeightSchema,
|
|
50
|
+
fontSize: { type: 'number' },
|
|
51
|
+
lineHeight: { type: 'number' },
|
|
52
|
+
align: alignSchema,
|
|
53
|
+
color: colorSchema,
|
|
54
|
+
bgColor: colorSchema,
|
|
55
|
+
spaceBefore: spaceSchema,
|
|
56
|
+
spaceAfter: spaceSchema,
|
|
57
|
+
keepTogether: { type: 'boolean' },
|
|
58
|
+
underline: { type: 'boolean' },
|
|
59
|
+
strikethrough: { type: 'boolean' },
|
|
60
|
+
bookmark: { type: 'boolean', const: false },
|
|
61
|
+
anchor: { type: 'string' },
|
|
62
|
+
url: { type: 'string', format: 'uri' },
|
|
63
|
+
letterSpacing: { type: 'number' },
|
|
64
|
+
smallCaps: { type: 'boolean' },
|
|
65
|
+
tabularNumbers: { type: 'boolean', description: 'Render digits at fixed slot width for aligned numeric columns.' },
|
|
66
|
+
hyphenate: { type: 'boolean', const: false, description: 'Set to false to disable hyphenation for this element.' },
|
|
67
|
+
annotation: {
|
|
68
|
+
type: 'object',
|
|
69
|
+
required: ['contents'],
|
|
70
|
+
properties: {
|
|
71
|
+
contents: { type: 'string' },
|
|
72
|
+
author: { type: 'string' },
|
|
73
|
+
color: colorSchema,
|
|
74
|
+
open: { type: 'boolean' },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
export const blockquoteSchema = {
|
|
80
|
+
type: 'object',
|
|
81
|
+
required: ['type', 'text'],
|
|
82
|
+
properties: {
|
|
83
|
+
type: { type: 'string', const: 'blockquote' },
|
|
84
|
+
text: { type: 'string' },
|
|
85
|
+
dir: dirSchema,
|
|
86
|
+
borderColor: colorSchema,
|
|
87
|
+
borderWidth: { type: 'number' },
|
|
88
|
+
bgColor: colorSchema,
|
|
89
|
+
color: colorSchema,
|
|
90
|
+
fontFamily: { type: 'string' },
|
|
91
|
+
fontWeight: fontWeightSchema,
|
|
92
|
+
fontStyle: { type: 'string', enum: ['normal', 'italic'] },
|
|
93
|
+
fontSize: { type: 'number' },
|
|
94
|
+
lineHeight: { type: 'number' },
|
|
95
|
+
padding: { type: 'number', description: 'Shorthand for paddingH and paddingV.' },
|
|
96
|
+
paddingH: { type: 'number', description: 'Horizontal padding inside box in pt. Default: 16' },
|
|
97
|
+
paddingV: { type: 'number', description: 'Vertical padding inside box in pt. Default: 10' },
|
|
98
|
+
align: alignSchema,
|
|
99
|
+
spaceBefore: spaceSchema,
|
|
100
|
+
spaceAfter: spaceSchema,
|
|
101
|
+
keepTogether: { type: 'boolean' },
|
|
102
|
+
underline: { type: 'boolean' },
|
|
103
|
+
strikethrough: { type: 'boolean' },
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
export const codeSchema = {
|
|
107
|
+
type: 'object',
|
|
108
|
+
required: ['type', 'text', 'fontFamily'],
|
|
109
|
+
properties: {
|
|
110
|
+
type: { type: 'string', const: 'code' },
|
|
111
|
+
text: { type: 'string' },
|
|
112
|
+
fontFamily: { type: 'string', description: 'Monospace font family (must be loaded in doc.fonts)' },
|
|
113
|
+
fontSize: { type: 'number' },
|
|
114
|
+
lineHeight: { type: 'number' },
|
|
115
|
+
bgColor: colorSchema,
|
|
116
|
+
color: colorSchema,
|
|
117
|
+
padding: { type: 'number' },
|
|
118
|
+
spaceAfter: spaceSchema,
|
|
119
|
+
spaceBefore: spaceSchema,
|
|
120
|
+
keepTogether: { type: 'boolean' },
|
|
121
|
+
language: { type: 'string', description: "e.g. 'javascript', 'typescript', 'python'" },
|
|
122
|
+
dir: dirSchema,
|
|
123
|
+
highlightTheme: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
description: 'Custom syntax highlight colors (6-digit hex). Overrides default GitHub-light theme.',
|
|
126
|
+
properties: {
|
|
127
|
+
keyword: colorSchema,
|
|
128
|
+
string: colorSchema,
|
|
129
|
+
comment: colorSchema,
|
|
130
|
+
number: colorSchema,
|
|
131
|
+
function: colorSchema,
|
|
132
|
+
punctuation: colorSchema,
|
|
133
|
+
type: colorSchema,
|
|
134
|
+
built_in: colorSchema,
|
|
135
|
+
literal: colorSchema,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
export const calloutSchema = {
|
|
141
|
+
type: 'object',
|
|
142
|
+
required: ['type', 'content'],
|
|
143
|
+
properties: {
|
|
144
|
+
type: { type: 'string', const: 'callout' },
|
|
145
|
+
content: { type: 'string' },
|
|
146
|
+
style: { type: 'string', enum: ['info', 'warning', 'tip', 'note'] },
|
|
147
|
+
title: { type: 'string' },
|
|
148
|
+
backgroundColor: colorSchema,
|
|
149
|
+
borderColor: colorSchema,
|
|
150
|
+
color: colorSchema,
|
|
151
|
+
titleColor: colorSchema,
|
|
152
|
+
fontFamily: { type: 'string' },
|
|
153
|
+
fontWeight: fontWeightSchema,
|
|
154
|
+
fontSize: { type: 'number' },
|
|
155
|
+
lineHeight: { type: 'number' },
|
|
156
|
+
padding: { type: 'number', description: 'Shorthand for paddingH and paddingV. Default: 12' },
|
|
157
|
+
paddingH: { type: 'number', description: 'Horizontal padding inside box in pt. Default: 16' },
|
|
158
|
+
paddingV: { type: 'number', description: 'Vertical padding inside box in pt. Default: 10' },
|
|
159
|
+
spaceBefore: spaceSchema,
|
|
160
|
+
spaceAfter: spaceSchema,
|
|
161
|
+
keepTogether: { type: 'boolean' },
|
|
162
|
+
dir: dirSchema,
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
export const richParagraphSchema = {
|
|
166
|
+
type: 'object',
|
|
167
|
+
required: ['type', 'spans'],
|
|
168
|
+
properties: {
|
|
169
|
+
type: { type: 'string', const: 'rich-paragraph' },
|
|
170
|
+
spans: { type: 'array', items: inlineSpanSchema },
|
|
171
|
+
dir: dirSchema,
|
|
172
|
+
fontSize: { type: 'number' },
|
|
173
|
+
lineHeight: { type: 'number' },
|
|
174
|
+
align: alignSchema,
|
|
175
|
+
bgColor: colorSchema,
|
|
176
|
+
spaceBefore: spaceSchema,
|
|
177
|
+
spaceAfter: spaceSchema,
|
|
178
|
+
keepTogether: { type: 'boolean' },
|
|
179
|
+
letterSpacing: { type: 'number' },
|
|
180
|
+
smallCaps: { type: 'boolean' },
|
|
181
|
+
tabularNumbers: { type: 'boolean', description: 'Render digits at fixed slot width for aligned numeric columns.' },
|
|
182
|
+
columns: { type: 'number', description: 'Number of columns for multi-column layout. Default: 1' },
|
|
183
|
+
columnGap: { type: 'number', description: 'Gap between columns in pt. Default: 24' },
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
export const listSchema = {
|
|
187
|
+
type: 'object',
|
|
188
|
+
required: ['type', 'style', 'items'],
|
|
189
|
+
properties: {
|
|
190
|
+
type: { type: 'string', const: 'list' },
|
|
191
|
+
style: { type: 'string', enum: ['ordered', 'unordered'] },
|
|
192
|
+
items: {
|
|
193
|
+
type: 'array',
|
|
194
|
+
items: {
|
|
195
|
+
type: 'object',
|
|
196
|
+
required: ['text'],
|
|
197
|
+
properties: {
|
|
198
|
+
text: { type: 'string' },
|
|
199
|
+
dir: dirSchema,
|
|
200
|
+
fontWeight: fontWeightSchema,
|
|
201
|
+
items: {
|
|
202
|
+
type: 'array',
|
|
203
|
+
description: 'Nested list items (up to 2 levels)',
|
|
204
|
+
items: {
|
|
205
|
+
type: 'object',
|
|
206
|
+
required: ['text'],
|
|
207
|
+
properties: {
|
|
208
|
+
text: { type: 'string' },
|
|
209
|
+
dir: dirSchema,
|
|
210
|
+
fontWeight: fontWeightSchema,
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
marker: { type: 'string' },
|
|
218
|
+
indent: { type: 'number' },
|
|
219
|
+
markerWidth: { type: 'number', description: 'Width reserved for marker column in pt. Default: 20' },
|
|
220
|
+
fontSize: { type: 'number' },
|
|
221
|
+
lineHeight: { type: 'number' },
|
|
222
|
+
itemSpaceAfter: { type: 'number', description: 'Space between list items in pt. Default: 4' },
|
|
223
|
+
nestedNumberingStyle: { type: 'string', enum: ['continue', 'restart'], description: 'How nested ordered counters behave. Default: continue' },
|
|
224
|
+
color: colorSchema,
|
|
225
|
+
spaceAfter: spaceSchema,
|
|
226
|
+
spaceBefore: spaceSchema,
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
export const tocSchema = {
|
|
230
|
+
type: 'object',
|
|
231
|
+
required: ['type'],
|
|
232
|
+
properties: {
|
|
233
|
+
type: { type: 'string', const: 'toc' },
|
|
234
|
+
title: { type: 'string' },
|
|
235
|
+
showTitle: { type: 'boolean' },
|
|
236
|
+
minLevel: { type: 'number', enum: [1, 2, 3, 4] },
|
|
237
|
+
maxLevel: { type: 'number', enum: [1, 2, 3, 4] },
|
|
238
|
+
fontSize: { type: 'number' },
|
|
239
|
+
titleFontSize: { type: 'number', description: 'Font size for TOC title. Default: fontSize + 4' },
|
|
240
|
+
levelIndent: { type: 'number', description: 'Indentation per level in pt. Default: 16' },
|
|
241
|
+
leader: { type: 'string', description: 'Leader character between entry and page number. Default: .' },
|
|
242
|
+
entrySpacing: { type: 'number', description: 'Space after each entry line in pt. Default: 4' },
|
|
243
|
+
fontFamily: { type: 'string' },
|
|
244
|
+
spaceBefore: spaceSchema,
|
|
245
|
+
spaceAfter: spaceSchema,
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
export const footnoteDefSchema = {
|
|
249
|
+
type: 'object',
|
|
250
|
+
required: ['type', 'id', 'text'],
|
|
251
|
+
properties: {
|
|
252
|
+
type: { type: 'string', const: 'footnote-def' },
|
|
253
|
+
id: { type: 'string' },
|
|
254
|
+
text: { type: 'string' },
|
|
255
|
+
fontSize: { type: 'number' },
|
|
256
|
+
fontFamily: { type: 'string' },
|
|
257
|
+
spaceAfter: spaceSchema,
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
//# sourceMappingURL=elements-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements-text.js","sourceRoot":"","sources":["../../src/schema/elements-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB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;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC;IAChC,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE;QAC/C,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACtB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,UAAU,EAAE,WAAW;KACxB;CACO,CAAA"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/** Atomic sub-schemas shared across element schemas. */
|
|
2
|
+
export declare const alignSchema: {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly enum: readonly ["left", "center", "right", "justify"];
|
|
5
|
+
};
|
|
6
|
+
export declare const alignNoJustify: {
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
readonly enum: readonly ["left", "center", "right"];
|
|
9
|
+
};
|
|
10
|
+
export declare const fontWeightSchema: {
|
|
11
|
+
readonly type: "number";
|
|
12
|
+
readonly enum: readonly [400, 700];
|
|
13
|
+
};
|
|
14
|
+
export declare const colorSchema: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly pattern: "^#[0-9A-Fa-f]{6}$";
|
|
17
|
+
readonly description: "6-digit hex color e.g. #FF0000";
|
|
18
|
+
};
|
|
19
|
+
export declare const dirSchema: {
|
|
20
|
+
readonly type: "string";
|
|
21
|
+
readonly enum: readonly ["ltr", "rtl", "auto"];
|
|
22
|
+
};
|
|
23
|
+
export declare const spaceSchema: {
|
|
24
|
+
readonly type: "number";
|
|
25
|
+
readonly description: "Space in points (pt)";
|
|
26
|
+
};
|
|
27
|
+
export declare const inlineSpanSchema: {
|
|
28
|
+
readonly type: "object";
|
|
29
|
+
readonly required: readonly ["text"];
|
|
30
|
+
readonly properties: {
|
|
31
|
+
readonly text: {
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
};
|
|
34
|
+
readonly dir: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
readonly enum: readonly ["ltr", "rtl", "auto"];
|
|
37
|
+
};
|
|
38
|
+
readonly fontFamily: {
|
|
39
|
+
readonly type: "string";
|
|
40
|
+
};
|
|
41
|
+
readonly fontWeight: {
|
|
42
|
+
readonly type: "number";
|
|
43
|
+
readonly enum: readonly [400, 700];
|
|
44
|
+
};
|
|
45
|
+
readonly fontStyle: {
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
readonly enum: readonly ["normal", "italic"];
|
|
48
|
+
};
|
|
49
|
+
readonly color: {
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
readonly pattern: "^#[0-9A-Fa-f]{6}$";
|
|
52
|
+
readonly description: "6-digit hex color e.g. #FF0000";
|
|
53
|
+
};
|
|
54
|
+
readonly fontSize: {
|
|
55
|
+
readonly type: "number";
|
|
56
|
+
};
|
|
57
|
+
readonly underline: {
|
|
58
|
+
readonly type: "boolean";
|
|
59
|
+
};
|
|
60
|
+
readonly strikethrough: {
|
|
61
|
+
readonly type: "boolean";
|
|
62
|
+
};
|
|
63
|
+
readonly url: {
|
|
64
|
+
readonly type: "string";
|
|
65
|
+
};
|
|
66
|
+
readonly href: {
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
};
|
|
69
|
+
readonly verticalAlign: {
|
|
70
|
+
readonly type: "string";
|
|
71
|
+
readonly enum: readonly ["superscript", "subscript"];
|
|
72
|
+
};
|
|
73
|
+
readonly smallCaps: {
|
|
74
|
+
readonly type: "boolean";
|
|
75
|
+
};
|
|
76
|
+
readonly letterSpacing: {
|
|
77
|
+
readonly type: "number";
|
|
78
|
+
};
|
|
79
|
+
readonly footnoteRef: {
|
|
80
|
+
readonly type: "string";
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/schema/shared.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,eAAO,MAAM,WAAW;;;CAA4E,CAAA;AACpG,eAAO,MAAM,cAAc;;;CAAiE,CAAA;AAC5F,eAAO,MAAM,gBAAgB;;;CAAgD,CAAA;AAC7E,eAAO,MAAM,WAAW;;;;CAA2G,CAAA;AACnI,eAAO,MAAM,SAAS;;;CAA4D,CAAA;AAClF,eAAO,MAAM,WAAW;;;CAAmE,CAAA;AAE3F,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBnB,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Atomic sub-schemas shared across element schemas. */
|
|
2
|
+
export const alignSchema = { type: 'string', enum: ['left', 'center', 'right', 'justify'] };
|
|
3
|
+
export const alignNoJustify = { type: 'string', enum: ['left', 'center', 'right'] };
|
|
4
|
+
export const fontWeightSchema = { type: 'number', enum: [400, 700] };
|
|
5
|
+
export const colorSchema = { type: 'string', pattern: '^#[0-9A-Fa-f]{6}$', description: '6-digit hex color e.g. #FF0000' };
|
|
6
|
+
export const dirSchema = { type: 'string', enum: ['ltr', 'rtl', 'auto'] };
|
|
7
|
+
export const spaceSchema = { type: 'number', description: 'Space in points (pt)' };
|
|
8
|
+
export const inlineSpanSchema = {
|
|
9
|
+
type: 'object',
|
|
10
|
+
required: ['text'],
|
|
11
|
+
properties: {
|
|
12
|
+
text: { type: 'string' },
|
|
13
|
+
dir: dirSchema,
|
|
14
|
+
fontFamily: { type: 'string' },
|
|
15
|
+
fontWeight: fontWeightSchema,
|
|
16
|
+
fontStyle: { type: 'string', enum: ['normal', 'italic'] },
|
|
17
|
+
color: colorSchema,
|
|
18
|
+
fontSize: { type: 'number' },
|
|
19
|
+
underline: { type: 'boolean' },
|
|
20
|
+
strikethrough: { type: 'boolean' },
|
|
21
|
+
url: { type: 'string' },
|
|
22
|
+
href: { type: 'string' },
|
|
23
|
+
verticalAlign: { type: 'string', enum: ['superscript', 'subscript'] },
|
|
24
|
+
smallCaps: { type: 'boolean' },
|
|
25
|
+
letterSpacing: { type: 'number' },
|
|
26
|
+
footnoteRef: { type: 'string' },
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/schema/shared.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,EAAW,CAAA;AACpG,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAW,CAAA;AAC5F,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAW,CAAA;AAC7E,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,gCAAgC,EAAW,CAAA;AACnI,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAAW,CAAA;AAClF,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sBAAsB,EAAW,CAAA;AAE3F,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,C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