suneditor 3.1.3 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/suneditor-contents.min.css +1 -1
  2. package/dist/suneditor.min.css +28 -1
  3. package/dist/suneditor.min.js +1 -1
  4. package/package.json +2 -1
  5. package/src/assets/design/color.css +12 -0
  6. package/src/assets/design/size.css +9 -2
  7. package/src/assets/icons/defaultIcons.js +96 -47
  8. package/src/assets/suneditor-contents.css +3 -2
  9. package/src/assets/suneditor.css +480 -31
  10. package/src/core/config/contextProvider.js +2 -1
  11. package/src/core/config/eventManager.js +41 -2
  12. package/src/core/config/optionProvider.js +23 -2
  13. package/src/core/editor.js +32 -14
  14. package/src/core/event/actions/index.js +76 -9
  15. package/src/core/event/effects/common.registry.js +2 -1
  16. package/src/core/event/effects/keydown.registry.js +169 -33
  17. package/src/core/event/effects/ruleHelpers.js +20 -6
  18. package/src/core/event/eventOrchestrator.js +136 -23
  19. package/src/core/event/handlers/handler_toolbar.js +4 -2
  20. package/src/core/event/handlers/handler_ww_dragDrop.js +10 -0
  21. package/src/core/event/handlers/handler_ww_input.js +9 -2
  22. package/src/core/event/handlers/handler_ww_key.js +86 -17
  23. package/src/core/event/handlers/handler_ww_mouse.js +45 -8
  24. package/src/core/event/ports.js +23 -5
  25. package/src/core/event/reducers/keydown.reducer.js +15 -2
  26. package/src/core/event/rules/keydown.rule.arrow.js +12 -2
  27. package/src/core/event/rules/keydown.rule.backspace.js +110 -15
  28. package/src/core/event/rules/keydown.rule.delete.js +62 -7
  29. package/src/core/event/rules/keydown.rule.enter.js +62 -31
  30. package/src/core/event/support/defaultLineManager.js +9 -2
  31. package/src/core/event/support/selectionState.js +13 -3
  32. package/src/core/kernel/coreKernel.js +1 -0
  33. package/src/core/logic/dom/char.js +13 -3
  34. package/src/core/logic/dom/format.js +171 -39
  35. package/src/core/logic/dom/html.js +357 -87
  36. package/src/core/logic/dom/inline.js +229 -34
  37. package/src/core/logic/dom/listFormat.js +111 -20
  38. package/src/core/logic/dom/nodeTransform.js +36 -11
  39. package/src/core/logic/dom/offset.js +116 -31
  40. package/src/core/logic/dom/selection.js +147 -29
  41. package/src/core/logic/panel/blockHandle.js +785 -0
  42. package/src/core/logic/panel/blockResolver.js +278 -0
  43. package/src/core/logic/panel/finder.js +16 -6
  44. package/src/core/logic/panel/menu.js +119 -18
  45. package/src/core/logic/panel/toolbar.js +75 -19
  46. package/src/core/logic/panel/viewer.js +76 -20
  47. package/src/core/logic/shell/_commandExecutor.js +44 -9
  48. package/src/core/logic/shell/commandDispatcher.js +46 -4
  49. package/src/core/logic/shell/component.js +102 -25
  50. package/src/core/logic/shell/focusManager.js +13 -3
  51. package/src/core/logic/shell/history.js +21 -6
  52. package/src/core/logic/shell/pluginManager.js +21 -13
  53. package/src/core/logic/shell/shortcuts.js +9 -1
  54. package/src/core/logic/shell/ui.js +139 -37
  55. package/src/core/schema/frameContext.js +34 -3
  56. package/src/core/schema/options.js +61 -19
  57. package/src/core/section/constructor.js +537 -103
  58. package/src/core/section/documentType.js +35 -6
  59. package/src/helper/converter.js +24 -7
  60. package/src/helper/dom/domCheck.js +25 -5
  61. package/src/helper/dom/domQuery.js +2 -1
  62. package/src/helper/dom/domUtils.js +17 -4
  63. package/src/helper/env.js +11 -2
  64. package/src/helper/keyCodeMap.js +6 -2
  65. package/src/helper/markdown.js +24 -5
  66. package/src/helper/msOffice.js +9 -2
  67. package/src/interfaces/plugins.js +1 -1
  68. package/src/langs/ckb.js +0 -1
  69. package/src/langs/cs.js +0 -1
  70. package/src/langs/da.js +0 -1
  71. package/src/langs/de.js +0 -1
  72. package/src/langs/en.js +0 -1
  73. package/src/langs/es.js +0 -1
  74. package/src/langs/fa.js +0 -1
  75. package/src/langs/fr.js +0 -1
  76. package/src/langs/he.js +0 -1
  77. package/src/langs/hu.js +0 -1
  78. package/src/langs/index.js +27 -1
  79. package/src/langs/it.js +0 -1
  80. package/src/langs/ja.js +0 -1
  81. package/src/langs/km.js +0 -1
  82. package/src/langs/ko.js +0 -1
  83. package/src/langs/lv.js +0 -1
  84. package/src/langs/nl.js +0 -1
  85. package/src/langs/pl.js +0 -1
  86. package/src/langs/pt_br.js +0 -1
  87. package/src/langs/ro.js +0 -1
  88. package/src/langs/ru.js +0 -1
  89. package/src/langs/se.js +0 -1
  90. package/src/langs/tr.js +0 -1
  91. package/src/langs/uk.js +0 -1
  92. package/src/langs/ur.js +0 -1
  93. package/src/langs/zh_cn.js +0 -1
  94. package/src/modules/contract/Browser.js +68 -23
  95. package/src/modules/contract/ColorPicker.js +12 -4
  96. package/src/modules/contract/Controller.js +37 -7
  97. package/src/modules/contract/Figure.js +159 -36
  98. package/src/modules/contract/HueSlider.js +27 -4
  99. package/src/modules/contract/Modal.js +62 -11
  100. package/src/modules/manager/FileManager.js +50 -8
  101. package/src/modules/ui/CommandMenu.js +597 -0
  102. package/src/modules/ui/ModalAnchorEditor.js +41 -9
  103. package/src/modules/ui/SelectMenu.js +481 -36
  104. package/src/modules/ui/index.js +1 -0
  105. package/src/plugins/browser/audioGallery.js +8 -1
  106. package/src/plugins/browser/fileBrowser.js +15 -2
  107. package/src/plugins/browser/fileGallery.js +8 -1
  108. package/src/plugins/browser/imageGallery.js +24 -3
  109. package/src/plugins/browser/videoGallery.js +19 -4
  110. package/src/plugins/command/blockquote.js +6 -1
  111. package/src/plugins/command/codeBlock.js +43 -5
  112. package/src/plugins/command/exportPDF.js +20 -4
  113. package/src/plugins/command/fileUpload.js +46 -11
  114. package/src/plugins/command/list_bulleted.js +6 -1
  115. package/src/plugins/command/list_numbered.js +6 -1
  116. package/src/plugins/dropdown/align.js +21 -33
  117. package/src/plugins/dropdown/backgroundColor.js +10 -2
  118. package/src/plugins/dropdown/blockStyle.js +17 -22
  119. package/src/plugins/dropdown/font.js +34 -34
  120. package/src/plugins/dropdown/hr.js +15 -43
  121. package/src/plugins/dropdown/layout.js +10 -27
  122. package/src/plugins/dropdown/lineHeight.js +10 -33
  123. package/src/plugins/dropdown/list.js +19 -25
  124. package/src/plugins/dropdown/paragraphStyle.js +16 -24
  125. package/src/plugins/dropdown/table/index.js +72 -17
  126. package/src/plugins/dropdown/table/render/table.html.js +3 -1
  127. package/src/plugins/dropdown/table/services/table.cell.js +33 -7
  128. package/src/plugins/dropdown/table/services/table.clipboard.js +5 -1
  129. package/src/plugins/dropdown/table/services/table.grid.js +40 -9
  130. package/src/plugins/dropdown/table/services/table.resize.js +55 -11
  131. package/src/plugins/dropdown/table/services/table.selection.js +27 -7
  132. package/src/plugins/dropdown/table/services/table.style.js +120 -20
  133. package/src/plugins/dropdown/template.js +13 -29
  134. package/src/plugins/dropdown/textStyle.js +22 -35
  135. package/src/plugins/field/autocomplete.js +8 -4
  136. package/src/plugins/field/slashCommand.js +297 -0
  137. package/src/plugins/index.js +3 -0
  138. package/src/plugins/input/fontSize.js +37 -8
  139. package/src/plugins/input/pageNavigator.js +7 -1
  140. package/src/plugins/modal/audio.js +71 -17
  141. package/src/plugins/modal/drawing.js +41 -11
  142. package/src/plugins/modal/embed.js +132 -22
  143. package/src/plugins/modal/image/index.js +115 -28
  144. package/src/plugins/modal/image/services/image.size.js +9 -2
  145. package/src/plugins/modal/image/services/image.upload.js +38 -4
  146. package/src/plugins/modal/link.js +9 -2
  147. package/src/plugins/modal/math.js +10 -2
  148. package/src/plugins/modal/video/index.js +112 -26
  149. package/src/plugins/modal/video/render/video.html.js +4 -1
  150. package/src/plugins/modal/video/services/video.size.js +15 -4
  151. package/src/plugins/modal/video/services/video.upload.js +10 -2
  152. package/src/plugins/popup/anchor.js +14 -2
  153. package/src/suneditor.js +8 -2
  154. package/src/themes/cobalt.css +12 -0
  155. package/src/themes/cream.css +12 -0
  156. package/src/themes/dark.css +12 -0
  157. package/src/themes/midnight.css +12 -0
  158. package/src/typedef.js +32 -21
  159. package/types/assets/icons/defaultIcons.d.ts +1 -0
  160. package/types/core/config/contextProvider.d.ts +7 -1
  161. package/types/core/config/eventManager.d.ts +37 -4
  162. package/types/core/config/optionProvider.d.ts +5 -1
  163. package/types/core/event/actions/index.d.ts +44 -6
  164. package/types/core/event/effects/keydown.registry.d.ts +37 -7
  165. package/types/core/event/effects/ruleHelpers.d.ts +6 -1
  166. package/types/core/event/eventOrchestrator.d.ts +6 -1
  167. package/types/core/event/handlers/handler_ww_clipboard.d.ts +15 -3
  168. package/types/core/event/handlers/handler_ww_dragDrop.d.ts +14 -2
  169. package/types/core/event/handlers/handler_ww_input.d.ts +10 -2
  170. package/types/core/event/handlers/handler_ww_key.d.ts +10 -2
  171. package/types/core/event/handlers/handler_ww_mouse.d.ts +25 -5
  172. package/types/core/event/ports.d.ts +7 -2
  173. package/types/core/event/rules/keydown.rule.backspace.d.ts +6 -1
  174. package/types/core/kernel/store.d.ts +4 -1
  175. package/types/core/logic/dom/format.d.ts +32 -14
  176. package/types/core/logic/dom/html.d.ts +11 -3
  177. package/types/core/logic/dom/nodeTransform.d.ts +6 -6
  178. package/types/core/logic/panel/blockHandle.d.ts +64 -0
  179. package/types/core/logic/panel/blockResolver.d.ts +50 -0
  180. package/types/core/logic/panel/menu.d.ts +72 -3
  181. package/types/core/logic/shell/commandDispatcher.d.ts +8 -0
  182. package/types/core/logic/shell/component.d.ts +5 -3
  183. package/types/core/logic/shell/shortcuts.d.ts +10 -1
  184. package/types/core/logic/shell/ui.d.ts +7 -1
  185. package/types/core/schema/context.d.ts +7 -1
  186. package/types/core/schema/frameContext.d.ts +36 -4
  187. package/types/core/schema/options.d.ts +110 -37
  188. package/types/core/section/constructor.d.ts +38 -1
  189. package/types/events.d.ts +208 -32
  190. package/types/helper/converter.d.ts +4 -2
  191. package/types/helper/dom/domCheck.d.ts +12 -2
  192. package/types/helper/dom/domQuery.d.ts +35 -7
  193. package/types/helper/dom/domUtils.d.ts +4 -1
  194. package/types/interfaces/plugins.d.ts +2 -2
  195. package/types/langs/_Lang.d.ts +0 -1
  196. package/types/modules/contract/Browser.d.ts +7 -7
  197. package/types/modules/contract/ColorPicker.d.ts +2 -2
  198. package/types/modules/contract/Controller.d.ts +7 -0
  199. package/types/modules/contract/Figure.d.ts +31 -4
  200. package/types/modules/ui/CommandMenu.d.ts +262 -0
  201. package/types/modules/ui/ModalAnchorEditor.d.ts +6 -1
  202. package/types/modules/ui/SelectMenu.d.ts +56 -3
  203. package/types/modules/ui/index.d.ts +1 -0
  204. package/types/plugins/browser/audioGallery.d.ts +17 -1
  205. package/types/plugins/browser/fileBrowser.d.ts +17 -1
  206. package/types/plugins/browser/fileGallery.d.ts +17 -1
  207. package/types/plugins/browser/imageGallery.d.ts +17 -1
  208. package/types/plugins/browser/videoGallery.d.ts +17 -1
  209. package/types/plugins/dropdown/align.d.ts +1 -1
  210. package/types/plugins/dropdown/blockStyle.d.ts +3 -1
  211. package/types/plugins/dropdown/table/index.d.ts +4 -1
  212. package/types/plugins/dropdown/table/services/table.clipboard.d.ts +5 -1
  213. package/types/plugins/dropdown/table/services/table.grid.d.ts +10 -2
  214. package/types/plugins/field/autocomplete.d.ts +0 -1
  215. package/types/plugins/field/slashCommand.d.ts +165 -0
  216. package/types/plugins/index.d.ts +3 -0
  217. package/types/plugins/modal/embed.d.ts +34 -0
  218. package/types/plugins/modal/link.d.ts +4 -1
  219. package/types/typedef.d.ts +48 -23
