suneditor 3.0.0-beta.9 → 3.0.0-rc.2

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 (380) hide show
  1. package/README.md +65 -57
  2. package/dist/suneditor-contents.min.css +1 -0
  3. package/dist/suneditor.min.css +1 -1
  4. package/dist/suneditor.min.js +1 -1
  5. package/package.json +110 -61
  6. package/src/assets/design/color.css +36 -17
  7. package/src/assets/design/size.css +2 -0
  8. package/src/assets/icons/defaultIcons.js +17 -2
  9. package/src/assets/suneditor-contents.css +51 -16
  10. package/src/assets/suneditor.css +116 -43
  11. package/src/core/config/contextProvider.js +288 -0
  12. package/src/core/config/eventManager.js +188 -0
  13. package/src/core/config/instanceCheck.js +59 -0
  14. package/src/core/config/optionProvider.js +452 -0
  15. package/src/core/editor.js +166 -1637
  16. package/src/core/event/actions/index.js +229 -0
  17. package/src/core/event/effects/common.registry.js +74 -0
  18. package/src/core/event/effects/keydown.registry.js +573 -0
  19. package/src/core/event/effects/ruleHelpers.js +148 -0
  20. package/src/core/event/eventOrchestrator.js +944 -0
  21. package/src/core/event/executor.js +27 -0
  22. package/src/core/{base/eventHandlers → event/handlers}/handler_toolbar.js +27 -28
  23. package/src/core/{base/eventHandlers → event/handlers}/handler_ww_clipboard.js +10 -8
  24. package/src/core/{base/eventHandlers → event/handlers}/handler_ww_dragDrop.js +22 -23
  25. package/src/core/event/handlers/handler_ww_input.js +75 -0
  26. package/src/core/event/handlers/handler_ww_key.js +228 -0
  27. package/src/core/event/handlers/handler_ww_mouse.js +166 -0
  28. package/src/core/event/ports.js +211 -0
  29. package/src/core/event/reducers/keydown.reducer.js +97 -0
  30. package/src/core/event/rules/keydown.rule.arrow.js +63 -0
  31. package/src/core/event/rules/keydown.rule.backspace.js +208 -0
  32. package/src/core/event/rules/keydown.rule.delete.js +132 -0
  33. package/src/core/event/rules/keydown.rule.enter.js +150 -0
  34. package/src/core/event/rules/keydown.rule.tab.js +35 -0
  35. package/src/core/event/support/defaultLineManager.js +136 -0
  36. package/src/core/event/support/selectionState.js +204 -0
  37. package/src/core/kernel/coreKernel.js +320 -0
  38. package/src/core/kernel/kernelInjector.js +19 -0
  39. package/src/core/kernel/store.js +173 -0
  40. package/src/core/{class → logic/dom}/char.js +42 -45
  41. package/src/core/logic/dom/format.js +1075 -0
  42. package/src/core/{class → logic/dom}/html.js +743 -624
  43. package/src/core/logic/dom/inline.js +1847 -0
  44. package/src/core/logic/dom/listFormat.js +601 -0
  45. package/src/core/{class → logic/dom}/nodeTransform.js +92 -72
  46. package/src/core/{class → logic/dom}/offset.js +254 -317
  47. package/src/core/logic/dom/selection.js +754 -0
  48. package/src/core/logic/panel/menu.js +389 -0
  49. package/src/core/logic/panel/toolbar.js +449 -0
  50. package/src/core/logic/panel/viewer.js +761 -0
  51. package/src/core/logic/shell/_commandExecutor.js +380 -0
  52. package/src/core/logic/shell/commandDispatcher.js +241 -0
  53. package/src/core/logic/shell/component.js +970 -0
  54. package/src/core/logic/shell/focusManager.js +110 -0
  55. package/src/core/{base → logic/shell}/history.js +110 -60
  56. package/src/core/logic/shell/pluginManager.js +363 -0
  57. package/src/core/logic/shell/shortcuts.js +130 -0
  58. package/src/core/logic/shell/ui.js +904 -0
  59. package/src/core/schema/context.js +66 -0
  60. package/src/core/schema/frameContext.js +160 -0
  61. package/src/core/schema/options.js +628 -0
  62. package/src/core/section/constructor.js +194 -500
  63. package/src/core/section/documentType.js +297 -222
  64. package/src/events.js +808 -543
  65. package/src/helper/clipboard.js +27 -16
  66. package/src/helper/converter.js +100 -78
  67. package/src/helper/dom/domCheck.js +56 -30
  68. package/src/helper/dom/domQuery.js +159 -89
  69. package/src/helper/dom/domUtils.js +114 -49
  70. package/src/helper/dom/index.js +5 -1
  71. package/src/helper/env.js +26 -26
  72. package/src/helper/index.js +1 -1
  73. package/src/helper/keyCodeMap.js +25 -28
  74. package/src/helper/numbers.js +4 -8
  75. package/src/helper/unicode.js +4 -8
  76. package/src/hooks/base.js +307 -0
  77. package/src/hooks/params.js +130 -0
  78. package/src/interfaces/contracts.js +227 -0
  79. package/src/interfaces/index.js +7 -0
  80. package/src/interfaces/plugins.js +239 -0
  81. package/src/langs/ckb.js +4 -4
  82. package/src/langs/cs.js +4 -4
  83. package/src/langs/da.js +4 -4
  84. package/src/langs/de.js +4 -4
  85. package/src/langs/en.js +4 -4
  86. package/src/langs/es.js +4 -4
  87. package/src/langs/fa.js +4 -4
  88. package/src/langs/fr.js +4 -4
  89. package/src/langs/he.js +4 -4
  90. package/src/langs/hu.js +4 -4
  91. package/src/langs/it.js +4 -4
  92. package/src/langs/ja.js +4 -4
  93. package/src/langs/km.js +4 -4
  94. package/src/langs/ko.js +4 -4
  95. package/src/langs/lv.js +4 -4
  96. package/src/langs/nl.js +4 -4
  97. package/src/langs/pl.js +4 -4
  98. package/src/langs/pt_br.js +13 -13
  99. package/src/langs/ro.js +4 -4
  100. package/src/langs/ru.js +4 -4
  101. package/src/langs/se.js +4 -4
  102. package/src/langs/tr.js +4 -4
  103. package/src/langs/uk.js +4 -4
  104. package/src/langs/ur.js +4 -4
  105. package/src/langs/zh_cn.js +4 -4
  106. package/src/modules/{Browser.js → contract/Browser.js} +119 -128
  107. package/src/modules/{ColorPicker.js → contract/ColorPicker.js} +132 -142
  108. package/src/modules/contract/Controller.js +589 -0
  109. package/src/modules/{Figure.js → contract/Figure.js} +591 -411
  110. package/src/modules/{HueSlider.js → contract/HueSlider.js} +125 -86
  111. package/src/modules/contract/Modal.js +357 -0
  112. package/src/modules/contract/index.js +9 -0
  113. package/src/modules/manager/ApiManager.js +197 -0
  114. package/src/modules/{FileManager.js → manager/FileManager.js} +128 -160
  115. package/src/modules/manager/index.js +5 -0
  116. package/src/modules/{ModalAnchorEditor.js → ui/ModalAnchorEditor.js} +108 -138
  117. package/src/modules/{SelectMenu.js → ui/SelectMenu.js} +119 -120
  118. package/src/modules/{_DragHandle.js → ui/_DragHandle.js} +1 -1
  119. package/src/modules/ui/index.js +6 -0
  120. package/src/plugins/browser/audioGallery.js +23 -26
  121. package/src/plugins/browser/fileBrowser.js +25 -28
  122. package/src/plugins/browser/fileGallery.js +20 -23
  123. package/src/plugins/browser/imageGallery.js +24 -23
  124. package/src/plugins/browser/videoGallery.js +27 -29
  125. package/src/plugins/command/blockquote.js +11 -17
  126. package/src/plugins/command/exportPDF.js +26 -26
  127. package/src/plugins/command/fileUpload.js +138 -133
  128. package/src/plugins/command/list_bulleted.js +48 -44
  129. package/src/plugins/command/list_numbered.js +48 -44
  130. package/src/plugins/dropdown/align.js +64 -50
  131. package/src/plugins/dropdown/backgroundColor.js +34 -35
  132. package/src/plugins/dropdown/{formatBlock.js → blockStyle.js} +43 -37
  133. package/src/plugins/dropdown/font.js +50 -36
  134. package/src/plugins/dropdown/fontColor.js +34 -35
  135. package/src/plugins/dropdown/hr.js +55 -50
  136. package/src/plugins/dropdown/layout.js +20 -15
  137. package/src/plugins/dropdown/lineHeight.js +46 -30
  138. package/src/plugins/dropdown/list.js +32 -33
  139. package/src/plugins/dropdown/paragraphStyle.js +40 -34
  140. package/src/plugins/dropdown/table/index.js +915 -0
  141. package/src/plugins/dropdown/table/render/table.html.js +308 -0
  142. package/src/plugins/dropdown/table/render/table.menu.js +121 -0
  143. package/src/plugins/dropdown/table/services/table.cell.js +465 -0
  144. package/src/plugins/dropdown/table/services/table.clipboard.js +414 -0
  145. package/src/plugins/dropdown/table/services/table.grid.js +504 -0
  146. package/src/plugins/dropdown/table/services/table.resize.js +463 -0
  147. package/src/plugins/dropdown/table/services/table.selection.js +466 -0
  148. package/src/plugins/dropdown/table/services/table.style.js +844 -0
  149. package/src/plugins/dropdown/table/shared/table.constants.js +109 -0
  150. package/src/plugins/dropdown/table/shared/table.utils.js +219 -0
  151. package/src/plugins/dropdown/template.js +20 -15
  152. package/src/plugins/dropdown/textStyle.js +28 -22
  153. package/src/plugins/field/mention.js +54 -49
  154. package/src/plugins/index.js +5 -5
  155. package/src/plugins/input/fontSize.js +100 -97
  156. package/src/plugins/input/pageNavigator.js +13 -10
  157. package/src/plugins/modal/audio.js +208 -219
  158. package/src/plugins/modal/drawing.js +99 -104
  159. package/src/plugins/modal/embed.js +323 -312
  160. package/src/plugins/modal/image/index.js +942 -0
  161. package/src/plugins/modal/image/render/image.html.js +150 -0
  162. package/src/plugins/modal/image/services/image.size.js +198 -0
  163. package/src/plugins/modal/image/services/image.upload.js +216 -0
  164. package/src/plugins/modal/image/shared/image.constants.js +20 -0
  165. package/src/plugins/modal/link.js +74 -54
  166. package/src/plugins/modal/math.js +126 -119
  167. package/src/plugins/modal/video/index.js +858 -0
  168. package/src/plugins/modal/video/render/video.html.js +131 -0
  169. package/src/plugins/modal/video/services/video.size.js +281 -0
  170. package/src/plugins/modal/video/services/video.upload.js +92 -0
  171. package/src/plugins/popup/anchor.js +57 -49
  172. package/src/suneditor.js +73 -61
  173. package/src/themes/cobalt.css +155 -0
  174. package/src/themes/dark.css +143 -120
  175. package/src/typedef.js +214 -63
  176. package/types/assets/icons/defaultIcons.d.ts +8 -0
  177. package/types/assets/suneditor-contents.css.d.ts +1 -0
  178. package/types/assets/suneditor.css.d.ts +1 -0
  179. package/types/core/config/contextProvider.d.ts +148 -0
  180. package/types/core/config/eventManager.d.ts +68 -0
  181. package/types/core/config/instanceCheck.d.ts +33 -0
  182. package/types/core/config/optionProvider.d.ts +147 -0
  183. package/types/core/editor.d.ts +27 -586
  184. package/types/core/event/actions/index.d.ts +50 -0
  185. package/types/core/event/effects/common.registry.d.ts +56 -0
  186. package/types/core/event/effects/keydown.registry.d.ts +80 -0
  187. package/types/core/event/effects/ruleHelpers.d.ts +36 -0
  188. package/types/core/event/eventOrchestrator.d.ts +191 -0
  189. package/types/core/event/executor.d.ts +13 -0
  190. package/types/core/event/handlers/handler_toolbar.d.ts +38 -0
  191. package/types/core/event/handlers/handler_ww_clipboard.d.ts +36 -0
  192. package/types/core/event/handlers/handler_ww_dragDrop.d.ts +26 -0
  193. package/types/core/event/handlers/handler_ww_input.d.ts +38 -0
  194. package/types/core/event/handlers/handler_ww_key.d.ts +40 -0
  195. package/types/core/event/handlers/handler_ww_mouse.d.ts +47 -0
  196. package/types/core/event/ports.d.ts +256 -0
  197. package/types/core/event/reducers/keydown.reducer.d.ts +84 -0
  198. package/types/core/event/rules/keydown.rule.arrow.d.ts +19 -0
  199. package/types/core/event/rules/keydown.rule.backspace.d.ts +18 -0
  200. package/types/core/event/rules/keydown.rule.delete.d.ts +18 -0
  201. package/types/core/event/rules/keydown.rule.enter.d.ts +18 -0
  202. package/types/core/event/rules/keydown.rule.tab.d.ts +18 -0
  203. package/types/core/event/support/defaultLineManager.d.ts +22 -0
  204. package/types/core/event/support/selectionState.d.ts +29 -0
  205. package/types/core/kernel/coreKernel.d.ts +219 -0
  206. package/types/core/kernel/kernelInjector.d.ts +16 -0
  207. package/types/core/kernel/store.d.ts +170 -0
  208. package/types/core/logic/dom/char.d.ts +46 -0
  209. package/types/core/logic/dom/format.d.ts +234 -0
  210. package/types/core/logic/dom/html.d.ts +290 -0
  211. package/types/core/logic/dom/inline.d.ts +93 -0
  212. package/types/core/logic/dom/listFormat.d.ts +101 -0
  213. package/types/core/logic/dom/nodeTransform.d.ts +110 -0
  214. package/types/core/logic/dom/offset.d.ts +335 -0
  215. package/types/core/logic/dom/selection.d.ts +165 -0
  216. package/types/core/logic/panel/menu.d.ts +93 -0
  217. package/types/core/logic/panel/toolbar.d.ts +128 -0
  218. package/types/core/logic/panel/viewer.d.ts +89 -0
  219. package/types/core/logic/shell/_commandExecutor.d.ts +18 -0
  220. package/types/core/logic/shell/commandDispatcher.d.ts +65 -0
  221. package/types/core/logic/shell/component.d.ts +182 -0
  222. package/types/core/logic/shell/focusManager.d.ts +31 -0
  223. package/types/core/{base → logic/shell}/history.d.ts +13 -12
  224. package/types/core/logic/shell/pluginManager.d.ts +115 -0
  225. package/types/core/logic/shell/shortcuts.d.ts +131 -0
  226. package/types/core/logic/shell/ui.d.ts +261 -0
  227. package/types/core/schema/context.d.ts +104 -0
  228. package/types/core/schema/frameContext.d.ts +320 -0
  229. package/types/core/schema/options.d.ts +1241 -0
  230. package/types/core/section/constructor.d.ts +117 -652
  231. package/types/core/section/documentType.d.ts +43 -61
  232. package/types/events.d.ts +796 -65
  233. package/types/helper/clipboard.d.ts +5 -4
  234. package/types/helper/converter.d.ts +55 -43
  235. package/types/helper/dom/domCheck.d.ts +27 -19
  236. package/types/helper/dom/domQuery.d.ts +76 -57
  237. package/types/helper/dom/domUtils.d.ts +62 -39
  238. package/types/helper/dom/index.d.ts +87 -1
  239. package/types/helper/env.d.ts +16 -13
  240. package/types/helper/index.d.ts +8 -2
  241. package/types/helper/keyCodeMap.d.ts +24 -23
  242. package/types/helper/numbers.d.ts +4 -6
  243. package/types/helper/unicode.d.ts +4 -3
  244. package/types/hooks/base.d.ts +239 -0
  245. package/types/hooks/params.d.ts +65 -0
  246. package/types/index.d.ts +20 -117
  247. package/types/interfaces/contracts.d.ts +183 -0
  248. package/types/interfaces/index.d.ts +3 -0
  249. package/types/interfaces/plugins.d.ts +168 -0
  250. package/types/langs/_Lang.d.ts +2 -2
  251. package/types/langs/index.d.ts +2 -2
  252. package/types/modules/contract/Browser.d.ts +262 -0
  253. package/types/modules/contract/ColorPicker.d.ts +99 -0
  254. package/types/modules/contract/Controller.d.ts +204 -0
  255. package/types/modules/contract/Figure.d.ts +529 -0
  256. package/types/modules/{HueSlider.d.ts → contract/HueSlider.d.ts} +39 -28
  257. package/types/modules/contract/Modal.d.ts +62 -0
  258. package/types/modules/contract/index.d.ts +7 -0
  259. package/types/modules/manager/ApiManager.d.ts +106 -0
  260. package/types/modules/manager/FileManager.d.ts +124 -0
  261. package/types/modules/manager/index.d.ts +3 -0
  262. package/types/modules/ui/ModalAnchorEditor.d.ts +152 -0
  263. package/types/modules/ui/SelectMenu.d.ts +107 -0
  264. package/types/modules/{_DragHandle.d.ts → ui/_DragHandle.d.ts} +1 -0
  265. package/types/modules/ui/index.d.ts +4 -0
  266. package/types/plugins/browser/audioGallery.d.ts +33 -41
  267. package/types/plugins/browser/fileBrowser.d.ts +42 -50
  268. package/types/plugins/browser/fileGallery.d.ts +33 -41
  269. package/types/plugins/browser/imageGallery.d.ts +30 -37
  270. package/types/plugins/browser/videoGallery.d.ts +33 -41
  271. package/types/plugins/command/blockquote.d.ts +4 -21
  272. package/types/plugins/command/exportPDF.d.ts +23 -33
  273. package/types/plugins/command/fileUpload.d.ts +80 -100
  274. package/types/plugins/command/list_bulleted.d.ts +9 -35
  275. package/types/plugins/command/list_numbered.d.ts +9 -35
  276. package/types/plugins/dropdown/align.d.ts +23 -46
  277. package/types/plugins/dropdown/backgroundColor.d.ts +35 -53
  278. package/types/plugins/dropdown/blockStyle.d.ts +45 -0
  279. package/types/plugins/dropdown/font.d.ts +18 -41
  280. package/types/plugins/dropdown/fontColor.d.ts +35 -53
  281. package/types/plugins/dropdown/hr.d.ts +26 -52
  282. package/types/plugins/dropdown/layout.d.ts +19 -25
  283. package/types/plugins/dropdown/lineHeight.d.ts +21 -39
  284. package/types/plugins/dropdown/list.d.ts +6 -34
  285. package/types/plugins/dropdown/paragraphStyle.d.ts +34 -45
  286. package/types/plugins/dropdown/table/index.d.ts +158 -0
  287. package/types/plugins/dropdown/table/render/table.html.d.ts +71 -0
  288. package/types/plugins/dropdown/table/render/table.menu.d.ts +59 -0
  289. package/types/plugins/dropdown/table/services/table.cell.d.ts +76 -0
  290. package/types/plugins/dropdown/table/services/table.clipboard.d.ts +26 -0
  291. package/types/plugins/dropdown/table/services/table.grid.d.ts +77 -0
  292. package/types/plugins/dropdown/table/services/table.resize.d.ts +72 -0
  293. package/types/plugins/dropdown/table/services/table.selection.d.ts +59 -0
  294. package/types/plugins/dropdown/table/services/table.style.d.ts +162 -0
  295. package/types/plugins/dropdown/table/shared/table.constants.d.ts +134 -0
  296. package/types/plugins/dropdown/table/shared/table.utils.d.ts +91 -0
  297. package/types/plugins/dropdown/template.d.ts +19 -25
  298. package/types/plugins/dropdown/textStyle.d.ts +23 -30
  299. package/types/plugins/field/mention.d.ts +66 -72
  300. package/types/plugins/index.d.ts +41 -40
  301. package/types/plugins/input/fontSize.d.ts +57 -96
  302. package/types/plugins/input/pageNavigator.d.ts +5 -8
  303. package/types/plugins/modal/audio.d.ts +60 -153
  304. package/types/plugins/modal/drawing.d.ts +16 -118
  305. package/types/plugins/modal/embed.d.ts +46 -166
  306. package/types/plugins/modal/image/index.d.ts +281 -0
  307. package/types/plugins/modal/image/render/image.html.d.ts +45 -0
  308. package/types/plugins/modal/image/services/image.size.d.ts +55 -0
  309. package/types/plugins/modal/image/services/image.upload.d.ts +24 -0
  310. package/types/plugins/modal/image/shared/image.constants.d.ts +17 -0
  311. package/types/plugins/modal/link.d.ts +46 -66
  312. package/types/plugins/modal/math.d.ts +17 -86
  313. package/types/plugins/modal/{video.d.ts → video/index.d.ts} +89 -221
  314. package/types/plugins/modal/video/render/video.html.d.ts +37 -0
  315. package/types/plugins/modal/video/services/video.size.d.ts +74 -0
  316. package/types/plugins/modal/video/services/video.upload.d.ts +19 -0
  317. package/types/plugins/popup/anchor.d.ts +8 -38
  318. package/types/suneditor.d.ts +55 -24
  319. package/types/typedef.d.ts +344 -228
  320. package/CONTRIBUTING.md +0 -186
  321. package/src/core/base/eventHandlers/handler_ww_key_input.js +0 -1200
  322. package/src/core/base/eventHandlers/handler_ww_mouse.js +0 -194
  323. package/src/core/base/eventManager.js +0 -1523
  324. package/src/core/class/component.js +0 -856
  325. package/src/core/class/format.js +0 -3433
  326. package/src/core/class/menu.js +0 -346
  327. package/src/core/class/selection.js +0 -610
  328. package/src/core/class/shortcuts.js +0 -98
  329. package/src/core/class/toolbar.js +0 -431
  330. package/src/core/class/ui.js +0 -424
  331. package/src/core/class/viewer.js +0 -750
  332. package/src/core/section/actives.js +0 -266
  333. package/src/core/section/context.js +0 -102
  334. package/src/editorInjector/_classes.js +0 -36
  335. package/src/editorInjector/_core.js +0 -87
  336. package/src/editorInjector/index.js +0 -73
  337. package/src/modules/ApiManager.js +0 -191
  338. package/src/modules/Controller.js +0 -474
  339. package/src/modules/Modal.js +0 -346
  340. package/src/modules/index.js +0 -14
  341. package/src/plugins/dropdown/table.js +0 -4034
  342. package/src/plugins/modal/image.js +0 -1376
  343. package/src/plugins/modal/video.js +0 -1226
  344. package/types/core/base/eventHandlers/handler_toolbar.d.ts +0 -41
  345. package/types/core/base/eventHandlers/handler_ww_clipboard.d.ts +0 -40
  346. package/types/core/base/eventHandlers/handler_ww_dragDrop.d.ts +0 -35
  347. package/types/core/base/eventHandlers/handler_ww_key_input.d.ts +0 -45
  348. package/types/core/base/eventHandlers/handler_ww_mouse.d.ts +0 -39
  349. package/types/core/base/eventManager.d.ts +0 -401
  350. package/types/core/class/char.d.ts +0 -61
  351. package/types/core/class/component.d.ts +0 -213
  352. package/types/core/class/format.d.ts +0 -623
  353. package/types/core/class/html.d.ts +0 -430
  354. package/types/core/class/menu.d.ts +0 -126
  355. package/types/core/class/nodeTransform.d.ts +0 -93
  356. package/types/core/class/offset.d.ts +0 -522
  357. package/types/core/class/selection.d.ts +0 -188
  358. package/types/core/class/shortcuts.d.ts +0 -142
  359. package/types/core/class/toolbar.d.ts +0 -189
  360. package/types/core/class/ui.d.ts +0 -164
  361. package/types/core/class/viewer.d.ts +0 -140
  362. package/types/core/section/actives.d.ts +0 -46
  363. package/types/core/section/context.d.ts +0 -45
  364. package/types/editorInjector/_classes.d.ts +0 -41
  365. package/types/editorInjector/_core.d.ts +0 -87
  366. package/types/editorInjector/index.d.ts +0 -69
  367. package/types/modules/ApiManager.d.ts +0 -125
  368. package/types/modules/Browser.d.ts +0 -326
  369. package/types/modules/ColorPicker.d.ts +0 -135
  370. package/types/modules/Controller.d.ts +0 -251
  371. package/types/modules/Figure.d.ts +0 -517
  372. package/types/modules/FileManager.d.ts +0 -202
  373. package/types/modules/Modal.d.ts +0 -111
  374. package/types/modules/ModalAnchorEditor.d.ts +0 -236
  375. package/types/modules/SelectMenu.d.ts +0 -194
  376. package/types/modules/index.d.ts +0 -26
  377. package/types/plugins/dropdown/formatBlock.d.ts +0 -55
  378. package/types/plugins/dropdown/table.d.ts +0 -627
  379. package/types/plugins/modal/image.d.ts +0 -451
  380. /package/{LICENSE → LICENSE.txt} +0 -0
