@easyling/sanity-connector 0.0.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/LICENSE +21 -0
- package/README.md +482 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/actions/bulkTranslate.d.ts +7 -0
- package/dist/actions/bulkTranslate.d.ts.map +1 -0
- package/dist/actions/bulkTranslate.js +543 -0
- package/dist/actions/bulkTranslate.js.map +1 -0
- package/dist/actions/manageDNTFields.d.ts +12 -0
- package/dist/actions/manageDNTFields.d.ts.map +1 -0
- package/dist/actions/manageDNTFields.js +100 -0
- package/dist/actions/manageDNTFields.js.map +1 -0
- package/dist/actions/translateDocument.d.ts +7 -0
- package/dist/actions/translateDocument.d.ts.map +1 -0
- package/dist/actions/translateDocument.js +256 -0
- package/dist/actions/translateDocument.js.map +1 -0
- package/dist/components/RadioWithDefault.d.ts +17 -0
- package/dist/components/RadioWithDefault.d.ts.map +1 -0
- package/dist/components/RadioWithDefault.js +29 -0
- package/dist/components/RadioWithDefault.js.map +1 -0
- package/dist/components/auth/AuthNavbar.d.ts +18 -0
- package/dist/components/auth/AuthNavbar.d.ts.map +1 -0
- package/dist/components/auth/AuthNavbar.js +15 -0
- package/dist/components/auth/AuthNavbar.js.map +1 -0
- package/dist/components/auth/AuthStatus.d.ts +27 -0
- package/dist/components/auth/AuthStatus.d.ts.map +1 -0
- package/dist/components/auth/AuthStatus.js +82 -0
- package/dist/components/auth/AuthStatus.js.map +1 -0
- package/dist/components/auth/AuthStatusWrapper.d.ts +15 -0
- package/dist/components/auth/AuthStatusWrapper.d.ts.map +1 -0
- package/dist/components/auth/AuthStatusWrapper.js +39 -0
- package/dist/components/auth/AuthStatusWrapper.js.map +1 -0
- package/dist/components/auth/MigrationPrompt.d.ts +20 -0
- package/dist/components/auth/MigrationPrompt.d.ts.map +1 -0
- package/dist/components/auth/MigrationPrompt.js +16 -0
- package/dist/components/auth/MigrationPrompt.js.map +1 -0
- package/dist/components/auth/MigrationPromptWrapper.d.ts +14 -0
- package/dist/components/auth/MigrationPromptWrapper.d.ts.map +1 -0
- package/dist/components/auth/MigrationPromptWrapper.js +16 -0
- package/dist/components/auth/MigrationPromptWrapper.js.map +1 -0
- package/dist/components/auth/OAuthCallback.d.ts +20 -0
- package/dist/components/auth/OAuthCallback.d.ts.map +1 -0
- package/dist/components/auth/OAuthCallback.js +12 -0
- package/dist/components/auth/OAuthCallback.js.map +1 -0
- package/dist/components/auth/index.d.ts +15 -0
- package/dist/components/auth/index.d.ts.map +1 -0
- package/dist/components/auth/index.js +12 -0
- package/dist/components/auth/index.js.map +1 -0
- package/dist/components/config/LocaleConfigTool.d.ts +17 -0
- package/dist/components/config/LocaleConfigTool.d.ts.map +1 -0
- package/dist/components/config/LocaleConfigTool.js +186 -0
- package/dist/components/config/LocaleConfigTool.js.map +1 -0
- package/dist/components/config/LocaleConfigToolWrapper.d.ts +13 -0
- package/dist/components/config/LocaleConfigToolWrapper.d.ts.map +1 -0
- package/dist/components/config/LocaleConfigToolWrapper.js +26 -0
- package/dist/components/config/LocaleConfigToolWrapper.js.map +1 -0
- package/dist/components/config/OAuthConfig.d.ts +26 -0
- package/dist/components/config/OAuthConfig.d.ts.map +1 -0
- package/dist/components/config/OAuthConfig.js +152 -0
- package/dist/components/config/OAuthConfig.js.map +1 -0
- package/dist/components/config/OAuthConfigWrapper.d.ts +13 -0
- package/dist/components/config/OAuthConfigWrapper.d.ts.map +1 -0
- package/dist/components/config/OAuthConfigWrapper.js +41 -0
- package/dist/components/config/OAuthConfigWrapper.js.map +1 -0
- package/dist/components/config/PasswordInput.d.ts +14 -0
- package/dist/components/config/PasswordInput.d.ts.map +1 -0
- package/dist/components/config/PasswordInput.js +23 -0
- package/dist/components/config/PasswordInput.js.map +1 -0
- package/dist/components/config/index.d.ts +9 -0
- package/dist/components/config/index.d.ts.map +1 -0
- package/dist/components/config/index.js +8 -0
- package/dist/components/config/index.js.map +1 -0
- package/dist/components/config/localeConfigToolDefinition.d.ts +13 -0
- package/dist/components/config/localeConfigToolDefinition.d.ts.map +1 -0
- package/dist/components/config/localeConfigToolDefinition.js +19 -0
- package/dist/components/config/localeConfigToolDefinition.js.map +1 -0
- package/dist/components/config/oauthConfigToolDefinition.d.ts +13 -0
- package/dist/components/config/oauthConfigToolDefinition.d.ts.map +1 -0
- package/dist/components/config/oauthConfigToolDefinition.js +19 -0
- package/dist/components/config/oauthConfigToolDefinition.js.map +1 -0
- package/dist/components/dialogs/ConfirmationDialog.d.ts +21 -0
- package/dist/components/dialogs/ConfirmationDialog.d.ts.map +1 -0
- package/dist/components/dialogs/ConfirmationDialog.js +28 -0
- package/dist/components/dialogs/ConfirmationDialog.js.map +1 -0
- package/dist/components/dialogs/ErrorDialog.d.ts +21 -0
- package/dist/components/dialogs/ErrorDialog.d.ts.map +1 -0
- package/dist/components/dialogs/ErrorDialog.js +28 -0
- package/dist/components/dialogs/ErrorDialog.js.map +1 -0
- package/dist/components/dialogs/LocaleSelectionDialog.d.ts +41 -0
- package/dist/components/dialogs/LocaleSelectionDialog.d.ts.map +1 -0
- package/dist/components/dialogs/LocaleSelectionDialog.js +117 -0
- package/dist/components/dialogs/LocaleSelectionDialog.js.map +1 -0
- package/dist/components/dialogs/SuccessDialog.d.ts +19 -0
- package/dist/components/dialogs/SuccessDialog.d.ts.map +1 -0
- package/dist/components/dialogs/SuccessDialog.js +37 -0
- package/dist/components/dialogs/SuccessDialog.js.map +1 -0
- package/dist/components/dialogs/index.d.ts +12 -0
- package/dist/components/dialogs/index.d.ts.map +1 -0
- package/dist/components/dialogs/index.js +8 -0
- package/dist/components/dialogs/index.js.map +1 -0
- package/dist/components/dnt/DNTFieldBadge.d.ts +16 -0
- package/dist/components/dnt/DNTFieldBadge.d.ts.map +1 -0
- package/dist/components/dnt/DNTFieldBadge.js +56 -0
- package/dist/components/dnt/DNTFieldBadge.js.map +1 -0
- package/dist/components/dnt/DNTFieldComponent.d.ts +17 -0
- package/dist/components/dnt/DNTFieldComponent.d.ts.map +1 -0
- package/dist/components/dnt/DNTFieldComponent.js +21 -0
- package/dist/components/dnt/DNTFieldComponent.js.map +1 -0
- package/dist/components/dnt/DNTFieldInput.d.ts +14 -0
- package/dist/components/dnt/DNTFieldInput.d.ts.map +1 -0
- package/dist/components/dnt/DNTFieldInput.js +76 -0
- package/dist/components/dnt/DNTFieldInput.js.map +1 -0
- package/dist/components/dnt/index.d.ts +7 -0
- package/dist/components/dnt/index.d.ts.map +1 -0
- package/dist/components/dnt/index.js +7 -0
- package/dist/components/dnt/index.js.map +1 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +6 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/pluginConfig.d.ts +163 -0
- package/dist/config/pluginConfig.d.ts.map +1 -0
- package/dist/config/pluginConfig.js +548 -0
- package/dist/config/pluginConfig.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +3 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +137 -0
- package/dist/plugin.js.map +1 -0
- package/dist/services/authStateManager.d.ts +94 -0
- package/dist/services/authStateManager.d.ts.map +1 -0
- package/dist/services/authStateManager.js +208 -0
- package/dist/services/authStateManager.js.map +1 -0
- package/dist/services/contentExtractor.d.ts +95 -0
- package/dist/services/contentExtractor.d.ts.map +1 -0
- package/dist/services/contentExtractor.js +516 -0
- package/dist/services/contentExtractor.js.map +1 -0
- package/dist/services/dialogService.d.ts +96 -0
- package/dist/services/dialogService.d.ts.map +1 -0
- package/dist/services/dialogService.js +244 -0
- package/dist/services/dialogService.js.map +1 -0
- package/dist/services/dntServiceManager.d.ts +44 -0
- package/dist/services/dntServiceManager.d.ts.map +1 -0
- package/dist/services/dntServiceManager.js +74 -0
- package/dist/services/dntServiceManager.js.map +1 -0
- package/dist/services/dntStorageAdapter.d.ts +73 -0
- package/dist/services/dntStorageAdapter.d.ts.map +1 -0
- package/dist/services/dntStorageAdapter.js +192 -0
- package/dist/services/dntStorageAdapter.js.map +1 -0
- package/dist/services/documentCreationService.d.ts +139 -0
- package/dist/services/documentCreationService.d.ts.map +1 -0
- package/dist/services/documentCreationService.js +938 -0
- package/dist/services/documentCreationService.js.map +1 -0
- package/dist/services/localeService.d.ts +160 -0
- package/dist/services/localeService.d.ts.map +1 -0
- package/dist/services/localeService.js +300 -0
- package/dist/services/localeService.js.map +1 -0
- package/dist/services/localeStorageAdapter.d.ts +42 -0
- package/dist/services/localeStorageAdapter.d.ts.map +1 -0
- package/dist/services/localeStorageAdapter.js +107 -0
- package/dist/services/localeStorageAdapter.js.map +1 -0
- package/dist/services/oauthConfigStorage.d.ts +46 -0
- package/dist/services/oauthConfigStorage.d.ts.map +1 -0
- package/dist/services/oauthConfigStorage.js +122 -0
- package/dist/services/oauthConfigStorage.js.map +1 -0
- package/dist/services/oauthService.d.ts +48 -0
- package/dist/services/oauthService.d.ts.map +1 -0
- package/dist/services/oauthService.js +71 -0
- package/dist/services/oauthService.js.map +1 -0
- package/dist/services/oauthServiceManager.d.ts +189 -0
- package/dist/services/oauthServiceManager.d.ts.map +1 -0
- package/dist/services/oauthServiceManager.js +380 -0
- package/dist/services/oauthServiceManager.js.map +1 -0
- package/dist/services/tokenStorage.d.ts +54 -0
- package/dist/services/tokenStorage.d.ts.map +1 -0
- package/dist/services/tokenStorage.js +140 -0
- package/dist/services/tokenStorage.js.map +1 -0
- package/dist/services/translationService.d.ts +374 -0
- package/dist/services/translationService.d.ts.map +1 -0
- package/dist/services/translationService.js +687 -0
- package/dist/services/translationService.js.map +1 -0
- package/dist/services/unifiedConfigStorage.d.ts +124 -0
- package/dist/services/unifiedConfigStorage.d.ts.map +1 -0
- package/dist/services/unifiedConfigStorage.js +304 -0
- package/dist/services/unifiedConfigStorage.js.map +1 -0
- package/dist/test-utils.d.ts +9 -0
- package/dist/test-utils.d.ts.map +1 -0
- package/dist/test-utils.js +13 -0
- package/dist/test-utils.js.map +1 -0
- package/dist/types/dialog.d.ts +107 -0
- package/dist/types/dialog.d.ts.map +1 -0
- package/dist/types/dialog.js +6 -0
- package/dist/types/dialog.js.map +1 -0
- package/dist/types/dnt.d.ts +84 -0
- package/dist/types/dnt.d.ts.map +1 -0
- package/dist/types/dnt.js +5 -0
- package/dist/types/dnt.js.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/locale.d.ts +116 -0
- package/dist/types/locale.d.ts.map +1 -0
- package/dist/types/locale.js +189 -0
- package/dist/types/locale.js.map +1 -0
- package/dist/types/oauth.d.ts +90 -0
- package/dist/types/oauth.d.ts.map +1 -0
- package/dist/types/oauth.js +62 -0
- package/dist/types/oauth.js.map +1 -0
- package/dist/types/pluginConfig.d.ts +45 -0
- package/dist/types/pluginConfig.d.ts.map +1 -0
- package/dist/types/pluginConfig.js +6 -0
- package/dist/types/pluginConfig.js.map +1 -0
- package/dist/types/translation.d.ts +122 -0
- package/dist/types/translation.d.ts.map +1 -0
- package/dist/types/translation.js +6 -0
- package/dist/types/translation.js.map +1 -0
- package/dist/utils/htmlFormatter.d.ts +66 -0
- package/dist/utils/htmlFormatter.d.ts.map +1 -0
- package/dist/utils/htmlFormatter.js +191 -0
- package/dist/utils/htmlFormatter.js.map +1 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +16 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +105 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +229 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/oauthErrorFeedback.d.ts +76 -0
- package/dist/utils/oauthErrorFeedback.d.ts.map +1 -0
- package/dist/utils/oauthErrorFeedback.js +134 -0
- package/dist/utils/oauthErrorFeedback.js.map +1 -0
- package/dist/utils/oauthLogger.d.ts +176 -0
- package/dist/utils/oauthLogger.d.ts.map +1 -0
- package/dist/utils/oauthLogger.js +282 -0
- package/dist/utils/oauthLogger.js.map +1 -0
- package/dist/utils/validator.d.ts +67 -0
- package/dist/utils/validator.d.ts.map +1 -0
- package/dist/utils/validator.js +390 -0
- package/dist/utils/validator.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Easyling Configuration Component
|
|
4
|
+
*
|
|
5
|
+
* UI component for configuring Easyling integration with access token and project ID
|
|
6
|
+
*/
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
import { Box, Card, Stack, Text, Button, TextInput, Flex, Label, Heading, useToast, Spinner } from '@sanity/ui';
|
|
9
|
+
import { CheckmarkIcon } from '@sanity/icons';
|
|
10
|
+
/**
|
|
11
|
+
* Easyling Configuration Component
|
|
12
|
+
*
|
|
13
|
+
* Provides a form for configuring Easyling authentication:
|
|
14
|
+
* - Project ID
|
|
15
|
+
* - Access Token (secure password field)
|
|
16
|
+
*/
|
|
17
|
+
export const OAuthConfig = ({ onConfigSaved, initialConfig, onSave, onLoad }) => {
|
|
18
|
+
const [formData, setFormData] = useState({
|
|
19
|
+
projectId: '',
|
|
20
|
+
accessToken: ''
|
|
21
|
+
});
|
|
22
|
+
const [formErrors, setFormErrors] = useState({});
|
|
23
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
24
|
+
const [isSaving, setIsSaving] = useState(false);
|
|
25
|
+
const [saveSuccess, setSaveSuccess] = useState(false);
|
|
26
|
+
const toast = useToast();
|
|
27
|
+
// Load configuration on mount
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
loadConfiguration();
|
|
30
|
+
}, []);
|
|
31
|
+
// Update form when initialConfig changes
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (initialConfig) {
|
|
34
|
+
setFormData({
|
|
35
|
+
projectId: initialConfig.projectId || '',
|
|
36
|
+
accessToken: initialConfig.accessToken || ''
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}, [initialConfig]);
|
|
40
|
+
/**
|
|
41
|
+
* Load existing configuration
|
|
42
|
+
*/
|
|
43
|
+
const loadConfiguration = async () => {
|
|
44
|
+
if (!onLoad)
|
|
45
|
+
return;
|
|
46
|
+
try {
|
|
47
|
+
setIsLoading(true);
|
|
48
|
+
const config = await onLoad();
|
|
49
|
+
if (config) {
|
|
50
|
+
setFormData({
|
|
51
|
+
projectId: config.projectId || '',
|
|
52
|
+
accessToken: config.accessToken || ''
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
console.error('Failed to load Easyling configuration:', error);
|
|
58
|
+
toast.push({
|
|
59
|
+
status: 'error',
|
|
60
|
+
title: 'Failed to load configuration',
|
|
61
|
+
description: error instanceof Error ? error.message : 'Unknown error occurred'
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
setIsLoading(false);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Validate form data
|
|
70
|
+
*/
|
|
71
|
+
const validateForm = () => {
|
|
72
|
+
const errors = {};
|
|
73
|
+
// Validate project ID
|
|
74
|
+
if (!formData.projectId.trim()) {
|
|
75
|
+
errors.projectId = 'Project ID is required';
|
|
76
|
+
}
|
|
77
|
+
// Validate access token
|
|
78
|
+
if (!formData.accessToken.trim()) {
|
|
79
|
+
errors.accessToken = 'Access Token is required';
|
|
80
|
+
}
|
|
81
|
+
setFormErrors(errors);
|
|
82
|
+
return Object.keys(errors).length === 0;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Handle form submission
|
|
86
|
+
*/
|
|
87
|
+
const handleSave = async () => {
|
|
88
|
+
// Clear previous save success
|
|
89
|
+
setSaveSuccess(false);
|
|
90
|
+
// Validate form
|
|
91
|
+
if (!validateForm()) {
|
|
92
|
+
toast.push({
|
|
93
|
+
status: 'error',
|
|
94
|
+
title: 'Validation Error',
|
|
95
|
+
description: 'Please fix the errors in the form'
|
|
96
|
+
});
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
setIsSaving(true);
|
|
101
|
+
// Build config object
|
|
102
|
+
const config = {
|
|
103
|
+
projectId: formData.projectId.trim(),
|
|
104
|
+
accessToken: formData.accessToken.trim()
|
|
105
|
+
};
|
|
106
|
+
// Save configuration
|
|
107
|
+
if (onSave) {
|
|
108
|
+
await onSave(config);
|
|
109
|
+
}
|
|
110
|
+
// Notify parent component
|
|
111
|
+
if (onConfigSaved) {
|
|
112
|
+
onConfigSaved(config);
|
|
113
|
+
}
|
|
114
|
+
setSaveSuccess(true);
|
|
115
|
+
toast.push({
|
|
116
|
+
status: 'success',
|
|
117
|
+
title: 'Configuration Saved',
|
|
118
|
+
description: 'Easyling configuration has been saved successfully'
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
console.error('Failed to save Easyling configuration:', error);
|
|
123
|
+
toast.push({
|
|
124
|
+
status: 'error',
|
|
125
|
+
title: 'Save Failed',
|
|
126
|
+
description: error instanceof Error ? error.message : 'Failed to save configuration'
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
setIsSaving(false);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Handle form field changes
|
|
135
|
+
*/
|
|
136
|
+
const handleFieldChange = (field, value) => {
|
|
137
|
+
setFormData(prev => ({ ...prev, [field]: value }));
|
|
138
|
+
// Clear error for this field
|
|
139
|
+
if (formErrors[field]) {
|
|
140
|
+
setFormErrors(prev => ({ ...prev, [field]: undefined }));
|
|
141
|
+
}
|
|
142
|
+
// Clear save success when form changes
|
|
143
|
+
if (saveSuccess) {
|
|
144
|
+
setSaveSuccess(false);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
if (isLoading) {
|
|
148
|
+
return (_jsx(Box, { padding: 4, children: _jsx(Flex, { align: "center", justify: "center", padding: 4, children: _jsx(Spinner, {}) }) }));
|
|
149
|
+
}
|
|
150
|
+
return (_jsx(Box, { padding: 4, children: _jsxs(Stack, { space: 4, children: [_jsxs(Stack, { space: 3, children: [_jsx(Heading, { size: 3, children: "Easyling Configuration" }), _jsx(Text, { size: 1, muted: true, children: "Configure Easyling authentication for translation service integration." })] }), _jsx(Card, { padding: 4, radius: 2, tone: "primary", children: _jsxs(Stack, { space: 3, children: [_jsx(Heading, { size: 1, children: "Setup Instructions" }), _jsxs(Stack, { space: 2, children: [_jsx(Text, { size: 1, children: "To obtain your Easyling credentials:" }), _jsx(Box, { paddingLeft: 3, children: _jsxs(Stack, { space: 2, children: [_jsxs(Text, { size: 1, children: ["1. Log in to your Easyling account at", ' ', _jsx("a", { href: "https://app.easyling.com", target: "_blank", rel: "noopener noreferrer", children: "app.easyling.com" })] }), _jsx(Text, { size: 1, children: "2. Find your Project ID in your project settings" }), _jsx(Text, { size: 1, children: "3. Navigate to Settings \u2192 API & Integrations" }), _jsx(Text, { size: 1, children: "4. Generate a long-lived access token" }), _jsx(Text, { size: 1, children: "5. Copy both the Project ID and Access Token below" })] }) })] })] }) }), _jsx(Card, { padding: 4, shadow: 1, radius: 2, children: _jsxs(Stack, { space: 4, children: [_jsxs(Stack, { space: 2, children: [_jsx(Label, { size: 1, children: "Project ID *" }), _jsx(TextInput, { value: formData.projectId, onChange: (e) => handleFieldChange('projectId', e.currentTarget.value), placeholder: "your-project-id", "aria-label": "Project ID", "aria-invalid": !!formErrors.projectId, "aria-describedby": formErrors.projectId ? 'projectId-error' : 'projectId-help' }), formErrors.projectId ? (_jsx(Text, { id: "projectId-error", size: 1, style: { color: 'var(--card-badge-critical-fg-color)' }, children: formErrors.projectId })) : (_jsx(Text, { id: "projectId-help", size: 1, muted: true, children: "Your Easyling project ID" }))] }), _jsxs(Stack, { space: 2, children: [_jsx(Label, { size: 1, children: "Access Token *" }), _jsx(TextInput, { value: formData.accessToken, onChange: (e) => handleFieldChange('accessToken', e.currentTarget.value), placeholder: "your-access-token", type: "password", "aria-label": "Access Token", "aria-invalid": !!formErrors.accessToken, "aria-describedby": formErrors.accessToken ? 'accessToken-error' : 'accessToken-help' }), formErrors.accessToken ? (_jsx(Text, { id: "accessToken-error", size: 1, style: { color: 'var(--card-badge-critical-fg-color)' }, children: formErrors.accessToken })) : (_jsx(Text, { id: "accessToken-help", size: 1, muted: true, children: "The long-lived access token provided by Easyling (kept secure)" }))] })] }) }), saveSuccess && (_jsx(Card, { padding: 3, radius: 2, tone: "positive", children: _jsxs(Flex, { align: "center", gap: 2, children: [_jsx(Text, { size: 2, children: _jsx(CheckmarkIcon, {}) }), _jsx(Text, { size: 1, weight: "semibold", children: "Configuration saved successfully" })] }) })), _jsx(Flex, { gap: 2, children: _jsx(Button, { text: "Save Configuration", tone: "primary", onClick: handleSave, disabled: isSaving, loading: isSaving }) })] }) }));
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=OAuthConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthConfig.js","sourceRoot":"","sources":["../../../src/components/config/OAuthConfig.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EACL,GAAG,EACH,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,EACN,SAAS,EACT,IAAI,EACJ,KAAK,EACL,OAAO,EACP,QAAQ,EACR,OAAO,EACR,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AA2B9C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EACtD,aAAa,EACb,aAAa,EACb,MAAM,EACN,MAAM,EACP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Wrapper for Sanity Integration
|
|
3
|
+
* Requirements: 9.1, 9.4
|
|
4
|
+
*
|
|
5
|
+
* Wraps the OAuthConfig component with Sanity client integration
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* Wrapper component that provides OAuthConfig with Sanity storage
|
|
10
|
+
* Requirements: 9.1, 9.4
|
|
11
|
+
*/
|
|
12
|
+
export declare const OAuthConfigWrapper: React.FC;
|
|
13
|
+
//# sourceMappingURL=OAuthConfigWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthConfigWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/config/OAuthConfigWrapper.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAOvC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAkCtC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* OAuth Configuration Wrapper for Sanity Integration
|
|
4
|
+
* Requirements: 9.1, 9.4
|
|
5
|
+
*
|
|
6
|
+
* Wraps the OAuthConfig component with Sanity client integration
|
|
7
|
+
*/
|
|
8
|
+
import { useMemo } from 'react';
|
|
9
|
+
import { useClient } from 'sanity';
|
|
10
|
+
import { OAuthConfig } from './OAuthConfig';
|
|
11
|
+
import { OAuthConfigStorage } from '../../services/oauthConfigStorage';
|
|
12
|
+
import { OAuthServiceManager } from '../../services/oauthServiceManager';
|
|
13
|
+
/**
|
|
14
|
+
* Wrapper component that provides OAuthConfig with Sanity storage
|
|
15
|
+
* Requirements: 9.1, 9.4
|
|
16
|
+
*/
|
|
17
|
+
export const OAuthConfigWrapper = () => {
|
|
18
|
+
const client = useClient({ apiVersion: '2023-01-01' });
|
|
19
|
+
// Create storage adapter with Sanity client
|
|
20
|
+
const storage = useMemo(() => {
|
|
21
|
+
return new OAuthConfigStorage(client);
|
|
22
|
+
}, [client]);
|
|
23
|
+
// Get OAuth service manager
|
|
24
|
+
const serviceManager = useMemo(() => {
|
|
25
|
+
return OAuthServiceManager.getInstance(client);
|
|
26
|
+
}, [client]);
|
|
27
|
+
// Load configuration handler
|
|
28
|
+
const handleLoad = async () => {
|
|
29
|
+
return await storage.load();
|
|
30
|
+
};
|
|
31
|
+
// Save configuration handler
|
|
32
|
+
const handleSave = async (config) => {
|
|
33
|
+
// Save to Sanity document storage
|
|
34
|
+
await storage.save(config);
|
|
35
|
+
// Also save to localStorage and update authentication state
|
|
36
|
+
// This ensures the translation service can use the credentials
|
|
37
|
+
await serviceManager.saveAuth(config.accessToken, config.projectId);
|
|
38
|
+
};
|
|
39
|
+
return (_jsx(OAuthConfig, { onLoad: handleLoad, onSave: handleSave }));
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=OAuthConfigWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthConfigWrapper.js","sourceRoot":"","sources":["../../../src/components/config/OAuthConfigWrapper.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAGzE;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAa,GAAG,EAAE;IAC/C,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAC;IAEvD,4CAA4C;IAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE;QAC3B,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,4BAA4B;IAC5B,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,EAAE;QAClC,OAAO,mBAAmB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,6BAA6B;IAC7B,MAAM,UAAU,GAAG,KAAK,IAAqC,EAAE;QAC7D,OAAO,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC,CAAC;IAEF,6BAA6B;IAC7B,MAAM,UAAU,GAAG,KAAK,EAAE,MAAuB,EAAiB,EAAE;QAClE,kCAAkC;QAClC,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAE3B,4DAA4D;QAC5D,+DAA+D;QAC/D,MAAM,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IACtE,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,WAAW,IACV,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,GAClB,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Password Input Component for Sanity
|
|
3
|
+
*
|
|
4
|
+
* Custom input component that obscures sensitive token values in Sanity Studio
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { StringInputProps } from 'sanity';
|
|
8
|
+
/**
|
|
9
|
+
* Password Input Component
|
|
10
|
+
*
|
|
11
|
+
* Renders a password-type input field that obscures the value
|
|
12
|
+
*/
|
|
13
|
+
export declare const PasswordInput: React.FC<StringInputProps>;
|
|
14
|
+
//# sourceMappingURL=PasswordInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordInput.d.ts","sourceRoot":"","sources":["../../../src/components/config/PasswordInput.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAc,MAAM,QAAQ,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAmBpD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Password Input Component for Sanity
|
|
4
|
+
*
|
|
5
|
+
* Custom input component that obscures sensitive token values in Sanity Studio
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { TextInput } from '@sanity/ui';
|
|
9
|
+
import { set, unset } from 'sanity';
|
|
10
|
+
/**
|
|
11
|
+
* Password Input Component
|
|
12
|
+
*
|
|
13
|
+
* Renders a password-type input field that obscures the value
|
|
14
|
+
*/
|
|
15
|
+
export const PasswordInput = (props) => {
|
|
16
|
+
const { elementProps, onChange, value = '' } = props;
|
|
17
|
+
const handleChange = React.useCallback((event) => {
|
|
18
|
+
const nextValue = event.currentTarget.value;
|
|
19
|
+
onChange(nextValue ? set(nextValue) : unset());
|
|
20
|
+
}, [onChange]);
|
|
21
|
+
return (_jsx(TextInput, { ...elementProps, type: "password", value: value, onChange: handleChange }));
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=PasswordInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordInput.js","sourceRoot":"","sources":["../../../src/components/config/PasswordInput.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAoB,GAAG,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEtD;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAA+B,CAAC,KAAK,EAAE,EAAE;IACjE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,KAAK,CAAC;IAErD,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CACpC,CAAC,KAA0C,EAAE,EAAE;QAC7C,MAAM,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC;QAC5C,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;IACjD,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,CACL,KAAC,SAAS,OACJ,YAAY,EAChB,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,GACtB,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration components exports
|
|
3
|
+
*/
|
|
4
|
+
export { LocaleConfigTool } from './LocaleConfigTool';
|
|
5
|
+
export type { LocaleConfigToolProps } from './LocaleConfigTool';
|
|
6
|
+
export { LocaleConfigToolWrapper } from './LocaleConfigToolWrapper';
|
|
7
|
+
export { localeConfigTool } from './localeConfigToolDefinition';
|
|
8
|
+
export { PasswordInput } from './PasswordInput';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/config/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration components exports
|
|
3
|
+
*/
|
|
4
|
+
export { LocaleConfigTool } from './LocaleConfigTool';
|
|
5
|
+
export { LocaleConfigToolWrapper } from './LocaleConfigToolWrapper';
|
|
6
|
+
export { localeConfigTool } from './localeConfigToolDefinition';
|
|
7
|
+
export { PasswordInput } from './PasswordInput';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/config/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locale Configuration Tool Definition
|
|
3
|
+
* Requirements: 1.1, 5.1, 5.7
|
|
4
|
+
*
|
|
5
|
+
* Sanity Studio tool for managing locale configuration
|
|
6
|
+
*/
|
|
7
|
+
import { Tool } from 'sanity';
|
|
8
|
+
/**
|
|
9
|
+
* Locale Configuration Tool for Sanity Studio
|
|
10
|
+
* Requirements: 1.1, 5.1, 5.7
|
|
11
|
+
*/
|
|
12
|
+
export declare const localeConfigTool: Tool;
|
|
13
|
+
//# sourceMappingURL=localeConfigToolDefinition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localeConfigToolDefinition.d.ts","sourceRoot":"","sources":["../../../src/components/config/localeConfigToolDefinition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAI9B;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,IAK9B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locale Configuration Tool Definition
|
|
3
|
+
* Requirements: 1.1, 5.1, 5.7
|
|
4
|
+
*
|
|
5
|
+
* Sanity Studio tool for managing locale configuration
|
|
6
|
+
*/
|
|
7
|
+
import { CogIcon } from '@sanity/icons';
|
|
8
|
+
import { LocaleConfigToolWrapper } from './LocaleConfigToolWrapper';
|
|
9
|
+
/**
|
|
10
|
+
* Locale Configuration Tool for Sanity Studio
|
|
11
|
+
* Requirements: 1.1, 5.1, 5.7
|
|
12
|
+
*/
|
|
13
|
+
export const localeConfigTool = {
|
|
14
|
+
name: 'locale-config',
|
|
15
|
+
title: 'Locale Configuration',
|
|
16
|
+
icon: CogIcon,
|
|
17
|
+
component: LocaleConfigToolWrapper
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=localeConfigToolDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localeConfigToolDefinition.js","sourceRoot":"","sources":["../../../src/components/config/localeConfigToolDefinition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,sBAAsB;IAC7B,IAAI,EAAE,OAAO;IACb,SAAS,EAAE,uBAAuB;CACnC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth Configuration Tool Definition
|
|
3
|
+
* Requirements: 9.1, 9.3
|
|
4
|
+
*
|
|
5
|
+
* Sanity Studio tool for managing OAuth configuration
|
|
6
|
+
*/
|
|
7
|
+
import { Tool } from 'sanity';
|
|
8
|
+
/**
|
|
9
|
+
* OAuth Configuration Tool for Sanity Studio
|
|
10
|
+
* Requirements: 9.1, 9.3
|
|
11
|
+
*/
|
|
12
|
+
export declare const oauthConfigTool: Tool;
|
|
13
|
+
//# sourceMappingURL=oauthConfigToolDefinition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthConfigToolDefinition.d.ts","sourceRoot":"","sources":["../../../src/components/config/oauthConfigToolDefinition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAI9B;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,IAK7B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth Configuration Tool Definition
|
|
3
|
+
* Requirements: 9.1, 9.3
|
|
4
|
+
*
|
|
5
|
+
* Sanity Studio tool for managing OAuth configuration
|
|
6
|
+
*/
|
|
7
|
+
import { CogIcon } from '@sanity/icons';
|
|
8
|
+
import { OAuthConfigWrapper } from './OAuthConfigWrapper';
|
|
9
|
+
/**
|
|
10
|
+
* OAuth Configuration Tool for Sanity Studio
|
|
11
|
+
* Requirements: 9.1, 9.3
|
|
12
|
+
*/
|
|
13
|
+
export const oauthConfigTool = {
|
|
14
|
+
name: 'oauth-config',
|
|
15
|
+
title: 'OAuth Configuration',
|
|
16
|
+
icon: CogIcon,
|
|
17
|
+
component: OAuthConfigWrapper
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=oauthConfigToolDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthConfigToolDefinition.js","sourceRoot":"","sources":["../../../src/components/config/oauthConfigToolDefinition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,qBAAqB;IAC5B,IAAI,EAAE,OAAO;IACb,SAAS,EAAE,kBAAkB;CAC9B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConfirmationDialog Component
|
|
3
|
+
* Requirements: 3.1, 3.2, 3.8
|
|
4
|
+
*
|
|
5
|
+
* A reusable confirmation dialog with proper accessibility support
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { ConfirmationDialogOptions } from '../../types/dialog';
|
|
9
|
+
export interface ConfirmationDialogProps extends ConfirmationDialogOptions {
|
|
10
|
+
/** Whether the dialog is open */
|
|
11
|
+
open: boolean;
|
|
12
|
+
/** Callback when user confirms */
|
|
13
|
+
onConfirm: () => void;
|
|
14
|
+
/** Callback when user cancels */
|
|
15
|
+
onCancel: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* ConfirmationDialog component with accessibility features
|
|
19
|
+
*/
|
|
20
|
+
export declare const ConfirmationDialog: React.FC<ConfirmationDialogProps>;
|
|
21
|
+
//# sourceMappingURL=ConfirmationDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmationDialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialogs/ConfirmationDialog.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,WAAW,uBAAwB,SAAQ,yBAAyB;IACxE,iCAAiC;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,kCAAkC;IAClC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA+EhE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* ConfirmationDialog Component
|
|
4
|
+
* Requirements: 3.1, 3.2, 3.8
|
|
5
|
+
*
|
|
6
|
+
* A reusable confirmation dialog with proper accessibility support
|
|
7
|
+
*/
|
|
8
|
+
import { useEffect, useRef } from 'react';
|
|
9
|
+
import { Dialog, Box, Stack, Text, Button, Card } from '@sanity/ui';
|
|
10
|
+
/**
|
|
11
|
+
* ConfirmationDialog component with accessibility features
|
|
12
|
+
*/
|
|
13
|
+
export const ConfirmationDialog = ({ open, title, message, details, confirmText = 'Confirm', cancelText = 'Cancel', tone = 'primary', closable = true, onConfirm, onCancel, }) => {
|
|
14
|
+
const confirmButtonRef = useRef(null);
|
|
15
|
+
// Focus the confirm button when dialog opens
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (open && confirmButtonRef.current) {
|
|
18
|
+
// Small delay to ensure dialog is fully rendered
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
confirmButtonRef.current?.focus();
|
|
21
|
+
}, 100);
|
|
22
|
+
}
|
|
23
|
+
}, [open]);
|
|
24
|
+
if (!open)
|
|
25
|
+
return null;
|
|
26
|
+
return (_jsx(Dialog, { id: "confirmation-dialog", header: title, onClose: closable ? onCancel : undefined, onClickOutside: closable ? onCancel : undefined, width: 1, role: "alertdialog", "aria-labelledby": "confirmation-dialog-title", "aria-describedby": "confirmation-dialog-description", children: _jsx(Box, { padding: 4, children: _jsxs(Stack, { space: 4, children: [_jsx(Card, { children: _jsx(Box, { padding: 3, children: _jsxs(Stack, { space: 3, children: [_jsx(Text, { id: "confirmation-dialog-description", size: 2, weight: "regular", children: message }), details && (_jsx(Text, { size: 1, muted: true, children: details }))] }) }) }), _jsxs(Stack, { space: 2, children: [_jsx(Button, { ref: confirmButtonRef, text: confirmText, tone: tone, onClick: onConfirm, mode: "default", "aria-label": `${confirmText} action` }), _jsx(Button, { text: cancelText, tone: "default", onClick: onCancel, mode: "ghost", "aria-label": `${cancelText} action` })] })] }) }) }));
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=ConfirmationDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmationDialog.js","sourceRoot":"","sources":["../../../src/components/dialogs/ConfirmationDialog.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAYpE;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,IAAI,EACJ,KAAK,EACL,OAAO,EACP,OAAO,EACP,WAAW,GAAG,SAAS,EACvB,UAAU,GAAG,QAAQ,EACrB,IAAI,GAAG,SAAS,EAChB,QAAQ,GAAG,IAAI,EACf,SAAS,EACT,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,gBAAgB,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAEzD,6CAA6C;IAC7C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,IAAI,IAAI,gBAAgB,CAAC,OAAO,EAAE,CAAC;YACrC,iDAAiD;YACjD,UAAU,CAAC,GAAG,EAAE;gBACd,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;YACpC,CAAC,EAAE,GAAG,CAAC,CAAC;QACV,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,OAAO,CACL,KAAC,MAAM,IACL,EAAE,EAAC,qBAAqB,EACxB,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EACxC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAC/C,KAAK,EAAE,CAAC,EACR,IAAI,EAAC,aAAa,qBACF,2BAA2B,sBAC1B,iCAAiC,YAElD,KAAC,GAAG,IAAC,OAAO,EAAE,CAAC,YACb,MAAC,KAAK,IAAC,KAAK,EAAE,CAAC,aACb,KAAC,IAAI,cACH,KAAC,GAAG,IAAC,OAAO,EAAE,CAAC,YACb,MAAC,KAAK,IAAC,KAAK,EAAE,CAAC,aACb,KAAC,IAAI,IACH,EAAE,EAAC,iCAAiC,EACpC,IAAI,EAAE,CAAC,EACP,MAAM,EAAC,SAAS,YAEf,OAAO,GACH,EACN,OAAO,IAAI,CACV,KAAC,IAAI,IAAC,IAAI,EAAE,CAAC,EAAE,KAAK,kBACjB,OAAO,GACH,CACR,IACK,GACJ,GACD,EAEP,MAAC,KAAK,IAAC,KAAK,EAAE,CAAC,aACb,KAAC,MAAM,IACL,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,SAAS,EAClB,IAAI,EAAC,SAAS,gBACF,GAAG,WAAW,SAAS,GACnC,EACF,KAAC,MAAM,IACL,IAAI,EAAE,UAAU,EAChB,IAAI,EAAC,SAAS,EACd,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAC,OAAO,gBACA,GAAG,UAAU,SAAS,GAClC,IACI,IACF,GACJ,GACC,CACV,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ErrorDialog Component
|
|
3
|
+
* Requirements: 3.7, 3.8
|
|
4
|
+
*
|
|
5
|
+
* An error notification dialog with accessibility support and retry functionality
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { ErrorDialogOptions } from '../../types/dialog';
|
|
9
|
+
export interface ErrorDialogProps extends ErrorDialogOptions {
|
|
10
|
+
/** Whether the dialog is open */
|
|
11
|
+
open: boolean;
|
|
12
|
+
/** Callback when dialog is closed */
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
/** Callback when user clicks retry */
|
|
15
|
+
onRetry?: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* ErrorDialog component for displaying error messages
|
|
19
|
+
*/
|
|
20
|
+
export declare const ErrorDialog: React.FC<ErrorDialogProps>;
|
|
21
|
+
//# sourceMappingURL=ErrorDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorDialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialogs/ErrorDialog.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,iCAAiC;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,qCAAqC;IACrC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAqGlD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* ErrorDialog Component
|
|
4
|
+
* Requirements: 3.7, 3.8
|
|
5
|
+
*
|
|
6
|
+
* An error notification dialog with accessibility support and retry functionality
|
|
7
|
+
*/
|
|
8
|
+
import { useEffect, useRef } from 'react';
|
|
9
|
+
import { Dialog, Box, Stack, Text, Button, Card, Code } from '@sanity/ui';
|
|
10
|
+
import { ErrorOutlineIcon } from '@sanity/icons';
|
|
11
|
+
/**
|
|
12
|
+
* ErrorDialog component for displaying error messages
|
|
13
|
+
*/
|
|
14
|
+
export const ErrorDialog = ({ open, title, message, error, showRetry = false, retryText = 'Retry', closable = true, onClose, onRetry, }) => {
|
|
15
|
+
const primaryButtonRef = useRef(null);
|
|
16
|
+
// Focus the primary button when dialog opens
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (open && primaryButtonRef.current) {
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
primaryButtonRef.current?.focus();
|
|
21
|
+
}, 100);
|
|
22
|
+
}
|
|
23
|
+
}, [open]);
|
|
24
|
+
if (!open)
|
|
25
|
+
return null;
|
|
26
|
+
return (_jsx(Dialog, { id: "error-dialog", header: title, onClose: closable ? onClose : undefined, onClickOutside: closable ? onClose : undefined, width: 1, role: "alertdialog", "aria-labelledby": "error-dialog-title", "aria-describedby": "error-dialog-description", children: _jsx(Box, { padding: 4, children: _jsxs(Stack, { space: 4, children: [_jsx(Card, { tone: "critical", padding: 3, radius: 2, children: _jsxs(Stack, { space: 3, children: [_jsx(Box, { children: _jsx(Text, { size: 3, children: _jsx(ErrorOutlineIcon, {}) }) }), _jsx(Text, { id: "error-dialog-description", size: 2, weight: "regular", children: message }), error && (_jsxs(Box, { marginTop: 2, children: [_jsx(Code, { size: 1, language: "text", children: error.message }), error.stack && (_jsx(Box, { marginTop: 2, children: _jsxs("details", { children: [_jsx("summary", { children: _jsx(Text, { size: 1, muted: true, children: "Stack trace" }) }), _jsx(Box, { marginTop: 2, children: _jsx(Code, { size: 0, language: "text", children: error.stack }) })] }) }))] }))] }) }), _jsxs(Stack, { space: 2, children: [showRetry && onRetry && (_jsx(Button, { ref: primaryButtonRef, text: retryText, tone: "critical", onClick: onRetry, mode: "default", "aria-label": `${retryText} action` })), _jsx(Button, { ref: !showRetry ? primaryButtonRef : undefined, text: "Close", tone: "default", onClick: onClose, mode: showRetry ? 'ghost' : 'default', "aria-label": "Close error dialog" })] })] }) }) }));
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=ErrorDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorDialog.js","sourceRoot":"","sources":["../../../src/components/dialogs/ErrorDialog.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAYjD;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EACtD,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EACL,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,OAAO,EACnB,QAAQ,GAAG,IAAI,EACf,OAAO,EACP,OAAO,GACR,EAAE,EAAE;IACH,MAAM,gBAAgB,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAEzD,6CAA6C;IAC7C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,IAAI,IAAI,gBAAgB,CAAC,OAAO,EAAE,CAAC;YACrC,UAAU,CAAC,GAAG,EAAE;gBACd,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;YACpC,CAAC,EAAE,GAAG,CAAC,CAAC;QACV,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,OAAO,CACL,KAAC,MAAM,IACL,EAAE,EAAC,cAAc,EACjB,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EACvC,cAAc,EAAE,QAAQ,CAAC,CAAC,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,SAAS,GACjC,CACH,EACD,KAAC,MAAM,IACL,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,EAC9C,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,SAAS,EACd,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,gBAC1B,oBAAoB,GAC/B,IACI,IACF,GACJ,GACC,CACV,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LocaleSelectionDialog Component
|
|
3
|
+
* Requirements: 2.1, 2.2, 2.3, 2.4, 2.6, 2.7
|
|
4
|
+
*
|
|
5
|
+
* A dialog for selecting target locales for translation with search and validation
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { LocaleDefinition } from '../../types/locale';
|
|
9
|
+
export interface LocaleSelectionDialogProps {
|
|
10
|
+
/** Whether the dialog is open */
|
|
11
|
+
open: boolean;
|
|
12
|
+
/** Dialog title */
|
|
13
|
+
title: string;
|
|
14
|
+
/** Dialog message/description */
|
|
15
|
+
message: string;
|
|
16
|
+
/** Available locales to choose from */
|
|
17
|
+
availableLocales: LocaleDefinition[];
|
|
18
|
+
/** Currently selected locale codes */
|
|
19
|
+
selectedLocales: string[];
|
|
20
|
+
/** Documents being translated (for context display) */
|
|
21
|
+
selectedDocuments?: any[];
|
|
22
|
+
/** Translation mode */
|
|
23
|
+
mode: 'single' | 'bulk';
|
|
24
|
+
/** Whether multiple locales can be selected */
|
|
25
|
+
allowMultiple?: boolean;
|
|
26
|
+
/** Whether locale selection is required */
|
|
27
|
+
required?: boolean;
|
|
28
|
+
/** Whether to show creation mode option in the dialog */
|
|
29
|
+
showCreationModeOption?: boolean;
|
|
30
|
+
/** Default creation mode to pre-select */
|
|
31
|
+
defaultCreationMode?: 'draft' | 'published';
|
|
32
|
+
/** Callback when user confirms selection */
|
|
33
|
+
onConfirm: (selectedLocales: string[], creationMode?: 'draft' | 'published') => void;
|
|
34
|
+
/** Callback when user cancels */
|
|
35
|
+
onCancel: () => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* LocaleSelectionDialog component with search and multi-select functionality
|
|
39
|
+
*/
|
|
40
|
+
export declare const LocaleSelectionDialog: React.FC<LocaleSelectionDialogProps>;
|
|
41
|
+
//# sourceMappingURL=LocaleSelectionDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocaleSelectionDialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialogs/LocaleSelectionDialog.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAA+C,MAAM,OAAO,CAAC;AAGpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,WAAW,0BAA0B;IACzC,iCAAiC;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,mBAAmB;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;IACrC,sCAAsC;IACtC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,uDAAuD;IACvD,iBAAiB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC1B,uBAAuB;IACvB,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yDAAyD;IACzD,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,0CAA0C;IAC1C,mBAAmB,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC5C,4CAA4C;IAC5C,SAAS,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,WAAW,KAAK,IAAI,CAAC;IACrF,iCAAiC;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAiWtE,CAAC"}
|