@redneckz/wildless-cms-uni-blocks 0.14.879 → 0.14.881

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 +42 -38
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/retail/api/updateRefreshToken.d.ts +1 -1
  4. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +1 -1
  5. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  6. package/dist/retail/api/esiaRequestProfile.js +7 -1
  7. package/dist/retail/api/esiaRequestProfile.js.map +1 -1
  8. package/dist/retail/api/updateRefreshToken.d.ts +1 -1
  9. package/dist/retail/api/updateRefreshToken.js +3 -3
  10. package/dist/retail/api/updateRefreshToken.js.map +1 -1
  11. package/dist/ui-kit/Select/Select.js +1 -1
  12. package/dist/ui-kit/Select/Select.js.map +1 -1
  13. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +1 -1
  14. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  15. package/lib/retail/api/esiaRequestProfile.js +7 -1
  16. package/lib/retail/api/esiaRequestProfile.js.map +1 -1
  17. package/lib/retail/api/updateRefreshToken.d.ts +1 -1
  18. package/lib/retail/api/updateRefreshToken.js +3 -3
  19. package/lib/retail/api/updateRefreshToken.js.map +1 -1
  20. package/lib/ui-kit/Select/Select.js +1 -1
  21. package/lib/ui-kit/Select/Select.js.map +1 -1
  22. package/mobile/bundle/bundle.umd.js +42 -38
  23. package/mobile/bundle/bundle.umd.min.js +1 -1
  24. package/mobile/bundle/retail/api/updateRefreshToken.d.ts +1 -1
  25. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +1 -1
  26. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  27. package/mobile/dist/retail/api/esiaRequestProfile.js +7 -1
  28. package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -1
  29. package/mobile/dist/retail/api/updateRefreshToken.d.ts +1 -1
  30. package/mobile/dist/retail/api/updateRefreshToken.js +3 -3
  31. package/mobile/dist/retail/api/updateRefreshToken.js.map +1 -1
  32. package/mobile/dist/ui-kit/Select/Select.js +1 -1
  33. package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
  34. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +1 -1
  35. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  36. package/mobile/lib/retail/api/esiaRequestProfile.js +7 -1
  37. package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -1
  38. package/mobile/lib/retail/api/updateRefreshToken.d.ts +1 -1
  39. package/mobile/lib/retail/api/updateRefreshToken.js +3 -3
  40. package/mobile/lib/retail/api/updateRefreshToken.js.map +1 -1
  41. package/mobile/lib/ui-kit/Select/Select.js +1 -1
  42. package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
  43. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +1 -1
  44. package/mobile/src/retail/api/esiaRequestProfile.ts +8 -2
  45. package/mobile/src/retail/api/updateRefreshToken.ts +3 -3
  46. package/mobile/src/ui-kit/Select/Select.tsx +1 -1
  47. package/package.json +1 -1
  48. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +1 -1
  49. package/src/retail/api/esiaRequestProfile.ts +8 -2
  50. package/src/retail/api/updateRefreshToken.ts +3 -3
  51. package/src/ui-kit/Select/Select.tsx +1 -1
@@ -1386,7 +1386,7 @@
1386
1386
  }, [isDisabled]);
1387
1387
  const handleChangeQuery = (newQuery) => {
1388
1388
  setQuery(newQuery);
1389
- setOption(newQuery, onChange);
1389
+ isManualInput && setOption(newQuery, onChange);
1390
1390
  debouncedOnSearchQuery && debouncedOnSearchQuery(newQuery);
1391
1391
  };
1392
1392
  const handleClose = useCallback(() => {
@@ -6142,7 +6142,45 @@
6142
6142
  }
6143
6143
  }, [target, key]);
6144
6144
 
6145
- const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body);
6145
+ const PORTAL_NATURAL_URL = '/';
6146
+ const UPDATING_INTERVAL = 60000 * 4;
6147
+ const updateRefreshToken = (isFromLeadForm = false) => {
6148
+ const refreshToken = globalThis.sessionStorage?.getItem('refreshToken');
6149
+ const accessToken = globalThis.sessionStorage?.getItem('accessToken');
6150
+ const taskId = globalThis.localStorage.getItem('taskId');
6151
+ const navigator = locationNavigator();
6152
+ if (!accessToken || !refreshToken || (!taskId && !isFromLeadForm)) {
6153
+ navigator.assign(PORTAL_NATURAL_URL);
6154
+ return () => {
6155
+ // do nothing
6156
+ };
6157
+ }
6158
+ const updateTokenRequest = async () => {
6159
+ const res = await doRequest('/auth/refresh', 'POST', {
6160
+ // eslint-disable-next-line camelcase
6161
+ refresh_token: refreshToken,
6162
+ // eslint-disable-next-line camelcase
6163
+ access_token: accessToken,
6164
+ });
6165
+ if (Number(res?.status) === 401) {
6166
+ navigator.assign(PORTAL_NATURAL_URL);
6167
+ }
6168
+ if (res?.ok) {
6169
+ const data = await res.json();
6170
+ globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
6171
+ globalThis.sessionStorage.setItem('accessToken', data.access_token);
6172
+ }
6173
+ };
6174
+ !isFromLeadForm && updateTokenRequest();
6175
+ const timer = setInterval(updateTokenRequest, UPDATING_INTERVAL);
6176
+ return () => clearInterval(timer);
6177
+ };
6178
+
6179
+ const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body).then((res) => {
6180
+ saveToken(res);
6181
+ updateRefreshToken(true);
6182
+ return res;
6183
+ });
6146
6184
 
