document-content-model 7.15.2 → 7.16.0
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/dist/bijection-constructs-3By08A5K.cjs +14695 -0
- package/dist/bijection-constructs-DlP29TpB.js +14624 -0
- package/dist/bijection-constructs.cjs +4 -0
- package/dist/bijection-constructs.d.cts +6 -0
- package/dist/bijection-constructs.d.ts +6 -0
- package/dist/bijection-constructs.js +2 -0
- package/dist/bijection-corpus.cjs +12 -0
- package/dist/bijection-corpus.d.cts +46 -0
- package/dist/bijection-corpus.d.ts +46 -0
- package/dist/bijection-corpus.js +2 -0
- package/dist/codec.d.cts +3 -3
- package/dist/codec.d.ts +3 -3
- package/dist/{construct-GVdTKrE7.d.cts → construct-C4XiF8OW.d.cts} +3 -3
- package/dist/{construct-GVdTKrE7.d.ts → construct-C4XiF8OW.d.ts} +3 -3
- package/dist/construct.d.cts +1 -1
- package/dist/construct.d.ts +1 -1
- package/dist/{content-CYB2gqF8.d.ts → content-CBE4kBMo.d.ts} +7924 -6158
- package/dist/{content-CG0dBdiE.d.cts → content-DKx5QaRd.d.cts} +7924 -6158
- package/dist/content-drawing-Dlo8cXJj.d.cts +1606 -0
- package/dist/content-drawing-DuvQQwuc.d.ts +1606 -0
- package/dist/content-drawing.cjs +186 -0
- package/dist/content-drawing.d.cts +2 -0
- package/dist/content-drawing.d.ts +2 -0
- package/dist/content-drawing.js +171 -0
- package/dist/content-json-schema-defs.cjs +29 -3035
- package/dist/content-json-schema-defs.d.cts +2 -6
- package/dist/content-json-schema-defs.d.ts +2 -6
- package/dist/content-json-schema-defs.js +30 -3033
- package/dist/content-sheet.cjs +408 -0
- package/dist/content-sheet.d.cts +2 -0
- package/dist/content-sheet.d.ts +2 -0
- package/dist/content-sheet.js +385 -0
- package/dist/content-vocabulary.cjs +190 -0
- package/dist/content-vocabulary.d.cts +2 -0
- package/dist/content-vocabulary.d.ts +2 -0
- package/dist/content-vocabulary.js +168 -0
- package/dist/content.cjs +29 -777
- package/dist/content.d.cts +2 -2
- package/dist/content.d.ts +2 -2
- package/dist/content.js +10 -701
- package/dist/decompose.cjs +5 -0
- package/dist/decompose.d.cts +5 -3
- package/dist/decompose.d.ts +5 -3
- package/dist/decompose.js +5 -1
- package/dist/definitions.cjs +2 -1
- package/dist/definitions.d.cts +4 -4
- package/dist/definitions.d.ts +4 -4
- package/dist/definitions.js +2 -1
- package/dist/factor-styles.cjs +2 -0
- package/dist/factor-styles.d.cts +1 -1
- package/dist/factor-styles.d.ts +1 -1
- package/dist/factor-styles.js +4 -2
- package/dist/flatten.cjs +5 -0
- package/dist/flatten.d.cts +3 -2
- package/dist/flatten.d.ts +3 -2
- package/dist/flatten.js +5 -1
- package/dist/index.cjs +71 -67
- package/dist/index.d.cts +12 -10
- package/dist/index.d.ts +12 -10
- package/dist/index.js +12 -12
- package/dist/json-schema-defs-blocks.cjs +1036 -0
- package/dist/json-schema-defs-blocks.d.cts +5 -0
- package/dist/json-schema-defs-blocks.d.ts +5 -0
- package/dist/json-schema-defs-blocks.js +1035 -0
- package/dist/json-schema-defs-math.cjs +291 -0
- package/dist/json-schema-defs-math.d.cts +5 -0
- package/dist/json-schema-defs-math.d.ts +5 -0
- package/dist/json-schema-defs-math.js +290 -0
- package/dist/json-schema-defs-shared.cjs +42 -0
- package/dist/json-schema-defs-shared.d.cts +9 -0
- package/dist/json-schema-defs-shared.d.ts +9 -0
- package/dist/json-schema-defs-shared.js +38 -0
- package/dist/json-schema-defs-sheet.cjs +944 -0
- package/dist/json-schema-defs-sheet.d.cts +5 -0
- package/dist/json-schema-defs-sheet.d.ts +5 -0
- package/dist/json-schema-defs-sheet.js +943 -0
- package/dist/json-schema-defs-tree.cjs +237 -0
- package/dist/json-schema-defs-tree.d.cts +5 -0
- package/dist/json-schema-defs-tree.d.ts +5 -0
- package/dist/json-schema-defs-tree.js +237 -0
- package/dist/json-schema-defs-vector.cjs +513 -0
- package/dist/json-schema-defs-vector.d.cts +5 -0
- package/dist/json-schema-defs-vector.d.ts +5 -0
- package/dist/json-schema-defs-vector.js +512 -0
- package/dist/magic-string.es-CB2hOw9v.js +1012 -0
- package/dist/magic-string.es-MEBc20Ce.cjs +1012 -0
- package/dist/math-layout.d.cts +2 -2
- package/dist/math-layout.d.ts +2 -2
- package/dist/math.cjs +7 -5
- package/dist/math.js +7 -5
- package/dist/mathml.cjs +3 -1
- package/dist/mathml.js +3 -1
- package/dist/{package-node-B8eeIyze.d.cts → package-node-BYL2owXg.d.cts} +40 -39
- package/dist/{package-node-BOvXA2-v.d.ts → package-node-vI3Q0nFf.d.ts} +40 -39
- package/dist/package-node.cjs +12 -9
- package/dist/package-node.d.cts +1 -1
- package/dist/package-node.d.ts +1 -1
- package/dist/package-node.js +4 -1
- package/dist/package.d.cts +6 -6
- package/dist/package.d.ts +6 -6
- package/dist/schema-io.cjs +7 -2
- package/dist/schema-io.d.cts +3 -2
- package/dist/schema-io.d.ts +3 -2
- package/dist/schema-io.js +7 -3
- package/dist/{style-BGMcYrD2.d.cts → style-D06NwxAJ.d.cts} +1 -1
- package/dist/{style-BGMcYrD2.d.ts → style-D06NwxAJ.d.ts} +1 -1
- package/dist/style.d.cts +1 -1
- package/dist/style.d.ts +1 -1
- package/dist/table-grid.cjs +5 -0
- package/dist/table-grid.d.cts +4 -3
- package/dist/table-grid.d.ts +4 -3
- package/dist/table-grid.js +5 -1
- package/dist/text-layout.d.cts +7 -7
- package/dist/text-layout.d.ts +7 -7
- package/package.json +1 -1
- package/schemas/content-document.schema.json +16 -16
- package/schemas/document-tree.schema.json +3 -3
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_math = require("./math.cjs");
|
|
3
|
+
const require_json_schema_defs_shared = require("./json-schema-defs-shared.cjs");
|
|
4
|
+
//#region src/json-schema-defs-math.ts
|
|
5
|
+
const DEFS_MATH = {
|
|
6
|
+
ContentFormula: {
|
|
7
|
+
type: "object",
|
|
8
|
+
properties: {
|
|
9
|
+
mathml: {
|
|
10
|
+
type: "array",
|
|
11
|
+
items: { $ref: "#/$defs/MathMlNode" }
|
|
12
|
+
},
|
|
13
|
+
starMath: { type: "string" },
|
|
14
|
+
presentation: { $ref: "#/$defs/MathPresentation" },
|
|
15
|
+
content: { $ref: "#/$defs/MathExpression" },
|
|
16
|
+
provenance: { $ref: "#/$defs/MathProvenance" },
|
|
17
|
+
source: { $ref: "#/$defs/SourceResidue" },
|
|
18
|
+
origin: { $ref: "#/$defs/ContentOrigin" },
|
|
19
|
+
interpretation: { $ref: "#/$defs/ContentInterpretation" }
|
|
20
|
+
},
|
|
21
|
+
required: ["mathml"],
|
|
22
|
+
additionalProperties: false
|
|
23
|
+
},
|
|
24
|
+
ExactRational: {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
numerator: {
|
|
28
|
+
type: "string",
|
|
29
|
+
pattern: "^(0|-?[1-9]\\d*)$"
|
|
30
|
+
},
|
|
31
|
+
denominator: {
|
|
32
|
+
type: "string",
|
|
33
|
+
pattern: "^[1-9]\\d*$"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
required: ["numerator", "denominator"],
|
|
37
|
+
additionalProperties: false
|
|
38
|
+
},
|
|
39
|
+
DimensionVector: {
|
|
40
|
+
type: "object",
|
|
41
|
+
propertyNames: {
|
|
42
|
+
type: "string",
|
|
43
|
+
enum: [...require_math.SI_BASE_DIMENSIONS]
|
|
44
|
+
},
|
|
45
|
+
additionalProperties: {
|
|
46
|
+
type: "integer",
|
|
47
|
+
minimum: -require_json_schema_defs_shared.MAX_SAFE_INTEGER,
|
|
48
|
+
maximum: require_json_schema_defs_shared.MAX_SAFE_INTEGER
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
MathPresentation: {
|
|
52
|
+
type: "object",
|
|
53
|
+
properties: { latex: { type: "string" } },
|
|
54
|
+
required: ["latex"],
|
|
55
|
+
additionalProperties: false
|
|
56
|
+
},
|
|
57
|
+
MathProvenance: {
|
|
58
|
+
type: "object",
|
|
59
|
+
properties: {
|
|
60
|
+
source: { type: "string" },
|
|
61
|
+
pageRef: { type: "string" },
|
|
62
|
+
editTrail: {
|
|
63
|
+
type: "array",
|
|
64
|
+
items: { type: "string" }
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
required: ["source", "editTrail"],
|
|
68
|
+
additionalProperties: false
|
|
69
|
+
},
|
|
70
|
+
MathUncertainty: {
|
|
71
|
+
type: "object",
|
|
72
|
+
properties: {
|
|
73
|
+
magnitude: { $ref: "#/$defs/ExactRational" },
|
|
74
|
+
unit: { type: "string" },
|
|
75
|
+
coverageFactor: {
|
|
76
|
+
type: "number",
|
|
77
|
+
exclusiveMinimum: 0
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
required: ["magnitude"],
|
|
81
|
+
additionalProperties: false
|
|
82
|
+
},
|
|
83
|
+
MathSymbolEntry: {
|
|
84
|
+
type: "object",
|
|
85
|
+
properties: {
|
|
86
|
+
glyph: { type: "string" },
|
|
87
|
+
scope: { type: "string" },
|
|
88
|
+
id: { type: "string" },
|
|
89
|
+
quantityKind: { type: "string" },
|
|
90
|
+
preferredUnit: { type: "string" },
|
|
91
|
+
definitionSource: { type: "string" }
|
|
92
|
+
},
|
|
93
|
+
required: [
|
|
94
|
+
"glyph",
|
|
95
|
+
"scope",
|
|
96
|
+
"id"
|
|
97
|
+
],
|
|
98
|
+
additionalProperties: false
|
|
99
|
+
},
|
|
100
|
+
MathUnit: {
|
|
101
|
+
type: "object",
|
|
102
|
+
properties: {
|
|
103
|
+
id: { type: "string" },
|
|
104
|
+
symbol: { type: "string" },
|
|
105
|
+
name: { type: "string" },
|
|
106
|
+
dimension: { $ref: "#/$defs/DimensionVector" },
|
|
107
|
+
factorToSi: { $ref: "#/$defs/ExactRational" },
|
|
108
|
+
offsetToSi: { $ref: "#/$defs/ExactRational" },
|
|
109
|
+
context: { type: "string" }
|
|
110
|
+
},
|
|
111
|
+
required: [
|
|
112
|
+
"id",
|
|
113
|
+
"symbol",
|
|
114
|
+
"dimension",
|
|
115
|
+
"factorToSi"
|
|
116
|
+
],
|
|
117
|
+
additionalProperties: false
|
|
118
|
+
},
|
|
119
|
+
MathNormalisationContext: {
|
|
120
|
+
type: "object",
|
|
121
|
+
properties: {
|
|
122
|
+
id: { type: "string" },
|
|
123
|
+
bases: {
|
|
124
|
+
type: "array",
|
|
125
|
+
items: {
|
|
126
|
+
type: "object",
|
|
127
|
+
properties: {
|
|
128
|
+
unit: { type: "string" },
|
|
129
|
+
value: { $ref: "#/$defs/ExactRational" }
|
|
130
|
+
},
|
|
131
|
+
required: ["unit", "value"],
|
|
132
|
+
additionalProperties: false
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
required: ["id", "bases"],
|
|
137
|
+
additionalProperties: false
|
|
138
|
+
},
|
|
139
|
+
TreeEmbeddedFont: {
|
|
140
|
+
type: "object",
|
|
141
|
+
properties: {
|
|
142
|
+
family: { type: "string" },
|
|
143
|
+
bold: { type: "boolean" },
|
|
144
|
+
italic: { type: "boolean" },
|
|
145
|
+
base64: { type: "string" }
|
|
146
|
+
},
|
|
147
|
+
required: [
|
|
148
|
+
"family",
|
|
149
|
+
"bold",
|
|
150
|
+
"italic",
|
|
151
|
+
"base64"
|
|
152
|
+
],
|
|
153
|
+
additionalProperties: false
|
|
154
|
+
},
|
|
155
|
+
SymbolTable: {
|
|
156
|
+
type: "object",
|
|
157
|
+
properties: {
|
|
158
|
+
symbols: {
|
|
159
|
+
type: "array",
|
|
160
|
+
items: { $ref: "#/$defs/MathSymbolEntry" }
|
|
161
|
+
},
|
|
162
|
+
units: {
|
|
163
|
+
type: "array",
|
|
164
|
+
items: { $ref: "#/$defs/MathUnit" }
|
|
165
|
+
},
|
|
166
|
+
contexts: {
|
|
167
|
+
type: "array",
|
|
168
|
+
items: { $ref: "#/$defs/MathNormalisationContext" }
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
required: ["symbols", "units"],
|
|
172
|
+
additionalProperties: false
|
|
173
|
+
},
|
|
174
|
+
MathNum: {
|
|
175
|
+
type: "object",
|
|
176
|
+
properties: {
|
|
177
|
+
kind: {
|
|
178
|
+
type: "string",
|
|
179
|
+
const: "num"
|
|
180
|
+
},
|
|
181
|
+
numerator: {
|
|
182
|
+
type: "string",
|
|
183
|
+
pattern: "^(0|-?[1-9]\\d*)$"
|
|
184
|
+
},
|
|
185
|
+
denominator: {
|
|
186
|
+
type: "string",
|
|
187
|
+
pattern: "^[1-9]\\d*$"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
required: [
|
|
191
|
+
"kind",
|
|
192
|
+
"numerator",
|
|
193
|
+
"denominator"
|
|
194
|
+
],
|
|
195
|
+
additionalProperties: false
|
|
196
|
+
},
|
|
197
|
+
MathQty: {
|
|
198
|
+
type: "object",
|
|
199
|
+
properties: {
|
|
200
|
+
kind: {
|
|
201
|
+
type: "string",
|
|
202
|
+
const: "qty"
|
|
203
|
+
},
|
|
204
|
+
value: { $ref: "#/$defs/ExactRational" },
|
|
205
|
+
unit: { type: "string" },
|
|
206
|
+
uncertainty: { $ref: "#/$defs/MathUncertainty" }
|
|
207
|
+
},
|
|
208
|
+
required: [
|
|
209
|
+
"kind",
|
|
210
|
+
"value",
|
|
211
|
+
"unit"
|
|
212
|
+
],
|
|
213
|
+
additionalProperties: false
|
|
214
|
+
},
|
|
215
|
+
MathSym: {
|
|
216
|
+
type: "object",
|
|
217
|
+
properties: {
|
|
218
|
+
kind: {
|
|
219
|
+
type: "string",
|
|
220
|
+
const: "sym"
|
|
221
|
+
},
|
|
222
|
+
id: { type: "string" }
|
|
223
|
+
},
|
|
224
|
+
required: ["kind", "id"],
|
|
225
|
+
additionalProperties: false
|
|
226
|
+
},
|
|
227
|
+
MathApp: {
|
|
228
|
+
type: "object",
|
|
229
|
+
properties: {
|
|
230
|
+
kind: {
|
|
231
|
+
type: "string",
|
|
232
|
+
const: "app"
|
|
233
|
+
},
|
|
234
|
+
operator: { type: "string" },
|
|
235
|
+
args: {
|
|
236
|
+
type: "array",
|
|
237
|
+
items: { $ref: "#/$defs/MathExpression" }
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
required: [
|
|
241
|
+
"kind",
|
|
242
|
+
"operator",
|
|
243
|
+
"args"
|
|
244
|
+
],
|
|
245
|
+
additionalProperties: false
|
|
246
|
+
},
|
|
247
|
+
MathSum: require_json_schema_defs_shared.mathBinderDef("sum"),
|
|
248
|
+
MathProd: require_json_schema_defs_shared.mathBinderDef("prod"),
|
|
249
|
+
MathMatrix: {
|
|
250
|
+
type: "object",
|
|
251
|
+
properties: {
|
|
252
|
+
kind: {
|
|
253
|
+
type: "string",
|
|
254
|
+
const: "matrix"
|
|
255
|
+
},
|
|
256
|
+
rows: {
|
|
257
|
+
type: "array",
|
|
258
|
+
items: {
|
|
259
|
+
type: "array",
|
|
260
|
+
items: { $ref: "#/$defs/MathExpression" }
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
required: ["kind", "rows"],
|
|
265
|
+
additionalProperties: false
|
|
266
|
+
},
|
|
267
|
+
MathUnparsed: {
|
|
268
|
+
type: "object",
|
|
269
|
+
properties: {
|
|
270
|
+
kind: {
|
|
271
|
+
type: "string",
|
|
272
|
+
const: "unparsed"
|
|
273
|
+
},
|
|
274
|
+
latex: { type: "string" }
|
|
275
|
+
},
|
|
276
|
+
required: ["kind", "latex"],
|
|
277
|
+
additionalProperties: false
|
|
278
|
+
},
|
|
279
|
+
MathExpression: { oneOf: [
|
|
280
|
+
{ $ref: "#/$defs/MathNum" },
|
|
281
|
+
{ $ref: "#/$defs/MathQty" },
|
|
282
|
+
{ $ref: "#/$defs/MathSym" },
|
|
283
|
+
{ $ref: "#/$defs/MathApp" },
|
|
284
|
+
{ $ref: "#/$defs/MathSum" },
|
|
285
|
+
{ $ref: "#/$defs/MathProd" },
|
|
286
|
+
{ $ref: "#/$defs/MathMatrix" },
|
|
287
|
+
{ $ref: "#/$defs/MathUnparsed" }
|
|
288
|
+
] }
|
|
289
|
+
};
|
|
290
|
+
//#endregion
|
|
291
|
+
exports.DEFS_MATH = DEFS_MATH;
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { SI_BASE_DIMENSIONS } from "./math.js";
|
|
2
|
+
import { MAX_SAFE_INTEGER, mathBinderDef } from "./json-schema-defs-shared.js";
|
|
3
|
+
//#region src/json-schema-defs-math.ts
|
|
4
|
+
const DEFS_MATH = {
|
|
5
|
+
ContentFormula: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
mathml: {
|
|
9
|
+
type: "array",
|
|
10
|
+
items: { $ref: "#/$defs/MathMlNode" }
|
|
11
|
+
},
|
|
12
|
+
starMath: { type: "string" },
|
|
13
|
+
presentation: { $ref: "#/$defs/MathPresentation" },
|
|
14
|
+
content: { $ref: "#/$defs/MathExpression" },
|
|
15
|
+
provenance: { $ref: "#/$defs/MathProvenance" },
|
|
16
|
+
source: { $ref: "#/$defs/SourceResidue" },
|
|
17
|
+
origin: { $ref: "#/$defs/ContentOrigin" },
|
|
18
|
+
interpretation: { $ref: "#/$defs/ContentInterpretation" }
|
|
19
|
+
},
|
|
20
|
+
required: ["mathml"],
|
|
21
|
+
additionalProperties: false
|
|
22
|
+
},
|
|
23
|
+
ExactRational: {
|
|
24
|
+
type: "object",
|
|
25
|
+
properties: {
|
|
26
|
+
numerator: {
|
|
27
|
+
type: "string",
|
|
28
|
+
pattern: "^(0|-?[1-9]\\d*)$"
|
|
29
|
+
},
|
|
30
|
+
denominator: {
|
|
31
|
+
type: "string",
|
|
32
|
+
pattern: "^[1-9]\\d*$"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
required: ["numerator", "denominator"],
|
|
36
|
+
additionalProperties: false
|
|
37
|
+
},
|
|
38
|
+
DimensionVector: {
|
|
39
|
+
type: "object",
|
|
40
|
+
propertyNames: {
|
|
41
|
+
type: "string",
|
|
42
|
+
enum: [...SI_BASE_DIMENSIONS]
|
|
43
|
+
},
|
|
44
|
+
additionalProperties: {
|
|
45
|
+
type: "integer",
|
|
46
|
+
minimum: -MAX_SAFE_INTEGER,
|
|
47
|
+
maximum: MAX_SAFE_INTEGER
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
MathPresentation: {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: { latex: { type: "string" } },
|
|
53
|
+
required: ["latex"],
|
|
54
|
+
additionalProperties: false
|
|
55
|
+
},
|
|
56
|
+
MathProvenance: {
|
|
57
|
+
type: "object",
|
|
58
|
+
properties: {
|
|
59
|
+
source: { type: "string" },
|
|
60
|
+
pageRef: { type: "string" },
|
|
61
|
+
editTrail: {
|
|
62
|
+
type: "array",
|
|
63
|
+
items: { type: "string" }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
required: ["source", "editTrail"],
|
|
67
|
+
additionalProperties: false
|
|
68
|
+
},
|
|
69
|
+
MathUncertainty: {
|
|
70
|
+
type: "object",
|
|
71
|
+
properties: {
|
|
72
|
+
magnitude: { $ref: "#/$defs/ExactRational" },
|
|
73
|
+
unit: { type: "string" },
|
|
74
|
+
coverageFactor: {
|
|
75
|
+
type: "number",
|
|
76
|
+
exclusiveMinimum: 0
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
required: ["magnitude"],
|
|
80
|
+
additionalProperties: false
|
|
81
|
+
},
|
|
82
|
+
MathSymbolEntry: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {
|
|
85
|
+
glyph: { type: "string" },
|
|
86
|
+
scope: { type: "string" },
|
|
87
|
+
id: { type: "string" },
|
|
88
|
+
quantityKind: { type: "string" },
|
|
89
|
+
preferredUnit: { type: "string" },
|
|
90
|
+
definitionSource: { type: "string" }
|
|
91
|
+
},
|
|
92
|
+
required: [
|
|
93
|
+
"glyph",
|
|
94
|
+
"scope",
|
|
95
|
+
"id"
|
|
96
|
+
],
|
|
97
|
+
additionalProperties: false
|
|
98
|
+
},
|
|
99
|
+
MathUnit: {
|
|
100
|
+
type: "object",
|
|
101
|
+
properties: {
|
|
102
|
+
id: { type: "string" },
|
|
103
|
+
symbol: { type: "string" },
|
|
104
|
+
name: { type: "string" },
|
|
105
|
+
dimension: { $ref: "#/$defs/DimensionVector" },
|
|
106
|
+
factorToSi: { $ref: "#/$defs/ExactRational" },
|
|
107
|
+
offsetToSi: { $ref: "#/$defs/ExactRational" },
|
|
108
|
+
context: { type: "string" }
|
|
109
|
+
},
|
|
110
|
+
required: [
|
|
111
|
+
"id",
|
|
112
|
+
"symbol",
|
|
113
|
+
"dimension",
|
|
114
|
+
"factorToSi"
|
|
115
|
+
],
|
|
116
|
+
additionalProperties: false
|
|
117
|
+
},
|
|
118
|
+
MathNormalisationContext: {
|
|
119
|
+
type: "object",
|
|
120
|
+
properties: {
|
|
121
|
+
id: { type: "string" },
|
|
122
|
+
bases: {
|
|
123
|
+
type: "array",
|
|
124
|
+
items: {
|
|
125
|
+
type: "object",
|
|
126
|
+
properties: {
|
|
127
|
+
unit: { type: "string" },
|
|
128
|
+
value: { $ref: "#/$defs/ExactRational" }
|
|
129
|
+
},
|
|
130
|
+
required: ["unit", "value"],
|
|
131
|
+
additionalProperties: false
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
required: ["id", "bases"],
|
|
136
|
+
additionalProperties: false
|
|
137
|
+
},
|
|
138
|
+
TreeEmbeddedFont: {
|
|
139
|
+
type: "object",
|
|
140
|
+
properties: {
|
|
141
|
+
family: { type: "string" },
|
|
142
|
+
bold: { type: "boolean" },
|
|
143
|
+
italic: { type: "boolean" },
|
|
144
|
+
base64: { type: "string" }
|
|
145
|
+
},
|
|
146
|
+
required: [
|
|
147
|
+
"family",
|
|
148
|
+
"bold",
|
|
149
|
+
"italic",
|
|
150
|
+
"base64"
|
|
151
|
+
],
|
|
152
|
+
additionalProperties: false
|
|
153
|
+
},
|
|
154
|
+
SymbolTable: {
|
|
155
|
+
type: "object",
|
|
156
|
+
properties: {
|
|
157
|
+
symbols: {
|
|
158
|
+
type: "array",
|
|
159
|
+
items: { $ref: "#/$defs/MathSymbolEntry" }
|
|
160
|
+
},
|
|
161
|
+
units: {
|
|
162
|
+
type: "array",
|
|
163
|
+
items: { $ref: "#/$defs/MathUnit" }
|
|
164
|
+
},
|
|
165
|
+
contexts: {
|
|
166
|
+
type: "array",
|
|
167
|
+
items: { $ref: "#/$defs/MathNormalisationContext" }
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
required: ["symbols", "units"],
|
|
171
|
+
additionalProperties: false
|
|
172
|
+
},
|
|
173
|
+
MathNum: {
|
|
174
|
+
type: "object",
|
|
175
|
+
properties: {
|
|
176
|
+
kind: {
|
|
177
|
+
type: "string",
|
|
178
|
+
const: "num"
|
|
179
|
+
},
|
|
180
|
+
numerator: {
|
|
181
|
+
type: "string",
|
|
182
|
+
pattern: "^(0|-?[1-9]\\d*)$"
|
|
183
|
+
},
|
|
184
|
+
denominator: {
|
|
185
|
+
type: "string",
|
|
186
|
+
pattern: "^[1-9]\\d*$"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
required: [
|
|
190
|
+
"kind",
|
|
191
|
+
"numerator",
|
|
192
|
+
"denominator"
|
|
193
|
+
],
|
|
194
|
+
additionalProperties: false
|
|
195
|
+
},
|
|
196
|
+
MathQty: {
|
|
197
|
+
type: "object",
|
|
198
|
+
properties: {
|
|
199
|
+
kind: {
|
|
200
|
+
type: "string",
|
|
201
|
+
const: "qty"
|
|
202
|
+
},
|
|
203
|
+
value: { $ref: "#/$defs/ExactRational" },
|
|
204
|
+
unit: { type: "string" },
|
|
205
|
+
uncertainty: { $ref: "#/$defs/MathUncertainty" }
|
|
206
|
+
},
|
|
207
|
+
required: [
|
|
208
|
+
"kind",
|
|
209
|
+
"value",
|
|
210
|
+
"unit"
|
|
211
|
+
],
|
|
212
|
+
additionalProperties: false
|
|
213
|
+
},
|
|
214
|
+
MathSym: {
|
|
215
|
+
type: "object",
|
|
216
|
+
properties: {
|
|
217
|
+
kind: {
|
|
218
|
+
type: "string",
|
|
219
|
+
const: "sym"
|
|
220
|
+
},
|
|
221
|
+
id: { type: "string" }
|
|
222
|
+
},
|
|
223
|
+
required: ["kind", "id"],
|
|
224
|
+
additionalProperties: false
|
|
225
|
+
},
|
|
226
|
+
MathApp: {
|
|
227
|
+
type: "object",
|
|
228
|
+
properties: {
|
|
229
|
+
kind: {
|
|
230
|
+
type: "string",
|
|
231
|
+
const: "app"
|
|
232
|
+
},
|
|
233
|
+
operator: { type: "string" },
|
|
234
|
+
args: {
|
|
235
|
+
type: "array",
|
|
236
|
+
items: { $ref: "#/$defs/MathExpression" }
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
required: [
|
|
240
|
+
"kind",
|
|
241
|
+
"operator",
|
|
242
|
+
"args"
|
|
243
|
+
],
|
|
244
|
+
additionalProperties: false
|
|
245
|
+
},
|
|
246
|
+
MathSum: mathBinderDef("sum"),
|
|
247
|
+
MathProd: mathBinderDef("prod"),
|
|
248
|
+
MathMatrix: {
|
|
249
|
+
type: "object",
|
|
250
|
+
properties: {
|
|
251
|
+
kind: {
|
|
252
|
+
type: "string",
|
|
253
|
+
const: "matrix"
|
|
254
|
+
},
|
|
255
|
+
rows: {
|
|
256
|
+
type: "array",
|
|
257
|
+
items: {
|
|
258
|
+
type: "array",
|
|
259
|
+
items: { $ref: "#/$defs/MathExpression" }
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
required: ["kind", "rows"],
|
|
264
|
+
additionalProperties: false
|
|
265
|
+
},
|
|
266
|
+
MathUnparsed: {
|
|
267
|
+
type: "object",
|
|
268
|
+
properties: {
|
|
269
|
+
kind: {
|
|
270
|
+
type: "string",
|
|
271
|
+
const: "unparsed"
|
|
272
|
+
},
|
|
273
|
+
latex: { type: "string" }
|
|
274
|
+
},
|
|
275
|
+
required: ["kind", "latex"],
|
|
276
|
+
additionalProperties: false
|
|
277
|
+
},
|
|
278
|
+
MathExpression: { oneOf: [
|
|
279
|
+
{ $ref: "#/$defs/MathNum" },
|
|
280
|
+
{ $ref: "#/$defs/MathQty" },
|
|
281
|
+
{ $ref: "#/$defs/MathSym" },
|
|
282
|
+
{ $ref: "#/$defs/MathApp" },
|
|
283
|
+
{ $ref: "#/$defs/MathSum" },
|
|
284
|
+
{ $ref: "#/$defs/MathProd" },
|
|
285
|
+
{ $ref: "#/$defs/MathMatrix" },
|
|
286
|
+
{ $ref: "#/$defs/MathUnparsed" }
|
|
287
|
+
] }
|
|
288
|
+
};
|
|
289
|
+
//#endregion
|
|
290
|
+
export { DEFS_MATH };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_schema_io = require("./schema-io.cjs");
|
|
3
|
+
require("zod");
|
|
4
|
+
//#region src/json-schema-defs-shared.ts
|
|
5
|
+
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER;
|
|
6
|
+
const EMBEDDED_OBJECT_KINDS = [
|
|
7
|
+
"formula",
|
|
8
|
+
"wordprocessing",
|
|
9
|
+
"presentation",
|
|
10
|
+
"spreadsheet",
|
|
11
|
+
"drawing",
|
|
12
|
+
"chart"
|
|
13
|
+
];
|
|
14
|
+
const CONTENT_DOCUMENT_URI = require_schema_io.schemaUriFor("ContentDocument");
|
|
15
|
+
function mathBinderDef(kind) {
|
|
16
|
+
return {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
kind: {
|
|
20
|
+
type: "string",
|
|
21
|
+
const: kind
|
|
22
|
+
},
|
|
23
|
+
binder: { type: "string" },
|
|
24
|
+
lower: { $ref: "#/$defs/MathExpression" },
|
|
25
|
+
upper: { $ref: "#/$defs/MathExpression" },
|
|
26
|
+
body: { $ref: "#/$defs/MathExpression" }
|
|
27
|
+
},
|
|
28
|
+
required: [
|
|
29
|
+
"kind",
|
|
30
|
+
"binder",
|
|
31
|
+
"lower",
|
|
32
|
+
"upper",
|
|
33
|
+
"body"
|
|
34
|
+
],
|
|
35
|
+
additionalProperties: false
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
exports.CONTENT_DOCUMENT_URI = CONTENT_DOCUMENT_URI;
|
|
40
|
+
exports.EMBEDDED_OBJECT_KINDS = EMBEDDED_OBJECT_KINDS;
|
|
41
|
+
exports.MAX_SAFE_INTEGER = MAX_SAFE_INTEGER;
|
|
42
|
+
exports.mathBinderDef = mathBinderDef;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/json-schema-defs-shared.d.ts
|
|
3
|
+
type JsonSchema = z.core.JSONSchema.JSONSchema;
|
|
4
|
+
declare const MAX_SAFE_INTEGER: number;
|
|
5
|
+
declare const EMBEDDED_OBJECT_KINDS: string[];
|
|
6
|
+
declare const CONTENT_DOCUMENT_URI: string;
|
|
7
|
+
declare function mathBinderDef(kind: "sum" | "prod"): JsonSchema;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { CONTENT_DOCUMENT_URI, EMBEDDED_OBJECT_KINDS, JsonSchema, MAX_SAFE_INTEGER, mathBinderDef };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/json-schema-defs-shared.d.ts
|
|
3
|
+
type JsonSchema = z.core.JSONSchema.JSONSchema;
|
|
4
|
+
declare const MAX_SAFE_INTEGER: number;
|
|
5
|
+
declare const EMBEDDED_OBJECT_KINDS: string[];
|
|
6
|
+
declare const CONTENT_DOCUMENT_URI: string;
|
|
7
|
+
declare function mathBinderDef(kind: "sum" | "prod"): JsonSchema;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { CONTENT_DOCUMENT_URI, EMBEDDED_OBJECT_KINDS, JsonSchema, MAX_SAFE_INTEGER, mathBinderDef };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { schemaUriFor } from "./schema-io.js";
|
|
2
|
+
import "zod";
|
|
3
|
+
//#region src/json-schema-defs-shared.ts
|
|
4
|
+
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER;
|
|
5
|
+
const EMBEDDED_OBJECT_KINDS = [
|
|
6
|
+
"formula",
|
|
7
|
+
"wordprocessing",
|
|
8
|
+
"presentation",
|
|
9
|
+
"spreadsheet",
|
|
10
|
+
"drawing",
|
|
11
|
+
"chart"
|
|
12
|
+
];
|
|
13
|
+
const CONTENT_DOCUMENT_URI = schemaUriFor("ContentDocument");
|
|
14
|
+
function mathBinderDef(kind) {
|
|
15
|
+
return {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {
|
|
18
|
+
kind: {
|
|
19
|
+
type: "string",
|
|
20
|
+
const: kind
|
|
21
|
+
},
|
|
22
|
+
binder: { type: "string" },
|
|
23
|
+
lower: { $ref: "#/$defs/MathExpression" },
|
|
24
|
+
upper: { $ref: "#/$defs/MathExpression" },
|
|
25
|
+
body: { $ref: "#/$defs/MathExpression" }
|
|
26
|
+
},
|
|
27
|
+
required: [
|
|
28
|
+
"kind",
|
|
29
|
+
"binder",
|
|
30
|
+
"lower",
|
|
31
|
+
"upper",
|
|
32
|
+
"body"
|
|
33
|
+
],
|
|
34
|
+
additionalProperties: false
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { CONTENT_DOCUMENT_URI, EMBEDDED_OBJECT_KINDS, MAX_SAFE_INTEGER, mathBinderDef };
|