@sitecore-jss/sitecore-jss-nextjs 21.1.0-canary.33 → 21.1.0-canary.34
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.
|
@@ -43,13 +43,13 @@ exports.Link = react_1.forwardRef((props, ref) => {
|
|
|
43
43
|
const value = (field.href
|
|
44
44
|
? field
|
|
45
45
|
: field.value);
|
|
46
|
-
const { href, querystring } = value;
|
|
46
|
+
const { href, querystring, anchor } = value;
|
|
47
47
|
const isEditing = editable && field.editable;
|
|
48
48
|
if (href && !isEditing) {
|
|
49
49
|
const text = showLinkTextWithChildrenPresent || !children ? value.text || value.href : null;
|
|
50
50
|
// determine if a link is a route or not.
|
|
51
51
|
if (internalLinkMatcher.test(href)) {
|
|
52
|
-
return (react_1.default.createElement(link_1.default, { href: { pathname: href, query: querystring }, key: "link", locale: false },
|
|
52
|
+
return (react_1.default.createElement(link_1.default, { href: { pathname: href, query: querystring, hash: anchor }, key: "link", locale: false },
|
|
53
53
|
react_1.default.createElement("a", Object.assign({ title: value.title, target: value.target, className: value.class }, htmlLinkProps, { ref: ref }),
|
|
54
54
|
text,
|
|
55
55
|
children)));
|
|
@@ -18,13 +18,13 @@ export const Link = forwardRef((props, ref) => {
|
|
|
18
18
|
const value = (field.href
|
|
19
19
|
? field
|
|
20
20
|
: field.value);
|
|
21
|
-
const { href, querystring } = value;
|
|
21
|
+
const { href, querystring, anchor } = value;
|
|
22
22
|
const isEditing = editable && field.editable;
|
|
23
23
|
if (href && !isEditing) {
|
|
24
24
|
const text = showLinkTextWithChildrenPresent || !children ? value.text || value.href : null;
|
|
25
25
|
// determine if a link is a route or not.
|
|
26
26
|
if (internalLinkMatcher.test(href)) {
|
|
27
|
-
return (React.createElement(NextLink, { href: { pathname: href, query: querystring }, key: "link", locale: false },
|
|
27
|
+
return (React.createElement(NextLink, { href: { pathname: href, query: querystring, hash: anchor }, key: "link", locale: false },
|
|
28
28
|
React.createElement("a", Object.assign({ title: value.title, target: value.target, className: value.class }, htmlLinkProps, { ref: ref }),
|
|
29
29
|
text,
|
|
30
30
|
children)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-nextjs",
|
|
3
|
-
"version": "21.1.0-canary.
|
|
3
|
+
"version": "21.1.0-canary.34",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"react-dom": "^18.1.0"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@sitecore-jss/sitecore-jss": "^21.1.0-canary.
|
|
74
|
-
"@sitecore-jss/sitecore-jss-dev-tools": "^21.1.0-canary.
|
|
75
|
-
"@sitecore-jss/sitecore-jss-react": "^21.1.0-canary.
|
|
73
|
+
"@sitecore-jss/sitecore-jss": "^21.1.0-canary.34",
|
|
74
|
+
"@sitecore-jss/sitecore-jss-dev-tools": "^21.1.0-canary.34",
|
|
75
|
+
"@sitecore-jss/sitecore-jss-react": "^21.1.0-canary.34",
|
|
76
76
|
"node-html-parser": "^6.0.0",
|
|
77
77
|
"prop-types": "^15.7.2",
|
|
78
78
|
"regex-parser": "^2.2.11",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
},
|
|
81
81
|
"description": "",
|
|
82
82
|
"types": "types/index.d.ts",
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "c03ac945ee5c9b0d532168244a1cd7e18e4e8e69",
|
|
84
84
|
"files": [
|
|
85
85
|
"dist",
|
|
86
86
|
"types",
|