@easyling/sanity-connector 0.0.1 → 0.0.2-rc.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/.tsbuildinfo +1 -1
- package/package.json +18 -12
- package/dist/actions/bulkTranslate.d.ts +0 -7
- package/dist/actions/bulkTranslate.d.ts.map +0 -1
- package/dist/actions/bulkTranslate.js +0 -543
- package/dist/actions/bulkTranslate.js.map +0 -1
- package/dist/actions/manageDNTFields.d.ts +0 -12
- package/dist/actions/manageDNTFields.d.ts.map +0 -1
- package/dist/actions/manageDNTFields.js +0 -100
- package/dist/actions/manageDNTFields.js.map +0 -1
- package/dist/actions/translateDocument.d.ts +0 -7
- package/dist/actions/translateDocument.d.ts.map +0 -1
- package/dist/actions/translateDocument.js +0 -256
- package/dist/actions/translateDocument.js.map +0 -1
- package/dist/components/RadioWithDefault.d.ts +0 -17
- package/dist/components/RadioWithDefault.d.ts.map +0 -1
- package/dist/components/RadioWithDefault.js +0 -29
- package/dist/components/RadioWithDefault.js.map +0 -1
- package/dist/components/auth/AuthNavbar.d.ts +0 -18
- package/dist/components/auth/AuthNavbar.d.ts.map +0 -1
- package/dist/components/auth/AuthNavbar.js +0 -15
- package/dist/components/auth/AuthNavbar.js.map +0 -1
- package/dist/components/auth/AuthStatus.d.ts +0 -27
- package/dist/components/auth/AuthStatus.d.ts.map +0 -1
- package/dist/components/auth/AuthStatus.js +0 -82
- package/dist/components/auth/AuthStatus.js.map +0 -1
- package/dist/components/auth/AuthStatusWrapper.d.ts +0 -15
- package/dist/components/auth/AuthStatusWrapper.d.ts.map +0 -1
- package/dist/components/auth/AuthStatusWrapper.js +0 -39
- package/dist/components/auth/AuthStatusWrapper.js.map +0 -1
- package/dist/components/auth/MigrationPrompt.d.ts +0 -20
- package/dist/components/auth/MigrationPrompt.d.ts.map +0 -1
- package/dist/components/auth/MigrationPrompt.js +0 -16
- package/dist/components/auth/MigrationPrompt.js.map +0 -1
- package/dist/components/auth/MigrationPromptWrapper.d.ts +0 -14
- package/dist/components/auth/MigrationPromptWrapper.d.ts.map +0 -1
- package/dist/components/auth/MigrationPromptWrapper.js +0 -16
- package/dist/components/auth/MigrationPromptWrapper.js.map +0 -1
- package/dist/components/auth/OAuthCallback.d.ts +0 -20
- package/dist/components/auth/OAuthCallback.d.ts.map +0 -1
- package/dist/components/auth/OAuthCallback.js +0 -12
- package/dist/components/auth/OAuthCallback.js.map +0 -1
- package/dist/components/auth/index.d.ts +0 -15
- package/dist/components/auth/index.d.ts.map +0 -1
- package/dist/components/auth/index.js +0 -12
- package/dist/components/auth/index.js.map +0 -1
- package/dist/components/config/LocaleConfigTool.d.ts +0 -17
- package/dist/components/config/LocaleConfigTool.d.ts.map +0 -1
- package/dist/components/config/LocaleConfigTool.js +0 -186
- package/dist/components/config/LocaleConfigTool.js.map +0 -1
- package/dist/components/config/LocaleConfigToolWrapper.d.ts +0 -13
- package/dist/components/config/LocaleConfigToolWrapper.d.ts.map +0 -1
- package/dist/components/config/LocaleConfigToolWrapper.js +0 -26
- package/dist/components/config/LocaleConfigToolWrapper.js.map +0 -1
- package/dist/components/config/OAuthConfig.d.ts +0 -26
- package/dist/components/config/OAuthConfig.d.ts.map +0 -1
- package/dist/components/config/OAuthConfig.js +0 -152
- package/dist/components/config/OAuthConfig.js.map +0 -1
- package/dist/components/config/OAuthConfigWrapper.d.ts +0 -13
- package/dist/components/config/OAuthConfigWrapper.d.ts.map +0 -1
- package/dist/components/config/OAuthConfigWrapper.js +0 -41
- package/dist/components/config/OAuthConfigWrapper.js.map +0 -1
- package/dist/components/config/PasswordInput.d.ts +0 -14
- package/dist/components/config/PasswordInput.d.ts.map +0 -1
- package/dist/components/config/PasswordInput.js +0 -23
- package/dist/components/config/PasswordInput.js.map +0 -1
- package/dist/components/config/index.d.ts +0 -9
- package/dist/components/config/index.d.ts.map +0 -1
- package/dist/components/config/index.js +0 -8
- package/dist/components/config/index.js.map +0 -1
- package/dist/components/config/localeConfigToolDefinition.d.ts +0 -13
- package/dist/components/config/localeConfigToolDefinition.d.ts.map +0 -1
- package/dist/components/config/localeConfigToolDefinition.js +0 -19
- package/dist/components/config/localeConfigToolDefinition.js.map +0 -1
- package/dist/components/config/oauthConfigToolDefinition.d.ts +0 -13
- package/dist/components/config/oauthConfigToolDefinition.d.ts.map +0 -1
- package/dist/components/config/oauthConfigToolDefinition.js +0 -19
- package/dist/components/config/oauthConfigToolDefinition.js.map +0 -1
- package/dist/components/dialogs/ConfirmationDialog.d.ts +0 -21
- package/dist/components/dialogs/ConfirmationDialog.d.ts.map +0 -1
- package/dist/components/dialogs/ConfirmationDialog.js +0 -28
- package/dist/components/dialogs/ConfirmationDialog.js.map +0 -1
- package/dist/components/dialogs/ErrorDialog.d.ts +0 -21
- package/dist/components/dialogs/ErrorDialog.d.ts.map +0 -1
- package/dist/components/dialogs/ErrorDialog.js +0 -28
- package/dist/components/dialogs/ErrorDialog.js.map +0 -1
- package/dist/components/dialogs/LocaleSelectionDialog.d.ts +0 -41
- package/dist/components/dialogs/LocaleSelectionDialog.d.ts.map +0 -1
- package/dist/components/dialogs/LocaleSelectionDialog.js +0 -117
- package/dist/components/dialogs/LocaleSelectionDialog.js.map +0 -1
- package/dist/components/dialogs/SuccessDialog.d.ts +0 -19
- package/dist/components/dialogs/SuccessDialog.d.ts.map +0 -1
- package/dist/components/dialogs/SuccessDialog.js +0 -37
- package/dist/components/dialogs/SuccessDialog.js.map +0 -1
- package/dist/components/dialogs/index.d.ts +0 -12
- package/dist/components/dialogs/index.d.ts.map +0 -1
- package/dist/components/dialogs/index.js +0 -8
- package/dist/components/dialogs/index.js.map +0 -1
- package/dist/components/dnt/DNTFieldBadge.d.ts +0 -16
- package/dist/components/dnt/DNTFieldBadge.d.ts.map +0 -1
- package/dist/components/dnt/DNTFieldBadge.js +0 -56
- package/dist/components/dnt/DNTFieldBadge.js.map +0 -1
- package/dist/components/dnt/DNTFieldComponent.d.ts +0 -17
- package/dist/components/dnt/DNTFieldComponent.d.ts.map +0 -1
- package/dist/components/dnt/DNTFieldComponent.js +0 -21
- package/dist/components/dnt/DNTFieldComponent.js.map +0 -1
- package/dist/components/dnt/DNTFieldInput.d.ts +0 -14
- package/dist/components/dnt/DNTFieldInput.d.ts.map +0 -1
- package/dist/components/dnt/DNTFieldInput.js +0 -76
- package/dist/components/dnt/DNTFieldInput.js.map +0 -1
- package/dist/components/dnt/index.d.ts +0 -7
- package/dist/components/dnt/index.d.ts.map +0 -1
- package/dist/components/dnt/index.js +0 -7
- package/dist/components/dnt/index.js.map +0 -1
- package/dist/config/index.d.ts +0 -6
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -6
- package/dist/config/index.js.map +0 -1
- package/dist/config/pluginConfig.d.ts +0 -163
- package/dist/config/pluginConfig.d.ts.map +0 -1
- package/dist/config/pluginConfig.js +0 -548
- package/dist/config/pluginConfig.js.map +0 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -12
- package/dist/index.js.map +0 -1
- package/dist/plugin.d.ts +0 -3
- package/dist/plugin.d.ts.map +0 -1
- package/dist/plugin.js +0 -137
- package/dist/plugin.js.map +0 -1
- package/dist/services/authStateManager.d.ts +0 -94
- package/dist/services/authStateManager.d.ts.map +0 -1
- package/dist/services/authStateManager.js +0 -208
- package/dist/services/authStateManager.js.map +0 -1
- package/dist/services/contentExtractor.d.ts +0 -95
- package/dist/services/contentExtractor.d.ts.map +0 -1
- package/dist/services/contentExtractor.js +0 -516
- package/dist/services/contentExtractor.js.map +0 -1
- package/dist/services/dialogService.d.ts +0 -96
- package/dist/services/dialogService.d.ts.map +0 -1
- package/dist/services/dialogService.js +0 -244
- package/dist/services/dialogService.js.map +0 -1
- package/dist/services/dntServiceManager.d.ts +0 -44
- package/dist/services/dntServiceManager.d.ts.map +0 -1
- package/dist/services/dntServiceManager.js +0 -74
- package/dist/services/dntServiceManager.js.map +0 -1
- package/dist/services/dntStorageAdapter.d.ts +0 -73
- package/dist/services/dntStorageAdapter.d.ts.map +0 -1
- package/dist/services/dntStorageAdapter.js +0 -192
- package/dist/services/dntStorageAdapter.js.map +0 -1
- package/dist/services/documentCreationService.d.ts +0 -139
- package/dist/services/documentCreationService.d.ts.map +0 -1
- package/dist/services/documentCreationService.js +0 -938
- package/dist/services/documentCreationService.js.map +0 -1
- package/dist/services/localeService.d.ts +0 -160
- package/dist/services/localeService.d.ts.map +0 -1
- package/dist/services/localeService.js +0 -300
- package/dist/services/localeService.js.map +0 -1
- package/dist/services/localeStorageAdapter.d.ts +0 -42
- package/dist/services/localeStorageAdapter.d.ts.map +0 -1
- package/dist/services/localeStorageAdapter.js +0 -107
- package/dist/services/localeStorageAdapter.js.map +0 -1
- package/dist/services/oauthConfigStorage.d.ts +0 -46
- package/dist/services/oauthConfigStorage.d.ts.map +0 -1
- package/dist/services/oauthConfigStorage.js +0 -122
- package/dist/services/oauthConfigStorage.js.map +0 -1
- package/dist/services/oauthService.d.ts +0 -48
- package/dist/services/oauthService.d.ts.map +0 -1
- package/dist/services/oauthService.js +0 -71
- package/dist/services/oauthService.js.map +0 -1
- package/dist/services/oauthServiceManager.d.ts +0 -189
- package/dist/services/oauthServiceManager.d.ts.map +0 -1
- package/dist/services/oauthServiceManager.js +0 -380
- package/dist/services/oauthServiceManager.js.map +0 -1
- package/dist/services/tokenStorage.d.ts +0 -54
- package/dist/services/tokenStorage.d.ts.map +0 -1
- package/dist/services/tokenStorage.js +0 -140
- package/dist/services/tokenStorage.js.map +0 -1
- package/dist/services/translationService.d.ts +0 -374
- package/dist/services/translationService.d.ts.map +0 -1
- package/dist/services/translationService.js +0 -687
- package/dist/services/translationService.js.map +0 -1
- package/dist/services/unifiedConfigStorage.d.ts +0 -124
- package/dist/services/unifiedConfigStorage.d.ts.map +0 -1
- package/dist/services/unifiedConfigStorage.js +0 -304
- package/dist/services/unifiedConfigStorage.js.map +0 -1
- package/dist/test-utils.d.ts +0 -9
- package/dist/test-utils.d.ts.map +0 -1
- package/dist/test-utils.js +0 -13
- package/dist/test-utils.js.map +0 -1
- package/dist/types/dialog.d.ts +0 -107
- package/dist/types/dialog.d.ts.map +0 -1
- package/dist/types/dialog.js +0 -6
- package/dist/types/dialog.js.map +0 -1
- package/dist/types/dnt.d.ts +0 -84
- package/dist/types/dnt.d.ts.map +0 -1
- package/dist/types/dnt.js +0 -5
- package/dist/types/dnt.js.map +0 -1
- package/dist/types/index.d.ts +0 -12
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -6
- package/dist/types/index.js.map +0 -1
- package/dist/types/locale.d.ts +0 -116
- package/dist/types/locale.d.ts.map +0 -1
- package/dist/types/locale.js +0 -189
- package/dist/types/locale.js.map +0 -1
- package/dist/types/oauth.d.ts +0 -90
- package/dist/types/oauth.d.ts.map +0 -1
- package/dist/types/oauth.js +0 -62
- package/dist/types/oauth.js.map +0 -1
- package/dist/types/pluginConfig.d.ts +0 -45
- package/dist/types/pluginConfig.d.ts.map +0 -1
- package/dist/types/pluginConfig.js +0 -6
- package/dist/types/pluginConfig.js.map +0 -1
- package/dist/types/translation.d.ts +0 -122
- package/dist/types/translation.d.ts.map +0 -1
- package/dist/types/translation.js +0 -6
- package/dist/types/translation.js.map +0 -1
- package/dist/utils/htmlFormatter.d.ts +0 -66
- package/dist/utils/htmlFormatter.d.ts.map +0 -1
- package/dist/utils/htmlFormatter.js +0 -191
- package/dist/utils/htmlFormatter.js.map +0 -1
- package/dist/utils/index.d.ts +0 -15
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -16
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -105
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -229
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/oauthErrorFeedback.d.ts +0 -76
- package/dist/utils/oauthErrorFeedback.d.ts.map +0 -1
- package/dist/utils/oauthErrorFeedback.js +0 -134
- package/dist/utils/oauthErrorFeedback.js.map +0 -1
- package/dist/utils/oauthLogger.d.ts +0 -176
- package/dist/utils/oauthLogger.d.ts.map +0 -1
- package/dist/utils/oauthLogger.js +0 -282
- package/dist/utils/oauthLogger.js.map +0 -1
- package/dist/utils/validator.d.ts +0 -67
- package/dist/utils/validator.d.ts.map +0 -1
- package/dist/utils/validator.js +0 -390
- package/dist/utils/validator.js.map +0 -1
|
@@ -1,548 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin configuration schema and utilities
|
|
3
|
-
* Requirements: 5.1, 5.2, 5.3
|
|
4
|
-
*/
|
|
5
|
-
import { RadioWithDefault } from '../components/RadioWithDefault';
|
|
6
|
-
/**
|
|
7
|
-
* Create unified plugin configuration schema for Sanity
|
|
8
|
-
* Internal type prefixed with EL_ to separate from customer document types
|
|
9
|
-
*
|
|
10
|
-
* This single document type stores all plugin configuration:
|
|
11
|
-
* - OAuth/authentication settings
|
|
12
|
-
* - Locale definitions
|
|
13
|
-
* - DNT (Do Not Translate) field mappings by document type
|
|
14
|
-
*
|
|
15
|
-
* @param PasswordInputComponent - Optional password input component for access token field
|
|
16
|
-
*/
|
|
17
|
-
export const createPluginConfigSchema = (PasswordInputComponent) => ({
|
|
18
|
-
name: 'EL_PluginConfiguration',
|
|
19
|
-
title: 'Easyling Translation Plugin Configuration',
|
|
20
|
-
type: 'document',
|
|
21
|
-
fields: [
|
|
22
|
-
// OAuth Configuration
|
|
23
|
-
{
|
|
24
|
-
name: 'projectId',
|
|
25
|
-
title: 'Project ID',
|
|
26
|
-
type: 'string',
|
|
27
|
-
description: 'Easyling project identifier',
|
|
28
|
-
group: 'oauth'
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'accessToken',
|
|
32
|
-
title: 'Access Token',
|
|
33
|
-
type: 'string',
|
|
34
|
-
description: 'Easyling API access token (hidden for security)',
|
|
35
|
-
group: 'oauth',
|
|
36
|
-
...(PasswordInputComponent && {
|
|
37
|
-
components: {
|
|
38
|
-
input: PasswordInputComponent
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
},
|
|
42
|
-
// Translation Settings
|
|
43
|
-
{
|
|
44
|
-
name: 'translationApiEndpoint',
|
|
45
|
-
title: 'Translation API Endpoint',
|
|
46
|
-
type: 'string',
|
|
47
|
-
description: 'The URL where translation requests will be sent (defaults to https://app.easyling.com/_ext/sanity/translate if not set)',
|
|
48
|
-
initialValue: 'https://app.easyling.com/_ext/sanity/translate',
|
|
49
|
-
placeholder: 'https://app.easyling.com/_ext/sanity/translate',
|
|
50
|
-
group: 'translation',
|
|
51
|
-
validation: (Rule) => Rule.custom((value) => {
|
|
52
|
-
// Optional field - if empty, will use default
|
|
53
|
-
if (!value || value.trim() === '') {
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
|
-
try {
|
|
57
|
-
const url = new URL(value.trim());
|
|
58
|
-
if (!['http:', 'https:'].includes(url.protocol)) {
|
|
59
|
-
return 'Must be a valid HTTP or HTTPS URL';
|
|
60
|
-
}
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
return 'Must be a valid HTTP or HTTPS URL';
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: 'defaultDocumentCreationMode',
|
|
70
|
-
title: 'Default Document Creation Mode',
|
|
71
|
-
type: 'string',
|
|
72
|
-
description: 'Whether translated documents should be created as drafts or published by default',
|
|
73
|
-
initialValue: 'draft',
|
|
74
|
-
group: 'translation',
|
|
75
|
-
options: {
|
|
76
|
-
list: [
|
|
77
|
-
{ title: 'Draft', value: 'draft' },
|
|
78
|
-
{ title: 'Published', value: 'published' }
|
|
79
|
-
],
|
|
80
|
-
layout: 'radio'
|
|
81
|
-
},
|
|
82
|
-
components: {
|
|
83
|
-
input: (props) => RadioWithDefault({ ...props, defaultValue: 'draft' })
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
// Advanced Settings
|
|
87
|
-
{
|
|
88
|
-
name: 'requestContentType',
|
|
89
|
-
title: 'Request Content-Type',
|
|
90
|
-
type: 'string',
|
|
91
|
-
description: 'Serialization format for translation request payloads',
|
|
92
|
-
initialValue: 'application/json',
|
|
93
|
-
group: 'advanced',
|
|
94
|
-
options: {
|
|
95
|
-
list: [
|
|
96
|
-
{ title: 'JSON', value: 'application/json' },
|
|
97
|
-
{ title: 'Protocol Buffer', value: 'application/x-protobuf' }
|
|
98
|
-
],
|
|
99
|
-
layout: 'radio'
|
|
100
|
-
},
|
|
101
|
-
components: {
|
|
102
|
-
input: (props) => RadioWithDefault({ ...props, defaultValue: 'application/json' })
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
name: 'responseAcceptHeader',
|
|
107
|
-
title: 'Response Accept Header',
|
|
108
|
-
type: 'string',
|
|
109
|
-
description: 'Preferred format for translation response (content negotiation)',
|
|
110
|
-
initialValue: 'application/json',
|
|
111
|
-
group: 'advanced',
|
|
112
|
-
options: {
|
|
113
|
-
list: [
|
|
114
|
-
{ title: 'JSON', value: 'application/json' },
|
|
115
|
-
{ title: 'Protocol Buffer', value: 'application/x-protobuf' }
|
|
116
|
-
],
|
|
117
|
-
layout: 'radio'
|
|
118
|
-
},
|
|
119
|
-
components: {
|
|
120
|
-
input: (props) => RadioWithDefault({ ...props, defaultValue: 'application/json' })
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
// Locale Configuration
|
|
124
|
-
{
|
|
125
|
-
name: 'locales',
|
|
126
|
-
title: 'Available Locales',
|
|
127
|
-
type: 'array',
|
|
128
|
-
description: 'Configure the locales available for translation',
|
|
129
|
-
group: 'locales',
|
|
130
|
-
of: [
|
|
131
|
-
{
|
|
132
|
-
type: 'object',
|
|
133
|
-
name: 'localeItem',
|
|
134
|
-
title: 'Locale',
|
|
135
|
-
fields: [
|
|
136
|
-
{
|
|
137
|
-
name: 'code',
|
|
138
|
-
title: 'Locale Code',
|
|
139
|
-
type: 'string',
|
|
140
|
-
description: 'Locale code in ISO 639-1 + ISO 3166-1 format (e.g., en-US, fr-FR)',
|
|
141
|
-
validation: (Rule) => Rule
|
|
142
|
-
.required()
|
|
143
|
-
.regex(/^[a-z]{2}-[A-Z]{2}$/, {
|
|
144
|
-
name: 'locale-code',
|
|
145
|
-
invert: false
|
|
146
|
-
})
|
|
147
|
-
.error('Locale code must be in format: xx-XX (e.g., en-US, fr-FR)')
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
name: 'displayName',
|
|
151
|
-
title: 'Display Name',
|
|
152
|
-
type: 'string',
|
|
153
|
-
description: 'Human-readable name for this locale (e.g., English (United States))',
|
|
154
|
-
validation: (Rule) => Rule
|
|
155
|
-
.required()
|
|
156
|
-
.min(1)
|
|
157
|
-
.error('Display name is required')
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
name: 'enabled',
|
|
161
|
-
title: 'Enabled',
|
|
162
|
-
type: 'boolean',
|
|
163
|
-
description: 'Whether this locale is available for translation',
|
|
164
|
-
initialValue: true
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
name: 'createdAt',
|
|
168
|
-
title: 'Created At',
|
|
169
|
-
type: 'string',
|
|
170
|
-
hidden: true
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
name: 'updatedAt',
|
|
174
|
-
title: 'Updated At',
|
|
175
|
-
type: 'string',
|
|
176
|
-
hidden: true
|
|
177
|
-
}
|
|
178
|
-
],
|
|
179
|
-
preview: {
|
|
180
|
-
select: {
|
|
181
|
-
title: 'displayName',
|
|
182
|
-
subtitle: 'code',
|
|
183
|
-
enabled: 'enabled'
|
|
184
|
-
},
|
|
185
|
-
prepare: ({ title, subtitle, enabled }) => ({
|
|
186
|
-
title: title || 'Unnamed Locale',
|
|
187
|
-
subtitle: subtitle ? `${subtitle}${enabled === false ? ' (Disabled)' : ''}` : ''
|
|
188
|
-
})
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
]
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
name: 'defaultLocale',
|
|
195
|
-
title: 'Default Locale',
|
|
196
|
-
type: 'string',
|
|
197
|
-
description: 'Default locale code to use when none is specified',
|
|
198
|
-
group: 'locales',
|
|
199
|
-
validation: (Rule) => Rule
|
|
200
|
-
.regex(/^[a-z]{2}-[A-Z]{2}$/, {
|
|
201
|
-
name: 'locale-code',
|
|
202
|
-
invert: false
|
|
203
|
-
})
|
|
204
|
-
.error('Default locale must be in format: xx-XX (e.g., en-US)')
|
|
205
|
-
},
|
|
206
|
-
// DNT Field Configuration
|
|
207
|
-
{
|
|
208
|
-
name: 'dntFieldConfigurations',
|
|
209
|
-
title: 'DNT Field Configurations',
|
|
210
|
-
type: 'array',
|
|
211
|
-
description: 'Document type DNT (Do Not Translate) field configurations. When you mark a field as DNT for a document type, it applies to all documents of that type. This is automatically managed when you toggle DNT badges in documents.',
|
|
212
|
-
group: 'dnt',
|
|
213
|
-
readOnly: true, // Read-only in UI - managed through DNT badge components
|
|
214
|
-
of: [
|
|
215
|
-
{
|
|
216
|
-
type: 'object',
|
|
217
|
-
name: 'dntTypeConfig',
|
|
218
|
-
title: 'Document Type DNT Configuration',
|
|
219
|
-
fields: [
|
|
220
|
-
{
|
|
221
|
-
name: 'documentType',
|
|
222
|
-
title: 'Document Type',
|
|
223
|
-
type: 'string',
|
|
224
|
-
description: 'The document type (e.g., "product", "article")',
|
|
225
|
-
validation: (Rule) => Rule.required()
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
name: 'fields',
|
|
229
|
-
title: 'DNT Fields',
|
|
230
|
-
type: 'array',
|
|
231
|
-
description: 'Fields marked as Do Not Translate',
|
|
232
|
-
of: [
|
|
233
|
-
{
|
|
234
|
-
type: 'object',
|
|
235
|
-
name: 'dntField',
|
|
236
|
-
fields: [
|
|
237
|
-
{
|
|
238
|
-
name: 'fieldPath',
|
|
239
|
-
title: 'Field Path',
|
|
240
|
-
type: 'string',
|
|
241
|
-
description: 'The field path (e.g., "sku", "price")',
|
|
242
|
-
validation: (Rule) => Rule.required()
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
name: 'dnt',
|
|
246
|
-
title: 'Do Not Translate',
|
|
247
|
-
type: 'boolean',
|
|
248
|
-
description: 'Whether this field should not be translated',
|
|
249
|
-
initialValue: true
|
|
250
|
-
}
|
|
251
|
-
],
|
|
252
|
-
preview: {
|
|
253
|
-
select: {
|
|
254
|
-
fieldPath: 'fieldPath',
|
|
255
|
-
dnt: 'dnt'
|
|
256
|
-
},
|
|
257
|
-
prepare: ({ fieldPath, dnt }) => ({
|
|
258
|
-
title: fieldPath || 'Unknown field',
|
|
259
|
-
subtitle: dnt ? 'Do Not Translate' : 'Translatable'
|
|
260
|
-
})
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
]
|
|
264
|
-
}
|
|
265
|
-
],
|
|
266
|
-
preview: {
|
|
267
|
-
select: {
|
|
268
|
-
documentType: 'documentType',
|
|
269
|
-
fields: 'fields'
|
|
270
|
-
},
|
|
271
|
-
prepare: ({ documentType, fields }) => ({
|
|
272
|
-
title: documentType || 'Unknown type',
|
|
273
|
-
subtitle: fields ? `${fields.length} DNT field${fields.length !== 1 ? 's' : ''}` : 'No DNT fields'
|
|
274
|
-
})
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
]
|
|
278
|
-
},
|
|
279
|
-
// Metadata
|
|
280
|
-
{
|
|
281
|
-
name: 'version',
|
|
282
|
-
title: 'Configuration Version',
|
|
283
|
-
type: 'string',
|
|
284
|
-
description: 'Internal version for configuration migration',
|
|
285
|
-
initialValue: '1.0.0',
|
|
286
|
-
readOnly: true,
|
|
287
|
-
hidden: true
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
name: 'lastUpdated',
|
|
291
|
-
title: 'Last Updated',
|
|
292
|
-
type: 'datetime',
|
|
293
|
-
description: 'When this configuration was last modified',
|
|
294
|
-
readOnly: true,
|
|
295
|
-
hidden: true
|
|
296
|
-
}
|
|
297
|
-
],
|
|
298
|
-
groups: [
|
|
299
|
-
{
|
|
300
|
-
name: 'oauth',
|
|
301
|
-
title: 'Authentication',
|
|
302
|
-
default: true
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
name: 'translation',
|
|
306
|
-
title: 'Translation Settings'
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
name: 'locales',
|
|
310
|
-
title: 'Locales'
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
name: 'dnt',
|
|
314
|
-
title: 'DNT Field Configuration',
|
|
315
|
-
description: 'View DNT (Do Not Translate) settings for all document types'
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
name: 'advanced',
|
|
319
|
-
title: '☢️ CAUTION ☢️ Dangerous Advanced Settings',
|
|
320
|
-
description: 'Advanced developer settings for request/response serialization. Changing these settings may break compatibility with your translation service.'
|
|
321
|
-
}
|
|
322
|
-
],
|
|
323
|
-
preview: {
|
|
324
|
-
prepare: () => ({
|
|
325
|
-
title: 'Easyling Translation Plugin Configuration',
|
|
326
|
-
subtitle: 'OAuth, Translation Settings, Locales, and DNT field settings'
|
|
327
|
-
})
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
/**
|
|
331
|
-
* Default export for backward compatibility and tests
|
|
332
|
-
*/
|
|
333
|
-
export const pluginConfigSchema = createPluginConfigSchema();
|
|
334
|
-
/**
|
|
335
|
-
* Legacy locale-only configuration schema (deprecated, kept for migration)
|
|
336
|
-
* @deprecated Use pluginConfigSchema instead
|
|
337
|
-
*/
|
|
338
|
-
export const legacyLocaleConfigSchema = {
|
|
339
|
-
name: 'EL_translation-plugin-config',
|
|
340
|
-
title: 'Translation Plugin Configuration (Legacy)',
|
|
341
|
-
type: 'object',
|
|
342
|
-
fields: [
|
|
343
|
-
{
|
|
344
|
-
name: 'locales',
|
|
345
|
-
title: 'Available Locales',
|
|
346
|
-
type: 'array',
|
|
347
|
-
description: 'Configure the locales available for translation',
|
|
348
|
-
of: [
|
|
349
|
-
{
|
|
350
|
-
type: 'object',
|
|
351
|
-
title: 'Locale',
|
|
352
|
-
fields: [
|
|
353
|
-
{
|
|
354
|
-
name: 'code',
|
|
355
|
-
title: 'Locale Code',
|
|
356
|
-
type: 'string',
|
|
357
|
-
description: 'Locale code in ISO 639-1 + ISO 3166-1 format (e.g., en-US, fr-FR)',
|
|
358
|
-
validation: (Rule) => Rule
|
|
359
|
-
.required()
|
|
360
|
-
.regex(/^[a-z]{2}-[A-Z]{2}$/, {
|
|
361
|
-
name: 'locale-code',
|
|
362
|
-
invert: false
|
|
363
|
-
})
|
|
364
|
-
.error('Locale code must be in format: xx-XX (e.g., en-US, fr-FR)')
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
name: 'displayName',
|
|
368
|
-
title: 'Display Name',
|
|
369
|
-
type: 'string',
|
|
370
|
-
description: 'Human-readable name for this locale (e.g., English (United States))',
|
|
371
|
-
validation: (Rule) => Rule
|
|
372
|
-
.required()
|
|
373
|
-
.min(1)
|
|
374
|
-
.error('Display name is required')
|
|
375
|
-
},
|
|
376
|
-
{
|
|
377
|
-
name: 'enabled',
|
|
378
|
-
title: 'Enabled',
|
|
379
|
-
type: 'boolean',
|
|
380
|
-
description: 'Whether this locale is available for translation',
|
|
381
|
-
initialValue: true
|
|
382
|
-
}
|
|
383
|
-
],
|
|
384
|
-
preview: {
|
|
385
|
-
select: {
|
|
386
|
-
title: 'displayName',
|
|
387
|
-
subtitle: 'code',
|
|
388
|
-
enabled: 'enabled'
|
|
389
|
-
},
|
|
390
|
-
prepare: ({ title, subtitle, enabled }) => ({
|
|
391
|
-
title: title || 'Unnamed Locale',
|
|
392
|
-
subtitle: `${subtitle}${enabled ? '' : ' (Disabled)'}`,
|
|
393
|
-
media: enabled ? '🌐' : '🚫'
|
|
394
|
-
})
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
]
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
name: 'defaultLocale',
|
|
401
|
-
title: 'Default Locale',
|
|
402
|
-
type: 'string',
|
|
403
|
-
description: 'Default locale code to use when none is specified',
|
|
404
|
-
validation: (Rule) => Rule
|
|
405
|
-
.regex(/^[a-z]{2}-[A-Z]{2}$/, {
|
|
406
|
-
name: 'locale-code',
|
|
407
|
-
invert: false
|
|
408
|
-
})
|
|
409
|
-
.error('Default locale must be in format: xx-XX (e.g., en-US)')
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
name: 'version',
|
|
413
|
-
title: 'Configuration Version',
|
|
414
|
-
type: 'string',
|
|
415
|
-
description: 'Internal version for configuration migration',
|
|
416
|
-
initialValue: '1.0.0',
|
|
417
|
-
readOnly: true
|
|
418
|
-
}
|
|
419
|
-
]
|
|
420
|
-
};
|
|
421
|
-
/**
|
|
422
|
-
* Default locale configuration
|
|
423
|
-
*/
|
|
424
|
-
export const defaultLocaleConfig = {
|
|
425
|
-
locales: [],
|
|
426
|
-
version: '1.0.0',
|
|
427
|
-
lastUpdated: new Date().toISOString()
|
|
428
|
-
};
|
|
429
|
-
/**
|
|
430
|
-
* Common locale definitions for quick setup
|
|
431
|
-
*/
|
|
432
|
-
export const commonLocales = [
|
|
433
|
-
{
|
|
434
|
-
code: 'en-US',
|
|
435
|
-
displayName: 'English (United States)',
|
|
436
|
-
enabled: true,
|
|
437
|
-
createdAt: new Date().toISOString(),
|
|
438
|
-
updatedAt: new Date().toISOString()
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
code: 'en-GB',
|
|
442
|
-
displayName: 'English (United Kingdom)',
|
|
443
|
-
enabled: true,
|
|
444
|
-
createdAt: new Date().toISOString(),
|
|
445
|
-
updatedAt: new Date().toISOString()
|
|
446
|
-
},
|
|
447
|
-
{
|
|
448
|
-
code: 'es-ES',
|
|
449
|
-
displayName: 'Spanish (Spain)',
|
|
450
|
-
enabled: true,
|
|
451
|
-
createdAt: new Date().toISOString(),
|
|
452
|
-
updatedAt: new Date().toISOString()
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
code: 'es-MX',
|
|
456
|
-
displayName: 'Spanish (Mexico)',
|
|
457
|
-
enabled: true,
|
|
458
|
-
createdAt: new Date().toISOString(),
|
|
459
|
-
updatedAt: new Date().toISOString()
|
|
460
|
-
},
|
|
461
|
-
{
|
|
462
|
-
code: 'fr-FR',
|
|
463
|
-
displayName: 'French (France)',
|
|
464
|
-
enabled: true,
|
|
465
|
-
createdAt: new Date().toISOString(),
|
|
466
|
-
updatedAt: new Date().toISOString()
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
code: 'de-DE',
|
|
470
|
-
displayName: 'German (Germany)',
|
|
471
|
-
enabled: true,
|
|
472
|
-
createdAt: new Date().toISOString(),
|
|
473
|
-
updatedAt: new Date().toISOString()
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
code: 'it-IT',
|
|
477
|
-
displayName: 'Italian (Italy)',
|
|
478
|
-
enabled: true,
|
|
479
|
-
createdAt: new Date().toISOString(),
|
|
480
|
-
updatedAt: new Date().toISOString()
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
code: 'pt-BR',
|
|
484
|
-
displayName: 'Portuguese (Brazil)',
|
|
485
|
-
enabled: true,
|
|
486
|
-
createdAt: new Date().toISOString(),
|
|
487
|
-
updatedAt: new Date().toISOString()
|
|
488
|
-
},
|
|
489
|
-
{
|
|
490
|
-
code: 'ja-JP',
|
|
491
|
-
displayName: 'Japanese (Japan)',
|
|
492
|
-
enabled: true,
|
|
493
|
-
createdAt: new Date().toISOString(),
|
|
494
|
-
updatedAt: new Date().toISOString()
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
code: 'ko-KR',
|
|
498
|
-
displayName: 'Korean (South Korea)',
|
|
499
|
-
enabled: true,
|
|
500
|
-
createdAt: new Date().toISOString(),
|
|
501
|
-
updatedAt: new Date().toISOString()
|
|
502
|
-
},
|
|
503
|
-
{
|
|
504
|
-
code: 'zh-CN',
|
|
505
|
-
displayName: 'Chinese (Simplified)',
|
|
506
|
-
enabled: true,
|
|
507
|
-
createdAt: new Date().toISOString(),
|
|
508
|
-
updatedAt: new Date().toISOString()
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
code: 'zh-TW',
|
|
512
|
-
displayName: 'Chinese (Traditional)',
|
|
513
|
-
enabled: true,
|
|
514
|
-
createdAt: new Date().toISOString(),
|
|
515
|
-
updatedAt: new Date().toISOString()
|
|
516
|
-
}
|
|
517
|
-
];
|
|
518
|
-
/**
|
|
519
|
-
* Validate locale code format
|
|
520
|
-
*/
|
|
521
|
-
export function validateLocaleCode(code) {
|
|
522
|
-
const localeCodeRegex = /^[a-z]{2}-[A-Z]{2}$/;
|
|
523
|
-
return localeCodeRegex.test(code);
|
|
524
|
-
}
|
|
525
|
-
/**
|
|
526
|
-
* Create a new locale definition with current timestamps
|
|
527
|
-
*/
|
|
528
|
-
export function createLocaleDefinition(code, displayName, enabled = true) {
|
|
529
|
-
const now = new Date().toISOString();
|
|
530
|
-
return {
|
|
531
|
-
code,
|
|
532
|
-
displayName,
|
|
533
|
-
enabled,
|
|
534
|
-
createdAt: now,
|
|
535
|
-
updatedAt: now
|
|
536
|
-
};
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Update an existing locale definition with new timestamp
|
|
540
|
-
*/
|
|
541
|
-
export function updateLocaleDefinition(locale, updates) {
|
|
542
|
-
return {
|
|
543
|
-
...locale,
|
|
544
|
-
...updates,
|
|
545
|
-
updatedAt: new Date().toISOString()
|
|
546
|
-
};
|
|
547
|
-
}
|
|
548
|
-
//# sourceMappingURL=pluginConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pluginConfig.js","sourceRoot":"","sources":["../../src/config/pluginConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,wB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pC,IAAY,EACZ,WAAmB,EACnB,UAAmB,IAAI;IAEvB,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,OAAO;QACL,IAAI;QACJ,WAAW;QACX,OAAO;QACP,SAAS,EAAE,GAAG;QACd,SAAS,EAAE,GAAG;KACf,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAwB,EACxB,OAAmE;IAEnE,OAAO;QACL,GAAG,MAAM;QACT,GAAG,OAAO;QACV,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Main entry point for the Sanity Translation Plugin
|
|
3
|
-
*/
|
|
4
|
-
export { default } from './plugin';
|
|
5
|
-
export type { LocaleDefinition, LocaleConfig, TranslationRequestPayload, TranslationResponse, TranslatableField, DNTFieldPreference, DNTPreferences, DNTTypeConfig, DNTStorage } from './types';
|
|
6
|
-
export type { UnifiedPluginConfig } from './services/unifiedConfigStorage';
|
|
7
|
-
export { createPluginConfigSchema, pluginConfigSchema } from './config/pluginConfig';
|
|
8
|
-
export { DNTFieldBadge, withDNTBadge, DNTFieldInput } from './components/dnt';
|
|
9
|
-
export { DNTStorageAdapter, LegacyDNTStorageAdapter } from './services/dntStorageAdapter';
|
|
10
|
-
export { UnifiedConfigStorage } from './services/unifiedConfigStorage';
|
|
11
|
-
export { DNTServiceManager, getDNTStorage } from './services/dntServiceManager';
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnC,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,UAAU,EACX,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGrF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG9E,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Main entry point for the Sanity Translation Plugin
|
|
3
|
-
*/
|
|
4
|
-
export { default } from './plugin';
|
|
5
|
-
export { createPluginConfigSchema, pluginConfigSchema } from './config/pluginConfig';
|
|
6
|
-
// Export DNT components for custom schema usage
|
|
7
|
-
export { DNTFieldBadge, withDNTBadge, DNTFieldInput } from './components/dnt';
|
|
8
|
-
// Export storage services for advanced usage
|
|
9
|
-
export { DNTStorageAdapter, LegacyDNTStorageAdapter } from './services/dntStorageAdapter';
|
|
10
|
-
export { UnifiedConfigStorage } from './services/unifiedConfigStorage';
|
|
11
|
-
export { DNTServiceManager, getDNTStorage } from './services/dntServiceManager';
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAiBnC,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAErF,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE9E,6CAA6C;AAC7C,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/plugin.d.ts
DELETED
package/dist/plugin.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.tsx"],"names":[],"mappings":";AAyFA,wBAiEG"}
|