reactive-route 0.0.1-alpha.3 → 0.0.1-alpha.31

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.
Files changed (163) hide show
  1. package/adapters/kr-observable-preact.cjs +39 -0
  2. package/adapters/kr-observable-preact.d.ts +3 -0
  3. package/adapters/kr-observable-preact.d.ts.map +1 -0
  4. package/adapters/kr-observable-preact.mjs +18 -0
  5. package/adapters/kr-observable-react.cjs +39 -0
  6. package/adapters/kr-observable-react.d.ts +3 -0
  7. package/adapters/kr-observable-react.d.ts.map +1 -0
  8. package/adapters/kr-observable-react.mjs +18 -0
  9. package/adapters/kr-observable-solid.cjs +37 -0
  10. package/adapters/kr-observable-solid.d.ts +3 -0
  11. package/adapters/kr-observable-solid.d.ts.map +1 -0
  12. package/adapters/kr-observable-solid.mjs +16 -0
  13. package/adapters/mobx-preact.cjs +43 -0
  14. package/adapters/mobx-preact.d.ts +3 -0
  15. package/adapters/mobx-preact.d.ts.map +1 -0
  16. package/adapters/mobx-preact.mjs +22 -0
  17. package/adapters/mobx-react.cjs +43 -0
  18. package/adapters/mobx-react.d.ts +3 -0
  19. package/adapters/mobx-react.d.ts.map +1 -0
  20. package/adapters/mobx-react.mjs +22 -0
  21. package/adapters/mobx-solid.cjs +42 -0
  22. package/adapters/mobx-solid.d.ts +3 -0
  23. package/adapters/mobx-solid.d.ts.map +1 -0
  24. package/adapters/mobx-solid.mjs +21 -0
  25. package/adapters/solid.cjs +45 -0
  26. package/adapters/solid.d.ts +3 -0
  27. package/adapters/solid.d.ts.map +1 -0
  28. package/adapters/solid.mjs +24 -0
  29. package/adapters/vue.cjs +40 -0
  30. package/adapters/vue.d.ts +3 -0
  31. package/adapters/vue.d.ts.map +1 -0
  32. package/adapters/vue.mjs +19 -0
  33. package/core/createRouter.d.ts +9 -0
  34. package/core/createRouter.d.ts.map +1 -0
  35. package/{dist/types/core/createRouterConfig.d.ts → core/createRoutes.d.ts} +4 -4
  36. package/core/createRoutes.d.ts.map +1 -0
  37. package/core/index.d.ts +14 -0
  38. package/core/index.d.ts.map +1 -0
  39. package/core/types/TypeAdapters.d.ts +9 -0
  40. package/core/types/TypeAdapters.d.ts.map +1 -0
  41. package/{dist/types/core → core}/types/TypeCurrentRoute.d.ts +1 -1
  42. package/core/types/TypeCurrentRoute.d.ts.map +1 -0
  43. package/{dist/types/core → core}/types/TypeLifecycleConfig.d.ts +2 -0
  44. package/core/types/TypeLifecycleConfig.d.ts.map +1 -0
  45. package/{dist/types/core → core}/types/TypePropsRouter.d.ts +2 -3
  46. package/core/types/TypePropsRouter.d.ts.map +1 -0
  47. package/{dist/types/core/types/TypeRedirectToParams.d.ts → core/types/TypeRedirectParams.d.ts} +6 -10
  48. package/core/types/TypeRedirectParams.d.ts.map +1 -0
  49. package/{dist/types/core → core}/types/TypeRoute.d.ts +0 -1
  50. package/core/types/TypeRoute.d.ts.map +1 -0
  51. package/{dist/types/core → core}/types/TypeRouteRaw.d.ts +1 -0
  52. package/core/types/TypeRouteRaw.d.ts.map +1 -0
  53. package/core/types/TypeRouter.d.ts +22 -0
  54. package/core/types/TypeRouter.d.ts.map +1 -0
  55. package/core/types/TypeValidator.d.ts.map +1 -0
  56. package/core/utils/PreventError.d.ts +4 -0
  57. package/core/utils/PreventError.d.ts.map +1 -0
  58. package/core/utils/RedirectError.d.ts +4 -0
  59. package/core/utils/RedirectError.d.ts.map +1 -0
  60. package/core/utils/addNames.d.ts.map +1 -0
  61. package/{dist/types/core → core}/utils/constants.d.ts +0 -2
  62. package/core/utils/constants.d.ts.map +1 -0
  63. package/core/utils/dynamic.d.ts.map +1 -0
  64. package/core/utils/findRouteByPathname.d.ts.map +1 -0
  65. package/core/utils/getDynamicValues.d.ts.map +1 -0
  66. package/core/utils/getInitialRoute.d.ts +7 -0
  67. package/core/utils/getInitialRoute.d.ts.map +1 -0
  68. package/core/utils/getQueryValues.d.ts.map +1 -0
  69. package/core/utils/getTypedEntries.d.ts.map +1 -0
  70. package/core/utils/history.d.ts.map +1 -0
  71. package/core/utils/loadComponentToConfig.d.ts.map +1 -0
  72. package/core/utils/queryString.d.ts +8 -0
  73. package/core/utils/queryString.d.ts.map +1 -0
  74. package/{dist/types/core → core}/utils/replaceDynamicValues.d.ts +1 -2
  75. package/core/utils/replaceDynamicValues.d.ts.map +1 -0
  76. package/core/utils/routerSetLoadedComponent.d.ts +7 -0
  77. package/core/utils/routerSetLoadedComponent.d.ts.map +1 -0
  78. package/index.cjs +406 -0
  79. package/index.mjs +383 -0
  80. package/package.json +67 -57
  81. package/preact/Router.d.ts +3 -0
  82. package/preact/Router.d.ts.map +1 -0
  83. package/preact/index.cjs +80 -0
  84. package/preact/index.d.ts.map +1 -0
  85. package/preact/index.mjs +57 -0
  86. package/react/Router.d.ts +5 -0
  87. package/react/Router.d.ts.map +1 -0
  88. package/react/index.cjs +79 -0
  89. package/react/index.d.ts.map +1 -0
  90. package/react/index.mjs +56 -0
  91. package/solid/Router.d.ts.map +1 -0
  92. package/solid/index.cjs +80 -0
  93. package/solid/index.d.ts +2 -0
  94. package/solid/index.d.ts.map +1 -0
  95. package/solid/index.mjs +57 -0
  96. package/vue/index.cjs +0 -0
  97. package/vue/index.d.ts +2 -0
  98. package/vue/index.d.ts.map +1 -0
  99. package/vue/index.mjs +0 -0
  100. package/LICENSE +0 -21
  101. package/README.md +0 -10
  102. package/dist/cjs/index.js +0 -381
  103. package/dist/cjs/package.json +0 -1
  104. package/dist/cjs/react/index.js +0 -149
  105. package/dist/cjs/react/package.json +0 -1
  106. package/dist/cjs/solid/index.js +0 -130
  107. package/dist/cjs/solid/package.json +0 -1
  108. package/dist/esm/index.js +0 -348
  109. package/dist/esm/package.json +0 -1
  110. package/dist/esm/react/index.js +0 -126
  111. package/dist/esm/react/package.json +0 -1
  112. package/dist/esm/solid/index.js +0 -107
  113. package/dist/esm/solid/package.json +0 -1
  114. package/dist/types/core/createRouterConfig.d.ts.map +0 -1
  115. package/dist/types/core/createRouterStore.d.ts +0 -4
  116. package/dist/types/core/createRouterStore.d.ts.map +0 -1
  117. package/dist/types/core/index.d.ts +0 -14
  118. package/dist/types/core/index.d.ts.map +0 -1
  119. package/dist/types/core/types/InterfaceRouterStore.d.ts +0 -24
  120. package/dist/types/core/types/InterfaceRouterStore.d.ts.map +0 -1
  121. package/dist/types/core/types/TypeCurrentRoute.d.ts.map +0 -1
  122. package/dist/types/core/types/TypeLifecycleConfig.d.ts.map +0 -1
  123. package/dist/types/core/types/TypePropsRouter.d.ts.map +0 -1
  124. package/dist/types/core/types/TypeRedirectToParams.d.ts.map +0 -1
  125. package/dist/types/core/types/TypeRoute.d.ts.map +0 -1
  126. package/dist/types/core/types/TypeRouteRaw.d.ts.map +0 -1
  127. package/dist/types/core/types/TypeRouteWithParams.d.ts +0 -6
  128. package/dist/types/core/types/TypeRouteWithParams.d.ts.map +0 -1
  129. package/dist/types/core/types/TypeValidator.d.ts.map +0 -1
  130. package/dist/types/core/utils/addNames.d.ts.map +0 -1
  131. package/dist/types/core/utils/constants.d.ts.map +0 -1
  132. package/dist/types/core/utils/dynamic.d.ts.map +0 -1
  133. package/dist/types/core/utils/findRouteByPathname.d.ts.map +0 -1
  134. package/dist/types/core/utils/getDynamicValues.d.ts.map +0 -1
  135. package/dist/types/core/utils/getInitialRoute.d.ts +0 -8
  136. package/dist/types/core/utils/getInitialRoute.d.ts.map +0 -1
  137. package/dist/types/core/utils/getQueryValues.d.ts.map +0 -1
  138. package/dist/types/core/utils/getTypedEntries.d.ts.map +0 -1
  139. package/dist/types/core/utils/history.d.ts.map +0 -1
  140. package/dist/types/core/utils/loadComponentToConfig.d.ts.map +0 -1
  141. package/dist/types/core/utils/replaceDynamicValues.d.ts.map +0 -1
  142. package/dist/types/react/Router.d.ts +0 -5
  143. package/dist/types/react/Router.d.ts.map +0 -1
  144. package/dist/types/react/index.d.ts.map +0 -1
  145. package/dist/types/react/useStore.d.ts +0 -8
  146. package/dist/types/react/useStore.d.ts.map +0 -1
  147. package/dist/types/solid/Router.d.ts.map +0 -1
  148. package/dist/types/solid/index.d.ts.map +0 -1
  149. package/dist/types/solid/useStore.d.ts +0 -7
  150. package/dist/types/solid/useStore.d.ts.map +0 -1
  151. package/dist/types/tsconfig.types.tsbuildinfo +0 -1
  152. /package/{dist/types/core → core}/types/TypeValidator.d.ts +0 -0
  153. /package/{dist/types/core → core}/utils/addNames.d.ts +0 -0
  154. /package/{dist/types/core → core}/utils/dynamic.d.ts +0 -0
  155. /package/{dist/types/core → core}/utils/findRouteByPathname.d.ts +0 -0
  156. /package/{dist/types/core → core}/utils/getDynamicValues.d.ts +0 -0
  157. /package/{dist/types/core → core}/utils/getQueryValues.d.ts +0 -0
  158. /package/{dist/types/core → core}/utils/getTypedEntries.d.ts +0 -0
  159. /package/{dist/types/core → core}/utils/history.d.ts +0 -0
  160. /package/{dist/types/core → core}/utils/loadComponentToConfig.d.ts +0 -0
  161. /package/{dist/types/react → preact}/index.d.ts +0 -0
  162. /package/{dist/types/solid → react}/index.d.ts +0 -0
  163. /package/{dist/types/solid → solid}/Router.d.ts +0 -0
