markdown-codec 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/codec.d.cts CHANGED
@@ -3,7 +3,7 @@ import { z } from "zod";
3
3
  declare const MarkdownBytesSchema: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
4
4
  declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodDiscriminatedUnion<[z.ZodObject<{
5
5
  kind: z.ZodLiteral<"wordprocessing">;
6
- formatVersion: z.ZodLiteral<2>;
6
+ formatVersion: z.ZodLiteral<3>;
7
7
  metadata: z.ZodObject<{
8
8
  title: z.ZodOptional<z.ZodString>;
9
9
  author: z.ZodOptional<z.ZodString>;
@@ -29,7 +29,7 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
29
29
  }, z.core.$strip>>;
30
30
  }, z.core.$strip>, z.ZodObject<{
31
31
  kind: z.ZodLiteral<"presentation">;
32
- formatVersion: z.ZodLiteral<2>;
32
+ formatVersion: z.ZodLiteral<3>;
33
33
  metadata: z.ZodObject<{
34
34
  title: z.ZodOptional<z.ZodString>;
35
35
  author: z.ZodOptional<z.ZodString>;
@@ -62,13 +62,20 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
62
62
  lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
63
63
  paintOrder: z.ZodOptional<z.ZodNumber>;
64
64
  sourcePath: z.ZodOptional<z.ZodString>;
65
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
66
+ pageIndex: z.ZodNumber;
67
+ xPt: z.ZodNumber;
68
+ yPt: z.ZodNumber;
69
+ widthPt: z.ZodNumber;
70
+ heightPt: z.ZodNumber;
71
+ }, z.core.$strip>>>;
65
72
  blocks: z.ZodArray<z.ZodCustom<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>;
66
73
  }, z.core.$strip>>;
67
74
  notes: z.ZodString;
68
75
  }, z.core.$strip>>;
69
76
  }, z.core.$strip>, z.ZodObject<{
70
77
  kind: z.ZodLiteral<"spreadsheet">;
71
- formatVersion: z.ZodLiteral<2>;
78
+ formatVersion: z.ZodLiteral<3>;
72
79
  metadata: z.ZodObject<{
73
80
  title: z.ZodOptional<z.ZodString>;
74
81
  author: z.ZodOptional<z.ZodString>;
@@ -135,6 +142,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
135
142
  }, z.core.$strip>>;
136
143
  hyperlink: z.ZodOptional<z.ZodString>;
137
144
  sourcePath: z.ZodOptional<z.ZodString>;
145
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
146
+ pageIndex: z.ZodNumber;
147
+ xPt: z.ZodNumber;
148
+ yPt: z.ZodNumber;
149
+ widthPt: z.ZodNumber;
150
+ heightPt: z.ZodNumber;
151
+ }, z.core.$strip>>>;
138
152
  }, z.core.$strip>>>;
139
153
  colSpan: z.ZodOptional<z.ZodNumber>;
140
154
  rowSpan: z.ZodOptional<z.ZodNumber>;
@@ -213,6 +227,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
213
227
  middle: "middle";
214
228
  }>>;
215
229
  sourcePath: z.ZodOptional<z.ZodString>;
230
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
231
+ pageIndex: z.ZodNumber;
232
+ xPt: z.ZodNumber;
233
+ yPt: z.ZodNumber;
234
+ widthPt: z.ZodNumber;
235
+ heightPt: z.ZodNumber;
236
+ }, z.core.$strip>>>;
216
237
  }, z.core.$strip>>;
217
238
  columns: z.ZodArray<z.ZodObject<{
218
239
  index: z.ZodNumber;
@@ -235,6 +256,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
235
256
  heightPt: z.ZodNumber;
236
257
  altText: z.ZodOptional<z.ZodString>;
237
258
  sourcePath: z.ZodOptional<z.ZodString>;
259
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
260
+ pageIndex: z.ZodNumber;
261
+ xPt: z.ZodNumber;
262
+ yPt: z.ZodNumber;
263
+ widthPt: z.ZodNumber;
264
+ heightPt: z.ZodNumber;
265
+ }, z.core.$strip>>>;
238
266
  anchorRow: z.ZodNumber;
239
267
  anchorColumn: z.ZodNumber;
240
268
  offsetXPt: z.ZodNumber;
@@ -285,7 +313,7 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
285
313
  }, z.core.$strip>>;
