@covalent/markdown-navigator 4.0.0-beta.1 → 4.1.1-beta.3
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/README.md +4 -222
- package/covalent-markdown-navigator.d.ts +1 -1
- package/esm2020/covalent-markdown-navigator.mjs +2 -2
- package/esm2020/markdown-navigator-window/markdown-navigator-window.component.mjs +48 -55
- package/esm2020/markdown-navigator-window-directive/markdown-navigator-window.directive.mjs +18 -20
- package/esm2020/markdown-navigator-window-service/markdown-navigator-window.service.mjs +30 -29
- package/esm2020/markdown-navigator.component.mjs +111 -304
- package/esm2020/markdown-navigator.module.mjs +45 -34
- package/esm2020/public_api.mjs +6 -0
- package/fesm2015/covalent-markdown-navigator.mjs +169 -426
- package/fesm2015/covalent-markdown-navigator.mjs.map +1 -1
- package/fesm2020/covalent-markdown-navigator.mjs +244 -434
- package/fesm2020/covalent-markdown-navigator.mjs.map +1 -1
- package/markdown-navigator-window/markdown-navigator-window.component.d.ts +12 -12
- package/markdown-navigator-window-directive/markdown-navigator-window.directive.d.ts +1 -1
- package/markdown-navigator.component.d.ts +18 -18
- package/package.json +22 -40
- package/{public-api.d.ts → public_api.d.ts} +0 -0
- package/src/README.md +237 -0
- package/esm2020/index.mjs +0 -2
- package/esm2020/public-api.mjs +0 -6
- package/index.d.ts +0 -1
- package/markdown-navigator-window/markdown-navigator-window.component.scss +0 -9
- package/markdown-navigator.component.scss +0 -55
|
@@ -1,303 +1,37 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { EventEmitter, SecurityContext, Component, ChangeDetectionStrategy, Input, Output, ViewChild, HostListener, Injectable, Inject, Directive, NgModule } from '@angular/core';
|
|
3
|
-
import * as
|
|
3
|
+
import * as i11 from '@angular/common';
|
|
4
4
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
5
5
|
import { __awaiter } from 'tslib';
|
|
6
6
|
import * as i1 from '@covalent/markdown';
|
|
7
|
-
import {
|
|
7
|
+
import { isAnchorLink, removeLeadingHash } from '@covalent/markdown';
|
|
8
|
+
import { firstValueFrom } from 'rxjs';
|
|
8
9
|
import * as i2 from '@angular/platform-browser';
|
|
9
10
|
import * as i3 from '@angular/common/http';
|
|
10
|
-
import * as
|
|
11
|
+
import * as i4 from '@angular/material/progress-bar';
|
|
11
12
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
12
|
-
import * as
|
|
13
|
+
import * as i5 from '@angular/material/button';
|
|
13
14
|
import { MatButtonModule } from '@angular/material/button';
|
|
14
|
-
import * as
|
|
15
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
16
|
-
import * as i8 from '@angular/material/icon';
|
|
15
|
+
import * as i6 from '@angular/material/icon';
|
|
17
16
|
import { MatIconModule } from '@angular/material/icon';
|
|
18
|
-
import * as
|
|
19
|
-
import * as
|
|
17
|
+
import * as i7 from '@angular/material/divider';
|
|
18
|
+
import * as i8 from '@covalent/core/message';
|
|
20
19
|
import { CovalentMessageModule } from '@covalent/core/message';
|
|
21
|
-
import * as
|
|
20
|
+
import * as i9 from '@covalent/flavored-markdown';
|
|
22
21
|
import { CovalentFlavoredMarkdownModule } from '@covalent/flavored-markdown';
|
|
23
|
-
import * as
|
|
22
|
+
import * as i10 from '@angular/material/list';
|
|
24
23
|
import { MatListModule } from '@angular/material/list';
|
|
24
|
+
import * as i12 from '@angular/material/tooltip';
|
|
25
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
25
26
|
import * as i13 from '@angular/material/core';
|
|
26
27
|
import * as i1$1 from '@covalent/core/dialogs';
|
|
27
28
|
import { ResizableDraggableDialog, CovalentDialogsModule } from '@covalent/core/dialogs';
|
|
28
29
|
|
|
29
|
-
const _c0 = ["markdownWrapper"];
|
|
30
|
-
function TdMarkdownNavigatorComponent_ng_container_0_mat_progress_bar_1_Template(rf, ctx) {
|
|
31
|
-
if (rf & 1) {
|
|
32
|
-
i0.ɵɵelement(0, "mat-progress-bar", 8);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_2_Template(rf, ctx) {
|
|
36
|
-
if (rf & 1) {
|
|
37
|
-
const _r12 = i0.ɵɵgetCurrentView();
|
|
38
|
-
i0.ɵɵelementStart(0, "button", 12);
|
|
39
|
-
i0.ɵɵlistener("click", function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(3); return ctx_r11.reset(); });
|
|
40
|
-
i0.ɵɵelementStart(1, "mat-icon");
|
|
41
|
-
i0.ɵɵtext(2, "home");
|
|
42
|
-
i0.ɵɵelementEnd();
|
|
43
|
-
i0.ɵɵelementEnd();
|
|
44
|
-
}
|
|
45
|
-
if (rf & 2) {
|
|
46
|
-
const ctx_r8 = i0.ɵɵnextContext(3);
|
|
47
|
-
i0.ɵɵproperty("matTooltip", ctx_r8.goHomeLabel);
|
|
48
|
-
i0.ɵɵattribute("data-test", "home-button");
|
|
49
|
-
i0.ɵɵadvance(1);
|
|
50
|
-
i0.ɵɵattribute("aria-label", ctx_r8.goHomeLabel);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_3_Template(rf, ctx) {
|
|
54
|
-
if (rf & 1) {
|
|
55
|
-
const _r14 = i0.ɵɵgetCurrentView();
|
|
56
|
-
i0.ɵɵelementStart(0, "button", 13);
|
|
57
|
-
i0.ɵɵlistener("click", function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_3_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r14); const ctx_r13 = i0.ɵɵnextContext(3); return ctx_r13.goBack(); });
|
|
58
|
-
i0.ɵɵelementStart(1, "mat-icon");
|
|
59
|
-
i0.ɵɵtext(2, "arrow_back");
|
|
60
|
-
i0.ɵɵelementEnd();
|
|
61
|
-
i0.ɵɵelementEnd();
|
|
62
|
-
}
|
|
63
|
-
if (rf & 2) {
|
|
64
|
-
const ctx_r9 = i0.ɵɵnextContext(3);
|
|
65
|
-
i0.ɵɵproperty("matTooltip", ctx_r9.goBackLabel);
|
|
66
|
-
i0.ɵɵattribute("data-test", "back-button");
|
|
67
|
-
i0.ɵɵadvance(1);
|
|
68
|
-
i0.ɵɵattribute("aria-label", ctx_r9.goBackLabel);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_span_4_Template(rf, ctx) {
|
|
72
|
-
if (rf & 1) {
|
|
73
|
-
i0.ɵɵelementStart(0, "span", 14);
|
|
74
|
-
i0.ɵɵtext(1);
|
|
75
|
-
i0.ɵɵelementEnd();
|
|
76
|
-
}
|
|
77
|
-
if (rf & 2) {
|
|
78
|
-
const ctx_r10 = i0.ɵɵnextContext(3);
|
|
79
|
-
i0.ɵɵattribute("data-test", "title");
|
|
80
|
-
i0.ɵɵadvance(1);
|
|
81
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r10.currentItemTitle, " ");
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_Template(rf, ctx) {
|
|
85
|
-
if (rf & 1) {
|
|
86
|
-
i0.ɵɵelementContainerStart(0);
|
|
87
|
-
i0.ɵɵelementStart(1, "div");
|
|
88
|
-
i0.ɵɵtemplate(2, TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_2_Template, 3, 3, "button", 9);
|
|
89
|
-
i0.ɵɵtemplate(3, TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_button_3_Template, 3, 3, "button", 10);
|
|
90
|
-
i0.ɵɵtemplate(4, TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_span_4_Template, 2, 2, "span", 11);
|
|
91
|
-
i0.ɵɵelementEnd();
|
|
92
|
-
i0.ɵɵelement(5, "mat-divider");
|
|
93
|
-
i0.ɵɵelementContainerEnd();
|
|
94
|
-
}
|
|
95
|
-
if (rf & 2) {
|
|
96
|
-
const ctx_r3 = i0.ɵɵnextContext(2);
|
|
97
|
-
i0.ɵɵadvance(1);
|
|
98
|
-
i0.ɵɵstyleProp("display", "flex");
|
|
99
|
-
i0.ɵɵadvance(1);
|
|
100
|
-
i0.ɵɵproperty("ngIf", ctx_r3.showHomeButton);
|
|
101
|
-
i0.ɵɵadvance(1);
|
|
102
|
-
i0.ɵɵproperty("ngIf", ctx_r3.showGoBackButton);
|
|
103
|
-
i0.ɵɵadvance(1);
|
|
104
|
-
i0.ɵɵproperty("ngIf", ctx_r3.currentItemTitle);
|
|
105
|
-
i0.ɵɵadvance(1);
|
|
106
|
-
i0.ɵɵstyleProp("position", "relative");
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function TdMarkdownNavigatorComponent_ng_container_0_div_4_td_message_2_Template(rf, ctx) {
|
|
110
|
-
if (rf & 1) {
|
|
111
|
-
i0.ɵɵelement(0, "td-message", 19);
|
|
112
|
-
}
|
|
113
|
-
if (rf & 2) {
|
|
114
|
-
const ctx_r16 = i0.ɵɵnextContext(3);
|
|
115
|
-
i0.ɵɵproperty("sublabel", ctx_r16.markdownLoaderError);
|
|
116
|
-
i0.ɵɵattribute("data-test", "markdown-loader-error");
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
function TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_loader_3_Template(rf, ctx) {
|
|
120
|
-
if (rf & 1) {
|
|
121
|
-
const _r20 = i0.ɵɵgetCurrentView();
|
|
122
|
-
i0.ɵɵelementStart(0, "td-flavored-markdown-loader", 20);
|
|
123
|
-
i0.ɵɵlistener("loadFailed", function TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_loader_3_Template_td_flavored_markdown_loader_loadFailed_0_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r19 = i0.ɵɵnextContext(3); return ctx_r19.handleMarkdownLoaderError($event); });
|
|
124
|
-
i0.ɵɵelementEnd();
|
|
125
|
-
}
|
|
126
|
-
if (rf & 2) {
|
|
127
|
-
const ctx_r17 = i0.ɵɵnextContext(3);
|
|
128
|
-
i0.ɵɵproperty("url", ctx_r17.url)("httpOptions", ctx_r17.httpOptions)("anchor", ctx_r17.anchor)("copyCodeToClipboard", ctx_r17.copyCodeToClipboard)("copyCodeTooltips", ctx_r17.copyCodeTooltips);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
function TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_4_Template(rf, ctx) {
|
|
132
|
-
if (rf & 1) {
|
|
133
|
-
const _r22 = i0.ɵɵgetCurrentView();
|
|
134
|
-
i0.ɵɵelementStart(0, "td-flavored-markdown", 21);
|
|
135
|
-
i0.ɵɵlistener("buttonClicked", function TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_4_Template_td_flavored_markdown_buttonClicked_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r21 = i0.ɵɵnextContext(3); return ctx_r21.buttonClicked.emit($event); });
|
|
136
|
-
i0.ɵɵelementEnd();
|
|
137
|
-
}
|
|
138
|
-
if (rf & 2) {
|
|
139
|
-
const ctx_r18 = i0.ɵɵnextContext(3);
|
|
140
|
-
i0.ɵɵproperty("content", ctx_r18.markdownString)("hostedUrl", ctx_r18.url)("anchor", ctx_r18.anchor)("copyCodeToClipboard", ctx_r18.copyCodeToClipboard)("copyCodeTooltips", ctx_r18.copyCodeTooltips);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
function TdMarkdownNavigatorComponent_ng_container_0_div_4_Template(rf, ctx) {
|
|
144
|
-
if (rf & 1) {
|
|
145
|
-
i0.ɵɵelementStart(0, "div", 15, 16);
|
|
146
|
-
i0.ɵɵtemplate(2, TdMarkdownNavigatorComponent_ng_container_0_div_4_td_message_2_Template, 1, 2, "td-message", 5);
|
|
147
|
-
i0.ɵɵtemplate(3, TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_loader_3_Template, 1, 5, "td-flavored-markdown-loader", 17);
|
|
148
|
-
i0.ɵɵtemplate(4, TdMarkdownNavigatorComponent_ng_container_0_div_4_td_flavored_markdown_4_Template, 1, 5, "td-flavored-markdown", 18);
|
|
149
|
-
i0.ɵɵelementEnd();
|
|
150
|
-
}
|
|
151
|
-
if (rf & 2) {
|
|
152
|
-
const ctx_r4 = i0.ɵɵnextContext(2);
|
|
153
|
-
i0.ɵɵadvance(2);
|
|
154
|
-
i0.ɵɵproperty("ngIf", ctx_r4.markdownLoaderError);
|
|
155
|
-
i0.ɵɵadvance(1);
|
|
156
|
-
i0.ɵɵproperty("ngIf", ctx_r4.showTdMarkdownLoader);
|
|
157
|
-
i0.ɵɵadvance(1);
|
|
158
|
-
i0.ɵɵproperty("ngIf", ctx_r4.showTdMarkdown);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
function TdMarkdownNavigatorComponent_ng_container_0_td_message_5_Template(rf, ctx) {
|
|
162
|
-
if (rf & 1) {
|
|
163
|
-
i0.ɵɵelement(0, "td-message", 19);
|
|
164
|
-
}
|
|
165
|
-
if (rf & 2) {
|
|
166
|
-
const ctx_r5 = i0.ɵɵnextContext(2);
|
|
167
|
-
i0.ɵɵproperty("sublabel", ctx_r5.childrenUrlError);
|
|
168
|
-
i0.ɵɵattribute("data-test", "children-url-error");
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
function TdMarkdownNavigatorComponent_ng_container_0_div_6_button_2_Template(rf, ctx) {
|
|
172
|
-
if (rf & 1) {
|
|
173
|
-
const _r27 = i0.ɵɵgetCurrentView();
|
|
174
|
-
i0.ɵɵelementStart(0, "button", 24);
|
|
175
|
-
i0.ɵɵlistener("click", function TdMarkdownNavigatorComponent_ng_container_0_div_6_button_2_Template_button_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r27); const item_r24 = restoredCtx.$implicit; const ctx_r26 = i0.ɵɵnextContext(3); return ctx_r26.handleItemSelected(item_r24); });
|
|
176
|
-
i0.ɵɵelementStart(1, "mat-icon", 25);
|
|
177
|
-
i0.ɵɵtext(2);
|
|
178
|
-
i0.ɵɵelementEnd();
|
|
179
|
-
i0.ɵɵelementStart(3, "span", 26);
|
|
180
|
-
i0.ɵɵtext(4);
|
|
181
|
-
i0.ɵɵelementEnd();
|
|
182
|
-
i0.ɵɵelementStart(5, "span", 26);
|
|
183
|
-
i0.ɵɵtext(6);
|
|
184
|
-
i0.ɵɵelementEnd();
|
|
185
|
-
i0.ɵɵelement(7, "mat-divider");
|
|
186
|
-
i0.ɵɵelementEnd();
|
|
187
|
-
}
|
|
188
|
-
if (rf & 2) {
|
|
189
|
-
const item_r24 = ctx.$implicit;
|
|
190
|
-
const index_r25 = ctx.index;
|
|
191
|
-
const ctx_r23 = i0.ɵɵnextContext(3);
|
|
192
|
-
i0.ɵɵproperty("id", "td-markdown-navigator-list-item-" + (item_r24.id ? item_r24.id : index_r25))("matTooltip", ctx_r23.getTitle(item_r24));
|
|
193
|
-
i0.ɵɵadvance(2);
|
|
194
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r23.getIcon(item_r24), " ");
|
|
195
|
-
i0.ɵɵadvance(2);
|
|
196
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r23.getTitle(item_r24), " ");
|
|
197
|
-
i0.ɵɵadvance(2);
|
|
198
|
-
i0.ɵɵtextInterpolate(item_r24.description);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
function TdMarkdownNavigatorComponent_ng_container_0_div_6_Template(rf, ctx) {
|
|
202
|
-
if (rf & 1) {
|
|
203
|
-
i0.ɵɵelementStart(0, "div", 22);
|
|
204
|
-
i0.ɵɵelementStart(1, "mat-action-list");
|
|
205
|
-
i0.ɵɵtemplate(2, TdMarkdownNavigatorComponent_ng_container_0_div_6_button_2_Template, 8, 5, "button", 23);
|
|
206
|
-
i0.ɵɵelementEnd();
|
|
207
|
-
i0.ɵɵelementEnd();
|
|
208
|
-
}
|
|
209
|
-
if (rf & 2) {
|
|
210
|
-
const ctx_r6 = i0.ɵɵnextContext(2);
|
|
211
|
-
i0.ɵɵadvance(2);
|
|
212
|
-
i0.ɵɵproperty("ngForOf", ctx_r6.currentMenuItems);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
function TdMarkdownNavigatorComponent_ng_container_0_ng_container_7_Template(rf, ctx) {
|
|
216
|
-
if (rf & 1) {
|
|
217
|
-
i0.ɵɵelementContainer(0);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
function TdMarkdownNavigatorComponent_ng_container_0_Template(rf, ctx) {
|
|
221
|
-
if (rf & 1) {
|
|
222
|
-
i0.ɵɵelementContainerStart(0);
|
|
223
|
-
i0.ɵɵtemplate(1, TdMarkdownNavigatorComponent_ng_container_0_mat_progress_bar_1_Template, 1, 0, "mat-progress-bar", 2);
|
|
224
|
-
i0.ɵɵtemplate(2, TdMarkdownNavigatorComponent_ng_container_0_ng_container_2_Template, 6, 7, "ng-container", 0);
|
|
225
|
-
i0.ɵɵelementStart(3, "div", 3);
|
|
226
|
-
i0.ɵɵtemplate(4, TdMarkdownNavigatorComponent_ng_container_0_div_4_Template, 5, 3, "div", 4);
|
|
227
|
-
i0.ɵɵtemplate(5, TdMarkdownNavigatorComponent_ng_container_0_td_message_5_Template, 1, 2, "td-message", 5);
|
|
228
|
-
i0.ɵɵtemplate(6, TdMarkdownNavigatorComponent_ng_container_0_div_6_Template, 3, 1, "div", 6);
|
|
229
|
-
i0.ɵɵtemplate(7, TdMarkdownNavigatorComponent_ng_container_0_ng_container_7_Template, 1, 0, "ng-container", 7);
|
|
230
|
-
i0.ɵɵelementEnd();
|
|
231
|
-
i0.ɵɵelementContainerEnd();
|
|
232
|
-
}
|
|
233
|
-
if (rf & 2) {
|
|
234
|
-
const ctx_r0 = i0.ɵɵnextContext();
|
|
235
|
-
i0.ɵɵadvance(1);
|
|
236
|
-
i0.ɵɵproperty("ngIf", ctx_r0.loading);
|
|
237
|
-
i0.ɵɵadvance(1);
|
|
238
|
-
i0.ɵɵproperty("ngIf", ctx_r0.showHeader);
|
|
239
|
-
i0.ɵɵadvance(2);
|
|
240
|
-
i0.ɵɵproperty("ngIf", ctx_r0.showTdMarkdownLoader || ctx_r0.showTdMarkdown);
|
|
241
|
-
i0.ɵɵadvance(1);
|
|
242
|
-
i0.ɵɵproperty("ngIf", ctx_r0.childrenUrlError);
|
|
243
|
-
i0.ɵɵadvance(1);
|
|
244
|
-
i0.ɵɵproperty("ngIf", ctx_r0.showMenu);
|
|
245
|
-
i0.ɵɵadvance(1);
|
|
246
|
-
i0.ɵɵproperty("ngComponentOutlet", ctx_r0.footerComponent);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
function TdMarkdownNavigatorComponent_div_1_Template(rf, ctx) {
|
|
250
|
-
if (rf & 1) {
|
|
251
|
-
i0.ɵɵelementStart(0, "div", 27);
|
|
252
|
-
i0.ɵɵelementStart(1, "mat-icon", 28);
|
|
253
|
-
i0.ɵɵtext(2, "subject");
|
|
254
|
-
i0.ɵɵelementEnd();
|
|
255
|
-
i0.ɵɵelementStart(3, "h2");
|
|
256
|
-
i0.ɵɵtext(4);
|
|
257
|
-
i0.ɵɵelementEnd();
|
|
258
|
-
i0.ɵɵelementEnd();
|
|
259
|
-
}
|
|
260
|
-
if (rf & 2) {
|
|
261
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
262
|
-
i0.ɵɵadvance(4);
|
|
263
|
-
i0.ɵɵtextInterpolate(ctx_r1.emptyStateLabel);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
30
|
const DEFAULT_MARKDOWN_NAVIGATOR_LABELS = {
|
|
267
31
|
goHome: 'Go home',
|
|
268
32
|
goBack: 'Go back',
|
|
269
33
|
emptyState: 'No item(s) to display',
|
|
270
34
|
};
|
|
271
|
-
function getTitleFromUrl(url) {
|
|
272
|
-
if (url) {
|
|
273
|
-
const temp = new URL(url);
|
|
274
|
-
if (temp.hash) {
|
|
275
|
-
return removeLeadingHash(temp.hash);
|
|
276
|
-
}
|
|
277
|
-
else {
|
|
278
|
-
const path = temp.pathname.split('/');
|
|
279
|
-
const fileName = path[path.length - 1];
|
|
280
|
-
return fileName.replace(/\.[^/.]+$/, ''); // remove .md
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return undefined;
|
|
284
|
-
}
|
|
285
|
-
function getTitleFromMarkdownString(markdownString) {
|
|
286
|
-
if (markdownString) {
|
|
287
|
-
const firstLine = markdownString.split(/[\r\n]+/).find((line) => !!line);
|
|
288
|
-
return removeLeadingHash(firstLine).trim();
|
|
289
|
-
}
|
|
290
|
-
return undefined;
|
|
291
|
-
}
|
|
292
|
-
function isMarkdownHref(anchor) {
|
|
293
|
-
return !isAnchorLink(anchor) && anchor.pathname.endsWith('.md');
|
|
294
|
-
}
|
|
295
|
-
function defaultCompareWith(o1, o2) {
|
|
296
|
-
if (o1.id && o2.id) {
|
|
297
|
-
return o1.id === o2.id;
|
|
298
|
-
}
|
|
299
|
-
return o1 === o2;
|
|
300
|
-
}
|
|
301
35
|
class TdMarkdownNavigatorComponent {
|
|
302
36
|
constructor(_markdownUrlLoaderService, _changeDetectorRef, _sanitizer, _http) {
|
|
303
37
|
this._markdownUrlLoaderService = _markdownUrlLoaderService;
|
|
@@ -324,7 +58,8 @@ class TdMarkdownNavigatorComponent {
|
|
|
324
58
|
}
|
|
325
59
|
clickListener(event) {
|
|
326
60
|
const element = event.srcElement;
|
|
327
|
-
if (element.matches('a[href]') &&
|
|
61
|
+
if (element.matches('a[href]') &&
|
|
62
|
+
isMarkdownHref(element)) {
|
|
328
63
|
this.handleLinkClick(event);
|
|
329
64
|
}
|
|
330
65
|
}
|
|
@@ -335,16 +70,19 @@ class TdMarkdownNavigatorComponent {
|
|
|
335
70
|
return this.historyStack.length > 1;
|
|
336
71
|
}
|
|
337
72
|
get showHeader() {
|
|
338
|
-
return this.showHomeButton || this.showGoBackButton || !!this.currentItemTitle;
|
|
73
|
+
return (this.showHomeButton || this.showGoBackButton || !!this.currentItemTitle);
|
|
339
74
|
}
|
|
340
75
|
get showMenu() {
|
|
341
|
-
|
|
76
|
+
const showMenu = this.currentMenuItems && this.currentMenuItems.length > 0;
|
|
77
|
+
return showMenu !== null && showMenu !== void 0 ? showMenu : false;
|
|
342
78
|
}
|
|
343
79
|
get showTdMarkdownLoader() {
|
|
344
|
-
return !!this.currentMarkdownItem &&
|
|
80
|
+
return (!!this.currentMarkdownItem &&
|
|
81
|
+
!!this.currentMarkdownItem.url &&
|
|
82
|
+
!this.showTdMarkdown);
|
|
345
83
|
}
|
|
346
84
|
get showTdMarkdown() {
|
|
347
|
-
return !!this.currentMarkdownItem && !!this.currentMarkdownItem.markdownString;
|
|
85
|
+
return (!!this.currentMarkdownItem && !!this.currentMarkdownItem.markdownString);
|
|
348
86
|
}
|
|
349
87
|
get url() {
|
|
350
88
|
if (this.currentMarkdownItem) {
|
|
@@ -362,28 +100,34 @@ class TdMarkdownNavigatorComponent {
|
|
|
362
100
|
if (this.currentMarkdownItem) {
|
|
363
101
|
return this.currentMarkdownItem.httpOptions;
|
|
364
102
|
}
|
|
103
|
+
return undefined;
|
|
365
104
|
}
|
|
366
105
|
get markdownString() {
|
|
367
106
|
if (this.currentMarkdownItem) {
|
|
368
107
|
return this.currentMarkdownItem.markdownString;
|
|
369
108
|
}
|
|
109
|
+
return undefined;
|
|
370
110
|
}
|
|
371
111
|
get anchor() {
|
|
372
112
|
if (this.currentMarkdownItem) {
|
|
373
113
|
return this.currentMarkdownItem.anchor;
|
|
374
114
|
}
|
|
115
|
+
return undefined;
|
|
375
116
|
}
|
|
376
117
|
get showEmptyState() {
|
|
377
118
|
return !this.items || this.items.length < 1;
|
|
378
119
|
}
|
|
379
120
|
get goHomeLabel() {
|
|
380
|
-
return (this.labels && this.labels.goHome) ||
|
|
121
|
+
return ((this.labels && this.labels.goHome) ||
|
|
122
|
+
DEFAULT_MARKDOWN_NAVIGATOR_LABELS.goHome);
|
|
381
123
|
}
|
|
382
124
|
get goBackLabel() {
|
|
383
|
-
return (this.labels && this.labels.goBack) ||
|
|
125
|
+
return ((this.labels && this.labels.goBack) ||
|
|
126
|
+
DEFAULT_MARKDOWN_NAVIGATOR_LABELS.goBack);
|
|
384
127
|
}
|
|
385
128
|
get emptyStateLabel() {
|
|
386
|
-
return (this.labels && this.labels.emptyState) ||
|
|
129
|
+
return ((this.labels && this.labels.emptyState) ||
|
|
130
|
+
DEFAULT_MARKDOWN_NAVIGATOR_LABELS.emptyState);
|
|
387
131
|
}
|
|
388
132
|
get currentItemTitle() {
|
|
389
133
|
if (this.historyStack.length < 1) {
|
|
@@ -399,10 +143,10 @@ class TdMarkdownNavigatorComponent {
|
|
|
399
143
|
}
|
|
400
144
|
ngOnChanges(changes) {
|
|
401
145
|
return __awaiter(this, void 0, void 0, function* () {
|
|
402
|
-
if (changes
|
|
146
|
+
if (changes['items']) {
|
|
403
147
|
this.reset();
|
|
404
148
|
}
|
|
405
|
-
if (changes
|
|
149
|
+
if (changes['startAt'] && this.items && this.startAt) {
|
|
406
150
|
this._jumpTo(this.startAt, undefined);
|
|
407
151
|
}
|
|
408
152
|
});
|
|
@@ -418,7 +162,9 @@ class TdMarkdownNavigatorComponent {
|
|
|
418
162
|
this.loading = false;
|
|
419
163
|
this.clearErrors();
|
|
420
164
|
// if single item and no children
|
|
421
|
-
if (this.items &&
|
|
165
|
+
if (this.items &&
|
|
166
|
+
this.items.length === 1 &&
|
|
167
|
+
!this.hasChildrenOrChildrenUrl(this.items[0])) {
|
|
422
168
|
this.currentMenuItems = [];
|
|
423
169
|
this.currentMarkdownItem = this.items[0];
|
|
424
170
|
}
|
|
@@ -434,7 +180,7 @@ class TdMarkdownNavigatorComponent {
|
|
|
434
180
|
this.clearErrors();
|
|
435
181
|
if (this.historyStack.length > 1) {
|
|
436
182
|
let parent = this.historyStack[this.historyStack.length - 2];
|
|
437
|
-
if (parent.startAtLink) {
|
|
183
|
+
if (parent === null || parent === void 0 ? void 0 : parent.startAtLink) {
|
|
438
184
|
parent = this.historyStack[this.historyStack.length - 3]
|
|
439
185
|
? this.historyStack[this.historyStack.length - 3]
|
|
440
186
|
: undefined;
|
|
@@ -488,10 +234,11 @@ class TdMarkdownNavigatorComponent {
|
|
|
488
234
|
});
|
|
489
235
|
}
|
|
490
236
|
loadChildrenUrl(item) {
|
|
237
|
+
var _a, _b;
|
|
491
238
|
return __awaiter(this, void 0, void 0, function* () {
|
|
492
|
-
const sanitizedUrl = this._sanitizer.sanitize(SecurityContext.URL, item.childrenUrl);
|
|
239
|
+
const sanitizedUrl = (_b = this._sanitizer.sanitize(SecurityContext.URL, (_a = item.childrenUrl) !== null && _a !== void 0 ? _a : null)) !== null && _b !== void 0 ? _b : '';
|
|
493
240
|
try {
|
|
494
|
-
return yield this._http.get(sanitizedUrl, Object.assign({}, item.httpOptions))
|
|
241
|
+
return yield firstValueFrom(this._http.get(sanitizedUrl, Object.assign({}, item.httpOptions)));
|
|
495
242
|
}
|
|
496
243
|
catch (error) {
|
|
497
244
|
this.handleChildrenUrlError(error);
|
|
@@ -500,25 +247,25 @@ class TdMarkdownNavigatorComponent {
|
|
|
500
247
|
});
|
|
501
248
|
}
|
|
502
249
|
getTitle(item) {
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
getTitleFromUrl(item.url) ||
|
|
507
|
-
getTitleFromMarkdownString(item.markdownString) ||
|
|
508
|
-
'').trim();
|
|
250
|
+
var _a, _b, _c;
|
|
251
|
+
if (!item) {
|
|
252
|
+
return '';
|
|
509
253
|
}
|
|
254
|
+
return (removeLeadingHash((_a = item.anchor) !== null && _a !== void 0 ? _a : '') ||
|
|
255
|
+
item.title ||
|
|
256
|
+
getTitleFromUrl((_b = item.url) !== null && _b !== void 0 ? _b : '') ||
|
|
257
|
+
getTitleFromMarkdownString((_c = item.markdownString) !== null && _c !== void 0 ? _c : '') ||
|
|
258
|
+
'').trim();
|
|
510
259
|
}
|
|
511
260
|
getIcon(item) {
|
|
512
|
-
|
|
513
|
-
return item.icon || 'subject';
|
|
514
|
-
}
|
|
261
|
+
return (item === null || item === void 0 ? void 0 : item.icon) || 'subject';
|
|
515
262
|
}
|
|
516
263
|
handleChildrenUrlError(error) {
|
|
517
264
|
this.childrenUrlError = error.message;
|
|
518
265
|
this._changeDetectorRef.markForCheck();
|
|
519
266
|
}
|
|
520
267
|
handleMarkdownLoaderError(error) {
|
|
521
|
-
this.markdownLoaderError = error.message;
|
|
268
|
+
this.markdownLoaderError = error ? error.message : '';
|
|
522
269
|
this._changeDetectorRef.markForCheck();
|
|
523
270
|
}
|
|
524
271
|
_jumpTo(itemOrPath, children) {
|
|
@@ -572,7 +319,7 @@ class TdMarkdownNavigatorComponent {
|
|
|
572
319
|
const compareWith = this.compareWith || defaultCompareWith;
|
|
573
320
|
if (items) {
|
|
574
321
|
for (const child of items) {
|
|
575
|
-
if (compareWith(child, item)) {
|
|
322
|
+
if (item && compareWith(child, item)) {
|
|
576
323
|
return [child];
|
|
577
324
|
}
|
|
578
325
|
const ancestors = this.findPath(child.children, item);
|
|
@@ -598,7 +345,7 @@ class TdMarkdownNavigatorComponent {
|
|
|
598
345
|
}
|
|
599
346
|
catch (error) {
|
|
600
347
|
const win = window.open(url.href, '_blank');
|
|
601
|
-
win.focus();
|
|
348
|
+
win === null || win === void 0 ? void 0 : win.focus();
|
|
602
349
|
}
|
|
603
350
|
finally {
|
|
604
351
|
this.loading = false;
|
|
@@ -607,35 +354,12 @@ class TdMarkdownNavigatorComponent {
|
|
|
607
354
|
});
|
|
608
355
|
}
|
|
609
356
|
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
i0.ɵɵviewQuery(_c0, 5);
|
|
614
|
-
}
|
|
615
|
-
if (rf & 2) {
|
|
616
|
-
let _t;
|
|
617
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.markdownWrapper = _t.first);
|
|
618
|
-
}
|
|
619
|
-
}, hostBindings: function TdMarkdownNavigatorComponent_HostBindings(rf, ctx) {
|
|
620
|
-
if (rf & 1) {
|
|
621
|
-
i0.ɵɵlistener("click", function TdMarkdownNavigatorComponent_click_HostBindingHandler($event) { return ctx.clickListener($event); });
|
|
622
|
-
}
|
|
623
|
-
}, inputs: { items: "items", labels: "labels", startAt: "startAt", copyCodeToClipboard: "copyCodeToClipboard", copyCodeTooltips: "copyCodeTooltips", footer: "footer", compareWith: "compareWith" }, outputs: { buttonClicked: "buttonClicked" }, features: [i0.ɵɵNgOnChangesFeature], decls: 2, vars: 2, consts: [[4, "ngIf"], ["layout", "column", "layout-align", "center center", "class", "empty-state", 4, "ngIf"], ["mode", "indeterminate", "color", "accent", 4, "ngIf"], ["id", "td-markdown-navigator-content", 1, "scroll-area"], ["class", "markdown-wrapper", 4, "ngIf"], ["color", "warn", "icon", "error", 3, "sublabel", 4, "ngIf"], ["class", "td-markdown-list", 4, "ngIf"], [4, "ngComponentOutlet"], ["mode", "indeterminate", "color", "accent"], ["id", "td-markdown-navigator-home-button", "mat-icon-button", "", 3, "matTooltip", "click", 4, "ngIf"], ["id", "td-markdown-navigator-back-button", "mat-icon-button", "", 3, "matTooltip", "click", 4, "ngIf"], ["flex", "", "class", "mat-body-2 title truncate", 4, "ngIf"], ["id", "td-markdown-navigator-home-button", "mat-icon-button", "", 3, "matTooltip", "click"], ["id", "td-markdown-navigator-back-button", "mat-icon-button", "", 3, "matTooltip", "click"], ["flex", "", 1, "mat-body-2", "title", "truncate"], [1, "markdown-wrapper"], ["markdownWrapper", ""], [3, "url", "httpOptions", "anchor", "copyCodeToClipboard", "copyCodeTooltips", "loadFailed", 4, "ngIf"], [3, "content", "hostedUrl", "anchor", "copyCodeToClipboard", "copyCodeTooltips", "buttonClicked", 4, "ngIf"], ["color", "warn", "icon", "error", 3, "sublabel"], [3, "url", "httpOptions", "anchor", "copyCodeToClipboard", "copyCodeTooltips", "loadFailed"], [3, "content", "hostedUrl", "anchor", "copyCodeToClipboard", "copyCodeTooltips", "buttonClicked"], [1, "td-markdown-list"], ["mat-list-item", "", "matTooltipPosition", "before", "matTooltipShowDelay", "500", 3, "id", "matTooltip", "click", 4, "ngFor", "ngForOf"], ["mat-list-item", "", "matTooltipPosition", "before", "matTooltipShowDelay", "500", 3, "id", "matTooltip", "click"], ["matListIcon", ""], ["matLine", "", 1, "truncate"], ["layout", "column", "layout-align", "center center", 1, "empty-state"], ["matListAvatar", ""]], template: function TdMarkdownNavigatorComponent_Template(rf, ctx) {
|
|
624
|
-
if (rf & 1) {
|
|
625
|
-
i0.ɵɵtemplate(0, TdMarkdownNavigatorComponent_ng_container_0_Template, 8, 6, "ng-container", 0);
|
|
626
|
-
i0.ɵɵtemplate(1, TdMarkdownNavigatorComponent_div_1_Template, 5, 1, "div", 1);
|
|
627
|
-
}
|
|
628
|
-
if (rf & 2) {
|
|
629
|
-
i0.ɵɵproperty("ngIf", !ctx.showEmptyState);
|
|
630
|
-
i0.ɵɵadvance(1);
|
|
631
|
-
i0.ɵɵproperty("ngIf", ctx.showEmptyState);
|
|
632
|
-
}
|
|
633
|
-
}, directives: [i4.NgIf, i5.MatProgressBar, i6.MatButton, i7.MatTooltip, i8.MatIcon, i9.MatDivider, i10.TdMessageComponent, i11.TdFlavoredMarkdownLoaderComponent, i11.TdFlavoredMarkdownComponent, i12.MatList, i4.NgForOf, i12.MatListItem, i12.MatListIconCssMatStyler, i13.MatLine, i4.NgComponentOutlet, i12.MatListAvatarCssMatStyler], styles: ["[_nghost-%COMP%]{position:relative;height:inherit;height:100%;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}[_nghost-%COMP%] .scroll-area[_ngcontent-%COMP%]{min-height:1px;overflow-y:auto;-ms-flex:1;flex:1;box-sizing:border-box}[_nghost-%COMP%] .markdown-wrapper[_ngcontent-%COMP%]{padding:16px 16px 0}[_nghost-%COMP%] .td-markdown-list[_ngcontent-%COMP%] > .mat-list[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] td-flavored-markdown-loader[_ngcontent-%COMP%] .mat-progress-bar{top:0;left:0;right:0;position:absolute}[_nghost-%COMP%] .title[_ngcontent-%COMP%]{display:inline-block;vertical-align:middle;margin:8px 0;padding-left:16px}.truncate[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.empty-state[_ngcontent-%COMP%]{padding:32px}.empty-state[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:4em}"], changeDetection: 0 });
|
|
634
|
-
(function () {
|
|
635
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownNavigatorComponent, [{
|
|
357
|
+
TdMarkdownNavigatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorComponent, deps: [{ token: i1.TdMarkdownLoaderService }, { token: i0.ChangeDetectorRef }, { token: i2.DomSanitizer }, { token: i3.HttpClient }], target: i0.ɵɵFactoryTarget.Component });
|
|
358
|
+
TdMarkdownNavigatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: TdMarkdownNavigatorComponent, selector: "td-markdown-navigator", inputs: { items: "items", labels: "labels", startAt: "startAt", copyCodeToClipboard: "copyCodeToClipboard", copyCodeTooltips: "copyCodeTooltips", footer: "footer", compareWith: "compareWith" }, outputs: { buttonClicked: "buttonClicked" }, host: { listeners: { "click": "clickListener($event)" } }, viewQueries: [{ propertyName: "markdownWrapper", first: true, predicate: ["markdownWrapper"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"!showEmptyState\">\n <mat-progress-bar\n *ngIf=\"loading\"\n mode=\"indeterminate\"\n color=\"accent\"\n ></mat-progress-bar>\n\n <ng-container *ngIf=\"showHeader\">\n <div [style.display]=\"'flex'\">\n <button\n id=\"td-markdown-navigator-home-button\"\n *ngIf=\"showHomeButton\"\n mat-icon-button\n [matTooltip]=\"goHomeLabel ?? ''\"\n (click)=\"reset()\"\n [attr.data-test]=\"'home-button'\"\n >\n <mat-icon [attr.aria-label]=\"goHomeLabel\">home</mat-icon>\n </button>\n\n <button\n id=\"td-markdown-navigator-back-button\"\n *ngIf=\"showGoBackButton\"\n mat-icon-button\n [matTooltip]=\"goBackLabel ?? ''\"\n (click)=\"goBack()\"\n [attr.data-test]=\"'back-button'\"\n >\n <mat-icon [attr.aria-label]=\"goBackLabel\">arrow_back</mat-icon>\n </button>\n <span\n flex\n *ngIf=\"currentItemTitle\"\n class=\"mat-body-2 title truncate\"\n [attr.data-test]=\"'title'\"\n >\n {{ currentItemTitle }}\n </span>\n </div>\n\n <mat-divider [style.position]=\"'relative'\"></mat-divider>\n </ng-container>\n\n <div class=\"scroll-area\" id=\"td-markdown-navigator-content\">\n <div\n *ngIf=\"showTdMarkdownLoader || showTdMarkdown\"\n class=\"markdown-wrapper\"\n #markdownWrapper\n >\n <td-message\n *ngIf=\"markdownLoaderError\"\n [sublabel]=\"markdownLoaderError\"\n color=\"warn\"\n icon=\"error\"\n [attr.data-test]=\"'markdown-loader-error'\"\n ></td-message>\n <td-flavored-markdown-loader\n *ngIf=\"showTdMarkdownLoader\"\n [url]=\"url ?? ''\"\n [httpOptions]=\"httpOptions ?? {}\"\n [anchor]=\"anchor ?? ''\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (loadFailed)=\"handleMarkdownLoaderError($event)\"\n ></td-flavored-markdown-loader>\n <td-flavored-markdown\n *ngIf=\"showTdMarkdown\"\n [content]=\"markdownString ?? ''\"\n [hostedUrl]=\"url ?? ''\"\n [anchor]=\"anchor ?? ''\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (buttonClicked)=\"buttonClicked.emit($event)\"\n ></td-flavored-markdown>\n </div>\n\n <td-message\n *ngIf=\"childrenUrlError\"\n [sublabel]=\"childrenUrlError\"\n color=\"warn\"\n icon=\"error\"\n [attr.data-test]=\"'children-url-error'\"\n ></td-message>\n <div *ngIf=\"showMenu\" class=\"td-markdown-list\">\n <mat-action-list>\n <button\n *ngFor=\"let item of currentMenuItems; index as index\"\n [id]=\"\n 'td-markdown-navigator-list-item-' + (item.id ? item.id : index)\n \"\n (click)=\"handleItemSelected(item)\"\n mat-list-item\n [matTooltip]=\"getTitle(item)\"\n matTooltipPosition=\"before\"\n matTooltipShowDelay=\"500\"\n >\n <mat-icon matListIcon>\n {{ getIcon(item) }}\n </mat-icon>\n <span matLine class=\"truncate\">\n {{ getTitle(item) }}\n </span>\n <span matLine class=\"truncate\">{{ item.description }}</span>\n <mat-divider></mat-divider>\n </button>\n </mat-action-list>\n </div>\n\n <ng-container *ngComponentOutlet=\"footerComponent\"></ng-container>\n </div>\n</ng-container>\n\n<div\n *ngIf=\"showEmptyState\"\n layout=\"column\"\n layout-align=\"center center\"\n class=\"empty-state\"\n>\n <mat-icon matListAvatar>subject</mat-icon>\n <h2>{{ emptyStateLabel }}</h2>\n</div>\n", styles: [":host{position:relative;height:inherit;height:100%;box-sizing:border-box;display:flex;flex-direction:column}:host .scroll-area{min-height:1px;overflow-y:auto;flex:1;box-sizing:border-box}:host .markdown-wrapper{padding:16px 16px 0}:host .td-markdown-list>.mat-list{padding-top:0}:host td-flavored-markdown-loader ::ng-deep .mat-progress-bar{top:0;left:0;right:0;position:absolute}:host .title{display:inline-block;vertical-align:middle;margin:8px 0;padding-left:16px}.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.empty-state{padding:32px}.empty-state mat-icon{font-size:4em}\n"], components: [{ type: i4.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i7.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { type: i8.TdMessageComponent, selector: "td-message", inputs: ["label", "sublabel", "icon", "color", "opened"] }, { type: i9.TdFlavoredMarkdownLoaderComponent, selector: "td-flavored-markdown-loader", inputs: ["url", "httpOptions", "anchor", "copyCodeToClipboard", "copyCodeTooltips"], outputs: ["contentReady", "loadFailed", "buttonClicked"] }, { type: i9.TdFlavoredMarkdownComponent, selector: "td-flavored-markdown", inputs: ["content", "simpleLineBreaks", "hostedUrl", "anchor", "copyCodeToClipboard", "copyCodeTooltips"], outputs: ["contentReady", "buttonClicked"] }, { type: i10.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { type: i10.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }], directives: [{ type: i11.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i12.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i11.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.MatListIconCssMatStyler, selector: "[mat-list-icon], [matListIcon]" }, { type: i13.MatLine, selector: "[mat-line], [matLine]" }, { type: i11.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModuleFactory"] }, { type: i10.MatListAvatarCssMatStyler, selector: "[mat-list-avatar], [matListAvatar]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
359
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorComponent, decorators: [{
|
|
636
360
|
type: Component,
|
|
637
|
-
args: [{ selector: 'td-markdown-navigator', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"!showEmptyState\">\n <mat-progress-bar
|
|
638
|
-
}], function () { return [{ type: i1.TdMarkdownLoaderService }, { type: i0.ChangeDetectorRef }, { type: i2.DomSanitizer }, { type: i3.HttpClient }]; }, { items: [{
|
|
361
|
+
args: [{ selector: 'td-markdown-navigator', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"!showEmptyState\">\n <mat-progress-bar\n *ngIf=\"loading\"\n mode=\"indeterminate\"\n color=\"accent\"\n ></mat-progress-bar>\n\n <ng-container *ngIf=\"showHeader\">\n <div [style.display]=\"'flex'\">\n <button\n id=\"td-markdown-navigator-home-button\"\n *ngIf=\"showHomeButton\"\n mat-icon-button\n [matTooltip]=\"goHomeLabel ?? ''\"\n (click)=\"reset()\"\n [attr.data-test]=\"'home-button'\"\n >\n <mat-icon [attr.aria-label]=\"goHomeLabel\">home</mat-icon>\n </button>\n\n <button\n id=\"td-markdown-navigator-back-button\"\n *ngIf=\"showGoBackButton\"\n mat-icon-button\n [matTooltip]=\"goBackLabel ?? ''\"\n (click)=\"goBack()\"\n [attr.data-test]=\"'back-button'\"\n >\n <mat-icon [attr.aria-label]=\"goBackLabel\">arrow_back</mat-icon>\n </button>\n <span\n flex\n *ngIf=\"currentItemTitle\"\n class=\"mat-body-2 title truncate\"\n [attr.data-test]=\"'title'\"\n >\n {{ currentItemTitle }}\n </span>\n </div>\n\n <mat-divider [style.position]=\"'relative'\"></mat-divider>\n </ng-container>\n\n <div class=\"scroll-area\" id=\"td-markdown-navigator-content\">\n <div\n *ngIf=\"showTdMarkdownLoader || showTdMarkdown\"\n class=\"markdown-wrapper\"\n #markdownWrapper\n >\n <td-message\n *ngIf=\"markdownLoaderError\"\n [sublabel]=\"markdownLoaderError\"\n color=\"warn\"\n icon=\"error\"\n [attr.data-test]=\"'markdown-loader-error'\"\n ></td-message>\n <td-flavored-markdown-loader\n *ngIf=\"showTdMarkdownLoader\"\n [url]=\"url ?? ''\"\n [httpOptions]=\"httpOptions ?? {}\"\n [anchor]=\"anchor ?? ''\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (loadFailed)=\"handleMarkdownLoaderError($event)\"\n ></td-flavored-markdown-loader>\n <td-flavored-markdown\n *ngIf=\"showTdMarkdown\"\n [content]=\"markdownString ?? ''\"\n [hostedUrl]=\"url ?? ''\"\n [anchor]=\"anchor ?? ''\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (buttonClicked)=\"buttonClicked.emit($event)\"\n ></td-flavored-markdown>\n </div>\n\n <td-message\n *ngIf=\"childrenUrlError\"\n [sublabel]=\"childrenUrlError\"\n color=\"warn\"\n icon=\"error\"\n [attr.data-test]=\"'children-url-error'\"\n ></td-message>\n <div *ngIf=\"showMenu\" class=\"td-markdown-list\">\n <mat-action-list>\n <button\n *ngFor=\"let item of currentMenuItems; index as index\"\n [id]=\"\n 'td-markdown-navigator-list-item-' + (item.id ? item.id : index)\n \"\n (click)=\"handleItemSelected(item)\"\n mat-list-item\n [matTooltip]=\"getTitle(item)\"\n matTooltipPosition=\"before\"\n matTooltipShowDelay=\"500\"\n >\n <mat-icon matListIcon>\n {{ getIcon(item) }}\n </mat-icon>\n <span matLine class=\"truncate\">\n {{ getTitle(item) }}\n </span>\n <span matLine class=\"truncate\">{{ item.description }}</span>\n <mat-divider></mat-divider>\n </button>\n </mat-action-list>\n </div>\n\n <ng-container *ngComponentOutlet=\"footerComponent\"></ng-container>\n </div>\n</ng-container>\n\n<div\n *ngIf=\"showEmptyState\"\n layout=\"column\"\n layout-align=\"center center\"\n class=\"empty-state\"\n>\n <mat-icon matListAvatar>subject</mat-icon>\n <h2>{{ emptyStateLabel }}</h2>\n</div>\n", styles: [":host{position:relative;height:inherit;height:100%;box-sizing:border-box;display:flex;flex-direction:column}:host .scroll-area{min-height:1px;overflow-y:auto;flex:1;box-sizing:border-box}:host .markdown-wrapper{padding:16px 16px 0}:host .td-markdown-list>.mat-list{padding-top:0}:host td-flavored-markdown-loader ::ng-deep .mat-progress-bar{top:0;left:0;right:0;position:absolute}:host .title{display:inline-block;vertical-align:middle;margin:8px 0;padding-left:16px}.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.empty-state{padding:32px}.empty-state mat-icon{font-size:4em}\n"] }]
|
|
362
|
+
}], ctorParameters: function () { return [{ type: i1.TdMarkdownLoaderService }, { type: i0.ChangeDetectorRef }, { type: i2.DomSanitizer }, { type: i3.HttpClient }]; }, propDecorators: { items: [{
|
|
639
363
|
type: Input
|
|
640
364
|
}], labels: [{
|
|
641
365
|
type: Input
|
|
@@ -657,8 +381,38 @@ class TdMarkdownNavigatorComponent {
|
|
|
657
381
|
}], clickListener: [{
|
|
658
382
|
type: HostListener,
|
|
659
383
|
args: ['click', ['$event']]
|
|
660
|
-
}] });
|
|
661
|
-
|
|
384
|
+
}] } });
|
|
385
|
+
function getTitleFromUrl(url) {
|
|
386
|
+
if (url) {
|
|
387
|
+
const temp = new URL(url);
|
|
388
|
+
if (temp.hash) {
|
|
389
|
+
return removeLeadingHash(temp.hash);
|
|
390
|
+
}
|
|
391
|
+
else {
|
|
392
|
+
const path = temp.pathname.split('/');
|
|
393
|
+
const fileName = path[path.length - 1];
|
|
394
|
+
return fileName.replace(/\.[^/.]+$/, ''); // remove .md
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return '';
|
|
398
|
+
}
|
|
399
|
+
function getTitleFromMarkdownString(markdownString) {
|
|
400
|
+
var _a;
|
|
401
|
+
if (markdownString) {
|
|
402
|
+
const firstLine = (_a = markdownString.split(/[\r\n]+/).find((line) => !!line)) !== null && _a !== void 0 ? _a : '';
|
|
403
|
+
return removeLeadingHash(firstLine).trim();
|
|
404
|
+
}
|
|
405
|
+
return '';
|
|
406
|
+
}
|
|
407
|
+
function isMarkdownHref(anchor) {
|
|
408
|
+
return !isAnchorLink(anchor) && anchor.pathname.endsWith('.md');
|
|
409
|
+
}
|
|
410
|
+
function defaultCompareWith(o1, o2) {
|
|
411
|
+
if (o1.id && o2.id) {
|
|
412
|
+
return o1.id === o2.id;
|
|
413
|
+
}
|
|
414
|
+
return o1 === o2;
|
|
415
|
+
}
|
|
662
416
|
|
|
663
417
|
const DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS = {
|
|
664
418
|
title: 'Help',
|
|
@@ -677,55 +431,44 @@ class TdMarkdownNavigatorWindowComponent {
|
|
|
677
431
|
this.buttonClicked = new EventEmitter();
|
|
678
432
|
}
|
|
679
433
|
get markdownNavigatorLabels() {
|
|
680
|
-
if (this.labels) {
|
|
681
|
-
|
|
682
|
-
return {
|
|
683
|
-
goHome,
|
|
684
|
-
goBack,
|
|
685
|
-
emptyState,
|
|
686
|
-
};
|
|
434
|
+
if (!this.labels) {
|
|
435
|
+
return undefined;
|
|
687
436
|
}
|
|
437
|
+
const { goHome, goBack, emptyState } = this.labels;
|
|
438
|
+
return {
|
|
439
|
+
goHome,
|
|
440
|
+
goBack,
|
|
441
|
+
emptyState,
|
|
442
|
+
};
|
|
688
443
|
}
|
|
689
444
|
get titleLabel() {
|
|
690
|
-
return (this.labels && this.labels.title) ||
|
|
445
|
+
return ((this.labels && this.labels.title) ||
|
|
446
|
+
DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.title);
|
|
691
447
|
}
|
|
692
448
|
get closeLabel() {
|
|
693
|
-
return (this.labels && this.labels.close) ||
|
|
449
|
+
return ((this.labels && this.labels.close) ||
|
|
450
|
+
DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.close);
|
|
694
451
|
}
|
|
695
452
|
get toggleDockedStateLabel() {
|
|
696
453
|
if (this.docked) {
|
|
697
|
-
return (this.labels && this.labels.unDock) ||
|
|
454
|
+
return ((this.labels && this.labels.unDock) ||
|
|
455
|
+
DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.unDock);
|
|
698
456
|
}
|
|
699
457
|
else {
|
|
700
|
-
return (this.labels && this.labels.dock) ||
|
|
458
|
+
return ((this.labels && this.labels.dock) ||
|
|
459
|
+
DEFAULT_MARKDOWN_NAVIGATOR_WINDOW_LABELS.dock);
|
|
701
460
|
}
|
|
702
461
|
}
|
|
703
462
|
toggleDockedState() {
|
|
704
463
|
this.dockToggled.emit(this.docked);
|
|
705
464
|
}
|
|
706
465
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
i0.ɵɵelementStart(0, "td-window-dialog", 0);
|
|
711
|
-
i0.ɵɵlistener("dockToggled", function TdMarkdownNavigatorWindowComponent_Template_td_window_dialog_dockToggled_0_listener() { return ctx.toggleDockedState(); })("closed", function TdMarkdownNavigatorWindowComponent_Template_td_window_dialog_closed_0_listener() { return ctx.closed.emit(); });
|
|
712
|
-
i0.ɵɵelementStart(1, "td-markdown-navigator", 1);
|
|
713
|
-
i0.ɵɵlistener("buttonClicked", function TdMarkdownNavigatorWindowComponent_Template_td_markdown_navigator_buttonClicked_1_listener($event) { return ctx.buttonClicked.emit($event); });
|
|
714
|
-
i0.ɵɵelementEnd();
|
|
715
|
-
i0.ɵɵelementEnd();
|
|
716
|
-
}
|
|
717
|
-
if (rf & 2) {
|
|
718
|
-
i0.ɵɵproperty("toolbarColor", ctx.toolbarColor)("docked", ctx.docked)("title", ctx.titleLabel)("toggleDockedStateLabel", ctx.toggleDockedStateLabel)("closeLabel", ctx.closeLabel);
|
|
719
|
-
i0.ɵɵadvance(1);
|
|
720
|
-
i0.ɵɵstyleProp("display", ctx.docked ? "none" : "inherit");
|
|
721
|
-
i0.ɵɵproperty("items", ctx.items)("labels", ctx.markdownNavigatorLabels)("startAt", ctx.startAt)("compareWith", ctx.compareWith)("footer", ctx.footer)("copyCodeToClipboard", ctx.copyCodeToClipboard)("copyCodeTooltips", ctx.copyCodeTooltips);
|
|
722
|
-
}
|
|
723
|
-
}, directives: [i1$1.TdWindowDialogComponent, TdMarkdownNavigatorComponent], styles: ["[_nghost-%COMP%]{height:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}td-markdown-navigator[_ngcontent-%COMP%]{height:calc(100% - 56px)}"], changeDetection: 0 });
|
|
724
|
-
(function () {
|
|
725
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownNavigatorWindowComponent, [{
|
|
466
|
+
TdMarkdownNavigatorWindowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
467
|
+
TdMarkdownNavigatorWindowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: TdMarkdownNavigatorWindowComponent, selector: "td-markdown-navigator-window", inputs: { items: "items", labels: "labels", toolbarColor: "toolbarColor", startAt: "startAt", compareWith: "compareWith", docked: "docked", copyCodeToClipboard: "copyCodeToClipboard", copyCodeTooltips: "copyCodeTooltips", footer: "footer" }, outputs: { closed: "closed", dockToggled: "dockToggled", buttonClicked: "buttonClicked" }, ngImport: i0, template: "<td-window-dialog\n [toolbarColor]=\"toolbarColor\"\n [docked]=\"docked\"\n [title]=\"titleLabel\"\n [toggleDockedStateLabel]=\"toggleDockedStateLabel\"\n [closeLabel]=\"closeLabel\"\n (dockToggled)=\"toggleDockedState()\"\n (closed)=\"closed.emit()\"\n>\n <td-markdown-navigator\n [items]=\"items\"\n [labels]=\"markdownNavigatorLabels\"\n [style.display]=\"docked ? 'none' : 'inherit'\"\n [startAt]=\"startAt\"\n [compareWith]=\"compareWith\"\n [footer]=\"footer\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (buttonClicked)=\"buttonClicked.emit($event)\"\n ></td-markdown-navigator>\n</td-window-dialog>\n", styles: [":host{height:100%;display:flex;flex-direction:column}td-markdown-navigator{height:calc(100% - 56px)}\n"], components: [{ type: i1$1.TdWindowDialogComponent, selector: "td-window-dialog", inputs: ["toolbarColor", "docked", "title", "toggleDockedStateLabel", "closeLabel"], outputs: ["dockToggled", "closed"] }, { type: TdMarkdownNavigatorComponent, selector: "td-markdown-navigator", inputs: ["items", "labels", "startAt", "copyCodeToClipboard", "copyCodeTooltips", "footer", "compareWith"], outputs: ["buttonClicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
468
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowComponent, decorators: [{
|
|
726
469
|
type: Component,
|
|
727
|
-
args: [{ selector: 'td-markdown-navigator-window', changeDetection: ChangeDetectionStrategy.OnPush, template: "<td-window-dialog\n [toolbarColor]=\"toolbarColor\"\n [docked]=\"docked\"\n [title]=\"titleLabel\"\n [toggleDockedStateLabel]=\"toggleDockedStateLabel\"\n [closeLabel]=\"closeLabel\"\n (dockToggled)=\"toggleDockedState()\"\n (closed)=\"closed.emit()\"\n>\n <td-markdown-navigator\n [items]=\"items\"\n [labels]=\"markdownNavigatorLabels\"\n [style.display]=\"docked ? 'none' : 'inherit'\"\n [startAt]=\"startAt\"\n [compareWith]=\"compareWith\"\n [footer]=\"footer\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (buttonClicked)=\"buttonClicked.emit($event)\"\n ></td-markdown-navigator>\n</td-window-dialog>\n", styles: [":host{height:100%;display
|
|
728
|
-
}],
|
|
470
|
+
args: [{ selector: 'td-markdown-navigator-window', changeDetection: ChangeDetectionStrategy.OnPush, template: "<td-window-dialog\n [toolbarColor]=\"toolbarColor\"\n [docked]=\"docked\"\n [title]=\"titleLabel\"\n [toggleDockedStateLabel]=\"toggleDockedStateLabel\"\n [closeLabel]=\"closeLabel\"\n (dockToggled)=\"toggleDockedState()\"\n (closed)=\"closed.emit()\"\n>\n <td-markdown-navigator\n [items]=\"items\"\n [labels]=\"markdownNavigatorLabels\"\n [style.display]=\"docked ? 'none' : 'inherit'\"\n [startAt]=\"startAt\"\n [compareWith]=\"compareWith\"\n [footer]=\"footer\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (buttonClicked)=\"buttonClicked.emit($event)\"\n ></td-markdown-navigator>\n</td-window-dialog>\n", styles: [":host{height:100%;display:flex;flex-direction:column}td-markdown-navigator{height:calc(100% - 56px)}\n"] }]
|
|
471
|
+
}], propDecorators: { items: [{
|
|
729
472
|
type: Input
|
|
730
473
|
}], labels: [{
|
|
731
474
|
type: Input
|
|
@@ -749,8 +492,7 @@ class TdMarkdownNavigatorWindowComponent {
|
|
|
749
492
|
type: Output
|
|
750
493
|
}], buttonClicked: [{
|
|
751
494
|
type: Output
|
|
752
|
-
}] });
|
|
753
|
-
})();
|
|
495
|
+
}] } });
|
|
754
496
|
|
|
755
497
|
const CDK_OVERLAY_CUSTOM_CLASS = 'td-window-dialog';
|
|
756
498
|
const DEFAULT_POSITION = { bottom: '0px', right: '0px' };
|
|
@@ -772,23 +514,16 @@ class TdMarkdownNavigatorWindowService {
|
|
|
772
514
|
this._tdDialogService = _tdDialogService;
|
|
773
515
|
this._document = _document;
|
|
774
516
|
this.rendererFactory = rendererFactory;
|
|
775
|
-
this.markdownNavigatorWindowDialog = undefined;
|
|
776
517
|
this.markdownNavigatorWindowDialogsOpen = 0;
|
|
777
|
-
this._renderer2 = rendererFactory.createRenderer(undefined,
|
|
518
|
+
this._renderer2 = rendererFactory.createRenderer(undefined, null);
|
|
778
519
|
}
|
|
779
520
|
open(config) {
|
|
521
|
+
var _a;
|
|
780
522
|
this.close();
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
}
|
|
786
|
-
else {
|
|
787
|
-
panelClass = [config.dialogConfig.panelClass];
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
const draggableConfig = Object.assign(Object.assign(Object.assign({}, DEFAULT_DRAGGABLE_DIALOG_CONFIG), config.dialogConfig), { panelClass });
|
|
791
|
-
const { matDialogRef, dragRefSubject } = this._tdDialogService.openDraggable({
|
|
523
|
+
const configClass = (_a = config === null || config === void 0 ? void 0 : config.dialogConfig) === null || _a === void 0 ? void 0 : _a.panelClass;
|
|
524
|
+
const panelClass = configClass && !Array.isArray(configClass) ? [configClass] : [];
|
|
525
|
+
const draggableConfig = Object.assign(Object.assign(Object.assign({}, DEFAULT_DRAGGABLE_DIALOG_CONFIG), config.dialogConfig), panelClass);
|
|
526
|
+
const { matDialogRef, dragRefSubject, } = this._tdDialogService.openDraggable({
|
|
792
527
|
component: TdMarkdownNavigatorWindowComponent,
|
|
793
528
|
config: draggableConfig,
|
|
794
529
|
dragHandleSelectors: ['.td-window-dialog-toolbar'],
|
|
@@ -797,10 +532,14 @@ class TdMarkdownNavigatorWindowService {
|
|
|
797
532
|
this.markdownNavigatorWindowDialog = matDialogRef;
|
|
798
533
|
this.markdownNavigatorWindowDialog.componentInstance.items = config.items;
|
|
799
534
|
this.markdownNavigatorWindowDialog.componentInstance.labels = config.labels;
|
|
800
|
-
this.markdownNavigatorWindowDialog.componentInstance.startAt =
|
|
801
|
-
|
|
802
|
-
this.markdownNavigatorWindowDialog.componentInstance.
|
|
803
|
-
|
|
535
|
+
this.markdownNavigatorWindowDialog.componentInstance.startAt =
|
|
536
|
+
config.startAt;
|
|
537
|
+
this.markdownNavigatorWindowDialog.componentInstance.copyCodeToClipboard =
|
|
538
|
+
config.copyCodeToClipboard;
|
|
539
|
+
this.markdownNavigatorWindowDialog.componentInstance.copyCodeTooltips =
|
|
540
|
+
config.copyCodeTooltips;
|
|
541
|
+
this.markdownNavigatorWindowDialog.componentInstance.compareWith =
|
|
542
|
+
config.compareWith;
|
|
804
543
|
this.markdownNavigatorWindowDialog.componentInstance.toolbarColor =
|
|
805
544
|
'toolbarColor' in config ? config.toolbarColor : 'primary';
|
|
806
545
|
this.markdownNavigatorWindowDialogsOpen++;
|
|
@@ -831,7 +570,12 @@ class TdMarkdownNavigatorWindowService {
|
|
|
831
570
|
if (docked) {
|
|
832
571
|
this.markdownNavigatorWindowDialog.componentInstance.docked = false;
|
|
833
572
|
this.markdownNavigatorWindowDialog.updateSize(dimensions.width, dimensions.height);
|
|
834
|
-
this.markdownNavigatorWindowDialog.updatePosition({
|
|
573
|
+
this.markdownNavigatorWindowDialog.updatePosition({
|
|
574
|
+
top: '0px',
|
|
575
|
+
right: '0px',
|
|
576
|
+
bottom: '0px',
|
|
577
|
+
left: '0px',
|
|
578
|
+
});
|
|
835
579
|
this.dragRef.setFreeDragPosition(position);
|
|
836
580
|
this.dragRef.disabled = false;
|
|
837
581
|
this.resizableDraggableDialog.attach();
|
|
@@ -862,18 +606,16 @@ class TdMarkdownNavigatorWindowService {
|
|
|
862
606
|
};
|
|
863
607
|
}
|
|
864
608
|
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
(
|
|
868
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownNavigatorWindowService, [{
|
|
609
|
+
TdMarkdownNavigatorWindowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowService, deps: [{ token: i1$1.TdDialogService }, { token: DOCUMENT }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
610
|
+
TdMarkdownNavigatorWindowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowService });
|
|
611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowService, decorators: [{
|
|
869
612
|
type: Injectable
|
|
870
|
-
}], function () {
|
|
613
|
+
}], ctorParameters: function () {
|
|
871
614
|
return [{ type: i1$1.TdDialogService }, { type: undefined, decorators: [{
|
|
872
615
|
type: Inject,
|
|
873
616
|
args: [DOCUMENT]
|
|
874
617
|
}] }, { type: i0.RendererFactory2 }];
|
|
875
|
-
}
|
|
876
|
-
})();
|
|
618
|
+
} });
|
|
877
619
|
|
|
878
620
|
class TdMarkdownNavigatorWindowDirective {
|
|
879
621
|
constructor(_markdownNavigatorWindowService) {
|
|
@@ -881,24 +623,19 @@ class TdMarkdownNavigatorWindowDirective {
|
|
|
881
623
|
this.disabled = false;
|
|
882
624
|
}
|
|
883
625
|
click() {
|
|
884
|
-
if (!this.disabled) {
|
|
626
|
+
if (!this.disabled && this.config) {
|
|
885
627
|
this._markdownNavigatorWindowService.open(this.config);
|
|
886
628
|
}
|
|
887
629
|
}
|
|
888
630
|
}
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
i0.ɵɵlistener("click", function TdMarkdownNavigatorWindowDirective_click_HostBindingHandler() { return ctx.click(); });
|
|
893
|
-
}
|
|
894
|
-
}, inputs: { config: ["tdMarkdownNavigatorWindow", "config"], disabled: "disabled" } });
|
|
895
|
-
(function () {
|
|
896
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownNavigatorWindowDirective, [{
|
|
631
|
+
TdMarkdownNavigatorWindowDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowDirective, deps: [{ token: TdMarkdownNavigatorWindowService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
632
|
+
TdMarkdownNavigatorWindowDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.2", type: TdMarkdownNavigatorWindowDirective, selector: "[tdMarkdownNavigatorWindow]", inputs: { config: ["tdMarkdownNavigatorWindow", "config"], disabled: "disabled" }, host: { listeners: { "click": "click()" } }, ngImport: i0 });
|
|
633
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownNavigatorWindowDirective, decorators: [{
|
|
897
634
|
type: Directive,
|
|
898
635
|
args: [{
|
|
899
636
|
selector: '[tdMarkdownNavigatorWindow]',
|
|
900
637
|
}]
|
|
901
|
-
}], function () { return [{ type: TdMarkdownNavigatorWindowService }]; }, { config: [{
|
|
638
|
+
}], ctorParameters: function () { return [{ type: TdMarkdownNavigatorWindowService }]; }, propDecorators: { config: [{
|
|
902
639
|
type: Input,
|
|
903
640
|
args: ['tdMarkdownNavigatorWindow']
|
|
904
641
|
}], disabled: [{
|
|
@@ -906,14 +643,26 @@ class TdMarkdownNavigatorWindowDirective {
|
|
|
906
643
|
}], click: [{
|
|
907
644
|
type: HostListener,
|
|
908
645
|
args: ['click']
|
|
909
|
-
}] });
|
|
910
|
-
})();
|
|
646
|
+
}] } });
|
|
911
647
|
|
|
912
648
|
class CovalentMarkdownNavigatorModule {
|
|
913
649
|
}
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
650
|
+
CovalentMarkdownNavigatorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownNavigatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
651
|
+
CovalentMarkdownNavigatorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownNavigatorModule, declarations: [TdMarkdownNavigatorComponent,
|
|
652
|
+
TdMarkdownNavigatorWindowComponent,
|
|
653
|
+
TdMarkdownNavigatorWindowDirective], imports: [CommonModule,
|
|
654
|
+
// material
|
|
655
|
+
MatButtonModule,
|
|
656
|
+
MatTooltipModule,
|
|
657
|
+
MatListModule,
|
|
658
|
+
MatIconModule,
|
|
659
|
+
MatProgressBarModule,
|
|
660
|
+
CovalentMessageModule,
|
|
661
|
+
CovalentFlavoredMarkdownModule,
|
|
662
|
+
CovalentDialogsModule], exports: [TdMarkdownNavigatorComponent,
|
|
663
|
+
TdMarkdownNavigatorWindowComponent,
|
|
664
|
+
TdMarkdownNavigatorWindowDirective] });
|
|
665
|
+
CovalentMarkdownNavigatorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownNavigatorModule, providers: [TdMarkdownNavigatorWindowService], imports: [[
|
|
917
666
|
CommonModule,
|
|
918
667
|
// material
|
|
919
668
|
MatButtonModule,
|
|
@@ -925,8 +674,7 @@ class CovalentMarkdownNavigatorModule {
|
|
|
925
674
|
CovalentFlavoredMarkdownModule,
|
|
926
675
|
CovalentDialogsModule,
|
|
927
676
|
]] });
|
|
928
|
-
(
|
|
929
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CovalentMarkdownNavigatorModule, [{
|
|
677
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownNavigatorModule, decorators: [{
|
|
930
678
|
type: NgModule,
|
|
931
679
|
args: [{
|
|
932
680
|
imports: [
|
|
@@ -941,24 +689,19 @@ class CovalentMarkdownNavigatorModule {
|
|
|
941
689
|
CovalentFlavoredMarkdownModule,
|
|
942
690
|
CovalentDialogsModule,
|
|
943
691
|
],
|
|
944
|
-
declarations: [
|
|
945
|
-
|
|
692
|
+
declarations: [
|
|
693
|
+
TdMarkdownNavigatorComponent,
|
|
694
|
+
TdMarkdownNavigatorWindowComponent,
|
|
695
|
+
TdMarkdownNavigatorWindowDirective,
|
|
696
|
+
],
|
|
697
|
+
exports: [
|
|
698
|
+
TdMarkdownNavigatorComponent,
|
|
699
|
+
TdMarkdownNavigatorWindowComponent,
|
|
700
|
+
TdMarkdownNavigatorWindowDirective,
|
|
701
|
+
],
|
|
946
702
|
providers: [TdMarkdownNavigatorWindowService],
|
|
947
703
|
}]
|
|
948
|
-
}]
|
|
949
|
-
})();
|
|
950
|
-
(function () {
|
|
951
|
-
(typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CovalentMarkdownNavigatorModule, { declarations: [TdMarkdownNavigatorComponent, TdMarkdownNavigatorWindowComponent, TdMarkdownNavigatorWindowDirective], imports: [CommonModule,
|
|
952
|
-
// material
|
|
953
|
-
MatButtonModule,
|
|
954
|
-
MatTooltipModule,
|
|
955
|
-
MatListModule,
|
|
956
|
-
MatIconModule,
|
|
957
|
-
MatProgressBarModule,
|
|
958
|
-
CovalentMessageModule,
|
|
959
|
-
CovalentFlavoredMarkdownModule,
|
|
960
|
-
CovalentDialogsModule], exports: [TdMarkdownNavigatorComponent, TdMarkdownNavigatorWindowComponent, TdMarkdownNavigatorWindowDirective] });
|
|
961
|
-
})();
|
|
704
|
+
}] });
|
|
962
705
|
|
|
963
706
|
/**
|
|
964
707
|
* Generated bundle index. Do not edit.
|