@ssgoi/vue 7.0.3 → 7.1.0-beta.0
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/nuxt.cjs +1 -0
- package/dist/nuxt.d.ts +36 -0
- package/dist/nuxt.js +9 -0
- package/dist/route-boundary.cjs +1 -0
- package/dist/route-boundary.d.ts +48 -0
- package/dist/route-boundary.js +36 -0
- package/dist/vue-router.cjs +1 -0
- package/dist/vue-router.d.ts +36 -0
- package/dist/vue-router.js +9 -0
- package/package.json +28 -4
package/dist/nuxt.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("nuxt/app"),r=require("./route-boundary.cjs"),t=r.createRouteBoundary(()=>{const e=o.useRouter();return()=>e.currentRoute.value.path});exports.SsgoiRouteBoundary=t;
|
package/dist/nuxt.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type { RouteBoundaryState, SsgoiRouteBoundaryProps, } from './route-boundary';
|
|
2
|
+
export declare const SsgoiRouteBoundary: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
3
|
+
as: {
|
|
4
|
+
type: import('vue').PropType<keyof HTMLElementTagNameMap>;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
routeKey: {
|
|
8
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
9
|
+
default: undefined;
|
|
10
|
+
};
|
|
11
|
+
resolve: {
|
|
12
|
+
type: import('vue').PropType<import('./route-boundary').SsgoiRouteBoundaryProps["resolve"]>;
|
|
13
|
+
default: undefined;
|
|
14
|
+
};
|
|
15
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
18
|
+
as: {
|
|
19
|
+
type: import('vue').PropType<keyof HTMLElementTagNameMap>;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
routeKey: {
|
|
23
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
24
|
+
default: undefined;
|
|
25
|
+
};
|
|
26
|
+
resolve: {
|
|
27
|
+
type: import('vue').PropType<import('./route-boundary').SsgoiRouteBoundaryProps["resolve"]>;
|
|
28
|
+
default: undefined;
|
|
29
|
+
};
|
|
30
|
+
}>> & Readonly<{}>, {
|
|
31
|
+
as: keyof HTMLElementTagNameMap;
|
|
32
|
+
resolve: ((location: {
|
|
33
|
+
pathname: string;
|
|
34
|
+
}) => import('./route-boundary').RouteBoundaryState) | undefined;
|
|
35
|
+
routeKey: string | number;
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
package/dist/nuxt.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue");function d(o){return u.defineComponent({name:"SsgoiRouteBoundary",inheritAttrs:!1,props:{as:{type:String,default:"div"},routeKey:{type:[String,Number],default:void 0},resolve:{type:Function,default:void 0}},setup(e,{attrs:a,slots:r}){const i=o(),t=u.computed(()=>{const n=i();return e.resolve?.({pathname:n})??{id:n}});return()=>u.h(e.as,{...a,key:e.routeKey??t.value.key??t.value.id,"data-ssgoi-transition":t.value.id},r.default?.())}})}exports.createRouteBoundary=d;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
export interface RouteBoundaryState {
|
|
3
|
+
id: string;
|
|
4
|
+
key?: string | number;
|
|
5
|
+
}
|
|
6
|
+
export interface SsgoiRouteBoundaryProps {
|
|
7
|
+
as?: keyof HTMLElementTagNameMap;
|
|
8
|
+
routeKey?: string | number;
|
|
9
|
+
resolve?: (location: {
|
|
10
|
+
pathname: string;
|
|
11
|
+
}) => RouteBoundaryState;
|
|
12
|
+
}
|
|
13
|
+
/** Shared rendering only; each subpath supplies its own router hook. */
|
|
14
|
+
export declare function createRouteBoundary(usePathname: () => () => string): import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
15
|
+
as: {
|
|
16
|
+
type: PropType<keyof HTMLElementTagNameMap>;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
routeKey: {
|
|
20
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
21
|
+
default: undefined;
|
|
22
|
+
};
|
|
23
|
+
resolve: {
|
|
24
|
+
type: PropType<SsgoiRouteBoundaryProps["resolve"]>;
|
|
25
|
+
default: undefined;
|
|
26
|
+
};
|
|
27
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
30
|
+
as: {
|
|
31
|
+
type: PropType<keyof HTMLElementTagNameMap>;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
routeKey: {
|
|
35
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
36
|
+
default: undefined;
|
|
37
|
+
};
|
|
38
|
+
resolve: {
|
|
39
|
+
type: PropType<SsgoiRouteBoundaryProps["resolve"]>;
|
|
40
|
+
default: undefined;
|
|
41
|
+
};
|
|
42
|
+
}>> & Readonly<{}>, {
|
|
43
|
+
as: keyof HTMLElementTagNameMap;
|
|
44
|
+
resolve: ((location: {
|
|
45
|
+
pathname: string;
|
|
46
|
+
}) => RouteBoundaryState) | undefined;
|
|
47
|
+
routeKey: string | number;
|
|
48
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineComponent as i, computed as d, h as s } from "vue";
|
|
2
|
+
function y(o) {
|
|
3
|
+
return i({
|
|
4
|
+
name: "SsgoiRouteBoundary",
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
props: {
|
|
7
|
+
as: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "div"
|
|
10
|
+
},
|
|
11
|
+
routeKey: { type: [String, Number], default: void 0 },
|
|
12
|
+
resolve: {
|
|
13
|
+
type: Function,
|
|
14
|
+
default: void 0
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(e, { attrs: a, slots: r }) {
|
|
18
|
+
const u = o(), t = d(() => {
|
|
19
|
+
const n = u();
|
|
20
|
+
return e.resolve?.({ pathname: n }) ?? { id: n };
|
|
21
|
+
});
|
|
22
|
+
return () => s(
|
|
23
|
+
e.as,
|
|
24
|
+
{
|
|
25
|
+
...a,
|
|
26
|
+
key: e.routeKey ?? t.value.key ?? t.value.id,
|
|
27
|
+
"data-ssgoi-transition": t.value.id
|
|
28
|
+
},
|
|
29
|
+
r.default?.()
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
y as createRouteBoundary
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue-router"),r=require("./route-boundary.cjs"),t=r.createRouteBoundary(()=>{const e=o.useRouter();return()=>e.currentRoute.value.path});exports.SsgoiRouteBoundary=t;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type { RouteBoundaryState, SsgoiRouteBoundaryProps, } from './route-boundary';
|
|
2
|
+
export declare const SsgoiRouteBoundary: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
3
|
+
as: {
|
|
4
|
+
type: import('vue').PropType<keyof HTMLElementTagNameMap>;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
routeKey: {
|
|
8
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
9
|
+
default: undefined;
|
|
10
|
+
};
|
|
11
|
+
resolve: {
|
|
12
|
+
type: import('vue').PropType<import('./route-boundary').SsgoiRouteBoundaryProps["resolve"]>;
|
|
13
|
+
default: undefined;
|
|
14
|
+
};
|
|
15
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
18
|
+
as: {
|
|
19
|
+
type: import('vue').PropType<keyof HTMLElementTagNameMap>;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
routeKey: {
|
|
23
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
24
|
+
default: undefined;
|
|
25
|
+
};
|
|
26
|
+
resolve: {
|
|
27
|
+
type: import('vue').PropType<import('./route-boundary').SsgoiRouteBoundaryProps["resolve"]>;
|
|
28
|
+
default: undefined;
|
|
29
|
+
};
|
|
30
|
+
}>> & Readonly<{}>, {
|
|
31
|
+
as: keyof HTMLElementTagNameMap;
|
|
32
|
+
resolve: ((location: {
|
|
33
|
+
pathname: string;
|
|
34
|
+
}) => import('./route-boundary').RouteBoundaryState) | undefined;
|
|
35
|
+
routeKey: string | number;
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/vue",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.1.0-beta.0",
|
|
4
4
|
"description": "Vue bindings for SSGOI - Native app-like page transitions for Vue applications",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -30,13 +30,27 @@
|
|
|
30
30
|
"import": "./dist/view-transitions.js",
|
|
31
31
|
"require": "./dist/view-transitions.cjs",
|
|
32
32
|
"default": "./dist/view-transitions.js"
|
|
33
|
+
},
|
|
34
|
+
"./vue-router": {
|
|
35
|
+
"types": "./dist/vue-router.d.ts",
|
|
36
|
+
"import": "./dist/vue-router.js",
|
|
37
|
+
"require": "./dist/vue-router.cjs",
|
|
38
|
+
"default": "./dist/vue-router.js"
|
|
39
|
+
},
|
|
40
|
+
"./nuxt": {
|
|
41
|
+
"types": "./dist/nuxt.d.ts",
|
|
42
|
+
"import": "./dist/nuxt.js",
|
|
43
|
+
"require": "./dist/nuxt.cjs",
|
|
44
|
+
"default": "./dist/nuxt.js"
|
|
33
45
|
}
|
|
34
46
|
},
|
|
35
47
|
"dependencies": {
|
|
36
|
-
"@ssgoi/core": "^7.0.
|
|
48
|
+
"@ssgoi/core": "^7.1.0-beta.0"
|
|
37
49
|
},
|
|
38
50
|
"peerDependencies": {
|
|
39
|
-
"vue": "^3.5.0"
|
|
51
|
+
"vue": "^3.5.0",
|
|
52
|
+
"vue-router": "*",
|
|
53
|
+
"nuxt": "*"
|
|
40
54
|
},
|
|
41
55
|
"devDependencies": {
|
|
42
56
|
"@eslint/js": "^9.30.1",
|
|
@@ -51,7 +65,9 @@
|
|
|
51
65
|
"typescript-eslint": "^8.35.1",
|
|
52
66
|
"vite": "^7.0.4",
|
|
53
67
|
"vite-plugin-dts": "^4.5.4",
|
|
54
|
-
"vue-tsc": "^2.2.12"
|
|
68
|
+
"vue-tsc": "^2.2.12",
|
|
69
|
+
"vue-router": "^4.6.3",
|
|
70
|
+
"nuxt": "^3.20.2"
|
|
55
71
|
},
|
|
56
72
|
"keywords": [
|
|
57
73
|
"vue",
|
|
@@ -77,6 +93,14 @@
|
|
|
77
93
|
"engines": {
|
|
78
94
|
"node": ">=18.0.0"
|
|
79
95
|
},
|
|
96
|
+
"peerDependenciesMeta": {
|
|
97
|
+
"vue-router": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
100
|
+
"nuxt": {
|
|
101
|
+
"optional": true
|
|
102
|
+
}
|
|
103
|
+
},
|
|
80
104
|
"scripts": {
|
|
81
105
|
"dev": "vite build --watch",
|
|
82
106
|
"build": "vue-tsc -b && vite build",
|