@microsoft/fast-router 1.0.0-alpha.1 → 1.0.0-alpha.11
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/CHANGELOG.json +162 -0
- package/CHANGELOG.md +83 -1
- package/dist/dts/contributors.d.ts +9 -10
- package/dist/{tsdoc-metadata.json → dts/tsdoc-metadata.json} +0 -0
- package/dist/dts/view.d.ts +4 -9
- package/dist/esm/contributors.js +18 -14
- package/dist/esm/router.js +2 -2
- package/dist/esm/view.js +6 -24
- package/dist/fast-router.api.json +31 -56
- package/dist/fast-router.d.ts +15 -21
- package/dist/fast-router.untrimmed.d.ts +15 -21
- package/docs/api-report.md +8 -11
- package/package.json +3 -3
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,168 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/fast-router",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"date": "Wed, 05 Oct 2022 23:26:01 GMT",
|
|
6
|
+
"tag": "@microsoft/fast-router_v1.0.0-alpha.11",
|
|
7
|
+
"version": "1.0.0-alpha.11",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "beachball",
|
|
12
|
+
"package": "@microsoft/fast-router",
|
|
13
|
+
"comment": "Bump @microsoft/fast-element to v2.0.0-beta.11",
|
|
14
|
+
"commit": "21d1de94be2b9399ddc43a2b93c6483fa7304591"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Mon, 03 Oct 2022 23:44:38 GMT",
|
|
21
|
+
"tag": "@microsoft/fast-router_v1.0.0-alpha.10",
|
|
22
|
+
"version": "1.0.0-alpha.10",
|
|
23
|
+
"comments": {
|
|
24
|
+
"prerelease": [
|
|
25
|
+
{
|
|
26
|
+
"author": "beachball",
|
|
27
|
+
"package": "@microsoft/fast-router",
|
|
28
|
+
"comment": "Bump @microsoft/fast-element to v2.0.0-beta.10",
|
|
29
|
+
"commit": "e23f4375f183f0672f9aeafd0e58411adb66ae90"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Wed, 28 Sep 2022 20:45:51 GMT",
|
|
36
|
+
"tag": "@microsoft/fast-router_v1.0.0-alpha.9",
|
|
37
|
+
"version": "1.0.0-alpha.9",
|
|
38
|
+
"comments": {
|
|
39
|
+
"prerelease": [
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@microsoft/fast-router",
|
|
43
|
+
"comment": "Bump @microsoft/fast-element to v2.0.0-beta.9",
|
|
44
|
+
"commit": "08fab33015853b7f820fdfdac2aecddfeb31843f"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "Tue, 27 Sep 2022 22:31:52 GMT",
|
|
51
|
+
"tag": "@microsoft/fast-router_v1.0.0-alpha.8",
|
|
52
|
+
"version": "1.0.0-alpha.8",
|
|
53
|
+
"comments": {
|
|
54
|
+
"prerelease": [
|
|
55
|
+
{
|
|
56
|
+
"author": "beachball",
|
|
57
|
+
"package": "@microsoft/fast-router",
|
|
58
|
+
"comment": "Bump @microsoft/fast-element to v2.0.0-beta.8",
|
|
59
|
+
"commit": "8834c6732c727d39f92f72b197388453a9c17f9b"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"date": "Fri, 23 Sep 2022 22:53:27 GMT",
|
|
66
|
+
"tag": "@microsoft/fast-router_v1.0.0-alpha.7",
|
|
67
|
+
"version": "1.0.0-alpha.7",
|
|
68
|
+
"comments": {
|
|
69
|
+
"prerelease": [
|
|
70
|
+
{
|
|
71
|
+
"author": "roeisenb@microsoft.com",
|
|
72
|
+
"package": "@microsoft/fast-router",
|
|
73
|
+
"commit": "2edd63a8abe24c68cfc7c76d773c912c6f2d6543",
|
|
74
|
+
"comment": "fix: update router to use the new behavior API"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"author": "beachball",
|
|
78
|
+
"package": "@microsoft/fast-router",
|
|
79
|
+
"comment": "Bump @microsoft/fast-element to v2.0.0-beta.7",
|
|
80
|
+
"commit": "1646b26450a08a77c8bd6302560fe12cc6989ae1"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"date": "Thu, 01 Sep 2022 21:53:34 GMT",
|
|
87
|
+
"tag": "@microsoft/fast-router_v1.0.0-alpha.6",
|
|
88
|
+
"version": "1.0.0-alpha.6",
|
|
89
|
+
"comments": {
|
|
90
|
+
"prerelease": [
|
|
91
|
+
{
|
|
92
|
+
"author": "beachball",
|
|
93
|
+
"package": "@microsoft/fast-router",
|
|
94
|
+
"comment": "Bump @microsoft/fast-element to v2.0.0-beta.6",
|
|
95
|
+
"commit": "6b0f08574475d8b28cc2df67bf72b9041c2ad285"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"date": "Thu, 18 Aug 2022 20:46:10 GMT",
|
|
102
|
+
"tag": "@microsoft/fast-router_v1.0.0-alpha.5",
|
|
103
|
+
"version": "1.0.0-alpha.5",
|
|
104
|
+
"comments": {
|
|
105
|
+
"prerelease": [
|
|
106
|
+
{
|
|
107
|
+
"author": "beachball",
|
|
108
|
+
"package": "@microsoft/fast-router",
|
|
109
|
+
"comment": "Bump @microsoft/fast-element to v2.0.0-beta.5",
|
|
110
|
+
"commit": "0b57f1bc812e8e6371b7d27bb625f99a25bfaa66"
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"date": "Mon, 18 Jul 2022 21:10:01 GMT",
|
|
117
|
+
"tag": "@microsoft/fast-router_v1.0.0-alpha.4",
|
|
118
|
+
"version": "1.0.0-alpha.4",
|
|
119
|
+
"comments": {
|
|
120
|
+
"prerelease": [
|
|
121
|
+
{
|
|
122
|
+
"author": "roeisenb@microsoft.com",
|
|
123
|
+
"package": "@microsoft/fast-router",
|
|
124
|
+
"commit": "f164aa75e62ed71c9386902051c021f1fdfba364",
|
|
125
|
+
"comment": "refactor: reduce duplication in style normalization code scenarios"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"author": "beachball",
|
|
129
|
+
"package": "@microsoft/fast-router",
|
|
130
|
+
"comment": "Bump @microsoft/fast-element to v2.0.0-beta.4",
|
|
131
|
+
"commit": "2ff46a32cdd9af12b236d0e2f3436a4de782e8ee"
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"date": "Wed, 22 Jun 2022 20:17:50 GMT",
|
|
138
|
+
"tag": "@microsoft/fast-router_v1.0.0-alpha.3",
|
|
139
|
+
"version": "1.0.0-alpha.3",
|
|
140
|
+
"comments": {
|
|
141
|
+
"prerelease": [
|
|
142
|
+
{
|
|
143
|
+
"comment": "Bump @microsoft/fast-element to v2.0.0-beta.3",
|
|
144
|
+
"author": "nicholasrice@users.noreply.github.com",
|
|
145
|
+
"commit": "f28cdb9fdba9cb27904acfad7444de82d447f39e",
|
|
146
|
+
"package": "@microsoft/fast-router"
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"date": "Wed, 15 Jun 2022 17:41:10 GMT",
|
|
153
|
+
"tag": "@microsoft/fast-router_v1.0.0-alpha.2",
|
|
154
|
+
"version": "1.0.0-alpha.2",
|
|
155
|
+
"comments": {
|
|
156
|
+
"prerelease": [
|
|
157
|
+
{
|
|
158
|
+
"comment": "chore: fix package.json type fields",
|
|
159
|
+
"author": "roeisenb@microsoft.com",
|
|
160
|
+
"commit": "e86a638b9e84cbf36d950025889742944e68e512",
|
|
161
|
+
"package": "@microsoft/fast-router"
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
},
|
|
4
166
|
{
|
|
5
167
|
"date": "Wed, 01 Jun 2022 17:53:14 GMT",
|
|
6
168
|
"tag": "@microsoft/fast-router_v1.0.0-alpha.1",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,91 @@
|
|
|
1
1
|
# Change Log - @microsoft/fast-router
|
|
2
2
|
|
|
3
|
-
This log was last generated on Wed,
|
|
3
|
+
This log was last generated on Wed, 05 Oct 2022 23:26:01 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.0.0-alpha.11
|
|
8
|
+
|
|
9
|
+
Wed, 05 Oct 2022 23:26:01 GMT
|
|
10
|
+
|
|
11
|
+
### Changes
|
|
12
|
+
|
|
13
|
+
- Bump @microsoft/fast-element to v2.0.0-beta.11
|
|
14
|
+
|
|
15
|
+
## 1.0.0-alpha.10
|
|
16
|
+
|
|
17
|
+
Mon, 03 Oct 2022 23:44:38 GMT
|
|
18
|
+
|
|
19
|
+
### Changes
|
|
20
|
+
|
|
21
|
+
- Bump @microsoft/fast-element to v2.0.0-beta.10
|
|
22
|
+
|
|
23
|
+
## 1.0.0-alpha.9
|
|
24
|
+
|
|
25
|
+
Wed, 28 Sep 2022 20:45:51 GMT
|
|
26
|
+
|
|
27
|
+
### Changes
|
|
28
|
+
|
|
29
|
+
- Bump @microsoft/fast-element to v2.0.0-beta.9
|
|
30
|
+
|
|
31
|
+
## 1.0.0-alpha.8
|
|
32
|
+
|
|
33
|
+
Tue, 27 Sep 2022 22:31:52 GMT
|
|
34
|
+
|
|
35
|
+
### Changes
|
|
36
|
+
|
|
37
|
+
- Bump @microsoft/fast-element to v2.0.0-beta.8
|
|
38
|
+
|
|
39
|
+
## 1.0.0-alpha.7
|
|
40
|
+
|
|
41
|
+
Fri, 23 Sep 2022 22:53:27 GMT
|
|
42
|
+
|
|
43
|
+
### Changes
|
|
44
|
+
|
|
45
|
+
- fix: update router to use the new behavior API (roeisenb@microsoft.com)
|
|
46
|
+
- Bump @microsoft/fast-element to v2.0.0-beta.7
|
|
47
|
+
|
|
48
|
+
## 1.0.0-alpha.6
|
|
49
|
+
|
|
50
|
+
Thu, 01 Sep 2022 21:53:34 GMT
|
|
51
|
+
|
|
52
|
+
### Changes
|
|
53
|
+
|
|
54
|
+
- Bump @microsoft/fast-element to v2.0.0-beta.6
|
|
55
|
+
|
|
56
|
+
## 1.0.0-alpha.5
|
|
57
|
+
|
|
58
|
+
Thu, 18 Aug 2022 20:46:10 GMT
|
|
59
|
+
|
|
60
|
+
### Changes
|
|
61
|
+
|
|
62
|
+
- Bump @microsoft/fast-element to v2.0.0-beta.5
|
|
63
|
+
|
|
64
|
+
## 1.0.0-alpha.4
|
|
65
|
+
|
|
66
|
+
Mon, 18 Jul 2022 21:10:01 GMT
|
|
67
|
+
|
|
68
|
+
### Changes
|
|
69
|
+
|
|
70
|
+
- refactor: reduce duplication in style normalization code scenarios (roeisenb@microsoft.com)
|
|
71
|
+
- Bump @microsoft/fast-element to v2.0.0-beta.4
|
|
72
|
+
|
|
73
|
+
## 1.0.0-alpha.3
|
|
74
|
+
|
|
75
|
+
Wed, 22 Jun 2022 20:17:50 GMT
|
|
76
|
+
|
|
77
|
+
### Changes
|
|
78
|
+
|
|
79
|
+
- Bump @microsoft/fast-element to v2.0.0-beta.3 (nicholasrice@users.noreply.github.com)
|
|
80
|
+
|
|
81
|
+
## 1.0.0-alpha.2
|
|
82
|
+
|
|
83
|
+
Wed, 15 Jun 2022 17:41:10 GMT
|
|
84
|
+
|
|
85
|
+
### Changes
|
|
86
|
+
|
|
87
|
+
- chore: fix package.json type fields (roeisenb@microsoft.com)
|
|
88
|
+
|
|
7
89
|
## 1.0.0-alpha.1
|
|
8
90
|
|
|
9
91
|
Wed, 01 Jun 2022 17:53:14 GMT
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AddViewBehaviorFactory,
|
|
1
|
+
import { AddViewBehaviorFactory, ViewBehavior, ViewBehaviorFactory, ViewController } from "@microsoft/fast-element";
|
|
2
2
|
import { NavigationCommitPhaseHook, NavigationPhaseHook, NavigationPhaseName } from "./phases.js";
|
|
3
|
-
import { RouterExecutionContext } from "./view.js";
|
|
4
3
|
/**
|
|
5
4
|
* @beta
|
|
6
5
|
*/
|
|
@@ -18,20 +17,20 @@ export declare type ContributorOptions = {
|
|
|
18
17
|
lifecycle?: boolean;
|
|
19
18
|
parameters?: boolean;
|
|
20
19
|
};
|
|
21
|
-
declare class NavigationContributorDirective implements
|
|
22
|
-
|
|
20
|
+
declare class NavigationContributorDirective implements ViewBehaviorFactory {
|
|
21
|
+
readonly options: Required<ContributorOptions>;
|
|
23
22
|
id: string;
|
|
24
23
|
nodeId: string;
|
|
25
24
|
constructor(options: Required<ContributorOptions>);
|
|
26
25
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
27
|
-
createBehavior(
|
|
26
|
+
createBehavior(): NavigationContributorBehavior;
|
|
28
27
|
}
|
|
29
|
-
declare class NavigationContributorBehavior implements
|
|
30
|
-
private
|
|
31
|
-
private options;
|
|
28
|
+
declare class NavigationContributorBehavior implements ViewBehavior {
|
|
29
|
+
private directive;
|
|
32
30
|
private router;
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
private contributor;
|
|
32
|
+
constructor(directive: NavigationContributorDirective);
|
|
33
|
+
bind(controller: ViewController): void;
|
|
35
34
|
unbind(source: unknown): void;
|
|
36
35
|
}
|
|
37
36
|
/**
|
|
File without changes
|
package/dist/dts/view.d.ts
CHANGED
|
@@ -4,19 +4,14 @@ import { Router } from "./router.js";
|
|
|
4
4
|
* @beta
|
|
5
5
|
*/
|
|
6
6
|
export declare type RouterExecutionContext = ExecutionContext & {
|
|
7
|
-
router
|
|
7
|
+
router?: Router;
|
|
8
8
|
};
|
|
9
|
-
/**
|
|
10
|
-
* @beta
|
|
11
|
-
*/
|
|
12
|
-
export declare const RouterExecutionContext: Readonly<{
|
|
13
|
-
create(router: Router): any;
|
|
14
|
-
}>;
|
|
15
9
|
/**
|
|
16
10
|
* @beta
|
|
17
11
|
*/
|
|
18
12
|
export interface RouteView {
|
|
19
|
-
|
|
13
|
+
context: RouterExecutionContext;
|
|
14
|
+
bind(allTypedParams: Readonly<Record<string, any>>): void;
|
|
20
15
|
appendTo(host: HTMLElement): void;
|
|
21
16
|
dispose(): void;
|
|
22
17
|
}
|
|
@@ -48,7 +43,7 @@ export declare class FASTElementLayout implements Layout {
|
|
|
48
43
|
private readonly template;
|
|
49
44
|
private runBeforeCommit;
|
|
50
45
|
private styles;
|
|
51
|
-
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] |
|
|
46
|
+
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] | undefined, runBeforeCommit?: boolean);
|
|
52
47
|
beforeCommit(routerElement: HTMLElement): Promise<void>;
|
|
53
48
|
afterCommit(routerElement: HTMLElement): Promise<void>;
|
|
54
49
|
private apply;
|
package/dist/esm/contributors.js
CHANGED
|
@@ -17,34 +17,38 @@ class NavigationContributorDirective {
|
|
|
17
17
|
createHTML(add) {
|
|
18
18
|
return Markup.attribute(add(this));
|
|
19
19
|
}
|
|
20
|
-
createBehavior(
|
|
21
|
-
return new NavigationContributorBehavior(
|
|
20
|
+
createBehavior() {
|
|
21
|
+
return new NavigationContributorBehavior(this);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
HTMLDirective.define(NavigationContributorDirective);
|
|
25
25
|
class NavigationContributorBehavior {
|
|
26
|
-
constructor(
|
|
27
|
-
this.
|
|
28
|
-
this.options = options;
|
|
26
|
+
constructor(directive) {
|
|
27
|
+
this.directive = directive;
|
|
29
28
|
this.router = null;
|
|
30
29
|
}
|
|
31
|
-
bind(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
bind(controller) {
|
|
31
|
+
var _a;
|
|
32
|
+
const context = controller.context;
|
|
33
|
+
const options = this.directive.options;
|
|
34
|
+
this.contributor = controller.targets[this.directive.nodeId];
|
|
35
|
+
if (options.lifecycle) {
|
|
36
|
+
this.router = (_a = context.router) !== null && _a !== void 0 ? _a : Router.find(this.contributor);
|
|
37
|
+
if (this.router) {
|
|
38
|
+
this.router.addContributor(this.contributor);
|
|
39
|
+
controller.onUnbind(this);
|
|
40
|
+
}
|
|
35
41
|
}
|
|
36
|
-
if (
|
|
42
|
+
if (options.parameters) {
|
|
37
43
|
const contributor = this.contributor;
|
|
38
|
-
const routeParams = source;
|
|
44
|
+
const routeParams = controller.source;
|
|
39
45
|
for (const key in routeParams) {
|
|
40
46
|
contributor[key] = routeParams[key];
|
|
41
47
|
}
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
unbind(source) {
|
|
45
|
-
|
|
46
|
-
this.router.removeContributor(this.contributor);
|
|
47
|
-
}
|
|
51
|
+
this.router.removeContributor(this.contributor);
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
/**
|
package/dist/esm/router.js
CHANGED
|
@@ -3,7 +3,6 @@ import { FASTElement } from "@microsoft/fast-element";
|
|
|
3
3
|
import { composedParent } from "@microsoft/fast-element/utilities";
|
|
4
4
|
import { NavigationMessage } from "./navigation.js";
|
|
5
5
|
import { childRouteParameter } from "./routes.js";
|
|
6
|
-
import { RouterExecutionContext } from "./view.js";
|
|
7
6
|
const routerProperty = "$router";
|
|
8
7
|
function findParentRouterForElement(element) {
|
|
9
8
|
let parent = element;
|
|
@@ -137,7 +136,8 @@ export class DefaultRouter {
|
|
|
137
136
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
137
|
this.newRoute = route;
|
|
139
138
|
this.newView = yield command.createView();
|
|
140
|
-
this.newView.
|
|
139
|
+
this.newView.context.router = this;
|
|
140
|
+
this.newView.bind(route.allTypedParams);
|
|
141
141
|
this.newView.appendTo(this.host);
|
|
142
142
|
yield command.transition.begin(this.host, this.view, this.newView);
|
|
143
143
|
return {
|
package/dist/esm/view.js
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
-
import { ElementStyles,
|
|
2
|
+
import { ElementStyles, html, } from "@microsoft/fast-element";
|
|
3
3
|
import { isFASTElementHost } from "./router.js";
|
|
4
|
-
/**
|
|
5
|
-
* @beta
|
|
6
|
-
*/
|
|
7
|
-
export const RouterExecutionContext = Object.freeze({
|
|
8
|
-
create(router) {
|
|
9
|
-
return Object.create(ExecutionContext.default, {
|
|
10
|
-
router: {
|
|
11
|
-
value: router,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
4
|
/**
|
|
17
5
|
* @beta
|
|
18
6
|
*/
|
|
@@ -33,17 +21,11 @@ export const Transition = Object.freeze({
|
|
|
33
21
|
* @beta
|
|
34
22
|
*/
|
|
35
23
|
export class FASTElementLayout {
|
|
36
|
-
constructor(template = null, styles =
|
|
24
|
+
constructor(template = null, styles = undefined, runBeforeCommit = true) {
|
|
25
|
+
var _a;
|
|
37
26
|
this.template = template;
|
|
38
27
|
this.runBeforeCommit = runBeforeCommit;
|
|
39
|
-
this.styles =
|
|
40
|
-
styles === void 0 || styles === null
|
|
41
|
-
? null
|
|
42
|
-
: Array.isArray(styles)
|
|
43
|
-
? new ElementStyles(styles)
|
|
44
|
-
: styles instanceof ElementStyles
|
|
45
|
-
? styles
|
|
46
|
-
: new ElementStyles([styles]);
|
|
28
|
+
this.styles = (_a = ElementStyles.normalize(styles)) !== null && _a !== void 0 ? _a : null;
|
|
47
29
|
}
|
|
48
30
|
beforeCommit(routerElement) {
|
|
49
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -64,8 +46,8 @@ export class FASTElementLayout {
|
|
|
64
46
|
if (routerElement.$fastController.template !== this.template) {
|
|
65
47
|
routerElement.$fastController.template = this.template;
|
|
66
48
|
}
|
|
67
|
-
if (routerElement.$fastController.
|
|
68
|
-
routerElement.$fastController.
|
|
49
|
+
if (routerElement.$fastController.mainStyles !== this.styles) {
|
|
50
|
+
routerElement.$fastController.mainStyles = this.styles;
|
|
69
51
|
}
|
|
70
52
|
}
|
|
71
53
|
}
|
|
@@ -2410,7 +2410,7 @@
|
|
|
2410
2410
|
},
|
|
2411
2411
|
{
|
|
2412
2412
|
"kind": "Content",
|
|
2413
|
-
"text": "[] |
|
|
2413
|
+
"text": "[] | undefined"
|
|
2414
2414
|
},
|
|
2415
2415
|
{
|
|
2416
2416
|
"kind": "Content",
|
|
@@ -9097,11 +9097,11 @@
|
|
|
9097
9097
|
{
|
|
9098
9098
|
"kind": "Reference",
|
|
9099
9099
|
"text": "ExecutionContext",
|
|
9100
|
-
"canonicalReference": "@microsoft/fast-element!ExecutionContext:
|
|
9100
|
+
"canonicalReference": "@microsoft/fast-element!ExecutionContext:interface"
|
|
9101
9101
|
},
|
|
9102
9102
|
{
|
|
9103
9103
|
"kind": "Content",
|
|
9104
|
-
"text": " & {\n router
|
|
9104
|
+
"text": " & {\n router?: "
|
|
9105
9105
|
},
|
|
9106
9106
|
{
|
|
9107
9107
|
"kind": "Reference",
|
|
@@ -9124,41 +9124,6 @@
|
|
|
9124
9124
|
"endIndex": 5
|
|
9125
9125
|
}
|
|
9126
9126
|
},
|
|
9127
|
-
{
|
|
9128
|
-
"kind": "Variable",
|
|
9129
|
-
"canonicalReference": "@microsoft/fast-router!RouterExecutionContext:var",
|
|
9130
|
-
"docComment": "/**\n * @beta\n */\n",
|
|
9131
|
-
"excerptTokens": [
|
|
9132
|
-
{
|
|
9133
|
-
"kind": "Content",
|
|
9134
|
-
"text": "RouterExecutionContext: "
|
|
9135
|
-
},
|
|
9136
|
-
{
|
|
9137
|
-
"kind": "Reference",
|
|
9138
|
-
"text": "Readonly",
|
|
9139
|
-
"canonicalReference": "!Readonly:type"
|
|
9140
|
-
},
|
|
9141
|
-
{
|
|
9142
|
-
"kind": "Content",
|
|
9143
|
-
"text": "<{\n create(router: "
|
|
9144
|
-
},
|
|
9145
|
-
{
|
|
9146
|
-
"kind": "Reference",
|
|
9147
|
-
"text": "Router",
|
|
9148
|
-
"canonicalReference": "@microsoft/fast-router!Router:interface"
|
|
9149
|
-
},
|
|
9150
|
-
{
|
|
9151
|
-
"kind": "Content",
|
|
9152
|
-
"text": "): any;\n}>"
|
|
9153
|
-
}
|
|
9154
|
-
],
|
|
9155
|
-
"releaseTag": "Beta",
|
|
9156
|
-
"name": "RouterExecutionContext",
|
|
9157
|
-
"variableTypeTokenRange": {
|
|
9158
|
-
"startIndex": 1,
|
|
9159
|
-
"endIndex": 5
|
|
9160
|
-
}
|
|
9161
|
-
},
|
|
9162
9127
|
{
|
|
9163
9128
|
"kind": "Interface",
|
|
9164
9129
|
"canonicalReference": "@microsoft/fast-router!RouteView:interface",
|
|
@@ -9245,15 +9210,6 @@
|
|
|
9245
9210
|
"kind": "Content",
|
|
9246
9211
|
"text": "<string, any>>"
|
|
9247
9212
|
},
|
|
9248
|
-
{
|
|
9249
|
-
"kind": "Content",
|
|
9250
|
-
"text": ", context: "
|
|
9251
|
-
},
|
|
9252
|
-
{
|
|
9253
|
-
"kind": "Reference",
|
|
9254
|
-
"text": "RouterExecutionContext",
|
|
9255
|
-
"canonicalReference": "@microsoft/fast-router!RouterExecutionContext:type"
|
|
9256
|
-
},
|
|
9257
9213
|
{
|
|
9258
9214
|
"kind": "Content",
|
|
9259
9215
|
"text": "): "
|
|
@@ -9269,8 +9225,8 @@
|
|
|
9269
9225
|
],
|
|
9270
9226
|
"isOptional": false,
|
|
9271
9227
|
"returnTypeTokenRange": {
|
|
9272
|
-
"startIndex":
|
|
9273
|
-
"endIndex":
|
|
9228
|
+
"startIndex": 6,
|
|
9229
|
+
"endIndex": 7
|
|
9274
9230
|
},
|
|
9275
9231
|
"releaseTag": "Beta",
|
|
9276
9232
|
"overloadIndex": 1,
|
|
@@ -9282,17 +9238,36 @@
|
|
|
9282
9238
|
"endIndex": 5
|
|
9283
9239
|
},
|
|
9284
9240
|
"isOptional": false
|
|
9241
|
+
}
|
|
9242
|
+
],
|
|
9243
|
+
"name": "bind"
|
|
9244
|
+
},
|
|
9245
|
+
{
|
|
9246
|
+
"kind": "PropertySignature",
|
|
9247
|
+
"canonicalReference": "@microsoft/fast-router!RouteView#context:member",
|
|
9248
|
+
"docComment": "",
|
|
9249
|
+
"excerptTokens": [
|
|
9250
|
+
{
|
|
9251
|
+
"kind": "Content",
|
|
9252
|
+
"text": "context: "
|
|
9285
9253
|
},
|
|
9286
9254
|
{
|
|
9287
|
-
"
|
|
9288
|
-
"
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
"
|
|
9255
|
+
"kind": "Reference",
|
|
9256
|
+
"text": "RouterExecutionContext",
|
|
9257
|
+
"canonicalReference": "@microsoft/fast-router!RouterExecutionContext:type"
|
|
9258
|
+
},
|
|
9259
|
+
{
|
|
9260
|
+
"kind": "Content",
|
|
9261
|
+
"text": ";"
|
|
9293
9262
|
}
|
|
9294
9263
|
],
|
|
9295
|
-
"
|
|
9264
|
+
"isOptional": false,
|
|
9265
|
+
"releaseTag": "Beta",
|
|
9266
|
+
"name": "context",
|
|
9267
|
+
"propertyTypeTokenRange": {
|
|
9268
|
+
"startIndex": 1,
|
|
9269
|
+
"endIndex": 2
|
|
9270
|
+
}
|
|
9296
9271
|
},
|
|
9297
9272
|
{
|
|
9298
9273
|
"kind": "MethodSignature",
|
package/dist/fast-router.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AddViewBehaviorFactory } from '@microsoft/fast-element';
|
|
2
|
-
import { Behavior } from '@microsoft/fast-element';
|
|
3
2
|
import { ComposableStyles } from '@microsoft/fast-element';
|
|
4
3
|
import { Constructable } from '@microsoft/fast-element';
|
|
5
4
|
import { ExecutionContext } from '@microsoft/fast-element';
|
|
6
5
|
import { FASTElement } from '@microsoft/fast-element';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { ViewBehavior } from '@microsoft/fast-element';
|
|
7
|
+
import { ViewBehaviorFactory } from '@microsoft/fast-element';
|
|
8
|
+
import { ViewController } from '@microsoft/fast-element';
|
|
9
9
|
import { ViewTemplate } from '@microsoft/fast-element';
|
|
10
10
|
|
|
11
11
|
/* Excluded from this release type: childRouteParameter */
|
|
@@ -199,7 +199,7 @@ export declare class FASTElementLayout implements Layout {
|
|
|
199
199
|
private readonly template;
|
|
200
200
|
private runBeforeCommit;
|
|
201
201
|
private styles;
|
|
202
|
-
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] |
|
|
202
|
+
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] | undefined, runBeforeCommit?: boolean);
|
|
203
203
|
beforeCommit(routerElement: HTMLElement): Promise<void>;
|
|
204
204
|
afterCommit(routerElement: HTMLElement): Promise<void>;
|
|
205
205
|
private apply;
|
|
@@ -339,22 +339,22 @@ export declare type NavigationContributor<TSettings = any> = Partial<Record<Excl
|
|
|
339
339
|
*/
|
|
340
340
|
export declare function navigationContributor(options?: ContributorOptions): NavigationContributorDirective;
|
|
341
341
|
|
|
342
|
-
declare class NavigationContributorBehavior implements
|
|
343
|
-
private
|
|
344
|
-
private options;
|
|
342
|
+
declare class NavigationContributorBehavior implements ViewBehavior {
|
|
343
|
+
private directive;
|
|
345
344
|
private router;
|
|
346
|
-
|
|
347
|
-
|
|
345
|
+
private contributor;
|
|
346
|
+
constructor(directive: NavigationContributorDirective);
|
|
347
|
+
bind(controller: ViewController): void;
|
|
348
348
|
unbind(source: unknown): void;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
-
declare class NavigationContributorDirective implements
|
|
352
|
-
|
|
351
|
+
declare class NavigationContributorDirective implements ViewBehaviorFactory {
|
|
352
|
+
readonly options: Required<ContributorOptions>;
|
|
353
353
|
id: string;
|
|
354
354
|
nodeId: string;
|
|
355
355
|
constructor(options: Required<ContributorOptions>);
|
|
356
356
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
357
|
-
createBehavior(
|
|
357
|
+
createBehavior(): NavigationContributorBehavior;
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
/**
|
|
@@ -746,23 +746,17 @@ export declare interface RouterElement extends HTMLElement {
|
|
|
746
746
|
* @beta
|
|
747
747
|
*/
|
|
748
748
|
export declare type RouterExecutionContext = ExecutionContext & {
|
|
749
|
-
router
|
|
749
|
+
router?: Router;
|
|
750
750
|
};
|
|
751
751
|
|
|
752
|
-
/**
|
|
753
|
-
* @beta
|
|
754
|
-
*/
|
|
755
|
-
export declare const RouterExecutionContext: Readonly<{
|
|
756
|
-
create(router: Router): any;
|
|
757
|
-
}>;
|
|
758
|
-
|
|
759
752
|
declare const routerProperty = "$router";
|
|
760
753
|
|
|
761
754
|
/**
|
|
762
755
|
* @beta
|
|
763
756
|
*/
|
|
764
757
|
export declare interface RouteView {
|
|
765
|
-
|
|
758
|
+
context: RouterExecutionContext;
|
|
759
|
+
bind(allTypedParams: Readonly<Record<string, any>>): void;
|
|
766
760
|
appendTo(host: HTMLElement): void;
|
|
767
761
|
dispose(): void;
|
|
768
762
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AddViewBehaviorFactory } from '@microsoft/fast-element';
|
|
2
|
-
import { Behavior } from '@microsoft/fast-element';
|
|
3
2
|
import { ComposableStyles } from '@microsoft/fast-element';
|
|
4
3
|
import { Constructable } from '@microsoft/fast-element';
|
|
5
4
|
import { ExecutionContext } from '@microsoft/fast-element';
|
|
6
5
|
import { FASTElement } from '@microsoft/fast-element';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { ViewBehavior } from '@microsoft/fast-element';
|
|
7
|
+
import { ViewBehaviorFactory } from '@microsoft/fast-element';
|
|
8
|
+
import { ViewController } from '@microsoft/fast-element';
|
|
9
9
|
import { ViewTemplate } from '@microsoft/fast-element';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -202,7 +202,7 @@ export declare class FASTElementLayout implements Layout {
|
|
|
202
202
|
private readonly template;
|
|
203
203
|
private runBeforeCommit;
|
|
204
204
|
private styles;
|
|
205
|
-
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] |
|
|
205
|
+
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] | undefined, runBeforeCommit?: boolean);
|
|
206
206
|
beforeCommit(routerElement: HTMLElement): Promise<void>;
|
|
207
207
|
afterCommit(routerElement: HTMLElement): Promise<void>;
|
|
208
208
|
private apply;
|
|
@@ -342,22 +342,22 @@ export declare type NavigationContributor<TSettings = any> = Partial<Record<Excl
|
|
|
342
342
|
*/
|
|
343
343
|
export declare function navigationContributor(options?: ContributorOptions): NavigationContributorDirective;
|
|
344
344
|
|
|
345
|
-
declare class NavigationContributorBehavior implements
|
|
346
|
-
private
|
|
347
|
-
private options;
|
|
345
|
+
declare class NavigationContributorBehavior implements ViewBehavior {
|
|
346
|
+
private directive;
|
|
348
347
|
private router;
|
|
349
|
-
|
|
350
|
-
|
|
348
|
+
private contributor;
|
|
349
|
+
constructor(directive: NavigationContributorDirective);
|
|
350
|
+
bind(controller: ViewController): void;
|
|
351
351
|
unbind(source: unknown): void;
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
-
declare class NavigationContributorDirective implements
|
|
355
|
-
|
|
354
|
+
declare class NavigationContributorDirective implements ViewBehaviorFactory {
|
|
355
|
+
readonly options: Required<ContributorOptions>;
|
|
356
356
|
id: string;
|
|
357
357
|
nodeId: string;
|
|
358
358
|
constructor(options: Required<ContributorOptions>);
|
|
359
359
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
360
|
-
createBehavior(
|
|
360
|
+
createBehavior(): NavigationContributorBehavior;
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
/**
|
|
@@ -749,23 +749,17 @@ export declare interface RouterElement extends HTMLElement {
|
|
|
749
749
|
* @beta
|
|
750
750
|
*/
|
|
751
751
|
export declare type RouterExecutionContext = ExecutionContext & {
|
|
752
|
-
router
|
|
752
|
+
router?: Router;
|
|
753
753
|
};
|
|
754
754
|
|
|
755
|
-
/**
|
|
756
|
-
* @beta
|
|
757
|
-
*/
|
|
758
|
-
export declare const RouterExecutionContext: Readonly<{
|
|
759
|
-
create(router: Router): any;
|
|
760
|
-
}>;
|
|
761
|
-
|
|
762
755
|
declare const routerProperty = "$router";
|
|
763
756
|
|
|
764
757
|
/**
|
|
765
758
|
* @beta
|
|
766
759
|
*/
|
|
767
760
|
export declare interface RouteView {
|
|
768
|
-
|
|
761
|
+
context: RouterExecutionContext;
|
|
762
|
+
bind(allTypedParams: Readonly<Record<string, any>>): void;
|
|
769
763
|
appendTo(host: HTMLElement): void;
|
|
770
764
|
dispose(): void;
|
|
771
765
|
}
|
package/docs/api-report.md
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
7
|
import { AddViewBehaviorFactory } from '@microsoft/fast-element';
|
|
8
|
-
import { Behavior } from '@microsoft/fast-element';
|
|
9
8
|
import { ComposableStyles } from '@microsoft/fast-element';
|
|
10
9
|
import { Constructable } from '@microsoft/fast-element';
|
|
11
10
|
import { ExecutionContext } from '@microsoft/fast-element';
|
|
12
11
|
import { FASTElement } from '@microsoft/fast-element';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { ViewBehavior } from '@microsoft/fast-element';
|
|
13
|
+
import { ViewBehaviorFactory } from '@microsoft/fast-element';
|
|
14
|
+
import { ViewController } from '@microsoft/fast-element';
|
|
15
15
|
import { ViewTemplate } from '@microsoft/fast-element';
|
|
16
16
|
|
|
17
17
|
// Warning: (ae-internal-missing-underscore) The name "childRouteParameter" should be prefixed with an underscore because the declaration is marked as @internal
|
|
@@ -152,7 +152,7 @@ export type FASTElementConstructor = new () => FASTElement;
|
|
|
152
152
|
|
|
153
153
|
// @beta (undocumented)
|
|
154
154
|
export class FASTElementLayout implements Layout {
|
|
155
|
-
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] |
|
|
155
|
+
constructor(template?: ViewTemplate | null, styles?: ComposableStyles | ComposableStyles[] | undefined, runBeforeCommit?: boolean);
|
|
156
156
|
// (undocumented)
|
|
157
157
|
afterCommit(routerElement: HTMLElement): Promise<void>;
|
|
158
158
|
// (undocumented)
|
|
@@ -582,20 +582,17 @@ export interface RouterElement extends HTMLElement {
|
|
|
582
582
|
|
|
583
583
|
// @beta (undocumented)
|
|
584
584
|
export type RouterExecutionContext = ExecutionContext & {
|
|
585
|
-
router
|
|
585
|
+
router?: Router;
|
|
586
586
|
};
|
|
587
587
|
|
|
588
|
-
// @beta (undocumented)
|
|
589
|
-
export const RouterExecutionContext: Readonly<{
|
|
590
|
-
create(router: Router): any;
|
|
591
|
-
}>;
|
|
592
|
-
|
|
593
588
|
// @beta (undocumented)
|
|
594
589
|
export interface RouteView {
|
|
595
590
|
// (undocumented)
|
|
596
591
|
appendTo(host: HTMLElement): void;
|
|
597
592
|
// (undocumented)
|
|
598
|
-
bind(allTypedParams: Readonly<Record<string, any
|
|
593
|
+
bind(allTypedParams: Readonly<Record<string, any>>): void;
|
|
594
|
+
// (undocumented)
|
|
595
|
+
context: RouterExecutionContext;
|
|
599
596
|
// (undocumented)
|
|
600
597
|
dispose(): void;
|
|
601
598
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@microsoft/fast-router",
|
|
3
3
|
"description": "A web-components-based router.",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "1.0.0-alpha.
|
|
5
|
+
"version": "1.0.0-alpha.11",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Microsoft",
|
|
8
8
|
"url": "https://discord.gg/FcSNfg4"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"url": "https://github.com/Microsoft/fast/issues/new/choose"
|
|
19
19
|
},
|
|
20
20
|
"main": "dist/esm/index.js",
|
|
21
|
-
"types": "dist/
|
|
21
|
+
"types": "dist/dts/index.d.ts",
|
|
22
22
|
"type": "module",
|
|
23
23
|
"unpkg": "dist/fast-router.min.js",
|
|
24
24
|
"scripts": {
|
|
@@ -80,6 +80,6 @@
|
|
|
80
80
|
"webpack-cli": "^4.9.2"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@microsoft/fast-element": "^2.0.0-beta.
|
|
83
|
+
"@microsoft/fast-element": "^2.0.0-beta.11"
|
|
84
84
|
}
|
|
85
85
|
}
|