@redneckz/wildless-cms-uni-blocks 0.14.772 → 0.14.774

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 (51) hide show
  1. package/bundle/bundle.umd.js +16 -6
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/hooks/useExternalNS.d.ts +2 -1
  4. package/dist/components/CalculatorCredit/CalculatorCredit.js +1 -1
  5. package/dist/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
  6. package/dist/components/CalculatorRefinancing/CalculatorRefinancing.js +4 -1
  7. package/dist/components/CalculatorRefinancing/CalculatorRefinancing.js.map +1 -1
  8. package/dist/components/Header/useChatBot.js +2 -2
  9. package/dist/components/Header/useChatBot.js.map +1 -1
  10. package/dist/hooks/useExternalNS.d.ts +2 -1
  11. package/dist/hooks/useExternalNS.js +12 -2
  12. package/dist/hooks/useExternalNS.js.map +1 -1
  13. package/lib/components/CalculatorCredit/CalculatorCredit.js +1 -1
  14. package/lib/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
  15. package/lib/components/CalculatorRefinancing/CalculatorRefinancing.js +4 -1
  16. package/lib/components/CalculatorRefinancing/CalculatorRefinancing.js.map +1 -1
  17. package/lib/components/Header/useChatBot.js +3 -3
  18. package/lib/components/Header/useChatBot.js.map +1 -1
  19. package/lib/hooks/useExternalNS.d.ts +2 -1
  20. package/lib/hooks/useExternalNS.js +10 -1
  21. package/lib/hooks/useExternalNS.js.map +1 -1
  22. package/mobile/bundle/bundle.umd.js +8 -4
  23. package/mobile/bundle/bundle.umd.min.js +1 -1
  24. package/mobile/bundle/hooks/useExternalNS.d.ts +2 -1
  25. package/mobile/dist/components/CalculatorCredit/CalculatorCredit.js +1 -1
  26. package/mobile/dist/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
  27. package/mobile/dist/components/CalculatorRefinancing/CalculatorRefinancing.js +4 -1
  28. package/mobile/dist/components/CalculatorRefinancing/CalculatorRefinancing.js.map +1 -1
  29. package/mobile/dist/components/Header/useChatBot.js +2 -2
  30. package/mobile/dist/components/Header/useChatBot.js.map +1 -1
  31. package/mobile/dist/hooks/useExternalNS.d.ts +2 -1
  32. package/mobile/dist/hooks/useExternalNS.js +12 -2
  33. package/mobile/dist/hooks/useExternalNS.js.map +1 -1
  34. package/mobile/lib/components/CalculatorCredit/CalculatorCredit.js +1 -1
  35. package/mobile/lib/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
  36. package/mobile/lib/components/CalculatorRefinancing/CalculatorRefinancing.js +4 -1
  37. package/mobile/lib/components/CalculatorRefinancing/CalculatorRefinancing.js.map +1 -1
  38. package/mobile/lib/components/Header/useChatBot.js +3 -3
  39. package/mobile/lib/components/Header/useChatBot.js.map +1 -1
  40. package/mobile/lib/hooks/useExternalNS.d.ts +2 -1
  41. package/mobile/lib/hooks/useExternalNS.js +10 -1
  42. package/mobile/lib/hooks/useExternalNS.js.map +1 -1
  43. package/mobile/src/components/CalculatorCredit/CalculatorCredit.tsx +3 -2
  44. package/mobile/src/components/CalculatorRefinancing/CalculatorRefinancing.tsx +9 -6
  45. package/mobile/src/components/Header/useChatBot.ts +3 -2
  46. package/mobile/src/hooks/useExternalNS.ts +12 -1
  47. package/package.json +1 -1
  48. package/src/components/CalculatorCredit/CalculatorCredit.tsx +3 -2
  49. package/src/components/CalculatorRefinancing/CalculatorRefinancing.tsx +9 -6
  50. package/src/components/Header/useChatBot.ts +3 -2
  51. package/src/hooks/useExternalNS.ts +12 -1
@@ -3390,7 +3390,7 @@
3390
3390
  max: calcParams.maxMonths,
3391
3391
  ...field('monthsValue'),
3392
3392
  value: calcParams.monthsValue,
