@redneckz/wildless-cms-uni-blocks 0.14.1023 → 0.14.1024

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 (84) hide show
  1. package/bin/migration-scripts/0.14.1013.js +3 -1
  2. package/bundle/bundle.umd.js +21 -15
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
  5. package/bundle/ui-kit/UserSurveyDialog/Star.d.ts +4 -5
  6. package/dist/api/sendUserSurvey.js +1 -1
  7. package/dist/api/sendUserSurvey.js.map +1 -1
  8. package/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
  9. package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  10. package/dist/components/Header/HeaderQuickActionsMenu.js +1 -3
  11. package/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  12. package/dist/ui-kit/UserSurveyDialog/FirstStep.js +2 -2
  13. package/dist/ui-kit/UserSurveyDialog/FirstStep.js.map +1 -1
  14. package/dist/ui-kit/UserSurveyDialog/SecondStep.js +2 -2
  15. package/dist/ui-kit/UserSurveyDialog/SecondStep.js.map +1 -1
  16. package/dist/ui-kit/UserSurveyDialog/Star.d.ts +4 -5
  17. package/dist/ui-kit/UserSurveyDialog/Star.js +12 -4
  18. package/dist/ui-kit/UserSurveyDialog/Star.js.map +1 -1
  19. package/dist/ui-kit/UserSurveyDialog/useUserSurveyDialog.js +2 -2
  20. package/dist/ui-kit/UserSurveyDialog/useUserSurveyDialog.js.map +1 -1
  21. package/lib/api/sendUserSurvey.js +1 -1
  22. package/lib/api/sendUserSurvey.js.map +1 -1
  23. package/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
  24. package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  25. package/lib/components/Header/HeaderQuickActionsMenu.js +1 -3
  26. package/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  27. package/lib/ui-kit/UserSurveyDialog/FirstStep.js +2 -2
  28. package/lib/ui-kit/UserSurveyDialog/FirstStep.js.map +1 -1
  29. package/lib/ui-kit/UserSurveyDialog/SecondStep.js +2 -2
  30. package/lib/ui-kit/UserSurveyDialog/SecondStep.js.map +1 -1
  31. package/lib/ui-kit/UserSurveyDialog/Star.d.ts +4 -5
  32. package/lib/ui-kit/UserSurveyDialog/Star.js +12 -4
  33. package/lib/ui-kit/UserSurveyDialog/Star.js.map +1 -1
  34. package/lib/ui-kit/UserSurveyDialog/useUserSurveyDialog.js +2 -2
  35. package/lib/ui-kit/UserSurveyDialog/useUserSurveyDialog.js.map +1 -1
  36. package/mobile/bundle/bundle.umd.js +21 -15
  37. package/mobile/bundle/bundle.umd.min.js +1 -1
  38. package/mobile/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
  39. package/mobile/bundle/ui-kit/UserSurveyDialog/Star.d.ts +4 -5
  40. package/mobile/dist/api/sendUserSurvey.js +1 -1
  41. package/mobile/dist/api/sendUserSurvey.js.map +1 -1
  42. package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
  43. package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  44. package/mobile/dist/components/Header/HeaderQuickActionsMenu.js +1 -3
  45. package/mobile/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  46. package/mobile/dist/ui-kit/UserSurveyDialog/FirstStep.js +2 -2
  47. package/mobile/dist/ui-kit/UserSurveyDialog/FirstStep.js.map +1 -1
  48. package/mobile/dist/ui-kit/UserSurveyDialog/SecondStep.js +2 -2
  49. package/mobile/dist/ui-kit/UserSurveyDialog/SecondStep.js.map +1 -1
  50. package/mobile/dist/ui-kit/UserSurveyDialog/Star.d.ts +4 -5
  51. package/mobile/dist/ui-kit/UserSurveyDialog/Star.js +12 -4
  52. package/mobile/dist/ui-kit/UserSurveyDialog/Star.js.map +1 -1
  53. package/mobile/dist/ui-kit/UserSurveyDialog/useUserSurveyDialog.js +2 -2
  54. package/mobile/dist/ui-kit/UserSurveyDialog/useUserSurveyDialog.js.map +1 -1
  55. package/mobile/lib/api/sendUserSurvey.js +1 -1
  56. package/mobile/lib/api/sendUserSurvey.js.map +1 -1
  57. package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +7 -1
  58. package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  59. package/mobile/lib/components/Header/HeaderQuickActionsMenu.js +1 -3
  60. package/mobile/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -1
  61. package/mobile/lib/ui-kit/UserSurveyDialog/FirstStep.js +2 -2
  62. package/mobile/lib/ui-kit/UserSurveyDialog/FirstStep.js.map +1 -1
  63. package/mobile/lib/ui-kit/UserSurveyDialog/SecondStep.js +2 -2
  64. package/mobile/lib/ui-kit/UserSurveyDialog/SecondStep.js.map +1 -1
  65. package/mobile/lib/ui-kit/UserSurveyDialog/Star.d.ts +4 -5
  66. package/mobile/lib/ui-kit/UserSurveyDialog/Star.js +12 -4
  67. package/mobile/lib/ui-kit/UserSurveyDialog/Star.js.map +1 -1
  68. package/mobile/lib/ui-kit/UserSurveyDialog/useUserSurveyDialog.js +2 -2
  69. package/mobile/lib/ui-kit/UserSurveyDialog/useUserSurveyDialog.js.map +1 -1
  70. package/mobile/src/api/sendUserSurvey.ts +1 -1
  71. package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +8 -4
  72. package/mobile/src/components/Header/HeaderQuickActionsMenu.tsx +1 -3
  73. package/mobile/src/ui-kit/UserSurveyDialog/FirstStep.tsx +3 -4
  74. package/mobile/src/ui-kit/UserSurveyDialog/SecondStep.tsx +2 -2
  75. package/mobile/src/ui-kit/UserSurveyDialog/Star.tsx +33 -18
  76. package/mobile/src/ui-kit/UserSurveyDialog/useUserSurveyDialog.ts +2 -2
  77. package/package.json +1 -1
  78. package/src/api/sendUserSurvey.ts +1 -1
  79. package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +8 -4
  80. package/src/components/Header/HeaderQuickActionsMenu.tsx +1 -3
  81. package/src/ui-kit/UserSurveyDialog/FirstStep.tsx +3 -4
  82. package/src/ui-kit/UserSurveyDialog/SecondStep.tsx +2 -2
  83. package/src/ui-kit/UserSurveyDialog/Star.tsx +33 -18
  84. package/src/ui-kit/UserSurveyDialog/useUserSurveyDialog.ts +2 -2
