doc-model.js 2.7.4 → 2.7.6
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/README.md +24 -28
- package/dist/layout.d.cts +8 -8
- package/dist/layout.d.ts +8 -8
- package/dist/package.d.cts +2 -2
- package/dist/package.d.ts +2 -2
- package/dist/schema-io.cjs +1 -1
- package/dist/schema-io.js +1 -1
- package/dist/style.d.cts +2 -2
- package/dist/style.d.ts +2 -2
- package/package.json +1 -1
- package/schemas/content-document.schema.json +3 -3
- package/schemas/document-package.schema.json +3 -3
- package/schemas/layout-document.schema.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> The canonical, format-agnostic content and layout schema pivot shared by [ooxml.js](https://github.com/ExaDev/ooxml.js), [odf.js](https://github.com/ExaDev/odf.js), [documents.js](https://github.com/ExaDev/documents.js), [pdf-codec](https://github.com/ExaDev/pdf-codec), and [markdown-codec](https://github.com/ExaDev/markdown-codec).
|
|
6
6
|
|
|
7
|
-
Both `ooxml.js` and `documents.js` independently arrived at the same content vocabulary
|
|
7
|
+
Both `ooxml.js` and `documents.js` independently arrived at the same content vocabulary, producing two field-identical copies in two places. This package is the fix: one schema, imported by every format package instead of redefined by each. It also sidesteps a circular dependency (`documents.js` depends on both `ooxml.js` and `odf.js`).
|
|
8
8
|
|
|
9
9
|
```mermaid
|
|
10
10
|
graph TD
|
|
@@ -48,13 +48,11 @@ graph TD
|
|
|
48
48
|
style schema fill:#f9a825,stroke:#333,stroke-width:3px
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
`ContentDocument` (the semantic pivot) is a discriminated union of five kinds: `wordprocessing` (docx/odt
|
|
51
|
+
`ContentDocument` (the semantic pivot) is a discriminated union of five kinds: `wordprocessing` (docx/odt sections of paragraphs/runs/tables/images), `presentation` (pptx/odp slides of shapes), `spreadsheet` (xlsx/ods sheets of cells, columns, rows, print settings), `drawing` (odg pages of shapes plus vector primitives — rect/ellipse/line/path), and `formula` (an equation carrying its own MathML node tree plus StarMath source when the producing format had one). `ContentEmbeddedObjectSchema` lets any of the five embed another whole `ContentDocument`. `LayoutDocument` (the PDF-rendering pivot) is pages of positioned `LayoutItem`s (`text`/`image`/`rect`/`line`/`ellipse`/`path`/`link`) in PDF user-space coordinates. `DocumentPackageSchema` pairs the two: `content` required, `layout` optional (derived, absent until something lays content out); the schema does not keep them in sync or detect staleness.
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
The package contains only [Zod](https://zod.dev) schemas, their inferred types, trivial schema-attached helpers (hex-colour conversion, recursive structural type guards), and two small structural interfaces (`ContentCodec`/`LayoutCodec`, see [Codecs](#codecs)). No XML, ZIP, PDF, or binary handling; the sole dependency is `zod`.
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
The GitHub repository is [`ExaDev/document-schema.js`](https://github.com/ExaDev/document-schema.js), matching the published npm package name.
|
|
55
|
+
Two format-agnostic helpers live here because they operate on the content model itself: cell-addressing utilities in `src/a1.ts` (0-based row/column indices, row-first order matching `ContentSheetCell`'s `{row, column}`) and the `FontFace` interface in `src/font-port.ts` (`{family, bold, italic}`).
|
|
58
56
|
|
|
59
57
|
## Usage
|
|
60
58
|
|
|
@@ -66,7 +64,7 @@ const layout = LayoutDocumentSchema.parse(somePageLayoutValue);
|
|
|
66
64
|
const pkg = DocumentPackageSchema.parse({ formatVersion: 1, content, layout });
|
|
67
65
|
```
|
|
68
66
|
|
|
69
|
-
Every module is also importable directly
|
|
67
|
+
Every module is also importable directly — `tsdown` builds one file per source module, and `package.json`'s `"./*"` export makes each individually resolvable:
|
|
70
68
|
|
|
71
69
|
```ts
|
|
72
70
|
import { schemaUriFor } from 'document-schema.js/schema-io';
|
|
@@ -75,7 +73,7 @@ import { ColorSchema } from 'document-schema.js/color';
|
|
|
75
73
|
|
|
76
74
|
## Codecs
|
|
77
75
|
|
|
78
|
-
|
|
76
|
+
`ContentCodec`/`LayoutCodec` (`src/codec.ts`) are the format-agnostic *interfaces* a sibling package's docx/pptx/odt/odp/ods/odg/xlsx/markdown/PDF codec can implement, so a caller working across formats holds one of these instead of a format-specific function pair:
|
|
79
77
|
|
|
80
78
|
```ts
|
|
81
79
|
import type { ContentCodec, LayoutCodec } from 'document-schema.js';
|
|
@@ -84,15 +82,15 @@ declare const docxCodec: ContentCodec; // read(bytes) -> ContentDocument; write(
|
|
|
84
82
|
declare const pdfCodec: LayoutCodec; // read(bytes) -> LayoutDocument; write(layout) -> bytes -- write is required
|
|
85
83
|
```
|
|
86
84
|
|
|
87
|
-
The two are
|
|
85
|
+
The two are separate interfaces (not one `DocumentCodec`) because the formats are asymmetric: most produce only *content* on read (layout is a later engine-driven step); PDF produces *layout* cheaply and content only via a separate, lossy reconstruction pass. `ContentCodec.write` is optional (`odf` has a reader but no builder — recovering MathML from glyphs is OCR-adjacent); `LayoutCodec.write` is required. Both are generic over their own `TOptions`.
|
|
88
86
|
|
|
89
|
-
Neither interface constructs a `DocumentPackage
|
|
87
|
+
Neither interface constructs a `DocumentPackage`; composing one is the caller's job (`documents.js`'s `DOCUMENT_FORMAT_CODECS` registry is the concrete example).
|
|
90
88
|
|
|
91
|
-
|
|
89
|
+
This package also hosts the **port contracts** a layout engine consumes: `TextMeasurer`/`StyledRun`/`WrappedLine` (`src/text-layout.ts`), `ProvidedFont`/`FontSubstitution` (`src/font-port.ts`), `MathBox`/`MathFontMetrics`/`PositionedFormula` (`src/math-layout.ts`), and `Point` (`src/geometry.ts`).
|
|
92
90
|
|
|
93
91
|
## JSON Schema
|
|
94
92
|
|
|
95
|
-
|
|
93
|
+
Three plain [JSON Schema](https://json-schema.org) files are published — generated from the Zod definitions via [`z.toJSONSchema()`](https://zod.dev/json-schema) at build time (`scripts/generate-json-schemas.mjs`) — for non-TypeScript consumers:
|
|
96
94
|
|
|
97
95
|
```ts
|
|
98
96
|
const documentPackageSchema = require('document-schema.js/schemas/document-package.schema.json');
|
|
@@ -108,13 +106,13 @@ node_modules/document-schema.js/schemas/content-document.schema.json
|
|
|
108
106
|
node_modules/document-schema.js/schemas/layout-document.schema.json
|
|
109
107
|
```
|
|
110
108
|
|
|
111
|
-
Each file's `$id` is a
|
|
109
|
+
Each file's `$id` is a jsdelivr URL pinned to the exact npm version — immutable and live on publish. The three files cross-reference via `$ref`s, so a validator resolving refs over HTTP can validate a whole `DocumentPackage`. `content-document.schema.json` carries a hand-authored `$defs` block for the recursive paragraph/table/embedded-object and MathML node models (Zod's converter cannot express these directly); `content-json-schema-defs.ts` holds those fragments, and a regression test compares each against a live `z.toJSONSchema()` of its real Zod counterpart so a field changed without updating its fragment fails a test. Fragments downstream of a `z.custom()` node (`ContentBlock`, `ContentTable`/`Cell`/`Row`, `ContentEmbeddedObjectBlock`, `MathMlNode`/`Element`/`Attribute`) still need hand re-verification against `src/content.ts`/`src/mathml.ts` — see below.
|
|
112
110
|
|
|
113
111
|
### `z.custom()` vs `z.lazy()` for recursive schemas
|
|
114
112
|
|
|
115
|
-
`ContentBlockSchema`, `ContentEmbeddedObjectSchema
|
|
113
|
+
`ContentBlockSchema`, `ContentEmbeddedObjectSchema`, and `MathMlNodeSchema` are `z.custom()` type-guard predicates rather than real Zod schemas, because `z.lazy()` was believed to collapse to `unknown` for recursive children. A throwaway spike (reverted) re-tested `MathMlNodeSchema` (the simplest case) against `zod@4.4.3`.
|
|
116
114
|
|
|
117
|
-
**Finding: `
|
|
115
|
+
**Finding: `z.lazy()` works now, with one constructional gotcha.** The naive rewrite —
|
|
118
116
|
|
|
119
117
|
```ts
|
|
120
118
|
export const MathMlElementSchema: z.ZodType<MathMlElement> = z.object({
|
|
@@ -128,15 +126,13 @@ export const MathMlNodeSchema: z.ZodType<MathMlNode> = z.discriminatedUnion('typ
|
|
|
128
126
|
]);
|
|
129
127
|
```
|
|
130
128
|
|
|
131
|
-
fails to typecheck: annotating `MathMlElementSchema`
|
|
132
|
-
|
|
133
|
-
With that one change, every existing test in `mathml.test.ts` passed unmodified -- including the four-level-deep nested-element test and the exact-failure-at-the-deepest-level negative test -- proving recursion genuinely terminates and validates correctly at runtime, not just at the type level. `z.toJSONSchema(MathMlNodeSchema, { unrepresentable: 'any' })`, called on its own (no registry, no `override()`), produced a fully real, standard `oneOf`-based JSON Schema with a genuine `{ "$ref": "#" }` at the exact recursion point (`element.children.items`) -- no empty `{}` degenerate node anywhere, and `unrepresentable: 'any'` never actually had to activate for it.
|
|
129
|
+
— fails to typecheck: annotating `MathMlElementSchema` as `z.ZodType<MathMlElement>` widens it so `z.discriminatedUnion` (which needs each member's internal `propValues`) rejects it, and dropping the annotation hits TypeScript's circular-inference error. The fix: annotate **only the outer union's binding** (`MathMlNodeSchema`), leaving every member schema unannotated and fully inferred — all tests passed, and `z.toJSONSchema()` produced a real `oneOf` with `{ "$ref": "#" }` at the recursion point.
|
|
134
130
|
|
|
135
|
-
**
|
|
131
|
+
**This is a tracked follow-up, not carried out here.** Converting `MathMlNodeSchema` for real would let the JSON-schema generator drop its hand-authored `$defs` entries; `ContentBlockSchema`/`ContentEmbeddedObjectSchema` are harder (mutual recursion across table/cell/row, plus the full `ContentDocument` cycle) and were not spiked.
|
|
136
132
|
|
|
137
133
|
### Self-describing JSON
|
|
138
134
|
|
|
139
|
-
`documentPackageWithSchema`/`contentDocumentWithSchema`/`layoutDocumentWithSchema` each
|
|
135
|
+
`documentPackageWithSchema`/`contentDocumentWithSchema`/`layoutDocumentWithSchema` each stamp a `$schema` property pointing at the `.schema.json` file for the currently installed version:
|
|
140
136
|
|
|
141
137
|
```ts
|
|
142
138
|
import { documentPackageWithSchema } from 'document-schema.js';
|
|
@@ -146,7 +142,7 @@ const tagged = documentPackageWithSchema(pkg);
|
|
|
146
142
|
writeFileSync('package.json.doc', JSON.stringify(tagged, null, 2));
|
|
147
143
|
```
|
|
148
144
|
|
|
149
|
-
A caller who already knows the kind can keep
|
|
145
|
+
A caller who already knows the kind can keep using the schemas directly — `DocumentPackageSchema.parse(value)` tolerates and strips an incoming `$schema` (none are `.strict()`). `documentFromJson` is for the "don't yet know the kind" case, reading `$schema` to decide which schema to run:
|
|
150
146
|
|
|
151
147
|
```ts
|
|
152
148
|
import { documentFromJson, UnrecognizedDocumentSchemaError } from 'document-schema.js';
|
|
@@ -161,17 +157,17 @@ try {
|
|
|
161
157
|
}
|
|
162
158
|
```
|
|
163
159
|
|
|
164
|
-
`documentSchemaKindOf(value)`
|
|
160
|
+
`documentSchemaKindOf(value)` returns the kind version-agnostically without parsing; `schemaUriFor(kind)` is the URL builder. No JSON-Schema-validator dependency (e.g. `ajv`) for ingest — the `.schema.json` files are a weaker approximation of the real Zod schemas, so re-validating against them would be a fidelity regression.
|
|
165
161
|
|
|
166
162
|
## Used by
|
|
167
163
|
|
|
168
|
-
- [ooxml.js](https://github.com/ExaDev/ooxml.js) —
|
|
169
|
-
- [odf.js](https://github.com/ExaDev/odf.js) —
|
|
170
|
-
- [documents.js](https://github.com/ExaDev/documents.js) —
|
|
171
|
-
- [pdf-codec](https://github.com/ExaDev/pdf-codec) —
|
|
172
|
-
- [markdown-codec](https://github.com/ExaDev/markdown-codec) —
|
|
164
|
+
- [ooxml.js](https://github.com/ExaDev/ooxml.js) — `readDocx`/`readPptx`/`readXlsxContent` return types are typed against this package's schemas, not a local lookalike.
|
|
165
|
+
- [odf.js](https://github.com/ExaDev/odf.js) — ODF typed readers return the same shared types, so ODF and OOXML speak the identical pivot.
|
|
166
|
+
- [documents.js](https://github.com/ExaDev/documents.js) — primary consumer of `ContentDocument`, `LayoutDocument`, and `DocumentPackage`; its `DOCUMENT_FORMAT_CODECS` registry implements `ContentCodec`/`LayoutCodec` per format.
|
|
167
|
+
- [pdf-codec](https://github.com/ExaDev/pdf-codec) — `readPdf`/`writePdf` operate on this package's `LayoutDocument` and item kinds, never redeclaring them.
|
|
168
|
+
- [markdown-codec](https://github.com/ExaDev/markdown-codec) — `readMarkdown`/`writeMarkdown` read and write this package's `ContentDocument` directly.
|
|
173
169
|
|
|
174
|
-
None
|
|
170
|
+
None depend on each other for this vocabulary — each depends on `document-schema.js` directly.
|
|
175
171
|
|
|
176
172
|
## Build, test, and lint
|
|
177
173
|
|
package/dist/layout.d.cts
CHANGED
|
@@ -9,12 +9,12 @@ declare const LayoutTextSchema: z.ZodObject<{
|
|
|
9
9
|
font: z.ZodObject<{
|
|
10
10
|
family: z.ZodString;
|
|
11
11
|
weight: z.ZodEnum<{
|
|
12
|
-
bold: "bold";
|
|
13
12
|
normal: "normal";
|
|
13
|
+
bold: "bold";
|
|
14
14
|
}>;
|
|
15
15
|
style: z.ZodEnum<{
|
|
16
|
-
italic: "italic";
|
|
17
16
|
normal: "normal";
|
|
17
|
+
italic: "italic";
|
|
18
18
|
}>;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
20
|
sizePt: z.ZodNumber;
|
|
@@ -202,12 +202,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
202
202
|
font: z.ZodObject<{
|
|
203
203
|
family: z.ZodString;
|
|
204
204
|
weight: z.ZodEnum<{
|
|
205
|
-
bold: "bold";
|
|
206
205
|
normal: "normal";
|
|
206
|
+
bold: "bold";
|
|
207
207
|
}>;
|
|
208
208
|
style: z.ZodEnum<{
|
|
209
|
-
italic: "italic";
|
|
210
209
|
normal: "normal";
|
|
210
|
+
italic: "italic";
|
|
211
211
|
}>;
|
|
212
212
|
}, z.core.$strip>;
|
|
213
213
|
sizePt: z.ZodNumber;
|
|
@@ -353,12 +353,12 @@ declare const LayoutPageSchema: z.ZodObject<{
|
|
|
353
353
|
font: z.ZodObject<{
|
|
354
354
|
family: z.ZodString;
|
|
355
355
|
weight: z.ZodEnum<{
|
|
356
|
-
bold: "bold";
|
|
357
356
|
normal: "normal";
|
|
357
|
+
bold: "bold";
|
|
358
358
|
}>;
|
|
359
359
|
style: z.ZodEnum<{
|
|
360
|
-
italic: "italic";
|
|
361
360
|
normal: "normal";
|
|
361
|
+
italic: "italic";
|
|
362
362
|
}>;
|
|
363
363
|
}, z.core.$strip>;
|
|
364
364
|
sizePt: z.ZodNumber;
|
|
@@ -528,12 +528,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
528
528
|
font: z.ZodObject<{
|
|
529
529
|
family: z.ZodString;
|
|
530
530
|
weight: z.ZodEnum<{
|
|
531
|
-
bold: "bold";
|
|
532
531
|
normal: "normal";
|
|
532
|
+
bold: "bold";
|
|
533
533
|
}>;
|
|
534
534
|
style: z.ZodEnum<{
|
|
535
|
-
italic: "italic";
|
|
536
535
|
normal: "normal";
|
|
536
|
+
italic: "italic";
|
|
537
537
|
}>;
|
|
538
538
|
}, z.core.$strip>;
|
|
539
539
|
sizePt: z.ZodNumber;
|
package/dist/layout.d.ts
CHANGED
|
@@ -9,12 +9,12 @@ declare const LayoutTextSchema: z.ZodObject<{
|
|
|
9
9
|
font: z.ZodObject<{
|
|
10
10
|
family: z.ZodString;
|
|
11
11
|
weight: z.ZodEnum<{
|
|
12
|
-
bold: "bold";
|
|
13
12
|
normal: "normal";
|
|
13
|
+
bold: "bold";
|
|
14
14
|
}>;
|
|
15
15
|
style: z.ZodEnum<{
|
|
16
|
-
italic: "italic";
|
|
17
16
|
normal: "normal";
|
|
17
|
+
italic: "italic";
|
|
18
18
|
}>;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
20
|
sizePt: z.ZodNumber;
|
|
@@ -202,12 +202,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
202
202
|
font: z.ZodObject<{
|
|
203
203
|
family: z.ZodString;
|
|
204
204
|
weight: z.ZodEnum<{
|
|
205
|
-
bold: "bold";
|
|
206
205
|
normal: "normal";
|
|
206
|
+
bold: "bold";
|
|
207
207
|
}>;
|
|
208
208
|
style: z.ZodEnum<{
|
|
209
|
-
italic: "italic";
|
|
210
209
|
normal: "normal";
|
|
210
|
+
italic: "italic";
|
|
211
211
|
}>;
|
|
212
212
|
}, z.core.$strip>;
|
|
213
213
|
sizePt: z.ZodNumber;
|
|
@@ -353,12 +353,12 @@ declare const LayoutPageSchema: z.ZodObject<{
|
|
|
353
353
|
font: z.ZodObject<{
|
|
354
354
|
family: z.ZodString;
|
|
355
355
|
weight: z.ZodEnum<{
|
|
356
|
-
bold: "bold";
|
|
357
356
|
normal: "normal";
|
|
357
|
+
bold: "bold";
|
|
358
358
|
}>;
|
|
359
359
|
style: z.ZodEnum<{
|
|
360
|
-
italic: "italic";
|
|
361
360
|
normal: "normal";
|
|
361
|
+
italic: "italic";
|
|
362
362
|
}>;
|
|
363
363
|
}, z.core.$strip>;
|
|
364
364
|
sizePt: z.ZodNumber;
|
|
@@ -528,12 +528,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
528
528
|
font: z.ZodObject<{
|
|
529
529
|
family: z.ZodString;
|
|
530
530
|
weight: z.ZodEnum<{
|
|
531
|
-
bold: "bold";
|
|
532
531
|
normal: "normal";
|
|
532
|
+
bold: "bold";
|
|
533
533
|
}>;
|
|
534
534
|
style: z.ZodEnum<{
|
|
535
|
-
italic: "italic";
|
|
536
535
|
normal: "normal";
|
|
536
|
+
italic: "italic";
|
|
537
537
|
}>;
|
|
538
538
|
}, z.core.$strip>;
|
|
539
539
|
sizePt: z.ZodNumber;
|
package/dist/package.d.cts
CHANGED
|
@@ -515,12 +515,12 @@ declare const DocumentPackageSchema: z.ZodObject<{
|
|
|
515
515
|
font: z.ZodObject<{
|
|
516
516
|
family: z.ZodString;
|
|
517
517
|
weight: z.ZodEnum<{
|
|
518
|
-
bold: "bold";
|
|
519
518
|
normal: "normal";
|
|
519
|
+
bold: "bold";
|
|
520
520
|
}>;
|
|
521
521
|
style: z.ZodEnum<{
|
|
522
|
-
italic: "italic";
|
|
523
522
|
normal: "normal";
|
|
523
|
+
italic: "italic";
|
|
524
524
|
}>;
|
|
525
525
|
}, z.core.$strip>;
|
|
526
526
|
sizePt: z.ZodNumber;
|
package/dist/package.d.ts
CHANGED
|
@@ -515,12 +515,12 @@ declare const DocumentPackageSchema: z.ZodObject<{
|
|
|
515
515
|
font: z.ZodObject<{
|
|
516
516
|
family: z.ZodString;
|
|
517
517
|
weight: z.ZodEnum<{
|
|
518
|
-
bold: "bold";
|
|
519
518
|
normal: "normal";
|
|
519
|
+
bold: "bold";
|
|
520
520
|
}>;
|
|
521
521
|
style: z.ZodEnum<{
|
|
522
|
-
italic: "italic";
|
|
523
522
|
normal: "normal";
|
|
523
|
+
italic: "italic";
|
|
524
524
|
}>;
|
|
525
525
|
}, z.core.$strip>;
|
|
526
526
|
sizePt: z.ZodNumber;
|
package/dist/schema-io.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const SCHEMA_FILE_NAMES = {
|
|
|
9
9
|
LayoutDocument: "layout-document.schema.json"
|
|
10
10
|
};
|
|
11
11
|
function schemaUriFor(kind) {
|
|
12
|
-
return `https://cdn.jsdelivr.net/npm/document-schema.js@2.7.
|
|
12
|
+
return `https://cdn.jsdelivr.net/npm/document-schema.js@2.7.6/schemas/${SCHEMA_FILE_NAMES[kind]}`;
|
|
13
13
|
}
|
|
14
14
|
const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@[^/]+\/schemas\/(document-package|content-document|layout-document)\.schema\.json$/;
|
|
15
15
|
function kindForFileStem(stem) {
|
package/dist/schema-io.js
CHANGED
|
@@ -8,7 +8,7 @@ const SCHEMA_FILE_NAMES = {
|
|
|
8
8
|
LayoutDocument: "layout-document.schema.json"
|
|
9
9
|
};
|
|
10
10
|
function schemaUriFor(kind) {
|
|
11
|
-
return `https://cdn.jsdelivr.net/npm/document-schema.js@2.7.
|
|
11
|
+
return `https://cdn.jsdelivr.net/npm/document-schema.js@2.7.6/schemas/${SCHEMA_FILE_NAMES[kind]}`;
|
|
12
12
|
}
|
|
13
13
|
const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@[^/]+\/schemas\/(document-package|content-document|layout-document)\.schema\.json$/;
|
|
14
14
|
function kindForFileStem(stem) {
|
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
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.7.
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.7.6/schemas/content-document.schema.json",
|
|
4
4
|
"oneOf": [
|
|
5
5
|
{
|
|
6
6
|
"type": "object",
|
|
@@ -1208,7 +1208,7 @@
|
|
|
1208
1208
|
]
|
|
1209
1209
|
},
|
|
1210
1210
|
"document": {
|
|
1211
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.7.
|
|
1211
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.7.6/schemas/content-document.schema.json"
|
|
1212
1212
|
},
|
|
1213
1213
|
"frame": {
|
|
1214
1214
|
"$ref": "#/$defs/Box"
|
|
@@ -2499,7 +2499,7 @@
|
|
|
2499
2499
|
]
|
|
2500
2500
|
},
|
|
2501
2501
|
"document": {
|
|
2502
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.7.
|
|
2502
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.7.6/schemas/content-document.schema.json"
|
|
2503
2503
|
},
|
|
2504
2504
|
"frame": {
|
|
2505
2505
|
"$ref": "#/$defs/Box"
|
|
@@ -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@2.7.
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.7.6/schemas/document-package.schema.json",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
6
6
|
"formatVersion": {
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"const": 1
|
|
9
9
|
},
|
|
10
10
|
"content": {
|
|
11
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.7.
|
|
11
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.7.6/schemas/content-document.schema.json"
|
|
12
12
|
},
|
|
13
13
|
"layout": {
|
|
14
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.7.
|
|
14
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.7.6/schemas/layout-document.schema.json"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"required": [
|
|
@@ -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@2.7.
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.7.6/schemas/layout-document.schema.json",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
6
6
|
"formatVersion": {
|