@easyling/sanity-connector 1.4.0 → 2.0.0
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/README.md +560 -90
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -0
- package/package.json +38 -54
- package/LICENSE +0 -21
- package/dist/.tsbuildinfo +0 -1
- package/dist-types/actions/bulkTranslate.d.ts +0 -6
- package/dist-types/actions/manageDNTFields.d.ts +0 -11
- package/dist-types/actions/translateDocument.d.ts +0 -6
- package/dist-types/components/RadioWithDefault.d.ts +0 -16
- package/dist-types/components/auth/AuthNavbar.d.ts +0 -17
- package/dist-types/components/auth/AuthStatus.d.ts +0 -26
- package/dist-types/components/auth/AuthStatusWrapper.d.ts +0 -14
- package/dist-types/components/auth/MigrationPrompt.d.ts +0 -19
- package/dist-types/components/auth/MigrationPromptWrapper.d.ts +0 -13
- package/dist-types/components/auth/OAuthCallback.d.ts +0 -19
- package/dist-types/components/auth/index.d.ts +0 -14
- package/dist-types/components/config/LocaleConfigTool.d.ts +0 -16
- package/dist-types/components/config/LocaleConfigToolWrapper.d.ts +0 -12
- package/dist-types/components/config/OAuthConfig.d.ts +0 -25
- package/dist-types/components/config/OAuthConfigWrapper.d.ts +0 -12
- package/dist-types/components/config/PasswordInput.d.ts +0 -13
- package/dist-types/components/config/index.d.ts +0 -8
- package/dist-types/components/config/localeConfigToolDefinition.d.ts +0 -12
- package/dist-types/components/config/oauthConfigToolDefinition.d.ts +0 -12
- package/dist-types/components/dialogs/ConfirmationDialog.d.ts +0 -20
- package/dist-types/components/dialogs/ErrorDialog.d.ts +0 -20
- package/dist-types/components/dialogs/LocaleSelectionDialog.d.ts +0 -62
- package/dist-types/components/dialogs/SuccessDialog.d.ts +0 -18
- package/dist-types/components/dialogs/index.d.ts +0 -11
- package/dist-types/components/dnt/DNTFieldBadge.d.ts +0 -15
- package/dist-types/components/dnt/DNTFieldComponent.d.ts +0 -16
- package/dist-types/components/dnt/DNTFieldInput.d.ts +0 -13
- package/dist-types/components/dnt/DebugDNTBadge.d.ts +0 -19
- package/dist-types/components/dnt/index.d.ts +0 -7
- package/dist-types/config/index.d.ts +0 -5
- package/dist-types/config/pluginConfig.d.ts +0 -162
- package/dist-types/index.d.ts +0 -11
- package/dist-types/plugin.d.ts +0 -12
- package/dist-types/services/authStateManager.d.ts +0 -93
- package/dist-types/services/collisionDetectionService.d.ts +0 -85
- package/dist-types/services/contentExtractor.d.ts +0 -161
- package/dist-types/services/dialogService.d.ts +0 -95
- package/dist-types/services/dntServiceManager.d.ts +0 -43
- package/dist-types/services/dntStorageAdapter.d.ts +0 -72
- package/dist-types/services/documentCreationService.d.ts +0 -262
- package/dist-types/services/localeService.d.ts +0 -159
- package/dist-types/services/localeStorageAdapter.d.ts +0 -41
- package/dist-types/services/oauthConfigStorage.d.ts +0 -45
- package/dist-types/services/oauthService.d.ts +0 -47
- package/dist-types/services/oauthServiceManager.d.ts +0 -195
- package/dist-types/services/tokenStorage.d.ts +0 -53
- package/dist-types/services/translationService.d.ts +0 -385
- package/dist-types/services/unifiedConfigStorage.d.ts +0 -158
- package/dist-types/test-utils.d.ts +0 -8
- package/dist-types/types/dialog.d.ts +0 -118
- package/dist-types/types/dnt.d.ts +0 -83
- package/dist-types/types/index.d.ts +0 -11
- package/dist-types/types/locale.d.ts +0 -115
- package/dist-types/types/oauth.d.ts +0 -89
- package/dist-types/types/pluginConfig.d.ts +0 -64
- package/dist-types/types/translation.d.ts +0 -121
- package/dist-types/utils/dntDefaults.d.ts +0 -101
- package/dist-types/utils/htmlFormatter.d.ts +0 -65
- package/dist-types/utils/index.d.ts +0 -16
- package/dist-types/utils/logger.d.ts +0 -104
- package/dist-types/utils/oauthErrorFeedback.d.ts +0 -75
- package/dist-types/utils/oauthLogger.d.ts +0 -175
- package/dist-types/utils/validator.d.ts +0 -66
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Migration Prompt Wrapper Component - DEPRECATED
|
|
3
|
-
*
|
|
4
|
-
* This component is no longer used since OAuth migration prompts are not needed
|
|
5
|
-
* with the new long-lived token authentication approach.
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
/**
|
|
9
|
-
* Migration Prompt Wrapper - DEPRECATED
|
|
10
|
-
*
|
|
11
|
-
* Returns null as OAuth migration is no longer applicable.
|
|
12
|
-
*/
|
|
13
|
-
export declare const MigrationPromptWrapper: React.FC;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OAuth Callback Component - DEPRECATED
|
|
3
|
-
*
|
|
4
|
-
* This component is no longer used with the new long-lived token authentication approach.
|
|
5
|
-
* Easyling authentication now uses direct access token configuration instead of OAuth flows.
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
export interface OAuthCallbackProps {
|
|
9
|
-
/** Callback when authentication is complete (not used) */
|
|
10
|
-
onComplete?: () => void;
|
|
11
|
-
/** Callback to retry authentication (not used) */
|
|
12
|
-
onRetry?: () => void;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* OAuth Callback Component - DEPRECATED
|
|
16
|
-
*
|
|
17
|
-
* Shows a message that OAuth callbacks are no longer supported.
|
|
18
|
-
*/
|
|
19
|
-
export declare const OAuthCallback: React.FC<OAuthCallbackProps>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Authentication Components
|
|
3
|
-
*
|
|
4
|
-
* Exports all authentication-related UI components
|
|
5
|
-
*/
|
|
6
|
-
export { AuthStatus } from './AuthStatus';
|
|
7
|
-
export type { AuthStatusProps } from './AuthStatus';
|
|
8
|
-
export { OAuthCallback } from './OAuthCallback';
|
|
9
|
-
export type { OAuthCallbackProps } from './OAuthCallback';
|
|
10
|
-
export { AuthStatusWrapper } from './AuthStatusWrapper';
|
|
11
|
-
export { AuthNavbar } from './AuthNavbar';
|
|
12
|
-
export { MigrationPrompt } from './MigrationPrompt';
|
|
13
|
-
export type { MigrationPromptProps } from './MigrationPrompt';
|
|
14
|
-
export { MigrationPromptWrapper } from './MigrationPromptWrapper';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LocaleConfigTool Component
|
|
3
|
-
* Requirements: 1.1, 1.2, 1.6, 1.7
|
|
4
|
-
*
|
|
5
|
-
* Administrative interface for managing locale configuration
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { LocaleService } from '../../services/localeService';
|
|
9
|
-
export interface LocaleConfigToolProps {
|
|
10
|
-
/** Locale service instance for CRUD operations */
|
|
11
|
-
localeService: LocaleService;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* LocaleConfigTool component for administrative locale management
|
|
15
|
-
*/
|
|
16
|
-
export declare const LocaleConfigTool: React.FC<LocaleConfigToolProps>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LocaleConfigTool Wrapper for Sanity Tool Integration
|
|
3
|
-
* Requirements: 1.1, 5.1, 5.2, 5.3, 5.7
|
|
4
|
-
*
|
|
5
|
-
* Wraps the LocaleConfigTool component with Sanity client integration
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
/**
|
|
9
|
-
* Wrapper component that provides LocaleService with Sanity storage adapter
|
|
10
|
-
* Requirements: 1.1, 5.1, 5.2, 5.3, 5.7
|
|
11
|
-
*/
|
|
12
|
-
export declare const LocaleConfigToolWrapper: React.FC;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Easyling Configuration Component
|
|
3
|
-
*
|
|
4
|
-
* UI component for configuring Easyling integration with access token and project ID
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { OAuthConfig as OAuthConfigType } from '../../types/oauth';
|
|
8
|
-
export interface OAuthConfigProps {
|
|
9
|
-
/** Callback when configuration is saved */
|
|
10
|
-
onConfigSaved?: (config: OAuthConfigType) => void;
|
|
11
|
-
/** Initial configuration to load */
|
|
12
|
-
initialConfig?: OAuthConfigType | null;
|
|
13
|
-
/** Function to save configuration */
|
|
14
|
-
onSave?: (config: OAuthConfigType) => Promise<void>;
|
|
15
|
-
/** Function to load configuration */
|
|
16
|
-
onLoad?: () => Promise<OAuthConfigType | null>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Easyling Configuration Component
|
|
20
|
-
*
|
|
21
|
-
* Provides a form for configuring Easyling authentication:
|
|
22
|
-
* - Project ID
|
|
23
|
-
* - Access Token (secure password field)
|
|
24
|
-
*/
|
|
25
|
-
export declare const OAuthConfig: React.FC<OAuthConfigProps>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OAuth Configuration 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;
|
|
@@ -1,13 +0,0 @@
|
|
|
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>;
|
|
@@ -1,8 +0,0 @@
|
|
|
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';
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
|
@@ -1,20 +0,0 @@
|
|
|
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>;
|
|
@@ -1,20 +0,0 @@
|
|
|
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>;
|
|
@@ -1,62 +0,0 @@
|
|
|
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
|
-
import type { CollisionResolutionMode, ExistingDocumentHandling } from '../../types/pluginConfig';
|
|
10
|
-
/**
|
|
11
|
-
* Result returned when user confirms locale selection
|
|
12
|
-
*/
|
|
13
|
-
export interface LocaleSelectionResult {
|
|
14
|
-
/** Selected locale codes */
|
|
15
|
-
locales: string[];
|
|
16
|
-
/** Document creation mode */
|
|
17
|
-
creationMode?: 'draft' | 'published';
|
|
18
|
-
/** Collision resolution mode (if override is enabled) */
|
|
19
|
-
collisionResolutionMode?: CollisionResolutionMode;
|
|
20
|
-
/** Existing document handling (if override is enabled) */
|
|
21
|
-
existingDocumentHandling?: ExistingDocumentHandling;
|
|
22
|
-
}
|
|
23
|
-
export interface LocaleSelectionDialogProps {
|
|
24
|
-
/** Whether the dialog is open */
|
|
25
|
-
open: boolean;
|
|
26
|
-
/** Dialog title */
|
|
27
|
-
title: string;
|
|
28
|
-
/** Dialog message/description */
|
|
29
|
-
message: string;
|
|
30
|
-
/** Available locales to choose from */
|
|
31
|
-
availableLocales: LocaleDefinition[];
|
|
32
|
-
/** Currently selected locale codes */
|
|
33
|
-
selectedLocales: string[];
|
|
34
|
-
/** Documents being translated (for context display) */
|
|
35
|
-
selectedDocuments?: any[];
|
|
36
|
-
/** Translation mode */
|
|
37
|
-
mode: 'single' | 'bulk';
|
|
38
|
-
/** Whether multiple locales can be selected */
|
|
39
|
-
allowMultiple?: boolean;
|
|
40
|
-
/** Whether locale selection is required */
|
|
41
|
-
required?: boolean;
|
|
42
|
-
/** Whether to show creation mode option in the dialog */
|
|
43
|
-
showCreationModeOption?: boolean;
|
|
44
|
-
/** Default creation mode to pre-select */
|
|
45
|
-
defaultCreationMode?: 'draft' | 'published';
|
|
46
|
-
/** Whether to show collision resolution override options */
|
|
47
|
-
showCollisionResolutionOverride?: boolean;
|
|
48
|
-
/** Default collision resolution mode from config */
|
|
49
|
-
defaultCollisionResolutionMode?: CollisionResolutionMode;
|
|
50
|
-
/** Default existing document handling from config */
|
|
51
|
-
defaultExistingDocumentHandling?: ExistingDocumentHandling;
|
|
52
|
-
/** Callback when user confirms selection */
|
|
53
|
-
onConfirm: (selectedLocales: string[], creationMode?: 'draft' | 'published') => void;
|
|
54
|
-
/** Enhanced callback with full result object */
|
|
55
|
-
onConfirmWithOptions?: (result: LocaleSelectionResult) => void;
|
|
56
|
-
/** Callback when user cancels */
|
|
57
|
-
onCancel: () => void;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* LocaleSelectionDialog component with search and multi-select functionality
|
|
61
|
-
*/
|
|
62
|
-
export declare const LocaleSelectionDialog: React.FC<LocaleSelectionDialogProps>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SuccessDialog Component
|
|
3
|
-
* Requirements: 3.6, 3.8
|
|
4
|
-
*
|
|
5
|
-
* A success notification dialog with accessibility support
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import type { SuccessDialogOptions } from '../../types/dialog';
|
|
9
|
-
export interface SuccessDialogProps extends SuccessDialogOptions {
|
|
10
|
-
/** Whether the dialog is open */
|
|
11
|
-
open: boolean;
|
|
12
|
-
/** Callback when dialog is closed */
|
|
13
|
-
onClose: () => void;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* SuccessDialog component for displaying success messages
|
|
17
|
-
*/
|
|
18
|
-
export declare const SuccessDialog: React.FC<SuccessDialogProps>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Dialog components exports
|
|
3
|
-
*/
|
|
4
|
-
export { ConfirmationDialog } from './ConfirmationDialog';
|
|
5
|
-
export type { ConfirmationDialogProps } from './ConfirmationDialog';
|
|
6
|
-
export { SuccessDialog } from './SuccessDialog';
|
|
7
|
-
export type { SuccessDialogProps } from './SuccessDialog';
|
|
8
|
-
export { ErrorDialog } from './ErrorDialog';
|
|
9
|
-
export type { ErrorDialogProps } from './ErrorDialog';
|
|
10
|
-
export { LocaleSelectionDialog } from './LocaleSelectionDialog';
|
|
11
|
-
export type { LocaleSelectionDialogProps } from './LocaleSelectionDialog';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DNT Field Badge Component
|
|
3
|
-
* Displays a badge on fields indicating their translation status and allows toggling
|
|
4
|
-
*
|
|
5
|
-
* Now uses document-type-based configuration: toggling DNT for a field applies to
|
|
6
|
-
* ALL documents of the same type.
|
|
7
|
-
*/
|
|
8
|
-
interface DNTFieldBadgeProps {
|
|
9
|
-
documentId: string;
|
|
10
|
-
documentType: string;
|
|
11
|
-
fieldPath: string;
|
|
12
|
-
fieldTitle?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare function DNTFieldBadge(props: DNTFieldBadgeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DNT Field Component
|
|
3
|
-
* A wrapper component that adds DNT toggle functionality to any field
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { ObjectInputProps, StringInputProps, NumberInputProps, BooleanInputProps, ArrayOfObjectsInputProps } from 'sanity';
|
|
7
|
-
type FieldInputProps = ObjectInputProps | StringInputProps | NumberInputProps | BooleanInputProps | ArrayOfObjectsInputProps;
|
|
8
|
-
interface DNTFieldComponentProps {
|
|
9
|
-
documentId?: string;
|
|
10
|
-
documentType?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Higher-order component that wraps field components with DNT functionality
|
|
14
|
-
*/
|
|
15
|
-
export declare function withDNTBadge<P extends FieldInputProps>(Component: React.ComponentType<P>): React.ComponentType<P & DNTFieldComponentProps>;
|
|
16
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DNT Field Input Component
|
|
3
|
-
* Wraps any field with a DNT toggle badge
|
|
4
|
-
*
|
|
5
|
-
* Now uses document-type-based configuration: toggling DNT for a field applies to
|
|
6
|
-
* ALL documents of the same type.
|
|
7
|
-
*/
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import { FieldProps } from 'sanity';
|
|
10
|
-
/**
|
|
11
|
-
* Field component that adds DNT badge
|
|
12
|
-
*/
|
|
13
|
-
export declare function DNTFieldInput(props: FieldProps): React.JSX.Element;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debug DNT Badge Component
|
|
3
|
-
*
|
|
4
|
-
* Displays debug information about the DNT status of a field.
|
|
5
|
-
* This badge is shown on ALL fields (not just translatable ones) when debug mode is enabled.
|
|
6
|
-
* It shows whether the field will be included in the translation request and its effective DNT status.
|
|
7
|
-
*/
|
|
8
|
-
import { FieldProps } from 'sanity';
|
|
9
|
-
export type DebugDNTBadgeProps = FieldProps & {
|
|
10
|
-
/** Name of the group this field belongs to */
|
|
11
|
-
groupName?: string;
|
|
12
|
-
/** Name of the fieldset this field belongs to */
|
|
13
|
-
fieldsetName?: string;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Debug DNT Badge Component
|
|
17
|
-
* Shows the effective DNT status for all fields when debug mode is enabled
|
|
18
|
-
*/
|
|
19
|
-
export declare function DebugDNTBadge(props: DebugDNTBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin configuration schema and utilities
|
|
3
|
-
* Requirements: 5.1, 5.2, 5.3
|
|
4
|
-
*/
|
|
5
|
-
import { LocaleConfig, LocaleDefinition } from '../types/locale';
|
|
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 declare const createPluginConfigSchema: (PasswordInputComponent?: any) => {
|
|
18
|
-
name: string;
|
|
19
|
-
title: string;
|
|
20
|
-
type: string;
|
|
21
|
-
fields: any[];
|
|
22
|
-
groups: ({
|
|
23
|
-
name: string;
|
|
24
|
-
title: string;
|
|
25
|
-
default: boolean;
|
|
26
|
-
description?: undefined;
|
|
27
|
-
} | {
|
|
28
|
-
name: string;
|
|
29
|
-
title: string;
|
|
30
|
-
default?: undefined;
|
|
31
|
-
description?: undefined;
|
|
32
|
-
} | {
|
|
33
|
-
name: string;
|
|
34
|
-
title: string;
|
|
35
|
-
description: string;
|
|
36
|
-
default?: undefined;
|
|
37
|
-
})[];
|
|
38
|
-
preview: {
|
|
39
|
-
prepare: () => {
|
|
40
|
-
title: string;
|
|
41
|
-
subtitle: string;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Default export for backward compatibility and tests
|
|
47
|
-
*/
|
|
48
|
-
export declare const pluginConfigSchema: {
|
|
49
|
-
name: string;
|
|
50
|
-
title: string;
|
|
51
|
-
type: string;
|
|
52
|
-
fields: any[];
|
|
53
|
-
groups: ({
|
|
54
|
-
name: string;
|
|
55
|
-
title: string;
|
|
56
|
-
default: boolean;
|
|
57
|
-
description?: undefined;
|
|
58
|
-
} | {
|
|
59
|
-
name: string;
|
|
60
|
-
title: string;
|
|
61
|
-
default?: undefined;
|
|
62
|
-
description?: undefined;
|
|
63
|
-
} | {
|
|
64
|
-
name: string;
|
|
65
|
-
title: string;
|
|
66
|
-
description: string;
|
|
67
|
-
default?: undefined;
|
|
68
|
-
})[];
|
|
69
|
-
preview: {
|
|
70
|
-
prepare: () => {
|
|
71
|
-
title: string;
|
|
72
|
-
subtitle: string;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Legacy locale-only configuration schema (deprecated, kept for migration)
|
|
78
|
-
* @deprecated Use pluginConfigSchema instead
|
|
79
|
-
*/
|
|
80
|
-
export declare const legacyLocaleConfigSchema: {
|
|
81
|
-
name: string;
|
|
82
|
-
title: string;
|
|
83
|
-
type: string;
|
|
84
|
-
fields: ({
|
|
85
|
-
name: string;
|
|
86
|
-
title: string;
|
|
87
|
-
type: string;
|
|
88
|
-
description: string;
|
|
89
|
-
of: {
|
|
90
|
-
type: string;
|
|
91
|
-
title: string;
|
|
92
|
-
fields: ({
|
|
93
|
-
name: string;
|
|
94
|
-
title: string;
|
|
95
|
-
type: string;
|
|
96
|
-
description: string;
|
|
97
|
-
validation: (Rule: any) => any;
|
|
98
|
-
initialValue?: undefined;
|
|
99
|
-
} | {
|
|
100
|
-
name: string;
|
|
101
|
-
title: string;
|
|
102
|
-
type: string;
|
|
103
|
-
description: string;
|
|
104
|
-
initialValue: boolean;
|
|
105
|
-
validation?: undefined;
|
|
106
|
-
})[];
|
|
107
|
-
preview: {
|
|
108
|
-
select: {
|
|
109
|
-
title: string;
|
|
110
|
-
subtitle: string;
|
|
111
|
-
enabled: string;
|
|
112
|
-
};
|
|
113
|
-
prepare: ({ title, subtitle, enabled }: any) => {
|
|
114
|
-
title: any;
|
|
115
|
-
subtitle: string;
|
|
116
|
-
media: string;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
}[];
|
|
120
|
-
validation?: undefined;
|
|
121
|
-
initialValue?: undefined;
|
|
122
|
-
readOnly?: undefined;
|
|
123
|
-
} | {
|
|
124
|
-
name: string;
|
|
125
|
-
title: string;
|
|
126
|
-
type: string;
|
|
127
|
-
description: string;
|
|
128
|
-
validation: (Rule: any) => any;
|
|
129
|
-
of?: undefined;
|
|
130
|
-
initialValue?: undefined;
|
|
131
|
-
readOnly?: undefined;
|
|
132
|
-
} | {
|
|
133
|
-
name: string;
|
|
134
|
-
title: string;
|
|
135
|
-
type: string;
|
|
136
|
-
description: string;
|
|
137
|
-
initialValue: string;
|
|
138
|
-
readOnly: boolean;
|
|
139
|
-
of?: undefined;
|
|
140
|
-
validation?: undefined;
|
|
141
|
-
})[];
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* Default locale configuration
|
|
145
|
-
*/
|
|
146
|
-
export declare const defaultLocaleConfig: LocaleConfig;
|
|
147
|
-
/**
|
|
148
|
-
* Common locale definitions for quick setup
|
|
149
|
-
*/
|
|
150
|
-
export declare const commonLocales: LocaleDefinition[];
|
|
151
|
-
/**
|
|
152
|
-
* Validate locale code format
|
|
153
|
-
*/
|
|
154
|
-
export declare function validateLocaleCode(code: string): boolean;
|
|
155
|
-
/**
|
|
156
|
-
* Create a new locale definition with current timestamps
|
|
157
|
-
*/
|
|
158
|
-
export declare function createLocaleDefinition(code: string, displayName: string, enabled?: boolean): LocaleDefinition;
|
|
159
|
-
/**
|
|
160
|
-
* Update an existing locale definition with new timestamp
|
|
161
|
-
*/
|
|
162
|
-
export declare function updateLocaleDefinition(locale: LocaleDefinition, updates: Partial<Omit<LocaleDefinition, 'createdAt' | 'updatedAt'>>): LocaleDefinition;
|
package/dist-types/index.d.ts
DELETED
|
@@ -1,11 +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';
|
package/dist-types/plugin.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Context for plugin configuration state
|
|
3
|
-
*/
|
|
4
|
-
interface PluginConfigContextType {
|
|
5
|
-
debugMode: boolean;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Hook to access plugin configuration
|
|
9
|
-
*/
|
|
10
|
-
export declare function usePluginConfig(): PluginConfigContextType;
|
|
11
|
-
declare const _default: import("sanity").Plugin<void>;
|
|
12
|
-
export default _default;
|