@inertiajs/core 3.0.0-beta.6 → 3.0.0-beta.7
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 +24 -19
- package/dist/index.js.map +2 -2
- package/dist/server.js +5 -5
- package/dist/server.js.map +1 -1
- package/dist/ssrErrors.js +2 -2
- package/dist/ssrErrors.js.map +1 -1
- package/package.json +2 -2
- package/types/httpErrors.d.ts +8 -7
- package/types/index.d.ts +2 -2
- package/types/layout.d.ts +8 -0
- package/types/router.d.ts +0 -4
- package/types/server.d.ts +1 -1
- package/types/ssrErrors.d.ts +1 -1
- package/types/types.d.ts +4 -3
package/dist/index.js
CHANGED
|
@@ -65,8 +65,8 @@ var fireBeforeEvent = (visit) => {
|
|
|
65
65
|
var fireErrorEvent = (errors) => {
|
|
66
66
|
return fireEvent("error", { detail: { errors } });
|
|
67
67
|
};
|
|
68
|
-
var fireNetworkErrorEvent = (
|
|
69
|
-
return fireEvent("networkError", { cancelable: true, detail: {
|
|
68
|
+
var fireNetworkErrorEvent = (error) => {
|
|
69
|
+
return fireEvent("networkError", { cancelable: true, detail: { error } });
|
|
70
70
|
};
|
|
71
71
|
var fireFinishEvent = (visit) => {
|
|
72
72
|
return fireEvent("finish", { detail: { visit } });
|
|
@@ -1819,27 +1819,31 @@ var HttpHandlers = class {
|
|
|
1819
1819
|
var httpHandlers = new HttpHandlers();
|
|
1820
1820
|
|
|
1821
1821
|
// src/httpErrors.ts
|
|
1822
|
-
var
|
|
1823
|
-
constructor(message,
|
|
1822
|
+
var HttpError = class extends Error {
|
|
1823
|
+
constructor(message, code, url) {
|
|
1824
1824
|
super(url ? `${message} (${url})` : message);
|
|
1825
|
+
this.name = "HttpError";
|
|
1826
|
+
this.code = code;
|
|
1827
|
+
this.url = url;
|
|
1828
|
+
}
|
|
1829
|
+
};
|
|
1830
|
+
var HttpResponseError = class extends HttpError {
|
|
1831
|
+
constructor(message, response, url) {
|
|
1832
|
+
super(message, "ERR_HTTP_RESPONSE", url);
|
|
1825
1833
|
this.name = "HttpResponseError";
|
|
1826
1834
|
this.response = response;
|
|
1827
|
-
this.url = url;
|
|
1828
1835
|
}
|
|
1829
1836
|
};
|
|
1830
|
-
var HttpCancelledError = class extends
|
|
1837
|
+
var HttpCancelledError = class extends HttpError {
|
|
1831
1838
|
constructor(message = "Request was cancelled", url) {
|
|
1832
|
-
super(
|
|
1839
|
+
super(message, "ERR_CANCELLED", url);
|
|
1833
1840
|
this.name = "HttpCancelledError";
|
|
1834
|
-
this.url = url;
|
|
1835
1841
|
}
|
|
1836
1842
|
};
|
|
1837
|
-
var HttpNetworkError = class extends
|
|
1843
|
+
var HttpNetworkError = class extends HttpError {
|
|
1838
1844
|
constructor(message, url, cause) {
|
|
1839
|
-
super(
|
|
1840
|
-
this.code = "ERR_NETWORK";
|
|
1845
|
+
super(message, "ERR_NETWORK", url);
|
|
1841
1846
|
this.name = "HttpNetworkError";
|
|
1842
|
-
this.url = url;
|
|
1843
1847
|
this.cause = cause;
|
|
1844
1848
|
}
|
|
1845
1849
|
};
|
|
@@ -2874,12 +2878,6 @@ var Router = class {
|
|
|
2874
2878
|
}
|
|
2875
2879
|
return eventHandler.onGlobalEvent(type, callback);
|
|
2876
2880
|
}
|
|
2877
|
-
/**
|
|
2878
|
-
* @deprecated Use cancelAll() instead.
|
|
2879
|
-
*/
|
|
2880
|
-
cancel() {
|
|
2881
|
-
this.syncRequestStream.cancelInFlight();
|
|
2882
|
-
}
|
|
2883
2881
|
hasPendingOptimistic() {
|
|
2884
2882
|
return this.asyncRequestStream.hasPendingOptimistic();
|
|
2885
2883
|
}
|
|
@@ -4283,7 +4281,12 @@ function isNamedLayouts(value, isComponent) {
|
|
|
4283
4281
|
if (!isPlainObject(value) || isComponent(value) || "component" in value) {
|
|
4284
4282
|
return false;
|
|
4285
4283
|
}
|
|
4286
|
-
return Object.values(value).some(
|
|
4284
|
+
return Object.values(value).some(
|
|
4285
|
+
(v) => isComponent(v) || Array.isArray(v) && isComponent(v[0]) || hasComponentKey(v) && isComponent(v.component)
|
|
4286
|
+
);
|
|
4287
|
+
}
|
|
4288
|
+
function isPropsObject(value, isComponent) {
|
|
4289
|
+
return isPlainObject(value) && !isComponent(value) && !("component" in value) && !isNamedLayouts(value, isComponent);
|
|
4287
4290
|
}
|
|
4288
4291
|
function isTuple(value, isComponent) {
|
|
4289
4292
|
return Array.isArray(value) && value.length === 2 && isComponent(value[0]) && isPlainObject(value[1]) && !isComponent(value[1]);
|
|
@@ -4885,6 +4888,7 @@ var router = new Router();
|
|
|
4885
4888
|
export {
|
|
4886
4889
|
FormComponentResetSymbol,
|
|
4887
4890
|
HttpCancelledError,
|
|
4891
|
+
HttpError,
|
|
4888
4892
|
HttpNetworkError,
|
|
4889
4893
|
HttpResponseError,
|
|
4890
4894
|
UseFormUtils,
|
|
@@ -4900,6 +4904,7 @@ export {
|
|
|
4900
4904
|
hasFiles,
|
|
4901
4905
|
hrefToUrl,
|
|
4902
4906
|
http,
|
|
4907
|
+
isPropsObject,
|
|
4903
4908
|
isSameUrlWithoutQueryOrHash,
|
|
4904
4909
|
isUrlMethodPair,
|
|
4905
4910
|
mergeDataIntoQueryString,
|