arrowjs-aluminum 0.9.2 → 0.10.0
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/Router.d.ts +27 -10
- package/dist/Router.d.ts.map +1 -1
- package/dist/Router.js +75 -47
- package/dist/Router.js.map +1 -1
- package/package.json +1 -1
package/dist/Router.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type ArrowTemplate } from "@arrow-js/core";
|
|
2
|
+
type getRoute = (variables: {
|
|
3
|
+
[variableName: string]: string;
|
|
4
|
+
}) => ArrowTemplate;
|
|
2
5
|
type routeType = {
|
|
3
6
|
[subPath: string]: routeType;
|
|
4
|
-
[
|
|
5
|
-
[variableName: string]: string;
|
|
6
|
-
}) => ArrowTemplate;
|
|
7
|
+
[getRouteOrRouter: symbol]: getRoute | Router;
|
|
7
8
|
};
|
|
8
9
|
/**
|
|
9
10
|
* A basic router
|
|
@@ -11,11 +12,17 @@ type routeType = {
|
|
|
11
12
|
export default class Router {
|
|
12
13
|
protected readonly routes: routeType;
|
|
13
14
|
protected readonly route404: ArrowTemplate;
|
|
15
|
+
protected readonly transformBeforeFetch: (template: ArrowTemplate, vars: {
|
|
16
|
+
[variableName: string]: string;
|
|
17
|
+
}) => ArrowTemplate;
|
|
14
18
|
/**
|
|
15
19
|
* Creates a router
|
|
16
20
|
* @param route404 The template to render if no other path was found. Defaults to "404" text
|
|
21
|
+
* @param transformBeforeFetch An optional function that can transform the path before it's fetched (either in {@link getPath} or {@link getPathNo404}
|
|
17
22
|
*/
|
|
18
|
-
constructor(route404?: ArrowTemplate
|
|
23
|
+
constructor(route404?: ArrowTemplate, transformBeforeFetch?: (template: ArrowTemplate, vars: {
|
|
24
|
+
[variableName: string]: string;
|
|
25
|
+
}) => ArrowTemplate);
|
|
19
26
|
/**
|
|
20
27
|
* Adds a route to this router
|
|
21
28
|
*
|
|
@@ -30,9 +37,9 @@ export default class Router {
|
|
|
30
37
|
* or end (unless you know what you're doing)
|
|
31
38
|
* @param renderTemplate The template to render at this location
|
|
32
39
|
*/
|
|
33
|
-
addRoute(path: string, renderTemplate: (variables: {
|
|
40
|
+
addRoute(path: string, renderTemplate: ((variables: {
|
|
34
41
|
[variableName: string]: string;
|
|
35
|
-
}) => ArrowTemplate): this;
|
|
42
|
+
}) => ArrowTemplate) | Router): this;
|
|
36
43
|
/**
|
|
37
44
|
* Gets the template to render from the given location. Will default to the 404 path if no path found
|
|
38
45
|
* @param location The location to fetch
|
|
@@ -43,6 +50,15 @@ export default class Router {
|
|
|
43
50
|
* @param location The location to fetch
|
|
44
51
|
*/
|
|
45
52
|
getPathNo404(location: string): ArrowTemplate | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* @return this router's 404 route
|
|
55
|
+
*/
|
|
56
|
+
get404(): ArrowTemplate;
|
|
57
|
+
/**
|
|
58
|
+
* @return `this.routes`. If you want just a single route, try {@link getPath}
|
|
59
|
+
*/
|
|
60
|
+
accessRoutes(): routeType;
|
|
61
|
+
private getPathInternal;
|
|
46
62
|
}
|
|
47
63
|
/**
|
|
48
64
|
* A router that can manages the web page based on the page's url
|
|
@@ -50,16 +66,17 @@ export default class Router {
|
|
|
50
66
|
export declare class PageAttachedRouter extends Router {
|
|
51
67
|
protected readonly rootElement: HTMLElement | undefined;
|
|
52
68
|
protected readonly location: import("./utils.js").Ref<string[]>;
|
|
53
|
-
protected readonly transformBeforeRender: (template: ArrowTemplate) => ArrowTemplate;
|
|
54
69
|
/**
|
|
55
70
|
* Creates a page attached router
|
|
56
71
|
* @param attachTo The dom element to attach this router to. Defaults to `document.body`
|
|
57
72
|
* @param route404 The template to render if no other path was found. Defaults to "404" text
|
|
58
|
-
* @param
|
|
73
|
+
* @param transformBeforeFetch An optional function that can transform the path before it's {@link rerender}ed
|
|
59
74
|
*/
|
|
60
|
-
constructor(attachTo: HTMLElement | undefined, route404?: ArrowTemplate,
|
|
75
|
+
constructor(attachTo: HTMLElement | undefined, route404?: ArrowTemplate, transformBeforeFetch?: (template: ArrowTemplate, vars: {
|
|
76
|
+
[variableName: string]: string;
|
|
77
|
+
}) => ArrowTemplate);
|
|
61
78
|
/**
|
|
62
|
-
* Rerenders the page
|
|
79
|
+
* Rerenders the page
|
|
63
80
|
*/
|
|
64
81
|
rerender(): void;
|
|
65
82
|
/**
|
package/dist/Router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../src/Router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,aAAa,EAAiB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../src/Router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,aAAa,EAAiB,MAAM,gBAAgB,CAAC;AAKlE,KAAK,QAAQ,GAAG,CAAC,SAAS,EAAC;IAAC,CAAC,YAAY,EAAC,MAAM,GAAE,MAAM,CAAA;CAAC,KAAG,aAAa,CAAC;AAC1E,KAAK,SAAS,GAAG;IAAC,CAAC,OAAO,EAAC,MAAM,GAAE,SAAS,CAAC;IAAC,CAAC,gBAAgB,EAAC,MAAM,GAAE,QAAQ,GAAC,MAAM,CAAA;CAAC,CAAC;AAIzF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,MAAM;IACvB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAC,SAAS,CAAI;IACvC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAC,aAAa,CAAC;IAC1C,SAAS,CAAC,QAAQ,CAAC,oBAAoB,aAOwC,aAAa,QAAO;QAAC,CAAC,YAAY,EAAC,MAAM,GAAE,MAAM,CAAA;KAAC,KAAG,aAAa,CAPzG;IAExC;;;;OAIG;gBACS,QAAQ,GAAC,aAAwB,EAAE,oBAAoB,CAAC,EAAC,CAAC,QAAQ,EAAC,aAAa,EAAE,IAAI,EAAC;QAAC,CAAC,YAAY,EAAC,MAAM,GAAE,MAAM,CAAA;KAAC,KAAG,aAAa;IAKjJ;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,IAAI,EAAC,MAAM,EAAE,cAAc,EAAC,CAAC,CAAC,SAAS,EAAC;QAAC,CAAC,YAAY,EAAC,MAAM,GAAE,MAAM,CAAA;KAAC,KAAG,aAAa,CAAC,GAAC,MAAM;IAwBvG;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAC,MAAM;IAGvB;;;OAGG;IACH,YAAY,CAAC,QAAQ,EAAC,MAAM;IAQ5B;;OAEG;IACH,MAAM;IACN;;OAEG;IACH,YAAY;IAEZ,OAAO,CAAC,eAAe;CAqC1B;AAGD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,MAAM;IAC1C,SAAS,CAAC,QAAQ,CAAC,WAAW,0BAAC;IAC/B,SAAS,CAAC,QAAQ,CAAC,QAAQ,qCAAqB;IAEhD;;;;;OAKG;gBACS,QAAQ,EAAC,WAAW,GAAC,SAAS,EAAE,QAAQ,CAAC,EAAC,aAAa,EACvD,oBAAoB,CAAC,EAAC,CAAC,QAAQ,EAAC,aAAa,EAAE,IAAI,EAAC;QAAC,CAAC,YAAY,EAAC,MAAM,GAAE,MAAM,CAAA;KAAC,KAAG,aAAa;IAU9G;;OAEG;IACI,QAAQ;IAQf;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,GAAC,MAA+B,EAAE,OAAO,CAAC,EAAC,KAAK;CAiBvE"}
|
package/dist/Router.js
CHANGED
|
@@ -1,31 +1,7 @@
|
|
|
1
1
|
import { html, reactive } from "@arrow-js/core";
|
|
2
2
|
import { ref } from "./utils.js";
|
|
3
3
|
const getRouteSymbol = Symbol("getRoute");
|
|
4
|
-
|
|
5
|
-
if (subPaths.length === 0 && routes[getRouteSymbol] !== undefined)
|
|
6
|
-
return { subRoutes: routes, variables };
|
|
7
|
-
//regular path
|
|
8
|
-
if (routes[subPaths[0]] !== undefined) {
|
|
9
|
-
if (routes[subPaths[0]] !== undefined)
|
|
10
|
-
return getPath(routes[subPaths[0]], subPaths.slice(1), { ...variables });
|
|
11
|
-
}
|
|
12
|
-
//variable path
|
|
13
|
-
const toReturn = [];
|
|
14
|
-
for (const key in routes) {
|
|
15
|
-
if (!key.startsWith(":") || routes[key] === undefined)
|
|
16
|
-
continue;
|
|
17
|
-
const maybeRoute = getPath(routes[key], subPaths.slice(1), {
|
|
18
|
-
...variables,
|
|
19
|
-
[key.slice(1)]: subPaths[0]
|
|
20
|
-
});
|
|
21
|
-
if (maybeRoute instanceof Array)
|
|
22
|
-
toReturn.push(...maybeRoute);
|
|
23
|
-
else if (maybeRoute !== undefined)
|
|
24
|
-
toReturn.push(maybeRoute);
|
|
25
|
-
}
|
|
26
|
-
if (toReturn.length > 0)
|
|
27
|
-
return toReturn;
|
|
28
|
-
}
|
|
4
|
+
const routerSymbol = Symbol("router");
|
|
29
5
|
const default404 = html `404`;
|
|
30
6
|
/**
|
|
31
7
|
* A basic router
|
|
@@ -33,12 +9,15 @@ const default404 = html `404`;
|
|
|
33
9
|
export default class Router {
|
|
34
10
|
routes = {};
|
|
35
11
|
route404;
|
|
12
|
+
transformBeforeFetch;
|
|
36
13
|
/**
|
|
37
14
|
* Creates a router
|
|
38
15
|
* @param route404 The template to render if no other path was found. Defaults to "404" text
|
|
16
|
+
* @param transformBeforeFetch An optional function that can transform the path before it's fetched (either in {@link getPath} or {@link getPathNo404}
|
|
39
17
|
*/
|
|
40
|
-
constructor(route404 = default404) {
|
|
18
|
+
constructor(route404 = default404, transformBeforeFetch) {
|
|
41
19
|
this.route404 = route404;
|
|
20
|
+
this.transformBeforeFetch = transformBeforeFetch || (template => template);
|
|
42
21
|
}
|
|
43
22
|
/**
|
|
44
23
|
* Adds a route to this router
|
|
@@ -57,13 +36,23 @@ export default class Router {
|
|
|
57
36
|
addRoute(path, renderTemplate) {
|
|
58
37
|
const subPaths = path.split("/");
|
|
59
38
|
let position = this.routes;
|
|
60
|
-
for (
|
|
61
|
-
|
|
39
|
+
for (let i = 0; i < subPaths.length; i++) {
|
|
40
|
+
const nextPos = subPaths[i];
|
|
41
|
+
if (position[nextPos] !== undefined && position[nextPos][routerSymbol] instanceof Router && i !== subPaths.length - 1)
|
|
42
|
+
throw new Error(`Cannot create route "${path}", there is a router in the way`);
|
|
43
|
+
if (position[nextPos] !== undefined && i !== subPaths.length - 1 && !(renderTemplate instanceof Router))
|
|
62
44
|
position = position[nextPos];
|
|
63
|
-
else
|
|
64
|
-
|
|
45
|
+
else {
|
|
46
|
+
if (i === subPaths.length - 1 && renderTemplate instanceof Router) {
|
|
47
|
+
position[nextPos] ||= {};
|
|
48
|
+
position[nextPos][routerSymbol] = renderTemplate;
|
|
49
|
+
}
|
|
50
|
+
else
|
|
51
|
+
position = position[nextPos] = {};
|
|
52
|
+
}
|
|
65
53
|
}
|
|
66
|
-
|
|
54
|
+
if (!(renderTemplate instanceof Router))
|
|
55
|
+
position[getRouteSymbol] = renderTemplate;
|
|
67
56
|
return this;
|
|
68
57
|
}
|
|
69
58
|
/**
|
|
@@ -78,16 +67,57 @@ export default class Router {
|
|
|
78
67
|
* @param location The location to fetch
|
|
79
68
|
*/
|
|
80
69
|
getPathNo404(location) {
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
const vars = {};
|
|
71
|
+
const pathOptions = this.getPathInternal(this.routes, location.split("/"), vars);
|
|
72
|
+
if (pathOptions === undefined || pathOptions.length === 0 || pathOptions[0] === undefined)
|
|
73
|
+
return undefined;
|
|
74
|
+
return this.transformBeforeFetch(pathOptions[0], vars);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* @return this router's 404 route
|
|
78
|
+
*/
|
|
79
|
+
get404() { return this.route404; }
|
|
80
|
+
/**
|
|
81
|
+
* @return `this.routes`. If you want just a single route, try {@link getPath}
|
|
82
|
+
*/
|
|
83
|
+
accessRoutes() { return this.routes; }
|
|
84
|
+
getPathInternal(routes, subPaths, variables) {
|
|
85
|
+
if (subPaths.length === 0 && routes[getRouteSymbol] !== undefined)
|
|
86
|
+
return [routes[getRouteSymbol](variables)];
|
|
87
|
+
//regular path
|
|
88
|
+
if (routes[subPaths[0]] !== undefined) {
|
|
89
|
+
if (routes[subPaths[0]] !== undefined) {
|
|
90
|
+
const next = routes[subPaths[0]];
|
|
91
|
+
if (next[routerSymbol] instanceof Router && subPaths.length > 1) {
|
|
92
|
+
return (next[routerSymbol].getPathInternal(next[routerSymbol].accessRoutes(), subPaths.slice(1), { ...variables }) ?? [])
|
|
93
|
+
.map(template => next[routerSymbol].transformBeforeFetch(template, { ...variables }));
|
|
94
|
+
}
|
|
95
|
+
else
|
|
96
|
+
return this.getPathInternal(next, subPaths.slice(1), { ...variables });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//variable path
|
|
100
|
+
const toReturn = [];
|
|
101
|
+
for (const key in routes) {
|
|
102
|
+
if (!key.startsWith(":") || routes[key] === undefined)
|
|
103
|
+
continue;
|
|
104
|
+
const maybeRoute = (routes[key][routerSymbol] instanceof Router && subPaths.length > 1) ?
|
|
105
|
+
(routes[key][routerSymbol].getPathInternal(routes[key][routerSymbol].accessRoutes(), subPaths.slice(1), {
|
|
106
|
+
...variables,
|
|
107
|
+
[key.slice(1)]: subPaths[0]
|
|
108
|
+
}) ?? []).map(template => routes[key][routerSymbol].transformBeforeFetch(template, {
|
|
109
|
+
...variables,
|
|
110
|
+
[key.slice(1)]: subPaths[0]
|
|
111
|
+
})) :
|
|
112
|
+
this.getPathInternal(routes[key], subPaths.slice(1), {
|
|
113
|
+
...variables,
|
|
114
|
+
[key.slice(1)]: subPaths[0]
|
|
115
|
+
});
|
|
116
|
+
if (maybeRoute !== undefined)
|
|
117
|
+
toReturn.push(...maybeRoute);
|
|
88
118
|
}
|
|
89
|
-
|
|
90
|
-
return
|
|
119
|
+
if (toReturn.length > 0)
|
|
120
|
+
return toReturn;
|
|
91
121
|
}
|
|
92
122
|
}
|
|
93
123
|
const differentPage = /^[A-Za-z]+:\/\/.*$/;
|
|
@@ -97,17 +127,15 @@ const differentPage = /^[A-Za-z]+:\/\/.*$/;
|
|
|
97
127
|
export class PageAttachedRouter extends Router {
|
|
98
128
|
rootElement;
|
|
99
129
|
location = ref([]);
|
|
100
|
-
transformBeforeRender;
|
|
101
130
|
/**
|
|
102
131
|
* Creates a page attached router
|
|
103
132
|
* @param attachTo The dom element to attach this router to. Defaults to `document.body`
|
|
104
133
|
* @param route404 The template to render if no other path was found. Defaults to "404" text
|
|
105
|
-
* @param
|
|
134
|
+
* @param transformBeforeFetch An optional function that can transform the path before it's {@link rerender}ed
|
|
106
135
|
*/
|
|
107
|
-
constructor(attachTo, route404,
|
|
108
|
-
super(route404);
|
|
136
|
+
constructor(attachTo, route404, transformBeforeFetch) {
|
|
137
|
+
super(route404, transformBeforeFetch);
|
|
109
138
|
this.rootElement = attachTo;
|
|
110
|
-
this.transformBeforeRender = transformBeforeRender || (template => template);
|
|
111
139
|
this.location.$on(() => this.rerender());
|
|
112
140
|
window.addEventListener("popstate", e => {
|
|
113
141
|
if (!this.redirect(window.location.pathname))
|
|
@@ -115,13 +143,13 @@ export class PageAttachedRouter extends Router {
|
|
|
115
143
|
}); //back button handling
|
|
116
144
|
}
|
|
117
145
|
/**
|
|
118
|
-
* Rerenders the page
|
|
146
|
+
* Rerenders the page
|
|
119
147
|
*/
|
|
120
148
|
rerender() {
|
|
121
149
|
const path = this.getPath(this.location.value.join("/"));
|
|
122
150
|
if (this.rootElement !== undefined) {
|
|
123
151
|
this.rootElement.replaceChildren();
|
|
124
|
-
|
|
152
|
+
path(this.rootElement);
|
|
125
153
|
}
|
|
126
154
|
}
|
|
127
155
|
/**
|
package/dist/Router.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Router.js","sourceRoot":"","sources":["../src/Router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,IAAI,EAAE,QAAQ,EAAC,MAA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