@ng-util/markdown 12.0.0 → 13.0.0
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/{esm2015/markdown-base.component.js → esm2020/markdown-base.component.mjs} +4 -4
- package/esm2020/markdown-preview.component.mjs +24 -0
- package/esm2020/markdown.component.mjs +82 -0
- package/{esm2015/markdown.config.js → esm2020/markdown.config.mjs} +0 -0
- package/{esm2015/markdown.module.js → esm2020/markdown.module.mjs} +5 -5
- package/esm2020/markdown.service.mjs +47 -0
- package/{esm2015/ng-util-markdown.js → esm2020/ng-util-markdown.mjs} +0 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/fesm2015/{ng-util-markdown.js → ng-util-markdown.mjs} +30 -26
- package/fesm2015/ng-util-markdown.mjs.map +1 -0
- package/fesm2020/ng-util-markdown.mjs +238 -0
- package/fesm2020/ng-util-markdown.mjs.map +1 -0
- package/package.json +20 -7
- package/bundles/ng-util-markdown.umd.js +0 -621
- package/bundles/ng-util-markdown.umd.js.map +0 -1
- package/esm2015/markdown-preview.component.js +0 -25
- package/esm2015/markdown.component.js +0 -75
- package/esm2015/markdown.service.js +0 -47
- package/fesm2015/ng-util-markdown.js.map +0 -1
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { __decorate, __metadata } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, Injectable, Inject, EventEmitter, Directive, Input, Output, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
4
|
+
import { InputNumber } from '@ng-util/util/convert';
|
|
5
|
+
import * as i1 from '@ng-util/lazy';
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
7
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
|
|
10
|
+
const NU_MARKDOWN_CONFIG = new InjectionToken('NU_MARKDOWN_CONFIG');
|
|
11
|
+
|
|
12
|
+
class NuMarkdownService {
|
|
13
|
+
constructor(config, lazySrv) {
|
|
14
|
+
this.lazySrv = lazySrv;
|
|
15
|
+
this.loading = false;
|
|
16
|
+
this.loaded = false;
|
|
17
|
+
this.notify$ = new Subject();
|
|
18
|
+
this.libs = config?.libs || [
|
|
19
|
+
`https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js`,
|
|
20
|
+
`https://cdn.jsdelivr.net/npm/vditor/dist/index.css`,
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
get notify() {
|
|
24
|
+
return this.notify$.asObservable();
|
|
25
|
+
}
|
|
26
|
+
load() {
|
|
27
|
+
if (this.loading) {
|
|
28
|
+
if (this.loaded) {
|
|
29
|
+
this.notify$.next();
|
|
30
|
+
}
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
this.loading = true;
|
|
34
|
+
const libs = this.libs;
|
|
35
|
+
this.lazySrv.monitor(libs).subscribe(() => {
|
|
36
|
+
this.loaded = true;
|
|
37
|
+
this.notify$.next();
|
|
38
|
+
});
|
|
39
|
+
this.lazySrv.load(libs);
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** @nocollapse */ /** @nocollapse */ NuMarkdownService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NuMarkdownService, deps: [{ token: NU_MARKDOWN_CONFIG }, { token: i1.NuLazyService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
44
|
+
/** @nocollapse */ /** @nocollapse */ NuMarkdownService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NuMarkdownService, providedIn: 'root' });
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NuMarkdownService, decorators: [{
|
|
46
|
+
type: Injectable,
|
|
47
|
+
args: [{ providedIn: 'root' }]
|
|
48
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
49
|
+
type: Inject,
|
|
50
|
+
args: [NU_MARKDOWN_CONFIG]
|
|
51
|
+
}] }, { type: i1.NuLazyService }]; } });
|
|
52
|
+
|
|
53
|
+
class NuMarkdownBaseComponent {
|
|
54
|
+
constructor(el, config, srv, ngZone) {
|
|
55
|
+
this.el = el;
|
|
56
|
+
this.config = config;
|
|
57
|
+
this.srv = srv;
|
|
58
|
+
this.ngZone = ngZone;
|
|
59
|
+
this.delay = 0;
|
|
60
|
+
this.disabled = false;
|
|
61
|
+
this.ready = new EventEmitter();
|
|
62
|
+
this.notify$ = this.srv.notify.subscribe(() => this.initDelay());
|
|
63
|
+
}
|
|
64
|
+
set value(v) {
|
|
65
|
+
this._value = v;
|
|
66
|
+
if (this.loaded) {
|
|
67
|
+
this.init();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
get instance() {
|
|
71
|
+
return this._instance;
|
|
72
|
+
}
|
|
73
|
+
initDelay() {
|
|
74
|
+
setTimeout(() => this.init(), this.delay);
|
|
75
|
+
}
|
|
76
|
+
get loaded() {
|
|
77
|
+
return !!window.Vditor;
|
|
78
|
+
}
|
|
79
|
+
ngAfterViewInit() {
|
|
80
|
+
if (this.loaded) {
|
|
81
|
+
this.initDelay();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
this.srv.load();
|
|
85
|
+
}
|
|
86
|
+
ngOnDestroy() {
|
|
87
|
+
this.notify$.unsubscribe();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/** @nocollapse */ /** @nocollapse */ NuMarkdownBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NuMarkdownBaseComponent, deps: [{ token: i0.ElementRef }, { token: NU_MARKDOWN_CONFIG }, { token: NuMarkdownService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
91
|
+
/** @nocollapse */ /** @nocollapse */ NuMarkdownBaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: NuMarkdownBaseComponent, inputs: { delay: "delay", disabled: "disabled", options: "options", value: "value" }, outputs: { ready: "ready" }, ngImport: i0 });
|
|
92
|
+
__decorate([
|
|
93
|
+
InputNumber(),
|
|
94
|
+
__metadata("design:type", Object)
|
|
95
|
+
], NuMarkdownBaseComponent.prototype, "delay", void 0);
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NuMarkdownBaseComponent, decorators: [{
|
|
97
|
+
type: Directive
|
|
98
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
99
|
+
type: Inject,
|
|
100
|
+
args: [NU_MARKDOWN_CONFIG]
|
|
101
|
+
}] }, { type: NuMarkdownService }, { type: i0.NgZone }]; }, propDecorators: { delay: [{
|
|
102
|
+
type: Input
|
|
103
|
+
}], disabled: [{
|
|
104
|
+
type: Input
|
|
105
|
+
}], options: [{
|
|
106
|
+
type: Input
|
|
107
|
+
}], ready: [{
|
|
108
|
+
type: Output
|
|
109
|
+
}], value: [{
|
|
110
|
+
type: Input
|
|
111
|
+
}] } });
|
|
112
|
+
|
|
113
|
+
class NuMarkdownPreviewComponent extends NuMarkdownBaseComponent {
|
|
114
|
+
init() {
|
|
115
|
+
this.ngZone.runOutsideAngular(async () => {
|
|
116
|
+
await Vditor.preview(this.el.nativeElement, this._value);
|
|
117
|
+
console.log(this.el.nativeElement.innerHTML);
|
|
118
|
+
this.ngZone.run(() => this.ready.emit(this.el.nativeElement.innerHTML));
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/** @nocollapse */ /** @nocollapse */ NuMarkdownPreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NuMarkdownPreviewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
123
|
+
/** @nocollapse */ /** @nocollapse */ NuMarkdownPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: NuMarkdownPreviewComponent, selector: "nu-markdown-preview", exportAs: ["nuMarkdownPreview"], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NuMarkdownPreviewComponent, decorators: [{
|
|
125
|
+
type: Component,
|
|
126
|
+
args: [{
|
|
127
|
+
selector: 'nu-markdown-preview',
|
|
128
|
+
template: ``,
|
|
129
|
+
exportAs: 'nuMarkdownPreview',
|
|
130
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
131
|
+
}]
|
|
132
|
+
}] });
|
|
133
|
+
|
|
134
|
+
class NuMarkdownComponent extends NuMarkdownBaseComponent {
|
|
135
|
+
constructor() {
|
|
136
|
+
super(...arguments);
|
|
137
|
+
this.onChange = (_) => { };
|
|
138
|
+
}
|
|
139
|
+
init() {
|
|
140
|
+
this.ngZone.runOutsideAngular(() => {
|
|
141
|
+
const options = {
|
|
142
|
+
value: this._value,
|
|
143
|
+
cache: {
|
|
144
|
+
enable: false,
|
|
145
|
+
},
|
|
146
|
+
mode: 'sv',
|
|
147
|
+
minHeight: 350,
|
|
148
|
+
input: (value) => {
|
|
149
|
+
this.ngZone.run(() => {
|
|
150
|
+
this._value = value;
|
|
151
|
+
this.onChange(value);
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
...this.config?.defaultOptions,
|
|
155
|
+
...this.options,
|
|
156
|
+
};
|
|
157
|
+
this._instance = new Vditor(this.el.nativeElement, options);
|
|
158
|
+
this.ngZone.run(() => this.ready.emit(this._instance));
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
setDisabled() {
|
|
162
|
+
if (!this.instance) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (this.disabled) {
|
|
166
|
+
this.instance.disabled();
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
this.instance.enable();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
writeValue(value) {
|
|
173
|
+
this._value = value || '';
|
|
174
|
+
if (this.instance) {
|
|
175
|
+
this.instance.setValue(this._value);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
registerOnChange(fn) {
|
|
179
|
+
this.onChange = fn;
|
|
180
|
+
}
|
|
181
|
+
registerOnTouched(_) { }
|
|
182
|
+
setDisabledState(_isDisabled) {
|
|
183
|
+
this.disabled = _isDisabled;
|
|
184
|
+
this.setDisabled();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/** @nocollapse */ /** @nocollapse */ NuMarkdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NuMarkdownComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
188
|
+
/** @nocollapse */ /** @nocollapse */ NuMarkdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: NuMarkdownComponent, selector: "nu-markdown", providers: [
|
|
189
|
+
{
|
|
190
|
+
provide: NG_VALUE_ACCESSOR,
|
|
191
|
+
useExisting: forwardRef((() => NuMarkdownComponent)),
|
|
192
|
+
multi: true,
|
|
193
|
+
},
|
|
194
|
+
], exportAs: ["nuMarkdown"], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
195
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NuMarkdownComponent, decorators: [{
|
|
196
|
+
type: Component,
|
|
197
|
+
args: [{
|
|
198
|
+
selector: 'nu-markdown',
|
|
199
|
+
template: ``,
|
|
200
|
+
exportAs: 'nuMarkdown',
|
|
201
|
+
providers: [
|
|
202
|
+
{
|
|
203
|
+
provide: NG_VALUE_ACCESSOR,
|
|
204
|
+
useExisting: forwardRef((() => NuMarkdownComponent)),
|
|
205
|
+
multi: true,
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
209
|
+
}]
|
|
210
|
+
}] });
|
|
211
|
+
|
|
212
|
+
const COMPONENTS = [NuMarkdownComponent, NuMarkdownPreviewComponent];
|
|
213
|
+
class NuMarkdownModule {
|
|
214
|
+
static forRoot(config) {
|
|
215
|
+
return {
|
|
216
|
+
ngModule: NuMarkdownModule,
|
|
217
|
+
providers: [{ provide: NU_MARKDOWN_CONFIG, useValue: config }],
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/** @nocollapse */ /** @nocollapse */ NuMarkdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NuMarkdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
222
|
+
/** @nocollapse */ /** @nocollapse */ NuMarkdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NuMarkdownModule, declarations: [NuMarkdownComponent, NuMarkdownPreviewComponent], imports: [CommonModule], exports: [NuMarkdownComponent, NuMarkdownPreviewComponent] });
|
|
223
|
+
/** @nocollapse */ /** @nocollapse */ NuMarkdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NuMarkdownModule, imports: [[CommonModule]] });
|
|
224
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NuMarkdownModule, decorators: [{
|
|
225
|
+
type: NgModule,
|
|
226
|
+
args: [{
|
|
227
|
+
imports: [CommonModule],
|
|
228
|
+
declarations: COMPONENTS,
|
|
229
|
+
exports: COMPONENTS,
|
|
230
|
+
}]
|
|
231
|
+
}] });
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Generated bundle index. Do not edit.
|
|
235
|
+
*/
|
|
236
|
+
|
|
237
|
+
export { NuMarkdownBaseComponent, NuMarkdownComponent, NuMarkdownModule, NuMarkdownPreviewComponent };
|
|
238
|
+
//# sourceMappingURL=ng-util-markdown.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-util-markdown.mjs","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"],"names":[],"mappings":";;;;;;;;;AAEO,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAC,oBAAoB,CAAC;;MCI7D,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,MAAM,EAAE,IAAI,IAAI;YAC1B,uDAAuD;YACvD,oDAAoD;SACrD,CAAC;KACH;IATD,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;KACpC;IASD,IAAI;QACF,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,IAAI,CAAC,MAAM,EAAE;gBACf,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;aACrB;YACD,OAAO,IAAI,CAAC;SACb;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QAEpB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAK,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC;YACnC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;SACrB,CAAC,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|
"description": "Vditor for Angular",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,13 +22,26 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@ng-util/util": "^10.0.0",
|
|
24
24
|
"@ng-util/lazy": "^10.0.0",
|
|
25
|
-
"tslib": "^2.
|
|
25
|
+
"tslib": "^2.3.0"
|
|
26
26
|
},
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"fesm2015": "fesm2015/ng-util-markdown.
|
|
27
|
+
"module": "fesm2015/ng-util-markdown.mjs",
|
|
28
|
+
"es2020": "fesm2020/ng-util-markdown.mjs",
|
|
29
|
+
"esm2020": "esm2020/ng-util-markdown.mjs",
|
|
30
|
+
"fesm2020": "fesm2020/ng-util-markdown.mjs",
|
|
31
|
+
"fesm2015": "fesm2015/ng-util-markdown.mjs",
|
|
32
32
|
"typings": "ng-util-markdown.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
"./package.json": {
|
|
35
|
+
"default": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./ng-util-markdown.d.ts",
|
|
39
|
+
"esm2020": "./esm2020/ng-util-markdown.mjs",
|
|
40
|
+
"es2020": "./fesm2020/ng-util-markdown.mjs",
|
|
41
|
+
"es2015": "./fesm2015/ng-util-markdown.mjs",
|
|
42
|
+
"node": "./fesm2015/ng-util-markdown.mjs",
|
|
43
|
+
"default": "./fesm2020/ng-util-markdown.mjs"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
33
46
|
"sideEffects": false
|
|
34
47
|
}
|