@adonisjs/inertia 1.0.0-11 → 1.0.0-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.
@@ -85,7 +85,7 @@ var Inertia = class {
85
85
  const result = await render.default(pageObject);
86
86
  return this.ctx.view.render(this.config.rootView, {
87
87
  ...viewProps,
88
- page: { ssrHead: result.head, ssrBody: result.body }
88
+ page: { ssrHead: result.head, ssrBody: result.body, ...pageObject }
89
89
  });
90
90
  }
91
91
  /**
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InertiaMiddleware
3
- } from "../chunk-CXICUKHN.js";
3
+ } from "../chunk-RTJXBXWZ.js";
4
4
 
5
5
  // providers/inertia_provider.ts
6
6
  import { configProvider } from "@adonisjs/core";
@@ -2,7 +2,7 @@ import { Vite } from '@adonisjs/vite';
2
2
  import { HttpContext } from '@adonisjs/core/http';
3
3
  import { NextFn } from '@adonisjs/core/types/http';
4
4
  import { ViteRuntime } from 'vite/runtime';
5
- import { ResolvedConfig, Data, PageProps, MaybePromise } from './types.js';
5
+ import { ResolvedConfig, Data, PageProps, PageObject, MaybePromise } from './types.js';
6
6
 
7
7
  /**
8
8
  * Symbol used to identify lazy props
@@ -25,12 +25,7 @@ declare class Inertia {
25
25
  /**
26
26
  * Render a page using Inertia
27
27
  */
28
- render<TPageProps extends Record<string, any> = PageProps, TViewProps extends Record<string, any> = PageProps>(component: string, pageProps?: TPageProps, viewProps?: TViewProps): Promise<string | {
29
- component: string;
30
- version: string | number;
31
- props: any;
32
- url: string;
33
- }>;
28
+ render<TPageProps extends Record<string, any> = PageProps, TViewProps extends Record<string, any> = PageProps>(component: string, pageProps?: TPageProps, viewProps?: TViewProps): Promise<string | PageObject>;
34
29
  /**
35
30
  * Create a lazy prop
36
31
  *
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InertiaMiddleware
3
- } from "../chunk-CXICUKHN.js";
3
+ } from "../chunk-RTJXBXWZ.js";
4
4
  export {
5
5
  InertiaMiddleware as default
6
6
  };
@@ -92,5 +92,13 @@ interface ResolvedConfig {
92
92
  bundle: string;
93
93
  };
94
94
  }
95
+ interface PageObject {
96
+ component: string;
97
+ version: string | number;
98
+ props: PageProps;
99
+ url: string;
100
+ ssrHead?: string;
101
+ ssrBody?: string;
102
+ }
95
103
 
96
- export type { AssetsVersion, Data, InertiaConfig, MaybePromise, PageProps, ResolvedConfig, SharedData, SharedDatumFactory };
104
+ export type { AssetsVersion, Data, InertiaConfig, MaybePromise, PageObject, PageProps, ResolvedConfig, SharedData, SharedDatumFactory };
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": "1.0.0-11",
4
+ "version": "1.0.0-12",
5
5
  "engines": {
6
6
  "node": ">=18.16.0"
7
7
  },
@@ -44,7 +44,7 @@
44
44
  "@adonisjs/prettier-config": "^1.2.2",
45
45
  "@adonisjs/session": "7.1.1",
46
46
  "@adonisjs/tsconfig": "^1.2.2",
47
- "@adonisjs/vite": "^3.0.0-2",
47
+ "@adonisjs/vite": "^3.0.0-4",
48
48
  "@japa/api-client": "^2.0.2",
49
49
  "@japa/assert": "2.1.0",
50
50
  "@japa/expect-type": "^2.0.1",
@@ -83,7 +83,7 @@
83
83
  "peerDependencies": {
84
84
  "@adonisjs/core": "^6.2.0",
85
85
  "@adonisjs/session": "^7.0.0",
86
- "@adonisjs/vite": "^3.0.0-2",
86
+ "@adonisjs/vite": "^3.0.0-4",
87
87
  "@japa/api-client": "^2.0.0",
88
88
  "edge.js": "^6.0.0"
89
89
  },