@ssgoi/svelte 2.0.0 → 2.1.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.
@@ -5,13 +5,20 @@
5
5
  interface Props {
6
6
  id: string;
7
7
  children: () => any;
8
+ as?: keyof HTMLElementTagNameMap;
9
+ class?: string;
8
10
  }
9
11
 
10
- let { id, children }: Props = $props();
12
+ let { id, children, as = 'div', class: className }: Props = $props();
11
13
 
12
14
  const getTransition = getSsgoiContext();
13
15
  </script>
14
16
 
15
- <div use:transition={getTransition(id)} data-ssgoi-transition={id}>
17
+ <svelte:element
18
+ this={as}
19
+ use:transition={getTransition(id)}
20
+ data-ssgoi-transition={id}
21
+ class={className}
22
+ >
16
23
  {@render children()}
17
- </div>
24
+ </svelte:element>
@@ -1,6 +1,8 @@
1
1
  interface Props {
2
2
  id: string;
3
3
  children: () => any;
4
+ as?: keyof HTMLElementTagNameMap;
5
+ class?: string;
4
6
  }
5
7
  declare const SsgoiTransition: import("svelte").Component<Props, {}, "">;
6
8
  type SsgoiTransition = ReturnType<typeof SsgoiTransition>;
@@ -1,9 +1,9 @@
1
- import { type Transition, type TransitionKey } from "@ssgoi/core";
1
+ import { type Transition, type TransitionKey } from '@ssgoi/core';
2
2
  export declare const transition: <TAnimationValue = number>(node: HTMLElement, params: Transition<undefined, TAnimationValue> & {
3
- key: TransitionKey;
3
+ key?: TransitionKey;
4
4
  }) => {
5
5
  update(newParams: Transition<undefined, TAnimationValue> & {
6
- key: TransitionKey;
6
+ key?: TransitionKey;
7
7
  }): void;
8
8
  destroy(): void;
9
9
  };
@@ -1,22 +1,24 @@
1
- import { transition as _transition, } from "@ssgoi/core";
1
+ import { transition as _transition } from '@ssgoi/core';
2
2
  export var transition = function (node, params) {
3
3
  var callback = _transition({
4
- key: params.key,
5
- in: params.in,
6
- out: params.out,
4
+ key: params === null || params === void 0 ? void 0 : params.key,
5
+ in: params === null || params === void 0 ? void 0 : params.in,
6
+ out: params === null || params === void 0 ? void 0 : params.out,
7
+ ref: node
7
8
  });
8
9
  var cleanup = callback(node);
9
10
  return {
10
11
  update: function (newParams) {
11
12
  callback = _transition({
12
- key: newParams.key,
13
- in: newParams.in,
14
- out: newParams.out,
13
+ key: newParams === null || newParams === void 0 ? void 0 : newParams.key,
14
+ in: newParams === null || newParams === void 0 ? void 0 : newParams.in,
15
+ out: newParams === null || newParams === void 0 ? void 0 : newParams.out,
16
+ ref: node
15
17
  });
16
18
  cleanup = callback(node);
17
19
  },
18
20
  destroy: function () {
19
21
  cleanup === null || cleanup === void 0 ? void 0 : cleanup();
20
- },
22
+ }
21
23
  };
22
24
  };
