@ng-util/markdown 11.2.0 → 12.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,45 +1,16 @@
1
- import { InjectionToken, Injectable, Inject, ɵɵdefineInjectable, ɵɵinject, Directive, ElementRef, NgZone, Input, EventEmitter, Component, forwardRef, ChangeDetectionStrategy, Output, NgModule } from '@angular/core';
2
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
3
1
  import { __decorate, __metadata, __awaiter } from 'tslib';
2
+ import * as i0 from '@angular/core';
3
+ import { InjectionToken, Injectable, Inject, EventEmitter, Directive, ElementRef, NgZone, Input, Output, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
4
4
  import { InputNumber } from '@ng-util/util/convert';
5
+ import * as i2 from '@ng-util/lazy';
5
6
  import { NuLazyService } from '@ng-util/lazy';
6
7
  import { Subject } from 'rxjs';
8
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
7
9
  import { CommonModule } from '@angular/common';
8
10
 
9
- /**
10
- * @fileoverview added by tsickle
11
- * Generated from: markdown.config.ts
12
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
13
- */
14
- /** @type {?} */
15
11
  const NU_MARKDOWN_CONFIG = new InjectionToken('NU_MARKDOWN_CONFIG');
16
- /**
17
- * @record
18
- */
19
- function NuMarkdownConfig() { }
20
- if (false) {
21
- /**
22
- * The base URL to [Vditor](https://github.com/Vanessa219/vditor) library, Default: `['https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', 'https://cdn.jsdelivr.net/npm/vditor/dist/index.css']`
23
- * @type {?|undefined}
24
- */
25
- NuMarkdownConfig.prototype.libs;
26
- /**
27
- * Equar [IOptions](https://github.com/Vanessa219/vditor/blob/master/types/index.d.ts#L432)
28
- * @type {?|undefined}
29
- */
30
- NuMarkdownConfig.prototype.defaultOptions;
31
- }
32
12
 
33
- /**
34
- * @fileoverview added by tsickle
35
- * Generated from: markdown.service.ts
36
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
37
- */
38
13
  class NuMarkdownService {
39
- /**
40
- * @param {?} config
41
- * @param {?} lazySrv
42
- */
43
14
  constructor(config, lazySrv) {
44
15
  this.lazySrv = lazySrv;
45
16
  this.loading = false;
@@ -50,126 +21,69 @@ class NuMarkdownService {
50
21
  `https://cdn.jsdelivr.net/npm/vditor/dist/index.css`,
51
22
  ];
52
23
  }
53
- /**
54
- * @return {?}
55
- */
56
24
  get notify() {
57
25
  return this.notify$.asObservable();
58
26
  }
59
- /**
60
- * @template THIS
61
- * @this {THIS}
62
- * @return {THIS}
63
- */
64
27
  load() {
65
- if ((/** @type {?} */ (this)).loading) {
66
- if ((/** @type {?} */ (this)).loaded) {
67
- (/** @type {?} */ (this)).notify$.next();
28
+ if (this.loading) {
29
+ if (this.loaded) {
30
+ this.notify$.next();
68
31
  }
69
- return (/** @type {?} */ (this));
32
+ return this;
70
33
  }
71
- (/** @type {?} */ (this)).loading = true;
72
- /** @type {?} */
73
- const libs = (/** @type {?} */ ((/** @type {?} */ (this)).libs));
74
- (/** @type {?} */ (this)).lazySrv.monitor(libs).subscribe((/**
75
- * @return {?}
76
- */
77
- () => {
78
- (/** @type {?} */ (this)).loaded = true;
79
- (/** @type {?} */ (this)).notify$.next();
80
- }));
81
- (/** @type {?} */ (this)).lazySrv.load(libs);
82
- return (/** @type {?} */ (this));
34
+ this.loading = true;
35
+ const libs = this.libs;
36
+ this.lazySrv.monitor(libs).subscribe(() => {
37
+ this.loaded = true;
38
+ this.notify$.next();
39
+ });
40
+ this.lazySrv.load(libs);
41
+ return this;
83
42
  }
84
43
  }
44
+ /** @nocollapse */ NuMarkdownService.ɵprov = i0.ɵɵdefineInjectable({ factory: function NuMarkdownService_Factory() { return new NuMarkdownService(i0.ɵɵinject(NU_MARKDOWN_CONFIG), i0.ɵɵinject(i2.NuLazyService)); }, token: NuMarkdownService, providedIn: "root" });
45
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
85
46
  NuMarkdownService.decorators = [
86
47
  { type: Injectable, args: [{ providedIn: 'root' },] }
87
48
  ];
88
- /** @nocollapse */
49
+ /**
50
+ * @type {function(): !Array<(null|{
51
+ * type: ?,
52
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
53
+ * })>}
54
+ * @nocollapse
55
+ */
89
56
  NuMarkdownService.ctorParameters = () => [
90
57
  { type: undefined, decorators: [{ type: Inject, args: [NU_MARKDOWN_CONFIG,] }] },
91
58
  { type: NuLazyService }
92
59
  ];
93
- /** @nocollapse */ NuMarkdownService.ɵprov = ɵɵdefineInjectable({ factory: function NuMarkdownService_Factory() { return new NuMarkdownService(ɵɵinject(NU_MARKDOWN_CONFIG), ɵɵinject(NuLazyService)); }, token: NuMarkdownService, providedIn: "root" });
94
- if (false) {
95
- /**
96
- * @type {?}
97
- * @private
98
- */
99
- NuMarkdownService.prototype.libs;
100
- /**
101
- * @type {?}
102
- * @private
103
- */
104
- NuMarkdownService.prototype.loading;
105
- /**
106
- * @type {?}
107
- * @private
108
- */
109
- NuMarkdownService.prototype.loaded;
110
- /**
111
- * @type {?}
112
- * @private
113
- */
114
- NuMarkdownService.prototype.notify$;
115
- /**
116
- * @type {?}
117
- * @private
118
- */
119
- NuMarkdownService.prototype.lazySrv;
120
- }
121
60
 
122
- /**
123
- * @fileoverview added by tsickle
124
- * Generated from: markdown-base.component.ts
125
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
126
- */
127
- /**
128
- * @abstract
129
- */
130
61
  class NuMarkdownBaseComponent {
131
- /**
132
- * @param {?} el
133
- * @param {?} config
134
- * @param {?} srv
135
- * @param {?} ngZone
136
- */
137
62
  constructor(el, config, srv, ngZone) {
138
63
  this.el = el;
139
64
  this.config = config;
140
65
  this.srv = srv;
141
66
  this.ngZone = ngZone;
142
- this.notify$ = this.srv.notify.subscribe((/**
143
- * @return {?}
144
- */
145
- () => this.initDelay()));
67
+ this.delay = 0;
68
+ this.disabled = false;
69
+ this.ready = new EventEmitter();
70
+ this.notify$ = this.srv.notify.subscribe(() => this.initDelay());
71
+ }
72
+ set value(v) {
73
+ this._value = v;
74
+ if (this.loaded) {
75
+ this.init();
76
+ }
146
77
  }
147
- /**
148
- * @return {?}
149
- */
150
78
  get instance() {
151
79
  return this._instance;
152
80
  }
153
- /**
154
- * @private
155
- * @return {?}
156
- */
157
81
  initDelay() {
158
- setTimeout((/**
159
- * @return {?}
160
- */
161
- () => this.init()), this.delay);
82
+ setTimeout(() => this.init(), this.delay);
162
83
  }
163
- /**
164
- * @protected
165
- * @return {?}
166
- */
167
84
  get loaded() {
168
- return !!((/** @type {?} */ (window))).Vditor;
85
+ return !!window.Vditor;
169
86
  }
170
- /**
171
- * @return {?}
172
- */
173
87
  ngAfterViewInit() {
174
88
  if (this.loaded) {
175
89
  this.initDelay();
@@ -177,123 +91,79 @@ class NuMarkdownBaseComponent {
177
91
  }
178
92
  this.srv.load();
179
93
  }
180
- /**
181
- * @return {?}
182
- */
183
94
  ngOnDestroy() {
184
95
  this.notify$.unsubscribe();
185
96
  }
186
97
  }
98
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
187
99
  NuMarkdownBaseComponent.decorators = [
188
100
  { type: Directive }
189
101
  ];
190
- /** @nocollapse */
102
+ /**
103
+ * @type {function(): !Array<(null|{
104
+ * type: ?,
105
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
106
+ * })>}
107
+ * @nocollapse
108
+ */
191
109
  NuMarkdownBaseComponent.ctorParameters = () => [
192
110
  { type: ElementRef },
193
111
  { type: undefined, decorators: [{ type: Inject, args: [NU_MARKDOWN_CONFIG,] }] },
194
112
  { type: NuMarkdownService },
195
113
  { type: NgZone }
196
114
  ];
115
+ /** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
197
116
  NuMarkdownBaseComponent.propDecorators = {
198
- delay: [{ type: Input }]
117
+ delay: [{ type: Input }],
118
+ disabled: [{ type: Input }],
119
+ options: [{ type: Input }],
120
+ ready: [{ type: Output }],
121
+ value: [{ type: Input }]
199
122
  };
200
123
  __decorate([
201
124
  InputNumber(),
202
- __metadata("design:type", Number)
125
+ __metadata("design:type", Object)
203
126
  ], NuMarkdownBaseComponent.prototype, "delay", void 0);
204
- if (false) {
205
- /**
206
- * @type {?}
207
- * @private
208
- */
209
- NuMarkdownBaseComponent.prototype.notify$;
210
- /**
211
- * @type {?}
212
- * @protected
213
- */
214
- NuMarkdownBaseComponent.prototype._instance;
215
- /** @type {?} */
216
- NuMarkdownBaseComponent.prototype.delay;
217
- /**
218
- * @type {?}
219
- * @protected
220
- */
221
- NuMarkdownBaseComponent.prototype.el;
222
- /**
223
- * @type {?}
224
- * @protected
225
- */
226
- NuMarkdownBaseComponent.prototype.config;
227
- /**
228
- * @type {?}
229
- * @protected
230
- */
231
- NuMarkdownBaseComponent.prototype.srv;
232
- /**
233
- * @type {?}
234
- * @protected
235
- */
236
- NuMarkdownBaseComponent.prototype.ngZone;
237
- /**
238
- * @abstract
239
- * @protected
240
- * @return {?}
241
- */
242
- NuMarkdownBaseComponent.prototype.init = function () { };
127
+
128
+ class NuMarkdownPreviewComponent extends NuMarkdownBaseComponent {
129
+ init() {
130
+ this.ngZone.runOutsideAngular(() => __awaiter(this, void 0, void 0, function* () {
131
+ yield Vditor.preview(this.el.nativeElement, this._value);
132
+ console.log(this.el.nativeElement.innerHTML);
133
+ this.ngZone.run(() => this.ready.emit(this.el.nativeElement.innerHTML));
134
+ }));
135
+ }
243
136
  }
137
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
138
+ NuMarkdownPreviewComponent.decorators = [
139
+ { type: Component, args: [{
140
+ selector: 'nu-markdown-preview',
141
+ template: ``,
142
+ exportAs: 'nuMarkdownPreview',
143
+ changeDetection: ChangeDetectionStrategy.OnPush
144
+ },] }
145
+ ];
244
146
 
245
- /**
246
- * @fileoverview added by tsickle
247
- * Generated from: markdown.component.ts
248
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
249
- */
250
147
  class NuMarkdownComponent extends NuMarkdownBaseComponent {
251
148
  constructor() {
252
149
  super(...arguments);
253
- this.ready = new EventEmitter();
254
- this.onChange = (/**
255
- * @param {?} _
256
- * @return {?}
257
- */
258
- (_) => { });
150
+ this.onChange = (_) => { };
259
151
  }
260
- /**
261
- * @protected
262
- * @return {?}
263
- */
264
152
  init() {
265
- this.ngZone.runOutsideAngular((/**
266
- * @return {?}
267
- */
268
- () => {
153
+ this.ngZone.runOutsideAngular(() => {
269
154
  var _a;
270
- /** @type {?} */
271
155
  const options = Object.assign(Object.assign({ value: this._value, cache: {
272
156
  enable: false,
273
- }, mode: 'sv', minHeight: 350, input: (/**
274
- * @param {?} value
275
- * @return {?}
276
- */
277
- (value) => {
278
- this.ngZone.run((/**
279
- * @return {?}
280
- */
281
- () => {
157
+ }, mode: 'sv', minHeight: 350, input: (value) => {
158
+ this.ngZone.run(() => {
282
159
  this._value = value;
283
160
  this.onChange(value);
284
- }));
285
- }) }, (_a = this.config) === null || _a === void 0 ? void 0 : _a.defaultOptions), this.options);
161
+ });
162
+ } }, (_a = this.config) === null || _a === void 0 ? void 0 : _a.defaultOptions), this.options);
286
163
  this._instance = new Vditor(this.el.nativeElement, options);
287
- this.ngZone.run((/**
288
- * @return {?}
289
- */
290
- () => this.ready.emit(this._instance)));
291
- }));
164
+ this.ngZone.run(() => this.ready.emit(this._instance));
165
+ });
292
166
  }
293
- /**
294
- * @private
295
- * @return {?}
296
- */
297
167
  setDisabled() {
298
168
  if (!this.instance) {
299
169
  return;
@@ -305,37 +175,22 @@ class NuMarkdownComponent extends NuMarkdownBaseComponent {
305
175
  this.instance.enable();
306
176
  }
307
177
  }
308
- /**
309
- * @param {?} value
310
- * @return {?}
311
- */
312
178
  writeValue(value) {
313
179
  this._value = value || '';
314
180
  if (this.instance) {
315
181
  this.instance.setValue(this._value);
316
182
  }
317
183
  }
318
- /**
319
- * @param {?} fn
320
- * @return {?}
321
- */
322
184
  registerOnChange(fn) {
323
185
  this.onChange = fn;
324
186
  }
325
- /**
326
- * @param {?} _
327
- * @return {?}
328
- */
329
187
  registerOnTouched(_) { }
330
- /**
331
- * @param {?} _isDisabled
332
- * @return {?}
333
- */
334
188
  setDisabledState(_isDisabled) {
335
189
  this.disabled = _isDisabled;
336
190
  this.setDisabled();
337
191
  }
338
192
  }
193
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
339
194
  NuMarkdownComponent.decorators = [
340
195
  { type: Component, args: [{
341
196
  selector: 'nu-markdown',
@@ -344,118 +199,16 @@ NuMarkdownComponent.decorators = [
344
199
  providers: [
345
200
  {
346
201
  provide: NG_VALUE_ACCESSOR,
347
- useExisting: forwardRef((/**
348
- * @return {?}
349
- */
350
- () => NuMarkdownComponent)),
202
+ useExisting: forwardRef(() => NuMarkdownComponent),
351
203
  multi: true,
352
204
  },
353
205
  ],
354
206
  changeDetection: ChangeDetectionStrategy.OnPush
355
- }] }
356
- ];
357
- NuMarkdownComponent.propDecorators = {
358
- options: [{ type: Input }],
359
- disabled: [{ type: Input }],
360
- ready: [{ type: Output }]
361
- };
362
- if (false) {
363
- /**
364
- * @type {?}
365
- * @private
366
- */
367
- NuMarkdownComponent.prototype._value;
368
- /** @type {?} */
369
- NuMarkdownComponent.prototype.options;
370
- /** @type {?} */
371
- NuMarkdownComponent.prototype.disabled;
372
- /** @type {?} */
373
- NuMarkdownComponent.prototype.ready;
374
- /**
375
- * @type {?}
376
- * @private
377
- */
378
- NuMarkdownComponent.prototype.onChange;
379
- }
380
-
381
- /**
382
- * @fileoverview added by tsickle
383
- * Generated from: markdown-preview.component.ts
384
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
385
- */
386
- class NuMarkdownPreviewComponent extends NuMarkdownBaseComponent {
387
- constructor() {
388
- super(...arguments);
389
- this.ready = new EventEmitter();
390
- }
391
- /**
392
- * @param {?} v
393
- * @return {?}
394
- */
395
- set value(v) {
396
- this._value = v;
397
- if (this.loaded) {
398
- this.init();
399
- }
400
- }
401
- /**
402
- * @protected
403
- * @return {?}
404
- */
405
- init() {
406
- this.ngZone.runOutsideAngular((/**
407
- * @return {?}
408
- */
409
- () => __awaiter(this, void 0, void 0, function* () {
410
- yield Vditor.preview(this.el.nativeElement, this._value);
411
- console.log(this.el.nativeElement.innerHTML);
412
- this.ngZone.run((/**
413
- * @return {?}
414
- */
415
- () => this.ready.emit(this.el.nativeElement.innerHTML)));
416
- })));
417
- }
418
- }
419
- NuMarkdownPreviewComponent.decorators = [
420
- { type: Component, args: [{
421
- selector: 'nu-markdown-preview',
422
- template: `{{ value }}`,
423
- exportAs: 'nuMarkdownPreview',
424
- changeDetection: ChangeDetectionStrategy.OnPush
425
- }] }
207
+ },] }
426
208
  ];
