@tinacms/schema-tools 0.0.0-dced6ab-20250611061422 → 0.0.0-dde3eb3-20251028070343
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/types/index.d.ts +33 -16
- package/package.json +2 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -3,6 +3,21 @@ import type React from 'react';
|
|
|
3
3
|
export declare const CONTENT_FORMATS: readonly ["mdx", "md", "markdown", "json", "yaml", "yml", "toml"];
|
|
4
4
|
export type ContentFormat = (typeof CONTENT_FORMATS)[number];
|
|
5
5
|
export type ContentFrontmatterFormat = 'yaml' | 'toml' | 'json';
|
|
6
|
+
export type Parser = {
|
|
7
|
+
type: 'mdx';
|
|
8
|
+
} | {
|
|
9
|
+
type: 'markdown';
|
|
10
|
+
/**
|
|
11
|
+
* Tina will escape entities like `<` and `[` by default. You can choose to turn
|
|
12
|
+
* off all escaping, or specify HTML, so `<div>` will not be turned into `\<div>`
|
|
13
|
+
*/
|
|
14
|
+
skipEscaping?: 'all' | 'html' | 'none';
|
|
15
|
+
} | {
|
|
16
|
+
/**
|
|
17
|
+
* Experimental: Returns the native Slate.js document as JSON. Ideal to retain the pure editor content structure.
|
|
18
|
+
*/
|
|
19
|
+
type: 'slatejson';
|
|
20
|
+
};
|
|
6
21
|
type Meta = {
|
|
7
22
|
active?: boolean;
|
|
8
23
|
dirty?: boolean;
|
|
@@ -114,6 +129,11 @@ export type UIField<Type, List extends boolean> = {
|
|
|
114
129
|
type FieldGeneric<Type, List extends boolean | undefined, ExtraFieldUIProps = {}> = List extends true ? {
|
|
115
130
|
list: true;
|
|
116
131
|
ui?: UIField<Type, true> & ExtraFieldUIProps;
|
|
132
|
+
/**
|
|
133
|
+
* Defines where new items will be added in the list.
|
|
134
|
+
* If not specified, defaults to `append`.
|
|
135
|
+
*/
|
|
136
|
+
addItemBehavior?: 'append' | 'prepend';
|
|
117
137
|
} : List extends false ? {
|
|
118
138
|
list?: false;
|
|
119
139
|
ui?: UIField<Type, false> & ExtraFieldUIProps;
|
|
@@ -215,16 +235,7 @@ export type RichTextField<WithNamespace extends boolean = false> = (FieldGeneric
|
|
|
215
235
|
*
|
|
216
236
|
* Specify `"markdown"` if you're having problems with Tina parsing your content.
|
|
217
237
|
*/
|
|
218
|
-
parser?:
|
|
219
|
-
type: 'markdown';
|
|
220
|
-
/**
|
|
221
|
-
* Tina will escape entities like `<` and `[` by default. You can choose to turn
|
|
222
|
-
* off all escaping, or specify HTML, so `<div>` will not be turned into `\<div>`
|
|
223
|
-
*/
|
|
224
|
-
skipEscaping?: 'all' | 'html' | 'none';
|
|
225
|
-
} | {
|
|
226
|
-
type: 'mdx';
|
|
227
|
-
};
|
|
238
|
+
parser?: Parser;
|
|
228
239
|
};
|
|
229
240
|
export type RichTextTemplate<WithNamespace extends boolean = false> = Template<WithNamespace> & {
|
|
230
241
|
inline?: boolean;
|
|
@@ -380,7 +391,7 @@ export interface Config<CMSCallback = undefined, FormifyCallback = undefined, Do
|
|
|
380
391
|
/**
|
|
381
392
|
* The Schema is used to define the shape of the content.
|
|
382
393
|
*
|
|
383
|
-
* https://tina.io/docs/
|
|
394
|
+
* https://tina.io/docs/r/the-config-file/
|
|
384
395
|
*/
|
|
385
396
|
schema: Schema;
|
|
386
397
|
/**
|
|
@@ -417,11 +428,17 @@ export interface Config<CMSCallback = undefined, FormifyCallback = undefined, Do
|
|
|
417
428
|
* ```
|
|
418
429
|
* [more info](https://vercel.com/docs/concepts/deployments/generated-urls#url-with-git-branch)
|
|
419
430
|
*/
|
|
420
|
-
previewUrl
|
|
431
|
+
previewUrl?: (context: {
|
|
421
432
|
branch: string;
|
|
422
433
|
}) => {
|
|
423
434
|
url: string;
|
|
424
435
|
};
|
|
436
|
+
/**
|
|
437
|
+
* Opt out of update checks - this will prevent the CMS for checking for new versions
|
|
438
|
+
* If true, the CMS will not check for updates.
|
|
439
|
+
* Defaults to false if not specified.
|
|
440
|
+
*/
|
|
441
|
+
optOutOfUpdateCheck?: boolean;
|
|
425
442
|
};
|
|
426
443
|
/**
|
|
427
444
|
* Configurations for the autogenerated GraphQL HTTP client
|
|
@@ -501,7 +518,7 @@ export interface Config<CMSCallback = undefined, FormifyCallback = undefined, Do
|
|
|
501
518
|
} | {
|
|
502
519
|
/**
|
|
503
520
|
* Use Git-backed assets for media, these values will
|
|
504
|
-
* [Learn more](https://tina.io/docs/
|
|
521
|
+
* [Learn more](https://tina.io/docs/r/repo-based-media/)
|
|
505
522
|
*/
|
|
506
523
|
tina: {
|
|
507
524
|
/**
|
|
@@ -576,7 +593,7 @@ export interface Schema<WithNamespace extends boolean = false> {
|
|
|
576
593
|
/**
|
|
577
594
|
* Collections represent a type of content (EX, blog post, page, author, etc). We recommend using singular naming in a collection (Ex: use post and not posts).
|
|
578
595
|
*
|
|
579
|
-
* https://tina.io/docs/
|
|
596
|
+
* https://tina.io/docs/r/content-modelling-collections/
|
|
580
597
|
*/
|
|
581
598
|
collections: Collection<WithNamespace>[];
|
|
582
599
|
/**
|
|
@@ -615,7 +632,7 @@ type TemplateCollection<WithNamespace extends boolean = false> = {
|
|
|
615
632
|
/**
|
|
616
633
|
* In most cases, just using fields is enough, however templates can be used when there are multiple variants of the same collection or object. For example in a "page" collection there might be a need for a marketing page template and a content page template, both under the collection "page".
|
|
617
634
|
*
|
|
618
|
-
* https://tina.io/docs/
|
|
635
|
+
* https://tina.io/docs/r/content-modelling-templates/
|
|
619
636
|
*/
|
|
620
637
|
templates: Template<WithNamespace>[];
|
|
621
638
|
fields?: undefined;
|
|
@@ -624,7 +641,7 @@ type FieldCollection<WithNamespace extends boolean = false> = {
|
|
|
624
641
|
/**
|
|
625
642
|
* Fields define the shape of the content and the user input.
|
|
626
643
|
*
|
|
627
|
-
* https://tina.io/docs/
|
|
644
|
+
* https://tina.io/docs/r/string-fields/
|
|
628
645
|
*/
|
|
629
646
|
fields: TinaField<WithNamespace>[];
|
|
630
647
|
templates?: undefined;
|
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-dde3eb3-20251028070343",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"ts-jest": "^29.2.5",
|
|
33
33
|
"typescript": "^5.7.3",
|
|
34
34
|
"yup": "^0.32.11",
|
|
35
|
-
"@tinacms/scripts": "0.0.0-
|
|
35
|
+
"@tinacms/scripts": "0.0.0-dde3eb3-20251028070343"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": ">=16.14.0",
|