@adonisjs/inertia 4.0.0-next.16 → 4.0.0-next.17
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/build/factories/main.js +1 -1
- package/build/index.js +1 -1
- package/build/{inertia_manager-Di3J3hSG.js → inertia_manager-DnlZGgE1.js} +2 -2
- package/build/providers/inertia_provider.js +1 -1
- package/build/src/client/react/context.d.ts +1 -1
- package/build/src/client/react/form.d.ts +1 -1
- package/build/src/client/react/index.js +19 -6
- package/build/src/client/react/link.d.ts +1 -1
- package/build/src/inertia_middleware.js +1 -1
- package/build/tsdown.config.d.ts +2 -0
- package/package.json +1 -24
package/build/factories/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ServerRenderer, r as Inertia } from "../inertia_manager-
|
|
1
|
+
import { n as ServerRenderer, r as Inertia } from "../inertia_manager-DnlZGgE1.js";
|
|
2
2
|
import { t as InertiaHeaders } from "../headers-DafWEpBh.js";
|
|
3
3
|
import "../debug-CBMTuPUm.js";
|
|
4
4
|
import { t as defineConfig } from "../inertia-CrPBlGRS.js";
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as symbols_exports, n as ServerRenderer, r as Inertia, t as InertiaManager } from "./inertia_manager-
|
|
1
|
+
import { i as symbols_exports, n as ServerRenderer, r as Inertia, t as InertiaManager } from "./inertia_manager-DnlZGgE1.js";
|
|
2
2
|
import { t as InertiaHeaders } from "./headers-DafWEpBh.js";
|
|
3
3
|
import "./debug-CBMTuPUm.js";
|
|
4
4
|
import { n as indexPages, t as defineConfig } from "./inertia-CrPBlGRS.js";
|
|
@@ -5,7 +5,7 @@ import { createHash } from "node:crypto";
|
|
|
5
5
|
import { serialize } from "@adonisjs/core/transformers";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
|
-
var
|
|
8
|
+
var __exportAll = (all, symbols) => {
|
|
9
9
|
let target = {};
|
|
10
10
|
for (var name in all) __defProp(target, name, {
|
|
11
11
|
get: all[name],
|
|
@@ -14,7 +14,7 @@ var __export = (all, symbols) => {
|
|
|
14
14
|
if (symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
15
15
|
return target;
|
|
16
16
|
};
|
|
17
|
-
var symbols_exports = /* @__PURE__ */
|
|
17
|
+
var symbols_exports = /* @__PURE__ */ __exportAll({
|
|
18
18
|
ALWAYS_PROP: () => ALWAYS_PROP,
|
|
19
19
|
DEEP_MERGE: () => DEEP_MERGE,
|
|
20
20
|
DEFERRED_PROP: () => DEFERRED_PROP,
|
|
@@ -11,7 +11,7 @@ import type { TuyauRegistry } from '@tuyau/core/types';
|
|
|
11
11
|
export declare function TuyauProvider<R extends TuyauRegistry>(props: {
|
|
12
12
|
children: React.ReactNode;
|
|
13
13
|
client: Tuyau<R>;
|
|
14
|
-
}):
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
/**
|
|
16
16
|
* Hook to access the Tuyau client from any component within a TuyauProvider.
|
|
17
17
|
*
|
|
@@ -37,7 +37,7 @@ type FormProps<Route extends keyof Routes> = Omit<React.ComponentPropsWithoutRef
|
|
|
37
37
|
* Resolves route parameters and generates the appropriate URL and HTTP method
|
|
38
38
|
* for Inertia form submission.
|
|
39
39
|
*/
|
|
40
|
-
declare function FormInner<Route extends keyof Routes>(props: FormProps<Route>, ref?: React.ForwardedRef<React.ElementRef<typeof InertiaForm>>):
|
|
40
|
+
declare function FormInner<Route extends keyof Routes>(props: FormProps<Route>, ref?: React.ForwardedRef<React.ElementRef<typeof InertiaForm>>): import("react/jsx-runtime").JSX.Element;
|
|
41
41
|
/**
|
|
42
42
|
* Type-safe Form component for Inertia.js form submissions.
|
|
43
43
|
*
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { Form as Form$1, Link as Link$1, router } from "@inertiajs/react";
|
|
3
4
|
const TuyauContext = React.createContext(null);
|
|
4
5
|
function TuyauProvider(props) {
|
|
5
|
-
return
|
|
6
|
+
return /* @__PURE__ */ jsx(TuyauContext.Provider, {
|
|
7
|
+
value: props.client,
|
|
8
|
+
children: props.children
|
|
9
|
+
});
|
|
6
10
|
}
|
|
7
11
|
function useTuyau() {
|
|
8
12
|
const context = React.useContext(TuyauContext);
|
|
@@ -23,16 +27,25 @@ function useRouter() {
|
|
|
23
27
|
function LinkInner(props, ref) {
|
|
24
28
|
const { route: _route, params, ...linkProps } = props;
|
|
25
29
|
const routeInfo = useTuyau().getRoute(props.route, { params });
|
|
26
|
-
return
|
|
30
|
+
return /* @__PURE__ */ jsx(Link$1, {
|
|
31
|
+
...linkProps,
|
|
32
|
+
href: routeInfo.url,
|
|
33
|
+
method: routeInfo.methods[0].toLowerCase(),
|
|
34
|
+
ref
|
|
35
|
+
});
|
|
27
36
|
}
|
|
28
37
|
const Link = React.forwardRef(LinkInner);
|
|
29
38
|
function FormInner(props, ref) {
|
|
30
39
|
const { route: _route, params, ...formProps } = props;
|
|
31
40
|
const routeInfo = useTuyau().getRoute(props.route, { params });
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
return /* @__PURE__ */ jsx(Form$1, {
|
|
42
|
+
...formProps,
|
|
43
|
+
action: {
|
|
44
|
+
url: routeInfo.url,
|
|
45
|
+
method: routeInfo.methods[0].toLowerCase()
|
|
46
|
+
},
|
|
47
|
+
ref
|
|
48
|
+
});
|
|
36
49
|
}
|
|
37
50
|
const Form = React.forwardRef(FormInner);
|
|
38
51
|
export { Form, Link, TuyauProvider, useRouter, useTuyau };
|
|
@@ -40,7 +40,7 @@ type LinkProps<Route extends keyof Routes> = Omit<React.ComponentPropsWithoutRef
|
|
|
40
40
|
* @param props - Link properties including route and parameters
|
|
41
41
|
* @param ref - Forward ref for the underlying InertiaLink component
|
|
42
42
|
*/
|
|
43
|
-
declare function LinkInner<Route extends keyof Routes>(props: LinkProps<Route>, ref?: React.ForwardedRef<React.ElementRef<typeof InertiaLink>>):
|
|
43
|
+
declare function LinkInner<Route extends keyof Routes>(props: LinkProps<Route>, ref?: React.ForwardedRef<React.ElementRef<typeof InertiaLink>>): import("react/jsx-runtime").JSX.Element;
|
|
44
44
|
/**
|
|
45
45
|
* Type-safe Link component for Inertia.js navigation.
|
|
46
46
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as InertiaManager } from "../inertia_manager-
|
|
1
|
+
import { t as InertiaManager } from "../inertia_manager-DnlZGgE1.js";
|
|
2
2
|
import { t as InertiaHeaders } from "../headers-DafWEpBh.js";
|
|
3
3
|
import { t as debug_default } from "../debug-CBMTuPUm.js";
|
|
4
4
|
const MUTATION_METHODS = [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/inertia",
|
|
3
3
|
"description": "Official Inertia.js adapter for AdonisJS",
|
|
4
|
-
"version": "4.0.0-next.
|
|
4
|
+
"version": "4.0.0-next.17",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.0.0"
|
|
7
7
|
},
|
|
@@ -160,29 +160,6 @@
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
|
-
"tsdown": {
|
|
164
|
-
"entry": [
|
|
165
|
-
"./index.ts",
|
|
166
|
-
"./src/types.ts",
|
|
167
|
-
"./src/client/vite.ts",
|
|
168
|
-
"./src/client/helpers.ts",
|
|
169
|
-
"./factories/main.ts",
|
|
170
|
-
"./src/inertia_middleware.ts",
|
|
171
|
-
"./providers/inertia_provider.ts",
|
|
172
|
-
"./src/plugins/edge/plugin.ts",
|
|
173
|
-
"./src/plugins/japa/api_client.ts",
|
|
174
|
-
"./src/client/react/index.tsx"
|
|
175
|
-
],
|
|
176
|
-
"outDir": "./build",
|
|
177
|
-
"clean": true,
|
|
178
|
-
"format": "esm",
|
|
179
|
-
"minify": "dce-only",
|
|
180
|
-
"fixedExtension": false,
|
|
181
|
-
"dts": false,
|
|
182
|
-
"treeshake": false,
|
|
183
|
-
"sourcemaps": false,
|
|
184
|
-
"target": "esnext"
|
|
185
|
-
},
|
|
186
163
|
"c8": {
|
|
187
164
|
"reporter": [
|
|
188
165
|
"text",
|