@inertiajs/core 2.3.7 → 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 +5 -3
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +5 -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 +1 -0
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 },
|
|
@@ -1387,7 +1387,7 @@ var InitialVisit = class {
|
|
|
1387
1387
|
fireNavigateEvent(page2);
|
|
1388
1388
|
const flash = page2.flash;
|
|
1389
1389
|
if (Object.keys(flash).length > 0) {
|
|
1390
|
-
fireFlashEvent(flash);
|
|
1390
|
+
queueMicrotask(() => fireFlashEvent(flash));
|
|
1391
1391
|
}
|
|
1392
1392
|
});
|
|
1393
1393
|
}
|
|
@@ -3027,6 +3027,7 @@ var useInfiniteScrollData = (options) => {
|
|
|
3027
3027
|
const removeEventListener = router.on("success", (event) => {
|
|
3028
3028
|
if (state.component === event.detail.page.component && getScrollPropFromCurrentPage().reset) {
|
|
3029
3029
|
resetState();
|
|
3030
|
+
options.onReset?.();
|
|
3030
3031
|
}
|
|
3031
3032
|
});
|
|
3032
3033
|
const getScrollPropKeyForSide = (side) => {
|
|
@@ -3443,7 +3444,8 @@ function useInfiniteScroll(options) {
|
|
|
3443
3444
|
onCompleteNextRequest: (loadedPage) => {
|
|
3444
3445
|
options.onCompleteNextRequest();
|
|
3445
3446
|
requestAnimationFrame(() => elementManager.processServerLoadedElements(loadedPage), 2);
|
|
3446
|
-
}
|
|
3447
|
+
},
|
|
3448
|
+
onReset: options.onDataReset
|
|
3447
3449
|
});
|
|
3448
3450
|
const addScrollPreservationCallbacks = (reloadOptions) => {
|
|
3449
3451
|
const { captureScrollPosition, restoreScrollPosition } = scrollPreservation.createCallbacks();
|