@ssgoi/core 6.6.1 → 6.6.3
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 +66 -9
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +471 -408
- package/dist/ssgoi-transition/create-context-manager.d.ts +11 -0
- package/dist/ssgoi-transition/create-context-manager.d.ts.map +1 -1
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/ssgoi-transition/find-matching-transition.d.ts +9 -3
- package/dist/ssgoi-transition/find-matching-transition.d.ts.map +1 -1
- package/package.json +13 -14
|
@@ -5,6 +5,17 @@ export type ContextManagerOptions = {
|
|
|
5
5
|
* @default (isMobile) => isMobile
|
|
6
6
|
*/
|
|
7
7
|
preserveScroll?: PreserveScrollOption;
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a raw path to the identity used for ALL scroll bookkeeping
|
|
10
|
+
* (record, restore, offset, evict). Defaults to the path unchanged.
|
|
11
|
+
*
|
|
12
|
+
* Wire this to the config `middleware` so a rewritten/aliased route records and
|
|
13
|
+
* restores its scroll under the SAME key the transition matcher resolves it to.
|
|
14
|
+
* Without it, scroll is stored under the raw `data-ssgoi-transition` id while the
|
|
15
|
+
* offset is looked up under the middleware-rewritten id (or vice-versa); the keys
|
|
16
|
+
* miss each other and the outgoing page snaps to the top mid-transition.
|
|
17
|
+
*/
|
|
18
|
+
resolvePath?: (path: string) => string;
|
|
8
19
|
};
|
|
9
20
|
export declare function createContextManager(options?: ContextManagerOptions): {
|
|
10
21
|
initializeContext: (element: HTMLElement, path: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-context-manager.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-context-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,QAAQ,CAAC;AAgBrE,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"create-context-manager.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-context-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,QAAQ,CAAC;AAgBrE,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACxC,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,qBAA0B;iCA4IlC,WAAW,QAAQ,MAAM;mCAwDpD,MAAM,OACR,MAAM,KACV;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;gCAuBQ,MAAM;2BAxJX,MAAM,KAAG,OAAO;;;+BAmKZ,MAAM,KAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;uBArMxC,OAAO;EAwNnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EACX,YAAY,EAOb,MAAM,QAAQ,CAAC;AAShB,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AA8C5D;;;;;;;;;GASG;AACH,MAAM,WAAW,mCAAmC;IAClD;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,EACpB,cAAc,GAAE,mCAAwC,GACvD,YAAY,
|
|
1
|
+
{"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EACX,YAAY,EAOb,MAAM,QAAQ,CAAC;AAShB,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AA8C5D;;;;;;;;;GASG;AACH,MAAM,WAAW,mCAAmC;IAClD;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,EACpB,cAAc,GAAE,mCAAwC,GACvD,YAAY,CA+hBd"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { TransitionConfig } from '../types/index.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Matches a path against a pattern
|
|
4
|
-
* Supports exact matches and
|
|
4
|
+
* Supports exact matches, wildcard patterns, and common route segment params
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* matchPath('/products', '/products') // true
|
|
8
8
|
* matchPath('/products/123', '/products/*') // true
|
|
9
|
+
* matchPath('/products', '/products/**') // true
|
|
10
|
+
* matchPath('/products/123/reviews', '/products/**') // true
|
|
11
|
+
* matchPath('/products/123', '/products/:id') // true
|
|
12
|
+
* matchPath('/products/123', '/products/[id]') // true
|
|
13
|
+
* matchPath('/products/123', '/products/{id}') // true
|
|
9
14
|
* matchPath('/products/123', '/products') // false
|
|
10
15
|
* matchPath('/anything', '*') // true
|
|
11
16
|
*/
|
|
@@ -13,8 +18,9 @@ export declare function matchPath(path: string, pattern: string): boolean;
|
|
|
13
18
|
/**
|
|
14
19
|
* Finds a matching transition configuration for the given from and to paths
|
|
15
20
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
21
|
+
* Chooses the most specific matching config. Exact paths outrank wildcard
|
|
22
|
+
* paths, deeper static wildcard prefixes outrank broader fallbacks, and equal
|
|
23
|
+
* specificity preserves the original config order.
|
|
18
24
|
*/
|
|
19
25
|
export declare function findMatchingTransition(from: string, to: string, transitions: Array<{
|
|
20
26
|
from: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-matching-transition.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/find-matching-transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"find-matching-transition.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/find-matching-transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AA6H/C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,KAAK,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,gBAAgB,CAAC;CAC9B,CAAC,GACD,gBAAgB,GAAG,IAAI,CAsBzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/core",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.3",
|
|
4
4
|
"description": "Core animation engine for SSGOI - Native app-like page transitions with spring physics",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -32,18 +32,6 @@
|
|
|
32
32
|
"!dist/**/*.test.*",
|
|
33
33
|
"!dist/**/*.spec.*"
|
|
34
34
|
],
|
|
35
|
-
"scripts": {
|
|
36
|
-
"dev": "vite",
|
|
37
|
-
"watch": "vite build --watch",
|
|
38
|
-
"build": "tsc && vite build",
|
|
39
|
-
"preview": "vite preview",
|
|
40
|
-
"prepare": "pnpm run build",
|
|
41
|
-
"lint": "eslint .",
|
|
42
|
-
"test": "vitest",
|
|
43
|
-
"test:ui": "vitest --ui",
|
|
44
|
-
"test:run": "vitest run",
|
|
45
|
-
"test:coverage": "vitest run --coverage"
|
|
46
|
-
},
|
|
47
35
|
"keywords": [
|
|
48
36
|
"page-transition",
|
|
49
37
|
"page-transitions",
|
|
@@ -88,5 +76,16 @@
|
|
|
88
76
|
"vite": "^6.0.7",
|
|
89
77
|
"vite-plugin-dts": "^4.5.0",
|
|
90
78
|
"vitest": "^3.2.4"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"dev": "vite",
|
|
82
|
+
"watch": "vite build --watch",
|
|
83
|
+
"build": "tsc && vite build",
|
|
84
|
+
"preview": "vite preview",
|
|
85
|
+
"lint": "eslint .",
|
|
86
|
+
"test": "vitest",
|
|
87
|
+
"test:ui": "vitest --ui",
|
|
88
|
+
"test:run": "vitest run",
|
|
89
|
+
"test:coverage": "vitest run --coverage"
|
|
91
90
|
}
|
|
92
|
-
}
|
|
91
|
+
}
|