@ssgoi/vue 6.2.0 → 6.4.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/README.md +10 -21
- package/dist/index.d.ts +1 -0
- package/dist/ssgoi-transition.vue.d.ts +4 -0
- package/dist/ssgoi.vue.cjs +1 -1
- package/dist/ssgoi.vue.d.ts +7 -3
- package/dist/ssgoi.vue.js +22 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -52,19 +52,15 @@ const config = {
|
|
|
52
52
|
</script>
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
### 2.
|
|
55
|
+
### 2. Mark your pages
|
|
56
56
|
|
|
57
57
|
```vue
|
|
58
58
|
<template>
|
|
59
|
-
<
|
|
59
|
+
<main data-ssgoi-transition="/">
|
|
60
60
|
<h1>Welcome</h1>
|
|
61
61
|
<!-- Page content -->
|
|
62
|
-
</
|
|
62
|
+
</main>
|
|
63
63
|
</template>
|
|
64
|
-
|
|
65
|
-
<script setup>
|
|
66
|
-
import { SsgoiTransition } from "@ssgoi/vue";
|
|
67
|
-
</script>
|
|
68
64
|
```
|
|
69
65
|
|
|
70
66
|
**That's it!** Your pages now transition smoothly with the configured effect.
|
|
@@ -115,14 +111,10 @@ const config = {
|
|
|
115
111
|
|
|
116
112
|
<!-- pages/index.vue -->
|
|
117
113
|
<template>
|
|
118
|
-
<
|
|
114
|
+
<main data-ssgoi-transition="/">
|
|
119
115
|
<!-- Your page content -->
|
|
120
|
-
</
|
|
116
|
+
</main>
|
|
121
117
|
</template>
|
|
122
|
-
|
|
123
|
-
<script setup>
|
|
124
|
-
import { SsgoiTransition } from "@ssgoi/vue";
|
|
125
|
-
</script>
|
|
126
118
|
```
|
|
127
119
|
|
|
128
120
|
## API Reference
|
|
@@ -144,20 +136,17 @@ Props:
|
|
|
144
136
|
- `config` - Transition configuration object
|
|
145
137
|
- `host` - Optional external playback host for debug tooling
|
|
146
138
|
|
|
147
|
-
####
|
|
139
|
+
#### `data-ssgoi-transition`
|
|
148
140
|
|
|
149
|
-
|
|
141
|
+
Attribute for pages that should transition. Set it on the page boundary element
|
|
142
|
+
inside `<Ssgoi>`.
|
|
150
143
|
|
|
151
144
|
```vue
|
|
152
|
-
<
|
|
145
|
+
<main data-ssgoi-transition="/page-id">
|
|
153
146
|
<!-- children -->
|
|
154
|
-
</
|
|
147
|
+
</main>
|
|
155
148
|
```
|
|
156
149
|
|
|
157
|
-
Props:
|
|
158
|
-
|
|
159
|
-
- `id` - Unique identifier for the page (required)
|
|
160
|
-
|
|
161
150
|
## Built-in Transitions
|
|
162
151
|
|
|
163
152
|
### Page Transitions (`@ssgoi/vue/view-transitions`)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './types';
|
|
2
2
|
export { default as Ssgoi } from './ssgoi.vue';
|
|
3
|
+
/** @deprecated Set `data-ssgoi-transition` directly on an element inside `<Ssgoi>` instead. */
|
|
3
4
|
export { default as SsgoiTransition } from './ssgoi-transition.vue';
|
|
4
5
|
export * from '@ssgoi/core';
|
package/dist/ssgoi.vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("./context.cjs"),i=require("@ssgoi/core/internal"),l=e.defineComponent({__name:"ssgoi",props:{config:{},host:{}},setup(c){const s=c,t=e.computed(()=>i.createSggoiTransitionContext(s.config,{host:s.host}));a.provideSsgoi(t);const n=e.ref(null);let o;const r=()=>{o?.(),o=void 0,n.value&&(o=i.observeSsgoiTransitions(n.value,t.value))};return e.onMounted(r),e.watch(t,r),e.onBeforeUnmount(()=>o?.()),(u,d)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"root",ref:n,"data-ssgoi-root":"",style:{display:"contents"}},[e.renderSlot(u.$slots,"default")],512))}});exports.default=l;
|
package/dist/ssgoi.vue.d.ts
CHANGED
|
@@ -9,11 +9,15 @@ declare function __VLS_template(): {
|
|
|
9
9
|
slots: {
|
|
10
10
|
default?(_: {}): any;
|
|
11
11
|
};
|
|
12
|
-
refs: {
|
|
13
|
-
|
|
12
|
+
refs: {
|
|
13
|
+
root: HTMLDivElement;
|
|
14
|
+
};
|
|
15
|
+
rootEl: HTMLDivElement;
|
|
14
16
|
};
|
|
15
17
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
-
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
18
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
19
|
+
root: HTMLDivElement;
|
|
20
|
+
}, HTMLDivElement>;
|
|
17
21
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
18
22
|
export default _default;
|
|
19
23
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
package/dist/ssgoi.vue.js
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideSsgoi as
|
|
3
|
-
import { createSggoiTransitionContext as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as a, computed as c, ref as l, onMounted as p, watch as f, onBeforeUnmount as u, createElementBlock as m, openBlock as d, renderSlot as g } from "vue";
|
|
2
|
+
import { provideSsgoi as v } from "./context.js";
|
|
3
|
+
import { createSggoiTransitionContext as _, observeSsgoiTransitions as h } from "@ssgoi/core/internal";
|
|
4
|
+
const y = /* @__PURE__ */ a({
|
|
5
5
|
__name: "ssgoi",
|
|
6
6
|
props: {
|
|
7
7
|
config: {},
|
|
8
8
|
host: {}
|
|
9
9
|
},
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
12
|
-
() =>
|
|
10
|
+
setup(r) {
|
|
11
|
+
const n = r, t = c(
|
|
12
|
+
() => _(n.config, { host: n.host })
|
|
13
13
|
);
|
|
14
|
-
|
|
14
|
+
v(t);
|
|
15
|
+
const e = l(null);
|
|
16
|
+
let o;
|
|
17
|
+
const s = () => {
|
|
18
|
+
o?.(), o = void 0, e.value && (o = h(e.value, t.value));
|
|
19
|
+
};
|
|
20
|
+
return p(s), f(t, s), u(() => o?.()), (i, S) => (d(), m("div", {
|
|
21
|
+
ref_key: "root",
|
|
22
|
+
ref: e,
|
|
23
|
+
"data-ssgoi-root": "",
|
|
24
|
+
style: { display: "contents" }
|
|
25
|
+
}, [
|
|
26
|
+
g(i.$slots, "default")
|
|
27
|
+
], 512));
|
|
15
28
|
}
|
|
16
29
|
});
|
|
17
30
|
export {
|
|
18
|
-
|
|
31
|
+
y as default
|
|
19
32
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/vue",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "Vue bindings for SSGOI - Native app-like page transitions for Vue applications",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@ssgoi/core": "^6.
|
|
36
|
+
"@ssgoi/core": "^6.4.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"vue": "^3.5.0"
|