@form-engine-ts/react 6.0.0 → 6.2.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 +10 -3
- package/dist/index.cjs +297 -67
- package/dist/index.d.cts +202 -116
- package/dist/index.d.ts +202 -116
- package/dist/index.js +285 -50
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _form_engine_ts_core from '@form-engine-ts/core';
|
|
2
|
-
import { QuestionType, FormField, ChoiceOption, FormPage, FormSchema, DisplayCondition, JsonValue, SchemaIssue, FormPolicy,
|
|
3
|
-
export { QuestionType } from '@form-engine-ts/core';
|
|
2
|
+
import { QuestionType, FormField, ChoiceOption, FormPage, FormSchema, DisplayCondition, JsonValue, SchemaIssue, FormPolicy, TranslationAdapter, AsyncTranslationAdapter, LocaleOption, TranslationReport, TranslationSlot, PopulateTranslationOptions, TranslationProgress, Question, FieldOption, ValidationIssue, ValidationError, FormValues, TranslationStatus, CanonicalTranslationMetadata, FormValue, AnswerValidationResult, FormEngineTranslator, FormEngineMessages, TranslationMissingKeyEvent, FieldType } from '@form-engine-ts/core';
|
|
3
|
+
export { FormSubmissionError, FormSubmissionSerializedError, QuestionType } from '@form-engine-ts/core';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { ReactNode, ComponentType, KeyboardEvent, MouseEvent, CSSProperties } from 'react';
|
|
6
6
|
import { SensitiveDataFinding } from '@form-engine-ts/privacy';
|
|
@@ -125,6 +125,127 @@ interface UseFormBuilderResult extends FormBuilderResult {
|
|
|
125
125
|
}
|
|
126
126
|
declare function useFormBuilder({ schema, onChange, policy, idFactory, factories, fieldEditorMode, activeFieldId: controlledActiveFieldId, defaultActiveFieldId, onActiveFieldChange }: FormBuilderOptions): FormBuilderResult;
|
|
127
127
|
|
|
128
|
+
interface UseTranslationWorkspaceOptions {
|
|
129
|
+
readonly schema: FormSchema;
|
|
130
|
+
readonly onChange?: (schema: FormSchema) => void;
|
|
131
|
+
readonly sourceLocale?: string;
|
|
132
|
+
readonly targetLocale?: string;
|
|
133
|
+
readonly translationAdapter?: TranslationAdapter | AsyncTranslationAdapter;
|
|
134
|
+
readonly signal?: AbortSignal;
|
|
135
|
+
readonly readOnly?: boolean;
|
|
136
|
+
readonly policy?: FormPolicy;
|
|
137
|
+
readonly availableLocales?: readonly (string | LocaleOption)[];
|
|
138
|
+
readonly onLocaleAdded?: (locale: string) => void;
|
|
139
|
+
readonly onLocaleRemoved?: (locale: string) => void;
|
|
140
|
+
readonly onLocaleChange?: (targetLocale: string) => void;
|
|
141
|
+
readonly beforeRemoveLocale?: (locale: string, context: {
|
|
142
|
+
readonly slotCount: number;
|
|
143
|
+
}) => Promise<boolean> | boolean;
|
|
144
|
+
readonly confirmRemoveLocale?: (props: ConfirmRemoveLocaleSlotProps) => ReactNode;
|
|
145
|
+
readonly slots?: Pick<TranslationWorkspaceSlots, "confirmRemoveLocale">;
|
|
146
|
+
readonly onTranslationStart?: (params: {
|
|
147
|
+
readonly targetLocale: string;
|
|
148
|
+
readonly mode: "manual" | "automatic";
|
|
149
|
+
}) => void;
|
|
150
|
+
readonly onTranslationSuccess?: (payload: TranslationEventPayload) => void;
|
|
151
|
+
readonly onTranslationReport?: (report: TranslationReport) => void;
|
|
152
|
+
readonly onTranslationError?: (params: {
|
|
153
|
+
readonly targetLocale: string;
|
|
154
|
+
readonly error: TranslationWorkspaceError;
|
|
155
|
+
}) => void;
|
|
156
|
+
readonly onTranslationChange?: (event: TranslationSlotChangeEvent) => void;
|
|
157
|
+
readonly validateLocale?: ((locale: string, currentLocales: readonly string[]) => LocaleValidationResult) | CustomLocaleValidator;
|
|
158
|
+
}
|
|
159
|
+
interface LocaleValidationContext {
|
|
160
|
+
readonly locale: string;
|
|
161
|
+
readonly defaultLocale: string;
|
|
162
|
+
readonly currentLocales: readonly string[];
|
|
163
|
+
readonly policy?: FormPolicy;
|
|
164
|
+
}
|
|
165
|
+
type CustomLocaleValidator = (locale: string, context: LocaleValidationContext) => LocaleValidationResult | boolean | string | undefined | void;
|
|
166
|
+
interface LocaleValidationResult {
|
|
167
|
+
readonly valid: boolean;
|
|
168
|
+
readonly error?: {
|
|
169
|
+
readonly type: "locale_not_allowed" | "max_locales_exceeded" | "invalid_locale_format" | "locale_already_exists" | "custom_validation_failed";
|
|
170
|
+
readonly message: string;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
interface TranslationSummary {
|
|
174
|
+
readonly totalSlots: number;
|
|
175
|
+
readonly translatedCount: number;
|
|
176
|
+
readonly missingCount: number;
|
|
177
|
+
readonly staleCount: number;
|
|
178
|
+
readonly manualCount: number;
|
|
179
|
+
readonly completionPercentage: number;
|
|
180
|
+
}
|
|
181
|
+
type TranslationWorkspaceError = {
|
|
182
|
+
readonly type: "locale_not_allowed";
|
|
183
|
+
readonly locale: string;
|
|
184
|
+
} | {
|
|
185
|
+
readonly type: "locale_already_exists";
|
|
186
|
+
readonly locale: string;
|
|
187
|
+
} | {
|
|
188
|
+
readonly type: "invalid_locale_format";
|
|
189
|
+
readonly locale: string;
|
|
190
|
+
} | {
|
|
191
|
+
readonly type: "max_locales_exceeded";
|
|
192
|
+
readonly max: number;
|
|
193
|
+
readonly current: number;
|
|
194
|
+
} | {
|
|
195
|
+
readonly type: "read_only_mode";
|
|
196
|
+
} | {
|
|
197
|
+
readonly type: "adapter_not_configured";
|
|
198
|
+
} | {
|
|
199
|
+
readonly type: "target_locale_missing";
|
|
200
|
+
} | {
|
|
201
|
+
readonly type: "translation_failed";
|
|
202
|
+
readonly message: string;
|
|
203
|
+
readonly cause?: unknown;
|
|
204
|
+
} | {
|
|
205
|
+
readonly type: "partial_failure";
|
|
206
|
+
readonly succeeded: number;
|
|
207
|
+
readonly failed: number;
|
|
208
|
+
} | {
|
|
209
|
+
readonly type: "cancelled";
|
|
210
|
+
} | {
|
|
211
|
+
readonly type: "custom_validation_failed";
|
|
212
|
+
readonly message: string;
|
|
213
|
+
};
|
|
214
|
+
interface UseTranslationWorkspaceResult {
|
|
215
|
+
readonly sourceLocale: string;
|
|
216
|
+
readonly targetLocale: string;
|
|
217
|
+
readonly targetLocales: readonly string[];
|
|
218
|
+
readonly localeOptions: readonly LocaleOption[];
|
|
219
|
+
readonly setTargetLocale: (locale: string) => void;
|
|
220
|
+
readonly slots: readonly TranslationSlot[];
|
|
221
|
+
readonly summary: TranslationSummary;
|
|
222
|
+
readonly addLocale: (locale: string) => {
|
|
223
|
+
readonly success: boolean;
|
|
224
|
+
readonly error?: TranslationWorkspaceError;
|
|
225
|
+
};
|
|
226
|
+
readonly isAddLocaleAllowed: (locale: string) => boolean;
|
|
227
|
+
readonly removeLocale: (locale: string) => boolean | Promise<boolean>;
|
|
228
|
+
readonly removeLocaleConfirmation?: ReactNode;
|
|
229
|
+
readonly setTranslation: (slot: TranslationSlot, text: string) => void;
|
|
230
|
+
readonly translateAll: (options?: PopulateTranslationOptions) => Promise<{
|
|
231
|
+
readonly success: boolean;
|
|
232
|
+
readonly report?: TranslationReport;
|
|
233
|
+
readonly error?: TranslationWorkspaceError;
|
|
234
|
+
}>;
|
|
235
|
+
readonly translateSlot: (slot: TranslationSlot, options?: {
|
|
236
|
+
readonly signal?: AbortSignal;
|
|
237
|
+
}) => Promise<{
|
|
238
|
+
readonly success: boolean;
|
|
239
|
+
readonly error?: TranslationWorkspaceError;
|
|
240
|
+
}>;
|
|
241
|
+
readonly cancelTranslation: () => void;
|
|
242
|
+
readonly isTranslating: boolean;
|
|
243
|
+
readonly progress?: TranslationProgress;
|
|
244
|
+
readonly error?: TranslationWorkspaceError;
|
|
245
|
+
}
|
|
246
|
+
declare const validateLocalePipeline: (locale: string, schema: FormSchema, policy?: FormPolicy, customValidator?: ((locale: string, currentLocales: readonly string[]) => LocaleValidationResult) | CustomLocaleValidator, availableLocales?: readonly (string | LocaleOption)[]) => LocaleValidationResult;
|
|
247
|
+
declare function useTranslationWorkspace({ schema, onChange, sourceLocale, targetLocale, translationAdapter, signal, readOnly, policy, availableLocales, onLocaleAdded, onLocaleRemoved, onLocaleChange, beforeRemoveLocale, confirmRemoveLocale, slots: workspaceSlots, onTranslationStart, onTranslationSuccess, onTranslationReport, onTranslationError, onTranslationChange, validateLocale }: UseTranslationWorkspaceOptions): UseTranslationWorkspaceResult;
|
|
248
|
+
|
|
128
249
|
interface SubmissionReceipt {
|
|
129
250
|
readonly formId: string;
|
|
130
251
|
readonly formVersion: number;
|
|
@@ -307,6 +428,7 @@ interface BuilderSlotBaseProps {
|
|
|
307
428
|
readonly actions: BuilderSlotActions;
|
|
308
429
|
readonly components: Required<FormBuilderComponents>;
|
|
309
430
|
readonly translate: (key: string, params?: Record<string, unknown>) => string;
|
|
431
|
+
readonly onChange?: (schema: FormSchema) => void;
|
|
310
432
|
}
|
|
311
433
|
interface BuilderToolbarSlotProps extends BuilderSlotBaseProps {
|
|
312
434
|
readonly kind: "page" | "field" | "option";
|
|
@@ -395,6 +517,8 @@ interface TranslationWorkspaceHeaderProps {
|
|
|
395
517
|
readonly onTranslateAll: () => void;
|
|
396
518
|
readonly isTranslating: boolean;
|
|
397
519
|
readonly readOnly: boolean;
|
|
520
|
+
readonly progress?: TranslationProgress;
|
|
521
|
+
readonly onCancel?: () => void;
|
|
398
522
|
}
|
|
399
523
|
interface TranslationSlotRowProps {
|
|
400
524
|
readonly slot: _form_engine_ts_core.TranslationSlot;
|
|
@@ -402,6 +526,76 @@ interface TranslationSlotRowProps {
|
|
|
402
526
|
readonly onChange: (text: string) => void;
|
|
403
527
|
readonly onTranslate: () => void;
|
|
404
528
|
}
|
|
529
|
+
interface TranslationComparisonItem {
|
|
530
|
+
readonly id: string;
|
|
531
|
+
readonly path: string;
|
|
532
|
+
readonly targetKind: "form" | "page" | "field" | "option";
|
|
533
|
+
readonly targetProperty: "title" | "description" | "label" | "completionMessage";
|
|
534
|
+
readonly nodeTitle?: string;
|
|
535
|
+
readonly sourceText: string;
|
|
536
|
+
readonly translatedText: string;
|
|
537
|
+
readonly status: TranslationStatus;
|
|
538
|
+
readonly metadata?: CanonicalTranslationMetadata;
|
|
539
|
+
readonly translatable: boolean;
|
|
540
|
+
}
|
|
541
|
+
interface TranslationComparisonSummary {
|
|
542
|
+
readonly total: number;
|
|
543
|
+
readonly translated: number;
|
|
544
|
+
readonly missing: number;
|
|
545
|
+
readonly stale: number;
|
|
546
|
+
readonly manual: number;
|
|
547
|
+
}
|
|
548
|
+
interface TranslationComparisonHeaderProps {
|
|
549
|
+
readonly sourceLocale: string;
|
|
550
|
+
readonly targetLocale: string;
|
|
551
|
+
readonly summary: TranslationComparisonSummary;
|
|
552
|
+
readonly onTranslateAll: () => void;
|
|
553
|
+
readonly isTranslating: boolean;
|
|
554
|
+
readonly readOnly: boolean;
|
|
555
|
+
readonly report?: TranslationReport;
|
|
556
|
+
readonly progress?: TranslationProgress;
|
|
557
|
+
readonly onCancel?: () => void;
|
|
558
|
+
}
|
|
559
|
+
interface TranslationComparisonItemRowProps {
|
|
560
|
+
readonly item: TranslationComparisonItem;
|
|
561
|
+
readonly questionIndex?: number;
|
|
562
|
+
readonly fieldType?: string;
|
|
563
|
+
readonly optionIndex?: number;
|
|
564
|
+
readonly sourceLocaleLabel?: string;
|
|
565
|
+
readonly targetLocaleLabel?: string;
|
|
566
|
+
readonly readOnly: boolean;
|
|
567
|
+
readonly onChange: (text: string) => void;
|
|
568
|
+
readonly onTranslate: () => Promise<void>;
|
|
569
|
+
}
|
|
570
|
+
interface UseTranslationComparisonOptions {
|
|
571
|
+
readonly schema: FormSchema;
|
|
572
|
+
readonly sourceLocale?: string;
|
|
573
|
+
readonly targetLocale: string;
|
|
574
|
+
readonly translationAdapter?: TranslationAdapter | AsyncTranslationAdapter;
|
|
575
|
+
readonly signal?: AbortSignal;
|
|
576
|
+
readonly readOnly?: boolean;
|
|
577
|
+
readonly onChange?: (nextSchema: FormSchema) => void;
|
|
578
|
+
readonly onTranslationChange?: (event: TranslationSlotChangeEvent) => void;
|
|
579
|
+
readonly onTranslationReport?: (report: TranslationReport) => void;
|
|
580
|
+
readonly onTranslationError?: (params: {
|
|
581
|
+
readonly targetLocale: string;
|
|
582
|
+
readonly error: TranslationWorkspaceError;
|
|
583
|
+
}) => void;
|
|
584
|
+
}
|
|
585
|
+
interface UseTranslationComparisonResult {
|
|
586
|
+
readonly sourceLocale: string;
|
|
587
|
+
readonly targetLocale: string;
|
|
588
|
+
readonly items: readonly TranslationComparisonItem[];
|
|
589
|
+
readonly summary: TranslationComparisonSummary;
|
|
590
|
+
readonly isTranslating: boolean;
|
|
591
|
+
readonly updateTranslation: (path: string, text: string) => void;
|
|
592
|
+
readonly translateSingle: (path: string) => Promise<void>;
|
|
593
|
+
readonly translateAll: (options?: PopulateTranslationOptions) => Promise<TranslationReport>;
|
|
594
|
+
readonly cancelTranslation: () => void;
|
|
595
|
+
readonly progress?: TranslationProgress;
|
|
596
|
+
readonly error?: TranslationWorkspaceError;
|
|
597
|
+
readonly report?: TranslationReport;
|
|
598
|
+
}
|
|
405
599
|
interface LocaleSelectorProps {
|
|
406
600
|
readonly targetLocale: string;
|
|
407
601
|
readonly targetLocales: readonly string[];
|
|
@@ -443,6 +637,7 @@ interface ConfirmRemoveLocaleSlotProps {
|
|
|
443
637
|
interface TranslationWorkspaceSlots {
|
|
444
638
|
readonly renderHeader?: (props: TranslationWorkspaceHeaderProps) => ReactNode;
|
|
445
639
|
readonly renderSlotRow?: (props: TranslationSlotRowProps) => ReactNode;
|
|
640
|
+
readonly renderItemRow?: (props: TranslationComparisonItemRowProps) => ReactNode;
|
|
446
641
|
readonly renderLocaleSelector?: (props: LocaleSelectorProps) => ReactNode;
|
|
447
642
|
readonly renderStatusBadge?: (props: {
|
|
448
643
|
readonly status: _form_engine_ts_core.TranslationStatus;
|
|
@@ -551,10 +746,6 @@ interface FormServerErrorPayload {
|
|
|
551
746
|
readonly fieldErrors?: Readonly<Record<string, string>>;
|
|
552
747
|
readonly formError?: string;
|
|
553
748
|
}
|
|
554
|
-
declare class FormSubmissionError extends Error {
|
|
555
|
-
readonly payload: FormServerErrorPayload;
|
|
556
|
-
constructor(message: string, payload?: FormServerErrorPayload);
|
|
557
|
-
}
|
|
558
749
|
type FormSubmitHandler = (answers: FormValues, context: SubmitContext) => SubmitResponse | void | Promise<SubmitResponse | undefined> | Promise<void>;
|
|
559
750
|
type SubmissionGuardResult = {
|
|
560
751
|
readonly status: "allow";
|
|
@@ -771,114 +962,7 @@ interface FieldState {
|
|
|
771
962
|
}
|
|
772
963
|
declare function useField(fieldId: string): FieldState;
|
|
773
964
|
|
|
774
|
-
|
|
775
|
-
readonly schema: FormSchema;
|
|
776
|
-
readonly onChange?: (schema: FormSchema) => void;
|
|
777
|
-
readonly sourceLocale?: string;
|
|
778
|
-
readonly targetLocale?: string;
|
|
779
|
-
readonly translationAdapter?: TranslationAdapter | AsyncTranslationAdapter;
|
|
780
|
-
readonly readOnly?: boolean;
|
|
781
|
-
readonly policy?: FormPolicy;
|
|
782
|
-
readonly availableLocales?: readonly (string | LocaleOption)[];
|
|
783
|
-
readonly onLocaleAdded?: (locale: string) => void;
|
|
784
|
-
readonly onLocaleRemoved?: (locale: string) => void;
|
|
785
|
-
readonly onLocaleChange?: (targetLocale: string) => void;
|
|
786
|
-
readonly beforeRemoveLocale?: (locale: string, context: {
|
|
787
|
-
readonly slotCount: number;
|
|
788
|
-
}) => Promise<boolean> | boolean;
|
|
789
|
-
readonly confirmRemoveLocale?: (props: ConfirmRemoveLocaleSlotProps) => ReactNode;
|
|
790
|
-
readonly slots?: Pick<TranslationWorkspaceSlots, "confirmRemoveLocale">;
|
|
791
|
-
readonly onTranslationStart?: (params: {
|
|
792
|
-
readonly targetLocale: string;
|
|
793
|
-
readonly mode: "manual" | "automatic";
|
|
794
|
-
}) => void;
|
|
795
|
-
readonly onTranslationSuccess?: (payload: TranslationEventPayload) => void;
|
|
796
|
-
readonly onTranslationError?: (params: {
|
|
797
|
-
readonly targetLocale: string;
|
|
798
|
-
readonly error: TranslationWorkspaceError;
|
|
799
|
-
}) => void;
|
|
800
|
-
readonly onTranslationChange?: (event: TranslationSlotChangeEvent) => void;
|
|
801
|
-
readonly validateLocale?: ((locale: string, currentLocales: readonly string[]) => LocaleValidationResult) | CustomLocaleValidator;
|
|
802
|
-
}
|
|
803
|
-
interface LocaleValidationContext {
|
|
804
|
-
readonly locale: string;
|
|
805
|
-
readonly defaultLocale: string;
|
|
806
|
-
readonly currentLocales: readonly string[];
|
|
807
|
-
readonly policy?: FormPolicy;
|
|
808
|
-
}
|
|
809
|
-
type CustomLocaleValidator = (locale: string, context: LocaleValidationContext) => LocaleValidationResult | boolean | string | undefined | void;
|
|
810
|
-
interface LocaleValidationResult {
|
|
811
|
-
readonly valid: boolean;
|
|
812
|
-
readonly error?: {
|
|
813
|
-
readonly type: "locale_not_allowed" | "max_locales_exceeded" | "invalid_locale_format" | "locale_already_exists" | "custom_validation_failed";
|
|
814
|
-
readonly message: string;
|
|
815
|
-
};
|
|
816
|
-
}
|
|
817
|
-
interface TranslationSummary {
|
|
818
|
-
readonly totalSlots: number;
|
|
819
|
-
readonly translatedCount: number;
|
|
820
|
-
readonly missingCount: number;
|
|
821
|
-
readonly staleCount: number;
|
|
822
|
-
readonly manualCount: number;
|
|
823
|
-
readonly completionPercentage: number;
|
|
824
|
-
}
|
|
825
|
-
type TranslationWorkspaceError = {
|
|
826
|
-
readonly type: "locale_not_allowed";
|
|
827
|
-
readonly locale: string;
|
|
828
|
-
} | {
|
|
829
|
-
readonly type: "locale_already_exists";
|
|
830
|
-
readonly locale: string;
|
|
831
|
-
} | {
|
|
832
|
-
readonly type: "invalid_locale_format";
|
|
833
|
-
readonly locale: string;
|
|
834
|
-
} | {
|
|
835
|
-
readonly type: "max_locales_exceeded";
|
|
836
|
-
readonly max: number;
|
|
837
|
-
readonly current: number;
|
|
838
|
-
} | {
|
|
839
|
-
readonly type: "read_only_mode";
|
|
840
|
-
} | {
|
|
841
|
-
readonly type: "adapter_not_configured";
|
|
842
|
-
} | {
|
|
843
|
-
readonly type: "target_locale_missing";
|
|
844
|
-
} | {
|
|
845
|
-
readonly type: "translation_failed";
|
|
846
|
-
readonly message: string;
|
|
847
|
-
readonly cause?: unknown;
|
|
848
|
-
} | {
|
|
849
|
-
readonly type: "custom_validation_failed";
|
|
850
|
-
readonly message: string;
|
|
851
|
-
};
|
|
852
|
-
interface UseTranslationWorkspaceResult {
|
|
853
|
-
readonly sourceLocale: string;
|
|
854
|
-
readonly targetLocale: string;
|
|
855
|
-
readonly targetLocales: readonly string[];
|
|
856
|
-
readonly localeOptions: readonly LocaleOption[];
|
|
857
|
-
readonly setTargetLocale: (locale: string) => void;
|
|
858
|
-
readonly slots: readonly TranslationSlot[];
|
|
859
|
-
readonly summary: TranslationSummary;
|
|
860
|
-
readonly addLocale: (locale: string) => {
|
|
861
|
-
readonly success: boolean;
|
|
862
|
-
readonly error?: TranslationWorkspaceError;
|
|
863
|
-
};
|
|
864
|
-
readonly isAddLocaleAllowed: (locale: string) => boolean;
|
|
865
|
-
readonly removeLocale: (locale: string) => boolean | Promise<boolean>;
|
|
866
|
-
readonly removeLocaleConfirmation?: ReactNode;
|
|
867
|
-
readonly setTranslation: (slot: TranslationSlot, text: string) => void;
|
|
868
|
-
readonly translateAll: (options?: PopulateTranslationOptions) => Promise<{
|
|
869
|
-
readonly success: boolean;
|
|
870
|
-
readonly report?: TranslationReport;
|
|
871
|
-
readonly error?: TranslationWorkspaceError;
|
|
872
|
-
}>;
|
|
873
|
-
readonly translateSlot: (slot: TranslationSlot) => Promise<{
|
|
874
|
-
readonly success: boolean;
|
|
875
|
-
readonly error?: TranslationWorkspaceError;
|
|
876
|
-
}>;
|
|
877
|
-
readonly isTranslating: boolean;
|
|
878
|
-
readonly error?: TranslationWorkspaceError;
|
|
879
|
-
}
|
|
880
|
-
declare const validateLocalePipeline: (locale: string, schema: FormSchema, policy?: FormPolicy, customValidator?: ((locale: string, currentLocales: readonly string[]) => LocaleValidationResult) | CustomLocaleValidator, availableLocales?: readonly (string | LocaleOption)[]) => LocaleValidationResult;
|
|
881
|
-
declare function useTranslationWorkspace({ schema, onChange, sourceLocale, targetLocale, translationAdapter, readOnly, policy, availableLocales, onLocaleAdded, onLocaleRemoved, onLocaleChange, beforeRemoveLocale, confirmRemoveLocale, slots: workspaceSlots, onTranslationStart, onTranslationSuccess, onTranslationError, onTranslationChange, validateLocale }: UseTranslationWorkspaceOptions): UseTranslationWorkspaceResult;
|
|
965
|
+
declare function useTranslationComparison({ schema, sourceLocale, targetLocale, translationAdapter, readOnly, onChange, onTranslationChange, onTranslationReport, onTranslationError, signal }: UseTranslationComparisonOptions): UseTranslationComparisonResult;
|
|
882
966
|
|
|
883
967
|
declare const BUILDER_TRANSLATION_KEYS: {
|
|
884
968
|
readonly ADD_FIELD: "builder.actions.addField";
|
|
@@ -909,10 +993,12 @@ interface FormEngineI18nProviderProps {
|
|
|
909
993
|
readonly fallbackLocale?: string;
|
|
910
994
|
readonly messages?: FormEngineMessages;
|
|
911
995
|
readonly customCatalogs?: Record<string, FormEngineMessages>;
|
|
996
|
+
readonly onMissingKey?: (event: TranslationMissingKeyEvent) => void;
|
|
997
|
+
readonly strict?: boolean;
|
|
912
998
|
readonly translator?: FormEngineTranslator;
|
|
913
999
|
readonly children: ReactNode;
|
|
914
1000
|
}
|
|
915
|
-
declare function FormEngineI18nProvider({ locale, fallbackLocale, messages, customCatalogs, translator: customTranslator, children }: FormEngineI18nProviderProps): react.JSX.Element;
|
|
1001
|
+
declare function FormEngineI18nProvider({ locale, fallbackLocale, messages, customCatalogs, onMissingKey, strict, translator: customTranslator, children }: FormEngineI18nProviderProps): react.JSX.Element;
|
|
916
1002
|
declare function useFormEngineI18n(): FormEngineI18nContextValue;
|
|
917
1003
|
|
|
918
1004
|
declare function resolveChoiceFieldLayout(type: FieldType, appearance?: FormRendererAppearance, groupedChoiceFieldsLegacy?: boolean): "default" | "grouped";
|
|
@@ -968,4 +1054,4 @@ interface StandaloneFormRendererProps extends FormRendererPresentationProps {
|
|
|
968
1054
|
type FormRendererProps = FormRendererPresentationProps | StandaloneFormRendererProps;
|
|
969
1055
|
declare function FormRenderer(props: FormRendererProps): react.JSX.Element;
|
|
970
1056
|
|
|
971
|
-
export { BUILDER_TRANSLATION_ALIASES, BUILDER_TRANSLATION_KEYS, type BeforeSubmit, type BuilderActionContext, type BuilderActionError, type BuilderActionIconType, type BuilderActionResult, type BuilderButtonProps, type BuilderCheckboxProps, type BuilderErrorMessageProps, type BuilderFactories, type BuilderFieldEditorSlotProps, type BuilderFieldsetProps, type BuilderIconButtonProps, type BuilderIdKind, type BuilderLocalizationSlotProps, type BuilderOptionEditorSlotProps, type BuilderPagesSlotProps, type BuilderPolicy, type BuilderSectionProps, type BuilderSelectOption, type BuilderSelectProps, type BuilderSlotActions, type BuilderTextAreaProps, type BuilderTextInputProps, type BuilderTextTarget, type BuilderToolbarSlotProps, type BuilderTranslationActionsSlotProps, type BuilderTranslationKey, type ChoiceFieldLayoutMode, type ChoiceFieldTypeLayoutMap, type ChoiceGroupSlotProps, type ComponentBaseProps, type ConfirmRemoveLocaleSlotProps, type CustomLocaleValidator, type FieldComponentProps, type FieldComponents, type FieldEditorControlsConfig, type FieldEditorHeaderSlotProps, type FieldEditorMode, type FieldError, type FieldPropertyControlMode, type FieldState, type FieldTypeSelectOptionsConfig, type FieldTypeSelectOptionsContext, type FieldTypeSelectOptionsSorter, type FieldTypeSelectOptionsTransformer, type FieldTypeSelectSlotProps, FormBuilder, type FormBuilderActions, type FormBuilderComponents, type FormBuilderFeatures, type FormBuilderOptions, type FormBuilderProps, type FormBuilderResult, type FormBuilderSectionName, type FormBuilderSlots, type FormBuilderSubmissionSettingsOptions, type FormCompletionSlotProps, type FormContextValue, FormEngineI18nContext, type FormEngineI18nContextValue, FormEngineI18nProvider, type FormEngineI18nProviderProps, type FormFieldsSlotProps, FormProvider, type FormProviderProps, FormRenderer, type FormRendererAppearance, type FormRendererMessages, type FormRendererPresentationProps, type FormRendererProps, type FormRendererSlotProps, type FormRendererSlots, type FormServerErrorPayload,
|
|
1057
|
+
export { BUILDER_TRANSLATION_ALIASES, BUILDER_TRANSLATION_KEYS, type BeforeSubmit, type BuilderActionContext, type BuilderActionError, type BuilderActionIconType, type BuilderActionResult, type BuilderButtonProps, type BuilderCheckboxProps, type BuilderErrorMessageProps, type BuilderFactories, type BuilderFieldEditorSlotProps, type BuilderFieldsetProps, type BuilderIconButtonProps, type BuilderIdKind, type BuilderLocalizationSlotProps, type BuilderOptionEditorSlotProps, type BuilderPagesSlotProps, type BuilderPolicy, type BuilderSectionProps, type BuilderSelectOption, type BuilderSelectProps, type BuilderSlotActions, type BuilderTextAreaProps, type BuilderTextInputProps, type BuilderTextTarget, type BuilderToolbarSlotProps, type BuilderTranslationActionsSlotProps, type BuilderTranslationKey, type ChoiceFieldLayoutMode, type ChoiceFieldTypeLayoutMap, type ChoiceGroupSlotProps, type ComponentBaseProps, type ConfirmRemoveLocaleSlotProps, type CustomLocaleValidator, type FieldComponentProps, type FieldComponents, type FieldEditorControlsConfig, type FieldEditorHeaderSlotProps, type FieldEditorMode, type FieldError, type FieldPropertyControlMode, type FieldState, type FieldTypeSelectOptionsConfig, type FieldTypeSelectOptionsContext, type FieldTypeSelectOptionsSorter, type FieldTypeSelectOptionsTransformer, type FieldTypeSelectSlotProps, FormBuilder, type FormBuilderActions, type FormBuilderComponents, type FormBuilderFeatures, type FormBuilderOptions, type FormBuilderProps, type FormBuilderResult, type FormBuilderSectionName, type FormBuilderSlots, type FormBuilderSubmissionSettingsOptions, type FormCompletionSlotProps, type FormContextValue, FormEngineI18nContext, type FormEngineI18nContextValue, FormEngineI18nProvider, type FormEngineI18nProviderProps, type FormFieldsSlotProps, FormProvider, type FormProviderProps, FormRenderer, type FormRendererAppearance, type FormRendererMessages, type FormRendererPresentationProps, type FormRendererProps, type FormRendererSlotProps, type FormRendererSlots, type FormServerErrorPayload, type FormSubmitHandler, type FormSubmitState, type FormSubmitStatus, type FormSubmittedAnswerItem, type FormSuccessRenderMode, type IconButtonProps, type InputComponentProps, type LocaleSelectorProps, type LocaleValidationContext, type LocaleValidationResult, type LocalizationSummaryContext, type ManualTranslationContext, type ManualTranslationTarget, type RenderSubmitButtonProps, type SelectComponentProps, type StandaloneFormRendererProps, type SubmissionAttempt, type SubmissionAttemptStore, type SubmissionConfirmationOptions, type SubmissionConfirmationRenderMode, type SubmissionConfirmationSlotProps, type SubmissionGuard, type SubmissionGuardResult, type SubmissionProtectionProps, type SubmissionReceipt, type SubmissionReceiptQuery, type SubmissionReceiptStore, type SubmitContext, type SubmitResponse, type SubmitResult, type SubmitStatus, type TranslationComparisonHeaderProps, type TranslationComparisonItem, type TranslationComparisonItemRowProps, type TranslationComparisonSummary, type TranslationEventPayload, type TranslationSlotChangeEvent, type TranslationSlotRowProps, type TranslationSummary, type TranslationWorkspaceActionsProps, type TranslationWorkspaceError, type TranslationWorkspaceHeaderProps, type TranslationWorkspaceSlots, type UseFormBuilderOptions, type UseFormBuilderResult, type UseSubmissionReceiptsResult, type UseTranslationComparisonOptions, type UseTranslationComparisonResult, type UseTranslationWorkspaceOptions, type UseTranslationWorkspaceResult, createLocalStorageSubmissionAttemptStore, createLocalStorageSubmissionReceiptStore, isTranslationUnresolved, resolveChoiceFieldLayout, resolveFieldEditorControls, resolveFieldTypeSelectOptions, resolveInitialFieldType, resolveTranslation, submissionReceiptQueryKey, useField, useForm, useFormBuilder, useFormEngineI18n, useSubmissionReceipts, useTranslationComparison, useTranslationWorkspace, validateLocalePipeline };
|