suneditor 3.0.0-beta.3 → 3.0.0-beta.30

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 (241) hide show
  1. package/CONTRIBUTING.md +8 -8
  2. package/README.md +44 -49
  3. package/dist/suneditor.min.css +1 -1
  4. package/dist/suneditor.min.js +1 -1
  5. package/package.json +95 -53
  6. package/src/assets/design/color.css +2 -2
  7. package/src/assets/design/size.css +2 -0
  8. package/src/assets/icons/defaultIcons.js +16 -1
  9. package/src/assets/suneditor-contents.css +9 -8
  10. package/src/assets/suneditor.css +29 -26
  11. package/src/core/{section → base}/actives.js +20 -12
  12. package/src/core/base/history.js +4 -4
  13. package/src/core/class/char.js +10 -10
  14. package/src/core/class/component.js +146 -57
  15. package/src/core/class/format.js +94 -2458
  16. package/src/core/class/html.js +187 -129
  17. package/src/core/class/inline.js +1853 -0
  18. package/src/core/class/listFormat.js +582 -0
  19. package/src/core/class/menu.js +14 -3
  20. package/src/core/class/nodeTransform.js +9 -14
  21. package/src/core/class/offset.js +162 -197
  22. package/src/core/class/selection.js +137 -34
  23. package/src/core/class/toolbar.js +73 -52
  24. package/src/core/class/ui.js +11 -11
  25. package/src/core/class/viewer.js +56 -55
  26. package/src/core/config/context.js +122 -0
  27. package/src/core/config/frameContext.js +204 -0
  28. package/src/core/config/options.js +639 -0
  29. package/src/core/editor.js +181 -108
  30. package/src/core/event/actions/index.js +229 -0
  31. package/src/core/event/effects/common.registry.js +60 -0
  32. package/src/core/event/effects/keydown.registry.js +551 -0
  33. package/src/core/event/effects/ruleHelpers.js +145 -0
  34. package/src/core/{base → event}/eventManager.js +119 -201
  35. package/src/core/event/executor.js +21 -0
  36. package/src/core/{base/eventHandlers → event/handlers}/handler_toolbar.js +4 -4
  37. package/src/core/{base/eventHandlers → event/handlers}/handler_ww_dragDrop.js +2 -2
  38. package/src/core/event/handlers/handler_ww_input.js +77 -0
  39. package/src/core/event/handlers/handler_ww_key.js +228 -0
  40. package/src/core/{base/eventHandlers → event/handlers}/handler_ww_mouse.js +3 -3
  41. package/src/core/event/ports.js +211 -0
  42. package/src/core/event/reducers/keydown.reducer.js +89 -0
  43. package/src/core/event/rules/keydown.rule.arrow.js +54 -0
  44. package/src/core/event/rules/keydown.rule.backspace.js +202 -0
  45. package/src/core/event/rules/keydown.rule.delete.js +126 -0
  46. package/src/core/event/rules/keydown.rule.enter.js +144 -0
  47. package/src/core/event/rules/keydown.rule.tab.js +29 -0
  48. package/src/core/section/constructor.js +79 -388
  49. package/src/core/section/documentType.js +47 -26
  50. package/src/core/util/instanceCheck.js +59 -0
  51. package/src/editorInjector/_classes.js +4 -0
  52. package/src/editorInjector/_core.js +17 -7
  53. package/src/editorInjector/index.js +10 -2
  54. package/src/events.js +6 -0
  55. package/src/helper/clipboard.js +24 -10
  56. package/src/helper/converter.js +17 -12
  57. package/src/helper/dom/domCheck.js +22 -3
  58. package/src/helper/dom/domQuery.js +91 -45
  59. package/src/helper/dom/domUtils.js +93 -19
  60. package/src/helper/dom/index.js +4 -0
  61. package/src/helper/env.js +11 -7
  62. package/src/helper/keyCodeMap.js +4 -3
  63. package/src/langs/ckb.js +1 -1
  64. package/src/langs/cs.js +1 -1
  65. package/src/langs/da.js +1 -1
  66. package/src/langs/de.js +1 -1
  67. package/src/langs/en.js +1 -1
  68. package/src/langs/es.js +1 -1
  69. package/src/langs/fa.js +1 -1
  70. package/src/langs/fr.js +1 -1
  71. package/src/langs/he.js +1 -1
  72. package/src/langs/hu.js +1 -1
  73. package/src/langs/it.js +1 -1
  74. package/src/langs/ja.js +1 -1
  75. package/src/langs/km.js +1 -1
  76. package/src/langs/ko.js +1 -1
  77. package/src/langs/lv.js +1 -1
  78. package/src/langs/nl.js +1 -1
  79. package/src/langs/pl.js +1 -1
  80. package/src/langs/pt_br.js +10 -10
  81. package/src/langs/ro.js +1 -1
  82. package/src/langs/ru.js +1 -1
  83. package/src/langs/se.js +1 -1
  84. package/src/langs/tr.js +1 -1
  85. package/src/langs/uk.js +1 -1
  86. package/src/langs/ur.js +1 -1
  87. package/src/langs/zh_cn.js +1 -1
  88. package/src/modules/ApiManager.js +25 -18
  89. package/src/modules/Browser.js +52 -61
  90. package/src/modules/ColorPicker.js +37 -38
  91. package/src/modules/Controller.js +85 -79
  92. package/src/modules/Figure.js +275 -187
  93. package/src/modules/FileManager.js +86 -92
  94. package/src/modules/HueSlider.js +67 -35
  95. package/src/modules/Modal.js +84 -77
  96. package/src/modules/ModalAnchorEditor.js +62 -79
  97. package/src/modules/SelectMenu.js +89 -86
  98. package/src/plugins/browser/audioGallery.js +9 -5
  99. package/src/plugins/browser/fileBrowser.js +10 -6
  100. package/src/plugins/browser/fileGallery.js +9 -5
  101. package/src/plugins/browser/imageGallery.js +9 -5
  102. package/src/plugins/browser/videoGallery.js +11 -6
  103. package/src/plugins/command/blockquote.js +1 -0
  104. package/src/plugins/command/exportPDF.js +11 -8
  105. package/src/plugins/command/fileUpload.js +41 -29
  106. package/src/plugins/command/list_bulleted.js +2 -1
  107. package/src/plugins/command/list_numbered.js +2 -1
  108. package/src/plugins/dropdown/align.js +8 -2
  109. package/src/plugins/dropdown/backgroundColor.js +19 -11
  110. package/src/plugins/dropdown/font.js +15 -9
  111. package/src/plugins/dropdown/fontColor.js +19 -11
  112. package/src/plugins/dropdown/formatBlock.js +7 -2
  113. package/src/plugins/dropdown/hr.js +7 -3
  114. package/src/plugins/dropdown/layout.js +6 -2
  115. package/src/plugins/dropdown/lineHeight.js +8 -3
  116. package/src/plugins/dropdown/list.js +2 -1
  117. package/src/plugins/dropdown/paragraphStyle.js +15 -11
  118. package/src/plugins/dropdown/{table.js → table/index.js} +514 -362
  119. package/src/plugins/dropdown/template.js +6 -2
  120. package/src/plugins/dropdown/textStyle.js +7 -3
  121. package/src/plugins/field/mention.js +33 -27
  122. package/src/plugins/input/fontSize.js +44 -37
  123. package/src/plugins/input/pageNavigator.js +3 -2
  124. package/src/plugins/modal/audio.js +90 -85
  125. package/src/plugins/modal/drawing.js +58 -66
  126. package/src/plugins/modal/embed.js +193 -180
  127. package/src/plugins/modal/image.js +441 -439
  128. package/src/plugins/modal/link.js +31 -8
  129. package/src/plugins/modal/math.js +23 -22
  130. package/src/plugins/modal/video.js +233 -230
  131. package/src/plugins/popup/anchor.js +24 -18
  132. package/src/suneditor.js +69 -24
  133. package/src/typedef.js +42 -19
  134. package/types/assets/icons/defaultIcons.d.ts +8 -0
  135. package/types/core/class/char.d.ts +1 -1
  136. package/types/core/class/component.d.ts +29 -7
  137. package/types/core/class/format.d.ts +4 -354
  138. package/types/core/class/html.d.ts +13 -4
  139. package/types/core/class/inline.d.ts +263 -0
  140. package/types/core/class/listFormat.d.ts +135 -0
  141. package/types/core/class/menu.d.ts +10 -2
  142. package/types/core/class/offset.d.ts +24 -26
  143. package/types/core/class/selection.d.ts +2 -0
  144. package/types/core/class/toolbar.d.ts +24 -11
  145. package/types/core/class/ui.d.ts +1 -1
  146. package/types/core/class/viewer.d.ts +1 -1
  147. package/types/core/config/context.d.ts +157 -0
  148. package/types/core/config/frameContext.d.ts +367 -0
  149. package/types/core/config/options.d.ts +1119 -0
  150. package/types/core/editor.d.ts +101 -66
  151. package/types/core/event/actions/index.d.ts +47 -0
  152. package/types/core/event/effects/common.registry.d.ts +50 -0
  153. package/types/core/event/effects/keydown.registry.d.ts +73 -0
  154. package/types/core/event/effects/ruleHelpers.d.ts +31 -0
  155. package/types/core/{base → event}/eventManager.d.ts +15 -46
  156. package/types/core/event/executor.d.ts +6 -0
  157. package/types/core/event/handlers/handler_ww_input.d.ts +41 -0
  158. package/types/core/{base/eventHandlers/handler_ww_key_input.d.ts → event/handlers/handler_ww_key.d.ts} +4 -6
  159. package/types/core/event/ports.d.ts +255 -0
  160. package/types/core/event/reducers/keydown.reducer.d.ts +75 -0
  161. package/types/core/event/rules/keydown.rule.arrow.d.ts +8 -0
  162. package/types/core/event/rules/keydown.rule.backspace.d.ts +9 -0
  163. package/types/core/event/rules/keydown.rule.delete.d.ts +9 -0
  164. package/types/core/event/rules/keydown.rule.enter.d.ts +9 -0
  165. package/types/core/event/rules/keydown.rule.tab.d.ts +9 -0
  166. package/types/core/section/constructor.d.ts +101 -631
  167. package/types/core/section/documentType.d.ts +14 -4
  168. package/types/core/util/instanceCheck.d.ts +50 -0
  169. package/types/editorInjector/_classes.d.ts +4 -0
  170. package/types/editorInjector/_core.d.ts +17 -7
  171. package/types/editorInjector/index.d.ts +10 -2
  172. package/types/events.d.ts +1 -0
  173. package/types/helper/clipboard.d.ts +2 -2
  174. package/types/helper/converter.d.ts +6 -9
  175. package/types/helper/dom/domCheck.d.ts +7 -0
  176. package/types/helper/dom/domQuery.d.ts +19 -8
  177. package/types/helper/dom/domUtils.d.ts +24 -2
  178. package/types/helper/dom/index.d.ts +86 -1
  179. package/types/helper/env.d.ts +6 -1
  180. package/types/helper/index.d.ts +7 -1
  181. package/types/helper/keyCodeMap.d.ts +3 -3
  182. package/types/index.d.ts +23 -117
  183. package/types/langs/index.d.ts +2 -2
  184. package/types/modules/ApiManager.d.ts +1 -8
  185. package/types/modules/Browser.d.ts +4 -62
  186. package/types/modules/ColorPicker.d.ts +4 -21
  187. package/types/modules/Controller.d.ts +8 -64
  188. package/types/modules/Figure.d.ts +54 -50
  189. package/types/modules/FileManager.d.ts +1 -13
  190. package/types/modules/HueSlider.d.ts +13 -3
  191. package/types/modules/Modal.d.ts +0 -43
  192. package/types/modules/ModalAnchorEditor.d.ts +0 -73
  193. package/types/modules/SelectMenu.d.ts +0 -85
  194. package/types/modules/index.d.ts +3 -3
  195. package/types/plugins/browser/audioGallery.d.ts +29 -18
  196. package/types/plugins/browser/fileBrowser.d.ts +38 -27
  197. package/types/plugins/browser/fileGallery.d.ts +29 -18
  198. package/types/plugins/browser/imageGallery.d.ts +24 -16
  199. package/types/plugins/browser/videoGallery.d.ts +29 -18
  200. package/types/plugins/command/blockquote.d.ts +1 -0
  201. package/types/plugins/command/exportPDF.d.ts +18 -18
  202. package/types/plugins/command/fileUpload.d.ts +65 -45
  203. package/types/plugins/command/list_bulleted.d.ts +1 -0
  204. package/types/plugins/command/list_numbered.d.ts +1 -0
  205. package/types/plugins/dropdown/align.d.ts +13 -8
  206. package/types/plugins/dropdown/backgroundColor.d.ts +30 -19
  207. package/types/plugins/dropdown/font.d.ts +13 -12
  208. package/types/plugins/dropdown/fontColor.d.ts +30 -19
  209. package/types/plugins/dropdown/formatBlock.d.ts +13 -8
  210. package/types/plugins/dropdown/hr.d.ts +15 -11
  211. package/types/plugins/dropdown/layout.d.ts +15 -11
  212. package/types/plugins/dropdown/lineHeight.d.ts +16 -11
  213. package/types/plugins/dropdown/list.d.ts +1 -0
  214. package/types/plugins/dropdown/paragraphStyle.d.ts +31 -27
  215. package/types/plugins/dropdown/table/index.d.ts +582 -0
  216. package/types/plugins/dropdown/table.d.ts +41 -86
  217. package/types/plugins/dropdown/template.d.ts +15 -11
  218. package/types/plugins/dropdown/textStyle.d.ts +19 -11
  219. package/types/plugins/field/mention.d.ts +58 -56
  220. package/types/plugins/index.d.ts +38 -38
  221. package/types/plugins/input/fontSize.d.ts +46 -50
  222. package/types/plugins/modal/audio.d.ts +26 -56
  223. package/types/plugins/modal/drawing.d.ts +0 -85
  224. package/types/plugins/modal/embed.d.ts +15 -79
  225. package/types/plugins/modal/image.d.ts +24 -136
  226. package/types/plugins/modal/link.d.ts +34 -15
  227. package/types/plugins/modal/math.d.ts +0 -16
  228. package/types/plugins/modal/video.d.ts +17 -86
  229. package/types/plugins/popup/anchor.d.ts +1 -8
  230. package/types/suneditor.d.ts +70 -19
  231. package/types/typedef.d.ts +60 -46
  232. package/src/core/base/eventHandlers/handler_ww_key_input.js +0 -1200
  233. package/src/core/section/context.js +0 -102
  234. package/types/core/section/context.d.ts +0 -45
  235. package/types/langs/_Lang.d.ts +0 -194
  236. /package/src/core/{base/eventHandlers → event/handlers}/handler_ww_clipboard.js +0 -0
  237. /package/types/core/{section → base}/actives.d.ts +0 -0
  238. /package/types/core/{base/eventHandlers → event/handlers}/handler_toolbar.d.ts +0 -0
  239. /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_clipboard.d.ts +0 -0
  240. /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_dragDrop.d.ts +0 -0
  241. /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_mouse.d.ts +0 -0
