@inertiajs/core 2.3.10 → 2.3.12

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.
package/dist/index.js CHANGED
@@ -942,6 +942,9 @@ var setHashIfSameUrl = (originUrl, destinationUrl) => {
942
942
  var isSameUrlWithoutHash = (url1, url2) => {
943
943
  return urlWithoutHash(url1).href === urlWithoutHash(url2).href;
944
944
  };
945
+ var isSameUrlWithoutQueryOrHash = (url1, url2) => {
946
+ return url1.origin === url2.origin && url1.pathname === url2.pathname;
947
+ };
945
948
  function isUrlMethodPair(href) {
946
949
  return href !== null && typeof href === "object" && href !== void 0 && "url" in href && "method" in href;
947
950
  }
@@ -2484,7 +2487,10 @@ var Router = class {
2484
2487
  if (events.onBefore(visit) === false || !fireBeforeEvent(visit)) {
2485
2488
  return;
2486
2489
  }
2487
- if (!isSameUrlWithoutHash(visit.url, hrefToUrl(page.get().url))) {
2490
+ const currentPageUrl = hrefToUrl(page.get().url);
2491
+ const isPartialReload = visit.only.length > 0 || visit.except.length > 0 || visit.reset.length > 0;
2492
+ const isSamePage = isPartialReload ? isSameUrlWithoutQueryOrHash(visit.url, currentPageUrl) : isSameUrlWithoutHash(visit.url, currentPageUrl);
2493
+ if (!isSamePage) {
2488
2494
  this.asyncRequestStream.cancelInFlight({ prefetch: false });
2489
2495
  }
2490
2496
  if (!visit.async) {
@@ -2808,6 +2814,7 @@ var UseFormUtils = class {
2808
2814
  /**
2809
2815
  * Parses all useForm() arguments into { rememberKey, data, precognitionEndpoint }.
2810
2816
  *
2817
+ * useForm()
2811
2818
  * useForm(data)
2812
2819
  * useForm(rememberKey, data)
2813
2820
  * useForm(method, url, data)
@@ -2815,6 +2822,13 @@ var UseFormUtils = class {
2815
2822
  *
2816
2823
  */
2817
2824
  static parseUseFormArguments(...args) {
2825
+ if (args.length === 0) {
2826
+ return {
2827
+ rememberKey: null,
2828
+ data: {},
2829
+ precognitionEndpoint: null
2830
+ };
2831
+ }
2818
2832
  if (args.length === 1) {
2819
2833
  return {
2820
2834
  rememberKey: null,
@@ -3971,7 +3985,7 @@ function setupProgress({
3971
3985
  }
3972
3986
 
3973
3987
  // src/resetFormFields.ts
3974
- var FormComponentResetSymbol = Symbol("FormComponentReset");
3988
+ var FormComponentResetSymbol = /* @__PURE__ */ Symbol("FormComponentReset");
3975
3989
  function isFormElement(element) {
3976
3990
  return element instanceof HTMLInputElement || element instanceof HTMLSelectElement || element instanceof HTMLTextAreaElement;
3977
3991
  }