@progress/kendo-vue-editor 7.0.1-develop.1 → 7.0.1-develop.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Editor.mjs CHANGED
@@ -5,215 +5,216 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as j, toRaw as K, markRaw as F, createVNode as p, h as T, isVNode as J } from "vue";
8
+ import { defineComponent as j, toRaw as K, markRaw as P, createVNode as h, h as T, isVNode as J } from "vue";
9
9
  import { ButtonGroup as q, Toolbar as Q, ToolbarSeparator as X } from "@progress/kendo-vue-buttons";
10
- import { guid as O, WatermarkOverlay as Y, classNames as Z, setRef as P, getRef as R, validatePackage as ee, shouldShowValidationUI as te, getLicenseMessage as ie, templateRendering as oe, getListeners as re, getTemplate as se } from "@progress/kendo-vue-common";
11
- import { Plugin as E, spacesFix as ne, history as ae, dropCursor as le, gapCursor as pe, tableEditing as de, PluginKey as H, Schema as ce, marks as me, EditorState as ue, keymap as M, baseKeymap as he, EditorView as fe, getMark as ge } from "@progress/kendo-editor-common";
10
+ import { guid as V, WatermarkOverlay as Y, classNames as Z, setRef as M, getRef as R, validatePackage as ee, shouldShowValidationUI as te, getLicenseMessage as ie, templateRendering as oe, getListeners as se, getTemplate as re } from "@progress/kendo-vue-common";
11
+ import { Plugin as $, spacesFix as ne, history as ae, dropCursor as le, gapCursor as pe, tableEditing as de, PluginKey as H, Schema as ce, marks as me, EditorState as ue, keymap as _, baseKeymap as he, EditorView as fe, getMark as ge } from "@progress/kendo-editor-common";
12
12
  import { nodes as ve } from "./config/schema.mjs";
13
- import { defaultStyle as we, tablesStyles as ke, rtlStyles as be } from "./config/defaultStyles.mjs";
14
- import { EditorToolsSettings as e } from "./config/toolsSettings.mjs";
13
+ import { defaultStyle as we, tablesStyles as be, rtlStyles as ke } from "./config/defaultStyles.mjs";
14
+ import { EditorToolsSettings as t } from "./config/toolsSettings.mjs";
15
15
  import { InsertLinkDialog as ye } from "./dialogs/insertLink.mjs";
16
16
  import { EditorUtils as y } from "./utils/main.mjs";
17
- import { editorPropsKey as D } from "./utils/props-key.mjs";
17
+ import { editorPropsKey as x } from "./utils/props-key.mjs";
18
18
  import { updateEditorValue as Ce } from "./utils/controlled-value.mjs";
19
- import { firefox as _ } from "./utils/browser-detection.mjs";
19
+ import { cleanupAndDestroyProseMirrorView as Se, nullifyObjectProperties as Le, cleanupIframe as Ee } from "./utils/cleanup.mjs";
20
+ import { firefox as D } from "./utils/browser-detection.mjs";
20
21
  import { packageMetadata as A } from "./package-metadata.mjs";
21
- import { Align as S } from "./tools/align.mjs";
22
- import { Indent as Se } from "./tools/indent.mjs";
23
- import { List as x } from "./tools/lists.mjs";
24
- import { Outdent as Le } from "./tools/outdent.mjs";
25
- import { InlineFormat as v } from "./tools/inlineFormat.mjs";
26
- import { FontName as I } from "./tools/fontStyle.mjs";
27
- import { FormatBlock as Ve } from "./tools/formatBlock.mjs";
28
- import { ProseMirror as a } from "./tools/proseMirrorTool.mjs";
22
+ import { Align as E } from "./tools/align.mjs";
23
+ import { Indent as Ve } from "./tools/indent.mjs";
24
+ import { List as I } from "./tools/lists.mjs";
25
+ import { Outdent as $e } from "./tools/outdent.mjs";
26
+ import { InlineFormat as b } from "./tools/inlineFormat.mjs";
27
+ import { FontName as U } from "./tools/fontStyle.mjs";
28
+ import { FormatBlock as Ae } from "./tools/formatBlock.mjs";
29
+ import { ProseMirror as c } from "./tools/proseMirrorTool.mjs";
29
30
  import { LinkTool as N } from "./tools/insertLink.mjs";
