@flowerforce/flower-react 3.5.1-beta.1 → 4.0.3-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +261 -202
  2. package/dist/index.cjs.js +214 -616
  3. package/dist/index.esm.js +184 -590
  4. package/dist/src/components/Flower.d.ts +7 -7
  5. package/dist/src/components/FlowerAction.d.ts +2 -3
  6. package/dist/src/components/FlowerComponent.d.ts +2 -4
  7. package/dist/src/components/FlowerFlow.d.ts +2 -3
  8. package/dist/src/components/FlowerNavigate/FlowerNavigate.d.ts +3 -0
  9. package/dist/src/components/FlowerNavigate/WrapperComponent.d.ts +3 -3
  10. package/dist/src/components/FlowerNavigate/index.d.ts +2 -4
  11. package/dist/src/components/FlowerNavigate/useFlowerNavigate.d.ts +1 -1
  12. package/dist/src/components/FlowerNode.d.ts +2 -3
  13. package/dist/src/components/FlowerRoute.d.ts +2 -3
  14. package/dist/src/components/FlowerServer.d.ts +2 -3
  15. package/dist/src/components/FlowerStart.d.ts +3 -4
  16. package/dist/src/components/index.d.ts +10 -0
  17. package/dist/src/components/useFlower/utils.d.ts +20 -0
  18. package/dist/src/components/useFlower.d.ts +2 -3
  19. package/dist/src/features/index.d.ts +2 -0
  20. package/dist/src/features/reducer/flowerReducer.d.ts +6 -0
  21. package/dist/src/{selectors.d.ts → features/selectors/selectors.d.ts} +474 -363
  22. package/dist/src/index.d.ts +5 -33
  23. package/dist/src/provider/index.d.ts +1 -0
  24. package/dist/src/provider/provider.d.ts +8 -0
  25. package/dist/src/types/FlowContext.d.ts +6 -0
  26. package/dist/src/types/FlowerHooks.d.ts +27 -0
  27. package/dist/src/{components/types → types}/FlowerProvider.d.ts +3 -3
  28. package/dist/src/types/index.d.ts +10 -0
  29. package/package.json +5 -2
  30. package/dist/src/components/FlowerField.d.ts +0 -4
  31. package/dist/src/components/FlowerRule.d.ts +0 -4
  32. package/dist/src/components/FlowerValue.d.ts +0 -4
  33. package/dist/src/components/types/FlowerField.d.ts +0 -124
  34. package/dist/src/components/types/FlowerHooks.d.ts +0 -72
  35. package/dist/src/components/types/FlowerRule.d.ts +0 -35
  36. package/dist/src/components/types/FlowerValue.d.ts +0 -33
  37. package/dist/src/components/useFlowerForm.d.ts +0 -26
  38. package/dist/src/context.d.ts +0 -10
  39. package/dist/src/provider.d.ts +0 -25
  40. package/dist/src/reducer.d.ts +0 -7
  41. /package/dist/src/{components/types → types}/DefaultNode.d.ts +0 -0
  42. /package/dist/src/{components/types → types}/FlowerComponent.d.ts +0 -0
  43. /package/dist/src/{components/types → types}/FlowerFlow.d.ts +0 -0
  44. /package/dist/src/{components/types → types}/FlowerNavigate.d.ts +0 -0
  45. /package/dist/src/{components/types → types}/FlowerNode.d.ts +0 -0
  46. /package/dist/src/{components/types → types}/FlowerRoute.d.ts +0 -0
  47. /package/dist/src/{components/types → types}/FlowerServer.d.ts +0 -0
