@comet/site-nextjs 9.0.0-canary-20260119123708 → 9.0.0-canary-20260121085838
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/lib/site-react/lib/blocks/DamFileDownloadLinkBlock.js +1 -5
- package/lib/site-react/lib/blocks/EmailLinkBlock.js +1 -4
- package/lib/site-react/lib/blocks/ExternalLinkBlock.js +2 -8
- package/lib/site-react/lib/blocks/PhoneLinkBlock.js +1 -4
- package/lib/sitePreview/previewUtils.d.ts +1 -1
- package/lib/sitePreview/previewUtils.js +5 -5
- package/package.json +12 -12
|
@@ -13,11 +13,7 @@ const DamFileDownloadLinkBlock = withPreview(
|
|
|
13
13
|
const href = file.fileUrl;
|
|
14
14
|
const target = openFileType === "NewTab" ? "_blank" : void 0;
|
|
15
15
|
if (legacyBehavior) {
|
|
16
|
-
return cloneElement(children, {
|
|
17
|
-
href,
|
|
18
|
-
target,
|
|
19
|
-
title
|
|
20
|
-
});
|
|
16
|
+
return cloneElement(children, { href, target, title });
|
|
21
17
|
}
|
|
22
18
|
return /* @__PURE__ */ jsx("a", { href, target, title, className, children });
|
|
23
19
|
},
|
|
@@ -9,10 +9,7 @@ const EmailLinkBlock = ({ data: { email }, children, title, className, legacyBeh
|
|
|
9
9
|
}
|
|
10
10
|
const href = `mailto:${email}`;
|
|
11
11
|
if (legacyBehavior) {
|
|
12
|
-
return cloneElement(
|
|
13
|
-
children,
|
|
14
|
-
{ href, title }
|
|
15
|
-
);
|
|
12
|
+
return cloneElement(children, { href, title });
|
|
16
13
|
}
|
|
17
14
|
return /* @__PURE__ */ jsx("a", { href, title, className, children });
|
|
18
15
|
};
|
|
@@ -17,10 +17,7 @@ function ExternalLinkBlock({ data: { targetUrl, openInNewWindow }, children, tit
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
if (legacyBehavior) {
|
|
20
|
-
return cloneElement(
|
|
21
|
-
children,
|
|
22
|
-
{ href: "#", onClick, title }
|
|
23
|
-
);
|
|
20
|
+
return cloneElement(children, { href: "#", onClick, title });
|
|
24
21
|
}
|
|
25
22
|
return /* @__PURE__ */ jsx("a", { href: "#", onClick, title, className, children });
|
|
26
23
|
} else {
|
|
@@ -33,10 +30,7 @@ function ExternalLinkBlock({ data: { targetUrl, openInNewWindow }, children, tit
|
|
|
33
30
|
const href = targetUrl;
|
|
34
31
|
const target = openInNewWindow ? "_blank" : void 0;
|
|
35
32
|
if (legacyBehavior) {
|
|
36
|
-
return cloneElement(
|
|
37
|
-
children,
|
|
38
|
-
{ href, target, title }
|
|
39
|
-
);
|
|
33
|
+
return cloneElement(children, { href, target, title });
|
|
40
34
|
}
|
|
41
35
|
return /* @__PURE__ */ jsx("a", { href, target, title, className, children });
|
|
42
36
|
}
|
|
@@ -9,10 +9,7 @@ const PhoneLinkBlock = ({ data: { phone }, children, title, className, legacyBeh
|
|
|
9
9
|
}
|
|
10
10
|
const href = `tel:${phone}`;
|
|
11
11
|
if (legacyBehavior) {
|
|
12
|
-
return cloneElement(
|
|
13
|
-
children,
|
|
14
|
-
{ href, title }
|
|
15
|
-
);
|
|
12
|
+
return cloneElement(children, { href, title });
|
|
16
13
|
}
|
|
17
14
|
return /* @__PURE__ */ jsx("a", { href, title, className, children });
|
|
18
15
|
};
|
|
@@ -14,7 +14,7 @@ export declare function verifyJwt<T>(jwt: string): Promise<T | null>;
|
|
|
14
14
|
export declare function setSitePreviewParams(payload: SitePreviewParams): Promise<void>;
|
|
15
15
|
/**
|
|
16
16
|
* Helper for SitePreview
|
|
17
|
-
* @param options.skipDraftModeCheck Allows skipping the draft mode check, only required when called from
|
|
17
|
+
* @param options.skipDraftModeCheck Allows skipping the draft mode check, only required when called from middleware.ts (see https://github.com/vercel/next.js/issues/52080)
|
|
18
18
|
* @return If SitePreview is active the current preview settings
|
|
19
19
|
*/
|
|
20
20
|
export declare function previewParams(options?: {
|
|
@@ -14,20 +14,20 @@ async function verifyJwt(jwt) {
|
|
|
14
14
|
}
|
|
15
15
|
async function setSitePreviewParams(payload) {
|
|
16
16
|
const jwt = await new SignJWT(payload).setProtectedHeader({ alg: "HS256" }).setExpirationTime("1 day").sign(new TextEncoder().encode(process.env.SITE_PREVIEW_SECRET));
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
cookies().set("__comet_site_preview", jwt, { httpOnly: true, sameSite: "lax" });
|
|
18
|
+
draftMode().enable();
|
|
19
19
|
}
|
|
20
20
|
async function previewParams(options = { skipDraftModeCheck: false }) {
|
|
21
21
|
if (options.skipDraftModeCheck) {
|
|
22
|
-
const headers$1 =
|
|
22
|
+
const headers$1 = headers();
|
|
23
23
|
if (headers$1.has("x-block-preview")) {
|
|
24
24
|
return verifyJwt(headers$1.get("x-block-preview") || "");
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
if (!options.skipDraftModeCheck) {
|
|
28
|
-
if (!
|
|
28
|
+
if (!draftMode().isEnabled) return null;
|
|
29
29
|
}
|
|
30
|
-
const cookie =
|
|
30
|
+
const cookie = cookies().get("__comet_site_preview");
|
|
31
31
|
if (cookie) {
|
|
32
32
|
return verifyJwt(cookie.value);
|
|
33
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comet/site-nextjs",
|
|
3
|
-
"version": "9.0.0-canary-
|
|
3
|
+
"version": "9.0.0-canary-20260121085838",
|
|
4
4
|
"description": "Comet Site Next.js package",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,23 +28,23 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"jose": "^5.10.0",
|
|
30
30
|
"server-only": "^0.0.1",
|
|
31
|
-
"@comet/site-react": "9.0.0-canary-
|
|
31
|
+
"@comet/site-react": "9.0.0-canary-20260121085838"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/jest": "^29.5.14",
|
|
35
|
-
"@types/react": "^
|
|
36
|
-
"@types/react-dom": "^
|
|
35
|
+
"@types/react": "^18.3.27",
|
|
36
|
+
"@types/react-dom": "^18.3.7",
|
|
37
37
|
"@vitejs/plugin-react": "^4.7.0",
|
|
38
38
|
"chokidar-cli": "^3.0.0",
|
|
39
39
|
"eslint": "^9.30.1",
|
|
40
40
|
"jest": "^29.7.0",
|
|
41
41
|
"jest-environment-jsdom": "^29.7.0",
|
|
42
42
|
"jest-junit": "^16.0.0",
|
|
43
|
-
"next": "^
|
|
43
|
+
"next": "^14.2.30",
|
|
44
44
|
"npm-run-all2": "^8.0.4",
|
|
45
45
|
"prettier": "^3.6.2",
|
|
46
|
-
"react": "^
|
|
47
|
-
"react-dom": "^
|
|
46
|
+
"react": "^18.3.1",
|
|
47
|
+
"react-dom": "^18.3.1",
|
|
48
48
|
"rimraf": "^6.1.2",
|
|
49
49
|
"rollup": "^4.44.2",
|
|
50
50
|
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"typescript": "5.9.3",
|
|
54
54
|
"vite": "^5.4.21",
|
|
55
55
|
"vite-plugin-dts": "^4.5.4",
|
|
56
|
-
"@comet/cli": "9.0.0-canary-
|
|
57
|
-
"@comet/eslint-config": "9.0.0-canary-
|
|
56
|
+
"@comet/cli": "9.0.0-canary-20260121085838",
|
|
57
|
+
"@comet/eslint-config": "9.0.0-canary-20260121085838"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"next": "^
|
|
61
|
-
"react": "^
|
|
62
|
-
"react-dom": "^
|
|
60
|
+
"next": "^14.2.0",
|
|
61
|
+
"react": "^18.0.0",
|
|
62
|
+
"react-dom": "^18.0.0"
|
|
63
63
|
},
|
|
64
64
|
"engines": {
|
|
65
65
|
"node": ">=18.0.0"
|