@sanity/document-internationalization 6.2.40 → 6.2.42
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.d.ts +20 -21
- package/dist/index.d.ts.map +1 -1
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@sanity/ui/styles.css";
|
|
2
2
|
import { DocumentActionDescription, DocumentActionProps, DocumentLanguageFilterContext, FieldDefinition, ObjectSchemaType, Reference, SanityClient, SanityDocument, SanityDocumentLike } from "sanity";
|
|
3
3
|
import { InternationalizedArrayItem, PluginConfig as PluginConfig$1 } from "sanity-plugin-internationalized-array";
|
|
4
|
-
declare function useDeleteTranslationAction(props: DocumentActionProps): DocumentActionDescription;
|
|
5
|
-
declare namespace useDeleteTranslationAction {
|
|
4
|
+
export declare function useDeleteTranslationAction(props: DocumentActionProps): DocumentActionDescription;
|
|
5
|
+
export declare namespace useDeleteTranslationAction {
|
|
6
6
|
var action: string;
|
|
7
7
|
var displayName: string;
|
|
8
8
|
}
|
|
@@ -10,23 +10,23 @@ declare namespace useDeleteTranslationAction {
|
|
|
10
10
|
* @deprecated use useDeleteTranslationAction instead
|
|
11
11
|
* Will be removed in the next major version
|
|
12
12
|
*/
|
|
13
|
-
declare const DeleteTranslationAction: (props: DocumentActionProps) => DocumentActionDescription;
|
|
14
|
-
declare function useDuplicateWithTranslationsAction({ id, type, onComplete }: DocumentActionProps): DocumentActionDescription;
|
|
15
|
-
declare namespace useDuplicateWithTranslationsAction {
|
|
13
|
+
export declare const DeleteTranslationAction: (props: DocumentActionProps) => DocumentActionDescription;
|
|
14
|
+
export declare function useDuplicateWithTranslationsAction({ id, type, onComplete }: DocumentActionProps): DocumentActionDescription;
|
|
15
|
+
export declare namespace useDuplicateWithTranslationsAction {
|
|
16
16
|
var action: string;
|
|
17
17
|
var displayName: string;
|
|
18
18
|
}
|
|
19
|
-
declare function DuplicateWithTranslationsAction(props: DocumentActionProps): DocumentActionDescription;
|
|
20
|
-
declare namespace DuplicateWithTranslationsAction {
|
|
19
|
+
export declare function DuplicateWithTranslationsAction(props: DocumentActionProps): DocumentActionDescription;
|
|
20
|
+
export declare namespace DuplicateWithTranslationsAction {
|
|
21
21
|
var action: string;
|
|
22
22
|
var displayName: string;
|
|
23
23
|
}
|
|
24
|
-
type Language = {
|
|
24
|
+
export type Language = {
|
|
25
25
|
id: Intl.UnicodeBCP47LocaleIdentifier;
|
|
26
26
|
title: string;
|
|
27
27
|
};
|
|
28
|
-
type SupportedLanguages = Language[] | ((client: SanityClient) => Promise<Language[]>);
|
|
29
|
-
type PluginCallbackArgs = {
|
|
28
|
+
export type SupportedLanguages = Language[] | ((client: SanityClient) => Promise<Language[]>);
|
|
29
|
+
export type PluginCallbackArgs = {
|
|
30
30
|
sourceDocument: SanityDocument;
|
|
31
31
|
newDocument: SanityDocument;
|
|
32
32
|
sourceLanguageId: string;
|
|
@@ -34,7 +34,7 @@ type PluginCallbackArgs = {
|
|
|
34
34
|
metaDocumentId: string;
|
|
35
35
|
client: SanityClient;
|
|
36
36
|
};
|
|
37
|
-
type PluginConfig = {
|
|
37
|
+
export type PluginConfig = {
|
|
38
38
|
supportedLanguages: SupportedLanguages;
|
|
39
39
|
schemaTypes: string[];
|
|
40
40
|
languageField?: string;
|
|
@@ -60,28 +60,28 @@ type PluginConfig = {
|
|
|
60
60
|
*/
|
|
61
61
|
addTemplates?: boolean;
|
|
62
62
|
};
|
|
63
|
-
type PluginConfigContext = Required<Omit<PluginConfig, 'metadataInternationalization'>> & {
|
|
63
|
+
export type PluginConfigContext = Required<Omit<PluginConfig, 'metadataInternationalization'>> & {
|
|
64
64
|
supportedLanguages: Language[];
|
|
65
65
|
metadataInternationalization?: Pick<PluginConfig$1, 'buttonLocations' | 'buttonAddAll' | 'languageDisplay'>;
|
|
66
66
|
};
|
|
67
|
-
type TranslationReference = InternationalizedArrayItem<Reference> & {
|
|
67
|
+
export type TranslationReference = InternationalizedArrayItem<Reference> & {
|
|
68
68
|
_type: 'internationalizedArrayReferenceValue';
|
|
69
69
|
value: Reference;
|
|
70
70
|
};
|
|
71
|
-
type Metadata = {
|
|
71
|
+
export type Metadata = {
|
|
72
72
|
_id: string;
|
|
73
73
|
_createdAt: string;
|
|
74
74
|
translations: TranslationReference[];
|
|
75
75
|
};
|
|
76
|
-
type MetadataDocument = SanityDocumentLike & {
|
|
76
|
+
export type MetadataDocument = SanityDocumentLike & {
|
|
77
77
|
schemaTypes: string[];
|
|
78
78
|
translations: TranslationReference[];
|
|
79
79
|
};
|
|
80
|
-
type DocumentInternationalizationMenuProps = {
|
|
80
|
+
export type DocumentInternationalizationMenuProps = {
|
|
81
81
|
schemaType: ObjectSchemaType;
|
|
82
82
|
documentId: string;
|
|
83
83
|
};
|
|
84
|
-
interface DocumentInternationalizationSchemaOpts {
|
|
84
|
+
export interface DocumentInternationalizationSchemaOpts {
|
|
85
85
|
documentInternationalization?: {
|
|
86
86
|
/** Set to true to disable duplication of this field or type */
|
|
87
87
|
exclude?: boolean;
|
|
@@ -106,8 +106,7 @@ declare module 'sanity' {
|
|
|
106
106
|
interface UrlOptions extends DocumentInternationalizationSchemaOpts {}
|
|
107
107
|
interface EmailOptions extends DocumentInternationalizationSchemaOpts {}
|
|
108
108
|
}
|
|
109
|
-
declare function useDocumentInternationalizationContext(): PluginConfigContext;
|
|
110
|
-
declare function DocumentInternationalizationMenu(props: DocumentInternationalizationMenuProps): React.JSX.Element | null;
|
|
111
|
-
declare const documentInternationalization: import("sanity").Plugin<PluginConfig>;
|
|
112
|
-
export { DeleteTranslationAction, DocumentInternationalizationMenu, DocumentInternationalizationMenuProps, DocumentInternationalizationSchemaOpts, DuplicateWithTranslationsAction, Language, Metadata, MetadataDocument, PluginCallbackArgs, PluginConfig, PluginConfigContext, SupportedLanguages, TranslationReference, documentInternationalization, useDeleteTranslationAction, useDocumentInternationalizationContext, useDuplicateWithTranslationsAction };
|
|
109
|
+
export declare function useDocumentInternationalizationContext(): PluginConfigContext;
|
|
110
|
+
export declare function DocumentInternationalizationMenu(props: DocumentInternationalizationMenuProps): React.JSX.Element | null;
|
|
111
|
+
export declare const documentInternationalization: import("sanity").Plugin<PluginConfig>;
|
|
113
112
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["InternationalizedArrayPluginConfig"],"sources":["../src/actions/DeleteTranslationAction.tsx","../src/actions/DuplicateWithTranslationsAction.tsx","../src/types.ts","../src/components/DocumentInternationalizationContext.tsx","../src/components/DocumentInternationalizationMenu.tsx","../src/plugin.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["InternationalizedArrayPluginConfig"],"sources":["../src/actions/DeleteTranslationAction.tsx","../src/actions/DuplicateWithTranslationsAction.tsx","../src/types.ts","../src/components/DocumentInternationalizationContext.tsx","../src/components/DocumentInternationalizationMenu.tsx","../src/plugin.tsx"],"mappings":";;;wBAmCE,2BAAA,OAAO,sBACN;;;;;;;;;qBA6FU,0BAAuB,OAAW,wBAAsB;wBC5ElB,qCACjD,IACA,MAEA,cACC,sBAAsB;;;;;wBAqMvB,gCAAA,OAAO,sBACN;;;;;YClPS;EACV,IAAI,KAAK;EACT;;YAGU,qBAAqB,eAAe,QAAQ,iBAAiB,QAAQ;YAErE;EACV,gBAAgB;EAChB,aAAa;EACb;EACA;EACA;EACA,QAAQ;;YAGE;EACV,oBAAoB;EACpB;EACA;EACA;EACA;EACA,iBAAiB;EACjB;EACA;EACA,aAAa,MAAM,uBAAuB;EAC1C,4CAA4C,KAAK;;;;;;EAMjD;;;;EAIA,+BAA+B,KAC7BA;;;;EAMF;;YAMU,sBAAsB,SAAS,KAAK;EAC9C,oBAAoB;EACpB,+BAA+B,KAC7BA;;YAKQ,uBAAuB,2BAA2B;EAC5D;EACA,OAAO;;YAGG;EACV;EACA;EACA,cAAc;;YAGJ,mBAAmB;EAC7B;EACA,cAAc;;YAGJ;EACV,YAAY;EACZ;;iBAIe;EACf;;IAEE;;;;YAKQ,qBAAqB;YACrB,qBAAqB;YACrB,uBAAuB;YACvB,qCAAqC;YACrC,oBAAoB;YACpB,wBAAwB;YACxB,oBAAoB;YACpB,wBAAwB;YACxB,qBAAqB;YACrB,sBAAsB;YACtB,sBAAsB;YACtB,6BAA6B;YAC7B,oBAAoB;YACpB,sBAAsB;YACtB,oBAAoB;YACpB,mBAAmB;YACnB,qBAAqB;;wBC5GjB,0CAA0C;wBCQ1C,iCACd,OAAO,wCACN,MAAM,IAAI;qBCJA,+CAA4B,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/document-internationalization",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.42",
|
|
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",
|
|
@@ -28,35 +28,35 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@sanity/icons": "^5.2.3",
|
|
31
|
-
"@sanity/mutator": "^6.
|
|
32
|
-
"@sanity/ui": "^4.4.
|
|
33
|
-
"@sanity/util": "^6.
|
|
31
|
+
"@sanity/mutator": "^6.18.0",
|
|
32
|
+
"@sanity/ui": "^4.4.5",
|
|
33
|
+
"@sanity/util": "^6.18.0",
|
|
34
34
|
"@sanity/uuid": "^3.0.3",
|
|
35
35
|
"rxjs": "^7.8.2",
|
|
36
|
-
"sanity-plugin-utils": "^2.0.
|
|
36
|
+
"sanity-plugin-utils": "^2.0.22"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@sanity/tsconfig": "^2.2.1",
|
|
40
|
-
"@sanity/tsdown-config": "^0.
|
|
40
|
+
"@sanity/tsdown-config": "^0.29.0",
|
|
41
41
|
"@testing-library/jest-dom": "^7.0.1",
|
|
42
42
|
"@testing-library/react": "^16.3.3",
|
|
43
|
-
"@types/node": "^24.
|
|
43
|
+
"@types/node": "^24.19.2",
|
|
44
44
|
"@types/react": "^19.3.0",
|
|
45
45
|
"@types/react-dom": "^19.3.0",
|
|
46
46
|
"jsdom": "^29.1.1",
|
|
47
47
|
"oxc-transform-react": "^0.153.0",
|
|
48
48
|
"react": "^19.3.0",
|
|
49
49
|
"react-dom": "^19.3.0",
|
|
50
|
-
"sanity": "^6.
|
|
51
|
-
"sanity-plugin-internationalized-array": "5.3.
|
|
50
|
+
"sanity": "^6.18.0",
|
|
51
|
+
"sanity-plugin-internationalized-array": "5.3.5",
|
|
52
52
|
"styled-components": "^6.5.3",
|
|
53
|
-
"tsdown": "^0.
|
|
53
|
+
"tsdown": "^0.23.1"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"react": "^19.2",
|
|
57
57
|
"react-dom": "^19.2",
|
|
58
58
|
"sanity": "^5 || ^6.0.0-0",
|
|
59
|
-
"sanity-plugin-internationalized-array": "^5.3.
|
|
59
|
+
"sanity-plugin-internationalized-array": "^5.3.5"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=20.19 <22 || >=22.12"
|