@@ -1,12 +1,17 @@
1
1
  import { env, converter, dom, numbers } from '../helper';
2
- import Constructor, { InitOptions, UpdateButton, CreateShortcuts, CreateStatusbar, OPTION_FRAME_FIXED_FLAG, OPTION_FIXED_FLAG } from './section/constructor';
3
- import { UpdateStatusbarContext } from './section/context';
4
- import { BASIC_COMMANDS, ACTIVE_EVENT_COMMANDS, SELECT_ALL, DIR_BTN_ACTIVE, SAVE, COPY_FORMAT, FONT_STYLE, PAGE_BREAK } from './section/actives';
2
+ import Constructor, { InitOptions, UpdateButton, CreateShortcuts, CreateStatusbar } from './section/constructor';
3
+ import { OPTION_FRAME_FIXED_FLAG, OPTION_FIXED_FLAG, BaseOptionsMap, FrameOptionsMap } from './config/options';
4
+ import { ContextUtil } from './config/context';
5
+ import { UpdateStatusbarContext, FrameContextUtil } from './config/frameContext';
6
+ import { BASIC_COMMANDS, ACTIVE_EVENT_COMMANDS, SELECT_ALL, DIR_BTN_ACTIVE, SAVE, COPY_FORMAT, FONT_STYLE, PAGE_BREAK } from './base/actives';
5
7
  import History from './base/history';