30
- import { Unlink as $e } from "./tools/unlink.mjs";
31
- import { CleanFormatting as Ee } from "./tools/cleanFormatting.mjs";
32
- import { SelectAll as Ae } from "./tools/selectAll.mjs";
33
- import { InsertImage as Be } from "./tools/insertImage.mjs";
34
- import { InsertTable as Fe } from "./tools/insertTable/tool.mjs";
35
- import { ViewHtml as Te } from "./tools/viewHtml.mjs";
36
- import { Pdf as Oe } from "./tools/pdf.mjs";
37
- import { Print as Pe } from "./tools/print.mjs";
38
- import { FindAndReplace as Re } from "./tools/findReplace.mjs";
39
- import { ApplyColor as U } from "./tools/applyColor.mjs";
40
- import { keys as w, messages as B } from "./messages/main.mjs";
41
- import { provideLocalizationService as He } from "@progress/kendo-vue-intl";
31
+ import { Unlink as Oe } from "./tools/unlink.mjs";
32
+ import { CleanFormatting as Be } from "./tools/cleanFormatting.mjs";
33
+ import { SelectAll as Fe } from "./tools/selectAll.mjs";
34
+ import { InsertImage as Pe } from "./tools/insertImage.mjs";
35
+ import { InsertTable as Te } from "./tools/insertTable/tool.mjs";
36
+ import { ViewHtml as Me } from "./tools/viewHtml.mjs";
37
+ import { Pdf as Re } from "./tools/pdf.mjs";
38
+ import { Print as He } from "./tools/print.mjs";
39
+ import { FindAndReplace as _e } from "./tools/findReplace.mjs";
40
+ import { ApplyColor as z } from "./tools/applyColor.mjs";
41
+ import { keys as k, messages as O } from "./messages/main.mjs";
42
+ import { provideLocalizationService as xe } from "@progress/kendo-vue-intl";
42
43
  const {
43
- link: z,
44
- bold: Me,
45
- italic: De,
46
- underline: _e
47
- } = e;
48
- function W(t) {
49
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !J(t);
44
+ link: W,
45
+ bold: De,
46
+ italic: Ie,
47
+ underline: Ue
48
+ } = t;
49
+ function G(e) {
50
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !J(e);
50
51
  }