3393
- }), renderCreditParamsForm$1({ ...calcParams, ...paramsViewSettings }, field), jsx("div", { className: "sm:hidden", children: paymentTypeElement })] }), jsxs("div", { className: style(CalculatorStyle.result, '@4xl:w-1/2'), children: [jsx(CalculatorValue, { title: "\u041F\u043E\u043B\u043D\u0430\u044F \u0441\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C \u043A\u0440\u0435\u0434\u0438\u0442\u0430", value: calcSource?.totalLoanCost }), jsx(CalculatorValue, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", value: calcParams?.rate, fractionDigits: 2, postfix: "%" }), jsx(CalculatorValue, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436", value: calcParams.monthlyPayment, postfix: "\u20BD" }), jsx("div", { className: "hidden sm:block mb-lg", children: paymentTypeElement }), renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }) }));
3393
+ }), renderCreditParamsForm$1({ ...calcParams, ...paramsViewSettings }, field), jsx("div", { className: "sm:hidden", children: paymentTypeElement })] }), jsxs("div", { className: style(CalculatorStyle.result, '@4xl:w-1/2'), children: [jsx(CalculatorValue, { title: "\u041F\u043E\u043B\u043D\u0430\u044F \u0441\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C \u043A\u0440\u0435\u0434\u0438\u0442\u0430", value: calcSource?.totalLoanCost }), jsx(CalculatorValue, { title: "\u0421\u0442\u0430\u0432\u043A\u0430 \u043E\u0442", value: defaultParamsCals?.rate, fractionDigits: 2, postfix: "%" }), jsx(CalculatorValue, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436", value: calcParams.monthlyPayment, postfix: "\u20BD" }), jsx("div", { className: "hidden sm:block mb-lg", children: paymentTypeElement }), renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }) }));
3394
3394
  });
3395
3395
  const renderCreditParamsForm$1 = (params, field) => (jsxs("div", { className: "flex flex-col gap-y-2xl", children: [params.isShowSalaryClient ? (jsx(Checkbox, { text: `Получаю зарплату на счёт\nв Россельхозбанке`, ...field('isSalaryClient'), value: params.isSalaryClient, className: "whitespace-pre-line sm:whitespace-normal" })) : null, params.isShowStateEmployee ? (jsx(Checkbox, { text: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E \u0432 \u0431\u044E\u0434\u0436\u0435\u0442\u043D\u043E\u0439 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('isStateEmployee'), value: params.isStateEmployee })) : null, params.isShowPensionClient ? (jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", ...field('isPensionClient'), value: params.isPensionClient })) : null, params.isShowInsurance ? (jsx(Checkbox, { text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", ...field('isInsurance'), value: params.isInsurance })) : null] }));
3396
3396
 
@@ -3768,6 +3768,7 @@
3768
3768
  moneyExtra: REFINANCING_OLD_DEFAULT_SUM,
3769
3769
  });
3770
3770
  const calcParams = getRefinancingCalculatorParams(userInputParams, calcSource, paramsViewSettings);
3771
+ const minRate = useMemo(() => getDefaultParamsMin(calcSource?.rateRows)?.rate, [calcSource?.rateRows]);
3771
3772
  const paymentTypeElement = renderPaymentType({
3772
3773
  title: '',
3773
3774
  mobileTitle: 'Тип платежа',
@@ -3803,7 +3804,7 @@
3803
3804
  ...field('moneyExtra'),
3804
3805
  value: calcParams.moneyExtra,
3805
3806
  })
