@progress/kendo-vue-editor 2.8.0-dev.202201121019 → 3.0.0-dev.202201170830

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 (60) hide show
  1. package/dist/cdn/js/kendo-vue-editor.js +1 -1
  2. package/dist/es/Editor.js +37 -27
  3. package/dist/es/config/toolsSettings.d.ts +4 -0
  4. package/dist/es/dialogs/FindReplace.d.ts +1 -1
  5. package/dist/es/dialogs/FindReplace.js +148 -111
  6. package/dist/es/dialogs/insertImage.js +10 -4
  7. package/dist/es/dialogs/insertLink.js +10 -4
  8. package/dist/es/dialogs/viewHtml.js +0 -4
  9. package/dist/es/main.d.ts +19 -0
  10. package/dist/es/main.js +19 -0
  11. package/dist/es/package-metadata.js +1 -1
  12. package/dist/es/tools/align.js +2 -2
  13. package/dist/es/tools/applyColor.js +6 -2
  14. package/dist/es/tools/cleanFormatting.js +2 -2
  15. package/dist/es/tools/findReplace.js +4 -4
  16. package/dist/es/tools/fontStyle.js +7 -8
  17. package/dist/es/tools/formatBlock.js +9 -7
  18. package/dist/es/tools/indent.js +2 -2
  19. package/dist/es/tools/inlineFormat.js +2 -2
  20. package/dist/es/tools/insertImage.js +2 -2
  21. package/dist/es/tools/insertLink.js +2 -2
  22. package/dist/es/tools/insertTable/tool.js +2 -2
  23. package/dist/es/tools/lists.js +2 -2
  24. package/dist/es/tools/outdent.js +2 -2
  25. package/dist/es/tools/pdf.js +2 -2
  26. package/dist/es/tools/print.js +2 -2
  27. package/dist/es/tools/proseMirrorTool.js +2 -2
  28. package/dist/es/tools/selectAll.js +2 -2
  29. package/dist/es/tools/unlink.js +2 -2
  30. package/dist/es/tools/viewHtml.js +2 -2
  31. package/dist/npm/Editor.js +36 -26
  32. package/dist/npm/config/toolsSettings.d.ts +4 -0
  33. package/dist/npm/dialogs/FindReplace.d.ts +1 -1
  34. package/dist/npm/dialogs/FindReplace.js +148 -111
  35. package/dist/npm/dialogs/insertImage.js +10 -4
  36. package/dist/npm/dialogs/insertLink.js +10 -4
  37. package/dist/npm/dialogs/viewHtml.js +0 -4
  38. package/dist/npm/main.d.ts +19 -0
  39. package/dist/npm/main.js +38 -0
  40. package/dist/npm/package-metadata.js +1 -1
  41. package/dist/npm/tools/align.js +2 -2
  42. package/dist/npm/tools/applyColor.js +6 -2
  43. package/dist/npm/tools/cleanFormatting.js +2 -2
  44. package/dist/npm/tools/findReplace.js +4 -4
  45. package/dist/npm/tools/fontStyle.js +7 -8
  46. package/dist/npm/tools/formatBlock.js +9 -7
  47. package/dist/npm/tools/indent.js +2 -2
  48. package/dist/npm/tools/inlineFormat.js +2 -2
  49. package/dist/npm/tools/insertImage.js +2 -2
  50. package/dist/npm/tools/insertLink.js +2 -2
  51. package/dist/npm/tools/insertTable/tool.js +2 -2
  52. package/dist/npm/tools/lists.js +2 -2
  53. package/dist/npm/tools/outdent.js +2 -2
  54. package/dist/npm/tools/pdf.js +2 -2
  55. package/dist/npm/tools/print.js +2 -2
  56. package/dist/npm/tools/proseMirrorTool.js +2 -2
  57. package/dist/npm/tools/selectAll.js +2 -2
  58. package/dist/npm/tools/unlink.js +2 -2
  59. package/dist/npm/tools/viewHtml.js +2 -2
  60. package/package.json +12 -12
package/dist/es/Editor.js CHANGED
@@ -33,7 +33,7 @@ import * as Vue from 'vue';
33
33
  var allVue = Vue;
34
34
  var gh = allVue.h;
35
35
  var markRaw = allVue.markRaw;