@@ -1,33 +1,5 @@
1
- export { Consumer as FlowerContextConsumer } from './context';
2
- export { Provider as FlowerContextProvider } from './context';
3
- export { context as FlowerContext } from './context';
4
- export { default as Flower } from './components/Flower';
5
- export { default as FlowerNode } from './components/FlowerNode';
6
- export { default as FlowerAction } from './components/FlowerAction';
7
- export { default as FlowerServer } from './components/FlowerServer';
8
- export { default as FlowerFlow } from './components/FlowerFlow';
9
- export { default as FlowerStart } from './components/FlowerStart';
10
- export { default as FlowerRoute } from './components/FlowerRoute';
11
- export { default as FlowerRule } from './components/FlowerRule';
12
- export { default as FlowerField } from './components/FlowerField';
13
- export { default as FlowerValue } from './components/FlowerValue';
14
- export { default as FlowerNavigate } from './components/FlowerNavigate';
15
- export { default as FlowerComponent } from './components/FlowerComponent';
16
- export { default as useFlower } from './components/useFlower';
17
- export { default as useFlowerForm } from './components/useFlowerForm';
18
- export { default as FlowerProvider } from './provider';
19
- export { getDataByFlow } from './selectors';
20
- export { useSelector } from './provider';
21
- export type { FlowerContext as FlowerContextProps } from './context';
22
- export type { FlowerNodeDefaultProps } from './components/types/DefaultNode';
23
- export type { FlowerComponentProps } from './components/types/FlowerComponent';
24
- export type { FlowerFieldProps } from './components/types/FlowerField';
25
- export type { FlowerFlowProps } from './components/types/FlowerFlow';
26
- export type { UseFlower, UseFlowerForm, UseFlowerProps, NavigateFunctionParams } from './components/types/FlowerHooks';
27
- export type { RouteReset, RoutePrev, RouteNode, Route, FlowerNavigateProps, FlowerNavigateActionsProps } from './components/types/FlowerNavigate';
28
- export type { FlowerNodeProps } from './components/types/FlowerNode';
29
- export type { FlowerProviderProps } from './components/types/FlowerProvider';
30
- export type { FlowerRouteProps } from './components/types/FlowerRoute';
31
- export type { FlowerRuleProps } from './components/types/FlowerRule';
32
- export type { FlowerServerProps } from './components/types/FlowerServer';
33
- export type { FlowerValueProps } from './components/types/FlowerValue';
1
+ export * from './components';
2
+ export * from './provider';
3
+ export { makeSelectFormData } from './features';
4
+ export type * from './types/FlowContext';
5
+ export { useDispatch, useSelector, useStore } from '@flowerforce/flower-react-store';
@@ -0,0 +1 @@
1
+ export * from './provider';
@@ -0,0 +1,8 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { ConfigureStoreOptions, Reducer } from '@reduxjs/toolkit';
3
+ export declare const FlowerProvider: ({ children, enableReduxDevtool, configureStoreOptions, reducers }: PropsWithChildren<{
4
+ reducers?: Record<string, Reducer>;
5
+ configureStoreOptions?: Omit<ConfigureStoreOptions, 'reducer'>;
6
+ /** @deprecated - uses devTools key from configureStoreOptions instead */
7
+ enableReduxDevtool?: boolean;
8
+ }>) => React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ export type FlowContext = {
2
+ flowName?: string | undefined;
3
+ currentNode?: string | undefined;
4
+ autostart?: boolean | undefined;
5
+ initialData?: Record<string, unknown>;
6
+ };
@@ -0,0 +1,27 @@
1
+ import { Route, RouteNode, RoutePrev, RouteReset, RouteRestart } from './FlowerNavigate';
2
+ export type UseFlowerProps = {
3
+ [x in 'name' | 'flowName']?: string;
4
+ };
5
+ export type useFlowerActions = {
6
+ /** Use this function to move to the next node inside the flow*/
7
+ next: (payload?: Route) => void;
8
+ /**Use this function to move to the previous node inside the flow*/
9
+ back: (payload?: RoutePrev) => void;
10
+ /**Use this function to return to the first node and restore history */
11
+ reset: (payload?: RouteReset) => void;
12
+ /**Use this function to move to a specific node*/
13
+ jump: (payload: RouteNode) => void;
14
+ /**Use this function to reset the flow data and history */
15
+ restart: (payload?: RouteRestart) => void;
16
+ /**Get current node by flowName or current flow */
17
+ getCurrentNodeId: (flowName?: string) => string;
18
+ };
19
+ export type UseFlower = (options?: UseFlowerProps) => useFlowerActions & {
20
+ /**The flow in which the hook is used.*/
21
+ flowName?: string;
22
+ /**Current node id*/
23
+ nodeId: string;
24
+ /**Initial start node id*/
25
+ startId: string;
26
+ };
27
+ export type NavigateFunctionParams = string | Record<string, any>;
@@ -1,13 +1,13 @@
1
1
  import { ThunkMiddleware, Tuple, configureStore } from '@reduxjs/toolkit';
