@covalent/flavored-markdown 3.1.2-beta.6 → 4.0.0-beta.1

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.
Files changed (35) hide show
  1. package/README.md +1 -1
  2. package/_flavored-markdown-theme.scss +1 -0
  3. package/cfm-list/cfm-list.component.d.ts +3 -0
  4. package/covalent-flavored-markdown.d.ts +1 -1
  5. package/esm2020/cfm-list/cfm-list.component.mjs +60 -0
  6. package/esm2020/covalent-flavored-markdown.mjs +5 -0
  7. package/esm2020/flavored-markdown-loader/flavored-markdown-loader.component.mjs +102 -0
  8. package/esm2020/flavored-markdown.component.mjs +476 -0
  9. package/esm2020/flavored-markdown.module.mjs +69 -0
  10. package/esm2020/index.mjs +2 -0
  11. package/esm2020/public_api.mjs +4 -0
  12. package/fesm2015/covalent-flavored-markdown.mjs +763 -0
  13. package/fesm2015/covalent-flavored-markdown.mjs.map +1 -0
  14. package/fesm2020/covalent-flavored-markdown.mjs +695 -0
  15. package/fesm2020/covalent-flavored-markdown.mjs.map +1 -0
  16. package/flavored-markdown-loader/flavored-markdown-loader.component.d.ts +3 -0
  17. package/flavored-markdown-loader/flavored-markdown-loader.component.scss +4 -2
  18. package/flavored-markdown.component.d.ts +26 -1
  19. package/flavored-markdown.component.scss +2 -0
  20. package/flavored-markdown.module.d.ts +16 -0
  21. package/package.json +35 -20
  22. package/bundles/covalent-flavored-markdown.umd.js +0 -1305
  23. package/bundles/covalent-flavored-markdown.umd.js.map +0 -1
  24. package/bundles/covalent-flavored-markdown.umd.min.js +0 -16
  25. package/bundles/covalent-flavored-markdown.umd.min.js.map +0 -1
  26. package/covalent-flavored-markdown.metadata.json +0 -1
  27. package/esm2015/cfm-list/cfm-list.component.js +0 -39
  28. package/esm2015/covalent-flavored-markdown.js +0 -11
  29. package/esm2015/flavored-markdown-loader/flavored-markdown-loader.component.js +0 -159
  30. package/esm2015/flavored-markdown.component.js +0 -741
  31. package/esm2015/flavored-markdown.module.js +0 -42
  32. package/esm2015/index.js +0 -7
  33. package/esm2015/public_api.js +0 -9
  34. package/fesm2015/covalent-flavored-markdown.js +0 -990
  35. package/fesm2015/covalent-flavored-markdown.js.map +0 -1
