@m4l/core 0.0.12 → 0.0.13
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/package.json +3 -5
- package/dist/contexts/EnvironmentContext/index.d.ts +0 -5
- package/dist/contexts/EnvironmentContext/types.d.ts +0 -6
- package/dist/contexts/FlagsContext/index.d.ts +0 -5
- package/dist/contexts/FlagsContext/types.d.ts +0 -10
- package/dist/contexts/HostToolsContext/index.d.ts +0 -6
- package/dist/contexts/HostToolsContext/types.d.ts +0 -6
- package/dist/contexts/ModuleDictionaryContext/index.d.ts +0 -5
- package/dist/contexts/ModuleDictionaryContext/types.d.ts +0 -15
- package/dist/contexts/NetworkContext/index.d.ts +0 -5
- package/dist/contexts/NetworkContext/types.d.ts +0 -11
- package/dist/contexts/index.d.ts +0 -5
- package/dist/hooks/index.d.ts +0 -6
- package/dist/hooks/useEnvironment/index.d.ts +0 -2
- package/dist/hooks/useFlags/index.d.ts +0 -3
- package/dist/hooks/useHostTools/index.d.ts +0 -2
- package/dist/hooks/useLocalStorage/useLocalStorage.d.ts +0 -1
- package/dist/hooks/useModuleDictionary/index.d.ts +0 -1
- package/dist/hooks/useNetwork/index.d.ts +0 -2
- package/dist/index.d.ts +0 -6
- package/dist/prueba.d.ts +0 -10
- package/dist/types/dictionary.d.ts +0 -13
- package/dist/types/index.d.ts +0 -39
- package/dist/utils/axiosOperation/index.d.ts +0 -2
- package/dist/utils/axiosOperation/types.d.ts +0 -5
- package/dist/utils/getLocalStorage.d.ts +0 -1
- package/dist/utils/getPropertyByString.d.ts +0 -1
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/setLocalStorage.d.ts +0 -1
- package/dist/utils/voidFunction.d.ts +0 -1
- package/dist/vite-env.d.ts +0 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/core",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.13",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "M4L Team",
|
|
7
7
|
"scripts": {
|
|
@@ -17,10 +17,6 @@
|
|
|
17
17
|
"coverage": "vitest run --coverage",
|
|
18
18
|
"Oldprepack": "json -f package.json -I -e \"delete this.devDependencies; delete this.dependencies\""
|
|
19
19
|
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"axios": "^0.27.2",
|
|
22
|
-
"snakecase-keys": "^5.4.2"
|
|
23
|
-
},
|
|
24
20
|
"peerDependencies": {
|
|
25
21
|
"react": ">=18"
|
|
26
22
|
},
|
|
@@ -36,6 +32,7 @@
|
|
|
36
32
|
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
37
33
|
"@typescript-eslint/parser": "^5.27.1",
|
|
38
34
|
"@vitejs/plugin-react": "^1.3.0",
|
|
35
|
+
"axios": "^0.27.2",
|
|
39
36
|
"eslint": "^8.17.0",
|
|
40
37
|
"eslint-config-prettier": "^8.5.0",
|
|
41
38
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
@@ -53,6 +50,7 @@
|
|
|
53
50
|
"react-dom": "^18.2.0",
|
|
54
51
|
"react-toastify": "^9.0.5",
|
|
55
52
|
"rollup-plugin-terser": "^7.0.2",
|
|
53
|
+
"snakecase-keys": "^5.4.2",
|
|
56
54
|
"typescript": "^4.6.3",
|
|
57
55
|
"vite": "^2.9.9",
|
|
58
56
|
"vite-plugin-dts": "^1.2.0",
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { EnvironmentProviderProps } from './types';
|
|
3
|
-
declare const EnvironmentContext: import("react").Context<import("../..").EnvironmentType>;
|
|
4
|
-
declare function EnvironmentProvider(props: EnvironmentProviderProps): JSX.Element;
|
|
5
|
-
export { EnvironmentProvider, EnvironmentContext };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FlagsContextProps, FlagsProviderProps } from './types';
|
|
3
|
-
declare const FlagsContext: import("react").Context<FlagsContextProps>;
|
|
4
|
-
declare function FlagsProvider({ children }: FlagsProviderProps): JSX.Element;
|
|
5
|
-
export { FlagsProvider, FlagsContext };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface FlagsProviderProps {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
}
|
|
5
|
-
export declare type Flag = string;
|
|
6
|
-
export interface FlagsContextProps {
|
|
7
|
-
flags: Array<Flag>;
|
|
8
|
-
clearFlags: () => void;
|
|
9
|
-
addFlag: (flag: Flag) => void;
|
|
10
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { HostToolsType } from '../../types';
|
|
3
|
-
import { HostToolsProviderProps } from './types';
|
|
4
|
-
declare const HostToolsContext: import("react").Context<HostToolsType>;
|
|
5
|
-
declare function HostToolsProvider(props: HostToolsProviderProps): JSX.Element;
|
|
6
|
-
export { HostToolsProvider, HostToolsContext };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ModuleDictionaryContextProps, ModuleDictionaryProviderProps } from './types';
|
|
3
|
-
declare const ModuleDictionaryContext: import("react").Context<ModuleDictionaryContextProps>;
|
|
4
|
-
declare function ModuleDictionaryProvider(props: ModuleDictionaryProviderProps): JSX.Element;
|
|
5
|
-
export { ModuleDictionaryProvider, ModuleDictionaryContext };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import type { GetLabelType, ModuleDictionary } from 'src/types/dictionary';
|
|
3
|
-
export interface ModuleDictionaryProviderProps {
|
|
4
|
-
currentLang?: string;
|
|
5
|
-
isAuth?: boolean;
|
|
6
|
-
moduleId: number;
|
|
7
|
-
moduleName?: string;
|
|
8
|
-
componentsDictionary: string[];
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
export interface ModuleDictionaryContextProps {
|
|
12
|
-
moduleDictionary?: ModuleDictionary;
|
|
13
|
-
getLabel: GetLabelType;
|
|
14
|
-
getModuleLabel: () => string;
|
|
15
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { NetworkProviderProps } from './types';
|
|
3
|
-
declare const NetworkContext: import("react").Context<import("./types").NetworkType>;
|
|
4
|
-
declare function NetworkProvider(props: NetworkProviderProps): JSX.Element;
|
|
5
|
-
export { NetworkProvider, NetworkContext };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { AxiosOperation, NetworkProps } from '../../types';
|
|
3
|
-
export declare type EventFunListener = (...args: any[]) => void;
|
|
4
|
-
export interface NetworkType {
|
|
5
|
-
networkOperation: (props: NetworkProps) => Promise<any>;
|
|
6
|
-
}
|
|
7
|
-
export interface NetworkProviderProps {
|
|
8
|
-
axiosOperation: AxiosOperation;
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
export declare type NetworkContextType = NetworkType;
|
package/dist/contexts/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { EnvironmentContext, EnvironmentProvider } from './EnvironmentContext';
|
|
2
|
-
export { HostToolsContext, HostToolsProvider } from './HostToolsContext';
|
|
3
|
-
export { NetworkContext, NetworkProvider } from './NetworkContext';
|
|
4
|
-
export { FlagsContext, FlagsProvider } from './FlagsContext';
|
|
5
|
-
export { ModuleDictionaryContext, ModuleDictionaryProvider } from './ModuleDictionaryContext';
|
package/dist/hooks/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { useLocalStorage } from './useLocalStorage/useLocalStorage';
|
|
2
|
-
export { useHostTools } from './useHostTools';
|
|
3
|
-
export { useNetwork } from './useNetwork';
|
|
4
|
-
export { useEnvironment } from './useEnvironment';
|
|
5
|
-
export { useFlags, useFlagsPresent } from './useFlags';
|
|
6
|
-
export { useModuleDictionary } from './useModuleDictionary';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useLocalStorage<ValueType>(key: string, initialValue: ValueType): any[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useModuleDictionary: () => import("../../contexts/ModuleDictionaryContext/types").ModuleDictionaryContextProps;
|
package/dist/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export * from './contexts';
|
|
2
|
-
export * from './hooks';
|
|
3
|
-
export { EmitEvents } from './types';
|
|
4
|
-
export type { Maybe, HostToolsType, NetworkProps, EnvironmentType, AxiosOperation, EventFunListener, } from './types';
|
|
5
|
-
export type { GetLabelType, Dictionary, ModuleDictionary, ComponentDictionary, } from './types/dictionary';
|
|
6
|
-
export * from './utils';
|
package/dist/prueba.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { voidFunction } from './utils/voidFunction';
|
|
2
|
-
|
|
3
|
-
export { EnvironmentProvider } from './contexts/EnvironmentContext';
|
|
4
|
-
|
|
5
|
-
// export function fn(arr: number[]) {
|
|
6
|
-
// const arr2 = [1, ...arr];
|
|
7
|
-
|
|
8
|
-
// const a = { ...{ A: 1 } };
|
|
9
|
-
// console.log(a, arr2);
|
|
10
|
-
// }
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare type GetLabelType = (key: string) => string;
|
|
2
|
-
export interface ComponentDictionary {
|
|
3
|
-
[key: string]: string;
|
|
4
|
-
}
|
|
5
|
-
export interface Dictionary {
|
|
6
|
-
[key: string]: ComponentDictionary | boolean | undefined | string;
|
|
7
|
-
}
|
|
8
|
-
export interface DataDictionary extends ComponentDictionary {
|
|
9
|
-
module_name: string;
|
|
10
|
-
}
|
|
11
|
-
export interface ModuleDictionary extends Dictionary {
|
|
12
|
-
data: DataDictionary;
|
|
13
|
-
}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Method } from 'axios';
|
|
2
|
-
import type { Id, ToastContent, ToastOptions } from 'react-toastify';
|
|
3
|
-
import type { BrowserHistory } from 'history';
|
|
4
|
-
export declare type Maybe<T> = T | undefined | null;
|
|
5
|
-
export declare interface EnvironmentType {
|
|
6
|
-
isLocalhost: boolean;
|
|
7
|
-
host: string;
|
|
8
|
-
domain_token: string;
|
|
9
|
-
host_api_remote: string;
|
|
10
|
-
host_api_local: string;
|
|
11
|
-
host_static_assets: string;
|
|
12
|
-
environment: string;
|
|
13
|
-
}
|
|
14
|
-
export declare type NetworkProps = {
|
|
15
|
-
method: Method;
|
|
16
|
-
endPoint: string;
|
|
17
|
-
timeout?: number;
|
|
18
|
-
parms?: object;
|
|
19
|
-
data?: object;
|
|
20
|
-
checkUnAuthorized?: boolean;
|
|
21
|
-
isRemote?: boolean;
|
|
22
|
-
showSuccesInfo?: boolean;
|
|
23
|
-
};
|
|
24
|
-
export declare type ToastFunction = (content: ToastContent, options?: ToastOptions) => Id;
|
|
25
|
-
export declare type EventFunListener = (...args: any[]) => void;
|
|
26
|
-
export declare interface HostToolsType {
|
|
27
|
-
history?: BrowserHistory;
|
|
28
|
-
toast: ToastFunction;
|
|
29
|
-
startProgress: VoidFunction;
|
|
30
|
-
stopProgress: VoidFunction;
|
|
31
|
-
events_add_listener: (eventName: string, handler: EventFunListener) => void;
|
|
32
|
-
events_remove_listener: (eventName: string, handler: Maybe<EventFunListener>) => void;
|
|
33
|
-
events_emit: (eventName: string, arg: any) => void;
|
|
34
|
-
}
|
|
35
|
-
export declare enum EmitEvents {
|
|
36
|
-
EMMIT_EVENT_NET_SERVICE_UNAUTHORIZED = "netsevice_unauthorized",
|
|
37
|
-
EMMIT_EVENT_HOST_THEME_CHANGE = "host_theme_change"
|
|
38
|
-
}
|
|
39
|
-
export declare type AxiosOperation = (props: NetworkProps, enviroment: EnvironmentType, hostTools: HostToolsType) => Promise<any>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getLocalStorage<ValueType>(key: string, initialValue: ValueType): ValueType;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getPropertyByString(object: Record<string, unknown>, propString: string): any;
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { voidFunction } from './voidFunction';
|
|
2
|
-
export { getPropertyByString } from './getPropertyByString';
|
|
3
|
-
export { getLocalStorage } from './getLocalStorage';
|
|
4
|
-
export { setLocalStorage } from './setLocalStorage';
|
|
5
|
-
export { axiosOperation } from './axiosOperation';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function setLocalStorage<ValueType>(key: string, value: ValueType): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function voidFunction(): void;
|
package/dist/vite-env.d.ts
DELETED