@redneckz/wildless-cms-uni-blocks 0.14.1070 → 0.14.1072

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 (49) hide show
  1. package/bundle/bundle.umd.js +47 -24
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/Header/HeaderQuickActionsMenu.d.ts +1 -0
  4. package/bundle/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
  5. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +34 -22
  6. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  7. package/dist/components/Header/HeaderQuickActionsMenu.d.ts +1 -0
  8. package/dist/components/Header/HeaderQuickActionsMenu.js +11 -0
  9. package/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  10. package/dist/retail/api/createParticipant.js +1 -1
  11. package/dist/retail/api/createParticipant.js.map +1 -1
  12. package/dist/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
  13. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +34 -22
  14. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  15. package/lib/components/Header/HeaderQuickActionsMenu.d.ts +1 -0
  16. package/lib/components/Header/HeaderQuickActionsMenu.js +11 -0
  17. package/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  18. package/lib/retail/api/createParticipant.js +1 -1
  19. package/lib/retail/api/createParticipant.js.map +1 -1
  20. package/lib/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
  21. package/mobile/bundle/bundle.umd.js +47 -24
  22. package/mobile/bundle/bundle.umd.min.js +1 -1
  23. package/mobile/bundle/components/Header/HeaderQuickActionsMenu.d.ts +1 -0
  24. package/mobile/bundle/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
  25. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +34 -22
  26. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  27. package/mobile/dist/components/Header/HeaderQuickActionsMenu.d.ts +1 -0
  28. package/mobile/dist/components/Header/HeaderQuickActionsMenu.js +11 -0
  29. package/mobile/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  30. package/mobile/dist/retail/api/createParticipant.js +1 -1
  31. package/mobile/dist/retail/api/createParticipant.js.map +1 -1
  32. package/mobile/dist/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
  33. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +34 -22
  34. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  35. package/mobile/lib/components/Header/HeaderQuickActionsMenu.d.ts +1 -0
  36. package/mobile/lib/components/Header/HeaderQuickActionsMenu.js +11 -0
  37. package/mobile/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  38. package/mobile/lib/retail/api/createParticipant.js +1 -1
  39. package/mobile/lib/retail/api/createParticipant.js.map +1 -1
  40. package/mobile/lib/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
  41. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +47 -28
  42. package/mobile/src/components/Header/HeaderQuickActionsMenu.tsx +12 -0
  43. package/mobile/src/retail/api/createParticipant.ts +1 -1
  44. package/mobile/src/retail/model/ApplicationLeadFormTypes.ts +1 -1
  45. package/package.json +1 -1
  46. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +47 -28
  47. package/src/components/Header/HeaderQuickActionsMenu.tsx +12 -0
  48. package/src/retail/api/createParticipant.ts +1 -1
  49. package/src/retail/model/ApplicationLeadFormTypes.ts +1 -1
@@ -6897,7 +6897,7 @@
6897
6897
  return res || {};
6898
6898
  };
6899
6899
 
6900
- const createParticipant = (body) => fetchRetailJSON('/external/public-data/createParticipant', 'POST', body).then((res) => res || null);
6900
+ const createParticipant = (body) => fetchRetailJSON('/internal/entities/createParticipant', 'POST', body).then((res) => res || null);
6901
6901
 
6902
6902
  const createUserProfile = (body) => fetchRetailJSON('/public-data/createUserProfile', 'POST', body).then((res) => res?.profile?.id || null);
6903
6903
 
