@ssgoi/vue 2.0.0 → 2.1.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),r=require("./transition.cjs"),a=require("./context.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),r=require("./transition.cjs"),a=require("./context.cjs"),c=t.defineComponent({__name:"ssgoi-transition",props:{id:{},as:{default:"div"},class:{}},setup(n){const s=n,i=a.useSsgoi(),o=t.computed(()=>({...i(s.id),key:s.id}));return(e,u)=>t.withDirectives((t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"data-ssgoi-transition":e.id,class:t.normalizeClass(s.class)},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["data-ssgoi-transition","class"])),[[t.unref(r.vTransition),o.value]])}});exports.default=c;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
id: string;
|
|
3
|
+
as?: keyof HTMLElementTagNameMap;
|
|
4
|
+
class?: string;
|
|
3
5
|
}
|
|
4
6
|
declare function __VLS_template(): {
|
|
5
7
|
attrs: Partial<{}>;
|
|
@@ -7,10 +9,12 @@ declare function __VLS_template(): {
|
|
|
7
9
|
default?(_: {}): any;
|
|
8
10
|
};
|
|
9
11
|
refs: {};
|
|
10
|
-
rootEl:
|
|
12
|
+
rootEl: any;
|
|
11
13
|
};
|
|
12
14
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
-
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
16
|
+
as: keyof HTMLElementTagNameMap;
|
|
17
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
18
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
15
19
|
export default _default;
|
|
16
20
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { vTransition as
|
|
3
|
-
import { useSsgoi as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as a, computed as e, withDirectives as r, createBlock as c, openBlock as l, resolveDynamicComponent as d, normalizeClass as m, withCtx as p, renderSlot as u, unref as f } from "vue";
|
|
2
|
+
import { vTransition as g } from "./transition.js";
|
|
3
|
+
import { useSsgoi as v } from "./context.js";
|
|
4
|
+
const w = /* @__PURE__ */ a({
|
|
5
5
|
__name: "ssgoi-transition",
|
|
6
6
|
props: {
|
|
7
|
-
id: {}
|
|
7
|
+
id: {},
|
|
8
|
+
as: { default: "div" },
|
|
9
|
+
class: {}
|
|
8
10
|
},
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
11
|
-
...
|
|
12
|
-
key:
|
|
11
|
+
setup(o) {
|
|
12
|
+
const t = o, i = v(), n = e(() => ({
|
|
13
|
+
...i(t.id),
|
|
14
|
+
key: t.id
|
|
13
15
|
}));
|
|
14
|
-
return (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
return (s, C) => r((l(), c(d(s.as), {
|
|
17
|
+
"data-ssgoi-transition": s.id,
|
|
18
|
+
class: m(t.class)
|
|
19
|
+
}, {
|
|
20
|
+
default: p(() => [
|
|
21
|
+
u(s.$slots, "default")
|
|
22
|
+
]),
|
|
23
|
+
_: 3
|
|
24
|
+
}, 8, ["data-ssgoi-transition", "class"])), [
|
|
25
|
+
[f(g), n.value]
|
|
18
26
|
]);
|
|
19
27
|
}
|
|
20
28
|
});
|
|
21
29
|
export {
|
|
22
|
-
|
|
30
|
+
w as default
|
|
23
31
|
};
|
package/dist/transition.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@ssgoi/core"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@ssgoi/core"),e=s.transition,r={mounted(n,t){if(!t.value){console.warn("[SSGOI] v-transition directive requires a configuration object");return}const o=t.value;setTimeout(()=>{const i=e({key:o.key,in:o.in,out:o.out,ref:n})(n);n._ssgoiCleanup=i},0)},unmounted(n){const t=n._ssgoiCleanup;t&&(t(),delete n._ssgoiCleanup)}};exports.transition=e;exports.vTransition=r;
|
package/dist/transition.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { transition as _transition, Transition, TransitionKey } from '@ssgoi/core';
|
|
2
2
|
import { Directive } from 'vue';
|
|
3
3
|
export declare const transition: typeof _transition;
|
|
4
|
-
export declare const vTransition: Directive<HTMLElement, Transition & {
|
|
5
|
-
key
|
|
6
|
-
}>;
|
|
4
|
+
export declare const vTransition: Directive<HTMLElement, (Transition & {
|
|
5
|
+
key?: TransitionKey;
|
|
6
|
+
}) | undefined>;
|
package/dist/transition.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { transition as
|
|
2
|
-
const
|
|
1
|
+
import { transition as e } from "@ssgoi/core";
|
|
2
|
+
const s = e, r = {
|
|
3
3
|
mounted(n, t) {
|
|
4
4
|
if (!t.value) {
|
|
5
|
-
console.warn(
|
|
6
|
-
"[SSGOI] v-transition directive requires a configuration object"
|
|
7
|
-
);
|
|
5
|
+
console.warn("[SSGOI] v-transition directive requires a configuration object");
|
|
8
6
|
return;
|
|
9
7
|
}
|
|
10
8
|
const o = t.value;
|
|
11
9
|
setTimeout(() => {
|
|
12
|
-
const i =
|
|
10
|
+
const i = s({
|
|
11
|
+
key: o.key,
|
|
12
|
+
in: o.in,
|
|
13
|
+
out: o.out,
|
|
14
|
+
ref: n
|
|
15
|
+
})(n);
|
|
13
16
|
n._ssgoiCleanup = i;
|
|
14
17
|
}, 0);
|
|
15
18
|
},
|
|
@@ -19,6 +22,6 @@ const e = s, r = {
|
|
|
19
22
|
}
|
|
20
23
|
};
|
|
21
24
|
export {
|
|
22
|
-
|
|
25
|
+
s as transition,
|
|
23
26
|
r as vTransition
|
|
24
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/vue",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Vue bindings for SSGOI - Native app-like page transitions for Vue applications",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"prepare": "pnpm run build"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@ssgoi/core": "
|
|
57
|
+
"@ssgoi/core": "^2.1.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"vue": "^3.5.0"
|