tinacms 0.68.9 → 0.68.12

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