inertiax-svelte 11.0.39 → 11.0.40

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.
@@ -243,6 +243,24 @@
243
243
  },
244
244
  })
245
245
 
246
+ // Handle 409 conflict responses (version mismatch / external redirect)
247
+ if (response.status === 409) {
248
+ const location = response.headers?.['x-inertia-location']
249
+ const redirect = response.headers?.['x-inertia-redirect']
250
+
251
+ if (location || redirect) {
252
+ if (frameId !== DEFAULT_FRAME_ID) {
253
+ // Non-top frames can't redirect the browser — reload the page so
254
+ // the app recovers at the document level.
255
+ window.location.reload()
256
+ } else {
257
+ window.location.href = location || redirect
258
+ }
259
+
260
+ return
261
+ }
262
+ }
263
+
246
264
  let data: any = response.data
247
265
  if (typeof data === 'string') {
248
266
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inertiax-svelte",
3
- "version": "11.0.39",
3
+ "version": "11.0.40",
4
4
  "license": "MIT",
5
5
  "description": "The Svelte adapter for Inertia.js",
6
6
  "contributors": [
@@ -38,27 +38,27 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@sveltejs/adapter-auto": "^7.0.1",
41
- "@sveltejs/kit": "^2.65.0",
41
+ "@sveltejs/kit": "^2.70.1",
42
42
  "@sveltejs/package": "^2.5.8",
43
- "@sveltejs/vite-plugin-svelte": "^7.1.2",
43
+ "@sveltejs/vite-plugin-svelte": "^7.2.0",
44
44
  "es-check": "9.5.3",
45
45
  "publint": "^0.3.21",
46
- "svelte": "^5.56.3",
47
- "svelte-check": "^4.6.0",
46
+ "svelte": "^5.56.7",
47
+ "svelte-check": "^4.7.3",
48
48
  "tslib": "^2.8.1",
49
49
  "typescript": "^6.0.3",
50
- "vite": "^8.0.16"
50
+ "vite": "^8.1.5"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "svelte": "^5.0.0"
54
54
  },
55
55
  "dependencies": {
56
- "es-toolkit": "^1.47.1",
56
+ "es-toolkit": "^1.49.0",
57
57
  "laravel-precognition": "^2.0.0",
58
- "inertiax-core": "11.0.38"
58
+ "inertiax-core": "11.0.40"
59
59
  },
60
60
  "scripts": {
61
- "build": "pnpm package && svelte-check --tsconfig ./tsconfig.json && publint",
61
+ "build": "pnpm package && svelte-check --tsconfig ./tsconfig.json",
62
62
  "build:with-deps": "svelte-kit sync && vite build --config vite-with-deps.config.js",
63
63
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
64
64
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",