@@ -7837,43 +7837,26 @@
7837
7837
  try {
7838
7838
  startSending();
7839
7839
  const transformedFormData = transformFormData(formData);
7840
- const participantData = await createParticipant({
7841
- phone: formatPhone(transformedFormData.phone),
7842
- email: transformedFormData.email,
7843
- });
7844
7840
  const referalData = leadFormStore.referalData;
7845
7841
  const marketingInfo = sessionStore.marketingInfo;
7846
- if (!participantData) {
7847
- throw new Error();
7848
- }
7849
- const { participantId, userId } = participantData;
7850
- if (!participantId) {
7851
- throw new Error();
7852
- }
7853
7842
  const common = {
7854
7843
  programId,
7855
- userId,
7856
7844
  productType,
7857
7845
  sendAspects,
7858
7846
  verifyPhoneDialog,
7859
7847
  handleFailSendForm,
7860
7848
  };
7861
7849
  const taskData = {
7862
- participantId,
7863
7850
  formData: transformedFormData,
7864
7851
  referalData,
7865
7852
  marketingInfo,
7866
7853
  saveUserData,
7867
7854
  };
7868
- const sendCurrentTask = createSendCurrentTaskNew({
7869
- common,
7870
- taskData,
7871
- consentBkiDialog,
7872
- });
7873
7855
  const handleSuccessVerify = createHandleSuccessVerifyNew({
7874
7856
  common,
7857
+ taskData,
7875
7858
  draftDialog,
7876
- sendCurrentTask,
7859
+ consentBkiDialog,
7877
7860
  });
7878
7861
  const acceptedConsents = getAcceptedConsents(transformedFormData, productType);
7879
7862
  verifyPhoneDialog.open({
@@ -7898,6 +7881,9 @@
7898
7881
  const createSendCurrentTaskNew = ({ common, taskData, consentBkiDialog, }) => async () => {
7899
7882
  const { programId, userId, productType, sendAspects, verifyPhoneDialog, handleFailSendForm } = common;
7900
7883
  const { participantId, formData, referalData, marketingInfo, saveUserData } = taskData;
7884
+ if (!participantId) {
7885
+ throw new Error();
7886
+ }
7901
7887
  const taskId = await updateUserDataNewMicroservice({
7902
7888
  programId,
7903
7889
  participantId,
@@ -7917,9 +7903,34 @@
7917
7903
  onFail: handleFailSendForm,
7918
7904
  });
7919
7905
  };
7920
- const createHandleSuccessVerifyNew = ({ common, draftDialog, sendCurrentTask, }) => async () => {
7921
- const { verifyPhoneDialog, sendAspects, handleFailSendForm, userId, programId, productType } = common;
7906
+ const createHandleSuccessVerifyNew = ({ common, taskData, draftDialog, consentBkiDialog, }) => async () => {
7907
+ const { programId, productType, sendAspects, verifyPhoneDialog, handleFailSendForm } = common;
7908
+ const { formData } = taskData;
7922
7909
  try {
7910
+ const participantData = await createParticipant({
7911
+ phone: formatPhone(formData.phone),
7912
+ email: formData.email,
7913
+ });
7914
+ if (!participantData) {
7915
+ throw new Error();
7916
+ }
7917
+ const { participantId, userId } = participantData;
7918
+ if (!participantId) {
7919
+ throw new Error();
7920
+ }
7921
+ const updatedCommon = {
7922
+ ...common,
7923
+ userId,
7924
+ };
7925
+ const updatedTaskData = {
7926
+ ...taskData,
7927
+ participantId,
7928
+ };
7929
+ const sendCurrentTask = createSendCurrentTaskNew({
7930
+ common: updatedCommon,
7931
+ taskData: updatedTaskData,
7932
+ consentBkiDialog,
7933
+ });
7923
7934
  const lastTaskId = await getLastTaskStatus({ userId, programId });
7924
7935
  if (lastTaskId) {
7925
7936
  const task = await getTaskById({ taskId: lastTaskId });
@@ -7936,7 +7947,8 @@
7936
7947
  await sendCurrentTask();
7937
7948
  }
7938
7949
  }
7939
- catch {
7950
+ catch (error) {
7951
+ console.error('Error in handleSuccessVerify:', error);
7940
7952
  handleFailSendForm();
7941
7953
  }
7942
7954
  };
@@ -13945,6 +13957,13 @@
13945
13957
  },
13946
13958
  text: 'Написать в чат',
13947
13959
  },
13960
+ phone: {
13961
+ handler: (ev) => {
13962
+ handlers?.phone(ev);
13963
+ closeDropdown();
13964
+ },
13965
+ text: 'Позвонить в Банк',
13966
+ },
13948
13967
  };
13949
13968
  return (jsx("button", { className: style('text-l font-light pb-m hover:text-primary-main text-left'), role: "link", onClick: quickActionsMapping[item?.text ?? ''].handler, children: quickActionsMapping[item?.text ?? ''].text }, item?.text ?? ''));
13950
13969
  };
@@ -13961,9 +13980,13 @@
13961
13980
  openChatBot(ev).finally();
13962
13981
  }
13963
13982
  }, []);
13983
+ const handlePhoneClick = useCallback(() => {
13984
+ globalThis.location.href = 'tel:88001007870';
13985
+ }, []);
13964
13986
  return {
13965
13987
  call: handleCallClick,
13966
13988
  chat: handleChatClick,
13989
+ phone: handlePhoneClick,
13967
13990
  };
13968
13991
  };
13969
13992
 
@@ -15018,7 +15041,7 @@
15018
15041
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
15019
15042
  });
15020
15043
 
15021
- const packageVersion = "0.14.1069";
15044
+ const packageVersion = "0.14.1071";
15022
15045
 
15023
15046
  exports.Blocks = Blocks;
15024
15047
  exports.ContentPage = ContentPage;