From 1bfb2e830e09745749751d147faf0801a3be2a0e Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:54:02 +0000 Subject: [PATCH 01/43] TinaCMS content update --- content/docs/schema.mdx | 55 +++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/content/docs/schema.mdx b/content/docs/schema.mdx index a3f50408af..b26129d109 100644 --- a/content/docs/schema.mdx +++ b/content/docs/schema.mdx @@ -1,17 +1,17 @@ --- id: /docs/schema/ - title: Content Modeling with TinaCMS next: content/docs/features/data-fetching.mdx +previous: '' --- ## Introduction The Tina schema defines the shape of your content. Tina uses a "content-modeling as code" approach. This has a few benefits compared to modelling through a UI: -- The schema is version-controlled -- Mutating the schema is easy, as you can test out changes locally, or in a branch. -- The developer can extend the schema in interesting ways (custom validation, custom UI fields, etc). +* The schema is version-controlled +* Mutating the schema is easy, as you can test out changes locally, or in a branch. +* The developer can extend the schema in interesting ways (custom validation, custom UI fields, etc). The content model, and all configuration code is defined in a file called `tina/config.{ts,js,tsx}`. @@ -64,7 +64,7 @@ Once we've defined a collection, we can edit its fields through the Tina UI, or ## "List" fields -Specifying `list: true` on _any_ field type will turn that field into an array of items: +Specifying `list: true` on *almost any* field type will turn that field into an array of items: ```js // ... @@ -80,9 +80,22 @@ fields: [ [See Example](https://tina-gql-playground.vercel.app/string-list) +### Caveats + +Certain field types cannot be set as a list, or may not have a specific list UI. To create lists of these fields, they can be wrapped in an object field type that has been been marked with list: true. + +Types that cannot be marked as a list: + +* [Reference Field Type](/docs/reference/types/reference/) + +A list of these types can be set, but they uses the singular field UI in the content editor: + +* Number Field Type +* + ## Limiting values to a set of options -Any _scalar_ field can accept an `options` array, note that in the example below we're using both `options` and `list` properties: +Any *scalar* field can accept an `options` array, note that in the example below we're using both `options` and `list` properties: ```js // ... @@ -248,7 +261,7 @@ export default defineConfig({ ## Referencing another document -The `reference` field connects one document to another and only needs to be defined on _one_ side of the relationship. You can specify any number of collections you'd like to connect: +The `reference` field connects one document to another and only needs to be defined on *one* side of the relationship. You can specify any number of collections you'd like to connect: ```js // ... @@ -270,28 +283,28 @@ fields: [ Each field in a collection can be of the following `type`: -### _scalar types_ +### *scalar types* -- [string](/docs/reference/types/string/) -- [datetime](/docs/reference/types/datetime/) -- [boolean](/docs/reference/types/boolean/) -- [image](/docs/reference/types/image/) -- [number](/docs/reference/types/number/) +* [string](/docs/reference/types/string/) +* [datetime](/docs/reference/types/datetime/) +* [boolean](/docs/reference/types/boolean/) +* [image](/docs/reference/types/image/) +* [number](/docs/reference/types/number/) -### _nonscalar types_ +### *nonscalar types* -- [reference](/docs/reference/types/reference/) -- [object](/docs/reference/types/object/) -- [rich-text](/docs/reference/types/rich-text/) +* [reference](/docs/reference/types/reference/) +* [object](/docs/reference/types/object/) +* [rich-text](/docs/reference/types/rich-text/) ## Video Tutorial -For those who prefer to learn from video, you can check out a snippet on media from our ["TinaCMS Deep Dive"](https://www.youtube.com/watch?v=PcgnJDILv4w&list=PLPar4H9PHKVqoCwZy79PHr8-W_vA3lAOB&pp=iAQB) series. +For those who prefer to learn from video, you can check out a snippet on media from our ["TinaCMS Deep Dive"](https://www.youtube.com/watch?v=PcgnJDILv4w\&list=PLPar4H9PHKVqoCwZy79PHr8-W_vA3lAOB\&pp=iAQB) series. ## Summary -- Your content is modeled in the `tina/config.{ts,js,tsx}` in your repo using `defineConfig`. -- Your content model contains an array of "collections". A "collection" maps a content type to a directory in your repo. -- A "collection" contains multiple fields, which can be of multiple scalar or non-scalar data types. +* Your content is modeled in the `tina/config.{ts,js,tsx}` in your repo using `defineConfig`. +* Your content model contains an array of "collections". A "collection" maps a content type to a directory in your repo. +* A "collection" contains multiple fields, which can be of multiple scalar or non-scalar data types. From bb66ac0d2f38e88b487f0da1c8158dc2cd43f654 Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:54:38 +0000 Subject: [PATCH 02/43] TinaCMS content update --- content/docs/schema.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/docs/schema.mdx b/content/docs/schema.mdx index b26129d109..78e3916a60 100644 --- a/content/docs/schema.mdx +++ b/content/docs/schema.mdx @@ -1,6 +1,7 @@ --- id: /docs/schema/ title: Content Modeling with TinaCMS +last_edited: '2024-09-11T23:54:36.905Z' next: content/docs/features/data-fetching.mdx previous: '' --- @@ -82,7 +83,7 @@ fields: [ ### Caveats -Certain field types cannot be set as a list, or may not have a specific list UI. To create lists of these fields, they can be wrapped in an object field type that has been been marked with list: true. +Certain field types cannot be set as a list, or may not have a specific list UI. To create lists of these fields, they can be wrapped in an object field type that has been been marked with `list: true`. Types that cannot be marked as a list: @@ -91,7 +92,7 @@ Types that cannot be marked as a list: A list of these types can be set, but they uses the singular field UI in the content editor: * Number Field Type -* +* ## Limiting values to a set of options From 7564e46105b1573ba395137469e3c0d9bf2e4604 Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:26:53 +0000 Subject: [PATCH 03/43] TinaCMS content update --- content/docs/schema.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/docs/schema.mdx b/content/docs/schema.mdx index 78e3916a60..c3920eaa99 100644 --- a/content/docs/schema.mdx +++ b/content/docs/schema.mdx @@ -1,7 +1,7 @@ --- id: /docs/schema/ title: Content Modeling with TinaCMS -last_edited: '2024-09-11T23:54:36.905Z' +last_edited: '2024-09-12T00:26:51.088Z' next: content/docs/features/data-fetching.mdx previous: '' --- @@ -91,8 +91,9 @@ Types that cannot be marked as a list: A list of these types can be set, but they uses the singular field UI in the content editor: -* Number Field Type -* +* [Number Field Type](/docs/reference/types/number/) +* [Datetime Field Type](/docs/reference/types/datetime/) +* [Boolean Field Type](/docs/reference/types/boolean/) ## Limiting values to a set of options From 85e5afc385219c6f3551b4b943bc5249deb4c0b5 Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:28:10 +0000 Subject: [PATCH 04/43] TinaCMS content update --- content/docs/schema.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/schema.mdx b/content/docs/schema.mdx index c3920eaa99..3dfe06455c 100644 --- a/content/docs/schema.mdx +++ b/content/docs/schema.mdx @@ -1,7 +1,7 @@ --- id: /docs/schema/ title: Content Modeling with TinaCMS -last_edited: '2024-09-12T00:26:51.088Z' +last_edited: '2024-09-12T00:28:09.755Z' next: content/docs/features/data-fetching.mdx previous: '' --- @@ -83,7 +83,7 @@ fields: [ ### Caveats -Certain field types cannot be set as a list, or may not have a specific list UI. To create lists of these fields, they can be wrapped in an object field type that has been been marked with `list: true`. +Certain field types cannot be set as a list, or may not have a specific list UI when changed through the content editor. To create lists of these fields, they can be wrapped in an object field type that has been been marked with `list: true`. Types that cannot be marked as a list: From 3a7f5be12fb7ef4ed13c550c054a88eaa9b0a0cd Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:32:03 +0000 Subject: [PATCH 05/43] TinaCMS content update --- content/docs/schema.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/docs/schema.mdx b/content/docs/schema.mdx index 3dfe06455c..8546d73552 100644 --- a/content/docs/schema.mdx +++ b/content/docs/schema.mdx @@ -1,7 +1,7 @@ --- id: /docs/schema/ title: Content Modeling with TinaCMS -last_edited: '2024-09-12T00:28:09.755Z' +last_edited: '2024-09-12T00:32:01.630Z' next: content/docs/features/data-fetching.mdx previous: '' --- @@ -65,10 +65,11 @@ Once we've defined a collection, we can edit its fields through the Tina UI, or ## "List" fields +![](https://res.cloudinary.com/forestry-demo/image/upload/v1726101065/Screenshot_2024-09-12_at_10.29.41_am_p0muts.png) + Specifying `list: true` on *almost any* field type will turn that field into an array of items: ```js -// ... fields: [ { label: 'Tags', @@ -79,7 +80,7 @@ fields: [ ] ``` -[See Example](https://tina-gql-playground.vercel.app/string-list) +[Live Example...](https://tina-gql-playground.vercel.app/string-list) ### Caveats From 14af5f0d06c4792c9671c8bc1cf946b9d9271ec4 Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:35:24 +0000 Subject: [PATCH 06/43] TinaCMS content update --- content/docs/schema.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/docs/schema.mdx b/content/docs/schema.mdx index 8546d73552..fc6bca29c3 100644 --- a/content/docs/schema.mdx +++ b/content/docs/schema.mdx @@ -1,7 +1,7 @@ --- id: /docs/schema/ title: Content Modeling with TinaCMS -last_edited: '2024-09-12T00:32:01.630Z' +last_edited: '2024-09-12T00:35:23.298Z' next: content/docs/features/data-fetching.mdx previous: '' --- @@ -95,6 +95,7 @@ A list of these types can be set, but they uses the singular field UI in the con * [Number Field Type](/docs/reference/types/number/) * [Datetime Field Type](/docs/reference/types/datetime/) * [Boolean Field Type](/docs/reference/types/boolean/) +* Rich-Text Field Type ## Limiting values to a set of options From c51e4a37e4a5f81dfb683cc2e64e38e692393a05 Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:35:33 +0000 Subject: [PATCH 07/43] TinaCMS content update --- content/docs/schema.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/schema.mdx b/content/docs/schema.mdx index fc6bca29c3..fd9d60c7c7 100644 --- a/content/docs/schema.mdx +++ b/content/docs/schema.mdx @@ -1,7 +1,7 @@ --- id: /docs/schema/ title: Content Modeling with TinaCMS -last_edited: '2024-09-12T00:35:23.298Z' +last_edited: '2024-09-12T00:35:32.450Z' next: content/docs/features/data-fetching.mdx previous: '' --- @@ -95,7 +95,7 @@ A list of these types can be set, but they uses the singular field UI in the con * [Number Field Type](/docs/reference/types/number/) * [Datetime Field Type](/docs/reference/types/datetime/) * [Boolean Field Type](/docs/reference/types/boolean/) -* Rich-Text Field Type +* [Rich-Text Field Type](/docs/reference/types/rich-text/) ## Limiting values to a set of options From 46adccb89daa9187487d98ae0d095697bd90ca26 Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:35:51 +0000 Subject: [PATCH 08/43] TinaCMS content update --- content/docs/schema.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/schema.mdx b/content/docs/schema.mdx index fd9d60c7c7..9dbdf90fcf 100644 --- a/content/docs/schema.mdx +++ b/content/docs/schema.mdx @@ -1,7 +1,7 @@ --- id: /docs/schema/ title: Content Modeling with TinaCMS -last_edited: '2024-09-12T00:35:32.450Z' +last_edited: '2024-09-12T00:35:50.171Z' next: content/docs/features/data-fetching.mdx previous: '' --- @@ -90,7 +90,7 @@ Types that cannot be marked as a list: * [Reference Field Type](/docs/reference/types/reference/) -A list of these types can be set, but they uses the singular field UI in the content editor: +A list of these types can be set, but they appear as a singular field in the content editor: * [Number Field Type](/docs/reference/types/number/) * [Datetime Field Type](/docs/reference/types/datetime/) From 34109166e3c961d19f4e2725e18031aac1d7532a Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:45:31 +0000 Subject: [PATCH 09/43] TinaCMS content update --- content/docs/reference/types/object.mdx | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/content/docs/reference/types/object.mdx b/content/docs/reference/types/object.mdx index ee546e2261..b2564916bc 100644 --- a/content/docs/reference/types/object.mdx +++ b/content/docs/reference/types/object.mdx @@ -1,6 +1,6 @@ --- title: The "object" field -last_edited: '2021-07-27T15:51:56.737Z' +last_edited: '2024-09-12T00:45:30.388Z' next: content/docs/reference/types/rich-text.mdx previous: content/docs/reference/types/reference.mdx --- @@ -107,6 +107,29 @@ Tina will generate the appropriate component depending on the configuration prov ![](https://res.cloudinary.com/forestry-demo/image/upload/v1722381170/Screenshot_2024-07-31_at_9.12.43_AM_gahppr.png) +### Using list object as a wrapper for other types + +Number, boolean, datetime and rich-text field types can be used in this way to add list options to the TinaCMS editor. + +Reference field types can be used in this way to create a list of references. + +```javascript +{ + label: "Author List", + name: "authorList", + type: "object", + list: true, + fields: [ + { + label: 'Author', + name: 'author', + type: 'reference', + collections: ['author'], + }, + ] +} +``` + ### Using templates instead of fields ```javascript From 4b8b10e8b681fdf92be97aee209ee87786b1eda7 Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:48:15 +0000 Subject: [PATCH 10/43] TinaCMS content update --- content/docs/reference/types/reference.mdx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/content/docs/reference/types/reference.mdx b/content/docs/reference/types/reference.mdx index 115a6f6600..eca938c3e1 100644 --- a/content/docs/reference/types/reference.mdx +++ b/content/docs/reference/types/reference.mdx @@ -1,6 +1,8 @@ --- title: The "reference" field -last_edited: '2024-08-27T08:00:17.162Z' +last_edited: '2024-09-12T00:48:14.741Z' +next: '' +previous: '' --- ## `reference` @@ -9,7 +11,7 @@ The `reference` field allows a "parent" document to connect to another document Once defined, the values of the *referenced* document become available to the parent. -> Note: `reference` with `list: true` is not currently supported. See the "Temporary work around" section of [issue #2056](https://github.com/tinacms/tinacms/issues/2056) for a suggested approach to achieve a similar result +> Note: `reference` with `list: true` is not currently supported. Object type lists can be used [as a wrapper](/docs/reference/types/object/#using-list-object-as-a-wrapper-for-other-types) where a reference list is needed. ## Object Definition @@ -145,7 +147,7 @@ You can search your reference with reference selector. The default reference selector displays the file path, there are cases where you may want to customize what is displayed in the dropdown to provide a better user experience. For example, showing the author's name instead of the file name can make the selection process more intuitive. -Below are some examples on how to customize the reference select using `ui.optionComponent`. +Below are some examples on how to customize the reference select using `ui.optionComponent`. Check out [custom field](https://tina.io/docs/extending-tina/custom-field-components/) to lean more about `ui`. From 8bb52354d6ace26b7d46505475bd1afff40352f4 Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:48:40 +0000 Subject: [PATCH 11/43] TinaCMS content update --- content/docs/reference/types/image.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/docs/reference/types/image.mdx b/content/docs/reference/types/image.mdx index 6f43e2fda9..e4924655f3 100644 --- a/content/docs/reference/types/image.mdx +++ b/content/docs/reference/types/image.mdx @@ -1,6 +1,8 @@ --- title: The "image" field -last_edited: '2022-06-15T15:51:56.737Z' +last_edited: '2024-09-12T00:48:39.650Z' +next: '' +previous: '' --- # `image` @@ -10,6 +12,7 @@ type ImageField = { label: string name: string type: 'image' + list: boolean /** See https://tina.io/docs/extending-tina/overview/ for customizing the UI **/ ui?: { label?: string From 5f74ec033187ac9c35ec810e735f29fd95603771 Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:48:52 +0000 Subject: [PATCH 12/43] TinaCMS content update --- content/docs/reference/types/image.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/reference/types/image.mdx b/content/docs/reference/types/image.mdx index e4924655f3..938e0ebdce 100644 --- a/content/docs/reference/types/image.mdx +++ b/content/docs/reference/types/image.mdx @@ -1,6 +1,6 @@ --- title: The "image" field -last_edited: '2024-09-12T00:48:39.650Z' +last_edited: '2024-09-12T00:48:51.277Z' next: '' previous: '' --- @@ -12,7 +12,7 @@ type ImageField = { label: string name: string type: 'image' - list: boolean + list?: boolean /** See https://tina.io/docs/extending-tina/overview/ for customizing the UI **/ ui?: { label?: string From ed1e4198444aebc995ba438231b113358f52b8bd Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:49:03 +0000 Subject: [PATCH 13/43] TinaCMS content update --- content/docs/reference/types/datetime.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/docs/reference/types/datetime.mdx b/content/docs/reference/types/datetime.mdx index 8371a726a3..17142d93da 100644 --- a/content/docs/reference/types/datetime.mdx +++ b/content/docs/reference/types/datetime.mdx @@ -1,6 +1,8 @@ --- title: The "datetime" field -last_edited: '2021-07-27T15:51:56.737Z' +last_edited: '2024-09-12T00:49:02.439Z' +next: '' +previous: '' --- ```ts @@ -8,6 +10,7 @@ type DatetimeField = { label: string name: string type: 'string' + list?: boolean /** See https://tina.io/docs/extending-tina/overview/ for customizing the UI **/ ui?: { dateFormat: string // eg 'YYYY MM DD' From 77339067695333adcf37b0538bbd5043e4f16088 Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:49:15 +0000 Subject: [PATCH 14/43] TinaCMS content update --- content/docs/reference/types/number.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/docs/reference/types/number.mdx b/content/docs/reference/types/number.mdx index f5730bf3da..485f36bfbf 100644 --- a/content/docs/reference/types/number.mdx +++ b/content/docs/reference/types/number.mdx @@ -1,6 +1,8 @@ --- title: The "number" field -last_edited: '2021-07-27T15:51:56.737Z' +last_edited: '2024-09-12T00:49:14.358Z' +next: '' +previous: '' --- ## `number` type @@ -10,8 +12,8 @@ type NumberField = { label: string name: string type: 'number' - /** See https://tina.io/docs/extending-tina/overview/ for customizing the UI **/ list?: boolean + /** See https://tina.io/docs/extending-tina/overview/ for customizing the UI **/ ui?: { label?: string description?: string From 426fa43c10104658c77495fae8fa0727817ea42e Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:40:28 +0000 Subject: [PATCH 15/43] TinaCMS content update --- content/docs/reference/types/number.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/reference/types/number.mdx b/content/docs/reference/types/number.mdx index 485f36bfbf..605062202e 100644 --- a/content/docs/reference/types/number.mdx +++ b/content/docs/reference/types/number.mdx @@ -1,6 +1,6 @@ --- title: The "number" field -last_edited: '2024-09-12T00:49:14.358Z' +last_edited: '2024-09-12T01:40:27.098Z' next: '' previous: '' --- @@ -13,7 +13,7 @@ type NumberField = { name: string type: 'number' list?: boolean - /** See https://tina.io/docs/extending-tina/overview/ for customizing the UI **/ + // See https://tina.io/docs/extending-tina/overview/ for customizing the UI ui?: { label?: string description?: string From d67b52a155570ea0cdf7b9ba06c800790b6d018f Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:41:20 +0000 Subject: [PATCH 16/43] TinaCMS content update --- content/docs/reference/types/string.mdx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/content/docs/reference/types/string.mdx b/content/docs/reference/types/string.mdx index a6f7663ede..61f0262b16 100644 --- a/content/docs/reference/types/string.mdx +++ b/content/docs/reference/types/string.mdx @@ -1,6 +1,8 @@ --- title: The "string" field -last_edited: '2021-07-27T15:51:56.737Z' +last_edited: '2024-09-12T01:41:19.065Z' +next: '' +previous: '' --- ## `string` type @@ -12,16 +14,16 @@ type StringField = { type: 'string' list?: boolean options?: (string | { value: string; label: string })[] - /** Represents the "body" of a markdown file **/ + // Represents the "body" of a markdown file isBody?: boolean - /** See https://tina.io/docs/extending-tina/overview/ for customizing the UI **/ + // See https://tina.io/docs/extending-tina/overview/ for customizing the UI ui?: { label?: string description?: string component?: FC | string | null parse?: (value: string | string[], name: string, field: F) => any format?: (value: string | string[], name: string, field: F) => any - // Note: defaultItem can only can be used when {list: true} + // defaultItem can only can be used when {list: true} defaultItem?: () => string | string validate?( // string or string[] depends on list true or false From ff36ddfba1f769af716df620538de3536a8604a8 Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:41:58 +0000 Subject: [PATCH 17/43] TinaCMS content update --- content/docs/reference/types/datetime.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/reference/types/datetime.mdx b/content/docs/reference/types/datetime.mdx index 17142d93da..2f6faa2f92 100644 --- a/content/docs/reference/types/datetime.mdx +++ b/content/docs/reference/types/datetime.mdx @@ -1,6 +1,6 @@ --- title: The "datetime" field -last_edited: '2024-09-12T00:49:02.439Z' +last_edited: '2024-09-12T01:41:57.299Z' next: '' previous: '' --- @@ -11,7 +11,7 @@ type DatetimeField = { name: string type: 'string' list?: boolean - /** See https://tina.io/docs/extending-tina/overview/ for customizing the UI **/ + // See https://tina.io/docs/extending-tina/overview/ for customizing the UI ui?: { dateFormat: string // eg 'YYYY MM DD' label?: string From e8aaf5323c3ce407c7ef2705555d4b14e552766b Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:42:18 +0000 Subject: [PATCH 18/43] TinaCMS content update --- content/docs/reference/types/boolean.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/docs/reference/types/boolean.mdx b/content/docs/reference/types/boolean.mdx index ff564fa3a5..beb1bc0694 100644 --- a/content/docs/reference/types/boolean.mdx +++ b/content/docs/reference/types/boolean.mdx @@ -1,6 +1,8 @@ --- title: The "boolean" field -last_edited: '2021-07-27T15:51:56.737Z' +last_edited: '2024-09-12T01:42:17.386Z' +next: '' +previous: '' --- ## `boolean` type @@ -10,8 +12,8 @@ type BooleanField = { label: string name: string type: 'boolean' - /** See https://tina.io/docs/extending-tina/overview/ for customizing the UI **/ list?: boolean + // See https://tina.io/docs/extending-tina/overview/ for customizing the UI ui?: { label?: string description?: string From 9694081f604fbcb4b5d21bfc932ed8f22e66fbc0 Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:42:33 +0000 Subject: [PATCH 19/43] TinaCMS content update --- content/docs/reference/types/image.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/reference/types/image.mdx b/content/docs/reference/types/image.mdx index 938e0ebdce..5b4d1706ed 100644 --- a/content/docs/reference/types/image.mdx +++ b/content/docs/reference/types/image.mdx @@ -1,6 +1,6 @@ --- title: The "image" field -last_edited: '2024-09-12T00:48:51.277Z' +last_edited: '2024-09-12T01:42:32.336Z' next: '' previous: '' --- @@ -13,7 +13,7 @@ type ImageField = { name: string type: 'image' list?: boolean - /** See https://tina.io/docs/extending-tina/overview/ for customizing the UI **/ + // See https://tina.io/docs/extending-tina/overview/ for customizing the UI ui?: { label?: string description?: string From 86e8bd6e03aea74a44ab5ea69d028fe6231aaafe Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:43:59 +0000 Subject: [PATCH 20/43] TinaCMS content update --- content/docs/reference/types/reference.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/docs/reference/types/reference.mdx b/content/docs/reference/types/reference.mdx index eca938c3e1..039a5d4ca6 100644 --- a/content/docs/reference/types/reference.mdx +++ b/content/docs/reference/types/reference.mdx @@ -1,6 +1,6 @@ --- title: The "reference" field -last_edited: '2024-09-12T00:48:14.741Z' +last_edited: '2024-09-12T01:43:58.248Z' next: '' previous: '' --- @@ -11,7 +11,7 @@ The `reference` field allows a "parent" document to connect to another document Once defined, the values of the *referenced* document become available to the parent. -> Note: `reference` with `list: true` is not currently supported. Object type lists can be used [as a wrapper](/docs/reference/types/object/#using-list-object-as-a-wrapper-for-other-types) where a reference list is needed. +> Note: `reference` with `list: true` is not currently supported. Object type lists can be used [as a wrapper](/docs/reference/types/object/#using-list-object-as-a-wrapper-for-other-types) around `reference` field types to create a list of references. ## Object Definition @@ -20,9 +20,9 @@ type ReferenceField = { label: string name: string type: 'reference' - /** The `name` of another collection **/ + // The `name` of another collection collections: string[] - /** See https://tina.io/docs/extending-tina/overview/ for customizing the UI **/ + // See https://tina.io/docs/extending-tina/overview/ for customizing the UI ui?: { label?: string description?: string From c0df5a8b757138113e1779445f228bba559b6dbd Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:46:50 +0000 Subject: [PATCH 21/43] TinaCMS content update --- content/docs/reference/types/object.mdx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/content/docs/reference/types/object.mdx b/content/docs/reference/types/object.mdx index b2564916bc..38928beaff 100644 --- a/content/docs/reference/types/object.mdx +++ b/content/docs/reference/types/object.mdx @@ -1,6 +1,6 @@ --- title: The "object" field -last_edited: '2024-09-12T00:45:30.388Z' +last_edited: '2024-09-12T01:46:49.912Z' next: content/docs/reference/types/rich-text.mdx previous: content/docs/reference/types/reference.mdx --- @@ -13,19 +13,18 @@ type ObjectField = { name: string type: 'object' list?: boolean - /** `fields OR `templates` may be provided, not both **/ + // `fields` OR `templates` may be provided, not both fields?: Field[] templates?: Template[] /** Customize the default "_template" key that gets set in a document to identify a block-type. Only applicable when list: true **/ templatesKey?: string - list?: boolean - /** See https://tina.io/docs/extending-tina/overview/ for customizing the UI **/ + // See https://tina.io/docs/extending-tina/overview/ for customizing the UI ui?: { - /** Weather or not the Visual Selector is enabled. See https://tina.io/docs/editing/blocks/#adding-a-visual-block-selector-experimental **/ + // Whether or not the Visual Selector is enabled. See https://tina.io/docs/editing/blocks/#adding-a-visual-block-selector-experimental visualSelector?: boolean, - // Note: defaultItem can only can be used when {list: true} + // defaultItem can only can be used when {list: true} defaultItem?: Record | () => Record, itemProps?( item: Record From 7a92d65652b11cfac63cc93a6c5f16d97434dc35 Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:49:02 +0000 Subject: [PATCH 22/43] TinaCMS content update --- content/docs/reference/types/object.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/reference/types/object.mdx b/content/docs/reference/types/object.mdx index 38928beaff..89f061c778 100644 --- a/content/docs/reference/types/object.mdx +++ b/content/docs/reference/types/object.mdx @@ -1,11 +1,11 @@ --- title: The "object" field -last_edited: '2024-09-12T01:46:49.912Z' +last_edited: '2024-09-12T01:49:01.669Z' next: content/docs/reference/types/rich-text.mdx previous: content/docs/reference/types/reference.mdx --- -# `object` +## `object` type ```ts type ObjectField = { From b7b38197de43798bcf886875f38ab599a88a31ce Mon Sep 17 00:00:00 2001 From: "tina-cloud-app[bot]" <58178390+tina-cloud-app[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:49:29 +0000 Subject: [PATCH 23/43] TinaCMS content update --- content/docs/reference/types/rich-text.mdx | 35 +++++++++++----------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/content/docs/reference/types/rich-text.mdx b/content/docs/reference/types/rich-text.mdx index ac9713487b..6182c6cbe4 100644 --- a/content/docs/reference/types/rich-text.mdx +++ b/content/docs/reference/types/rich-text.mdx @@ -1,9 +1,11 @@ --- title: The "rich-text" field -last_edited: '2021-07-27T15:51:56.737Z' +last_edited: '2024-09-12T01:49:28.439Z' +next: '' +previous: '' --- -# `rich-text` +## `rich-text` type Tina's `rich-text` field leverages MDX so you can embed your own structured blocks. To render a `rich-text` field with React we recommend the `` component from `tinacms`. See [usage](/docs/editing/markdown/#rendering-content-with-object-object) @@ -88,15 +90,12 @@ This is some text Results in the following response from the content API: -