@toast-ui/editor 3.1.10 → 3.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.
Files changed (57) hide show
  1. package/dist/esm/i18n/ar.js +1 -1
  2. package/dist/esm/i18n/cs-cz.js +1 -1
  3. package/dist/esm/i18n/de-de.js +1 -1
  4. package/dist/esm/i18n/en-us.js +1 -1
  5. package/dist/esm/i18n/es-es.js +1 -1
  6. package/dist/esm/i18n/fi-fi.js +1 -1
  7. package/dist/esm/i18n/fr-fr.js +1 -1
  8. package/dist/esm/i18n/gl-es.js +1 -1
  9. package/dist/esm/i18n/hr-hr.js +1 -1
  10. package/dist/esm/i18n/i18n.js +1 -1
  11. package/dist/esm/i18n/it-it.js +1 -1
  12. package/dist/esm/i18n/ja-jp.js +1 -1
  13. package/dist/esm/i18n/ko-kr.js +1 -1
  14. package/dist/esm/i18n/nb-no.js +1 -1
  15. package/dist/esm/i18n/nl-nl.js +1 -1
  16. package/dist/esm/i18n/pl-pl.js +1 -1
  17. package/dist/esm/i18n/pt-br.js +1 -1
  18. package/dist/esm/i18n/ru-ru.js +1 -1
  19. package/dist/esm/i18n/sv-se.js +1 -1
  20. package/dist/esm/i18n/tr-tr.js +1 -1
  21. package/dist/esm/i18n/uk-ua.js +1 -1
  22. package/dist/esm/i18n/zh-cn.js +1 -1
  23. package/dist/esm/i18n/zh-tw.js +1 -1
  24. package/dist/esm/index.js +70 -31
  25. package/dist/esm/indexViewer.js +39 -7
  26. package/dist/i18n/ar.js +1 -1
  27. package/dist/i18n/cs-cz.js +1 -1
  28. package/dist/i18n/de-de.js +1 -1
  29. package/dist/i18n/es-es.js +1 -1
  30. package/dist/i18n/fi-fi.js +1 -1
  31. package/dist/i18n/fr-fr.js +1 -1
  32. package/dist/i18n/gl-es.js +1 -1
  33. package/dist/i18n/hr-hr.js +1 -1
  34. package/dist/i18n/it-it.js +1 -1
  35. package/dist/i18n/ja-jp.js +1 -1
  36. package/dist/i18n/ko-kr.js +1 -1
  37. package/dist/i18n/nb-no.js +1 -1
  38. package/dist/i18n/nl-nl.js +1 -1
  39. package/dist/i18n/pl-pl.js +1 -1
  40. package/dist/i18n/pt-br.js +1 -1
  41. package/dist/i18n/ru-ru.js +1 -1
  42. package/dist/i18n/sv-se.js +1 -1
  43. package/dist/i18n/tr-tr.js +1 -1
  44. package/dist/i18n/uk-ua.js +1 -1
  45. package/dist/i18n/zh-cn.js +1 -1
  46. package/dist/i18n/zh-tw.js +1 -1
  47. package/dist/toastui-editor-only.css +1 -1
  48. package/dist/toastui-editor-viewer.css +1 -1
  49. package/dist/toastui-editor-viewer.js +54 -12
  50. package/dist/toastui-editor.css +9 -1
  51. package/dist/toastui-editor.js +54 -11
  52. package/package.json +8 -9
  53. package/types/convertor.d.ts +1 -1
  54. package/types/editor.d.ts +19 -0
  55. package/types/index.d.ts +1 -1
  56. package/types/prosemirror-commands.d.ts +15 -0
  57. package/types/prosemirror-model.d.ts +1 -10
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.10
3
+ * @version 3.2.0
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.10 | Wed Jul 27 2022
3
+ * @version 3.2.0 | Fri Aug 05 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.10 | Wed Jul 27 2022
3
+ * @version 3.2.0 | Fri Aug 05 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,19 +1,19 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.10 | Wed Jul 27 2022
3
+ * @version 3.2.0 | Fri Aug 05 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
8
8
  if(typeof exports === 'object' && typeof module === 'object')