6
- import EventManager from './base/eventManager';
8
+ import EventManager from './event/eventManager';
7
9
  import Events from '../events';
8
10
  import DocumentType from './section/documentType';
9
11
 
12
+ // util
13
+ import InstanceCheck from './util/instanceCheck';
14
+
10
15
  // class injector
11
16
  import ClassInjector from '../editorInjector/_classes';
12
17
 
@@ -15,6 +20,8 @@ import Char from './class/char';
15
20
  import Component from './class/component';
16
21
  import Format from './class/format';
17
22
  import HTML from './class/html';
23
+ import Inline from './class/inline';
24
+ import ListFormat from './class/listFormat';
18
25
  import Menu from './class/menu';
19
26
  import NodeTransform from './class/nodeTransform';
20
27
  import Offset from './class/offset';
@@ -28,14 +35,6 @@ const COMMAND_BUTTONS = '.se-menu-list .se-toolbar-btn[data-command]';
28
35
  const DISABLE_BUTTONS_CODEVIEW = `${COMMAND_BUTTONS}:not([class~="se-code-view-enabled"]):not([data-type="MORE"])`;
29
36
  const DISABLE_BUTTONS_CONTROLLER = `${COMMAND_BUTTONS}:not([class~="se-component-enabled"]):not([data-type="MORE"])`;
30
37
 
31
- /**
32
- * @typedef {import('./section/constructor').EditorInitOptions} EditorInitOptions_editor
33
- */
34
-
35
- /**
36
- * @typedef {import('./section/constructor').EditorFrameOptions} EditorFrameOptions_editor
37
- */
38
-
39
38
  /**
40
39
  * @typedef {import('../modules/Controller').ControllerInfo} ControllerInfo_editor
41
40
  */
