@redneckz/wildless-cms-uni-blocks 0.14.1056 → 0.14.1058

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 (105) hide show
  1. package/bin/migration-scripts/0.14.1058.js +21 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +63 -38
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/CreditCardForm/getCreditCardFormTaskData.d.ts +3 -2
  6. package/bundle/model/LinkProps.d.ts +0 -2
  7. package/bundle/ui-kit/LinkButton/LinkButtonContent.d.ts +4 -0
  8. package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +16 -2
  9. package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  10. package/dist/components/CreditCardForm/getCreditCardFormTaskData.d.ts +3 -2
  11. package/dist/components/CreditCardForm/getCreditCardFormTaskData.js +38 -24
  12. package/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  13. package/dist/components/CreditCardForm/useCreditCardFormAPI.js +1 -1
  14. package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  15. package/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  16. package/dist/model/LinkProps.d.ts +0 -2
  17. package/dist/ui-kit/LinkButton/LinkButton.js +9 -9
  18. package/dist/ui-kit/LinkButton/LinkButton.js.map +1 -1
  19. package/dist/ui-kit/LinkButton/LinkButtonContent.d.ts +4 -0
  20. package/dist/ui-kit/UserSurveyDialog/useUserSurveyDialog.js +1 -1
  21. package/dist/ui-kit/UserSurveyDialog/useUserSurveyDialog.js.map +1 -1
  22. package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +16 -2
  23. package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  24. package/lib/components/CreditCardForm/getCreditCardFormTaskData.d.ts +3 -2
  25. package/lib/components/CreditCardForm/getCreditCardFormTaskData.js +38 -24
  26. package/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  27. package/lib/components/CreditCardForm/useCreditCardFormAPI.js +1 -1
  28. package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  29. package/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  30. package/lib/model/LinkProps.d.ts +0 -2
  31. package/lib/ui-kit/LinkButton/LinkButton.js +9 -9
  32. package/lib/ui-kit/LinkButton/LinkButton.js.map +1 -1
  33. package/lib/ui-kit/LinkButton/LinkButtonContent.d.ts +4 -0
  34. package/lib/ui-kit/UserSurveyDialog/useUserSurveyDialog.js +1 -1
  35. package/lib/ui-kit/UserSurveyDialog/useUserSurveyDialog.js.map +1 -1
  36. package/mobile/bundle/bundle.umd.js +63 -38
  37. package/mobile/bundle/bundle.umd.min.js +1 -1
  38. package/mobile/bundle/components/CreditCardForm/getCreditCardFormTaskData.d.ts +3 -2
  39. package/mobile/bundle/model/LinkProps.d.ts +0 -2
  40. package/mobile/bundle/ui-kit/LinkButton/LinkButtonContent.d.ts +4 -0
  41. package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +16 -2
  42. package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  43. package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.d.ts +3 -2
  44. package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.js +38 -24
  45. package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  46. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +1 -1
  47. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  48. package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  49. package/mobile/dist/model/LinkProps.d.ts +0 -2
  50. package/mobile/dist/ui-kit/LinkButton/LinkButton.js +9 -9
  51. package/mobile/dist/ui-kit/LinkButton/LinkButton.js.map +1 -1
  52. package/mobile/dist/ui-kit/LinkButton/LinkButtonContent.d.ts +4 -0
  53. package/mobile/dist/ui-kit/UserSurveyDialog/useUserSurveyDialog.js +1 -1
  54. package/mobile/dist/ui-kit/UserSurveyDialog/useUserSurveyDialog.js.map +1 -1
  55. package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +16 -2
  56. package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  57. package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.d.ts +3 -2
  58. package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.js +38 -24
  59. package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  60. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +1 -1
  61. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  62. package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  63. package/mobile/lib/model/LinkProps.d.ts +0 -2
  64. package/mobile/lib/ui-kit/LinkButton/LinkButton.js +9 -9
  65. package/mobile/lib/ui-kit/LinkButton/LinkButton.js.map +1 -1
  66. package/mobile/lib/ui-kit/LinkButton/LinkButtonContent.d.ts +4 -0
  67. package/mobile/lib/ui-kit/UserSurveyDialog/useUserSurveyDialog.js +1 -1
  68. package/mobile/lib/ui-kit/UserSurveyDialog/useUserSurveyDialog.js.map +1 -1
  69. package/mobile/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +16 -2
  70. package/mobile/src/components/CreditCardForm/getCreditCardFormTaskData.ts +43 -26
  71. package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +1 -1
  72. package/mobile/src/components/CreditForm/CreditFormStatusTracker.tsx +1 -0
  73. package/mobile/src/model/LinkProps.ts +0 -2
  74. package/mobile/src/ui-kit/LinkButton/LinkButton.tsx +11 -10
  75. package/mobile/src/ui-kit/LinkButton/LinkButtonContent.ts +4 -0
  76. package/mobile/src/ui-kit/UserSurveyDialog/useUserSurveyDialog.ts +1 -1
  77. package/package.json +1 -1
  78. package/src/components/ButtonsBlock/ButtonsBlock.fixture.tsx +2 -1
  79. package/src/components/CreditCardForm/CreditCardForm.fixture.mobile.tsx +0 -4
  80. package/src/components/CreditCardForm/CreditCardForm.fixture.tsx +7 -13
  81. package/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +16 -2
  82. package/src/components/CreditCardForm/getCreditCardFormTaskData.ts +43 -26
  83. package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +1 -1
  84. package/src/components/CreditForm/CreditForm.fixture.mobile.tsx +0 -4
  85. package/src/components/CreditForm/CreditFormStatusTracker.tsx +1 -0
  86. package/src/model/LinkProps.ts +0 -2
  87. package/src/ui-kit/LinkButton/LinkButton.tsx +11 -10
  88. package/src/ui-kit/LinkButton/LinkButtonContent.ts +4 -0
  89. package/src/ui-kit/UserSurveyDialog/useUserSurveyDialog.ts +1 -1
  90. package/bundle/retail/utils/mockLocalStorage.d.ts +0 -1
  91. package/dist/retail/utils/mockLocalStorage.d.ts +0 -1
  92. package/dist/retail/utils/mockLocalStorage.js +0 -38
  93. package/dist/retail/utils/mockLocalStorage.js.map +0 -1
  94. package/lib/retail/utils/mockLocalStorage.d.ts +0 -1
  95. package/lib/retail/utils/mockLocalStorage.js +0 -35
  96. package/lib/retail/utils/mockLocalStorage.js.map +0 -1
  97. package/mobile/bundle/retail/utils/mockLocalStorage.d.ts +0 -1
  98. package/mobile/dist/retail/utils/mockLocalStorage.d.ts +0 -1
  99. package/mobile/dist/retail/utils/mockLocalStorage.js +0 -38
  100. package/mobile/dist/retail/utils/mockLocalStorage.js.map +0 -1
  101. package/mobile/lib/retail/utils/mockLocalStorage.d.ts +0 -1
  102. package/mobile/lib/retail/utils/mockLocalStorage.js +0 -35
  103. package/mobile/lib/retail/utils/mockLocalStorage.js.map +0 -1
  104. package/mobile/src/retail/utils/mockLocalStorage.ts +0 -44
  105. package/src/retail/utils/mockLocalStorage.ts +0 -44