@@ -1,1305 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/checkbox'), require('@covalent/highlight'), require('@covalent/markdown'), require('@covalent/core/data-table'), require('@angular/common'), require('@angular/material/list'), require('@angular/material/progress-bar'), require('@angular/material/button')) :
3
- typeof define === 'function' && define.amd ? define('@covalent/flavored-markdown', ['exports', '@angular/core', '@angular/material/checkbox', '@covalent/highlight', '@covalent/markdown', '@covalent/core/data-table', '@angular/common', '@angular/material/list', '@angular/material/progress-bar', '@angular/material/button'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.covalent = global.covalent || {}, global.covalent['flavored-markdown'] = {}), global.ng.core, global.ng.material.checkbox, global.covalent.highlight, global.covalent.markdown, global.covalent.core['data-table'], global.ng.common, global.ng.material.list, global.ng.material.progressBar, global.ng.material.button));
5
- }(this, (function (exports, core, checkbox, highlight, markdown, dataTable, common, list, progressBar, button) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
- var extendStatics = function (d, b) {
23
- extendStatics = Object.setPrototypeOf ||
24
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
- function (d, b) { for (var p in b)
26
- if (Object.prototype.hasOwnProperty.call(b, p))
27
- d[p] = b[p]; };
28
- return extendStatics(d, b);
29
- };
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
- var __assign = function () {
36
- __assign = Object.assign || function __assign(t) {
37
- for (var s, i = 1, n = arguments.length; i < n; i++) {
38
- s = arguments[i];
39
- for (var p in s)
40
- if (Object.prototype.hasOwnProperty.call(s, p))
41
- t[p] = s[p];
42
- }
43
- return t;
44
- };
45
- return __assign.apply(this, arguments);
46
- };
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s)
50
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
- t[p] = s[p];
52
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
- t[p[i]] = s[p[i]];
56
- }
57
- return t;
58
- }
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
62
- r = Reflect.decorate(decorators, target, key, desc);
63
- else
64
- for (var i = decorators.length - 1; i >= 0; i--)
65
- if (d = decorators[i])
66
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
67
- return c > 3 && r && Object.defineProperty(target, key, r), r;
68
- }
69
- function __param(paramIndex, decorator) {
70
- return function (target, key) { decorator(target, key, paramIndex); };
71
- }
72
- function __metadata(metadataKey, metadataValue) {
73
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
74
- return Reflect.metadata(metadataKey, metadataValue);
75
- }
76
- function __awaiter(thisArg, _arguments, P, generator) {
77
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
78
- return new (P || (P = Promise))(function (resolve, reject) {
79
- function fulfilled(value) { try {
80
- step(generator.next(value));
81
- }
82
- catch (e) {
83
- reject(e);
84
- } }
85
- function rejected(value) { try {
86
- step(generator["throw"](value));
87
- }
88
- catch (e) {
89
- reject(e);
90
- } }
91
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
92
- step((generator = generator.apply(thisArg, _arguments || [])).next());
93
- });
94
- }
95
- function __generator(thisArg, body) {
96
- var _ = { label: 0, sent: function () { if (t[0] & 1)
97
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
98
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
99
- function verb(n) { return function (v) { return step([n, v]); }; }
100
- function step(op) {
101
- if (f)
102
- throw new TypeError("Generator is already executing.");
103
- while (_)
104
- try {
105
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
106
- return t;
107
- if (y = 0, t)
108
- op = [op[0] & 2, t.value];
109
- switch (op[0]) {
110
- case 0:
111
- case 1:
112
- t = op;
113
- break;
114
- case 4:
115
- _.label++;
116
- return { value: op[1], done: false };
117
- case 5:
118
- _.label++;
119
- y = op[1];
120
- op = [0];
121
- continue;
122
- case 7:
123
- op = _.ops.pop();
124
- _.trys.pop();
125
- continue;
126
- default:
127
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
128
- _ = 0;
129
- continue;
130
- }
131
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
132
- _.label = op[1];
133
- break;
134
- }
135
- if (op[0] === 6 && _.label < t[1]) {
136
- _.label = t[1];
137
- t = op;
138
- break;
139
- }
140
- if (t && _.label < t[2]) {
141
- _.label = t[2];
142
- _.ops.push(op);
143
- break;
144
- }
145
- if (t[2])
146
- _.ops.pop();
147
- _.trys.pop();
148
- continue;
149
- }
150
- op = body.call(thisArg, _);
151
- }
152
- catch (e) {
153
- op = [6, e];
154
- y = 0;
155
- }
156
- finally {
157
- f = t = 0;
158
- }
159
- if (op[0] & 5)
160
- throw op[1];
161
- return { value: op[0] ? op[1] : void 0, done: true };
162
- }
163
- }
164
- var __createBinding = Object.create ? (function (o, m, k, k2) {
165
- if (k2 === undefined)
166
- k2 = k;
167
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
168
- }) : (function (o, m, k, k2) {
169
- if (k2 === undefined)
170
- k2 = k;
171
- o[k2] = m[k];
172
- });
173
- function __exportStar(m, o) {
174
- for (var p in m)
175
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
176
- __createBinding(o, m, p);
177
- }
178
- function __values(o) {
179
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
180
- if (m)
181
- return m.call(o);
182
- if (o && typeof o.length === "number")
183
- return {
184
- next: function () {
185
- if (o && i >= o.length)
186
- o = void 0;
187
- return { value: o && o[i++], done: !o };
188
- }
189
- };
190
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
191
- }
192
- function __read(o, n) {
193
- var m = typeof Symbol === "function" && o[Symbol.iterator];
194
- if (!m)
195
- return o;
196
- var i = m.call(o), r, ar = [], e;
197
- try {
198
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
199
- ar.push(r.value);
200
- }
201
- catch (error) {
202
- e = { error: error };
203
- }
204
- finally {
205
- try {
206
- if (r && !r.done && (m = i["return"]))
207
- m.call(i);
208
- }
209
- finally {
210
- if (e)
211
- throw e.error;
212
- }
213
- }
214
- return ar;
215
- }
216
- function __spread() {
217
- for (var ar = [], i = 0; i < arguments.length; i++)
218
- ar = ar.concat(__read(arguments[i]));
219
- return ar;
220
- }
221
- function __spreadArrays() {
222
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
223
- s += arguments[i].length;
224
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
225
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
226
- r[k] = a[j];
227
- return r;
228
- }
229
- ;
230
- function __await(v) {
231
- return this instanceof __await ? (this.v = v, this) : new __await(v);
232
- }
233
- function __asyncGenerator(thisArg, _arguments, generator) {
234
- if (!Symbol.asyncIterator)
235
- throw new TypeError("Symbol.asyncIterator is not defined.");
236
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
237
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
238
- function verb(n) { if (g[n])
239
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
240
- function resume(n, v) { try {
241
- step(g[n](v));
242
- }
243
- catch (e) {
244
- settle(q[0][3], e);
245
- } }
246
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
247
- function fulfill(value) { resume("next", value); }
248
- function reject(value) { resume("throw", value); }
249
- function settle(f, v) { if (f(v), q.shift(), q.length)
250
- resume(q[0][0], q[0][1]); }
251
- }
252
- function __asyncDelegator(o) {
253
- var i, p;
254
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
255
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
256
- }
257
- function __asyncValues(o) {
258
- if (!Symbol.asyncIterator)
259
- throw new TypeError("Symbol.asyncIterator is not defined.");
260
- var m = o[Symbol.asyncIterator], i;
261
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
262
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
263
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
264
- }
265
- function __makeTemplateObject(cooked, raw) {
266
- if (Object.defineProperty) {
267
- Object.defineProperty(cooked, "raw", { value: raw });
268
- }
269
- else {
270
- cooked.raw = raw;
271
- }
272
- return cooked;
273
- }
274
- ;
275
- var __setModuleDefault = Object.create ? (function (o, v) {
276
- Object.defineProperty(o, "default", { enumerable: true, value: v });
277
- }) : function (o, v) {
278
- o["default"] = v;
279
- };
280
- function __importStar(mod) {
281
- if (mod && mod.__esModule)
282
- return mod;
283
- var result = {};
284
- if (mod != null)
285
- for (var k in mod)
286
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
287
- __createBinding(result, mod, k);
288
- __setModuleDefault(result, mod);
289
- return result;
290
- }
291
- function __importDefault(mod) {
292
- return (mod && mod.__esModule) ? mod : { default: mod };
293
- }
294
- function __classPrivateFieldGet(receiver, privateMap) {
295
- if (!privateMap.has(receiver)) {
296
- throw new TypeError("attempted to get private field on non-instance");
297
- }
298
- return privateMap.get(receiver);
299
- }
300
- function __classPrivateFieldSet(receiver, privateMap, value) {
301
- if (!privateMap.has(receiver)) {
302
- throw new TypeError("attempted to set private field on non-instance");
303
- }
304
- privateMap.set(receiver, value);
305
- return value;
306
- }
307
-
308
- /**
309
- * @fileoverview added by tsickle
310
- * Generated from: cfm-list/cfm-list.component.ts
311
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
312
- */
313
- /**
314
- * @record
315
- */
316
- function IFlavoredListItem() { }
317
- if (false) {
318
- /** @type {?} */
319
- IFlavoredListItem.prototype.line;
320
- /** @type {?|undefined} */
321
- IFlavoredListItem.prototype.sublines;
322
- }
323
- var TdFlavoredListComponent = /** @class */ (function () {
324
- function TdFlavoredListComponent() {
325
- this.dense = false;
326
- }
327
- return TdFlavoredListComponent;
328
- }());
329
- TdFlavoredListComponent.decorators = [
330
- { type: core.Component, args: [{
331
- selector: 'cfm-list',
332
- template: "<mat-list [attr.dense]=\"dense ? true : null\">\n <ng-template let-line let-last=\"last\" ngFor [ngForOf]=\"lines\">\n <mat-list-item>\n <h4 matLine>\n {{ line.line }}\n </h4>\n <p *ngFor=\"let subline of line.sublines\" matLine>\n {{ subline }}\n </p>\n <mat-divider *ngIf=\"!last\"></mat-divider>\n </mat-list-item>\n </ng-template>\n</mat-list>\n",
333
- styles: [""]
334
- }] }
335
- ];
336
- TdFlavoredListComponent.propDecorators = {
337
- lines: [{ type: core.Input }],
338
- dense: [{ type: core.Input }]
339
- };
340
- if (false) {
341
- /** @type {?} */
342
- TdFlavoredListComponent.prototype.lines;
343
- /** @type {?} */
344
- TdFlavoredListComponent.prototype.dense;
345
- }
346
-
347
- /**
348
- * @record
349
- */
350
- function ITdFlavoredMarkdownButtonClickEvent() { }
351
- if (false) {
352
- /** @type {?} */
353
- ITdFlavoredMarkdownButtonClickEvent.prototype.text;
354
- /** @type {?} */
355
- ITdFlavoredMarkdownButtonClickEvent.prototype.data;
356
- }
357
- var TdFlavoredMarkdownButtonComponent = /** @class */ (function () {
358
- function TdFlavoredMarkdownButtonComponent() {
359
- this.display = 'inline-block';
360
- this.text = '';
361
- this.data = '';
362
- this.clicked = new core.EventEmitter();
363
- }
364
- /**
365
- * @return {?}
366
- */
367
- TdFlavoredMarkdownButtonComponent.prototype.emitClick = function () {
368
- this.clicked.emit({ text: this.text, data: this.data });
369
- };
370
- return TdFlavoredMarkdownButtonComponent;
371
- }());
372
- TdFlavoredMarkdownButtonComponent.decorators = [
373
- { type: core.Component, args: [{
374
- template: "\n <button mat-raised-button (click)=\"emitClick()\">\n {{ text }}\n </button>\n "
375
- }] }
376
- ];
377
- TdFlavoredMarkdownButtonComponent.propDecorators = {
378
- display: [{ type: core.HostBinding, args: ['style.display',] }],
379
- text: [{ type: core.Input }],
380
- data: [{ type: core.Input }],
381
- clicked: [{ type: core.Output }]
382
- };
383
- if (false) {
384
- /** @type {?} */
385
- TdFlavoredMarkdownButtonComponent.prototype.display;
386
- /** @type {?} */
387
- TdFlavoredMarkdownButtonComponent.prototype.text;
388
- /** @type {?} */
389
- TdFlavoredMarkdownButtonComponent.prototype.data;
390
- /** @type {?} */
391
- TdFlavoredMarkdownButtonComponent.prototype.clicked;
392
- }
393
- var TdFlavoredMarkdownContainerDirective = /** @class */ (function () {
394
- /**
395
- * @param {?} viewContainerRef
396
- * @param {?} _renderer
397
- */
398
- function TdFlavoredMarkdownContainerDirective(viewContainerRef, _renderer) {
399
- this.viewContainerRef = viewContainerRef;
400
- this._renderer = _renderer;
401
- }
402
- /**
403
- * @return {?}
404
- */
405
- TdFlavoredMarkdownContainerDirective.prototype.clear = function () {
406
- this._renderer.setProperty(this.viewContainerRef.element.nativeElement, 'innerHTML', '');
407
- this.viewContainerRef.clear();
408
- };
409
- return TdFlavoredMarkdownContainerDirective;
410
- }());
411
- TdFlavoredMarkdownContainerDirective.decorators = [
412
- { type: core.Directive, args: [{
413
- selector: '[tdFlavoredMarkdownContainer]',
414
- },] }
415
- ];
416
- /** @nocollapse */
417
- TdFlavoredMarkdownContainerDirective.ctorParameters = function () { return [
418
- { type: core.ViewContainerRef },
419
- { type: core.Renderer2 }
420
- ]; };
421
- if (false) {
422
- /** @type {?} */
423
- TdFlavoredMarkdownContainerDirective.prototype.viewContainerRef;
424
- /**
425
- * @type {?}
426
- * @private
427
- */
428
- TdFlavoredMarkdownContainerDirective.prototype._renderer;
429
- }
430
- var TdFlavoredMarkdownComponent = /** @class */ (function () {
431
- /**
432
- * @param {?} _componentFactoryResolver
433
- * @param {?} _renderer
434
- * @param {?} _changeDetectorRef
435
- * @param {?} _injector
436
- * @param {?} _elementRef
437
- */
438
- function TdFlavoredMarkdownComponent(_componentFactoryResolver, _renderer, _changeDetectorRef, _injector, _elementRef) {
439
- this._componentFactoryResolver = _componentFactoryResolver;
440
- this._renderer = _renderer;
441
- this._changeDetectorRef = _changeDetectorRef;
442
- this._injector = _injector;
443
- this._elementRef = _elementRef;
444
- this._simpleLineBreaks = false;
445
- this._components = {};
446
- this._viewInit = false;
447
- /**
448
- * copyCodeToClipboard?: boolean
449
- *
450
- * Display copy button on code snippets to copy code to clipboard.
451
- *
452
- */
453
- this.copyCodeToClipboard = false;
454
- /**
455
- * copyCodeTooltips?: ICopyCodeTooltips
456
- *
457
- * Tooltips for copy button to copy and upon copying.
458
- */
459
- this.copyCodeTooltips = {};
460
- /**
461
- * contentReady?: function
462
- * Event emitted after the markdown content rendering is finished.
463
- */
464
- this.contentReady = new core.EventEmitter();
465
- /**
466
- * buttonClicked?: ITdFlavoredMarkdownButtonClickEvent
467
- * Event emitted when a button is clicked
468
- * Is an object containing text and data of button
469
- */
470
- this.buttonClicked = new core.EventEmitter();
471
- }
472
- Object.defineProperty(TdFlavoredMarkdownComponent.prototype, "content", {
473
- /**
474
- * content?: string
475
- *
476
- * Markdown format content to be parsed as material/covalent markup.
477
- *
478
- * e.g. README.md content.
479
- * @param {?} content
480
- * @return {?}
481
- */
482
- set: function (content) {
483
- this._content = content;
484
- },
485
- enumerable: false,
486
- configurable: true
487
- });
488
- Object.defineProperty(TdFlavoredMarkdownComponent.prototype, "simpleLineBreaks", {
489
- /**
490
- * simpleLineBreaks?: string
491
- *
492
- * Sets whether newline characters inside paragraphs and spans are parsed as <br/>.
493
- * Defaults to false.
494
- * @param {?} simpleLineBreaks
495
- * @return {?}
496
- */
497
- set: function (simpleLineBreaks) {
498
- this._simpleLineBreaks = simpleLineBreaks;
499
- },
500
- enumerable: false,
501
- configurable: true
502
- });
503
- Object.defineProperty(TdFlavoredMarkdownComponent.prototype, "hostedUrl", {
504
- /**
505
- * hostedUrl?: string
506
- *
507
- * If markdown contains relative paths, this is required to generate correct urls
508
- *
509
- * @param {?} hostedUrl
510
- * @return {?}
511
- */
512
- set: function (hostedUrl) {
513
- this._hostedUrl = hostedUrl;
514
- },
515
- enumerable: false,
516
- configurable: true
517
- });
518
- Object.defineProperty(TdFlavoredMarkdownComponent.prototype, "anchor", {
519
- /**
520
- * anchor?: string
521
- *
522
- * Anchor to jump to
523
- *
524
- * @param {?} anchor
525
- * @return {?}
526
- */
527
- set: function (anchor) {
528
- this._anchor = anchor;
529
- },
530
- enumerable: false,
531
- configurable: true
532
- });
533
- /**
534
- * @param {?} changes
535
- * @return {?}
536
- */
537
- TdFlavoredMarkdownComponent.prototype.ngOnChanges = function (changes) {
538
- // only anchor changed
539
- if (changes.anchor && !changes.content && !changes.simpleLineBreaks && !changes.hostedUrl) {
540
- markdown.scrollToAnchor(this._elementRef.nativeElement, this._anchor, false);
541
- }
542
- else {
543
- this.refresh();
544
- }
545
- };
546
- /**
547
- * @return {?}
548
- */
549
- TdFlavoredMarkdownComponent.prototype.ngAfterViewInit = function () {
550
- var _this = this;
551
- if (!this._content) {
552
- this._loadContent((( /** @type {?} */(this.container.viewContainerRef.element.nativeElement))).textContent);
553
- Promise.resolve().then(( /**
554
- * @return {?}
555
- */function () {
556
- _this._viewInit = true;
557
- _this._changeDetectorRef.markForCheck();
558
- }));
559
- }
560
- };
561
- /**
562
- * @return {?}
563
- */
564
- TdFlavoredMarkdownComponent.prototype.refresh = function () {
565
- if (this._content) {
566
- this._loadContent(this._content);
567
- }
568
- else if (this._viewInit) {
569
- this._loadContent((( /** @type {?} */(this.container.viewContainerRef.element.nativeElement))).textContent);
570
- }
571
- this._changeDetectorRef.markForCheck();
572
- };
573
- /**
574
- * @private
575
- * @param {?} markdown
576
- * @return {?}
577
- */
578
- TdFlavoredMarkdownComponent.prototype._loadContent = function (markdown$1) {
579
- var _this = this;
580
- if (markdown$1 && markdown$1.trim().length > 0) {
581
- this.container.clear();
582
- markdown$1 = markdown$1.replace(/^(\s|\t)*\n+/g, '').replace(/(\s|\t)*\n+(\s|\t)*$/g, '');
583
- // Split markdown by line characters
584
- /** @type {?} */
585
- var lines = markdown$1.split('\n');
586
- // check how much indentation is used by the first actual markdown line
587
- /** @type {?} */
588
- var firstLineWhitespace = lines[0].match(/^(\s|\t)*/)[0];
589
- // Remove all indentation spaces so markdown can be parsed correctly
590
- /** @type {?} */
591
- var startingWhitespaceRegex_1 = new RegExp('^' + firstLineWhitespace);
592
- lines = lines.map(( /**
593
- * @param {?} line
594
- * @return {?}
595
- */function (line) {
596
- return line.replace(startingWhitespaceRegex_1, '');
597
- }));
598
- // Join lines again with line characters
599
- markdown$1 = __spread(lines, ['', '']).join('\n');
600
- markdown$1 = this._replaceCodeBlocks(markdown$1);
601
- markdown$1 = this._replaceCheckbox(markdown$1);
602
- markdown$1 = this._replaceTables(markdown$1);
603
- markdown$1 = this._replaceLists(markdown$1);
604
- markdown$1 = this._replaceButtons(markdown$1);
605
- /** @type {?} */
606
- var keys = Object.keys(this._components);
607
- // need to sort the placeholders in order of encounter in markdown content
608
- keys.sort(( /**
609
- * @param {?} compA
610
- * @param {?} compB
611
- * @return {?}
612
- */function (compA, compB) {
613
- return markdown$1.indexOf(compA) > markdown$1.indexOf(compB) ? 1 : -1;
614
- }));
615
- this._render(markdown$1, keys[0], keys);
616
- // TODO: timeout required since resizing of html elements occurs which causes a change in the scroll position
617
- setTimeout(( /**
618
- * @return {?}
619
- */function () { return markdown.scrollToAnchor(_this._elementRef.nativeElement, _this._anchor, false); }), 250);
620
- this.contentReady.emit();
621
- Promise.resolve().then(( /**
622
- * @return {?}
623
- */function () {
624
- _this._changeDetectorRef.markForCheck();
625
- }));
626
- }
627
- };
628
- /**
629
- * @private
630
- * @param {?} markdown
631
- * @param {?} key
632
- * @param {?} keys
633
- * @return {?}
634
- */
635
- TdFlavoredMarkdownComponent.prototype._render = function (markdown$1, key, keys) {
636
- if (!markdown$1) {
637
- return;
638
- }
639
- if (key && markdown$1.indexOf(key) > -1) {
640
- /** @type {?} */
641
- var markdownParts = markdown$1.split(key);
642
- keys.shift();
643
- this._render(markdownParts[0], undefined, undefined);
644
- this.container.viewContainerRef.insert(this._components[key].hostView, this.container.viewContainerRef.length);
645
- this._components[key] = undefined;
646
- delete this._components[key];
647
- this._render(markdownParts[1], keys[0], keys);
648
- }
649
- else {
650
- /** @type {?} */
651
- var contentRef = this._componentFactoryResolver
652
- .resolveComponentFactory(markdown.TdMarkdownComponent)
653
- .create(this._injector);
654
- contentRef.instance.content = markdown$1;
655
- contentRef.instance.hostedUrl = this._hostedUrl;
656
- contentRef.instance.simpleLineBreaks = this._simpleLineBreaks;
657
- contentRef.instance.refresh();
658
- this.container.viewContainerRef.insert(contentRef.hostView, this.container.viewContainerRef.length);
659
- }
660
- };
661
- /**
662
- * @private
663
- * @template T
664
- * @param {?} markdown
665
- * @param {?} type
666
- * @param {?} regExp
667
- * @param {?} replacerFunc
668
- * @return {?}
669
- */
670
- TdFlavoredMarkdownComponent.prototype._replaceComponent = function (markdown, type, regExp, replacerFunc) {
671
- var _this = this;
672
- /** @type {?} */
673
- var componentIndex = 0;
674
- return markdown.replace(regExp, ( /**
675
- * @param {...?} args
676
- * @return {?}
677
- */function () {
678
- var args = [];
679
- for (var _i = 0; _i < arguments.length; _i++) {
680
- args[_i] = arguments[_i];
681
- }
682
- /** @type {?} */
683
- var componentFactory = _this._componentFactoryResolver.resolveComponentFactory(type);
684
- /** @type {?} */
685
- var componentRef = componentFactory.create(_this._injector);
686
- replacerFunc.apply(void 0, __spread([componentRef], args));
687
- /** @type {?} */
688
- var key = '[' + componentFactory.selector + '-placeholder-' + componentIndex++ + ']';
689
- _this._components[key] = componentRef;
690
- return key;
691
- }));
692
- };
693
- /**
694
- * @private
695
- * @param {?} markdown
696
- * @return {?}
697
- */
698
- TdFlavoredMarkdownComponent.prototype._replaceCheckbox = function (markdown) {
699
- var _this = this;
700
- /** @type {?} */
701
- var checkboxRegExp = /(?:^|\n)- \[(x| )\](.*)/gi;
702
- return this._replaceComponent(markdown, checkbox.MatCheckbox, checkboxRegExp, ( /**
703
- * @param {?} componentRef
704
- * @param {?} match
705
- * @param {?} checked
706
- * @param {?} label
707
- * @return {?}
708
- */function (componentRef, match, checked, label) {
709
- componentRef.instance.checked = !!checked.trim();
710
- componentRef.instance.disabled = true;
711
- componentRef.instance.labelPosition = 'after';
712
- _this._renderer.setProperty((( /** @type {?} */(componentRef.instance._elementRef.nativeElement))).getElementsByClassName('mat-checkbox-label')[0], 'innerHTML', label);
713
- }));
714
- };
715
- /**
716
- * @private
717
- * @param {?} markdown
718
- * @return {?}
719
- */
720
- TdFlavoredMarkdownComponent.prototype._replaceButtons = function (markdown) {
721
- var _this = this;
722
- /** @type {?} */
723
- var buttonRegExp = /\[([^\[]+)\](\(#data=(.*)\))/i;
724
- /** @type {?} */
725
- var globalButtonRegExp = new RegExp(buttonRegExp.source, buttonRegExp.flags + 'g');
726
- return this._replaceComponent(markdown, TdFlavoredMarkdownButtonComponent, globalButtonRegExp, ( /**
727
- * @param {?} componentRef
728
- * @param {?} match
729
- * @return {?}
730
- */function (componentRef, match) {
731
- /** @type {?} */
732
- var matches = buttonRegExp.exec(match);
733
- /** @type {?} */
734
- var text = matches[1];
735
- /** @type {?} */
736
- var data = matches[3];
737
- componentRef.instance.text = text;
738
- componentRef.instance.data = data;
739
- componentRef.instance.clicked.subscribe(( /**
740
- * @param {?} clickEvent
741
- * @return {?}
742
- */function (clickEvent) { return _this.buttonClicked.emit(clickEvent); }));
743
- }));
744
- };
745
- /**
746
- * @private
747
- * @param {?} markdown
748
- * @return {?}
749
- */
750
- TdFlavoredMarkdownComponent.prototype._replaceCodeBlocks = function (markdown) {
751
- var _this = this;
752
- /** @type {?} */
753
- var codeBlockRegExp = /(?:^|\n)```(.*)\n([\s\S]*?)\n```/g;
754
- return this._replaceComponent(markdown, highlight.TdHighlightComponent, codeBlockRegExp, ( /**
755
- * @param {?} componentRef
756
- * @param {?} match
757
- * @param {?} language
758
- * @param {?} codeblock
759
- * @return {?}
760
- */function (componentRef, match, language, codeblock) {
761
- if (language) {
762
- componentRef.instance.codeLang = language;
763
- }
764
- componentRef.instance.copyCodeToClipboard = _this.copyCodeToClipboard;
765
- componentRef.instance.copyCodeTooltips = _this.copyCodeTooltips;
766
- componentRef.instance.content = codeblock;
767
- }));
768
- };
769
- /**
770
- * @private
771
- * @param {?} markdown
772
- * @return {?}
773
- */
774
- TdFlavoredMarkdownComponent.prototype._replaceTables = function (markdown) {
775
- /** @type {?} */
776
- var tableRgx = /^ {0,3}\|?.+\|.+\n[ \t]{0,3}\|?[ \t]*:?[ \t]*(?:-|=){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:-|=){2,}[\s\S]+?(?:\n\n|~0)/gm;
777
- return this._replaceComponent(markdown, dataTable.TdDataTableComponent, tableRgx, ( /**
778
- * @param {?} componentRef
779
- * @param {?} match
780
- * @return {?}
781
- */function (componentRef, match) {
782
- /** @type {?} */
783
- var dataTableLines = match.replace(/(\s|\t)*\n+(\s|\t)*$/g, '').split('\n');
784
- /** @type {?} */
785
- var columns = dataTableLines[0]
786
- .split('|')
787
- .filter(( /**
788
- * @param {?} col
789
- * @return {?}
790
- */function (col) {
791
- return col;
792
- }))
793
- .map(( /**
794
- * @param {?} s
795
- * @return {?}
796
- */function (s) {
797
- return s.trim();
798
- }));
799
- /** @type {?} */
800
- var alignment = dataTableLines[1]
801
- .split('|')
802
- .filter(( /**
803
- * @param {?} v
804
- * @return {?}
805
- */function (v) {
806
- return v;
807
- }))
808
- .map(( /**
809
- * @param {?} s
810
- * @return {?}
811
- */function (s) {
812
- return s.trim();
813
- }));
814
- componentRef.instance.columns = columns.map(( /**
815
- * @param {?} col
816
- * @param {?} index
817
- * @return {?}
818
- */function (col, index) {
819
- /** @type {?} */
820
- var widths = alignment[index].split('---');
821
- /** @type {?} */
822
- var min = parseInt(widths[0], 10);
823
- /** @type {?} */
824
- var max = parseInt(widths[1], 10);
825
- /** @type {?} */
826
- var width = { min: min, max: max };
827
- if (isNaN(min) && isNaN(max)) {
828
- width = undefined;
829
- }
830
- else if (isNaN(max)) {
831
- width.max = undefined;
832
- }
833
- else if (isNaN(min)) {
834
- width.min = undefined;
835
- }
836
- return {
837
- label: col,
838
- name: col.toLowerCase().trim(),
839
- numeric: /^--*[ \t]*:[ \t]*$/.test(alignment[index]),
840
- width: width,
841
- };
842
- }));
843
- /** @type {?} */
844
- var data = [];
845
- var _loop_1 = function (i) {
846
- /** @type {?} */
847
- var rowSplit = dataTableLines[i]
848
- .split('|')
849
- .filter(( /**
850
- * @param {?} cell
851
- * @return {?}
852
- */function (cell) {
853
- return cell;
854
- }))
855
- .map(( /**
856
- * @param {?} s
857
- * @return {?}
858
- */function (s) {
859
- return s.trim();
860
- }));
861
- /** @type {?} */
862
- var row = {};
863
- columns.forEach(( /**
864
- * @param {?} col
865
- * @param {?} index
866
- * @return {?}
867
- */function (col, index) {
868
- /** @type {?} */
869
- var rowSplitCell = rowSplit[index];
870
- if (rowSplitCell) {
871
- row[col.toLowerCase().trim()] = rowSplitCell.replace(/`(.*)`/, ( /**
872
- * @param {?} m
873
- * @param {?} value
874
- * @return {?}
875
- */function (m, value) {
876
- return value;
877
- }));
878
- }
879
- }));
880
- data.push(row);
881
- };
882
- for (var i = 2; i < dataTableLines.length; i++) {
883
- _loop_1(i);
884
- }
885
- componentRef.instance.data = data;
886
- componentRef.instance.sortable = true;
887
- componentRef.instance.sortChange.subscribe(( /**
888
- * @param {?} event
889
- * @return {?}
890
- */function (event) {
891
- componentRef.instance.data.sort(( /**
892
- * @param {?} a
893
- * @param {?} b
894
- * @return {?}
895
- */function (a, b) {
896
- /** @type {?} */
897
- var compA = a[event.name];
898
- /** @type {?} */
899
- var compB = b[event.name];
900
- /** @type {?} */
901
- var direction = 0;
902
- if (!Number.isNaN(Number.parseFloat(compA)) && !Number.isNaN(Number.parseFloat(compB))) {
903
- direction = Number.parseFloat(compA) - Number.parseFloat(compB);
904
- }
905
- else {
906
- if (compA < compB) {
907
- direction = -1;
908
- }
909
- else if (compA > compB) {
910
- direction = 1;
911
- }
912
- }
913
- return direction * (event.order === dataTable.TdDataTableSortingOrder.Descending ? -1 : 1);
914
- }));
915
- componentRef.instance.refresh();
916
- }));
917
- setTimeout(( /**
918
- * @return {?}
919
- */function () {
920
- componentRef.instance.refresh();
921
- }));
922
- }));
923
- };
924
- /**
925
- * @private
926
- * @param {?} markdown
927
- * @return {?}
928
- */
929
- TdFlavoredMarkdownComponent.prototype._replaceLists = function (markdown) {
930
- /** @type {?} */
931
- var listRegExp = /(?:^|\n)(( *\+)[ |\t](.*)\n)+/g;
932
- return this._replaceComponent(markdown, TdFlavoredListComponent, listRegExp, ( /**
933
- * @param {?} componentRef
934
- * @param {?} match
935
- * @return {?}
936
- */function (componentRef, match) {
937
- /** @type {?} */
938
- var lineTexts = match.split(new RegExp('\\n {' + (match.indexOf('+') - 1).toString() + '}\\+[ |\\t]'));
939
- lineTexts.shift();
940
- /** @type {?} */
941
- var lines = [];
942
- lineTexts.forEach(( /**
943
- * @param {?} text
944
- * @param {?} index
945
- * @return {?}
946
- */function (text, index) {
947
- /** @type {?} */
948
- var sublineTexts = text.split(/\n *\+ /);
949
- lines.push({
950
- line: sublineTexts.shift(),
951
- sublines: sublineTexts.map(( /**
952
- * @param {?} subline
953
- * @return {?}
954
- */function (subline) {
955
- return subline.trim();
956
- })),
957
- });
958
- }));
959
- componentRef.instance.lines = lines;
960
- }));
961
- };
962
- return TdFlavoredMarkdownComponent;
963
- }());
964
- TdFlavoredMarkdownComponent.decorators = [
965
- { type: core.Component, args: [{
966
- selector: 'td-flavored-markdown',
967
- template: "<div tdFlavoredMarkdownContainer>\n <ng-content></ng-content>\n</div>\n",
968
- changeDetection: core.ChangeDetectionStrategy.OnPush,
969
- styles: [":host ::ng-deep td-markdown:first-of-type>div:first-of-type>h1:first-of-type,:host ::ng-deep td-markdown:first-of-type>div:first-of-type>h2:first-of-type{margin-top:0}:host ::ng-deep mat-checkbox,:host ::ng-deep td-data-table{display:block}:host ::ng-deep mat-checkbox:last-of-type,:host ::ng-deep td-data-table,:host ::ng-deep td-highlight{margin-bottom:16px}:host ::ng-deep :not(pre)>code{font-family:Menlo,Monaco,Andale Mono,lucida console,Courier New,monospace;padding-left:2px;padding-right:2px}:host ::ng-deep td-highlight{-ms-flex-direction:row;-ms-flex-pack:justify;display:-ms-flexbox;display:flex;flex-direction:row;justify-content:space-between}"]
970
- }] }
971
- ];
972
- /** @nocollapse */
973
- TdFlavoredMarkdownComponent.ctorParameters = function () { return [
974
- { type: core.ComponentFactoryResolver },
975
- { type: core.Renderer2 },
976
- { type: core.ChangeDetectorRef },
977
- { type: core.Injector },
978
- { type: core.ElementRef }
979
- ]; };
980
- TdFlavoredMarkdownComponent.propDecorators = {
981
- content: [{ type: core.Input, args: ['content',] }],
982
- simpleLineBreaks: [{ type: core.Input, args: ['simpleLineBreaks',] }],
983
- hostedUrl: [{ type: core.Input, args: ['hostedUrl',] }],
984
- anchor: [{ type: core.Input, args: ['anchor',] }],
985
- copyCodeToClipboard: [{ type: core.Input }],
986
- copyCodeTooltips: [{ type: core.Input }],
987
- contentReady: [{ type: core.Output }],
988
- buttonClicked: [{ type: core.Output }],
989
- container: [{ type: core.ViewChild, args: [TdFlavoredMarkdownContainerDirective, { static: true },] }]
990
- };
991
- if (false) {
992
- /**
993
- * @type {?}
994
- * @private
995
- */
996
- TdFlavoredMarkdownComponent.prototype._content;
997
- /**
998
- * @type {?}
999
- * @private
1000
- */
1001
- TdFlavoredMarkdownComponent.prototype._simpleLineBreaks;
1002
- /**
1003
- * @type {?}
1004
- * @private
1005
- */
1006
- TdFlavoredMarkdownComponent.prototype._hostedUrl;
1007
- /**
1008
- * @type {?}
1009
- * @private
1010
- */
1011
- TdFlavoredMarkdownComponent.prototype._anchor;
1012
- /**
1013
- * @type {?}
1014
- * @private
1015
- */
1016
- TdFlavoredMarkdownComponent.prototype._components;
1017
- /**
1018
- * @type {?}
1019
- * @private
1020
- */
1021
- TdFlavoredMarkdownComponent.prototype._viewInit;
1022
- /**
1023
- * copyCodeToClipboard?: boolean
1024
- *
1025
- * Display copy button on code snippets to copy code to clipboard.
1026
- *
1027
- * @type {?}
1028
- */
1029
- TdFlavoredMarkdownComponent.prototype.copyCodeToClipboard;
1030
- /**
1031
- * copyCodeTooltips?: ICopyCodeTooltips
1032
- *
1033
- * Tooltips for copy button to copy and upon copying.
1034
- * @type {?}
1035
- */
1036
- TdFlavoredMarkdownComponent.prototype.copyCodeTooltips;
1037
- /**
1038
- * contentReady?: function
1039
- * Event emitted after the markdown content rendering is finished.
1040
- * @type {?}
1041
- */
1042
- TdFlavoredMarkdownComponent.prototype.contentReady;
1043
- /**
1044
- * buttonClicked?: ITdFlavoredMarkdownButtonClickEvent
1045
- * Event emitted when a button is clicked
1046
- * Is an object containing text and data of button
1047
- * @type {?}
1048
- */
1049
- TdFlavoredMarkdownComponent.prototype.buttonClicked;
1050
- /** @type {?} */
1051
- TdFlavoredMarkdownComponent.prototype.container;
1052
- /**
1053
- * @type {?}
1054
- * @private
1055
- */
1056
- TdFlavoredMarkdownComponent.prototype._componentFactoryResolver;
1057
- /**
1058
- * @type {?}
1059
- * @private
1060
- */
1061
- TdFlavoredMarkdownComponent.prototype._renderer;
1062
- /**
1063
- * @type {?}
1064
- * @private
1065
- */
1066
- TdFlavoredMarkdownComponent.prototype._changeDetectorRef;
1067
- /**
1068
- * @type {?}
1069
- * @private
1070
- */
1071
- TdFlavoredMarkdownComponent.prototype._injector;
1072
- /**
1073
- * @type {?}
1074
- * @private
1075
- */
1076
- TdFlavoredMarkdownComponent.prototype._elementRef;
1077
- }
1078
-
1079
- // TODO: make a td-markdown-loader component
1080
- var TdFlavoredMarkdownLoaderComponent = /** @class */ (function () {
1081
- /**
1082
- * @param {?} _changeDetectorRef
1083
- * @param {?} _markdownUrlLoaderService
1084
- */
1085
- function TdFlavoredMarkdownLoaderComponent(_changeDetectorRef, _markdownUrlLoaderService) {
1086
- this._changeDetectorRef = _changeDetectorRef;
1087
- this._markdownUrlLoaderService = _markdownUrlLoaderService;
1088
- /**
1089
- * copyCodeToClipboard?: boolean
1090
- *
1091
- * Display copy button on code snippets to copy code to clipboard.
1092
- *
1093
- */
1094
- this.copyCodeToClipboard = false;
1095
- /**
1096
- * copyCodeTooltips?: ICopyCodeTooltips
1097
- *
1098
- * Tooltips for copy button to copy and upon copying.
1099
- */
1100
- this.copyCodeTooltips = {};
1101
- /**
1102
- * contentReady: void
1103
- * Emitted when markdown rendering is finished.
1104
- */
1105
- this.contentReady = new core.EventEmitter();
1106
- /**
1107
- * loadFailed: Error
1108
- * Emitted when loading of markdown file fails.
1109
- */
1110
- this.loadFailed = new core.EventEmitter();
1111
- this.buttonClicked = new core.EventEmitter();
1112
- this.loading = true;
1113
- }
1114
- /**
1115
- * @param {?} changes
1116
- * @return {?}
1117
- */
1118
- TdFlavoredMarkdownLoaderComponent.prototype.ngOnChanges = function (changes) {
1119
- if (changes.url || changes.httpOptions) {
1120
- this.loadMarkdown();
1121
- }
1122
- };
1123
- /**
1124
- * @return {?}
1125
- */
1126
- TdFlavoredMarkdownLoaderComponent.prototype.loadMarkdown = function () {
1127
- return __awaiter(this, void 0, void 0, function () {
1128
- var _a, error_1;
1129
- return __generator(this, function (_b) {
1130
- switch (_b.label) {
1131
- case 0:
1132
- this.loading = true;
1133
- this._changeDetectorRef.markForCheck();
1134
- _b.label = 1;
1135
- case 1:
1136
- _b.trys.push([1, 3, 4, 5]);
1137
- _a = this;
1138
- return [4 /*yield*/, this._markdownUrlLoaderService.load(this.url, this.httpOptions)];
1139
- case 2:
1140
- _a.content = _b.sent();
1141
- return [3 /*break*/, 5];
1142
- case 3:
1143
- error_1 = _b.sent();
1144
- this.loadFailed.emit(error_1);
1145
- return [3 /*break*/, 5];
1146
- case 4:
1147
- this.loading = false;
1148
- this._changeDetectorRef.markForCheck();
1149
- return [7 /*endfinally*/];
1150
- case 5: return [2 /*return*/];
1151
- }
1152
- });
1153
- });
1154
- };
1155
- return TdFlavoredMarkdownLoaderComponent;
1156
- }());
1157
- TdFlavoredMarkdownLoaderComponent.decorators = [
1158
- { type: core.Component, args: [{
1159
- selector: 'td-flavored-markdown-loader',
1160
- template: "<mat-progress-bar\n [ngClass]=\"'delay'\"\n *ngIf=\"loading\"\n mode=\"indeterminate\"\n color=\"accent\"\n class=\"sticky\"\n></mat-progress-bar>\n<td-flavored-markdown\n *ngIf=\"!loading\"\n [content]=\"content\"\n [hostedUrl]=\"url\"\n [anchor]=\"anchor\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n (contentReady)=\"contentReady.emit()\"\n (buttonClicked)=\"buttonClicked.emit($event)\"\n></td-flavored-markdown>\n",
1161
- changeDetection: core.ChangeDetectionStrategy.OnPush,
1162
- styles: [":host{display:block}.sticky{position:absolute;top:0}.delay{animation:delayAnimation;animation-duration:.6s}@keyframes delayAnimation{0%{opacity:0}99%{opacity:0}to{opacity:1}}"]
1163
- }] }
1164
- ];
1165
- /** @nocollapse */
1166
- TdFlavoredMarkdownLoaderComponent.ctorParameters = function () { return [
1167
- { type: core.ChangeDetectorRef },
1168
- { type: markdown.TdMarkdownLoaderService }
1169
- ]; };
1170
- TdFlavoredMarkdownLoaderComponent.propDecorators = {
1171
- url: [{ type: core.Input }],
1172
- httpOptions: [{ type: core.Input }],
1173
- anchor: [{ type: core.Input }],
1174
- copyCodeToClipboard: [{ type: core.Input }],
1175
- copyCodeTooltips: [{ type: core.Input }],
1176
- contentReady: [{ type: core.Output }],
1177
- loadFailed: [{ type: core.Output }],
1178
- buttonClicked: [{ type: core.Output }]
1179
- };
1180
- if (false) {
1181
- /**
1182
- * url: string
1183
- * The url of the markdown file.
1184
- * @type {?}
1185
- */
1186
- TdFlavoredMarkdownLoaderComponent.prototype.url;
1187
- /**
1188
- * httpOptions: object
1189
- * HTTP options that can be part of the request.
1190
- * @type {?}
1191
- */
1192
- TdFlavoredMarkdownLoaderComponent.prototype.httpOptions;
1193
- /**
1194
- * anchor: string
1195
- * Anchor to jump to.
1196
- * @type {?}
1197
- */
1198
- TdFlavoredMarkdownLoaderComponent.prototype.anchor;
1199
- /**
1200
- * copyCodeToClipboard?: boolean
1201
- *
1202
- * Display copy button on code snippets to copy code to clipboard.
1203
- *
1204
- * @type {?}
1205
- */
1206
- TdFlavoredMarkdownLoaderComponent.prototype.copyCodeToClipboard;
1207
- /**
1208
- * copyCodeTooltips?: ICopyCodeTooltips
1209
- *
1210
- * Tooltips for copy button to copy and upon copying.
1211
- * @type {?}
1212
- */
1213
- TdFlavoredMarkdownLoaderComponent.prototype.copyCodeTooltips;
1214
- /**
1215
- * contentReady: void
1216
- * Emitted when markdown rendering is finished.
1217
- * @type {?}
1218
- */
1219
- TdFlavoredMarkdownLoaderComponent.prototype.contentReady;
1220
- /**
1221
- * loadFailed: Error
1222
- * Emitted when loading of markdown file fails.
1223
- * @type {?}
1224
- */
1225
- TdFlavoredMarkdownLoaderComponent.prototype.loadFailed;
1226
- /** @type {?} */
1227
- TdFlavoredMarkdownLoaderComponent.prototype.buttonClicked;
1228
- /** @type {?} */
1229
- TdFlavoredMarkdownLoaderComponent.prototype.content;
1230
- /** @type {?} */
1231
- TdFlavoredMarkdownLoaderComponent.prototype.loading;
1232
- /**
1233
- * @type {?}
1234
- * @private
1235
- */
1236
- TdFlavoredMarkdownLoaderComponent.prototype._changeDetectorRef;
1237
- /**
1238
- * @type {?}
1239
- * @private
1240
- */
1241
- TdFlavoredMarkdownLoaderComponent.prototype._markdownUrlLoaderService;
1242
- }
1243
-
1244
- /**
1245
- * @fileoverview added by tsickle
1246
- * Generated from: flavored-markdown.module.ts
1247
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1248
- */
1249
- var CovalentFlavoredMarkdownModule = /** @class */ (function () {
1250
- function CovalentFlavoredMarkdownModule() {
1251
- }
1252
- return CovalentFlavoredMarkdownModule;
1253
- }());
1254
- CovalentFlavoredMarkdownModule.decorators = [
1255
- { type: core.NgModule, args: [{
1256
- imports: [
1257
- common.CommonModule,
1258
- checkbox.MatCheckboxModule,
1259
- list.MatListModule,
1260
- progressBar.MatProgressBarModule,
1261
- dataTable.CovalentDataTableModule,
1262
- highlight.CovalentHighlightModule,
1263
- markdown.CovalentMarkdownModule,
1264
- button.MatButtonModule,
1265
- ],
1266
- declarations: [
1267
- TdFlavoredListComponent,
1268
- TdFlavoredMarkdownComponent,
1269
- TdFlavoredMarkdownContainerDirective,
1270
- TdFlavoredMarkdownLoaderComponent,
1271
- TdFlavoredMarkdownButtonComponent,
1272
- ],
1273
- exports: [TdFlavoredMarkdownComponent, TdFlavoredMarkdownLoaderComponent],
1274
- },] }
1275
- ];
1276
-
1277
- /**
1278
- * @fileoverview added by tsickle
1279
- * Generated from: public_api.ts
1280
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1281
- */
1282
-
1283
- /**
1284
- * @fileoverview added by tsickle
1285
- * Generated from: index.ts
1286
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1287
- */
1288
-
1289
- /**
1290
- * @fileoverview added by tsickle
1291
- * Generated from: covalent-flavored-markdown.ts
1292
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1293
- */
1294
-
1295
- exports.CovalentFlavoredMarkdownModule = CovalentFlavoredMarkdownModule;
1296
- exports.TdFlavoredMarkdownButtonComponent = TdFlavoredMarkdownButtonComponent;
1297
- exports.TdFlavoredMarkdownComponent = TdFlavoredMarkdownComponent;
1298
- exports.TdFlavoredMarkdownContainerDirective = TdFlavoredMarkdownContainerDirective;
1299
- exports.TdFlavoredMarkdownLoaderComponent = TdFlavoredMarkdownLoaderComponent;
1300
- exports.ɵa = TdFlavoredListComponent;
1301
-
1302
- Object.defineProperty(exports, '__esModule', { value: true });
1303
-
1304
- })));
1305
- //# sourceMappingURL=covalent-flavored-markdown.umd.js.map