@inertiajs/core 2.3.6 → 2.3.8
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.esm.js +9 -3
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +9 -3
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/types/infiniteScroll/data.d.ts +1 -0
- package/types/types.d.ts +7 -4
package/dist/index.esm.js
CHANGED
|
@@ -735,7 +735,7 @@ function mergeDataIntoQueryString(method, href, data, qsArrayFormat = "brackets"
|
|
|
735
735
|
const hasHash = href.toString().includes("#");
|
|
736
736
|
const url = new URL(href.toString(), typeof window === "undefined" ? "http://localhost" : window.location.toString());
|
|
737
737
|
if (hasDataForQueryString) {
|
|
738
|
-
const hasIndices = /\[\d+\]/.test(url.search);
|
|
738
|
+
const hasIndices = /\[\d+\]/.test(decodeURIComponent(url.search));
|
|
739
739
|
const parseOptions = { ignoreQueryPrefix: true, allowSparse: true };
|
|
740
740
|
url.search = qs.stringify(
|
|
741
741
|
{ ...qs.parse(url.search, parseOptions), ...data },
|
|
@@ -1116,6 +1116,10 @@ var History = class {
|
|
|
1116
1116
|
return window.history.state?.documentScrollPosition || { top: 0, left: 0 };
|
|
1117
1117
|
}
|
|
1118
1118
|
replaceState(page2, cb = null) {
|
|
1119
|
+
if (isEqual(this.current, page2)) {
|
|
1120
|
+
cb && cb();
|
|
1121
|
+
return;
|
|
1122
|
+
}
|
|
1119
1123
|
page.merge(page2);
|
|
1120
1124
|
if (isServer) {
|
|
1121
1125
|
return;
|
|
@@ -1383,7 +1387,7 @@ var InitialVisit = class {
|
|
|
1383
1387
|
fireNavigateEvent(page2);
|
|
1384
1388
|
const flash = page2.flash;
|
|
1385
1389
|
if (Object.keys(flash).length > 0) {
|
|
1386
|
-
fireFlashEvent(flash);
|
|
1390
|
+
queueMicrotask(() => fireFlashEvent(flash));
|
|
1387
1391
|
}
|
|
1388
1392
|
});
|
|
1389
1393
|
}
|
|
@@ -3023,6 +3027,7 @@ var useInfiniteScrollData = (options) => {
|
|
|
3023
3027
|
const removeEventListener = router.on("success", (event) => {
|
|
3024
3028
|
if (state.component === event.detail.page.component && getScrollPropFromCurrentPage().reset) {
|
|
3025
3029
|
resetState();
|
|
3030
|
+
options.onReset?.();
|
|
3026
3031
|
}
|
|
3027
3032
|
});
|
|
3028
3033
|
const getScrollPropKeyForSide = (side) => {
|
|
@@ -3439,7 +3444,8 @@ function useInfiniteScroll(options) {
|
|
|
3439
3444
|
onCompleteNextRequest: (loadedPage) => {
|
|
3440
3445
|
options.onCompleteNextRequest();
|
|
3441
3446
|
requestAnimationFrame(() => elementManager.processServerLoadedElements(loadedPage), 2);
|
|
3442
|
-
}
|
|
3447
|
+
},
|
|
3448
|
+
onReset: options.onDataReset
|
|
3443
3449
|
});
|
|
3444
3450
|
const addScrollPreservationCallbacks = (reloadOptions) => {
|
|
3445
3451
|
const { captureScrollPosition, restoreScrollPosition } = scrollPreservation.createCallbacks();
|