2
- import { Flower } from '@flowerforce/flower-core';
2
+ import { Flower, REDUCER_NAME } from '@flowerforce/flower-core';
3
3
  import { UnknownAction } from 'redux';
4
4
  export interface FlowerProviderInterface {
5
5
  render(): JSX.Element;
6
6
  }
7
7
  export type FlowerProviderProps = ReturnType<typeof configureStore<{
8
- flower: Record<string, Flower<any>>;
8
+ [REDUCER_NAME.FLOWER_FLOW]: Record<string, Flower<any>>;
9
9
  }, UnknownAction, Tuple<[
10
10
  ThunkMiddleware<{
11
- flower: Record<string, Flower<any>>;
11
+ [REDUCER_NAME.FLOWER_FLOW]: Record<string, Flower<any>>;
12
12
  }, UnknownAction>
13
13
  ]>>>;
@@ -0,0 +1,10 @@
1
+ export * from './DefaultNode';
2
+ export * from './FlowContext';
3
+ export * from './FlowerComponent';
4
+ export * from './FlowerFlow';
5
+ export * from './FlowerHooks';
6
+ export * from './FlowerNavigate';
7
+ export * from './FlowerNode';
8
+ export * from './FlowerProvider';
9
+ export * from './FlowerRoute';
10
+ export * from './FlowerServer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowerforce/flower-react",
3
- "version": "3.5.1-beta.1",
3
+ "version": "4.0.3-beta.0",
4
4
  "description": "FlowerJS components, hooks and utils for React.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,7 +34,10 @@
34
34
  "typescript": "^5.4.5"
35
35
  },
