@jasonshimmy/custom-elements-runtime 1.2.2 → 1.2.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/dist/custom-elements-runtime.cjs.js +20 -17
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +1054 -980
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +20 -17
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/router.d.ts +4 -9
- package/dist/store.d.ts +5 -1
- package/package.json +2 -1
package/dist/router.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lightweight, scalable router for Custom Elements Runtime
|
|
3
|
-
* - Functional API, zero dependencies, SSR/static site compatible
|
|
4
|
-
* - Integrates with createStore and lib/index.ts
|
|
5
|
-
*/
|
|
6
1
|
import { type Store } from "./store";
|
|
7
2
|
export type RouteComponent = {
|
|
8
3
|
new (...args: any[]): any;
|
|
@@ -49,8 +44,8 @@ export interface RouterLinkProps {
|
|
|
49
44
|
ariaCurrentValue: string;
|
|
50
45
|
disabled: boolean;
|
|
51
46
|
external: boolean;
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
linkClass?: string;
|
|
48
|
+
linkStyle?: string;
|
|
54
49
|
}
|
|
55
50
|
export interface RouterLinkComputed {
|
|
56
51
|
current: RouteState;
|
|
@@ -83,7 +78,7 @@ export declare function useRouter(config: RouterConfig): {
|
|
|
83
78
|
push: (path: string) => Promise<void>;
|
|
84
79
|
replace: (path: string) => Promise<void>;
|
|
85
80
|
back: () => void;
|
|
86
|
-
subscribe: (listener: (state: RouteState) => void) => void;
|
|
81
|
+
subscribe: (listener: (state: RouteState) => void) => () => void;
|
|
87
82
|
matchRoute: (path: string) => {
|
|
88
83
|
route: Route | null;
|
|
89
84
|
params: Record<string, string>;
|
|
@@ -106,7 +101,7 @@ export declare function initRouter(config: RouterConfig): {
|
|
|
106
101
|
push: (path: string) => Promise<void>;
|
|
107
102
|
replace: (path: string) => Promise<void>;
|
|
108
103
|
back: () => void;
|
|
109
|
-
subscribe: (listener: (state: RouteState) => void) => void;
|
|
104
|
+
subscribe: (listener: (state: RouteState) => void) => () => void;
|
|
110
105
|
matchRoute: (path: string) => {
|
|
111
106
|
route: Route | null;
|
|
112
107
|
params: Record<string, string>;
|
package/dist/store.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
type Listener<T> = (state: T) => void;
|
|
2
2
|
export interface Store<T extends object> {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Subscribe to store updates.
|
|
5
|
+
* Returns an unsubscribe function to remove the listener.
|
|
6
|
+
*/
|
|
7
|
+
subscribe(listener: Listener<T>): () => void;
|
|
4
8
|
getState(): T;
|
|
5
9
|
setState(partial: Partial<T> | ((prev: T) => Partial<T>)): void;
|
|
6
10
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jasonshimmy/custom-elements-runtime",
|
|
3
3
|
"description": "A powerful, modern, and lightweight runtime for creating reactive web components with TypeScript",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"web-components",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@testing-library/jest-dom": "^6.8.0",
|
|
33
|
+
"@types/jsdom": "^27.0.0",
|
|
33
34
|
"@vitest/coverage-v8": "^3.2.4",
|
|
34
35
|
"cypress": "^15.0.0",
|
|
35
36
|
"jsdom": "^26.1.0",
|