51
52
  const C = {
52
53
  Bold: {
53
- comp: v,
54
- props: e.bold
54
+ comp: b,
55
+ props: t.bold
55
56
  },
56
57
  Italic: {
57
- comp: v,
58
- props: e.italic
58
+ comp: b,
59
+ props: t.italic
59
60
  },
60
61
  Underline: {
61
- comp: v,
62
- props: e.underline
62
+ comp: b,
63
+ props: t.underline
63
64
  },
64
65
  Strikethrough: {
65
- comp: v,
66
- props: e.strikethrough
66
+ comp: b,
67
+ props: t.strikethrough
67
68
  },
68
69
  Subscript: {
69
- comp: v,
70
- props: e.subscript
70
+ comp: b,
71
+ props: t.subscript
71
72
  },
72
73
  Superscript: {
73
- comp: v,
74
- props: e.superscript
74
+ comp: b,
75
+ props: t.superscript
75
76
  },
76
77
  AlignLeft: {
77
- comp: S,
78
- props: e.alignLeft
78
+ comp: E,
79
+ props: t.alignLeft
79
80
  },
80
81
  AlignCenter: {
81
- comp: S,
82
- props: e.alignCenter
82
+ comp: E,
83
+ props: t.alignCenter
83
84
  },
84
85
  AlignRight: {
85
- comp: S,
86
- props: e.alignRight
86
+ comp: E,
87
+ props: t.alignRight
87
88
  },
88
89
  AlignJustify: {
89
- comp: S,
90
- props: e.alignJustify
90
+ comp: E,
91
+ props: t.alignJustify
91
92
  },
92
93
  Indent: {
93
- comp: Se,
94
- props: e.indent
94
+ comp: Ve,
95
+ props: t.indent
95
96
  },
96
97
  Outdent: {
97
- comp: Le,
98
- props: e.outdent
98
+ comp: $e,
99
+ props: t.outdent
99
100
  },
100
101
  OrderedList: {
101
- comp: x,
102
- props: e.orderedList
102
+ comp: I,
103
+ props: t.orderedList
103
104
  },
104
105
  UnorderedList: {
105
- comp: x,
106
- props: e.bulletList
106
+ comp: I,
107
+ props: t.bulletList
107
108
  },
108
109
  FontSize: {
109
- comp: I,
110
- props: e.fontSize
110
+ comp: U,
111
+ props: t.fontSize
111
112
  },
112
113
  FontName: {
113
- comp: I,
114
- props: e.fontName
114
+ comp: U,
115
+ props: t.fontName
115
116
  },
116
117
  FormatBlock: {
117
- comp: Ve,
118
- props: e.formatBlock
118
+ comp: Ae,
119
+ props: t.formatBlock
119
120
  },
120
121
  Undo: {
121
- comp: a,
122
- props: e.undo
122
+ comp: c,
123
+ props: t.undo
123
124
  },
124
125
  Redo: {
125
- comp: a,
126
- props: e.redo
126
+ comp: c,
127
+ props: t.redo
127
128
  },
128
129
  Link: {
129
130
  comp: N,
130
- props: e.link
131
+ props: t.link
131
132
  },
132
133
  Unlink: {
133
- comp: $e,
134
- props: e.unlink
134
+ comp: Oe,
135
+ props: t.unlink
135
136
  },
136
137
  InsertImage: {
137
- comp: Be,
138
- props: e.image
138
+ comp: Pe,
139
+ props: t.image
139
140
  },
140
141
  ViewHtml: {
141
- comp: Te,
142
- props: e.viewHtml
142
+ comp: Me,
143
+ props: t.viewHtml
143
144
  },
144
145
  CleanFormatting: {
145
- comp: Ee,
146
- props: e.cleanFormatting
146
+ comp: Be,
147
+ props: t.cleanFormatting
147
148
  },
148
149
  SelectAll: {
149
- comp: Ae,
150
- props: e.selectAll
150
+ comp: Fe,
151
+ props: t.selectAll
151
152
  },
152
153
  InsertTable: {
153
- comp: Fe,
154
- props: e.insertTable
154
+ comp: Te,
155
+ props: t.insertTable
155
156
  },
156
157
  MergeCells: {
157
- comp: a,
158
- props: e.mergeCells
158
+ comp: c,
159
+ props: t.mergeCells
159
160
  },
160
161
  SplitCell: {
161
- comp: a,
162
- props: e.splitCell
162
+ comp: c,
163
+ props: t.splitCell
163
164
  },
164
165
  AddRowBefore: {
165
- comp: a,
166
- props: e.addRowBefore
166
+ comp: c,
167
+ props: t.addRowBefore
167
168
  },
168
169
  AddRowAfter: {
169
- comp: a,
170
- props: e.addRowAfter
170
+ comp: c,
171
+ props: t.addRowAfter
171
172
  },
172
173
  AddColumnBefore: {
173
- comp: a,
174
- props: e.addColumnBefore
174
+ comp: c,
175
+ props: t.addColumnBefore
175
176
  },
176
177
  AddColumnAfter: {
177
- comp: a,
178
- props: e.addColumnAfter
178
+ comp: c,
179
+ props: t.addColumnAfter
179
180
  },
180
181
  DeleteRow: {
181
- comp: a,
182
- props: e.deleteRow
182
+ comp: c,
183
+ props: t.deleteRow
183
184
  },
184
185
  DeleteColumn: {
185
- comp: a,
186
- props: e.deleteColumn
186
+ comp: c,
187
+ props: t.deleteColumn
187
188
  },
188
189
  DeleteTable: {
189
- comp: a,
190
- props: e.deleteTable
190
+ comp: c,
191
+ props: t.deleteTable
191
192
  },
192
193
  Print: {
193
- comp: Pe,
194
- props: e.print
194
+ comp: He,
195
+ props: t.print
195
196
  },
196
197
  Pdf: {
197
- comp: Oe,
198
- props: e.pdf
198
+ comp: Re,
199
+ props: t.pdf
199
200
  },
200
201
  InsertFile: {
201
202
  comp: N,
202
- props: e.insertFile
203
+ props: t.insertFile
203
204
  },
204
205
  FindAndReplace: {
205
- comp: Re,
206
- props: e.findAndReplace
206
+ comp: _e,
207
+ props: t.findAndReplace
207
208
  },
208
209
  ForeColor: {
209
- comp: U,
210
- props: e.foreColor
210
+ comp: z,
211
+ props: t.foreColor
211
212
  },
212
213
  BackColor: {
213
- comp: U,
214
- props: e.backColor
214
+ comp: z,
215
+ props: t.backColor
215
216
  }
216
- }, kt = /* @__PURE__ */ j({
217
+ }, St = /* @__PURE__ */ j({
217
218
  name: "KendoEditor",
218
219
  emits: {
219
220
  focus: null,
@@ -233,8 +234,8 @@ const C = {
233
234
  defaultEditMode: {
234
235
  type: String,
235
236
  default: "iframe",
236
- validator: function(t) {
237
- return ["iframe", "div"].includes(t);
237
+ validator: function(e) {
238
+ return ["iframe", "div"].includes(e);
238
239
  }
239
240
  },
240
241
  contentStyle: Object,
@@ -248,8 +249,8 @@ const C = {
248
249
  preserveWhitespace: {
249
250
  type: [String, Boolean],
250
251
  default: "full",
251
- validator: function(t) {
252
- return [!0, !1, "full"].includes(t);
252
+ validator: function(e) {
253
+ return [!0, !1, "full"].includes(e);
253
254
  }
254
255
  },
255
256
  pasteHtml: Function,
@@ -260,7 +261,7 @@ const C = {
260
261
  },
261
262
  data() {
262
263
  return {
263
- updateGuid: O(),
264
+ updateGuid: V(),
264
265
  view: void 0,
265
266
  linkDialog: !1,
266
267
  showLicenseWatermark: !1,
@@ -268,192 +269,215 @@ const C = {
268
269
  };
269
270
  },
270
271
  created() {
271
- this._view = void 0, this.trOnChange = null, this.valueisUpdated = !1, this._prevValue = this.$props.value, ee(A), this.showLicenseWatermark = te(A), this.licenseMessage = ie(A);
272
+ this._view = void 0, this.trOnChange = null, this.valueisUpdated = !1, this._prevValue = this.$props.value, this.pluginViews = [], ee(A), this.showLicenseWatermark = te(A), this.licenseMessage = ie(A);
272
273
  },
273
274
  mounted() {
274
- this.iframe = R(this, "iframe"), this.contentElement = R(this, "contentElement"), (!this.iframe || !_) && this.initialize();
275
+ this.iframe = R(this, "iframe"), this.contentElement = R(this, "contentElement"), (!this.iframe || !D) && this.initialize();
275
276
  },
276
277
  watch: {
277
- value: function(t, i) {
278
+ value: function(e, i) {
278
279
  this.valueisUpdated = !0, this._prevValue = i;
279
280
  }
280
281
  },
281
282
  updated() {
282
283
  const {
283
- value: t
284
+ value: e
284
285
  } = this.$props, i = this.getView();
285
- t === void 0 || !this.valueisUpdated || !i || (Ce(i, this.computedValue(), this._prevValue, this.trOnChange, this.htmlOnChange), this.valueisUpdated = !1, this.trOnChange = null, this.htmlOnChange = null);
286
+ e === void 0 || !this.valueisUpdated || !i || (Ce(i, this.computedValue(), this._prevValue, this.trOnChange, this.htmlOnChange), this.valueisUpdated = !1, this.trOnChange = null, this.htmlOnChange = null);
287
+ },
288
+ beforeUnmount() {
289
+ var a, m;
290
+ this.iframe && (this.iframe.src = "about:blank");
291
+ const e = this.iframe, i = this.contentElement, s = this.getView();
292
+ if (s) {
293
+ (a = this.pluginViews) == null || a.forEach((l) => {
294
+ var f;
295
+ (f = l == null ? void 0 : l.destroy) == null || f.call(l);
296
+ });
297
+ const u = Se(s);
298
+ (m = u == null ? void 0 : u.parentNode) == null || m.removeChild(u);
299
+ }
300
+ this.view && Le(this.view), this.view = void 0, this._view = null, this.trOnChange = null, this.htmlOnChange = null, this.pasteEvent = void 0, this.valueisUpdated = !1, this._prevValue = void 0, this.pluginViews && (this.pluginViews.length = 0, this.pluginViews = null), this.iframe = void 0, this.contentElement = void 0, e && Ee(e, i), this.updateGuid = void 0, this.linkDialog = !1;
286
301
  },
287
302
  unmounted() {
288
- this.getView() && this.getView().destroy(), this.view = void 0, this._view = void 0;
303
+ this.view = void 0, this._view = null, this.iframe = void 0, this.contentElement = void 0, this.pluginViews = null;
289
304
  },
290
305
  render() {
291
- let t = 100;
306
+ let e = 100;
292
307
  const {
293
308
  tools: i = [],
294
- defaultEditMode: r = "iframe",
295
- preserveWhitespace: g = "full",
296
- style: c,
297
- value: k
298
- } = this.$props, b = this.getView(), m = He(this), L = this.showLicenseWatermark ? p(Y, {
309
+ defaultEditMode: s = "iframe",
310
+ preserveWhitespace: a = "full",
311
+ style: m,
312
+ value: u
313
+ } = this.$props, l = this.getView(), f = xe(this), w = this.showLicenseWatermark ? h(Y, {
299
314
  message: this.licenseMessage
300
315
  }, null) : null;
301
316
  if (this.view) {
302
- const o = D.getState(this.view.state);
303
- o.preserveWhitespace = g;
317
+ const o = x.getState(this.view.state);
318
+ o.preserveWhitespace = a;
304
319
  }
305
- let h = this.$props.contentStyle;
306
- h === void 0 && (c || {}).height === void 0 && (h = {
320
+ let g = this.$props.contentStyle;
321
+ g === void 0 && (m || {}).height === void 0 && (g = {
307
322
  height: "300px"
308
323
  });
309
- const $ = function() {
310
- return this.linkDialog && p(ye, {
311
- view: b,
312
- settings: z,
324
+ const S = function() {
325
+ return this.linkDialog && h(ye, {
326
+ view: l,
327
+ settings: W,
313
328
  dir: this.$props.dir,
314
329
  onClose: this.handleClose
315
330
  }, null);
316
- }, s = function(o, u) {
317
- const l = C[o] || o, G = function() {
318
- let f;
319
- return o === "ForeColor" ? f = m.toLanguageString(w.foregroundColorAriaLabel, B[w.foregroundColorAriaLabel]) : o === "BackColor" && (f = m.toLanguageString(w.backgroundColor, B[w.backgroundColor])), f;
331
+ }, L = function(o, p) {
332
+ const d = C[o] || o, F = function() {
333
+ let v;
334
+ return o === "ForeColor" ? v = f.toLanguageString(k.foregroundColorAriaLabel, O[k.foregroundColorAriaLabel]) : o === "BackColor" && (v = f.toLanguageString(k.backgroundColor, O[k.backgroundColor])), v;
320
335
  };
321
336
  if (C[o]) {
322
- t++;
323
- const f = {
324
- view: b,
337
+ e++;
338
+ const v = {
339
+ view: l,
325
340
  dir: this.$props.dir,
326
- key: t,
341
+ key: e,
327
342
  updateGuid: this.updateGuid,
328
343
  settings: C[o].props,
329
344
  ...C[o].props,
330
- ariaLabel: G()
345
+ ariaLabel: F()
331
346
  };
332
- return T(F(C[o].comp), f);
347
+ return T(P(C[o].comp), v);
333
348
  } else {
334
- if (l === "Separator")
335
- return p(X, {
336
- key: t
349
+ if (d === "Separator")
350
+ return h(X, {
351
+ key: e
337
352
  }, null);
338
353
  {
339
- const f = oe.call(this, l.render, re.call(this));
340
- return se.call(this, {
354
+ const v = oe.call(this, d.render, se.call(this));
355
+ return re.call(this, {
341
356
  h: T,
342
- template: f,
357
+ template: v,
343
358
  defaultRendering: null,
344
359
  additionalListeners: {},
345
360
  additionalProps: {
346
- view: b,
361
+ view: l,
347
362
  dir: this.$props.dir,
348
363
  updateGuid: this.updateGuid,
349
- key: t,
350
- settings: l.props
364
+ key: e,
365
+ settings: d.props
351
366
  }
352
367
  });
353
368
  }
354
369
  }
355
- }, d = function(o, u) {
356
- return o.map(function(l) {
357
- return s.call(this, l, u);
370
+ }, r = function(o, p) {
371
+ return o.map(function(d) {
372
+ return L.call(this, d, p);
358
373
  }, this);
359
- }, n = i.map(function(o, u) {
360
- let l;
361
- return Array.isArray(o) ? p(q, {
362
- key: u
363
- }, W(l = d.call(this, o, u)) ? l : {
364
- default: () => [l]
365
- }) : s.call(this, o, u);
374
+ }, n = i.map(function(o, p) {
375
+ let d;
376
+ return Array.isArray(o) ? h(q, {
377
+ key: p
378
+ }, G(d = r.call(this, o, p)) ? d : {
379
+ default: () => [d]
380
+ }) : L.call(this, o, p);
366
381
  }, this);
367
- return p("div", {
382
+ return h("div", {
368
383
  class: Z("k-editor", {
369
384
  "k-editor-resizable": this.$props.resizable
370
385
  }),
371
386
  dir: this.$props.dir
372
- }, [n.length > 0 && p(Q, {
387
+ }, [n.length > 0 && h(Q, {
373
388
  overflow: "none",
374
389
  class: "k-editor-toolbar",
375
390
  keyboardNavigation: this.$props.keyboardNavigation
376
- }, W(n) ? n : {
391
+ }, G(n) ? n : {
377
392
  default: () => [n]
378
- }), r === "iframe" ? p("div", {
393
+ }), s === "iframe" ? h("div", {
379
394
  class: "k-editor-content"
380
- }, [p("iframe", {
395
+ }, [h("iframe", {
381
396
  onLoad: this.iframeLoad,
382
- ref: P(this, "iframe"),
397
+ ref: M(this, "iframe"),
383
398
  frameborder: "0",
384
- title: m.toLanguageString(w.iframeTitle, B[w.iframeTitle]),
385
- style: h,
399
+ title: f.toLanguageString(k.iframeTitle, O[k.iframeTitle]),
400
+ style: g,
386
401
  class: "k-iframe"
387
- }, null)]) : p("div", {
388
- style: h,
402
+ }, null)]) : h("div", {
403
+ style: g,
389
404
  class: "k-editor-content"
390
- }, [p("div", {
391
- ref: P(this, "contentElement"),
405
+ }, [h("div", {
406
+ ref: M(this, "contentElement"),
392
407
  role: "textbox",
393
408
  "aria-labelledby": this.$props.ariaLabelledBy,
394
409
  "aria-describedby": this.$props.ariaDescribedBy,
395
410
  "aria-label": this.$props.ariaLabel
396
- }, null)]), $.call(this), L]);
411
+ }, null)]), S.call(this), w]);
397
412
  },
398
413
  methods: {
399
414
  getView() {
400
415
  return this.view;
401
416
  },
402
417
  getHTML() {
403
- const t = this.getView();
404
- return t ? y.getHtml(t.state) : "";
418
+ const e = this.getView();
419
+ return e ? y.getHtml(e.state) : "";
405
420
  },
406
- setHTML(t) {
421
+ setHTML(e) {
407
422
  const i = this.getView();
408
- i && y.setHtml(i, t);
423
+ i && y.setHtml(i, e);
409
424
  },
410
425
  focus() {
411
426
  this.getView() && this.getView().focus();
412
427
  },
413
- updateTools(t) {
414
- this.view = t, this.updateGuid = O();
428
+ updateTools(e) {
429
+ this.view = e, this.updateGuid = V();
415
430
  },
416
431
  iframeLoad() {
417
- _ && this.initialize();
432
+ D && this.initialize();
418
433
  },
419
434
  initialize() {
420
- const t = this.iframe && this.iframe.contentWindow;
421
- if (t) {
422
- const s = t.document;
423
- [we, ke, this.$props.dir === "rtl" ? be : void 0].forEach((n) => {
424
- if (n) {
425
- const o = s.createElement("style");
426
- o.appendChild(s.createTextNode(n)), s.head.appendChild(o);
435
+ const e = this.iframe && this.iframe.contentWindow;
436
+ if (e) {
437
+ const r = e.document;
438
+ [we, be, this.$props.dir === "rtl" ? ke : void 0].forEach((o) => {
439
+ if (o) {
440
+ const p = r.createElement("style");
441
+ p.appendChild(r.createTextNode(o)), r.head.appendChild(p);
427
442
  }
428
443
  });
429
- const d = s.createElement("meta");
430
- d.setAttribute("charset", "utf-8"), s.head.appendChild(d), this.contentElement = s.createElement("div"), s.body.appendChild(this.contentElement), this.contentElement.classList.add("k-content"), this.contentElement.setAttribute("role", "main");
444
+ const n = r.createElement("meta");
445
+ n.setAttribute("charset", "utf-8"), r.head.appendChild(n), this.contentElement = r.createElement("div"), r.body.appendChild(this.contentElement), this.contentElement.classList.add("k-content"), this.contentElement.setAttribute("role", "main");
431
446
  }
432
447
  const i = this.contentElement;
433
448
  if (!i)
434
449
  return;
435
450
  const {
436
- preserveWhitespace: r = "full"
437
- } = this.$props, g = this;
438
- let c = [
451
+ preserveWhitespace: s = "full"
452
+ } = this.$props, a = this, m = function(r) {
453
+ a.view = r, a.updateGuid = V();
454
+ };
455
+ let u = [
439
456
  // https://prosemirror.net/docs/ref/#state.PluginSpec
440
- new E({
441
- view: () => ({
442
- update: this.updateTools
443
- }),
457
+ new $({
458
+ view: (r) => {
459
+ const n = {
460
+ update: m,
461
+ destroy: () => {
462
+ const o = a.pluginViews.indexOf(n);
463
+ o > -1 && a.pluginViews.splice(o, 1);
464
+ }
465
+ };
466
+ return a.pluginViews.push(n), n;
467
+ },
444
468
  key: new H("toolbar-tools-update-plugin")
445
469
  }),
446
- new E({
470
+ new $({
447
471
  filterTransaction: this.filterTransaction,
448
472
  key: new H("onExecute-event-plugin")
449
473
  }),
450
- new E({
451
- key: D,
474
+ new $({
475
+ key: x,
452
476
  state: {
453
477
  init: () => ({
454
- preserveWhitespace: r
478
+ preserveWhitespace: s
455
479
  }),
456
- apply: (s, d) => d
480
+ apply: (r, n) => n
457
481
  }
458
482
  }),
459
483
  ne(),
@@ -461,41 +485,41 @@ const C = {
461
485
  le(),
462
486
  pe(),
463
487
  de()
464
- ], k = {
488
+ ], l = {
465
489
  ...y.getShortcuts({
466
490
  types: {
467
491
  listItem: "list_item",
468
492
  hardBreak: "hard_break"
469
493
  },
470
494
  toolsSettings: {
471
- bold: Me,
472
- italic: De,
473
- underline: _e
495
+ bold: De,
496
+ italic: Ie,
497
+ underline: Ue
474
498
  }
475
499
  }),
476
500
  "Mod-k": () => {
477
501
  const {
478
- linkDialog: s
479
- } = this.$data, d = this.getView();
480
- if (d) {
481
- const n = d.state, o = n.selection.empty, u = ge(n, n.schema.marks[z.mark]);
482
- !s && !(o && !u) && (this.linkDialog = !0);
502
+ linkDialog: r
503
+ } = this.$data, n = this.getView();
504
+ if (n) {
505
+ const o = n.state, p = o.selection.empty, d = ge(o, o.schema.marks[W.mark]);
506
+ !r && !(p && !d) && (this.linkDialog = !0);
483
507
  }
484
- return !s;
508
+ return !r;
485
509
  }
486
510
  };
487
511
  const {
488
- defaultContent: b = "",
489
- value: m
490
- } = this.$props, L = m && typeof m != "string" ? K(m) : y.createDocument(new ce({
512
+ defaultContent: f = "",
513
+ value: w
514
+ } = this.$props, B = w && typeof w != "string" ? K(w) : y.createDocument(new ce({
491
515
  nodes: ve,
492
516
  marks: me
493
- }), m || b, {
494
- preserveWhitespace: r
495
- }), V = {
517
+ }), w || f, {
518
+ preserveWhitespace: s
519
+ }), g = {
496
520
  state: ue.create({
497
- plugins: [...c, M(k), M(he)],
498
- doc: L
521
+ plugins: [...u, _(l), _(he)],
522
+ doc: B
499
523
  }),
500
524
  transformPastedHTML: this.onPasteHtml,
501
525
  dispatchTransaction: this.dispatchTransaction,
@@ -504,74 +528,74 @@ const C = {
504
528
  blur: this.onBlur,
505
529
  paste: this.onPaste
506
530
  }
507
- }, h = {
508
- plugins: c,
509
- shortcuts: k,
510
- target: g,
511
- viewProps: V,
531
+ }, S = {
532
+ plugins: u,
533
+ shortcuts: l,
534
+ target: a,
535
+ viewProps: g,
512
536
  dom: i
513
537
  };
514
- this.$emit("loaded", h);
515
- const $ = this.$props.extendView && this.$props.extendView(h) || new fe({
538
+ this.$emit("loaded", S);
539
+ const L = this.$props.extendView && this.$props.extendView(S) || new fe({
516
540
  mount: i
517
- }, V);
518
- this.view = F($);
541
+ }, g);
542
+ this.view = P(L);
519
543
  },
520
- filterTransaction(t, i) {
521
- const r = {
544
+ filterTransaction(e, i) {
545
+ const s = {
522
546
  target: this,
523
- transaction: t,
547
+ transaction: e,
524
548
  state: i
525
549
  };
526
- return this.$emit("execute", r), !0;
550
+ return this.$emit("execute", s), !0;
527
551
  },
528
- onPasteHtml(t) {
552
+ onPasteHtml(e) {
529
553
  if (this.$props.pasteHtml && this.pasteEvent) {
530
554
  const i = {
531
555
  target: this,
532
- pastedHtml: t,
556
+ pastedHtml: e,
533
557
  event: this.pasteEvent
534
- }, r = this.$props.pasteHtml(i);
535
- if (this.pasteEvent = void 0, typeof r == "string")
536
- return r;
558
+ }, s = this.$props.pasteHtml(i);
559
+ if (this.pasteEvent = void 0, typeof s == "string")
560
+ return s;
537
561
  }
538
- return t;
562
+ return e;
539
563
  },
540
- dispatchTransaction(t) {
541
- const i = t.docChanged;
564
+ dispatchTransaction(e) {
565
+ const i = e.docChanged;
542
566
  if (i) {
543
- this.trOnChange = t;
544
- const r = t.doc, g = t.doc.type.schema, c = this, k = {
545
- target: c,
546
- value: r,
567
+ this.trOnChange = e;
568
+ const s = e.doc, a = e.doc.type.schema, m = this, u = {
569
+ target: m,
570
+ value: s,
547
571
  get html() {
548
- return c.htmlOnChange = y.getHtml({
549
- doc: r,
550
- schema: g
551
- }), c.htmlOnChange;
572
+ return m.htmlOnChange = y.getHtml({
573
+ doc: s,
574
+ schema: a
575
+ }), m.htmlOnChange;
552
576
  },
553
- transaction: t,
554
- schema: g
577
+ transaction: e,
578
+ schema: a
555
579
  };
556
- this.$emit("change", k);
580
+ this.$emit("change", u);
557
581
  }
558
- this.getView() && (this.$props.value === void 0 || !i) && this.getView().updateState(this.getView().state.apply(t));
582
+ this.getView() && (this.$props.value === void 0 || !i) && this.getView().updateState(this.getView().state.apply(e));
559
583
  },
560
- onFocus(t, i) {
561
- const r = {
584
+ onFocus(e, i) {
585
+ const s = {
562
586
  target: this,
563
587
  event: i
564
588
  };
565
- return this.$emit("focus", r), !1;
589
+ return this.$emit("focus", s), !1;
566
590
  },
567
- onBlur(t, i) {
568
- const r = {
591
+ onBlur(e, i) {
592
+ const s = {
569
593
  target: this,
570
594
  event: i
571
595
  };
572
- return this.$emit("blur", r), !1;
596
+ return this.$emit("blur", s), !1;
573
597
  },
574
- onPaste(t, i) {
598
+ onPaste(e, i) {
575
599
  return this.$props.pasteHtml && (this.pasteEvent = i), !1;
576
600
  },
577
601
  handleClose() {
@@ -583,6 +607,6 @@ const C = {
583
607
  }
584
608
  });
585
609
  export {
586
- kt as Editor,
610
+ St as Editor,
587
611
  C as allTools
588
612
  };