@redneckz/wildless-cms-uni-blocks 0.14.205 → 0.14.207
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/bundle.umd.js +23 -9
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/utils/isUUID.d.ts +1 -1
- package/dist/components/Footer/Contacts.js +1 -1
- package/dist/components/Footer/Contacts.js.map +1 -1
- package/dist/hooks/useNavigateHandler.js +13 -4
- package/dist/hooks/useNavigateHandler.js.map +1 -1
- package/dist/utils/adjustHref.js +7 -2
- package/dist/utils/adjustHref.js.map +1 -1
- package/dist/utils/isUUID.d.ts +1 -1
- package/dist/utils/isUUID.js +1 -1
- package/dist/utils/isUUID.js.map +1 -1
- package/lib/components/Footer/Contacts.js +1 -1
- package/lib/components/Footer/Contacts.js.map +1 -1
- package/lib/hooks/useNavigateHandler.js +13 -4
- package/lib/hooks/useNavigateHandler.js.map +1 -1
- package/lib/utils/adjustHref.js +8 -3
- package/lib/utils/adjustHref.js.map +1 -1
- package/lib/utils/isUUID.d.ts +1 -1
- package/lib/utils/isUUID.js +1 -1
- package/lib/utils/isUUID.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +23 -9
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/utils/isUUID.d.ts +1 -1
- package/mobile/dist/components/Footer/Contacts.js +1 -1
- package/mobile/dist/components/Footer/Contacts.js.map +1 -1
- package/mobile/dist/hooks/useNavigateHandler.js +13 -4
- package/mobile/dist/hooks/useNavigateHandler.js.map +1 -1
- package/mobile/dist/utils/adjustHref.js +7 -2
- package/mobile/dist/utils/adjustHref.js.map +1 -1
- package/mobile/dist/utils/isUUID.d.ts +1 -1
- package/mobile/dist/utils/isUUID.js +1 -1
- package/mobile/dist/utils/isUUID.js.map +1 -1
- package/mobile/lib/components/Footer/Contacts.js +1 -1
- package/mobile/lib/components/Footer/Contacts.js.map +1 -1
- package/mobile/lib/hooks/useNavigateHandler.js +13 -4
- package/mobile/lib/hooks/useNavigateHandler.js.map +1 -1
- package/mobile/lib/utils/adjustHref.js +8 -3
- package/mobile/lib/utils/adjustHref.js.map +1 -1
- package/mobile/lib/utils/isUUID.d.ts +1 -1
- package/mobile/lib/utils/isUUID.js +1 -1
- package/mobile/lib/utils/isUUID.js.map +1 -1
- package/mobile/src/components/Footer/Contacts.tsx +1 -1
- package/mobile/src/hooks/useNavigateHandler.ts +14 -4
- package/mobile/src/utils/adjustHref.ts +10 -3
- package/mobile/src/utils/isUUID.ts +1 -1
- package/package.json +1 -1
- package/src/components/Footer/Contacts.tsx +1 -1
- package/src/hooks/useNavigateHandler.ts +14 -4
- package/src/utils/adjustHref.ts +10 -3
- package/src/utils/isUUID.ts +1 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -292,7 +292,7 @@
|
|
|
292
292
|
|
|
293
293
|
const dirname = (path) => path?.split('/').slice(0, -1).join('/');
|
|
294
294
|
|
|
295
|
-
const isUUID = (src) => {
|
|
295
|
+
const isUUID = (src = '') => {
|
|
296
296
|
return /^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(src);
|
|
297
297
|
};
|
|
298
298
|
|
|
@@ -314,13 +314,18 @@
|
|
|
314
314
|
const PREFIX_API = '/api/';
|
|
315
315
|
const FILE_STORAGE_API = `${PREFIX_API}v1/storage`;
|
|
316
316
|
const adjustHref = (router) => (href, basePath = projectSettings.BASE_PATH) => {
|
|
317
|
-
if (
|
|
317
|
+
if ([
|
|
318
|
+
!href,
|
|
319
|
+
isURL(href),
|
|
320
|
+
isHash(href),
|
|
321
|
+
[projectSettings.CDN, PREFIX_API].some((_) => hasPrefix(href, _)),
|
|
322
|
+
].some(Boolean)) {
|
|
318
323
|
return href;
|
|
319
324
|
}
|
|
320
325
|
if (isUUID(href)) {
|
|
321
326
|
return `${FILE_STORAGE_API}/${href}/file`;
|
|
322
327
|
}
|
|
323
|
-
const isRelativeToBase = href
|
|
328
|
+
const isRelativeToBase = href?.startsWith('/');
|
|
324
329
|
return joinPath(hasPrefix(href, basePath) ? '' : basePath, isRelativeToBase ? '/' : dirname(router.pathname), href);
|
|
325
330
|
};
|
|
326
331
|
const hasPrefix = (href, prefix) => prefix && href && href.startsWith(prefix);
|
|
@@ -4106,7 +4111,7 @@
|
|
|
4106
4111
|
}
|
|
4107
4112
|
};
|
|
4108
4113
|
|
|
4109
|
-
const Contacts = JSX(({ className = '', items }) => (jsxs("div", { className: className, children: [items?.length ? items.map(renderContactsGroup) : null, jsx(LinkButton, { version: "primary", className: "w-full", href: "https://
|
|
4114
|
+
const Contacts = JSX(({ className = '', items }) => (jsxs("div", { className: className, children: [items?.length ? items.map(renderContactsGroup) : null, jsx(LinkButton, { version: "primary", className: "w-full", href: "https://www.rshb.ru/natural/feedback/question", target: "_blank", ariaLabel: "\u041E\u0431\u0440\u0430\u0442\u043D\u0430\u044F \u0441\u0432\u044F\u0437\u044C", text: "\u041E\u0431\u0440\u0430\u0442\u043D\u0430\u044F \u0441\u0432\u044F\u0437\u044C" })] })));
|
|
4110
4115
|
const renderContactsGroup = (item, i) => (jsxs("div", { className: "mb-m space-y-m", children: [jsx("div", { children: jsx(Text, { size: "text-l", font: "font-medium", children: item?.title }) }), jsx("div", { className: "space-y-m", children: item.items?.map(renderContact) })] }, String(i)));
|
|
4111
4116
|
const renderContact = (item, index) => (jsxs("div", { className: "space-y-2xs", children: [jsx("div", { children: renderText(item.type, item.text) }), jsx(Paragraph, { size: "text-s", font: "font-light", color: "text-secondary-text", children: item.description })] }, String(index)));
|
|
4112
4117
|
const renderText = (type, text = '') => {
|
|
@@ -5882,12 +5887,21 @@
|
|
|
5882
5887
|
useEventListener(globalThis, 'click', navigationHandler);
|
|
5883
5888
|
};
|
|
5884
5889
|
const navigationHandler = (ev) => {
|
|
5885
|
-
const
|
|
5886
|
-
if (
|
|
5890
|
+
const element = getAnchorElement(ev.target);
|
|
5891
|
+
if (isURL(element?.href)) {
|
|
5887
5892
|
ev.preventDefault();
|
|
5888
|
-
const url = adjustSessionQuery(
|
|
5889
|
-
|
|
5893
|
+
const url = adjustSessionQuery(element?.href) || element?.href;
|
|
5894
|
+
if (url) {
|
|
5895
|
+
globalThis.location.href = url;
|
|
5896
|
+
}
|
|
5897
|
+
}
|
|
5898
|
+
};
|
|
5899
|
+
const getAnchorElement = (target) => {
|
|
5900
|
+
let _target = target;
|
|
5901
|
+
while (Boolean(_target) && _target.tagName !== 'A') {
|
|
5902
|
+
_target = _target?.parentNode;
|
|
5890
5903
|
}
|
|
5904
|
+
return _target;
|
|
5891
5905
|
};
|
|
5892
5906
|
|
|
5893
5907
|
const COOKIE_DIALOG_ID = 'cookie';
|
|
@@ -6040,7 +6054,7 @@
|
|
|
6040
6054
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
6041
6055
|
});
|
|
6042
6056
|
|
|
6043
|
-
const packageVersion = "0.14.
|
|
6057
|
+
const packageVersion = "0.14.206";
|
|
6044
6058
|
|
|
6045
6059
|
exports.Blocks = Blocks;
|
|
6046
6060
|
exports.ContentPage = ContentPage;
|