286
314
  }, z.core.$strip>, z.ZodObject<{
287
315
  kind: z.ZodLiteral<"drawing">;
288
- formatVersion: z.ZodLiteral<2>;
316
+ formatVersion: z.ZodLiteral<3>;
289
317
  metadata: z.ZodObject<{
290
318
  title: z.ZodOptional<z.ZodString>;
291
319
  author: z.ZodOptional<z.ZodString>;
@@ -318,6 +346,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
318
346
  lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
319
347
  paintOrder: z.ZodOptional<z.ZodNumber>;
320
348
  sourcePath: z.ZodOptional<z.ZodString>;
349
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
350
+ pageIndex: z.ZodNumber;
351
+ xPt: z.ZodNumber;
352
+ yPt: z.ZodNumber;
353
+ widthPt: z.ZodNumber;
354
+ heightPt: z.ZodNumber;
355
+ }, z.core.$strip>>>;
321
356
  blocks: z.ZodArray<z.ZodCustom<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>;
322
357
  }, z.core.$strip>>;
323
358
  vectors: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -350,6 +385,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
350
385
  }, z.core.$strip>>;
351
386
  paintOrder: z.ZodOptional<z.ZodNumber>;
352
387
  sourcePath: z.ZodOptional<z.ZodString>;
388
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
389
+ pageIndex: z.ZodNumber;
390
+ xPt: z.ZodNumber;
391
+ yPt: z.ZodNumber;
392
+ widthPt: z.ZodNumber;
393
+ heightPt: z.ZodNumber;
394
+ }, z.core.$strip>>>;
353
395
  }, z.core.$strip>, z.ZodObject<{
354
396
  kind: z.ZodLiteral<"ellipse">;
355
397
  frame: z.ZodObject<{
@@ -380,6 +422,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
380
422
  }, z.core.$strip>>;
381
423
  paintOrder: z.ZodOptional<z.ZodNumber>;
382
424
  sourcePath: z.ZodOptional<z.ZodString>;
425
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
426
+ pageIndex: z.ZodNumber;
427
+ xPt: z.ZodNumber;
428
+ yPt: z.ZodNumber;
429
+ widthPt: z.ZodNumber;
430
+ heightPt: z.ZodNumber;
431
+ }, z.core.$strip>>>;
383
432
  }, z.core.$strip>, z.ZodObject<{
384
433
  kind: z.ZodLiteral<"line">;
385
434
  from: z.ZodObject<{
@@ -406,6 +455,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
406
455
  }, z.core.$strip>;
407
456
  paintOrder: z.ZodOptional<z.ZodNumber>;
408
457
  sourcePath: z.ZodOptional<z.ZodString>;
458
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
459
+ pageIndex: z.ZodNumber;
460
+ xPt: z.ZodNumber;
461
+ yPt: z.ZodNumber;
462
+ widthPt: z.ZodNumber;
463
+ heightPt: z.ZodNumber;
464
+ }, z.core.$strip>>>;
409
465
  }, z.core.$strip>, z.ZodObject<{
410
466
  kind: z.ZodLiteral<"path">;
411
467
  frame: z.ZodObject<{
@@ -468,11 +524,18 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
468
524
  }, z.core.$strip>>;
469
525
  paintOrder: z.ZodOptional<z.ZodNumber>;
470
526
  sourcePath: z.ZodOptional<z.ZodString>;
527
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
528
+ pageIndex: z.ZodNumber;
529
+ xPt: z.ZodNumber;
530
+ yPt: z.ZodNumber;
531
+ widthPt: z.ZodNumber;
532
+ heightPt: z.ZodNumber;
533
+ }, z.core.$strip>>>;
471
534
  }, z.core.$strip>], "kind">>;
472
535
  }, z.core.$strip>>;