@@ -706,15 +706,15 @@
706
706
  }, [method, href]);
707
707
 
708
708
  /** @deprecated */
709
- const LinkButton = JSX(({ disabled, children, method = 'LINK', href, id, additionalHrefs, ...rest }) => {
709
+ const LinkButton = JSX(({ disabled, children, method = 'LINK', href, id, additionalHref, chance, ...rest }) => {
710
710
  const [currentLink, setCurrentLink] = useState();
711
711
  const handleFormSubmit = useFormSubmit({ method, href });
712
712
  const linksStore = useLocalStore();
713
713
  useEffect(() => {
714
- additionalHrefs && saveLinksToStore({ linksStore, href, id, additionalHrefs });
714
+ additionalHref && saveLinksToStore({ linksStore, href, id, additionalHref, chance });
715
715
  const adjustedHref = (linksStore.links || []).find((store) => store.id === id)?.lastLink;
716
716
  setCurrentLink(adjustedHref ?? href);
717
- }, [additionalHrefs, href]);
717
+ }, [additionalHref, href]);
718
718
  const link = useLink();
719
719
  const adjustedProps = link({ onClick: handleFormSubmit, href: currentLink, ...rest });
720
720
  const buttonInner = children ?? jsx(ButtonInner, { ...adjustedProps });
@@ -722,22 +722,22 @@
722
722
  });
