@redneckz/wildless-cms-uni-blocks 0.14.676 → 0.14.677
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.
- package/bundle/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/bundle/bundle.umd.js +23 -12
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/hooks/useNavigator.d.ts +8 -0
- package/bundle/index.d.ts +1 -0
- package/dist/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/dist/api/RetailAPI/updateRefreshToken.js +6 -10
- package/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardForm.js +4 -1
- package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/dist/components/CreditForm/CreditForm.js +4 -1
- package/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/dist/hooks/useNavigator.d.ts +8 -0
- package/dist/hooks/useNavigator.js +13 -0
- package/dist/hooks/useNavigator.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/lib/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/lib/api/RetailAPI/updateRefreshToken.js +6 -10
- package/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardForm.js +4 -1
- package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.js +4 -1
- package/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/lib/hooks/useNavigator.d.ts +8 -0
- package/lib/hooks/useNavigator.js +10 -0
- package/lib/hooks/useNavigator.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/mobile/bundle/bundle.umd.js +23 -12
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/hooks/useNavigator.d.ts +8 -0
- package/mobile/bundle/index.d.ts +1 -0
- package/mobile/dist/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/updateRefreshToken.js +6 -10
- package/mobile/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js +4 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditForm.js +4 -1
- package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/dist/hooks/useNavigator.d.ts +8 -0
- package/mobile/dist/hooks/useNavigator.js +13 -0
- package/mobile/dist/hooks/useNavigator.js.map +1 -0
- package/mobile/dist/index.d.ts +1 -0
- package/mobile/dist/index.js +3 -1
- package/mobile/dist/index.js.map +1 -1
- package/mobile/lib/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/mobile/lib/api/RetailAPI/updateRefreshToken.js +6 -10
- package/mobile/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js +4 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditForm.js +4 -1
- package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/lib/hooks/useNavigator.d.ts +8 -0
- package/mobile/lib/hooks/useNavigator.js +10 -0
- package/mobile/lib/hooks/useNavigator.js.map +1 -0
- package/mobile/lib/index.d.ts +1 -0
- package/mobile/lib/index.js +1 -0
- package/mobile/lib/index.js.map +1 -1
- package/mobile/src/api/RetailAPI/updateRefreshToken.ts +6 -12
- package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +6 -1
- package/mobile/src/components/CreditForm/CreditForm.tsx +6 -1
- package/mobile/src/hooks/useNavigator.ts +15 -0
- package/mobile/src/index.ts +1 -0
- package/package.json +1 -1
- package/src/api/RetailAPI/updateRefreshToken.ts +6 -12
- package/src/components/CreditCardForm/CreditCardForm.tsx +6 -1
- package/src/components/CreditForm/CreditForm.tsx +6 -1
- package/src/hooks/useNavigator.ts +15 -0
- package/src/index.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const updateRefreshToken: () => () => void;
|
|
1
|
+
export declare const updateRefreshToken: (failCallback: () => void) => () => void;
|
package/bundle/bundle.umd.js
CHANGED
|
@@ -6194,14 +6194,13 @@
|
|
|
6194
6194
|
const renderBlocks = (info) => (jsx("div", { className: "flex gap-5xl grow basis-0", children: info.map((column, i) => renderBlocksColumn({ column, i })) }));
|
|
6195
6195
|
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;
|
|
6196
6196
|
|
|
6197
|
-
const PORTAL_NATURAL_URL = '/';
|
|
6198
6197
|
const UPDATING_INTERVAL = 60000 * 4;
|
|
6199
|
-
const updateRefreshToken = () => {
|
|
6198
|
+
const updateRefreshToken = (failCallback) => {
|
|
6200
6199
|
const refreshToken = globalThis.sessionStorage?.getItem('refreshToken');
|
|
6201
6200
|
const accessToken = globalThis.sessionStorage?.getItem('accessToken');
|
|
6202
6201
|
const taskId = globalThis.localStorage.getItem('taskId');
|
|
6203
6202
|
if (!accessToken || !refreshToken || !taskId) {
|
|
6204
|
-
|
|
6203
|
+
failCallback();
|
|
6205
6204
|
return () => null;
|
|
6206
6205
|
}
|
|
6207
6206
|
const updateTokenRequest = async () => {
|
|
@@ -6211,8 +6210,10 @@
|
|
|
6211
6210
|
// eslint-disable-next-line camelcase
|
|
6212
6211
|
access_token: accessToken,
|
|
6213
6212
|
});
|
|
6214
|
-
if (res) {
|
|
6215
|
-
|
|
6213
|
+
if (res?.status == 401) {
|
|
6214
|
+
failCallback();
|
|
6215
|
+
}
|
|
6216
|
+
if (res?.ok) {
|
|
6216
6217
|
const data = await res.json();
|
|
6217
6218
|
globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
|
|
6218
6219
|
globalThis.sessionStorage.setItem('accessToken', data.access_token);
|
|
@@ -6222,10 +6223,15 @@
|
|
|
6222
6223
|
const timer = setInterval(updateTokenRequest, UPDATING_INTERVAL);
|
|
6223
6224
|
return () => clearInterval(timer);
|
|
6224
6225
|
};
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6226
|
+
|
|
6227
|
+
function useNavigator() {
|
|
6228
|
+
return useNavigator._impl();
|
|
6229
|
+
}
|
|
6230
|
+
useNavigator._impl = () => ({
|
|
6231
|
+
assign: (url) => globalThis.location.assign(url),
|
|
6232
|
+
});
|
|
6233
|
+
useNavigator.setup = (impl) => {
|
|
6234
|
+
useNavigator._impl = impl;
|
|
6229
6235
|
};
|
|
6230
6236
|
|
|
6231
6237
|
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 mr-4 text-gray", children: description }) : null] })] })));
|
|
@@ -7075,6 +7081,7 @@
|
|
|
7075
7081
|
],
|
|
7076
7082
|
];
|
|
7077
7083
|
|
|
7084
|
+
const PORTAL_NATURAL_URL$1 = '/';
|
|
7078
7085
|
const WIZARD_STEPS$1 = 6;
|
|
7079
7086
|
const WIZARD_TITLES$1 = [
|
|
7080
7087
|
'Параметры карты',
|
|
@@ -7088,7 +7095,8 @@
|
|
|
7088
7095
|
const [step, setStep] = useState(0);
|
|
7089
7096
|
const formContainerRef = useRef(null);
|
|
7090
7097
|
const scrollToTop = useCallback(() => formContainerRef?.current?.scrollIntoView({ behavior: 'smooth' }), [formContainerRef]);
|
|
7091
|
-
|
|
7098
|
+
const navigator = useNavigator();
|
|
7099
|
+
useEffect(() => updateRefreshToken(() => navigator.assign(PORTAL_NATURAL_URL$1)), []);
|
|
7092
7100
|
const handleNextStep = useCallback(() => {
|
|
7093
7101
|
setStep((_) => Math.min(_ + 1, WIZARD_STEPS$1));
|
|
7094
7102
|
scrollToTop();
|
|
@@ -7861,6 +7869,7 @@
|
|
|
7861
7869
|
],
|
|
7862
7870
|
];
|
|
7863
7871
|
|
|
7872
|
+
const PORTAL_NATURAL_URL = '/';
|
|
7864
7873
|
const WIZARD_STEPS = 5;
|
|
7865
7874
|
const WIZARD_TITLES = [
|
|
7866
7875
|
'',
|
|
@@ -7874,7 +7883,8 @@
|
|
|
7874
7883
|
const [step, setStep] = useState(0);
|
|
7875
7884
|
const formContainerRef = useRef(null);
|
|
7876
7885
|
const scrollToTop = useCallback(() => formContainerRef?.current?.scrollIntoView({ behavior: 'smooth' }), [formContainerRef]);
|
|
7877
|
-
|
|
7886
|
+
const navigator = useNavigator();
|
|
7887
|
+
useEffect(() => updateRefreshToken(() => navigator.assign(PORTAL_NATURAL_URL)), []);
|
|
7878
7888
|
const handleNextStep = useCallback(() => {
|
|
7879
7889
|
setStep((_) => Math.min(_ + 1, WIZARD_STEPS));
|
|
7880
7890
|
scrollToTop();
|
|
@@ -10295,7 +10305,7 @@
|
|
|
10295
10305
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
10296
10306
|
});
|
|
10297
10307
|
|
|
10298
|
-
const packageVersion = "0.14.
|
|
10308
|
+
const packageVersion = "0.14.676";
|
|
10299
10309
|
|
|
10300
10310
|
exports.Blocks = Blocks;
|
|
10301
10311
|
exports.ContentPage = ContentPage;
|
|
@@ -10306,6 +10316,7 @@
|
|
|
10306
10316
|
exports.setup = setup;
|
|
10307
10317
|
exports.setupHooks = setupHooks;
|
|
10308
10318
|
exports.url = url;
|
|
10319
|
+
exports.useNavigator = useNavigator;
|
|
10309
10320
|
exports.useRouter = useRouter;
|
|
10310
10321
|
|
|
10311
10322
|
Object.defineProperty(exports, '__esModule', { value: true });
|