package/package.json CHANGED
@@ -1,94 +1,95 @@
1
1
  {
2
- "name": "@ssgoi/svelte",
3
- "version": "2.0.0",
4
- "description": "Svelte bindings for SSGOI - Native app-like page transitions for Svelte and SvelteKit applications",
5
- "private": false,
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.js",
8
- "files": [
9
- "dist",
10
- "!dist/**/*.test.*",
11
- "!dist/**/*.spec.*"
12
- ],
13
- "svelte": "./dist/index.js",
14
- "types": "./dist/index.d.ts",
15
- "type": "module",
16
- "dependencies": {
17
- "@ssgoi/core": "2.0.0"
18
- },
19
- "peerDependencies": {
20
- "svelte": "^5.0.0"
21
- },
22
- "devDependencies": {
23
- "@eslint/compat": "^1.2.5",
24
- "@eslint/js": "^9.18.0",
25
- "@sveltejs/adapter-auto": "^6.0.0",
26
- "@sveltejs/kit": "^2.16.0",
27
- "@sveltejs/package": "^2.0.0",
28
- "@sveltejs/vite-plugin-svelte": "^5.0.0",
29
- "eslint": "^9.18.0",
30
- "eslint-config-prettier": "^10.0.1",
31
- "eslint-plugin-svelte": "^3.0.0",
32
- "globals": "^16.0.0",
33
- "prettier": "^3.4.2",
34
- "prettier-plugin-svelte": "^3.3.3",
35
- "publint": "^0.3.2",
36
- "svelte": "^5.0.0",
37
- "svelte-check": "^4.0.0",
38
- "typescript": "^5.0.0",
39
- "typescript-eslint": "^8.20.0",
40
- "vite": "^6.2.6"
41
- },
42
- "keywords": [
43
- "svelte",
44
- "page-transition",
45
- "animation",
46
- "ssgoi",
47
- "spring-physics"
48
- ],
49
- "author": "MeurSyphus <tmdeoans@snu.ac.kr>",
50
- "license": "MIT",
51
- "repository": {
52
- "type": "git",
53
- "url": "git+https://github.com/meursyphus/ssgoi.git",
54
- "directory": "packages/svelte"
55
- },
56
- "homepage": "https://ssgoi.dev",
57
- "bugs": {
58
- "url": "https://github.com/meursyphus/ssgoi/issues"
59
- },
60
- "publishConfig": {
61
- "access": "public"
62
- },
63
- "engines": {
64
- "node": ">=18.0.0"
65
- },
66
- "exports": {
67
- ".": {
68
- "types": "./dist/index.d.ts",
69
- "import": "./dist/index.js"
70
- },
71
- "./transitions": {
72
- "types": "./dist/transitions/index.d.ts",
73
- "import": "./dist/transitions/index.js"
74
- },
75
- "./view-transitions": {
76
- "types": "./dist/view-transitions/index.d.ts",
77
- "import": "./dist/view-transitions/index.js"
78
- },
79
- "./types": {
80
- "types": "./dist/types.d.ts",
81
- "import": "./dist/types.js"
82
- },
83
- "./presets": {
84
- "types": "./dist/presets/index.d.ts",
85
- "import": "./dist/presets/index.js"
86
- }
87
- },
88
- "scripts": {
89
- "dev": "svelte-package --watch",
90
- "build": "svelte-package",
91
- "format": "prettier --write .",
92
- "lint": "prettier --check . && eslint ."
93
- }
94
- }
2
+ "name": "@ssgoi/svelte",
3
+ "version": "2.1.0",
4
+ "description": "Svelte bindings for SSGOI - Native app-like page transitions for Svelte and SvelteKit applications",
5
+ "private": false,
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "scripts": {
9
+ "dev": "svelte-package --watch",
10
+ "build": "svelte-package",
11
+ "format": "prettier --write .",
12
+ "lint": "prettier --check . && eslint .",
13
+ "prepare": "pnpm run build"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "!dist/**/*.test.*",
18
+ "!dist/**/*.spec.*"
19
+ ],
20
+ "svelte": "./dist/index.js",
21
+ "types": "./dist/index.d.ts",
22
+ "type": "module",
23
+ "dependencies": {
24
+ "@ssgoi/core": "workspace:*"
25
+ },
26
+ "peerDependencies": {
27
+ "svelte": "^5.0.0"
28
+ },
29
+ "devDependencies": {
30
+ "@eslint/compat": "^1.2.5",
31
+ "@eslint/js": "^9.18.0",
32
+ "@sveltejs/adapter-auto": "^6.0.0",
33
+ "@sveltejs/kit": "^2.16.0",
34
+ "@sveltejs/package": "^2.0.0",
35
+ "@sveltejs/vite-plugin-svelte": "^5.0.0",
36
+ "eslint": "^9.18.0",
37
+ "eslint-config-prettier": "^10.0.1",
38
+ "eslint-plugin-svelte": "^3.0.0",
39
+ "globals": "^16.0.0",
40
+ "prettier": "^3.4.2",
41
+ "prettier-plugin-svelte": "^3.3.3",
42
+ "publint": "^0.3.2",
43
+ "svelte": "^5.0.0",
44
+ "svelte-check": "^4.0.0",
45
+ "typescript": "^5.0.0",
46
+ "typescript-eslint": "^8.20.0",
47
+ "vite": "^6.2.6"
48
+ },
49
+ "keywords": [
50
+ "svelte",
51
+ "page-transition",
52
+ "animation",
53
+ "ssgoi",
54
+ "spring-physics"
55
+ ],
56
+ "author": "MeurSyphus <tmdeoans@snu.ac.kr>",
57
+ "license": "MIT",
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "git+https://github.com/meursyphus/ssgoi.git",
61
+ "directory": "packages/svelte"
62
+ },
63
+ "homepage": "https://ssgoi.dev",
64
+ "bugs": {
65
+ "url": "https://github.com/meursyphus/ssgoi/issues"
66
+ },
67
+ "publishConfig": {
68
+ "access": "public"
69
+ },
70
+ "engines": {
71
+ "node": ">=18.0.0"
72
+ },
73
+ "exports": {
74
+ ".": {
75
+ "types": "./dist/index.d.ts",
76
+ "import": "./dist/index.js"
77
+ },
78
+ "./transitions": {
79
+ "types": "./dist/transitions/index.d.ts",
80
+ "import": "./dist/transitions/index.js"
81
+ },
82
+ "./view-transitions": {
83
+ "types": "./dist/view-transitions/index.d.ts",
84
+ "import": "./dist/view-transitions/index.js"
85
+ },
86
+ "./types": {
87
+ "types": "./dist/types.d.ts",
88
+ "import": "./dist/types.js"
89
+ },
90
+ "./presets": {
91
+ "types": "./dist/presets/index.d.ts",
92
+ "import": "./dist/presets/index.js"
93
+ }
94
+ }
95
+ }