6147
6185
  const initialFormState = {
6148
6186
  surname: '',
@@ -6360,7 +6398,7 @@
6360
6398
  code,
6361
6399
  state,
6362
6400
  redirectUri: globalThis.location?.href,
6363
- authorize: false,
6401
+ authorize: true,
6364
6402
  });
6365
6403
  if (data) {
6366
6404
  const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
@@ -7848,40 +7886,6 @@
7848
7886
  const renderBlocks = (info) => (jsx("div", { className: "flex gap-5xl grow basis-0", children: info.map((column, i) => renderBlocksColumn({ column, i })) }));
7849
7887
  const renderBlocksColumn = ({ column, i }) => column ? (jsx("div", { className: "flex flex-col gap-xl grow basis-0", children: column.map(({ title = '', description, additionalDescription, button }, key) => (jsxs("div", { children: [jsx(Headline, { title: title, description: description, headlineVersion: "XS", align: "text-left", isEmbedded: true }), additionalDescription ? (jsx("div", { className: "mt-xs opacity-80", children: jsx(Paragraph, { size: "text-m", font: "font-light", children: additionalDescription }) })) : null, jsx("div", { className: style({ 'mt-xl': Boolean(button?.text) }), children: renderButtonsSection([button]) })] }, String(key)))) }, `col-${String(i)}`)) : null;
7850
7888
 
7851
- const PORTAL_NATURAL_URL = '/';
7852
- const UPDATING_INTERVAL = 60000 * 4;
7853
- const updateRefreshToken = () => {
7854
- const refreshToken = globalThis.sessionStorage?.getItem('refreshToken');
7855
- const accessToken = globalThis.sessionStorage?.getItem('accessToken');
7856
- const taskId = globalThis.localStorage.getItem('taskId');
7857
- const navigator = locationNavigator();
7858
- if (!accessToken || !refreshToken || !taskId) {
7859
- navigator.assign(PORTAL_NATURAL_URL);
7860
- return () => {
7861
- // do nothing
7862
- };
7863
- }
7864
- const updateTokenRequest = async () => {
7865
- const res = await doRequest('/auth/refresh', 'POST', {
7866
- // eslint-disable-next-line camelcase
7867
- refresh_token: refreshToken,
7868
- // eslint-disable-next-line camelcase
7869
- access_token: accessToken,
7870
- });
7871
- if (Number(res?.status) === 401) {
7872
- navigator.assign(PORTAL_NATURAL_URL);
7873
- }
7874
- if (res?.ok) {
7875
- const data = await res.json();
7876
- globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
7877
- globalThis.sessionStorage.setItem('accessToken', data.access_token);
7878
- }
7879
- };
7880
- updateTokenRequest();
7881
- const timer = setInterval(updateTokenRequest, UPDATING_INTERVAL);
7882
- return () => clearInterval(timer);
7883
- };
7884
-
7885
7889
  const ProgressBar = JSX(({ step = 10, description, showPercentage = true }) => (jsxs("div", { children: [jsx("div", { className: "h-4 w-full bg-gray relative", children: jsx("div", { className: "h-4 bg-green", style: { width: `${step}%` } }) }), jsxs("div", { className: "relative", children: [showPercentage ? jsxs("div", { className: "absolute left-2/4 text-green", children: [step, "%"] }) : null, description ? jsx("div", { className: "text-right pr-m text-gray", children: description }) : null] })] })));
7886
7890
 
7887
7891
  const CreditCardFormProgress = JSX(({ step = 1, totalSteps = 6, stepsTitles = [] }) => {
@@ -11358,7 +11362,7 @@
11358
11362
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
11359
11363
  });
11360
11364
 
11361
- const packageVersion = "0.14.878";
11365
+ const packageVersion = "0.14.880";
11362
11366
 
11363
11367
  exports.Blocks = Blocks;
11364
11368
  exports.ContentPage = ContentPage;