@sanity/document-internationalization 2.1.0 → 2.1.1
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/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { TrashIcon, CogIcon, SplitVerticalIcon, CheckmarkIcon, AddIcon, EditIcon, TranslateIcon, InfoOutlineIcon } from '@sanity/icons';
|
|
3
3
|
import { Flex, Spinner, Stack, Text, Card, Grid, Button, useToast, Tooltip, Box, Badge, useClickOutside, TextInput, Popover, Inline, Dialog } from '@sanity/ui';
|
|
4
4
|
import { useMemo, useEffect, createContext, useContext, useState, useCallback } from 'react';
|
|
5
|
-
import { useSchema, Preview, useClient, isDocumentSchemaType, pathToString, useEditState, useValidationStatus, TextWithTone,
|
|
5
|
+
import { useSchema, Preview, useClient, useWorkspace, isDocumentSchemaType, pathToString, useEditState, useValidationStatus, TextWithTone, PatchEvent, unset, defineType, defineField, definePlugin, isSanityDocument } from 'sanity';
|
|
6
6
|
import { Feedback, useListeningQuery } from 'sanity-plugin-utils';
|
|
7
7
|
import { uuid } from '@sanity/uuid';
|
|
8
8
|
import { usePaneRouter, useDocumentPane } from 'sanity/desk';
|
|
@@ -219,6 +219,7 @@ function DocumentInternationalizationProvider(props) {
|
|
|
219
219
|
const client = useClient({
|
|
220
220
|
apiVersion: pluginConfig.apiVersion
|
|
221
221
|
});
|
|
222
|
+
const workspace = useWorkspace();
|
|
222
223
|
const supportedLanguages = Array.isArray(pluginConfig.supportedLanguages) ? pluginConfig.supportedLanguages :
|
|
223
224
|
// eslint-disable-next-line require-await
|
|
224
225
|
suspend(async () => {
|
|
@@ -226,7 +227,7 @@ function DocumentInternationalizationProvider(props) {
|
|
|
226
227
|
return pluginConfig.supportedLanguages(client);
|
|
227
228
|
}
|
|
228
229
|
return pluginConfig.supportedLanguages;
|
|
229
|
-
}, []);
|
|
230
|
+
}, [workspace]);
|
|
230
231
|
return /* @__PURE__ */jsx(DocumentInternationalizationContext.Provider, {
|
|
231
232
|
value: {
|
|
232
233
|
...pluginConfig,
|