@rxap/authentication 22.0.0-dev.0 → 22.0.0-dev.2
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.md +31 -0
- package/README.md +5 -3
- package/compodoc/architecture.html +222 -0
- package/compodoc/changelog.html +75 -5
- package/compodoc/dependencies.html +96 -21
- package/compodoc/directives/SignOutDirective.html +140 -98
- package/compodoc/index.html +50 -8
- package/compodoc/injectables/AuthenticationRoutingService.html +69 -9
- package/compodoc/injectables/DisabledAuthenticationService.html +87 -21
- package/compodoc/injectables/RegisterService.html +77 -17
- package/compodoc/injectables/RxapAuthenticationGuard.html +105 -27
- package/compodoc/injectables/RxapAuthenticationService.html +98 -21
- package/compodoc/interfaces/AuthenticationAccessToken.html +172 -98
- package/compodoc/interfaces/AuthenticationEvent.html +131 -62
- package/compodoc/interfaces/IAuthenticationService.html +171 -115
- package/compodoc/js/architecture-graph.js +288 -0
- package/compodoc/js/libs/bootstrap-native.js +4 -2
- package/compodoc/js/libs/jszip.min.js +13 -0
- package/compodoc/js/libs/svg-pan-zoom.min.js +3 -3
- package/compodoc/js/libs/tablesort.min.js +3 -3
- package/compodoc/js/libs/tablesort.number.min.js +3 -3
- package/compodoc/js/libs/vis-network.min.js +78 -0
- package/compodoc/js/menu-wc.js +25 -12
- package/compodoc/js/menu.js +10 -11
- package/compodoc/js/routes/routes_index.js +1 -0
- package/compodoc/js/routes.js +142 -34
- package/compodoc/js/search/search-lunr.js +6 -8
- package/compodoc/js/search/search.js +118 -66
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/js/tabs.js +98 -15
- package/compodoc/js/tree.js +44 -7
- package/compodoc/license.html +48 -6
- package/compodoc/llms.txt +138 -0
- package/compodoc/miscellaneous/enumerations.html +45 -4
- package/compodoc/miscellaneous/functions.html +150 -20
- package/compodoc/miscellaneous/variables.html +72 -7
- package/compodoc/modules.html +44 -3
- package/compodoc/overview.html +54 -3
- package/compodoc/properties.html +45 -4
- package/compodoc/routes.html +227 -0
- package/compodoc/styles/compodoc.css +365 -44
- package/compodoc/styles/dark.css +16 -0
- package/compodoc/template-playground/default-templates.json +192 -0
- package/compodoc/template-playground/hbs-render.service.ts +217 -0
- package/compodoc/template-playground/main.ts +9 -0
- package/compodoc/template-playground/template-editor.service.ts +173 -0
- package/compodoc/template-playground/template-playground.component.ts +614 -0
- package/compodoc/template-playground/template-playground.module.ts +29 -0
- package/compodoc/template-playground/zip-export.service.ts +86 -0
- package/compodoc/template-playground-app/app.js +1389 -0
- package/compodoc/template-playground-app/index.html +462 -0
- package/docs/documentation.json +357 -210
- package/docs/html/assets/highlight.css +1 -1
- package/docs/html/assets/icons.js +1 -1
- package/docs/html/assets/icons.svg +1 -1
- package/docs/html/assets/main.js +5 -5
- package/docs/html/assets/search.js +1 -1
- package/docs/html/assets/style.css +265 -228
- package/docs/html/classes/AuthenticationRoutingService.html +58 -2
- package/docs/html/classes/DisabledAuthenticationService.html +112 -6
- package/docs/html/classes/RegisterService.html +81 -3
- package/docs/html/classes/RxapAuthenticationGuard.html +120 -7
- package/docs/html/classes/RxapAuthenticationService.html +114 -6
- package/docs/html/classes/SignOutDirective.html +94 -5
- package/docs/html/enums/AuthenticationEventType.html +66 -4
- package/docs/html/functions/BearerTokenInterceptor.html +43 -1
- package/docs/html/functions/provideAuthentication.html +43 -1
- package/docs/html/functions/withDisabledAuthentication.html +42 -1
- package/docs/html/functions/withInitialAuthenticationState.html +42 -1
- package/docs/html/hierarchy.html +34 -1
- package/docs/html/index.html +44 -7
- package/docs/html/interfaces/AuthenticationAccessToken.html +72 -3
- package/docs/html/interfaces/AuthenticationEvent.html +66 -2
- package/docs/html/interfaces/IAuthenticationService.html +94 -5
- package/docs/html/modules.html +52 -1
- package/docs/html/variables/RXAP_AUTHENTICATION_ACCESS_TOKEN.html +33 -1
- package/docs/html/variables/RXAP_AUTHENTICATION_DEACTIVATED.html +33 -1
- package/docs/html/variables/RXAP_INITIAL_AUTHENTICATION_STATE.html +33 -1
- package/docs/markdown/README.md +6 -4
- package/docs/markdown/classes/AuthenticationRoutingService.md +6 -6
- package/docs/markdown/classes/DisabledAuthenticationService.md +12 -12
- package/docs/markdown/classes/RegisterService.md +7 -7
- package/docs/markdown/classes/RxapAuthenticationGuard.md +11 -11
- package/docs/markdown/classes/RxapAuthenticationService.md +14 -14
- package/docs/markdown/classes/SignOutDirective.md +8 -8
- package/docs/markdown/enumerations/AuthenticationEventType.md +5 -5
- package/docs/markdown/functions/BearerTokenInterceptor.md +2 -2
- package/docs/markdown/functions/provideAuthentication.md +2 -2
- package/docs/markdown/functions/withDisabledAuthentication.md +4 -4
- package/docs/markdown/functions/withInitialAuthenticationState.md +2 -2
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/interfaces/AuthenticationAccessToken.md +6 -6
- package/docs/markdown/interfaces/AuthenticationEvent.md +4 -4
- package/docs/markdown/interfaces/IAuthenticationService.md +7 -7
- package/docs/markdown/variables/RXAP_AUTHENTICATION_ACCESS_TOKEN.md +3 -3
- package/docs/markdown/variables/RXAP_AUTHENTICATION_DEACTIVATED.md +2 -2
- package/docs/markdown/variables/RXAP_INITIAL_AUTHENTICATION_STATE.md +2 -2
- package/docs/wiki/Class.AuthenticationRoutingService.md +5 -5
- package/docs/wiki/Class.DisabledAuthenticationService.md +11 -11
- package/docs/wiki/Class.RegisterService.md +6 -6
- package/docs/wiki/Class.RxapAuthenticationGuard.md +10 -10
- package/docs/wiki/Class.RxapAuthenticationService.md +13 -13
- package/docs/wiki/Class.SignOutDirective.md +7 -7
- package/docs/wiki/Enumeration.AuthenticationEventType.md +4 -4
- package/docs/wiki/Function.BearerTokenInterceptor.md +1 -1
- package/docs/wiki/Function.provideAuthentication.md +1 -1
- package/docs/wiki/Function.withDisabledAuthentication.md +3 -3
- package/docs/wiki/Function.withInitialAuthenticationState.md +1 -1
- package/docs/wiki/Home.md +5 -3
- package/docs/wiki/Interface.AuthenticationAccessToken.md +5 -5
- package/docs/wiki/Interface.AuthenticationEvent.md +3 -3
- package/docs/wiki/Interface.IAuthenticationService.md +6 -6
- package/docs/wiki/Variable.RXAP_AUTHENTICATION_ACCESS_TOKEN.md +2 -2
- package/docs/wiki/Variable.RXAP_AUTHENTICATION_DEACTIVATED.md +1 -1
- package/docs/wiki/Variable.RXAP_INITIAL_AUTHENTICATION_STATE.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/fesm2022/rxap-authentication.mjs +363 -346
- package/fesm2022/rxap-authentication.mjs.map +1 -1
- package/generators.json +16 -0
- package/package.json +11 -13
- package/src/generators/init/generator.js +120 -0
- package/src/generators/init/index.js +6 -0
- package/src/generators/init/schema.json +8 -0
- package/src/generators/package.json +3 -0
- package/compodoc/js/libs/vis.min.js +0 -47
- package/compodoc/js/menu-wc_es5.js +0 -40
- package/theme.css +0 -1
|
@@ -61,6 +61,20 @@
|
|
|
61
61
|
}
|
|
62
62
|
toggleDarkMode(darkModeState);
|
|
63
63
|
</script>
|
|
64
|
+
<script>
|
|
65
|
+
// --- Iframe navigation tracking for Template Playground ---
|
|
66
|
+
function sendCurrentUrlToParent() {
|
|
67
|
+
if (window.parent && window.parent !== window) {
|
|
68
|
+
window.parent.postMessage({
|
|
69
|
+
type: 'compodoc-iframe-navigate',
|
|
70
|
+
url: window.location.pathname + window.location.hash
|
|
71
|
+
}, '*');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
window.addEventListener('hashchange', sendCurrentUrlToParent, false);
|
|
75
|
+
window.addEventListener('popstate', sendCurrentUrlToParent, false);
|
|
76
|
+
window.addEventListener('DOMContentLoaded', sendCurrentUrlToParent, false);
|
|
77
|
+
</script>
|
|
64
78
|
|
|
65
79
|
<div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
|
|
66
80
|
<div class="d-flex">
|
|
@@ -70,7 +84,14 @@
|
|
|
70
84
|
</div>
|
|
71
85
|
|
|
72
86
|
<div class="xs-menu menu" id="mobile-menu">
|
|
73
|
-
<div id="book-search-input" role="search"
|
|
87
|
+
<div id="book-search-input" role="search">
|
|
88
|
+
<input type="text" placeholder="Type to search">
|
|
89
|
+
<button type="button"
|
|
90
|
+
class="search-input-clear"
|
|
91
|
+
aria-label="Clear search"
|
|
92
|
+
data-search-input-clear>×</button>
|
|
93
|
+
</div>
|
|
94
|
+
<compodoc-menu></compodoc-menu>
|
|
74
95
|
</div>
|
|
75
96
|
|
|
76
97
|
<div class="container-fluid main">
|
|
@@ -94,6 +115,10 @@
|
|
|
94
115
|
|
|
95
116
|
|
|
96
117
|
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
97
122
|
<ol class="breadcrumb">
|
|
98
123
|
<li class="breadcrumb-item">Interfaces</li>
|
|
99
124
|
<li class="breadcrumb-item"
|
|
@@ -101,6 +126,11 @@
|
|
|
101
126
|
IAuthenticationService</li>
|
|
102
127
|
</ol>
|
|
103
128
|
|
|
129
|
+
<div class="io-file io-file-path" data-compodoc="entity-file-path">
|
|
130
|
+
<span class="icon ion-ios-document" aria-hidden="true"></span>
|
|
131
|
+
<code>src/lib/authentication.service.ts</code>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
104
134
|
<ul class="nav nav-tabs" role="tablist">
|
|
105
135
|
<li class="nav-item">
|
|
106
136
|
<a href="#info"
|
|
@@ -108,6 +138,12 @@
|
|
|
108
138
|
class="nav-link active"
|
|
109
139
|
role="tab" id="info-tab" data-bs-toggle="tab" data-link="info">Info</a>
|
|
110
140
|
</li>
|
|
141
|
+
<li class="nav-item">
|
|
142
|
+
<a href="#api"
|
|
143
|
+
class="nav-link"
|
|
144
|
+
|
|
145
|
+
role="tab" id="api-tab" data-bs-toggle="tab" data-link="api">API</a>
|
|
146
|
+
</li>
|
|
111
147
|
<li class="nav-item">
|
|
112
148
|
<a href="#source"
|
|
113
149
|
class="nav-link"
|
|
@@ -118,71 +154,62 @@
|
|
|
118
154
|
|
|
119
155
|
<div class="tab-content">
|
|
120
156
|
<div class="tab-pane fade active in" id="info">
|
|
121
|
-
<p class="comment">
|
|
122
|
-
<h3>File</h3>
|
|
123
|
-
</p>
|
|
124
|
-
<p class="comment">
|
|
125
|
-
<code>src/lib/authentication.service.ts</code>
|
|
126
|
-
</p>
|
|
127
157
|
|
|
128
158
|
|
|
129
159
|
|
|
160
|
+
</div>
|
|
130
161
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
>
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
<
|
|
164
|
-
<
|
|
165
|
-
<
|
|
166
|
-
<
|
|
167
|
-
|
|
168
|
-
>
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
</
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
>
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
</tr>
|
|
181
|
-
</tbody>
|
|
182
|
-
</table>
|
|
183
|
-
</section>
|
|
162
|
+
<div class="tab-pane fade " id="api"><section data-compodoc="block-index">
|
|
163
|
+
<h3 id="index">Index</h3>
|
|
164
|
+
<table class="table table-sm table-bordered index-table">
|
|
165
|
+
<tbody>
|
|
166
|
+
<tr>
|
|
167
|
+
<td class="col-md-3">
|
|
168
|
+
<h6><b>Properties</b></h6>
|
|
169
|
+
</td>
|
|
170
|
+
<td class="col-md-9">
|
|
171
|
+
<ul class="index-list">
|
|
172
|
+
<li>
|
|
173
|
+
<a href="#events$" class="reference-link ">
|
|
174
|
+
<span class="reference-badge reference-badge--property" aria-hidden="true">P</span><span class="reference-link-label">events$</span>
|
|
175
|
+
</a>
|
|
176
|
+
</li>
|
|
177
|
+
<li>
|
|
178
|
+
<a href="#isAuthenticated$" class="reference-link ">
|
|
179
|
+
<span class="reference-badge reference-badge--property" aria-hidden="true">P</span><span class="reference-link-label">isAuthenticated$</span>
|
|
180
|
+
</a>
|
|
181
|
+
</li>
|
|
182
|
+
</ul>
|
|
183
|
+
</td>
|
|
184
|
+
</tr>
|
|
185
|
+
</tbody>
|
|
186
|
+
</table>
|
|
187
|
+
<table class="table table-sm table-bordered index-table">
|
|
188
|
+
<tbody>
|
|
189
|
+
<tr>
|
|
190
|
+
<td class="col-md-3">
|
|
191
|
+
<h6><b>Methods</b></h6>
|
|
192
|
+
</td>
|
|
193
|
+
<td class="col-md-9">
|
|
194
|
+
<ul class="index-list">
|
|
195
|
+
<li>
|
|
196
|
+
<a href="#isAuthenticated" class="reference-link ">
|
|
197
|
+
<span class="reference-badge reference-badge--method" aria-hidden="true">M</span><span class="reference-link-label">isAuthenticated</span>
|
|
198
|
+
</a>
|
|
199
|
+
</li>
|
|
200
|
+
<li>
|
|
201
|
+
<a href="#signOut" class="reference-link ">
|
|
202
|
+
<span class="reference-badge reference-badge--method" aria-hidden="true">M</span><span class="reference-link-label">signOut</span>
|
|
203
|
+
</a>
|
|
204
|
+
</li>
|
|
205
|
+
</ul>
|
|
206
|
+
</td>
|
|
207
|
+
</tr>
|
|
208
|
+
</tbody>
|
|
209
|
+
</table>
|
|
210
|
+
</section>
|
|
184
211
|
|
|
185
|
-
|
|
212
|
+
<section data-compodoc="block-methods">
|
|
186
213
|
|
|
187
214
|
<h3 id="methods">
|
|
188
215
|
Methods
|
|
@@ -263,76 +290,89 @@
|
|
|
263
290
|
</table>
|
|
264
291
|
</section>
|
|
265
292
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
293
|
+
|
|
294
|
+
<section data-compodoc="block-properties">
|
|
295
|
+
<h3 id="inputs">Properties</h3>
|
|
296
|
+
<table class="table table-sm table-bordered">
|
|
297
|
+
<tbody>
|
|
298
|
+
<tr>
|
|
299
|
+
<td class="col-md-4">
|
|
300
|
+
<a name="events$"></a>
|
|
301
|
+
<span class="name "><b>events$</b>
|
|
302
|
+
<a href="#events$">
|
|
303
|
+
<span class="icon ion-ios-link"></span>
|
|
304
|
+
</a>
|
|
305
|
+
</span>
|
|
306
|
+
</td>
|
|
307
|
+
</tr>
|
|
308
|
+
<tr>
|
|
309
|
+
<td class="col-md-4">
|
|
310
|
+
<code>events$: <code><a href="../interfaces/AuthenticationEvent.html" target="_self" >Observable<AuthenticationEvent></a></code>
|
|
283
311
|
</code>
|
|
284
|
-
|
|
285
|
-
|
|
312
|
+
</td>
|
|
313
|
+
</tr>
|
|
314
|
+
|
|
286
315
|
|
|
316
|
+
<tr>
|
|
317
|
+
<td class="col-md-4">
|
|
318
|
+
<i>Type : </i> <code><a href="../interfaces/AuthenticationEvent.html" target="_self" >Observable<AuthenticationEvent></a></code>
|
|
287
319
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
<i>Type : </i> <code><a href="../interfaces/AuthenticationEvent.html" target="_self" >Observable<AuthenticationEvent></a></code>
|
|
320
|
+
</td>
|
|
321
|
+
</tr>
|
|
291
322
|
|
|
292
|
-
</td>
|
|
293
|
-
</tr>
|
|
294
323
|
|
|
295
324
|
|
|
296
325
|
|
|
297
326
|
|
|
327
|
+
<tr>
|
|
328
|
+
<td class="col-md-4">
|
|
329
|
+
<div class="io-line">Defined in <a href="" data-line="14" class="link-to-prism">src/lib/authentication.service.ts:14</a></div>
|
|
330
|
+
</td>
|
|
331
|
+
</tr>
|
|
298
332
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
333
|
+
</tbody>
|
|
334
|
+
</table>
|
|
335
|
+
<table class="table table-sm table-bordered">
|
|
336
|
+
<tbody>
|
|
337
|
+
<tr>
|
|
338
|
+
<td class="col-md-4">
|
|
339
|
+
<a name="isAuthenticated$"></a>
|
|
340
|
+
<span class="name "><b>isAuthenticated$</b>
|
|
341
|
+
<a href="#isAuthenticated$">
|
|
342
|
+
<span class="icon ion-ios-link"></span>
|
|
343
|
+
</a>
|
|
344
|
+
</span>
|
|
345
|
+
</td>
|
|
346
|
+
</tr>
|
|
347
|
+
<tr>
|
|
348
|
+
<td class="col-md-4">
|
|
349
|
+
<code>isAuthenticated$: <code>Observable<boolean | null></code>
|
|
316
350
|
</code>
|
|
317
|
-
|
|
318
|
-
|
|
351
|
+
</td>
|
|
352
|
+
</tr>
|
|
319
353
|
|
|
320
354
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
355
|
+
<tr>
|
|
356
|
+
<td class="col-md-4">
|
|
357
|
+
<i>Type : </i> <code>Observable<boolean | null></code>
|
|
324
358
|
|
|
325
|
-
|
|
326
|
-
|
|
359
|
+
</td>
|
|
360
|
+
</tr>
|
|
327
361
|
|
|
328
362
|
|
|
329
363
|
|
|
330
364
|
|
|
331
365
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
366
|
+
<tr>
|
|
367
|
+
<td class="col-md-4">
|
|
368
|
+
<div class="io-line">Defined in <a href="" data-line="13" class="link-to-prism">src/lib/authentication.service.ts:13</a></div>
|
|
369
|
+
</td>
|
|
370
|
+
</tr>
|
|
371
|
+
|
|
372
|
+
</tbody>
|
|
373
|
+
</table>
|
|
374
|
+
</section>
|
|
375
|
+
</div>
|
|
336
376
|
|
|
337
377
|
|
|
338
378
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
@@ -432,6 +472,24 @@ export class RxapAuthenticationService implements IAuthenticationService {
|
|
|
432
472
|
|
|
433
473
|
<script>
|
|
434
474
|
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
475
|
+
var updateDarkModeSwitchOffset = function () {
|
|
476
|
+
var content = document.querySelector('.content');
|
|
477
|
+
var scrollbarWidth = 0;
|
|
478
|
+
|
|
479
|
+
if (content) {
|
|
480
|
+
scrollbarWidth = Math.max(0, content.offsetWidth - content.clientWidth);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
document.documentElement.style.setProperty(
|
|
484
|
+
'--content-scrollbar-width',
|
|
485
|
+
scrollbarWidth + 'px'
|
|
486
|
+
);
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
updateDarkModeSwitchOffset();
|
|
490
|
+
requestAnimationFrame(updateDarkModeSwitchOffset);
|
|
491
|
+
window.addEventListener('resize', updateDarkModeSwitchOffset);
|
|
492
|
+
|
|
435
493
|
checkToggle(darkModeState);
|
|
436
494
|
if ($darkModeToggleSwitchers.length > 0) {
|
|
437
495
|
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
@@ -447,14 +505,12 @@ export class RxapAuthenticationService implements IAuthenticationService {
|
|
|
447
505
|
<script src="../js/libs/lit-html.js"></script>
|
|
448
506
|
|
|
449
507
|
<script src="../js/menu-wc.js" defer></script>
|
|
450
|
-
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
|
451
508
|
|
|
452
509
|
<script src="../js/libs/bootstrap-native.js"></script>
|
|
453
510
|
|
|
454
511
|
<script src="../js/libs/es6-shim.min.js"></script>
|
|
455
512
|
<script src="../js/libs/EventDispatcher.js"></script>
|
|
456
513
|
<script src="../js/libs/promise.min.js"></script>
|
|
457
|
-
<script src="../js/libs/zepto.min.js"></script>
|
|
458
514
|
|
|
459
515
|
<script src="../js/compodoc.js"></script>
|
|
460
516
|
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
2
|
+
var container = document.getElementById("architecture-graph");
|
|
3
|
+
if (!container) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
if (
|
|
7
|
+
typeof ARCHITECTURE_DEP_GRAPH === "undefined" ||
|
|
8
|
+
!ARCHITECTURE_DEP_GRAPH ||
|
|
9
|
+
!ARCHITECTURE_DEP_GRAPH.nodes
|
|
10
|
+
) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (typeof vis === "undefined" || !vis.Network) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var typeColors = {
|
|
18
|
+
component: "#10b39c",
|
|
19
|
+
directive: "#6747dd",
|
|
20
|
+
pipe: "#de3b91",
|
|
21
|
+
module: "#2973f0",
|
|
22
|
+
injectable: "#b77006",
|
|
23
|
+
};
|
|
24
|
+
var isDarkMode = function () {
|
|
25
|
+
return !!(document.body && document.body.classList.contains("dark"));
|
|
26
|
+
};
|
|
27
|
+
var getNodeTextColor = function () {
|
|
28
|
+
return isDarkMode() ? "#f0f0f0" : "#2d2d2d";
|
|
29
|
+
};
|
|
30
|
+
var getEdgeColor = function () {
|
|
31
|
+
return isDarkMode() ? "#b5b5b5" : "#8b8b8b";
|
|
32
|
+
};
|
|
33
|
+
var getEdgeOpacity = function () {
|
|
34
|
+
return isDarkMode() ? 0.8 : 0.65;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var allNodes = ARCHITECTURE_DEP_GRAPH.nodes.map(function (node) {
|
|
38
|
+
return {
|
|
39
|
+
id: node.id,
|
|
40
|
+
label: node.name,
|
|
41
|
+
type: node.type,
|
|
42
|
+
url: node.url,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
var allEdges = ARCHITECTURE_DEP_GRAPH.edges.map(function (edge) {
|
|
46
|
+
return {
|
|
47
|
+
from: edge.source,
|
|
48
|
+
to: edge.target,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
if (!allNodes.length || !allEdges.length) {
|
|
53
|
+
container.innerHTML =
|
|
54
|
+
'<p class="alert alert-warning">No dependency links to render.</p>';
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var degreeByNodeId = {};
|
|
59
|
+
allEdges.forEach(function (edge) {
|
|
60
|
+
degreeByNodeId[edge.from] = (degreeByNodeId[edge.from] || 0) + 1;
|
|
61
|
+
degreeByNodeId[edge.to] = (degreeByNodeId[edge.to] || 0) + 1;
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
allNodes = allNodes.map(function (node) {
|
|
65
|
+
var degree = degreeByNodeId[node.id] || 1;
|
|
66
|
+
return {
|
|
67
|
+
id: node.id,
|
|
68
|
+
label: node.label,
|
|
69
|
+
title: node.label + " (" + node.type + ")",
|
|
70
|
+
type: node.type,
|
|
71
|
+
url: node.url,
|
|
72
|
+
color: typeColors[node.type] || typeColors.module,
|
|
73
|
+
size: Math.min(30, 10 + degree * 1.3),
|
|
74
|
+
font: { color: getNodeTextColor(), size: 12 },
|
|
75
|
+
borderWidth: 1,
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
var activeTypes = {};
|
|
80
|
+
var knownTypes = ["component", "directive", "pipe", "module", "injectable"];
|
|
81
|
+
knownTypes.forEach(function (type) {
|
|
82
|
+
activeTypes[type] = true;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
var nodeById = {};
|
|
86
|
+
allNodes.forEach(function (node) {
|
|
87
|
+
nodeById[node.id] = node;
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
var network;
|
|
91
|
+
var currentScale = 1;
|
|
92
|
+
|
|
93
|
+
var applyGraphTheme = function () {
|
|
94
|
+
var textColor = getNodeTextColor();
|
|
95
|
+
var edgeColor = getEdgeColor();
|
|
96
|
+
var edgeOpacity = getEdgeOpacity();
|
|
97
|
+
|
|
98
|
+
for (var i = 0; i < allNodes.length; i++) {
|
|
99
|
+
allNodes[i].font = allNodes[i].font || {};
|
|
100
|
+
allNodes[i].font.color = textColor;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (network) {
|
|
104
|
+
network.setOptions({
|
|
105
|
+
edges: {
|
|
106
|
+
color: { color: edgeColor, opacity: edgeOpacity },
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
var getFilteredGraphData = function () {
|
|
113
|
+
var visibleNodes = allNodes.filter(function (node) {
|
|
114
|
+
return activeTypes[node.type];
|
|
115
|
+
});
|
|
116
|
+
var visibleNodeIds = {};
|
|
117
|
+
visibleNodes.forEach(function (node) {
|
|
118
|
+
visibleNodeIds[node.id] = true;
|
|
119
|
+
});
|
|
120
|
+
var visibleEdges = allEdges.filter(function (edge) {
|
|
121
|
+
return visibleNodeIds[edge.from] && visibleNodeIds[edge.to];
|
|
122
|
+
});
|
|
123
|
+
return { nodes: visibleNodes, edges: visibleEdges };
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
var renderFilteredGraph = function () {
|
|
127
|
+
var filtered = getFilteredGraphData();
|
|
128
|
+
network.setData({
|
|
129
|
+
nodes: new vis.DataSet(filtered.nodes),
|
|
130
|
+
edges: new vis.DataSet(filtered.edges),
|
|
131
|
+
});
|
|
132
|
+
network.stabilize(120);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
var options = {
|
|
136
|
+
autoResize: true,
|
|
137
|
+
layout: {
|
|
138
|
+
improvedLayout: true,
|
|
139
|
+
},
|
|
140
|
+
interaction: {
|
|
141
|
+
hover: true,
|
|
142
|
+
dragView: true,
|
|
143
|
+
zoomView: true,
|
|
144
|
+
},
|
|
145
|
+
physics: {
|
|
146
|
+
enabled: true,
|
|
147
|
+
stabilization: {
|
|
148
|
+
enabled: true,
|
|
149
|
+
iterations: 180,
|
|
150
|
+
fit: true,
|
|
151
|
+
},
|
|
152
|
+
barnesHut: {
|
|
153
|
+
gravitationalConstant: -6000,
|
|
154
|
+
centralGravity: 0.35,
|
|
155
|
+
springLength: 130,
|
|
156
|
+
springConstant: 0.02,
|
|
157
|
+
damping: 0.2,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
edges: {
|
|
161
|
+
arrows: { to: { enabled: true, scaleFactor: 0.6 } },
|
|
162
|
+
color: { color: getEdgeColor(), opacity: getEdgeOpacity() },
|
|
163
|
+
smooth: {
|
|
164
|
+
enabled: true,
|
|
165
|
+
type: "dynamic",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
nodes: {
|
|
169
|
+
shape: "dot",
|
|
170
|
+
scaling: {
|
|
171
|
+
min: 9,
|
|
172
|
+
max: 32,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
var initialData = getFilteredGraphData();
|
|
178
|
+
network = new vis.Network(
|
|
179
|
+
container,
|
|
180
|
+
{
|
|
181
|
+
nodes: new vis.DataSet(initialData.nodes),
|
|
182
|
+
edges: new vis.DataSet(initialData.edges),
|
|
183
|
+
},
|
|
184
|
+
options,
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
network.on("click", function (params) {
|
|
188
|
+
if (!params.nodes || params.nodes.length === 0) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
var node = nodeById[params.nodes[0]];
|
|
192
|
+
if (node && node.url) {
|
|
193
|
+
document.location.href = node.url;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
network.once("stabilizationIterationsDone", function () {
|
|
198
|
+
network.fit({ animation: { duration: 250, easingFunction: "easeOutQuad" } });
|
|
199
|
+
currentScale = 1;
|
|
200
|
+
});
|
|
201
|
+
applyGraphTheme();
|
|
202
|
+
|
|
203
|
+
var legendButtons = document.querySelectorAll("[data-architecture-filter]");
|
|
204
|
+
var updateLegendState = function () {
|
|
205
|
+
for (var i = 0; i < legendButtons.length; i++) {
|
|
206
|
+
var button = legendButtons[i];
|
|
207
|
+
var type = button.getAttribute("data-architecture-filter");
|
|
208
|
+
var active = !!activeTypes[type];
|
|
209
|
+
button.setAttribute("aria-pressed", active ? "true" : "false");
|
|
210
|
+
if (active) {
|
|
211
|
+
button.classList.remove("is-disabled");
|
|
212
|
+
} else {
|
|
213
|
+
button.classList.add("is-disabled");
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
for (var i = 0; i < legendButtons.length; i++) {
|
|
219
|
+
legendButtons[i].addEventListener("click", function (event) {
|
|
220
|
+
event.preventDefault();
|
|
221
|
+
var type = this.getAttribute("data-architecture-filter");
|
|
222
|
+
if (!type) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
activeTypes[type] = !activeTypes[type];
|
|
227
|
+
|
|
228
|
+
var activeCount = 0;
|
|
229
|
+
knownTypes.forEach(function (entry) {
|
|
230
|
+
if (activeTypes[entry]) {
|
|
231
|
+
activeCount += 1;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
if (activeCount === 0) {
|
|
235
|
+
knownTypes.forEach(function (entry) {
|
|
236
|
+
activeTypes[entry] = true;
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
updateLegendState();
|
|
241
|
+
renderFilteredGraph();
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
updateLegendState();
|
|
245
|
+
|
|
246
|
+
var zoomIn = document.getElementById("architecture-zoom-in");
|
|
247
|
+
var zoomOut = document.getElementById("architecture-zoom-out");
|
|
248
|
+
var reset = document.getElementById("architecture-reset");
|
|
249
|
+
|
|
250
|
+
if (zoomIn) {
|
|
251
|
+
zoomIn.addEventListener("click", function (ev) {
|
|
252
|
+
ev.preventDefault();
|
|
253
|
+
currentScale = Math.min(4, currentScale * 1.25);
|
|
254
|
+
network.moveTo({
|
|
255
|
+
scale: currentScale,
|
|
256
|
+
animation: { duration: 160, easingFunction: "easeOutQuad" },
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
if (zoomOut) {
|
|
261
|
+
zoomOut.addEventListener("click", function (ev) {
|
|
262
|
+
ev.preventDefault();
|
|
263
|
+
currentScale = Math.max(0.2, currentScale / 1.25);
|
|
264
|
+
network.moveTo({
|
|
265
|
+
scale: currentScale,
|
|
266
|
+
animation: { duration: 160, easingFunction: "easeOutQuad" },
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
if (reset) {
|
|
271
|
+
reset.addEventListener("click", function (ev) {
|
|
272
|
+
ev.preventDefault();
|
|
273
|
+
network.fit({ animation: { duration: 180, easingFunction: "easeOutQuad" } });
|
|
274
|
+
currentScale = 1;
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (window.MutationObserver && document.body) {
|
|
279
|
+
var bodyThemeObserver = new MutationObserver(function () {
|
|
280
|
+
applyGraphTheme();
|
|
281
|
+
renderFilteredGraph();
|
|
282
|
+
});
|
|
283
|
+
bodyThemeObserver.observe(document.body, {
|
|
284
|
+
attributes: true,
|
|
285
|
+
attributeFilter: ["class"],
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
});
|