@redneckz/wildless-cms-uni-blocks 0.14.1082 → 0.14.1084

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 (42) hide show
  1. package/bundle/bundle.umd.js +17 -16
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
  4. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +2 -14
  5. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  6. package/dist/components/Header/HeaderQuickActionsMenu.js +11 -1
  7. package/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  8. package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
  9. package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +4 -2
  10. package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
  11. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +2 -14
  12. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  13. package/lib/components/Header/HeaderQuickActionsMenu.js +11 -1
  14. package/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  15. package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
  16. package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +4 -2
  17. package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
  18. package/mobile/bundle/bundle.umd.js +17 -16
  19. package/mobile/bundle/bundle.umd.min.js +1 -1
  20. package/mobile/bundle/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
  21. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +2 -14
  22. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  23. package/mobile/dist/components/Header/HeaderQuickActionsMenu.js +11 -1
  24. package/mobile/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  25. package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
  26. package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +4 -2
  27. package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
  28. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +2 -14
  29. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  30. package/mobile/lib/components/Header/HeaderQuickActionsMenu.js +11 -1
  31. package/mobile/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  32. package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
  33. package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +4 -2
  34. package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
  35. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +2 -21
  36. package/mobile/src/components/Header/HeaderQuickActionsMenu.tsx +13 -1
  37. package/mobile/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +7 -2
  38. package/package.json +1 -1
  39. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +2 -21
  40. package/src/components/Header/HeaderQuickActionsMenu.tsx +13 -1
  41. package/src/icons/IconName.ts +4 -4
  42. package/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +7 -2
@@ -1548,16 +1548,18 @@
1548
1548
  return (jsxs("div", { className: style('bg-white p-lg pb-6xl my-6xl rounded-lg w-full', DIALOG_STYLE[maxWidth], DIALOG_POSITION[position], { 'mr-3xl': !isMobileMode && position === 'corner' }, { 'mb-12': isMobileMode }), role: "dialog", title: "\u0414\u0438\u0430\u043B\u043E\u0433", onClick: onClick, children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0 z-10", onClose: onClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container", children: children })] }));
1549
1549
  });
1550
1550
 
1551
- const ResponseTypeDialog = JSX(({ ok, typeForm, onClose, errorMessage }) => {
1551
+ const ResponseTypeDialog = JSX(({ ok, typeForm, onClose, errorMessage, errorTitle }) => {
1552
1552
  const statusIcon = ok ? 'ResponseOKIcon' : 'ResponseFailIcon';
1553
+ const responseTitle = errorTitle ?? getDefaultTitle(ok);
1553
1554
  const responseOKDescription = typeForm === 'ANTIFRAUD'
1554
1555
  ? `Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы
1555
1556
  можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка
1556
1557
  не звонят с использованием мессенджеров.`
1557
1558
  : 'Совсем скоро мы с вами свяжемся';
1558
1559
  const responseFailDescription = errorMessage || 'Пожалуйста, повторите позднее';
1559
- return (jsx(Dialog, { maxWidth: "lg", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md space-x-m", children: [jsx(Img, { image: { icon: statusIcon, iconVersion: 'normal' }, width: "136", height: "136" }), jsx(Headline, { className: "w-full", title: ok ? 'Ваша заявка отправлена' : 'Не удалось отправить заявку', description: ok ? responseOKDescription : responseFailDescription, headlineVersion: "XS", isEmbedded: true }), jsx(Button, { type: "button", onClick: onClose, children: "\u0425\u043E\u0440\u043E\u0448\u043E" })] }) }));
1560
+ return (jsx(Dialog, { maxWidth: "lg", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md space-x-m", children: [jsx(Img, { image: { icon: statusIcon, iconVersion: 'normal' }, width: "136", height: "136" }), jsx(Headline, { className: "w-full", title: responseTitle, description: ok ? responseOKDescription : responseFailDescription, headlineVersion: "XS", isEmbedded: true }), jsx(Button, { type: "button", onClick: onClose, children: "\u0425\u043E\u0440\u043E\u0448\u043E" })] }) }));
1560
1561
  });
1562
+ const getDefaultTitle = (ok = false) => ok ? 'Ваша заявка отправлена' : 'Не удалось отправить заявку';
1561
1563
 
1562
1564
  const sessionStore = new Store(); // sessionStorage cache
1563
1565
  replicate(sessionStore, new StorageAdapter(globalThis?.sessionStorage));
@@ -8018,13 +8020,8 @@
8018
8020
  });
8019
8021
  };
8020
8022
  const createHandleSuccessVerifyNew = ({ common, taskData, draftDialog, consentBkiDialog, }) => async () => {
8021
- const { verifyPhoneDialog, sendAspects, handleFailSendForm, programId, productType, aspects } = common;
8023
+ const { verifyPhoneDialog, sendAspects, handleFailSendForm, programId, productType } = common;
8022
8024
  const { formData } = taskData;
8023
- handleAspects({
8024
- aspectsAttributes: getAspects('leadForm', productType),
8025
- aspects,
8026
- ev: {},
8027
- });
8028
8025
  try {
8029
8026
  const participantData = await createParticipant({
8030
8027
  phone: formatPhone(formData.phone),
@@ -8100,13 +8097,8 @@
8100
8097
  };
8101
8098
  const createHandleSuccessVerifyOld = (props, sendCurrentTask) => async () => {
8102
8099
  const { common, draftDialog } = props;
8103
- const { aspects, programId, sendAspects, verifyPhoneDialog, handleFailSendForm, profileId } = common;
8100
+ const { programId, sendAspects, verifyPhoneDialog, handleFailSendForm, profileId } = common;
8104
8101
  const productType = common.productType;
8105
- handleAspects({
8106
- aspectsAttributes: getAspects('leadForm', productType),
8107
- aspects,
8108
- ev: {},
8109
- });
8110
8102
  try {
8111
8103
  const lastTaskId = await getLastTaskStatus({ profileId, programId });
8112
8104
  if (lastTaskId) {
@@ -13881,6 +13873,7 @@
13881
13873
  const transformQuickActions = (items) => items.map((item) => ({ text: item }));
13882
13874
  const useHandlers = () => {
13883
13875
  const phoneCallRequestDialog = useDialog(PhoneCallRequestDialog);
13876
+ const responseTypeDialog = useDialog(ResponseTypeDialog);
13884
13877
  const handleCallClick = useCallback(() => {
13885
13878
  phoneCallRequestDialog.open({ onClose: () => phoneCallRequestDialog.close() });
13886
13879
  }, []);
@@ -13888,7 +13881,15 @@
13888
13881
  const handleChatClick = useCallback((ev) => {
13889
13882
  const openChatBot = aspects[CHAT_BOT_ASPECT_NAME];
13890
13883
  if (openChatBot && ev) {
13891
- openChatBot(ev).finally();
13884
+ openChatBot(ev)
13885
+ .catch(() => {
13886
+ responseTypeDialog.open({
13887
+ onClose: () => responseTypeDialog.close(),
13888
+ errorMessage: 'Пожалуйста, попробуйте позднее',
13889
+ errorTitle: 'Ошибка загрузки чата',
13890
+ });
13891
+ })
13892
+ .finally();
13892
13893
  }
13893
13894
  }, []);
13894
13895
  const handlePhoneClick = useCallback(() => {
@@ -15158,7 +15159,7 @@
15158
15159
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
15159
15160
  });
15160
15161
 
15161
- const packageVersion = "0.14.1081";
15162
+ const packageVersion = "0.14.1083";
15162
15163
 
15163
15164
  exports.Blocks = Blocks;
15164
15165
  exports.ContentPage = ContentPage;