@ecodev/natural-editor 41.2.0 → 42.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.
Files changed (36) hide show
  1. package/{esm2015/ecodev-natural-editor.js → esm2020/ecodev-natural-editor.mjs} +0 -0
  2. package/esm2020/lib/editor/editor.component.mjs +213 -0
  3. package/{esm2015/lib/editor.module.js → esm2020/lib/editor.module.mjs} +4 -4
  4. package/{esm2015/lib/link-dialog/link-dialog.component.js → esm2020/lib/link-dialog/link-dialog.component.mjs} +5 -8
  5. package/esm2020/lib/utils/image.mjs +81 -0
  6. package/esm2020/lib/utils/inputrules.mjs +70 -0
  7. package/esm2020/lib/utils/item.mjs +39 -0
  8. package/esm2020/lib/utils/keymap.mjs +115 -0
  9. package/esm2020/lib/utils/menu.mjs +184 -0
  10. package/esm2020/lib/utils/paragraph-with-alignment.mjs +43 -0
  11. package/esm2020/lib/utils/schema.mjs +51 -0
  12. package/{esm2015/lib/utils/table.js → esm2020/lib/utils/table.mjs} +2 -2
  13. package/esm2020/lib/utils/text-align-item.mjs +81 -0
  14. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  15. package/fesm2015/ecodev-natural-editor.mjs +995 -0
  16. package/fesm2015/ecodev-natural-editor.mjs.map +1 -0
  17. package/fesm2020/ecodev-natural-editor.mjs +1001 -0
  18. package/fesm2020/ecodev-natural-editor.mjs.map +1 -0
  19. package/lib/editor/editor.component.d.ts +1 -0
  20. package/lib/utils/inputrules.d.ts +7 -0
  21. package/lib/utils/item.d.ts +30 -0
  22. package/lib/utils/keymap.d.ts +32 -0
  23. package/lib/utils/menu.d.ts +2 -31
  24. package/lib/utils/paragraph-with-alignment.d.ts +2 -0
  25. package/lib/utils/text-align-item.d.ts +6 -0
  26. package/package.json +31 -10
  27. package/src/lib/editor/_editor.theme.scss +1 -1
  28. package/theming/_natural-editor.theme.scss +1 -1
  29. package/bundles/ecodev-natural-editor.umd.js +0 -1026
  30. package/bundles/ecodev-natural-editor.umd.js.map +0 -1
  31. package/esm2015/lib/editor/editor.component.js +0 -200
  32. package/esm2015/lib/utils/image.js +0 -81
  33. package/esm2015/lib/utils/menu.js +0 -207
  34. package/esm2015/lib/utils/schema.js +0 -46
  35. package/fesm2015/ecodev-natural-editor.js +0 -673
  36. package/fesm2015/ecodev-natural-editor.js.map +0 -1
