@sanity/document-internationalization 2.1.0 → 2.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/document-internationalization",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Create unique translations of a document based on its language, joined by a shared reference document.",
5
5
  "keywords": [
6
6
  "sanity",
@@ -63,7 +63,7 @@
63
63
  "@commitlint/config-conventional": "^18.1.0",
64
64
  "@sanity/pkg-utils": "^2.4.8",
65
65
  "@sanity/plugin-kit": "^3.1.10",
66
- "@sanity/semantic-release-preset": "^4.1.6",
66
+ "@sanity/semantic-release-preset": "^4.1.7",
67
67
  "@types/react": "^18.0.27",
68
68
  "@types/styled-components": "^5.1.26",
69
69
  "@typescript-eslint/eslint-plugin": "^5.51.0",
@@ -85,7 +85,7 @@
85
85
  "react-is": "^18",
86
86
  "rimraf": "^4.1.2",
87
87
  "sanity": "^3.3.1",
88
- "semantic-release": "^22.0.6",
88
+ "semantic-release": "^23.0.7",
89
89
  "typescript": "^4.9.5"
90
90
  },
91
91
  "peerDependencies": {
@@ -1,6 +1,6 @@
1
1
  import {useContext} from 'react'
2
2
  import {createContext} from 'react'
3
- import {LayoutProps, useClient} from 'sanity'
3
+ import {LayoutProps, useClient, useWorkspace} from 'sanity'
4
4
  import {suspend} from 'suspend-react'
5
5
 
6
6
  import {DEFAULT_CONFIG} from '../constants'
@@ -26,6 +26,7 @@ export function DocumentInternationalizationProvider(
26
26
  const {pluginConfig} = props
27
27
 
28
28
  const client = useClient({apiVersion: pluginConfig.apiVersion})
29
+ const workspace = useWorkspace()
29
30
  const supportedLanguages = Array.isArray(pluginConfig.supportedLanguages)
30
31
  ? pluginConfig.supportedLanguages
31
32
  : // eslint-disable-next-line require-await
@@ -34,7 +35,7 @@ export function DocumentInternationalizationProvider(
34
35
  return pluginConfig.supportedLanguages(client)
35
36
  }
36
37
  return pluginConfig.supportedLanguages
37
- }, [])
38
+ }, [workspace])
38
39
 
39
40
  return (
40
41
  <DocumentInternationalizationContext.Provider