@cntrl-site/sdk-nextjs 0.8.1 → 0.8.2
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.
|
Binary file
|
|
@@ -4,7 +4,7 @@ exports.LinkWrapper = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const LinkWrapper = ({ url, children }) => {
|
|
6
6
|
const validUrl = url && buildValidUrl(url);
|
|
7
|
-
return url ? ((0, jsx_runtime_1.jsx)("a", { href: validUrl, target: url.startsWith('/') ? '_self' : '_blank', rel: "noreferrer", children: children })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }));
|
|
7
|
+
return url ? ((0, jsx_runtime_1.jsx)("a", { href: validUrl, target: url.startsWith('/') || url.startsWith('#') ? '_self' : '_blank', rel: "noreferrer", children: children })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }));
|
|
8
8
|
};
|
|
9
9
|
exports.LinkWrapper = LinkWrapper;
|
|
10
10
|
function buildValidUrl(url) {
|
|
@@ -22,7 +22,7 @@ const Section = ({ section, children }) => {
|
|
|
22
22
|
}`;
|
|
23
23
|
}, '');
|
|
24
24
|
};
|
|
25
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `section-${section.id}`, style: {
|
|
25
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: `section-${section.id}`, id: section.name, style: {
|
|
26
26
|
backgroundColor: backgroundColor
|
|
27
27
|
}, children: children }), (0, jsx_runtime_1.jsx)("style", { jsx: true, children: `
|
|
28
28
|
${(0, sdk_1.getLayoutStyles)(layouts, [section.height], ([height]) => (`
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ export const LinkWrapper: React.FC<Props> = ({ url, children }) => {
|
|
|
10
10
|
return url ? (
|
|
11
11
|
<a
|
|
12
12
|
href={validUrl}
|
|
13
|
-
target={url.startsWith('/') ? '_self' : '_blank'}
|
|
13
|
+
target={url.startsWith('/') || url.startsWith('#') ? '_self' : '_blank'}
|
|
14
14
|
rel="noreferrer"
|
|
15
15
|
>
|
|
16
16
|
{children}
|
|
@@ -4,8 +4,7 @@ import {
|
|
|
4
4
|
getLayoutStyles,
|
|
5
5
|
TArticleSection,
|
|
6
6
|
TSectionHeight,
|
|
7
|
-
SectionHeightMode
|
|
8
|
-
CntrlColor
|
|
7
|
+
SectionHeightMode
|
|
9
8
|
} from '@cntrl-site/sdk';
|
|
10
9
|
import { useCntrlContext } from '../provider/useCntrlContext';
|
|
11
10
|
import { useSectionColor } from './useSectionColor';
|
|
@@ -39,6 +38,7 @@ export const Section: FC<Props> = ({ section, children }) => {
|
|
|
39
38
|
<>
|
|
40
39
|
<div
|
|
41
40
|
className={`section-${section.id}`}
|
|
41
|
+
id={section.name}
|
|
42
42
|
style={{
|
|
43
43
|
backgroundColor: backgroundColor
|
|
44
44
|
}}
|