suneditor 2.47.5 → 2.47.7

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 (141) hide show
  1. package/LICENSE.txt +20 -20
  2. package/README.md +1625 -1613
  3. package/dist/css/suneditor.min.css +1 -1
  4. package/dist/suneditor.min.js +2 -2
  5. package/example.md +586 -586
  6. package/package.json +71 -71
  7. package/src/assets/css/suneditor-contents.css +561 -561
  8. package/src/assets/css/suneditor.css +2 -2
  9. package/src/assets/defaultIcons.js +103 -103
  10. package/src/lang/Lang.d.ts +143 -143
  11. package/src/lang/ckb.d.ts +4 -4
  12. package/src/lang/ckb.js +187 -187
  13. package/src/lang/cs.d.ts +4 -4
  14. package/src/lang/cs.js +187 -187
  15. package/src/lang/da.d.ts +4 -4
  16. package/src/lang/da.js +191 -191
  17. package/src/lang/de.d.ts +4 -4
  18. package/src/lang/de.js +188 -188
  19. package/src/lang/en.d.ts +4 -4
  20. package/src/lang/en.js +187 -187
  21. package/src/lang/es.d.ts +4 -4
  22. package/src/lang/es.js +187 -187
  23. package/src/lang/fa.d.ts +4 -4
  24. package/src/lang/fa.js +187 -187
  25. package/src/lang/fr.d.ts +4 -4
  26. package/src/lang/fr.js +188 -188
  27. package/src/lang/he.d.ts +4 -4
  28. package/src/lang/he.js +188 -188
  29. package/src/lang/hu.d.ts +5 -5
  30. package/src/lang/hu.js +188 -188
  31. package/src/lang/index.d.ts +25 -24
  32. package/src/lang/index.js +30 -27
  33. package/src/lang/it.d.ts +4 -4
  34. package/src/lang/it.js +188 -188
  35. package/src/lang/ja.d.ts +4 -4
  36. package/src/lang/ja.js +187 -187
  37. package/src/lang/km.d.ts +5 -0
  38. package/src/lang/km.js +188 -0
  39. package/src/lang/ko.d.ts +4 -4
  40. package/src/lang/ko.js +187 -187
  41. package/src/lang/lv.d.ts +4 -4
  42. package/src/lang/lv.js +187 -187
  43. package/src/lang/nl.d.ts +4 -4
  44. package/src/lang/nl.js +187 -187
  45. package/src/lang/pl.d.ts +4 -4
  46. package/src/lang/pl.js +187 -187
  47. package/src/lang/pt_br.d.ts +4 -4
  48. package/src/lang/pt_br.js +189 -189
  49. package/src/lang/ro.d.ts +4 -4
  50. package/src/lang/ro.js +187 -187
  51. package/src/lang/ru.d.ts +4 -4
  52. package/src/lang/ru.js +187 -187
  53. package/src/lang/se.d.ts +4 -4
  54. package/src/lang/se.js +191 -191
  55. package/src/lang/tr.d.ts +5 -5
  56. package/src/lang/tr.js +191 -191
  57. package/src/lang/ua.d.ts +5 -5
  58. package/src/lang/ua.js +188 -188
  59. package/src/lang/ur.d.ts +4 -4
  60. package/src/lang/ur.js +187 -187
  61. package/src/lang/zh_cn.d.ts +4 -4
  62. package/src/lang/zh_cn.js +187 -187
  63. package/src/lib/constructor.js +0 -0
  64. package/src/lib/context.d.ts +42 -42
  65. package/src/lib/context.js +0 -0
  66. package/src/lib/core.d.ts +1135 -1135
  67. package/src/lib/core.js +9 -3
  68. package/src/lib/history.d.ts +48 -48
  69. package/src/lib/history.js +218 -218
  70. package/src/lib/util.d.ts +677 -677
  71. package/src/lib/util.js +1 -1
  72. package/src/options.d.ts +621 -620
  73. package/src/plugins/CommandPlugin.d.ts +7 -7
  74. package/src/plugins/DialogPlugin.d.ts +19 -19
  75. package/src/plugins/FileBrowserPlugin.d.ts +29 -29
  76. package/src/plugins/Module.d.ts +14 -14
  77. package/src/plugins/Plugin.d.ts +41 -41
  78. package/src/plugins/SubmenuPlugin.d.ts +7 -7
  79. package/src/plugins/command/blockquote.d.ts +4 -4
  80. package/src/plugins/command/blockquote.js +46 -46
  81. package/src/plugins/dialog/audio.d.ts +4 -4
  82. package/src/plugins/dialog/audio.js +557 -558
  83. package/src/plugins/dialog/image.d.ts +4 -4
  84. package/src/plugins/dialog/image.js +1126 -1127
  85. package/src/plugins/dialog/link.d.ts +4 -4
  86. package/src/plugins/dialog/link.js +223 -223
  87. package/src/plugins/dialog/math.d.ts +4 -4
  88. package/src/plugins/dialog/math.js +300 -300
  89. package/src/plugins/dialog/video.d.ts +4 -4
  90. package/src/plugins/dialog/video.js +989 -989
  91. package/src/plugins/fileBrowser/imageGallery.d.ts +4 -4
  92. package/src/plugins/fileBrowser/imageGallery.js +64 -64
  93. package/src/plugins/index.d.ts +79 -79
  94. package/src/plugins/index.js +32 -32
  95. package/src/plugins/modules/_anchor.js +461 -461
  96. package/src/plugins/modules/_colorPicker.d.ts +59 -59
  97. package/src/plugins/modules/_colorPicker.js +0 -0
  98. package/src/plugins/modules/_notice.d.ts +20 -20
  99. package/src/plugins/modules/_notice.js +72 -72
  100. package/src/plugins/modules/_selectMenu.js +118 -118
  101. package/src/plugins/modules/component.d.ts +24 -24
  102. package/src/plugins/modules/component.js +80 -80
  103. package/src/plugins/modules/dialog.d.ts +27 -27
  104. package/src/plugins/modules/dialog.js +174 -174
  105. package/src/plugins/modules/fileBrowser.d.ts +41 -41
  106. package/src/plugins/modules/fileBrowser.js +377 -377
  107. package/src/plugins/modules/fileManager.d.ts +66 -66
  108. package/src/plugins/modules/fileManager.js +325 -325
  109. package/src/plugins/modules/index.d.ts +10 -10
  110. package/src/plugins/modules/index.js +8 -8
  111. package/src/plugins/modules/resizing.d.ts +153 -153
  112. package/src/plugins/modules/resizing.js +902 -902
  113. package/src/plugins/submenu/align.d.ts +4 -4
  114. package/src/plugins/submenu/align.js +160 -160
  115. package/src/plugins/submenu/font.d.ts +4 -4
  116. package/src/plugins/submenu/font.js +123 -123
  117. package/src/plugins/submenu/fontColor.d.ts +4 -4
  118. package/src/plugins/submenu/fontColor.js +0 -0
  119. package/src/plugins/submenu/fontSize.d.ts +4 -4
  120. package/src/plugins/submenu/fontSize.js +112 -112
  121. package/src/plugins/submenu/formatBlock.d.ts +4 -4
  122. package/src/plugins/submenu/formatBlock.js +273 -273
  123. package/src/plugins/submenu/hiliteColor.d.ts +4 -4
  124. package/src/plugins/submenu/hiliteColor.js +0 -0
  125. package/src/plugins/submenu/horizontalRule.d.ts +4 -4
  126. package/src/plugins/submenu/horizontalRule.js +98 -98
  127. package/src/plugins/submenu/lineHeight.d.ts +4 -4
  128. package/src/plugins/submenu/lineHeight.js +104 -104
  129. package/src/plugins/submenu/list.d.ts +4 -4
  130. package/src/plugins/submenu/list.js +456 -456
  131. package/src/plugins/submenu/paragraphStyle.d.ts +4 -4
  132. package/src/plugins/submenu/paragraphStyle.js +135 -135
  133. package/src/plugins/submenu/table.d.ts +4 -4
  134. package/src/plugins/submenu/template.d.ts +4 -4
  135. package/src/plugins/submenu/template.js +71 -71
  136. package/src/plugins/submenu/textStyle.d.ts +4 -4
  137. package/src/plugins/submenu/textStyle.js +167 -167
  138. package/src/suneditor.d.ts +9 -9
  139. package/src/suneditor.js +75 -75
  140. package/src/suneditor_build.js +20 -17
  141. package/README_V3_TEMP.md +0 -630