package/dist/esm/index.js DELETED
@@ -1,348 +0,0 @@
1
- // packages/core/utils/addNames.ts
2
- function addNames(obj) {
3
- Object.entries(obj).forEach(([key, value]) => {
4
- value.name = key;
5
- });
6
- return obj;
7
- }
8
-
9
- // packages/core/createRouterConfig.ts
10
- function createRouterConfig(config) {
11
- return addNames(config);
12
- }
13
-
14
- // packages/core/createRouterStore.ts
15
- import queryString2 from "query-string";
16
-
17
- // packages/core/utils/constants.ts
18
- var constants = {
19
- dynamicSeparator: ":",
20
- pathPartSeparator: "/",
21
- isClient: typeof window !== "undefined",
22
- errorRedirect: "REDIRECT",
23
- errorPrevent: "PREVENT_REDIRECT"
24
- };
25
-
26
- // packages/core/utils/dynamic.ts
27
- function isDynamic(param) {
28
- return param[0] === constants.dynamicSeparator;
29
- }
30
- function clearDynamic(param) {
31
- return param.replace(new RegExp(`^${constants.dynamicSeparator}`), "");
32
- }
33
- function isDynamicRoute(route) {
34
- return "params" in route;
35
- }
36
-
37
- // packages/core/utils/getDynamicValues.ts
38
- function getDynamicValues(params) {
39
- const { route, pathname } = params;
40
- const pathnameArray = pathname.replace(/\?.+$/, "").split(constants.pathPartSeparator).filter(Boolean).map((str) => decodeURIComponent(str));
41
- const routePathnameArray = route.path.split(constants.pathPartSeparator).filter(Boolean);
42
- const dynamicParams = {};
43
- for (let i = 0; i < routePathnameArray.length; i++) {
44
- const paramName = routePathnameArray[i];
45
- if (isDynamic(paramName)) dynamicParams[clearDynamic(paramName)] = pathnameArray[i];
46
- }
47
- return dynamicParams;
48
- }
49
-
50
- // packages/core/utils/getQueryValues.ts
51
- import queryString from "query-string";
52
-
53
- // packages/core/utils/getTypedEntries.ts
54
- var getTypedEntries = Object.entries;
55
-
56
- // packages/core/utils/getQueryValues.ts
57
- function getQueryValues(params) {
58
- const { route, pathname } = params;
59
- const qs = queryString.extract(pathname);
60
- if (!qs || !route.query) return {};
61
- const query = queryString.parse(qs);
62
- getTypedEntries(query).forEach(([key, value]) => {
63
- const validator = route.query[key];
64
- if (typeof validator !== "function" || !validator(value)) {
65
- delete query[key];
66
- }
67
- });
68
- return query;
69
- }
70
-
71
- // packages/core/utils/history.ts
72
- import { createBrowserHistory } from "history";
73
- var history = constants.isClient ? createBrowserHistory() : null;
74
-
75
- // packages/core/utils/loadComponentToConfig.ts
76
- function loadComponentToConfig(params) {
77
- const { route } = params;
78
- if (!route.component && route.loader) {
79
- const loadingFn = route.loader;
80
- return loadingFn().then((module) => {
81
- const { default: component, pageName, ...rest } = module;
82
- route.component = component;
83
- route.otherExports = rest;
84
- route.pageName = pageName;
85
- });
86
- }
87
- return Promise.resolve();
88
- }
89
-
90
- // packages/core/utils/replaceDynamicValues.ts
91
- var re = new RegExp(`[^${constants.pathPartSeparator}]+`, "g");
92
- function replaceDynamicValues({
93
- route,
94
- params = {}
95
- }) {
96
- return route.path.replace(re, (paramName) => {
97
- if (!isDynamic(paramName)) return paramName;
98
- const value = params[clearDynamic(paramName)];
99
- if (!value) {
100
- throw new Error(
101
- `replaceDynamicValues: no param "${paramName}" passed for route ${route.name}`
102
- );
103
- }
104
- return encodeURIComponent(value);
105
- });
106
- }
107
-
108
- // packages/core/createRouterStore.ts
109
- function createRouterStore({
110
- batch,
111
- routes,
112
- autorun,
113
- replaceObject,
114
- routeError500,
115
- makeObservable,
116
- lifecycleParams
117
- }) {
118
- const routerStore = makeObservable({
119
- routesHistory: [],
120
- currentRoute: {},
121
- isRedirecting: false,
122
- redirectTo: void 0,
123
- restoreFromServer: void 0,
124
- utils: {
125
- batch,
126
- autorun,
127
- replaceObject,
128
- makeObservable
129
- }
130
- });
131
- routerStore.restoreFromServer = function restoreFromServer(obj) {
132
- batch(() => {
133
- routerStore.routesHistory.push(...obj.routesHistory || []);
134
- Object.assign(routerStore.currentRoute, obj.currentRoute);
135
- });
136
- const preloadedRouteName = Object.keys(routes).find(
137
- (routeName) => routerStore.currentRoute.name === routeName
138
- );
139
- return loadComponentToConfig({ route: routes[preloadedRouteName] });
140
- };
141
- routerStore.redirectTo = async function redirectTo(config) {
142
- const { route: routeName, noHistoryPush, asClient } = config;
143
- const isClient = typeof asClient === "boolean" ? asClient : constants.isClient;
144
- let currentRoute;
145
- let currentPathname;
146
- let currentUrl;
147
- let currentSearch;
148
- let currentQuery;
149
- if (routerStore.currentRoute?.name) {
150
- currentRoute = routes[routerStore.currentRoute.name];
151
- currentPathname = replaceDynamicValues({
152
- route: currentRoute,
153
- params: routerStore.currentRoute.params
154
- });
155
- currentUrl = queryString2.stringifyUrl({
156
- url: currentPathname,
157
- query: routerStore.currentRoute.query
158
- });
159
- currentQuery = routerStore.currentRoute.query;
160
- currentSearch = queryString2.stringify(routerStore.currentRoute.query);
161
- }
162
- const nextRoute = routes[routeName];
163
- const nextPathname = replaceDynamicValues({
164
- route: nextRoute,
165
- params: "params" in config ? config.params : void 0
166
- });
167
- let nextQuery;
168
- let nextUrl = nextPathname;
169
- let nextSearch;
170
- if ("query" in config && config.query) {
171
- const clearedQuery = getQueryValues({
172
- route: nextRoute,
173
- pathname: `${nextPathname}?${queryString2.stringify(config.query)}`
174
- });
175
- if (Object.keys(clearedQuery).length > 0) {
176
- nextQuery = clearedQuery;
177
- nextSearch = queryString2.stringify(clearedQuery);
178
- nextUrl = queryString2.stringifyUrl({ url: nextPathname, query: clearedQuery });
179
- }
180
- }
181
- if (currentUrl === nextUrl) return Promise.resolve();
182
- if (currentPathname === nextPathname) {
183
- if (currentSearch !== nextSearch) {
184
- batch(() => {
185
- replaceObject(routerStore.currentRoute.query, nextQuery || {});
186
- routerStore.routesHistory.push(nextUrl);
187
- });
188
- if (history && !noHistoryPush) {
189
- history.push({
190
- hash: history.location.hash,
191
- search: nextSearch,
192
- pathname: nextPathname
193
- });
194
- }
195
- }
196
- return Promise.resolve();
197
- }
198
- batch(() => {
199
- routerStore.isRedirecting = true;
200
- });
201
- try {
202
- await currentRoute?.beforeLeave?.(
203
- {
204
- nextUrl,
205
- nextRoute,
206
- nextQuery,
207
- nextSearch,
208
- nextPathname,
209
- currentUrl,
210
- currentQuery,
211
- currentRoute,
212
- currentSearch,
213
- currentPathname
214
- },
215
- ...lifecycleParams || []
216
- );
217
- const redirectConfig = await nextRoute.beforeEnter?.(
218
- {
219
- nextUrl,
220
- nextRoute,
221
- nextQuery,
222
- nextSearch,
223
- nextPathname,
224
- currentUrl,
225
- currentQuery,
226
- currentRoute,
227
- currentSearch,
228
- currentPathname
229
- },
230
- ...lifecycleParams || []
231
- );
232
- if (typeof redirectConfig === "object") {
233
- if (isClient) return redirectTo({ ...redirectConfig, asClient });
234
- const redirectRoute = routes[redirectConfig.route];
235
- const redirectParams = "params" in redirectConfig && redirectConfig.params ? redirectConfig.params : void 0;
236
- let redirectUrl = replaceDynamicValues({
237
- params: redirectParams,
238
- route: redirectRoute
239
- });
240
- if ("query" in redirectConfig && redirectConfig.query) {
241
- const clearedQuery = getQueryValues({
242
- route: nextRoute,
243
- pathname: `${nextPathname}?${queryString2.stringify(redirectConfig.query)}`
244
- });
245
- if (Object.keys(clearedQuery).length > 0) {
246
- redirectUrl = queryString2.stringifyUrl({ url: redirectUrl, query: clearedQuery });
247
- }
248
- }
249
- throw Object.assign(new Error(redirectUrl), { name: constants.errorRedirect });
250
- }
251
- await loadComponentToConfig({ route: routes[nextRoute.name] });
252
- } catch (error) {
253
- if (error?.name === constants.errorPrevent) return Promise.resolve();
254
- if (error?.name === constants.errorRedirect) {
255
- throw error;
256
- }
257
- console.error(error);
258
- await loadComponentToConfig({ route: routeError500 });
259
- batch(() => {
260
- replaceObject(routerStore.currentRoute, {
261
- name: routeError500.name,
262
- path: routeError500.path,
263
- props: routes[routeError500.name].props,
264
- query: {},
265
- params: {},
266
- pageName: routes[routeError500.name].pageName
267
- });
268
- routerStore.isRedirecting = false;
269
- });
270
- return Promise.resolve();
271
- }
272
- batch(() => {
273
- replaceObject(routerStore.currentRoute, {
274
- name: nextRoute.name,
275
- path: nextRoute.path,
276
- props: routes[nextRoute.name].props,
277
- query: getQueryValues({ route: nextRoute, pathname: nextUrl }),
278
- params: getDynamicValues({ route: nextRoute, pathname: nextUrl }),
279
- pageName: routes[nextRoute.name].pageName
280
- });
281
- const lastUrl = routerStore.routesHistory[routerStore.routesHistory.length - 1];
282
- if (lastUrl !== nextUrl) {
283
- routerStore.routesHistory.push(nextUrl);
284
- }
285
- if (history && !noHistoryPush) {
286
- history.push({
287
- hash: history.location.hash,
288
- search: "query" in config ? `?${queryString2.stringify(config.query)}` : "",
289
- pathname: nextPathname
290
- });
291
- }
292
- routerStore.isRedirecting = false;
293
- });
294
- return Promise.resolve();
295
- };
296
- return routerStore;
297
- }
298
-
299
- // packages/core/utils/findRouteByPathname.ts
300
- function completeStaticMatch(pathname, path) {
301
- return !path.includes(constants.dynamicSeparator) && (pathname === path || pathname === `${path}${constants.pathPartSeparator}`);
302
- }
303
- function findRouteByPathname({
304
- pathname,
305
- routes
306
- }) {
307
- let dynamicRouteMatch;
308
- const pathnameArray = pathname.replace(/\?.+$/, "").split(constants.pathPartSeparator).filter(Boolean);
309
- for (const routeName in routes) {
310
- if (!Object.hasOwn(routes, routeName)) continue;
311
- const route = routes[routeName];
312
- if (completeStaticMatch(pathname, route.path)) return route;
313
- if (dynamicRouteMatch) continue;
314
- const routePathnameArray = route.path.split(constants.pathPartSeparator).filter(Boolean);
315
- if (routePathnameArray.length !== pathnameArray.length) continue;
316
- const someParamInvalid = routePathnameArray.some((paramName, i) => {
317
- const paramFromUrl = pathnameArray[i];
318
- if (!isDynamic(paramName)) return paramName !== paramFromUrl;
319
- const validator = route.params?.[clearDynamic(paramName)];
320
- if (typeof validator !== "function") {
321
- throw new Error(`findRoute: missing validator for param "${paramName}"`);
322
- }
323
- return !validator(paramFromUrl);
324
- });
325
- if (!someParamInvalid) dynamicRouteMatch = route;
326
- }
327
- return dynamicRouteMatch;
328
- }
329
-
330
- // packages/core/utils/getInitialRoute.ts
331
- function getInitialRoute(params) {
332
- const route = findRouteByPathname({ pathname: params.pathname, routes: params.routes }) || params.routes[params.fallback];
333
- return {
334
- route: route.name,
335
- query: getQueryValues({ route, pathname: params.pathname }),
336
- params: getDynamicValues({ route, pathname: params.pathname })
337
- };
338
- }
339
- export {
340
- createRouterConfig,
341
- createRouterStore,
342
- findRouteByPathname,
343
- getInitialRoute,
344
- history,
345
- isDynamicRoute,
346
- loadComponentToConfig,
347
- replaceDynamicValues
348
- };
@@ -1 +0,0 @@
1
- {"type": "module"}
@@ -1,126 +0,0 @@
1
- // packages/react/Router.tsx
2
- import { makeAutoObservable } from "mobx";
3
- import { observer } from "mobx-react-lite";
4
- import { getInitialRoute, history } from "reactive-route";
5
-
6
- // packages/react/useStore.ts
7
- import { runInAction } from "mobx";
8
- import { useEffect, useRef, useState } from "react";
9
- function useStore(ViewModel, props) {
10
- const isFirstRenderRef = useRef(true);
11
- const [vm] = useState(() => {
12
- const instance = new ViewModel(props || {});
13
- runInAction(() => {
14
- instance.beforeMount?.();
15
- });
16
- return instance;
17
- });
18
- useEffect(() => {
19
- if (isFirstRenderRef.current) {
20
- isFirstRenderRef.current = false;
21
- } else if (props) {
22
- runInAction(() => {
23
- vm.props = props || {};
24
- });
25
- }
26
- }, [props]);
27
- useEffect(() => {
28
- vm.afterMount?.();
29
- return () => {
30
- vm.autorunDisposers?.forEach((disposer) => disposer());
31
- };
32
- }, []);
33
- return vm;
34
- }
35
-
36
- // packages/react/Router.tsx
37
- import { jsx } from "react/jsx-runtime";
38
- var VM = class {
39
- constructor(props) {
40
- this.props = props;
41
- makeAutoObservable(
42
- this,
43
- { loadedComponent: false, setLoadedComponent: false, props: false },
44
- { autoBind: true }
45
- );
46
- }
47
- autorunDisposers = [];
48
- loadedComponentName = void 0;
49
- loadedComponentPage = void 0;
50
- loadedComponent;
51
- currentProps = {};
52
- get utils() {
53
- return this.props.routerStore.utils;
54
- }
55
- beforeMount() {
56
- this.props.beforeMount?.();
57
- this.redirectOnHistoryPop();
58
- this.setLoadedComponent();
59
- this.autorunDisposers.push(this.utils.autorun(this.setLoadedComponent));
60
- }
61
- redirectOnHistoryPop() {
62
- if (!history) return;
63
- history.listen((params) => {
64
- if (params.action !== "POP") return;
65
- const previousRoutePathname = this.props.routerStore.routesHistory[this.props.routerStore.routesHistory.length - 2];
66
- if (previousRoutePathname === params.location.pathname) {
67
- this.utils.batch(() => this.props.routerStore.routesHistory.pop());
68
- }
69
- void this.props.routerStore.redirectTo({
70
- noHistoryPush: true,
71
- ...getInitialRoute({
72
- routes: this.props.routes,
73
- pathname: history.location.pathname,
74
- fallback: "error404"
75
- })
76
- });
77
- });
78
- }
79
- setLoadedComponent = () => {
80
- const { loadedComponentName, loadedComponentPage } = this;
81
- const { currentRoute, isRedirecting } = this.props.routerStore;
82
- const currentRouteName = currentRoute.name;
83
- const currentRoutePage = currentRoute.pageName;
84
- let preventRedirect = false;
85
- if (isRedirecting) preventRedirect = true;
86
- else if (loadedComponentName === currentRouteName) preventRedirect = true;
87
- else if (loadedComponentPage != null && currentRouteName != null) {
88
- if (loadedComponentPage === currentRoutePage) {
89
- const componentConfig = this.props.routes[currentRouteName];
90
- this.utils.batch(() => {
91
- this.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
92
- });
93
- preventRedirect = true;
94
- }
95
- }
96
- if (preventRedirect) return;
97
- this.utils.batch(() => {
98
- if (!loadedComponentName) {
99
- this.setComponent(currentRouteName);
100
- } else {
101
- this.props.beforeUpdatePageComponent?.();
102
- this.setComponent(currentRouteName);
103
- }
104
- });
105
- };
106
- setComponent(currentRouteName) {
107
- const componentConfig = this.props.routes[currentRouteName];
108
- const RouteComponent = componentConfig.component;
109
- this.props.beforeSetPageComponent?.(componentConfig);
110
- this.currentProps = "props" in componentConfig ? componentConfig.props || {} : {};
111
- this.loadedComponentName = currentRouteName;
112
- this.loadedComponentPage = componentConfig.pageName;
113
- this.loadedComponent = RouteComponent;
114
- }
115
- };
116
- var Router = observer(
117
- (props) => {
118
- const vm = useStore(VM, props);
119
- const LoadedComponent = vm.loadedComponentName ? vm.loadedComponent : null;
120
- if (LoadedComponent) return /* @__PURE__ */ jsx(LoadedComponent, { ...vm.currentProps });
121
- return null;
122
- }
123
- );
124
- export {
125
- Router
126
- };
@@ -1 +0,0 @@
1
- {"type": "module"}
@@ -1,107 +0,0 @@
1
- // packages/solid/Router.tsx
2
- import { createComponent as _$createComponent } from "solid-js/web";
3
- import { mergeProps as _$mergeProps } from "solid-js/web";
4
- import { getInitialRoute, history } from "reactive-route";
5
- import { Show } from "solid-js";
6
- import { createMutable } from "solid-js/store";
7
- import { Dynamic } from "solid-js/web";
8
-
9
- // packages/solid/useStore.ts
10
- import { onMount } from "solid-js";
11
- function useStore(ViewModel, props) {
12
- const vm = new ViewModel(props);
13
- vm.beforeMount?.();
14
- onMount(() => {
15
- vm.afterMount?.();
16
- });
17
- return vm;
18
- }
19
-
20
- // packages/solid/Router.tsx
21
- var VM = class {
22
- constructor(props) {
23
- this.props = props;
24
- return createMutable(this);
25
- }
26
- loadedComponentName = void 0;
27
- loadedComponentPage = void 0;
28
- currentProps = {};
29
- get utils() {
30
- return this.props.routerStore.utils;
31
- }
32
- beforeMount() {
33
- this.props.beforeMount?.();
34
- this.redirectOnHistoryPop();
35
- this.utils.autorun(() => this.setLoadedComponent());
36
- }
37
- redirectOnHistoryPop() {
38
- if (!history) return;
39
- history.listen((params) => {
40
- if (params.action !== "POP") return;
41
- const previousRoutePathname = this.props.routerStore.routesHistory[this.props.routerStore.routesHistory.length - 2];
42
- if (previousRoutePathname === params.location.pathname) {
43
- this.props.routerStore.routesHistory.pop();
44
- }
45
- void this.props.routerStore.redirectTo({
46
- noHistoryPush: true,
47
- ...getInitialRoute({
48
- routes: this.props.routes,
49
- pathname: history.location.pathname,
50
- fallback: "error404"
51
- })
52
- });
53
- });
54
- }
55
- setLoadedComponent() {
56
- const currentRouteName = this.props.routerStore.currentRoute.name;
57
- const currentRoutePage = this.props.routerStore.currentRoute.pageName;
58
- let preventRedirect = false;
59
- if (this.props.routerStore.isRedirecting) preventRedirect = true;
60
- else if (this.loadedComponentName === currentRouteName) {
61
- preventRedirect = true;
62
- } else if (this.loadedComponentPage != null && currentRouteName != null) {
63
- if (this.loadedComponentPage === currentRoutePage) {
64
- const componentConfig = this.props.routes[currentRouteName];
65
- this.utils.replaceObject(this.currentProps, "props" in componentConfig ? componentConfig.props : {});
66
- preventRedirect = true;
67
- }
68
- }
69
- if (preventRedirect) return;
70
- this.utils.batch(() => {
71
- if (!this.loadedComponentName) {
72
- this.setComponent();
73
- } else {
74
- this.props.beforeUpdatePageComponent?.();
75
- this.setComponent();
76
- }
77
- });
78
- }
79
- setComponent() {
80
- const currentRouteName = this.props.routerStore.currentRoute.name;
81
- const componentConfig = this.props.routes[currentRouteName];
82
- this.props.beforeSetPageComponent?.(componentConfig);
83
- this.utils.batch(() => {
84
- this.utils.replaceObject(this.currentProps, "props" in componentConfig ? componentConfig.props : {});
85
- this.loadedComponentName = currentRouteName;
86
- this.loadedComponentPage = componentConfig.pageName;
87
- });
88
- }
89
- };
90
- function Router(props) {
91
- const vm = useStore(VM, props);
92
- return _$createComponent(Show, {
93
- get when() {
94
- return vm.loadedComponentName;
95
- },
96
- get children() {
97
- return _$createComponent(Dynamic, _$mergeProps({
98
- get component() {
99
- return props.routes[vm.loadedComponentName]?.component || void 0;
100
- }
101
- }, () => vm.currentProps));
102
- }
103
- });
104
- }
105
- export {
106
- Router
107
- };
@@ -1 +0,0 @@
1
- {"type": "module"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createRouterConfig.d.ts","sourceRoot":"","sources":["../../../packages/core/createRouterConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,wBAAgB,kBAAkB,CAAC,OAAO,SAAS;KAAG,GAAG,IAAI,MAAM,OAAO,GAAG,YAAY;CAAE,EACzF,MAAM,EAAE,OAAO,GACd;KACA,GAAG,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG;QACrC,IAAI,EAAE,GAAG,CAAC;QACV,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,GAAG,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACpC;CACF,CAEA"}
@@ -1,4 +0,0 @@
1
- import { InterfaceRouterStore, TypeCreateRouterStore } from './types/InterfaceRouterStore';
2
- import { TypeRoute } from './types/TypeRoute';
3
- export declare function createRouterStore<TRoutes extends Record<string, TypeRoute>>({ batch, routes, autorun, replaceObject, routeError500, makeObservable, lifecycleParams, }: TypeCreateRouterStore<TRoutes>): InterfaceRouterStore<TRoutes>;
4
- //# sourceMappingURL=createRouterStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createRouterStore.d.ts","sourceRoot":"","sources":["../../../packages/core/createRouterStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE3F,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAQ9C,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,EAC3E,KAAK,EACL,MAAM,EACN,OAAO,EACP,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,GAChB,EAAE,qBAAqB,CAAC,OAAO,CAAC,GAAG,oBAAoB,CAAC,OAAO,CAAC,CA0PhE"}
@@ -1,14 +0,0 @@
1
- export { createRouterConfig } from './createRouterConfig';
2
- export { createRouterStore } from './createRouterStore';
3
- export type { InterfaceRouterStore } from './types/InterfaceRouterStore';
4
- export type { TypeCurrentRoute } from './types/TypeCurrentRoute';
5
- export type { TypePropsRouter } from './types/TypePropsRouter';
6
- export type { TypeRedirectToParams } from './types/TypeRedirectToParams';
7
- export type { TypeRoute } from './types/TypeRoute';
8
- export { isDynamicRoute } from './utils/dynamic';
9
- export { findRouteByPathname } from './utils/findRouteByPathname';
10
- export { getInitialRoute } from './utils/getInitialRoute';
11
- export { history } from './utils/history';
12
- export { loadComponentToConfig } from './utils/loadComponentToConfig';
13
- export { replaceDynamicValues } from './utils/replaceDynamicValues';
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1,24 +0,0 @@
1
- import { TypeCurrentRoute } from './TypeCurrentRoute';
2
- import { TypeRedirectToParams } from './TypeRedirectToParams';
3
- import { TypeRoute } from './TypeRoute';
4
- type TypeUtils = {
5
- batch: (cb: () => void) => void;
6
- autorun: (cb: () => void) => any;
7
- replaceObject: <TObj extends Record<string, any>>(obj: TObj, newObj: TObj) => void;
8
- makeObservable: <TObj extends Record<string, any>>(obj: TObj) => TObj;
9
- };
10
- export type TypeCreateRouterStore<TRoutes extends Record<string, TypeRoute>> = TypeUtils & {
11
- routes: TRoutes;
12
- routeError500: TRoutes[keyof TRoutes];
13
- lifecycleParams?: Array<any>;
14
- };
15
- export type InterfaceRouterStore<TRoutes extends Record<string, TypeRoute>> = {
16
- routesHistory: Array<string>;
17
- currentRoute: TypeCurrentRoute<TRoutes[keyof TRoutes]>;
18
- isRedirecting: boolean;
19
- redirectTo<TRouteName extends keyof TRoutes>(config: TypeRedirectToParams<TRoutes, TRouteName>): Promise<void>;
20
- utils: TypeUtils;
21
- restoreFromServer(obj: InterfaceRouterStore<TRoutes>): Promise<void>;
22
- };
23
- export {};
24
- //# sourceMappingURL=InterfaceRouterStore.d.ts.map
@@ -1 +0,0 @@
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,KAAK,SAAS,GAAG;IACf,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;CACvE,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,SAAS,GAAG;IACzF,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI;IAC5E,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,YAAY,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC;IACvD,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,KAAK,EAAE,SAAS,CAAC;IACjB,iBAAiB,CAAC,GAAG,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TypeCurrentRoute.d.ts","sourceRoot":"","sources":["../../../../packages/core/types/TypeCurrentRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,gBAAgB,CAAC,MAAM,SAAS,SAAS,IAAI;IACvD,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,MAAM,EAAE,MAAM,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/C,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;CAC9B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TypeLifecycleConfig.d.ts","sourceRoot":"","sources":["../../../../packages/core/types/TypeLifecycleConfig.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,GAAG,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TypePropsRouter.d.ts","sourceRoot":"","sources":["../../../../packages/core/types/TypePropsRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,eAAe,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI;IACvE,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,sBAAsB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC,MAAM,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3E,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAC;CACxC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TypeRedirectToParams.d.ts","sourceRoot":"","sources":["../../../../packages/core/types/TypeRedirectToParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,MAAM,oBAAoB,CAC9B,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EACzC,UAAU,SAAS,MAAM,OAAO,IAC9B,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GACnE,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAChE;IACE,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GACD;IACE,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GACH,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAChE;IACE,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GACD;IACE,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TypeRoute.d.ts","sourceRoot":"","sources":["../../../../packages/core/types/TypeRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACpC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TypeRouteRaw.d.ts","sourceRoot":"","sources":["../../../../packages/core/types/TypeRouteRaw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,OAAO,CAAC;QAAE,OAAO,EAAE,GAAG,CAAA;KAAE,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACjF,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;CACzF,CAAC"}