@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 CHANGED
@@ -52,19 +52,15 @@ const config = {
52
52
  </script>
53
53
  ```
54
54
 
55
- ### 2. Wrap your pages
55
+ ### 2. Mark your pages
56
56
 
57
57
  ```vue
58
58
  <template>
59
- <SsgoiTransition id="/">
59
+ <main data-ssgoi-transition="/">
60
60
  <h1>Welcome</h1>
61
61
  <!-- Page content -->
62
- </SsgoiTransition>
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
- <SsgoiTransition id="/">
114
+ <main data-ssgoi-transition="/">
119
115
  <!-- Your page content -->
120
- </SsgoiTransition>
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
- #### `<SsgoiTransition>`
139
+ #### `data-ssgoi-transition`
148
140
 
149
- Wrapper component for pages that should transition.
141
+ Attribute for pages that should transition. Set it on the page boundary element
142
+ inside `<Ssgoi>`.
150
143
 
151
144
  ```vue
152
- <SsgoiTransition id="/page-id">
145
+ <main data-ssgoi-transition="/page-id">
153
146
  <!-- children -->
154
- </SsgoiTransition>
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';
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @deprecated Set `data-ssgoi-transition` directly on the page boundary
3
+ * element inside `<Ssgoi>` instead.
4
+ */
1
5
  interface Props {
2
6
  id: string;
3
7
  as?: keyof HTMLElementTagNameMap;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("./context.cjs"),i=require("@ssgoi/core/internal"),c=e.defineComponent({__name:"ssgoi",props:{config:{},host:{}},setup(o){const t=o,n=e.computed(()=>i.createSggoiTransitionContext(t.config,{host:t.host}));return s.provideSsgoi(n),(r,u)=>e.renderSlot(r.$slots,"default")}});exports.default=c;
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;
@@ -9,11 +9,15 @@ declare function __VLS_template(): {
9
9
  slots: {
10
10
  default?(_: {}): any;
11
11
  };
12
- refs: {};
13
- rootEl: any;
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, {}, any>;
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 n, computed as s, renderSlot as i } from "vue";
2
- import { provideSsgoi as p } from "./context.js";
3
- import { createSggoiTransitionContext as c } from "@ssgoi/core/internal";
4
- const d = /* @__PURE__ */ n({
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(t) {
11
- const o = t, e = s(
12
- () => c(o.config, { host: o.host })
10
+ setup(r) {
11
+ const n = r, t = c(
12
+ () => _(n.config, { host: n.host })
13
13
  );
14
- return p(e), (r, m) => i(r.$slots, "default");
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
- d as default
31
+ y as default
19
32
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssgoi/vue",
3
- "version": "6.2.0",
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.2.0"
36
+ "@ssgoi/core": "^6.4.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "vue": "^3.5.0"