@@ -0,0 +1,1241 @@
1
+ import type {} from '../../typedef';
2
+ export namespace DEFAULTS {
3
+ let BUTTON_LIST: (string | string[])[];
4
+ let REQUIRED_FORMAT_LINE: string;
5
+ let REQUIRED_ELEMENT_WHITELIST: string;
6
+ let ELEMENT_WHITELIST: string;
7
+ let TEXT_STYLE_TAGS: string;
8
+ let SCOPE_SELECTION_TAGS: string[];
9
+ let ATTRIBUTE_WHITELIST: string;
10
+ let FORMAT_LINE: string;
11
+ let FORMAT_BR_LINE: string;
12
+ let FORMAT_CLOSURE_BR_LINE: string;
13
+ let FORMAT_BLOCK: string;
14
+ let FORMAT_CLOSURE_BLOCK: string;
15
+ let ALLOWED_EMPTY_NODE_LIST: string;
16
+ let SIZE_UNITS: string[];
17
+ let CLASS_NAME: string;
18
+ let CLASS_MJX: string;
19
+ let EXTRA_TAG_MAP: {
20
+ script: boolean;
21
+ style: boolean;
22
+ meta: boolean;
23
+ link: boolean;
24
+ '[a-z]+:[a-z]+': boolean;
25
+ };
26
+ let CONTENT_STYLES: string;
27
+ let TAG_STYLES: {
28
+ 'table|th|td': string;
29
+ 'table|td': string;
30
+ tr: string;
31
+ col: string;
32
+ caption: string;
33
+ 'ol|ul': string;
34
+ figure: string;
35
+ figcaption: string;
36
+ 'img|video|iframe': string;
37
+ hr: string;
38
+ };
39
+ let SPAN_STYLES: string;
40
+ let LINE_STYLES: string;
41
+ let RETAIN_STYLE_MODE: string[];
42
+ }
43
+ /**
44
+ * ================================================================================================================================
45
+ * === OPTIONS TYPES : Frame
46
+ * =================================================================================================================================
47
+ */
48
+ /**
49
+ * ================================================================================================================================
50
+ * @typedef {Object} EditorFrameOptions
51
+ *
52
+ * **Frame-level editable area options**
53
+ * -----------------
54
+ *
55
+ * === Content & Editing ===
56
+ * @property {string} [value=""] - Initial value for the editor.
57
+ * @property {string} [placeholder=""] - Placeholder text.
58
+ * @property {Object<string, string>} [editableFrameAttributes={spellcheck: "false"}] - Attributes for the editable frame[.sun-editor-editable]. (e.g. [key]: value)
59
+ * ///
60
+ *
61
+ * === Layout & Sizing ===
62
+ * @property {string|number} [width="100%"] - Width for the editor.
63
+ * @property {string|number} [minWidth=""] - Min width for the editor.
64
+ * @property {string|number} [maxWidth=""] - Max width for the editor.
65
+ * @property {string|number} [height="auto"] - Height for the editor.
66
+ * @property {string|number} [minHeight=""] - Min height for the editor.
67
+ * @property {string|number} [maxHeight=""] - Max height for the editor.
68
+ * @property {string} [editorStyle=""] - Style string of the top frame of the editor. (e.g. "border: 1px solid #ccc;").
69
+ * ///
70
+ *
71
+ * === Iframe Mode ===
72
+ * @property {boolean} [iframe=false] - Content will be placed in an iframe and isolated from the rest of the page.
73
+ * @property {boolean} [iframe_fullPage=false] - Allows the usage of HTML, HEAD, BODY tags and DOCTYPE declaration on the `iframe`.
74
+ * @property {Object<string, string>} [iframe_attributes={}] - Attributes of the `iframe`. (e.g. {'allow-scripts': 'true'})
75
+ * @property {Array<string>} [iframe_cssFileName=["suneditor"]] - CSS files to apply inside the iframe.
76
+ * - String: Filename pattern to search in document <link> tags (e.g. "suneditor" or "suneditor.[a-z0-9]+" matches "suneditor.abc123.css")
77
+ * - "*": Wildcard to include ALL stylesheets from the page
78
+ * - Array: Multiple patterns (e.g. ["suneditor", "custom", "*"])
79
+ * - Absolute URLs and data URLs (data:text/css,) are also supported
80
+ * ///
81
+ *
82
+ * === Statusbar & Character Counter ===
83
+ * @property {boolean} [statusbar=true] - Enables the status bar.
84
+ * @property {boolean} [statusbar_showPathLabel=true] - Displays the current node structure to status bar.
85
+ * @property {boolean} [statusbar_resizeEnable=true] - Enables resize function of bottom status bar
86
+ * @property {boolean} [charCounter=false] - Shows the number of characters in the editor.
87
+ * - If the `maxCharCount` option has a value, it becomes `true`.
88
+ * @property {?number} [charCounter_max=null] - The maximum number of characters allowed to be inserted into the editor.
89
+ * @property {?string} [charCounter_label=null] - Text to be displayed in the `charCounter` area of the bottom bar. (e.g. "Characters : 20/200")
90
+ * @property {"char"|"byte"|"byte-html"} [charCounter_type="char"] - Defines the calculation method of the `charCounter` option.
91
+ * - `char`: Characters length.
92
+ * - `byte`: Binary data size of characters.
93
+ * - `byte-html`: Binary data size of the full HTML string.
94
+ *
95
+ */
96
+ /** ================================================================================================================================ */
97
+ /**
98
+ * @typedef {Object} OptionStyleResult
99
+ * @property {string} top - Styles applied to the top container (e.g. width, z-index, etc).
100
+ * @property {string} frame - Styles applied to the iframe container (e.g. height, min-height).
101
+ * @property {string} editor - Styles applied to the editable content area.
102
+ */
103
+ /**
104
+ * @typedef {Object} InternalFrameOptions
105
+ * **Runtime-only frame options (computed internally, cannot be set by users)**
106
+ * @property {Object} [__statusbarEvent] - Status bar event configuration.
107
+ * @property {SunEditor.InitFrameOptions} _origin - origin frame options
108
+ * @property {OptionStyleResult} [_defaultStyles] - Enables fixed positioning for the editor frame.
109
+ * @property {*} [codeMirror5Editor] - CodeMirror5 editor instance (frame-level). Set by `_checkCodeMirror` after initialization.
110
+ * @property {*} [codeMirror6Editor] - CodeMirror6 EditorView instance (frame-level). Set by `_checkCodeMirror` after initialization.
111
+ */
112
+ /**
113
+ * @typedef {EditorFrameOptions & InternalFrameOptions} AllFrameOptions
114
+ */
115
+ /**
116
+ * @typedef {'width'|'minWidth'|'maxWidth'|'height'|'minHeight'|'maxHeight'} TransformedFrameOptionKeys
117
+ */
118
+ /**
119
+ * @typedef {Object} TransformedFrameOptions
120
+ * @property {string} width
121
+ * @property {string} minWidth
122
+ * @property {string} maxWidth
123
+ * @property {string} height
124
+ * @property {string} minHeight
125
+ * @property {string} maxHeight
126
+ */
127
+ /**
128
+ * @typedef {Omit<AllFrameOptions, TransformedFrameOptionKeys> & TransformedFrameOptions} ProcessedFrameOptions
129
+ */
130
+ /**
131
+ * ================================================================================================================================
132
+ * === OPTIONS TYPES : Base
133
+ * =================================================================================================================================
134
+ */
135
+ /**
136
+ * ================================================================================================================================
137
+ * @typedef {Object} PrivateBaseOptions
138
+ *
139
+ * **Advanced internal options (user-configurable, prefixed with `__`)**
140
+ * -----------------
141
+ *
142
+ * === Defaults & Whitelists ===
143
+ * @property {string} [__textStyleTags=CONSTANTS.TEXT_STYLE_TAGS] - The basic tags that serves as the base for `textStyleTags`
144
+ * - The default follows {@link DEFAULTS.TEXT_STYLE_TAGS}
145
+ * @property {Object<string, string>} [__tagStyles=CONSTANTS.TAG_STYLES] - The basic tags that serves as the base for `tagStyles`
146
+ * - The default follows {@link DEFAULTS.TAG_STYLES}
147
+ * @property {string} [__defaultElementWhitelist] - A custom string used to construct a list of HTML elements to allow.
148
+ * - The final list of allowed elements (regex pattern) is dynamically generated according to the following rules:
149
+ * - A list of required elements, {@link DEFAULTS.REQUIRED_ELEMENT_WHITELIST}, is always included.
150
+ * - If a string value is provided for this option (`__defaultElementWhitelist`):** That string value is used.
151
+ * - If this option is not provided or is not a string: The default constant {@link DEFAULTS.ELEMENT_WHITELIST} is used.
152
+ * - 1. If no options are given, the final pattern is:
153
+ * - 'a|img|p|div|...' (REQUIRED + DEFAULT)
154
+ * - 2. If options are given directly, the final pattern is:
155
+ * - 'a|img|custom|tags' (REQUIRED + options.__defaultElementWhitelist)
156
+ * @property {string} [__defaultAttributeWhitelist=CONSTANTS.ATTRIBUTE_WHITELIST] - A complete list of attributes that are allowed by default on all tags. Delimiter: "|" (e.g. "href|target").
157
+ * - The default follows {@link DEFAULTS.ATTRIBUTE_WHITELIST}
158
+ * ///
159
+ *
160
+ * === Formatting ===
161
+ * @property {string} [__defaultFormatLine=CONSTANTS.FORMAT_LINE] - Specifies the tag to be used as the editor's default `line` element.
162
+ * - The default follows {@link DEFAULTS.FORMAT_LINE}
163
+ * @property {string} [__defaultFormatBrLine=CONSTANTS.FORMAT_BR_LINE] - Specifies the tag to be used as the editor's default `brLine` element.
164
+ * - The default follows {@link DEFAULTS.FORMAT_BR_LINE}
165
+ * @property {string} [__defaultFormatClosureBrLine=CONSTANTS.FORMAT_CLOSURE_BR_LINE] - Specifies the tag to be used as the editor's default `closureBrLine` element.
166
+ * - The default follows {@link DEFAULTS.FORMAT_CLOSURE_BR_LINE}
167
+ * @property {string} [__defaultFormatBlock=CONSTANTS.FORMAT_BLOCK] - Specifies the tag to be used as the editor's default `block` element.
168
+ * - The default follows {@link DEFAULTS.FORMAT_BLOCK}
169
+ * @property {string} [__defaultFormatClosureBlock=CONSTANTS.FORMAT_CLOSURE_BLOCK] - Specifies the tag to be used as the editor's default `closureBlock` element.
170
+ * - The default follows {@link DEFAULTS.FORMAT_CLOSURE_BLOCK}
171
+ * ///
172
+ *
173
+ * === Filters & Behavior ===
174
+ * @property {boolean} [__lineFormatFilter=true] - Line format filter configuration.
175
+ * @property {Array<string>} [__listCommonStyle=["fontSize", "color", "fontFamily", "fontWeight", "fontStyle"]] - Defines the list of styles that are applied directly to the `<li>` element
176
+ * - when a text style is applied to the entire list item.
177
+ * - For example, when changing the font size or color of a list item (`<li>`),
178
+ * - these styles will be applied to the `<li>` tag instead of wrapping the content inside additional tags.
179
+ * @property {{pluginName: string, we: boolean}|boolean} [__pluginRetainFilter=true] - Plugin retain filter configuration. (Internal use primarily)
180
+ * - You can turn it off/on globally with `true`/`false` or set it per plugin. (e.g. { table: false })
181
+ */
182
+ /**
183
+ * ================================================================================================================================
184
+ * @typedef {Object} EditorBaseOptions
185
+ *
186
+ * **Top-level editor configuration**
187
+ * -----------------
188
+ *
189
+ * === Plugins & Toolbar ===
190
+ * @property {Object<string, *>|Array<Object<string, *>>} [plugins] - Plugin configuration.
191
+ * @property {Array<string>} [excludedPlugins=[]] - Plugin configuration.
192
+ * @property {SunEditor.UI.ButtonList} [buttonList=CONSTANTS.BUTTON_LIST] - List of toolbar buttons, grouped by sub-arrays.
193
+ * - The default follows {@link DEFAULTS.BUTTON_LIST}
194
+ * ///
195
+ *
196
+ * === Modes & Themes ===
197
+ * @property {boolean} [v2Migration=false] - Enables migration mode for SunEditor v2.
198
+ * @property {"classic"|"inline"|"balloon"|"balloon-always"} [mode="classic"] - Toolbar mode: `classic`, `inline`, `balloon`, `balloon-always`.
199
+ * @property {string} [type=""] - Editor type: `document:header,page`.
200
+ * @property {string} [theme=""] - Editor theme.
201
+ * @property {Object<string, string>} [lang] - Language configuration. default : EN
202
+ * @property {Object<string, string>} [icons] - Overrides the default icons.
203
+ * @property {"ltr"|"rtl"} [textDirection="ltr"] - Text direction: `ltr` or `rtl`.
204
+ * @property {Array<string>} [reverseButtons=['indent-outdent']] - An array of command pairs whose shortcut icons should be opposite each other, depending on the `textDirection` mode.
205
+ * ///
206
+ *
207
+ * === Strict & Advanced Filtering ===
208
+ * @property {true | {
209
+ * tagFilter: boolean,
210
+ * formatFilter: boolean,
211
+ * classFilter: boolean,
212
+ * textStyleTagFilter: boolean,
213
+ * attrFilter: boolean,
214
+ * styleFilter: boolean
215
+ * }} [strictMode=true] - Enables strict filtering of tags, attributes, and styles.
216
+ * - Use `true` to enable all filters (default), or an object to control individual filters.
217
+ * - Setting `false` is not supported; use the object form to disable specific filters instead.
218
+ * @property {Array<string>} [scopeSelectionTags=CONSTANTS.SCOPE_SELECTION_TAGS] - Tags treated as whole units when selecting all content.
219
+ * - The default follows {@link DEFAULTS.SCOPE_SELECTION_TAGS}
220
+ * ///
221
+ *
222
+ * === Content Filtering & Formatting ===
223
+ * ==
224
+ * #### 1) Tag & Element Control
225
+ * @property {string} [elementWhitelist=""] - Specifies HTML elements to additionally allow beyond the 'default' allow list. Delimiter: "|" (e.g. "p|div", "*").
226
+ * - The value entered here will be added to the end of the default list determined by the {@link PrivateBaseOptions.__defaultElementWhitelist} logic above.
227
+ * @property {string} [elementBlacklist=""] - Filters by specifying HTML elements that should not be used. Delimiter: "|" (e.g. "script|style").
228
+ * - Tags specified here will eventually be removed, even if they are included in other whitelists.
229
+ * @property {string} [allowedEmptyTags=CONSTANTS.ALLOWED_EMPTY_NODE_LIST] - A list of tags that are allowed to be kept even if their values are empty.
230
+ * - The default follows {@link DEFAULTS.ALLOWED_EMPTY_NODE_LIST}
231
+ * - It is concatenated with the value of `ALLOWED_EMPTY_NODE_LIST` to form the final `allowedEmptyTags` list.
232
+ * @property {string} [allowedClassName=""] - Allowed class names.
233
+ * - Added the default value {@link DEFAULTS.CLASS_NAME}
234
+ * ///
235
+ *
236
+ * #### 2) Attribute Control
237
+ * @property {{[key: string]: string|undefined}} [attributeWhitelist=null] - Specifies additional attributes to allow for each tag. (e.g. {a: "href|target", img: "src|alt", "*": "id"}).
238
+ * - Rules for objects specified here will be merged into the {@link PrivateBaseOptions.__defaultAttributeWhitelist}.
239
+ * @property {{[key: string]: string|undefined}} [attributeBlacklist=null] - Filter by specifying attributes to disallow by tag. (e.g. {a: "href|target", img: "src|alt", "*": "name"}).
240
+ * - Attributes specified here will eventually be removed even if they are allowed by other settings.
241
+ * - A list of required elements, {@link DEFAULTS.REQUIRED_FORMAT_LINE}, is always included.
242
+ * ///
243
+ *
244
+ * #### 3) Text & Inline Style Control
245
+ * @property {string} [textStyleTags=__textStyleTags] - Additional text style tags.
246
+ * - The default follows {@link PrivateBaseOptions.__textStyleTags}
247
+ * @property {Object<string, string>} [convertTextTags={bold: "strong", underline: "u", italic: "em", strike: "del", subscript: "sub", superscript: "sup"}] - Maps text styles to specific HTML tags.
248
+ * @property {string} [allUsedStyles] - Specifies additional styles to the list of allowed styles. Delimiter: "|" (e.g. "color|background-color").
249
+ * @property {Object<string, string>} [tagStyles={}] - Specifies allowed styles for HTML tags.
250
+ * @property {string} [spanStyles=CONSTANTS.SPAN_STYLES] - Specifies allowed styles for the `span` tag.
251
+ * - The default follows {@link DEFAULTS.SPAN_STYLES}
252
+ * @property {string} [lineStyles=CONSTANTS.LINE_STYLES] - Specifies allowed styles for the `line` element (p..).
253
+ * - The default follows {@link DEFAULTS.LINE_STYLES}
254
+ * @property {Array<string>} [fontSizeUnits=CONSTANTS.SIZE_UNITS] - Allowed font size units.
255
+ * - The default follows {@link DEFAULTS.SIZE_UNITS}
256
+ * @property {"repeat"|"always"|"none"} [retainStyleMode="repeat"] - This option determines how inline elements (such as <span>, <strong>, etc.) are handled when deleting text.
257
+ * - `repeat`: Inline styles are retained unless the backspace key is repeatedly pressed. If the user continuously presses backspace, the styles will eventually be removed.
258
+ * - `none`: Inline styles are not retained at all. When deleting text, the associated inline elements are immediately removed along with it.
259
+ * - `always`: Inline styles persist indefinitely unless explicitly removed. Even if all text inside an inline element is deleted, the element itself remains until manually removed.
260
+ * ///
261
+ *
262
+ * #### 4) Line & Block Formatting
263
+ * @property {string} [defaultLine="p"] - Default `line` element when inserting new lines.
264
+ * @property {"line"|"br"} [defaultLineBreakFormat="line"] - Specifies the default line break format.
265
+ * - [Recommended] `line` : is a line break that is divided into general tags.
266
+ * - [Not recommended] `br` : Line breaks are treated as <br> on the same line. (like shift+enter)
267
+ * - Line breaks are handled as <br> within `line`.
268
+ * - You can create a new `line` by entering a line break twice in a row.
269
+ * - Formats that include `line`, such as "Quote", still operate on a `line` basis.
270
+ * - suneditor processes work in `line` units.
271
+ * - When set to `br`, performance may decrease when editing a lot of data.
272
+ * @property {string} [lineAttrReset=""] - Line properties that should be reset when changing lines (e.g. "id|name").
273
+ * @property {string} [formatLine=__defaultFormatLine] - Additionally allowed `line` elements beyond the default. Delimiter: "|" (e.g. "p|div").
274
+ * It is concatenated with the value of {@link PrivateBaseOptions.__defaultFormatLine} to form the final `line` element list.
275
+ * - `line` element also contain `brLine` element
276
+ * @property {string} [formatBrLine=__defaultFormatBrLine] - Additionally allowed `brLine` elements beyond the default. (e.g. "PRE").
277
+ * - It is concatenated with the value of {@link PrivateBaseOptions.__defaultFormatBrLine} to form the final `brLine` element list.
278
+ * - `brLine` elements is included in the `line` element.
279
+ * - `brLine` elements's line break is `BR` tag.
280
+ * ※ Entering the Enter key in the space on the last line ends `brLine` and appends `line`.
281
+ * @property {string} [formatClosureBrLine=__defaultFormatClosureBrLine] - Additionally allowed `closureBrLine` elements beyond the default.
282
+ * - It is concatenated with the value of {@link PrivateBaseOptions.__defaultFormatClosureBrLine} to form the final `closureBrLine` element list.
283
+ * - `closureBrLine` elements is included in the `brLine`.
284
+ * - `closureBrLine` elements's line break is `BR` tag.
285
+ * - ※ You cannot exit this format with the Enter key or Backspace key.
286
+ * - ※ Use it only in special cases. ([ex] format of table cells)
287
+ * @property {string} [formatBlock=__defaultFormatBlock] - Additionally allowed `block` elements beyond the default.
288
+ * - It is concatenated with the value of {@link PrivateBaseOptions.__defaultFormatBlock} to form the final `block` element list.
289
+ * - `block` is wrap the `line` and `component`
290
+ * @property {string} [formatClosureBlock=__defaultFormatClosureBlock] - Additionally allowed `closureBlock` elements beyond the default.
291
+ * - It is concatenated with the value of {@link PrivateBaseOptions.__defaultFormatClosureBlock} to form the final `closureBlock` element list.
292
+ * - `closureBlock` elements is included in the `block`.
293
+ * - `closureBlock` element is wrap the `line` and `component`
294
+ * - ※ You cannot exit this format with the Enter key or Backspace key.
295
+ * - ※ Use it only in special cases. (e.g. format of table cells)
296
+ * ///
297
+ *
298
+ * === UI & Interaction ===
299
+ * @property {boolean} [closeModalOutsideClick=false] - Closes modals when clicking outside.
300
+ * @property {boolean} [syncTabIndent=true] - Synchronizes tab indent with spaces.
301
+ * @property {boolean} [tabDisable=false] - Disables tab key input.
302
+ * @property {string} [toolbar_width="auto"] - Toolbar width.
303
+ * @property {?HTMLElement} [toolbar_container] - Container element for the toolbar.
304
+ * @property {number} [toolbar_sticky=0] - Enables sticky toolbar with optional offset.
305
+ * @property {boolean} [toolbar_hide=false] - Hides toolbar initially.
306
+ * @property {Object} [subToolbar={}] - Sub-toolbar configuration.
307
+ * @property {SunEditor.UI.ButtonList} [subToolbar.buttonList] - List of Sub-toolbar buttons, grouped by sub-arrays.
308
+ * @property {"balloon"|"balloon-always"} [subToolbar.mode="balloon"] - Sub-toolbar mode: `balloon`, `balloon-always`.
309
+ * @property {string} [subToolbar.width="auto"] - Sub-toolbar width.
310
+ * @property {?HTMLElement} [statusbar_container] - Container element for the status bar.
311
+ * @property {boolean} [shortcutsHint=true] - Displays shortcut hints in tooltips.
312
+ * @property {boolean} [shortcutsDisable=false] - Disables keyboard shortcuts.
313
+ * @property {{[key: string]: Array<string>|undefined}} [shortcuts={}] - Custom keyboard shortcuts.
314
+ * ///
315
+ *
316
+ * === Advanced Features ===
317
+ * @property {boolean} [copyFormatKeepOn=false] - Keeps the format of the copied content.
318
+ * @property {boolean} [autoLinkify] - Automatically converts URLs into hyperlinks. (`Link` plugin required)
319
+ * - Default value is determined dynamically based on whether the `link` plugin is enabled. (default : `Boolean(plugins.link)`)
320
+ * @property {Array<string>} [autoStyleify=["bold", "underline", "italic", "strike"]] - Styles applied automatically on text input.
321
+ * @property {number} [historyStackDelayTime=400] - Delay time for history stack updates (ms).
322
+ * @property {string} [printClass=""] - Class name for printing.
323
+ * @property {number} [fullScreenOffset=0] - Offset applied when entering fullscreen mode.
324
+ * @property {?string} [previewTemplate=null] - Custom template for preview mode.
325
+ * @property {?string} [printTemplate=null] - Custom template for print mode.
326
+ * @property {SunEditor.ComponentInsertType} [componentInsertBehavior="auto"] - Enables automatic selection of inserted components.
327
+ * - For inline components: places the cursor near the inserted component or selects it if no nearby range is available.
328
+ * - For block components: executes behavior based on `selectMode`:
329
+ * - `auto`: Move cursor to the next line if possible, otherwise select the component.
330
+ * - `select`: Always select the inserted component.
331
+ * - `line`: Move cursor to the next line if possible, or create a new line and move there.
332
+ * - `none`: Do nothing.
333
+ * @property {?string} [defaultUrlProtocol=null] - Default URL protocol for links.
334
+ * @property {Object<"copy", number>} [toastMessageTime={copy: 1500}] - {"copy": 1500} - Duration for displaying toast messages.
335
+ * @property {boolean} [freeCodeViewMode=false] - Enables free code view mode.
336
+ *
337
+ * === Dynamic Options ===
338
+ * @property {Object<string, *>} [externalLibs] - External libraries like CodeMirror or MathJax. See {@link https://github.com/ARA-developer/suneditor/blob/develop/guide/external-libraries.md External Libraries Guide}
339
+ * @property {Object<string, boolean>} [allowedExtraTags=CONSTANTS.EXTRA_TAG_MAP] - Specifies extra allowed or disallowed tags.
340
+ * - The default follows {@link DEFAULTS.EXTRA_TAG_MAP}
341
+ * ///
342
+ *
343
+ * === User Events ===
344
+ * @property {SunEditor.Event.Handlers} [events] - User event handlers configuration
345
+ * ///
346
+ *
347
+ * === [ Plugin-Specific Options ] ===
348
+ * ---[ Auto-generated by scripts/check/inject-plugin-jsdoc.cjs - DO NOT EDIT MANUALLY ]---
349
+ * @property {import('../../plugins/dropdown/align.js').AlignPluginOptions} [align]
350
+ * @property {import('../../plugins/modal/audio.js').AudioPluginOptions} [audio]
351
+ * @property {import('../../plugins/browser/audioGallery.js').AudioGalleryPluginOptions} [audioGallery]
352
+ * @property {import('../../plugins/dropdown/backgroundColor.js').BackgroundColorPluginOptions} [backgroundColor]
353
+ * @property {import('../../plugins/dropdown/blockStyle.js').BlockStylePluginOptions} [blockStyle]
354
+ * @property {import('../../plugins/modal/drawing.js').DrawingPluginOptions} [drawing]
355
+ * @property {import('../../plugins/modal/embed.js').EmbedPluginOptions} [embed]
356
+ * @property {import('../../plugins/command/exportPDF.js').ExportPDFPluginOptions} [exportPDF]
357
+ * @property {import('../../plugins/browser/fileBrowser.js').FileBrowserPluginOptions} [fileBrowser]
358
+ * @property {import('../../plugins/browser/fileGallery.js').FileGalleryPluginOptions} [fileGallery]
359
+ * @property {import('../../plugins/command/fileUpload.js').FileUploadPluginOptions} [fileUpload]
360
+ * @property {import('../../plugins/dropdown/font.js').FontPluginOptions} [font]
361
+ * @property {import('../../plugins/dropdown/fontColor.js').FontColorPluginOptions} [fontColor]
362
+ * @property {import('../../plugins/input/fontSize.js').FontSizePluginOptions} [fontSize]
363
+ * @property {import('../../plugins/dropdown/hr.js').HRPluginOptions} [hr]
364
+ * @property {import('../../plugins/modal/image/index.js').ImagePluginOptions} [image]
365
+ * @property {import('../../plugins/browser/imageGallery.js').ImageGalleryPluginOptions} [imageGallery]
366
+ * @property {import('../../plugins/dropdown/layout.js').LayoutPluginOptions} [layout]
367
+ * @property {import('../../plugins/dropdown/lineHeight.js').LineHeightPluginOptions} [lineHeight]
368
+ * @property {import('../../plugins/modal/link.js').LinkPluginOptions} [link]
369
+ * @property {import('../../plugins/modal/math.js').MathPluginOptions} [math]
370
+ * @property {import('../../plugins/field/mention.js').MentionPluginOptions} [mention]
371
+ * @property {import('../../plugins/dropdown/paragraphStyle.js').ParagraphStylePluginOptions} [paragraphStyle]
372
+ * @property {import('../../plugins/dropdown/table/index.js').TablePluginOptions} [table]
373
+ * @property {import('../../plugins/dropdown/template.js').TemplatePluginOptions} [template]
374
+ * @property {import('../../plugins/dropdown/textStyle.js').TextStylePluginOptions} [textStyle]
375
+ * @property {import('../../plugins/modal/video/index.js').VideoPluginOptions} [video]
376
+ * @property {import('../../plugins/browser/videoGallery.js').VideoGalleryPluginOptions} [videoGallery]
377
+ * ///
378
+ * ---[ End of auto-generated plugin options ]---
379
+ * ================================================================================================================================
380
+ */
381
+ /**
382
+ * ================================================================================================================================
383
+ * @typedef {Object} InternalBaseOptions
384
+ *
385
+ * **Runtime-only base options (computed internally, cannot be set by users)**
386
+ *
387
+ * @property {string} [_themeClass] - Computed className for the selected theme (e.g., `se-theme-default`).
388
+ * @property {string} [_type_options] - Additional sub-type string from the `type` option (after `:`).
389
+ * @property {string} [_allowedExtraTag] - Preprocessed allowed tag string for RegExp (e.g., "mark|figure").
390
+ * @property {string} [_disallowedExtraTag] - Preprocessed disallowed tag string.
391
+ * @property {string} [_editableClass] - Final computed editable class (used in editor wrapper).
392
+ * @property {boolean} [_rtl] - Whether text direction is RTL.
393
+ * @property {string[]} [_reverseCommandArray] - Internal key shortcut matcher for reverse commands.
394
+ * @property {string} [_subMode] - Sub toolbar mode (e.g., `balloon`).
395
+ * @property {string[]} [_textStyleTags] - Tag names used for text styling, plus span/li.
396
+ * @property {RegExp} [_textStylesRegExp] - Regex to match inline styles (e.g., fontSize, color).
397
+ * @property {RegExp} [_lineStylesRegExp] - Regex to match line styles (e.g., text-align, padding).
398
+ * @property {Object<string, string>} [_defaultStyleTagMap] - Mapping HTML tag => standard tag.
399
+ * @property {Object<string, string>} [_styleCommandMap] - Mapping HTML tag => command (e.g., bold, underline).
400
+ * @property {Object<string, string>} [_defaultTagCommand] - Mapping command => preferred tag.
401
+ * @property {string} [_editorElementWhitelist] - Element whitelist regex pattern for the editor.
402
+ *
403
+ * @property {Set} [buttons] - List of currently used toolbar buttons
404
+ * @property {Set} [buttons_sub] - List of currently used sub-toolbar buttons
405
+ * @property {string} [toolbar_sub_width] - Sub-toolbar width.
406
+ * @property {string[]} [reverseCommands] - Merged reverse command pairs array (includes default `indent-outdent` + user's `reverseButtons`).
407
+ *
408
+ * @property {*} [codeMirror] - CodeMirror configuration object from `externalLibs.codeMirror`.
409
+ * @property {boolean} [codeMirror6Editor] - Whether CodeMirror 6 is available (base-level flag). Frame-level stores the actual EditorView instance.
410
+ * @property {boolean} [codeMirror5Editor] - Whether CodeMirror 5 is available (base-level flag). Frame-level stores the actual CM5 instance.
411
+ * @property {boolean} [hasCodeMirror] - Uses CodeMirror for code view.
412
+ *
413
+ * @property {Set<string>} [allUsedStyles] - Processed set of all allowed CSS styles. Converted from user's `string` input ("|" delimited) to `Set<string>` in constructor.
414
+ */
415
+ /**
416
+ * @typedef {EditorBaseOptions & PrivateBaseOptions & EditorFrameOptions} EditorInitOptions
417
+ */
418
+ /**
419
+ * @typedef {EditorBaseOptions & PrivateBaseOptions & InternalBaseOptions} AllBaseOptions
420
+ */
421
+ /**
422
+ * ================================================================================================================================
423
+ * === OPTION FLAGS : Fixed / Resettable
424
+ * =================================================================================================================================
425
+ */
426
+ /**
427
+ * @description For all EditorInitOptions keys, only boolean | null values are allowed.
428
+ * - `fixed` → Immutable / `null` → Resettable.
429
+ * @type {Partial<Object<keyof EditorInitOptions, "fixed" | true>>}
430
+ */
431
+ export const OPTION_FRAME_FIXED_FLAG: Partial<any>;
432
+ /**
433
+ * @description For all EditorInitOptions keys, only boolean | null values are allowed.
434
+ * - `fixed` → Immutable / `null` → Resettable.
435
+ * @type {Partial<Object<keyof EditorInitOptions, "fixed" | true>>}
436
+ */
437
+ export const OPTION_FIXED_FLAG: Partial<any>;
438
+ /**
439
+ * **Frame-level editable area options**
440
+ * -----------------
441
+ *
442
+ * === Content & Editing ===
443
+ */
444
+ export type EditorFrameOptions = {
445
+ /**
446
+ * - Initial value for the editor.
447
+ */
448
+ value?: string;
449
+ /**
450
+ * - Placeholder text.
451
+ */
452
+ placeholder?: string;
453
+ /**
454
+ * - Attributes for the editable frame[.sun-editor-editable]. (e.g. [key]: value)
455
+ * ///
456
+ *
457
+ * === Layout & Sizing ===
458
+ */
459
+ editableFrameAttributes?: {
460
+ [x: string]: string;
461
+ };
462
+ /**
463
+ * - Width for the editor.
464
+ */
465
+ width?: string | number;
466
+ /**
467
+ * - Min width for the editor.
468
+ */
469
+ minWidth?: string | number;
470
+ /**
471
+ * - Max width for the editor.
472
+ */
473
+ maxWidth?: string | number;
474
+ /**
475
+ * - Height for the editor.
476
+ */
477
+ height?: string | number;
478
+ /**
479
+ * - Min height for the editor.
480
+ */
481
+ minHeight?: string | number;
482
+ /**
483
+ * - Max height for the editor.
484
+ */
485
+ maxHeight?: string | number;
486
+ /**
487
+ * - Style string of the top frame of the editor. (e.g. "border: 1px solid #ccc;").
488
+ * ///
489
+ *
490
+ * === Iframe Mode ===
491
+ */
492
+ editorStyle?: string;
493
+ /**
494
+ * - Content will be placed in an iframe and isolated from the rest of the page.
495
+ */
496
+ iframe?: boolean;
497
+ /**
498
+ * - Allows the usage of HTML, HEAD, BODY tags and DOCTYPE declaration on the `iframe`.
499
+ */
500
+ iframe_fullPage?: boolean;
501
+ /**
502
+ * - Attributes of the `iframe`. (e.g. {'allow-scripts': 'true'})
503
+ */
504
+ iframe_attributes?: {
505
+ [x: string]: string;
506
+ };
507
+ /**
508
+ * - CSS files to apply inside the iframe.
509
+ * - String: Filename pattern to search in document <link> tags (e.g. "suneditor" or "suneditor.[a-z0-9]+" matches "suneditor.abc123.css")
510
+ * - "*": Wildcard to include ALL stylesheets from the page
511
+ * - Array: Multiple patterns (e.g. ["suneditor", "custom", "*"])
512
+ * - Absolute URLs and data URLs (data:text/css,) are also supported
513
+ * ///
514
+ *
515
+ * === Statusbar & Character Counter ===
516
+ */
517
+ iframe_cssFileName?: Array<string>;
518
+ /**
519
+ * - Enables the status bar.
520
+ */
521
+ statusbar?: boolean;
522
+ /**
523
+ * - Displays the current node structure to status bar.
524
+ */
525
+ statusbar_showPathLabel?: boolean;
526
+ /**
527
+ * - Enables resize function of bottom status bar
528
+ */
529
+ statusbar_resizeEnable?: boolean;
530
+ /**
531
+ * - Shows the number of characters in the editor.
532
+ * - If the `maxCharCount` option has a value, it becomes `true`.
533
+ */
534
+ charCounter?: boolean;
535
+ /**
536
+ * - The maximum number of characters allowed to be inserted into the editor.
537
+ */
538
+ charCounter_max?: number | null;
539
+ /**
540
+ * - Text to be displayed in the `charCounter` area of the bottom bar. (e.g. "Characters : 20/200")
541
+ */
542
+ charCounter_label?: string | null;
543
+ /**
544
+ * - Defines the calculation method of the `charCounter` option.
545
+ * - `char`: Characters length.
546
+ * - `byte`: Binary data size of characters.
547
+ * - `byte-html`: Binary data size of the full HTML string.
548
+ */
549
+ charCounter_type?: 'char' | 'byte' | 'byte-html';
550
+ };
551
+ export type OptionStyleResult = {
552
+ /**
553
+ * - Styles applied to the top container (e.g. width, z-index, etc).
554
+ */
555
+ top: string;
556
+ /**
557
+ * - Styles applied to the iframe container (e.g. height, min-height).
558
+ */
559
+ frame: string;
560
+ /**
561
+ * - Styles applied to the editable content area.
562
+ */
563
+ editor: string;
564
+ };
565
+ /**
566
+ * **Runtime-only frame options (computed internally, cannot be set by users)**
567
+ */
568
+ export type InternalFrameOptions = {
569
+ /**
570
+ * - Status bar event configuration.
571
+ */
572
+ __statusbarEvent?: any;
573
+ /**
574
+ * - origin frame options
575
+ */
576
+ _origin: SunEditor.InitFrameOptions;
577
+ /**
578
+ * - Enables fixed positioning for the editor frame.
579
+ */
580
+ _defaultStyles?: OptionStyleResult;
581
+ /**
582
+ * - CodeMirror5 editor instance (frame-level). Set by `_checkCodeMirror` after initialization.
583
+ */
584
+ codeMirror5Editor?: any;
585
+ /**
586
+ * - CodeMirror6 EditorView instance (frame-level). Set by `_checkCodeMirror` after initialization.
587
+ */
588
+ codeMirror6Editor?: any;
589
+ };
590
+ export type AllFrameOptions = EditorFrameOptions & InternalFrameOptions;
591
+ export type TransformedFrameOptionKeys = 'width' | 'minWidth' | 'maxWidth' | 'height' | 'minHeight' | 'maxHeight';
592
+ export type TransformedFrameOptions = {
593
+ width: string;
594
+ minWidth: string;
595
+ maxWidth: string;
596
+ height: string;
597
+ minHeight: string;
598
+ maxHeight: string;
599
+ };
600
+ export type ProcessedFrameOptions = Omit<AllFrameOptions, TransformedFrameOptionKeys> & TransformedFrameOptions;
601
+ /**
602
+ * **Advanced internal options (user-configurable, prefixed with `__`)**
603
+ * -----------------
604
+ *
605
+ * === Defaults & Whitelists ===
606
+ */
607
+ export type PrivateBaseOptions = {
608
+ /**
609
+ * - The basic tags that serves as the base for `textStyleTags`
610
+ * - The default follows {@link DEFAULTS.TEXT_STYLE_TAGS}
611
+ */
612
+ __textStyleTags?: string;
613
+ /**
614
+ * - The basic tags that serves as the base for `tagStyles`
615
+ * - The default follows {@link DEFAULTS.TAG_STYLES}
616
+ */
617
+ __tagStyles?: {
618
+ [x: string]: string;
619
+ };
620
+ /**
621
+ * - A custom string used to construct a list of HTML elements to allow.
622
+ * - The final list of allowed elements (regex pattern) is dynamically generated according to the following rules:
623
+ * - A list of required elements, {@link DEFAULTS.REQUIRED_ELEMENT_WHITELIST}, is always included.
624
+ * - If a string value is provided for this option (`__defaultElementWhitelist`):** That string value is used.
625
+ * - If this option is not provided or is not a string: The default constant {@link DEFAULTS.ELEMENT_WHITELIST} is used.
626
+ * - 1. If no options are given, the final pattern is:
627
+ * - 'a|img|p|div|...' (REQUIRED + DEFAULT)
628
+ * - 2. If options are given directly, the final pattern is:
629
+ * - 'a|img|custom|tags' (REQUIRED + options.__defaultElementWhitelist)
630
+ */
631
+ __defaultElementWhitelist?: string;
632
+ /**
633
+ * - A complete list of attributes that are allowed by default on all tags. Delimiter: "|" (e.g. "href|target").
634
+ * - The default follows {@link DEFAULTS.ATTRIBUTE_WHITELIST}///
635
+ *
636
+ * === Formatting ===
637
+ */
638
+ __defaultAttributeWhitelist?: string;
639
+ /**
640
+ * - Specifies the tag to be used as the editor's default `line` element.
641
+ * - The default follows {@link DEFAULTS.FORMAT_LINE}
642
+ */
643
+ __defaultFormatLine?: string;
644
+ /**
645
+ * - Specifies the tag to be used as the editor's default `brLine` element.
646
+ * - The default follows {@link DEFAULTS.FORMAT_BR_LINE}
647
+ */
648
+ __defaultFormatBrLine?: string;
649
+ /**
650
+ * - Specifies the tag to be used as the editor's default `closureBrLine` element.
651
+ * - The default follows {@link DEFAULTS.FORMAT_CLOSURE_BR_LINE}
652
+ */
653
+ __defaultFormatClosureBrLine?: string;
654
+ /**
655
+ * - Specifies the tag to be used as the editor's default `block` element.
656
+ * - The default follows {@link DEFAULTS.FORMAT_BLOCK}
657
+ */
658
+ __defaultFormatBlock?: string;
659
+ /**
660
+ * - Specifies the tag to be used as the editor's default `closureBlock` element.
661
+ * - The default follows {@link DEFAULTS.FORMAT_CLOSURE_BLOCK}///
662
+ *
663
+ * === Filters & Behavior ===
664
+ */
665
+ __defaultFormatClosureBlock?: string;
666
+ /**
667
+ * - Line format filter configuration.
668
+ */
669
+ __lineFormatFilter?: boolean;
670
+ /**
671
+ * - Defines the list of styles that are applied directly to the `<li>` element
672
+ * - when a text style is applied to the entire list item.
673
+ * - For example, when changing the font size or color of a list item (`<li>`),
674
+ * - these styles will be applied to the `<li>` tag instead of wrapping the content inside additional tags.
675
+ */
676
+ __listCommonStyle?: Array<string>;
677
+ /**
678
+ * - Plugin retain filter configuration. (Internal use primarily)
679
+ * - You can turn it off/on globally with `true`/`false` or set it per plugin. (e.g. { table: false })
680
+ */
681
+ __pluginRetainFilter?:
682
+ | {
683
+ pluginName: string;
684
+ we: boolean;
685
+ }
686
+ | boolean;
687
+ };
688
+ /**
689
+ * **Top-level editor configuration**
690
+ * -----------------
691
+ *
692
+ * === Plugins & Toolbar ===
693
+ */
694
+ export type EditorBaseOptions = {
695
+ /**
696
+ * - Plugin configuration.
697
+ */
698
+ plugins?:
699
+ | {
700
+ [x: string]: any;
701
+ }
702
+ | Array<{
703
+ [x: string]: any;
704
+ }>;
705
+ /**
706
+ * - Plugin configuration.
707
+ */
708
+ excludedPlugins?: Array<string>;
709
+ /**
710
+ * - List of toolbar buttons, grouped by sub-arrays.
711
+ * - The default follows {@link DEFAULTS.BUTTON_LIST}///
712
+ *
713
+ * === Modes & Themes ===
714
+ */
715
+ buttonList?: SunEditor.UI.ButtonList;
716
+ /**
717
+ * - Enables migration mode for SunEditor v2.
718
+ */
719
+ v2Migration?: boolean;
720
+ /**
721
+ * - Toolbar mode: `classic`, `inline`, `balloon`, `balloon-always`.
722
+ */
723
+ mode?: 'classic' | 'inline' | 'balloon' | 'balloon-always';
724
+ /**
725
+ * - Editor type: `document:header,page`.
726
+ */
727
+ type?: string;
728
+ /**
729
+ * - Editor theme.
730
+ */
731
+ theme?: string;
732
+ /**
733
+ * - Language configuration. default : EN
734
+ */
735
+ lang?: {
736
+ [x: string]: string;
737
+ };
738
+ /**
739
+ * - Overrides the default icons.
740
+ */
741
+ icons?: {
742
+ [x: string]: string;
743
+ };
744
+ /**
745
+ * - Text direction: `ltr` or `rtl`.
746
+ */
747
+ textDirection?: 'ltr' | 'rtl';
748
+ /**
749
+ * - An array of command pairs whose shortcut icons should be opposite each other, depending on the `textDirection` mode.
750
+ * ///
751
+ *
752
+ * === Strict & Advanced Filtering ===
753
+ */
754
+ reverseButtons?: Array<string>;
755
+ /**
756
+ * - Enables strict filtering of tags, attributes, and styles.
757
+ * - Use `true` to enable all filters (default), or an object to control individual filters.
758
+ * - Setting `false` is not supported; use the object form to disable specific filters instead.
759
+ */
760
+ strictMode?:
761
+ | true
762
+ | {
763
+ tagFilter: boolean;
764
+ formatFilter: boolean;
765
+ classFilter: boolean;
766
+ textStyleTagFilter: boolean;
767
+ attrFilter: boolean;
768
+ styleFilter: boolean;
769
+ };
770
+ /**
771
+ * - Tags treated as whole units when selecting all content.
772
+ * - The default follows {@link DEFAULTS.SCOPE_SELECTION_TAGS}///
773
+ *
774
+ * === Content Filtering & Formatting ===
775
+ * ==
776
+ * #### 1) Tag & Element Control
777
+ */
778
+ scopeSelectionTags?: Array<string>;
779
+ /**
780
+ * - Specifies HTML elements to additionally allow beyond the 'default' allow list. Delimiter: "|" (e.g. "p|div", "*").
781
+ * - The value entered here will be added to the end of the default list determined by the {@link PrivateBaseOptions.__defaultElementWhitelist} logic above.
782
+ */
783
+ elementWhitelist?: string;
784
+ /**
785
+ * - Filters by specifying HTML elements that should not be used. Delimiter: "|" (e.g. "script|style").
786
+ * - Tags specified here will eventually be removed, even if they are included in other whitelists.
787
+ */
788
+ elementBlacklist?: string;
789
+ /**
790
+ * - A list of tags that are allowed to be kept even if their values are empty.
791
+ * - The default follows {@link DEFAULTS.ALLOWED_EMPTY_NODE_LIST}- It is concatenated with the value of `ALLOWED_EMPTY_NODE_LIST` to form the final `allowedEmptyTags` list.
792
+ */
793
+ allowedEmptyTags?: string;
794
+ /**
795
+ * - Allowed class names.
796
+ * - Added the default value {@link DEFAULTS.CLASS_NAME}///
797
+ *
798
+ * #### 2) Attribute Control
799
+ */
800
+ allowedClassName?: string;
801
+ /**
802
+ * - Specifies additional attributes to allow for each tag. (e.g. {a: "href|target", img: "src|alt", "*": "id"}).
803
+ * - Rules for objects specified here will be merged into the {@link PrivateBaseOptions.__defaultAttributeWhitelist}.
804
+ */
805
+ attributeWhitelist?: {
806
+ [key: string]: string | undefined;
807
+ };
808
+ /**
809
+ * - Filter by specifying attributes to disallow by tag. (e.g. {a: "href|target", img: "src|alt", "*": "name"}).
810
+ * - Attributes specified here will eventually be removed even if they are allowed by other settings.
811
+ * - A list of required elements, {@link DEFAULTS.REQUIRED_FORMAT_LINE}, is always included.
812
+ * ///
813
+ *
814
+ * #### 3) Text & Inline Style Control
815
+ */
816
+ attributeBlacklist?: {
817
+ [key: string]: string | undefined;
818
+ };
819
+ /**
820
+ * - Additional text style tags.
821
+ * - The default follows {@link PrivateBaseOptions.__textStyleTags}
822
+ */
823
+ textStyleTags?: string;
824
+ /**
825
+ * - Maps text styles to specific HTML tags.
826
+ */
827
+ convertTextTags?: {
828
+ [x: string]: string;
829
+ };
830
+ /**
831
+ * - Specifies additional styles to the list of allowed styles. Delimiter: "|" (e.g. "color|background-color").
832
+ */
833
+ allUsedStyles?: string;
834
+ /**
835
+ * - Specifies allowed styles for HTML tags.
836
+ */
837
+ tagStyles?: {
838
+ [x: string]: string;
839
+ };
840
+ /**
841
+ * - Specifies allowed styles for the `span` tag.
842
+ * - The default follows {@link DEFAULTS.SPAN_STYLES}
843
+ */
844
+ spanStyles?: string;
845
+ /**
846
+ * - Specifies allowed styles for the `line` element (p..).
847
+ * - The default follows {@link DEFAULTS.LINE_STYLES}
848
+ */
849
+ lineStyles?: string;
850
+ /**
851
+ * - Allowed font size units.
852
+ * - The default follows {@link DEFAULTS.SIZE_UNITS}
853
+ */
854
+ fontSizeUnits?: Array<string>;
855
+ /**
856
+ * - This option determines how inline elements (such as <span>, <strong>, etc.) are handled when deleting text.
857
+ * - `repeat`: Inline styles are retained unless the backspace key is repeatedly pressed. If the user continuously presses backspace, the styles will eventually be removed.
858
+ * - `none`: Inline styles are not retained at all. When deleting text, the associated inline elements are immediately removed along with it.
859
+ * - `always`: Inline styles persist indefinitely unless explicitly removed. Even if all text inside an inline element is deleted, the element itself remains until manually removed.
860
+ * ///
861
+ *
862
+ * #### 4) Line & Block Formatting
863
+ */
864
+ retainStyleMode?: 'repeat' | 'always' | 'none';
865
+ /**
866
+ * - Default `line` element when inserting new lines.
867
+ */
868
+ defaultLine?: string;
869
+ /**
870
+ * - Specifies the default line break format.
871
+ * - [Recommended] `line` : is a line break that is divided into general tags.
872
+ * - [Not recommended] `br` : Line breaks are treated as <br> on the same line. (like shift+enter)
873
+ * - Line breaks are handled as <br> within `line`.
874
+ * - You can create a new `line` by entering a line break twice in a row.
875
+ * - Formats that include `line`, such as "Quote", still operate on a `line` basis.
876
+ * - suneditor processes work in `line` units.
877
+ * - When set to `br`, performance may decrease when editing a lot of data.
878
+ */
879
+ defaultLineBreakFormat?: 'line' | 'br';
880
+ /**
881
+ * - Line properties that should be reset when changing lines (e.g. "id|name").
882
+ */
883
+ lineAttrReset?: string;
884
+ /**
885
+ * - Additionally allowed `line` elements beyond the default. Delimiter: "|" (e.g. "p|div").
886
+ * It is concatenated with the value of {@link PrivateBaseOptions.__defaultFormatLine} to form the final `line` element list.
887
+ * - `line` element also contain `brLine` element
888
+ */
889
+ formatLine?: string;
890
+ /**
891
+ * - Additionally allowed `brLine` elements beyond the default. (e.g. "PRE").
892
+ * - It is concatenated with the value of {@link PrivateBaseOptions.__defaultFormatBrLine} to form the final `brLine` element list.
893
+ * - `brLine` elements is included in the `line` element.
894
+ * - `brLine` elements's line break is `BR` tag.
895
+ * ※ Entering the Enter key in the space on the last line ends `brLine` and appends `line`.
896
+ */
897
+ formatBrLine?: string;
898
+ /**
899
+ * - Additionally allowed `closureBrLine` elements beyond the default.
900
+ * - It is concatenated with the value of {@link PrivateBaseOptions.__defaultFormatClosureBrLine} to form the final `closureBrLine` element list.
901
+ * - `closureBrLine` elements is included in the `brLine`.
902
+ * - `closureBrLine` elements's line break is `BR` tag.
903
+ * - ※ You cannot exit this format with the Enter key or Backspace key.
904
+ * - ※ Use it only in special cases. ([ex] format of table cells)
905
+ */
906
+ formatClosureBrLine?: string;
907
+ /**
908
+ * - Additionally allowed `block` elements beyond the default.
909
+ * - It is concatenated with the value of {@link PrivateBaseOptions.__defaultFormatBlock} to form the final `block` element list.
910
+ * - `block` is wrap the `line` and `component`
911
+ */
912
+ formatBlock?: string;
913
+ /**
914
+ * - Additionally allowed `closureBlock` elements beyond the default.
915
+ * - It is concatenated with the value of {@link PrivateBaseOptions.__defaultFormatClosureBlock} to form the final `closureBlock` element list.
916
+ * - `closureBlock` elements is included in the `block`.
917
+ * - `closureBlock` element is wrap the `line` and `component`
918
+ * - ※ You cannot exit this format with the Enter key or Backspace key.
919
+ * - ※ Use it only in special cases. (e.g. format of table cells)
920
+ * ///
921
+ *
922
+ * === UI & Interaction ===
923
+ */
924
+ formatClosureBlock?: string;
925
+ /**
926
+ * - Closes modals when clicking outside.
927
+ */
928
+ closeModalOutsideClick?: boolean;
929
+ /**
930
+ * - Synchronizes tab indent with spaces.
931
+ */
932
+ syncTabIndent?: boolean;
933
+ /**
934
+ * - Disables tab key input.
935
+ */
936
+ tabDisable?: boolean;
937
+ /**
938
+ * - Toolbar width.
939
+ */
940
+ toolbar_width?: string;
941
+ /**
942
+ * - Container element for the toolbar.
943
+ */
944
+ toolbar_container?: HTMLElement | null;
945
+ /**
946
+ * - Enables sticky toolbar with optional offset.
947
+ */
948
+ toolbar_sticky?: number;
949
+ /**
950
+ * - Hides toolbar initially.
951
+ */
952
+ toolbar_hide?: boolean;
953
+ /**
954
+ * - Sub-toolbar configuration.
955
+ */
956
+ subToolbar?: {
957
+ buttonList?: SunEditor.UI.ButtonList;
958
+ mode?: 'balloon' | 'balloon-always';
959
+ width?: string;
960
+ };
961
+ /**
962
+ * - Container element for the status bar.
963
+ */
964
+ statusbar_container?: HTMLElement | null;
965
+ /**
966
+ * - Displays shortcut hints in tooltips.
967
+ */
968
+ shortcutsHint?: boolean;
969
+ /**
970
+ * - Disables keyboard shortcuts.
971
+ */
972
+ shortcutsDisable?: boolean;
973
+ /**
974
+ * - Custom keyboard shortcuts.
975
+ * ///
976
+ *
977
+ * === Advanced Features ===
978
+ */
979
+ shortcuts?: {
980
+ [key: string]: Array<string> | undefined;
981
+ };
982
+ /**
983
+ * - Keeps the format of the copied content.
984
+ */
985
+ copyFormatKeepOn?: boolean;
986
+ /**
987
+ * - Automatically converts URLs into hyperlinks. (`Link` plugin required)
988
+ * - Default value is determined dynamically based on whether the `link` plugin is enabled. (default : `Boolean(plugins.link)`)
989
+ */
990
+ autoLinkify?: boolean;
991
+ /**
992
+ * - Styles applied automatically on text input.
993
+ */
994
+ autoStyleify?: Array<string>;
995
+ /**
996
+ * - Delay time for history stack updates (ms).
997
+ */
998
+ historyStackDelayTime?: number;
999
+ /**
1000
+ * - Class name for printing.
1001
+ */
1002
+ printClass?: string;
1003
+ /**
1004
+ * - Offset applied when entering fullscreen mode.
1005
+ */
1006
+ fullScreenOffset?: number;
1007
+ /**
1008
+ * - Custom template for preview mode.
1009
+ */
1010
+ previewTemplate?: string | null;
1011
+ /**
1012
+ * - Custom template for print mode.
1013
+ */
1014
+ printTemplate?: string | null;
1015
+ /**
1016
+ * - Enables automatic selection of inserted components.
1017
+ * - For inline components: places the cursor near the inserted component or selects it if no nearby range is available.
1018
+ * - For block components: executes behavior based on `selectMode`:
1019
+ * - `auto`: Move cursor to the next line if possible, otherwise select the component.
1020
+ * - `select`: Always select the inserted component.
1021
+ * - `line`: Move cursor to the next line if possible, or create a new line and move there.
1022
+ * - `none`: Do nothing.
1023
+ */
1024
+ componentInsertBehavior?: SunEditor.ComponentInsertType;
1025
+ /**
1026
+ * - Default URL protocol for links.
1027
+ */
1028
+ defaultUrlProtocol?: string | null;
1029
+ /**
1030
+ * - {"copy": 1500} - Duration for displaying toast messages.
1031
+ */
1032
+ toastMessageTime?: any;
1033
+ /**
1034
+ * - Enables free code view mode.
1035
+ *
1036
+ * === Dynamic Options ===
1037
+ */
1038
+ freeCodeViewMode?: boolean;
1039
+ /**
1040
+ * - External libraries like CodeMirror or MathJax. See {@link https://github.com/ARA-developer/suneditor/blob/develop/guide/external-libraries.md External Libraries Guide}
1041
+ */
1042
+ externalLibs?: {
1043
+ [x: string]: any;
1044
+ };
1045
+ /**
1046
+ * - Specifies extra allowed or disallowed tags.
1047
+ * - The default follows {@link DEFAULTS.EXTRA_TAG_MAP}///
1048
+ *
1049
+ * === User Events ===
1050
+ */
1051
+ allowedExtraTags?: {
1052
+ [x: string]: boolean;
1053
+ };
1054
+ /**
1055
+ * - User event handlers configuration
1056
+ * ///
1057
+ *
1058
+ * === [ Plugin-Specific Options ] ===
1059
+ * ---[ Auto-generated by scripts/check/inject-plugin-jsdoc.cjs - DO NOT EDIT MANUALLY ]---
1060
+ */
1061
+ events?: SunEditor.Event.Handlers;
1062
+ align?: import('../../plugins/dropdown/align.js').AlignPluginOptions;
1063
+ audio?: import('../../plugins/modal/audio.js').AudioPluginOptions;
1064
+ audioGallery?: import('../../plugins/browser/audioGallery.js').AudioGalleryPluginOptions;
1065
+ backgroundColor?: import('../../plugins/dropdown/backgroundColor.js').BackgroundColorPluginOptions;
1066
+ blockStyle?: import('../../plugins/dropdown/blockStyle.js').BlockStylePluginOptions;
1067
+ drawing?: import('../../plugins/modal/drawing.js').DrawingPluginOptions;
1068
+ embed?: import('../../plugins/modal/embed.js').EmbedPluginOptions;
1069
+ exportPDF?: import('../../plugins/command/exportPDF.js').ExportPDFPluginOptions;
1070
+ fileBrowser?: import('../../plugins/browser/fileBrowser.js').FileBrowserPluginOptions;
1071
+ fileGallery?: import('../../plugins/browser/fileGallery.js').FileGalleryPluginOptions;
1072
+ fileUpload?: import('../../plugins/command/fileUpload.js').FileUploadPluginOptions;
1073
+ font?: import('../../plugins/dropdown/font.js').FontPluginOptions;
1074
+ fontColor?: import('../../plugins/dropdown/fontColor.js').FontColorPluginOptions;
1075
+ fontSize?: import('../../plugins/input/fontSize.js').FontSizePluginOptions;
1076
+ hr?: import('../../plugins/dropdown/hr.js').HRPluginOptions;
1077
+ image?: import('../../plugins/modal/image/index.js').ImagePluginOptions;
1078
+ imageGallery?: import('../../plugins/browser/imageGallery.js').ImageGalleryPluginOptions;
1079
+ layout?: import('../../plugins/dropdown/layout.js').LayoutPluginOptions;
1080
+ lineHeight?: import('../../plugins/dropdown/lineHeight.js').LineHeightPluginOptions;
1081
+ link?: import('../../plugins/modal/link.js').LinkPluginOptions;
1082
+ math?: import('../../plugins/modal/math.js').MathPluginOptions;
1083
+ mention?: import('../../plugins/field/mention.js').MentionPluginOptions;
1084
+ paragraphStyle?: import('../../plugins/dropdown/paragraphStyle.js').ParagraphStylePluginOptions;
1085
+ table?: import('../../plugins/dropdown/table/index.js').TablePluginOptions;
1086
+ template?: import('../../plugins/dropdown/template.js').TemplatePluginOptions;
1087
+ textStyle?: import('../../plugins/dropdown/textStyle.js').TextStylePluginOptions;
1088
+ video?: import('../../plugins/modal/video/index.js').VideoPluginOptions;
1089
+ /**
1090
+ * ///
1091
+ * ---[ End of auto-generated plugin options ]---
1092
+ * ================================================================================================================================
1093
+ */
1094
+ videoGallery?: import('../../plugins/browser/videoGallery.js').VideoGalleryPluginOptions;
1095
+ };
1096
+ /**
1097
+ * **Runtime-only base options (computed internally, cannot be set by users)**
1098
+ */
1099
+ export type InternalBaseOptions = {
1100
+ /**
1101
+ * - Computed className for the selected theme (e.g., `se-theme-default`).
1102
+ */
1103
+ _themeClass?: string;
1104
+ /**
1105
+ * - Additional sub-type string from the `type` option (after `:`).
1106
+ */
1107
+ _type_options?: string;
1108
+ /**
1109
+ * - Preprocessed allowed tag string for RegExp (e.g., "mark|figure").
1110
+ */
1111
+ _allowedExtraTag?: string;
1112
+ /**
1113
+ * - Preprocessed disallowed tag string.
1114
+ */
1115
+ _disallowedExtraTag?: string;
1116
+ /**
1117
+ * - Final computed editable class (used in editor wrapper).
1118
+ */
1119
+ _editableClass?: string;
1120
+ /**
1121
+ * - Whether text direction is RTL.
1122
+ */
1123
+ _rtl?: boolean;
1124
+ /**
1125
+ * - Internal key shortcut matcher for reverse commands.
1126
+ */
1127
+ _reverseCommandArray?: string[];
1128
+ /**
1129
+ * - Sub toolbar mode (e.g., `balloon`).
1130
+ */
1131
+ _subMode?: string;
1132
+ /**
1133
+ * - Tag names used for text styling, plus span/li.
1134
+ */
1135
+ _textStyleTags?: string[];
1136
+ /**
1137
+ * - Regex to match inline styles (e.g., fontSize, color).
1138
+ */
1139
+ _textStylesRegExp?: RegExp;
1140
+ /**
1141
+ * - Regex to match line styles (e.g., text-align, padding).
1142
+ */
1143
+ _lineStylesRegExp?: RegExp;
1144
+ /**
1145
+ * - Mapping HTML tag => standard tag.
1146
+ */
1147
+ _defaultStyleTagMap?: {
1148
+ [x: string]: string;
1149
+ };
1150
+ /**
1151
+ * - Mapping HTML tag => command (e.g., bold, underline).
1152
+ */
1153
+ _styleCommandMap?: {
1154
+ [x: string]: string;
1155
+ };
1156
+ /**
1157
+ * - Mapping command => preferred tag.
1158
+ */
1159
+ _defaultTagCommand?: {
1160
+ [x: string]: string;
1161
+ };
1162
+ /**
1163
+ * - Element whitelist regex pattern for the editor.
1164
+ */
1165
+ _editorElementWhitelist?: string;
1166
+ /**
1167
+ * - List of currently used toolbar buttons
1168
+ */
1169
+ buttons?: Set<any>;
1170
+ /**
1171
+ * - List of currently used sub-toolbar buttons
1172
+ */
1173
+ buttons_sub?: Set<any>;
1174
+ /**
1175
+ * - Sub-toolbar width.
1176
+ */
1177
+ toolbar_sub_width?: string;
1178
+ /**
1179
+ * - Merged reverse command pairs array (includes default `indent-outdent` + user's `reverseButtons`).
1180
+ */
1181
+ reverseCommands?: string[];
1182
+ /**
1183
+ * - CodeMirror configuration object from `externalLibs.codeMirror`.
1184
+ */
1185
+ codeMirror?: any;
1186
+ /**
1187
+ * - Whether CodeMirror 6 is available (base-level flag). Frame-level stores the actual EditorView instance.
1188
+ */
1189
+ codeMirror6Editor?: boolean;
1190
+ /**
1191
+ * - Whether CodeMirror 5 is available (base-level flag). Frame-level stores the actual CM5 instance.
1192
+ */
1193
+ codeMirror5Editor?: boolean;
1194
+ /**
1195
+ * - Uses CodeMirror for code view.
1196
+ */
1197
+ hasCodeMirror?: boolean;
1198
+ /**
1199
+ * - Processed set of all allowed CSS styles. Converted from user's `string` input ("|" delimited) to `Set<string>` in constructor.
1200
+ */
1201
+ allUsedStyles?: Set<string>;
1202
+ };
1203
+ export type EditorInitOptions = EditorBaseOptions & PrivateBaseOptions & EditorFrameOptions;
1204
+ export type AllBaseOptions = EditorBaseOptions & PrivateBaseOptions & InternalBaseOptions;
1205
+ export type TransformedOptionKeys = 'formatClosureBrLine' | 'formatBrLine' | 'formatLine' | 'formatClosureBlock' | 'formatBlock' | 'toolbar_width' | 'toolbar_container' | 'toolbar_sticky' | 'strictMode' | 'lineAttrReset';
1206
+ export type StrictModeOptions = {
1207
+ tagFilter: boolean;
1208
+ formatFilter: boolean;
1209
+ classFilter: boolean;
1210
+ textStyleTagFilter: boolean;
1211
+ attrFilter: boolean;
1212
+ styleFilter: boolean;
1213
+ };
1214
+ export type TransformedOptions = {
1215
+ formatClosureBrLine: {
1216
+ reg: RegExp;
1217
+ str: string;
1218
+ };
1219
+ formatBrLine: {
1220
+ reg: RegExp;
1221
+ str: string;
1222
+ };
1223
+ formatLine: {
1224
+ reg: RegExp;
1225
+ str: string;
1226
+ };
1227
+ formatClosureBlock: {
1228
+ reg: RegExp;
1229
+ str: string;
1230
+ };
1231
+ formatBlock: {
1232
+ reg: RegExp;
1233
+ str: string;
1234
+ };
1235
+ toolbar_width: string;
1236
+ toolbar_container: HTMLElement | null;
1237
+ toolbar_sticky: number;
1238
+ strictMode: StrictModeOptions;
1239
+ lineAttrReset: string[];
1240
+ };
1241
+ export type ProcessedBaseOptions = Omit<AllBaseOptions, TransformedOptionKeys> & TransformedOptions;