@flowerforce/flower-react 4.0.10-beta.0 → 4.0.11-beta.1
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/CHANGELOG.md +48 -0
- package/dist/index.cjs.js +206 -85
- package/dist/index.esm.js +204 -85
- package/dist/src/components/Flower.d.ts +3 -15
- package/dist/src/components/hooks/eventsHandlers.d.ts +5 -0
- package/dist/src/components/hooks/index.d.ts +5 -0
- package/dist/src/components/hooks/types/index.d.ts +29 -0
- package/dist/src/components/hooks/useBrowserNavigationSync.d.ts +12 -0
- package/dist/src/components/hooks/useDestroyFlow.d.ts +2 -0
- package/dist/src/components/hooks/useInitDevtools.d.ts +2 -0
- package/dist/src/components/hooks/useInitNodes.d.ts +2 -0
- package/dist/src/components/hooks/useSelectorsClient.d.ts +6 -0
- package/dist/src/components/useFlower/utils.d.ts +2 -0
- package/dist/src/features/selectors/selectors.d.ts +175 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/types/Flower.d.ts +15 -0
- package/dist/src/types/utilsTypes.d.ts +4 -0
- package/dist/src/utils.d.ts +2 -10
- package/package.json +12 -7
@@ -378,6 +378,181 @@ export declare const makeSelectCurrentNodeId: (name: string) => ((state: {
|
|
378
378
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
379
379
|
memoize: typeof import("reselect").weakMapMemoize;
|
380
380
|
};
|
381
|
+
export declare const makeSelectIsCurrentNode: (name: string) => ((state: {
|
382
|
+
FlowerFlow: {
|
383
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
384
|
+
};
|
385
|
+
}) => import("@flowerforce/flower-core").INode) & {
|
386
|
+
clearCache: () => void;
|
387
|
+
resultsCount: () => number;
|
388
|
+
resetResultsCount: () => void;
|
389
|
+
} & {
|
390
|
+
resultFunc: (resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>, resultFuncArgs_1: string) => import("@flowerforce/flower-core").INode;
|
391
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>, resultFuncArgs_1: string) => import("@flowerforce/flower-core").INode) & {
|
392
|
+
clearCache: () => void;
|
393
|
+
resultsCount: () => number;
|
394
|
+
resetResultsCount: () => void;
|
395
|
+
};
|
396
|
+
lastResult: () => import("@flowerforce/flower-core").INode;
|
397
|
+
dependencies: [((state: {
|
398
|
+
FlowerFlow: {
|
399
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
400
|
+
};
|
401
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
402
|
+
clearCache: () => void;
|
403
|
+
resultsCount: () => number;
|
404
|
+
resetResultsCount: () => void;
|
405
|
+
} & {
|
406
|
+
resultFunc: (resultFuncArgs_0: {
|
407
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
408
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
409
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
410
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
411
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
412
|
+
clearCache: () => void;
|
413
|
+
resultsCount: () => number;
|
414
|
+
resetResultsCount: () => void;
|
415
|
+
};
|
416
|
+
lastResult: () => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
417
|
+
dependencies: [<T extends Record<string, any>>(state: {
|
418
|
+
FlowerFlow: {
|
419
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
420
|
+
};
|
421
|
+
}) => {
|
422
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
423
|
+
}];
|
424
|
+
recomputations: () => number;
|
425
|
+
resetRecomputations: () => void;
|
426
|
+
dependencyRecomputations: () => number;
|
427
|
+
resetDependencyRecomputations: () => void;
|
428
|
+
} & {
|
429
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
430
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
431
|
+
}, ((state: {
|
432
|
+
FlowerFlow: {
|
433
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
434
|
+
};
|
435
|
+
}) => string) & {
|
436
|
+
clearCache: () => void;
|
437
|
+
resultsCount: () => number;
|
438
|
+
resetResultsCount: () => void;
|
439
|
+
} & {
|
440
|
+
resultFunc: (resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>, resultFuncArgs_1: string) => string;
|
441
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>, resultFuncArgs_1: string) => string) & {
|
442
|
+
clearCache: () => void;
|
443
|
+
resultsCount: () => number;
|
444
|
+
resetResultsCount: () => void;
|
445
|
+
};
|
446
|
+
lastResult: () => string;
|
447
|
+
dependencies: [((state: {
|
448
|
+
FlowerFlow: {
|
449
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
450
|
+
};
|
451
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
452
|
+
clearCache: () => void;
|
453
|
+
resultsCount: () => number;
|
454
|
+
resetResultsCount: () => void;
|
455
|
+
} & {
|
456
|
+
resultFunc: (resultFuncArgs_0: {
|
457
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
458
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
459
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
460
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
461
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
462
|
+
clearCache: () => void;
|
463
|
+
resultsCount: () => number;
|
464
|
+
resetResultsCount: () => void;
|
465
|
+
};
|
466
|
+
lastResult: () => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
467
|
+
dependencies: [<T extends Record<string, any>>(state: {
|
468
|
+
FlowerFlow: {
|
469
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
470
|
+
};
|
471
|
+
}) => {
|
472
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
473
|
+
}];
|
474
|
+
recomputations: () => number;
|
475
|
+
resetRecomputations: () => void;
|
476
|
+
dependencyRecomputations: () => number;
|
477
|
+
resetDependencyRecomputations: () => void;
|
478
|
+
} & {
|
479
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
480
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
481
|
+
}, ((state: {
|
482
|
+
FlowerFlow: {
|
483
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
484
|
+
};
|
485
|
+
}) => string) & {
|
486
|
+
clearCache: () => void;
|
487
|
+
resultsCount: () => number;
|
488
|
+
resetResultsCount: () => void;
|
489
|
+
} & {
|
490
|
+
resultFunc: (resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>) => string;
|
491
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("@flowerforce/flower-core").Flower<Record<string, any>>) => string) & {
|
492
|
+
clearCache: () => void;
|
493
|
+
resultsCount: () => number;
|
494
|
+
resetResultsCount: () => void;
|
495
|
+
};
|
496
|
+
lastResult: () => string;
|
497
|
+
dependencies: [((state: {
|
498
|
+
FlowerFlow: {
|
499
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
500
|
+
};
|
501
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
502
|
+
clearCache: () => void;
|
503
|
+
resultsCount: () => number;
|
504
|
+
resetResultsCount: () => void;
|
505
|
+
} & {
|
506
|
+
resultFunc: (resultFuncArgs_0: {
|
507
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
508
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
509
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
510
|
+
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
511
|
+
}) => import("@flowerforce/flower-core").Flower<Record<string, any>>) & {
|
512
|
+
clearCache: () => void;
|
513
|
+
resultsCount: () => number;
|
514
|
+
resetResultsCount: () => void;
|
515
|
+
};
|
516
|
+
lastResult: () => import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
517
|
+
dependencies: [<T extends Record<string, any>>(state: {
|
518
|
+
FlowerFlow: {
|
519
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
520
|
+
};
|
521
|
+
}) => {
|
522
|
+
[x: string]: import("@flowerforce/flower-core").Flower<T>;
|
523
|
+
}];
|
524
|
+
recomputations: () => number;
|
525
|
+
resetRecomputations: () => void;
|
526
|
+
dependencyRecomputations: () => number;
|
527
|
+
resetDependencyRecomputations: () => void;
|
528
|
+
} & {
|
529
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
530
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
531
|
+
}];
|
532
|
+
recomputations: () => number;
|
533
|
+
resetRecomputations: () => void;
|
534
|
+
dependencyRecomputations: () => number;
|
535
|
+
resetDependencyRecomputations: () => void;
|
536
|
+
} & {
|
537
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
538
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
539
|
+
}];
|
540
|
+
recomputations: () => number;
|
541
|
+
resetRecomputations: () => void;
|
542
|
+
dependencyRecomputations: () => number;
|
543
|
+
resetDependencyRecomputations: () => void;
|
544
|
+
} & {
|
545
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
546
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
547
|
+
}];
|
548
|
+
recomputations: () => number;
|
549
|
+
resetRecomputations: () => void;
|
550
|
+
dependencyRecomputations: () => number;
|
551
|
+
resetDependencyRecomputations: () => void;
|
552
|
+
} & {
|
553
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
554
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
555
|
+
};
|
381
556
|
export declare const makeSelectPrevNodeRetain: (name: string) => ((state: {
|
382
557
|
FlowerFlow: {
|
383
558
|
[x: string]: import("@flowerforce/flower-core").Flower<Record<string, any>>;
|
package/dist/src/index.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
export
|
1
|
+
export { Flower, FlowerAction, FlowerFlow, FlowerNode, FlowerRoute, FlowerNavigate, FlowerServer, FlowerStart, useFlower, useFlowerNavigate } from './components';
|
2
2
|
export * from './provider';
|
3
3
|
export { makeSelectData, reducerFlower, flowerReducers } from './features';
|
4
4
|
export type * from './types';
|
5
5
|
export { createApi } from '@flowerforce/flower-react-store';
|
6
|
+
export { HistoryContextProvider } from '@flowerforce/flower-react-history-context';
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { PropsWithChildren } from "react";
|
2
|
+
export type FlowerInitalState = {
|
3
|
+
startId?: string;
|
4
|
+
current?: string;
|
5
|
+
history?: string[];
|
6
|
+
};
|
7
|
+
export type FlowerClientProps = PropsWithChildren & {
|
8
|
+
name: string;
|
9
|
+
/**@deprecated Use persist instead */
|
10
|
+
destroyOnUnmount?: boolean;
|
11
|
+
persist?: boolean;
|
12
|
+
startId?: string | null;
|
13
|
+
initialData?: any;
|
14
|
+
initialState?: FlowerInitalState;
|
15
|
+
};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { Edge, MapEdge, NodeConfig, RulesByNodeId } from '@flowerforce/flower-core';
|
2
|
+
import { Children } from 'react';
|
3
|
+
export type GenerateNodesForFlowerJson = (nodes: ReturnType<typeof Children.toArray>, edges?: Edge[]) => NodeConfig[];
|
4
|
+
export type GetRulesExists = (rules: RulesByNodeId<any>[]) => ReturnType<MapEdge> | undefined;
|
package/dist/src/utils.d.ts
CHANGED
@@ -1,10 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
export declare const
|
3
|
-
nodeId: string | undefined;
|
4
|
-
nodeType: string;
|
5
|
-
nodeTitle: string;
|
6
|
-
children: Record<string, any> | Record<string, any>[] | undefined;
|
7
|
-
nextRules: import("@flowerforce/flower-core").RulesByNodeId<any>[] | undefined;
|
8
|
-
retain: boolean;
|
9
|
-
disabled: boolean;
|
10
|
-
}[];
|
1
|
+
import { GenerateNodesForFlowerJson } from './types/utilsTypes';
|
2
|
+
export declare const generateNodesForFlowerJson: GenerateNodesForFlowerJson;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@flowerforce/flower-react",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.11-beta.1",
|
4
4
|
"description": "FlowerJS components, hooks and utils for React.",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -24,8 +24,12 @@
|
|
24
24
|
"peerDependencies": {
|
25
25
|
"react": ">=18",
|
26
26
|
"@reduxjs/toolkit": "^2.2.4",
|
27
|
-
"
|
28
|
-
"
|
27
|
+
"reselect": "^5.1.0",
|
28
|
+
"@testing-library/react": "15.0.7",
|
29
|
+
"@testing-library/jest-dom": "6.6.3",
|
30
|
+
"@flowerforce/flower-react-form": "4.0.11-beta.0",
|
31
|
+
"@testing-library/user-event": "14.6.1",
|
32
|
+
"redux": "5.0.1"
|
29
33
|
},
|
30
34
|
"devDependencies": {
|
31
35
|
"@testing-library/jest-dom": "^6.4.5",
|
@@ -37,10 +41,11 @@
|
|
37
41
|
"typescript": "^5.4.5"
|
38
42
|
},
|
39
43
|
"dependencies": {
|
40
|
-
"@flowerforce/flower-core": "4.0.1-beta.
|
41
|
-
"@flowerforce/flower-react-context": "4.0.1-beta.
|
42
|
-
"@flowerforce/flower-react-store": "4.0.1-beta.
|
43
|
-
"@flowerforce/flower-react-shared": "4.0.6-beta.
|
44
|
+
"@flowerforce/flower-core": "4.0.1-beta.9",
|
45
|
+
"@flowerforce/flower-react-context": "4.0.1-beta.9",
|
46
|
+
"@flowerforce/flower-react-store": "4.0.1-beta.9",
|
47
|
+
"@flowerforce/flower-react-shared": "4.0.6-beta.5",
|
48
|
+
"@flowerforce/flower-react-history-context": "4.0.0",
|
44
49
|
"lodash": "^4.17.21"
|
45
50
|
},
|
46
51
|
"exports": {
|