723
723
  const RegularButton = JSX(({ className = '', href, rel, target, ariaLabel, version, rounded, onClick, type, data, children, text, }) => (jsx("a", { className: getRegularButtonClasses({ className, version, rounded }), href: href, rel: rel, target: target, "aria-label": ariaLabel || `Ссылка на ${text}`, role: href ? 'link' : 'button', onClick: onClick, type: type, ...getAspectsAttributes(data), children: children })));
724
724
  const DisabledButton = JSX(({ className, ariaLabel, version, rounded, children }) => (jsx("button", { type: "button", "aria-disabled": "true", "aria-label": ariaLabel, tabIndex: -1, className: getDisabledButtonClasses({ className, rounded, version }), children: children })));
725
- const getRandomHref = (href = '', additionalHrefs = []) => {
726
- const hrefs = [href, ...additionalHrefs];
727
- return hrefs[Math.floor(Math.random() * hrefs.length)];
725
+ const getRandomHref = (href = '', additionalHref = '', chance = 50) => {
726
+ const randomNumber = Math.random() * 100;
727
+ return randomNumber < chance ? additionalHref : href;
728
728
  };
729
729
  // Отсчитываем 7 длей с текущей даты
730
730
  const getTimeAfter7days = () => Date.now() + 7 * 24 * 60 * 60 * 1000;
731
731
  // Сохраняем или заменяем рандомную ссылку в localStorage
732
- const saveLinksToStore = ({ linksStore, id, href, additionalHrefs }) => {
732
+ const saveLinksToStore = ({ linksStore, id, href, additionalHref, chance }) => {
733
733
  const buttonLinkStore = (linksStore.links || []).find((store) => store.id === id);
734
734
  // Если хранилища вообще нет
735
735
  if (!linksStore.links) {
736
736
  linksStore.links = [];
737
737
  }
738
- if ((!buttonLinkStore || buttonLinkStore.nextDueAt <= Date.now()) && additionalHrefs) {
738
+ if ((!buttonLinkStore || buttonLinkStore.nextDueAt <= Date.now()) && additionalHref) {
739
739
  // Получаем рандомную ссылку
740
- const randomHref = getRandomHref(href, additionalHrefs);
740
+ const randomHref = getRandomHref(href, additionalHref, chance);
741
741
  // При наличии ссылки для этой кнопки в хранилище удаляем этот элемент из массива ссылок
742
742
  const updatedLinks = linksStore.links?.filter((item) => item.id !== id);
743
743
  // Добавляем новый элемент
@@ -2041,7 +2041,7 @@
2041
2041
  ? Date.now() - Number.parseInt(sessionStore.surveyTimerStart)
2042
2042
  : 0;
2043
2043
  const isShowSurvey = !isSurveySkipped &&
2044
- !isOtherLanguagePortal &&
2044
+ !isOtherLanguagePortal() &&
2045
2045
  (!userSurveyStore.userSurvey || userSurveyStore.userSurvey?.nextDueAt <= Date.now());
2046
2046
  const handleSkipSurvey = useCallback(() => {
2047
2047
  sessionStore.isSurveySkipped = true;
@@ -10526,13 +10526,25 @@
10526
10526
  'CREATE_APPLICATION_SHORT_SIGNAL',
10527
10527
  'CREATE_APPLICATION_LOAN_V3_SIGNAL',
10528
10528
  ];
10529
+ const MESSAGE_NAMES$1 = [
10530
+ 'CREATE_APPLICATION_SHORT_MESSAGE',
10531
+ // 'CREATE_APPLICATION_LOAN_MESSAGE',
10532
+ ];
10529
10533
  const CreditCardFormStatusTracker = JSX(() => {
10534
+ const isNewMicroservice = checkNewMicroservice();
10530
10535
  const [status, setStatus] = useState(STATUS_TYPE.process);
10531
10536
  const { taskId } = useRetailFormStore();
10532
10537
  useEffect(() => {
10533
10538
  (async () => {
10534
- for (const signalType of SIGNAL_TYPES$1) {
10535
- await sendSignalToProcess({ signalType, taskId });
10539
+ if (isNewMicroservice) {
10540
+ for (const messageName of MESSAGE_NAMES$1) {
10541
+ await sendMessage({ messageName, taskId });
10542
+ }
10543
+ }
10544
+ else {
10545
+ for (const signalType of SIGNAL_TYPES$1) {
10546
+ await sendSignalToProcess({ signalType, taskId });
10547
+ }
10536
10548
  }
10537
10549
  })();
10538
10550
  }, [taskId]);
@@ -10842,31 +10854,44 @@
10842
10854
  : {};
10843
10855
  };
10844
10856
 
10845
- const getCreditCardFormTaskData = ({ participantId, taskId, profileId, formData, step = 0, }) => ({
10846
- sendToBank: true,
10847
- taskKind: 'UNITED',
10848
- task: {
10849
- id: taskId,
10850
- ...getOfficeCode$1(formData),
10851
- authorizedAgentId: formData?.bankEmployeeCode,
10852
- participants: [
10853
- {
10854
- id: participantId,
10855
- profile: {
10856
- id: profileId,
10857
- },
10858
- roleCd: {
10859
- key: 'BORROWER',
10860
- value: 'Заемщик',
10861
- },
10862
- ...getCurrentStepData$2(step, formData),
10857
+ const getCreditCardFormTaskData = ({ participantId, taskId, profileId, formData, step = 0, }) => {
10858
+ const isNewMicroservice = checkNewMicroservice();
10859
+ const participantInfo = {
10860
+ id: participantId,
10861
+ ...(!isNewMicroservice && {
10862
+ profile: {
10863
+ id: profileId,
10863
10864
  },
10864
- ],
10865
- ...getCardOptionsData(formData),
10866
- ...getDeliveryData$1(formData),
10867
- files: formData?.files,
10868
- },
10869
- });
10865
+ }),
10866
+ roleCd: {
10867
+ key: 'BORROWER',
10868
+ value: 'Заемщик',
10869
+ },
10870
+ ...getCurrentStepData$2(step, formData),
10871
+ };
10872
+ return {
10873
+ sendToBank: true,
10874
+ taskKind: 'UNITED',
10875
+ task: {
10876
+ id: taskId,
10877
+ ...getOfficeCode$1(formData),
10878
+ authorizedAgentId: formData?.bankEmployeeCode,
10879
+ ...(isNewMicroservice
10880
+ ? {
10881
+ participant: participantInfo,
10882
+ }
10883
+ : {
10884
+ participants: [participantInfo],
10885
+ }),
10886
+ ...getCardOptionsData(formData),
10887
+ ...getDeliveryData$1(formData),
10888
+ esiaAccountTypeCd: {
10889
+ key: formData?.esiaAccountTypeCd?.key,
10890
+ },
10891
+ files: formData?.files,
10892
+ },
10893
+ };
10894
+ };
10870
10895
  const getCurrentStepData$2 = (step, formData) => {
10871
10896
  switch (step) {
10872
10897
  case 0:
@@ -10909,7 +10934,7 @@
10909
10934
  retailFormStore.leadForm = formData;
10910
10935
  try {
10911
10936
  const { taskId, profileId, participantId } = retailFormStore;
10912
- if (taskId && profileId && participantId) {
10937
+ if (taskId) {
10913
10938
  const response = await updateUserTask(getCreditCardFormTaskData({
10914
10939
  participantId,
10915
10940
  taskId,
@@ -14793,7 +14818,7 @@
14793
14818
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
14794
14819
  });
14795
14820
 
14796
- const packageVersion = "0.14.1055";
14821
+ const packageVersion = "0.14.1057";
14797
14822
 
14798
14823
  exports.Blocks = Blocks;
14799
14824
  exports.ContentPage = ContentPage;