@redneckz/wildless-cms-uni-blocks 0.9.15 → 0.9.16
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 +14 -12
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/hooks/useLink.d.ts +5 -1
- package/bundle/services/sitemap/SitemapData.d.ts +2 -2
- package/bundle/ui-kit/SearchDialog/SearchDialog.d.ts +2 -2
- package/bundle/ui-kit/Sitemap/Sitemap.d.ts +2 -2
- package/bundle/utils/adjustHref.d.ts +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/dist/components/Footer/TextInformationLink.js +1 -1
- package/dist/components/Footer/TextInformationLink.js.map +1 -1
- package/dist/hooks/useLink.d.ts +5 -1
- package/dist/hooks/useLink.js +3 -2
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/services/sitemap/SitemapData.d.ts +2 -2
- package/dist/ui-kit/SearchDialog/SearchDialog.d.ts +2 -2
- package/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/dist/ui-kit/Sitemap/Sitemap.d.ts +2 -2
- package/dist/ui-kit/Sitemap/Sitemap.js +3 -4
- package/dist/ui-kit/Sitemap/Sitemap.js.map +1 -1
- package/dist/ui-kit/TopItem/TopItem.js +1 -1
- package/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/dist/utils/adjustHref.d.ts +1 -1
- package/dist/utils/adjustHref.js +4 -3
- package/dist/utils/adjustHref.js.map +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/lib/components/Footer/TextInformationLink.js +1 -1
- package/lib/components/Footer/TextInformationLink.js.map +1 -1
- package/lib/hooks/useLink.d.ts +5 -1
- package/lib/hooks/useLink.js +3 -2
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/services/sitemap/SitemapData.d.ts +2 -2
- package/lib/ui-kit/SearchDialog/SearchDialog.d.ts +2 -2
- package/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/lib/ui-kit/Sitemap/Sitemap.d.ts +2 -2
- package/lib/ui-kit/Sitemap/Sitemap.js +3 -4
- package/lib/ui-kit/Sitemap/Sitemap.js.map +1 -1
- package/lib/ui-kit/TopItem/TopItem.js +1 -1
- package/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/lib/utils/adjustHref.d.ts +1 -1
- package/lib/utils/adjustHref.js +4 -3
- package/lib/utils/adjustHref.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +12 -10
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/hooks/useLink.d.ts +5 -1
- package/mobile/bundle/services/sitemap/SitemapData.d.ts +2 -2
- package/mobile/bundle/ui-kit/SearchDialog/SearchDialog.d.ts +2 -2
- package/mobile/bundle/ui-kit/Sitemap/Sitemap.d.ts +2 -2
- package/mobile/bundle/utils/adjustHref.d.ts +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Footer/TextInformationLink.js +1 -1
- package/mobile/dist/components/Footer/TextInformationLink.js.map +1 -1
- package/mobile/dist/hooks/useLink.d.ts +5 -1
- package/mobile/dist/hooks/useLink.js +3 -2
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/services/sitemap/SitemapData.d.ts +2 -2
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.d.ts +2 -2
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/dist/ui-kit/Sitemap/Sitemap.d.ts +2 -2
- package/mobile/dist/ui-kit/Sitemap/Sitemap.js +3 -4
- package/mobile/dist/ui-kit/Sitemap/Sitemap.js.map +1 -1
- package/mobile/dist/ui-kit/TopItem/TopItem.js +1 -1
- package/mobile/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/dist/utils/adjustHref.d.ts +1 -1
- package/mobile/dist/utils/adjustHref.js +4 -3
- package/mobile/dist/utils/adjustHref.js.map +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Footer/TextInformationLink.js +1 -1
- package/mobile/lib/components/Footer/TextInformationLink.js.map +1 -1
- package/mobile/lib/hooks/useLink.d.ts +5 -1
- package/mobile/lib/hooks/useLink.js +3 -2
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/services/sitemap/SitemapData.d.ts +2 -2
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.d.ts +2 -2
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/lib/ui-kit/Sitemap/Sitemap.d.ts +2 -2
- package/mobile/lib/ui-kit/Sitemap/Sitemap.js +3 -4
- package/mobile/lib/ui-kit/Sitemap/Sitemap.js.map +1 -1
- package/mobile/lib/ui-kit/TopItem/TopItem.js +1 -1
- package/mobile/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/lib/utils/adjustHref.d.ts +1 -1
- package/mobile/lib/utils/adjustHref.js +4 -3
- package/mobile/lib/utils/adjustHref.js.map +1 -1
- package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +1 -1
- package/mobile/src/components/Footer/TextInformationLink.tsx +1 -1
- package/mobile/src/hooks/useLink.ts +9 -2
- package/mobile/src/services/sitemap/SitemapData.ts +2 -2
- package/mobile/src/ui-kit/SearchDialog/SearchDialog.tsx +5 -5
- package/mobile/src/ui-kit/Sitemap/Sitemap.tsx +6 -7
- package/mobile/src/ui-kit/TopItem/TopItem.tsx +1 -1
- package/mobile/src/utils/adjustHref.ts +16 -11
- package/package.json +1 -1
- package/src/components/Calculator/useDepositCalculatorParams.ts +1 -1
- package/src/components/Footer/TextInformationLink.tsx +1 -1
- package/src/hooks/useLink.ts +9 -2
- package/src/services/sitemap/SitemapData.ts +2 -2
- package/src/ui-kit/SearchDialog/SearchDialog.tsx +5 -5
- package/src/ui-kit/Sitemap/Sitemap.tsx +6 -7
- package/src/ui-kit/TopItem/TopItem.tsx +1 -1
- package/src/utils/adjustHref.ts +16 -11
package/bundle/bundle.umd.js
CHANGED
|
@@ -503,13 +503,14 @@
|
|
|
503
503
|
joinPath: joinPath
|
|
504
504
|
});
|
|
505
505
|
|
|
506
|
-
const adjustHref = (router) => (href) => {
|
|
507
|
-
if (!href || isURL(href) || (
|
|
506
|
+
const adjustHref = (router) => (href, basePath = projectSettings.BASE_PATH) => {
|
|
507
|
+
if (!href || isURL(href) || hasPrefix(href, projectSettings.CDN)) {
|
|
508
508
|
return href;
|
|
509
509
|
}
|
|
510
510
|
const isRelativeToBase = href.startsWith('/');
|
|
511
|
-
return joinPath(
|
|
511
|
+
return joinPath(hasPrefix(href, basePath) ? '' : basePath, isRelativeToBase ? '/' : dirname(router.pathname), href);
|
|
512
512
|
};
|
|
513
|
+
const hasPrefix = (href, prefix) => prefix && href && href.startsWith(prefix);
|
|
513
514
|
|
|
514
515
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
515
516
|
const handlerDecorator = (handler, targetContent) => {
|
|
@@ -538,12 +539,13 @@
|
|
|
538
539
|
useRouter._impl = impl;
|
|
539
540
|
};
|
|
540
541
|
|
|
541
|
-
function useLink(
|
|
542
|
+
function useLink(params = {}) {
|
|
543
|
+
const { isRemote, basePath } = params;
|
|
542
544
|
const router = useRouter();
|
|
543
545
|
const { close } = useDialog();
|
|
544
546
|
return (props) => ({
|
|
545
547
|
...props,
|
|
546
|
-
href: isRemote ? props.href : adjustHref(router)(props.href),
|
|
548
|
+
href: isRemote ? props.href : adjustHref(router)(props.href, basePath),
|
|
547
549
|
'aria-label': props.text,
|
|
548
550
|
onClick: handlerDecorator(handleHref(props), props),
|
|
549
551
|
});
|
|
@@ -1761,7 +1763,7 @@
|
|
|
1761
1763
|
}
|
|
1762
1764
|
};
|
|
1763
1765
|
const checkRowByParam = ({ row, userInputParams, paramKey, isExclude }) => isExclude || userInputParams[paramKey] === row[paramKey];
|
|
1764
|
-
const getMiddleMonth = (minMonths, maxMonths) => Math.round((maxMonths - minMonths) / 2);
|
|
1766
|
+
const getMiddleMonth = (minMonths, maxMonths) => minMonths + Math.round((maxMonths - minMonths) / 2);
|
|
1765
1767
|
|
|
1766
1768
|
const DepositCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
1767
1769
|
const [moneyValue, setMoneyValue] = useState(DEPOSIT_DEFAULT_SUM);
|
|
@@ -3040,7 +3042,7 @@
|
|
|
3040
3042
|
}
|
|
3041
3043
|
|
|
3042
3044
|
const Sitemap = JSX(({ className, topItems }) => {
|
|
3043
|
-
const link = useLink(true);
|
|
3045
|
+
const link = useLink({ isRemote: true });
|
|
3044
3046
|
return (jsx("div", { className: style('flex items-start justify-between', className), children: topItems?.map(link).map(renderColumn) }));
|
|
3045
3047
|
});
|
|
3046
3048
|
const renderColumn = (menuItem, index) => {
|
|
@@ -3049,9 +3051,9 @@
|
|
|
3049
3051
|
};
|
|
3050
3052
|
const ColumnItem = JSX(({ text, index, basePath, ...rest }) => {
|
|
3051
3053
|
const isAnotherPortal = projectSettings.BASE_PATH && basePath ? !projectSettings.BASE_PATH.startsWith(basePath) : false;
|
|
3052
|
-
const link = useLink(isAnotherPortal);
|
|
3054
|
+
const link = useLink({ isRemote: isAnotherPortal });
|
|
3053
3055
|
const { href, target, onClick } = link(rest);
|
|
3054
|
-
return (jsx("a", { className: style('text-l-light text-secondary-text hover:text-primary-main no-underline', 'overflow-x-hidden overflow-ellipsis whitespace-nowrap'), href:
|
|
3056
|
+
return (jsx("a", { className: style('text-l-light text-secondary-text hover:text-primary-main no-underline', 'overflow-x-hidden overflow-ellipsis whitespace-nowrap'), href: href, target: target || '_self', onClick: onClick, children: text || `Раздел ${index}` }));
|
|
3055
3057
|
});
|
|
3056
3058
|
|
|
3057
3059
|
const SearchInput = JSX(({ className, isMobile, value, autoFocus, onChange, onFocus }) => {
|
|
@@ -3135,7 +3137,7 @@
|
|
|
3135
3137
|
});
|
|
3136
3138
|
|
|
3137
3139
|
const TextInformationLink = JSX(({ className = '', index, ...rest }) => {
|
|
3138
|
-
const link = useLink();
|
|
3140
|
+
const link = useLink({ isRemote: true });
|
|
3139
3141
|
const { href, target, text, onClick } = link(rest);
|
|
3140
3142
|
return (jsx("a", { className: `text-xs-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px] ${className}`, href: href, target: target, onClick: onClick, children: text || `Документ ${index}` }));
|
|
3141
3143
|
});
|
|
@@ -3272,7 +3274,7 @@
|
|
|
3272
3274
|
});
|
|
3273
3275
|
|
|
3274
3276
|
const TopItem = JSX(({ className = '', active, flat, children, ...rest }) => {
|
|
3275
|
-
const link = useLink(true);
|
|
3277
|
+
const link = useLink({ isRemote: true });
|
|
3276
3278
|
const { href, target, text, onClick } = link(rest);
|
|
3277
3279
|
return (jsx("a", { className: style(getLinkStyle(active, flat), className), href: href, target: target, onClick: onClick, rel: "noopener noreferrer", "aria-label": text, children: jsx("span", { className: getTextStyle$1(active, flat), children: text || children }) }));
|
|
3278
3280
|
});
|
|
@@ -4983,7 +4985,7 @@
|
|
|
4983
4985
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
|
|
4984
4986
|
}
|
|
4985
4987
|
|
|
4986
|
-
const packageVersion = "0.9.
|
|
4988
|
+
const packageVersion = "0.9.16";
|
|
4987
4989
|
|
|
4988
4990
|
exports.Blocks = Blocks;
|
|
4989
4991
|
exports.ContentPage = ContentPage;
|