427
- NuMarkdownPreviewComponent.propDecorators = {
428
- value: [{ type: Input }],
429
- options: [{ type: Input }],
430
- disabled: [{ type: Input }],
431
- ready: [{ type: Output }]
432
- };
433
- if (false) {
434
- /**
435
- * @type {?}
436
- * @private
437
- */
438
- NuMarkdownPreviewComponent.prototype._value;
439
- /** @type {?} */
440
- NuMarkdownPreviewComponent.prototype.options;
441
- /** @type {?} */
442
- NuMarkdownPreviewComponent.prototype.disabled;
443
- /** @type {?} */
444
- NuMarkdownPreviewComponent.prototype.ready;
445
- }
446
209
 
447
- /**
448
- * @fileoverview added by tsickle
449
- * Generated from: markdown.module.ts
450
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
451
- */
452
- /** @type {?} */
453
210
  const COMPONENTS = [NuMarkdownComponent, NuMarkdownPreviewComponent];
454
211
  class NuMarkdownModule {
455
- /**
456
- * @param {?=} config
457
- * @return {?}
458
- */
459
212
  static forRoot(config) {
460
213
  return {
461
214
  ngModule: NuMarkdownModule,
@@ -463,6 +216,7 @@ class NuMarkdownModule {
463
216
  };
464
217
  }
465
218
  }
219
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
466
220
  NuMarkdownModule.decorators = [
467
221
  { type: NgModule, args: [{
468
222
  imports: [CommonModule],
@@ -472,16 +226,8 @@ NuMarkdownModule.decorators = [
472
226
  ];
473
227
 
474
228
  /**
475
- * @fileoverview added by tsickle
476
- * Generated from: public-api.ts
477
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
478
- */
479
-
480
- /**
481
- * @fileoverview added by tsickle
482
- * Generated from: ng-util-markdown.ts
483
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
229
+ * Generated bundle index. Do not edit.
484
230
  */
485
231
 
486
- export { NuMarkdownComponent, NuMarkdownModule, NuMarkdownBaseComponent as ɵa, NU_MARKDOWN_CONFIG as ɵb, NuMarkdownService as ɵd, NuMarkdownPreviewComponent as ɵe };
232
+ export { NuMarkdownBaseComponent, NuMarkdownComponent, NuMarkdownModule, NuMarkdownPreviewComponent, NU_MARKDOWN_CONFIG as ɵa, NuMarkdownService as ɵc };
487
233
  //# sourceMappingURL=ng-util-markdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ng-util-markdown.js","sources":["../../../../../packages/markdown/markdown.config.ts","../../../../../packages/markdown/markdown.service.ts","../../../../../packages/markdown/markdown-base.component.ts","../../../../../packages/markdown/markdown.component.ts","../../../../../packages/markdown/markdown-preview.component.ts","../../../../../packages/markdown/markdown.module.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const NU_MARKDOWN_CONFIG = new InjectionToken('NU_MARKDOWN_CONFIG');\n\nexport interface NuMarkdownConfig {\n /**\n * The base URL to [Vditor](https://github.com/Vanessa219/vditor) library, Default: `['https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', 'https://cdn.jsdelivr.net/npm/vditor/dist/index.css']`\n */\n libs?: string[];\n\n /**\n * Equar [IOptions](https://github.com/Vanessa219/vditor/blob/master/types/index.d.ts#L432)\n */\n defaultOptions?: any;\n}\n","import { Inject, Injectable } from '@angular/core';\nimport { NuLazyService } from '@ng-util/lazy';\nimport { Observable, Subject } from 'rxjs';\nimport { NuMarkdownConfig, NU_MARKDOWN_CONFIG } from './markdown.config';\n\n@Injectable({ providedIn: 'root' })\nexport class NuMarkdownService {\n private libs: string[];\n private loading = false;\n private loaded = false;\n private notify$ = new Subject<void>();\n\n get notify(): Observable<void> {\n return this.notify$.asObservable();\n }\n\n constructor(@Inject(NU_MARKDOWN_CONFIG) config: NuMarkdownConfig, private lazySrv: NuLazyService) {\n this.libs = config?.libs || [\n `https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js`,\n `https://cdn.jsdelivr.net/npm/vditor/dist/index.css`,\n ];\n }\n\n load(): this {\n if (this.loading) {\n if (this.loaded) {\n this.notify$.next();\n }\n return this;\n }\n this.loading = true;\n\n const libs = this.libs!;\n this.lazySrv.monitor(libs).subscribe(() => {\n this.loaded = true;\n this.notify$.next();\n });\n this.lazySrv.load(libs);\n\n return this;\n }\n}\n","import { AfterViewInit, Directive, ElementRef, Inject, Input, NgZone, OnDestroy } from '@angular/core';\nimport { InputNumber } from '@ng-util/util/convert';\nimport { Subscription } from 'rxjs';\nimport { NuMarkdownConfig, NU_MARKDOWN_CONFIG } from './markdown.config';\nimport { NuMarkdownService } from './markdown.service';\n\n@Directive()\nexport abstract class NuMarkdownBaseComponent implements AfterViewInit, OnDestroy {\n private notify$: Subscription;\n protected _instance: any;\n\n @Input() @InputNumber() delay: number;\n\n get instance(): any {\n return this._instance;\n }\n\n constructor(\n protected el: ElementRef<HTMLElement>,\n @Inject(NU_MARKDOWN_CONFIG) protected config: NuMarkdownConfig,\n protected srv: NuMarkdownService,\n protected ngZone: NgZone,\n ) {\n this.notify$ = this.srv.notify.subscribe(() => this.initDelay());\n }\n\n private initDelay(): void {\n setTimeout(() => this.init(), this.delay);\n }\n\n protected abstract init(): void;\n\n protected get loaded(): boolean {\n return !!(window as any).Vditor;\n }\n\n ngAfterViewInit(): void {\n if (this.loaded) {\n this.initDelay();\n return;\n }\n this.srv.load();\n }\n\n ngOnDestroy(): void {\n this.notify$.unsubscribe();\n }\n}\n","import { ChangeDetectionStrategy, Component, EventEmitter, forwardRef, Input, Output } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { NuMarkdownBaseComponent } from './markdown-base.component';\n\ndeclare var Vditor: any;\n\n@Component({\n selector: 'nu-markdown',\n template: ``,\n exportAs: 'nuMarkdown',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NuMarkdownComponent),\n multi: true,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NuMarkdownComponent extends NuMarkdownBaseComponent implements ControlValueAccessor {\n private _value: string;\n @Input() options: any;\n @Input() disabled: boolean;\n @Output() ready = new EventEmitter<any>();\n private onChange = (_: string) => {};\n\n protected init(): void {\n this.ngZone.runOutsideAngular(() => {\n const options = {\n value: this._value,\n cache: {\n enable: false,\n },\n mode: 'sv',\n minHeight: 350,\n input: (value: string) => {\n this.ngZone.run(() => {\n this._value = value;\n this.onChange(value);\n });\n },\n ...this.config?.defaultOptions,\n ...this.options,\n };\n this._instance = new Vditor(this.el.nativeElement, options);\n this.ngZone.run(() => this.ready.emit(this._instance));\n });\n }\n\n private setDisabled(): void {\n if (!this.instance) {\n return;\n }\n if (this.disabled) {\n this.instance.disabled();\n } else {\n this.instance.enable();\n }\n }\n\n writeValue(value: string): void {\n this._value = value || '';\n if (this.instance) {\n this.instance.setValue(this._value);\n }\n }\n\n registerOnChange(fn: (_: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(_: () => void): void {}\n\n setDisabledState(_isDisabled: boolean): void {\n this.disabled = _isDisabled;\n this.setDisabled();\n }\n}\n","import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';\nimport { NuMarkdownBaseComponent } from './markdown-base.component';\n\ndeclare var Vditor: any;\n\n@Component({\n selector: 'nu-markdown-preview',\n template: `{{ value }}`,\n exportAs: 'nuMarkdownPreview',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NuMarkdownPreviewComponent extends NuMarkdownBaseComponent {\n private _value: string;\n @Input()\n set value(v: string) {\n this._value = v;\n if (this.loaded) {\n this.init();\n }\n }\n @Input() options: any;\n @Input() disabled: boolean;\n @Output() ready = new EventEmitter<string>();\n\n protected init(): void {\n this.ngZone.runOutsideAngular(async () => {\n await Vditor.preview(this.el.nativeElement, this._value);\n console.log(this.el.nativeElement.innerHTML);\n this.ngZone.run(() => this.ready.emit(this.el.nativeElement.innerHTML));\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\nimport { NuMarkdownPreviewComponent } from './markdown-preview.component';\nimport { NuMarkdownComponent } from './markdown.component';\nimport { NuMarkdownConfig, NU_MARKDOWN_CONFIG } from './markdown.config';\n\nconst COMPONENTS = [NuMarkdownComponent, NuMarkdownPreviewComponent];\n\n@NgModule({\n imports: [CommonModule],\n declarations: COMPONENTS,\n exports: COMPONENTS,\n})\nexport class NuMarkdownModule {\n static forRoot(config?: NuMarkdownConfig): ModuleWithProviders<NuMarkdownModule> {\n return {\n ngModule: NuMarkdownModule,\n providers: [{ provide: NU_MARKDOWN_CONFIG, useValue: config }],\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAEa,kBAAkB,GAAG,IAAI,cAAc,CAAC,oBAAoB;;;;+BAYxE;;;;;;IANC,gCAAgB;;;;;IAKhB,0CAAqB;;;;;;;;MCPV,iBAAi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CAAC;SACzE,CAAA,EAAC,CAAC;KACJ;;;YAzBF,SAAS,SAAC;gBACT,QAAQ,EAAE,qBAAqB;gBAC/B,QAAQ,EAAE,aAAa;gBACvB,QAAQ,EAAE,mBAAmB;gBAC7B,eAAe,EAAE,uBAAuB,CAAC,MAAM;aAChD;;;oBAGE,KAAK;sBAOL,KAAK;uBACL,KAAK;oBACL,MAAM;;;;;;;IAVP,4CAAuB;;IAQvB,6CAAsB;;IACtB,8CAA2B;;IAC3B,2CAA6C;;;;;;;;;MChBzC,UAAU,GAAG,CAAC,mBAAmB,EAAE,0BAA0B,CAAC;MAOvD,gBAAgB;;;;;IAC3B,OAAO,OAAO,CAAC,MAAyB;QACtC,OAAO;YACL,QAAQ,EAAE,gBAAgB;YAC1B,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;SAC/D,CAAC;KACH;;;YAXF,QAAQ,SAAC;gBACR,OAAO,EAAE,CAAC,YAAY,CAAC;gBACvB,YAAY,EAAE,UAAU;gBACxB,OAAO,EAAE,UAAU;aACpB;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ng-util-markdown.js","sources":["../../../../packages/markdown/markdown.config.ts","../../../../packages/markdown/markdown.service.ts","../../../../packages/markdown/markdown-base.component.ts","../../../../packages/markdown/markdown-preview.component.ts","../../../../packages/markdown/markdown.component.ts","../../../../packages/markdown/markdown.module.ts","../../../../packages/markdown/ng-util-markdown.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const NU_MARKDOWN_CONFIG = new InjectionToken('NU_MARKDOWN_CONFIG');\n\nexport interface NuMarkdownConfig {\n /**\n * The base URL to [Vditor](https://github.com/Vanessa219/vditor) library, Default: `['https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', 'https://cdn.jsdelivr.net/npm/vditor/dist/index.css']`\n */\n libs?: string[];\n\n /**\n * Equar [IOptions](https://github.com/Vanessa219/vditor/blob/master/types/index.d.ts#L432)\n */\n defaultOptions?: any;\n}\n","import { Inject, Injectable } from '@angular/core';\nimport { NuLazyService } from '@ng-util/lazy';\nimport { Observable, Subject } from 'rxjs';\nimport { NuMarkdownConfig, NU_MARKDOWN_CONFIG } from './markdown.config';\n\n@Injectable({ providedIn: 'root' })\nexport class NuMarkdownService {\n private libs: string[];\n private loading = false;\n private loaded = false;\n private notify$ = new Subject<void>();\n\n get notify(): Observable<void> {\n return this.notify$.asObservable();\n }\n\n constructor(@Inject(NU_MARKDOWN_CONFIG) config: NuMarkdownConfig, private lazySrv: NuLazyService) {\n this.libs = config?.libs || [\n `https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js`,\n `https://cdn.jsdelivr.net/npm/vditor/dist/index.css`,\n ];\n }\n\n load(): this {\n if (this.loading) {\n if (this.loaded) {\n this.notify$.next();\n }\n return this;\n }\n this.loading = true;\n\n const libs = this.libs!;\n this.lazySrv.monitor(libs).subscribe(() => {\n this.loaded = true;\n this.notify$.next();\n });\n this.lazySrv.load(libs);\n\n return this;\n }\n}\n","import { AfterViewInit, Directive, ElementRef, EventEmitter, Inject, Input, NgZone, OnDestroy, Output } from '@angular/core';\nimport { InputNumber } from '@ng-util/util/convert';\nimport { Subscription } from 'rxjs';\nimport { NuMarkdownConfig, NU_MARKDOWN_CONFIG } from './markdown.config';\nimport { NuMarkdownService } from './markdown.service';\n\n@Directive()\nexport abstract class NuMarkdownBaseComponent implements AfterViewInit, OnDestroy {\n private notify$: Subscription;\n protected _instance: any;\n\n @Input() @InputNumber() delay = 0;\n @Input() disabled = false;\n @Input() options: any;\n @Output() ready = new EventEmitter<string>();\n\n protected _value!: string;\n @Input()\n set value(v: string) {\n this._value = v;\n if (this.loaded) {\n this.init();\n }\n }\n\n get instance(): any {\n return this._instance;\n }\n\n constructor(\n protected el: ElementRef<HTMLElement>,\n @Inject(NU_MARKDOWN_CONFIG) protected config: NuMarkdownConfig,\n protected srv: NuMarkdownService,\n protected ngZone: NgZone,\n ) {\n this.notify$ = this.srv.notify.subscribe(() => this.initDelay());\n }\n\n private initDelay(): void {\n setTimeout(() => this.init(), this.delay);\n }\n\n protected abstract init(): void;\n\n protected get loaded(): boolean {\n return !!(window as any).Vditor;\n }\n\n ngAfterViewInit(): void {\n if (this.loaded) {\n this.initDelay();\n return;\n }\n this.srv.load();\n }\n\n ngOnDestroy(): void {\n this.notify$.unsubscribe();\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { NuMarkdownBaseComponent } from './markdown-base.component';\n\ndeclare var Vditor: any;\n\n@Component({\n selector: 'nu-markdown-preview',\n template: ``,\n exportAs: 'nuMarkdownPreview',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NuMarkdownPreviewComponent extends NuMarkdownBaseComponent {\n protected init(): void {\n this.ngZone.runOutsideAngular(async () => {\n await Vditor.preview(this.el.nativeElement, this._value);\n console.log(this.el.nativeElement.innerHTML);\n this.ngZone.run(() => this.ready.emit(this.el.nativeElement.innerHTML));\n });\n }\n}\n","import { ChangeDetectionStrategy, Component, forwardRef } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { NuMarkdownBaseComponent } from './markdown-base.component';\n\ndeclare var Vditor: any;\n\n@Component({\n selector: 'nu-markdown',\n template: ``,\n exportAs: 'nuMarkdown',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NuMarkdownComponent),\n multi: true,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NuMarkdownComponent extends NuMarkdownBaseComponent implements ControlValueAccessor {\n private onChange = (_: string) => {};\n\n protected init(): void {\n this.ngZone.runOutsideAngular(() => {\n const options = {\n value: this._value,\n cache: {\n enable: false,\n },\n mode: 'sv',\n minHeight: 350,\n input: (value: string) => {\n this.ngZone.run(() => {\n this._value = value;\n this.onChange(value);\n });\n },\n ...this.config?.defaultOptions,\n ...this.options,\n };\n this._instance = new Vditor(this.el.nativeElement, options);\n this.ngZone.run(() => this.ready.emit(this._instance));\n });\n }\n\n private setDisabled(): void {\n if (!this.instance) {\n return;\n }\n if (this.disabled) {\n this.instance.disabled();\n } else {\n this.instance.enable();\n }\n }\n\n writeValue(value: string): void {\n this._value = value || '';\n if (this.instance) {\n this.instance.setValue(this._value);\n }\n }\n\n registerOnChange(fn: (_: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(_: () => void): void {}\n\n setDisabledState(_isDisabled: boolean): void {\n this.disabled = _isDisabled;\n this.setDisabled();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\nimport { NuMarkdownPreviewComponent } from './markdown-preview.component';\nimport { NuMarkdownComponent } from './markdown.component';\nimport { NuMarkdownConfig, NU_MARKDOWN_CONFIG } from './markdown.config';\n\nconst COMPONENTS = [NuMarkdownComponent, NuMarkdownPreviewComponent];\n\n@NgModule({\n imports: [CommonModule],\n declarations: COMPONENTS,\n exports: COMPONENTS,\n})\nexport class NuMarkdownModule {\n static forRoot(config?: NuMarkdownConfig): ModuleWithProviders<NuMarkdownModule> {\n return {\n ngModule: NuMarkdownModule,\n providers: [{ provide: NU_MARKDOWN_CONFIG, useValue: config }],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {NU_MARKDOWN_CONFIG as ɵa,NuMarkdownConfig as ɵb} from './markdown.config';\nexport {NuMarkdownService as ɵc} from './markdown.service';"],"names":[],"mappings":";;;;;;;;;;MAEa,kBAAkB,GAAG,IAAI,cAAc,CAAC,oBAAoB;;MCI5D,iBAAiB;IAU5B,YAAwC,MAAwB,EAAU,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;QARxF,YAAO,GAAG,KAAK,CAAC;QAChB,WAAM,GAAG,KAAK,CAAC;QACf,YAAO,GAAG,IAAI,OAAO,EAAQ,CAAC;QAOpC,IAAI,CAAC,IAAI,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN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AAI,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE,CAAC;QAC1B,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACrC;KACF;IAED,gBAAgB,CAAC,EAAuB;QACtC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;KACpB;IAED,iBAAiB,CAAC,CAAa,KAAU;IAEzC,gBAAgB,CAAC,WAAoB;QACnC,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC;QAC5B,IAAI,CAAC,WAAW,EAAE,CAAC;KACpB;;;;YAlEF,SAAS,SAAC;gBACT,QAAQ,EAAE,aAAa;gBACvB,QAAQ,EAAE,EAAE;gBACZ,QAAQ,EAAE,YAAY;gBACtB,SAAS,EAAE;oBACT;wBACE,OAAO,EAAE,iBAAiB;wBAC1B,WAAW,EAAE,UAAU,CAAC,MAAM,mBAAmB,CAAC;wBAClD,KAAK,EAAE,IAAI;qBACZ;iBACF;gBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;aAChD;;;ACZD,MAAM,UAAU,GAAG,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC;MAOxD,gBAAgB;IAC3B,OAAO,OAAO,CAAC,MAAyB;QACtC,OAAO;YACL,QAAQ,EAAE,gBAAgB;YAC1B,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;SAC/D,CAAC;KACH;;;;YAXF,QAAQ,SAAC;gBACR,OAAO,EAAE,CAAC,YAAY,CAAC;gBACvB,YAAY,EAAE,UAAU;gBACxB,OAAO,EAAE,UAAU;aACpB;;;ACZD;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { AfterViewInit, ElementRef, NgZone, OnDestroy } from '@angular/core';
1
+ import { AfterViewInit, ElementRef, EventEmitter, NgZone, OnDestroy } from '@angular/core';
2
2
  import { NuMarkdownConfig } from './markdown.config';
3
3
  import { NuMarkdownService } from './markdown.service';
4
4
  export declare abstract class NuMarkdownBaseComponent implements AfterViewInit, OnDestroy {
@@ -9,6 +9,11 @@ export declare abstract class NuMarkdownBaseComponent implements AfterViewInit,
9
9
  private notify$;
10
10
  protected _instance: any;
11
11
  delay: number;
12
+ disabled: boolean;
13
+ options: any;
14
+ ready: EventEmitter<string>;
15
+ protected _value: string;
16
+ set value(v: string);
12
17
  get instance(): any;
13
18
  constructor(el: ElementRef<HTMLElement>, config: NuMarkdownConfig, srv: NuMarkdownService, ngZone: NgZone);
14
19
  private initDelay;
@@ -1,10 +1,4 @@
1
- import { EventEmitter } from '@angular/core';
2
1
  import { NuMarkdownBaseComponent } from './markdown-base.component';
3
2
  export declare class NuMarkdownPreviewComponent extends NuMarkdownBaseComponent {
4
- private _value;
5
- set value(v: string);
6
- options: any;
7
- disabled: boolean;
8
- ready: EventEmitter<string>;
9
3
  protected init(): void;
10
4
  }
@@ -1,11 +1,6 @@
1
- import { EventEmitter } from '@angular/core';
2
1
  import { ControlValueAccessor } from '@angular/forms';
3
2
  import { NuMarkdownBaseComponent } from './markdown-base.component';
4
3
  export declare class NuMarkdownComponent extends NuMarkdownBaseComponent implements ControlValueAccessor {
5
- private _value;
6
- options: any;
7
- disabled: boolean;
8
- ready: EventEmitter<any>;
9
4
  private onChange;
10
5
  protected init(): void;
11
6
  private setDisabled;
@@ -2,7 +2,5 @@
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
4
  export * from './public-api';
5
- export { NuMarkdownBaseComponent as ɵa } from './markdown-base.component';
6
- export { NuMarkdownPreviewComponent as ɵe } from './markdown-preview.component';
7
- export { NU_MARKDOWN_CONFIG as ɵb, NuMarkdownConfig as ɵc } from './markdown.config';
8
- export { NuMarkdownService as ɵd } from './markdown.service';
5
+ export { NU_MARKDOWN_CONFIG as ɵa, NuMarkdownConfig as ɵb } from './markdown.config';
6
+ export { NuMarkdownService as ɵc } from './markdown.service';