reactive-route 0.0.1-alpha.15 → 0.0.1-alpha.16
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/adapters/kr-observable.d.ts.map +1 -1
- package/dist/adapters/mobx.d.ts.map +1 -1
- package/dist/adapters/solid.d.ts.map +1 -1
- package/dist/cjs/adapters/kr-observable/index.js +0 -1
- package/dist/cjs/adapters/mobx/index.js +1 -2
- package/dist/cjs/adapters/solid/index.js +1 -2
- package/dist/cjs/react/index.js +0 -2
- package/dist/cjs/solid/index.js +15 -13
- package/dist/core/types/InterfaceRouterStore.d.ts +0 -2
- package/dist/core/types/InterfaceRouterStore.d.ts.map +1 -1
- package/dist/esm/adapters/kr-observable/index.js +0 -1
- package/dist/esm/adapters/mobx/index.js +2 -3
- package/dist/esm/adapters/solid/index.js +1 -2
- package/dist/esm/react/index.js +0 -2
- package/dist/esm/solid/index.js +15 -13
- package/dist/solid/Router.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kr-observable.d.ts","sourceRoot":"","sources":["../../packages/adapters/kr-observable.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"kr-observable.d.ts","sourceRoot":"","sources":["../../packages/adapters/kr-observable.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,YAYtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobx.d.ts","sourceRoot":"","sources":["../../packages/adapters/mobx.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"mobx.d.ts","sourceRoot":"","sources":["../../packages/adapters/mobx.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,YAetB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solid.d.ts","sourceRoot":"","sources":["../../packages/adapters/solid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"solid.d.ts","sourceRoot":"","sources":["../../packages/adapters/solid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,eAAO,MAAM,QAAQ,EAAE,YAmBtB,CAAC"}
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -65,7 +65,6 @@ function RouterInner(props) {
|
|
|
65
65
|
if (loadedComponentPage === currentRoute.pageName) {
|
|
66
66
|
props.routerStore.adapters.batch(() => {
|
|
67
67
|
config.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
|
|
68
|
-
config[Symbol.for("$adm")]?.batch();
|
|
69
68
|
});
|
|
70
69
|
preventRedirect = true;
|
|
71
70
|
}
|
|
@@ -77,7 +76,6 @@ function RouterInner(props) {
|
|
|
77
76
|
config.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
|
|
78
77
|
config.loadedComponentName = currentRoute.name;
|
|
79
78
|
config.loadedComponentPage = componentConfig.pageName;
|
|
80
|
-
config[Symbol.for("$adm")]?.batch();
|
|
81
79
|
});
|
|
82
80
|
}, []);
|
|
83
81
|
(0, import_react.useState)(() => {
|
package/dist/cjs/solid/index.js
CHANGED
|
@@ -77,23 +77,25 @@ function Router(props) {
|
|
|
77
77
|
props.routerStore.adapters.replaceObject(config.currentProps, "props" in componentConfig ? componentConfig.props : {});
|
|
78
78
|
config.loadedComponentName = currentRouteName;
|
|
79
79
|
config.loadedComponentPage = componentConfig.pageName;
|
|
80
|
-
config[Symbol.for("$adm")]?.batch();
|
|
81
80
|
});
|
|
82
81
|
});
|
|
83
82
|
}
|
|
84
83
|
props.beforeMount?.();
|
|
85
84
|
redirectOnHistoryPop();
|
|
86
85
|
props.routerStore.adapters.autorun(() => setLoadedComponent());
|
|
87
|
-
return (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
86
|
+
return (
|
|
87
|
+
// @ts-ignore
|
|
88
|
+
(0, import_web.createComponent)(import_solid_js.Show, {
|
|
89
|
+
get when() {
|
|
90
|
+
return config.loadedComponentName;
|
|
91
|
+
},
|
|
92
|
+
get children() {
|
|
93
|
+
return (0, import_web.createComponent)(import_web3.Dynamic, (0, import_web2.mergeProps)({
|
|
94
|
+
get component() {
|
|
95
|
+
return props.routes[config.loadedComponentName]?.component || void 0;
|
|
96
|
+
}
|
|
97
|
+
}, () => config.currentProps));
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
);
|
|
99
101
|
}
|
|
@@ -6,9 +6,7 @@ export type TypeAdapters = {
|
|
|
6
6
|
autorun: (cb: () => void) => any;
|
|
7
7
|
replaceObject: <TObj extends Record<string, any>>(obj: TObj, newObj: TObj) => void;
|
|
8
8
|
makeObservable: <TObj extends Record<string, any>>(obj: TObj) => TObj;
|
|
9
|
-
makeAutoObservable: (...args: Array<any>) => any;
|
|
10
9
|
observer?: (comp: any) => any;
|
|
11
|
-
subscribe?: (target: any, cb: () => void, keys: Set<any>) => any;
|
|
12
10
|
};
|
|
13
11
|
export type TypeCreateRouterStore<TRoutes extends Record<string | 'notFound' | 'internalError', TypeRoute>> = {
|
|
14
12
|
routes: TRoutes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InterfaceRouterStore.d.ts","sourceRoot":"","sources":["../../../packages/core/types/InterfaceRouterStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,GAAG,CAAC;IACjC,aAAa,EAAE,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,KAAK,IAAI,CAAC;IACnF,cAAc,EAAE,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACtE,
|
|
1
|
+
{"version":3,"file":"InterfaceRouterStore.d.ts","sourceRoot":"","sources":["../../../packages/core/types/InterfaceRouterStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,GAAG,CAAC;IACjC,aAAa,EAAE,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,KAAK,IAAI,CAAC;IACnF,cAAc,EAAE,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACtE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAC/B,OAAO,SAAS,MAAM,CAAC,MAAM,GAAG,UAAU,GAAG,eAAe,EAAE,SAAS,CAAC,IACtE;IACF,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAC9B,OAAO,SAAS,MAAM,CAAC,MAAM,GAAG,UAAU,GAAG,eAAe,EAAE,SAAS,CAAC,IACtE;IACF,QAAQ,EAAE,YAAY,CAAC;IACvB,YAAY,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC;IACvD,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,UAAU,SAAS,MAAM,OAAO,EACzC,MAAM,EAAE,oBAAoB,CAAC,OAAO,EAAE,UAAU,CAAC,GAChD,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,cAAc,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,iBAAiB,CAAC,GAAG,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// packages/adapters/mobx.ts
|
|
2
|
-
import { autorun,
|
|
2
|
+
import { autorun, observable, runInAction } from "mobx";
|
|
3
3
|
import { observer } from "mobx-react-lite";
|
|
4
4
|
var adapters = {
|
|
5
5
|
batch: runInAction,
|
|
@@ -15,8 +15,7 @@ var adapters = {
|
|
|
15
15
|
Object.assign(obj, newObj);
|
|
16
16
|
});
|
|
17
17
|
},
|
|
18
|
-
makeObservable: observable
|
|
19
|
-
makeAutoObservable
|
|
18
|
+
makeObservable: observable
|
|
20
19
|
};
|
|
21
20
|
export {
|
|
22
21
|
adapters
|
package/dist/esm/react/index.js
CHANGED
|
@@ -39,7 +39,6 @@ function RouterInner(props) {
|
|
|
39
39
|
if (loadedComponentPage === currentRoute.pageName) {
|
|
40
40
|
props.routerStore.adapters.batch(() => {
|
|
41
41
|
config.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
|
|
42
|
-
config[Symbol.for("$adm")]?.batch();
|
|
43
42
|
});
|
|
44
43
|
preventRedirect = true;
|
|
45
44
|
}
|
|
@@ -51,7 +50,6 @@ function RouterInner(props) {
|
|
|
51
50
|
config.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
|
|
52
51
|
config.loadedComponentName = currentRoute.name;
|
|
53
52
|
config.loadedComponentPage = componentConfig.pageName;
|
|
54
|
-
config[Symbol.for("$adm")]?.batch();
|
|
55
53
|
});
|
|
56
54
|
}, []);
|
|
57
55
|
useState(() => {
|
package/dist/esm/solid/index.js
CHANGED
|
@@ -51,25 +51,27 @@ function Router(props) {
|
|
|
51
51
|
props.routerStore.adapters.replaceObject(config.currentProps, "props" in componentConfig ? componentConfig.props : {});
|
|
52
52
|
config.loadedComponentName = currentRouteName;
|
|
53
53
|
config.loadedComponentPage = componentConfig.pageName;
|
|
54
|
-
config[Symbol.for("$adm")]?.batch();
|
|
55
54
|
});
|
|
56
55
|
});
|
|
57
56
|
}
|
|
58
57
|
props.beforeMount?.();
|
|
59
58
|
redirectOnHistoryPop();
|
|
60
59
|
props.routerStore.adapters.autorun(() => setLoadedComponent());
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
60
|
+
return (
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
_$createComponent(Show, {
|
|
63
|
+
get when() {
|
|
64
|
+
return config.loadedComponentName;
|
|
65
|
+
},
|
|
66
|
+
get children() {
|
|
67
|
+
return _$createComponent(Dynamic, _$mergeProps({
|
|
68
|
+
get component() {
|
|
69
|
+
return props.routes[config.loadedComponentName]?.component || void 0;
|
|
70
|
+
}
|
|
71
|
+
}, () => config.currentProps));
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
);
|
|
73
75
|
}
|
|
74
76
|
export {
|
|
75
77
|
Router
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../packages/solid/Router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAItF,wBAAgB,MAAM,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../packages/solid/Router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAItF,wBAAgB,MAAM,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,kCA4FhG"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "reactive-route",
|
|
3
3
|
"author": "Dmitry Kazakov",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.0.1-alpha.
|
|
5
|
+
"version": "0.0.1-alpha.16",
|
|
6
6
|
"description": "Reactive Router for different frameworks",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"esbuild": "0.25.9",
|
|
49
49
|
"global-jsdom": "26.0.0",
|
|
50
50
|
"husky": "9.1.7",
|
|
51
|
-
"kr-observable": "3.
|
|
51
|
+
"kr-observable": "3.1.1",
|
|
52
52
|
"lint-staged": "16.1.6",
|
|
53
53
|
"lodash": "4.17.21",
|
|
54
54
|
"mobx": "6.13.7",
|