tungsten 0.1.71 → 0.1.72
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/Instance/Instance.d.ts +3 -1
- package/dist/Instance/Instance.d.ts.map +1 -1
- package/dist/Instance/Instance.js +33 -10
- package/dist/Servers/DevServer.d.ts.map +1 -1
- package/dist/Servers/DevServer.js +3 -1
- package/dist/Servers/ProdServer.d.ts.map +1 -1
- package/dist/Servers/TungstenServer.d.ts.map +1 -1
- package/dist/Servers/TungstenServer.js +16 -7
- package/dist/Servers/hono/TungstenServerHono.d.ts.map +1 -1
- package/dist/Servers/hono/TungstenServerHono.js +12 -7
- package/dist/Servers/initStores.js +1 -1
- package/dist/Store/InternalStoreSchema.d.ts +3 -1
- package/dist/Store/InternalStoreSchema.d.ts.map +1 -1
- package/dist/Store/InternalStoreSchema.js +3 -1
- package/dist/components/RouteRedirectComponent.d.ts +12 -0
- package/dist/components/RouteRedirectComponent.d.ts.map +1 -0
- package/dist/components/RouteRedirectComponent.js +15 -0
- package/dist/components/{RedirectComponent.d.ts → WebRedirectComponent.d.ts} +4 -5
- package/dist/components/WebRedirectComponent.d.ts.map +1 -0
- package/dist/components/{RedirectComponent.js → WebRedirectComponent.js} +2 -2
- package/dist/indexInner.d.ts +3 -2
- package/dist/indexInner.d.ts.map +1 -1
- package/dist/indexInner.js +2 -1
- package/dist/routing/Routes.d.ts +5 -0
- package/dist/routing/Routes.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/components/RedirectComponent.d.ts.map +0 -1
|
@@ -8,6 +8,7 @@ import { MatchedRouteInfo } from '../Servers/MatchedRouteInfo.js';
|
|
|
8
8
|
import { type RouteKey } from '../routing/RouteTypes.js';
|
|
9
9
|
import type { Routes } from '../routing/Routes.js';
|
|
10
10
|
import { StoreSubscriptionsMap } from 'tungsten/Store/StoreSubscriptions.types.js';
|
|
11
|
+
import { RedirectCode } from '../routing/RedirectCode.js';
|
|
11
12
|
export declare class Instance {
|
|
12
13
|
location: string;
|
|
13
14
|
reqRes: ReqRes | null;
|
|
@@ -30,7 +31,8 @@ export declare class Instance {
|
|
|
30
31
|
constructor(location: string, instanceConfig: InstanceConfig, reqRes: ReqRes | null, appRoutes: AppRoutes, routes: Routes, internalStore: TrueStore<InternalStoreSchema>, stores: TrueStore<any>[], storeSubscriptions: StoreSubscriptionsMap, globalData: GlobalData, matchedRouteInfo: MatchedRouteInfo);
|
|
31
32
|
getRoutes: () => Routes;
|
|
32
33
|
updateLocation: (location: string) => void;
|
|
33
|
-
goto: (
|
|
34
|
+
goto: (routeKey: RouteKey) => Promise<void>;
|
|
35
|
+
redirect: (url: string, code?: RedirectCode) => void;
|
|
34
36
|
setDefaultTitle: (defaultTitle: string) => void;
|
|
35
37
|
setTitle: (title: string) => void;
|
|
36
38
|
setTitleToDefault: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Instance.d.ts","sourceRoot":"","sources":["../../src/Instance/Instance.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAIjE,OAAO,EAAyB,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAA;
|
|
1
|
+
{"version":3,"file":"Instance.d.ts","sour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CAAA;IAClC,sBAAsB,EAAE,WAAW,EAAE,CAAA;IACrC,UAAU,EAAE,OAAO,CAAQ;gBAEvB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EAGd,aAAa,EAAE,SAAS,CAAC,mBAAmB,CAAC,EAC7C,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,EACxB,kBAAkB,EAAE,qBAAqB,EACzC,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB;IAgCtC,SAAS,eAER;IACD,cAAc,GAAI,UAAU,MAAM,UAMjC;IACD,IAAI,GAAU,UAAU,QAAQ,mBA6D/B;IASD,QAAQ,GAAI,KAAK,MAAM,EAAE,OAAM,YAAkB,UAQhD;IACD,eAAe,GAAI,cAAc,MAAM,UAEtC;IACD,QAAQ,GAAI,OAAO,MAAM,UAIxB;IACD,iBAAiB,aAEhB;CAIJ"}
|
|
@@ -8,7 +8,11 @@ import { throwError } from "../throwError.js";
|
|
|
8
8
|
import { StringIsValidRouteKey } from "../routing/RouteTypes.js";
|
|
9
9
|
import { isProd } from "../isProd.js";
|
|
10
10
|
import { WebRedirect } from "../routing/WebRedirect.js";
|
|
11
|
-
import {
|
|
11
|
+
import { RouteRedirectComponent } from "../components/RouteRedirectComponent.js";
|
|
12
|
+
import { WebRedirectComponent } from "../components/WebRedirectComponent.js";
|
|
13
|
+
import { isServer } from "../isServer.js";
|
|
14
|
+
import { ContentNodeIsClassComponent } from "../ContentNode.js";
|
|
15
|
+
import { $props, $type } from "../contentNodeSymbols.js";
|
|
12
16
|
export class Instance {
|
|
13
17
|
constructor(_location, instanceConfig, reqRes, appRoutes, routes,
|
|
14
18
|
//globalData: GlobalData,
|
|
@@ -45,10 +49,10 @@ export class Instance {
|
|
|
45
49
|
this.location = location;
|
|
46
50
|
this.internalStore.location.set(location);
|
|
47
51
|
});
|
|
48
|
-
_defineProperty(this, "goto", async
|
|
52
|
+
_defineProperty(this, "goto", async routeKey => {
|
|
49
53
|
// get route data
|
|
50
54
|
this.navigating = true;
|
|
51
|
-
const matchedRouteInfo = await routing(
|
|
55
|
+
const matchedRouteInfo = await routing(routeKey, this.getRoutes());
|
|
52
56
|
//console.log('matchedRouteInfo', location, matchedRouteInfo)
|
|
53
57
|
//console.log('matched route info', this.matchedRouteInfo)
|
|
54
58
|
// data here is the result of the route data function
|
|
@@ -58,27 +62,37 @@ export class Instance {
|
|
|
58
62
|
return;
|
|
59
63
|
} else if (matchedRouteInfo.data instanceof WebRedirect) {
|
|
60
64
|
throwError('Instance.goto', 'WebRedirect not yet implemented');
|
|
65
|
+
this.redirect;
|
|
61
66
|
//const redirect = matchedRouteInfo.data
|
|
62
67
|
//this.goto(redirect.to)
|
|
63
68
|
//return
|
|
64
69
|
}
|
|
65
70
|
// handle Redirect components
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
// if (
|
|
72
|
+
// matchedRouteInfo.content instanceof RedirectComponent
|
|
73
|
+
// //&& matchedRouteInfo.content.__tungstenComponentType === 'redirect'
|
|
74
|
+
// ) {
|
|
75
|
+
if (typeof matchedRouteInfo.content !== 'function' && ContentNodeIsClassComponent(matchedRouteInfo.content)) {
|
|
76
|
+
if (matchedRouteInfo.content[$type] === RouteRedirectComponent || matchedRouteInfo.content[$type].prototype instanceof RouteRedirectComponent) {
|
|
77
|
+
this.goto(matchedRouteInfo.content[$props].to);
|
|
78
|
+
return;
|
|
79
|
+
} else if (matchedRouteInfo.content[$type] === WebRedirectComponent || matchedRouteInfo.content[$type].prototype instanceof WebRedirectComponent) {
|
|
80
|
+
console.log('Content is a WebRedirectComponent - perform a hard redirect');
|
|
81
|
+
this.redirect(matchedRouteInfo.content[$props].to);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
71
84
|
}
|
|
85
|
+
console.log('updating route info to', matchedRouteInfo);
|
|
72
86
|
//console.log('instance goto')
|
|
73
87
|
//console.log('siteBasePath', this.config.siteBasePath)
|
|
74
88
|
//console.log('location', location)
|
|
75
89
|
//console.log('final dest', this.config.siteBasePath + location)
|
|
76
90
|
this.matchedRouteInfo = matchedRouteInfo;
|
|
77
91
|
const publicUrl = isProd && this.config.staticSite === true // add .html suffix for static sites
|
|
78
|
-
?
|
|
92
|
+
? routeKey === '/' ? '/' : routeKey + '.html' : routeKey;
|
|
79
93
|
if (isClient) window.history.pushState(null, '', this.config.siteBasePath + publicUrl);
|
|
80
94
|
this.setTitleToDefault();
|
|
81
|
-
this.updateLocation(
|
|
95
|
+
this.updateLocation(routeKey); // this.internalStore.set('location', to)
|
|
82
96
|
//this.finishedNavigating()
|
|
83
97
|
});
|
|
84
98
|
// postNavigationQueue: (() => void)[] = []
|
|
@@ -89,6 +103,15 @@ export class Instance {
|
|
|
89
103
|
// func()
|
|
90
104
|
// }
|
|
91
105
|
// }
|
|
106
|
+
_defineProperty(this, "redirect", (url, code = 302) => {
|
|
107
|
+
if (this.reqRes) {
|
|
108
|
+
console.assert(isServer, 'reqRes is set, expected isServer to be truth');
|
|
109
|
+
this.reqRes.res.redirect(code, url);
|
|
110
|
+
} else {
|
|
111
|
+
console.assert(isClient, 'reqRes is not set, expected isClient to be truthy');
|
|
112
|
+
window.location.replace(url);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
92
115
|
_defineProperty(this, "setDefaultTitle", defaultTitle => {
|
|
93
116
|
this.defaultTitle = defaultTitle;
|
|
94
117
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevServer.d.ts","sourceRoot":"","sources":["../../src/Servers/DevServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,OAA4D,MAAM,SAAS,CAAA;AAGlF,OAAO,KAAK,EAAE,uBAAuB,EAAwB,MAAM,uBAAuB,CAAA;AAC1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,EACvF,iBAAiB,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;IAmHlD,OAAO,CAAC,mBAAmB,CAsE1B;IAKD,OAAO,CAAC,gBAAgB,CAcvB;IAED,OAAO,CAAC,aAAa,CAkMpB;IAID,aAAa,GAAU,MAAM,kBAAkB,EAAE,QAAQ,MAAM,yBAQ9D;IACD,QAAQ,GAAI,OAAO,OAAO,UAIzB;IACD,SAAS,GAAI,OAAO,OAAO,EAAE,YAAY,MAAM,EAAE,YAehD;IACD,KAAK,QAAO,OAAO,CAAC,MAAM,CAAC,CAO1B;IACD,IAAI,aAEH;CAGJ"}
|
|
@@ -82,7 +82,9 @@ export class DevServer extends TungstenServer {
|
|
|
82
82
|
throwError('DevServer', `export ${middlewareExportName} not found in ${middlewareFile}` + ` when trying to load server middleware`);
|
|
83
83
|
}
|
|
84
84
|
const middlewares = middlewareModule[middlewareExportName]; // eslint-disable-line no-type-assertion/no-type-assertion
|
|
85
|
-
if (!Array.isArray(middlewares))
|
|
85
|
+
if (!Array.isArray(middlewares)) {
|
|
86
|
+
throwError('addServerMiddleware', `Expected middlewares to be an array`);
|
|
87
|
+
}
|
|
86
88
|
if (!(0 in middlewares)) throwError('addServerMiddleware', `No middleware entry at index 0`);
|
|
87
89
|
const firstMiddleware = middlewares[0];
|
|
88
90
|
if (!(typeof firstMiddleware === 'function')) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProdServer.d.ts","sourceRoot":"","sources":["../../src/Servers/ProdServer.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAI7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAMpD,OAAO,EAA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CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEX,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,uBAAuB,EAC/B,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,gBAAgB,GAAG,IAAI,EAC5C,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IAuH7C,OAAO,CAAC,gBAAgB,CAgBvB;IACD,aAAa,GAAU,KAAK,OAAO,CAAC,OAAO,EAAE,KAAK,OAAO,CAAC,QAAQ,KAAG,OAAO,CAAC,IAAI,CAAC,CA6GjF;IACD,SAAS,eASR;IAMD,KAAK,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAwBlE,IAAI;CAKP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TungstenServer.d.ts","sourceRoot":"","sources":["../../src/Servers/TungstenServer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,KAAK,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"TungstenServer.d.ts","sourceRoot":"","sources":["../../src/Servers/TungstenServer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,KAAK,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,SAAS,CAAA;AAiB1D,qBAAa,cAAc;IACvB,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO;CAoD/F"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ContentNodeIsClassComponent } from "../ContentNode.js";
|
|
2
2
|
import { RoutingRedirect } from "../routing/RoutingRedirect.js";
|
|
3
3
|
import { cliTodo } from "../cliOutput.js";
|
|
4
|
-
import {
|
|
4
|
+
import { RouteRedirectComponent } from "../components/RouteRedirectComponent.js";
|
|
5
|
+
import { WebRedirectComponent } from "../components/WebRedirectComponent.js";
|
|
5
6
|
import { $props, $type } from "../contentNodeSymbols.js";
|
|
6
7
|
import { WebRedirect } from "../routing/WebRedirect.js";
|
|
7
8
|
function debug(...texts) {
|
|
@@ -28,12 +29,20 @@ export class TungstenServer {
|
|
|
28
29
|
// console.log('$type', (matchedRouteInfo as any).content[$type])
|
|
29
30
|
//console.log('content[$type]', matchedRouteInfo.content[$type])
|
|
30
31
|
//console.log('instanceof', matchedRouteInfo.content instanceof RedirectComponent)
|
|
31
|
-
if (typeof matchedRouteInfo.content !== 'function' && ContentNodeIsClassComponent(matchedRouteInfo.content)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
if (typeof matchedRouteInfo.content !== 'function' && ContentNodeIsClassComponent(matchedRouteInfo.content)) {
|
|
33
|
+
if (matchedRouteInfo.content[$type] === RouteRedirectComponent || matchedRouteInfo.content[$type].prototype instanceof RouteRedirectComponent) {
|
|
34
|
+
cliTodo('consider type of RedirectComponent props');
|
|
35
|
+
const code = matchedRouteInfo.content[$props].code || 302;
|
|
36
|
+
const to = matchedRouteInfo.content[$props].to;
|
|
37
|
+
res.redirect(code, to);
|
|
38
|
+
return true;
|
|
39
|
+
} else if (matchedRouteInfo.content[$type] === WebRedirectComponent || matchedRouteInfo.content[$type].prototype instanceof WebRedirectComponent) {
|
|
40
|
+
cliTodo('consider type of RedirectComponent props');
|
|
41
|
+
const code = matchedRouteInfo.content[$props].code || 302;
|
|
42
|
+
const to = matchedRouteInfo.content[$props].to;
|
|
43
|
+
res.redirect(code, to);
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
37
46
|
}
|
|
38
47
|
return false;
|
|
39
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TungstenServerHono.d.ts","sourceRoot":"","sources":["../../../src/Servers/hono/TungstenServerHono.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAG9D,OAAO,EAAQ,OAAO,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"TungstenServerHono.d.ts","sourceRoot":"","sources":["../../../src/Servers/hono/TungstenServerHono.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAG9D,OAAO,EAAQ,OAAO,EAAE,MAAM,MAAM,CAAA;AAuBpC,qBAAa,kBAAkB;IAC3B,SAAS,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,EAAY,gBAAgB,EAAE,gBAAgB,GAAG,OAAO;CA6C/F"}
|
|
@@ -3,9 +3,10 @@ import { Hono } from 'hono';
|
|
|
3
3
|
import { ContentNodeIsClassComponent } from "../../ContentNode.js";
|
|
4
4
|
import { RoutingRedirect } from "../../routing/RoutingRedirect.js";
|
|
5
5
|
import { cliTodo } from "../../cliOutput.js";
|
|
6
|
-
import {
|
|
6
|
+
import { RouteRedirectComponent } from "../../components/RouteRedirectComponent.js";
|
|
7
7
|
import { $props, $type } from "../../contentNodeSymbols.js";
|
|
8
8
|
import { WebRedirect } from "../../routing/WebRedirect.js";
|
|
9
|
+
import { throwError } from "../../throwError.js";
|
|
9
10
|
const app = new Hono();
|
|
10
11
|
app.get(async c => {
|
|
11
12
|
const id = c.req.param('id');
|
|
@@ -36,12 +37,16 @@ export class TungstenServerHono {
|
|
|
36
37
|
// console.log('$type', (matchedRouteInfo as any).content[$type])
|
|
37
38
|
//console.log('content[$type]', matchedRouteInfo.content[$type])
|
|
38
39
|
//console.log('instanceof', matchedRouteInfo.content instanceof RedirectComponent)
|
|
39
|
-
if (typeof matchedRouteInfo.content !== 'function' && ContentNodeIsClassComponent(matchedRouteInfo.content)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
if (typeof matchedRouteInfo.content !== 'function' && ContentNodeIsClassComponent(matchedRouteInfo.content)) {
|
|
41
|
+
if (matchedRouteInfo.content[$type] === RouteRedirectComponent || matchedRouteInfo.content[$type].prototype instanceof RouteRedirectComponent) {
|
|
42
|
+
cliTodo('consider type of RedirectComponent props');
|
|
43
|
+
const code = matchedRouteInfo.content[$props].code || 302;
|
|
44
|
+
const to = matchedRouteInfo.content[$props].to;
|
|
45
|
+
c.redirect(to, code);
|
|
46
|
+
return true;
|
|
47
|
+
} else {
|
|
48
|
+
throwError('TungstenServerHono', 'Need to check for WebRedirectComponent here');
|
|
49
|
+
}
|
|
45
50
|
}
|
|
46
51
|
return false;
|
|
47
52
|
}
|
|
@@ -4,7 +4,7 @@ import { createStores } from "../Store/createStores.js";
|
|
|
4
4
|
export function initStores(location, reqResOrNull, globalData, matchedRouteInfo, serverDataLoading = null) {
|
|
5
5
|
const storeSubscriptions = new Map();
|
|
6
6
|
const internalStoreSubscribedElements = new Map();
|
|
7
|
-
const internalStore = makeStore(new InternalStoreSchema(location), internalStoreSubscribedElements, serverDataLoading);
|
|
7
|
+
const internalStore = makeStore(new InternalStoreSchema(location, matchedRouteInfo), internalStoreSubscribedElements, serverDataLoading);
|
|
8
8
|
storeSubscriptions.set(internalStore, internalStoreSubscribedElements);
|
|
9
9
|
const stores = createStores(reqResOrNull, matchedRouteInfo, globalData, storeSubscriptions, serverDataLoading);
|
|
10
10
|
return {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { MatchedRouteInfo } from '../Servers/MatchedRouteInfo.js';
|
|
1
2
|
export declare class InternalStoreSchema {
|
|
2
3
|
location: string;
|
|
3
|
-
|
|
4
|
+
matchedRouteInfo: MatchedRouteInfo;
|
|
5
|
+
constructor(location: string, matchedRouteInfo: MatchedRouteInfo);
|
|
4
6
|
}
|
|
5
7
|
//# sourceMappingURL=InternalStoreSchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalStoreSchema.d.ts","sourceRoot":"","sources":["../../src/Store/InternalStoreSchema.ts"],"names":[],"mappings":"AACA,qBAAa,mBAAmB;IAC5B,QAAQ,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"InternalStoreSchema.d.ts","sourceRoot":"","sources":["../../src/Store/InternalStoreSchema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEtE,qBAAa,mBAAmB;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAChB,gBAAgB,EAAE,gBAAgB,CAAA;gBACtB,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB;CAInE"}
|
|
@@ -2,8 +2,10 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
2
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
4
|
export class InternalStoreSchema {
|
|
5
|
-
constructor(location) {
|
|
5
|
+
constructor(location, matchedRouteInfo) {
|
|
6
6
|
_defineProperty(this, "location", void 0);
|
|
7
|
+
_defineProperty(this, "matchedRouteInfo", void 0);
|
|
7
8
|
this.location = location;
|
|
9
|
+
this.matchedRouteInfo = matchedRouteInfo;
|
|
8
10
|
}
|
|
9
11
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TungstenSimpleComponent } from '../Components.jsx';
|
|
2
|
+
import type { RedirectCode } from '../routing/RedirectCode.js';
|
|
3
|
+
import { MinimumRoutes } from '../routing/Routes.js';
|
|
4
|
+
export type RouteRedirectComponentProps<Routes extends MinimumRoutes> = {
|
|
5
|
+
to: keyof Routes;
|
|
6
|
+
code?: RedirectCode;
|
|
7
|
+
};
|
|
8
|
+
export declare class RouteRedirectComponent<Routes extends MinimumRoutes> extends TungstenSimpleComponent<RouteRedirectComponentProps<Routes>> {
|
|
9
|
+
static __tungstenRedirect: boolean;
|
|
10
|
+
content: () => "This should redirect - if you see this, redirection didn't work" | null;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=RouteRedirectComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouteRedirectComponent.d.ts","sourceRoot":"","sources":["../../src/components/RouteRedirectComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,MAAM,MAAM,2BAA2B,CAAC,MAAM,SAAS,aAAa,IAAI;IACpE,EAAE,EAAE,MAAM,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,YAAY,CAAA;CACtB,CAAA;AACD,qBAAa,sBAAsB,CAAC,MAAM,SAAS,aAAa,CAC5D,SAAQ,uBAAuB,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;IAEpE,MAAM,CAAC,kBAAkB,UAAO;IAIhC,OAAO,iFAEG;CACb"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
+
import { isDev } from 'tungsten/isDev.js';
|
|
5
|
+
import { TungstenSimpleComponent } from "../Components.js";
|
|
6
|
+
export class RouteRedirectComponent extends TungstenSimpleComponent {
|
|
7
|
+
constructor(...args) {
|
|
8
|
+
super(...args);
|
|
9
|
+
//__tungstenComponentType = 'redirect' as const
|
|
10
|
+
//to = this.props.to
|
|
11
|
+
//code = this.props.code
|
|
12
|
+
_defineProperty(this, "content", () => isDev ? 'This should redirect - if you see this, redirection didn\'t work' : null);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
_defineProperty(RouteRedirectComponent, "__tungstenRedirect", true);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { TungstenSimpleComponent } from '../Components.jsx';
|
|
2
|
-
import type { Path } from '../routing/RouteTypes.js';
|
|
3
2
|
import type { RedirectCode } from '../routing/RedirectCode.js';
|
|
4
|
-
export type
|
|
5
|
-
to:
|
|
3
|
+
export type WebRedirectComponentProps = {
|
|
4
|
+
to: string;
|
|
6
5
|
code?: RedirectCode;
|
|
7
6
|
};
|
|
8
|
-
export declare class
|
|
7
|
+
export declare class WebRedirectComponent extends TungstenSimpleComponent<WebRedirectComponent> {
|
|
9
8
|
static __tungstenRedirect: boolean;
|
|
10
9
|
content: () => "This should redirect - if you see this, redirection didn't work" | null;
|
|
11
10
|
}
|
|
12
|
-
//# sourceMappingURL=
|
|
11
|
+
//# sourceMappingURL=WebRedirectComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebRedirectComponent.d.ts","sourceRoot":"","sources":["../../src/components/WebRedirectComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D,MAAM,MAAM,yBAAyB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,YAAY,CAAA;CACtB,CAAA;AACD,qBAAa,oBAAqB,SAAQ,uBAAuB,CAAC,oBAAoB,CAAC;IACnF,MAAM,CAAC,kBAAkB,UAAO;IAIhC,OAAO,iFAEG;CACb"}
|
|
@@ -3,7 +3,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
4
|
import { isDev } from 'tungsten/isDev.js';
|
|
5
5
|
import { TungstenSimpleComponent } from "../Components.js";
|
|
6
|
-
export class
|
|
6
|
+
export class WebRedirectComponent extends TungstenSimpleComponent {
|
|
7
7
|
constructor(...args) {
|
|
8
8
|
super(...args);
|
|
9
9
|
//__tungstenComponentType = 'redirect' as const
|
|
@@ -12,4 +12,4 @@ export class RedirectComponent extends TungstenSimpleComponent {
|
|
|
12
12
|
_defineProperty(this, "content", () => isDev ? 'This should redirect - if you see this, redirection didn\'t work' : null);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
_defineProperty(
|
|
15
|
+
_defineProperty(WebRedirectComponent, "__tungstenRedirect", true);
|
package/dist/indexInner.d.ts
CHANGED
|
@@ -16,7 +16,8 @@ export * from './components/bindable/BindableTextarea.jsx';
|
|
|
16
16
|
export * from './components/GoToComponent.jsx';
|
|
17
17
|
export * from './components/Lazy.js';
|
|
18
18
|
export * from './components/Link.jsx';
|
|
19
|
-
export * from './components/
|
|
19
|
+
export * from './components/RouteRedirectComponent.jsx';
|
|
20
|
+
export * from './components/WebRedirectComponent.jsx';
|
|
20
21
|
export * from './nbsp.js';
|
|
21
22
|
export * from './browserStorage.js';
|
|
22
23
|
export { createElement } from './createElement.js';
|
|
@@ -63,7 +64,7 @@ export type { ReqRes, ReqResOrNull } from './ReqRes.js';
|
|
|
63
64
|
export type { Params } from './routing/Params.js';
|
|
64
65
|
export type { ParamsFromPath } from './routing/ParamsFromPath.js';
|
|
65
66
|
export type { RouteType, Route } from './routing/RouteType.js';
|
|
66
|
-
export { type RouteKey, type Path, StringIsPath, RouteKeyIsPath } from './routing/RouteTypes.js';
|
|
67
|
+
export { type RouteKey, type Path, type Path as RoutePath, StringIsPath, RouteKeyIsPath } from './routing/RouteTypes.js';
|
|
67
68
|
export type { Routes, CustomRoutes } from './routing/Routes.js';
|
|
68
69
|
export type { RouteParams } from './routing/RouteParams.type.js';
|
|
69
70
|
export type { RouteData } from './routing/RouteData.js';
|
package/dist/indexInner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexInner.d.ts","sourceRoot":"","sources":["../src/indexInner.ts"],"names":[],"mappings":"AAEA,cAAc,qBAAqB,CAAA;AACnC,OAAO,EACH,uBAAuB,EAAE,uBAAuB,IAAI,eAAe,EAAE,mBAAmB;AACxF,yBAAyB,EAAE,yBAAyB,IAAI,iBAAiB,EAAE,qBAAqB;AAEhG,gCAAgC,EAAE,gCAAgC,IAAI,wBAAwB,EAC9F,kCAAkC,EAAE,kCAAkC,IAAI,0BAA0B,GACvG,MAAM,kBAAkB,CAAA;AAEzB,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,uBAAuB,CAAA;AACrC,cAAc,4CAA4C,CAAA;AAC1D,cAAc,yCAAyC,CAAA;AACvD,cAAc,8CAA8C,CAAA;AAC5D,cAAc,yCAAyC,CAAA;AACvD,cAAc,0CAA0C,CAAA;AACxD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,gCAAgC,CAAA;AAC9C,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,
|
|
1
|
+
{"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AACjD,YAAY,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACjE,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,IAAI,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxH,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAChE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAC3E,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,YAAY,EACR,0BAA0B,EAAE,0BAA0B,IAAI,SAAS,EACnE,gCAAgC,EAAE,gCAAgC,IAAI,eAAe,EACrF,cAAc,EACjB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG7C,mBAAmB,mBAAmB,CAAA"}
|
package/dist/indexInner.js
CHANGED
|
@@ -21,7 +21,8 @@ export * from "./components/bindable/BindableTextarea.js";
|
|
|
21
21
|
export * from "./components/GoToComponent.js";
|
|
22
22
|
export * from "./components/Lazy.js";
|
|
23
23
|
export * from "./components/Link.js";
|
|
24
|
-
export * from "./components/
|
|
24
|
+
export * from "./components/RouteRedirectComponent.js";
|
|
25
|
+
export * from "./components/WebRedirectComponent.js";
|
|
25
26
|
export * from "./nbsp.js";
|
|
26
27
|
export * from "./browserStorage.js";
|
|
27
28
|
export { createElement } from "./createElement.js";
|
package/dist/routing/Routes.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { Path } from './RouteTypes.js';
|
|
2
2
|
import type { RouteType } from './RouteType.js';
|
|
3
|
+
export type MinimumRoutes = {
|
|
4
|
+
default: RouteType<any, any>;
|
|
5
|
+
} | {
|
|
6
|
+
'404': RouteType<any, any>;
|
|
7
|
+
};
|
|
3
8
|
export type Routes = {
|
|
4
9
|
[key in Path]: RouteType<any, any>;
|
|
5
10
|
} & ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Routes.d.ts","sourceRoot":"","sources":["../../src/routing/Routes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAY,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,MAAM,MAAM,GAAG;KAAG,GAAG,IAAI,IAAI,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC;CAAE,GACzD,CACE;IAAE,SAAS,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CAAE,GAChC;IAAE,KAAK,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CAAE,CACnC,CAAA;AAED,MAAM,MAAM,YAAY,CAAC,KAAK,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI;KAAG,GAAG,IAAI,IAAI,GAAG,KAAK;CAAE,GACpF,CACE;IAAE,SAAS,EAAE,KAAK,CAAA;CAAE,GAClB;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CACrB,CAAA"}
|
|
1
|
+
{"version":3,"file":"Routes.d.ts","sourceRoot":"","sources":["../../src/routing/Routes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAY,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,MAAM,aAAa,GACnB;IAAE,OAAO,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CAAE,GAChC;IAAE,KAAK,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CAAE,CAAA;AAEpC,MAAM,MAAM,MAAM,GAAG;KAAG,GAAG,IAAI,IAAI,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC;CAAE,GACzD,CACE;IAAE,SAAS,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CAAE,GAChC;IAAE,KAAK,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CAAE,CACnC,CAAA;AAED,MAAM,MAAM,YAAY,CAAC,KAAK,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI;KAAG,GAAG,IAAI,IAAI,GAAG,KAAK;CAAE,GACpF,CACE;IAAE,SAAS,EAAE,KAAK,CAAA;CAAE,GAClB;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CACrB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectComponent.d.ts","sourceRoot":"","sources":["../../src/components/RedirectComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D,MAAM,MAAM,sBAAsB,GAAG;IACjC,EAAE,EAAE,IAAI,CAAA;IACR,IAAI,CAAC,EAAE,YAAY,CAAA;CACtB,CAAA;AACD,qBAAa,iBAAkB,SAAQ,uBAAuB,CAAC,sBAAsB,CAAC;IAClF,MAAM,CAAC,kBAAkB,UAAO;IAIhC,OAAO,iFAEG;CACb"}
|