@inertiajs/svelte 2.3.0 → 2.3.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.
@@ -22,7 +22,7 @@ export default async function createInertiaApp({ id = 'app', resolve, setup, pro
22
22
  const { html, head, css } = svelteApp;
23
23
  return {
24
24
  body: useScriptElementForInitialPage
25
- ? `<script data-page="${id}" type="application/json">${JSON.stringify(initialPage)}</script><div data-server-rendered="true" id="${id}">${html}</div>`
25
+ ? `<script data-page="${id}" type="application/json">${JSON.stringify(initialPage).replace(/\//g, '\\/')}</script><div data-server-rendered="true" id="${id}">${html}</div>`
26
26
  : `<div data-server-rendered="true" id="${id}" data-page="${escape(JSON.stringify(initialPage))}">${html}</div>`,
27
27
  head: [head, css ? `<style data-vite-css>${css.code}</style>` : ''],
28
28
  };
package/dist/useForm.js CHANGED
@@ -26,7 +26,7 @@ export default function useForm(...args) {
26
26
  const validator = createValidator((client) => {
27
27
  const { method, url } = precognitionEndpoint();
28
28
  const form = formWithPrecognition();
29
- const transformedData = transform(form.data());
29
+ const transformedData = cloneDeep(transform(form.data()));
30
30
  return client[method](url, transformedData);
31
31
  }, cloneDeep(defaults));
32
32
  validatorRef = validator;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inertiajs/svelte",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "license": "MIT",
5
5
  "description": "The Svelte adapter for Inertia.js",
6
6
  "contributors": [
@@ -55,7 +55,7 @@
55
55
  "@types/lodash-es": "^4.17.12",
56
56
  "laravel-precognition": "^1.0.0",
57
57
  "lodash-es": "^4.17.21",
58
- "@inertiajs/core": "2.3.0"
58
+ "@inertiajs/core": "2.3.1"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "pnpm package && svelte-check --tsconfig ./tsconfig.json && publint",