36
- import { ButtonGroup, Toolbar } from '@progress/kendo-vue-buttons';
36
+ import { ButtonGroup, Toolbar, ToolbarSeparator } from '@progress/kendo-vue-buttons';
37
37
  import { classNames, validatePackage, getTemplate, getListeners, templateRendering, guid } from '@progress/kendo-vue-common';
38
38
  import { EditorState, Plugin, PluginKey, EditorView, Schema, baseKeymap, keymap, history, dropCursor, gapCursor, getMark, spacesFix, tableEditing } from '@progress/kendo-editor-common';
39
39
  import { marks, nodes } from './config/schema';
@@ -267,12 +267,13 @@ var EditorVue2 = {
267
267
  },
268
268
  data: function data() {
269
269
  return {
270
+ updateGuid: guid(),
270
271
  view: undefined,
271
272
  linkDialog: false
272
273
  };
273
274
  },
274
275
  created: function created() {
275
- this._view = undefined;
276
+ this.view = undefined;
276
277
  validatePackage(packageMetadata);
277
278
  },
278
279
  mounted: function mounted() {
@@ -290,7 +291,7 @@ var EditorVue2 = {
290
291
  },
291
292
  updated: function updated() {
292
293
  var value = this.$props.value;
293
- var view = this._view;
294
+ var view = this.view;
294
295
 
295
296
  if (value === undefined || !view) {
296
297
  return;
@@ -309,8 +310,8 @@ var EditorVue2 = {
309
310
  },
310
311
  // @ts-ignore
311
312
  unmounted: function unmounted() {
312
- if (this._view) {
313
- this._view.destroy();
313
+ if (this.view) {
314
+ this.view.destroy();
314
315
  }
315
316
 
316
317
  this.view = undefined;
@@ -321,8 +322,8 @@ var EditorVue2 = {
321
322
  return this.trOnChange.doc;
322
323
  } else if (this.$props.value !== undefined) {
323
324
  return this.$props.value;
324
- } else if (this._view) {
325
- return this._view.state.doc;
325
+ } else if (this.view) {
326
+ return this.view.state.doc;
326
327
  }
327
328
 
328
329
  return this.$props.defaultContent || '';
@@ -340,6 +341,7 @@ var EditorVue2 = {
340
341
  var _this = this;
341
342
 
342
343
  var h = gh || createElement;
344
+ var toolindex = 100;
343
345
  var _a = this.$props,
344
346
  _b = _a.tools,
345
347
  tools = _b === void 0 ? [] : _b,
@@ -350,8 +352,8 @@ var EditorVue2 = {
350
352
  style = _a.style;
351
353
  var view = this.getView();
352
354
 
353
- if (view) {
354
- var editorProps = editorPropsKey.getState(view.state);
355
+ if (this.view) {
356
+ var editorProps = editorPropsKey.getState(this.view.state);
355
357
  editorProps.preserveWhitespace = preserveWhitespace;
356
358
  }
357
359
 
@@ -381,22 +383,31 @@ var EditorVue2 = {
381
383
  });
382
384
  };
383
385
 
384
- var renderTool = function renderTool(currentTool, index) {
386
+ var renderTool = function renderTool(currentTool, _index) {
385
387
  var ct = allTools[currentTool] || currentTool;
386
388
 
387
389
  if (allTools[currentTool]) {
390
+ toolindex++;
391
+
388
392
  var toolProps = __assign({
389
393
  view: view,
390
394
  dir: this.$props.dir,
391
- key: guid(),
395
+ key: toolindex,
396
+ updateGuid: this.updateGuid,
392
397
  settings: allTools[currentTool].props
393
398
  }, allTools[currentTool].props);
394
399
 
395
400
  return h(this.v3 ? markRaw(allTools[currentTool].comp) : allTools[currentTool].comp, this.v3 ? toolProps : {
396
401
  props: toolProps
397
402
  });
403
+ } else if (ct === 'Separator') {
404
+ return (// @ts-ignore
405
+ h(ToolbarSeparator, {
406
+ key: toolindex
407
+ })
408
+ );
398
409
  } else {
399
- var tool = templateRendering.call(this, ct, getListeners.call(this));
410
+ var tool = templateRendering.call(this, ct.render, getListeners.call(this));
400
411
  return getTemplate.call(this, {
401
412
  h: h,
402
413
  template: tool,
@@ -405,11 +416,12 @@ var EditorVue2 = {
405
416
  additionalProps: {
406
417
  view: view,
407
418
  dir: this.$props.dir,
408
- key: index
419
+ updateGuid: this.updateGuid,
420
+ key: toolindex,
421
+ settings: ct.props
409
422
  }
410
423
  });
411
- } // return tool.type === ToolbarSeparator ? <Tool key={index} /> : tool;
412
-
424
+ }
413
425
  };
414
426
 
415
427
  var renderTools = function renderTools(item, index) {
@@ -471,7 +483,7 @@ var EditorVue2 = {
471
483
  },
472
484
  methods: {
473
485
  getView: function getView() {
474
- return this.v3 ? this._view : this.view;
486
+ return this.view;
475
487
  },
476
488
  getHTML: function getHTML() {
477
489
  var view = this.getView();
@@ -490,16 +502,15 @@ var EditorVue2 = {
490
502
  }
491
503
  },
492
504
  focus: function focus() {
493
- if (this._view) {
494
- this._view.focus();
505
+ if (this.view) {
506
+ this.view.focus();
495
507
  }
496
508
  },
497
509
  updateTools: function updateTools(view) {
498
510
  this.view = view;
499
511
 
500
512
  if (this.v3) {
501
- this._view = view;
502
- this.$forceUpdate();
513
+ this.updateGuid = guid();
503
514
  }
504
515
  },
505
516
  iframeLoad: function iframeLoad() {
@@ -578,7 +589,7 @@ var EditorVue2 = {
578
589
  })), {
579
590
  'Mod-k': function ModK() {
580
591
  var linkDialog = _this.$data.linkDialog;
581
- var editorView = _this._view;
592
+ var editorView = _this.view;
582
593
 
583
594
  if (editorView) {
584
595
  var editorState = editorView.state;
@@ -598,8 +609,7 @@ var EditorVue2 = {
598
609
  var _b = this.$props,
599
610
  _c = _b.defaultContent,
600
611
  defaultContent = _c === void 0 ? '' : _c,
601
- value = _b.value,
602
- onMount = _b.onMount;
612
+ value = _b.value;
603
613
  var doc = value && typeof value !== 'string' ? value : EditorUtils.createDocument(new Schema({
604
614
  nodes: nodes,
605
615
  marks: marks
@@ -627,10 +637,10 @@ var EditorVue2 = {
627
637
  dom: dom
628
638
  };
629
639
  this.$emit('loaded', mountEvent);
630
- var view = this._view = this.$props.extendView && this.$props.extendView(mountEvent) || new EditorView({
640
+ var view = this.$props.extendView && this.$props.extendView(mountEvent) || new EditorView({
631
641
  mount: dom
632
642
  }, viewProps);
633
- this.view = view;
643
+ this.view = this.v3 ? markRaw(view) : view;
634
644
  },
635
645
  filterTransaction: function filterTransaction(transaction, state) {
636
646
  var event = {
@@ -684,8 +694,8 @@ var EditorVue2 = {
684
694
  this.$emit('change', event_2);
685
695
  }
686
696
 
687
- if (this._view && (this.$props.value === undefined || !docChanged)) {
688
- this._view.updateState(this._view.state.apply(transaction));
697
+ if (this.view && (this.$props.value === undefined || !docChanged)) {
698
+ this.view.updateState(this.view.state.apply(transaction));
689
699
  }
690
700
  },
691
701
  onFocus: function onFocus(_view, nativeEvent) {
@@ -154,6 +154,10 @@ export declare namespace EditorToolsSettings {
154
154
  * The name of the applied command.
155
155
  */
156
156
  commandName: string;
157
+ /**
158
+ * The dir of the applied command.
159
+ */
160
+ dir?: String;
157
161
  }
158
162
  /**
159
163
  * The setting of the IndentAction tool.
@@ -7,7 +7,7 @@ import { EditorToolsSettings } from './../config/toolsSettings';
7
7
  import { TextSelection, EditorView } from '@progress/kendo-editor-common';
8
8
  interface FindAndReplaceDialogData {
9
9
  selectedTab: number;
10
- matches?: TextSelection<any>[];
10
+ matches: TextSelection<any>[];
11
11
  nextMatch?: TextSelection<any>;
12
12
  searchText: string;
13
13
  replaceText: string;