3806
- : null, jsx("div", { className: "sm:hidden pt-1 pb-4 border-b border-main-divider", children: paymentTypeElement })] }), jsxs("div", { className: style(CalculatorStyle.result, '@4xl:w-1/2'), children: [jsx(CalculatorValue, { title: "\u041F\u043E\u043B\u043D\u0430\u044F \u0441\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C \u043A\u0440\u0435\u0434\u0438\u0442\u0430", value: calcSource?.totalLoanCost }), jsx(CalculatorValue, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", value: calcParams?.rate, fractionDigits: 2, postfix: "%" }), jsx(CalculatorValue, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436", value: calcParams.monthlyPayment, postfix: "\u20BD" }), calcParams.benefit > 0 ? (jsx(CalculatorValue, { title: 'Выгода в месяц', value: calcParams.benefit, postfix: "\u20BD" })) : null, jsx("div", { className: "hidden sm:block mb-lg", children: paymentTypeElement }), renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }) }));
3807
+ : null, jsx("div", { className: "sm:hidden pt-1 pb-4 border-b border-main-divider", children: paymentTypeElement })] }), jsxs("div", { className: style(CalculatorStyle.result, '@4xl:w-1/2'), children: [jsx(CalculatorValue, { title: "\u041F\u043E\u043B\u043D\u0430\u044F \u0441\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C \u043A\u0440\u0435\u0434\u0438\u0442\u0430", value: calcSource?.totalLoanCost }), jsx(CalculatorValue, { title: "\u0421\u0442\u0430\u0432\u043A\u0430 \u043E\u0442", value: minRate, fractionDigits: 2, postfix: "%" }), jsx(CalculatorValue, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436", value: calcParams.monthlyPayment, postfix: "\u20BD" }), calcParams.benefit > 0 ? (jsx(CalculatorValue, { title: 'Выгода в месяц', value: calcParams.benefit, postfix: "\u20BD" })) : null, jsx("div", { className: "hidden sm:block mb-lg", children: paymentTypeElement }), renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }) }));
3807
3808
  });
3808
3809
  const renderCreditParamsForm = (params, field) => (jsxs("div", { className: "space-y-lg sm:space-y-s", children: [params.isShowSalaryClient ? (jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0443 \u043D\u0430 \u0441\u0447\u0451\u0442 \u0432 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0435", ...field('isSalaryClient'), value: params.isSalaryClient })) : null, params.isShowInsurance ? (jsx(Checkbox, { text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", ...field('isInsurance'), value: params.isInsurance })) : null, jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0443\u044E \u0441\u0443\u043C\u043C\u0443", ...field('isExtraMoney'), value: params.isExtraMoney })] }));
3809
3810
 
@@ -5027,7 +5028,7 @@
5027
5028
  });
5028
5029
 
5029
5030
  const getNS = (_) => globalThis[_];
5030
- const initializeExternalNS = (namespaceName, url) => {
5031
+ const initializeExternalNS = (namespaceName, url, isModule = false) => {
5031
5032
  const script = document.getElementById(url);
5032
5033
  if (script) {
5033
5034
  const ns = getNS(namespaceName);
@@ -5048,6 +5049,9 @@
5048
5049
  newScript.src = url;
5049
5050
  newScript.async = true;
5050
5051
  newScript.id = url;
5052
+ if (isModule) {
5053
+ newScript.type = 'module';
5054
+ }
5051
5055
  newScript.addEventListener('load', () => {
5052
5056
  resolve(getNS(namespaceName));
5053
5057
  });
@@ -5058,6 +5062,12 @@
5058
5062
  });
5059
5063
  }
5060
5064
  };
5065
+ const initializeExternalStylesheet = (url = '') => {
5066
+ const link = document.createElement('link');
5067
+ link.href = url;
5068
+ link.rel = 'stylesheet';
5069
+ document.head.appendChild(link);
5070
+ };
5061
5071
  function useExternalNS(namespaceName, url, unmountNS = true) {
5062
5072
  const [externalNS, setExternalNS] = useState(undefined);
5063
5073
  useEffect(() => {
@@ -5101,8 +5111,8 @@
5101
5111
  return;
5102
5112
  }
5103
5113
  if (chat !== 'personal') {
5104
- initializeExternalNS(`${CHAT_NAMESPACE}_business_css`, `${chatUrl}/bundle.css`);
5105
- const businessChat = (await initializeExternalNS(CHAT_NAMESPACE, `${chatUrl}/bundle.js`));
5114
+ initializeExternalStylesheet(`${chatUrl}/bundle.css`);
5115
+ const businessChat = (await initializeExternalNS(CHAT_NAMESPACE, `${chatUrl}/bundle.js`, true));
5106
5116
  if (businessChat?.render) {
5107
5117
  businessChat.render(CHAT_FRAME_ID, true);
5108
5118
  }
@@ -7002,7 +7012,7 @@
7002
7012
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
7003
7013
  });
7004
7014
 
7005
- const packageVersion = "0.14.771";
7015
+ const packageVersion = "0.14.773";
7006
7016
 
7007
7017
  exports.Blocks = Blocks;
7008
7018
  exports.ContentPage = ContentPage;