@comet/site-nextjs 8.20.2 → 9.0.0-beta.1

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.
@@ -13,7 +13,11 @@ const DamFileDownloadLinkBlock = withPreview(
13
13
  const href = file.fileUrl;
14
14
  const target = openFileType === "NewTab" ? "_blank" : anchorProps.target;
15
15
  if (legacyBehavior) {
16
- return cloneElement(children, { ...anchorProps, href, target });
16
+ return cloneElement(children, {
17
+ ...anchorProps,
18
+ href,
19
+ target
20
+ });
17
21
  }
18
22
  return /* @__PURE__ */ jsx("a", { ...anchorProps, href, target, children });
19
23
  },
@@ -9,7 +9,10 @@ const EmailLinkBlock = ({ data: { email }, children, legacyBehavior, ...anchorPr
9
9
  }
10
10
  const href = `mailto:${email}`;
11
11
  if (legacyBehavior) {
12
- return cloneElement(children, { ...anchorProps, href });
12
+ return cloneElement(children, {
13
+ ...anchorProps,
14
+ href
15
+ });
13
16
  }
14
17
  return /* @__PURE__ */ jsx("a", { ...anchorProps, href, children });
15
18
  };
@@ -17,7 +17,11 @@ function ExternalLinkBlock({ data: { targetUrl, openInNewWindow }, children, leg
17
17
  }
18
18
  };
19
19
  if (legacyBehavior) {
20
- return cloneElement(children, { ...anchorProps, href: "#", onClick });
20
+ return cloneElement(children, {
21
+ ...anchorProps,
22
+ href: "#",
23
+ onClick
24
+ });
21
25
  }
22
26
  return /* @__PURE__ */ jsx("a", { ...anchorProps, href: "#", onClick, children });
23
27
  } else {
@@ -30,7 +34,11 @@ function ExternalLinkBlock({ data: { targetUrl, openInNewWindow }, children, leg
30
34
  const href = targetUrl;
31
35
  const target = openInNewWindow ? "_blank" : anchorProps.target;
32
36
  if (legacyBehavior) {
33
- return cloneElement(children, { ...anchorProps, href, target });
37
+ return cloneElement(children, {
38
+ ...anchorProps,
39
+ href,
40
+ target
41
+ });
34
42
  }
35
43
  return /* @__PURE__ */ jsx("a", { ...anchorProps, href, target, children });
36
44
  }
@@ -9,7 +9,10 @@ const PhoneLinkBlock = ({ data: { phone }, children, legacyBehavior, ...anchorPr
9
9
  }
10
10
  const href = `tel:${phone}`;
11
11
  if (legacyBehavior) {
12
- return cloneElement(children, { ...anchorProps, href });
12
+ return cloneElement(children, {
13
+ ...anchorProps,
14
+ href
15
+ });
13
16
  }
14
17
  return /* @__PURE__ */ jsx("a", { ...anchorProps, href, children });
15
18
  };
@@ -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 middleware.ts (see https://github.com/vercel/next.js/issues/52080)
17
+ * @param options.skipDraftModeCheck Allows skipping the draft mode check, only required when called from proxy.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
- cookies().set("__comet_site_preview", jwt, { httpOnly: true, sameSite: "lax" });
18
- draftMode().enable();
17
+ (await cookies()).set("__comet_site_preview", jwt, { httpOnly: true, sameSite: "lax" });
18
+ (await draftMode()).enable();
19
19
  }
20
20
  async function previewParams(options = { skipDraftModeCheck: false }) {
21
21
  if (options.skipDraftModeCheck) {
22
- const headers$1 = headers();
22
+ const headers$1 = await 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 (!draftMode().isEnabled) return null;
28
+ if (!(await draftMode()).isEnabled) return null;
29
29
  }
30
- const cookie = cookies().get("__comet_site_preview");
30
+ const cookie = (await 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": "8.20.2",
3
+ "version": "9.0.0-beta.1",
4
4
  "description": "Comet Site Next.js package",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,28 +20,26 @@
20
20
  "./css": "./lib/style.css",
21
21
  "./webpackPersistedQueriesLoader": "./lib/site-react/lib/persistedQueries/webpackPersistedQueriesLoader.js"
22
22
  },
23
- "module": "./lib/index.js",
24
- "types": "lib/index.d.ts",
25
23
  "files": [
26
24
  "lib/*"
27
25
  ],
28
26
  "dependencies": {
29
27
  "jose": "^5.10.0",
30
28
  "server-only": "^0.0.1",
31
- "@comet/site-react": "8.20.2"
29
+ "@comet/site-react": "9.0.0-beta.1"
32
30
  },
33
31
  "devDependencies": {
34
- "@types/react": "^18.3.27",
35
- "@types/react-dom": "^18.3.7",
32
+ "@types/react": "^19.2.10",
33
+ "@types/react-dom": "^19.2.3",
36
34
  "@vitejs/plugin-react": "^4.7.0",
37
35
  "chokidar-cli": "^3.0.0",
38
36
  "eslint": "^9.39.2",
39
37
  "jsdom": "^28.0.0",
40
- "next": "^14.2.35",
38
+ "next": "^16.0.3",
41
39
  "npm-run-all2": "^8.0.4",
42
40
  "prettier": "^3.6.2",
43
- "react": "^18.3.1",
44
- "react-dom": "^18.3.1",
41
+ "react": "^19.2.4",
42
+ "react-dom": "^19.2.4",
45
43
  "rimraf": "^6.1.2",
46
44
  "rollup": "^4.44.2",
47
45
  "rollup-plugin-preserve-directives": "^0.4.0",
@@ -50,13 +48,13 @@
50
48
  "vite": "^5.4.21",
51
49
  "vite-plugin-dts": "^4.5.4",
52
50
  "vitest": "^4.0.16",
53
- "@comet/cli": "8.20.2",
54
- "@comet/eslint-config": "8.20.2"
51
+ "@comet/cli": "9.0.0-beta.1",
52
+ "@comet/eslint-config": "9.0.0-beta.1"
55
53
  },
56
54
  "peerDependencies": {
57
- "next": "^14.2.35",
58
- "react": "^18.0.0",
59
- "react-dom": "^18.0.0"
55
+ "next": "^16.0.0",
56
+ "react": "^19.0.0",
57
+ "react-dom": "^19.0.0"
60
58
  },
61
59
  "engines": {
62
60
  "node": ">=18.0.0"