document-model.js 3.1.0 → 3.2.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/style.d.cts CHANGED
@@ -10,12 +10,12 @@ type Alignment = z.infer<typeof AlignmentSchema>;
10
10
  declare const LayoutFontSchema: z.ZodObject<{
11
11
  family: z.ZodString;
12
12
  weight: z.ZodEnum<{
13
- bold: "bold";
14
13
  normal: "normal";
14
+ bold: "bold";
15
15
  }>;
16
16
  style: z.ZodEnum<{
17
- italic: "italic";
18
17
  normal: "normal";
18
+ italic: "italic";
19
19
  }>;
20
20
  }, z.core.$strip>;
21
21
  type LayoutFont = z.infer<typeof LayoutFontSchema>;
package/dist/style.d.ts CHANGED
@@ -10,12 +10,12 @@ type Alignment = z.infer<typeof AlignmentSchema>;
10
10
  declare const LayoutFontSchema: z.ZodObject<{
11
11
  family: z.ZodString;
12
12
  weight: z.ZodEnum<{
13
- bold: "bold";
14
13
  normal: "normal";
14
+ bold: "bold";
15
15
  }>;
16
16
  style: z.ZodEnum<{
17
- italic: "italic";
18
17
  normal: "normal";
18
+ italic: "italic";
19
19
  }>;
20
20
  }, z.core.$strip>;
21
21
  type LayoutFont = z.infer<typeof LayoutFontSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "document-model.js",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "The canonical, format-agnostic content and layout schemas shared by ooxml.js, odf.js, and documents.js -- pure Zod schemas, no behaviour.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@3.1.0/schemas/content-document.schema.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@3.2.0/schemas/content-document.schema.json",
4
4
  "oneOf": [
5
5
  {
6
6
  "type": "object",
@@ -46,6 +46,9 @@
46
46
  },
47
47
  "additionalProperties": false
48
48
  },
49
+ "symbolTable": {
50
+ "$ref": "#/$defs/SymbolTable"
51
+ },
49
52
  "sections": {
50
53
  "type": "array",
51
54
  "items": {
@@ -165,6 +168,9 @@
165
168
  },
166
169
  "additionalProperties": false
167
170
  },
171
+ "symbolTable": {
172
+ "$ref": "#/$defs/SymbolTable"
173
+ },
168
174
  "slides": {
169
175
  "type": "array",
170
176
  "items": {
@@ -373,6 +379,9 @@
373
379
  },
374
380
  "additionalProperties": false
375
381
  },
382
+ "symbolTable": {
383
+ "$ref": "#/$defs/SymbolTable"
384
+ },
376
385
  "sheets": {
377
386
  "type": "array",
378
387
  "items": {
@@ -1384,7 +1393,7 @@
1384
1393
  ]
1385
1394
  },
1386
1395
  "document": {
1387
- "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@3.1.0/schemas/content-document.schema.json"
1396
+ "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@3.2.0/schemas/content-document.schema.json"
1388
1397
  },
1389
1398
  "frame": {
1390
1399
  "$ref": "#/$defs/Box"
@@ -1479,6 +1488,9 @@
1479
1488
  },
1480
1489
  "additionalProperties": false
1481
1490
  },
1491
+ "symbolTable": {
1492
+ "$ref": "#/$defs/SymbolTable"
1493
+ },
1482
1494
  "pages": {
1483
1495
  "type": "array",
1484
1496
  "items": {
@@ -2448,23 +2460,11 @@
2448
2460
  },
2449
2461
  "additionalProperties": false
2450
2462
  },
2463
+ "symbolTable": {
2464
+ "$ref": "#/$defs/SymbolTable"
2465
+ },
2451
2466
  "formula": {
2452
- "type": "object",
2453
- "properties": {
2454
- "mathml": {
2455
- "type": "array",
2456
- "items": {
2457
- "$ref": "#/$defs/MathMlNode"
2458
- }
2459
- },
2460
- "starMath": {
2461
- "type": "string"
2462
- }
2463
- },
2464
- "required": [
2465
- "mathml"
2466
- ],
2467
- "additionalProperties": false
2467
+ "$ref": "#/$defs/ContentFormula"
2468
2468
  }
2469
2469
  },
2470
2470
  "required": [
@@ -2923,7 +2923,7 @@
2923
2923
  ]
2924
2924
  },
2925
2925
  "document": {
2926
- "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@3.1.0/schemas/content-document.schema.json"
2926
+ "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@3.2.0/schemas/content-document.schema.json"
2927
2927
  },