473
536
  }, z.core.$strip>, z.ZodObject<{
474
537
  kind: z.ZodLiteral<"formula">;
475
- formatVersion: z.ZodLiteral<2>;
538
+ formatVersion: z.ZodLiteral<3>;
476
539
  metadata: z.ZodObject<{
477
540
  title: z.ZodOptional<z.ZodString>;
478
541
  author: z.ZodOptional<z.ZodString>;
package/dist/codec.d.ts CHANGED
@@ -3,7 +3,7 @@ import { z } from "zod";
3
3
  declare const MarkdownBytesSchema: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
4
4
  declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodDiscriminatedUnion<[z.ZodObject<{
5
5
  kind: z.ZodLiteral<"wordprocessing">;
6
- formatVersion: z.ZodLiteral<2>;
6
+ formatVersion: z.ZodLiteral<3>;
7
7
  metadata: z.ZodObject<{
8
8
  title: z.ZodOptional<z.ZodString>;
9
9
  author: z.ZodOptional<z.ZodString>;
@@ -29,7 +29,7 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
29
29
  }, z.core.$strip>>;
30
30
  }, z.core.$strip>, z.ZodObject<{
31
31
  kind: z.ZodLiteral<"presentation">;
32
- formatVersion: z.ZodLiteral<2>;
32
+ formatVersion: z.ZodLiteral<3>;
33
33
  metadata: z.ZodObject<{
34
34
  title: z.ZodOptional<z.ZodString>;
35
35
  author: z.ZodOptional<z.ZodString>;
@@ -62,13 +62,20 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
62
62
  lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
63
63
  paintOrder: z.ZodOptional<z.ZodNumber>;
64
64
  sourcePath: z.ZodOptional<z.ZodString>;
65
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
66
+ pageIndex: z.ZodNumber;
67
+ xPt: z.ZodNumber;
68
+ yPt: z.ZodNumber;
69
+ widthPt: z.ZodNumber;
70
+ heightPt: z.ZodNumber;
71
+ }, z.core.$strip>>>;
65
72
  blocks: z.ZodArray<z.ZodCustom<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>;
66
73
  }, z.core.$strip>>;
67
74
  notes: z.ZodString;
68
75
  }, z.core.$strip>>;
69
76
  }, z.core.$strip>, z.ZodObject<{
70
77
  kind: z.ZodLiteral<"spreadsheet">;
71
- formatVersion: z.ZodLiteral<2>;
78
+ formatVersion: z.ZodLiteral<3>;
72
79
  metadata: z.ZodObject<{
73
80
  title: z.ZodOptional<z.ZodString>;
74
81
  author: z.ZodOptional<z.ZodString>;
@@ -135,6 +142,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
135
142
  }, z.core.$strip>>;
136
143
  hyperlink: z.ZodOptional<z.ZodString>;
137
144
  sourcePath: z.ZodOptional<z.ZodString>;
145
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
146
+ pageIndex: z.ZodNumber;
147
+ xPt: z.ZodNumber;
148
+ yPt: z.ZodNumber;
149
+ widthPt: z.ZodNumber;
150
+ heightPt: z.ZodNumber;
151
+ }, z.core.$strip>>>;
138
152
  }, z.core.$strip>>>;
139
153
  colSpan: z.ZodOptional<z.ZodNumber>;
140
154
  rowSpan: z.ZodOptional<z.ZodNumber>;
@@ -213,6 +227,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
213
227
  middle: "middle";
214
228
  }>>;
215
229
  sourcePath: z.ZodOptional<z.ZodString>;
230
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
231
+ pageIndex: z.ZodNumber;
232
+ xPt: z.ZodNumber;
233
+ yPt: z.ZodNumber;
234
+ widthPt: z.ZodNumber;
235
+ heightPt: z.ZodNumber;
236
+ }, z.core.$strip>>>;
216
237
  }, z.core.$strip>>;
217
238
  columns: z.ZodArray<z.ZodObject<{
218
239
  index: z.ZodNumber;
@@ -235,6 +256,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
235
256
  heightPt: z.ZodNumber;
236
257
  altText: z.ZodOptional<z.ZodString>;
237
258
  sourcePath: z.ZodOptional<z.ZodString>;
259
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
260
+ pageIndex: z.ZodNumber;
261
+ xPt: z.ZodNumber;
262
+ yPt: z.ZodNumber;
263
+ widthPt: z.ZodNumber;
264
+ heightPt: z.ZodNumber;
265
+ }, z.core.$strip>>>;
238
266
  anchorRow: z.ZodNumber;
239
267
  anchorColumn: z.ZodNumber;
240
268
  offsetXPt: z.ZodNumber;
@@ -285,7 +313,7 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
285
313
  }, z.core.$strip>>;
