@ecodev/natural-editor 41.0.0 → 41.2.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/bundles/ecodev-natural-editor.umd.js +247 -80
- package/bundles/ecodev-natural-editor.umd.js.map +1 -1
- package/esm2015/lib/editor/editor.component.js +200 -0
- package/esm2015/lib/editor.module.js +15 -5
- package/esm2015/lib/link-dialog/link-dialog.component.js +3 -4
- package/esm2015/lib/utils/image.js +81 -0
- package/esm2015/lib/utils/menu.js +207 -0
- package/esm2015/lib/utils/schema.js +46 -0
- package/esm2015/lib/utils/table.js +37 -0
- package/esm2015/public-api.js +2 -2
- package/fesm2015/ecodev-natural-editor.js +233 -69
- package/fesm2015/ecodev-natural-editor.js.map +1 -1
- package/lib/{editor.component.d.ts → editor/editor.component.d.ts} +19 -4
- package/lib/editor.module.d.ts +4 -2
- package/lib/utils/image.d.ts +15 -0
- package/lib/{menu.d.ts → utils/menu.d.ts} +1 -1
- package/lib/utils/schema.d.ts +3 -0
- package/lib/utils/table.d.ts +8 -0
- package/package.json +3 -1
- package/public-api.d.ts +1 -1
- package/src/lib/editor/_editor.theme.scss +44 -0
- package/theming/_natural-editor.theme.scss +1 -1
- package/esm2015/lib/editor.component.js +0 -160
- package/esm2015/lib/menu.js +0 -222
- package/esm2015/lib/schema.js +0 -21
- package/lib/schema.d.ts +0 -2
- package/src/lib/_editor.theme.scss +0 -23
|
@@ -1,52 +1,158 @@
|
|
|
1
1
|
import '@angular/localize/init';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import { EditorView } from 'prosemirror-view';
|
|
5
|
-
import {
|
|
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
6
|
import { exampleSetup } from 'prosemirror-example-setup';
|
|
7
7
|
import { Schema, DOMSerializer, DOMParser } from 'prosemirror-model';
|
|
8
|
-
import { nodes, marks } from 'prosemirror-schema-basic';
|
|
9
|
-
import { addListNodes, wrapInList } from 'prosemirror-schema-list';
|
|
10
8
|
import * as i6 from '@angular/common';
|
|
11
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';
|
|
12
14
|
import { joinUpItem, liftItem, selectParentNodeItem, undoItem, redoItem, wrapItem, blockTypeItem } from 'prosemirror-menu';
|
|
13
15
|
import { toggleMark } from 'prosemirror-commands';
|
|
14
16
|
import * as i1 from '@angular/material/dialog';
|
|
15
17
|
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
16
18
|
import * as i4 from '@angular/forms';
|
|
17
19
|
import { FormControl, Validators, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
20
|
+
import * as i11 from '@ecodev/natural';
|
|
21
|
+
import { ifValid, NaturalFileModule } from '@ecodev/natural';
|
|
18
22
|
import * as i2 from '@angular/material/form-field';
|
|
19
23
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
20
24
|
import * as i3 from '@angular/material/button';
|
|
21
25
|
import { MatButtonModule } from '@angular/material/button';
|
|
22
26
|
import * as i5 from '@angular/material/input';
|
|
23
27
|
import { MatInputModule } from '@angular/material/input';
|
|
24
|
-
import * as
|
|
25
|
-
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
26
|
-
import * as i4$1 from '@angular/material/icon';
|
|
28
|
+
import * as i5$1 from '@angular/material/icon';
|
|
27
29
|
import { MatIconModule } from '@angular/material/icon';
|
|
28
|
-
import * as i6$1 from '@angular/material/
|
|
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';
|
|
29
33
|
import { MatMenuModule } from '@angular/material/menu';
|
|
30
|
-
import * as i8 from '@angular/material/
|
|
34
|
+
import * as i8 from '@angular/material/divider';
|
|
35
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
36
|
+
import * as i10 from '@angular/material/tooltip';
|
|
31
37
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
32
38
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
33
39
|
|
|
34
|
-
|
|
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 = {
|
|
35
117
|
heading: nodes.heading,
|
|
36
118
|
doc: nodes.doc,
|
|
37
119
|
paragraph: nodes.paragraph,
|
|
38
120
|
text: nodes.text,
|
|
39
121
|
hard_break: nodes.hard_break,
|
|
40
122
|
};
|
|
41
|
-
const
|
|
123
|
+
const basicMarks = {
|
|
42
124
|
link: marks.link,
|
|
43
125
|
em: marks.em,
|
|
44
126
|
strong: marks.strong,
|
|
45
127
|
};
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
nodes: addListNodes(
|
|
49
|
-
marks:
|
|
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,
|
|
50
156
|
});
|
|
51
157
|
|
|
52
158
|
class LinkDialogComponent {
|
|
@@ -61,9 +167,7 @@ class LinkDialogComponent {
|
|
|
61
167
|
this.form.setValue(data);
|
|
62
168
|
}
|
|
63
169
|
maybeConfirm() {
|
|
64
|
-
|
|
65
|
-
this.confirm();
|
|
66
|
-
}
|
|
170
|
+
ifValid(this.form).subscribe(() => this.confirm());
|
|
67
171
|
}
|
|
68
172
|
confirm() {
|
|
69
173
|
this.dialogRef.close(this.form.value);
|
|
@@ -82,6 +186,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImpor
|
|
|
82
186
|
args: [MAT_DIALOG_DATA]
|
|
83
187
|
}] }, { type: i1.MatDialogRef }]; } });
|
|
84
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
|
+
|
|
85
224
|
/**
|
|
86
225
|
* One item of the menu.
|
|
87
226
|
*
|
|
@@ -136,35 +275,6 @@ function canInsert(state, nodeType) {
|
|
|
136
275
|
}
|
|
137
276
|
return false;
|
|
138
277
|
}
|
|
139
|
-
// function insertImageItem(nodeType: NodeType) {
|
|
140
|
-
// return new MenuItem({
|
|
141
|
-
// enable(state): boolean {
|
|
142
|
-
// return canInsert(state, nodeType);
|
|
143
|
-
// },
|
|
144
|
-
// run(state, _, view) {
|
|
145
|
-
// let {from, to} = state.selection,
|
|
146
|
-
// attrs = null;
|
|
147
|
-
// if (state.selection instanceof NodeSelection && state.selection.node.type == nodeType) {
|
|
148
|
-
// attrs = state.selection.node.attrs;
|
|
149
|
-
// }
|
|
150
|
-
// openPrompt({
|
|
151
|
-
// title: 'Insert image',
|
|
152
|
-
// fields: {
|
|
153
|
-
// src: new TextField({label: 'Location', required: true, value: attrs && attrs.src}),
|
|
154
|
-
// title: new TextField({label: 'Title', value: attrs && attrs.title}),
|
|
155
|
-
// alt: new TextField({
|
|
156
|
-
// label: 'Description',
|
|
157
|
-
// value: attrs ? attrs.alt : state.doc.textBetween(from, to, ' '),
|
|
158
|
-
// }),
|
|
159
|
-
// },
|
|
160
|
-
// callback(attrs) {
|
|
161
|
-
// view.dispatch(view.state.tr.replaceSelectionWith(nodeType.createAndFill(attrs)));
|
|
162
|
-
// view.focus();
|
|
163
|
-
// },
|
|
164
|
-
// });
|
|
165
|
-
// },
|
|
166
|
-
// });
|
|
167
|
-
// }
|
|
168
278
|
function cmdItem(cmd, options = {}, useEnable = false) {
|
|
169
279
|
const passedOptions = Object.assign({ run: cmd }, options);
|
|
170
280
|
if ((!options.enable || useEnable) && !options.select) {
|
|
@@ -252,10 +362,6 @@ function buildMenuItems(schema, dialog) {
|
|
|
252
362
|
if (type) {
|
|
253
363
|
r.toggleLink = linkItem(type, dialog);
|
|
254
364
|
}
|
|
255
|
-
type = schema.nodes.image;
|
|
256
|
-
if (type) {
|
|
257
|
-
// r.insertImage = insertImageItem(type);
|
|
258
|
-
}
|
|
259
365
|
type = schema.nodes.bullet_list;
|
|
260
366
|
if (type) {
|
|
261
367
|
r.wrapBulletList = wrapListItem(type);
|
|
@@ -297,6 +403,22 @@ function buildMenuItems(schema, dialog) {
|
|
|
297
403
|
},
|
|
298
404
|
});
|
|
299
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
|
+
}
|
|
300
422
|
return r;
|
|
301
423
|
}
|
|
302
424
|
|
|
@@ -311,24 +433,38 @@ function buildMenuItems(schema, dialog) {
|
|
|
311
433
|
*/
|
|
312
434
|
// @dynamic
|
|
313
435
|
class NaturalEditorComponent {
|
|
314
|
-
constructor(ngControl, document, dialog) {
|
|
436
|
+
constructor(ngControl, document, dialog, imagePlugin) {
|
|
315
437
|
this.ngControl = ngControl;
|
|
316
438
|
this.document = document;
|
|
317
439
|
this.dialog = dialog;
|
|
440
|
+
this.imagePlugin = imagePlugin;
|
|
318
441
|
this.view = null;
|
|
319
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;
|
|
320
451
|
/**
|
|
321
452
|
* HTML string
|
|
322
453
|
*/
|
|
323
454
|
this.content = '';
|
|
324
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();
|
|
325
460
|
if (this.ngControl !== null) {
|
|
326
461
|
this.ngControl.valueAccessor = this;
|
|
327
462
|
}
|
|
328
463
|
}
|
|
329
464
|
ngOnInit() {
|
|
330
|
-
this.
|
|
331
|
-
|
|
465
|
+
this.schema = this.imageUploader ? advancedSchema : basicSchema;
|
|
466
|
+
this.menu = buildMenuItems(this.schema, this.dialog);
|
|
467
|
+
const serializer = DOMSerializer.fromSchema(this.schema);
|
|
332
468
|
const state = this.createState();
|
|
333
469
|
this.view = new EditorView(this.editor.nativeElement, {
|
|
334
470
|
state: state,
|
|
@@ -370,17 +506,23 @@ class NaturalEditorComponent {
|
|
|
370
506
|
if (!template.firstChild) {
|
|
371
507
|
throw new Error('child of template element could not be created');
|
|
372
508
|
}
|
|
373
|
-
const parser = DOMParser.fromSchema(schema);
|
|
509
|
+
const parser = DOMParser.fromSchema(this.schema);
|
|
374
510
|
const doc = parser.parse(template.firstChild);
|
|
375
|
-
const
|
|
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
|
+
}
|
|
376
523
|
return EditorState.create({
|
|
377
524
|
doc: doc,
|
|
378
|
-
plugins:
|
|
379
|
-
...exampleSetup({ schema, menuBar: false }),
|
|
380
|
-
new Plugin({
|
|
381
|
-
view: () => self,
|
|
382
|
-
}),
|
|
383
|
-
],
|
|
525
|
+
plugins: plugins,
|
|
384
526
|
});
|
|
385
527
|
}
|
|
386
528
|
/**
|
|
@@ -418,15 +560,25 @@ class NaturalEditorComponent {
|
|
|
418
560
|
item.spec.run(this.view.state, this.view.dispatch, this.view, event);
|
|
419
561
|
this.view.focus();
|
|
420
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
|
+
}
|
|
421
572
|
}
|
|
422
|
-
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 }], target: i0.ɵɵFactoryTarget.Component });
|
|
423
|
-
NaturalEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: NaturalEditorComponent, selector: "natural-editor", outputs: { contentChange: "contentChange" }, viewQueries: [{ propertyName: "editor", first: true, predicate: ["editor"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<div class=\"menu\" *ngIf=\"menu\">\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\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 #editor></div>\n", styles: [".menu{border-bottom:1px solid;display:flex;flex-wrap:wrap;padding:10px 18px}::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}\n"], components: [{ type: i3$1.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { type: i4$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { 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: i6$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i6$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { type: i8.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i6$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }] });
|
|
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"] }] });
|
|
424
575
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: NaturalEditorComponent, decorators: [{
|
|
425
576
|
type: Component,
|
|
426
577
|
args: [{
|
|
427
578
|
selector: 'natural-editor',
|
|
428
579
|
templateUrl: './editor.component.html',
|
|
429
580
|
styleUrls: ['./editor.component.scss'],
|
|
581
|
+
providers: [ImagePlugin],
|
|
430
582
|
}]
|
|
431
583
|
}], ctorParameters: function () { return [{ type: i4.NgControl, decorators: [{
|
|
432
584
|
type: Optional
|
|
@@ -435,11 +587,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImpor
|
|
|
435
587
|
}] }, { type: Document, decorators: [{
|
|
436
588
|
type: Inject,
|
|
437
589
|
args: [DOCUMENT]
|
|
438
|
-
}] }, { type: i1.MatDialog }]; }, propDecorators: { editor: [{
|
|
590
|
+
}] }, { type: i1.MatDialog }, { type: ImagePlugin }]; }, propDecorators: { editor: [{
|
|
439
591
|
type: ViewChild,
|
|
440
592
|
args: ['editor', { read: ElementRef, static: true }]
|
|
441
593
|
}], contentChange: [{
|
|
442
594
|
type: Output
|
|
595
|
+
}], imageUploader: [{
|
|
596
|
+
type: Input
|
|
597
|
+
}], save: [{
|
|
598
|
+
type: Output
|
|
443
599
|
}] } });
|
|
444
600
|
|
|
445
601
|
const imports = [
|
|
@@ -454,6 +610,8 @@ const imports = [
|
|
|
454
610
|
MatToolbarModule,
|
|
455
611
|
MatTooltipModule,
|
|
456
612
|
ReactiveFormsModule,
|
|
613
|
+
NaturalFileModule,
|
|
614
|
+
MatDividerModule,
|
|
457
615
|
];
|
|
458
616
|
class NaturalEditorModule {
|
|
459
617
|
}
|
|
@@ -468,7 +626,9 @@ NaturalEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ver
|
|
|
468
626
|
MatMenuModule,
|
|
469
627
|
MatToolbarModule,
|
|
470
628
|
MatTooltipModule,
|
|
471
|
-
ReactiveFormsModule
|
|
629
|
+
ReactiveFormsModule,
|
|
630
|
+
NaturalFileModule,
|
|
631
|
+
MatDividerModule], exports: [CommonModule,
|
|
472
632
|
MatButtonModule,
|
|
473
633
|
MatButtonToggleModule,
|
|
474
634
|
MatDialogModule,
|
|
@@ -478,7 +638,9 @@ NaturalEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ver
|
|
|
478
638
|
MatMenuModule,
|
|
479
639
|
MatToolbarModule,
|
|
480
640
|
MatTooltipModule,
|
|
481
|
-
ReactiveFormsModule,
|
|
641
|
+
ReactiveFormsModule,
|
|
642
|
+
NaturalFileModule,
|
|
643
|
+
MatDividerModule, NaturalEditorComponent] });
|
|
482
644
|
NaturalEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: NaturalEditorModule, imports: [[...imports], CommonModule,
|
|
483
645
|
MatButtonModule,
|
|
484
646
|
MatButtonToggleModule,
|
|
@@ -489,7 +651,9 @@ NaturalEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
|
|
|
489
651
|
MatMenuModule,
|
|
490
652
|
MatToolbarModule,
|
|
491
653
|
MatTooltipModule,
|
|
492
|
-
ReactiveFormsModule
|
|
654
|
+
ReactiveFormsModule,
|
|
655
|
+
NaturalFileModule,
|
|
656
|
+
MatDividerModule] });
|
|
493
657
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: NaturalEditorModule, decorators: [{
|
|
494
658
|
type: NgModule,
|
|
495
659
|
args: [{
|