@tinacms/schema-tools 0.0.0-bc59a81-20241030011355 → 0.0.0-bdc07c1-20250506013835
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/index.d.ts +1 -6
- package/dist/index.js +194 -168
- package/dist/index.mjs +193 -166
- package/dist/schema/TinaSchema.d.ts +21 -1
- package/dist/schema/addNamespaceToSchema.d.ts +8 -4
- package/dist/types/index.d.ts +15 -7
- package/dist/validate/fields.d.ts +0 -3
- package/dist/validate/schema.d.ts +12 -15
- package/dist/validate/util.d.ts +3 -0
- package/package.json +8 -7
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ContentFormat, ContentFrontmatterFormat } from '@tinacms/common';
|
|
1
2
|
import type { FC } from 'react';
|
|
2
3
|
import type React from 'react';
|
|
3
4
|
type Meta = {
|
|
@@ -185,7 +186,7 @@ export type ReferenceField = (FieldGeneric<string, undefined, ReferenceFieldOpti
|
|
|
185
186
|
export type PasswordField = (FieldGeneric<string, undefined> | FieldGeneric<string, false>) & BaseField & {
|
|
186
187
|
type: 'password';
|
|
187
188
|
};
|
|
188
|
-
type
|
|
189
|
+
type ToolbarOverrideType = 'heading' | 'link' | 'image' | 'quote' | 'ul' | 'ol' | 'code' | 'codeBlock' | 'bold' | 'italic' | 'raw' | 'embed' | 'mermaid' | 'table';
|
|
189
190
|
type RichTextAst = {
|
|
190
191
|
type: 'root';
|
|
191
192
|
children: Record<string, unknown>[];
|
|
@@ -198,8 +199,14 @@ export type RichTextField<WithNamespace extends boolean = false> = (FieldGeneric
|
|
|
198
199
|
* will be stored as frontmatter
|
|
199
200
|
*/
|
|
200
201
|
isBody?: boolean;
|
|
201
|
-
|
|
202
|
+
/**@deprecated use overrides.toolbar */
|
|
203
|
+
toolbarOverride?: ToolbarOverrideType[];
|
|
202
204
|
templates?: RichTextTemplate<WithNamespace>[];
|
|
205
|
+
overrides?: {
|
|
206
|
+
toolbar?: ToolbarOverrideType[];
|
|
207
|
+
/**Default set to true */
|
|
208
|
+
showFloatingToolbar?: boolean;
|
|
209
|
+
};
|
|
203
210
|
/**
|
|
204
211
|
* By default, Tina parses markdown with MDX, this is a more strict parser
|
|
205
212
|
* that allows you to use structured content inside markdown (via `templates`).
|
|
@@ -394,7 +401,7 @@ export interface Config<CMSCallback = undefined, FormifyCallback = undefined, Do
|
|
|
394
401
|
token?: string | null;
|
|
395
402
|
ui?: {
|
|
396
403
|
/**
|
|
397
|
-
* When using
|
|
404
|
+
* When using TinaCloud's branching feature, provide the URL for your given branch
|
|
398
405
|
*
|
|
399
406
|
* Eg. If you're deplying to Vercel, and your repo name is 'my-app',
|
|
400
407
|
* Vercel's preview URL would be based on the branch:
|
|
@@ -521,7 +528,7 @@ export interface Config<CMSCallback = undefined, FormifyCallback = undefined, Do
|
|
|
521
528
|
} | {
|
|
522
529
|
searchClient?: never;
|
|
523
530
|
/**
|
|
524
|
-
* Use the
|
|
531
|
+
* Use the TinaCloud search index
|
|
525
532
|
*/
|
|
526
533
|
tina: {
|
|
527
534
|
/**
|
|
@@ -548,7 +555,7 @@ export interface Config<CMSCallback = undefined, FormifyCallback = undefined, Do
|
|
|
548
555
|
maxSearchIndexFieldLength?: number;
|
|
549
556
|
};
|
|
550
557
|
/**
|
|
551
|
-
* Used to override the default
|
|
558
|
+
* Used to override the default TinaCloud API URL
|
|
552
559
|
*
|
|
553
560
|
* [mostly for internal use only]
|
|
554
561
|
*/
|
|
@@ -581,7 +588,7 @@ interface BaseCollection {
|
|
|
581
588
|
name: string;
|
|
582
589
|
path: string;
|
|
583
590
|
indexes?: IndexType[];
|
|
584
|
-
format?:
|
|
591
|
+
format?: ContentFormat;
|
|
585
592
|
ui?: UICollection;
|
|
586
593
|
/**
|
|
587
594
|
* @deprecated - use `ui.defaultItem` on the each `template` instead
|
|
@@ -590,7 +597,7 @@ interface BaseCollection {
|
|
|
590
597
|
/**
|
|
591
598
|
* This format will be used to parse the markdown frontmatter
|
|
592
599
|
*/
|
|
593
|
-
frontmatterFormat?:
|
|
600
|
+
frontmatterFormat?: ContentFrontmatterFormat;
|
|
594
601
|
/**
|
|
595
602
|
* The delimiters used to parse the frontmatter.
|
|
596
603
|
*/
|
|
@@ -630,6 +637,7 @@ type Document = {
|
|
|
630
637
|
relativePath: string;
|
|
631
638
|
filename: string;
|
|
632
639
|
extension: string;
|
|
640
|
+
hasReferences?: boolean;
|
|
633
641
|
};
|
|
634
642
|
};
|
|
635
643
|
export interface UICollection<Form = any, CMS = any, TinaForm = any> {
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
1
|
import { z } from 'zod';
|
|
5
2
|
export declare const CollectionBaseSchema: z.ZodObject<{
|
|
6
3
|
label: z.ZodOptional<z.ZodString>;
|
|
7
4
|
name: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
8
5
|
path: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
9
|
-
format: z.ZodOptional<z.ZodEnum<["
|
|
6
|
+
format: z.ZodOptional<z.ZodEnum<["mdx", "md", "markdown", "json", "yaml", "yml", "toml"]>>;
|
|
10
7
|
isAuthCollection: z.ZodOptional<z.ZodBoolean>;
|
|
11
8
|
isDetached: z.ZodOptional<z.ZodBoolean>;
|
|
12
9
|
}, "strip", z.ZodTypeAny, {
|
|
13
10
|
name?: string;
|
|
14
11
|
label?: string;
|
|
15
12
|
path?: string;
|
|
16
|
-
format?: "
|
|
13
|
+
format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
|
|
17
14
|
isDetached?: boolean;
|
|
18
15
|
isAuthCollection?: boolean;
|
|
19
16
|
}, {
|
|
20
17
|
name?: string;
|
|
21
18
|
label?: string;
|
|
22
19
|
path?: string;
|
|
23
|
-
format?: "
|
|
20
|
+
format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
|
|
24
21
|
isDetached?: boolean;
|
|
25
22
|
isAuthCollection?: boolean;
|
|
26
23
|
}>;
|
|
@@ -29,7 +26,7 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
|
|
|
29
26
|
label: z.ZodOptional<z.ZodString>;
|
|
30
27
|
name: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
31
28
|
path: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
32
|
-
format: z.ZodOptional<z.ZodEnum<["
|
|
29
|
+
format: z.ZodOptional<z.ZodEnum<["mdx", "md", "markdown", "json", "yaml", "yml", "toml"]>>;
|
|
33
30
|
isAuthCollection: z.ZodOptional<z.ZodBoolean>;
|
|
34
31
|
isDetached: z.ZodOptional<z.ZodBoolean>;
|
|
35
32
|
}, {
|
|
@@ -73,7 +70,7 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
|
|
|
73
70
|
fields?: import("..").TinaField[];
|
|
74
71
|
label?: string;
|
|
75
72
|
path?: string;
|
|
76
|
-
format?: "
|
|
73
|
+
format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
|
|
77
74
|
isDetached?: boolean;
|
|
78
75
|
isAuthCollection?: boolean;
|
|
79
76
|
}, {
|
|
@@ -86,7 +83,7 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
|
|
|
86
83
|
fields?: import("..").TinaField[];
|
|
87
84
|
label?: string;
|
|
88
85
|
path?: string;
|
|
89
|
-
format?: "
|
|
86
|
+
format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
|
|
90
87
|
isDetached?: boolean;
|
|
91
88
|
isAuthCollection?: boolean;
|
|
92
89
|
}>, {
|
|
@@ -99,7 +96,7 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
|
|
|
99
96
|
fields?: import("..").TinaField[];
|
|
100
97
|
label?: string;
|
|
101
98
|
path?: string;
|
|
102
|
-
format?: "
|
|
99
|
+
format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
|
|
103
100
|
isDetached?: boolean;
|
|
104
101
|
isAuthCollection?: boolean;
|
|
105
102
|
}, {
|
|
@@ -112,7 +109,7 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
|
|
|
112
109
|
fields?: import("..").TinaField[];
|
|
113
110
|
label?: string;
|
|
114
111
|
path?: string;
|
|
115
|
-
format?: "
|
|
112
|
+
format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
|
|
116
113
|
isDetached?: boolean;
|
|
117
114
|
isAuthCollection?: boolean;
|
|
118
115
|
}>, "many">;
|
|
@@ -246,7 +243,7 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
|
|
|
246
243
|
fields?: import("..").TinaField[];
|
|
247
244
|
label?: string;
|
|
248
245
|
path?: string;
|
|
249
|
-
format?: "
|
|
246
|
+
format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
|
|
250
247
|
isDetached?: boolean;
|
|
251
248
|
isAuthCollection?: boolean;
|
|
252
249
|
}[];
|
|
@@ -284,7 +281,7 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
|
|
|
284
281
|
fields?: import("..").TinaField[];
|
|
285
282
|
label?: string;
|
|
286
283
|
path?: string;
|
|
287
|
-
format?: "
|
|
284
|
+
format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
|
|
288
285
|
isDetached?: boolean;
|
|
289
286
|
isAuthCollection?: boolean;
|
|
290
287
|
}[];
|
|
@@ -322,7 +319,7 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
|
|
|
322
319
|
fields?: import("..").TinaField[];
|
|
323
320
|
label?: string;
|
|
324
321
|
path?: string;
|
|
325
|
-
format?: "
|
|
322
|
+
format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
|
|
326
323
|
isDetached?: boolean;
|
|
327
324
|
isAuthCollection?: boolean;
|
|
328
325
|
}[];
|
|
@@ -360,7 +357,7 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
|
|
|
360
357
|
fields?: import("..").TinaField[];
|
|
361
358
|
label?: string;
|
|
362
359
|
path?: string;
|
|
363
|
-
format?: "
|
|
360
|
+
format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
|
|
364
361
|
isDetached?: boolean;
|
|
365
362
|
isAuthCollection?: boolean;
|
|
366
363
|
}[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/schema-tools",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-bdc07c1-20250506013835",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -23,20 +23,21 @@
|
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@types/jest": "^29.5.
|
|
26
|
+
"@types/jest": "^29.5.14",
|
|
27
27
|
"@types/micromatch": "^4.0.9",
|
|
28
|
-
"@types/react": "^18.3.
|
|
28
|
+
"@types/react": "^18.3.18",
|
|
29
29
|
"@types/yup": "^0.29.14",
|
|
30
30
|
"jest": "^29.7.0",
|
|
31
31
|
"react": "^18.3.1",
|
|
32
32
|
"ts-jest": "^29.2.5",
|
|
33
|
-
"typescript": "^5.
|
|
33
|
+
"typescript": "^5.7.3",
|
|
34
34
|
"yup": "^0.32.11",
|
|
35
|
-
"@tinacms/scripts": "1.3.
|
|
35
|
+
"@tinacms/scripts": "1.3.4"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": ">=16.14.0",
|
|
39
|
-
"yup": "^0.32.0"
|
|
39
|
+
"yup": "^0.32.0",
|
|
40
|
+
"@tinacms/common": "0.0.0-bdc07c1-20250506013835"
|
|
40
41
|
},
|
|
41
42
|
"publishConfig": {
|
|
42
43
|
"registry": "https://registry.npmjs.org"
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
"dependencies": {
|
|
49
50
|
"picomatch-browser": "2.2.6",
|
|
50
51
|
"url-pattern": "^1.0.3",
|
|
51
|
-
"zod": "^3.
|
|
52
|
+
"zod": "^3.24.2"
|
|
52
53
|
},
|
|
53
54
|
"scripts": {
|
|
54
55
|
"build": "tinacms-scripts build",
|