@tinacms/app 1.2.13 → 1.2.14

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,5 +1,18 @@
1
1
  # @tinacms/app
2
2
 
3
+ ## 1.2.14
4
+
5
+ ### Patch Changes
6
+
7
+ - 52b1762e2: Prevent unhandled promise rejection when not able to determine collection for file
8
+ - 16b0c8073: Fix issue where activeField search param would be called twice, resulting in the incorrect form being focused.
9
+ - Updated dependencies [70c74bb55]
10
+ - Updated dependencies [385c8a865]
11
+ - Updated dependencies [ccd928bc3]
12
+ - Updated dependencies [1aea2c6a4]
13
+ - @tinacms/toolkit@1.7.3
14
+ - tinacms@1.5.7
15
+
3
16
  ## 1.2.13
4
17
 
5
18
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/app",
3
- "version": "1.2.13",
3
+ "version": "1.2.14",
4
4
  "main": "src/main.tsx",
5
5
  "license": "Apache-2.0",
6
6
  "devDependencies": {
@@ -14,7 +14,7 @@
14
14
  "@heroicons/react": "1.0.6",
15
15
  "@monaco-editor/react": "4.4.5",
16
16
  "@tinacms/mdx": "1.3.10",
17
- "@tinacms/toolkit": "1.7.2",
17
+ "@tinacms/toolkit": "1.7.3",
18
18
  "@xstate/react": "3.0.0",
19
19
  "final-form": "4.20.7",
20
20
  "graphiql": "^2.4.0",
@@ -27,7 +27,7 @@
27
27
  "react-is": "17.0.2",
28
28
  "react-router-dom": "6.3.0",
29
29
  "tailwindcss": "^3.2.7",
30
- "tinacms": "1.5.6",
30
+ "tinacms": "1.5.7",
31
31
  "typescript": "^4.6.4",
32
32
  "zod": "^3.14.3"
33
33
  }
@@ -179,6 +179,8 @@ export const useGraphQLReducer = (
179
179
  >([])
180
180
  const [operationIndex, setOperationIndex] = React.useState(0)
181
181
 
182
+ const activeField = searchParams.get('active-field')
183
+
182
184
  React.useEffect(() => {
183
185
  const run = async () => {
184
186
  return Promise.all(
@@ -435,7 +437,6 @@ export const useGraphQLReducer = (
435
437
  { id: payload.id, data: result.data },
436
438
  ])
437
439
  }
438
- const activeField = searchParams.get('active-field')
439
440
  if (activeField) {
440
441
  setSearchParams({})
441
442
  const [queryId, eventFieldName] = activeField.split('---')
@@ -471,7 +472,10 @@ export const useGraphQLReducer = (
471
472
  },
472
473
  })
473
474
  },
474
- [resolvedDocuments.map((doc) => doc._internalSys.path).join('.')]
475
+ [
476
+ resolvedDocuments.map((doc) => doc._internalSys.path).join('.'),
477
+ activeField,
478
+ ]
475
479
  )
476
480
 
477
481
  const handleMessage = React.useCallback(
@@ -866,7 +870,11 @@ const getTemplateForDocument = (
866
870
  tinaSchema: TinaSchema
867
871
  ) => {
868
872
  const id = resolvedDocument._internalSys.path
869
- const collection = tinaSchema.getCollectionByFullPath(id)
873
+ let collection: Collection<true> | undefined
874
+ try {
875
+ collection = tinaSchema.getCollectionByFullPath(id)
876
+ } catch (e) {}
877
+
870
878
  if (!collection) {
871
879
  throw new Error(`Unable to determine collection for path ${id}`)
872
880
  }