@@ -1756,7 +1756,7 @@
1756
1756
  const sendUserSurvey = async (body) => {
1757
1757
  try {
1758
1758
  const response = await LeadServiceFetch(`${API_BASE_URI}/survey`, body);
1759
- return await response;
1759
+ return response;
1760
1760
  }
1761
1761
  catch (e) {
1762
1762
  return null;
@@ -1773,12 +1773,20 @@
1773
1773
 
1774
1774
  const SubmitButton$1 = JSX(({ isLoading, disabled, children, className, ...rest }) => (jsxs(Button, { type: "submit", className: style('relative', className), disabled: isLoading || disabled, ...rest, children: [isLoading ? jsx(Loader, { blur: true, size: "small" }) : null, children] })));
1775
1775
 
1776
- const Star = JSX(({ value, hover, rating, setHover, setRating }) => {
1777
- const fillColor = value <= (hover || rating) ? '#42AB44' : '#C9CACC';
1778
- return (jsx("div", { onClick: () => setRating?.(value), onMouseEnter: () => setHover?.(value), onMouseLeave: () => setHover?.(null), children: jsx("svg", { "data-rating": value, fill: fillColor, width: "57", height: "57", viewBox: "0 0 57 57", children: jsx("path", { d: "M47.7803 18.2879L47.7836 18.2884C50.566 18.7521 53.0867 20.1374 53.9176 22.7226C54.7498 25.3116 53.5025 27.9027 51.4977 29.8954L51.4942 29.8989L45.7132 35.6799C45.5729 35.8202 45.3591 36.1532 45.2186 36.6438C45.0796 37.1295 45.0808 37.5314 45.1257 37.7381L45.1268 37.743L46.78 44.8909C47.4787 47.9228 47.3175 51.2217 44.8924 52.9896C42.4714 54.7546 39.2808 53.9093 36.5999 52.3257L29.6214 48.1946C29.4392 48.0866 29.0426 47.96 28.5087 47.96C27.9816 47.96 27.5736 48.0831 27.3687 48.2004L27.3634 48.2035L20.4041 52.3232L20.4019 52.3246C17.7218 53.9145 14.5351 54.7459 12.1155 52.9803C9.69339 51.213 9.51826 47.9236 10.22 44.8909L11.8731 37.743L11.8743 37.7379C11.9191 37.5311 11.9203 37.1293 11.7813 36.6438C11.6409 36.1532 11.4271 35.8202 11.2867 35.6799L5.50006 29.8932C3.50738 27.9006 2.26429 25.3118 3.08972 22.7269C3.91586 20.1398 6.43161 18.7525 9.21638 18.2884L16.6527 17.0529L16.6552 17.0525C16.8169 17.0243 17.1619 16.8935 17.5523 16.604C17.945 16.3128 18.1668 16.022 18.2378 15.877L18.2462 15.8598L22.3508 7.65087L22.352 7.6485C23.629 5.08222 25.7146 3.01416 28.4796 3.01416C31.2412 3.01416 33.3328 5.07832 34.6215 7.64213L34.6236 7.64649L38.7303 15.8598L38.75 15.9001C38.7884 15.9807 38.8225 16.0591 38.8511 16.1283C38.9197 16.1891 39.0148 16.2702 39.1464 16.3781C39.1829 16.394 39.242 16.4185 39.3288 16.4505C39.5779 16.5424 39.9286 16.6512 40.3732 16.7719C41.2573 17.0121 42.3688 17.2611 43.4823 17.4894C44.5886 17.7163 45.6648 17.9163 46.4667 18.0598C46.8669 18.1315 47.1972 18.1888 47.4266 18.2281L47.6909 18.2729L47.7589 18.2843L47.7803 18.2879Z" }) }) }));
1779
- });
1776
+ const GREY_COLOR = '#C9CACC';
1777
+ const GREEN_COLOR = '#42AB44';
1778
+ const Star = JSX(({ value, hover, rating, setHover, setRating }) => (jsx("div", { onClick: () => value && setRating?.(value), onMouseEnter: () => value && setHover?.(value), onMouseLeave: () => setHover?.(null), children: jsx("svg", { "data-rating": value, fill: getColor({ value, hover, rating }), width: "57", height: "57", viewBox: "0 0 57 57", children: jsx("path", { d: "M47.7803 18.2879L47.7836 18.2884C50.566 18.7521 53.0867 20.1374 53.9176 22.7226C54.7498 25.3116 53.5025 27.9027 51.4977 29.8954L51.4942 29.8989L45.7132 35.6799C45.5729 35.8202 45.3591 36.1532 45.2186 36.6438C45.0796 37.1295 45.0808 37.5314 45.1257 37.7381L45.1268 37.743L46.78 44.8909C47.4787 47.9228 47.3175 51.2217 44.8924 52.9896C42.4714 54.7546 39.2808 53.9093 36.5999 52.3257L29.6214 48.1946C29.4392 48.0866 29.0426 47.96 28.5087 47.96C27.9816 47.96 27.5736 48.0831 27.3687 48.2004L27.3634 48.2035L20.4041 52.3232L20.4019 52.3246C17.7218 53.9145 14.5351 54.7459 12.1155 52.9803C9.69339 51.213 9.51826 47.9236 10.22 44.8909L11.8731 37.743L11.8743 37.7379C11.9191 37.5311 11.9203 37.1293 11.7813 36.6438C11.6409 36.1532 11.4271 35.8202 11.2867 35.6799L5.50006 29.8932C3.50738 27.9006 2.26429 25.3118 3.08972 22.7269C3.91586 20.1398 6.43161 18.7525 9.21638 18.2884L16.6527 17.0529L16.6552 17.0525C16.8169 17.0243 17.1619 16.8935 17.5523 16.604C17.945 16.3128 18.1668 16.022 18.2378 15.877L18.2462 15.8598L22.3508 7.65087L22.352 7.6485C23.629 5.08222 25.7146 3.01416 28.4796 3.01416C31.2412 3.01416 33.3328 5.07832 34.6215 7.64213L34.6236 7.64649L38.7303 15.8598L38.75 15.9001C38.7884 15.9807 38.8225 16.0591 38.8511 16.1283C38.9197 16.1891 39.0148 16.2702 39.1464 16.3781C39.1829 16.394 39.242 16.4185 39.3288 16.4505C39.5779 16.5424 39.9286 16.6512 40.3732 16.7719C41.2573 17.0121 42.3688 17.2611 43.4823 17.4894C44.5886 17.7163 45.6648 17.9163 46.4667 18.0598C46.8669 18.1315 47.1972 18.1888 47.4266 18.2281L47.6909 18.2729L47.7589 18.2843L47.7803 18.2879Z" }) }) })));
1779
+ const getColor = ({ value, hover, rating }) => {
1780
+ if (value && hover) {
1781
+ return value <= hover ? GREEN_COLOR : GREY_COLOR;
1782
+ }
1783
+ if (value && rating) {
1784
+ return value <= rating ? GREEN_COLOR : GREY_COLOR;
1785
+ }
1786
+ return GREY_COLOR;
1787
+ };
1780
1788
 
1781
- const stars$1 = new Array(5).fill(Star);
1789
+ const stars$1 = Array.from('12345', () => Star);
1782
1790
  const TITLE$1 = {
1783
1791
  NPS: 'Оцените, пожалуйста, от 1 до 5,\nнасколько вероятно, что вы порекомендуете Россельхозбанк коллегам, друзьям и знакомым?',
1784
1792
  CSI: 'Оцените, пожалуйста, удовлетворённость пользования сайтом',
@@ -1791,7 +1799,7 @@
1791
1799
  onNextStep();
1792
1800
  }
1793
1801
  };
1794
- return (jsxs("div", { className: "flex flex-col gap-xl items-center", children: [jsx(Heading, { className: "text-center whitespace-pre-line", headingType: "h5", title: TITLE$1[surveyType] }), jsx("div", { className: "flex justify-center", children: stars$1.map((StarItem, index) => (jsx(StarItem, { value: index + 1, rating: currentRating, hover: currentHover, setRating: setRatingFn, setHover: setCurrentHover, className: "modal-feedback__star" }, index))) }), currentRating === 5 ? (jsx(SubmitButton$1, { onClick: () => onSubmit(), isLoading: isSending, children: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C" })) : null] }));
1802
+ return (jsxs("div", { className: "flex flex-col gap-xl items-center", children: [jsx(Heading, { className: "text-center whitespace-pre-line", headingType: "h5", title: TITLE$1[surveyType] }), jsx("div", { className: "flex justify-center", children: stars$1.map((StarItem, index) => (jsx(StarItem, { value: index + 1, rating: currentRating, hover: currentHover, setRating: setRatingFn, setHover: setCurrentHover }, index.toString()))) }), currentRating === 5 ? (jsx(SubmitButton$1, { onClick: () => onSubmit(), isLoading: isSending, children: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C" })) : null] }));
1795
1803
  });
1796
1804
 
1797
1805
  const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
@@ -1908,7 +1916,7 @@
1908
1916
  return jsx(InputWrapper, { isOpen: isOpen, onOpen: open, onClose: close, ...props });
1909
1917
  });
1910
1918
 
1911
- const stars = new Array(5).fill(Star);
1919
+ const stars = Array.from('12345', () => Star);
1912
1920
  const TITLE = 'Что бы мы могли улучшить?';
1913
1921
  const SecondStep = JSX(({ currentRating, currentReason, reasons = [], isSending, setCurrentReason, onSubmit }) => {
1914
1922
  const [comment, setComment] = useState();
@@ -1918,7 +1926,7 @@
1918
1926
  text,
1919
1927
  });
1920
1928
  };
1921
- return (jsxs("div", { className: "flex flex-col gap-xl items-center", children: [jsx(Heading, { className: "text-center", headingType: "h5", title: TITLE }), jsx("div", { className: "flex justify-center", children: stars.map((StarItem, index) => (jsx(StarItem, { value: index + 1, rating: currentRating }, index))) }), jsx(RadioButtonGroup, { className: "w-full text-wrap", orientation: "vertical", items: reasons, value: currentReason?.id, onChange: handleReasonChange }), currentReason?.text === 'Другое' ? (jsx(InputControl, { className: "w-full", placeholder: "\u041D\u0430\u043F\u0438\u0448\u0438\u0442\u0435, \u043F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0441\u0432\u043E\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442 \u043E\u0442\u0432\u0435\u0442\u0430", isTextarea: true, value: comment, onChange: setComment, maxLength: 255 })) : null, currentReason ? (jsx(SubmitButton$1, { onClick: () => onSubmit(comment), isLoading: isSending, children: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C" })) : null] }));
1929
+ return (jsxs("div", { className: "flex flex-col gap-xl items-center", children: [jsx(Heading, { className: "text-center", headingType: "h5", title: TITLE }), jsx("div", { className: "flex justify-center", children: stars.map((StarItem, index) => (jsx(StarItem, { value: index + 1, rating: currentRating }, index.toString()))) }), jsx(RadioButtonGroup, { className: "w-full text-wrap", orientation: "vertical", items: reasons, value: currentReason?.id, onChange: handleReasonChange }), currentReason?.text === 'Другое' ? (jsx(InputControl, { className: "w-full", placeholder: "\u041D\u0430\u043F\u0438\u0448\u0438\u0442\u0435, \u043F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0441\u0432\u043E\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442 \u043E\u0442\u0432\u0435\u0442\u0430", isTextarea: true, value: comment, onChange: setComment, maxLength: 255 })) : null, currentReason ? (jsx(SubmitButton$1, { onClick: () => onSubmit(comment), isLoading: isSending, children: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C" })) : null] }));
1922
1930
  });
1923
1931
 
1924
1932
  const STEPS$3 = [FirstStep, SecondStep, FinalStep];
@@ -1973,7 +1981,7 @@
1973
1981
 
1974
1982
  const DELAY = 5 * 60 * 1000;
1975
1983
  // Хук отвечает за показ пользователю опроса
1976
- const useUserSurveyDialog = (withoutTimer) => {
1984
+ const useUserSurveyDialog = (withoutTimer = false) => {
1977
1985
  const userSurveyDialog = useDialog(UserSurveyDialog);
1978
1986
  const userSurveyStore = useLocalStore();
1979
1987
  const sessionStore = useSessionStore();
@@ -1987,7 +1995,7 @@
1987
1995
  const handleCloseSurvey = useCallback(() => {
1988
1996
  sessionStore.isSurveySkipped = true;
1989
1997
  }, []);
1990
- const openUserSurveyDialog = useCallback((isAfterTargetAction) => {
1998
+ const openUserSurveyDialog = useCallback((isAfterTargetAction = false) => {
1991
1999
  userSurveyDialog.open({
1992
2000
  reasonsSource: {
1993
2001
  $ref: '/wcms-resources/user-survey-reasons.json',
@@ -12986,9 +12994,7 @@
12986
12994
  const handleChatClick = useCallback((ev) => {
12987
12995
  const openChatBot = aspects[CHAT_BOT_ASPECT_NAME];
12988
12996
  if (openChatBot && ev) {
12989
- if (openChatBot) {
12990
- openChatBot(ev).finally();
12991
- }
12997
+ openChatBot(ev).finally();
12992
12998
  }
12993
12999
  }, []);
12994
13000
  return {
@@ -14134,7 +14140,7 @@
14134
14140
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
14135
14141
  });
14136
14142
 
14137
- const packageVersion = "0.14.1022";
14143
+ const packageVersion = "0.14.1023";
14138
14144
 
14139
14145
  exports.Blocks = Blocks;
14140
14146
  exports.ContentPage = ContentPage;