@@ -10,7 +10,11 @@ declare class EventManager {
10
10
  * @param {import('./optionProvider').default} optionProvider
11
11
  * @param {import('../kernel/coreKernel').Deps} $
12
12
  */
13
- constructor(contextProvider: import('./contextProvider').default, optionProvider: import('./optionProvider').default, $: import('../kernel/coreKernel').Deps);
13
+ constructor(
14
+ contextProvider: import('./contextProvider').default,
15
+ optionProvider: import('./optionProvider').default,
16
+ $: import('../kernel/coreKernel').Deps,
17
+ );
14
18
  /**
15
19
  * @description Events object, call by triggerEvent function
16
20
  * @type {SunEditor.Event.Handlers}
@@ -21,6 +25,22 @@ declare class EventManager {
21
25
  * @type {(eventName: string, ...args: *) => Promise<*>}
22
26
  */
23
27
  triggerEvent: (eventName: string, ...args: any) => Promise<any>;
28
+ /**
29
+ * @internal
30
+ * @description Bind the EventOrchestrator once it is constructed. Invoked by `coreKernel`
31
+ * immediately after orchestrator creation so the public `applyTagEffect` method below can delegate.
32
+ * @param {import('../event/eventOrchestrator').default} orchestrator
33
+ */
34
+ _bindOrchestrator(orchestrator: import('../event/eventOrchestrator').default): void;
35
+ /**
36
+ * @description Re-run the toolbar/menu active-state pass against the given selection node (or the
37
+ * current selection if `null`). Thin pass-through to {@link EventOrchestrator#applyTagEffect};
38
+ * exposed on `$.eventManager` so modules/plugins can request an immediate sync after they mutate
39
+ * `commandDispatcher.targets` (e.g. CommandMenu pushing newly-rendered rows).
40
+ * @param {?Node} [selectionNode]
41
+ * @returns {Node | undefined}
42
+ */
43
+ applyTagEffect(selectionNode?: Node | null): Node | undefined;
24
44
  /**
25
45
  * @description Register for an event.
26
46
  * - Only events registered with this method are unregistered or re-registered when methods such as 'setOptions', 'destroy' are called.
@@ -30,7 +50,12 @@ declare class EventManager {
30
50
  * @param {boolean|AddEventListenerOptions} [useCapture] Event useCapture option
31
51
  * @return {?SunEditor.Event.Info} Registered event information
32
52
  */
33
- addEvent(target: any, type: string, listener: any, useCapture?: boolean | AddEventListenerOptions): SunEditor.Event.Info | null;
53
+ addEvent(
54
+ target: any,
55
+ type: string,
56
+ listener: any,
57
+ useCapture?: boolean | AddEventListenerOptions,
58
+ ): SunEditor.Event.Info | null;
34
59
  /**
35
60
  * @description Remove event
36
61
  * @param {SunEditor.Event.Info} params event info = this.addEvent()
@@ -45,7 +70,11 @@ declare class EventManager {
45
70
  * @param {boolean|AddEventListenerOptions} [useCapture] Use event capture
46
71
  * @return {SunEditor.Event.GlobalInfo} Registered event information
47
72
  */
48
- addGlobalEvent(type: string, listener: any, useCapture?: boolean | AddEventListenerOptions): SunEditor.Event.GlobalInfo;
73
+ addGlobalEvent(
74
+ type: string,
75
+ listener: any,
76
+ useCapture?: boolean | AddEventListenerOptions,
77
+ ): SunEditor.Event.GlobalInfo;
49
78
  /**
50
79
  * @description Remove events from document.
51
80
  * - When created as an Iframe, the event of the document inside the Iframe is also removed.
@@ -54,7 +83,11 @@ declare class EventManager {
54
83
  * @param {boolean|AddEventListenerOptions} [useCapture] Use event capture
55
84
  * @returns {undefined|null} Success: `null`, Not found: `undefined`
56
85
  */
57
- removeGlobalEvent(type: string | SunEditor.Event.GlobalInfo, listener?: any, useCapture?: boolean | AddEventListenerOptions): undefined | null;
86
+ removeGlobalEvent(
87
+ type: string | SunEditor.Event.GlobalInfo,
88
+ listener?: any,
89
+ useCapture?: boolean | AddEventListenerOptions,
90
+ ): undefined | null;
58
91
  /**
59
92
  * @internal
60
93
  * @description Gives an active effect when the mouse down event is blocked. (Used when "env.isGecko" is `true`)
@@ -52,7 +52,11 @@ export default class OptionProvider {
52
52
  * @param {SunEditor.Kernel} kernel
53
53
  * @param {import('../section/constructor').ConstructorReturnType} product
54
54
  */
55
- constructor(kernel: SunEditor.Kernel, product: import('../section/constructor').ConstructorReturnType, options: any);
55
+ constructor(
56
+ kernel: SunEditor.Kernel,
57
+ product: import('../section/constructor').ConstructorReturnType,
58
+ options: any,
59
+ );
56
60
  /**
57
61
  * @return {BaseOptionsMap}
58
62
  */
@@ -10,29 +10,67 @@ export namespace A {
10
10
  function historyPush(hard: boolean): Action;
11
11
  function documentTypeRefreshHeader(): Action;
12
12
  function selectionSetRange(sc: Node, so: number, ec: Node, eo: number): Action;
13
- function formatRemoveBlock(rangeEl: Element, selectedFormats: Element[] | null, newBlockElement: Element | null, shouldDelete: boolean, skipHistory: boolean): Action;
13
+ function formatRemoveBlock(
14
+ rangeEl: Element,
15
+ selectedFormats: Element[] | null,
16
+ newBlockElement: Element | null,
17
+ shouldDelete: boolean,
18
+ skipHistory: boolean,
19
+ ): Action;
14
20
  function domUtilsRemoveItem(item: Node): Action;
15
21
  function selectComponentFallback(cmponentInfo: SunEditor.ComponentInfo): Action;
16
22
  function delFormatRemoveAndMove(container: Node, formatEl: Element): Action;
17
23
  function backspaceFormatMaintain(formatEl: Element): Action;
18
24
  function backspaceBrLineStrip(formatEl: Element): Action;
19
- function backspaceComponentSelect(selectionNode: Node, range: Range, fileComponentInfo: SunEditor.ComponentInfo): Action;
20
- function backspaceComponentRemove(isList: boolean, sel: Node, formatEl: Element, fileComponentInfo: SunEditor.ComponentInfo): Action;
25
+ function backspaceComponentSelect(
26
+ selectionNode: Node,
27
+ range: Range,
28
+ fileComponentInfo: SunEditor.ComponentInfo,
29
+ ): Action;
30
+ function backspaceComponentRemove(
31
+ isList: boolean,
32
+ sel: Node,
33
+ formatEl: Element,
34
+ fileComponentInfo: SunEditor.ComponentInfo,
35
+ ): Action;
21
36
  function backspaceListMergePrev(prev: Element, formatEl: Element, rangeEl: Element): Action;
22
37
  function backspaceListRemoveNested(range: Range): Action;
38
+ function backspaceEmptyLineMergePrev(formatEl: Element, prev: Element): Action;
39
+ function backspaceBrLineRowMerge(rowEndBr: Node, rowStartBr: Node): Action;
23
40
  function deleteComponentSelect(formatEl: Element, fileComponentInfo: SunEditor.ComponentInfo): Action;
24
41
  function deleteComponentSelectNext(formatEl: any, nextEl: Element): Action;
25
42
  function deleteListRemoveNested(range: Range, formatEl: Element, rangeEl: Element): Action;
43
+ function deleteEmptyLineMergeNext(formatEl: Element, next: Element): Action;
44
+ function deleteBrLineRowMerge(rowEndBr: Node): Action;
26
45
  function tabFormatIndent(range: Range, formatEl: Element, shift: boolean): Action;
27
46
  function enterScrollTo(range: Range): Action;
28
47
  function enterLineAddDefault(formatEl: Element): Action;
29
48
  function enterListAddItem(formatEl: Element, selectionNode: Node): Action;
30
49
  function enterFormatExitEmpty(formatEl: Element, rangeEl: Element): Action;
31
- function enterFormatCleanBrAndZWS(selectionNode: Node, selectionFormat: boolean, brBlock: Element, children: NodeList, offset: number): Action;
50
+ function enterFormatCleanBrAndZWS(
51
+ selectionNode: Node,
52
+ selectionFormat: boolean,
53
+ brBlock: Element,
54
+ children: NodeList,
55
+ offset: number,
56
+ ): Action;
32
57
  function enterFormatInsertBrHtml(brBlock: Element, range: Range, wSelection: Selection, offset: number): Action;
33
58
  function enterFormatInsertBrNode(wSelection: Selection): Action;
34
- function enterFormatBreakAtEdge(formatEl: Element, selectionNode: Node, formatStartEdge: boolean, formatEndEdge: boolean, bidiSwapped?: boolean): Action;
35
- function enterFormatBreakWithSelection(formatEl: Element, range: Range, formatStartEdge: boolean, formatEndEdge: boolean): Action;
59
+ function enterBrLineInsert(range: Range): Action;
60
+ function enterBrLineExit(brBlock: Element): Action;
61
+ function enterFormatBreakAtEdge(
62
+ formatEl: Element,
63
+ selectionNode: Node,
64
+ formatStartEdge: boolean,
65
+ formatEndEdge: boolean,
66
+ bidiSwapped?: boolean,
67
+ ): Action;
68
+ function enterFormatBreakWithSelection(
69
+ formatEl: Element,
70
+ range: Range,
71
+ formatStartEdge: boolean,
72
+ formatEndEdge: boolean,
73
+ ): Action;
36
74
  function enterFormatBreakAtCursor(formatEl: Element, range: Range): Action;
37
75
  function enterFigcaptionExitInList(formatEl: Element): Action;
38
76
  function keydownInputInsertNbsp(): Action;
@@ -9,13 +9,23 @@ declare const _default: {
9
9
  /** @action backspaceFormatMaintain */
10
10
  'backspace.format.maintain': ({ ctx }: EffectContext_keydown, { formatEl }: any) => void;
11
11
  /** @action backspaceComponentSelect */
12
- 'backspace.component.select': ({ ports }: EffectContext_keydown, { selectionNode, range, fileComponentInfo }: any) => void;
12
+ 'backspace.component.select': (
13
+ { ports }: EffectContext_keydown,
14
+ { selectionNode, range, fileComponentInfo }: any,
15
+ ) => void;
13
16
  /** @action backspaceComponentRemove */
14
- 'backspace.component.remove': ({ ports }: EffectContext_keydown, { isList, sel, formatEl, fileComponentInfo }: any) => void;
17
+ 'backspace.component.remove': (
18
+ { ports }: EffectContext_keydown,
19
+ { isList, sel, formatEl, fileComponentInfo }: any,
20
+ ) => void;
15
21
  /** @action backspaceListMergePrev */
16
22
  'backspace.list.mergePrev': ({ ports }: EffectContext_keydown, { prev, formatEl, rangeEl }: any) => void;
17
23
  /** @action backspaceListRemoveNested */
18
24
  'backspace.list.removeNested': ({ ports }: EffectContext_keydown, { range }: any) => void;
25
+ /** @action backspaceEmptyLineMergePrev */
26
+ 'backspace.emptyLine.mergePrev': ({ ports }: EffectContext_keydown, { formatEl, prev }: any) => void;
27
+ /** @action backspaceBrLineRowMerge */
28
+ 'backspace.brline.rowMerge': ({ ports }: EffectContext_keydown, { rowEndBr, rowStartBr }: any) => void;
19
29
  /** [delete] */
20
30
  /** @action deleteComponentSelect */
21
31
  'delete.component.select': ({ ports }: EffectContext_keydown, { formatEl, fileComponentInfo }: any) => void;
@@ -23,6 +33,10 @@ declare const _default: {
23
33
  'delete.component.selectNext': ({ ports, ctx }: EffectContext_keydown, { formatEl, nextEl }: any) => void;
24
34
  /** @action deleteListRemoveNested */
25
35
  'delete.list.removeNested': ({ ports, ctx }: EffectContext_keydown, { range, formatEl, rangeEl }: any) => void;
36
+ /** @action deleteEmptyLineMergeNext — remove an empty line, move caret to the start of the next line */
37
+ 'delete.emptyLine.mergeNext': ({ ports }: EffectContext_keydown, { formatEl, next }: any) => void;
38
+ /** @action deleteBrLineRowMerge — remove an empty row inside a brLine (PRE), pull the next row up */
39
+ 'delete.brline.rowMerge': ({ ports }: EffectContext_keydown, { rowEndBr }: any) => void;
26
40
  /** [tab] */
27
41
  /** @action tabFormatIndent */
28
42
  'tab.format.indent': ({ ports, ctx }: EffectContext_keydown, { range, formatEl, shift }: any) => boolean;
@@ -30,21 +44,37 @@ declare const _default: {
30
44
  /** @action enterScrollTo */
31
45
  'enter.scrollTo': ({ ports }: EffectContext_keydown, { range }: any) => void;
32
46
  /** @action enterLineAddDefault */
33
- 'enter.line.addDefault': ({ ports, ctx }: EffectContext_keydown, { formatEl }: any) => void;
47
+ 'enter.line.addDefault': ({ ports }: EffectContext_keydown, { formatEl }: any) => void;
34
48
  /** @action enterListAddItem */
35
49
  'enter.list.addItem': ({ ports }: EffectContext_keydown, { formatEl, selectionNode }: any) => void;
36
50
  /** @action enterFormatExitEmpty */
37
51
  'enter.format.exitEmpty': ({ ports, ctx }: EffectContext_keydown, { formatEl, rangeEl }: any) => void;
38
52
  /** @action enterFormatCleanBrAndZWS */
39
- 'enter.format.cleanBrAndZWS': ({ ports }: EffectContext_keydown, { selectionNode, selectionFormat, brBlock, children, offset }: any) => void;
53
+ 'enter.format.cleanBrAndZWS': (
54
+ { ports }: EffectContext_keydown,
55
+ { selectionNode, selectionFormat, brBlock, children, offset }: any,
56
+ ) => void;
40
57
  /** @action enterFormatInsertBrHtml */
41
- 'enter.format.insertBrHtml': ({ ports }: EffectContext_keydown, { brBlock, range, wSelection, offset }: any) => void;
58
+ 'enter.format.insertBrHtml': (
59
+ { ports }: EffectContext_keydown,
60
+ { brBlock, range, wSelection, offset }: any,
61
+ ) => void;
62
+ /** @action enterBrLineInsert — insert exactly one empty row at the caret inside a normal brLine. */
63
+ 'enter.brline.insert': ({ ports }: EffectContext_keydown, { range }: any) => void;
64
+ /** @action enterBrLineExit — consume only the caret's current (last) empty row and add a default line after the brLine. */
65
+ 'enter.brline.exit': ({ ports }: EffectContext_keydown, { brBlock }: any) => void;
42
66
  /** @action enterFormatInsertBrNode */
43
67
  'enter.format.insertBrNode': ({ ports }: EffectContext_keydown, { wSelection }: any) => void;
44
68
  /** @action enterFormatBreakAtEdge */
45
- 'enter.format.breakAtEdge': ({ ports, ctx }: EffectContext_keydown, { formatEl, selectionNode, formatStartEdge, formatEndEdge, bidiSwapped }: any) => void;
69
+ 'enter.format.breakAtEdge': (
70
+ { ports, ctx }: EffectContext_keydown,
71
+ { formatEl, selectionNode, formatStartEdge, formatEndEdge, bidiSwapped }: any,
72
+ ) => void;
46
73
  /** @action enterFormatBreakWithSelection */
47
- 'enter.format.breakWithSelection': ({ ports, ctx }: EffectContext_keydown, { formatEl, range, formatStartEdge, formatEndEdge }: any) => void;
74
+ 'enter.format.breakWithSelection': (
75
+ { ports, ctx }: EffectContext_keydown,
76
+ { formatEl, range, formatStartEdge, formatEndEdge }: any,
77
+ ) => void;
48
78
  /** @action enterFormatBreakAtCursor */
49
79
  'enter.format.breakAtCursor': ({ ports, ctx }: EffectContext_keydown, { formatEl, range }: any) => void;
50
80
  /** @action enterFigcaptionExitInList */
@@ -45,4 +45,9 @@ export function setDefaultLine(ports: EventPorts, lineTagName: string): void;
45
45
  * @param {Document} doc - The document object
46
46
  * @returns {boolean} true if the detected edge doesn't match the visual position (bidi mismatch)
47
47
  */
48
- export function isRtlBidiMismatch(range: Range, formatEl: HTMLElement, detectedEdge: 'front' | 'end', doc: Document): boolean;
48
+ export function isRtlBidiMismatch(
49
+ range: Range,
50
+ formatEl: HTMLElement,
51
+ detectedEdge: 'front' | 'end',
52
+ doc: Document,
53
+ ): boolean;
@@ -96,7 +96,12 @@ declare class EventOrchestrator extends KernelInjector {
96
96
  * @param {SunEditor.FrameContext} frameContext The frame context
97
97
  * @returns {Promise<boolean>} Resolves to `false` if processing is complete, otherwise allows default behavior
98
98
  */
99
- _dataTransferAction(type: 'paste' | 'drop', e: Event, clipboardData: DataTransfer, frameContext: SunEditor.FrameContext): Promise<boolean>;
99
+ _dataTransferAction(
100
+ type: 'paste' | 'drop',
101
+ e: Event,
102
+ clipboardData: DataTransfer,
103
+ frameContext: SunEditor.FrameContext,
104
+ ): Promise<boolean>;
100
105
  /**
101
106
  * @internal
102
107
  * @description Registers common UI events such as toolbar and menu interactions.
@@ -6,12 +6,20 @@ import type {} from '../../../typedef';
6
6
  * @this {EventManagerThis_handler_ww_clipboard}
7
7
  * @param {ClipboardEvent} e - Event object
8
8
  */
9
- export function OnPaste_wysiwyg(this: import('../eventOrchestrator').default, frameContext: any, e: ClipboardEvent): true | Promise<boolean>;
9
+ export function OnPaste_wysiwyg(
10
+ this: import('../eventOrchestrator').default,
11
+ frameContext: any,
12
+ e: ClipboardEvent,
13
+ ): true | Promise<boolean>;
10
14
  /**
11
15
  * @this {EventManagerThis_handler_ww_clipboard}
12
16
  * @param {ClipboardEvent} e - Event object
13
17
  */
14
- export function OnCopy_wysiwyg(this: import('../eventOrchestrator').default, frameContext: any, e: ClipboardEvent): Promise<boolean>;
18
+ export function OnCopy_wysiwyg(
19
+ this: import('../eventOrchestrator').default,
20
+ frameContext: any,
21
+ e: ClipboardEvent,
22
+ ): Promise<boolean>;
15
23
  export class OnCopy_wysiwyg {
16
24
  /**
17
25
  * @this {EventManagerThis_handler_ww_clipboard}
@@ -24,7 +32,11 @@ export class OnCopy_wysiwyg {
24
32
  * @this {EventManagerThis_handler_ww_clipboard}
25
33
  * @param {ClipboardEvent} e - Event object
26
34
  */
27
- export function OnCut_wysiwyg(this: import('../eventOrchestrator').default, frameContext: any, e: ClipboardEvent): Promise<boolean>;
35
+ export function OnCut_wysiwyg(
36
+ this: import('../eventOrchestrator').default,
37
+ frameContext: any,
38
+ e: ClipboardEvent,
39
+ ): Promise<boolean>;
28
40
  export class OnCut_wysiwyg {
29
41
  /**
30
42
  * @this {EventManagerThis_handler_ww_clipboard}
@@ -10,7 +10,14 @@ import type {} from '../../../typedef';
10
10
  * @param {?HTMLElement} _innerToolbar - Inner toolbar element
11
11
  * @param {DragEvent} e - Event object
12
12
  */
13
- export function OnDragOver_wysiwyg(this: import('../eventOrchestrator').default, fc: SunEditor.FrameContext, dragCursor: HTMLElement, _iframeTopArea: HTMLElement | null, _innerToolbar: HTMLElement | null, e: DragEvent): void;
13
+ export function OnDragOver_wysiwyg(
14
+ this: import('../eventOrchestrator').default,
15
+ fc: SunEditor.FrameContext,
16
+ dragCursor: HTMLElement,
17
+ _iframeTopArea: HTMLElement | null,
18
+ _innerToolbar: HTMLElement | null,
19
+ e: DragEvent,
20
+ ): void;
14
21
  /**
15
22
  * @this {EventManagerThis_handler_ww_dragDrop}
16
23
  * @param {HTMLElement} dragCursor - Drag cursor element
@@ -22,5 +29,10 @@ export function OnDragEnd_wysiwyg(this: import('../eventOrchestrator').default,
22
29
  * @param {HTMLElement} dragCursor - Drag cursor element
23
30
  * @param {DragEvent} e - Event object
24
31
  */
25
- export function OnDrop_wysiwyg(this: import('../eventOrchestrator').default, fc: SunEditor.FrameContext, dragCursor: HTMLElement, e: DragEvent): boolean | Promise<boolean>;
32
+ export function OnDrop_wysiwyg(
33
+ this: import('../eventOrchestrator').default,
34
+ fc: SunEditor.FrameContext,
35
+ dragCursor: HTMLElement,
36
+ e: DragEvent,
37
+ ): boolean | Promise<boolean>;
26
38
  export type EventManagerThis_handler_ww_dragDrop = import('../eventOrchestrator').default;
@@ -7,7 +7,11 @@ import type {} from '../../../typedef';
7
7
  * @param {SunEditor.FrameContext} fc - Frame context object
8
8
  * @param {InputEvent} e - Event object
9
9
  */
10
- export function OnBeforeInput_wysiwyg(this: import('../eventOrchestrator').default, fc: SunEditor.FrameContext, e: InputEvent): Promise<boolean>;
10
+ export function OnBeforeInput_wysiwyg(
11
+ this: import('../eventOrchestrator').default,
12
+ fc: SunEditor.FrameContext,
13
+ e: InputEvent,
14
+ ): Promise<boolean>;
11
15
  export class OnBeforeInput_wysiwyg {
12
16
  /**
13
17
  * @typedef {import('../eventOrchestrator').default} EventManagerThis_handler_ww_input
@@ -25,7 +29,11 @@ export class OnBeforeInput_wysiwyg {
25
29
  * @param {SunEditor.FrameContext} fc - Frame context object
26
30
  * @param {InputEvent} e - Event object
27
31
  */
28
- export function OnInput_wysiwyg(this: import('../eventOrchestrator').default, fc: SunEditor.FrameContext, e: InputEvent): Promise<boolean>;
32
+ export function OnInput_wysiwyg(
33
+ this: import('../eventOrchestrator').default,
34
+ fc: SunEditor.FrameContext,
35
+ e: InputEvent,
36
+ ): Promise<boolean>;
29
37
  export class OnInput_wysiwyg {
30
38
  /**
31
39
  * @this {EventManagerThis_handler_ww_input}
@@ -7,7 +7,11 @@ import type {} from '../../../typedef';
7
7
  * @param {SunEditor.FrameContext} fc - Frame context object
8
8
  * @param {KeyboardEvent} e - Event object
9
9
  */
10
- export function OnKeyDown_wysiwyg(this: import('../eventOrchestrator').default, fc: SunEditor.FrameContext, e: KeyboardEvent): Promise<boolean>;
10
+ export function OnKeyDown_wysiwyg(
11
+ this: import('../eventOrchestrator').default,
12
+ fc: SunEditor.FrameContext,
13
+ e: KeyboardEvent,
14
+ ): Promise<boolean>;
11
15
  export class OnKeyDown_wysiwyg {
12
16
  /**
13
17
  * @typedef {import('../eventOrchestrator').default} EventManagerThis_handler_ww_key_input
@@ -26,7 +30,11 @@ export class OnKeyDown_wysiwyg {
26
30
  * @param {SunEditor.FrameContext} fc - Frame context object
27
31
  * @param {KeyboardEvent} e - Event object
28
32
  */
29
- export function OnKeyUp_wysiwyg(this: import('../eventOrchestrator').default, fc: SunEditor.FrameContext, e: KeyboardEvent): Promise<void>;
33
+ export function OnKeyUp_wysiwyg(
34
+ this: import('../eventOrchestrator').default,
35
+ fc: SunEditor.FrameContext,
36
+ e: KeyboardEvent,
37
+ ): Promise<void>;
30
38
  export class OnKeyUp_wysiwyg {
31
39
  /**
32
40
  * @this {EventManagerThis_handler_ww_key_input}
@@ -7,7 +7,11 @@ import type {} from '../../../typedef';
7
7
  * @param {SunEditor.FrameContext} fc - Frame context object
8
8
  * @param {MouseEvent} e - Event object
9
9
  */
10
- export function OnMouseDown_wysiwyg(this: import('../eventOrchestrator').default, fc: SunEditor.FrameContext, e: MouseEvent): Promise<void>;
10
+ export function OnMouseDown_wysiwyg(
11
+ this: import('../eventOrchestrator').default,
12
+ fc: SunEditor.FrameContext,
13
+ e: MouseEvent,
14
+ ): Promise<void>;
11
15
  export class OnMouseDown_wysiwyg {
12
16
  /**
13
17
  * @typedef {import('../eventOrchestrator').default} EventManagerThis_handler_ww_mouse
@@ -25,23 +29,39 @@ export class OnMouseDown_wysiwyg {
25
29
  * @param {SunEditor.FrameContext} fc - Frame context object
26
30
  * @param {MouseEvent} e - Event object
27
31
  */
28
- export function OnMouseUp_wysiwyg(this: import('../eventOrchestrator').default, fc: SunEditor.FrameContext, e: MouseEvent): Promise<void>;
32
+ export function OnMouseUp_wysiwyg(
33
+ this: import('../eventOrchestrator').default,
34
+ fc: SunEditor.FrameContext,
35
+ e: MouseEvent,
36
+ ): Promise<void>;
29
37
  /**
30
38
  * @this {EventManagerThis_handler_ww_mouse}
31
39
  * @param {SunEditor.FrameContext} fc - Frame context object
32
40
  * @param {MouseEvent} e - Event object
33
41
  */
34
- export function OnClick_wysiwyg(this: import('../eventOrchestrator').default, fc: SunEditor.FrameContext, e: MouseEvent): Promise<boolean>;
42
+ export function OnClick_wysiwyg(
43
+ this: import('../eventOrchestrator').default,
44
+ fc: SunEditor.FrameContext,
45
+ e: MouseEvent,
46
+ ): Promise<boolean>;
35
47
  /**
36
48
  * @this {EventManagerThis_handler_ww_mouse}
37
49
  * @param {SunEditor.FrameContext} fc - Frame context object
38
50
  * @param {MouseEvent} e - Event object
39
51
  */
40
- export function OnMouseMove_wysiwyg(this: import('../eventOrchestrator').default, fc: SunEditor.FrameContext, e: MouseEvent): boolean;
52
+ export function OnMouseMove_wysiwyg(
53
+ this: import('../eventOrchestrator').default,
54
+ fc: SunEditor.FrameContext,
55
+ e: MouseEvent,
56
+ ): boolean;
41
57
  /**
42
58
  * @this {EventManagerThis_handler_ww_mouse}
43
59
  * @param {SunEditor.FrameContext} fc - Frame context object
44
60
  * @param {MouseEvent} e - Event object
45
61
  */
46
- export function OnMouseLeave_wysiwyg(this: import('../eventOrchestrator').default, fc: SunEditor.FrameContext, e: MouseEvent): Promise<void>;
62
+ export function OnMouseLeave_wysiwyg(
63
+ this: import('../eventOrchestrator').default,
64
+ fc: SunEditor.FrameContext,
65
+ e: MouseEvent,
66
+ ): Promise<void>;
47
67
  export type EventManagerThis_handler_ww_mouse = import('../eventOrchestrator').default;
@@ -33,6 +33,7 @@ import type {} from '../../typedef';
33
33
  * @property {(...args: Parameters<Format['isEdgeLine']>) => ReturnType<Format['isEdgeLine']>} isEdgeLine
34
34
  * @property {(...args: Parameters<Format['removeBlock']>) => ReturnType<Format['removeBlock']>} removeBlock
35
35
  * @property {(...args: Parameters<Format['addLine']>) => ReturnType<Format['addLine']>} addLine
36
+ * @property {(...args: Parameters<Format['addLineAfter']>) => ReturnType<Format['addLineAfter']>} addLineAfter
36
37
  */
37
38
  /**
38
39
  * @typedef {Object} ListFormatPorts
@@ -111,6 +112,7 @@ export function makePorts(
111
112
  removeArray: Array<Node> | null;
112
113
  };
113
114
  addLine: (el: any, nextOrTag: any) => HTMLElement;
115
+ addLineAfter: (el: any) => HTMLElement;
114
116
  };
115
117
  listFormat: {
116
118
  applyNested: (
@@ -167,7 +169,7 @@ export function makePorts(
167
169
  setOnShortcutKey: (v: any) => any;
168
170
  /**
169
171
  * @description Scrolls the editor view to the caret position after pressing `Enter`.
170
- * @param {Range} range Range object
172
+ * @param {Range} range Pre-Enter snapshot range (fallback only).
171
173
  */
172
174
  enterScrollTo(range: Range): void;
173
175
  /**
@@ -204,6 +206,7 @@ export type FormatPorts = {
204
206
  isEdgeLine: (...args: Parameters<Format['isEdgeLine']>) => ReturnType<Format['isEdgeLine']>;
205
207
  removeBlock: (...args: Parameters<Format['removeBlock']>) => ReturnType<Format['removeBlock']>;
206
208
  addLine: (...args: Parameters<Format['addLine']>) => ReturnType<Format['addLine']>;
209
+ addLineAfter: (...args: Parameters<Format['addLineAfter']>) => ReturnType<Format['addLineAfter']>;
207
210
  };
208
211
  export type ListFormatPorts = {
209
212
  applyNested: (...args: Parameters<ListFormat['applyNested']>) => ReturnType<ListFormat['applyNested']>;
@@ -220,7 +223,9 @@ export type HtmlPorts = {
220
223
  insertNode: (...args: Parameters<Html['insertNode']>) => ReturnType<Html['insertNode']>;
221
224
  };
222
225
  export type NodeTransformPorts = {
223
- removeAllParents: (...args: Parameters<NodeTransform['removeAllParents']>) => ReturnType<NodeTransform['removeAllParents']>;
226
+ removeAllParents: (
227
+ ...args: Parameters<NodeTransform['removeAllParents']>
228
+ ) => ReturnType<NodeTransform['removeAllParents']>;
224
229
  split: (...args: Parameters<NodeTransform['split']>) => ReturnType<NodeTransform['split']>;
225
230
  };
226
231
  export type CharPorts = {
@@ -12,7 +12,12 @@ import type {} from '../../../typedef';
12
12
  * @param {EventKeydownCtx} ctx - Context object
13
13
  * @returns {boolean} Return `false` to stop the processing
14
14
  */
15
- export function reduceBackspaceDown(this: void, actions: EventActions, ports: EventPorts, ctx: EventKeydownCtx): boolean;
15
+ export function reduceBackspaceDown(
16
+ this: void,
17
+ actions: EventActions,
18
+ ports: EventPorts,
19
+ ctx: EventKeydownCtx,
20
+ ): boolean;
16
21
  export type EventActions = import('../actions').Action[];
17
22
  export type EventPorts = import('../ports').EventReducerPorts;
18
23
  export type EventKeydownCtx = import('../reducers/keydown.reducer').KeydownReducerCtx;
@@ -168,7 +168,10 @@ declare class Store {
168
168
  * @param {(newValue: StoreState[K], oldValue: StoreState[K]) => void} callback
169
169
  * @returns {() => void} Unsubscribe function
170
170
  */
171
- subscribe<K extends keyof StoreState>(path: K, callback: (newValue: StoreState[K], oldValue: StoreState[K]) => void): () => void;
171
+ subscribe<K extends keyof StoreState>(
172
+ path: K,
173
+ callback: (newValue: StoreState[K], oldValue: StoreState[K]) => void,
174
+ ): () => void;
172
175
  _reset(): void;
173
176
  _destroy(): void;
174
177
  #private;
@@ -25,13 +25,13 @@ declare class Format {
25
25
  /**
26
26
  * @description If a parent node that contains an argument node finds a format node (`format.isLine`), it returns that node.
27
27
  * @param {Node} node Reference node.
28
- * @param {?(current: Node) => boolean} [validation] Additional validation function.
28
+ * @param {?(current: *) => boolean} [validation] Additional validation function.
29
29
  * @returns {HTMLElement|null}
30
30
  * @example
31
31
  * const line = editor.$.format.getLine(editor.$.selection.getNode());
32
32
  * const lineWithFilter = editor.$.format.getLine(node, (el) => el.nodeName !== 'LI');
33
33
  */
34
- getLine(node: Node, validation?: ((current: Node) => boolean) | null): HTMLElement | null;
34
+ getLine(node: Node, validation?: ((current: any) => boolean) | null): HTMLElement | null;
35
35
  /**
36
36
  * @description Replace the br-line tag of the current selection.
37
37
  * @param {Node} element BR-Line element (PRE..)
@@ -42,30 +42,48 @@ declare class Format {
42
42
  /**
43
43
  * @description If a parent node that contains an argument node finds a `brLine` (`format.isBrLine`), it returns that node.
44
44
  * @param {Node} element Reference node.
45
- * @param {?(current: Node) => boolean} [validation] Additional validation function.
45
+ * @param {?(current: *) => boolean} [validation] Additional validation function.
46
46
  * @returns {HTMLBRElement|null}
47
47
  * @example
48
48
  * const brLine = editor.$.format.getBrLine(editor.$.selection.getNode());
49
49
  */
50
- getBrLine(element: Node, validation?: ((current: Node) => boolean) | null): HTMLBRElement | null;
50
+ getBrLine(element: Node, validation?: ((current: any) => boolean) | null): HTMLBRElement | null;
51
51
  /**
52
- * @description Append `line` element to sibling node of argument element.
53
- * - If the `lineNode` argument value is present, the tag of that argument value is inserted,
54
- * - If not, the currently selected format tag is inserted.
55
- * @param {Node} element Insert as siblings of that element
56
- * @param {?(string|Node)} [lineNode] Node name or node obejct to be inserted
57
- * @returns {HTMLElement}
52
+ * @description Insert a new line as the next sibling of `element`.
53
+ * - Selection-aware — tag/attributes default to the **currently selected line**, not
54
+ * - `element`'s tag. Use {@link addLineAfter} when the decision must depend only on
55
+ * - `element` (e.g., Enter exiting a heading).
56
+ *
57
+ * - Tag resolution: brLine context → bare `<br>`; else `lineNode` override → current
58
+ * - line clone → `defaultLine`. Attribute copy excludes only `id` (vs `addLineAfter`
59
+ * - which respects `lineAttrReset`). Inside a table cell, inserts within the cell.
60
+ *
61
+ * @param {Node} element Reference element — new line is inserted right after it
62
+ * @param {?(string|Node)} [lineNode] Override: string tag name, or Node whose tag
63
+ * and attributes (except `id`) are copied
64
+ * @returns {HTMLElement} The new line, or a `<br>` in brLine context
58
65
  */
59
66
  addLine(element: Node, lineNode?: (string | Node) | null): HTMLElement;
67
+ /**
68
+ * @description Insert a new line after the given block element.
69
+ * Selection-independent — determines tag/attributes from the element itself.
70
+ * - Heading (H1-H6), HR → new default line
71
+ * - LI → new LI with copied attributes
72
+ * - PRE / brLine → new default line (exit brLine)
73
+ * - Normal line → same tag with copied attributes
74
+ * @param {HTMLElement} element The block element to insert after
75
+ * @returns {HTMLElement|null} The newly created element
76
+ */
77
+ addLineAfter(element: HTMLElement): HTMLElement | null;
60
78
  /**
61
79
  * @description If a parent node that contains an argument node finds a format node (`format.isBlock`), it returns that node.
62
80
  * @param {Node} element Reference node.
63
- * @param {?(current: Node) => boolean} [validation] Additional validation function.
81
+ * @param {?(current: *) => boolean} [validation] Additional validation function.
64
82
  * @returns {HTMLElement|null}
65
83
  * @example
66
84
  * const block = editor.$.format.getBlock(editor.$.selection.getNode());
67
85
  */
68
- getBlock(element: Node, validation?: ((current: Node) => boolean) | null): HTMLElement | null;
86
+ getBlock(element: Node, validation?: ((current: any) => boolean) | null): HTMLElement | null;
69
87
  /**
70
88
  * @description Appended all selected `line` element to the argument element(`block`) and insert
71
89
  * @param {Node} blockElement Element of wrap the arguments (BLOCKQUOTE...)
@@ -218,12 +236,12 @@ declare class Format {
218
236
  isClosureBrLine(element: Node | string): element is HTMLElement;
219
237
  /**
220
238
  * @description Returns a `line` array from selected range.
221
- * @param {?(current: Node) => boolean} [validation] The validation function. (Replaces the default validation `format.isLine(current)`)
239
+ * @param {?(current: *) => boolean} [validation] The validation function. (Replaces the default validation `format.isLine(current)`)
222
240
  * @returns {Array<HTMLElement>}
223
241
  * @example
224
242
  * const selectedLines = editor.$.format.getLines();
225
243
  */
226
- getLines(validation?: ((current: Node) => boolean) | null): Array<HTMLElement>;
244
+ getLines(validation?: ((current: any) => boolean) | null): Array<HTMLElement>;
227
245
  /**
228
246
  * @description Get lines and components from the selected range. (P, DIV, H[1-6], OL, UL, TABLE..)
229
247
  * - If some of the component are included in the selection, get the entire that component.
@@ -17,7 +17,7 @@ declare class HTML {
17
17
  * @param {Object} params - Filtering parameters.
18
18
  * @param {string} [params.tagWhitelist] - Allowed tags, specified as a string with tags separated by `'|'`. (e.g. `"div|p|span"`).
19
19
  * @param {string} [params.tagBlacklist] - Disallowed tags, specified as a string with tags separated by `'|'`. (e.g. `"script|iframe"`).
20
- * @param {(node: Node) => Node | string | null} [params.validate] - Function to validate and modify individual nodes.
20
+ * @param {(node: *) => Node | string | null} [params.validate] - Function to validate and modify individual nodes.
21
21
  * - Return `null` to remove the node.
22
22
  * - Return a `Node` to replace the current node.
23
23
  * - Return a `string` to replace the node's `outerHTML`.
@@ -54,7 +54,7 @@ declare class HTML {
54
54
  }: {
55
55
  tagWhitelist?: string;
56
56
  tagBlacklist?: string;
57
- validate?: (node: Node) => Node | string | null;
57
+ validate?: (node: any) => Node | string | null;
58
58
  validateAll?: boolean;
59
59
  },
60
60
  ): string;
@@ -185,7 +185,15 @@ declare class HTML {
185
185
  * const html = editor.$.html.get();
186
186
  * const htmlWithFrame = editor.$.html.get({ withFrame: true });
187
187
  */
188
- get({ withFrame, includeFullPage, rootKey }?: { withFrame?: boolean; includeFullPage?: boolean; rootKey?: number | Array<number> }): string | any;
188
+ get({
189
+ withFrame,
190
+ includeFullPage,
191
+ rootKey,
192
+ }?: {
193
+ withFrame?: boolean;
194
+ includeFullPage?: boolean;
195
+ rootKey?: number | Array<number>;
196
+ }): string | any;
189
197
  /**
190
198
  * @description Sets the HTML string to the editor content
191
199
  * @param {string} html HTML string