@gaddario98/react-core 2.0.5 → 2.0.7
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 +4 -4
- package/dist/auth/index.js +1 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/index.mjs +1 -1
- package/dist/auth/index.mjs.map +1 -1
- package/dist/form/index.js +155 -143
- package/dist/form/index.js.map +1 -1
- package/dist/form/index.mjs +153 -141
- package/dist/form/index.mjs.map +1 -1
- package/dist/index.d.ts +43 -41
- package/dist/index.js +770 -1548
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +761 -1539
- package/dist/index.mjs.map +1 -1
- package/dist/pages/index.d.ts +31 -32
- package/dist/pages/index.js +148 -143
- package/dist/pages/index.js.map +1 -1
- package/dist/pages/index.mjs +148 -143
- package/dist/pages/index.mjs.map +1 -1
- package/dist/providers/index.d.ts +1 -1
- package/dist/queries/index.d.ts +1 -1
- package/dist/queries/index.js +371 -314
- package/dist/queries/index.js.map +1 -1
- package/dist/queries/index.mjs +371 -314
- package/dist/queries/index.mjs.map +1 -1
- package/dist/state/index.js +183 -151
- package/dist/state/index.js.map +1 -1
- package/dist/state/index.mjs +183 -151
- package/dist/state/index.mjs.map +1 -1
- package/dist/utiles/index.js +230 -151
- package/dist/utiles/index.js.map +1 -1
- package/dist/utiles/index.mjs +230 -151
- package/dist/utiles/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import * as _gaddario98_react_state from '@gaddario98/react-state';
|
|
1
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
3
|
import * as _gaddario98_react_form from '@gaddario98/react-form';
|
|
3
|
-
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';
|
|
4
|
-
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';
|
|
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, FormConfigProps as FormConfigProps$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, ApiConfig as ApiConfig$1 } from '@gaddario98/react-queries';
|
|
5
6
|
import * as _tanstack_react_form from '@tanstack/react-form';
|
|
6
7
|
import { DeepKeys, DeepValue, FormOptions, FieldApi, FieldState, ReactFormExtendedApi } from '@tanstack/react-form';
|
|
7
8
|
import * as React$1 from 'react';
|
|
8
9
|
import React__default, { ComponentProps, PropsWithChildren, JSX as JSX$1, ReactNode } from 'react';
|
|
9
|
-
import * as _gaddario98_react_state from '@gaddario98/react-state';
|
|
10
10
|
import { AuthState as AuthState$1 } from '@gaddario98/react-auth';
|
|
11
11
|
import * as jotai_family from 'jotai-family';
|
|
12
12
|
import * as jotai from 'jotai';
|
|
@@ -14,15 +14,13 @@ import { PrimitiveAtom } from 'jotai';
|
|
|
14
14
|
export { PrimitiveAtom } from 'jotai';
|
|
15
15
|
import * as jotai_utils from 'jotai/utils';
|
|
16
16
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
17
|
-
import {
|
|
17
|
+
import { useMutation, MutateOptions, UseMutationOptions, UseQueryOptions, useQuery, UseMutationResult, QueryClient } from '@tanstack/react-query';
|
|
18
18
|
import { NotificationConfig } from '@gaddario98/react-notifications';
|
|
19
19
|
import { AxiosRequestConfig } from 'axios';
|
|
20
20
|
import { PersistQueryClientOptions } from '@tanstack/react-query-persist-client';
|
|
21
21
|
import { ClassValue } from 'clsx';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
declare const useAuthValue: () => AuthState | null;
|
|
25
|
-
declare const useAuthState: () => [AuthState | null, (value: AuthState | null) => void];
|
|
22
|
+
import { LocalizationConfigProps as LocalizationConfigProps$1 } from '@gaddario98/react-localization';
|
|
23
|
+
import { PageConfigProps as PageConfigProps$1 } from '@gaddario98/react-pages';
|
|
26
24
|
|
|
27
25
|
type AuthState = {
|
|
28
26
|
id: string;
|
|
@@ -33,6 +31,10 @@ type AuthState = {
|
|
|
33
31
|
email?: string;
|
|
34
32
|
};
|
|
35
33
|
|
|
34
|
+
declare const authAtom: _gaddario98_react_state.PrimitiveAtom<AuthState | null>;
|
|
35
|
+
declare const useAuthValue: () => AuthState | null;
|
|
36
|
+
declare const useAuthState: () => [AuthState | null, (value: AuthState | null) => void];
|
|
37
|
+
|
|
36
38
|
/**
|
|
37
39
|
* Metadata Configuration Types
|
|
38
40
|
* Custom metadata system replacing react-helmet-async
|
|
@@ -590,24 +592,24 @@ type MutationCompositeKey$1<Q extends QueriesArray$1> = {
|
|
|
590
592
|
}[MutationTopKey$1<Q>];
|
|
591
593
|
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;
|
|
592
594
|
type GetFunction<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
593
|
-
<K extends QueryTopKey$1<Q>>(type:
|
|
594
|
-
<K extends QueryCompositeKey$1<Q>>(type:
|
|
595
|
-
<K extends QueryCompositeKey$1<Q>>(type:
|
|
596
|
-
<K extends QueryTopKey$1<Q>>(type:
|
|
597
|
-
<K extends QueryCompositeKey$1<Q>>(type:
|
|
598
|
-
<K extends MutationTopKey$1<Q>>(type:
|
|
599
|
-
<K extends MutationCompositeKey$1<Q>>(type:
|
|
600
|
-
<K extends MutationCompositeKey$1<Q>>(type:
|
|
601
|
-
<K extends MutationTopKey$1<Q>>(type:
|
|
602
|
-
<K extends MutationCompositeKey$1<Q>>(type:
|
|
603
|
-
<K extends VariableTopKey<V>>(type:
|
|
604
|
-
<K extends VariableTopKey<V>>(type:
|
|
605
|
-
<TField extends DeepKeys<F>>(type:
|
|
606
|
-
<TField extends DeepKeys<F>>(type:
|
|
595
|
+
<K extends QueryTopKey$1<Q>>(type: "query", key: K): MultipleQueryResponse$1<Q>[K];
|
|
596
|
+
<K extends QueryCompositeKey$1<Q>>(type: "query", key: K): QueryValue$1<Q, K>;
|
|
597
|
+
<K extends QueryCompositeKey$1<Q>>(type: "query", key: K, defaultValue: unknown): NonNullable<QueryValue$1<Q, K>>;
|
|
598
|
+
<K extends QueryTopKey$1<Q>>(type: "query", key: K, defaultValue: MultipleQueryResponse$1<Q>[K]["data"]): MultipleQueryResponse$1<Q>[K]["data"];
|
|
599
|
+
<K extends QueryCompositeKey$1<Q>>(type: "query", key: K, defaultValue: QueryValue$1<Q, K>): NonNullable<QueryValue$1<Q, K>>;
|
|
600
|
+
<K extends MutationTopKey$1<Q>>(type: "mutation", key: K): AllMutation$1<Q>[K];
|
|
601
|
+
<K extends MutationCompositeKey$1<Q>>(type: "mutation", key: K): MutationValue$1<Q, K>;
|
|
602
|
+
<K extends MutationCompositeKey$1<Q>>(type: "mutation", key: K, defaultValue: unknown): NonNullable<MutationValue$1<Q, K>>;
|
|
603
|
+
<K extends MutationTopKey$1<Q>>(type: "mutation", key: K, defaultValue: AllMutation$1<Q>[K]["data"]): AllMutation$1<Q>[K]["data"];
|
|
604
|
+
<K extends MutationCompositeKey$1<Q>>(type: "mutation", key: K, defaultValue: MutationValue$1<Q, K>): NonNullable<MutationValue$1<Q, K>>;
|
|
605
|
+
<K extends VariableTopKey<V>>(type: "state", key: K): VariableValue<V, K>;
|
|
606
|
+
<K extends VariableTopKey<V>>(type: "state", key: K, defaultValue: VariableValue<V, K>): NonNullable<VariableValue<V, K>>;
|
|
607
|
+
<TField extends DeepKeys<F>>(type: "form", key: TField): DeepValue<F, TField> | undefined;
|
|
608
|
+
<TField extends DeepKeys<F>>(type: "form", key: TField, defaultValue: DeepValue<F, TField>): NonNullable<DeepValue<F, TField>>;
|
|
607
609
|
};
|
|
608
610
|
type SetFunction<F extends FieldValues$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
609
|
-
(type:
|
|
610
|
-
(type:
|
|
611
|
+
(type: "form"): SetValueFunction$1<F>;
|
|
612
|
+
(type: "state"): <K extends VariableTopKey<V>>(key: K, value: VariableValue<V, K>) => void;
|
|
611
613
|
};
|
|
612
614
|
type FunctionProps<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
613
615
|
/**
|
|
@@ -633,7 +635,7 @@ type LifecycleContext<F extends FieldValues$1 = FieldValues$1, Q extends Queries
|
|
|
633
635
|
pageConfig?: PageProps<F, Q, V>;
|
|
634
636
|
};
|
|
635
637
|
type Items<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
636
|
-
type:
|
|
638
|
+
type: "custom";
|
|
637
639
|
component: React.JSX.Element | ((props: FunctionProps<F, Q, V>) => React.JSX.Element);
|
|
638
640
|
index?: number;
|
|
639
641
|
usedBoxes?: number;
|
|
@@ -644,12 +646,12 @@ type Items<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<s
|
|
|
644
646
|
isInDraggableView?: boolean;
|
|
645
647
|
key?: string;
|
|
646
648
|
lazy?: boolean;
|
|
647
|
-
lazyTrigger?:
|
|
649
|
+
lazyTrigger?: "viewport" | "interaction" | "conditional";
|
|
648
650
|
lazyCondition?: MappedItemsFunction<F, Q, boolean, V>;
|
|
649
651
|
};
|
|
650
652
|
type ContainerItem<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
651
|
-
type:
|
|
652
|
-
component?: PageConfigProps[
|
|
653
|
+
type: "container";
|
|
654
|
+
component?: PageConfigProps["ItemsContainer"];
|
|
653
655
|
items: ContentItemsType<F, Q, V>;
|
|
654
656
|
index?: number;
|
|
655
657
|
usedBoxes?: number;
|
|
@@ -660,28 +662,28 @@ type ContainerItem<F extends FieldValues$1, Q extends QueriesArray$1, V extends
|
|
|
660
662
|
isInDraggableView?: boolean;
|
|
661
663
|
key?: string;
|
|
662
664
|
lazy?: boolean;
|
|
663
|
-
lazyTrigger?:
|
|
665
|
+
lazyTrigger?: "viewport" | "interaction" | "conditional";
|
|
664
666
|
lazyCondition?: MappedItemsFunction<F, Q, boolean, V>;
|
|
665
667
|
};
|
|
666
668
|
type ContentItem<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = Items<F, Q, V> | ContainerItem<F, Q, V>;
|
|
667
669
|
type MappedContents<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = MappedItemsFunction<F, Q, Array<ContentItem<F, Q, V>>, V>;
|
|
668
670
|
type ContentItemsType<F extends FieldValues$1, Q extends QueriesArray$1 = QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = Array<ContentItem<F, Q, V>> | MappedContents<F, Q, V>;
|
|
669
|
-
type FormPageProps<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = Omit<ComponentProps<typeof FormManager$1<F>>,
|
|
671
|
+
type FormPageProps<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"> & {
|
|
670
672
|
defaultValueQueryKey?: Array<string>;
|
|
671
|
-
defaultValueQueryMap?: (props: ExtractQuery$1<Q>[
|
|
673
|
+
defaultValueQueryMap?: (props: ExtractQuery$1<Q>["response"]) => F;
|
|
672
674
|
submit?: Array<Submit$1<F>> | MappedItemsFunction<F, Q, Array<Submit$1<F>>, V>;
|
|
673
675
|
index?: number;
|
|
674
676
|
data?: Array<FormManagerConfig$1<F> | MappedItemsFunction<F, Q, FormManagerConfig$1<F>, V>>;
|
|
675
677
|
debounceDelay?: number;
|
|
676
678
|
hidden?: boolean | MappedItemsFunction<F, Q, boolean, V>;
|
|
677
679
|
};
|
|
678
|
-
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
|
|
679
|
-
type:
|
|
680
|
+
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" ? {
|
|
681
|
+
type: "mutation";
|
|
680
682
|
mutationConfig: (<Qa extends QueriesArray$1>(props: FunctionProps<F, Qa, V>) => MutationConfig$1<P, R, C>) | MutationConfig$1<P, R, C>;
|
|
681
683
|
key: K;
|
|
682
684
|
} : {
|
|
683
|
-
type:
|
|
684
|
-
queryConfig?: (<Qa extends QueriesArray$1>(props: FunctionProps<F, Qa, V>) => Omit<QueryProps$1<K, R>,
|
|
685
|
+
type: "query";
|
|
686
|
+
queryConfig?: (<Qa extends QueriesArray$1>(props: FunctionProps<F, Qa, V>) => Omit<QueryProps$1<K, R>, "keyToMap">) | Omit<QueryProps$1<K, R>, "keyToMap">;
|
|
685
687
|
key: K;
|
|
686
688
|
} : never;
|
|
687
689
|
type QueryPageConfigArray<F extends FieldValues$1, Q extends QueriesArray$1, V extends Record<string, unknown> = Record<string, unknown>> = {
|
|
@@ -734,9 +736,9 @@ type ViewSettings = {
|
|
|
734
736
|
} & Record<string, unknown>>;
|
|
735
737
|
pageContainerProps?: Record<string, unknown>;
|
|
736
738
|
/** @deprecated Use layoutComponent instead */
|
|
737
|
-
customLayoutComponent?: PageConfigProps[
|
|
739
|
+
customLayoutComponent?: PageConfigProps["BodyContainer"];
|
|
738
740
|
/** @deprecated Use pageContainerComponent instead */
|
|
739
|
-
customPageContainer?: PageConfigProps[
|
|
741
|
+
customPageContainer?: PageConfigProps["PageContainer"];
|
|
740
742
|
};
|
|
741
743
|
/**
|
|
742
744
|
* Dependency Graph Node
|
|
@@ -2165,10 +2167,10 @@ declare function withMemo<T extends React.ComponentType<any>>(Component: T, prop
|
|
|
2165
2167
|
* Interfaccia che raccoglie tutte le configurazioni dei plugin di core
|
|
2166
2168
|
*/
|
|
2167
2169
|
interface CoreConfig {
|
|
2168
|
-
form?: Partial<FormConfigProps>;
|
|
2169
|
-
localization?: LocalizationConfigProps;
|
|
2170
|
-
pages?: Partial<PageConfigProps>;
|
|
2171
|
-
apiConfig?: Partial<ApiConfig>;
|
|
2170
|
+
form?: Partial<FormConfigProps$1>;
|
|
2171
|
+
localization?: LocalizationConfigProps$1;
|
|
2172
|
+
pages?: Partial<PageConfigProps$1>;
|
|
2173
|
+
apiConfig?: Partial<ApiConfig$1>;
|
|
2172
2174
|
}
|
|
2173
2175
|
declare const useCoreConfig: ({ form, localization, pages, apiConfig, }: CoreConfig) => void;
|
|
2174
2176
|
|