next-sanity 12.3.1 → 12.3.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.
@@ -1,5 +1,5 @@
1
1
  import { l as setComlink, u as setComlinkClientConfig } from "./context.js";
2
- import { useRouter } from "next/navigation.js";
2
+ import { useRouter } from "next/navigation";
3
3
  import { useEffect, useEffectEvent } from "react";
4
4
  import { createNode, createNodeMachine } from "@sanity/comlink";
5
5
  import { createCompatibilityActors } from "@sanity/presentation-comlink";
@@ -1,4 +1,4 @@
1
- import { useRouter } from "next/navigation.js";
1
+ import { useRouter } from "next/navigation";
2
2
  import { useEffect } from "react";
3
3
  const focusThrottleInterval = 5e3;
4
4
  function RefreshOnFocus() {
@@ -1,4 +1,4 @@
1
- import { useRouter } from "next/navigation.js";
1
+ import { useRouter } from "next/navigation";
2
2
  import { useEffect, useReducer } from "react";
3
3
  /**
4
4
  * Handles refreshing the page when the page is mounted,
@@ -1,4 +1,4 @@
1
- import { useRouter } from "next/navigation.js";
1
+ import { useRouter } from "next/navigation";
2
2
  import { useEffect } from "react";
3
3
  function RefreshOnReconnect() {
4
4
  const router = useRouter();
@@ -1,4 +1,4 @@
1
- import { usePathname, useRouter, useSearchParams } from "next/navigation.js";
1
+ import { usePathname, useRouter, useSearchParams } from "next/navigation";
2
2
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
3
  import { VisualEditing as VisualEditing$1 } from "@sanity/visual-editing/react";
4
4
  import { jsx } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  import { validatePreviewUrl } from "@sanity/preview-url-secret";
2
2
  import { perspectiveCookieName } from "@sanity/preview-url-secret/constants";
3
- import { cookies, draftMode } from "next/headers.js";
4
- import { redirect } from "next/navigation.js";
3
+ import { cookies, draftMode } from "next/headers";
4
+ import { redirect } from "next/navigation";
5
5
  /**
6
6
  * Sets up an API route for enabling draft mode, can be paired with the `previewUrl.previewMode.enable` in `sanity/presentation`.
7
7
  * Can also be used with `sanity-plugin-iframe-pane`.
@@ -1,4 +1,4 @@
1
- import { ImageLoader, ImageProps as ImageProps$1 } from "next/image.js";
1
+ import { ImageLoader, ImageProps as ImageProps$1 } from "next/image";
2
2
  /**
3
3
  * @alpha
4
4
  */
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import NextImage from "next/image.js";
2
+ import NextImage from "next/image";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  /**
5
5
  * @alpha
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { d as setEnvironment, f as setPerspective } from "../../../context.js";
3
3
  import { t as isCorsOriginError } from "../../../isCorsOriginError.js";
4
- import { useRouter } from "next/navigation.js";
4
+ import { useRouter } from "next/navigation";
5
5
  import { useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
6
6
  import { isMaybePresentation, isMaybePreviewWindow } from "@sanity/presentation-comlink";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  import { createClient } from "@sanity/client";
9
9
  import { revalidateSyncTags } from "next-sanity/live/server-actions";
10
- import dynamic from "next/dynamic.js";
10
+ import dynamic from "next/dynamic";
11
11
  const PresentationComlink = dynamic(() => import("../../../PresentationComlink.js"), { ssr: false });
12
12
  const RefreshOnMount = dynamic(() => import("../../../RefreshOnMount.js"), { ssr: false });
13
13
  const RefreshOnFocus = dynamic(() => import("../../../RefreshOnFocus.js"), { ssr: false });
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import dynamic from "next/dynamic.js";
3
+ import dynamic from "next/dynamic";
4
4
  /**
5
5
  * This file works around a new restriction in Next v15 where server components are not allowed
6
6
  * to use dynamic(() => import('...), {ssr: false})
@@ -1,8 +1,8 @@
1
1
  "use server";
2
2
  import { t as sanitizePerspective } from "../../utils.js";
3
3
  import { perspectiveCookieName } from "@sanity/preview-url-secret/constants";
4
- import { cookies, draftMode } from "next/headers.js";
5
- import { revalidateTag } from "next/cache.js";
4
+ import { cookies, draftMode } from "next/headers";
5
+ import { revalidateTag } from "next/cache";
6
6
  async function revalidateSyncTags(tags) {
7
7
  revalidateTag("sanity:fetch-sync-tags", "max");
8
8
  for (const _tag of tags) {
package/dist/live.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { t as isCorsOriginError } from "./isCorsOriginError.js";
2
2
  import { t as sanitizePerspective } from "./utils.js";
3
3
  import { perspectiveCookieName } from "@sanity/preview-url-secret/constants";
4
- import { cookies, draftMode } from "next/headers.js";
4
+ import { cookies, draftMode } from "next/headers";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import "@sanity/client";
7
7
  import SanityLiveClientComponent from "next-sanity/live/client-components/live";
8
8
  import SanityLiveStreamClientComponent from "next-sanity/live/client-components/live-stream";
9
- import { PHASE_PRODUCTION_BUILD } from "next/constants.js";
9
+ import { PHASE_PRODUCTION_BUILD } from "next/constants";
10
10
  import { preconnect, prefetchDNS } from "react-dom";
11
11
  /**
12
12
  * @internal
@@ -1,6 +1,6 @@
1
1
  "use server";
2
- import { draftMode } from "next/headers.js";
3
- import { revalidatePath } from "next/cache.js";
2
+ import { draftMode } from "next/headers";
3
+ import { revalidatePath } from "next/cache";
4
4
  async function revalidateRootLayout() {
5
5
  if (!(await draftMode()).isEnabled) {
6
6
  console.warn("Skipped revalidatePath request because draft mode is not enabled");
@@ -1,4 +1,4 @@
1
- import { NextRequest } from "next/server.js";
1
+ import { NextRequest } from "next/server";
2
2
  /** @public */
3
3
  type ParsedBody<T> = {
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-sanity",
3
- "version": "12.3.1",
3
+ "version": "12.3.2",
4
4
  "description": "Sanity.io toolkit for Next.js",
5
5
  "keywords": [
6
6
  "live",
@@ -64,7 +64,7 @@
64
64
  "@sanity/visual-editing": "^5.3.4",
65
65
  "@sanity/webhook": "^4.0.4",
66
66
  "dequal": "^2.0.3",
67
- "groq": "^5.22.0",
67
+ "groq": "^5.23.0",
68
68
  "history": "^5.3.0",
69
69
  "server-only": "^0.0.1"
70
70
  },
@@ -77,7 +77,7 @@
77
77
  "@vitejs/plugin-react": "^6.0.1",
78
78
  "@vitest/coverage-v8": "^4.1.5",
79
79
  "js-yaml": "^4.1.1",
80
- "next": "16.3.0-canary.2",
80
+ "next": "16.3.0-canary.5",
81
81
  "publint": "^0.3.18",
82
82
  "react": "^19.2.5",
83
83
  "react-dom": "^19.2.5",
@@ -85,7 +85,7 @@
85
85
  "tsdown": "^0.21.10",
86
86
  "typedoc": "^0.28.19",
87
87
  "typescript": "5.9.3",
88
- "vite": "^8.0.0",
88
+ "vite": "^8.0.10",
89
89
  "vitest": "^4.1.5",
90
90
  "vitest-package-exports": "^1.2.0"
91
91
  },
@@ -94,7 +94,7 @@
94
94
  "next": "^16.0.0-0",
95
95
  "react": "^19.2.3",
96
96
  "react-dom": "^19.2.3",
97
- "sanity": "^5.22.0",
97
+ "sanity": "^5.23.0",
98
98
  "styled-components": "^6.1"
99
99
  },
100
100
  "engines": {