36
36
  "dependencies": {
37
- "@flowerforce/flower-core": "3.3.1-beta.1",
37
+ "@flowerforce/flower-core": "4.0.1-beta.0",
38
+ "@flowerforce/flower-react-context": "4.0.1-beta.0",
39
+ "@flowerforce/flower-react-store": "4.0.1-beta.0",
40
+ "@flowerforce/flower-react-shared": "4.0.2-beta.0",
38
41
  "@reduxjs/toolkit": "^2.2.4",
39
42
  "lodash": "^4.17.21",
40
43
  "react-redux": "^9.1.2",
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { FlowerFieldProps } from './types/FlowerField';
3
- declare const component: React.MemoExoticComponent<({ id, validate, asyncValidate, asyncDebounce, asyncInitialError, asyncWaitingError, rules, alwaysDisplay, value, children, defaultValue, destroyOnHide, destroyValue, flowName, onUpdate }: FlowerFieldProps) => React.JSX.Element | (string | number | Iterable<React.ReactNode> | React.JSX.Element)[] | null | undefined>;
4
- export default component;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { FlowerRuleProps } from './types/FlowerRule';
3
- declare const component: React.MemoExoticComponent<({ children, rules, value, alwaysDisplay, flowName, id, onUpdate }: FlowerRuleProps) => string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | (string | number | Iterable<React.ReactNode> | React.JSX.Element)[] | null | undefined>;
4
- export default component;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { FlowerValueProps } from './types/FlowerValue';
3
- declare const component: React.MemoExoticComponent<({ id, rules, alwaysDisplay, value, children, spreadValue, flowName, onUpdate, }: FlowerValueProps) => React.JSX.Element | (string | number | React.JSX.Element | Iterable<React.ReactNode>)[] | null | undefined>;
4
- export default component;
@@ -1,124 +0,0 @@
1
- import { FunctionRule, RulesObject } from '@flowerforce/flower-core';
2
- export type FlowerFieldProps<T extends Record<string, any> = Record<string, any>> = {
3
- /** The path to the value you want to read from the flow's data
4
- *
5
- * Example: id="loginForm.name"
6
- *
7
- * The FlowerField component reads the value of the key "name" of the loginForm object in the flow's data
8
- */
9
- id?: string;
10
- /** The FlowerField's children */
11
- children: React.ReactNode | ((props: {
12
- /** The string passed to the "id" FlowerField's prop */
13
- id: string;
14
- /** The value found at the "id" key in the flow data
15
- *
16
- * Example: id="loginForm.name"
17
- *
18
- * This parameter will hold the value found at the key 'name' of the loginForm object in the flow's data.
19
- */
20
- value: any;
21
- /** An array of strings containing error messages associated with validation rules that are not satisfied. */
22
- errors: undefined | string[];
23
- /** This parameter will notify you when there are validation errors. */
24
- hasError: undefined | boolean;
25
- /** Use this function to write a new value at the "id" key
26
- *
27
- * Example: id="loginForm.name"
28
- *
29
- * onChange("John") will write "John" at the key 'name' of the loginForm object in the flow's data.
30
- */
31
- onChange: (props: any) => void;
32
- /** The function executed on blur input*/
33
- onBlur: () => void;
34
- /** The function executed on focus input*/
35
- onFocus: () => void;
36
- /** This value is set to true when the form has been submitted at least once or a next invoked */
37
- isSubmitted: boolean;
38
- /** This parameter will notify you whether the form field has been focues */
39
- focused: boolean | undefined;
40
- /** This parameter will notify you whether the form field has been touched */
41
- touched: boolean;
42
- /** This parameter will notify you if the form field is filled in at least once */
43
- dirty: boolean;
44
- /** true when some of the display rules are not satisfied, and you have passed true to the "alwaysDisplay" FlowerField's prop*/
45
- hidden: boolean;
46
- /** true when you have an async validation in progress */
47
- isValidating: boolean | undefined;
48
- }) => React.ReactNode | React.ReactElement | undefined);
49
- /**The validation rules for that field
50
- *
51
- * Example: validate={[
52
- *
53
- * {
54
- * rules: {
55
- * $self: {
56
- * $regex:
57
- * '^([A-Z]{6}[0-9LMNPQRSTUV]{2}[ABCDEHLMPRST]{1}[0-9LMNPQRSTUV]{2}[A-Z]{1}[0-9LMNPQRSTUV]{3}[A-Z]{1})$|([0-9]{11})$',
58
- * },
59
- * },
60
- * message: 'Value not valid',
61
- * },
62
- * {
63
- * // Don't use promises
64
- * rules: (data)=> {
65
- * return data.name === 'Andrea'
66
- * },
67
- * message: 'Value not valid',
68
- * }
69
- * ]}
70
- *
71
- * For every rule you can pass an error message, that Flower returns when that condition is note satisfied
72
- */
73
- validate?: Record<string, any>[] | string[];
74
- /** A function to perform an async validation */
75
- asyncValidate?: (value: any, data?: Record<string, any>, errors?: undefined | string[]) => string[] | undefined | Promise<string[]> | {
76
- message: string;
77
- }[] | boolean | Promise<boolean>;
78
- /** Use this to set a debounce for the async validation
79
- *
80
- * The default value is 0
81
- */
82
- asyncDebounce?: number;
83
- /** The initial error message when you have an async validation
84
- *
85
- * The default value is undefined
86
- */
87
- asyncInitialError?: string;
88
- /** The message that the FlowerField returns while validating*/
89
- asyncWaitingError?: string;
90
- /** An object containing the display rules of that component. When the conditions are not satisfied, the children is hidden.
91
- *
92
- * Example: rules={{ $and: [{ name: { $exists: true } }] }}
93
- */
94
- rules?: RulesObject<T> | FunctionRule;
95
- /** The name of the flow from which read the data
96
- *
97
- * - note: the default value is the name of the flow where the component is used
98
- */
99
- flowName?: string;
100
- /** Initial value field */
101
- defaultValue?: unknown;
102
- /** Remove value from data on destroy element */
103
- destroyValue?: boolean;
104
- /** Remove value from data on hide element */
105
- destroyOnHide?: boolean;
106
- value?: any;
107
- /** When set to true, the children is shown even if the rules are not satisfied
108
- *
109
- * The FlowerField returns the boolean variable "hidden" to notify you if the conditions are satisfied or not
110
- */
111
- alwaysDisplay?: boolean;
112
- /** The function executed when the value found at the path passed to the "id" prop changes */
113
- onUpdate?: (value: any) => void;
114
- /** The function executed at the "onBlur" event, for example for Input components
115
- *
116
- * The onBlur function will test all the validation rules
117
- */
118
- onBlur?: (e: any) => void;
119
- /** The function executed at the "onFocus" event, for example for Input components
120
- *
121
- * The onFocus function will test all the validation rules
122
- */
123
- onFocus?: (e: any) => void;
124
- };
@@ -1,72 +0,0 @@
1
- import { Route, RouteNode, RoutePrev, RouteReset, RouteRestart } from './FlowerNavigate';
2
- export type UseFlowerProps = {
3
- [x in 'name' | 'flowName']?: string;
4
- };
5
- export type UseFlowerForm = (options?: UseFlowerProps) => {
6
- /** This value is set to true when the form has been submitted at least once or a next invoked. */
7
- isSubmitted: boolean;
8
- /** This value is set to true when at least once field is dirted. */
9
- isDirty: boolean;
10
- /** This value is the id of the focused element. */
11
- hasFocus: string | undefined;
12
- /** An object containing all the form errors */
13
- errors: Record<string, any>;
14
- /** An object containing all the form custom errors */
15
- customErrors: Record<string, any>;
16
- /** This value is set to true when all the validation rules are satisfied and the form is valid*/
17
- isValid: boolean;
18
- /** This value is set to true during asynchronous validation.*/
19
- isValidating: boolean | undefined;
20
- /** Use this function to read status from the flow's form. */
21
- getFormStatus: (path?: string) => any;
22
- /** Use this function to read values from the flow's data. */
23
- getData: (path?: string) => any;
24
- /** Use this function to set values in the flow's data. */
25
- setData: (
26
- /** The value that you want to set */
27
- value: any,
28
- /** Specify the target path to set the value*/
29
- id?: string) => void;
30
- /** Use this function to set value in the flow's field data. */
31
- setDataField: (
32
- /** Specify the target path to set the value*/
33
- id: string,
34
- /** The value that you want to set */
35
- value: any,
36
- /** Specify default value for dirty status*/
37
- dirty?: boolean) => void;
38
- /** Use this function to unset values in the flow's data. */
39
- unsetData: (
40
- /** Specify the target path to the value tha you want to unset*/
41
- path: string) => void;
42
- /** Use this function to replace a value in the flow's data. */
43
- replaceData: (value: any) => void;
44
- /**Use this function to reset errors form and touched state */
45
- reset: (nodeId?: string) => void;
46
- /**this function to set a custom error on a specific field */
47
- setCustomErrors: (field: string, errors: string[], nodeId?: string) => void;
48
- };
49
- type useFlowerActions = {
50
- /** Use this function to move to the next node inside the flow*/
51
- next: (payload?: Route) => void;
52
- /**Use this function to move to the previous node inside the flow*/
53
- back: (payload?: RoutePrev) => void;
54
- /**Use this function to return to the first node and restore history */
55
- reset: (payload?: RouteReset) => void;
56
- /**Use this function to move to a specific node*/
57
- jump: (payload: RouteNode) => void;
58
- /**Use this function to reset the flow data and history */
59
- restart: (payload?: RouteRestart) => void;
60
- /**Get current node by flowName or current flow */
61
- getCurrentNodeId: (flowName?: string) => string;
62
- };
63
- export type UseFlower = (options?: UseFlowerProps) => useFlowerActions & {
64
- /**The flow in which the hook is used.*/
65
- flowName?: string;
66
- /**Current node id*/
67
- nodeId: string;
68
- /**Initial start node id*/
69
- startId: string;
70
- };
71
- export type NavigateFunctionParams = string | Record<string, any>;
72
- export {};
@@ -1,35 +0,0 @@
1
- import { FunctionRule, RulesObject } from '@flowerforce/flower-core';
2
- export type FlowerRuleProps = {
3
- /** The path to the value you want to read from the flow's data
4
- *
5
- * Example: id="loginForm.name"
6
- *
7
- * The FlowerRule component reads the value of the key "name" of the loginForm object in the flow's data
8
- */
9
- id?: string;
10
- /** */
11
- value?: any;
12
- /** An object or function containing the display rules of that component. When the conditions are not satisfied, the children is hidden.
13
- *
14
- * Example: rules={{ $and: [{ name: { $exists: true } }] }}
15
- * Example: rules={(state) => state... === true}
16
- * if missing it is always visible
17
- */
18
- rules?: RulesObject<Record<string, any>> | FunctionRule;
19
- /** The name of the flow from which read the data
20
- *
21
- * - note: the default value is the name of the flow where the component is used
22
- */
23
- flowName?: string;
24
- /** When set to true, the children is shown even if the rules are not satisfied
25
- *
26
- * The FlowerRule returns the boolean variable "hidden" to notify you if the conditions are satisfied or not
27
- */
28
- alwaysDisplay?: boolean;
29
- /** The function executed when the value found at the path passed to the "id" prop changes */
30
- onUpdate?: (hidden: boolean) => void;
31
- /** The children of the FlowerRule*/
32
- children?: React.ReactNode | ((props: {
33
- hidden?: boolean;
34
- }) => React.ReactNode | React.ReactElement | undefined);
35
- };
@@ -1,33 +0,0 @@
1
- import { FunctionRule, RulesObject } from '@flowerforce/flower-core';
2
- export type FlowerValueProps = {
3
- /** The path to the value you want to read from the flow's data
4
- *
5
- * Example: id="loginForm.name"
6
- *
7
- * The FlowerValue component reads the value of the key "name" of the loginForm object in the flow's data
8
- * If missing, I return all values, which is equivalent to setting id='*'
9
- */
10
- id?: string;
11
- value?: any;
12
- /** An object containing the display rules of that component. When the conditions are not satisfied, the children is hidden.
13
- *
14
- * Example: rules={{ $and: [{ name: { $exists: true } }] }}
15
- */
16
- rules?: RulesObject<any> | FunctionRule;
17
- /** The FlowerValue's children */
18
- children: React.ReactNode | ((props: Record<string, any>) => React.ReactNode | React.ReactElement | undefined);
19
- /** Set this value to true to spread the value into separate values in case it is an object. */
20
- spreadValue?: boolean;
21
- /** The name of the flow from which read the data
22
- *
23
- * - note: the default value is the name of the flow where the component is used
24
- */
25
- flowName?: string;
26
- /** When set to true, the children is shown even if the rules are not satisfied
27
- *
28
- * The FlowerValue returns the boolean variable "hidden" to notify you if the conditions are satisfied or not
29
- */
30
- alwaysDisplay?: boolean;
31
- /** The function executed when the value found at the path passed to the "id" prop changes */
32
- onUpdate?: (value: any) => void;
33
- };
@@ -1,26 +0,0 @@
1
- import { UseFlowerForm } from './types/FlowerHooks';
2
- /** This hook allows you to manage and retrieve information about Forms.
3
- *
4
- * It exposes details regarding the form's state and a set of methods for reading and writing within it:
5
- *
6
- * - isSubmitted,
7
- * - isDirty,
8
- * - errors,
9
- * - customErrors,
10
- * - isValid,
11
- * - isValidating,
12
- * - getData,
13
- * - setData,
14
- * - unsetData,
15
- * - replaceData,
16
- * - reset,
17
- * - setCustomErrors
18
- * - getFormStatus
19
- *
20
- * @param {string} flowName - first optional parameter
21
- *
22
- * @param {string} name - alias optional parameter, if flowName exist, name is not used
23
- *
24
- */
25
- declare const useFlowerForm: UseFlowerForm;
26
- export default useFlowerForm;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- export type FlowerContext = {
3
- flowName?: string | undefined;
4
- currentNode?: string | undefined;
5
- autostart?: boolean | undefined;
6
- initialData?: Record<string, any>;
7
- };
8
- export declare const context: React.Context<FlowerContext>;
9
- export declare const Provider: React.Provider<FlowerContext>;
10
- export declare const Consumer: React.Consumer<FlowerContext>;
@@ -1,25 +0,0 @@
1
- import React, { PropsWithChildren, PureComponent } from 'react';
2
- import { Action } from '@reduxjs/toolkit';
3
- import { FlowerProviderProps } from './components/types/FlowerProvider';
4
- export declare const useDispatch: import("react-redux").UseDispatch<import("redux").Dispatch<Action>>;
5
- export declare const useSelector: import("react-redux").UseSelector<unknown>;
6
- export declare const useStore: import("react-redux").UseStore<import("redux").Store<any, Action, {}>>;
7
- export declare const store: ({ enableDevtool }: {
8
- enableDevtool?: boolean;
9
- }) => import("@reduxjs/toolkit").EnhancedStore<{
10
- flower: Record<string, import("packages/flower-core/dist/src").Flower<Record<string, any>>>;
11
- }, import("redux").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
12
- dispatch: import("redux-thunk").ThunkDispatch<{
13
- flower: Record<string, import("packages/flower-core/dist/src").Flower<Record<string, any>>>;
14
- }, undefined, import("redux").UnknownAction>;
15
- }>, import("redux").StoreEnhancer]>>;
16
- declare class FlowerProvider extends PureComponent<PropsWithChildren<{
17
- enableReduxDevtool?: boolean;
18
- }>, FlowerProviderProps> {
19
- private store;
20
- constructor(props: PropsWithChildren<{
21
- enableReduxDevtool?: boolean;
22
- }>);
23
- render(): React.JSX.Element;
24
- }
25
- export default FlowerProvider;
@@ -1,7 +0,0 @@
1
- import { Flower } from '@flowerforce/flower-core';
2
- declare const flowerReducer: import("@reduxjs/toolkit").Slice<Record<string, Flower<Record<string, any>>>, import("@flowerforce/flower-core").ReducersFunctions, "flower", "flower", import("@reduxjs/toolkit").SliceSelectors<Record<string, Flower<Record<string, any>>>>>;
3
- export declare const actions: import("@reduxjs/toolkit").CaseReducerActions<import("@flowerforce/flower-core").ReducersFunctions, "flower">;
4
- export declare const reducerFlower: {
5
- flower: import("redux").Reducer<Record<string, Flower<Record<string, any>>>>;
6
- };
7
- export default flowerReducer;