@toast-ui/editor 3.1.3 → 3.1.6

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 (54) hide show
  1. package/dist/esm/i18n/ar.js +2 -2
  2. package/dist/esm/i18n/cs-cz.js +2 -2
  3. package/dist/esm/i18n/de-de.js +4 -4
  4. package/dist/esm/i18n/en-us.js +3 -3
  5. package/dist/esm/i18n/es-es.js +2 -2
  6. package/dist/esm/i18n/fi-fi.js +2 -2
  7. package/dist/esm/i18n/fr-fr.js +2 -2
  8. package/dist/esm/i18n/gl-es.js +2 -2
  9. package/dist/esm/i18n/hr-hr.js +2 -2
  10. package/dist/esm/i18n/i18n.js +3 -3
  11. package/dist/esm/i18n/it-it.js +2 -2
  12. package/dist/esm/i18n/ja-jp.js +3 -3
  13. package/dist/esm/i18n/ko-kr.js +3 -3
  14. package/dist/esm/i18n/nb-no.js +2 -2
  15. package/dist/esm/i18n/nl-nl.js +3 -3
  16. package/dist/esm/i18n/pl-pl.js +2 -2
  17. package/dist/esm/i18n/pt-br.js +2 -2
  18. package/dist/esm/i18n/ru-ru.js +2 -2
  19. package/dist/esm/i18n/sv-se.js +2 -2
  20. package/dist/esm/i18n/tr-tr.js +2 -2
  21. package/dist/esm/i18n/uk-ua.js +2 -2
  22. package/dist/esm/i18n/zh-cn.js +3 -3
  23. package/dist/esm/i18n/zh-tw.js +2 -2
  24. package/dist/esm/index.js +28 -14
  25. package/dist/esm/indexViewer.js +16 -7
  26. package/dist/i18n/ar.js +2 -2
  27. package/dist/i18n/cs-cz.js +2 -2
  28. package/dist/i18n/de-de.js +4 -4
  29. package/dist/i18n/es-es.js +2 -2
  30. package/dist/i18n/fi-fi.js +2 -2
  31. package/dist/i18n/fr-fr.js +2 -2
  32. package/dist/i18n/gl-es.js +2 -2
  33. package/dist/i18n/hr-hr.js +2 -2
  34. package/dist/i18n/it-it.js +2 -2
  35. package/dist/i18n/ja-jp.js +3 -3
  36. package/dist/i18n/ko-kr.js +3 -3
  37. package/dist/i18n/nb-no.js +2 -2
  38. package/dist/i18n/nl-nl.js +3 -3
  39. package/dist/i18n/pl-pl.js +2 -2
  40. package/dist/i18n/pt-br.js +2 -2
  41. package/dist/i18n/ru-ru.js +2 -2
  42. package/dist/i18n/sv-se.js +2 -2
  43. package/dist/i18n/tr-tr.js +2 -2
  44. package/dist/i18n/uk-ua.js +2 -2
  45. package/dist/i18n/zh-cn.js +3 -3
  46. package/dist/i18n/zh-tw.js +2 -2
  47. package/dist/toastui-editor-only.css +2 -2
  48. package/dist/toastui-editor-viewer.css +2 -2
  49. package/dist/toastui-editor-viewer.js +31 -12
  50. package/dist/toastui-editor.css +2 -2
  51. package/dist/toastui-editor.js +28 -13
  52. package/package.json +3 -2
  53. package/types/editor.d.ts +9 -1
  54. package/types/index.d.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -36,8 +36,8 @@ Editor.setLanguage(['de', 'de-DE'], {
36
36
  Heading: 'Titel',
37
37
  'Image URL': 'Bild URL',
38
38
  'Select image file': 'Grafik auswählen',
39
- 'Choose a file': 'Wähle eine datei',
40
- 'No file': 'Keine datei',
39
+ 'Choose a file': 'Wähle eine Datei',
40
+ 'No file': 'Keine Datei',
41
41
  Description: 'Beschreibung',
42
42
  OK: 'OK',
43
43
  More: 'Mehr',
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -9,7 +9,7 @@ import Editor from '@toast-ui/editor';
9
9
 
10
10
  /**
11
11
  * @fileoverview I18N for English
12
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
12
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
13
13
  */
14
14
  Editor.setLanguage(['en', 'en-US'], {
15
15
  Markdown: 'Markdown',
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -168,7 +168,7 @@ var Map = /** @class */ (function () {
168
168
 
169
169
  /**
170
170
  * @fileoverview Implements i18n
171
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
171
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
172
172
  */
173
173
  var DEFAULT_CODE = 'en-US';
174
174
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -9,7 +9,7 @@ import Editor from '@toast-ui/editor';
9
9
 
10
10
  /**
11
11
  * @fileoverview I18N for Japanese
12
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
12
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
13
13
  */
14
14
  Editor.setLanguage(['ja', 'ja-JP'], {
15
15
  Markdown: 'マークダウン',
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -9,7 +9,7 @@ import Editor from '@toast-ui/editor';
9
9
 
10
10
  /**
11
11
  * @fileoverview I18N for Korean
12
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
12
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
13
13
  */
14
14
  Editor.setLanguage(['ko', 'ko-KR'], {
15
15
  Markdown: '마크다운',
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -9,7 +9,7 @@ import Editor from '@toast-ui/editor';
9
9
 
10
10
  /**
11
11
  * @fileoverview I18N for Dutch
12
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
12
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
13
13
  */
14
14
  Editor.setLanguage(['nl', 'nl-NL'], {
15
15
  Markdown: 'Markdown',
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -9,7 +9,7 @@ import Editor from '@toast-ui/editor';
9
9
 
10
10
  /**
11
11
  * @fileoverview I18N for Chinese
12
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
12
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
13
13
  */
14
14
  Editor.setLanguage('zh-CN', {
15
15
  Markdown: 'Markdown',
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @toast-ui/editor
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
@@ -11,7 +11,7 @@ import { ReplaceAroundStep, liftTarget, canSplit, StepMap } from 'prosemirror-tr
11
11
  import { TextSelection, Plugin, PluginKey, EditorState, AllSelection, Selection, SelectionRange, NodeSelection } from 'prosemirror-state';
12
12
  import { keymap } from 'prosemirror-keymap';
13
13
  import { deleteSelection, selectAll, baseKeymap, chainCommands, joinForward, newlineInCode, setBlockType, wrapIn, toggleMark as toggleMark$1, exitCode } from 'prosemirror-commands';
14
- import { InputRule, inputRules } from 'prosemirror-inputrules';
14
+ import { InputRule, inputRules, undoInputRule } from 'prosemirror-inputrules';
15
15
  import { undo, redo, history, undoDepth } from 'prosemirror-history';
16
16
 
17
17
  /*! *****************************************************************************
@@ -700,7 +700,7 @@ var sendHostname_1 = sendHostname;
700
700
  /Mac/.test(navigator.platform);
701
701
  var reSpaceMoreThanOne = /[\u0020]+/g;
702
702
  var reEscapeChars$1 = /[>(){}[\]+-.!#|]/g;
703
- var reEscapeHTML = /<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\/>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g;
703
+ var reEscapeHTML = /<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g;
704
704
  var reEscapeBackSlash = /\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g;
705
705
  var reEscapePairedChars = /[*_~`]/g;
706
706
  var reMdImageSyntax = /!\[.*\]\(.*\)/g;
@@ -1161,7 +1161,10 @@ function createWidgetContent(info, text) {
1161
1161
  }
1162
1162
  function widgetToDOM(info, text) {
1163
1163
  var _a = widgetRuleMap[info], rule = _a.rule, toDOM = _a.toDOM;
1164
- text = unwrapWidgetSyntax(text).match(rule)[0];
1164
+ var matches = unwrapWidgetSyntax(text).match(rule);
1165
+ if (matches) {
1166
+ text = matches[0];
1167
+ }
1165
1168
  return toDOM(text);
1166
1169
  }
1167
1170
  function getWidgetRules() {
@@ -4262,11 +4265,11 @@ var MdEditor = /** @class */ (function (_super) {
4262
4265
  ]);
4263
4266
  };
4264
4267
  MdEditor.prototype.createPlugins = function () {
4265
- return this.defaultPlugins.concat(__spreadArray$1([
4268
+ return __spreadArray$1([
4266
4269
  syntaxHighlight(this.context),
4267
4270
  previewHighlight(this.context),
4268
4271
  smartTask(this.context)
4269
- ], this.createPluginProps()));
4272
+ ], this.createPluginProps()).concat(this.defaultPlugins);
4270
4273
  };
4271
4274
  MdEditor.prototype.createView = function () {
4272
4275
  var _this = this;
@@ -16617,7 +16620,7 @@ var Map$1 = /** @class */ (function () {
16617
16620
 
16618
16621
  /**
16619
16622
  * @fileoverview Implements i18n
16620
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
16623
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
16621
16624
  */
16622
16625
  var DEFAULT_CODE = 'en-US';
16623
16626
  /**
@@ -19527,12 +19530,12 @@ var WysiwygEditor = /** @class */ (function (_super) {
19527
19530
  });
19528
19531
  };
19529
19532
  WysiwygEditor.prototype.createPlugins = function () {
19530
- return this.defaultPlugins.concat(__spreadArray$1([
19533
+ return __spreadArray$1([
19531
19534
  tableSelection(),
19532
19535
  tableContextMenu(this.eventEmitter),
19533
19536
  task(),
19534
19537
  toolbarStateHighlight(this.eventEmitter)
19535
- ], this.createPluginProps()));
19538
+ ], this.createPluginProps()).concat(this.defaultPlugins);
19536
19539
  };
19537
19540
  WysiwygEditor.prototype.createPluginNodeViews = function () {
19538
19541
  var _a = this, eventEmitter = _a.eventEmitter, pluginNodeViews = _a.pluginNodeViews;
@@ -21615,10 +21618,11 @@ var Convertor = /** @class */ (function () {
21615
21618
  }());
21616
21619
 
21617
21620
  function execPlugin(plugin, eventEmitter, usageStatistics) {
21618
- var pmState = { Plugin: Plugin, Selection: Selection, TextSelection: TextSelection };
21621
+ var pmState = { Plugin: Plugin, PluginKey: PluginKey, Selection: Selection, TextSelection: TextSelection };
21619
21622
  var pmView = { Decoration: Decoration, DecorationSet: DecorationSet };
21620
21623
  var pmModel = { Fragment: Fragment };
21621
- var context = { eventEmitter: eventEmitter, usageStatistics: usageStatistics, pmState: pmState, pmView: pmView, pmModel: pmModel, i18n: i18n };
21624
+ var pmRules = { InputRule: InputRule, inputRules: inputRules, undoInputRule: undoInputRule };
21625
+ var context = { eventEmitter: eventEmitter, usageStatistics: usageStatistics, pmState: pmState, pmView: pmView, pmModel: pmModel, pmRules: pmRules, i18n: i18n };
21622
21626
  if (isArray_1(plugin)) {
21623
21627
  var pluginFn = plugin[0], _a = plugin[1], options = _a === void 0 ? {} : _a;
21624
21628
  return pluginFn(context, options);
@@ -21773,6 +21777,10 @@ var ToastUIEditorViewer = /** @class */ (function () {
21773
21777
  element.hasAttribute(TASK_ATTR_NAME) &&
21774
21778
  isPositionInBox(style, ev.offsetX, ev.offsetY)) {
21775
21779
  toggleClass(element, TASK_CHECKED_CLASS_NAME);
21780
+ this.eventEmitter.emit('change', {
21781
+ source: 'viewer',
21782
+ date: ev,
21783
+ });
21776
21784
  }
21777
21785
  };
21778
21786
  /**
@@ -22523,7 +22531,12 @@ var ToastUIEditorCore = /** @class */ (function () {
22523
22531
  _this.wwEditor.setModel(wwNode);
22524
22532
  }
22525
22533
  });
22526
- return this.wwEditor.view.dom.innerHTML;
22534
+ var html = this.wwEditor.view.dom.innerHTML;
22535
+ if (this.placeholder) {
22536
+ var rePlaceholder = new RegExp("<span class=\"placeholder[^>]+>" + this.placeholder + "</span>", 'i');
22537
+ return html.replace(rePlaceholder, '');
22538
+ }
22539
+ return html;
22527
22540
  };
22528
22541
  /**
22529
22542
  * Insert text
@@ -22779,6 +22792,7 @@ var ToastUIEditorCore = /** @class */ (function () {
22779
22792
  * @param {string} placeholder - placeholder to set
22780
22793
  */
22781
22794
  ToastUIEditorCore.prototype.setPlaceholder = function (placeholder) {
22795
+ this.placeholder = placeholder;
22782
22796
  this.mdEditor.setPlaceholder(placeholder);
22783
22797
  this.wwEditor.setPlaceholder(placeholder);
22784
22798
  };
@@ -25638,7 +25652,7 @@ var templateObject_1;
25638
25652
 
25639
25653
  /**
25640
25654
  * @fileoverview I18N for English
25641
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
25655
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
25642
25656
  */
25643
25657
  ToastUIEditorCore.setLanguage(['en', 'en-US'], {
25644
25658
  Markdown: 'Markdown',
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * @toast-ui/editor : viewer
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
 
8
- import { Plugin, Selection, TextSelection } from 'prosemirror-state';
8
+ import { Plugin, PluginKey, Selection, TextSelection } from 'prosemirror-state';
9
+ import { InputRule, inputRules, undoInputRule } from 'prosemirror-inputrules';
9
10
  import { Decoration, DecorationSet } from 'prosemirror-view';
10
11
  import { Fragment } from 'prosemirror-model';
11
12
 
@@ -10104,7 +10105,10 @@ function unwrapWidgetSyntax(text) {
10104
10105
  }
10105
10106
  function widgetToDOM(info, text) {
10106
10107
  var _a = widgetRuleMap[info], rule = _a.rule, toDOM = _a.toDOM;
10107
- text = unwrapWidgetSyntax(text).match(rule)[0];
10108
+ var matches = unwrapWidgetSyntax(text).match(rule);
10109
+ if (matches) {
10110
+ text = matches[0];
10111
+ }
10108
10112
  return toDOM(text);
10109
10113
  }
10110
10114
  function getWidgetContent(widgetNode) {
@@ -11976,7 +11980,7 @@ var Map$1 = /** @class */ (function () {
11976
11980
 
11977
11981
  /**
11978
11982
  * @fileoverview Implements i18n
11979
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
11983
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
11980
11984
  */
11981
11985
  var DEFAULT_CODE = 'en-US';
11982
11986
  /**
@@ -12219,10 +12223,11 @@ function mixinTableOffsetMapPrototype(offsetMapMixin, createOffsetMapMixin) {
12219
12223
  }
12220
12224
 
12221
12225
  function execPlugin(plugin, eventEmitter, usageStatistics) {
12222
- var pmState = { Plugin: Plugin, Selection: Selection, TextSelection: TextSelection };
12226
+ var pmState = { Plugin: Plugin, PluginKey: PluginKey, Selection: Selection, TextSelection: TextSelection };
12223
12227
  var pmView = { Decoration: Decoration, DecorationSet: DecorationSet };
12224
12228
  var pmModel = { Fragment: Fragment };
12225
- var context = { eventEmitter: eventEmitter, usageStatistics: usageStatistics, pmState: pmState, pmView: pmView, pmModel: pmModel, i18n: i18n };
12229
+ var pmRules = { InputRule: InputRule, inputRules: inputRules, undoInputRule: undoInputRule };
12230
+ var context = { eventEmitter: eventEmitter, usageStatistics: usageStatistics, pmState: pmState, pmView: pmView, pmModel: pmModel, pmRules: pmRules, i18n: i18n };
12226
12231
  if (isArray_1(plugin)) {
12227
12232
  var pluginFn = plugin[0], _a = plugin[1], options = _a === void 0 ? {} : _a;
12228
12233
  return pluginFn(context, options);
@@ -12667,6 +12672,10 @@ var ToastUIEditorViewer = /** @class */ (function () {
12667
12672
  element.hasAttribute(TASK_ATTR_NAME) &&
12668
12673
  isPositionInBox(style, ev.offsetX, ev.offsetY)) {
12669
12674
  toggleClass(element, TASK_CHECKED_CLASS_NAME);
12675
+ this.eventEmitter.emit('change', {
12676
+ source: 'viewer',
12677
+ date: ev,
12678
+ });
12670
12679
  }
12671
12680
  };
12672
12681
  /**
package/dist/i18n/ar.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -129,8 +129,8 @@ _editorCore__WEBPACK_IMPORTED_MODULE_0___default().setLanguage(['de', 'de-DE'],
129
129
  Heading: 'Titel',
130
130
  'Image URL': 'Bild URL',
131
131
  'Select image file': 'Grafik auswählen',
132
- 'Choose a file': 'Wähle eine datei',
133
- 'No file': 'Keine datei',
132
+ 'Choose a file': 'Wähle eine Datei',
133
+ 'No file': 'Keine Datei',
134
134
  Description: 'Beschreibung',
135
135
  OK: 'OK',
136
136
  More: 'Mehr',
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -101,7 +101,7 @@ __webpack_require__.r(__webpack_exports__);
101
101
  /* harmony import */ var _editorCore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editorCore__WEBPACK_IMPORTED_MODULE_0__);
102
102
  /**
103
103
  * @fileoverview I18N for Japanese
104
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
104
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
105
105
  */
106
106
 
107
107
  _editorCore__WEBPACK_IMPORTED_MODULE_0___default().setLanguage(['ja', 'ja-JP'], {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -101,7 +101,7 @@ __webpack_require__.r(__webpack_exports__);
101
101
  /* harmony import */ var _editorCore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editorCore__WEBPACK_IMPORTED_MODULE_0__);
102
102
  /**
103
103
  * @fileoverview I18N for Korean
104
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
104
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
105
105
  */
106
106
 
107
107
  _editorCore__WEBPACK_IMPORTED_MODULE_0___default().setLanguage(['ko', 'ko-KR'], {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -101,7 +101,7 @@ __webpack_require__.r(__webpack_exports__);
101
101
  /* harmony import */ var _editorCore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editorCore__WEBPACK_IMPORTED_MODULE_0__);
102
102
  /**
103
103
  * @fileoverview I18N for Dutch
104
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
104
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
105
105
  */
106
106
 
107
107
  _editorCore__WEBPACK_IMPORTED_MODULE_0___default().setLanguage(['nl', 'nl-NL'], {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -101,7 +101,7 @@ __webpack_require__.r(__webpack_exports__);
101
101
  /* harmony import */ var _editorCore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editorCore__WEBPACK_IMPORTED_MODULE_0__);
102
102
  /**
103
103
  * @fileoverview I18N for Chinese
104
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
104
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
105
105
  */
106
106
 
107
107
  _editorCore__WEBPACK_IMPORTED_MODULE_0___default().setLanguage('zh-CN', {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.3
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  @charset "utf-8";
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  /*
@@ -1,19 +1,19 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
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-model"), require("prosemirror-state"), require("prosemirror-view"));
9
+ module.exports = factory(require("prosemirror-inputrules"), require("prosemirror-model"), require("prosemirror-state"), require("prosemirror-view"));
10
10
  else if(typeof define === 'function' && define.amd)
11
- define(["prosemirror-model", "prosemirror-state", "prosemirror-view"], factory);
11
+ define(["prosemirror-inputrules", "prosemirror-model", "prosemirror-state", "prosemirror-view"], factory);
12
12
  else if(typeof exports === 'object')
13
- exports["toastui"] = factory(require("prosemirror-model"), require("prosemirror-state"), require("prosemirror-view"));
13
+ exports["toastui"] = factory(require("prosemirror-inputrules"), 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]);
16
- })(self, function(__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]);
16
+ })(self, function(__WEBPACK_EXTERNAL_MODULE__479__, __WEBPACK_EXTERNAL_MODULE__43__, __WEBPACK_EXTERNAL_MODULE__814__, __WEBPACK_EXTERNAL_MODULE__311__) {
17
17
  return /******/ (function() { // webpackBootstrap
18
18
  /******/ var __webpack_modules__ = ({
19
19
 
@@ -2712,6 +2712,14 @@ function isUndefined(obj) {
2712
2712
  module.exports = isUndefined;
2713
2713
 
2714
2714
 
2715
+ /***/ }),
2716
+
2717
+ /***/ 479:
2718
+ /***/ (function(module) {
2719
+
2720
+ "use strict";
2721
+ module.exports = __WEBPACK_EXTERNAL_MODULE__479__;
2722
+
2715
2723
  /***/ }),
2716
2724
 
2717
2725
  /***/ 43:
@@ -12084,7 +12092,7 @@ var request_sendHostname = __webpack_require__(391);
12084
12092
  var isMac = /Mac/.test(navigator.platform);
12085
12093
  var reSpaceMoreThanOne = /[\u0020]+/g;
12086
12094
  var common_reEscapeChars = /[>(){}[\]+-.!#|]/g;
12087
- var reEscapeHTML = /<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\/>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g;
12095
+ var reEscapeHTML = /<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g;
12088
12096
  var reEscapeBackSlash = /\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g;
12089
12097
  var reEscapePairedChars = /[*_~`]/g;
12090
12098
  var reMdImageSyntax = /!\[.*\]\(.*\)/g;
@@ -12702,7 +12710,10 @@ function createWidgetContent(info, text) {
12702
12710
  }
12703
12711
  function widgetToDOM(info, text) {
12704
12712
  var _a = widgetRuleMap[info], rule = _a.rule, toDOM = _a.toDOM;
12705
- text = unwrapWidgetSyntax(text).match(rule)[0];
12713
+ var matches = unwrapWidgetSyntax(text).match(rule);
12714
+ if (matches) {
12715
+ text = matches[0];
12716
+ }
12706
12717
  return toDOM(text);
12707
12718
  }
12708
12719
  function getWidgetRules() {
@@ -13396,6 +13407,8 @@ var MarkdownPreview = /** @class */ (function () {
13396
13407
 
13397
13408
  // EXTERNAL MODULE: external {"commonjs":"prosemirror-state","commonjs2":"prosemirror-state","amd":"prosemirror-state"}
13398
13409
  var external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_ = __webpack_require__(814);
13410
+ // EXTERNAL MODULE: external {"commonjs":"prosemirror-inputrules","commonjs2":"prosemirror-inputrules","amd":"prosemirror-inputrules"}
13411
+ var external_commonjs_prosemirror_inputrules_commonjs2_prosemirror_inputrules_amd_prosemirror_inputrules_ = __webpack_require__(479);
13399
13412
  // EXTERNAL MODULE: external {"commonjs":"prosemirror-view","commonjs2":"prosemirror-view","amd":"prosemirror-view"}
13400
13413
  var external_commonjs_prosemirror_view_commonjs2_prosemirror_view_amd_prosemirror_view_ = __webpack_require__(311);
13401
13414
  // EXTERNAL MODULE: external {"commonjs":"prosemirror-model","commonjs2":"prosemirror-model","amd":"prosemirror-model"}
@@ -13464,7 +13477,7 @@ var map_Map = /** @class */ (function () {
13464
13477
  ;// CONCATENATED MODULE: ./src/i18n/i18n.ts
13465
13478
  /**
13466
13479
  * @fileoverview Implements i18n
13467
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
13480
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
13468
13481
  */
13469
13482
 
13470
13483
 
@@ -13792,11 +13805,13 @@ function mixinTableOffsetMapPrototype(offsetMapMixin, createOffsetMapMixin) {
13792
13805
 
13793
13806
 
13794
13807
 
13808
+
13795
13809
  function execPlugin(plugin, eventEmitter, usageStatistics) {
13796
- var pmState = { Plugin: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.Plugin, Selection: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.Selection, TextSelection: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.TextSelection };
13810
+ 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 };
13797
13811
  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 };
13798
13812
  var pmModel = { Fragment: external_commonjs_prosemirror_model_commonjs2_prosemirror_model_amd_prosemirror_model_.Fragment };
13799
- var context = { eventEmitter: eventEmitter, usageStatistics: usageStatistics, pmState: pmState, pmView: pmView, pmModel: pmModel, i18n: i18n };
13813
+ 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 };
13814
+ var context = { eventEmitter: eventEmitter, usageStatistics: usageStatistics, pmState: pmState, pmView: pmView, pmModel: pmModel, pmRules: pmRules, i18n: i18n };
13800
13815
  if (isArray_default()(plugin)) {
13801
13816
  var pluginFn = plugin[0], _a = plugin[1], options = _a === void 0 ? {} : _a;
13802
13817
  return pluginFn(context, options);
@@ -14188,6 +14203,10 @@ var ToastUIEditorViewer = /** @class */ (function () {
14188
14203
  element.hasAttribute(TASK_ATTR_NAME) &&
14189
14204
  isPositionInBox(style, ev.offsetX, ev.offsetY)) {
14190
14205
  toggleClass(element, TASK_CHECKED_CLASS_NAME);
14206
+ this.eventEmitter.emit('change', {
14207
+ source: 'viewer',
14208
+ date: ev,
14209
+ });
14191
14210
  }
14192
14211
  };
14193
14212
  /**
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  .ProseMirror {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.3 | Thu Feb 10 2022
4
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
3
+ * @version 3.1.6 | Mon May 16 2022
4
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -3388,7 +3388,7 @@ var sendHostname_default = /*#__PURE__*/__webpack_require__.n(sendHostname);
3388
3388
  var isMac = /Mac/.test(navigator.platform);
3389
3389
  var reSpaceMoreThanOne = /[\u0020]+/g;
3390
3390
  var reEscapeChars = /[>(){}[\]+-.!#|]/g;
3391
- var reEscapeHTML = /<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\/>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g;
3391
+ var reEscapeHTML = /<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g;
3392
3392
  var reEscapeBackSlash = /\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g;
3393
3393
  var reEscapePairedChars = /[*_~`]/g;
3394
3394
  var reMdImageSyntax = /!\[.*\]\(.*\)/g;
@@ -3846,7 +3846,10 @@ function createWidgetContent(info, text) {
3846
3846
  }
3847
3847
  function widgetToDOM(info, text) {
3848
3848
  var _a = widgetRuleMap[info], rule = _a.rule, toDOM = _a.toDOM;
3849
- text = unwrapWidgetSyntax(text).match(rule)[0];
3849
+ var matches = unwrapWidgetSyntax(text).match(rule);
3850
+ if (matches) {
3851
+ text = matches[0];
3852
+ }
3850
3853
  return toDOM(text);
3851
3854
  }
3852
3855
  function getWidgetRules() {
@@ -7182,11 +7185,11 @@ var MdEditor = /** @class */ (function (_super) {
7182
7185
  ]);
7183
7186
  };
7184
7187
  MdEditor.prototype.createPlugins = function () {
7185
- return this.defaultPlugins.concat(__spreadArray([
7188
+ return __spreadArray([
7186
7189
  syntaxHighlight(this.context),
7187
7190
  previewHighlight(this.context),
7188
7191
  smartTask(this.context)
7189
- ], this.createPluginProps()));
7192
+ ], this.createPluginProps()).concat(this.defaultPlugins);
7190
7193
  };
7191
7194
  MdEditor.prototype.createView = function () {
7192
7195
  var _this = this;
@@ -17951,7 +17954,7 @@ var map_Map = /** @class */ (function () {
17951
17954
  ;// CONCATENATED MODULE: ./src/i18n/i18n.ts
17952
17955
  /**
17953
17956
  * @fileoverview Implements i18n
17954
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
17957
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
17955
17958
  */
17956
17959
 
17957
17960
 
@@ -21128,12 +21131,12 @@ var WysiwygEditor = /** @class */ (function (_super) {
21128
21131
  });
21129
21132
  };
21130
21133
  WysiwygEditor.prototype.createPlugins = function () {
21131
- return this.defaultPlugins.concat(__spreadArray([
21134
+ return __spreadArray([
21132
21135
  tableSelection(),
21133
21136
  tableContextMenu(this.eventEmitter),
21134
21137
  task(),
21135
21138
  toolbarStateHighlight(this.eventEmitter)
21136
- ], this.createPluginProps()));
21139
+ ], this.createPluginProps()).concat(this.defaultPlugins);
21137
21140
  };
21138
21141
  WysiwygEditor.prototype.createPluginNodeViews = function () {
21139
21142
  var _a = this, eventEmitter = _a.eventEmitter, pluginNodeViews = _a.pluginNodeViews;
@@ -23199,11 +23202,13 @@ var Convertor = /** @class */ (function () {
23199
23202
 
23200
23203
 
23201
23204
 
23205
+
23202
23206
  function execPlugin(plugin, eventEmitter, usageStatistics) {
23203
- var pmState = { Plugin: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.Plugin, Selection: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.Selection, TextSelection: external_commonjs_prosemirror_state_commonjs2_prosemirror_state_amd_prosemirror_state_.TextSelection };
23207
+ 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 };
23204
23208
  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 };
23205
23209
  var pmModel = { Fragment: external_commonjs_prosemirror_model_commonjs2_prosemirror_model_amd_prosemirror_model_.Fragment };
23206
- var context = { eventEmitter: eventEmitter, usageStatistics: usageStatistics, pmState: pmState, pmView: pmView, pmModel: pmModel, i18n: i18n };
23210
+ 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 };
23211
+ var context = { eventEmitter: eventEmitter, usageStatistics: usageStatistics, pmState: pmState, pmView: pmView, pmModel: pmModel, pmRules: pmRules, i18n: i18n };
23207
23212
  if (isArray_default()(plugin)) {
23208
23213
  var pluginFn = plugin[0], _a = plugin[1], options = _a === void 0 ? {} : _a;
23209
23214
  return pluginFn(context, options);
@@ -23371,6 +23376,10 @@ var ToastUIEditorViewer = /** @class */ (function () {
23371
23376
  element.hasAttribute(TASK_ATTR_NAME) &&
23372
23377
  isPositionInBox(style, ev.offsetX, ev.offsetY)) {
23373
23378
  toggleClass(element, TASK_CHECKED_CLASS_NAME);
23379
+ this.eventEmitter.emit('change', {
23380
+ source: 'viewer',
23381
+ date: ev,
23382
+ });
23374
23383
  }
23375
23384
  };
23376
23385
  /**
@@ -24173,7 +24182,12 @@ var ToastUIEditorCore = /** @class */ (function () {
24173
24182
  _this.wwEditor.setModel(wwNode);
24174
24183
  }
24175
24184
  });
24176
- return this.wwEditor.view.dom.innerHTML;
24185
+ var html = this.wwEditor.view.dom.innerHTML;
24186
+ if (this.placeholder) {
24187
+ var rePlaceholder = new RegExp("<span class=\"placeholder[^>]+>" + this.placeholder + "</span>", 'i');
24188
+ return html.replace(rePlaceholder, '');
24189
+ }
24190
+ return html;
24177
24191
  };
24178
24192
  /**
24179
24193
  * Insert text
@@ -24429,6 +24443,7 @@ var ToastUIEditorCore = /** @class */ (function () {
24429
24443
  * @param {string} placeholder - placeholder to set
24430
24444
  */
24431
24445
  ToastUIEditorCore.prototype.setPlaceholder = function (placeholder) {
24446
+ this.placeholder = placeholder;
24432
24447
  this.mdEditor.setPlaceholder(placeholder);
24433
24448
  this.wwEditor.setPlaceholder(placeholder);
24434
24449
  };
@@ -27290,7 +27305,7 @@ var editor_templateObject_1;
27290
27305
  ;// CONCATENATED MODULE: ./src/i18n/en-us.ts
27291
27306
  /**
27292
27307
  * @fileoverview I18N for English
27293
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
27308
+ * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
27294
27309
  */
27295
27310
 
27296
27311
  editorCore.setLanguage(['en', 'en-US'], {
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@toast-ui/editor",
3
- "version": "3.1.3",
3
+ "version": "3.1.6",
4
4
  "description": "GFM Markdown Wysiwyg Editor - Productive and Extensible",
5
5
  "keywords": [
6
6
  "nhn",
7
+ "nhn cloud",
7
8
  "toast",
8
9
  "toastui",
9
10
  "toast-ui",
@@ -47,7 +48,7 @@
47
48
  "dist/i18n",
48
49
  "types"
49
50
  ],
50
- "author": "NHN FE Development Lab <dl_javascript@nhn.com>",
51
+ "author": "NHN Cloud FE Development Lab <dl_javascript@nhn.com>",
51
52
  "license": "MIT",
52
53
  "repository": {
53
54
  "type": "git",
package/types/editor.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { Schema, NodeSpec, MarkSpec, Fragment } from 'prosemirror-model';
2
2
  import { EditorView, Decoration, DecorationSet } from 'prosemirror-view';
3
- import { EditorState, Plugin, Selection, TextSelection } from 'prosemirror-state';
3
+ import { EditorState, Plugin, PluginKey, Selection, TextSelection } from 'prosemirror-state';
4
+ import { undoInputRule, InputRule, inputRules } from 'prosemirror-inputrules';
5
+
4
6
  import {
5
7
  HTMLConvertor,
6
8
  MdPos,
@@ -122,11 +124,17 @@ export interface PluginContext {
122
124
  i18n: I18n;
123
125
  pmState: {
124
126
  Plugin: typeof Plugin;
127
+ PluginKey: typeof PluginKey;
125
128
  Selection: typeof Selection;
126
129
  TextSelection: typeof TextSelection;
127
130
  };
128
131
  pmView: { Decoration: typeof Decoration; DecorationSet: typeof DecorationSet };
129
132
  pmModel: { Fragment: typeof Fragment };
133
+ pmRules: {
134
+ inputRules: typeof inputRules;
135
+ InputRule: typeof InputRule;
136
+ undoInputRule: typeof undoInputRule;
137
+ };
130
138
  }
131
139
 
132
140
  export type PluginFn = (context: PluginContext, options?: any) => PluginInfo | null;
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for TOAST UI Editor v3.1.3
1
+ // Type definitions for TOAST UI Editor v3.1.6
2
2
  // TypeScript Version: 4.2.3
3
3
  import {
4
4
  EditorCore,