2928
2928
  "frame": {
2929
2929
  "$ref": "#/$defs/Box"
@@ -3126,6 +3126,460 @@
3126
3126
  "$ref": "#/$defs/MathMlElement"
3127
3127
  }
3128
3128
  ]
3129
+ },
3130
+ "ContentFormula": {
3131
+ "type": "object",
3132
+ "properties": {
3133
+ "mathml": {
3134
+ "type": "array",
3135
+ "items": {
3136
+ "$ref": "#/$defs/MathMlNode"
3137
+ }
3138
+ },
3139
+ "starMath": {
3140
+ "type": "string"
3141
+ },
3142
+ "presentation": {
3143
+ "$ref": "#/$defs/MathPresentation"
3144
+ },
3145
+ "content": {
3146
+ "$ref": "#/$defs/MathExpression"
3147
+ },
3148
+ "provenance": {
3149
+ "$ref": "#/$defs/MathProvenance"
3150
+ }
3151
+ },
3152
+ "required": [
3153
+ "mathml"
3154
+ ],
3155
+ "additionalProperties": false
3156
+ },
3157
+ "ExactRational": {
3158
+ "type": "object",
3159
+ "properties": {
3160
+ "numerator": {
3161
+ "type": "string",
3162
+ "pattern": "^(0|-?[1-9]\\d*)$"
3163
+ },
3164
+ "denominator": {
3165
+ "type": "string",
3166
+ "pattern": "^[1-9]\\d*$"
3167
+ }
3168
+ },
3169
+ "required": [
3170
+ "numerator",
3171
+ "denominator"
3172
+ ],
3173
+ "additionalProperties": false
3174
+ },
3175
+ "DimensionVector": {
3176
+ "type": "object",
3177
+ "propertyNames": {
3178
+ "type": "string",
3179
+ "enum": [
3180
+ "length",
3181
+ "mass",
3182
+ "time",
3183
+ "electricCurrent",
3184
+ "thermodynamicTemperature",
3185
+ "amountOfSubstance",
3186
+ "luminousIntensity"
3187
+ ]
3188
+ },
3189
+ "additionalProperties": {
3190
+ "type": "integer",
3191
+ "minimum": -9007199254740991,
3192
+ "maximum": 9007199254740991
3193
+ }
3194
+ },
3195
+ "MathPresentation": {
3196
+ "type": "object",
3197
+ "properties": {
3198
+ "latex": {
3199
+ "type": "string"
3200
+ }
3201
+ },
3202
+ "required": [
3203
+ "latex"
3204
+ ],
3205
+ "additionalProperties": false
3206
+ },
3207
+ "MathProvenance": {
3208
+ "type": "object",
3209
+ "properties": {
3210
+ "source": {
3211
+ "type": "string"
3212
+ },
3213
+ "pageRef": {
3214
+ "type": "string"
3215
+ },
3216
+ "editTrail": {
3217
+ "type": "array",
3218
+ "items": {
3219
+ "type": "string"
3220
+ }
3221
+ }
3222
+ },
3223
+ "required": [
3224
+ "source",
3225
+ "editTrail"
3226
+ ],
3227
+ "additionalProperties": false
3228
+ },
3229
+ "MathUncertainty": {
3230
+ "type": "object",
3231
+ "properties": {
3232
+ "magnitude": {
3233
+ "$ref": "#/$defs/ExactRational"
3234
+ },
3235
+ "unit": {
3236
+ "type": "string"
3237
+ },
3238
+ "coverageFactor": {
3239
+ "type": "number",
3240
+ "exclusiveMinimum": 0
3241
+ }
3242
+ },
3243
+ "required": [
3244
+ "magnitude"
3245
+ ],
3246
+ "additionalProperties": false
3247
+ },
3248
+ "MathSymbolEntry": {
3249
+ "type": "object",
3250
+ "properties": {
3251
+ "glyph": {
3252
+ "type": "string"
3253
+ },
3254
+ "scope": {
3255
+ "type": "string"
3256
+ },
3257
+ "id": {
3258
+ "type": "string"
3259
+ },
3260
+ "quantityKind": {
3261
+ "type": "string"
3262
+ },
3263
+ "preferredUnit": {
3264
+ "type": "string"
3265
+ },
3266
+ "definitionSource": {
3267
+ "type": "string"
3268
+ }
3269
+ },
3270
+ "required": [
3271
+ "glyph",
3272
+ "scope",
3273
+ "id"
3274
+ ],
3275
+ "additionalProperties": false
3276
+ },
3277
+ "MathUnit": {
3278
+ "type": "object",
3279
+ "properties": {
3280
+ "id": {
3281
+ "type": "string"
3282
+ },
3283
+ "symbol": {
3284
+ "type": "string"
3285
+ },
3286
+ "name": {
3287
+ "type": "string"
3288
+ },
3289
+ "dimension": {
3290
+ "$ref": "#/$defs/DimensionVector"
3291
+ },
3292
+ "factorToSi": {
3293
+ "$ref": "#/$defs/ExactRational"
3294
+ },
3295
+ "offsetToSi": {
3296
+ "$ref": "#/$defs/ExactRational"
3297
+ },
3298
+ "context": {
3299
+ "type": "string"
3300
+ }
3301
+ },
3302
+ "required": [
3303
+ "id",
3304
+ "symbol",
3305
+ "dimension",
3306
+ "factorToSi"
3307
+ ],
3308
+ "additionalProperties": false
3309
+ },
3310
+ "MathNormalisationContext": {
3311
+ "type": "object",
3312
+ "properties": {
3313
+ "id": {
3314
+ "type": "string"
3315
+ },
3316
+ "bases": {
3317
+ "type": "array",
3318
+ "items": {
3319
+ "type": "object",
3320
+ "properties": {
3321
+ "unit": {
3322
+ "type": "string"
3323
+ },
3324
+ "value": {
3325
+ "$ref": "#/$defs/ExactRational"
3326
+ }
3327
+ },
3328
+ "required": [
3329
+ "unit",
3330
+ "value"
3331
+ ],
3332
+ "additionalProperties": false
3333
+ }
3334
+ }
3335
+ },
3336
+ "required": [
3337
+ "id",
3338
+ "bases"
3339
+ ],
3340
+ "additionalProperties": false
3341
+ },
3342
+ "SymbolTable": {
3343
+ "type": "object",
3344
+ "properties": {
3345
+ "symbols": {
3346
+ "type": "array",
3347
+ "items": {
3348
+ "$ref": "#/$defs/MathSymbolEntry"
3349
+ }
3350
+ },
3351
+ "units": {
3352
+ "type": "array",
3353
+ "items": {
3354
+ "$ref": "#/$defs/MathUnit"
3355
+ }
3356
+ },
3357
+ "contexts": {
3358
+ "type": "array",
3359
+ "items": {
3360
+ "$ref": "#/$defs/MathNormalisationContext"
3361
+ }
3362
+ }
3363
+ },
3364
+ "required": [
3365
+ "symbols",
3366
+ "units"
3367
+ ],
3368
+ "additionalProperties": false
3369
+ },
3370
+ "MathNum": {
3371
+ "type": "object",
3372
+ "properties": {
3373
+ "kind": {
3374
+ "type": "string",
3375
+ "const": "num"
3376
+ },
3377
+ "numerator": {
3378
+ "type": "string",
3379
+ "pattern": "^(0|-?[1-9]\\d*)$"
3380
+ },
3381
+ "denominator": {
3382
+ "type": "string",
3383
+ "pattern": "^[1-9]\\d*$"
3384
+ }
3385
+ },
3386
+ "required": [
3387
+ "kind",
3388
+ "numerator",
3389
+ "denominator"
3390
+ ],
3391
+ "additionalProperties": false
3392
+ },
3393
+ "MathQty": {
3394
+ "type": "object",
3395
+ "properties": {
3396
+ "kind": {
3397
+ "type": "string",
3398
+ "const": "qty"
3399
+ },
3400
+ "value": {
3401
+ "$ref": "#/$defs/ExactRational"
3402
+ },
3403
+ "unit": {
3404
+ "type": "string"
3405
+ },
3406
+ "uncertainty": {
3407
+ "$ref": "#/$defs/MathUncertainty"
3408
+ }
3409
+ },
3410
+ "required": [
3411
+ "kind",
3412
+ "value",
3413
+ "unit"
3414
+ ],
3415
+ "additionalProperties": false
3416
+ },
3417
+ "MathSym": {
3418
+ "type": "object",
3419
+ "properties": {
3420
+ "kind": {
3421
+ "type": "string",
3422
+ "const": "sym"
3423
+ },
3424
+ "id": {
3425
+ "type": "string"
3426
+ }
3427
+ },
3428
+ "required": [
3429
+ "kind",
3430
+ "id"
3431
+ ],
3432
+ "additionalProperties": false
3433
+ },
3434
+ "MathApp": {
3435
+ "type": "object",
3436
+ "properties": {
3437
+ "kind": {
3438
+ "type": "string",
3439
+ "const": "app"
3440
+ },
3441
+ "operator": {
3442
+ "type": "string"
3443
+ },
3444
+ "args": {
3445
+ "type": "array",
3446
+ "items": {
3447
+ "$ref": "#/$defs/MathExpression"
3448
+ }
3449
+ }
3450
+ },
3451
+ "required": [
3452
+ "kind",
3453
+ "operator",
3454
+ "args"
3455
+ ],
3456
+ "additionalProperties": false
3457
+ },
3458
+ "MathSum": {
3459
+ "type": "object",
3460
+ "properties": {
3461
+ "kind": {
3462
+ "type": "string",
3463
+ "const": "sum"
3464
+ },
3465
+ "binder": {
3466
+ "type": "string"
3467
+ },
3468
+ "lower": {
3469
+ "$ref": "#/$defs/MathExpression"
3470
+ },
3471
+ "upper": {
3472
+ "$ref": "#/$defs/MathExpression"
3473
+ },
3474
+ "body": {
3475
+ "$ref": "#/$defs/MathExpression"
3476
+ }
3477
+ },
3478
+ "required": [
3479
+ "kind",
3480
+ "binder",
3481
+ "lower",
3482
+ "upper",
3483
+ "body"
3484
+ ],
3485
+ "additionalProperties": false
3486
+ },
3487
+ "MathProd": {
3488
+ "type": "object",
3489
+ "properties": {
3490
+ "kind": {
3491
+ "type": "string",
3492
+ "const": "prod"
3493
+ },
3494
+ "binder": {
3495
+ "type": "string"
3496
+ },
3497
+ "lower": {
3498
+ "$ref": "#/$defs/MathExpression"
3499
+ },
3500
+ "upper": {
3501
+ "$ref": "#/$defs/MathExpression"
3502
+ },
3503
+ "body": {
3504
+ "$ref": "#/$defs/MathExpression"
3505
+ }
3506
+ },
3507
+ "required": [
3508
+ "kind",
3509
+ "binder",
3510
+ "lower",
3511
+ "upper",
3512
+ "body"
3513
+ ],
3514
+ "additionalProperties": false
3515
+ },
3516
+ "MathMatrix": {
3517
+ "type": "object",
3518
+ "properties": {
3519
+ "kind": {
3520
+ "type": "string",
3521
+ "const": "matrix"
3522
+ },
3523
+ "rows": {
3524
+ "type": "array",
3525
+ "items": {
3526
+ "type": "array",
3527
+ "items": {
3528
+ "$ref": "#/$defs/MathExpression"
3529
+ }
3530
+ }
3531
+ }
3532
+ },
3533
+ "required": [
3534
+ "kind",
3535
+ "rows"
3536
+ ],
3537
+ "additionalProperties": false
3538
+ },
3539
+ "MathUnparsed": {
3540
+ "type": "object",
3541
+ "properties": {
3542
+ "kind": {
3543
+ "type": "string",
3544
+ "const": "unparsed"
3545
+ },
3546
+ "latex": {
3547
+ "type": "string"
3548
+ }
3549
+ },
3550
+ "required": [
3551
+ "kind",
3552
+ "latex"
3553
+ ],
3554
+ "additionalProperties": false
3555
+ },
3556
+ "MathExpression": {
3557
+ "oneOf": [
3558
+ {
3559
+ "$ref": "#/$defs/MathNum"
3560
+ },
3561
+ {
3562
+ "$ref": "#/$defs/MathQty"
3563
+ },
3564
+ {
3565
+ "$ref": "#/$defs/MathSym"
3566
+ },
3567
+ {
3568
+ "$ref": "#/$defs/MathApp"
3569
+ },
3570
+ {
3571
+ "$ref": "#/$defs/MathSum"
3572
+ },
3573
+ {
3574
+ "$ref": "#/$defs/MathProd"
3575
+ },
3576
+ {
3577
+ "$ref": "#/$defs/MathMatrix"
3578
+ },
3579
+ {
3580
+ "$ref": "#/$defs/MathUnparsed"
3581
+ }
3582
+ ]
3129
3583
  }
3130
3584
  }
3131
3585
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@3.1.0/schemas/document-package.schema.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@3.2.0/schemas/document-package.schema.json",
4
4
  "type": "object",
5
5
  "properties": {
6
6
  "formatVersion": {
@@ -8,7 +8,7 @@
8
8
  "const": 2
9
9
  },
10
10
  "content": {
11
- "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@3.1.0/schemas/content-document.schema.json"
11
+ "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@3.2.0/schemas/content-document.schema.json"
12
12
  },
13
13
  "pages": {
14
14
  "type": "array",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@3.1.0/schemas/layout-document.schema.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@3.2.0/schemas/layout-document.schema.json",
4
4
  "type": "object",
5
5
  "properties": {
6
6
  "formatVersion": {