@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,15 +1,15 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
- type FlowerInitalState = {
2
+ type FlowerInitialState = {
3
3
  startId?: string;
4
4
  current?: string;
5
5
  history?: string[];
6
6
  };
7
- type FlowerClientProps = PropsWithChildren & {
7
+ type FlowerClientProps = PropsWithChildren<{
8
8
  name: string;
9
9
  destroyOnUnmount?: boolean;
10
10
  startId?: string | null;
11
- initialData?: any;
12
- initialState?: FlowerInitalState;
13
- };
14
- declare const component: React.MemoExoticComponent<({ children, name, destroyOnUnmount, startId, initialData, initialState }: FlowerClientProps) => React.JSX.Element | null>;
15
- export default component;
11
+ initialState?: FlowerInitialState;
12
+ initialData?: Record<string, unknown>;
13
+ }>;
14
+ export declare const Flower: ({ children, name, destroyOnUnmount, startId, initialState, initialData }: FlowerClientProps) => React.JSX.Element | null;
15
+ export {};
@@ -1,4 +1,3 @@
1
1
  import React from 'react';
2
- import { FlowerNodeDefaultProps } from './types/DefaultNode';
3
- declare const component: React.MemoExoticComponent<({ children, onEnter, onExit }: FlowerNodeDefaultProps) => React.ReactNode>;
4
- export default component;
2
+ import { FlowerNodeDefaultProps } from '../types/DefaultNode';
3
+ export declare const FlowerAction: ({ children, onEnter, onExit }: FlowerNodeDefaultProps) => React.JSX.Element;
@@ -1,4 +1,2 @@
1
- import React from 'react';
2
- import { FlowerComponentProps } from './types/FlowerComponent';
3
- declare const component: React.MemoExoticComponent<({ children }: FlowerComponentProps) => React.ReactNode>;
4
- export default component;
1
+ import { FlowerComponentProps } from '../types/FlowerComponent';
2
+ export declare const FlowerComponent: ({ children }: FlowerComponentProps) => import("react").ReactNode;
@@ -1,4 +1,3 @@
1
1
  import React from 'react';
2
- import { FlowerFlowProps } from './types/FlowerFlow';
3
- declare const component: React.MemoExoticComponent<({ children, onEnter, onExit }: FlowerFlowProps) => React.ReactNode>;
4
- export default component;
2
+ import { FlowerFlowProps } from '../types/FlowerFlow';
3
+ export declare const FlowerFlow: ({ children, onEnter, onExit }: FlowerFlowProps) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { FlowerNavigateProps } from '../../types/FlowerNavigate';
3
+ export declare const FlowerNavigate: ({ children, flowName: forceFlowName, action, route, node, rules, alwaysDisplay }: FlowerNavigateProps) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- declare function FlowerNavigateWrapper({ hidden, Component, onNavigate, ...props }: any): any;
3
- declare const component: React.MemoExoticComponent<typeof FlowerNavigateWrapper>;
4
- export default component;
2
+ declare function _FlowerNavigateWrapper({ hidden, Component, onNavigate, ...props }: any): any;
3
+ export declare const FlowerNavigateWrapper: React.MemoExoticComponent<typeof _FlowerNavigateWrapper>;
4
+ export {};
@@ -1,4 +1,2 @@
1
- import React from 'react';
2
- import { FlowerNavigateProps } from '../types/FlowerNavigate';
3
- declare const component: React.MemoExoticComponent<({ children, flowName: forceFlowName, action, route, node, rules, alwaysDisplay, }: FlowerNavigateProps) => React.JSX.Element | (string | number | Iterable<React.ReactNode> | React.JSX.Element)[] | null | undefined>;
4
- export default component;
1
+ export * from './FlowerNavigate';
2
+ export * from './useFlowerNavigate';
@@ -1,4 +1,4 @@
1
- import { FlowerNavigateProps } from '../types/FlowerNavigate';
1
+ import { FlowerNavigateProps } from '../../types/FlowerNavigate';
2
2
  type UseFlowerNavigateProps = Pick<FlowerNavigateProps, 'flowName' | 'node' | 'route' | 'action'>;
3
3
  export declare const useFlowerNavigate: ({ flowName, action, route, node }: UseFlowerNavigateProps) => {
4
4
  onNavigate: () => void;
@@ -1,4 +1,3 @@
1
1
  import React from 'react';
2
- import { FlowerNodeProps } from './types/FlowerNode';
3
- declare const component: React.MemoExoticComponent<({ children, onEnter, onExit }: FlowerNodeProps) => React.ReactNode>;
4
- export default component;
2
+ import { FlowerNodeProps } from '../types/FlowerNode';
3
+ export declare const FlowerNode: ({ children, onEnter, onExit }: FlowerNodeProps) => React.JSX.Element;
@@ -1,4 +1,3 @@
1
1
  import React from 'react';
2
- import { FlowerRouteProps } from './types/FlowerRoute';
3
- declare const component: React.MemoExoticComponent<({ autostart, children, onEnter, onExit }: FlowerRouteProps) => React.ReactNode>;
4
- export default component;
2
+ import { FlowerRouteProps } from '../types/FlowerRoute';
3
+ export declare const FlowerRoute: ({ autostart, children, onEnter, onExit }: FlowerRouteProps) => React.JSX.Element;
@@ -1,4 +1,3 @@
1
1
  import React from 'react';
2
- import { FlowerServerProps } from './types/FlowerServer';
3
- declare const component: React.MemoExoticComponent<({ children }: FlowerServerProps) => React.ReactNode>;
4
- export default component;
2
+ import { FlowerServerProps } from '../types/FlowerServer';
3
+ export declare const FlowerServer: ({ children }: FlowerServerProps) => React.JSX.Element;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
- declare function FlowerStart(): null;
3
- declare const component: React.MemoExoticComponent<typeof FlowerStart>;
4
- export default component;
1
+ declare function _FlowerStart(): null;
2
+ export declare const FlowerStart: typeof _FlowerStart;
3
+ export {};
@@ -0,0 +1,10 @@
1
+ export * from './Flower';
2
+ export * from './FlowerAction';
3
+ export * from './FlowerComponent';
4
+ export * from './FlowerFlow';
5
+ export * from './FlowerNavigate';
6
+ export * from './FlowerNode';
7
+ export * from './FlowerRoute';
8
+ export * from './FlowerServer';
9
+ export * from './FlowerStart';
10
+ export * from './useFlower';
@@ -0,0 +1,20 @@
1
+ export declare const makeActionPayloadOnPrev: (flowName: string | undefined, params: any) => {
2
+ type: string;
3
+ payload: Record<string, any>;
4
+ };
5
+ export declare const makeActionPayloadOnReset: (flowName: string | undefined, params: any) => {
6
+ type: string;
7
+ payload: Record<string, any>;
8
+ };
9
+ export declare const makeActionPayloadOnNode: (flowName: string | undefined, params: any) => {
10
+ type: string;
11
+ payload: Record<string, any>;
12
+ };
13
+ export declare const makeActionPayloadOnNext: (flowName: string | undefined, params: any) => {
14
+ type: string;
15
+ payload: Record<string, any>;
16
+ };
17
+ export declare const makeActionPayloadOnRestart: (flowName: string | undefined, params: any) => {
18
+ type: string;
19
+ payload: Record<string, any>;
20
+ };
@@ -1,4 +1,4 @@
1
- import { UseFlower } from './types/FlowerHooks';
1
+ import { UseFlower } from '../types/FlowerHooks';
2
2
  /** This hook allows you to read flow informations, such as the flowName and ID of the current node.
3
3
  *
4
4
  * It also exposes all the functions to navigate within the flow:
@@ -17,5 +17,4 @@ import { UseFlower } from './types/FlowerHooks';
17
17
  *
18
18
  * @param {string} name - optional parameter, if flowName exist, name is not used
19
19
  */
20
- declare const useFlower: UseFlower;
21
- export default useFlower;
20
+ export declare const useFlower: UseFlower;
@@ -0,0 +1,2 @@
1
+ export * from './reducer/flowerReducer';
2
+ export * from './selectors/selectors';
@@ -0,0 +1,6 @@
1
+ import { Flower, REDUCER_NAME } from '@flowerforce/flower-core';
2
+ import { REDUCERS_TYPES } from '@flowerforce/flower-react-store';
3
+ export declare const flowerReducer: import("@reduxjs/toolkit").Slice<Record<string, Flower<Record<string, any>>>, import("@flowerforce/flower-core").CoreReducersFunctions, REDUCER_NAME.FLOWER_FLOW, REDUCER_NAME.FLOWER_FLOW, import("@reduxjs/toolkit").SliceSelectors<Record<string, Flower<Record<string, any>>>>>;
4
+ export declare const flowerActions: import("@reduxjs/toolkit").CaseReducerActions<import("@flowerforce/flower-core").CoreReducersFunctions, REDUCER_NAME.FLOWER_FLOW>;
5
+ export declare const flowerFlowReducer: import("redux").Reducer<Record<string, Flower<Record<string, any>>>>;
6
+ export declare const reducerFlower: REDUCERS_TYPES;