@prismicio/svelte 3.0.0-pr.70.0fcf71f → 3.0.0-pr.71.0f237fd

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.
@@ -23,7 +23,7 @@
23
23
 
24
24
  const { repositoryName, routePrefix = "preview", routePrefixName = routePrefix }: Props = $props()
25
25
 
26
- const toolbarSrc = $derived(getToolbarSrc(repositoryName))
26
+ const toolbarSrc = $derived(getToolbarSrc(repositoryName, { version: 5 }))
27
27
 
28
28
  /** Set to `true` when the next `beforeNavigate()` call should not prefix the route. */
29
29
  let endingPreview = $state(false)
@@ -34,6 +34,14 @@ export const redirectToPreviewURL = async (config) => {
34
34
  httpOnly: false,
35
35
  });
36
36
  }
37
+ // The toolbar's `v=5` flow follows the preview session with this cookie.
38
+ const session = new URL(config.request.url).searchParams.get("session");
39
+ if (session) {
40
+ config.cookies.set(prismic.cookie.previewSession, session, {
41
+ path: "/",
42
+ httpOnly: false,
43
+ });
44
+ }
37
45
  return new Response(undefined, {
38
46
  status: 307,
39
47
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/svelte",
3
- "version": "3.0.0-pr.70.0fcf71f",
3
+ "version": "3.0.0-pr.71.0f237fd",
4
4
  "description": "Svelte components to present Prismic content.",
5
5
  "keywords": [
6
6
  "prismic",
@@ -62,7 +62,7 @@
62
62
  "esm-env": "^1.2.2"
63
63
  },
64
64
  "devDependencies": {
65
- "@prismicio/client": "^7.22.3",
65
+ "@prismicio/client": "7.22.3-pr.477.9eb2102",
66
66
  "@prismicio/mock": "^0.7.2",
67
67
  "@sveltejs/kit": "^3.0.1",
68
68
  "@sveltejs/package": "^3.0.1",
@@ -80,7 +80,7 @@
80
80
  "vitest": "^5.0.5"
81
81
  },
82
82
  "peerDependencies": {
83
- "@prismicio/client": ">=7",
83
+ "@prismicio/client": "^7.23.0",
84
84
  "@sveltejs/kit": "^3.0.0",
85
85
  "svelte": "^5.16.0"
86
86
  },
@@ -89,6 +89,9 @@
89
89
  "optional": true
90
90
  }
91
91
  },
92
+ "overrides": {
93
+ "@prismicio/client": "$@prismicio/client"
94
+ },
92
95
  "engines": {
93
96
  "node": ">=22"
94
97
  }
@@ -23,7 +23,7 @@
23
23
 
24
24
  const { repositoryName, routePrefix = "preview", routePrefixName = routePrefix }: Props = $props()
25
25
 
26
- const toolbarSrc = $derived(getToolbarSrc(repositoryName))
26
+ const toolbarSrc = $derived(getToolbarSrc(repositoryName, { version: 5 }))
27
27
 
28
28
  /** Set to `true` when the next `beforeNavigate()` call should not prefix the route. */
29
29
  let endingPreview = $state(false)
@@ -69,6 +69,15 @@ export const redirectToPreviewURL = async (
69
69
  })
70
70
  }
71
71
 
72
+ // The toolbar's `v=5` flow follows the preview session with this cookie.
73
+ const session = new URL(config.request.url).searchParams.get("session")
74
+ if (session) {
75
+ config.cookies.set(prismic.cookie.previewSession, session, {
76
+ path: "/",
77
+ httpOnly: false,
78
+ })
79
+ }
80
+
72
81
  return new Response(undefined, {
73
82
  status: 307,
74
83
  headers: {