@tinacms/app 0.0.0-cacbd0e-20250306051805 → 0.0.0-ce1414c-20251110052442

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 CHANGED
@@ -1,11 +1,132 @@
1
1
  # @tinacms/app
2
2
 
3
- ## 0.0.0-cacbd0e-20250306051805
3
+ ## 0.0.0-ce1414c-20251110052442
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies []:
8
- - tinacms@0.0.0-cacbd0e-20250306051805
7
+ - [#6087](https://github.com/tinacms/tinacms/pull/6087) [`1286e87`](https://github.com/tinacms/tinacms/commit/1286e87323694dc819edc56360613dc654f3d3ca) Thanks [@kulesy](https://github.com/kulesy)! - feat: Enhance branch creation modal with improved UI/UX and dropdown button component
8
+
9
+ - [#6098](https://github.com/tinacms/tinacms/pull/6098) [`a2d983e`](https://github.com/tinacms/tinacms/commit/a2d983ed886f66db2c133e902eacaa8d07e88bdb) Thanks [@Pat-Stuart](https://github.com/Pat-Stuart)! - Change from blue accent coloring to orange
10
+
11
+ - Updated dependencies [[`1286e87`](https://github.com/tinacms/tinacms/commit/1286e87323694dc819edc56360613dc654f3d3ca), [`4416a28`](https://github.com/tinacms/tinacms/commit/4416a283ac1cfea5e9c4890cd71f2edf3b704344), [`6cba118`](https://github.com/tinacms/tinacms/commit/6cba118c90f7c7ab6356c0ef83fca18526e47f8d), [`572fb28`](https://github.com/tinacms/tinacms/commit/572fb28236b56db4ede5fe53b177b80323ae7284), [`ce1414c`](https://github.com/tinacms/tinacms/commit/ce1414ce1b82e6755a96c9c12949cd469b43e283), [`f224124`](https://github.com/tinacms/tinacms/commit/f224124220811fb44749122d46eb7100af89ee77), [`a2d983e`](https://github.com/tinacms/tinacms/commit/a2d983ed886f66db2c133e902eacaa8d07e88bdb), [`bc35474`](https://github.com/tinacms/tinacms/commit/bc354740d0cb359c372ba287974e7e9db3c5119c)]:
12
+ - tinacms@0.0.0-ce1414c-20251110052442
13
+
14
+ ## 2.3.5
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [[`003e348`](https://github.com/tinacms/tinacms/commit/003e348472ddc08eee63d78190038097542b6311), [`5527e8a`](https://github.com/tinacms/tinacms/commit/5527e8ab5821c8613fcfd1b0b8bc6d93291a6d03), [`5ffd60e`](https://github.com/tinacms/tinacms/commit/5ffd60e7b07b19cde6fab36a911503276c83715f), [`b23aa0c`](https://github.com/tinacms/tinacms/commit/b23aa0c5defc51b8f9fe00a59dd87e1d2f8b9f0b), [`5d13c0d`](https://github.com/tinacms/tinacms/commit/5d13c0d023373692233c8be2127ae6e3d7d68b47)]:
19
+ - tinacms@2.9.1
20
+
21
+ ## 2.3.4
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [[`0bbe080`](https://github.com/tinacms/tinacms/commit/0bbe0804e334238850a4f8f33be5cd123ff68ab3), [`98fbc94`](https://github.com/tinacms/tinacms/commit/98fbc941a07fbc52edafaeb43b49b5ea30ea4172), [`ced9076`](https://github.com/tinacms/tinacms/commit/ced9076d25d7177bd8d9ae3c6133d0560366511c)]:
26
+ - tinacms@2.9.0
27
+
28
+ ## 2.3.3
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies [[`ea917dd`](https://github.com/tinacms/tinacms/commit/ea917dd2840c955d462b66b58009d2a16da39377), [`b012b6c`](https://github.com/tinacms/tinacms/commit/b012b6c7fae2674c613fd4c54e1819a86c6d2c3e), [`39e5b05`](https://github.com/tinacms/tinacms/commit/39e5b0562af7bca1e2923fc94b7c8119e12a0133), [`55e018b`](https://github.com/tinacms/tinacms/commit/55e018b9826a540005bbadf8fd51e9bac456d531)]:
33
+ - tinacms@2.8.3
34
+
35
+ ## 2.3.2
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [[`eaa6ed5`](https://github.com/tinacms/tinacms/commit/eaa6ed551c76349c5849cd1e19a8066ecbbe205c), [`60a15d5`](https://github.com/tinacms/tinacms/commit/60a15d533b85a0c3f9f483f6f0f0b6824616284b), [`2fb1c4e`](https://github.com/tinacms/tinacms/commit/2fb1c4e79d1cae5ab29c3f93b0867214e193f59c)]:
40
+ - tinacms@2.8.2
41
+ - @tinacms/mdx@1.8.1
42
+
43
+ ## 2.3.1
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [[`41359ed`](https://github.com/tinacms/tinacms/commit/41359edaf08def7a5e26969ec114155038c09752), [`b20a2c4`](https://github.com/tinacms/tinacms/commit/b20a2c4fd64fa2d06711850db63fb317302ee361), [`41359ed`](https://github.com/tinacms/tinacms/commit/41359edaf08def7a5e26969ec114155038c09752)]:
48
+ - tinacms@2.8.1
49
+
50
+ ## 2.3.0
51
+
52
+ ### Minor Changes
53
+
54
+ - [#5744](https://github.com/tinacms/tinacms/pull/5744) [`98a61e2`](https://github.com/tinacms/tinacms/commit/98a61e2d263978a7096cc23ac7e94aa0039981be) Thanks [@Ben0189](https://github.com/Ben0189)! - Upgrade Plate editor to v48 beta, integrating latest features and improvements.
55
+
56
+ ### Patch Changes
57
+
58
+ - Updated dependencies [[`98a61e2`](https://github.com/tinacms/tinacms/commit/98a61e2d263978a7096cc23ac7e94aa0039981be)]:
59
+ - @tinacms/mdx@1.8.0
60
+ - tinacms@2.8.0
61
+
62
+ ## 2.2.10
63
+
64
+ ### Patch Changes
65
+
66
+ - [#5833](https://github.com/tinacms/tinacms/pull/5833) [`5269d65`](https://github.com/tinacms/tinacms/commit/5269d6578d361c55326f39375eaa175707342d51) Thanks [@JackDevAU](https://github.com/JackDevAU)! - 🐛 FIX - Visual Editor Webpack HMR loading issue
67
+
68
+ - Updated dependencies [[`5269d65`](https://github.com/tinacms/tinacms/commit/5269d6578d361c55326f39375eaa175707342d51), [`3026a2b`](https://github.com/tinacms/tinacms/commit/3026a2b492113a53c036e43d5d85837cea4a6de3), [`28a94a6`](https://github.com/tinacms/tinacms/commit/28a94a602186f48b528b91236007839e5d02a9de)]:
69
+ - tinacms@2.7.10
70
+
71
+ ## 2.2.9
72
+
73
+ ### Patch Changes
74
+
75
+ - [#5741](https://github.com/tinacms/tinacms/pull/5741) [`0e9de37`](https://github.com/tinacms/tinacms/commit/0e9de379dab2970206b9b60eb014808662f67287) Thanks [@wicksipedia](https://github.com/wicksipedia)! - CMS admin UI - Refactor Sidebar and Branch Button Components
76
+ Forms header - Adds breadcrumb navigation
77
+
78
+ - [#5784](https://github.com/tinacms/tinacms/pull/5784) [`b25c5f0`](https://github.com/tinacms/tinacms/commit/b25c5f0b0e1d3f37870b780230b41dbc56bef1ab) Thanks [@JackDevAU](https://github.com/JackDevAU)! - - Fixed padding issues in FormLists
79
+
80
+ - Fixed Visual Editing's "Edit" button (Reference Fields)
81
+
82
+ - [#5789](https://github.com/tinacms/tinacms/pull/5789) [`5040a6a`](https://github.com/tinacms/tinacms/commit/5040a6aa24e62166d942c47b61a3f18585caded6) Thanks [@JackDevAU](https://github.com/JackDevAU)! - ✨ Adds click to focus for nested objects
83
+
84
+ - Updated dependencies [[`2a3ed6c`](https://github.com/tinacms/tinacms/commit/2a3ed6c3ec3233fd90fd94f3dd3d0243aaad079a), [`bc47f93`](https://github.com/tinacms/tinacms/commit/bc47f938431c400714808613f633b05659a87be1), [`0e9de37`](https://github.com/tinacms/tinacms/commit/0e9de379dab2970206b9b60eb014808662f67287), [`468f0ee`](https://github.com/tinacms/tinacms/commit/468f0eefc0a15a9a9a23737d29ea9a5cb5c6aef6), [`e27c017`](https://github.com/tinacms/tinacms/commit/e27c0172005797af93b908152d51b2966c0cf059), [`b25c5f0`](https://github.com/tinacms/tinacms/commit/b25c5f0b0e1d3f37870b780230b41dbc56bef1ab), [`5040a6a`](https://github.com/tinacms/tinacms/commit/5040a6aa24e62166d942c47b61a3f18585caded6), [`dbef36f`](https://github.com/tinacms/tinacms/commit/dbef36f594b949024d5525184b6a9e1b9085b759), [`3ba6d78`](https://github.com/tinacms/tinacms/commit/3ba6d78f35f817d55bfc3d12b750e54b7e0d11f2)]:
85
+ - tinacms@2.7.9
86
+ - @tinacms/mdx@1.7.0
87
+
88
+ ## 2.2.8
89
+
90
+ ### Patch Changes
91
+
92
+ - Updated dependencies [[`5e36123`](https://github.com/tinacms/tinacms/commit/5e361239a372e21dda624d17b4ff274bab23ce90), [`856e07a`](https://github.com/tinacms/tinacms/commit/856e07a0b8d742ee78d5eba565623cf081a61534), [`4d9c8ab`](https://github.com/tinacms/tinacms/commit/4d9c8abf6badd1bcc833bda432ab22dace4925ae), [`7346dc9`](https://github.com/tinacms/tinacms/commit/7346dc996fd81ecb395b62f373976512e8224c21)]:
93
+ - tinacms@2.7.8
94
+ - @tinacms/mdx@1.6.3
95
+
96
+ ## 2.2.7
97
+
98
+ ### Patch Changes
99
+
100
+ - [#5607](https://github.com/tinacms/tinacms/pull/5607) [`1965236`](https://github.com/tinacms/tinacms/commit/19652363784e48b065ec1924a9cd9611c8e79cae) Thanks [@jeffsee55](https://github.com/jeffsee55)! - Specify react and react-dom as peer deps
101
+
102
+ - Updated dependencies [[`1965236`](https://github.com/tinacms/tinacms/commit/19652363784e48b065ec1924a9cd9611c8e79cae)]:
103
+ - tinacms@2.7.7
104
+
105
+ ## 2.2.6
106
+
107
+ ### Patch Changes
108
+
109
+ - Updated dependencies [[`65cee5d`](https://github.com/tinacms/tinacms/commit/65cee5d6ae16c7320a4a14f0d9a82dc5f9103e34)]:
110
+ - tinacms@2.7.6
111
+
112
+ ## 2.2.5
113
+
114
+ ### Patch Changes
115
+
116
+ - [#5602](https://github.com/tinacms/tinacms/pull/5602) [`ab43169`](https://github.com/tinacms/tinacms/commit/ab43169af5a95f31fa27bb0236623a031883a1fd) Thanks [@wicksipedia](https://github.com/wicksipedia)! - fix naming of TinaCloud
117
+
118
+ - [#5588](https://github.com/tinacms/tinacms/pull/5588) [`fd664d8`](https://github.com/tinacms/tinacms/commit/fd664d8f4e83941ed1b1f234668ab6341a6178f8) Thanks [@JackDevAU](https://github.com/JackDevAU)! - - Fix server-side branch queries by storing the active branch in a cookie and passing it via the x-branch header.
119
+ - Ensure GraphQL playground correctly updates when switching branches.
120
+ - Updated dependencies [[`921f235`](https://github.com/tinacms/tinacms/commit/921f2356e4615d532d02eefa7103fdb70f83b97a), [`ab43169`](https://github.com/tinacms/tinacms/commit/ab43169af5a95f31fa27bb0236623a031883a1fd), [`b551232`](https://github.com/tinacms/tinacms/commit/b5512326ad0ad9855bc75e2073a3ab2a8ec4c064), [`ea204c9`](https://github.com/tinacms/tinacms/commit/ea204c9045451f3ebea04f503e6158d2016613e4), [`fd664d8`](https://github.com/tinacms/tinacms/commit/fd664d8f4e83941ed1b1f234668ab6341a6178f8)]:
121
+ - tinacms@2.7.5
122
+ - @tinacms/mdx@1.6.2
123
+
124
+ ## 2.2.3
125
+
126
+ ### Patch Changes
127
+
128
+ - Updated dependencies [[`991db1f`](https://github.com/tinacms/tinacms/commit/991db1f10c1f9cf9211d7e82bd56658cdcce24c7)]:
129
+ - tinacms@2.7.3
9
130
 
10
131
  ## 2.2.2
11
132
 
@@ -461,7 +582,7 @@
461
582
 
462
583
  fix: Use clean page-sizes on media manager (to make pagination more obvious)
463
584
 
464
- Fix issue with uploading media in a folder with tina cloud
585
+ Fix issue with uploading media in a folder with TinaCloud
465
586
 
466
587
  - Updated dependencies [9c27087fb]
467
588
  - Updated dependencies [65d0a701f]
package/index.html CHANGED
@@ -51,7 +51,7 @@
51
51
  the assets for this page.\
52
52
  </p>\
53
53
  <p>\
54
- Please visit <a href="https://tina.io/docs/tina-cloud/faq/#how-do-i-resolve-failed-loading-tinacms-assets-error">this doc</a> for help.\
54
+ Please visit <a href="https://tina.io/docs/r/FAQ/#13-how-do-i-resolve-failed-loading-tinacms-assets-error">this doc</a> for help.\
55
55
  </p>\
56
56
  </div>'
57
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/app",
3
- "version": "0.0.0-cacbd0e-20250306051805",
3
+ "version": "0.0.0-ce1414c-20251110052442",
4
4
  "main": "src/main.tsx",
5
5
  "license": "Apache-2.0",
6
6
  "devDependencies": {
@@ -8,6 +8,10 @@
8
8
  "@types/react-dom": "^18.3.5",
9
9
  "typescript": "^5.7.3"
10
10
  },
11
+ "peerDependencies": {
12
+ "react": ">=18.3.1 <20.0.0",
13
+ "react-dom": ">=18.3.1 <20.0.0"
14
+ },
11
15
  "dependencies": {
12
16
  "@graphiql/toolkit": "0.8.4",
13
17
  "@headlessui/react": "2.1.8",
@@ -22,7 +26,7 @@
22
26
  "react-router-dom": "6.3.0",
23
27
  "typescript": "^5.7.3",
24
28
  "zod": "^3.24.2",
25
- "tinacms": "0.0.0-cacbd0e-20250306051805",
26
- "@tinacms/mdx": "1.6.1"
29
+ "@tinacms/mdx": "1.8.1",
30
+ "tinacms": "0.0.0-ce1414c-20251110052442"
27
31
  }
28
32
  }
@@ -1,10 +1,10 @@
1
1
  import { createGraphiQLFetcher } from '@graphiql/toolkit';
2
+ import { FolderIcon } from '@heroicons/react/outline';
3
+ import { queries } from 'CLIENT_IMPORT';
2
4
  import { GraphiQL } from 'graphiql';
3
5
  import { parse, print } from 'graphql';
4
6
  import React from 'react';
5
7
  import { useCMS } from 'tinacms';
6
- import { FolderIcon } from '@heroicons/react/outline';
7
- import { queries } from 'CLIENT_IMPORT';
8
8
 
9
9
  import 'graphiql/graphiql.min.css';
10
10
 
@@ -74,9 +74,7 @@ const Playground = () => {
74
74
  {noAutoQueries
75
75
  ? 'No auto-generated queries found, the Tina config is likely set to client.skip = true'
76
76
  : "Tina's auto-generated queries can be found here as well as any queries you may have defined yourself."}{' '}
77
- <a href='https://tina.io/docs/data-fetching/custom-queries/'>
78
- Learn more here
79
- </a>
77
+ <a href='https://tina.io/docs/r/custom-queries/'>Learn more here</a>
80
78
  </div>
81
79
  <nav className='space-y-1' aria-label='Sidebar'>
82
80
  <ul>
@@ -100,7 +98,7 @@ const Playground = () => {
100
98
  false
101
99
  ? 'bg-gray-100 text-gray-900'
102
100
  : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900',
103
- 'flex items-center rounded-md px-3 py-2 text-sm font-medium w-full text-left'
101
+ 'flex items-center rounded px-3 py-2 text-sm font-medium w-full text-left'
104
102
  )}
105
103
  onClick={async () => {
106
104
  if (typeof value === 'function') {
@@ -134,7 +132,7 @@ const Playground = () => {
134
132
  <GraphiQL
135
133
  fetcher={async (params, options) => {
136
134
  const fetcher = createGraphiQLFetcher({
137
- url: __API_URL__,
135
+ url: cms.api.tina.contentApiUrl || __API_URL__,
138
136
  headers: { Authorization: `Bearer ${getToken()}` },
139
137
  });
140
138
  return fetcher(params, options);
@@ -1,16 +1,16 @@
1
- /**
2
-
3
-
4
-
5
- */
6
- import React from 'react';
7
- import { XCircleIcon } from '@heroicons/react/solid';
8
1
  import {
9
2
  Popover,
10
3
  PopoverButton,
11
4
  PopoverPanel,
12
5
  Transition,
13
6
  } from '@headlessui/react';
7
+ import { XCircleIcon } from '@heroicons/react/solid';
8
+ /**
9
+
10
+
11
+
12
+ */
13
+ import React from 'react';
14
14
  import { Fragment } from 'react';
15
15
  // import { InvalidMarkdownElement } from '@tinacms/mdx/src/parse/plate'
16
16
  export type EmptyTextElement = { type: 'text'; text: '' };
@@ -93,7 +93,7 @@ export function ErrorMessage({ error }: { error: InvalidMarkdownElement }) {
93
93
  >
94
94
  <PopoverPanel className='absolute top-8 w-[300px] -right-3 z-10 mt-3 px-4 sm:px-0'>
95
95
  <div className='overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5'>
96
- <div className='rounded-md bg-red-50 p-4 overflow-scroll'>
96
+ <div className='rounded bg-red-50 p-4 overflow-scroll'>
97
97
  <div className='flex'>
98
98
  <div className='flex-shrink-0'>
99
99
  <XCircleIcon
@@ -1,9 +1,3 @@
1
- /**
2
-
3
-
4
-
5
- */
6
-
7
1
  import React from 'react';
8
2
  import MonacoEditor, { useMonaco, loader } from '@monaco-editor/react';
9
3
  /**
@@ -12,15 +6,15 @@ import MonacoEditor, { useMonaco, loader } from '@monaco-editor/react';
12
6
  * easily install the current version of the mdx package in all scenarios
13
7
  * (when we're working in the monorepo, or working with a tagged npm version)
14
8
  */
15
- import { parseMDX, stringifyMDX } from '@tinacms/mdx';
16
- import { useDebounce } from './use-debounce';
9
+ import { parseMDX, serializeMDX } from '@tinacms/mdx';
17
10
  import type * as monaco from 'monaco-editor';
11
+ import { RichTextType } from 'tinacms';
18
12
  import {
19
- buildError,
20
13
  ErrorMessage,
21
14
  InvalidMarkdownElement,
15
+ buildError,
22
16
  } from './error-message';
23
- import { RichTextType } from 'tinacms';
17
+ import { useDebounce } from './use-debounce';
24
18
 
25
19
  export const uuid = () => {
26
20
  // @ts-ignore
@@ -34,11 +28,6 @@ export const uuid = () => {
34
28
 
35
29
  type Monaco = typeof monaco;
36
30
 
37
- // 0.33.0 has a bug https://github.com/microsoft/monaco-editor/issues/2947
38
- loader.config({
39
- paths: { vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.31.1/min/vs' },
40
- });
41
-
42
31
  /**
43
32
  * Since monaco lazy-loads we may have a delay from when the block is inserted
44
33
  * to when monaco has intantiated, keep trying to focus on it.
@@ -68,7 +57,7 @@ export const RawEditor = (props: RichTextType) => {
68
57
  const field = props.field;
69
58
  const inputValue = React.useMemo(() => {
70
59
  // @ts-ignore no access to the rich-text type from this package
71
- const res = stringifyMDX(props.input.value, field, (value) => value);
60
+ const res = serializeMDX(props.input.value, field, (value) => value);
72
61
  return typeof props.input.value === 'string' ? props.input.value : res;
73
62
  }, []);
74
63
  const [value, setValue] = React.useState(inputValue);
@@ -149,13 +138,17 @@ export const RawEditor = (props: RichTextType) => {
149
138
  monacoEditor: monaco.editor.IStandaloneCodeEditor,
150
139
  monaco: Monaco
151
140
  ) {
152
- monacoEditorRef.current = monacoEditor;
153
- monacoEditor.onDidContentSizeChange(() => {
154
- // FIXME: if the window is too tall the performance degrades, come up with a nice
155
- // balance between the two
156
- setHeight(Math.min(Math.max(100, monacoEditor.getContentHeight()), 1000));
157
- monacoEditor.layout();
158
- });
141
+ if (monacoEditor) {
142
+ monacoEditorRef.current = monacoEditor;
143
+ monacoEditor.onDidContentSizeChange(() => {
144
+ // FIXME: if the window is too tall the performance degrades, come up with a nice
145
+ // balance between the two
146
+ setHeight(
147
+ Math.min(Math.max(100, monacoEditor.getContentHeight()), 1000)
148
+ );
149
+ monacoEditor.layout();
150
+ });
151
+ }
159
152
  }
160
153
 
161
154
  return (
@@ -168,6 +161,9 @@ export const RawEditor = (props: RichTextType) => {
168
161
  </div>
169
162
  <div style={{ height: `${height}px` }}>
170
163
  <MonacoEditor
164
+ beforeMount={() => {}}
165
+ height='100%'
166
+ width='100%'
171
167
  path={id}
172
168
  onMount={handleEditorDidMount}
173
169
  // Setting a custom theme is kind of buggy because it doesn't get defined until monaco has mounted.
@@ -219,10 +215,8 @@ const Button = (props) => {
219
215
  return (
220
216
  <button
221
217
  className={`${
222
- props.align === 'left'
223
- ? 'rounded-l-md border-r-0'
224
- : 'rounded-r-md border-l-0'
225
- } flex justify-center w-full shadow rounded-md bg-white cursor-pointer relative inline-flex items-center px-2 py-2 border border-gray-200 hover:text-white text-sm font-medium transition-all ease-out duration-150 hover:bg-blue-500 focus:z-10 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500`}
218
+ props.align === 'left' ? 'rounded-l border-r-0' : 'rounded-r border-l-0'
219
+ } flex justify-center w-full shadow rounded bg-white cursor-pointer relative inline-flex items-center px-2 py-2 border border-gray-200 hover:text-white text-sm font-medium transition-all ease-out duration-150 hover:bg-blue-500 focus:z-10 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500`}
226
220
  type='button'
227
221
  onClick={props.onClick}
228
222
  >
package/src/index.css CHANGED
@@ -13,6 +13,10 @@
13
13
  fill: currentColor;
14
14
  }
15
15
 
16
+ .font-libre-baskerville {
17
+ font-family: "Libre Baskerville", serif;
18
+ }
19
+
16
20
  body {
17
21
  margin: 0;
18
22
  padding: 0;
@@ -382,3 +386,8 @@ td.rdtYear:hover {
382
386
  .tina-date-field .rdtTime td {
383
387
  cursor: default;
384
388
  }
389
+
390
+ /* Override Radix UI Portal wrapper z-index for dropdown menus */
391
+ [data-radix-popper-content-wrapper] {
392
+ z-index: 10800 !important;
393
+ }
@@ -103,12 +103,11 @@ const addMetadataField = (
103
103
  kind: 'SelectionSet',
104
104
  selections: [],
105
105
  }),
106
- selections:
107
- [
108
- ...(node.selectionSet?.selections || []),
109
- METADATA_FIELD,
110
- CONTENT_SOURCE_FIELD,
111
- ] || [],
106
+ selections: [
107
+ ...(node.selectionSet?.selections || []),
108
+ METADATA_FIELD,
109
+ CONTENT_SOURCE_FIELD,
110
+ ],
112
111
  },
113
112
  };
114
113
  };
@@ -127,8 +126,7 @@ const addMetaFieldsToQuery = (
127
126
  kind: 'SelectionSet',
128
127
  selections: [],
129
128
  }),
130
- selections:
131
- [...(node.selectionSet?.selections || []), ...metaFields] || [],
129
+ selections: [...(node.selectionSet?.selections || []), ...metaFields],
132
130
  },
133
131
  };
134
132
  };
@@ -242,6 +240,7 @@ export const isNodeType = (type: G.GraphQLOutputType) => {
242
240
  return true;
243
241
  }
244
242
  }
243
+ return false;
245
244
  };
246
245
 
247
246
  export const isConnectionType = (type: G.GraphQLOutputType) => {
@@ -270,4 +269,5 @@ export const isConnectionType = (type: G.GraphQLOutputType) => {
270
269
  return true;
271
270
  }
272
271
  }
272
+ return false;
273
273
  };
@@ -1,36 +1,36 @@
1
- import React from 'react';
2
- import * as G from 'graphql';
3
- import { getIn } from 'final-form';
4
- import { z } from 'zod';
5
1
  // @ts-expect-error
6
2
  import schemaJson from 'SCHEMA_IMPORT';
7
- import { expandQuery, isConnectionType, isNodeType } from './expand-query';
3
+ import { getIn } from 'final-form';
4
+ import * as G from 'graphql';
5
+ import React from 'react';
6
+ import { useSearchParams } from 'react-router-dom';
8
7
  import {
8
+ Client,
9
+ Collection,
10
+ ErrorDialog,
9
11
  Form,
10
- TinaCMS,
12
+ FormOptions,
13
+ GlobalFormPlugin,
11
14
  NAMER,
12
- TinaSchema,
13
- useCMS,
14
- resolveField,
15
- Collection,
16
15
  Template,
16
+ TinaCMS,
17
17
  TinaField,
18
- Client,
19
- FormOptions,
20
- GlobalFormPlugin,
18
+ TinaSchema,
21
19
  TinaState,
22
- ErrorDialog,
20
+ resolveField,
21
+ useCMS,
23
22
  } from 'tinacms';
24
- import { createForm, createGlobalForm, FormifyCallback } from './build-form';
23
+ import { z } from 'zod';
24
+ import { FormifyCallback, createForm, createGlobalForm } from './build-form';
25
+ import { showErrorModal } from './errors';
26
+ import { expandQuery, isConnectionType, isNodeType } from './expand-query';
25
27
  import type {
26
- PostMessage,
27
28
  Payload,
28
- SystemInfo,
29
+ PostMessage,
29
30
  ResolvedDocument,
31
+ SystemInfo,
30
32
  } from './types';
31
33
  import { getFormAndFieldNameFromMetadata } from './util';
32
- import { useSearchParams } from 'react-router-dom';
33
- import { showErrorModal } from './errors';
34
34
 
35
35
  const sysSchema = z.object({
36
36
  breadcrumbs: z.array(z.string()),
@@ -45,7 +45,7 @@ const sysSchema = z.object({
45
45
  collection: z.object({
46
46
  name: z.string(),
47
47
  slug: z.string(),
48
- label: z.string(),
48
+ label: z.string().optional().nullable(),
49
49
  path: z.string(),
50
50
  format: z.string().optional().nullable(),
51
51
  matches: z.string().optional().nullable(),
@@ -305,6 +305,7 @@ export const useGraphQLReducer = (
305
305
  prefix: '',
306
306
  };
307
307
  }
308
+
308
309
  if (isConnectionType(info.returnType)) {
309
310
  const name = G.getNamedType(info.returnType).name;
310
311
  const connectionCollection = tinaSchema
@@ -339,6 +340,7 @@ export const useGraphQLReducer = (
339
340
  const maybeResolvedDocument = resolvedDocuments.find(
340
341
  (doc) => doc._internalSys.path === value
341
342
  );
343
+
342
344
  // If we already have this document, use it.
343
345
  if (maybeResolvedDocument) {
344
346
  resolvedDocument = maybeResolvedDocument;
@@ -349,6 +351,7 @@ export const useGraphQLReducer = (
349
351
  // here and just grab it from the response
350
352
  const maybeResolvedDocument =
351
353
  documentSchema.parse(valueFromSetup);
354
+
352
355
  if (maybeResolvedDocument._internalSys.path === value) {
353
356
  resolvedDocument = maybeResolvedDocument;
354
357
  } else {
@@ -559,6 +562,14 @@ export const useGraphQLReducer = (
559
562
  payload,
560
563
  ]);
561
564
  }
565
+ // TODO: This is causing a webpack HMR issue - look into refactoring this logic
566
+ // if (event.data.type === 'url-changed') {
567
+ // console.log('[EVENT_TRIGGERED] url-changed: ', event);
568
+ // cms.dispatch({
569
+ // type: 'sidebar:set-loading-state',
570
+ // value: true,
571
+ // });
572
+ // }
562
573
  },
563
574
  [cms, JSON.stringify(results)]
564
575
  );
package/src/lib/types.ts CHANGED
@@ -6,7 +6,8 @@ export type PostMessage =
6
6
  }
7
7
  | { type: 'field:selected'; fieldName: string }
8
8
  | { type: 'quick-edit'; value: boolean }
9
- | { type: 'user-select-form'; formId: string };
9
+ | { type: 'user-select-form'; formId: string }
10
+ | { type: 'url-changed' };
10
11
 
11
12
  export type Payload = {
12
13
  id: string;
package/src/lib/util.ts CHANGED
@@ -108,27 +108,22 @@ export const getFormAndFieldNameFromMetadata = (
108
108
  object: object,
109
109
  eventFieldName: string
110
110
  ) => {
111
- let formId;
112
- let n;
113
- const value = getDeepestMetadata(object, eventFieldName);
114
- if (value) {
115
- if (value.prefix) {
116
- const fieldName = eventFieldName.slice(value?.prefix?.length + 1);
117
- const localFieldName = value.name
118
- ? fieldName.slice(value?.name?.length + 1)
119
- : fieldName;
120
- if (localFieldName) {
121
- // If localFieldName is tags.2, just use `tags`
122
- if (!isNaN(Number(localFieldName.split('.')[1]))) {
123
- n = value.fields[localFieldName.split('.')[0]];
124
- } else {
125
- n = value.fields[localFieldName];
126
- }
127
- } else {
128
- n = value.name;
129
- }
130
- formId = value.id;
131
- }
111
+ const metadata = getDeepestMetadata(object, eventFieldName);
112
+
113
+ if (!metadata) {
114
+ console.warn(
115
+ '[getFormAndFieldNameFromMetadata] No metadata found for:',
116
+ eventFieldName
117
+ );
118
+ return { formId: undefined, fieldName: undefined };
132
119
  }
133
- return { formId, fieldName: n };
120
+
121
+ const { id: formId, prefix } = metadata;
122
+ const prefixLength = prefix?.length ?? 0;
123
+ const localFieldName = eventFieldName.slice(prefixLength + 1);
124
+
125
+ return {
126
+ formId,
127
+ fieldName: localFieldName,
128
+ };
134
129
  };