@inertiajs/vue3 3.0.0-beta.2 → 3.0.0-beta.3
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 +191 -190
- package/dist/index.js.map +3 -3
- package/package.json +2 -2
- package/types/app.d.ts +2 -1
- package/types/createInertiaApp.d.ts +17 -8
- package/types/deferred.d.ts +3 -9
- package/types/whenVisible.d.ts +5 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inertiajs/vue3",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Vue 3 adapter for Inertia.js",
|
|
6
6
|
"contributors": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@types/lodash-es": "^4.17.12",
|
|
56
56
|
"laravel-precognition": "2.0.0-beta.3",
|
|
57
57
|
"lodash-es": "^4.17.23",
|
|
58
|
-
"@inertiajs/core": "3.0.0-beta.
|
|
58
|
+
"@inertiajs/core": "3.0.0-beta.3"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "pnpm clean && ./build.js && tsc",
|
package/types/app.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HeadManagerOnUpdateCallback, HeadManagerTitleCallback, Page, PageProps, SharedPageProps } from '@inertiajs/core';
|
|
1
|
+
import { HeadManager, HeadManagerOnUpdateCallback, HeadManagerTitleCallback, Page, PageProps, SharedPageProps } from '@inertiajs/core';
|
|
2
2
|
import { DefineComponent, Plugin } from 'vue';
|
|
3
3
|
export interface InertiaAppProps<SharedProps extends PageProps = PageProps> {
|
|
4
4
|
initialPage: Page<SharedProps>;
|
|
@@ -9,6 +9,7 @@ export interface InertiaAppProps<SharedProps extends PageProps = PageProps> {
|
|
|
9
9
|
defaultLayout?: (name: string, page: Page) => unknown;
|
|
10
10
|
}
|
|
11
11
|
export type InertiaApp = DefineComponent<InertiaAppProps>;
|
|
12
|
+
export declare let headManager: HeadManager;
|
|
12
13
|
declare const App: InertiaApp;
|
|
13
14
|
export default App;
|
|
14
15
|
export declare const plugin: Plugin;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { CreateInertiaAppOptions, CreateInertiaAppOptionsForCSR, CreateInertiaAppOptionsForSSR, InertiaAppSSRResponse, Page, PageProps } from '@inertiajs/core';
|
|
1
|
+
import { CreateInertiaAppOptions, CreateInertiaAppOptionsForCSR, CreateInertiaAppOptionsForSSR, InertiaAppSSRResponse, Page, PageProps, SharedPageProps } from '@inertiajs/core';
|
|
2
2
|
import { DefineComponent, Plugin, App as VueApp } from 'vue';
|
|
3
|
-
import { renderToString } from 'vue/server-renderer';
|
|
4
3
|
import { InertiaApp, InertiaAppProps } from './app';
|
|
5
4
|
import { VueInertiaAppConfig } from './types';
|
|
6
|
-
type ComponentResolver = (name: string, page?: Page) => DefineComponent | Promise<DefineComponent> | {
|
|
5
|
+
type ComponentResolver = (name: string, page?: Page<SharedPageProps>) => DefineComponent | Promise<DefineComponent> | {
|
|
7
6
|
default: DefineComponent;
|
|
8
7
|
};
|
|
9
8
|
type SetupOptions<ElementType, SharedProps extends PageProps> = {
|
|
@@ -12,17 +11,27 @@ type SetupOptions<ElementType, SharedProps extends PageProps> = {
|
|
|
12
11
|
props: InertiaAppProps<SharedProps>;
|
|
13
12
|
plugin: Plugin;
|
|
14
13
|
};
|
|
15
|
-
type InertiaAppOptionsForCSR<SharedProps extends PageProps> = CreateInertiaAppOptionsForCSR<SharedProps, ComponentResolver, SetupOptions<HTMLElement, SharedProps>, void, VueInertiaAppConfig
|
|
14
|
+
type InertiaAppOptionsForCSR<SharedProps extends PageProps> = CreateInertiaAppOptionsForCSR<SharedProps, ComponentResolver, SetupOptions<HTMLElement, SharedProps>, void, VueInertiaAppConfig> & {
|
|
15
|
+
withApp?: (app: VueApp, options: {
|
|
16
|
+
ssr: boolean;
|
|
17
|
+
}) => void;
|
|
18
|
+
};
|
|
16
19
|
type InertiaAppOptionsForSSR<SharedProps extends PageProps> = CreateInertiaAppOptionsForSSR<SharedProps, ComponentResolver, SetupOptions<null, SharedProps>, VueApp, VueInertiaAppConfig> & {
|
|
17
|
-
render:
|
|
20
|
+
render: (app: VueApp) => Promise<string>;
|
|
21
|
+
withApp?: (app: VueApp, options: {
|
|
22
|
+
ssr: boolean;
|
|
23
|
+
}) => void;
|
|
18
24
|
};
|
|
19
25
|
type InertiaAppOptionsAuto<SharedProps extends PageProps> = CreateInertiaAppOptions<ComponentResolver, SetupOptions<HTMLElement | null, SharedProps>, VueApp | void, VueInertiaAppConfig> & {
|
|
20
26
|
page?: Page<SharedProps>;
|
|
21
27
|
render?: undefined;
|
|
28
|
+
withApp?: (app: VueApp, options: {
|
|
29
|
+
ssr: boolean;
|
|
30
|
+
}) => void;
|
|
22
31
|
};
|
|
23
32
|
type RenderToString = (app: VueApp) => Promise<string>;
|
|
24
33
|
type RenderFunction<SharedProps extends PageProps> = (page: Page<SharedProps>, renderToString: RenderToString) => Promise<InertiaAppSSRResponse>;
|
|
25
|
-
export default function createInertiaApp<SharedProps extends PageProps = PageProps>(options: InertiaAppOptionsForCSR<SharedProps>): Promise<void>;
|
|
26
|
-
export default function createInertiaApp<SharedProps extends PageProps = PageProps>(options: InertiaAppOptionsForSSR<SharedProps>): Promise<InertiaAppSSRResponse>;
|
|
27
|
-
export default function createInertiaApp<SharedProps extends PageProps = PageProps>(options?: InertiaAppOptionsAuto<SharedProps>): Promise<void | RenderFunction<SharedProps>>;
|
|
34
|
+
export default function createInertiaApp<SharedProps extends PageProps = PageProps & SharedPageProps>(options: InertiaAppOptionsForCSR<SharedProps>): Promise<void>;
|
|
35
|
+
export default function createInertiaApp<SharedProps extends PageProps = PageProps & SharedPageProps>(options: InertiaAppOptionsForSSR<SharedProps>): Promise<InertiaAppSSRResponse>;
|
|
36
|
+
export default function createInertiaApp<SharedProps extends PageProps = PageProps & SharedPageProps>(options?: InertiaAppOptionsAuto<SharedProps>): Promise<void | RenderFunction<SharedProps>>;
|
|
28
37
|
export {};
|
package/types/deferred.d.ts
CHANGED
|
@@ -17,15 +17,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
17
17
|
})[];
|
|
18
18
|
required: true;
|
|
19
19
|
};
|
|
20
|
-
}>, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
default: import("vue").Slot<{
|
|
24
|
-
reloading: boolean;
|
|
25
|
-
}>;
|
|
26
|
-
fallback: import("vue").Slot<{}>;
|
|
27
|
-
}>;
|
|
28
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}>[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
23
|
data: {
|
|
30
24
|
type: (StringConstructor | {
|
|
31
25
|
(arrayLength: number): String[];
|
package/types/whenVisible.d.ts
CHANGED
|
@@ -32,16 +32,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
32
32
|
type: BooleanConstructor;
|
|
33
33
|
default: boolean;
|
|
34
34
|
};
|
|
35
|
-
}>,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, {
|
|
40
|
-
keys(): string[];
|
|
41
|
-
}, {
|
|
42
|
-
registerObserver(): void;
|
|
43
|
-
getReloadParams(): Partial<ReloadOptions>;
|
|
44
|
-
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
35
|
+
}>, () => (import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}>[] | null)[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
45
40
|
data: {
|
|
46
41
|
type: (StringConstructor | {
|
|
47
42
|
(arrayLength: number): String[];
|