diff --git a/CHANGELOG.md b/CHANGELOG.md index 96f23bfd1..47d79c631 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,12 @@ For changes prior to v1.0.0, see the [legacy releases](https://legacy.inertiajs. ## [Unreleased](https://github.com/inertiajs/inertia/compare/v1.0.12...HEAD) -- Nothing! +- Nothing + +## [v1.0.13](https://github.com/inertiajs/inertia/compare/v1.0.12...v1.0.13) + +- Clear errors on form reset ([#1568](https://github.com/inertiajs/inertia/pull/1568)) +- Fix Link type in React ([#1659](https://github.com/inertiajs/inertia/pull/1659)) ## [v1.0.12](https://github.com/inertiajs/inertia/compare/v1.0.11...v1.0.12) diff --git a/package-lock.json b/package-lock.json index d8dfe35ce..085bbfebb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,12 +40,13 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", - "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.5" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" @@ -91,12 +92,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5", + "@babel/types": "^7.23.0", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -125,22 +126,22 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", - "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/template": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" @@ -211,9 +212,9 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz", - "integrity": "sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { "@babel/types": "^7.22.5" @@ -232,9 +233,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" @@ -264,13 +265,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -278,9 +279,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.5.tgz", - "integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "devOptional": true, "bin": { "parser": "bin/babel-parser.js" @@ -320,33 +321,33 @@ } }, "node_modules/@babel/template": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", - "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", - "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/types": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -355,13 +356,13 @@ } }, "node_modules/@babel/types": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -2559,9 +2560,9 @@ } }, "node_modules/postcss": { - "version": "8.4.24", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz", - "integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "devOptional": true, "funding": [ { @@ -3951,7 +3952,7 @@ }, "packages/core": { "name": "@inertiajs/core", - "version": "1.0.12", + "version": "1.0.13", "license": "MIT", "dependencies": { "axios": "^1.2.0", @@ -3984,10 +3985,10 @@ }, "packages/react": { "name": "@inertiajs/react", - "version": "1.0.12", + "version": "1.0.13", "license": "MIT", "dependencies": { - "@inertiajs/core": "1.0.12", + "@inertiajs/core": "1.0.13", "lodash.isequal": "^4.5.0" }, "devDependencies": { @@ -4016,10 +4017,10 @@ }, "packages/svelte": { "name": "@inertiajs/svelte", - "version": "1.0.12", + "version": "1.0.13", "license": "MIT", "dependencies": { - "@inertiajs/core": "1.0.12", + "@inertiajs/core": "1.0.13", "lodash.clonedeep": "^4.5.0", "lodash.isequal": "^4.5.0" }, @@ -4029,10 +4030,10 @@ }, "packages/vue2": { "name": "@inertiajs/vue2", - "version": "1.0.12", + "version": "1.0.13", "license": "MIT", "dependencies": { - "@inertiajs/core": "1.0.12", + "@inertiajs/core": "1.0.13", "lodash.clonedeep": "^4.5.0", "lodash.isequal": "^4.5.0" }, @@ -4060,10 +4061,10 @@ }, "packages/vue3": { "name": "@inertiajs/vue3", - "version": "1.0.12", + "version": "1.0.13", "license": "MIT", "dependencies": { - "@inertiajs/core": "1.0.12", + "@inertiajs/core": "1.0.13", "lodash.clonedeep": "^4.5.0", "lodash.isequal": "^4.5.0" }, @@ -4126,7 +4127,7 @@ "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", - "postcss": "^8.4.20", + "postcss": "^8.4.31", "react": "^18.2.0", "react-dom": "^18.2.0", "tailwindcss": "^3.2.4", @@ -4156,7 +4157,7 @@ "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", - "postcss": "^8.4.20", + "postcss": "^8.4.31", "svelte": "^4.0.0", "tailwindcss": "^3.2.4", "vite": "^4.0.5" @@ -4172,7 +4173,7 @@ "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", - "postcss": "^8.4.20", + "postcss": "^8.4.31", "tailwindcss": "^3.2.4", "vite": "^4.0.5", "vue": "^2.7.14", @@ -4190,7 +4191,7 @@ "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", - "postcss": "^8.4.20", + "postcss": "^8.4.31", "tailwindcss": "^3.2.4", "typescript": "^4.9.4", "vite": "^4.0.5", @@ -4268,12 +4269,13 @@ } }, "@babel/code-frame": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", - "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "requires": { - "@babel/highlight": "^7.22.5" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" } }, "@babel/compat-data": { @@ -4306,12 +4308,12 @@ } }, "@babel/generator": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "requires": { - "@babel/types": "^7.22.5", + "@babel/types": "^7.23.0", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -4331,19 +4333,19 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", - "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true }, "@babel/helper-function-name": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "requires": { - "@babel/template": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" } }, "@babel/helper-hoist-variables": { @@ -4396,9 +4398,9 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz", - "integrity": "sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "requires": { "@babel/types": "^7.22.5" @@ -4411,9 +4413,9 @@ "dev": true }, "@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true }, "@babel/helper-validator-option": { @@ -4434,20 +4436,20 @@ } }, "@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.5.tgz", - "integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "devOptional": true }, "@babel/plugin-transform-react-jsx-self": { @@ -4469,42 +4471,42 @@ } }, "@babel/template": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", - "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "requires": { - "@babel/code-frame": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" } }, "@babel/traverse": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", - "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", "dev": true, "requires": { - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/types": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" } }, @@ -4689,7 +4691,7 @@ "@inertiajs/react": { "version": "file:packages/react", "requires": { - "@inertiajs/core": "1.0.12", + "@inertiajs/core": "1.0.13", "@types/react": "^16.9.1", "@types/react-dom": "^16.9.17", "esbuild": "^0.16.13", @@ -4717,7 +4719,7 @@ "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", - "postcss": "^8.4.20", + "postcss": "^8.4.31", "react": "^18.2.0", "react-dom": "^18.2.0", "tailwindcss": "^3.2.4", @@ -4736,7 +4738,7 @@ "@inertiajs/svelte": { "version": "file:packages/svelte", "requires": { - "@inertiajs/core": "1.0.12", + "@inertiajs/core": "1.0.13", "lodash.clonedeep": "^4.5.0", "lodash.isequal": "^4.5.0" } @@ -4750,7 +4752,7 @@ "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", - "postcss": "^8.4.20", + "postcss": "^8.4.31", "svelte": "^4.0.0", "tailwindcss": "^3.2.4", "vite": "^4.0.5" @@ -4759,7 +4761,7 @@ "@inertiajs/vue2": { "version": "file:packages/vue2", "requires": { - "@inertiajs/core": "1.0.12", + "@inertiajs/core": "1.0.13", "esbuild": "^0.16.13", "lodash.clonedeep": "^4.5.0", "lodash.isequal": "^4.5.0", @@ -4785,7 +4787,7 @@ "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", - "postcss": "^8.4.20", + "postcss": "^8.4.31", "tailwindcss": "^3.2.4", "vite": "^4.0.5", "vue": "^2.7.14", @@ -4795,7 +4797,7 @@ "@inertiajs/vue3": { "version": "file:packages/vue3", "requires": { - "@inertiajs/core": "1.0.12", + "@inertiajs/core": "1.0.13", "esbuild": "^0.16.13", "lodash.clonedeep": "^4.5.0", "lodash.isequal": "^4.5.0", @@ -4845,7 +4847,7 @@ "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", - "postcss": "^8.4.20", + "postcss": "^8.4.31", "tailwindcss": "^3.2.4", "typescript": "^4.9.4", "vite": "^4.0.5", @@ -6287,9 +6289,9 @@ "dev": true }, "postcss": { - "version": "8.4.24", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz", - "integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "devOptional": true, "requires": { "nanoid": "^3.3.6", diff --git a/packages/core/package.json b/packages/core/package.json index 3d38cb298..6f285ac22 100755 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@inertiajs/core", - "version": "1.0.12", + "version": "1.0.13", "license": "MIT", "description": "A framework for creating server-driven single page apps.", "contributors": [ diff --git a/packages/react/package.json b/packages/react/package.json index da5241476..3c9704976 100755 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@inertiajs/react", - "version": "1.0.12", + "version": "1.0.13", "license": "MIT", "description": "The React adapter for Inertia.js", "contributors": [ @@ -59,7 +59,7 @@ "react": "^16.9.0 || ^17.0.0 || ^18.0.0" }, "dependencies": { - "@inertiajs/core": "1.0.12", + "@inertiajs/core": "1.0.13", "lodash.isequal": "^4.5.0" } } diff --git a/packages/react/src/Link.ts b/packages/react/src/Link.ts index 0ced488b0..d92d81d0d 100755 --- a/packages/react/src/Link.ts +++ b/packages/react/src/Link.ts @@ -37,9 +37,7 @@ export type InertiaLinkProps = BaseInertiaLinkProps & Omit, keyof BaseInertiaLinkProps> & Omit, keyof BaseInertiaLinkProps> -type InertiaLink = React.FunctionComponent - -const Link: InertiaLink = forwardRef( +const Link = forwardRef( ( { children, diff --git a/packages/react/src/useForm.ts b/packages/react/src/useForm.ts index 22af09f4a..6e88ac049 100644 --- a/packages/react/src/useForm.ts +++ b/packages/react/src/useForm.ts @@ -166,6 +166,20 @@ export default function useForm( [data, setErrors], ) + function clearErrors(...fields) { + setErrors((errors) => { + const newErrors = (Object.keys(errors) as Array).reduce( + (carry, field) => ({ + ...carry, + ...(fields.length > 0 && !fields.includes(field) ? { [field]: errors[field] } : {}), + }), + {}, + ) + setHasErrors(Object.keys(newErrors).length > 0) + return newErrors + }) + } + return { data, setData(keyOrData: keyof TForm | Function | TForm, maybeValue?: TForm[keyof TForm]) { @@ -200,6 +214,8 @@ export default function useForm( reset(...fields) { if (fields.length === 0) { setData(defaults) + setErrors({}) + setHasErrors(false) } else { setData( (Object.keys(defaults) as Array) @@ -212,6 +228,7 @@ export default function useForm( { ...data }, ), ) + clearErrors(...fields) } }, setError(fieldOrFields: keyof TForm | Record, maybeValue?: string) { @@ -226,19 +243,7 @@ export default function useForm( return newErrors }) }, - clearErrors(...fields) { - setErrors((errors) => { - const newErrors = (Object.keys(errors) as Array).reduce( - (carry, field) => ({ - ...carry, - ...(fields.length > 0 && !fields.includes(field) ? { [field]: errors[field] } : {}), - }), - {}, - ) - setHasErrors(Object.keys(newErrors).length > 0) - return newErrors - }) - }, + clearErrors, submit, get(url, options) { submit('get', url, options) diff --git a/packages/svelte/package.json b/packages/svelte/package.json index e3f98a59c..95415fc3b 100755 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@inertiajs/svelte", - "version": "1.0.12", + "version": "1.0.13", "license": "MIT", "description": "The Svelte adapter for Inertia.js", "contributors": [ @@ -28,7 +28,7 @@ "svelte": "^3.20.0 || ^4.0.0" }, "dependencies": { - "@inertiajs/core": "1.0.12", + "@inertiajs/core": "1.0.13", "lodash.clonedeep": "^4.5.0", "lodash.isequal": "^4.5.0" } diff --git a/packages/svelte/src/useForm.js b/packages/svelte/src/useForm.js index d624f65d6..37978c1ad 100644 --- a/packages/svelte/src/useForm.js +++ b/packages/svelte/src/useForm.js @@ -1,6 +1,6 @@ import { router } from '@inertiajs/core' -import isEqual from 'lodash.isequal' import cloneDeep from 'lodash.clonedeep' +import isEqual from 'lodash.isequal' import { writable } from 'svelte/store' function useForm(...args) { @@ -52,6 +52,7 @@ function useForm(...args) { let clonedDefaults = cloneDeep(defaults) if (fields.length === 0) { this.setStore(clonedDefaults) + this.clearErrors() } else { this.setStore( Object.keys(clonedDefaults) @@ -61,6 +62,7 @@ function useForm(...args) { return carry }, {}), ) + this.clearErrors(...fields) } return this diff --git a/packages/vue2/package.json b/packages/vue2/package.json index 4487fc5c5..c4099ee81 100755 --- a/packages/vue2/package.json +++ b/packages/vue2/package.json @@ -1,6 +1,6 @@ { "name": "@inertiajs/vue2", - "version": "1.0.12", + "version": "1.0.13", "license": "MIT", "description": "The Vue 2 adapter for Inertia.js", "contributors": [ @@ -58,7 +58,7 @@ "vue": "^2.7.0" }, "dependencies": { - "@inertiajs/core": "1.0.12", + "@inertiajs/core": "1.0.13", "lodash.clonedeep": "^4.5.0", "lodash.isequal": "^4.5.0" } diff --git a/packages/vue2/src/useForm.ts b/packages/vue2/src/useForm.ts index 20a2ebc25..4b7bf1a01 100644 --- a/packages/vue2/src/useForm.ts +++ b/packages/vue2/src/useForm.ts @@ -88,6 +88,7 @@ export default function useForm(...args): InertiaFor if (fields.length === 0) { defaults = clonedData Object.assign(this, resolvedData) + this.clearErrors() } else { Object.keys(resolvedData) .filter((key) => fields.includes(key)) @@ -95,6 +96,7 @@ export default function useForm(...args): InertiaFor defaults[key] = clonedData[key] this[key] = resolvedData[key] }) + this.clearErrors(...fields) } return this diff --git a/packages/vue2/tests/cypress/integration/form-helper.test.js b/packages/vue2/tests/cypress/integration/form-helper.test.js index c0b05208e..a872cdd97 100644 --- a/packages/vue2/tests/cypress/integration/form-helper.test.js +++ b/packages/vue2/tests/cypress/integration/form-helper.test.js @@ -340,7 +340,7 @@ describe('Form Helper', () => { cy.get('#remember').should('be.checked') }) - it('does not reset errors when it resets a field to its initial value', () => { + it('resets error when it resets a field to its initial value', () => { cy.get('#name').clear().type('A') cy.get('#handle').clear().type('B') cy.get('#remember').check() @@ -361,11 +361,11 @@ describe('Form Helper', () => { cy.get('#remember').should('be.checked') cy.get('.errors-status').should('have.text', 'Form has errors') cy.get('.name_error').should('have.text', 'Some name error') - cy.get('.handle_error').should('have.text', 'The Handle was invalid') + cy.get('.handle_error').should('not.exist') cy.get('.remember_error').should('not.exist') }) - it('does not reset errors when it resets all fields to their initial values', () => { + it('reset errors when it resets all fields to their initial values', () => { cy.get('#name').clear().type('A') cy.get('#handle').clear().type('B') cy.get('#remember').check() @@ -379,14 +379,14 @@ describe('Form Helper', () => { cy.get('.name_error').should('have.text', 'Some name error') cy.get('.handle_error').should('have.text', 'The Handle was invalid') - cy.get('.reset-one').click() + cy.get('.reset').click() - cy.get('#name').should('have.value', 'A') + cy.get('#name').should('have.value', 'foo') cy.get('#handle').should('have.value', 'example') - cy.get('#remember').should('be.checked') - cy.get('.errors-status').should('have.text', 'Form has errors') - cy.get('.name_error').should('have.text', 'Some name error') - cy.get('.handle_error').should('have.text', 'The Handle was invalid') + cy.get('#remember').should('not.be.checked') + cy.get('.errors-status').should('have.text', 'Form has no errors') + cy.get('.name_error').should('not.exist') + cy.get('.handle_error').should('not.exist') cy.get('.remember_error').should('not.exist') }) diff --git a/packages/vue2/tests/cypress/integration/remember.test.js b/packages/vue2/tests/cypress/integration/remember.test.js index 93fa31019..b5baf7c3b 100644 --- a/packages/vue2/tests/cypress/integration/remember.test.js +++ b/packages/vue2/tests/cypress/integration/remember.test.js @@ -273,7 +273,7 @@ describe('Remember (local state caching)', () => { cy.get('#remember').should('be.checked') cy.get('#untracked').should('have.value', 'C') // Unchanged from above cy.get('.name_error').should('not.exist') - cy.get('.handle_error').should('have.text', 'The Handle was invalid') + cy.get('.handle_error').should('not.exist') cy.get('.remember_error').should('not.exist') cy.get('.link').click() @@ -287,7 +287,7 @@ describe('Remember (local state caching)', () => { cy.get('#remember').should('be.checked') cy.get('#untracked').should('not.have.value', 'C') // Untracked, so now reset (page state was lost) cy.get('.name_error').should('not.exist') - cy.get('.handle_error').should('have.text', 'The Handle was invalid') + cy.get('.handle_error').should('not.exist') cy.get('.remember_error').should('not.exist') }) }) diff --git a/packages/vue3/package.json b/packages/vue3/package.json index c7b59b478..0678f4b1e 100755 --- a/packages/vue3/package.json +++ b/packages/vue3/package.json @@ -1,6 +1,6 @@ { "name": "@inertiajs/vue3", - "version": "1.0.12", + "version": "1.0.13", "license": "MIT", "description": "The Vue 3 adapter for Inertia.js", "contributors": [ @@ -56,7 +56,7 @@ "vue": "^3.0.0" }, "dependencies": { - "@inertiajs/core": "1.0.12", + "@inertiajs/core": "1.0.13", "lodash.clonedeep": "^4.5.0", "lodash.isequal": "^4.5.0" } diff --git a/packages/vue3/src/useForm.ts b/packages/vue3/src/useForm.ts index d617a80c7..665eaf794 100644 --- a/packages/vue3/src/useForm.ts +++ b/packages/vue3/src/useForm.ts @@ -95,6 +95,7 @@ export default function useForm( if (fields.length === 0) { defaults = clonedData Object.assign(this, resolvedData) + this.clearErrors() } else { Object.keys(resolvedData) .filter((key) => fields.includes(key)) @@ -102,6 +103,7 @@ export default function useForm( defaults[key] = clonedData[key] this[key] = resolvedData[key] }) + this.clearErrors(...fields) } return this diff --git a/playgrounds/react/package.json b/playgrounds/react/package.json index f581ec797..4cca2fb34 100644 --- a/playgrounds/react/package.json +++ b/playgrounds/react/package.json @@ -14,7 +14,7 @@ "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", - "postcss": "^8.4.20", + "postcss": "^8.4.31", "react": "^18.2.0", "react-dom": "^18.2.0", "tailwindcss": "^3.2.4", diff --git a/playgrounds/svelte/package.json b/playgrounds/svelte/package.json index 78e1f248f..705a8eda2 100644 --- a/playgrounds/svelte/package.json +++ b/playgrounds/svelte/package.json @@ -13,7 +13,7 @@ "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", - "postcss": "^8.4.20", + "postcss": "^8.4.31", "svelte": "^4.0.0", "tailwindcss": "^3.2.4", "vite": "^4.0.5" diff --git a/playgrounds/vue2/package.json b/playgrounds/vue2/package.json index a6859304e..0c4ba85a1 100644 --- a/playgrounds/vue2/package.json +++ b/playgrounds/vue2/package.json @@ -13,7 +13,7 @@ "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", - "postcss": "^8.4.20", + "postcss": "^8.4.31", "tailwindcss": "^3.2.4", "vite": "^4.0.5", "vue": "^2.7.14", diff --git a/playgrounds/vue3/package.json b/playgrounds/vue3/package.json index 04e520fe7..35fe0fc07 100644 --- a/playgrounds/vue3/package.json +++ b/playgrounds/vue3/package.json @@ -14,7 +14,7 @@ "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", - "postcss": "^8.4.20", + "postcss": "^8.4.31", "tailwindcss": "^3.2.4", "typescript": "^4.9.4", "vite": "^4.0.5",