286
314
  }, z.core.$strip>, z.ZodObject<{
287
315
  kind: z.ZodLiteral<"drawing">;
288
- formatVersion: z.ZodLiteral<2>;
316
+ formatVersion: z.ZodLiteral<3>;
289
317
  metadata: z.ZodObject<{
290
318
  title: z.ZodOptional<z.ZodString>;
291
319
  author: z.ZodOptional<z.ZodString>;
@@ -318,6 +346,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
318
346
  lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
319
347
  paintOrder: z.ZodOptional<z.ZodNumber>;
320
348
  sourcePath: z.ZodOptional<z.ZodString>;
349
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
350
+ pageIndex: z.ZodNumber;
351
+ xPt: z.ZodNumber;
352
+ yPt: z.ZodNumber;
353
+ widthPt: z.ZodNumber;
354
+ heightPt: z.ZodNumber;
355
+ }, z.core.$strip>>>;
321
356
  blocks: z.ZodArray<z.ZodCustom<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>;
322
357
  }, z.core.$strip>>;
323
358
  vectors: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -350,6 +385,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
350
385
  }, z.core.$strip>>;
351
386
  paintOrder: z.ZodOptional<z.ZodNumber>;
352
387
  sourcePath: z.ZodOptional<z.ZodString>;
388
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
389
+ pageIndex: z.ZodNumber;
390
+ xPt: z.ZodNumber;
391
+ yPt: z.ZodNumber;
392
+ widthPt: z.ZodNumber;
393
+ heightPt: z.ZodNumber;
394
+ }, z.core.$strip>>>;
353
395
  }, z.core.$strip>, z.ZodObject<{
354
396
  kind: z.ZodLiteral<"ellipse">;
355
397
  frame: z.ZodObject<{
@@ -380,6 +422,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
380
422
  }, z.core.$strip>>;
381
423
  paintOrder: z.ZodOptional<z.ZodNumber>;
382
424
  sourcePath: z.ZodOptional<z.ZodString>;
425
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
426
+ pageIndex: z.ZodNumber;
427
+ xPt: z.ZodNumber;
428
+ yPt: z.ZodNumber;
429
+ widthPt: z.ZodNumber;
430
+ heightPt: z.ZodNumber;
431
+ }, z.core.$strip>>>;
383
432
  }, z.core.$strip>, z.ZodObject<{
384
433
  kind: z.ZodLiteral<"line">;
385
434
  from: z.ZodObject<{
@@ -406,6 +455,13 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
406
455
  }, z.core.$strip>;
407
456
  paintOrder: z.ZodOptional<z.ZodNumber>;
408
457
  sourcePath: z.ZodOptional<z.ZodString>;
458
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
459
+ pageIndex: z.ZodNumber;
460
+ xPt: z.ZodNumber;
461
+ yPt: z.ZodNumber;
462
+ widthPt: z.ZodNumber;
463
+ heightPt: z.ZodNumber;
464
+ }, z.core.$strip>>>;
409
465
  }, z.core.$strip>, z.ZodObject<{
410
466
  kind: z.ZodLiteral<"path">;
411
467
  frame: z.ZodObject<{
@@ -468,11 +524,18 @@ declare const markdownCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uin
468
524
  }, z.core.$strip>>;
469
525
  paintOrder: z.ZodOptional<z.ZodNumber>;
470
526
  sourcePath: z.ZodOptional<z.ZodString>;
527
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
528
+ pageIndex: z.ZodNumber;
529
+ xPt: z.ZodNumber;
530
+ yPt: z.ZodNumber;
531
+ widthPt: z.ZodNumber;
532
+ heightPt: z.ZodNumber;
533
+ }, z.core.$strip>>>;
471
534
  }, z.core.$strip>], "kind">>;
472
535
  }, z.core.$strip>>;
473
536
  }, z.core.$strip>, z.ZodObject<{
474
537
  kind: z.ZodLiteral<"formula">;
475
- formatVersion: z.ZodLiteral<2>;
538
+ formatVersion: z.ZodLiteral<3>;
476
539
  metadata: z.ZodObject<{
477
540
  title: z.ZodOptional<z.ZodString>;
478
541
  author: z.ZodOptional<z.ZodString>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdown-codec",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Hand-written CommonMark+GFM <-> ContentDocument codec, built on document-schema.js",
5
5
  "type": "module",
6
6
  "repository": {
@@ -79,7 +79,7 @@
79
79
  "license": "MIT",
80
80
  "packageManager": "pnpm@11.6.0",
81
81
  "dependencies": {
82
- "document-schema.js": "^2.7.16",
82
+ "document-schema.js": "^3.0.0",
83
83
  "zod": "^4.4.3"
84
84
  },
85
85
  "devDependencies": {