@@ -43,8 +42,8 @@ const DISABLE_BUTTONS_CONTROLLER = `${COMMAND_BUTTONS}:not([class~="se-component
43
42
  /**
44
43
  * @constructor
45
44
  * @description SunEditor constructor function.
46
- * @param {Array<{target: Element, key: *, options: EditorFrameOptions_editor}>} multiTargets Target element
47
- * @param {EditorInitOptions_editor} options options
45
+ * @param {Array<{target: Element, key: *, options: __se__EditorFrameOptions}>} multiTargets Target element
46
+ * @param {__se__EditorOptions} options options
48
47
  */
49
48
  function Editor(multiTargets, options) {
50
49
  const _d = multiTargets[0].target.ownerDocument || env._d;
@@ -63,47 +62,75 @@ function Editor(multiTargets, options) {
63
62
  */
64
63
  this.frameRoots = product.frameRoots;
65
64
 
65
+ /**
66
+ * @description Document object
67
+ * @type {Document}
68
+ */
69
+ this._d = _d;
70
+
71
+ /**
72
+ * @description Window object
73
+ * @type {Window}
74
+ */
75
+ this._w = _w;
76
+
77
+ /**
78
+ * @description Controllers carrier
79
+ * @type {HTMLElement}
80
+ */
81
+ this.carrierWrapper = product.carrierWrapper;
82
+
66
83
  /**
67
84
  * @description Editor context object
68
85
  * @type {__se__Context}
69
86
  */
70
- this.context = product.context;
87
+ this.__context = product.context;
71
88
 
72
89
  /**
73
- * @description Current focusing frame context
74
- * @type {__se__FrameContext}
90
+ * @description Utility object that manages the editor's runtime context.
91
+ * Provides methods to get, set, and inspect internal context.
92
+ * @type {ContextUtil}
75
93
  */
76
- this.frameContext = new Map();
94
+ this.context = ContextUtil(this);
77
95
 
78
96
  /**
79
- * @description Current focusing frame context options
80
- * @type {__se__FrameOptions}
97
+ * @description Current focusing [frame] context
98
+ * @type {import('./config/frameContext').FrameContextMap}
81
99
  */
82
- this.frameOptions = new Map();
100
+ this.__frameContext = new Map();
83
101
 
84
102
  /**
85
- * @description Document object
86
- * @type {Document}
103
+ * @description Utility object that manages the editor's runtime [frame] context.
104
+ * Provides methods to get, set, and inspect internal context.
105
+ * @type {FrameContextUtil}
87
106
  */
88
- this._d = _d;
107
+ this.frameContext = FrameContextUtil(this);
89
108
 
90
109
  /**
91
- * @description Window object
92
- * @type {Window}
110
+ * @description Current focusing [frame] context options
111
+ * @type {__se__FrameOptions}
93
112
  */
94
- this._w = _w;
113
+ this.__frameOptions = new Map();
95
114
 
96
115
  /**
97
- * @description Controllers carrier
98
- * @type {HTMLElement}
116
+ * @description Utility object that manages the editor's runtime [frame] options.
117
+ * Provides methods to get, set, and inspect internal [frame] options.
118
+ * @type {FrameOptionsMap}
99
119
  */
100
- this.carrierWrapper = product.carrierWrapper;
120
+ this.frameOptions = FrameOptionsMap(this);
101
121
 
102
122
  /**
103
- * @description Editor options
123
+ * @description Editor row options
104
124
  * @type {Map<string, *>}
105
125
  */
106
- this.options = product.options;
126
+ this.__options = product.options;
127
+
128
+ /**
129
+ * @description Utility object that manages the editor's runtime options.
130
+ * Provides methods to get, set, and inspect internal editor options.
131
+ * @type {BaseOptionsMap}
132
+ */
133
+ this.options = BaseOptionsMap(this);
107
134
 
108
135
  /**
109
136
  * @description Plugins
@@ -146,6 +173,8 @@ function Editor(multiTargets, options) {
146
173
  codeIndentSize: 2,
147
174
  currentNodes: [],
148
175
  currentNodesMap: [],
176
+ initViewportHeight: 0,
177
+ currentViewportHeight: 0,
149
178
  onSelected: false,
150
179
  rootKey: product.rootId,
151
180
  _range: null,
@@ -209,9 +238,9 @@ function Editor(multiTargets, options) {
209
238
  /**
210
239
  * @description Shoutcuts reverse key array
211
240
  * - An array of key codes generated with the reverseButtons option, used to reverse the action for a specific key combination.
212
- * @type {Array<string>}
241
+ * @type {Set<string>}
213
242
  */
214
- this.reverseKeys = [];
243
+ this.reverseKeys = new Set();
215
244
 
216
245
  /**
217
246
  * @description A map with the plugin's buttons having an "active" method and the default command buttons with an "active" action.
@@ -265,9 +294,13 @@ function Editor(multiTargets, options) {
265
294
  // ------ base ------
266
295
  /** @description History class instance @type {ReturnType<typeof import('./base/history').default>} */
267
296
  this.history = null;
268
- /** @description EventManager class instance @type {import('./base/eventManager').default} */
297
+ /** @description EventManager class instance @type {import('./event/eventManager').default} */
269
298
  this.eventManager = null;
270
299
 
300
+ // ----- util -----
301
+ /** @description iframe-safe instanceof check utility class @type {import('./util/instanceCheck').default} */
302
+ this.instanceCheck = null;
303
+
271
304
  // ------ class ------
272
305
  /** @description Toolbar class instance @type {import('./class/toolbar').default} */
273
306
  this.toolbar = null;
@@ -281,6 +314,10 @@ function Editor(multiTargets, options) {
281
314
  this.format = null;
282
315
  /** @description HTML class instance @type {import('./class/html').default} */
283
316
  this.html = null;
317
+ /** @description Inline format class instance @type {import('./class/inline').default} */
318
+ this.inline = null;
319
+ /** @description List format class instance @type {import('./class/listFormat').default} */
320
+ this.listFormat = null;
284
321
  /** @description Menu class instance @type {import('./class/menu').default} */
285
322
  this.menu = null;
286
323
  /** @description NodeTransform class instance @type {import('./class/nodeTransform').default} */
@@ -311,7 +348,7 @@ function Editor(multiTargets, options) {
311
348
 
312
349
  /**
313
350
  * @description Closest ShadowRoot to editor if found
314
- * @type {ShadowRoot}
351
+ * @type {ShadowRoot & { getSelection?: () => Selection }} - Chromium-based browsers (Chrome, Edge, etc.) has a getSelection method on the ShadowRoot
315
352
  */
316
353
  this._shadowRoot = null;
317
354
 
@@ -354,13 +391,13 @@ function Editor(multiTargets, options) {
354
391
 
355
392
  /**
356
393
  * @description List of buttons to run plugins in the toolbar
357
- * @type {Array<HTMLElement>}
394
+ * @type {Object<string, Array<HTMLElement>>}
358
395
  */
359
396
  this._pluginCallButtons = product.pluginCallButtons;
360
397
 
361
398
  /**
362
399
  * @description List of buttons to run plugins in the Sub-Toolbar
363
- * @type {Array<HTMLElement>}
400
+ * @type {Object<string, Array<HTMLElement>>|[]}
364
401
  */
365
402
  this._pluginCallButtons_sub = product.pluginCallButtons_sub;
366
403
 
@@ -413,7 +450,7 @@ function Editor(multiTargets, options) {
413
450
 
414
451
  /**
415
452
  * @description plugin retainFormat info Map()
416
- * @type {Map<string, ((...args: *) => *)>}
453
+ * @type {Map<string, { key: string, method: (...args: *) => * }>}
417
454
  */
418
455
  this._MELInfo = null;
419
456
 
@@ -454,7 +491,7 @@ function Editor(multiTargets, options) {
454
491
 
455
492
  /**
456
493
  * @description Origin options
457
- * @type {EditorInitOptions_editor}
494
+ * @type {__se__EditorOptions}
458
495
  */
459
496
  this._originOptions = options;
460
497
 
@@ -577,6 +614,10 @@ Editor.prototype = {
577
614
  this.html.set(`<${this.options.get('defaultLine')}><br></${this.options.get('defaultLine')}>`);
578
615
  this.focus();
579
616
  this.history.push(false);
617
+ // document type
618
+ if (this.frameContext.has('documentType_use_header')) {
619
+ this.frameContext.get('documentType').reHeader();
620
+ }
580
621
  break;
581
622
  case 'codeView':
582
623
  this.viewer.codeView(!this.frameContext.get('isCodeView'));
@@ -597,7 +638,7 @@ Editor.prototype = {
597
638
  this.history.redo();
598
639
  break;
599
640
  case 'removeFormat':
600
- this.format.removeInlineElement();
641
+ this.inline.remove();
601
642
  this.focus();
602
643
  break;
603
644
  case 'print':
@@ -684,8 +725,7 @@ Editor.prototype = {
684
725
  * @returns {boolean}
685
726
  */
686
727
  isEmpty(fc) {
687
- fc = fc || this.frameContext;
688
- const wysiwyg = fc.get('wysiwyg');
728
+ const wysiwyg = (fc || this.frameContext).get('wysiwyg');
689
729
  return dom.check.isZeroWidth(wysiwyg.textContent) && !wysiwyg.querySelector(this.options.get('allowedEmptyTags')) && (wysiwyg.innerText.match(/\n/g) || '').length <= 1;
690
730
  },
691
731
 
@@ -707,8 +747,8 @@ Editor.prototype = {
707
747
  if (typeof plugins[k].setDir === 'function') plugins[k].setDir(dir);
708
748
  }
709
749
 
710
- const toolbarWrapper = this.context.get('toolbar._wrapper');
711
- const statusbarWrapper = this.context.get('statusbar._wrapper');
750
+ const toolbarWrapper = this.context.get('toolbar_wrapper');
751
+ const statusbarWrapper = this.context.get('statusbar_wrapper');
712
752
  if (rtl) {
713
753
  this.applyFrameRoots((e) => {
714
754
  dom.utils.addClass([e.get('topArea'), e.get('wysiwyg'), e.get('documentTypePageMirror')], 'se-rtl');
@@ -721,9 +761,13 @@ Editor.prototype = {
721
761
  dom.utils.removeClass([this.carrierWrapper, toolbarWrapper, statusbarWrapper], 'se-rtl');
722
762
  }
723
763
 
724
- const lineNodes = dom.query.getListChildren(fc.get('wysiwyg'), (current) => {
725
- return this.format.isLine(current) && !!(current.style.marginRight || current.style.marginLeft || current.style.textAlign);
726
- });
764
+ const lineNodes = dom.query.getListChildren(
765
+ fc.get('wysiwyg'),
766
+ (current) => {
767
+ return this.format.isLine(current) && !!(current.style.marginRight || current.style.marginLeft || current.style.textAlign);
768
+ },
769
+ null
770
+ );
727
771
 
728
772
  for (let i = 0, n, l, r; (n = lineNodes[i]); i++) {
729
773
  n = lineNodes[i];
@@ -743,11 +787,11 @@ Editor.prototype = {
743
787
  DIR_BTN_ACTIVE(this, rtl);
744
788
 
745
789
  // document type
746
- if (fc.has('documentType-use-header')) {
790
+ if (fc.has('documentType_use_header')) {
747
791
  if (rtl) fc.get('wrapper').appendChild(fc.get('documentTypeInner'));
748
792
  else fc.get('wrapper').insertBefore(fc.get('documentTypeInner'), fc.get('wysiwygFrame'));
749
793
  }
750
- if (fc.has('documentType-use-page')) {
794
+ if (fc.has('documentType_use_page')) {
751
795
  if (rtl) fc.get('wrapper').insertBefore(fc.get('documentTypePage'), fc.get('wysiwygFrame'));
752
796
  else fc.get('wrapper').appendChild(fc.get('documentTypePage'));
753
797
  }
@@ -765,7 +809,7 @@ Editor.prototype = {
765
809
 
766
810
  /**
767
811
  * @description Add or reset option property (Editor is reloaded)
768
- * @param {EditorInitOptions_editor} newOptions Options
812
+ * @param {__se__EditorOptions} newOptions Options
769
813
  */
770
814
  resetOptions(newOptions) {
771
815
  this.viewer.codeView(false);
@@ -815,7 +859,7 @@ Editor.prototype = {
815
859
  const newFrameMap = newO.frameMap;
816
860
  /** --------- [root start] --------- */
817
861
  for (let i = 0, len = newOptionKeys.length, k; i < len; i++) {
818
- k = newOptionKeys[i] || null;
862
+ k = /** @type {keyof import('./config/options').AllBaseOptions} */ (newOptionKeys[i] || null);
819
863
 
820
864
  if (newRootKeys.has(k)) {
821
865
  const diff = rootDiff.get(k);
@@ -922,7 +966,7 @@ Editor.prototype = {
922
966
  this._originOptions = _originOptions;
923
967
 
924
968
  // --- [toolbar] ---
925
- const toolbar = this.context.get('toolbar.main');
969
+ const toolbar = this.context.get('toolbar_main');
926
970
  // width
927
971
  if (/inline|balloon/i.test(options.get('mode')) && newOptionKeys.includes('toolbar_width')) {
928
972
  toolbar.style.width = options.get('toolbar_width');
@@ -1008,7 +1052,7 @@ Editor.prototype = {
1008
1052
  */
1009
1053
  focusEdge(focusEl) {
1010
1054
  this._preventBlur = false;
1011
- if (!focusEl) focusEl = this.frameContext.get('wysiwyg').lastElementChild;
1055
+ focusEl ||= this.frameContext.get('wysiwyg').lastElementChild;
1012
1056
 
1013
1057
  const fileComponentInfo = this.component.get(focusEl);
1014
1058
  if (fileComponentInfo) {
@@ -1058,9 +1102,9 @@ Editor.prototype = {
1058
1102
 
1059
1103
  /** remove element */
1060
1104
  dom.utils.removeItem(this.carrierWrapper);
1061
- dom.utils.removeItem(this.context.get('toolbar._wrapper'));
1062
- dom.utils.removeItem(this.context.get('toolbar.sub._wrapper'));
1063
- dom.utils.removeItem(this.context.get('statusbar._wrapper'));
1105
+ dom.utils.removeItem(this.context.get('toolbar_wrapper'));
1106
+ dom.utils.removeItem(this.context.get('toolbar_sub_wrapper'));
1107
+ dom.utils.removeItem(this.context.get('statusbar_wrapper'));
1064
1108
  this.applyFrameRoots((e) => {
1065
1109
  dom.utils.removeItem(e.get('topArea'));
1066
1110
  e.get('options').clear();
@@ -1085,7 +1129,7 @@ Editor.prototype = {
1085
1129
  delete obj[k];
1086
1130
  }
1087
1131
 
1088
- obj = ['eventManager', 'char', 'component', 'format', 'html', 'menu', 'nodeTransform', 'offset', 'selection', 'shortcuts', 'toolbar', 'ui', 'viewer'];
1132
+ obj = ['eventManager', 'instanceCheck', 'char', 'component', 'format', 'html', 'inline', 'listFormat', 'menu', 'nodeTransform', 'offset', 'selection', 'shortcuts', 'toolbar', 'ui', 'viewer'];
1089
1133
  for (let i = 0, len = obj.length, c; i < len; i++) {
1090
1134
  c = this[obj[i]];
1091
1135
  for (const k in c) {
@@ -1114,8 +1158,8 @@ Editor.prototype = {
1114
1158
  * @param {__se__FrameContext} rt Root target[key] FrameContext
1115
1159
  */
1116
1160
  _setFrameInfo(rt) {
1117
- this.frameContext = rt;
1118
- this.frameOptions = rt.get('options');
1161
+ this.frameContext.reset(rt);
1162
+ this.frameOptions.reset(rt.get('options'));
1119
1163
  rt.set('_editorHeight', rt.get('wysiwygFrame').offsetHeight);
1120
1164
  this._lineBreaker_t = rt.get('lineBreaker_t');
1121
1165
  this._lineBreaker_b = rt.get('lineBreaker_b');
@@ -1174,10 +1218,10 @@ Editor.prototype = {
1174
1218
  if (this.options.get('type') === 'document') {
1175
1219
  e.set('documentType', new DocumentType(this, e));
1176
1220
  if (e.get('documentType').useHeader) {
1177
- e.set('documentType-use-header', true);
1221
+ e.set('documentType_use_header', true);
1178
1222
  }
1179
1223
  if (e.get('documentType').usePage) {
1180
- e.set('documentType-use-page', true);
1224
+ e.set('documentType_use_page', true);
1181
1225
  e.get('documentTypePageMirror').innerHTML = e.get('wysiwyg').innerHTML;
1182
1226
  }
1183
1227
  }
@@ -1191,15 +1235,17 @@ Editor.prototype = {
1191
1235
  _resourcesStateChange(fc) {
1192
1236
  this._iframeAutoHeight(fc);
1193
1237
  this._checkPlaceholder(fc);
1194
- if (this.options.get('type') === 'document' && fc.get('documentType').usePage) {
1238
+ // document type page
1239
+ if (fc.has('documentType_use_page')) {
1195
1240
  fc.get('documentTypePageMirror').innerHTML = fc.get('wysiwyg').innerHTML;
1241
+ fc.get('documentType').rePage(true);
1196
1242
  }
1197
1243
  },
1198
1244
 
1199
1245
  /**
1200
1246
  * @private
1201
1247
  * @description Modify the height value of the iframe when the height of the iframe is automatic.
1202
- * @param {__se__FrameContext} fc - Frame context object
1248
+ * @param {__se__FrameContext|FrameContextUtil} fc - Frame context object
1203
1249
  */
1204
1250
  _iframeAutoHeight(fc) {
1205
1251
  const autoFrame = fc.get('_iframeAuto');
@@ -1218,7 +1264,7 @@ Editor.prototype = {
1218
1264
  /**
1219
1265
  * @private
1220
1266
  * @description Call the "onResizeEditor" event
1221
- * @param {__se__FrameContext} fc - Frame context object
1267
+ * @param {__se__FrameContext|FrameContextUtil} fc - Frame context object
1222
1268
  * @param {number} h - Height value
1223
1269
  * @param {ResizeObserverEntry} resizeObserverEntry - ResizeObserverEntry object
1224
1270
  */
@@ -1235,7 +1281,7 @@ Editor.prototype = {
1235
1281
  }
1236
1282
 
1237
1283
  // document type page
1238
- if (fc.has('documentType-use-page')) {
1284
+ if (fc.has('documentType_use_page')) {
1239
1285
  fc.get('documentType').resizePage();
1240
1286
  }
1241
1287
  },
@@ -1246,7 +1292,7 @@ Editor.prototype = {
1246
1292
  * @param {?__se__FrameContext=} fc - Frame context object, If null fc is this.frameContext
1247
1293
  */
1248
1294
  _checkPlaceholder(fc) {
1249
- fc = fc || this.frameContext;
1295
+ fc ||= /** @type {__se__FrameContext} */ (this.frameContext);
1250
1296
  const placeholder = fc.get('placeholder');
1251
1297
 
1252
1298
  if (placeholder) {
@@ -1266,9 +1312,12 @@ Editor.prototype = {
1266
1312
  /**
1267
1313
  * @private
1268
1314
  * @description Initializ editor
1269
- * @param {EditorInitOptions_editor} options Options
1315
+ * @param {__se__EditorOptions} options Options
1270
1316
  */
1271
1317
  __editorInit(options) {
1318
+ this.status.initViewportHeight = this._w.visualViewport.height;
1319
+ this.eventManager.__setViewportSize();
1320
+
1272
1321
  this.applyFrameRoots((e) => {
1273
1322
  this.__setEditorParams(e);
1274
1323
  });
@@ -1283,6 +1332,9 @@ Editor.prototype = {
1283
1332
  this.applyFrameRoots((e) => {
1284
1333
  this.eventManager._addFrameEvents(e);
1285
1334
  this._initWysiwygArea(e, e.get('options').get('value'));
1335
+ if (e.get('options').get('iframe') && e.get('options').get('height') === 'auto') {
1336
+ this.__callResizeFunction(e, e.get('wysiwygFrame').offsetHeight, null);
1337
+ }
1286
1338
  });
1287
1339
 
1288
1340
  this.eventManager.__eventDoc = null;
@@ -1290,29 +1342,37 @@ Editor.prototype = {
1290
1342
  this._componentsInfoReset = false;
1291
1343
  this._checkComponents(true);
1292
1344
 
1293
- this._w.setTimeout(() => {
1294
- // toolbar visibility
1295
- this.context.get('toolbar.main').style.visibility = '';
1296
- // roots
1297
- this.applyFrameRoots((e) => {
1298
- if (typeof this._resourcesStateChange !== 'function') return;
1299
- // observer
1300
- if (this.eventManager._wwFrameObserver) this.eventManager._wwFrameObserver.observe(e.get('wysiwygFrame'));
1301
- if (this.eventManager._toolbarObserver) this.eventManager._toolbarObserver.observe(e.get('_toolbarShadow'));
1302
- // resource state
1303
- this._resourcesStateChange(e);
1304
- });
1305
- // history reset
1306
- this.history.reset();
1307
- // user event
1308
- this.triggerEvent('onload', {});
1309
- }, 0);
1345
+ this._w.setTimeout(
1346
+ function () {
1347
+ // Check if instance was destroyed (e.g., in SSR with dynamic imports mistake)
1348
+ if (!this.context) {
1349
+ console.warn('[SUNEDITOR:E_INIT_FAIL] Editor instance was destroyed before initialization completed. Check if destroy() was called.');
1350
+ return;
1351
+ }
1352
+
1353
+ // toolbar visibility
1354
+ this.context.get('toolbar_main').style.visibility = '';
1355
+ // roots
1356
+ this.applyFrameRoots((e) => {
1357
+ // observer
1358
+ if (this.eventManager._wwFrameObserver) this.eventManager._wwFrameObserver.observe(e.get('wysiwygFrame'));
1359
+ if (this.eventManager._toolbarObserver) this.eventManager._toolbarObserver.observe(e.get('_toolbarShadow'));
1360
+ // resource state
1361
+ this._resourcesStateChange(e);
1362
+ });
1363
+ // history reset
1364
+ this.history.reset();
1365
+ // user event
1366
+ this.triggerEvent('onload', {});
1367
+ }.bind(this),
1368
+ 0
1369
+ );
1310
1370
  },
1311
1371
 
1312
1372
  /**
1313
1373
  * @private
1314
1374
  * @description Initializ core variable
1315
- * @param {EditorInitOptions_editor} options Options
1375
+ * @param {__se__EditorOptions} options Options
1316
1376
  */
1317
1377
  __init(options) {
1318
1378
  // file components
@@ -1331,6 +1391,7 @@ Editor.prototype = {
1331
1391
  ['onMouseUp', []],
1332
1392
  ['onScroll', []],
1333
1393
  ['onClick', []],
1394
+ ['onBeforeInput', []],
1334
1395
  ['onInput', []],
1335
1396
  ['onKeyDown', []],
1336
1397
  ['onKeyUp', []],
@@ -1397,7 +1458,7 @@ Editor.prototype = {
1397
1458
  // plugin maintain
1398
1459
  if (plugin.retainFormat) {
1399
1460
  const info = plugin.retainFormat();
1400
- this._MELInfo.set(info.query, info.method);
1461
+ this._MELInfo.set(info.query, { key: plugin.constructor.key, method: info.method });
1401
1462
  }
1402
1463
  }
1403
1464
 
@@ -1425,20 +1486,24 @@ Editor.prototype = {
1425
1486
  delete this._pluginCallButtons;
1426
1487
  delete this._pluginCallButtons_sub;
1427
1488
 
1428
- this.__cachingButtons();
1489
+ this.__cachingButtons('all');
1429
1490
  this.__cachingShortcuts();
1430
1491
  },
1431
1492
 
1432
1493
  /**
1433
1494
  * @private
1434
1495
  * @description Caching basic buttons to use
1496
+ * @param {string} mode 'all' | 'main' | 'sub'
1435
1497
  */
1436
- __cachingButtons() {
1498
+ __cachingButtons(mode) {
1437
1499
  const ctx = this.context;
1438
1500
  this.__setDisabledButtons();
1439
- this.__saveCommandButtons(this.allCommandButtons, ctx.get('toolbar.buttonTray'));
1440
- if (this.options.has('_subMode')) {
1441
- this.__saveCommandButtons(this.subAllCommandButtons, ctx.get('toolbar.sub.buttonTray'));
1501
+
1502
+ if (/all|main/.test(mode)) {
1503
+ this.__saveCommandButtons(this.allCommandButtons, ctx.get('toolbar_buttonTray'));
1504
+ }
1505
+ if (/all|sub/.test(mode) && this.options.has('_subMode')) {
1506
+ this.__saveCommandButtons(this.subAllCommandButtons, ctx.get('toolbar_sub_buttonTray'));
1442
1507
  }
1443
1508
  },
1444
1509
 
@@ -1450,12 +1515,12 @@ Editor.prototype = {
1450
1515
  __setDisabledButtons() {
1451
1516
  const ctx = this.context;
1452
1517
 
1453
- this._codeViewDisabledButtons = converter.nodeListToArray(ctx.get('toolbar.buttonTray').querySelectorAll(DISABLE_BUTTONS_CODEVIEW));
1454
- this._controllerOnDisabledButtons = converter.nodeListToArray(ctx.get('toolbar.buttonTray').querySelectorAll(DISABLE_BUTTONS_CONTROLLER));
1518
+ this._codeViewDisabledButtons = converter.nodeListToArray(ctx.get('toolbar_buttonTray').querySelectorAll(DISABLE_BUTTONS_CODEVIEW));
1519
+ this._controllerOnDisabledButtons = converter.nodeListToArray(ctx.get('toolbar_buttonTray').querySelectorAll(DISABLE_BUTTONS_CONTROLLER));
1455
1520
 
1456
1521
  if (this.options.has('_subMode')) {
1457
- this._codeViewDisabledButtons = this._codeViewDisabledButtons.concat(converter.nodeListToArray(ctx.get('toolbar.sub.buttonTray').querySelectorAll(DISABLE_BUTTONS_CODEVIEW)));
1458
- this._controllerOnDisabledButtons = this._controllerOnDisabledButtons.concat(converter.nodeListToArray(ctx.get('toolbar.sub.buttonTray').querySelectorAll(DISABLE_BUTTONS_CONTROLLER)));
1522
+ this._codeViewDisabledButtons = this._codeViewDisabledButtons.concat(converter.nodeListToArray(ctx.get('toolbar_sub_buttonTray').querySelectorAll(DISABLE_BUTTONS_CODEVIEW)));
1523
+ this._controllerOnDisabledButtons = this._controllerOnDisabledButtons.concat(converter.nodeListToArray(ctx.get('toolbar_sub_buttonTray').querySelectorAll(DISABLE_BUTTONS_CONTROLLER)));
1459
1524
  }
1460
1525
  },
1461
1526
 
@@ -1559,12 +1624,6 @@ Editor.prototype = {
1559
1624
  }
1560
1625
  }
1561
1626
 
1562
- // wisywig attributes
1563
- const attr = frameOptions.get('editableFrameAttributes');
1564
- for (const k in attr) {
1565
- e.get('wysiwyg').setAttribute(k, attr[k]);
1566
- }
1567
-
1568
1627
  // init, validate
1569
1628
  if (frameOptions.get('iframe')) {
1570
1629
  e.set('_ww', e.get('wysiwygFrame').contentWindow);
@@ -1577,6 +1636,12 @@ Editor.prototype = {
1577
1636
  e.set('_ww', _w);
1578
1637
  e.set('_wd', this._d);
1579
1638
  }
1639
+
1640
+ // wisywig attributes
1641
+ const attr = frameOptions.get('editableFrameAttributes');
1642
+ for (const k in attr) {
1643
+ e.get('wysiwyg').setAttribute(k, attr[k]);
1644
+ }
1580
1645
  },
1581
1646
 
1582
1647
  /**
@@ -1588,7 +1653,7 @@ Editor.prototype = {
1588
1653
  this.events = { ...Events, ...this.options.get('events') };
1589
1654
  this.triggerEvent = async (eventName, eventData) => {
1590
1655
  // [iframe] wysiwyg is disabled, the event is not called.
1591
- if (eventData?.frameContext?.get('wysiwyg').getAttribute('contenteditable') === 'false') return false;
1656
+ if (dom.check.isNonEditable(eventData?.frameContext?.get('wysiwyg'))) return false;
1592
1657
  const eventHandler = this.events[eventName];
1593
1658
  if (typeof eventHandler === 'function') {
1594
1659
  return await eventHandler({ editor: this, ...eventData });
@@ -1602,14 +1667,16 @@ Editor.prototype = {
1602
1667
  // eventManager
1603
1668
  this.eventManager = new EventManager(this);
1604
1669
 
1605
- // util classes
1670
+ // util
1671
+ this.instanceCheck = new InstanceCheck(this);
1672
+
1673
+ // main classes
1606
1674
  this.offset = new Offset(this);
1607
1675
  this.shortcuts = new Shortcuts(this);
1608
- // main classes
1609
1676
  this.toolbar = new Toolbar(this, { keyName: 'toolbar', balloon: this.isBalloon, balloonAlways: this.isBalloonAlways, inline: this.isInline, res: this._responsiveButtons });
1610
1677
  if (this.options.has('_subMode')) {
1611
1678
  this.subToolbar = new Toolbar(this, {
1612
- keyName: 'toolbar.sub',
1679
+ keyName: 'toolbar_sub',
1613
1680
  balloon: this.isSubBalloon,
1614
1681
  balloonAlways: this.isSubBalloonAlways,
1615
1682
  inline: false,
@@ -1621,6 +1688,8 @@ Editor.prototype = {
1621
1688
  this.nodeTransform = new NodeTransform(this);
1622
1689
  this.component = new Component(this);
1623
1690
  this.format = new Format(this);
1691
+ this.inline = new Inline(this);
1692
+ this.listFormat = new ListFormat(this);
1624
1693
  this.menu = new Menu(this);
1625
1694
  this.char = new Char(this);
1626
1695
  this.ui = new UI(this);
@@ -1633,6 +1702,8 @@ Editor.prototype = {
1633
1702
  ClassInjector.call(this.component, this);
1634
1703
  ClassInjector.call(this.format, this);
1635
1704
  ClassInjector.call(this.html, this);
1705
+ ClassInjector.call(this.inline, this);
1706
+ ClassInjector.call(this.listFormat, this);
1636
1707
  ClassInjector.call(this.menu, this);
1637
1708
  ClassInjector.call(this.nodeTransform, this);
1638
1709
  ClassInjector.call(this.offset, this);
@@ -1649,6 +1720,8 @@ Editor.prototype = {
1649
1720
  delete this.component['component'];
1650
1721
  delete this.format['format'];
1651
1722
  delete this.html['html'];
1723
+ delete this.inline['inline'];
1724
+ delete this.listFormat['listFormat'];
1652
1725
  delete this.menu['menu'];
1653
1726
  delete this.nodeTransform['nodeTransform'];
1654
1727
  delete this.offset['offset'];
@@ -1665,7 +1738,7 @@ Editor.prototype = {
1665
1738
  /**
1666
1739
  * @private
1667
1740
  * @description Creates the editor instance and initializes components.
1668
- * @param {EditorInitOptions_editor} originOptions - The initial editor options.
1741
+ * @param {__se__EditorOptions} originOptions - The initial editor options.
1669
1742
  * @returns {Promise<void>}
1670
1743
  */
1671
1744
  async __Create(originOptions) {
@@ -1696,7 +1769,7 @@ Editor.prototype = {
1696
1769
  if (e.get('options').get('iframe')) {
1697
1770
  const iframeLoaded = new Promise((resolve) => {
1698
1771
  this.eventManager.addEvent(e.get('wysiwygFrame'), 'load', ({ target }) => {
1699
- this.__setIframeDocument(target, this.options, e.get('options'));
1772
+ this.__setIframeDocument(target, this.__options, e.get('options'));
1700
1773
  resolve();
1701
1774
  });
1702
1775
  });