9
- module.exports = factory(require("prosemirror-inputrules"), require("prosemirror-model"), require("prosemirror-state"), require("prosemirror-view"));
9
+ module.exports = factory(require("prosemirror-inputrules"), require("prosemirror-keymap"), require("prosemirror-model"), require("prosemirror-state"), require("prosemirror-view"));
10
10
  else if(typeof define === 'function' && define.amd)
11
- define(["prosemirror-inputrules", "prosemirror-model", "prosemirror-state", "prosemirror-view"], factory);
11
+ define(["prosemirror-inputrules", "prosemirror-keymap", "prosemirror-model", "prosemirror-state", "prosemirror-view"], factory);
12
12
  else if(typeof exports === 'object')
13
- exports["toastui"] = factory(require("prosemirror-inputrules"), require("prosemirror-model"), require("prosemirror-state"), require("prosemirror-view"));
13
+ exports["toastui"] = factory(require("prosemirror-inputrules"), require("prosemirror-keymap"), require("prosemirror-model"), require("prosemirror-state"), require("prosemirror-view"));
14
14
  else
15
- root["toastui"] = root["toastui"] || {}, root["toastui"]["Editor"] = factory(root[undefined], root[undefined], root[undefined], root[undefined]);
16
- })(self, function(__WEBPACK_EXTERNAL_MODULE__479__, __WEBPACK_EXTERNAL_MODULE__43__, __WEBPACK_EXTERNAL_MODULE__814__, __WEBPACK_EXTERNAL_MODULE__311__) {
15
+ root["toastui"] = root["toastui"] || {}, root["toastui"]["Editor"] = factory(root[undefined], root[undefined], root[undefined], root[undefined], root[undefined]);
16
+ })(self, function(__WEBPACK_EXTERNAL_MODULE__479__, __WEBPACK_EXTERNAL_MODULE__481__, __WEBPACK_EXTERNAL_MODULE__43__, __WEBPACK_EXTERNAL_MODULE__814__, __WEBPACK_EXTERNAL_MODULE__311__) {
17
17
  return /******/ (function() { // webpackBootstrap
18
18
  /******/ var __webpack_modules__ = ({
19
19
 
@@ -2722,6 +2722,14 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__479__;
2722
2722
 
2723
2723
  /***/ }),
2724
2724
 
2725
+ /***/ 481:
2726
+ /***/ (function(module) {
2727
+
2728
+ "use strict";
2729
+ module.exports = __WEBPACK_EXTERNAL_MODULE__481__;
2730
+
2731
+ /***/ }),
2732
+
2725
2733
  /***/ 43:
2726
2734
  /***/ (function(module) {
2727
2735
 
@@ -12538,6 +12546,14 @@ function replaceBRWithEmptyBlock(html) {
12538
12546
  });
12539
12547
  return replacedHTML;
12540
12548
  }
12549
+ function removeProseMirrorHackNodes(html) {
12550
+ var reProseMirrorImage = /<img class="ProseMirror-separator" alt="">/g;
12551
+ var reProseMirrorTrailingBreak = / class="ProseMirror-trailingBreak"/g;
12552
+ var resultHTML = html;
12553
+ resultHTML = resultHTML.replace(reProseMirrorImage, '');
12554
+ resultHTML = resultHTML.replace(reProseMirrorTrailingBreak, '');
12555
+ return resultHTML;
12556
+ }
12541
12557
 
12542
12558
  // EXTERNAL MODULE: ../../node_modules/tui-code-snippet/type/isFunction.js
12543
12559
  var isFunction = __webpack_require__(294);
@@ -13406,7 +13422,7 @@ var MarkdownPreview = /** @class */ (function () {
13406
13422
  return this.el;
13407
13423
  };
13408
13424
  MarkdownPreview.prototype.getHTML = function () {
13409
- return this.previewContent.innerHTML;
13425
+ return removeProseMirrorHackNodes(this.previewContent.innerHTML);
13410
13426
  };
13411
13427
  MarkdownPreview.prototype.setHTML = function (html) {
13412
13428
  this.previewContent.innerHTML = html;
@@ -13427,6 +13443,8 @@ var external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemir
13427
13443
  var external_commonjs_prosemirror_inputrules_commonjs2_prosemirror_inputrules_amd_prosemirror_inputrules_ = __webpack_require__(479);
13428
13444
  // EXTERNAL MODULE: external {"commonjs":"prosemirror-view","commonjs2":"prosemirror-view","amd":"prosemirror-view"}
13429
13445
  var external_commonjs_prosemirror_view_commonjs2_prosemirror_view_amd_prosemirror_view_ = __webpack_require__(311);
13446
+ // EXTERNAL MODULE: external {"commonjs":"prosemirror-keymap","commonjs2":"prosemirror-keymap","amd":"prosemirror-keymap"}
13447
+ var external_commonjs_prosemirror_keymap_commonjs2_prosemirror_keymap_amd_prosemirror_keymap_ = __webpack_require__(481);
13430
13448
  // EXTERNAL MODULE: external {"commonjs":"prosemirror-model","commonjs2":"prosemirror-model","amd":"prosemirror-model"}
13431
13449
  var external_commonjs_prosemirror_model_commonjs2_prosemirror_model_amd_prosemirror_model_ = __webpack_require__(43);
13432
13450
  // EXTERNAL MODULE: ../../node_modules/tui-code-snippet/array/inArray.js
@@ -13822,22 +13840,41 @@ function mixinTableOffsetMapPrototype(offsetMapMixin, createOffsetMapMixin) {
13822
13840
 
13823
13841
 
13824
13842
 
13825
- function execPlugin(plugin, eventEmitter, usageStatistics) {
13843
+
13844
+ function execPlugin(pluginInfo) {
13845
+ var plugin = pluginInfo.plugin, eventEmitter = pluginInfo.eventEmitter, usageStatistics = pluginInfo.usageStatistics, instance = pluginInfo.instance;
13826
13846
  var pmState = { Plugin: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.Plugin, PluginKey: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.PluginKey, Selection: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.Selection, TextSelection: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.TextSelection };
13827
13847
  var pmView = { Decoration: external_commonjs_prosemirror_view_commonjs2_prosemirror_view_amd_prosemirror_view_.Decoration, DecorationSet: external_commonjs_prosemirror_view_commonjs2_prosemirror_view_amd_prosemirror_view_.DecorationSet };
13828
13848
  var pmModel = { Fragment: external_commonjs_prosemirror_model_commonjs2_prosemirror_model_amd_prosemirror_model_.Fragment };
13829
13849
  var pmRules = { InputRule: external_commonjs_prosemirror_inputrules_commonjs2_prosemirror_inputrules_amd_prosemirror_inputrules_.InputRule, inputRules: external_commonjs_prosemirror_inputrules_commonjs2_prosemirror_inputrules_amd_prosemirror_inputrules_.inputRules, undoInputRule: external_commonjs_prosemirror_inputrules_commonjs2_prosemirror_inputrules_amd_prosemirror_inputrules_.undoInputRule };
13830
- var context = { eventEmitter: eventEmitter, usageStatistics: usageStatistics, pmState: pmState, pmView: pmView, pmModel: pmModel, pmRules: pmRules, i18n: i18n };
13850
+ var pmKeymap = { keymap: external_commonjs_prosemirror_keymap_commonjs2_prosemirror_keymap_amd_prosemirror_keymap_.keymap };
13851
+ var context = {
13852
+ eventEmitter: eventEmitter,
13853
+ usageStatistics: usageStatistics,
13854
+ instance: instance,
13855
+ pmState: pmState,
13856
+ pmView: pmView,
13857
+ pmModel: pmModel,
13858
+ pmRules: pmRules,
13859
+ pmKeymap: pmKeymap,
13860
+ i18n: i18n,
13861
+ };
13831
13862
  if (isArray_default()(plugin)) {
13832
13863
  var pluginFn = plugin[0], _a = plugin[1], options = _a === void 0 ? {} : _a;
13833
13864
  return pluginFn(context, options);
13834
13865
  }
13835
13866
  return plugin(context);
13836
13867
  }
13837
- function getPluginInfo(plugins, eventEmitter, usageStatistics) {
13868
+ function getPluginInfo(pluginsInfo) {
13869
+ var plugins = pluginsInfo.plugins, eventEmitter = pluginsInfo.eventEmitter, usageStatistics = pluginsInfo.usageStatistics, instance = pluginsInfo.instance;
13838
13870
  eventEmitter.listen('mixinTableOffsetMapPrototype', mixinTableOffsetMapPrototype);
13839
13871
  return (plugins !== null && plugins !== void 0 ? plugins : []).reduce(function (acc, plugin) {
13840
- var pluginInfoResult = execPlugin(plugin, eventEmitter, usageStatistics);
13872
+ var pluginInfoResult = execPlugin({
13873
+ plugin: plugin,
13874
+ eventEmitter: eventEmitter,
13875
+ usageStatistics: usageStatistics,
13876
+ instance: instance,
13877
+ });
13841
13878
  if (!pluginInfoResult) {
13842
13879
  throw new Error('The return value of the executed plugin is empty.');
13843
13880
  }
@@ -14166,7 +14203,12 @@ var ToastUIEditorViewer = /** @class */ (function () {
14166
14203
  }, options);
14167
14204
  this.eventEmitter = new eventEmitter();
14168
14205
  var linkAttributes = sanitizeLinkAttribute(this.options.linkAttributes);
14169
- var _a = getPluginInfo(this.options.plugins, this.eventEmitter, this.options.usageStatistics) || {}, toHTMLRenderers = _a.toHTMLRenderers, markdownParsers = _a.markdownParsers;
14206
+ var _a = getPluginInfo({
14207
+ plugins: this.options.plugins,
14208
+ eventEmitter: this.eventEmitter,
14209
+ usageStatistics: this.options.usageStatistics,
14210
+ instance: this,
14211
+ }) || {}, toHTMLRenderers = _a.toHTMLRenderers, markdownParsers = _a.markdownParsers;
14170
14212
  var _b = this.options, customHTMLRenderer = _b.customHTMLRenderer, extendedAutolinks = _b.extendedAutolinks, referenceDefinition = _b.referenceDefinition, frontMatter = _b.frontMatter, customHTMLSanitizer = _b.customHTMLSanitizer;
14171
14213
  var rendererOptions = {
14172
14214
  linkAttributes: linkAttributes,
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.10 | Wed Jul 27 2022
3
+ * @version 3.2.0 | Fri Aug 05 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -48,6 +48,14 @@ li.ProseMirror-selectednode:after {
48
48
  pointer-events: none;
49
49
  }
50
50
 
51
+ /* Protect against generic img rules */
52
+
53
+ img.ProseMirror-separator {
54
+ display: inline !important;
55
+ border: none !important;
56
+ margin: 0 !important;
57
+ }
58
+
51
59
  @charset "utf-8";
52
60
  /* height */
53
61
  .auto-height,
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.10 | Wed Jul 27 2022
3
+ * @version 3.2.0 | Fri Aug 05 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -4236,6 +4236,14 @@ function replaceBRWithEmptyBlock(html) {
4236
4236
  });
4237
4237
  return replacedHTML;
4238
4238
  }
4239
+ function removeProseMirrorHackNodes(html) {
4240
+ var reProseMirrorImage = /<img class="ProseMirror-separator" alt="">/g;
4241
+ var reProseMirrorTrailingBreak = / class="ProseMirror-trailingBreak"/g;
4242
+ var resultHTML = html;
4243
+ resultHTML = resultHTML.replace(reProseMirrorImage, '');
4244
+ resultHTML = resultHTML.replace(reProseMirrorTrailingBreak, '');
4245
+ return resultHTML;
4246
+ }
4239
4247
 
4240
4248
  ;// CONCATENATED MODULE: ./src/plugins/popupWidget.ts
4241
4249
 
@@ -16945,7 +16953,7 @@ var MarkdownPreview = /** @class */ (function () {
16945
16953
  return this.el;
16946
16954
  };
16947
16955
  MarkdownPreview.prototype.getHTML = function () {
16948
- return this.previewContent.innerHTML;
16956
+ return removeProseMirrorHackNodes(this.previewContent.innerHTML);
16949
16957
  };
16950
16958
  MarkdownPreview.prototype.setHTML = function (html) {
16951
16959
  this.previewContent.innerHTML = html;
@@ -17648,10 +17656,14 @@ var CellSelection = /** @class */ (function (_super) {
17648
17656
  }
17649
17657
  var copiedRow = row.copy(external_commonjs_prosemirror_model_commonjs2_prosemirror_model_amd_prosemirror_model_.Fragment.from(cells));
17650
17658
  var targetNode = isTableHeadCell ? tableHead : tableBody;
17659
+ // @ts-ignore
17651
17660
  targetNode.content = targetNode.content.append(external_commonjs_prosemirror_model_commonjs2_prosemirror_model_amd_prosemirror_model_.Fragment.from(copiedRow));
17652
17661
  }
17653
17662
  return new external_commonjs_prosemirror_model_commonjs2_prosemirror_model_amd_prosemirror_model_.Slice(createTableFragment(tableHead, tableBody), 1, 1);
17654
17663
  };
17664
+ CellSelection.prototype.toJSON = function () {
17665
+ return JSON.stringify(this);
17666
+ };
17655
17667
  return CellSelection;
17656
17668
  }(external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.Selection));
17657
17669
  /* harmony default export */ var selection_cellSelection = (CellSelection);
@@ -18492,7 +18504,6 @@ var CODE_BLOCK_LANG_CLASS_NAME = 'toastui-editor-ww-code-block-language';
18492
18504
  var CodeBlockView = /** @class */ (function () {
18493
18505
  function CodeBlockView(node, view, getPos, eventEmitter) {
18494
18506
  var _this = this;
18495
- this.dom = null;
18496
18507
  this.contentDOM = null;
18497
18508
  this.input = null;
18498
18509
  this.timer = null;
@@ -21230,7 +21241,7 @@ var WysiwygEditor = /** @class */ (function (_super) {
21230
21241
  return this.specs.commands(this.view, getWwCommands());
21231
21242
  };
21232
21243
  WysiwygEditor.prototype.getHTML = function () {
21233
- return this.view.dom.innerHTML;
21244
+ return removeProseMirrorHackNodes(this.view.dom.innerHTML);
21234
21245
  };
21235
21246
  WysiwygEditor.prototype.getModel = function () {
21236
21247
  return this.view.state.doc;
@@ -23256,22 +23267,41 @@ var Convertor = /** @class */ (function () {
23256
23267
 
23257
23268
 
23258
23269
 
23259
- function execPlugin(plugin, eventEmitter, usageStatistics) {
23270
+
23271
+ function execPlugin(pluginInfo) {
23272
+ var plugin = pluginInfo.plugin, eventEmitter = pluginInfo.eventEmitter, usageStatistics = pluginInfo.usageStatistics, instance = pluginInfo.instance;
23260
23273
  var pmState = { Plugin: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.Plugin, PluginKey: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.PluginKey, Selection: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.Selection, TextSelection: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.TextSelection };
23261
23274
  var pmView = { Decoration: external_commonjs_prosemirror_view_commonjs2_prosemirror_view_amd_prosemirror_view_.Decoration, DecorationSet: external_commonjs_prosemirror_view_commonjs2_prosemirror_view_amd_prosemirror_view_.DecorationSet };
23262
23275
  var pmModel = { Fragment: external_commonjs_prosemirror_model_commonjs2_prosemirror_model_amd_prosemirror_model_.Fragment };
23263
23276
  var pmRules = { InputRule: external_commonjs_prosemirror_inputrules_commonjs2_prosemirror_inputrules_amd_prosemirror_inputrules_.InputRule, inputRules: external_commonjs_prosemirror_inputrules_commonjs2_prosemirror_inputrules_amd_prosemirror_inputrules_.inputRules, undoInputRule: external_commonjs_prosemirror_inputrules_commonjs2_prosemirror_inputrules_amd_prosemirror_inputrules_.undoInputRule };
23264
- var context = { eventEmitter: eventEmitter, usageStatistics: usageStatistics, pmState: pmState, pmView: pmView, pmModel: pmModel, pmRules: pmRules, i18n: i18n };
23277
+ var pmKeymap = { keymap: external_commonjs_prosemirror_keymap_commonjs2_prosemirror_keymap_amd_prosemirror_keymap_.keymap };
23278
+ var context = {
23279
+ eventEmitter: eventEmitter,
23280
+ usageStatistics: usageStatistics,
23281
+ instance: instance,
23282
+ pmState: pmState,
23283
+ pmView: pmView,
23284
+ pmModel: pmModel,
23285
+ pmRules: pmRules,
23286
+ pmKeymap: pmKeymap,
23287
+ i18n: i18n,
23288
+ };
23265
23289
  if (isArray_default()(plugin)) {
23266
23290
  var pluginFn = plugin[0], _a = plugin[1], options = _a === void 0 ? {} : _a;
23267
23291
  return pluginFn(context, options);
23268
23292
  }
23269
23293
  return plugin(context);
23270
23294
  }
23271
- function getPluginInfo(plugins, eventEmitter, usageStatistics) {
23295
+ function getPluginInfo(pluginsInfo) {
23296
+ var plugins = pluginsInfo.plugins, eventEmitter = pluginsInfo.eventEmitter, usageStatistics = pluginsInfo.usageStatistics, instance = pluginsInfo.instance;
23272
23297
  eventEmitter.listen('mixinTableOffsetMapPrototype', mixinTableOffsetMapPrototype);
23273
23298
  return (plugins !== null && plugins !== void 0 ? plugins : []).reduce(function (acc, plugin) {
23274
- var pluginInfoResult = execPlugin(plugin, eventEmitter, usageStatistics);
23299
+ var pluginInfoResult = execPlugin({
23300
+ plugin: plugin,
23301
+ eventEmitter: eventEmitter,
23302
+ usageStatistics: usageStatistics,
23303
+ instance: instance,
23304
+ });
23275
23305
  if (!pluginInfoResult) {
23276
23306
  throw new Error('The return value of the executed plugin is empty.');
23277
23307
  }
@@ -23376,7 +23406,12 @@ var ToastUIEditorViewer = /** @class */ (function () {
23376
23406
  }, options);
23377
23407
  this.eventEmitter = new eventEmitter();
23378
23408
  var linkAttributes = sanitizeLinkAttribute(this.options.linkAttributes);
23379
- var _a = getPluginInfo(this.options.plugins, this.eventEmitter, this.options.usageStatistics) || {}, toHTMLRenderers = _a.toHTMLRenderers, markdownParsers = _a.markdownParsers;
23409
+ var _a = getPluginInfo({
23410
+ plugins: this.options.plugins,
23411
+ eventEmitter: this.eventEmitter,
23412
+ usageStatistics: this.options.usageStatistics,
23413
+ instance: this,
23414
+ }) || {}, toHTMLRenderers = _a.toHTMLRenderers, markdownParsers = _a.markdownParsers;
23380
23415
  var _b = this.options, customHTMLRenderer = _b.customHTMLRenderer, extendedAutolinks = _b.extendedAutolinks, referenceDefinition = _b.referenceDefinition, frontMatter = _b.frontMatter, customHTMLSanitizer = _b.customHTMLSanitizer;
23381
23416
  var rendererOptions = {
23382
23417
  linkAttributes: linkAttributes,
@@ -23982,7 +24017,12 @@ var ToastUIEditorCore = /** @class */ (function () {
23982
24017
  this.eventEmitter = new eventEmitter();
23983
24018
  setWidgetRules(widgetRules);
23984
24019
  var linkAttributes = sanitizeLinkAttribute(this.options.linkAttributes);
23985
- this.pluginInfo = getPluginInfo(this.options.plugins, this.eventEmitter, this.options.usageStatistics);
24020
+ this.pluginInfo = getPluginInfo({
24021
+ plugins: this.options.plugins,
24022
+ eventEmitter: this.eventEmitter,
24023
+ usageStatistics: this.options.usageStatistics,
24024
+ instance: this,
24025
+ });
23986
24026
  var _b = this.pluginInfo, toHTMLRenderers = _b.toHTMLRenderers, toMarkdownRenderers = _b.toMarkdownRenderers, mdPlugins = _b.mdPlugins, wwPlugins = _b.wwPlugins, wwNodeViews = _b.wwNodeViews, mdCommands = _b.mdCommands, wwCommands = _b.wwCommands, markdownParsers = _b.markdownParsers;
23987
24027
  var rendererOptions = {
23988
24028
  linkAttributes: linkAttributes,
@@ -24236,7 +24276,7 @@ var ToastUIEditorCore = /** @class */ (function () {
24236
24276
  _this.wwEditor.setModel(wwNode);
24237
24277
  }
24238
24278
  });
24239
- var html = this.wwEditor.view.dom.innerHTML;
24279
+ var html = removeProseMirrorHackNodes(this.wwEditor.view.dom.innerHTML);
24240
24280
  if (this.placeholder) {
24241
24281
  var rePlaceholder = new RegExp("<span class=\"placeholder[^>]+>" + this.placeholder + "</span>", 'i');
24242
24282
  return html.replace(rePlaceholder, '');
@@ -27382,6 +27422,9 @@ var ToastUIEditor = /** @class */ (function (_super) {
27382
27422
  /* harmony default export */ var editor = (ToastUIEditor);
27383
27423
  var editor_templateObject_1;
27384
27424
 
27425
+ ;// CONCATENATED MODULE: ../../node_modules/prosemirror-view/style/prosemirror.css
27426
+ // extracted by mini-css-extract-plugin
27427
+
27385
27428
  ;// CONCATENATED MODULE: ./src/i18n/en-us.ts
27386
27429
  /**
27387
27430
  * @fileoverview I18N for English
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toast-ui/editor",
3
- "version": "3.1.10",
3
+ "version": "3.2.0",
4
4
  "description": "GFM Markdown Wysiwyg Editor - Productive and Extensible",
5
5
  "keywords": [
6
6
  "nhn",
@@ -83,13 +83,12 @@
83
83
  },
84
84
  "dependencies": {
85
85
  "dompurify": "^2.3.3",
86
- "prosemirror-commands": "~1.1.9",
87
- "prosemirror-history": "~1.1.3",
88
- "prosemirror-inputrules": "~1.1.3",
89
- "prosemirror-keymap": "~1.1.4",
90
- "prosemirror-model": "~1.14.1",
91
- "prosemirror-state": "~1.3.4",
92
- "prosemirror-view": "~1.18.7",
93
- "prosemirror-transform": "~1.3.0"
86
+ "prosemirror-commands": "^1.1.9",
87
+ "prosemirror-history": "^1.1.3",
88
+ "prosemirror-inputrules": "^1.1.3",
89
+ "prosemirror-keymap": "^1.1.4",
90
+ "prosemirror-model": "^1.14.1",
91
+ "prosemirror-state": "^1.3.4",
92
+ "prosemirror-view": "^1.18.7"
94
93
  }
95
94
  }
@@ -1,4 +1,4 @@
1
- import { NodeType, MarkType, Schema, Node as ProsemirrorNode, Mark } from 'prosemirror-model';
1
+ import { NodeType, MarkType, Schema, ProsemirrorNode, Mark } from 'prosemirror-model';
2
2
  import { MdNode, MdNodeType, RendererOptions, HTMLToken, MdPos } from './toastmark';
3
3
  import { WwNodeType, WwMarkType } from './wysiwyg';
4
4
 
package/types/editor.d.ts CHANGED
@@ -2,6 +2,8 @@ import { Schema, NodeSpec, MarkSpec, Fragment } from 'prosemirror-model';
2
2
  import { EditorView, Decoration, DecorationSet } from 'prosemirror-view';
3
3
  import { EditorState, Plugin, PluginKey, Selection, TextSelection } from 'prosemirror-state';
4
4
  import { undoInputRule, InputRule, inputRules } from 'prosemirror-inputrules';
5
+ import { keymap } from 'prosemirror-keymap';
6
+ import { Editor } from '@t/index';
5
7
 
6
8
  import {
7
9
  HTMLConvertor,
@@ -122,6 +124,7 @@ export interface PluginContext {
122
124
  eventEmitter: Emitter;
123
125
  usageStatistics?: boolean;
124
126
  i18n: I18n;
127
+ instance: Editor | Viewer;
125
128
  pmState: {
126
129
  Plugin: typeof Plugin;
127
130
  PluginKey: typeof PluginKey;
@@ -135,10 +138,26 @@ export interface PluginContext {
135
138
  InputRule: typeof InputRule;
136
139
  undoInputRule: typeof undoInputRule;
137
140
  };
141
+ pmKeymap: {
142
+ keymap: typeof keymap;
143
+ };
138
144
  }
139
145
 
140
146
  export type PluginFn = (context: PluginContext, options?: any) => PluginInfo | null;
141
147
  export type EditorPlugin = PluginFn | [PluginFn, any];
148
+ type ContextInfo = {
149
+ eventEmitter: Emitter;
150
+ usageStatistics: boolean;
151
+ instance: Editor | Viewer;
152
+ };
153
+
154
+ export type EditorPluginInfo = ContextInfo & {
155
+ plugin: EditorPlugin;
156
+ };
157
+
158
+ export type EditorPluginsInfo = ContextInfo & {
159
+ plugins: EditorPlugin[];
160
+ };
142
161
 
143
162
  export interface EditorOptions {
144
163
  el: HTMLElement;
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for TOAST UI Editor v3.1.10
1
+ // Type definitions for TOAST UI Editor v3.2.0
2
2
  // TypeScript Version: 4.2.3
3
3
  import {
4
4
  EditorCore,
@@ -0,0 +1,15 @@
1
+ import { EditorState, Transaction } from 'prosemirror-state';
2
+ import { EditorView } from 'prosemirror-view';
3
+ import { Schema } from 'prosemirror-model';
4
+
5
+ import 'prosemirror-commands';
6
+
7
+ declare module 'prosemirror-commands' {
8
+ export interface Command<S extends Schema = any> {
9
+ (state: EditorState<S>, dispatch?: (tr: Transaction<S>) => void, view?: EditorView<S>): boolean;
10
+ }
11
+
12
+ export interface Keymap<S extends Schema = any> {
13
+ [key: string]: Command<S>;
14
+ }
15
+ }
@@ -7,16 +7,7 @@ declare module 'prosemirror-model' {
7
7
  findDiffEnd(other: ProsemirrorNode | Fragment): { a: number; b: number } | null | undefined;
8
8
  }
9
9
 
10
- export interface ProsemirrorNode extends Model.Node {
11
- descendants(
12
- fn: (
13
- node: Model.Node,
14
- pos: number,
15
- parent: Model.Node,
16
- index?: number
17
- ) => boolean | void | null | undefined
18
- ): void;
19
- }
10
+ export type ProsemirrorNode = Model.Node;
20
11
 
21
12
  export interface NodeType {
22
13
  compatibleContent(node: NodeType): boolean;