@gaddario98/react-core 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +184 -2
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/index.mjs +183 -1
- package/dist/auth/index.mjs.map +1 -1
- package/dist/form/index.js +263 -3959
- package/dist/form/index.js.map +1 -1
- package/dist/form/index.mjs +213 -3909
- package/dist/form/index.mjs.map +1 -1
- package/dist/index.d.ts +623 -93
- package/dist/index.js +5381 -16418
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5372 -16409
- package/dist/index.mjs.map +1 -1
- package/dist/localization/index.js +184 -2
- package/dist/localization/index.js.map +1 -1
- package/dist/localization/index.mjs +183 -1
- package/dist/localization/index.mjs.map +1 -1
- package/dist/notifications/index.d.ts +2 -2
- package/dist/notifications/index.js +185 -3
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/index.mjs +184 -2
- package/dist/notifications/index.mjs.map +1 -1
- package/dist/pages/index.js +1536 -1680
- package/dist/pages/index.js.map +1 -1
- package/dist/pages/index.mjs +1522 -1666
- package/dist/pages/index.mjs.map +1 -1
- package/dist/queries/index.js +393 -7439
- package/dist/queries/index.js.map +1 -1
- package/dist/queries/index.mjs +385 -7431
- package/dist/queries/index.mjs.map +1 -1
- package/dist/state/index.js +10 -1783
- package/dist/state/index.js.map +1 -1
- package/dist/state/index.mjs +2 -1775
- package/dist/state/index.mjs.map +1 -1
- package/package.json +8 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as jotai_vanilla_atom from 'jotai/vanilla/atom';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import * as _gaddario98_react_form from '@gaddario98/react-form';
|
|
4
|
-
import { FieldValues as FieldValues$1, FormManagerConfig as FormManagerConfig$1, Submit as Submit$1, SetValueFunction as SetValueFunction$1, FormManager as FormManager$1, SubmitKeysArg as SubmitKeysArg$1, FormElements as FormElements$1
|
|
5
|
-
import { QueriesArray as QueriesArray$1, MultipleQueryResponse as MultipleQueryResponse$1, AllMutation as AllMutation$1, QueryDefinition as QueryDefinition$1, MutationConfig as MutationConfig$1, QueryProps as QueryProps$1, QueryAtIndex as QueryAtIndex$1, ExtractQuery as ExtractQuery$1
|
|
4
|
+
import { FieldValues as FieldValues$1, FormManagerConfig as FormManagerConfig$1, Submit as Submit$1, SetValueFunction as SetValueFunction$1, FormManager as FormManager$1, SubmitKeysArg as SubmitKeysArg$1, FormElements as FormElements$1 } from '@gaddario98/react-form';
|
|
5
|
+
import { QueriesArray as QueriesArray$1, MultipleQueryResponse as MultipleQueryResponse$1, AllMutation as AllMutation$1, QueryDefinition as QueryDefinition$1, MutationConfig as MutationConfig$1, QueryProps as QueryProps$1, QueryAtIndex as QueryAtIndex$1, ExtractQuery as ExtractQuery$1 } from '@gaddario98/react-queries';
|
|
6
6
|
import * as _tanstack_react_form from '@tanstack/react-form';
|
|
7
7
|
import { DeepKeys, DeepValue, FormOptions, FieldApi, FieldState, ReactFormExtendedApi } from '@tanstack/react-form';
|
|
8
8
|
import * as React$1 from 'react';
|
|
9
9
|
import React__default, { ComponentProps, PropsWithChildren, JSX as JSX$1, ReactNode } from 'react';
|
|
10
|
+
import * as _gaddario98_react_state from '@gaddario98/react-state';
|
|
10
11
|
import { AuthState as AuthState$1 } from '@gaddario98/react-auth';
|
|
12
|
+
import * as form_types from 'form/types';
|
|
11
13
|
import * as jotai_family from 'jotai-family';
|
|
12
14
|
import * as jotai from 'jotai';
|
|
13
15
|
import { PrimitiveAtom } from 'jotai';
|
|
@@ -19,8 +21,6 @@ import { NotificationConfig } from '@gaddario98/react-notifications';
|
|
|
19
21
|
import { AxiosRequestConfig } from 'axios';
|
|
20
22
|
import { PersistQueryClientOptions } from '@tanstack/react-query-persist-client';
|
|
21
23
|
import { ClassValue } from 'clsx';
|
|
22
|
-
import { LocalizationConfigProps as LocalizationConfigProps$1 } from '@gaddario98/react-localization';
|
|
23
|
-
import { PageConfigProps as PageConfigProps$1 } from '@gaddario98/react-pages';
|
|
24
24
|
|
|
25
25
|
type AuthState = {
|
|
26
26
|
id: string;
|
|
@@ -31,7 +31,7 @@ type AuthState = {
|
|
|
31
31
|
email?: string;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
declare const authAtom:
|
|
34
|
+
declare const authAtom: jotai_vanilla_atom.PrimitiveAtom<AuthState | null>;
|
|
35
35
|
declare const useAuthValue: () => AuthState | null;
|
|
36
36
|
declare const useAuthState: () => [AuthState | null, (value: AuthState | null) => void];
|
|
37
37
|
|
|
@@ -576,32 +576,32 @@ declare const usePageConfigValue: () => PageConfigProps;
|
|
|
576
576
|
declare const usePageConfigState: () => [PageConfigProps, (value: PageConfigProps) => void];
|
|
577
577
|
declare const usePageConfigReset: () => () => void;
|
|
578
578
|
|
|
579
|
-
type StringKey$
|
|
580
|
-
type VariableTopKey<V> = StringKey$
|
|
579
|
+
type StringKey$2<T> = Extract<keyof T, string>;
|
|
580
|
+
type VariableTopKey<V> = StringKey$2<V>;
|
|
581
581
|
type VariableValue<V, K extends VariableTopKey<V>> = V[K];
|
|
582
|
-
type QueryTopKey$
|
|
583
|
-
type QuerySubKey$
|
|
584
|
-
type QueryCompositeKey$
|
|
585
|
-
[K in QueryTopKey$
|
|
586
|
-
}[QueryTopKey$
|
|
587
|
-
type QueryValue$
|
|
588
|
-
type MutationTopKey$
|
|
589
|
-
type MutationSubKey$
|
|
590
|
-
type MutationCompositeKey$
|
|
591
|
-
[K in MutationTopKey$
|
|
592
|
-
}[MutationTopKey$
|
|
593
|
-
type MutationValue$
|
|
582
|
+
type QueryTopKey$2<Q extends QueriesArray$1> = StringKey$2<MultipleQueryResponse$1<Q>>;
|
|
583
|
+
type QuerySubKey$2<Q extends QueriesArray$1, K extends QueryTopKey$2<Q>> = StringKey$2<MultipleQueryResponse$1<Q>[K]>;
|
|
584
|
+
type QueryCompositeKey$2<Q extends QueriesArray$1> = {
|
|
585
|
+
[K in QueryTopKey$2<Q>]: K | `${K}.${QuerySubKey$2<Q, K>}`;
|
|
586
|
+
}[QueryTopKey$2<Q>];
|
|
587
|
+
type QueryValue$2<Q extends QueriesArray$1, K extends QueryCompositeKey$2<Q>> = K extends `${infer Top}.${infer Sub}` ? Top extends QueryTopKey$2<Q> ? Sub extends QuerySubKey$2<Q, Top> ? MultipleQueryResponse$1<Q>[Top][Sub] : never : never : K extends QueryTopKey$2<Q> ? MultipleQueryResponse$1<Q>[K] : never;
|
|
588
|
+
type MutationTopKey$2<Q extends QueriesArray$1> = StringKey$2<AllMutation$1<Q>>;
|
|
589
|
+
type MutationSubKey$2<Q extends QueriesArray$1, K extends MutationTopKey$2<Q>> = StringKey$2<AllMutation$1<Q>[K]>;
|
|
590
|
+
type MutationCompositeKey$2<Q extends QueriesArray$1> = {
|
|
591
|
+
[K in MutationTopKey$2<Q>]: K | `${K}.${MutationSubKey$2<Q, K>}`;
|
|
592
|
+
}[MutationTopKey$2<Q>];
|
|
593
|
+
type MutationValue$2<Q extends QueriesArray$1, K extends MutationCompositeKey$2<Q>> = K extends `${infer Top}.${infer Sub}` ? Top extends MutationTopKey$2<Q> ? Sub extends MutationSubKey$2<Q, Top> ? AllMutation$1<Q>[Top][Sub] : never : never : K extends MutationTopKey$2<Q> ? AllMutation$1<Q>[K] : never;
|
|
594
594
|
type GetFunction<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
595
|
-
<K extends QueryTopKey$
|
|
596
|
-
<K extends QueryCompositeKey$
|
|
597
|
-
<K extends QueryCompositeKey$
|
|
598
|
-
<K extends QueryTopKey$
|
|
599
|
-
<K extends QueryCompositeKey$
|
|
600
|
-
<K extends MutationTopKey$
|
|
601
|
-
<K extends MutationCompositeKey$
|
|
602
|
-
<K extends MutationCompositeKey$
|
|
603
|
-
<K extends MutationTopKey$
|
|
604
|
-
<K extends MutationCompositeKey$
|
|
595
|
+
<K extends QueryTopKey$2<Q>>(type: "query", key: K): MultipleQueryResponse$1<Q>[K];
|
|
596
|
+
<K extends QueryCompositeKey$2<Q>>(type: "query", key: K): QueryValue$2<Q, K>;
|
|
597
|
+
<K extends QueryCompositeKey$2<Q>>(type: "query", key: K, defaultValue: unknown): NonNullable<QueryValue$2<Q, K>>;
|
|
598
|
+
<K extends QueryTopKey$2<Q>>(type: "query", key: K, defaultValue: MultipleQueryResponse$1<Q>[K]["data"]): MultipleQueryResponse$1<Q>[K]["data"];
|
|
599
|
+
<K extends QueryCompositeKey$2<Q>>(type: "query", key: K, defaultValue: QueryValue$2<Q, K>): NonNullable<QueryValue$2<Q, K>>;
|
|
600
|
+
<K extends MutationTopKey$2<Q>>(type: "mutation", key: K): AllMutation$1<Q>[K];
|
|
601
|
+
<K extends MutationCompositeKey$2<Q>>(type: "mutation", key: K): MutationValue$2<Q, K>;
|
|
602
|
+
<K extends MutationCompositeKey$2<Q>>(type: "mutation", key: K, defaultValue: unknown): NonNullable<MutationValue$2<Q, K>>;
|
|
603
|
+
<K extends MutationTopKey$2<Q>>(type: "mutation", key: K, defaultValue: AllMutation$1<Q>[K]["data"]): AllMutation$1<Q>[K]["data"];
|
|
604
|
+
<K extends MutationCompositeKey$2<Q>>(type: "mutation", key: K, defaultValue: MutationValue$2<Q, K>): NonNullable<MutationValue$2<Q, K>>;
|
|
605
605
|
<K extends VariableTopKey<V>>(type: "state", key: K): VariableValue<V, K>;
|
|
606
606
|
<K extends VariableTopKey<V>>(type: "state", key: K, defaultValue: VariableValue<V, K>): NonNullable<VariableValue<V, K>>;
|
|
607
607
|
<TField extends DeepKeys<F>>(type: "form", key: TField): DeepValue<F, TField> | undefined;
|
|
@@ -677,7 +677,7 @@ type FormPageProps<F extends FieldValues$1, Q extends QueriesArray$1, V extends
|
|
|
677
677
|
debounceDelay?: number;
|
|
678
678
|
hidden?: boolean | MappedItemsFunction<F, Q, boolean, V>;
|
|
679
679
|
};
|
|
680
|
-
type SingleQueryConfig$
|
|
680
|
+
type SingleQueryConfig$2<F extends FieldValues$1, Q extends QueryDefinition$1<any, any, any, any, any>, V extends Record<string, unknown> = Record<string, unknown>> = Q extends QueryDefinition$1<infer K, infer T, infer P, infer R, infer C> ? T extends "mutation" ? {
|
|
681
681
|
type: "mutation";
|
|
682
682
|
mutationConfig: (<Qa extends QueriesArray$1>(props: FunctionProps<F, Qa, V>) => MutationConfig$1<P, R, C>) | MutationConfig$1<P, R, C>;
|
|
683
683
|
key: K;
|
|
@@ -687,7 +687,7 @@ type SingleQueryConfig$1<F extends FieldValues$1, Q extends QueryDefinition$1<an
|
|
|
687
687
|
key: K;
|
|
688
688
|
} : never;
|
|
689
689
|
type QueryPageConfigArray<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
690
|
-
[I in keyof Q]: SingleQueryConfig$
|
|
690
|
+
[I in keyof Q]: SingleQueryConfig$2<F, QueryAtIndex$1<Q, I>, V>;
|
|
691
691
|
};
|
|
692
692
|
interface PageProps<F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> {
|
|
693
693
|
id: string;
|
|
@@ -804,11 +804,11 @@ declare const usePageConfig: <F extends FieldValues$1, Q extends QueriesArray$1,
|
|
|
804
804
|
pageId: string;
|
|
805
805
|
}) => {
|
|
806
806
|
formData: {
|
|
807
|
-
formContents: (
|
|
807
|
+
formContents: (form_types.Submit<F, form_types.SubmitKeysArg<F>> | form_types.FormManagerConfig<F>)[];
|
|
808
808
|
elements: _gaddario98_react_form.FormElements[];
|
|
809
809
|
errors: any[];
|
|
810
810
|
formValues: F;
|
|
811
|
-
setValue:
|
|
811
|
+
setValue: form_types.SetValueFunction<F>;
|
|
812
812
|
};
|
|
813
813
|
form: FormPageProps<F, Q, V> | undefined;
|
|
814
814
|
mappedViewSettings: ViewSettings;
|
|
@@ -827,7 +827,7 @@ declare const useGenerateContent: <F extends FieldValues$1, Q extends QueriesArr
|
|
|
827
827
|
header: react_jsx_runtime.JSX.Element[];
|
|
828
828
|
body: react_jsx_runtime.JSX.Element[];
|
|
829
829
|
footer: react_jsx_runtime.JSX.Element[];
|
|
830
|
-
allContents: (ContentItem<F, Q, V> |
|
|
830
|
+
allContents: (ContentItem<F, Q, V> | form_types.Submit<F, form_types.SubmitKeysArg<F>> | form_types.FormManagerConfig<F>)[];
|
|
831
831
|
};
|
|
832
832
|
|
|
833
833
|
interface GenerateContentRenderProps<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> {
|
|
@@ -891,7 +891,7 @@ declare function useFormData<F extends FieldValues$1, Q extends QueriesArray$1,
|
|
|
891
891
|
pageId: string;
|
|
892
892
|
}): {
|
|
893
893
|
mappedFormData: FormManagerConfig$1<F>[];
|
|
894
|
-
formSubmit: Submit$1<F,
|
|
894
|
+
formSubmit: Submit$1<F, form_types.SubmitKeysArg<F>>[];
|
|
895
895
|
};
|
|
896
896
|
|
|
897
897
|
/**
|
|
@@ -1384,25 +1384,25 @@ declare function pageToMarkdown(options: {
|
|
|
1384
1384
|
content: string;
|
|
1385
1385
|
}): string;
|
|
1386
1386
|
|
|
1387
|
-
interface FormNotificationMessage {
|
|
1387
|
+
interface FormNotificationMessage$1 {
|
|
1388
1388
|
message: string;
|
|
1389
1389
|
type: 'success' | 'error' | 'info' | 'warning';
|
|
1390
1390
|
autoHideDuration?: number;
|
|
1391
1391
|
textTransOption?: Record<string, unknown>;
|
|
1392
1392
|
ns?: string;
|
|
1393
1393
|
}
|
|
1394
|
-
interface FormTranslationOptions {
|
|
1394
|
+
interface FormTranslationOptions$1 {
|
|
1395
1395
|
[key: string]: string | number | boolean | undefined;
|
|
1396
1396
|
ns?: string;
|
|
1397
1397
|
}
|
|
1398
|
-
interface FormConfigProps {
|
|
1398
|
+
interface FormConfigProps$1 {
|
|
1399
1399
|
formFieldContainer: React.FC<PropsWithChildren>;
|
|
1400
|
-
showNotification?: (notification: FormNotificationMessage) => void;
|
|
1401
|
-
translateText?: (key: string, options?: FormTranslationOptions) => string;
|
|
1400
|
+
showNotification?: (notification: FormNotificationMessage$1) => void;
|
|
1401
|
+
translateText?: (key: string, options?: FormTranslationOptions$1) => string;
|
|
1402
1402
|
}
|
|
1403
|
-
declare const formConfigAtom: _gaddario98_react_state.PrimitiveAtom<FormConfigProps>;
|
|
1404
|
-
declare const useFormConfigValue: () => FormConfigProps;
|
|
1405
|
-
declare const useFormConfigState: () => [FormConfigProps, (value: FormConfigProps) => void];
|
|
1403
|
+
declare const formConfigAtom: _gaddario98_react_state.PrimitiveAtom<FormConfigProps$1>;
|
|
1404
|
+
declare const useFormConfigValue: () => FormConfigProps$1;
|
|
1405
|
+
declare const useFormConfigState: () => [FormConfigProps$1, (value: FormConfigProps$1) => void];
|
|
1406
1406
|
declare const useFormConfigReset: () => () => void;
|
|
1407
1407
|
|
|
1408
1408
|
interface UseCustomFormOptions<TData extends FieldValues> extends FormOptions<TData, any, any, any, any, any, any, any, any, any, any, any> {
|
|
@@ -1481,8 +1481,8 @@ type FormManagerProps<T extends FieldValues = FieldValues> = {
|
|
|
1481
1481
|
globalErrorNs?: string;
|
|
1482
1482
|
submit?: Array<Submit<T>>;
|
|
1483
1483
|
notification?: {
|
|
1484
|
-
success?: FormNotificationMessage | ((res: unknown) => FormNotificationMessage);
|
|
1485
|
-
error?: FormNotificationMessage | ((error: string) => FormNotificationMessage);
|
|
1484
|
+
success?: FormNotificationMessage$1 | ((res: unknown) => FormNotificationMessage$1);
|
|
1485
|
+
error?: FormNotificationMessage$1 | ((error: string) => FormNotificationMessage$1);
|
|
1486
1486
|
ns?: string;
|
|
1487
1487
|
};
|
|
1488
1488
|
onValuesChange?: (props: T, setValue: (name: any, value: any) => void) => void;
|
|
@@ -1508,8 +1508,8 @@ type UseFormManagerProps<T extends FieldValues> = {
|
|
|
1508
1508
|
globalErrorNs?: string;
|
|
1509
1509
|
submit?: Array<Submit<T>>;
|
|
1510
1510
|
notification?: {
|
|
1511
|
-
success?: FormNotificationMessage | ((res: unknown) => FormNotificationMessage);
|
|
1512
|
-
error?: FormNotificationMessage | ((error: string) => FormNotificationMessage);
|
|
1511
|
+
success?: FormNotificationMessage$1 | ((res: unknown) => FormNotificationMessage$1);
|
|
1512
|
+
error?: FormNotificationMessage$1 | ((error: string) => FormNotificationMessage$1);
|
|
1513
1513
|
ns?: string;
|
|
1514
1514
|
};
|
|
1515
1515
|
onValuesChange?: (props: T, setValue: (name: any, value: any) => void) => void;
|
|
@@ -1553,7 +1553,7 @@ type FormFieldConfig<T extends FieldValues> = {
|
|
|
1553
1553
|
isInDraggableView?: boolean;
|
|
1554
1554
|
helper?: {
|
|
1555
1555
|
text?: string;
|
|
1556
|
-
translationOption?: FormTranslationOptions;
|
|
1556
|
+
translationOption?: FormTranslationOptions$1;
|
|
1557
1557
|
};
|
|
1558
1558
|
onFieldChange?: (value: any) => void;
|
|
1559
1559
|
hidden?: boolean | MappedFormItemsFunction<T, boolean>;
|
|
@@ -1610,8 +1610,8 @@ declare const useFormValue: <F extends FieldValues>(formId: string) => FormStore
|
|
|
1610
1610
|
declare const useFormState: <F extends FieldValues>() => [Record<string, FormStoreEntry<F>>, (value: Record<string, FormStoreEntry<F>>) => void];
|
|
1611
1611
|
declare const useSetFormState: <F extends FieldValues>(formId: string) => (val: Partial<FormStoreEntry<F>>) => void;
|
|
1612
1612
|
|
|
1613
|
-
type Locale = string;
|
|
1614
|
-
type TranslationResources = Record<string, any>;
|
|
1613
|
+
type Locale$1 = string;
|
|
1614
|
+
type TranslationResources$1 = Record<string, any>;
|
|
1615
1615
|
/**
|
|
1616
1616
|
* Opzioni di formattazione per i diversi tipi di valori
|
|
1617
1617
|
*/
|
|
@@ -1700,17 +1700,17 @@ interface TranslationOptions {
|
|
|
1700
1700
|
*/
|
|
1701
1701
|
type TranslateFunction = (key: string, options?: TranslationOptions) => string;
|
|
1702
1702
|
interface I18nConfig {
|
|
1703
|
-
defaultLocale: Locale;
|
|
1704
|
-
supportedLocales: Array<Locale>;
|
|
1703
|
+
defaultLocale: Locale$1;
|
|
1704
|
+
supportedLocales: Array<Locale$1>;
|
|
1705
1705
|
}
|
|
1706
1706
|
|
|
1707
|
-
interface LocalizationConfigProps {
|
|
1708
|
-
currentLocale: Locale;
|
|
1709
|
-
locales: Record<Locale, TranslationResources>;
|
|
1707
|
+
interface LocalizationConfigProps$1 {
|
|
1708
|
+
currentLocale: Locale$1;
|
|
1709
|
+
locales: Record<Locale$1, TranslationResources$1>;
|
|
1710
1710
|
}
|
|
1711
|
-
declare const localizationConfigAtom: _gaddario98_react_state.PrimitiveAtom<LocalizationConfigProps>;
|
|
1712
|
-
declare const useLocalizationConfigValue: () => LocalizationConfigProps;
|
|
1713
|
-
declare const useLocalizationConfigState: () => [LocalizationConfigProps, (value: LocalizationConfigProps) => void];
|
|
1711
|
+
declare const localizationConfigAtom: _gaddario98_react_state.PrimitiveAtom<LocalizationConfigProps$1>;
|
|
1712
|
+
declare const useLocalizationConfigValue: () => LocalizationConfigProps$1;
|
|
1713
|
+
declare const useLocalizationConfigState: () => [LocalizationConfigProps$1, (value: LocalizationConfigProps$1) => void];
|
|
1714
1714
|
declare const useLocalizationConfigReset: () => () => void;
|
|
1715
1715
|
/**
|
|
1716
1716
|
* Hook per gestire le operazioni di localization
|
|
@@ -1719,33 +1719,33 @@ declare const useLocalizationActions: () => {
|
|
|
1719
1719
|
/**
|
|
1720
1720
|
* Aggiunge o aggiorna una locale con le sue risorse
|
|
1721
1721
|
*/
|
|
1722
|
-
addLocale: (locale: Locale, resources: TranslationResources) => void;
|
|
1722
|
+
addLocale: (locale: Locale$1, resources: TranslationResources$1) => void;
|
|
1723
1723
|
/**
|
|
1724
1724
|
* Switch alla locale specificata
|
|
1725
1725
|
*/
|
|
1726
|
-
switchLocale: (locale: Locale) => void;
|
|
1726
|
+
switchLocale: (locale: Locale$1) => void;
|
|
1727
1727
|
/**
|
|
1728
1728
|
* Inizializza con una locale di default
|
|
1729
1729
|
*/
|
|
1730
|
-
initializeLocale: (locale: Locale, resources: TranslationResources) => void;
|
|
1730
|
+
initializeLocale: (locale: Locale$1, resources: TranslationResources$1) => void;
|
|
1731
1731
|
};
|
|
1732
1732
|
|
|
1733
1733
|
/**
|
|
1734
1734
|
* Funzione core per risolvere una traduzione.
|
|
1735
1735
|
*/
|
|
1736
|
-
declare const resolveTranslation: (key: string, resources: TranslationResources, options?: TranslationOptions, locale?: string) => string;
|
|
1736
|
+
declare const resolveTranslation: (key: string, resources: TranslationResources$1, options?: TranslationOptions, locale?: string) => string;
|
|
1737
1737
|
|
|
1738
1738
|
declare const useTranslation: (_ns?: string) => {
|
|
1739
1739
|
t: TranslateFunction;
|
|
1740
|
-
locale: Locale;
|
|
1740
|
+
locale: Locale$1;
|
|
1741
1741
|
};
|
|
1742
1742
|
|
|
1743
1743
|
/**
|
|
1744
1744
|
* Crea un'istanza di traduzione per l'uso lato server (o fuori dai componenti React).
|
|
1745
1745
|
*/
|
|
1746
|
-
declare const createServerTranslator: (resources: TranslationResources, locale?: Locale) => {
|
|
1746
|
+
declare const createServerTranslator: (resources: TranslationResources$1, locale?: Locale$1) => {
|
|
1747
1747
|
t: TranslateFunction;
|
|
1748
|
-
locale: Locale;
|
|
1748
|
+
locale: Locale$1;
|
|
1749
1749
|
};
|
|
1750
1750
|
|
|
1751
1751
|
type TranslationFunction = (key: string, options?: TranslationOptions) => string;
|
|
@@ -1769,13 +1769,13 @@ interface AppProvidersProps {
|
|
|
1769
1769
|
}
|
|
1770
1770
|
declare const AppProviders: React__default.FC<PropsWithChildren<AppProvidersProps>>;
|
|
1771
1771
|
|
|
1772
|
-
type ApiMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
1773
|
-
type Endpoint = Record<string, string>;
|
|
1772
|
+
type ApiMethod$1 = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
1773
|
+
type Endpoint$1 = Record<string, string>;
|
|
1774
1774
|
interface QueriesProps<TProps, TResponse, TConverter = null> {
|
|
1775
|
-
endpoint: [keyof Endpoint, string] | [keyof Endpoint];
|
|
1775
|
+
endpoint: [keyof Endpoint$1, string] | [keyof Endpoint$1];
|
|
1776
1776
|
queryKeyToInvalidate?: Array<string>;
|
|
1777
1777
|
headers?: AxiosRequestConfig['headers'];
|
|
1778
|
-
method: ApiMethod;
|
|
1778
|
+
method: ApiMethod$1;
|
|
1779
1779
|
converter?: (props: TProps) => TConverter;
|
|
1780
1780
|
customRequest?: (url: string, method: string, data: TProps) => Promise<TResponse>;
|
|
1781
1781
|
mutateOptions?: MutateOptions<TResponse, Error, TProps, unknown>;
|
|
@@ -1787,7 +1787,7 @@ interface QueriesProps<TProps, TResponse, TConverter = null> {
|
|
|
1787
1787
|
};
|
|
1788
1788
|
}
|
|
1789
1789
|
interface QueryProps<Key extends string, TResponse> {
|
|
1790
|
-
endpoint: [keyof Endpoint, string] | [keyof Endpoint];
|
|
1790
|
+
endpoint: [keyof Endpoint$1, string] | [keyof Endpoint$1];
|
|
1791
1791
|
queryKey: Array<string>;
|
|
1792
1792
|
enabled: boolean;
|
|
1793
1793
|
keyToMap: Key;
|
|
@@ -1800,7 +1800,7 @@ interface QueryProps<Key extends string, TResponse> {
|
|
|
1800
1800
|
options?: Omit<Parameters<typeof useQuery<TResponse>>['0'], 'queryKey' | 'queryFn'>;
|
|
1801
1801
|
}
|
|
1802
1802
|
interface CustomQueryOptions<TResponse> extends Omit<UseQueryOptions<TResponse, Error>, 'queryKey' | 'queryFn'> {
|
|
1803
|
-
endpoint: [keyof Endpoint, string] | [keyof Endpoint];
|
|
1803
|
+
endpoint: [keyof Endpoint$1, string] | [keyof Endpoint$1];
|
|
1804
1804
|
queryKey: Array<string>;
|
|
1805
1805
|
headers?: AxiosRequestConfig['headers'];
|
|
1806
1806
|
disableAuthControl?: boolean;
|
|
@@ -1812,8 +1812,8 @@ interface CustomQueryOptions<TResponse> extends Omit<UseQueryOptions<TResponse,
|
|
|
1812
1812
|
customQueryFn?: () => Promise<TResponse>;
|
|
1813
1813
|
}
|
|
1814
1814
|
interface CustomMutationOptions<TProps, TResponse> extends UseMutationOptions<TResponse, Error, TProps, unknown> {
|
|
1815
|
-
endpoint: [keyof Endpoint, string] | [keyof Endpoint];
|
|
1816
|
-
method: ApiMethod;
|
|
1815
|
+
endpoint: [keyof Endpoint$1, string] | [keyof Endpoint$1];
|
|
1816
|
+
method: ApiMethod$1;
|
|
1817
1817
|
headers?: AxiosRequestConfig['headers'];
|
|
1818
1818
|
queryKeyToInvalidate?: Array<string>;
|
|
1819
1819
|
customRequest?: (url: string, method: string, data: TProps) => Promise<TResponse>;
|
|
@@ -2012,30 +2012,30 @@ declare const createScopeMutationsAtom: (scopeId: string) => jotai.WritableAtom<
|
|
|
2012
2012
|
declare const createQuerySelector: <Q extends QueriesArray>(scopeId: string, queryKey: string) => jotai.Atom<QueryStoreEntry<Q>>;
|
|
2013
2013
|
declare const createMutationSelector: <Q extends QueriesArray>(scopeId: string, mutationKey: string) => jotai.Atom<MutationStoreEntry<Q>>;
|
|
2014
2014
|
|
|
2015
|
-
interface EncryptionConfig {
|
|
2015
|
+
interface EncryptionConfig$1 {
|
|
2016
2016
|
secretKey: string;
|
|
2017
2017
|
enabled?: boolean;
|
|
2018
2018
|
encryptFn?: (data: unknown, key: string) => Promise<string>;
|
|
2019
2019
|
decryptFn?: (data: string, key: string) => Promise<unknown>;
|
|
2020
2020
|
}
|
|
2021
|
-
type ApiConverter<TProps, TConverter> = (props: TProps) => TConverter;
|
|
2022
|
-
interface ApiRequestFnProps<TProps, TConverter = TProps> {
|
|
2021
|
+
type ApiConverter$1<TProps, TConverter> = (props: TProps) => TConverter;
|
|
2022
|
+
interface ApiRequestFnProps$1<TProps, TConverter = TProps> {
|
|
2023
2023
|
url: string;
|
|
2024
|
-
method: ApiMethod;
|
|
2024
|
+
method: ApiMethod$1;
|
|
2025
2025
|
body?: TProps;
|
|
2026
2026
|
headers?: AxiosRequestConfig['headers'];
|
|
2027
|
-
converter?: ApiConverter<TProps, TConverter>;
|
|
2027
|
+
converter?: ApiConverter$1<TProps, TConverter>;
|
|
2028
2028
|
}
|
|
2029
|
-
interface ApiNotificationMessage {
|
|
2029
|
+
interface ApiNotificationMessage$1 {
|
|
2030
2030
|
message: string;
|
|
2031
2031
|
type: 'success' | 'error' | 'info' | 'warning';
|
|
2032
2032
|
autoHideDuration?: number;
|
|
2033
2033
|
textTransOption?: Record<string, unknown>;
|
|
2034
2034
|
ns?: string;
|
|
2035
2035
|
}
|
|
2036
|
-
interface ApiConfig {
|
|
2037
|
-
endpoints: Endpoint;
|
|
2038
|
-
requestFn: <TProps, TResponse, TConverter = TProps>(props: ApiRequestFnProps<TProps, TConverter>) => Promise<TResponse>;
|
|
2036
|
+
interface ApiConfig$1 {
|
|
2037
|
+
endpoints: Endpoint$1;
|
|
2038
|
+
requestFn: <TProps, TResponse, TConverter = TProps>(props: ApiRequestFnProps$1<TProps, TConverter>) => Promise<TResponse>;
|
|
2039
2039
|
validateAuthFn?: () => boolean;
|
|
2040
2040
|
defaultHeaders?: Record<string, string>;
|
|
2041
2041
|
persistOptions?: Omit<PersistQueryClientOptions, 'queryClient'>;
|
|
@@ -2045,12 +2045,12 @@ interface ApiConfig {
|
|
|
2045
2045
|
onMessage?: (message: unknown) => void;
|
|
2046
2046
|
autoConnect?: boolean;
|
|
2047
2047
|
};
|
|
2048
|
-
encryption?: EncryptionConfig;
|
|
2049
|
-
showNotification?: (notification: ApiNotificationMessage) => void;
|
|
2048
|
+
encryption?: EncryptionConfig$1;
|
|
2049
|
+
showNotification?: (notification: ApiNotificationMessage$1) => void;
|
|
2050
2050
|
}
|
|
2051
|
-
declare const apiConfigAtom: _gaddario98_react_state.PrimitiveAtom<ApiConfig>;
|
|
2052
|
-
declare const useApiConfigValue: () => ApiConfig;
|
|
2053
|
-
declare const useApiConfigState: () => [ApiConfig, (value: ApiConfig) => void];
|
|
2051
|
+
declare const apiConfigAtom: _gaddario98_react_state.PrimitiveAtom<ApiConfig$1>;
|
|
2052
|
+
declare const useApiConfigValue: () => ApiConfig$1;
|
|
2053
|
+
declare const useApiConfigState: () => [ApiConfig$1, (value: ApiConfig$1) => void];
|
|
2054
2054
|
declare const useApiConfigReset: () => () => void;
|
|
2055
2055
|
|
|
2056
2056
|
declare const useQueryApi: <TResponse>(options: CustomQueryOptions<TResponse>, id?: string) => QueryResult<TResponse>;
|
|
@@ -2126,7 +2126,7 @@ declare const importKey: (secretKey: string) => Promise<CryptoKey>;
|
|
|
2126
2126
|
declare const encryptData: (data: any, secretKey: string) => Promise<string>;
|
|
2127
2127
|
declare const decryptData: (encryptedData: string, secretKey: string) => Promise<any>;
|
|
2128
2128
|
|
|
2129
|
-
declare const apiRequest: <TProps, TResponse, TConverter = TProps>({ method, url, body, headers, converter, }: ApiRequestFnProps<TProps, TConverter>) => Promise<TResponse>;
|
|
2129
|
+
declare const apiRequest: <TProps, TResponse, TConverter = TProps>({ method, url, body, headers, converter, }: ApiRequestFnProps$1<TProps, TConverter>) => Promise<TResponse>;
|
|
2130
2130
|
declare const fetchRequest: <TProps, TResponse>(url: string, headers?: AxiosRequestConfig["headers"]) => Promise<TResponse>;
|
|
2131
2131
|
|
|
2132
2132
|
type SyncStorage = Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>;
|
|
@@ -2163,16 +2163,546 @@ type PropsAreEqual<P> = (prevProps: Readonly<P>, nextProps: Readonly<P>) => bool
|
|
|
2163
2163
|
*/
|
|
2164
2164
|
declare function withMemo<T extends React.ComponentType<any>>(Component: T, propsAreEqual?: PropsAreEqual<React.ComponentProps<T>>): T;
|
|
2165
2165
|
|
|
2166
|
+
interface FormNotificationMessage {
|
|
2167
|
+
message: string;
|
|
2168
|
+
type: 'success' | 'error' | 'info' | 'warning';
|
|
2169
|
+
autoHideDuration?: number;
|
|
2170
|
+
textTransOption?: Record<string, unknown>;
|
|
2171
|
+
ns?: string;
|
|
2172
|
+
}
|
|
2173
|
+
interface FormTranslationOptions {
|
|
2174
|
+
[key: string]: string | number | boolean | undefined;
|
|
2175
|
+
ns?: string;
|
|
2176
|
+
}
|
|
2177
|
+
interface FormConfigProps {
|
|
2178
|
+
formFieldContainer: React.FC<PropsWithChildren>;
|
|
2179
|
+
showNotification?: (notification: FormNotificationMessage) => void;
|
|
2180
|
+
translateText?: (key: string, options?: FormTranslationOptions) => string;
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
type Locale = string;
|
|
2184
|
+
type TranslationResources = Record<string, any>;
|
|
2185
|
+
|
|
2186
|
+
interface LocalizationConfigProps {
|
|
2187
|
+
currentLocale: Locale;
|
|
2188
|
+
locales: Record<Locale, TranslationResources>;
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
/**
|
|
2192
|
+
* Metadata Configuration Types
|
|
2193
|
+
* Custom metadata system replacing react-helmet-async
|
|
2194
|
+
* Platform-agnostic: works on web, React Native, and SSR
|
|
2195
|
+
*/
|
|
2196
|
+
|
|
2197
|
+
/**
|
|
2198
|
+
* Context passed to dynamic metadata evaluator functions
|
|
2199
|
+
* Provides access to form values, queries, and page state
|
|
2200
|
+
*/
|
|
2201
|
+
type MetadataEvaluatorContext$1<F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1> = FunctionProps$1<F, Q>;
|
|
2202
|
+
interface MetaTag$1 {
|
|
2203
|
+
/** For <meta name="..." content="..." /> */
|
|
2204
|
+
name?: string;
|
|
2205
|
+
/** For <meta property="og:..." content="..." /> */
|
|
2206
|
+
property?: string;
|
|
2207
|
+
/** For <meta http-equiv="..." content="..." /> */
|
|
2208
|
+
httpEquiv?: string;
|
|
2209
|
+
/** Meta tag content */
|
|
2210
|
+
content: string;
|
|
2211
|
+
/** Unique identifier for updating existing tags */
|
|
2212
|
+
id?: string;
|
|
2213
|
+
}
|
|
2214
|
+
/**
|
|
2215
|
+
* Open Graph Image Configuration
|
|
2216
|
+
*/
|
|
2217
|
+
interface OpenGraphImage$1 {
|
|
2218
|
+
/** Absolute URL to the image */
|
|
2219
|
+
url: string;
|
|
2220
|
+
/** Alt text for the image */
|
|
2221
|
+
alt?: string;
|
|
2222
|
+
/** Image width in pixels */
|
|
2223
|
+
width?: number;
|
|
2224
|
+
/** Image height in pixels */
|
|
2225
|
+
height?: number;
|
|
2226
|
+
/** MIME type (e.g., "image/jpeg", "image/png") */
|
|
2227
|
+
type?: string;
|
|
2228
|
+
}
|
|
2229
|
+
/**
|
|
2230
|
+
* Open Graph Article Configuration (when type='article')
|
|
2231
|
+
*/
|
|
2232
|
+
interface OpenGraphArticle$1 {
|
|
2233
|
+
/** ISO 8601 date string */
|
|
2234
|
+
publishedTime?: string;
|
|
2235
|
+
/** ISO 8601 date string */
|
|
2236
|
+
modifiedTime?: string;
|
|
2237
|
+
/** ISO 8601 date string */
|
|
2238
|
+
expirationTime?: string;
|
|
2239
|
+
/** Author name or URL */
|
|
2240
|
+
author?: string | Array<string>;
|
|
2241
|
+
/** Article section/category */
|
|
2242
|
+
section?: string;
|
|
2243
|
+
/** Article tags */
|
|
2244
|
+
tags?: Array<string>;
|
|
2245
|
+
}
|
|
2246
|
+
/**
|
|
2247
|
+
* Open Graph Configuration (Facebook, LinkedIn, etc.)
|
|
2248
|
+
*/
|
|
2249
|
+
interface OpenGraphConfig$1<F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1> {
|
|
2250
|
+
type?: 'website' | 'article' | 'product' | 'profile';
|
|
2251
|
+
title?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
|
|
2252
|
+
description?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
|
|
2253
|
+
/** Single image URL or full image config */
|
|
2254
|
+
image?: string | OpenGraphImage$1 | ((context: MetadataEvaluatorContext$1<F, Q>) => string | OpenGraphImage$1);
|
|
2255
|
+
/** Multiple images for the page */
|
|
2256
|
+
images?: Array<OpenGraphImage$1> | ((context: MetadataEvaluatorContext$1<F, Q>) => Array<OpenGraphImage$1>);
|
|
2257
|
+
/** Canonical URL */
|
|
2258
|
+
url?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
|
|
2259
|
+
siteName?: string;
|
|
2260
|
+
/** Locale (e.g., "en_US", "it_IT") */
|
|
2261
|
+
locale?: string;
|
|
2262
|
+
/** Article-specific metadata (when type='article') */
|
|
2263
|
+
article?: OpenGraphArticle$1;
|
|
2264
|
+
}
|
|
2265
|
+
/**
|
|
2266
|
+
* Twitter Card Configuration
|
|
2267
|
+
*/
|
|
2268
|
+
interface TwitterCardConfig$1<F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1> {
|
|
2269
|
+
/** Card type */
|
|
2270
|
+
card?: 'summary' | 'summary_large_image' | 'app' | 'player';
|
|
2271
|
+
/** @username of the website */
|
|
2272
|
+
site?: string;
|
|
2273
|
+
/** @username of the content creator */
|
|
2274
|
+
creator?: string;
|
|
2275
|
+
/** Title (falls back to og:title then page title) */
|
|
2276
|
+
title?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
|
|
2277
|
+
/** Description (falls back to og:description then page description) */
|
|
2278
|
+
description?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
|
|
2279
|
+
/** Image URL (falls back to og:image) */
|
|
2280
|
+
image?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
|
|
2281
|
+
/** Alt text for the image */
|
|
2282
|
+
imageAlt?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
|
|
2283
|
+
}
|
|
2284
|
+
/**
|
|
2285
|
+
* Alternate languages/URLs configuration for i18n SEO
|
|
2286
|
+
*/
|
|
2287
|
+
interface AlternatesConfig$1 {
|
|
2288
|
+
/** Canonical URL for this page */
|
|
2289
|
+
canonical?: string;
|
|
2290
|
+
/** Map of locale → URL for hreflang tags (e.g., { "en": "/en/page", "it": "/it/page" }) */
|
|
2291
|
+
languages?: Record<string, string>;
|
|
2292
|
+
/** Media-specific alternates (e.g., mobile version) */
|
|
2293
|
+
media?: Record<string, string>;
|
|
2294
|
+
/** RSS/Atom feed alternates */
|
|
2295
|
+
types?: Record<string, Array<{
|
|
2296
|
+
url: string;
|
|
2297
|
+
title?: string;
|
|
2298
|
+
}>>;
|
|
2299
|
+
}
|
|
2300
|
+
/**
|
|
2301
|
+
* Icon configuration
|
|
2302
|
+
*/
|
|
2303
|
+
interface IconConfig$1 {
|
|
2304
|
+
/** URL to the icon */
|
|
2305
|
+
url: string;
|
|
2306
|
+
/** Icon type (e.g., "image/png", "image/svg+xml") */
|
|
2307
|
+
type?: string;
|
|
2308
|
+
/** Icon sizes (e.g., "32x32", "192x192") */
|
|
2309
|
+
sizes?: string;
|
|
2310
|
+
/** Color for SVG mask icons */
|
|
2311
|
+
color?: string;
|
|
2312
|
+
}
|
|
2313
|
+
/**
|
|
2314
|
+
* Icons & PWA configuration
|
|
2315
|
+
*/
|
|
2316
|
+
interface IconsConfig$1 {
|
|
2317
|
+
/** Standard favicon(s) - link[rel="icon"] */
|
|
2318
|
+
icon?: string | IconConfig$1 | Array<IconConfig$1>;
|
|
2319
|
+
/** Apple touch icon(s) - link[rel="apple-touch-icon"] */
|
|
2320
|
+
apple?: string | IconConfig$1 | Array<IconConfig$1>;
|
|
2321
|
+
/** Shortcut icon (legacy) */
|
|
2322
|
+
shortcut?: string;
|
|
2323
|
+
}
|
|
2324
|
+
/**
|
|
2325
|
+
* Structured Data Configuration (schema.org JSON-LD)
|
|
2326
|
+
*/
|
|
2327
|
+
interface StructuredDataConfig$1<F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1> {
|
|
2328
|
+
type: 'Article' | 'Product' | 'WebPage' | 'FAQPage' | 'Organization' | 'Person' | 'WebSite' | 'BreadcrumbList';
|
|
2329
|
+
schema: Record<string, unknown> | ((context: MetadataEvaluatorContext$1<F, Q>) => Record<string, unknown>);
|
|
2330
|
+
}
|
|
2331
|
+
/**
|
|
2332
|
+
* AI Crawler Hints (for AI search engines and LLMs)
|
|
2333
|
+
*/
|
|
2334
|
+
interface AIHintsConfig$1<F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1> {
|
|
2335
|
+
/** Content classification (e.g., "documentation", "tutorial", "reference") */
|
|
2336
|
+
contentClassification?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
|
|
2337
|
+
/** Hints for AI models (e.g., ["code-heavy", "technical"]) */
|
|
2338
|
+
modelHints?: Array<string> | ((context: MetadataEvaluatorContext$1<F, Q>) => Array<string>);
|
|
2339
|
+
/** Additional context for AI understanding */
|
|
2340
|
+
contextualInfo?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
|
|
2341
|
+
/** Exclude this page from AI crawler indexing */
|
|
2342
|
+
excludeFromIndexing?: boolean;
|
|
2343
|
+
}
|
|
2344
|
+
/**
|
|
2345
|
+
* Robots Configuration (indexing directives)
|
|
2346
|
+
*/
|
|
2347
|
+
interface RobotsConfig$1 {
|
|
2348
|
+
/** Prevent indexing */
|
|
2349
|
+
noindex?: boolean;
|
|
2350
|
+
/** Don't follow links */
|
|
2351
|
+
nofollow?: boolean;
|
|
2352
|
+
/** Don't cache page */
|
|
2353
|
+
noarchive?: boolean;
|
|
2354
|
+
/** Don't show snippets in search results */
|
|
2355
|
+
nosnippet?: boolean;
|
|
2356
|
+
/** Image preview size in search results */
|
|
2357
|
+
maxImagePreview?: 'none' | 'standard' | 'large';
|
|
2358
|
+
/** Max snippet length in search results */
|
|
2359
|
+
maxSnippet?: number;
|
|
2360
|
+
}
|
|
2361
|
+
/**
|
|
2362
|
+
* Complete Metadata Configuration (Generic over F and Q for dynamic metadata)
|
|
2363
|
+
* This is the "input" type — values can be strings or evaluator functions.
|
|
2364
|
+
* Use resolveMetadata() to convert this to ResolvedMetadata.
|
|
2365
|
+
*/
|
|
2366
|
+
interface MetadataConfig$1<F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1> {
|
|
2367
|
+
/** Page title - sets document.title on web */
|
|
2368
|
+
title?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
|
|
2369
|
+
/** Page description meta tag */
|
|
2370
|
+
description?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
|
|
2371
|
+
/** Canonical URL for the page */
|
|
2372
|
+
canonical?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
|
|
2373
|
+
/** HTML lang attribute (e.g., "en", "it") */
|
|
2374
|
+
lang?: string;
|
|
2375
|
+
/**
|
|
2376
|
+
* @deprecated Use `lang` instead. Will be removed in a future version.
|
|
2377
|
+
*/
|
|
2378
|
+
documentLang?: string;
|
|
2379
|
+
/** Keywords for SEO */
|
|
2380
|
+
keywords?: Array<string> | ((context: MetadataEvaluatorContext$1<F, Q>) => Array<string>);
|
|
2381
|
+
openGraph?: OpenGraphConfig$1<F, Q>;
|
|
2382
|
+
twitter?: TwitterCardConfig$1<F, Q>;
|
|
2383
|
+
alternates?: AlternatesConfig$1;
|
|
2384
|
+
icons?: IconsConfig$1;
|
|
2385
|
+
/** Web app manifest URL */
|
|
2386
|
+
manifest?: string;
|
|
2387
|
+
structuredData?: StructuredDataConfig$1<F, Q>;
|
|
2388
|
+
aiHints?: AIHintsConfig$1<F, Q>;
|
|
2389
|
+
robots?: RobotsConfig$1;
|
|
2390
|
+
customMeta?: Array<MetaTag$1> | ((context: MetadataEvaluatorContext$1<F, Q>) => Array<MetaTag$1>);
|
|
2391
|
+
disableIndexing?: boolean;
|
|
2392
|
+
/** Author meta tag */
|
|
2393
|
+
author?: string;
|
|
2394
|
+
/** Viewport meta tag (defaults to "width=device-width, initial-scale=1") */
|
|
2395
|
+
viewport?: string;
|
|
2396
|
+
/** Theme color for browser UI */
|
|
2397
|
+
themeColor?: string;
|
|
2398
|
+
}
|
|
2399
|
+
/**
|
|
2400
|
+
* Configuration for lazy loading and code splitting behavior
|
|
2401
|
+
* Enables deferred component loading to reduce initial bundle size
|
|
2402
|
+
*/
|
|
2403
|
+
interface LazyLoadingConfig$1<F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1> {
|
|
2404
|
+
/** Enable lazy loading (default: true) */
|
|
2405
|
+
enabled?: boolean;
|
|
2406
|
+
/** Preload on hover for interactive elements (default: false) */
|
|
2407
|
+
preloadOnHover?: boolean;
|
|
2408
|
+
/** Preload on focus for keyboard navigation (default: false) */
|
|
2409
|
+
preloadOnFocus?: boolean;
|
|
2410
|
+
/** Preload after render with delay (in ms, default: undefined - no delay) */
|
|
2411
|
+
preloadAfterRender?: number;
|
|
2412
|
+
/** Fallback component to show while loading (default: null) */
|
|
2413
|
+
suspenseFallback?: React.ReactNode;
|
|
2414
|
+
/** Custom error boundary component for lazy-loaded modules */
|
|
2415
|
+
errorBoundary?: React.ComponentType<{
|
|
2416
|
+
error: Error;
|
|
2417
|
+
retry: () => void;
|
|
2418
|
+
}>;
|
|
2419
|
+
/** Maximum time to wait before showing error state (in ms, default: 30000) */
|
|
2420
|
+
timeout?: number;
|
|
2421
|
+
/** Log performance metrics for lazy loading (development only) */
|
|
2422
|
+
logMetrics?: boolean;
|
|
2423
|
+
/** IntersectionObserver threshold (0-1, default: 0.1) - alias for intersectionThreshold */
|
|
2424
|
+
threshold?: number | Array<number>;
|
|
2425
|
+
/** IntersectionObserver threshold (0-1, default: 0.1) */
|
|
2426
|
+
intersectionThreshold?: number | Array<number>;
|
|
2427
|
+
/** IntersectionObserver root margin (default: "100px") - alias for intersectionRootMargin */
|
|
2428
|
+
rootMargin?: string;
|
|
2429
|
+
/** IntersectionObserver root margin (default: "100px") */
|
|
2430
|
+
intersectionRootMargin?: string;
|
|
2431
|
+
/** Trigger type for lazy loading: viewport (IntersectionObserver), interaction (manual), or conditional (based on function) */
|
|
2432
|
+
trigger?: 'viewport' | 'interaction' | 'conditional';
|
|
2433
|
+
/** Conditional function to determine if content should load (for trigger: "conditional") */
|
|
2434
|
+
condition?: (context: MetadataEvaluatorContext$1<F, Q>) => boolean;
|
|
2435
|
+
/** Placeholder component to show before lazy content loads */
|
|
2436
|
+
placeholder?: React.ReactNode;
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2439
|
+
interface DefaultContainerProps$1<F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> {
|
|
2440
|
+
children?: Array<React.JSX.Element>;
|
|
2441
|
+
allContents: Array<ContentItem$1<F, Q, V> | FormManagerConfig$1<F> | Submit$1<F>>;
|
|
2442
|
+
handleRefresh?: () => void;
|
|
2443
|
+
viewSettings?: ViewSettings$1;
|
|
2444
|
+
pageId?: string;
|
|
2445
|
+
}
|
|
2446
|
+
type PageAuthState$1 = {
|
|
2447
|
+
id: string;
|
|
2448
|
+
accountVerified?: boolean;
|
|
2449
|
+
isLogged?: boolean;
|
|
2450
|
+
token?: string;
|
|
2451
|
+
phoneNumber?: string;
|
|
2452
|
+
email?: string;
|
|
2453
|
+
};
|
|
2454
|
+
interface PageTranslationOptions$1 {
|
|
2455
|
+
[key: string]: string | number | boolean | undefined;
|
|
2456
|
+
ns?: string;
|
|
2457
|
+
}
|
|
2458
|
+
interface PageConfigProps$1 {
|
|
2459
|
+
HeaderContainer: <F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>>(props: Omit<DefaultContainerProps$1<F, Q, V>, 'viewSettings'> & ViewSettings$1['header']) => React.ReactNode;
|
|
2460
|
+
FooterContainer: <F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>>(props: Omit<DefaultContainerProps$1<F, Q, V>, 'viewSettings'> & ViewSettings$1['footer']) => React.ReactNode;
|
|
2461
|
+
BodyContainer: <F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>>(props: DefaultContainerProps$1<F, Q, V>) => React.ReactNode;
|
|
2462
|
+
authPageImage: string;
|
|
2463
|
+
authPageProps: PageProps$1;
|
|
2464
|
+
isLogged: (val: AuthState$1 | null) => boolean;
|
|
2465
|
+
ItemsContainer: (props: {
|
|
2466
|
+
children: React.ReactNode;
|
|
2467
|
+
}) => React.ReactNode;
|
|
2468
|
+
LoaderComponent?: (props: {
|
|
2469
|
+
loading?: boolean;
|
|
2470
|
+
message?: string;
|
|
2471
|
+
ns?: string;
|
|
2472
|
+
}) => React.ReactNode;
|
|
2473
|
+
PageContainer: (props: {
|
|
2474
|
+
children: React.ReactNode;
|
|
2475
|
+
id: string;
|
|
2476
|
+
}) => React.ReactNode;
|
|
2477
|
+
meta?: {
|
|
2478
|
+
title?: string;
|
|
2479
|
+
description?: string;
|
|
2480
|
+
};
|
|
2481
|
+
defaultMetadata: MetadataConfig$1;
|
|
2482
|
+
setMetadata: (config: MetadataConfig$1) => void;
|
|
2483
|
+
getMetadata: () => MetadataConfig$1;
|
|
2484
|
+
resetMetadata: () => void;
|
|
2485
|
+
lazyLoading: LazyLoadingConfig$1;
|
|
2486
|
+
authValues?: PageAuthState$1 | null;
|
|
2487
|
+
locale?: string;
|
|
2488
|
+
translateText?: (key: string, options?: PageTranslationOptions$1) => string;
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
type StringKey$1<T> = Extract<keyof T, string>;
|
|
2492
|
+
type VariableTopKey$1<V> = StringKey$1<V>;
|
|
2493
|
+
type VariableValue$1<V, K extends VariableTopKey$1<V>> = V[K];
|
|
2494
|
+
type QueryTopKey$1<Q extends QueriesArray$1> = StringKey$1<MultipleQueryResponse$1<Q>>;
|
|
2495
|
+
type QuerySubKey$1<Q extends QueriesArray$1, K extends QueryTopKey$1<Q>> = StringKey$1<MultipleQueryResponse$1<Q>[K]>;
|
|
2496
|
+
type QueryCompositeKey$1<Q extends QueriesArray$1> = {
|
|
2497
|
+
[K in QueryTopKey$1<Q>]: K | `${K}.${QuerySubKey$1<Q, K>}`;
|
|
2498
|
+
}[QueryTopKey$1<Q>];
|
|
2499
|
+
type QueryValue$1<Q extends QueriesArray$1, K extends QueryCompositeKey$1<Q>> = K extends `${infer Top}.${infer Sub}` ? Top extends QueryTopKey$1<Q> ? Sub extends QuerySubKey$1<Q, Top> ? MultipleQueryResponse$1<Q>[Top][Sub] : never : never : K extends QueryTopKey$1<Q> ? MultipleQueryResponse$1<Q>[K] : never;
|
|
2500
|
+
type MutationTopKey$1<Q extends QueriesArray$1> = StringKey$1<AllMutation$1<Q>>;
|
|
2501
|
+
type MutationSubKey$1<Q extends QueriesArray$1, K extends MutationTopKey$1<Q>> = StringKey$1<AllMutation$1<Q>[K]>;
|
|
2502
|
+
type MutationCompositeKey$1<Q extends QueriesArray$1> = {
|
|
2503
|
+
[K in MutationTopKey$1<Q>]: K | `${K}.${MutationSubKey$1<Q, K>}`;
|
|
2504
|
+
}[MutationTopKey$1<Q>];
|
|
2505
|
+
type MutationValue$1<Q extends QueriesArray$1, K extends MutationCompositeKey$1<Q>> = K extends `${infer Top}.${infer Sub}` ? Top extends MutationTopKey$1<Q> ? Sub extends MutationSubKey$1<Q, Top> ? AllMutation$1<Q>[Top][Sub] : never : never : K extends MutationTopKey$1<Q> ? AllMutation$1<Q>[K] : never;
|
|
2506
|
+
type GetFunction$1<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
2507
|
+
<K extends QueryTopKey$1<Q>>(type: "query", key: K): MultipleQueryResponse$1<Q>[K];
|
|
2508
|
+
<K extends QueryCompositeKey$1<Q>>(type: "query", key: K): QueryValue$1<Q, K>;
|
|
2509
|
+
<K extends QueryCompositeKey$1<Q>>(type: "query", key: K, defaultValue: unknown): NonNullable<QueryValue$1<Q, K>>;
|
|
2510
|
+
<K extends QueryTopKey$1<Q>>(type: "query", key: K, defaultValue: MultipleQueryResponse$1<Q>[K]["data"]): MultipleQueryResponse$1<Q>[K]["data"];
|
|
2511
|
+
<K extends QueryCompositeKey$1<Q>>(type: "query", key: K, defaultValue: QueryValue$1<Q, K>): NonNullable<QueryValue$1<Q, K>>;
|
|
2512
|
+
<K extends MutationTopKey$1<Q>>(type: "mutation", key: K): AllMutation$1<Q>[K];
|
|
2513
|
+
<K extends MutationCompositeKey$1<Q>>(type: "mutation", key: K): MutationValue$1<Q, K>;
|
|
2514
|
+
<K extends MutationCompositeKey$1<Q>>(type: "mutation", key: K, defaultValue: unknown): NonNullable<MutationValue$1<Q, K>>;
|
|
2515
|
+
<K extends MutationTopKey$1<Q>>(type: "mutation", key: K, defaultValue: AllMutation$1<Q>[K]["data"]): AllMutation$1<Q>[K]["data"];
|
|
2516
|
+
<K extends MutationCompositeKey$1<Q>>(type: "mutation", key: K, defaultValue: MutationValue$1<Q, K>): NonNullable<MutationValue$1<Q, K>>;
|
|
2517
|
+
<K extends VariableTopKey$1<V>>(type: "state", key: K): VariableValue$1<V, K>;
|
|
2518
|
+
<K extends VariableTopKey$1<V>>(type: "state", key: K, defaultValue: VariableValue$1<V, K>): NonNullable<VariableValue$1<V, K>>;
|
|
2519
|
+
<TField extends DeepKeys<F>>(type: "form", key: TField): DeepValue<F, TField> | undefined;
|
|
2520
|
+
<TField extends DeepKeys<F>>(type: "form", key: TField, defaultValue: DeepValue<F, TField>): NonNullable<DeepValue<F, TField>>;
|
|
2521
|
+
};
|
|
2522
|
+
type SetFunction$1<F extends FieldValues$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
2523
|
+
(type: "form"): SetValueFunction$1<F>;
|
|
2524
|
+
(type: "state"): <K extends VariableTopKey$1<V>>(key: K, value: VariableValue$1<V, K>) => void;
|
|
2525
|
+
};
|
|
2526
|
+
type FunctionProps$1<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
2527
|
+
/**
|
|
2528
|
+
* Read the current query/mutation value by key.
|
|
2529
|
+
* Example: get('query', 'bookings')
|
|
2530
|
+
*/
|
|
2531
|
+
get: GetFunction$1<F, Q, V>;
|
|
2532
|
+
/**
|
|
2533
|
+
* Generic setter accessor.
|
|
2534
|
+
* - set('form') returns `setValue`
|
|
2535
|
+
* - set('state') returns state setter
|
|
2536
|
+
*/
|
|
2537
|
+
set: SetFunction$1<F, V>;
|
|
2538
|
+
};
|
|
2539
|
+
type MappedItemsFunction$1<F extends FieldValues$1, Q extends QueriesArray$1, ComponentType, V extends Record<string, unknown> = Record<string, unknown>> = (props: FunctionProps$1<F, Q, V>) => ComponentType;
|
|
2540
|
+
/**
|
|
2541
|
+
* Context passed to lifecycle callbacks
|
|
2542
|
+
* Provides access to form, queries, mutations, and utilities
|
|
2543
|
+
*/
|
|
2544
|
+
type LifecycleContext$1<F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = FunctionProps$1<F, Q, V> & {
|
|
2545
|
+
ns?: string;
|
|
2546
|
+
pageId?: string;
|
|
2547
|
+
pageConfig?: PageProps$1<F, Q, V>;
|
|
2548
|
+
};
|
|
2549
|
+
type Items$1<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
2550
|
+
type: "custom";
|
|
2551
|
+
component: React.JSX.Element | ((props: FunctionProps$1<F, Q, V>) => React.JSX.Element);
|
|
2552
|
+
index?: number;
|
|
2553
|
+
usedBoxes?: number;
|
|
2554
|
+
renderInFooter?: boolean;
|
|
2555
|
+
renderInHeader?: boolean;
|
|
2556
|
+
hidden?: boolean | MappedItemsFunction$1<F, Q, boolean, V>;
|
|
2557
|
+
isDraggable?: boolean;
|
|
2558
|
+
isInDraggableView?: boolean;
|
|
2559
|
+
key?: string;
|
|
2560
|
+
lazy?: boolean;
|
|
2561
|
+
lazyTrigger?: "viewport" | "interaction" | "conditional";
|
|
2562
|
+
lazyCondition?: MappedItemsFunction$1<F, Q, boolean, V>;
|
|
2563
|
+
};
|
|
2564
|
+
type ContainerItem$1<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
2565
|
+
type: "container";
|
|
2566
|
+
component?: PageConfigProps$1["ItemsContainer"];
|
|
2567
|
+
items: ContentItemsType$1<F, Q, V>;
|
|
2568
|
+
index?: number;
|
|
2569
|
+
usedBoxes?: number;
|
|
2570
|
+
renderInFooter?: boolean;
|
|
2571
|
+
renderInHeader?: boolean;
|
|
2572
|
+
hidden?: boolean | MappedItemsFunction$1<F, Q, boolean, V>;
|
|
2573
|
+
isDraggable?: boolean;
|
|
2574
|
+
isInDraggableView?: boolean;
|
|
2575
|
+
key?: string;
|
|
2576
|
+
lazy?: boolean;
|
|
2577
|
+
lazyTrigger?: "viewport" | "interaction" | "conditional";
|
|
2578
|
+
lazyCondition?: MappedItemsFunction$1<F, Q, boolean, V>;
|
|
2579
|
+
};
|
|
2580
|
+
type ContentItem$1<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = Items$1<F, Q, V> | ContainerItem$1<F, Q, V>;
|
|
2581
|
+
type MappedContents$1<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = MappedItemsFunction$1<F, Q, Array<ContentItem$1<F, Q, V>>, V>;
|
|
2582
|
+
type ContentItemsType$1<F extends FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = Array<ContentItem$1<F, Q, V>> | MappedContents$1<F, Q, V>;
|
|
2583
|
+
type FormPageProps$1<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = Omit<ComponentProps<typeof FormManager$1<F>>, "updateFormValues" | "submit" | "data"> & {
|
|
2584
|
+
defaultValueQueryKey?: Array<string>;
|
|
2585
|
+
defaultValueQueryMap?: (props: ExtractQuery$1<Q>["response"]) => F;
|
|
2586
|
+
submit?: Array<Submit$1<F>> | MappedItemsFunction$1<F, Q, Array<Submit$1<F>>, V>;
|
|
2587
|
+
index?: number;
|
|
2588
|
+
data?: Array<FormManagerConfig$1<F> | MappedItemsFunction$1<F, Q, FormManagerConfig$1<F>, V>>;
|
|
2589
|
+
debounceDelay?: number;
|
|
2590
|
+
hidden?: boolean | MappedItemsFunction$1<F, Q, boolean, V>;
|
|
2591
|
+
};
|
|
2592
|
+
type SingleQueryConfig$1<F extends FieldValues$1, Q extends QueryDefinition$1<any, any, any, any, any>, V extends Record<string, unknown> = Record<string, unknown>> = Q extends QueryDefinition$1<infer K, infer T, infer P, infer R, infer C> ? T extends "mutation" ? {
|
|
2593
|
+
type: "mutation";
|
|
2594
|
+
mutationConfig: (<Qa extends QueriesArray$1>(props: FunctionProps$1<F, Qa, V>) => MutationConfig$1<P, R, C>) | MutationConfig$1<P, R, C>;
|
|
2595
|
+
key: K;
|
|
2596
|
+
} : {
|
|
2597
|
+
type: "query";
|
|
2598
|
+
queryConfig?: (<Qa extends QueriesArray$1>(props: FunctionProps$1<F, Qa, V>) => Omit<QueryProps$1<K, R>, "keyToMap">) | Omit<QueryProps$1<K, R>, "keyToMap">;
|
|
2599
|
+
key: K;
|
|
2600
|
+
} : never;
|
|
2601
|
+
type QueryPageConfigArray$1<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
2602
|
+
[I in keyof Q]: SingleQueryConfig$1<F, QueryAtIndex$1<Q, I>, V>;
|
|
2603
|
+
};
|
|
2604
|
+
interface PageProps$1<F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> {
|
|
2605
|
+
id: string;
|
|
2606
|
+
ns?: string;
|
|
2607
|
+
contents?: ContentItemsType$1<F, Q, V>;
|
|
2608
|
+
queries?: QueryPageConfigArray$1<F, Q, V>;
|
|
2609
|
+
form?: FormPageProps$1<F, Q, V>;
|
|
2610
|
+
variables?: V;
|
|
2611
|
+
viewSettings?: MappedItemsFunction$1<F, Q, ViewSettings$1, V> | ViewSettings$1;
|
|
2612
|
+
meta?: MetadataConfig$1<F, Q>;
|
|
2613
|
+
lazyLoading?: LazyLoadingConfig$1;
|
|
2614
|
+
platformOverrides?: PlatformOverrides$1<F, Q, V>;
|
|
2615
|
+
lifecycleCallbacks?: {
|
|
2616
|
+
onMountComplete?: (context: LifecycleContext$1<F, Q, V>) => void | Promise<void>;
|
|
2617
|
+
onQuerySuccess?: (context: LifecycleContext$1<F, Q, V>, queryKey: string, data: unknown) => void | Promise<void>;
|
|
2618
|
+
onQueryError?: (context: LifecycleContext$1<F, Q, V>, queryKey: string, error: Error) => void | Promise<void>;
|
|
2619
|
+
onFormSubmit?: (context: LifecycleContext$1<F, Q, V>, result: unknown) => void | Promise<void>;
|
|
2620
|
+
onValuesChange?: MappedItemsFunction$1<F, Q, void, V>;
|
|
2621
|
+
};
|
|
2622
|
+
enableAuthControl?: boolean;
|
|
2623
|
+
}
|
|
2624
|
+
/**
|
|
2625
|
+
* Platform-specific configuration overrides (proper type with PageProps reference)
|
|
2626
|
+
* Allows different behavior on web vs React Native
|
|
2627
|
+
*/
|
|
2628
|
+
type PlatformOverrides$1<F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
2629
|
+
/** Web-specific overrides (React DOM) */
|
|
2630
|
+
web?: Partial<PageProps$1<F, Q, V>>;
|
|
2631
|
+
/** React Native-specific overrides */
|
|
2632
|
+
native?: Partial<PageProps$1<F, Q, V>>;
|
|
2633
|
+
};
|
|
2634
|
+
type ViewSettings$1 = {
|
|
2635
|
+
withoutPadding?: boolean;
|
|
2636
|
+
header?: {
|
|
2637
|
+
withoutPadding?: boolean;
|
|
2638
|
+
};
|
|
2639
|
+
footer?: {
|
|
2640
|
+
withoutPadding?: boolean;
|
|
2641
|
+
};
|
|
2642
|
+
disableRefreshing?: boolean;
|
|
2643
|
+
layoutComponent?: <F extends FieldValues$1 = FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>>(props: DefaultContainerProps$1<F, Q, V> & Record<string, unknown>) => React.ReactNode;
|
|
2644
|
+
layoutProps?: Record<string, unknown>;
|
|
2645
|
+
pageContainerComponent?: React.ComponentType<{
|
|
2646
|
+
children: React.ReactNode;
|
|
2647
|
+
id: string;
|
|
2648
|
+
} & Record<string, unknown>>;
|
|
2649
|
+
pageContainerProps?: Record<string, unknown>;
|
|
2650
|
+
/** @deprecated Use layoutComponent instead */
|
|
2651
|
+
customLayoutComponent?: PageConfigProps$1["BodyContainer"];
|
|
2652
|
+
/** @deprecated Use pageContainerComponent instead */
|
|
2653
|
+
customPageContainer?: PageConfigProps$1["PageContainer"];
|
|
2654
|
+
};
|
|
2655
|
+
|
|
2656
|
+
type ApiMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
2657
|
+
type Endpoint = Record<string, string>;
|
|
2658
|
+
|
|
2659
|
+
interface EncryptionConfig {
|
|
2660
|
+
secretKey: string;
|
|
2661
|
+
enabled?: boolean;
|
|
2662
|
+
encryptFn?: (data: unknown, key: string) => Promise<string>;
|
|
2663
|
+
decryptFn?: (data: string, key: string) => Promise<unknown>;
|
|
2664
|
+
}
|
|
2665
|
+
type ApiConverter<TProps, TConverter> = (props: TProps) => TConverter;
|
|
2666
|
+
interface ApiRequestFnProps<TProps, TConverter = TProps> {
|
|
2667
|
+
url: string;
|
|
2668
|
+
method: ApiMethod;
|
|
2669
|
+
body?: TProps;
|
|
2670
|
+
headers?: AxiosRequestConfig['headers'];
|
|
2671
|
+
converter?: ApiConverter<TProps, TConverter>;
|
|
2672
|
+
}
|
|
2673
|
+
interface ApiNotificationMessage {
|
|
2674
|
+
message: string;
|
|
2675
|
+
type: 'success' | 'error' | 'info' | 'warning';
|
|
2676
|
+
autoHideDuration?: number;
|
|
2677
|
+
textTransOption?: Record<string, unknown>;
|
|
2678
|
+
ns?: string;
|
|
2679
|
+
}
|
|
2680
|
+
interface ApiConfig {
|
|
2681
|
+
endpoints: Endpoint;
|
|
2682
|
+
requestFn: <TProps, TResponse, TConverter = TProps>(props: ApiRequestFnProps<TProps, TConverter>) => Promise<TResponse>;
|
|
2683
|
+
validateAuthFn?: () => boolean;
|
|
2684
|
+
defaultHeaders?: Record<string, string>;
|
|
2685
|
+
persistOptions?: Omit<PersistQueryClientOptions, 'queryClient'>;
|
|
2686
|
+
queryClient: QueryClient;
|
|
2687
|
+
websocketConfig?: {
|
|
2688
|
+
url: string;
|
|
2689
|
+
onMessage?: (message: unknown) => void;
|
|
2690
|
+
autoConnect?: boolean;
|
|
2691
|
+
};
|
|
2692
|
+
encryption?: EncryptionConfig;
|
|
2693
|
+
showNotification?: (notification: ApiNotificationMessage) => void;
|
|
2694
|
+
}
|
|
2695
|
+
|
|
2166
2696
|
/**
|
|
2167
2697
|
* Interfaccia che raccoglie tutte le configurazioni dei plugin di core
|
|
2168
2698
|
*/
|
|
2169
2699
|
interface CoreConfig {
|
|
2170
|
-
form?: Partial<FormConfigProps
|
|
2171
|
-
localization?: LocalizationConfigProps
|
|
2700
|
+
form?: Partial<FormConfigProps>;
|
|
2701
|
+
localization?: LocalizationConfigProps;
|
|
2172
2702
|
pages?: Partial<PageConfigProps$1>;
|
|
2173
|
-
apiConfig?: Partial<ApiConfig
|
|
2703
|
+
apiConfig?: Partial<ApiConfig>;
|
|
2174
2704
|
}
|
|
2175
2705
|
declare const useCoreConfig: ({ form, localization, pages, apiConfig, }: CoreConfig) => void;
|
|
2176
2706
|
|
|
2177
2707
|
export { AppProviders, DEFAULT_FORM_ENTRY, DEFAULT_MUTATION_ENTRY, DEFAULT_QUERY_ENTRY, DefaultContainer, DefaultFormContainer, FormField, FormManager, MemoizationCache, MetadataStoreProvider, PageGenerator, QueriesProvider, RenderComponents, ab2str, algorithm, apiConfigAtom, apiRequest, applyMetadataToDom, atomStateGenerator, authAtom, buildArticleJsonLd, buildBreadcrumbListJsonLd, buildFAQPageJsonLd, buildOrganizationJsonLd, buildProductJsonLd, buildWebSiteJsonLd, clearMetadataLog, cn, collectMetadataToHtml, createExtractor, createFormSelector, createMetadataStore, createMutationSelector, createQuerySelector, createScopeFormsAtom, createScopeMutationsAtom, createScopePageVariablesAtom, createScopeQueriesAtom, createServerTranslator, decryptData, deepEqual, encryptData, fetchRequest, formAtom, formConfigAtom, generateLlmsFullTxt, generateLlmsTxt, generateRobotsTxt, generateSitemapEntries, generateSitemapXml, getCompositeKey, getFormCompositeKey, getMetadata, getMetadataLog, getPageConfig, getPageVariablesCompositeKey, importKey, isStableValue, localizationConfigAtom, logMetadata, memoPropsComparator, memoize, mutationsAtom, optimizeDeps, pageConfigAtom, pageToMarkdown, pageVariablesAtom, pageVariablesAtomFamily, queriesAtom, resetMetadata, resolveMetadata, resolveTranslation, setCustomStorage, setDefaultFormContainer, setMetadata, setMetadataLogging, shallowEqual, storage, str2ab, toNextHeadTags, toNextMetadata, useApi, useApiConfigReset, useApiConfigState, useApiConfigValue, useApiValues, useApplyMetadata, useAuthState, useAuthValue, useCoreConfig, useFormConfigReset, useFormConfigState, useFormConfigValue, useFormData, useFormManager, useFormState, useFormValue, useFormValues, useGenerateContent, useGenerateContentRender, useInvalidateQueries, useJotaiForm, useJotaiMutations, useJotaiQueries, useLocalizationActions, useLocalizationConfigReset, useLocalizationConfigState, useLocalizationConfigValue, useMetadata, useMetadataStore, useMultipleMutation, useMultipleQuery, useMultipleWebSocket, useMutateApi, usePageConfig, usePageConfigReset, usePageConfigState, usePageConfigValue, useQueryApi, useSetFormState, useTranslatedText, useTranslation, useViewSettings, useWebSocket, withMemo };
|
|
2178
|
-
export type { AIHintsConfig, AllMutation, AlternatesConfig, ApiConfig, ApiConverter, ApiMethod, ApiNotificationMessage, ApiRequestFnProps, AppProvidersProps, ArticleJsonLdInput, AtomGeneratorOptions, AtomState, AuthState, BreadcrumbItem, ContainerItem, ContentItem, ContentItemsType, ContentProps, ContextValue, CoreConfig, CustomMutation, CustomMutationOptions, CustomQueryOptions, DefaultContainerProps, DefaultFormContainerProps, DependencyGraph, DependencyNode, Elements, EncryptionConfig, Endpoint, ErrorComponentProps, ExtractMutation, ExtractMutationByKey, ExtractQuery, ExtractQueryByKey, ExtractQueryResponse, ExtractWebSocket, ExtractorCache, FAQItem, FieldComponentProps, FieldValues, FormConfigProps, FormContainerProps, FormElements, FormFieldConfig, FormFieldProps, FormFunctionProps, FormManagerConfig, FormManagerProps, FormNotificationMessage, FormPageProps, FormStoreEntry, FormTranslationOptions, FormatOptions, FunctionProps, GenerateContentProps, GenerateContentRenderProps, GenericFieldApi, GenericFieldState, GenericFormApi, GetApiValuesFunction, GetFormValuesFunction, GetFunction, HeadTag, I18nConfig, IconConfig, IconsConfig, ItemContainerProps, Items, LazyLoadingConfig, LlmsTxtConfig, LlmsTxtEntry, Locale, LocalizationConfigProps, MappedContents, MappedFormItemsFunction, MappedItemsFunction, MemoizationCacheStats, MetaTag, MetadataConfig, MetadataProvider, MetadataStore, MultipleQueryResponse, MultipleWebSocketResponse, MutationActionInternal, MutationConfig, MutationItem, MutationStateInternal, MutationStoreEntry, NextMetadata, OpenGraphArticle, OpenGraphConfig, OpenGraphImage, OrganizationJsonLdInput, PageAuthState, PageConfigProps, MetadataConfig as PageMetadataProps, PageProps, PageTranslationOptions, PlatformOverrides, ProductJsonLdInput, Props, ProviderConfig, QueriesArray, QueriesProps, QueryAtIndex, QueryConfig, QueryConfigArray, QueryDefinition, QueryItem, QueryPageConfigArray, QueryProps, QueryResult, QueryStoreEntry, RenderComponentsProps, ResolvedMetadata, RobotsConfig, RobotsTxtConfig, Rules, SetFunction, SetValueFunction, SingleQueryConfig, SitemapEntry, StructuredDataConfig, Submit, SubmitKeysArg, SubmitPayload, SyncStorage, TranslateFunction, TranslationFunction, TranslationOptions, TranslationResources, TwitterCardConfig, UseApiOptions, UseCustomFormOptions, UseFormManagerProps, UseFormValuesProps, UseMetadataProps, ViewSettings, ViewSettingsContainerProps, WebSiteJsonLdInput, WebSocketDefinition, WebSocketResult, WebSocketsArray };
|
|
2708
|
+
export type { AIHintsConfig, AllMutation, AlternatesConfig, ApiConfig$1 as ApiConfig, ApiConverter$1 as ApiConverter, ApiMethod$1 as ApiMethod, ApiNotificationMessage$1 as ApiNotificationMessage, ApiRequestFnProps$1 as ApiRequestFnProps, AppProvidersProps, ArticleJsonLdInput, AtomGeneratorOptions, AtomState, AuthState, BreadcrumbItem, ContainerItem, ContentItem, ContentItemsType, ContentProps, ContextValue, CoreConfig, CustomMutation, CustomMutationOptions, CustomQueryOptions, DefaultContainerProps, DefaultFormContainerProps, DependencyGraph, DependencyNode, Elements, EncryptionConfig$1 as EncryptionConfig, Endpoint$1 as Endpoint, ErrorComponentProps, ExtractMutation, ExtractMutationByKey, ExtractQuery, ExtractQueryByKey, ExtractQueryResponse, ExtractWebSocket, ExtractorCache, FAQItem, FieldComponentProps, FieldValues, FormConfigProps$1 as FormConfigProps, FormContainerProps, FormElements, FormFieldConfig, FormFieldProps, FormFunctionProps, FormManagerConfig, FormManagerProps, FormNotificationMessage$1 as FormNotificationMessage, FormPageProps, FormStoreEntry, FormTranslationOptions$1 as FormTranslationOptions, FormatOptions, FunctionProps, GenerateContentProps, GenerateContentRenderProps, GenericFieldApi, GenericFieldState, GenericFormApi, GetApiValuesFunction, GetFormValuesFunction, GetFunction, HeadTag, I18nConfig, IconConfig, IconsConfig, ItemContainerProps, Items, LazyLoadingConfig, LlmsTxtConfig, LlmsTxtEntry, Locale$1 as Locale, LocalizationConfigProps$1 as LocalizationConfigProps, MappedContents, MappedFormItemsFunction, MappedItemsFunction, MemoizationCacheStats, MetaTag, MetadataConfig, MetadataProvider, MetadataStore, MultipleQueryResponse, MultipleWebSocketResponse, MutationActionInternal, MutationConfig, MutationItem, MutationStateInternal, MutationStoreEntry, NextMetadata, OpenGraphArticle, OpenGraphConfig, OpenGraphImage, OrganizationJsonLdInput, PageAuthState, PageConfigProps, MetadataConfig as PageMetadataProps, PageProps, PageTranslationOptions, PlatformOverrides, ProductJsonLdInput, Props, ProviderConfig, QueriesArray, QueriesProps, QueryAtIndex, QueryConfig, QueryConfigArray, QueryDefinition, QueryItem, QueryPageConfigArray, QueryProps, QueryResult, QueryStoreEntry, RenderComponentsProps, ResolvedMetadata, RobotsConfig, RobotsTxtConfig, Rules, SetFunction, SetValueFunction, SingleQueryConfig, SitemapEntry, StructuredDataConfig, Submit, SubmitKeysArg, SubmitPayload, SyncStorage, TranslateFunction, TranslationFunction, TranslationOptions, TranslationResources$1 as TranslationResources, TwitterCardConfig, UseApiOptions, UseCustomFormOptions, UseFormManagerProps, UseFormValuesProps, UseMetadataProps, ViewSettings, ViewSettingsContainerProps, WebSiteJsonLdInput, WebSocketDefinition, WebSocketResult, WebSocketsArray };
|