@@ -1,673 +0,0 @@
1
- import '@angular/localize/init';
2
- import * as i0 from '@angular/core';
3
- import { Injectable, Inject, Component, EventEmitter, ElementRef, Optional, Self, ViewChild, Output, Input, NgModule } from '@angular/core';
4
- import { DecorationSet, Decoration, EditorView } from 'prosemirror-view';
5
- import { Plugin, TextSelection, EditorState } from 'prosemirror-state';
6
- import { exampleSetup } from 'prosemirror-example-setup';
7
- import { Schema, DOMSerializer, DOMParser } from 'prosemirror-model';
8
- import * as i6 from '@angular/common';
9
- import { DOCUMENT, CommonModule } from '@angular/common';
10
- import { tableNodes, tableNodeTypes, addColumnBefore, addColumnAfter, deleteColumn, addRowBefore, addRowAfter, deleteRow, deleteTable, mergeCells, splitCell, toggleHeaderColumn, toggleHeaderRow, toggleHeaderCell, columnResizing, tableEditing, goToNextCell } from 'prosemirror-tables';
11
- import { keymap } from 'prosemirror-keymap';
12
- import { nodes, marks } from 'prosemirror-schema-basic';
13
- import { addListNodes, wrapInList } from 'prosemirror-schema-list';
14
- import { joinUpItem, liftItem, selectParentNodeItem, undoItem, redoItem, wrapItem, blockTypeItem } from 'prosemirror-menu';
15
- import { toggleMark } from 'prosemirror-commands';
16
- import * as i1 from '@angular/material/dialog';
17
- import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
18
- import * as i4 from '@angular/forms';
19
- import { FormControl, Validators, FormGroup, ReactiveFormsModule } from '@angular/forms';
20
- import * as i11 from '@ecodev/natural';
21
- import { ifValid, NaturalFileModule } from '@ecodev/natural';
22
- import * as i2 from '@angular/material/form-field';
23
- import { MatFormFieldModule } from '@angular/material/form-field';
24
- import * as i3 from '@angular/material/button';
25
- import { MatButtonModule } from '@angular/material/button';
26
- import * as i5 from '@angular/material/input';
27
- import { MatInputModule } from '@angular/material/input';
28
- import * as i5$1 from '@angular/material/icon';
29
- import { MatIconModule } from '@angular/material/icon';
30
- import * as i6$1 from '@angular/material/button-toggle';
31
- import { MatButtonToggleModule } from '@angular/material/button-toggle';
32
- import * as i7 from '@angular/material/menu';
33
- import { MatMenuModule } from '@angular/material/menu';
34
- import * as i8 from '@angular/material/divider';
35
- import { MatDividerModule } from '@angular/material/divider';
36
- import * as i10 from '@angular/material/tooltip';
37
- import { MatTooltipModule } from '@angular/material/tooltip';
38
- import { MatToolbarModule } from '@angular/material/toolbar';
39
-
40
- class ImagePlugin {
41
- constructor(document) {
42
- this.document = document;
43
- this.plugin = new Plugin({
44
- state: {
45
- init() {
46
- return DecorationSet.empty;
47
- },
48
- apply(tr, set) {
49
- // Adjust decoration positions to changes made by the transaction
50
- set = set.map(tr.mapping, tr.doc);
51
- // See if the transaction adds or removes any placeholders
52
- const action = tr.getMeta(this);
53
- if (action && action.add) {
54
- const widget = document.createElement('placeholder');
55
- const deco = Decoration.widget(action.add.pos, widget, { id: action.add.id });
56
- set = set.add(tr.doc, [deco]);
57
- }
58
- else if (action && action.remove) {
59
- set = set.remove(set.find(undefined, undefined, spec => spec.id === action.remove.id));
60
- }
61
- return set;
62
- },
63
- },
64
- props: {
65
- decorations(state) {
66
- return this.getState(state);
67
- },
68
- },
69
- });
70
- }
71
- findPlaceholder(state, id) {
72
- const decorators = this.plugin.getState(state);
73
- const found = decorators.find(undefined, undefined, spec => spec.id === id);
74
- return found.length ? found[0].from : null;
75
- }
76
- startImageUpload(view, file, uploader, schema) {
77
- // A fresh object to act as the ID for this upload
78
- const id = {};
79
- // Replace the selection with a placeholder
80
- const tr = view.state.tr;
81
- if (!tr.selection.empty) {
82
- tr.deleteSelection();
83
- }
84
- tr.setMeta(this.plugin, { add: { id, pos: tr.selection.from } });
85
- view.dispatch(tr);
86
- uploader(file).subscribe({
87
- next: url => {
88
- const pos = this.findPlaceholder(view.state, id);
89
- // If the content around the placeholder has been deleted, drop
90
- // the image
91
- if (pos === null) {
92
- return;
93
- }
94
- // Otherwise, insert it at the placeholder's position, and remove
95
- // the placeholder
96
- view.dispatch(view.state.tr
97
- .replaceWith(pos, pos, schema.nodes.image.create({ src: url }))
98
- .setMeta(this.plugin, { remove: { id } }));
99
- },
100
- error: () => {
101
- // On failure, just clean up the placeholder
102
- view === null || view === void 0 ? void 0 : view.dispatch(tr.setMeta(this.plugin, { remove: { id } }));
103
- },
104
- });
105
- }
106
- }
107
- ImagePlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ImagePlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
108
- ImagePlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ImagePlugin });
109
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ImagePlugin, decorators: [{
110
- type: Injectable
111
- }], ctorParameters: function () { return [{ type: Document, decorators: [{
112
- type: Inject,
113
- args: [DOCUMENT]
114
- }] }]; } });
115
-
116
- const basicNodes = {
117
- heading: nodes.heading,
118
- doc: nodes.doc,
119
- paragraph: nodes.paragraph,
120
- text: nodes.text,
121
- hard_break: nodes.hard_break,
122
- };
123
- const basicMarks = {
124
- link: marks.link,
125
- em: marks.em,
126
- strong: marks.strong,
127
- };
128
- const tmpSchema = new Schema({ nodes: basicNodes, marks: basicMarks });
129
- const basicSchema = new Schema({
130
- nodes: addListNodes(tmpSchema.spec.nodes, 'paragraph block*', 'block'),
131
- marks: tmpSchema.spec.marks,
132
- });
133
- const tmpSchema2 = new Schema({
134
- nodes: Object.assign(Object.assign({}, nodes), tableNodes({
135
- tableGroup: 'block',
136
- cellContent: 'block+',
137
- cellAttributes: {
138
- background: {
139
- default: null,
140
- getFromDOM(dom) {
141
- return dom.style.backgroundColor || null;
142
- },
143
- setDOMAttr(value, attrs) {
144
- if (value) {
145
- attrs.style = (attrs.style || '') + `background-color: ${value};`;
146
- }
147
- },
148
- },
149
- },
150
- })),
151
- marks: basicMarks,
152
- });
153
- const advancedSchema = new Schema({
154
- nodes: addListNodes(tmpSchema2.spec.nodes, 'paragraph block*', 'block'),
155
- marks: basicMarks,
156
- });
157
-
158
- class LinkDialogComponent {
159
- constructor(data, dialogRef) {
160
- this.dialogRef = dialogRef;
161
- this.hrefControl = new FormControl('', Validators.required);
162
- this.titleControl = new FormControl('');
163
- this.form = new FormGroup({
164
- href: this.hrefControl,
165
- title: this.titleControl,
166
- });
167
- this.form.setValue(data);
168
- }
169
- maybeConfirm() {
170
- ifValid(this.form).subscribe(() => this.confirm());
171
- }
172
- confirm() {
173
- this.dialogRef.close(this.form.value);
174
- }
175
- }
176
- LinkDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: LinkDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
177
- LinkDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: LinkDialogComponent, selector: "ng-component", ngImport: i0, template: "<h2 i18n mat-dialog-title>Ins\u00E9rer un lien</h2>\n\n<mat-dialog-content [formGroup]=\"form\">\n <mat-form-field>\n <mat-label i18n>URL</mat-label>\n <input matInput [formControl]=\"hrefControl\" (keydown.enter)=\"maybeConfirm()\" />\n <mat-error *ngIf=\"hrefControl.hasError('required')\" i18n>Ce champ est requis</mat-error>\n </mat-form-field>\n <mat-form-field>\n <mat-label i18n>Titre</mat-label>\n <input matInput [formControl]=\"titleControl\" (keydown.enter)=\"maybeConfirm()\" />\n </mat-form-field>\n</mat-dialog-content>\n\n<mat-dialog-actions>\n <button mat-button [mat-dialog-close] i18n>Annuler</button>\n <button mat-stroked-button (click)=\"maybeConfirm()\" [disabled]=\"!form.valid\"><span i18n>Valider</span></button>\n</mat-dialog-actions>\n", styles: ["mat-dialog-actions{display:flex;flex-direction:row;justify-content:flex-end}mat-dialog-content{width:70vw;max-width:60em;display:grid}\n"], components: [{ type: i2.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2.MatLabel, selector: "mat-label" }, { type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatError, selector: "mat-error", inputs: ["id"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }] });
178
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: LinkDialogComponent, decorators: [{
179
- type: Component,
180
- args: [{
181
- templateUrl: './link-dialog.component.html',
182
- styleUrls: ['./link-dialog.component.scss'],
183
- }]
184
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
185
- type: Inject,
186
- args: [MAT_DIALOG_DATA]
187
- }] }, { type: i1.MatDialogRef }]; } });
188
-
189
- function createCell(cellType, cellContent) {
190
- return cellContent ? cellType.createChecked(null, cellContent) : cellType.createAndFill();
191
- }
192
- function createTable(state, rowsCount, colsCount, withHeaderRow, cellContent) {
193
- const types = tableNodeTypes(state.schema);
194
- const headerCells = [];
195
- const cells = [];
196
- for (let index = 0; index < colsCount; index += 1) {
197
- const cell = createCell(types.cell, cellContent);
198
- if (cell) {
199
- cells.push(cell);
200
- }
201
- if (withHeaderRow) {
202
- const headerCell = createCell(types.header_cell, cellContent);
203
- if (headerCell) {
204
- headerCells.push(headerCell);
205
- }
206
- }
207
- }
208
- const rows = [];
209
- for (let index = 0; index < rowsCount; index += 1) {
210
- rows.push(types.row.createChecked(null, withHeaderRow && index === 0 ? headerCells : cells));
211
- }
212
- return types.table.createChecked(null, rows);
213
- }
214
- function addTable(state, dispatch, { rowsCount = 3, colsCount = 3, withHeaderRow = true, cellContent, } = {}) {
215
- const offset = state.tr.selection.anchor + 1;
216
- const nodes = createTable(state, rowsCount, colsCount, withHeaderRow, cellContent);
217
- const tr = state.tr.replaceSelectionWith(nodes).scrollIntoView();
218
- const resolvedPos = tr.doc.resolve(offset);
219
- // move cursor into table
220
- tr.setSelection(TextSelection.near(resolvedPos));
221
- dispatch === null || dispatch === void 0 ? void 0 : dispatch(tr);
222
- }
223
-
224
- /**
225
- * One item of the menu.
226
- *
227
- * This is the equivalent of `MenuItem` but without all the rendering logic since we use Angular
228
- * templates for rendering. Also it caches the state of the item everytime the editor state changes,
229
- * so Angular can query the state as often as needed without performance hit.
230
- */
231
- class Item {
232
- constructor(spec) {
233
- this.spec = spec;
234
- /**
235
- * Whether the item is 'active' (for example, the item for toggling the strong mark might be active when the cursor is in strong text).
236
- */
237
- this.active = false;
238
- /**
239
- * Button is shown but disabled, because the item cannot be (un-)applied
240
- */
241
- this.disabled = false;
242
- /**
243
- * Whether the item is shown at the moment
244
- */
245
- this.show = true;
246
- }
247
- /**
248
- * Update the item state according to the editor state
249
- */
250
- update(view, state) {
251
- if (this.spec.active) {
252
- this.active = this.spec.active(state);
253
- }
254
- if (this.spec.enable) {
255
- this.disabled = !this.spec.enable(state);
256
- }
257
- if (this.spec.select) {
258
- this.show = this.spec.select(state);
259
- }
260
- }
261
- }
262
- /**
263
- * Convert built-in `MenuItem` into our Angular specific `Item`
264
- */
265
- function toItem(item) {
266
- return new Item(item.spec);
267
- }
268
- function canInsert(state, nodeType) {
269
- const $from = state.selection.$from;
270
- for (let d = $from.depth; d >= 0; d--) {
271
- const index = $from.index(d);
272
- if ($from.node(d).canReplaceWith(index, index, nodeType)) {
273
- return true;
274
- }
275
- }
276
- return false;
277
- }
278
- function cmdItem(cmd, options = {}, useEnable = false) {
279
- const passedOptions = Object.assign({ run: cmd }, options);
280
- if ((!options.enable || useEnable) && !options.select) {
281
- passedOptions[options.enable ? 'enable' : 'select'] = (state) => cmd(state);
282
- }
283
- return new Item(passedOptions);
284
- }
285
- function markActive(state, type) {
286
- const { from, $from, to, empty } = state.selection;
287
- if (empty) {
288
- return !!type.isInSet(state.storedMarks || $from.marks());
289
- }
290
- else {
291
- return state.doc.rangeHasMark(from, to, type);
292
- }
293
- }
294
- function markItem(markType, options = {}) {
295
- const passedOptions = Object.assign({ active(state) {
296
- return markActive(state, markType);
297
- } }, options);
298
- return cmdItem(toggleMark(markType), passedOptions, true);
299
- }
300
- function linkItem(markType, dialog) {
301
- return new Item({
302
- active(state) {
303
- return markActive(state, markType);
304
- },
305
- enable(state) {
306
- return !state.selection.empty;
307
- },
308
- run(state, dispatch, view) {
309
- if (markActive(state, markType)) {
310
- toggleMark(markType)(state, dispatch);
311
- return true;
312
- }
313
- dialog
314
- .open(LinkDialogComponent, {
315
- data: {
316
- href: '',
317
- title: '',
318
- },
319
- })
320
- .afterClosed()
321
- .subscribe(result => {
322
- if (result) {
323
- if (!result.title) {
324
- delete result.title;
325
- }
326
- toggleMark(markType, result)(view.state, view.dispatch);
327
- }
328
- view.focus();
329
- });
330
- },
331
- });
332
- }
333
- function wrapListItem(nodeType) {
334
- return cmdItem(wrapInList(nodeType));
335
- }
336
- /**
337
- * Given a schema, look for default mark and node types in it and
338
- * return an object with relevant menu items relating to those marks:
339
- */
340
- function buildMenuItems(schema, dialog) {
341
- const r = {
342
- joinUp: toItem(joinUpItem),
343
- lift: toItem(liftItem),
344
- selectParentNode: toItem(selectParentNodeItem),
345
- undo: toItem(undoItem),
346
- redo: toItem(redoItem),
347
- };
348
- let type;
349
- type = schema.marks.strong;
350
- if (type) {
351
- r.toggleStrong = markItem(type);
352
- }
353
- type = schema.marks.em;
354
- if (type) {
355
- r.toggleEm = markItem(type);
356
- }
357
- type = schema.marks.code;
358
- if (type) {
359
- r.toggleCode = markItem(type);
360
- }
361
- type = schema.marks.link;
362
- if (type) {
363
- r.toggleLink = linkItem(type, dialog);
364
- }
365
- type = schema.nodes.bullet_list;
366
- if (type) {
367
- r.wrapBulletList = wrapListItem(type);
368
- }
369
- type = schema.nodes.ordered_list;
370
- if (type) {
371
- r.wrapOrderedList = wrapListItem(type);
372
- }
373
- type = schema.nodes.blockquote;
374
- if (type) {
375
- r.wrapBlockQuote = toItem(wrapItem(type, {}));
376
- }
377
- type = schema.nodes.paragraph;
378
- if (type) {
379
- r.makeParagraph = toItem(blockTypeItem(type, {}));
380
- }
381
- type = schema.nodes.code_block;
382
- if (type) {
383
- r.makeCodeBlock = toItem(blockTypeItem(type, {}));
384
- }
385
- type = schema.nodes.heading;
386
- if (type) {
387
- r.makeHead1 = toItem(blockTypeItem(type, { attrs: { level: 1 } }));
388
- r.makeHead2 = toItem(blockTypeItem(type, { attrs: { level: 2 } }));
389
- r.makeHead3 = toItem(blockTypeItem(type, { attrs: { level: 3 } }));
390
- r.makeHead4 = toItem(blockTypeItem(type, { attrs: { level: 4 } }));
391
- r.makeHead5 = toItem(blockTypeItem(type, { attrs: { level: 5 } }));
392
- r.makeHead6 = toItem(blockTypeItem(type, { attrs: { level: 6 } }));
393
- }
394
- type = schema.nodes.horizontal_rule;
395
- if (type) {
396
- const hr = type;
397
- r.insertHorizontalRule = new Item({
398
- enable(state) {
399
- return canInsert(state, hr);
400
- },
401
- run(state, dispatch) {
402
- dispatch(state.tr.replaceSelectionWith(hr.create()));
403
- },
404
- });
405
- }
406
- type = schema.nodes.table;
407
- if (type) {
408
- r.insertTable = new Item({ run: (e, tr) => addTable(e, tr) });
409
- r.addColumnBefore = new Item({ run: addColumnBefore });
410
- r.addColumnAfter = new Item({ run: addColumnAfter });
411
- r.deleteColumn = new Item({ run: deleteColumn });
412
- r.addRowBefore = new Item({ run: addRowBefore });
413
- r.addRowAfter = new Item({ run: addRowAfter });
414
- r.deleteRow = new Item({ run: deleteRow });
415
- r.deleteTable = new Item({ run: deleteTable });
416
- r.mergeCells = new Item({ run: mergeCells });
417
- r.splitCell = new Item({ run: splitCell });
418
- r.toggleHeaderColumn = new Item({ run: toggleHeaderColumn });
419
- r.toggleHeaderRow = new Item({ run: toggleHeaderRow });
420
- r.toggleHeaderCell = new Item({ run: toggleHeaderCell });
421
- }
422
- return r;
423
- }
424
-
425
- /**
426
- * Prosemirror component
427
- *
428
- * Usage :
429
- *
430
- * ```html
431
- * <natural-editor [(ngModel)]="htmlString"></natural-editor>
432
- * ```
433
- */
434
- // @dynamic
435
- class NaturalEditorComponent {
436
- constructor(ngControl, document, dialog, imagePlugin) {
437
- this.ngControl = ngControl;
438
- this.document = document;
439
- this.dialog = dialog;
440
- this.imagePlugin = imagePlugin;
441
- this.view = null;
442
- this.contentChange = new EventEmitter();
443
- /**
444
- * Callback to upload an image.
445
- *
446
- * If given it will enable advanced schema, including image and tables.
447
- * It must be given on initialization and cannot be changed later on.
448
- */
449
- this.imageUploader = null;
450
- this.schema = basicSchema;
451
- /**
452
- * HTML string
453
- */
454
- this.content = '';
455
- this.menu = null;
456
- /**
457
- * If subscribed to, then the save button will be shown and click events forwarded
458
- */
459
- this.save = new EventEmitter();
460
- if (this.ngControl !== null) {
461
- this.ngControl.valueAccessor = this;
462
- }
463
- }
464
- ngOnInit() {
465
- this.schema = this.imageUploader ? advancedSchema : basicSchema;
466
- this.menu = buildMenuItems(this.schema, this.dialog);
467
- const serializer = DOMSerializer.fromSchema(this.schema);
468
- const state = this.createState();
469
- this.view = new EditorView(this.editor.nativeElement, {
470
- state: state,
471
- dispatchTransaction: (transaction) => {
472
- if (!this.view) {
473
- return;
474
- }
475
- const newState = this.view.state.apply(transaction);
476
- this.view.updateState(newState);
477
- // Transform doc into HTML string
478
- const dom = serializer.serializeFragment(this.view.state.doc);
479
- const el = this.document.createElement('_');
480
- el.appendChild(dom);
481
- const newContent = el.innerHTML;
482
- if (this.content === newContent) {
483
- return;
484
- }
485
- this.content = el.innerHTML;
486
- if (this.onChange) {
487
- this.onChange(this.content);
488
- }
489
- this.contentChange.emit(this.content);
490
- },
491
- });
492
- this.update();
493
- }
494
- writeValue(val) {
495
- if (typeof val === 'string' && val !== this.content) {
496
- this.content = val;
497
- }
498
- if (this.view !== null) {
499
- const state = this.createState();
500
- this.view.updateState(state);
501
- }
502
- }
503
- createState() {
504
- const template = this.document.createElement('_');
505
- template.innerHTML = '<div>' + this.content + '</div>';
506
- if (!template.firstChild) {
507
- throw new Error('child of template element could not be created');
508
- }
509
- const parser = DOMParser.fromSchema(this.schema);
510
- const doc = parser.parse(template.firstChild);
511
- const plugins = [
512
- ...exampleSetup({ schema: this.schema, menuBar: false }),
513
- new Plugin({
514
- view: () => this,
515
- }),
516
- ];
517
- if (this.schema === advancedSchema) {
518
- plugins.push(this.imagePlugin.plugin, columnResizing(undefined), tableEditing(), keymap({
519
- Tab: goToNextCell(1),
520
- 'Shift-Tab': goToNextCell(-1),
521
- }));
522
- }
523
- return EditorState.create({
524
- doc: doc,
525
- plugins: plugins,
526
- });
527
- }
528
- /**
529
- * Called by Prosemirror whenever the editor state changes. So we update our menu states.
530
- */
531
- update() {
532
- if (!this.view || !this.menu) {
533
- return;
534
- }
535
- for (const item of Object.values(this.menu)) {
536
- item.update(this.view, this.view.state);
537
- }
538
- }
539
- registerOnChange(fn) {
540
- this.onChange = fn;
541
- }
542
- registerOnTouched(fn) { }
543
- setDisabledState(isDisabled) {
544
- // TODO disable editor ?
545
- }
546
- ngOnDestroy() {
547
- if (this.view) {
548
- this.view.destroy();
549
- this.view = null;
550
- }
551
- }
552
- run(event, key) {
553
- if (!this.view || !this.menu) {
554
- return;
555
- }
556
- const item = this.menu[key];
557
- if (!item || item.disabled || !item.show) {
558
- return;
559
- }
560
- item.spec.run(this.view.state, this.view.dispatch, this.view, event);
561
- this.view.focus();
562
- }
563
- upload(file) {
564
- if (!this.view || !this.imageUploader) {
565
- return;
566
- }
567
- if (this.view.state.selection.$from.parent.inlineContent) {
568
- this.imagePlugin.startImageUpload(this.view, file, this.imageUploader, this.schema);
569
- }
570
- this.view.focus();
571
- }
572
- }
573
- NaturalEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: NaturalEditorComponent, deps: [{ token: i4.NgControl, optional: true, self: true }, { token: DOCUMENT }, { token: i1.MatDialog }, { token: ImagePlugin }], target: i0.ɵɵFactoryTarget.Component });
574
- NaturalEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: NaturalEditorComponent, selector: "natural-editor", inputs: { imageUploader: "imageUploader" }, outputs: { contentChange: "contentChange", save: "save" }, providers: [ImagePlugin], viewQueries: [{ propertyName: "editor", first: true, predicate: ["editor"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<div class=\"menu-container\" *ngIf=\"menu\">\n <div class=\"menu\">\n <button mat-button *ngIf=\"save.observed\" (click)=\"save.emit()\" i18n-matTooltip matTooltip=\"Enregistrer\">\n <mat-icon>save</mat-icon>\n </button>\n\n <mat-button-toggle-group multiple>\n <mat-button-toggle\n *ngIf=\"menu.toggleStrong\"\n [disabled]=\"menu.toggleStrong.disabled\"\n [checked]=\"menu.toggleStrong.active\"\n (click)=\"run($event, 'toggleStrong')\"\n i18n-matTooltip\n matTooltip=\"Gras\"\n >\n <mat-icon>format_bold</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle\n *ngIf=\"menu.toggleEm\"\n [disabled]=\"menu.toggleEm.disabled\"\n [checked]=\"menu.toggleEm.active\"\n (click)=\"run($event, 'toggleEm')\"\n i18n-matTooltip\n matTooltip=\"Italique\"\n >\n <mat-icon>format_italic</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle\n *ngIf=\"menu.toggleCode\"\n [disabled]=\"menu.toggleCode.disabled\"\n [checked]=\"menu.toggleCode.active\"\n (click)=\"run($event, 'toggleCode')\"\n i18n-matTooltip\n matTooltip=\"Code\"\n >\n <mat-icon>code</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle\n *ngIf=\"menu.toggleLink\"\n [disabled]=\"menu.toggleLink.disabled\"\n [checked]=\"menu.toggleLink.active\"\n (click)=\"run($event, 'toggleLink')\"\n i18n-matTooltip\n matTooltip=\"Ins\u00E9rer un lien...\"\n >\n <mat-icon>insert_link</mat-icon>\n </mat-button-toggle>\n </mat-button-toggle-group>\n\n <button mat-button [matMenuTriggerFor]=\"blockMenu\">\n <span i18n>Type</span>\n <mat-icon>arrow_drop_down</mat-icon>\n </button>\n\n <mat-menu #blockMenu=\"matMenu\">\n <button\n mat-menu-item\n *ngIf=\"menu.makeParagraph\"\n [disabled]=\"menu.makeParagraph.disabled\"\n (click)=\"run($event, 'makeParagraph')\"\n i18n\n >Paragraphe\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeCodeBlock\"\n [disabled]=\"menu.makeCodeBlock.disabled\"\n (click)=\"run($event, 'makeCodeBlock')\"\n i18n\n >Code\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead1\"\n [disabled]=\"menu.makeHead1.disabled\"\n (click)=\"run($event, 'makeHead1')\"\n i18n\n >Titre 1\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead2\"\n [disabled]=\"menu.makeHead2.disabled\"\n (click)=\"run($event, 'makeHead2')\"\n i18n\n >Titre 2\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead3\"\n [disabled]=\"menu.makeHead3.disabled\"\n (click)=\"run($event, 'makeHead3')\"\n i18n\n >Titre 3\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead4\"\n [disabled]=\"menu.makeHead4.disabled\"\n (click)=\"run($event, 'makeHead4')\"\n i18n\n >Titre 4\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead5\"\n [disabled]=\"menu.makeHead5.disabled\"\n (click)=\"run($event, 'makeHead5')\"\n i18n\n >Titre 5\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.makeHead6\"\n [disabled]=\"menu.makeHead6.disabled\"\n (click)=\"run($event, 'makeHead6')\"\n i18n\n >Titre 6\n </button>\n </mat-menu>\n\n <button mat-button [matMenuTriggerFor]=\"tableMenu\" *ngIf=\"menu.addColumnBefore\">\n <span i18n>Tableau</span>\n <mat-icon>arrow_drop_down</mat-icon>\n </button>\n\n <mat-menu #tableMenu=\"matMenu\">\n <button\n mat-menu-item\n *ngIf=\"menu.insertTable\"\n [disabled]=\"menu.insertTable.disabled\"\n (click)=\"run($event, 'insertTable')\"\n i18n\n >Ins\u00E9rer un tableau\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.deleteTable\"\n [disabled]=\"menu.deleteTable.disabled\"\n (click)=\"run($event, 'deleteTable')\"\n i18n\n >Supprimer le tableau\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.mergeCells\"\n [disabled]=\"menu.mergeCells.disabled\"\n (click)=\"run($event, 'mergeCells')\"\n i18n\n >Fusionner les cellules\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.splitCell\"\n [disabled]=\"menu.splitCell.disabled\"\n (click)=\"run($event, 'splitCell')\"\n i18n\n >Scinder les cellules\n </button>\n\n <mat-divider></mat-divider>\n\n <button\n mat-menu-item\n *ngIf=\"menu.addColumnBefore\"\n [disabled]=\"menu.addColumnBefore.disabled\"\n (click)=\"run($event, 'addColumnBefore')\"\n i18n\n >Ins\u00E9rer une colonne avant\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.addColumnAfter\"\n [disabled]=\"menu.addColumnAfter.disabled\"\n (click)=\"run($event, 'addColumnAfter')\"\n i18n\n >Ins\u00E9rer une colonne apr\u00E8s\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.deleteColumn\"\n [disabled]=\"menu.deleteColumn.disabled\"\n (click)=\"run($event, 'deleteColumn')\"\n i18n\n >Supprimer la colonne\n </button>\n\n <mat-divider></mat-divider>\n\n <button\n mat-menu-item\n *ngIf=\"menu.addRowBefore\"\n [disabled]=\"menu.addRowBefore.disabled\"\n (click)=\"run($event, 'addRowBefore')\"\n i18n\n >Ins\u00E9rer une ligne avant\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.addRowAfter\"\n [disabled]=\"menu.addRowAfter.disabled\"\n (click)=\"run($event, 'addRowAfter')\"\n i18n\n >Ins\u00E9rer une ligne apr\u00E8s\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.deleteRow\"\n [disabled]=\"menu.deleteRow.disabled\"\n (click)=\"run($event, 'deleteRow')\"\n i18n\n >Supprimer la ligne\n </button>\n\n <mat-divider></mat-divider>\n\n <button\n mat-menu-item\n *ngIf=\"menu.toggleHeaderColumn\"\n [disabled]=\"menu.toggleHeaderColumn.disabled\"\n (click)=\"run($event, 'toggleHeaderColumn')\"\n i18n\n >Ent\u00EAte de colonne\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.toggleHeaderRow\"\n [disabled]=\"menu.toggleHeaderRow.disabled\"\n (click)=\"run($event, 'toggleHeaderRow')\"\n i18n\n >Ent\u00EAte de ligne\n </button>\n <button\n mat-menu-item\n *ngIf=\"menu.toggleHeaderCell\"\n [disabled]=\"menu.toggleHeaderCell.disabled\"\n (click)=\"run($event, 'toggleHeaderCell')\"\n i18n\n >Ent\u00EAte de cellule\n </button>\n </mat-menu>\n\n <button\n mat-button\n *ngIf=\"imageUploader\"\n naturalFileDrop\n [selectable]=\"true\"\n [broadcast]=\"false\"\n i18n-matTooltip\n matTooltip=\"Ins\u00E9rer une image\"\n (fileChange)=\"upload($event)\"\n >\n <mat-icon>insert_photo</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.undo\"\n [disabled]=\"menu.undo.disabled\"\n (click)=\"run($event, 'undo')\"\n i18n-matTooltip\n matTooltip=\"Annuler\"\n >\n <mat-icon>undo</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.redo\"\n [disabled]=\"menu.redo.disabled\"\n (click)=\"run($event, 'redo')\"\n i18n-matTooltip\n matTooltip=\"Refaire\"\n >\n <mat-icon>redo</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.wrapBulletList && menu.wrapBulletList.show\"\n [disabled]=\"menu.wrapBulletList.disabled\"\n (click)=\"run($event, 'wrapBulletList')\"\n i18n-matTooltip\n matTooltip=\"Liste \u00E0 puce\"\n >\n <mat-icon>format_list_bulleted</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.wrapOrderedList && menu.wrapOrderedList.show\"\n [disabled]=\"menu.wrapOrderedList.disabled\"\n (click)=\"run($event, 'wrapOrderedList')\"\n i18n-matTooltip\n matTooltip=\"Liste \u00E0 num\u00E9ro\"\n >\n <mat-icon>format_list_numbered</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.wrapBlockQuote && menu.wrapBlockQuote.show\"\n [disabled]=\"menu.wrapBlockQuote.disabled\"\n (click)=\"run($event, 'wrapBlockQuote')\"\n i18n-matTooltip\n matTooltip=\"Citation\"\n >\n <mat-icon>format_quote</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.joinUp && menu.joinUp.show\"\n [disabled]=\"menu.joinUp.disabled\"\n (click)=\"run($event, 'joinUp')\"\n i18n-matTooltip\n matTooltip=\"Fusionner avec l'\u00E9l\u00E9ment du haut\"\n >\n <mat-icon>move_up</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.lift && menu.lift.show\"\n [disabled]=\"menu.lift.disabled\"\n (click)=\"run($event, 'lift')\"\n i18n-matTooltip\n matTooltip=\"D\u00E9sindenter\"\n >\n <mat-icon>format_indent_decrease</mat-icon>\n </button>\n\n <button\n mat-button\n *ngIf=\"menu.selectParentNode && menu.selectParentNode.show\"\n [disabled]=\"menu.selectParentNode.disabled\"\n (click)=\"run($event, 'selectParentNode')\"\n i18n-matTooltip\n matTooltip=\"S\u00E9lectionner l'\u00E9l\u00E9ment parent\"\n >\n <mat-icon>select_all</mat-icon>\n </button>\n </div>\n</div>\n<div #editor></div>\n", styles: [".menu{border-bottom:1px solid;display:flex;flex-wrap:wrap;padding:10px 18px}.menu-container{position:sticky;top:-20px;z-index:999}::ng-deep .ProseMirror{position:relative}::ng-deep .ProseMirror{word-wrap:break-word;white-space:pre-wrap;-webkit-font-variant-ligatures:none;font-feature-settings:none;font-variant-ligatures:none}::ng-deep .ProseMirror pre{white-space:pre-wrap}::ng-deep .ProseMirror li{position:relative}::ng-deep .ProseMirror-hideselection *::selection{background:transparent}::ng-deep .ProseMirror-hideselection *::-moz-selection{background:transparent}::ng-deep .ProseMirror-hideselection{caret-color:transparent}::ng-deep .ProseMirror-selectednode{outline:2px solid #8cf}::ng-deep li.ProseMirror-selectednode{outline:none}::ng-deep li.ProseMirror-selectednode:after{content:\"\";position:absolute;left:-32px;right:-2px;top:-2px;bottom:-2px;border:2px solid #8cf;pointer-events:none}::ng-deep .ProseMirror-gapcursor{display:none;pointer-events:none;position:absolute}::ng-deep .ProseMirror-gapcursor:after{content:\"\";display:block;position:absolute;top:-2px;width:20px;border-top:1px solid black;animation:ProseMirror-cursor-blink 1.1s steps(2,start) infinite}@keyframes ProseMirror-cursor-blink{to{visibility:hidden}}::ng-deep .ProseMirror-focused .ProseMirror-gapcursor{display:block}::ng-deep .ProseMirror-example-setup-style hr{padding:2px 10px;border:none;margin:1em 0}::ng-deep .ProseMirror-example-setup-style hr:after{content:\"\";display:block;height:1px;background-color:silver;line-height:2px}::ng-deep .ProseMirror ul,::ng-deep .ProseMirror ol{padding-left:30px}::ng-deep .ProseMirror blockquote{padding-left:1em;border-left:3px solid #eee;margin-left:0;margin-right:0}::ng-deep .ProseMirror-example-setup-style img{cursor:default}::ng-deep .ProseMirror p:first-child,::ng-deep .ProseMirror h1:first-child,::ng-deep .ProseMirror h2:first-child,::ng-deep .ProseMirror h3:first-child,::ng-deep .ProseMirror h4:first-child,::ng-deep .ProseMirror h5:first-child,::ng-deep .ProseMirror h6:first-child{margin-top:10px}::ng-deep .ProseMirror{padding:4px 8px 4px 14px;line-height:1.2;outline:none}::ng-deep .ProseMirror p{margin-bottom:1em}::ng-deep .ProseMirror .tableWrapper{overflow-x:auto}::ng-deep .ProseMirror table{border-collapse:collapse;table-layout:fixed;width:100%;overflow:hidden}::ng-deep .ProseMirror td,::ng-deep .ProseMirror th{vertical-align:top;box-sizing:border-box;position:relative}::ng-deep .ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;z-index:20;background-color:#adf;pointer-events:none}::ng-deep .ProseMirror.resize-cursor{cursor:col-resize}::ng-deep .ProseMirror .selectedCell:after{z-index:2;position:absolute;content:\"\";left:0;right:0;top:0;bottom:0;background:rgba(200,200,255,.4);pointer-events:none}::ng-deep .ProseMirror table{margin:0}::ng-deep .ProseMirror th,::ng-deep .ProseMirror td{min-width:1em;border:1px solid #ddd;padding:3px 5px}::ng-deep .ProseMirror .tableWrapper{margin:1em 0}::ng-deep .ProseMirror th{font-weight:bold;text-align:left}::ng-deep placeholder{display:block;width:50px;height:50px;background-size:500% 100%!important;animation:gradient 3s none infinite}@keyframes gradient{0%{background-position:100% 100%}to{background-position:0 0}}\n"], components: [{ type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i6$1.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { type: i7.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i7.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { type: i8.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i6$1.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { type: i7.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { type: i11.NaturalFileDropDirective, selector: ":not([naturalFileSelect])[naturalFileDrop]", outputs: ["fileOver"] }] });
575
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: NaturalEditorComponent, decorators: [{
576
- type: Component,
577
- args: [{
578
- selector: 'natural-editor',
579
- templateUrl: './editor.component.html',
580
- styleUrls: ['./editor.component.scss'],
581
- providers: [ImagePlugin],
582
- }]
583
- }], ctorParameters: function () { return [{ type: i4.NgControl, decorators: [{
584
- type: Optional
585
- }, {
586
- type: Self
587
- }] }, { type: Document, decorators: [{
588
- type: Inject,
589
- args: [DOCUMENT]
590
- }] }, { type: i1.MatDialog }, { type: ImagePlugin }]; }, propDecorators: { editor: [{
591
- type: ViewChild,
592
- args: ['editor', { read: ElementRef, static: true }]
593
- }], contentChange: [{
594
- type: Output
595
- }], imageUploader: [{
596
- type: Input
597
- }], save: [{
598
- type: Output
599
- }] } });
600
-
601
- const imports = [
602
- CommonModule,
603
- MatButtonModule,
604
- MatButtonToggleModule,
605
- MatDialogModule,
606
- MatFormFieldModule,
607
- MatIconModule,
608
- MatInputModule,
609
- MatMenuModule,
610
- MatToolbarModule,
611
- MatTooltipModule,
612
- ReactiveFormsModule,
613
- NaturalFileModule,
614
- MatDividerModule,
615
- ];
616
- class NaturalEditorModule {
617
- }
618
- NaturalEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: NaturalEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
619
- NaturalEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: NaturalEditorModule, declarations: [NaturalEditorComponent, LinkDialogComponent], imports: [CommonModule,
620
- MatButtonModule,
621
- MatButtonToggleModule,
622
- MatDialogModule,
623
- MatFormFieldModule,
624
- MatIconModule,
625
- MatInputModule,
626
- MatMenuModule,
627
- MatToolbarModule,
628
- MatTooltipModule,
629
- ReactiveFormsModule,
630
- NaturalFileModule,
631
- MatDividerModule], exports: [CommonModule,
632
- MatButtonModule,
633
- MatButtonToggleModule,
634
- MatDialogModule,
635
- MatFormFieldModule,
636
- MatIconModule,
637
- MatInputModule,
638
- MatMenuModule,
639
- MatToolbarModule,
640
- MatTooltipModule,
641
- ReactiveFormsModule,
642
- NaturalFileModule,
643
- MatDividerModule, NaturalEditorComponent] });
644
- NaturalEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: NaturalEditorModule, imports: [[...imports], CommonModule,
645
- MatButtonModule,
646
- MatButtonToggleModule,
647
- MatDialogModule,
648
- MatFormFieldModule,
649
- MatIconModule,
650
- MatInputModule,
651
- MatMenuModule,
652
- MatToolbarModule,
653
- MatTooltipModule,
654
- ReactiveFormsModule,
655
- NaturalFileModule,
656
- MatDividerModule] });
657
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: NaturalEditorModule, decorators: [{
658
- type: NgModule,
659
- args: [{
660
- declarations: [NaturalEditorComponent, LinkDialogComponent],
661
- imports: [...imports],
662
- exports: [...imports, NaturalEditorComponent],
663
- }]
664
- }] });
665
-
666
- // Load `$localize` onto the global scope - to be able to use that function to translate strings in components/services.
667
-
668
- /**
669
- * Generated bundle index. Do not edit.
670
- */
671
-
672
- export { NaturalEditorComponent, NaturalEditorModule };
673
- //# sourceMappingURL=ecodev-natural-editor.js.map