@redneckz/wildless-cms-uni-blocks 0.14.676 → 0.14.677

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 (73) hide show
  1. package/bundle/api/RetailAPI/updateRefreshToken.d.ts +1 -1
  2. package/bundle/bundle.umd.js +23 -12
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/hooks/useNavigator.d.ts +8 -0
  5. package/bundle/index.d.ts +1 -0
  6. package/dist/api/RetailAPI/updateRefreshToken.d.ts +1 -1
  7. package/dist/api/RetailAPI/updateRefreshToken.js +6 -10
  8. package/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
  9. package/dist/components/CreditCardForm/CreditCardForm.js +4 -1
  10. package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
  11. package/dist/components/CreditForm/CreditForm.js +4 -1
  12. package/dist/components/CreditForm/CreditForm.js.map +1 -1
  13. package/dist/hooks/useNavigator.d.ts +8 -0
  14. package/dist/hooks/useNavigator.js +13 -0
  15. package/dist/hooks/useNavigator.js.map +1 -0
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.js +3 -1
  18. package/dist/index.js.map +1 -1
  19. package/lib/api/RetailAPI/updateRefreshToken.d.ts +1 -1
  20. package/lib/api/RetailAPI/updateRefreshToken.js +6 -10
  21. package/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
  22. package/lib/components/CreditCardForm/CreditCardForm.js +4 -1
  23. package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
  24. package/lib/components/CreditForm/CreditForm.js +4 -1
  25. package/lib/components/CreditForm/CreditForm.js.map +1 -1
  26. package/lib/hooks/useNavigator.d.ts +8 -0
  27. package/lib/hooks/useNavigator.js +10 -0
  28. package/lib/hooks/useNavigator.js.map +1 -0
  29. package/lib/index.d.ts +1 -0
  30. package/lib/index.js +1 -0
  31. package/lib/index.js.map +1 -1
  32. package/mobile/bundle/api/RetailAPI/updateRefreshToken.d.ts +1 -1
  33. package/mobile/bundle/bundle.umd.js +23 -12
  34. package/mobile/bundle/bundle.umd.min.js +1 -1
  35. package/mobile/bundle/hooks/useNavigator.d.ts +8 -0
  36. package/mobile/bundle/index.d.ts +1 -0
  37. package/mobile/dist/api/RetailAPI/updateRefreshToken.d.ts +1 -1
  38. package/mobile/dist/api/RetailAPI/updateRefreshToken.js +6 -10
  39. package/mobile/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
  40. package/mobile/dist/components/CreditCardForm/CreditCardForm.js +4 -1
  41. package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
  42. package/mobile/dist/components/CreditForm/CreditForm.js +4 -1
  43. package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
  44. package/mobile/dist/hooks/useNavigator.d.ts +8 -0
  45. package/mobile/dist/hooks/useNavigator.js +13 -0
  46. package/mobile/dist/hooks/useNavigator.js.map +1 -0
  47. package/mobile/dist/index.d.ts +1 -0
  48. package/mobile/dist/index.js +3 -1
  49. package/mobile/dist/index.js.map +1 -1
  50. package/mobile/lib/api/RetailAPI/updateRefreshToken.d.ts +1 -1
  51. package/mobile/lib/api/RetailAPI/updateRefreshToken.js +6 -10
  52. package/mobile/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
  53. package/mobile/lib/components/CreditCardForm/CreditCardForm.js +4 -1
  54. package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
  55. package/mobile/lib/components/CreditForm/CreditForm.js +4 -1
  56. package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
  57. package/mobile/lib/hooks/useNavigator.d.ts +8 -0
  58. package/mobile/lib/hooks/useNavigator.js +10 -0
  59. package/mobile/lib/hooks/useNavigator.js.map +1 -0
  60. package/mobile/lib/index.d.ts +1 -0
  61. package/mobile/lib/index.js +1 -0
  62. package/mobile/lib/index.js.map +1 -1
  63. package/mobile/src/api/RetailAPI/updateRefreshToken.ts +6 -12
  64. package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +6 -1
  65. package/mobile/src/components/CreditForm/CreditForm.tsx +6 -1
  66. package/mobile/src/hooks/useNavigator.ts +15 -0
  67. package/mobile/src/index.ts +1 -0
  68. package/package.json +1 -1
  69. package/src/api/RetailAPI/updateRefreshToken.ts +6 -12
  70. package/src/components/CreditCardForm/CreditCardForm.tsx +6 -1
  71. package/src/components/CreditForm/CreditForm.tsx +6 -1
  72. package/src/hooks/useNavigator.ts +15 -0
  73. package/src/index.ts +1 -0
@@ -1,6 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback, useEffect, useMemo, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { updateRefreshToken } from '../../api/RetailAPI/updateRefreshToken';
4
+ import { useNavigator } from '../../hooks/useNavigator';
4
5
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
5
6
  import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
6
7
  import { style } from '../../utils/style';
@@ -12,6 +13,8 @@ import { stepsSectionsMap } from './creditFormStepsData';
12
13
 
13
14
  interface CreditFormWizardProps extends CreditFormContent, UniBlockProps {}
14
15
 
16
+ const PORTAL_NATURAL_URL = '/';
17
+
15
18
  const WIZARD_STEPS = 5;
16
19
 
17
20
  const WIZARD_TITLES = [
@@ -32,7 +35,9 @@ export const CreditForm = JSX<CreditFormWizardProps>(({ className, ...rest }) =>
32
35
  [formContainerRef],
33
36
  );
34
37
 
35
- useEffect(updateRefreshToken, []);
38
+ const navigator = useNavigator();
39
+
40
+ useEffect(() => updateRefreshToken(() => navigator.assign(PORTAL_NATURAL_URL)), []);
36
41
 
37
42
  const handleNextStep = useCallback(() => {
38
43
  setStep((_) => Math.min(_ + 1, WIZARD_STEPS));
@@ -0,0 +1,15 @@
1
+ export interface Navigator {
2
+ assign: (url: string) => void;
3
+ }
4
+
5
+ export function useNavigator(): Navigator {
6
+ return useNavigator._impl();
7
+ }
8
+
9
+ useNavigator._impl = (): Navigator => ({
10
+ assign: (url) => globalThis.location.assign(url),
11
+ });
12
+
13
+ useNavigator.setup = (impl: () => Navigator) => {
14
+ useNavigator._impl = impl;
15
+ };
package/src/index.ts CHANGED
@@ -3,6 +3,7 @@ export { setup } from '@redneckz/uni-jsx/lib/setup';
3
3
  export { Blocks } from './components/Blocks';
4
4
  export { ContentPage } from './components/ContentPage/ContentPage';
5
5
  export { handlerDecorator } from './hooks/handlerDecorator';
6
+ export { useNavigator } from './hooks/useNavigator';
6
7
  export { useRouter } from './hooks/useRouter';
7
8
  export { projectSettings } from './ProjectSettings';
8
9
  export { joinList } from './utils/joinList';