@redneckz/wildless-cms-uni-blocks 0.14.1083 → 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 (32) hide show
  1. package/bundle/bundle.umd.js +15 -4
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
  4. package/dist/components/Header/HeaderQuickActionsMenu.js +11 -1
  5. package/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  6. package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
  7. package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +4 -2
  8. package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
  9. package/lib/components/Header/HeaderQuickActionsMenu.js +11 -1
  10. package/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  11. package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
  12. package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +4 -2
  13. package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
  14. package/mobile/bundle/bundle.umd.js +15 -4
  15. package/mobile/bundle/bundle.umd.min.js +1 -1
  16. package/mobile/bundle/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
  17. package/mobile/dist/components/Header/HeaderQuickActionsMenu.js +11 -1
  18. package/mobile/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  19. package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
  20. package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +4 -2
  21. package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
  22. package/mobile/lib/components/Header/HeaderQuickActionsMenu.js +11 -1
  23. package/mobile/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  24. package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
  25. package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +4 -2
  26. package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
  27. package/mobile/src/components/Header/HeaderQuickActionsMenu.tsx +13 -1
  28. package/mobile/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +7 -2
  29. package/package.json +1 -1
  30. package/src/components/Header/HeaderQuickActionsMenu.tsx +13 -1
  31. package/src/icons/IconName.ts +4 -4
  32. 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));
@@ -13871,6 +13873,7 @@
13871
13873
  const transformQuickActions = (items) => items.map((item) => ({ text: item }));
13872
13874
  const useHandlers = () => {
13873
13875
  const phoneCallRequestDialog = useDialog(PhoneCallRequestDialog);
13876
+ const responseTypeDialog = useDialog(ResponseTypeDialog);
13874
13877
  const handleCallClick = useCallback(() => {
13875
13878
  phoneCallRequestDialog.open({ onClose: () => phoneCallRequestDialog.close() });
13876
13879
  }, []);
@@ -13878,7 +13881,15 @@
13878
13881
  const handleChatClick = useCallback((ev) => {
13879
13882
  const openChatBot = aspects[CHAT_BOT_ASPECT_NAME];
13880
13883
  if (openChatBot && ev) {
13881
- openChatBot(ev).finally();
13884
+ openChatBot(ev)
13885
+ .catch(() => {
13886
+ responseTypeDialog.open({
13887
+ onClose: () => responseTypeDialog.close(),
13888
+ errorMessage: 'Пожалуйста, попробуйте позднее',
13889
+ errorTitle: 'Ошибка загрузки чата',
13890
+ });
13891
+ })
13892
+ .finally();
13882
13893
  }
13883
13894
  }, []);
13884
13895
  const handlePhoneClick = useCallback(() => {
@@ -15148,7 +15159,7 @@
15148
15159
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
15149
15160
  });
15150
15161
 
15151
- const packageVersion = "0.14.1082";
15162
+ const packageVersion = "0.14.1083";
15152
15163
 
15153
15164
  exports.Blocks = Blocks;
15154
15165
  exports.ContentPage = ContentPage;