tinacms 0.68.10 → 0.68.13
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/LICENSE +176 -0
- package/dist/client.js +1 -2
- package/dist/edit-state.es.js +7 -35
- package/dist/edit-state.js +8 -37
- package/dist/hooks/formify/spec/schema.d.ts +3 -0
- package/dist/index.es.js +515 -580
- package/dist/index.js +286 -352
- package/dist/internalClient/index.d.ts +8 -0
- package/dist/rich-text.es.js +74 -73
- package/dist/rich-text.js +75 -75
- package/dist/style.css +54 -3
- package/package.json +36 -13
- package/CHANGELOG.md +0 -1586
package/CHANGELOG.md
DELETED
|
@@ -1,1586 +0,0 @@
|
|
|
1
|
-
# tinacms
|
|
2
|
-
|
|
3
|
-
## 0.68.10
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- d95b73974: Fix collection list page delete modal
|
|
8
|
-
- 7b77fe1b5: Add a default TinaMediaStore for repo-based media
|
|
9
|
-
- Updated dependencies [2ef5a1f33]
|
|
10
|
-
- Updated dependencies [fb73fb355]
|
|
11
|
-
- Updated dependencies [7b77fe1b5]
|
|
12
|
-
- Updated dependencies [99a13024d]
|
|
13
|
-
- @tinacms/toolkit@0.56.33
|
|
14
|
-
- @tinacms/schema-tools@0.0.6
|
|
15
|
-
- @tinacms/sharedctx@0.1.1
|
|
16
|
-
|
|
17
|
-
All notable changes to `tinacms/packages/tinacms` will be documented in this file.
|
|
18
|
-
|
|
19
|
-
Note: For root tinacms changes, please refer to the [CHANGELOG.md](https://github.com/tinacms/tinacms/CHANGELOG.md) specific to root `tinacms`.
|
|
20
|
-
|
|
21
|
-
## 0.68.9
|
|
22
|
-
|
|
23
|
-
### Patch Changes
|
|
24
|
-
|
|
25
|
-
- 1f7d3ca3d: Use custom wrapper class for tailwind type plugin
|
|
26
|
-
- cceef726e: Fix login ui issue
|
|
27
|
-
- Updated dependencies [1f7d3ca3d]
|
|
28
|
-
- Updated dependencies [f6cb634c2]
|
|
29
|
-
- Updated dependencies [6c17f0160]
|
|
30
|
-
- Updated dependencies [cceef726e]
|
|
31
|
-
- @tinacms/toolkit@0.56.32
|
|
32
|
-
- @tinacms/schema-tools@0.0.5
|
|
33
|
-
- @tinacms/sharedctx@0.1.1
|
|
34
|
-
|
|
35
|
-
## 0.68.8
|
|
36
|
-
|
|
37
|
-
### Patch Changes
|
|
38
|
-
|
|
39
|
-
- 999f0895a: Set font family on heading elements
|
|
40
|
-
- 41be5e7fc: Fixes subitem links to use breadcrumbs
|
|
41
|
-
- Updated dependencies [999f0895a]
|
|
42
|
-
- @tinacms/toolkit@0.56.31
|
|
43
|
-
|
|
44
|
-
## 0.68.7
|
|
45
|
-
|
|
46
|
-
### Patch Changes
|
|
47
|
-
|
|
48
|
-
- aaaa5bb09: Added pagination to the CMS
|
|
49
|
-
- e06dbb3ca: Adds `waitForDB` cmd to cli
|
|
50
|
-
- Updated dependencies [aaaa5bb09]
|
|
51
|
-
- @tinacms/toolkit@0.56.30
|
|
52
|
-
|
|
53
|
-
## 0.68.6
|
|
54
|
-
|
|
55
|
-
### Patch Changes
|
|
56
|
-
|
|
57
|
-
- 2cc206b1a: Improve mobile nav behaviour
|
|
58
|
-
- 8998df207: fix: update tina client with the current branch from local storage
|
|
59
|
-
- Updated dependencies [58a7a00f7]
|
|
60
|
-
- Updated dependencies [2cc206b1a]
|
|
61
|
-
- Updated dependencies [aaadefd2d]
|
|
62
|
-
- @tinacms/toolkit@0.56.29
|
|
63
|
-
|
|
64
|
-
## 0.68.5
|
|
65
|
-
|
|
66
|
-
### Patch Changes
|
|
67
|
-
|
|
68
|
-
- 646cad8da: Adds support for using the generated client on the frontend
|
|
69
|
-
- f857616f6: Rename sdk to queries
|
|
70
|
-
- 6e2ed31a2: Added `isTitle` property to the schema that allows the title to be displayed in the CMS
|
|
71
|
-
- Updated dependencies [a196198bd]
|
|
72
|
-
- Updated dependencies [57a4a3789]
|
|
73
|
-
- Updated dependencies [6e2ed31a2]
|
|
74
|
-
- Updated dependencies [ba1499029]
|
|
75
|
-
- @tinacms/toolkit@0.56.28
|
|
76
|
-
- @tinacms/schema-tools@0.0.4
|
|
77
|
-
|
|
78
|
-
## 0.68.4
|
|
79
|
-
|
|
80
|
-
### Patch Changes
|
|
81
|
-
|
|
82
|
-
- 7372f90ca: Adds a new client that can be used on the backend and frontend.
|
|
83
|
-
- Updated dependencies [d4f98d0fc]
|
|
84
|
-
- Updated dependencies [7e2272442]
|
|
85
|
-
- @tinacms/toolkit@0.56.27
|
|
86
|
-
|
|
87
|
-
## 0.68.3
|
|
88
|
-
|
|
89
|
-
### Patch Changes
|
|
90
|
-
|
|
91
|
-
- 8b7ee346a: - Display label instead of name for mdx dropdown af306fa
|
|
92
|
-
- Fix issue where reset triggered chagnes to the wrong rich-text field 03f6191
|
|
93
|
-
- Fix issue where null children in a code block threw an error e454bce
|
|
94
|
-
- Updated dependencies [f6f56bcc0]
|
|
95
|
-
- Updated dependencies [59d33a74a]
|
|
96
|
-
- Updated dependencies [8b7ee346a]
|
|
97
|
-
- Updated dependencies [acb38bf9f]
|
|
98
|
-
- @tinacms/toolkit@0.56.26
|
|
99
|
-
|
|
100
|
-
## 0.68.2
|
|
101
|
-
|
|
102
|
-
### Patch Changes
|
|
103
|
-
|
|
104
|
-
- Updated dependencies [e90647da3]
|
|
105
|
-
- @tinacms/toolkit@0.56.25
|
|
106
|
-
|
|
107
|
-
## 0.68.1
|
|
108
|
-
|
|
109
|
-
### Patch Changes
|
|
110
|
-
|
|
111
|
-
- 41d666f9a: Styles list page overflow menu, removes unused prop
|
|
112
|
-
- e5a1152f2: Fix issue where pages that didnt use `useTina` would get a loading spinner that hangs
|
|
113
|
-
- Updated dependencies [41d666f9a]
|
|
114
|
-
- @tinacms/toolkit@0.56.24
|
|
115
|
-
|
|
116
|
-
## 0.68.0
|
|
117
|
-
|
|
118
|
-
### Minor Changes
|
|
119
|
-
|
|
120
|
-
- 6a6f137ae: # Simplify GraphQL API
|
|
121
|
-
|
|
122
|
-
## `schema` must be supplied to the `<TinaCMS>` component
|
|
123
|
-
|
|
124
|
-
Previously the `.tina/schema.ts` was only used by the Tina CLI to generate the GraphQL API. However it's now required as a prop to `<TinaCMS>`. This allows you to provide runtime logic in the `ui` property of field definitions. See the documentation on "Extending Tina" for examples.
|
|
125
|
-
|
|
126
|
-
## The GraphQL API has been simplified
|
|
127
|
-
|
|
128
|
-
### `get<collection name>` is now just the collection name
|
|
129
|
-
|
|
130
|
-
```graphql
|
|
131
|
-
# old
|
|
132
|
-
{
|
|
133
|
-
getPostDocument(relativePath: $relativePath) { ... }
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
# new
|
|
137
|
-
{
|
|
138
|
-
post(relativePath: $relativePath) { ... }
|
|
139
|
-
}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### `get<collection name>List` is now `<collection name>Connection`
|
|
143
|
-
|
|
144
|
-
The use of the term `connection` is due to our adherence the the [relay cursor spec](https://relay.dev/graphql/connections.htm). We may offer a simplified list field in a future release
|
|
145
|
-
|
|
146
|
-
```graphql
|
|
147
|
-
# old
|
|
148
|
-
{
|
|
149
|
-
getPostList { ... }
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
# new
|
|
153
|
-
{
|
|
154
|
-
postConnection { ... }
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### `getCollection` and `getCollections` are now `collection` and `collections`
|
|
159
|
-
|
|
160
|
-
```graphql
|
|
161
|
-
# old
|
|
162
|
-
{
|
|
163
|
-
getCollection(collection: "post") {...}
|
|
164
|
-
}
|
|
165
|
-
{
|
|
166
|
-
getCollections {...}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
# new
|
|
170
|
-
{
|
|
171
|
-
collection(collection: "post") {...}
|
|
172
|
-
}
|
|
173
|
-
{
|
|
174
|
-
collections {...}
|
|
175
|
-
}
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### No more `data` property
|
|
179
|
-
|
|
180
|
-
The `data` property was previously where all field definitions could be found. This has been moved on level up:
|
|
181
|
-
|
|
182
|
-
```graphql
|
|
183
|
-
# old
|
|
184
|
-
{
|
|
185
|
-
getPostDocument(relativePath: $relativePath) {
|
|
186
|
-
data {
|
|
187
|
-
title
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
# new
|
|
193
|
-
{
|
|
194
|
-
post(relativePath: $relativePath) {
|
|
195
|
-
title
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
#### The type for documents no longer includes "Document" at the end
|
|
201
|
-
|
|
202
|
-
```graphql
|
|
203
|
-
# old
|
|
204
|
-
{
|
|
205
|
-
getPostDocument(relativePath: $relativePath) {
|
|
206
|
-
data {
|
|
207
|
-
author {
|
|
208
|
-
... on AuthorDocument {
|
|
209
|
-
data {
|
|
210
|
-
name
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
# new
|
|
219
|
-
{
|
|
220
|
-
post(relativePath: $relativePath) {
|
|
221
|
-
author {
|
|
222
|
-
... on Author {
|
|
223
|
-
name
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
### Meta fields are now underscored
|
|
231
|
-
|
|
232
|
-
Aside from `id`, other metadata is now underscored:
|
|
233
|
-
|
|
234
|
-
```graphql
|
|
235
|
-
# old
|
|
236
|
-
{
|
|
237
|
-
getPostDocument(relativePath: $relativePath) {
|
|
238
|
-
sys {
|
|
239
|
-
relativePath
|
|
240
|
-
}
|
|
241
|
-
values
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
# new
|
|
246
|
-
{
|
|
247
|
-
post(relativePath: $relativePath) {
|
|
248
|
-
_sys {
|
|
249
|
-
relativePath
|
|
250
|
-
}
|
|
251
|
-
_values
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### `dataJSON` is gone
|
|
257
|
-
|
|
258
|
-
This is identical to `_values`
|
|
259
|
-
|
|
260
|
-
### `form` is gone
|
|
261
|
-
|
|
262
|
-
`form` was used internally to generate forms for the given document, however that's now handled by providing your `schema` to `<TinaCMS>`.
|
|
263
|
-
|
|
264
|
-
### `getDocumentList` is gone
|
|
265
|
-
|
|
266
|
-
It's no longer possible to query all documents at once, you can query for collection documents via the `collection` query:
|
|
267
|
-
|
|
268
|
-
```graphql
|
|
269
|
-
{
|
|
270
|
-
collection {
|
|
271
|
-
documents {
|
|
272
|
-
edges {
|
|
273
|
-
node {...}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
### Patch Changes
|
|
281
|
-
|
|
282
|
-
- Updated dependencies [6a6f137ae]
|
|
283
|
-
- @tinacms/toolkit@0.56.23
|
|
284
|
-
|
|
285
|
-
## 0.67.4
|
|
286
|
-
|
|
287
|
-
### Patch Changes
|
|
288
|
-
|
|
289
|
-
- 168f6cc6e: Update delete modal header
|
|
290
|
-
- 2a6060138: Fix url parsing issue when a branch name contained a `/`
|
|
291
|
-
- 3af3d6787: Fix issues with finding the template for multitemplate collections
|
|
292
|
-
- Updated dependencies [bf5fe0074]
|
|
293
|
-
- @tinacms/toolkit@0.56.22
|
|
294
|
-
|
|
295
|
-
## 0.67.3
|
|
296
|
-
|
|
297
|
-
### Patch Changes
|
|
298
|
-
|
|
299
|
-
- Updated dependencies [d37562999]
|
|
300
|
-
- @tinacms/toolkit@0.56.21
|
|
301
|
-
|
|
302
|
-
## 0.67.2
|
|
303
|
-
|
|
304
|
-
### Patch Changes
|
|
305
|
-
|
|
306
|
-
- 40afac061: updated @headlessui/react
|
|
307
|
-
- Updated dependencies [40afac061]
|
|
308
|
-
- @tinacms/toolkit@0.56.20
|
|
309
|
-
|
|
310
|
-
## 0.67.1
|
|
311
|
-
|
|
312
|
-
### Patch Changes
|
|
313
|
-
|
|
314
|
-
- 921709a7e: Adds validation to the schema instead of only using typescript types
|
|
315
|
-
- 3e2d9e43a: Adds new GraphQL `deleteDocument` mutation and logic
|
|
316
|
-
- Updated dependencies [921709a7e]
|
|
317
|
-
- @tinacms/schema-tools@0.0.3
|
|
318
|
-
|
|
319
|
-
## 0.67.0
|
|
320
|
-
|
|
321
|
-
### Minor Changes
|
|
322
|
-
|
|
323
|
-
- 86651039b: Updates to the way forms are generated in contextual editing. This lays the groundwork for
|
|
324
|
-
future updates but doesn't offer new behavior yet. It does come with a small breaking change:
|
|
325
|
-
|
|
326
|
-
[BREAKING]: The `id` of forms is now the actual document `path`. Previously this was the name of the GraphQL query node (eg. `getPostDocument`).
|
|
327
|
-
If you're using the [`formifyCallback`](https://tina.io/docs/advanced/customizing-forms/#customizing-a-form) prop to create global forms, you'll probably need to update the callback to check for the appropriate id.
|
|
328
|
-
|
|
329
|
-
Eg. `formConfig.id === 'getSiteNavsDocument'` should be something like `formConfig.id === 'content/navs/mynav.md'`
|
|
330
|
-
|
|
331
|
-
If you're experiencing any issues with contextual editing, you can disable this flag for now by specifying `cms.flags.set('use-unstable-formify', false)`.
|
|
332
|
-
|
|
333
|
-
## 0.66.10
|
|
334
|
-
|
|
335
|
-
### Patch Changes
|
|
336
|
-
|
|
337
|
-
- 39a8c4f7d: Fix issue with unstableFormify where `Document` interface fields were not being formified properly
|
|
338
|
-
- ec28a129b: Update to tina admin to use the frontend schema
|
|
339
|
-
- a28b787c5: With the rich-text editor, inserting a soft-break (`shift+enter`), this will now result in a `<br>` tag being inserted. Note that this will save the markdown with a backslash to indicate line break (instead of multiple empty spaces):
|
|
340
|
-
|
|
341
|
-
```markdown
|
|
342
|
-
123 Abc St\
|
|
343
|
-
Charlottetown, PEI
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
- 93363dfc2: Prevent error on reset when nested blocks have changed in unstable formify hook
|
|
347
|
-
- abf25c673: The schema can now to used on the frontend (optional for now but will be the main path moving forward).
|
|
348
|
-
|
|
349
|
-
### How to migrate.
|
|
350
|
-
|
|
351
|
-
If you gone though the `tinacms init` process there should be a file called `.tina/components/TinaProvider`. In that file you can import the schema from `schema.ts` and add it to the TinaCMS wrapper component.
|
|
352
|
-
|
|
353
|
-
```tsx
|
|
354
|
-
import TinaCMS from 'tinacms'
|
|
355
|
-
import schema, { tinaConfig } from '../schema.ts'
|
|
356
|
-
|
|
357
|
-
// Importing the TinaProvider directly into your page will cause Tina to be added to the production bundle.
|
|
358
|
-
// Instead, import the tina/provider/index default export to have it dynamially imported in edit-moode
|
|
359
|
-
/**
|
|
360
|
-
*
|
|
361
|
-
* @private Do not import this directly, please import the dynamic provider instead
|
|
362
|
-
*/
|
|
363
|
-
const TinaProvider = ({ children }) => {
|
|
364
|
-
return (
|
|
365
|
-
<TinaCMS {...tinaConfig} schema={schema}>
|
|
366
|
-
{children}
|
|
367
|
-
</TinaCMS>
|
|
368
|
-
)
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
export default TinaProvider
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
- 591640db0: Fixes a bug with `breadcrumbs` to account for subfolders (instead of just the `filename`) and allows Documents to be created and updated within subfolders.
|
|
375
|
-
|
|
376
|
-
Before this fix, `breadcrumbs` was only the `basename` of the file minus the `extension`. So `my-folder-a/my-folder-b/my-file.md` would have `breadcrumbs` of `['my-file']`. With this change, `breadcrumbs` will be `['my-folder-a','my-folder-b','my-file']` (leaving out the `content/<collection>`).
|
|
377
|
-
|
|
378
|
-
- 875779ac6: Don't attempt to formify nodes which don't have data fields (ie. ...on Node)
|
|
379
|
-
- e8b0de1f7: Add `parentTypename` to fields to allow us to disambiguate between fields which have the same field names but different types. Example, an event from field name of `blocks.0.title` could belong to a `Cta` block or a `Hero` block, both of which have a `title` field.
|
|
380
|
-
- Updated dependencies [429d8e93e]
|
|
381
|
-
- Updated dependencies [6c517b5da]
|
|
382
|
-
- Updated dependencies [e81cf8867]
|
|
383
|
-
- Updated dependencies [abf25c673]
|
|
384
|
-
- Updated dependencies [801f39f62]
|
|
385
|
-
- Updated dependencies [0e270d878]
|
|
386
|
-
- Updated dependencies [e8b0de1f7]
|
|
387
|
-
- @tinacms/sharedctx@0.1.1
|
|
388
|
-
- @tinacms/toolkit@0.56.19
|
|
389
|
-
- @tinacms/schema-tools@0.0.2
|
|
390
|
-
|
|
391
|
-
## 0.66.9
|
|
392
|
-
|
|
393
|
-
### Patch Changes
|
|
394
|
-
|
|
395
|
-
- 91d5a6073: Allow "." in file names
|
|
396
|
-
- 11d55f441: Add experimental useGraphQLForms hook
|
|
397
|
-
- f41bd62ea: Ensure client-side Tina code only runs on the browser. Without this check, we'd see a server/client mismatch like:
|
|
398
|
-
|
|
399
|
-
```
|
|
400
|
-
warning.js:33 Warning: Expected server HTML to contain a matching <div> in <body>.
|
|
401
|
-
```
|
|
402
|
-
|
|
403
|
-
- Updated dependencies [e9a0c82cf]
|
|
404
|
-
- Updated dependencies [d4fdeaa9f]
|
|
405
|
-
- Updated dependencies [ed85f2594]
|
|
406
|
-
- Updated dependencies [d86e515ba]
|
|
407
|
-
- Updated dependencies [db0dab1d4]
|
|
408
|
-
- @tinacms/toolkit@0.56.18
|
|
409
|
-
|
|
410
|
-
## 0.66.8
|
|
411
|
-
|
|
412
|
-
### Patch Changes
|
|
413
|
-
|
|
414
|
-
- 4923a2d66: Checks isAuthenticated() before making requests to the GraphQL client
|
|
415
|
-
- Updated dependencies [106549814]
|
|
416
|
-
- Updated dependencies [4923a2d66]
|
|
417
|
-
- Updated dependencies [a07ff39bb]
|
|
418
|
-
- @tinacms/toolkit@0.56.17
|
|
419
|
-
|
|
420
|
-
## 0.66.7
|
|
421
|
-
|
|
422
|
-
### Patch Changes
|
|
423
|
-
|
|
424
|
-
- bfada9a09: Used success messaging when creating/updating a Document in the CMS
|
|
425
|
-
|
|
426
|
-
## 0.66.6
|
|
427
|
-
|
|
428
|
-
### Patch Changes
|
|
429
|
-
|
|
430
|
-
- becff2a0b: Adds define schema to the `tinacms` package (instead of `@tinacms/cli`. This is done in preparation of the extending tina work)
|
|
431
|
-
- ae1a5a58f: Sets `tina-admin` to default to `true`
|
|
432
|
-
- 3ed4c8727: Add flag for experimental new formify logic
|
|
433
|
-
- 5535a9970: Switches to using HashRouter for Admin
|
|
434
|
-
- 3ff1de06a: Upgrade to Tailwind 3
|
|
435
|
-
- fbdb7be01: Adds a defineConfig function to allow type hints for the tinacms config
|
|
436
|
-
- 24f8b057f: Handles errors better in the CMS
|
|
437
|
-
- Updated dependencies [ae1a5a58f]
|
|
438
|
-
- Updated dependencies [5535a9970]
|
|
439
|
-
- Updated dependencies [3ff1de06a]
|
|
440
|
-
- Updated dependencies [022ccd389]
|
|
441
|
-
- Updated dependencies [24f8b057f]
|
|
442
|
-
- @tinacms/toolkit@0.56.16
|
|
443
|
-
- @tinacms/sharedctx@0.1.0
|
|
444
|
-
|
|
445
|
-
## 0.66.5
|
|
446
|
-
|
|
447
|
-
### Patch Changes
|
|
448
|
-
|
|
449
|
-
- 43c834565: Adds an activity indicator throughout Admin
|
|
450
|
-
- 53a4550db: Allows RouteMapping to be dynamically imported
|
|
451
|
-
- 731451bee: Adjust the JWT token refresh logic to refresh tokens _before_ they expire.
|
|
452
|
-
- e102d7438: Updated auth modal to use toolkit button components
|
|
453
|
-
- Updated dependencies [43c834565]
|
|
454
|
-
- @tinacms/toolkit@0.56.15
|
|
455
|
-
|
|
456
|
-
## 0.66.4
|
|
457
|
-
|
|
458
|
-
### Patch Changes
|
|
459
|
-
|
|
460
|
-
- cc5c8431d: Remove console.log
|
|
461
|
-
- Updated dependencies [af9f6c2c2]
|
|
462
|
-
- Updated dependencies [2e14cda5e]
|
|
463
|
-
- Updated dependencies [3d4c52a19]
|
|
464
|
-
- @tinacms/toolkit@0.56.14
|
|
465
|
-
|
|
466
|
-
## 0.66.3
|
|
467
|
-
|
|
468
|
-
### Patch Changes
|
|
469
|
-
|
|
470
|
-
- Updated dependencies [e41b709ce]
|
|
471
|
-
- @tinacms/toolkit@0.56.13
|
|
472
|
-
|
|
473
|
-
## 0.66.2
|
|
474
|
-
|
|
475
|
-
### Patch Changes
|
|
476
|
-
|
|
477
|
-
- 102628c7f: Fixes admin page wrapper scrolling
|
|
478
|
-
- 55cb0c5ec: Updates the relativePath field for clarity
|
|
479
|
-
- 9e77273d2: use collection name as fallback for label
|
|
480
|
-
- Updated dependencies [8c18edd5c]
|
|
481
|
-
- Updated dependencies [0773f6486]
|
|
482
|
-
- Updated dependencies [d8cd60f65]
|
|
483
|
-
- Updated dependencies [9e77273d2]
|
|
484
|
-
- Updated dependencies [63a74aece]
|
|
485
|
-
- @tinacms/toolkit@0.56.12
|
|
486
|
-
|
|
487
|
-
## 0.66.1
|
|
488
|
-
|
|
489
|
-
### Patch Changes
|
|
490
|
-
|
|
491
|
-
- 3bba1817d: Integrates Chrome Components with TinaAdmin
|
|
492
|
-
- Updated dependencies [3bba1817d]
|
|
493
|
-
- Updated dependencies [415c03d25]
|
|
494
|
-
- @tinacms/toolkit@0.56.11
|
|
495
|
-
- @tinacms/sharedctx@0.1.0
|
|
496
|
-
|
|
497
|
-
## 0.66.0
|
|
498
|
-
|
|
499
|
-
### Minor Changes
|
|
500
|
-
|
|
501
|
-
- d6f46a9f9: fix: When passing in queries into the root TinaCMS container, don't overwrite the data prop on an empty query
|
|
502
|
-
|
|
503
|
-
### Patch Changes
|
|
504
|
-
|
|
505
|
-
- Updated dependencies [37286858e]
|
|
506
|
-
- @tinacms/toolkit@0.56.10
|
|
507
|
-
|
|
508
|
-
## 0.65.3
|
|
509
|
-
|
|
510
|
-
### Patch Changes
|
|
511
|
-
|
|
512
|
-
- 0c4456c11: fix: Send update to useTina hook on the initial isLoading change
|
|
513
|
-
|
|
514
|
-
## 0.65.2
|
|
515
|
-
|
|
516
|
-
### Patch Changes
|
|
517
|
-
|
|
518
|
-
- a9b385b01: Fix mutation string for document creation
|
|
519
|
-
|
|
520
|
-
## 0.65.1
|
|
521
|
-
|
|
522
|
-
### Patch Changes
|
|
523
|
-
|
|
524
|
-
- 68284198a: fix: use user-specific document creator callback
|
|
525
|
-
- ccf4dcbd4: chore: Export low-level data provider from "tinacms", for the playground and other sandboz environments
|
|
526
|
-
- f2431c031: Fix type for code_block TinaMarkdown element
|
|
527
|
-
|
|
528
|
-
## 0.65.0
|
|
529
|
-
|
|
530
|
-
### Minor Changes
|
|
531
|
-
|
|
532
|
-
- 792f47251: useTina hook for page-level form registration
|
|
533
|
-
|
|
534
|
-
### Patch Changes
|
|
535
|
-
|
|
536
|
-
- 6a50a1368: Updates the look and feel of the Tina Sidebar
|
|
537
|
-
- 239382619: Introduces TinaAdminApi and consolidates types
|
|
538
|
-
- Updated dependencies [8ad8f03fd]
|
|
539
|
-
- Updated dependencies [6a50a1368]
|
|
540
|
-
- Updated dependencies [792f47251]
|
|
541
|
-
- @tinacms/toolkit@0.56.9
|
|
542
|
-
- @tinacms/sharedctx@0.1.0
|
|
543
|
-
|
|
544
|
-
## 0.64.2
|
|
545
|
-
|
|
546
|
-
### Patch Changes
|
|
547
|
-
|
|
548
|
-
- Updated dependencies [7006b38ea]
|
|
549
|
-
- @tinacms/toolkit@0.56.8
|
|
550
|
-
|
|
551
|
-
## 0.64.1
|
|
552
|
-
|
|
553
|
-
### Patch Changes
|
|
554
|
-
|
|
555
|
-
- 28010a026: Adds tailwind styles to Admin Layout
|
|
556
|
-
- Updated dependencies [e8ca82899]
|
|
557
|
-
- @tinacms/toolkit@0.56.7
|
|
558
|
-
|
|
559
|
-
## 0.64.0
|
|
560
|
-
|
|
561
|
-
### Minor Changes
|
|
562
|
-
|
|
563
|
-
- 4a3990c7e: Cloudinary media store now serves images over `https` by default. This can now be configured though the handler provided.
|
|
564
|
-
|
|
565
|
-
To revert to the old behavior:
|
|
566
|
-
|
|
567
|
-
```ts
|
|
568
|
-
export default createMediaHandler(
|
|
569
|
-
{
|
|
570
|
-
// ...
|
|
571
|
-
},
|
|
572
|
-
{
|
|
573
|
-
useHttps: false,
|
|
574
|
-
}
|
|
575
|
-
)
|
|
576
|
-
```
|
|
577
|
-
|
|
578
|
-
The default for `useHttps` is `true`
|
|
579
|
-
|
|
580
|
-
## 0.63.0
|
|
581
|
-
|
|
582
|
-
### Minor Changes
|
|
583
|
-
|
|
584
|
-
- 3897ec5d9: Replace `branch`, `clientId`, `isLocalClient` props with single `apiURL`. When working locally, this should be `http://localhost:4001/graphql`. For Tina Cloud, use `https://content.tinajs.io/content/<my-client-id>/github/<my-branch>`
|
|
585
|
-
|
|
586
|
-
```tsx
|
|
587
|
-
// _app.tsx
|
|
588
|
-
// ...
|
|
589
|
-
<TinaCMS apiURL={process.env.NEXT_PUBLIC_TINA_API_URL} {...pageProps}>
|
|
590
|
-
{livePageProps => <Component {...livePageProps} />}
|
|
591
|
-
</TinaCMS>
|
|
592
|
-
```
|
|
593
|
-
|
|
594
|
-
DEPRECATION NOTICE: `branch`, `clientId`, `isLocalClient` props will be deprecated in the future
|
|
595
|
-
|
|
596
|
-
### Patch Changes
|
|
597
|
-
|
|
598
|
-
- 96e4a77e2: Fixed types
|
|
599
|
-
- b5c22503a: Changes messaging on login page for TinaAdmin when in local-mode
|
|
600
|
-
- Updated dependencies [60f939f34]
|
|
601
|
-
- @tinacms/toolkit@0.56.6
|
|
602
|
-
|
|
603
|
-
## 0.62.0
|
|
604
|
-
|
|
605
|
-
### Minor Changes
|
|
606
|
-
|
|
607
|
-
- 70da62fe8: deprecated the use of `getStaticPropsForTina`
|
|
608
|
-
|
|
609
|
-
### Patch Changes
|
|
610
|
-
|
|
611
|
-
- 0afa75df1: 2342 - [TinaAdmin] Truncates the `filename` column for the Document List View
|
|
612
|
-
- 7dafce89d: Fixed issue where content creator was invalid
|
|
613
|
-
- 3de8c6165: Enabled branch creation in branch switcher
|
|
614
|
-
- fee183f8f: add "switch to default branch" recover option to error boundary
|
|
615
|
-
- 5c070a83f: feat: Add UI banner for when in localMode
|
|
616
|
-
- Updated dependencies [ddf81a4fd]
|
|
617
|
-
- Updated dependencies [20260a82d]
|
|
618
|
-
- Updated dependencies [0370147fb]
|
|
619
|
-
- Updated dependencies [3de8c6165]
|
|
620
|
-
- Updated dependencies [2eaad97bf]
|
|
621
|
-
- Updated dependencies [5c070a83f]
|
|
622
|
-
- @tinacms/toolkit@0.56.5
|
|
623
|
-
|
|
624
|
-
## 0.61.1
|
|
625
|
-
|
|
626
|
-
### Patch Changes
|
|
627
|
-
|
|
628
|
-
- Updated dependencies [2c7718636]
|
|
629
|
-
- @tinacms/toolkit@0.56.4
|
|
630
|
-
|
|
631
|
-
## 0.61.0
|
|
632
|
-
|
|
633
|
-
### Minor Changes
|
|
634
|
-
|
|
635
|
-
- 229feda1d: add .nvmrc file for setting preferred node version
|
|
636
|
-
|
|
637
|
-
## 0.60.3
|
|
638
|
-
|
|
639
|
-
### Patch Changes
|
|
640
|
-
|
|
641
|
-
- 4adaf15af: Fix types which weren't included in previous patch
|
|
642
|
-
|
|
643
|
-
## 0.60.2
|
|
644
|
-
|
|
645
|
-
### Patch Changes
|
|
646
|
-
|
|
647
|
-
- 816271d03: Ensure login/logout pages work when admin flag is disabled
|
|
648
|
-
|
|
649
|
-
## 0.60.1
|
|
650
|
-
|
|
651
|
-
### Patch Changes
|
|
652
|
-
|
|
653
|
-
- Updated dependencies [4700d7ae4]
|
|
654
|
-
- @tinacms/toolkit@0.56.3
|
|
655
|
-
|
|
656
|
-
## 0.60.0
|
|
657
|
-
|
|
658
|
-
### Minor Changes
|
|
659
|
-
|
|
660
|
-
- 75974d0a4: Updates the tina cloud client to do id_token & access_token refreshes when needed
|
|
661
|
-
|
|
662
|
-
### Patch Changes
|
|
663
|
-
|
|
664
|
-
- 88c209b45: Throw when Tina Cloud responds with non 200 code
|
|
665
|
-
- dcdf1ecf0: Updates `react-router` to `v6` for `TinaAdmin`
|
|
666
|
-
- 47d126029: Fix support of objects in a list for MDX templates
|
|
667
|
-
- Updated dependencies [bc4699d2b]
|
|
668
|
-
- @tinacms/toolkit@0.56.2
|
|
669
|
-
|
|
670
|
-
## 0.59.1
|
|
671
|
-
|
|
672
|
-
### Patch Changes
|
|
673
|
-
|
|
674
|
-
- ed9d48abc: Swaps starter's old admin for the new one
|
|
675
|
-
- f6876d30f: Alter empty sidebar message to be more specific to auto-generating logic
|
|
676
|
-
- Updated dependencies [f6876d30f]
|
|
677
|
-
- Updated dependencies [92268fc85]
|
|
678
|
-
- @tinacms/toolkit@0.56.1
|
|
679
|
-
|
|
680
|
-
## 0.59.0
|
|
681
|
-
|
|
682
|
-
### Minor Changes
|
|
683
|
-
|
|
684
|
-
- df3030990: Add basic branch switcher
|
|
685
|
-
|
|
686
|
-
### Patch Changes
|
|
687
|
-
|
|
688
|
-
- 9ecceb59f: Always include `collection` for TinaAdmin `createDocument()` and `updateDocument()`
|
|
689
|
-
- Updated dependencies [df3030990]
|
|
690
|
-
- @tinacms/toolkit@0.56.0
|
|
691
|
-
|
|
692
|
-
## 0.58.1
|
|
693
|
-
|
|
694
|
-
### Patch Changes
|
|
695
|
-
|
|
696
|
-
- e6995cfcb: Adds README for TinaAdmin
|
|
697
|
-
- 60729f60c: Adds a `reference` field
|
|
698
|
-
- 19e02829f: Add ability to control plugin layout for global plugins from formify
|
|
699
|
-
- Updated dependencies [60729f60c]
|
|
700
|
-
- @tinacms/toolkit@0.55.4
|
|
701
|
-
|
|
702
|
-
## 0.58.0
|
|
703
|
-
|
|
704
|
-
### Minor Changes
|
|
705
|
-
|
|
706
|
-
- d1ed404ba: Add support for auto-generated SDK for type-safe data fetching
|
|
707
|
-
|
|
708
|
-
### Patch Changes
|
|
709
|
-
|
|
710
|
-
- 138ceb8c4: Clean up dependencies
|
|
711
|
-
- 0417e3750: Adds RouteMapperPlugin and FormMetaPlugin
|
|
712
|
-
- Updated dependencies [138ceb8c4]
|
|
713
|
-
- Updated dependencies [0417e3750]
|
|
714
|
-
- Updated dependencies [d9f37ea7e]
|
|
715
|
-
- @tinacms/toolkit@0.55.3
|
|
716
|
-
|
|
717
|
-
## 0.57.4
|
|
718
|
-
|
|
719
|
-
### Patch Changes
|
|
720
|
-
|
|
721
|
-
- 4b7795612: Adds support for collection.templates to TinaAdmin
|
|
722
|
-
- a39ddc611: update media store to load only when in edit mode
|
|
723
|
-
- 1096fe3e4: Ensure forms unmount properly when `useGraphQLForms` unmounts
|
|
724
|
-
|
|
725
|
-
## 0.57.3
|
|
726
|
-
|
|
727
|
-
### Patch Changes
|
|
728
|
-
|
|
729
|
-
- Updated dependencies [2724c48c0]
|
|
730
|
-
- @tinacms/toolkit@0.55.2
|
|
731
|
-
|
|
732
|
-
## 0.57.2
|
|
733
|
-
|
|
734
|
-
### Patch Changes
|
|
735
|
-
|
|
736
|
-
- 7849c1233: Fix styles on panel
|
|
737
|
-
|
|
738
|
-
## 0.57.1
|
|
739
|
-
|
|
740
|
-
### Patch Changes
|
|
741
|
-
|
|
742
|
-
- 9c0d48e09: Fix console errors for mdx editor
|
|
743
|
-
- Updated dependencies [9c0d48e09]
|
|
744
|
-
- @tinacms/toolkit@0.55.1
|
|
745
|
-
|
|
746
|
-
## 0.57.0
|
|
747
|
-
|
|
748
|
-
### Minor Changes
|
|
749
|
-
|
|
750
|
-
- b99baebf1: Add rich-text editor based on mdx, bump React dependency requirement to 16.14
|
|
751
|
-
|
|
752
|
-
### Patch Changes
|
|
753
|
-
|
|
754
|
-
- 891623c7c: Adds support for List and Update to TinaAdmin
|
|
755
|
-
- d5e3adf37: Adds support for Log In & Log Out to TinaAdmin
|
|
756
|
-
- Updated dependencies [b99baebf1]
|
|
757
|
-
- @tinacms/toolkit@0.55.0
|
|
758
|
-
|
|
759
|
-
## 0.56.3
|
|
760
|
-
|
|
761
|
-
### Patch Changes
|
|
762
|
-
|
|
763
|
-
- 67df49220: Allow dashes in filenames for content creator
|
|
764
|
-
- Updated dependencies [b961c7417]
|
|
765
|
-
- @tinacms/toolkit@0.54.1
|
|
766
|
-
|
|
767
|
-
## 0.56.2
|
|
768
|
-
|
|
769
|
-
### Patch Changes
|
|
770
|
-
|
|
771
|
-
- 84a86358f: Fix bug which reset the form onChange for GraphQL forms
|
|
772
|
-
|
|
773
|
-
## 0.56.1
|
|
774
|
-
|
|
775
|
-
### Patch Changes
|
|
776
|
-
|
|
777
|
-
- a05aa61bd: Fix issue where forms weren't being removed when the page unmounted
|
|
778
|
-
- @tinacms/toolkit@0.54.0
|
|
779
|
-
|
|
780
|
-
## 0.56.0
|
|
781
|
-
|
|
782
|
-
### Minor Changes
|
|
783
|
-
|
|
784
|
-
- c6e2dd69a: Updated Wrapper component so that it can be build without loading the media store
|
|
785
|
-
- 3f9cad860: A warning message is added to warn the user if they are using a staticRequest at run time.
|
|
786
|
-
|
|
787
|
-
### Patch Changes
|
|
788
|
-
|
|
789
|
-
- 2908f8176: Fixes an issue where nested reference fields weren't updated properly when their values changed.
|
|
790
|
-
- 08ef183a0: Allow tina.io URLs to be supplied as a a prop:
|
|
791
|
-
|
|
792
|
-
```tsx
|
|
793
|
-
<TinaEditProvider
|
|
794
|
-
editMode={
|
|
795
|
-
<TinaCMS
|
|
796
|
-
branch="main"
|
|
797
|
-
clientId={NEXT_PUBLIC_TINA_CLIENT_ID}
|
|
798
|
-
tinaioConfig={{
|
|
799
|
-
baseUrl: "some-base.io"
|
|
800
|
-
}}
|
|
801
|
-
//...
|
|
802
|
-
```
|
|
803
|
-
|
|
804
|
-
Or just the identity/content URLs:
|
|
805
|
-
|
|
806
|
-
```tsx
|
|
807
|
-
<TinaEditProvider
|
|
808
|
-
editMode={
|
|
809
|
-
<TinaCMS
|
|
810
|
-
branch="main"
|
|
811
|
-
clientId={NEXT_PUBLIC_TINA_CLIENT_ID}
|
|
812
|
-
tinaioConfig={{
|
|
813
|
-
identityApiUrl: "https://some-base.io"
|
|
814
|
-
// AND/OR
|
|
815
|
-
contentApiUrl: "https://content.some-base.io"
|
|
816
|
-
}}
|
|
817
|
-
//...
|
|
818
|
-
```
|
|
819
|
-
|
|
820
|
-
- Updated dependencies [9213d5608]
|
|
821
|
-
- Updated dependencies [b59f23295]
|
|
822
|
-
- Updated dependencies [a419056b6]
|
|
823
|
-
- Updated dependencies [ded8dfbee]
|
|
824
|
-
- Updated dependencies [5df9fe543]
|
|
825
|
-
- Updated dependencies [9d68b058f]
|
|
826
|
-
- Updated dependencies [91cebe5bc]
|
|
827
|
-
- @tinacms/toolkit@0.54.0
|
|
828
|
-
|
|
829
|
-
## 0.55.2
|
|
830
|
-
|
|
831
|
-
### Patch Changes
|
|
832
|
-
|
|
833
|
-
- Updated dependencies [7b149a4e7]
|
|
834
|
-
- Updated dependencies [906d72c50]
|
|
835
|
-
- @tinacms/toolkit@0.53.0
|
|
836
|
-
|
|
837
|
-
## 0.55.1
|
|
838
|
-
|
|
839
|
-
### Patch Changes
|
|
840
|
-
|
|
841
|
-
- 9b27192fe: Build packages with new scripting, which includes preliminary support for ES modules.
|
|
842
|
-
- Updated dependencies [9b27192fe]
|
|
843
|
-
- @tinacms/toolkit@0.52.3
|
|
844
|
-
|
|
845
|
-
## 0.55.0
|
|
846
|
-
|
|
847
|
-
### Minor Changes
|
|
848
|
-
|
|
849
|
-
- d0e896561: Provide better error boundary message and visual affordances to user in <ErrorBoundary />.
|
|
850
|
-
- 27c1fd382: Adds a close button to the Tina Cloud auth model so a user is not suck in edit mode.
|
|
851
|
-
|
|
852
|
-
## 0.54.4
|
|
853
|
-
|
|
854
|
-
### Patch Changes
|
|
855
|
-
|
|
856
|
-
- Updated dependencies [6b1cbf916]
|
|
857
|
-
- @tinacms/toolkit@0.52.2
|
|
858
|
-
|
|
859
|
-
## 0.54.3
|
|
860
|
-
|
|
861
|
-
### Patch Changes
|
|
862
|
-
|
|
863
|
-
- Updated dependencies [4de977f63]
|
|
864
|
-
- @tinacms/toolkit@0.52.1
|
|
865
|
-
|
|
866
|
-
## 0.54.2
|
|
867
|
-
|
|
868
|
-
### Patch Changes
|
|
869
|
-
|
|
870
|
-
- d1ef2545f: Ensure `undefined` values aren't passed back from getStaticPropsForTina
|
|
871
|
-
|
|
872
|
-
## 0.54.1
|
|
873
|
-
|
|
874
|
-
### Patch Changes
|
|
875
|
-
|
|
876
|
-
- Updated dependencies [b4f5e973f]
|
|
877
|
-
- @tinacms/toolkit@0.52.0
|
|
878
|
-
|
|
879
|
-
## 0.54.0
|
|
880
|
-
|
|
881
|
-
### Minor Changes
|
|
882
|
-
|
|
883
|
-
- 3af2c075c: Loading state now resets in useGraphqlForms
|
|
884
|
-
- 515fc3ffd: Don't treat cloud client with missing client-id as local client
|
|
885
|
-
|
|
886
|
-
### Patch Changes
|
|
887
|
-
|
|
888
|
-
- Updated dependencies [634524925]
|
|
889
|
-
- @tinacms/toolkit@0.51.0
|
|
890
|
-
|
|
891
|
-
## 0.53.0
|
|
892
|
-
|
|
893
|
-
### Minor Changes
|
|
894
|
-
|
|
895
|
-
- 1b8bb5d0f: fix: don't throw error on missing client id
|
|
896
|
-
|
|
897
|
-
### Patch Changes
|
|
898
|
-
|
|
899
|
-
- f863d8be8: Fixes an issue where new documents returned a 404 when on a hosted deployement. Instead, `getStaticPropsForTina` will catch and return an empty object for the data key. This allows us to replace it with real data client-side.
|
|
900
|
-
|
|
901
|
-
## 0.52.0
|
|
902
|
-
|
|
903
|
-
### Minor Changes
|
|
904
|
-
|
|
905
|
-
- 8a20437c: Expose a createGlobalForm function in formifyCallback that creates a screen plugin
|
|
906
|
-
|
|
907
|
-
### Patch Changes
|
|
908
|
-
|
|
909
|
-
- d31df43d: Handles situations where `currentFields` is not an Array
|
|
910
|
-
- 271a72d7: Use collection label (defined in schema.ts) as form label
|
|
911
|
-
|
|
912
|
-
## 0.51.0
|
|
913
|
-
|
|
914
|
-
### Minor Changes
|
|
915
|
-
|
|
916
|
-
- 6dfbfed0: Added variables to useGraphqlForms dependencies in order to update data when variables change
|
|
917
|
-
|
|
918
|
-
### Patch Changes
|
|
919
|
-
|
|
920
|
-
- Updated dependencies [e074d555]
|
|
921
|
-
- @tinacms/toolkit@0.50.1
|
|
922
|
-
|
|
923
|
-
## 0.50.1
|
|
924
|
-
|
|
925
|
-
### Patch Changes
|
|
926
|
-
|
|
927
|
-
- 3f05aad1: Fix race condition where `values` was taking longer to update in React state, making the data syncing run too early
|
|
928
|
-
- 76e3a8a7: Properly uses formifyCallback and documentCreatorCallback
|
|
929
|
-
|
|
930
|
-
## 0.50.0
|
|
931
|
-
|
|
932
|
-
### Minor Changes
|
|
933
|
-
|
|
934
|
-
- 7f3c8c1a: # 🔧 Changes coming to TinaCMS ⚙️
|
|
935
|
-
|
|
936
|
-
👋 You may have noticed we've been hard at-work lately building out a more opinionated approach to TinaCMS. To that end, we've settled around a few key points we'd like to announce. To see the work in progress, check out the [main](https://github.com/tinacms/tinacms/tree/main) branch, which will become the primary branch soon.
|
|
937
|
-
|
|
938
|
-
## Consolidating @tinacms packages in to @tinacms/toolkit
|
|
939
|
-
|
|
940
|
-
By nature, Tina relies heavily on React context, and the dependency mismatches from over-modularizing our toolkit has led to many bugs related to missing context. To fix this, we'll be consolidating nearly every package in the @tinacms scope to a single package called `@tinacms/toolkit`
|
|
941
|
-
|
|
942
|
-
We'll also be rolling out esm support as it's now much easier to address build improvements
|
|
943
|
-
|
|
944
|
-
## A more focused tinacms package
|
|
945
|
-
|
|
946
|
-
The `tinacms` package now comes baked-in with APIs for working with the TinaCMS GraphQL API. Because `@tinacms/toolkit` now encompasses everything you'd need to build your own CMS integration, we're repurposing the `tinacms` package to more accurately reflect the "batteries-included" approach.
|
|
947
|
-
|
|
948
|
-
If you haven't been introduced, the GraphQL API is a Git-backed CMS which we'll be leaning into more in the future. With a generous free tier and direct syncing with Github its something we're really excited to push forward. Sign up for free here
|
|
949
|
-
Note: tinacms still exports the same APIs, but we'll gradually start moving the backend-agnostic tools to @tinacms/toolkit.
|
|
950
|
-
|
|
951
|
-
## Consolidating the tina-graphql-gateway repo
|
|
952
|
-
|
|
953
|
-
The tina-graphql-gateway repo will be absorbed into this one. If you've been working with our GraphQL APIs you'll need to follow our migration guide.
|
|
954
|
-
|
|
955
|
-
## Moving from Lerna to Yarn PNP
|
|
956
|
-
|
|
957
|
-
We've had success with Yarn 2 and PNP in other monorepos, if you're a contributor you'll notice some updates to the DX, which should hopefully result in a smoother experience.
|
|
958
|
-
|
|
959
|
-
## FAQ
|
|
960
|
-
|
|
961
|
-
### What about other backends?
|
|
962
|
-
|
|
963
|
-
The `@tinacms/toolkit` isn't going anywhere. And if you're using packages like `react-tinacms-strapi` or r`eact-tinacms-github` with success, that won't change much, they'll just be powered by `@tinacms/toolkit` under the hood.
|
|
964
|
-
|
|
965
|
-
### Do I need to do anything?
|
|
966
|
-
|
|
967
|
-
We'll be bumping all packages to `0.50.0` to reflect the changes. If you're using @tincams scoped packages those won't receive the upgrade. Unscoped packages like `react-tinacms-editor` will be upgraded, and should be bumped to 0.50.0 as well.
|
|
968
|
-
When we move to `1.0.0` we'll be pushing internal APIs to `@tinacms/toolkit`, so that's the long-term location of
|
|
969
|
-
|
|
970
|
-
### Will you continue to patch older versions?
|
|
971
|
-
|
|
972
|
-
We'll continue to make security patches, however major bug fixes will likely not see any updates. Keep in mind that `@tinacms/toolkit` will continue to be developed.
|
|
973
|
-
|
|
974
|
-
### Patch Changes
|
|
975
|
-
|
|
976
|
-
- 434d61d4: Use the default import from 'tinacms' to set up the Tina context:
|
|
977
|
-
|
|
978
|
-
```jsx
|
|
979
|
-
// pages/_app.js
|
|
980
|
-
import TinaCMS from 'tinacms'
|
|
981
|
-
|
|
982
|
-
const App = ({ Component, pageProps }) => {
|
|
983
|
-
return (
|
|
984
|
-
<TinaCMS
|
|
985
|
-
// Required: The query from your `getStaticProps` request
|
|
986
|
-
query={pageProps.query}
|
|
987
|
-
// Required: The variables from your `getStaticProps` request
|
|
988
|
-
variables={pageProps.variables} // Variables used in your query
|
|
989
|
-
// Required: The data from your `getStaticProps` request
|
|
990
|
-
data={pageProps.data}
|
|
991
|
-
// Optional: Set to true when working with the local API
|
|
992
|
-
isLocalClient={true}
|
|
993
|
-
// Optional: When using Tina Cloud, specify the git branch
|
|
994
|
-
branch="main"
|
|
995
|
-
// Optional: Your identifier when connecting to Tina Cloud
|
|
996
|
-
clientId="<some-id-from-tina-cloud>"
|
|
997
|
-
// Optional: A callback for altering the CMS object if needed
|
|
998
|
-
cmsCallback={cms => {}}
|
|
999
|
-
// Optional: A callback for altering the form generation if needed
|
|
1000
|
-
formifyCallback={args => {}}
|
|
1001
|
-
// Optional: A callback for altering the document creator plugin
|
|
1002
|
-
documentCreatorCallback={args => {}}
|
|
1003
|
-
>
|
|
1004
|
-
{livePageProps => <Component {...livePageProps} />}
|
|
1005
|
-
</TinaCMS>
|
|
1006
|
-
)
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
export default App
|
|
1010
|
-
```
|
|
1011
|
-
|
|
1012
|
-
To load TinaCMS dynamically, use the EditState context:
|
|
1013
|
-
|
|
1014
|
-
```jsx
|
|
1015
|
-
// pages/_app.js
|
|
1016
|
-
import dynamic from 'next/dynamic'
|
|
1017
|
-
import { TinaEditProvider } from 'tinacms/dist/edit-state'
|
|
1018
|
-
const TinaCMS = dynamic(() => import('tinacms'), { ssr: false })
|
|
1019
|
-
|
|
1020
|
-
const App({ Component, pageProps }) {
|
|
1021
|
-
return (
|
|
1022
|
-
<>
|
|
1023
|
-
<TinaEditProvider
|
|
1024
|
-
editMode={
|
|
1025
|
-
<TinaCMS {...pageProps}>
|
|
1026
|
-
{livePageProps => <Component {...livePageProps} />}
|
|
1027
|
-
</TinaCMS>
|
|
1028
|
-
}
|
|
1029
|
-
>
|
|
1030
|
-
<Component {...pageProps} />
|
|
1031
|
-
</TinaEditProvider>
|
|
1032
|
-
</>
|
|
1033
|
-
)
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
export default App
|
|
1037
|
-
```
|
|
1038
|
-
|
|
1039
|
-
- Updated dependencies [7f3c8c1a]
|
|
1040
|
-
- @tinacms/toolkit@0.44.0
|
|
1041
|
-
|
|
1042
|
-
## 0.4.0
|
|
1043
|
-
|
|
1044
|
-
### Minor Changes
|
|
1045
|
-
|
|
1046
|
-
- ab4e388b: Updates where LoadingDots is imported from
|
|
1047
|
-
- 7351d92f: # Define schema changes
|
|
1048
|
-
|
|
1049
|
-
We're going to be leaning on a more _primitive_ concept of how types are defined with Tina, and in doing so will be introducing some breaking changes to the way schemas are defined. Read the detailed [RFC discussion](https://github.com/tinacms/rfcs/pull/18) for more on this topic, specifically the [latter portions](https://github.com/tinacms/rfcs/pull/18#issuecomment-805400313) of the discussion.
|
|
1050
|
-
|
|
1051
|
-
## Collections now accept a `fields` _or_ `templates` property
|
|
1052
|
-
|
|
1053
|
-
You can now provide `fields` instead of `templates` for your collection, doing so will result in a more straightforward schema definition:
|
|
1054
|
-
|
|
1055
|
-
```js
|
|
1056
|
-
{
|
|
1057
|
-
collections: [
|
|
1058
|
-
{
|
|
1059
|
-
name: 'post',
|
|
1060
|
-
label: 'Post',
|
|
1061
|
-
path: 'content/posts',
|
|
1062
|
-
fields: [
|
|
1063
|
-
{
|
|
1064
|
-
name: 'title',
|
|
1065
|
-
label: 'Title',
|
|
1066
|
-
type: 'string', // read on below to learn more about _type_ changes
|
|
1067
|
-
},
|
|
1068
|
-
],
|
|
1069
|
-
// defining `fields` and `templates` would result in a compilation error
|
|
1070
|
-
},
|
|
1071
|
-
]
|
|
1072
|
-
}
|
|
1073
|
-
```
|
|
1074
|
-
|
|
1075
|
-
**Why?**
|
|
1076
|
-
|
|
1077
|
-
Previously, a collection could define multiple templates, the ambiguity introduced with this feature meant that your documents needed a `_template` field on them so we'd know which one they belonged to. It also mean having to disambiguate your queries in graphql:
|
|
1078
|
-
|
|
1079
|
-
```graphql
|
|
1080
|
-
getPostDocument(relativePage: $relativePath) {
|
|
1081
|
-
data {
|
|
1082
|
-
...on Article_Doc_Data {
|
|
1083
|
-
title
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
```
|
|
1088
|
-
|
|
1089
|
-
Going forward, if you use `fields` on a collection, you can omit the `_template` key and simplify your query:
|
|
1090
|
-
|
|
1091
|
-
```graphql
|
|
1092
|
-
getPostDocument(relativePage: $relativePath) {
|
|
1093
|
-
data {
|
|
1094
|
-
title
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
```
|
|
1098
|
-
|
|
1099
|
-
## `type` changes
|
|
1100
|
-
|
|
1101
|
-
Types will look a little bit different, and are meant to reflect the lowest form of the shape they can represent. Moving forward, the `ui` field will represent the UI portion of what you might expect. For a blog post "description" field, you'd define it like this:
|
|
1102
|
-
|
|
1103
|
-
```js
|
|
1104
|
-
{
|
|
1105
|
-
type: "string",
|
|
1106
|
-
label: "Description",
|
|
1107
|
-
name: "description",
|
|
1108
|
-
}
|
|
1109
|
-
```
|
|
1110
|
-
|
|
1111
|
-
By default `string` will use the `text` field, but you can change that by specifying the `component`:
|
|
1112
|
-
|
|
1113
|
-
```js
|
|
1114
|
-
{
|
|
1115
|
-
type: "string",
|
|
1116
|
-
label: "Description",
|
|
1117
|
-
name: "description",
|
|
1118
|
-
ui: {
|
|
1119
|
-
component: "textarea"
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
```
|
|
1123
|
-
|
|
1124
|
-
For the most part, the UI properties are added to the field and adhere to the existing capabilities of Tina's core [field plugins](https://tina.io/docs/fields/). But there's nothing stopping you from providing your own components -- just be sure to register those with the CMS object on the frontend:
|
|
1125
|
-
|
|
1126
|
-
```js
|
|
1127
|
-
{
|
|
1128
|
-
type: "string",
|
|
1129
|
-
label: "Description",
|
|
1130
|
-
name: "description",
|
|
1131
|
-
ui: {
|
|
1132
|
-
component: "myMapField"
|
|
1133
|
-
someAdditionalMapConfig: 'some-value'
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
```
|
|
1137
|
-
|
|
1138
|
-
[Register](https://tina.io/docs/fields/custom-fields/#registering-the-plugin) your `myMapField` with Tina:
|
|
1139
|
-
|
|
1140
|
-
```js
|
|
1141
|
-
cms.fields.add({
|
|
1142
|
-
name: 'myMapField',
|
|
1143
|
-
Component: MapPicker,
|
|
1144
|
-
})
|
|
1145
|
-
```
|
|
1146
|
-
|
|
1147
|
-
### One important gotcha
|
|
1148
|
-
|
|
1149
|
-
Every property in the `defineSchema` API must be serlializable. Meaning functions will not work. For example, there's no way to define a `validate` or `parse` function at this level. However, you can either use the [formify](https://tina.io/docs/tina-cloud/client/#formify) API to get access to the Tina form, or provide your own logic by specifying a plugin of your choice:
|
|
1150
|
-
|
|
1151
|
-
```js
|
|
1152
|
-
{
|
|
1153
|
-
type: "string",
|
|
1154
|
-
label: "Description",
|
|
1155
|
-
name: "description",
|
|
1156
|
-
ui: {
|
|
1157
|
-
component: "myText"
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
```
|
|
1161
|
-
|
|
1162
|
-
And then when you register the plugin, provide your custom logic here:
|
|
1163
|
-
|
|
1164
|
-
```js
|
|
1165
|
-
import { TextFieldPlugin } from 'tinacms'
|
|
1166
|
-
|
|
1167
|
-
// ...
|
|
1168
|
-
|
|
1169
|
-
cms.fields.add({
|
|
1170
|
-
...TextFieldPlugin, // spread existing text plugin
|
|
1171
|
-
name: 'myText',
|
|
1172
|
-
validate: value => {
|
|
1173
|
-
someValidationLogic(value)
|
|
1174
|
-
},
|
|
1175
|
-
})
|
|
1176
|
-
```
|
|
1177
|
-
|
|
1178
|
-
**Why?**
|
|
1179
|
-
|
|
1180
|
-
The reality is that under the hood this has made no difference to the backend, so we're removing it as a point of friction. Instead, `type` is the true definition of the field's _shape_, while `ui` can be used for customizing the look and behavior of the field's UI.
|
|
1181
|
-
|
|
1182
|
-
## Defensive coding in Tina
|
|
1183
|
-
|
|
1184
|
-
When working with GraphQL, there are 2 reasons a property may not be present.
|
|
1185
|
-
|
|
1186
|
-
1. The data is not a required property. That is to say, if I have a blog post document, and "category" is an optional field, we'll need to make sure we factor that into how we render our page:
|
|
1187
|
-
|
|
1188
|
-
```tsx
|
|
1189
|
-
const MyPage = props => {
|
|
1190
|
-
return (
|
|
1191
|
-
<>
|
|
1192
|
-
<h2>{props.getPostDocument.data.title}</h2>
|
|
1193
|
-
<MyCategoryComponent>
|
|
1194
|
-
{props.getPostDocument.data?.category}
|
|
1195
|
-
</MyCategoryComponent>
|
|
1196
|
-
</>
|
|
1197
|
-
)
|
|
1198
|
-
}
|
|
1199
|
-
```
|
|
1200
|
-
|
|
1201
|
-
2. The query did not ask for that field:
|
|
1202
|
-
|
|
1203
|
-
```graphql
|
|
1204
|
-
{
|
|
1205
|
-
getPostDocument {
|
|
1206
|
-
data {
|
|
1207
|
-
title
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
```
|
|
1212
|
-
|
|
1213
|
-
But with Tina, there's a 3rd scenario: the document may be in an invalid state. Meaning, we could mark the field as `required` _and_ query for the appropriate field, and _still_ not have the expected shape of data. Due to the contextual nature of Tina, it's very common to be in an intermediate state, where your data is incomplete simply because you're still working on it. Most APIs would throw an error when a document is in an invalid state. Or, more likely, you couldn't even request it.
|
|
1214
|
-
|
|
1215
|
-
## Undefined list fields will return `null`
|
|
1216
|
-
|
|
1217
|
-
Previously an listable field which wasn't defined in the document was treated as an emptry array. So for example:
|
|
1218
|
-
|
|
1219
|
-
```md
|
|
1220
|
-
---
|
|
1221
|
-
title: 'Hello, World'
|
|
1222
|
-
categories:
|
|
1223
|
-
- sports
|
|
1224
|
-
- movies
|
|
1225
|
-
---
|
|
1226
|
-
```
|
|
1227
|
-
|
|
1228
|
-
The responsee would be `categories: ['sports', 'movies']`. If you omit the items, but kept the empty array:
|
|
1229
|
-
|
|
1230
|
-
```md
|
|
1231
|
-
---
|
|
1232
|
-
title: 'Hello, World'
|
|
1233
|
-
categories: []
|
|
1234
|
-
---
|
|
1235
|
-
```
|
|
1236
|
-
|
|
1237
|
-
The responsee would be `categories: []`. If you omit the field entirely:
|
|
1238
|
-
|
|
1239
|
-
```md
|
|
1240
|
-
---
|
|
1241
|
-
title: 'Hello, World'
|
|
1242
|
-
---
|
|
1243
|
-
```
|
|
1244
|
-
|
|
1245
|
-
The response will be `categories: null`. Previously this would have been `[]`, which was incorrect.
|
|
1246
|
-
|
|
1247
|
-
## For a listable item which is `required: true` you _must_ provide a `ui.defaultItem` property
|
|
1248
|
-
|
|
1249
|
-
### Why?
|
|
1250
|
-
|
|
1251
|
-
It's possible for Tina's editing capabilities to introduce an invalid state during edits to list items. Imagine the scenario where you are iterating through an array of objects, and each object has a categories array on it we'd like to render:
|
|
1252
|
-
|
|
1253
|
-
```tsx
|
|
1254
|
-
const MyPage = props => {
|
|
1255
|
-
return props.blocks.map(block => {
|
|
1256
|
-
return (
|
|
1257
|
-
<>
|
|
1258
|
-
<h2>{block.categories.split(',')}</h2>
|
|
1259
|
-
</>
|
|
1260
|
-
)
|
|
1261
|
-
})
|
|
1262
|
-
}
|
|
1263
|
-
```
|
|
1264
|
-
|
|
1265
|
-
For a new item, `categories` will be null, so we'll get an error. This only happens when you're editing your page with Tina, so it's not a production-facing issue.
|
|
1266
|
-
|
|
1267
|
-
## Every `type` can be a list
|
|
1268
|
-
|
|
1269
|
-
Previously, we had a `list` field, which allowed you to supply a `field` property. Instead, _every_ primitive type can be represented as a list:
|
|
1270
|
-
|
|
1271
|
-
```js
|
|
1272
|
-
{
|
|
1273
|
-
type: "string",
|
|
1274
|
-
label: "Categories",
|
|
1275
|
-
name: "categories",
|
|
1276
|
-
list: true
|
|
1277
|
-
}
|
|
1278
|
-
```
|
|
1279
|
-
|
|
1280
|
-
Additionally, enumerable lists and selects are inferred from the `options` property. The following example is represented by a `select` field:
|
|
1281
|
-
|
|
1282
|
-
```js
|
|
1283
|
-
{
|
|
1284
|
-
type: "string",
|
|
1285
|
-
label: "Categories",
|
|
1286
|
-
name: "categories",
|
|
1287
|
-
options: ["fitness", "movies", "music"]
|
|
1288
|
-
}
|
|
1289
|
-
```
|
|
1290
|
-
|
|
1291
|
-
While this, is a `checkbox` field
|
|
1292
|
-
|
|
1293
|
-
```js
|
|
1294
|
-
{
|
|
1295
|
-
type: "string",
|
|
1296
|
-
label: "Categories",
|
|
1297
|
-
name: "categories"
|
|
1298
|
-
list: true,
|
|
1299
|
-
options: ["fitness", "movies", "music"]
|
|
1300
|
-
}
|
|
1301
|
-
```
|
|
1302
|
-
|
|
1303
|
-
> Note we may introduce an `enum` type, but haven't discussed it thoroughly
|
|
1304
|
-
|
|
1305
|
-
## Introducing the `object` type
|
|
1306
|
-
|
|
1307
|
-
Tina currently represents the concept of an _object_ in two ways: a `group` (and `group-list`), which is a uniform collection of fields; and `blocks`, which is a polymporphic collection. Moving forward, we'll be introducing a more comporehensive type, which envelopes the behavior of both `group` and `blocks`, and since _every_ field can be a `list`, this also makes `group-list` redundant.
|
|
1308
|
-
|
|
1309
|
-
> Note: we've previously assumed that `blocks` usage would _always_ be as an array. We'll be keeping that assumption with the `blocks` type for compatibility, but `object` will allow for non-array polymorphic objects.
|
|
1310
|
-
|
|
1311
|
-
### Defining an `object` type
|
|
1312
|
-
|
|
1313
|
-
An `object` type takes either a `fields` _or_ `templates` property (just like the `collections` definition). If you supply `fields`, you'll end up with what is essentially a `group` item. And if you say `list: true`, you'll have what used to be a `group-list` definition.
|
|
1314
|
-
|
|
1315
|
-
Likewise, if you supply a `templates` field and `list: true`, you'll get the same API as `blocks`. However you can also say `list: false` (or omit it entirely), and you'll have a polymorphic object which is _not_ an array.
|
|
1316
|
-
|
|
1317
|
-
This is identical to the current `blocks` definition:
|
|
1318
|
-
|
|
1319
|
-
```js
|
|
1320
|
-
{
|
|
1321
|
-
type: "object",
|
|
1322
|
-
label: "Page Sections",
|
|
1323
|
-
name: "pageSections",
|
|
1324
|
-
list: true,
|
|
1325
|
-
templates: [{
|
|
1326
|
-
label: "Hero",
|
|
1327
|
-
name: "hero",
|
|
1328
|
-
fields: [{
|
|
1329
|
-
label: "Title",
|
|
1330
|
-
name: "title",
|
|
1331
|
-
type: "string"
|
|
1332
|
-
}]
|
|
1333
|
-
}]
|
|
1334
|
-
}
|
|
1335
|
-
```
|
|
1336
|
-
|
|
1337
|
-
And here is one for `group`:
|
|
1338
|
-
|
|
1339
|
-
```js
|
|
1340
|
-
{
|
|
1341
|
-
type: "object",
|
|
1342
|
-
label: "Hero",
|
|
1343
|
-
name: "hero",
|
|
1344
|
-
fields: [{
|
|
1345
|
-
label: "Title",
|
|
1346
|
-
name: "title",
|
|
1347
|
-
type: "string"
|
|
1348
|
-
}]
|
|
1349
|
-
}
|
|
1350
|
-
```
|
|
1351
|
-
|
|
1352
|
-
## `dataJSON` field
|
|
1353
|
-
|
|
1354
|
-
You can now request `dataJSON` for the entire data object as a single query key. This is great for more tedius queries like theme files where including each item in the result is cumbersome.
|
|
1355
|
-
|
|
1356
|
-
> Note there is no typescript help for this feature for now
|
|
1357
|
-
|
|
1358
|
-
```graphql
|
|
1359
|
-
getThemeDocument(relativePath: $relativePath) {
|
|
1360
|
-
dataJSON
|
|
1361
|
-
}
|
|
1362
|
-
```
|
|
1363
|
-
|
|
1364
|
-
```json
|
|
1365
|
-
{
|
|
1366
|
-
"getThemeDocument": {
|
|
1367
|
-
"dataJSON": {
|
|
1368
|
-
"every": "field",
|
|
1369
|
-
"in": {
|
|
1370
|
-
"the": "document"
|
|
1371
|
-
},
|
|
1372
|
-
"is": "returned"
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
```
|
|
1377
|
-
|
|
1378
|
-
## Lists queries will now adhere to the GraphQL connection spec
|
|
1379
|
-
|
|
1380
|
-
[Read the spec](https://relay.dev/graphql/connections.htm)
|
|
1381
|
-
|
|
1382
|
-
Previously, lists would return a simple array of items:
|
|
1383
|
-
|
|
1384
|
-
```graphql
|
|
1385
|
-
{
|
|
1386
|
-
getPostsList {
|
|
1387
|
-
id
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
```
|
|
1391
|
-
|
|
1392
|
-
Which would result in:
|
|
1393
|
-
|
|
1394
|
-
```json
|
|
1395
|
-
{
|
|
1396
|
-
"data": {
|
|
1397
|
-
"getPostsList": [
|
|
1398
|
-
{
|
|
1399
|
-
"id": "content/posts/voteForPedro.md"
|
|
1400
|
-
}
|
|
1401
|
-
]
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
```
|
|
1405
|
-
|
|
1406
|
-
In the new API, you'll need to step through `edges` & `nodes`:
|
|
1407
|
-
|
|
1408
|
-
```graphql
|
|
1409
|
-
{
|
|
1410
|
-
getPostsList {
|
|
1411
|
-
edges {
|
|
1412
|
-
node {
|
|
1413
|
-
id
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
```
|
|
1419
|
-
|
|
1420
|
-
```json
|
|
1421
|
-
{
|
|
1422
|
-
"data": {
|
|
1423
|
-
"getPostsList": {
|
|
1424
|
-
"edges": [
|
|
1425
|
-
{
|
|
1426
|
-
"node": {
|
|
1427
|
-
"id": "content/posts/voteForPedro.md"
|
|
1428
|
-
}
|
|
1429
|
-
}
|
|
1430
|
-
]
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
|
-
```
|
|
1435
|
-
|
|
1436
|
-
**Why?**
|
|
1437
|
-
|
|
1438
|
-
The GraphQL connection spec opens up a more future-proof structure, allowing us to put more information in to the _connection_ itself like how many results have been returned, and how to request the next page of data.
|
|
1439
|
-
|
|
1440
|
-
Read [a detailed explanation](https://graphql.org/learn/pagination/) of how the connection spec provides a richer set of capabilities.
|
|
1441
|
-
|
|
1442
|
-
> Note: sorting and filtering is still not supported for list queries.
|
|
1443
|
-
|
|
1444
|
-
## `_body` is no longer included by default
|
|
1445
|
-
|
|
1446
|
-
There is instead an `isBody` boolean which can be added to any `string` field
|
|
1447
|
-
|
|
1448
|
-
**Why?**
|
|
1449
|
-
|
|
1450
|
-
Since markdown files sort of have an implicit "body" to them, we were automatically populating a field which represented the body of your markdown file. This wasn't that useful, and kind of annoying. Instead, just attach `isBody` to the field which you want to represent your markdown "body":
|
|
1451
|
-
|
|
1452
|
-
```js
|
|
1453
|
-
{
|
|
1454
|
-
collections: [{
|
|
1455
|
-
name: "post",
|
|
1456
|
-
label: "Post",
|
|
1457
|
-
path: "content/posts",
|
|
1458
|
-
fields: [
|
|
1459
|
-
{
|
|
1460
|
-
name: "title",
|
|
1461
|
-
label: "Title",
|
|
1462
|
-
type: "string"
|
|
1463
|
-
}
|
|
1464
|
-
{
|
|
1465
|
-
name: "myBody",
|
|
1466
|
-
label: "My Body",
|
|
1467
|
-
type: "string",
|
|
1468
|
-
component: 'textarea',
|
|
1469
|
-
isBody: true
|
|
1470
|
-
}
|
|
1471
|
-
]
|
|
1472
|
-
}]
|
|
1473
|
-
}
|
|
1474
|
-
```
|
|
1475
|
-
|
|
1476
|
-
This would result in a form field called `My Body` getting saved to the body of your markdown file (if you're using markdown):
|
|
1477
|
-
|
|
1478
|
-
```md
|
|
1479
|
-
---
|
|
1480
|
-
title: Hello, World!
|
|
1481
|
-
---
|
|
1482
|
-
|
|
1483
|
-
This is the body of the file, it's edited through the "My Body" field in your form.
|
|
1484
|
-
```
|
|
1485
|
-
|
|
1486
|
-
## References now point to more than one collection.
|
|
1487
|
-
|
|
1488
|
-
Instead of a `collection` property, you must now define a `collections` field, which is an array:
|
|
1489
|
-
|
|
1490
|
-
```js
|
|
1491
|
-
{
|
|
1492
|
-
type: "reference",
|
|
1493
|
-
label: "Author",
|
|
1494
|
-
name: "author",
|
|
1495
|
-
collections: ["author"]
|
|
1496
|
-
}
|
|
1497
|
-
```
|
|
1498
|
-
|
|
1499
|
-
```graphql
|
|
1500
|
-
{
|
|
1501
|
-
getPostDocument(relativePath: "hello.md") {
|
|
1502
|
-
data {
|
|
1503
|
-
title
|
|
1504
|
-
author {
|
|
1505
|
-
...on Author_Document {
|
|
1506
|
-
name
|
|
1507
|
-
}
|
|
1508
|
-
...on Post_Document {
|
|
1509
|
-
title
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1513
|
-
}
|
|
1514
|
-
```
|
|
1515
|
-
|
|
1516
|
-
## Other breaking changes
|
|
1517
|
-
|
|
1518
|
-
### The `template` field on polymorphic objects (formerly _blocks_) is now `_template`
|
|
1519
|
-
|
|
1520
|
-
**Old API:**
|
|
1521
|
-
|
|
1522
|
-
```md
|
|
1523
|
-
---
|
|
1524
|
-
---
|
|
1525
|
-
myBlocks:
|
|
1526
|
-
- template: hero
|
|
1527
|
-
title: Hello
|
|
1528
|
-
---
|
|
1529
|
-
```
|
|
1530
|
-
|
|
1531
|
-
**New API:**
|
|
1532
|
-
|
|
1533
|
-
```md
|
|
1534
|
-
---
|
|
1535
|
-
---
|
|
1536
|
-
myBlocks:
|
|
1537
|
-
- \_template: hero
|
|
1538
|
-
title: Hello
|
|
1539
|
-
---
|
|
1540
|
-
```
|
|
1541
|
-
|
|
1542
|
-
### `data` `__typename` values have changed
|
|
1543
|
-
|
|
1544
|
-
They now include the proper namespace to prevent naming collisions and no longer require `_Doc_Data` suffix. All generated `__typename` properties are going to be slightly different. We weren't fully namespacing fields so it wasn't possible to guarantee that no collisions would occur. The pain felt here will likely be most seen when querying and filtering through blocks. This ensures the stability of this type in the future
|
|
1545
|
-
|
|
1546
|
-
```graphql
|
|
1547
|
-
{
|
|
1548
|
-
getPageDocument(relativePath: "home.md") {
|
|
1549
|
-
data {
|
|
1550
|
-
title
|
|
1551
|
-
myBlocks {
|
|
1552
|
-
...on Page_Hero_Data { # previously this would have been Hero_Data
|
|
1553
|
-
# ...
|
|
1554
|
-
}
|
|
1555
|
-
}
|
|
1556
|
-
}
|
|
1557
|
-
}
|
|
1558
|
-
```
|
|
1559
|
-
|
|
1560
|
-
### Patch Changes
|
|
1561
|
-
|
|
1562
|
-
- d42e2bcf: Adds number, datetime, and boolean fields back into primitive field generators
|
|
1563
|
-
- 95244e14: Early return for query nodes which can't be formified
|
|
1564
|
-
- Updated dependencies [7351d92f]
|
|
1565
|
-
- tina-graphql-helpers@0.1.2
|
|
1566
|
-
|
|
1567
|
-
## 0.3.0
|
|
1568
|
-
|
|
1569
|
-
### Minor Changes
|
|
1570
|
-
|
|
1571
|
-
- 96ee3eb1: Revisited useDocumentCreatorPlugin to improve the UX
|
|
1572
|
-
|
|
1573
|
-
## 0.2.23
|
|
1574
|
-
|
|
1575
|
-
### Patch Changes
|
|
1576
|
-
|
|
1577
|
-
- Bump packages to reflect new changest capabilities
|
|
1578
|
-
- Updated dependencies [undefined]
|
|
1579
|
-
- tina-graphql-helpers@0.1.1
|
|
1580
|
-
|
|
1581
|
-
## 0.2.22
|
|
1582
|
-
|
|
1583
|
-
### Patch Changes
|
|
1584
|
-
|
|
1585
|
-
- Updated dependencies [undefined]
|
|
1586
|
-
- tina-graphql-helpers@0.1.0
|