@@ -1,5 +1,5 @@
1
- import { DialogPlugin } from '../DialogPlugin';
2
-
3
- declare const link: DialogPlugin;
4
-
1
+ import { DialogPlugin } from '../DialogPlugin';
2
+
3
+ declare const link: DialogPlugin;
4
+
5
5
  export default link;
@@ -1,223 +1,223 @@
1
- /*
2
- * wysiwyg web editor
3
- *
4
- * suneditor.js
5
- * Copyright 2017 JiHong Lee.
6
- * MIT license.
7
- */
8
- 'use strict';
9
-
10
- import dialog from '../modules/dialog';
11
- import anchor from '../modules/_anchor';
12
-
13
- export default {
14
- name: 'link',
15
- display: 'dialog',
16
- add: function (core) {
17
- core.addModule([dialog, anchor]);
18
-
19
- const context = core.context;
20
- const contextLink = context.link = {
21
- focusElement: null, // @Override dialog // This element has focus when the dialog is opened.
22
- _linkAnchor: null,
23
- anchorCtx: null
24
- };
25
-
26
- /** link dialog */
27
- let link_dialog = this.setDialog(core);
28
- contextLink.modal = link_dialog;
29
-
30
- /** link controller */
31
- let link_controller = this.setController_LinkButton(core);
32
- contextLink.linkController = link_controller;
33
-
34
- link_dialog.querySelector('form').addEventListener('submit', this.submit.bind(core));
35
- link_controller.addEventListener('click', this.onClick_linkController.bind(core));
36
-
37
- /** append html */
38
- context.dialog.modal.appendChild(link_dialog);
39
-
40
- /** append controller */
41
- context.element.relative.appendChild(link_controller);
42
-
43
- /** link event */
44
- core.plugins.anchor.initEvent.call(core, 'link', link_dialog);
45
- contextLink.focusElement = context.anchor.caller.link.urlInput;
46
-
47
- /** empty memory */
48
- link_dialog = null, link_controller = null;
49
- },
50
-
51
- /** dialog */
52
- setDialog: function (core) {
53
- const lang = core.lang;
54
- const dialog = core.util.createElement('DIV');
55
- const icons = core.icons;
56
-
57
- dialog.className = 'se-dialog-content';
58
- dialog.style.display = 'none';
59
- let html = '' +
60
- '<form>' +
61
- '<div class="se-dialog-header">' +
62
- '<button type="button" data-command="close" class="se-btn se-dialog-close" title="' + lang.dialogBox.close + '" aria-label="' + lang.dialogBox.close + '">' +
63
- icons.cancel +
64
- '</button>' +
65
- '<span class="se-modal-title">' + lang.dialogBox.linkBox.title + '</span>' +
66
- '</div>' +
67
- core.context.anchor.forms.innerHTML +
68
- '<div class="se-dialog-footer">' +
69
- '<button type="submit" class="se-btn-primary" title="' + lang.dialogBox.submitButton + '" aria-label="' + lang.dialogBox.submitButton + '"><span>' + lang.dialogBox.submitButton + '</span></button>' +
70
- '</div>' +
71
- '</form>';
72
-
73
- dialog.innerHTML = html;
74
- return dialog;
75
- },
76
-
77
- /** modify controller button */
78
- setController_LinkButton: function (core) {
79
- const lang = core.lang;
80
- const icons = core.icons;
81
- const link_btn = core.util.createElement('DIV');
82
-
83
- link_btn.className = 'se-controller se-controller-link';
84
- link_btn.innerHTML = '' +
85
- '<div class="se-arrow se-arrow-up"></div>' +
86
- '<div class="link-content"><span><a target="_blank" href=""></a>&nbsp;</span>' +
87
- '<div class="se-btn-group">' +
88
- '<button type="button" data-command="update" tabindex="-1" class="se-btn se-tooltip">' +
89
- icons.edit +
90
- '<span class="se-tooltip-inner"><span class="se-tooltip-text">' + lang.controller.edit + '</span></span>' +
91
- '</button>' +
92
- '<button type="button" data-command="unlink" tabindex="-1" class="se-btn se-tooltip">' +
93
- icons.unlink +
94
- '<span class="se-tooltip-inner"><span class="se-tooltip-text">' + lang.controller.unlink + '</span></span>' +
95
- '</button>' +
96
- '<button type="button" data-command="delete" tabindex="-1" class="se-btn se-tooltip">' +
97
- icons.delete +
98
- '<span class="se-tooltip-inner"><span class="se-tooltip-text">' + lang.controller.remove + '</span></span>' +
99
- '</button>' +
100
- '</div>' +
101
- '</div>';
102
-
103
- return link_btn;
104
- },
105
-
106
- /**
107
- * @Override dialog
108
- */
109
- open: function () {
110
- this.plugins.dialog.open.call(this, 'link', 'link' === this.currentControllerName);
111
- },
112
-
113
- submit: function (e) {
114
- this.showLoading();
115
-
116
- e.preventDefault();
117
- e.stopPropagation();
118
-
119
- try {
120
- const oA = this.plugins.anchor.createAnchor.call(this, this.context.anchor.caller.link, false);
121
- if (oA === null) return;
122
-
123
- if (!this.context.dialog.updateModal) {
124
- const selectedFormats = this.getSelectedElements();
125
- if (selectedFormats.length > 1) {
126
- const oFormat = this.util.createElement(selectedFormats[0].nodeName);
127
- oFormat.appendChild(oA);
128
- if (!this.insertNode(oFormat, null, true)) return;
129
- } else {
130
- if (!this.insertNode(oA, null, true)) return;
131
- }
132
-
133
- this.setRange(oA.childNodes[0], 0, oA.childNodes[0], oA.textContent.length);
134
- } else {
135
- // set range
136
- const textNode = this.context.link._linkAnchor.childNodes[0];
137
- this.setRange(textNode, 0, textNode, textNode.textContent.length);
138
- }
139
- } finally {
140
- this.plugins.dialog.close.call(this);
141
- this.closeLoading();
142
- // history stack
143
- this.history.push(false);
144
- }
145
-
146
- return false;
147
- },
148
-
149
- /**
150
- * @Override core
151
- */
152
- active: function (element) {
153
- if (!element) {
154
- if (this.controllerArray.indexOf(this.context.link.linkController) > -1) {
155
- this.controllersOff();
156
- }
157
- } else if (this.util.isAnchor(element) && element.getAttribute('data-image-link') === null) {
158
- if (this.controllerArray.indexOf(this.context.link.linkController) < 0) {
159
- this.plugins.link.call_controller.call(this, element);
160
- }
161
- return true;
162
- }
163
-
164
- return false;
165
- },
166
-
167
- /**
168
- * @Override dialog
169
- */
170
- on: function (update) {
171
- this.plugins.anchor.on.call(this, this.context.anchor.caller.link, update);
172
- },
173
-
174
- call_controller: function (selectionATag) {
175
- this.editLink = this.context.link._linkAnchor = this.context.anchor.caller.link.linkAnchor = selectionATag;
176
- const linkBtn = this.context.link.linkController;
177
- const link = linkBtn.querySelector('a');
178
-
179
- link.href = selectionATag.href;
180
- link.title = selectionATag.textContent;
181
- link.textContent = selectionATag.textContent;
182
-
183
- this.util.addClass(selectionATag, 'on');
184
- this.setControllerPosition(linkBtn, selectionATag, 'bottom', {left: 0, top: 0});
185
- this.controllersOn(linkBtn, selectionATag, 'link', this.util.removeClass.bind(this.util, this.context.link._linkAnchor, 'on'));
186
- },
187
-
188
- onClick_linkController: function (e) {
189
- e.stopPropagation();
190
-
191
- const command = e.target.getAttribute('data-command') || e.target.parentNode.getAttribute('data-command');
192
- if (!command) return;
193
-
194
- e.preventDefault();
195
-
196
- if (/update/.test(command)) {
197
- this.plugins.dialog.open.call(this, 'link', true);
198
- } else if (/unlink/.test(command)) {
199
- const sc = this.util.getChildElement(this.context.link._linkAnchor, function (current) { return current.childNodes.length === 0 || current.nodeType === 3; }, false);
200
- const ec = this.util.getChildElement(this.context.link._linkAnchor, function (current) { return current.childNodes.length === 0 || current.nodeType === 3; }, true);
201
- this.setRange(sc, 0, ec, ec.textContent.length);
202
- this.nodeChange(null, null, ['A'], false);
203
- } else {
204
- /** delete */
205
- this.util.removeItem(this.context.link._linkAnchor);
206
- this.context.anchor.caller.link.linkAnchor = null;
207
- this.focus();
208
-
209
- // history stack
210
- this.history.push(false);
211
- }
212
-
213
- this.controllersOff();
214
- },
215
-
216
- /**
217
- * @Override dialog
218
- */
219
- init: function () {
220
- this.context.link.linkController.style.display = 'none';
221
- this.plugins.anchor.init.call(this, this.context.anchor.caller.link);
222
- }
223
- };
1
+ /*
2
+ * wysiwyg web editor
3
+ *
4
+ * suneditor.js
5
+ * Copyright 2017 JiHong Lee.
6
+ * MIT license.
7
+ */
8
+ 'use strict';
9
+
10
+ import dialog from '../modules/dialog';
11
+ import anchor from '../modules/_anchor';
12
+
13
+ export default {
14
+ name: 'link',
15
+ display: 'dialog',
16
+ add: function (core) {
17
+ core.addModule([dialog, anchor]);
18
+
19
+ const context = core.context;
20
+ const contextLink = context.link = {
21
+ focusElement: null, // @Override dialog // This element has focus when the dialog is opened.
22
+ _linkAnchor: null,
23
+ anchorCtx: null
24
+ };
25
+
26
+ /** link dialog */
27
+ let link_dialog = this.setDialog(core);
28
+ contextLink.modal = link_dialog;
29
+
30
+ /** link controller */
31
+ let link_controller = this.setController_LinkButton(core);
32
+ contextLink.linkController = link_controller;
33
+
34
+ link_dialog.querySelector('form').addEventListener('submit', this.submit.bind(core));
35
+ link_controller.addEventListener('click', this.onClick_linkController.bind(core));
36
+
37
+ /** append html */
38
+ context.dialog.modal.appendChild(link_dialog);
39
+
40
+ /** append controller */
41
+ context.element.relative.appendChild(link_controller);
42
+
43
+ /** link event */
44
+ core.plugins.anchor.initEvent.call(core, 'link', link_dialog);
45
+ contextLink.focusElement = context.anchor.caller.link.urlInput;
46
+
47
+ /** empty memory */
48
+ link_dialog = null, link_controller = null;
49
+ },
50
+
51
+ /** dialog */
52
+ setDialog: function (core) {
53
+ const lang = core.lang;
54
+ const dialog = core.util.createElement('DIV');
55
+ const icons = core.icons;
56
+
57
+ dialog.className = 'se-dialog-content';
58
+ dialog.style.display = 'none';
59
+ let html = '' +
60
+ '<form>' +
61
+ '<div class="se-dialog-header">' +
62
+ '<button type="button" data-command="close" class="se-btn se-dialog-close" title="' + lang.dialogBox.close + '" aria-label="' + lang.dialogBox.close + '">' +
63
+ icons.cancel +
64
+ '</button>' +
65
+ '<span class="se-modal-title">' + lang.dialogBox.linkBox.title + '</span>' +
66
+ '</div>' +
67
+ core.context.anchor.forms.innerHTML +
68
+ '<div class="se-dialog-footer">' +
69
+ '<button type="submit" class="se-btn-primary" title="' + lang.dialogBox.submitButton + '" aria-label="' + lang.dialogBox.submitButton + '"><span>' + lang.dialogBox.submitButton + '</span></button>' +
70
+ '</div>' +
71
+ '</form>';
72
+
73
+ dialog.innerHTML = html;
74
+ return dialog;
75
+ },
76
+
77
+ /** modify controller button */
78
+ setController_LinkButton: function (core) {
79
+ const lang = core.lang;
80
+ const icons = core.icons;
81
+ const link_btn = core.util.createElement('DIV');
82
+
83
+ link_btn.className = 'se-controller se-controller-link';
84
+ link_btn.innerHTML = '' +
85
+ '<div class="se-arrow se-arrow-up"></div>' +
86
+ '<div class="link-content"><span><a target="_blank" href=""></a>&nbsp;</span>' +
87
+ '<div class="se-btn-group">' +
88
+ '<button type="button" data-command="update" tabindex="-1" class="se-btn se-tooltip">' +
89
+ icons.edit +
90
+ '<span class="se-tooltip-inner"><span class="se-tooltip-text">' + lang.controller.edit + '</span></span>' +
91
+ '</button>' +
92
+ '<button type="button" data-command="unlink" tabindex="-1" class="se-btn se-tooltip">' +
93
+ icons.unlink +
94
+ '<span class="se-tooltip-inner"><span class="se-tooltip-text">' + lang.controller.unlink + '</span></span>' +
95
+ '</button>' +
96
+ '<button type="button" data-command="delete" tabindex="-1" class="se-btn se-tooltip">' +
97
+ icons.delete +
98
+ '<span class="se-tooltip-inner"><span class="se-tooltip-text">' + lang.controller.remove + '</span></span>' +
99
+ '</button>' +
100
+ '</div>' +
101
+ '</div>';
102
+
103
+ return link_btn;
104
+ },
105
+
106
+ /**
107
+ * @Override dialog
108
+ */
109
+ open: function () {
110
+ this.plugins.dialog.open.call(this, 'link', 'link' === this.currentControllerName);
111
+ },
112
+
113
+ submit: function (e) {
114
+ this.showLoading();
115
+
116
+ e.preventDefault();
117
+ e.stopPropagation();
118
+
119
+ try {
120
+ const oA = this.plugins.anchor.createAnchor.call(this, this.context.anchor.caller.link, false);
121
+ if (oA === null) return;
122
+
123
+ if (!this.context.dialog.updateModal) {
124
+ const selectedFormats = this.getSelectedElements();
125
+ if (selectedFormats.length > 1) {
126
+ const oFormat = this.util.createElement(selectedFormats[0].nodeName);
127
+ oFormat.appendChild(oA);
128
+ if (!this.insertNode(oFormat, null, true)) return;
129
+ } else {
130
+ if (!this.insertNode(oA, null, true)) return;
131
+ }
132
+
133
+ this.setRange(oA.childNodes[0], 0, oA.childNodes[0], oA.textContent.length);
134
+ } else {
135
+ // set range
136
+ const textNode = this.context.link._linkAnchor.childNodes[0];
137
+ this.setRange(textNode, 0, textNode, textNode.textContent.length);
138
+ }
139
+ } finally {
140
+ this.plugins.dialog.close.call(this);
141
+ this.closeLoading();
142
+ // history stack
143
+ this.history.push(false);
144
+ }
145
+
146
+ return false;
147
+ },
148
+
149
+ /**
150
+ * @Override core
151
+ */
152
+ active: function (element) {
153
+ if (!element) {
154
+ if (this.controllerArray.indexOf(this.context.link.linkController) > -1) {
155
+ this.controllersOff();
156
+ }
157
+ } else if (this.util.isAnchor(element) && element.getAttribute('data-image-link') === null) {
158
+ if (this.controllerArray.indexOf(this.context.link.linkController) < 0) {
159
+ this.plugins.link.call_controller.call(this, element);
160
+ }
161
+ return true;
162
+ }
163
+
164
+ return false;
165
+ },
166
+
167
+ /**
168
+ * @Override dialog
169
+ */
170
+ on: function (update) {
171
+ this.plugins.anchor.on.call(this, this.context.anchor.caller.link, update);
172
+ },
173
+
174
+ call_controller: function (selectionATag) {
175
+ this.editLink = this.context.link._linkAnchor = this.context.anchor.caller.link.linkAnchor = selectionATag;
176
+ const linkBtn = this.context.link.linkController;
177
+ const link = linkBtn.querySelector('a');
178
+
179
+ link.href = selectionATag.href;
180
+ link.title = selectionATag.textContent;
181
+ link.textContent = selectionATag.textContent;
182
+
183
+ this.util.addClass(selectionATag, 'on');
184
+ this.setControllerPosition(linkBtn, selectionATag, 'bottom', {left: 0, top: 0});
185
+ this.controllersOn(linkBtn, selectionATag, 'link', this.util.removeClass.bind(this.util, this.context.link._linkAnchor, 'on'));
186
+ },
187
+
188
+ onClick_linkController: function (e) {
189
+ e.stopPropagation();
190
+
191
+ const command = e.target.getAttribute('data-command') || e.target.parentNode.getAttribute('data-command');
192
+ if (!command) return;
193
+
194
+ e.preventDefault();
195
+
196
+ if (/update/.test(command)) {
197
+ this.plugins.dialog.open.call(this, 'link', true);
198
+ } else if (/unlink/.test(command)) {
199
+ const sc = this.util.getChildElement(this.context.link._linkAnchor, function (current) { return current.childNodes.length === 0 || current.nodeType === 3; }, false);
200
+ const ec = this.util.getChildElement(this.context.link._linkAnchor, function (current) { return current.childNodes.length === 0 || current.nodeType === 3; }, true);
201
+ this.setRange(sc, 0, ec, ec.textContent.length);
202
+ this.nodeChange(null, null, ['A'], false);
203
+ } else {
204
+ /** delete */
205
+ this.util.removeItem(this.context.link._linkAnchor);
206
+ this.context.anchor.caller.link.linkAnchor = null;
207
+ this.focus();
208
+
209
+ // history stack
210
+ this.history.push(false);
211
+ }
212
+
213
+ this.controllersOff();
214
+ },
215
+
216
+ /**
217
+ * @Override dialog
218
+ */
219
+ init: function () {
220
+ this.context.link.linkController.style.display = 'none';
221
+ this.plugins.anchor.init.call(this, this.context.anchor.caller.link);
222
+ }
223
+ };
@@ -1,5 +1,5 @@
1
- import { DialogPlugin } from '../DialogPlugin';
2
-
3
- declare const math: DialogPlugin;
4
-
1
+ import { DialogPlugin } from '../DialogPlugin';
2
+
3
+ declare const math: DialogPlugin;
4
+
5
5
  export default math;