suneditor 3.0.0-beta.26 → 3.0.0-beta.28

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 (135) hide show
  1. package/dist/suneditor.min.css +1 -1
  2. package/dist/suneditor.min.js +1 -1
  3. package/package.json +77 -39
  4. package/src/core/{section → base}/actives.js +1 -1
  5. package/src/core/class/component.js +2 -0
  6. package/src/core/class/format.js +44 -2435
  7. package/src/core/class/html.js +5 -4
  8. package/src/core/class/inline.js +1853 -0
  9. package/src/core/class/listFormat.js +582 -0
  10. package/src/core/class/nodeTransform.js +1 -3
  11. package/src/core/class/selection.js +4 -2
  12. package/src/core/class/ui.js +1 -1
  13. package/src/core/class/viewer.js +4 -4
  14. package/src/core/config/options.js +37 -18
  15. package/src/core/editor.js +43 -29
  16. package/src/core/event/actions/index.js +229 -0
  17. package/src/core/event/effects/common.registry.js +60 -0
  18. package/src/core/event/effects/keydown.registry.js +551 -0
  19. package/src/core/event/effects/ruleHelpers.js +145 -0
  20. package/src/core/{base → event}/eventManager.js +8 -124
  21. package/src/core/event/executor.js +21 -0
  22. package/src/core/{base/eventHandlers → event/handlers}/handler_toolbar.js +1 -1
  23. package/src/core/event/handlers/handler_ww_input.js +77 -0
  24. package/src/core/event/handlers/handler_ww_key.js +228 -0
  25. package/src/core/{base/eventHandlers → event/handlers}/handler_ww_mouse.js +3 -3
  26. package/src/core/event/ports.js +211 -0
  27. package/src/core/event/reducers/keydown.reducer.js +89 -0
  28. package/src/core/event/rules/keydown.rule.arrow.js +54 -0
  29. package/src/core/event/rules/keydown.rule.backspace.js +202 -0
  30. package/src/core/event/rules/keydown.rule.delete.js +126 -0
  31. package/src/core/event/rules/keydown.rule.enter.js +144 -0
  32. package/src/core/event/rules/keydown.rule.tab.js +29 -0
  33. package/src/core/section/constructor.js +57 -23
  34. package/src/editorInjector/_classes.js +4 -0
  35. package/src/editorInjector/index.js +4 -0
  36. package/src/helper/clipboard.js +0 -1
  37. package/src/helper/converter.js +6 -7
  38. package/src/helper/dom/domCheck.js +1 -1
  39. package/src/helper/dom/domQuery.js +1 -1
  40. package/src/helper/dom/domUtils.js +2 -2
  41. package/src/helper/dom/index.js +4 -0
  42. package/src/helper/env.js +1 -6
  43. package/src/helper/keyCodeMap.js +0 -1
  44. package/src/langs/ckb.js +1 -1
  45. package/src/langs/cs.js +1 -1
  46. package/src/langs/da.js +1 -1
  47. package/src/langs/de.js +1 -1
  48. package/src/langs/en.js +1 -1
  49. package/src/langs/es.js +1 -1
  50. package/src/langs/fa.js +1 -1
  51. package/src/langs/fr.js +1 -1
  52. package/src/langs/he.js +1 -1
  53. package/src/langs/hu.js +1 -1
  54. package/src/langs/it.js +1 -1
  55. package/src/langs/ja.js +1 -1
  56. package/src/langs/km.js +1 -1
  57. package/src/langs/ko.js +1 -1
  58. package/src/langs/lv.js +1 -1
  59. package/src/langs/nl.js +1 -1
  60. package/src/langs/pl.js +1 -1
  61. package/src/langs/pt_br.js +1 -1
  62. package/src/langs/ro.js +1 -1
  63. package/src/langs/ru.js +1 -1
  64. package/src/langs/se.js +1 -1
  65. package/src/langs/tr.js +1 -1
  66. package/src/langs/uk.js +1 -1
  67. package/src/langs/ur.js +1 -1
  68. package/src/langs/zh_cn.js +1 -1
  69. package/src/modules/ApiManager.js +5 -0
  70. package/src/modules/Figure.js +4 -10
  71. package/src/modules/HueSlider.js +18 -4
  72. package/src/modules/SelectMenu.js +1 -1
  73. package/src/plugins/command/fileUpload.js +1 -1
  74. package/src/plugins/command/list_bulleted.js +1 -1
  75. package/src/plugins/command/list_numbered.js +1 -1
  76. package/src/plugins/dropdown/backgroundColor.js +2 -2
  77. package/src/plugins/dropdown/font.js +2 -2
  78. package/src/plugins/dropdown/fontColor.js +2 -2
  79. package/src/plugins/dropdown/list.js +1 -1
  80. package/src/plugins/dropdown/table.js +1 -3
  81. package/src/plugins/dropdown/textStyle.js +1 -1
  82. package/src/plugins/field/mention.js +2 -2
  83. package/src/plugins/input/fontSize.js +9 -9
  84. package/src/plugins/modal/audio.js +5 -5
  85. package/src/plugins/modal/embed.js +5 -5
  86. package/src/plugins/modal/image.js +7 -7
  87. package/src/plugins/modal/link.js +23 -8
  88. package/src/plugins/modal/video.js +5 -5
  89. package/src/suneditor.js +9 -34
  90. package/src/typedef.js +15 -9
  91. package/types/core/class/format.d.ts +2 -352
  92. package/types/core/class/html.d.ts +2 -2
  93. package/types/core/class/inline.d.ts +263 -0
  94. package/types/core/class/listFormat.d.ts +135 -0
  95. package/types/core/config/options.d.ts +52 -78
  96. package/types/core/editor.d.ts +22 -12
  97. package/types/core/event/actions/index.d.ts +47 -0
  98. package/types/core/event/effects/common.registry.d.ts +50 -0
  99. package/types/core/event/effects/keydown.registry.d.ts +73 -0
  100. package/types/core/event/effects/ruleHelpers.d.ts +31 -0
  101. package/types/core/{base → event}/eventManager.d.ts +0 -42
  102. package/types/core/event/executor.d.ts +6 -0
  103. package/types/core/event/handlers/handler_ww_input.d.ts +41 -0
  104. package/types/core/{base/eventHandlers/handler_ww_key_input.d.ts → event/handlers/handler_ww_key.d.ts} +4 -33
  105. package/types/core/event/ports.d.ts +255 -0
  106. package/types/core/event/reducers/keydown.reducer.d.ts +75 -0
  107. package/types/core/event/rules/keydown.rule.arrow.d.ts +8 -0
  108. package/types/core/event/rules/keydown.rule.backspace.d.ts +9 -0
  109. package/types/core/event/rules/keydown.rule.delete.d.ts +9 -0
  110. package/types/core/event/rules/keydown.rule.enter.d.ts +9 -0
  111. package/types/core/event/rules/keydown.rule.tab.d.ts +9 -0
  112. package/types/core/section/constructor.d.ts +165 -39
  113. package/types/editorInjector/_classes.d.ts +4 -0
  114. package/types/editorInjector/index.d.ts +4 -0
  115. package/types/helper/converter.d.ts +4 -20
  116. package/types/helper/dom/index.d.ts +86 -1
  117. package/types/index.d.ts +11 -121
  118. package/types/langs/index.d.ts +2 -2
  119. package/types/modules/HueSlider.d.ts +12 -0
  120. package/types/modules/index.d.ts +3 -3
  121. package/types/plugins/index.d.ts +38 -38
  122. package/types/plugins/modal/link.d.ts +6 -4
  123. package/types/suneditor.d.ts +18 -19
  124. package/types/typedef.d.ts +6 -2
  125. package/src/core/base/eventHandlers/handler_ww_key_input.js +0 -1267
  126. package/types/core/section/context.d.ts +0 -67
  127. package/types/core/section/options.d.ts +0 -1022
  128. package/types/langs/_Lang.d.ts +0 -194
  129. /package/src/core/{base/eventHandlers → event/handlers}/handler_ww_clipboard.js +0 -0
  130. /package/src/core/{base/eventHandlers → event/handlers}/handler_ww_dragDrop.js +0 -0
  131. /package/types/core/{section → base}/actives.d.ts +0 -0
  132. /package/types/core/{base/eventHandlers → event/handlers}/handler_toolbar.d.ts +0 -0
  133. /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_clipboard.d.ts +0 -0
  134. /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_dragDrop.d.ts +0 -0
  135. /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_mouse.d.ts +0 -0
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @typedef {Object} KeydownReducerCtx - Keydown Reducer Context object
3
+ * @property {KeyboardEvent} ctx.e - The keyboard event
4
+ * @property {__se__FrameContext} ctx.fc - Frame context object
5
+ * @property {__se__EditorStatus} ctx.status - Editor status object
6
+ * @property {__se__BaseOptions} ctx.options - Options object
7
+ * @property {__se__FrameOptions} ctx.frameOptions - Frame options object
8
+ * @property {Range} ctx.range - Current selection range
9
+ * @property {HTMLElement|Text} ctx.selectionNode - Current selection node
10
+ * @property {HTMLElement} ctx.formatEl - Current format element
11
+ * @property {string} ctx.keyCode - Key code
12
+ * @property {boolean} ctx.ctrl - Whether the ctrl key is pressed
13
+ * @property {boolean} ctx.alt - Whether the alt key is pressed
14
+ * @property {boolean} ctx.shift - Whether the shift key is pressed
15
+ */
16
+ /**
17
+ * @description Keydown event reducer
18
+ * @param {__se__EventPorts} ports - Ports for interacting with editor
19
+ * @param {KeydownReducerCtx} ctx - Context object
20
+ * @returns {Promise<__se__EventActions>} Action list
21
+ */
22
+ export function reduceKeydown(ports: __se__EventPorts, ctx: KeydownReducerCtx): Promise<__se__EventActions>;
23
+ /**
24
+ * - Keydown Reducer Context object
25
+ */
26
+ export type KeydownReducerCtx = {
27
+ /**
28
+ * - The keyboard event
29
+ */
30
+ e: KeyboardEvent;
31
+ /**
32
+ * - Frame context object
33
+ */
34
+ fc: __se__FrameContext;
35
+ /**
36
+ * - Editor status object
37
+ */
38
+ status: __se__EditorStatus;
39
+ /**
40
+ * - Options object
41
+ */
42
+ options: __se__BaseOptions;
43
+ /**
44
+ * - Frame options object
45
+ */
46
+ frameOptions: __se__FrameOptions;
47
+ /**
48
+ * - Current selection range
49
+ */
50
+ range: Range;
51
+ /**
52
+ * - Current selection node
53
+ */
54
+ selectionNode: HTMLElement | Text;
55
+ /**
56
+ * - Current format element
57
+ */
58
+ formatEl: HTMLElement;
59
+ /**
60
+ * - Key code
61
+ */
62
+ keyCode: string;
63
+ /**
64
+ * - Whether the ctrl key is pressed
65
+ */
66
+ ctrl: boolean;
67
+ /**
68
+ * - Whether the alt key is pressed
69
+ */
70
+ alt: boolean;
71
+ /**
72
+ * - Whether the shift key is pressed
73
+ */
74
+ shift: boolean;
75
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @this {void}
3
+ * @description Arrow key down rule
4
+ * @param {__se__EventActions} actions - Action list
5
+ * @param {__se__EventPorts} ports - Ports for interacting with editor
6
+ * @param {__se__EventKeydownCtx} ctx - Context object
7
+ */
8
+ export function reduceArrowDown(this: void, actions: __se__EventActions, ports: __se__EventPorts, ctx: __se__EventKeydownCtx): void;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @this {void}
3
+ * @description Backspace key down rule
4
+ * @param {__se__EventActions} actions - Action list
5
+ * @param {__se__EventPorts} ports - Ports for interacting with editor
6
+ * @param {__se__EventKeydownCtx} ctx - Context object
7
+ * @returns {boolean} Return false to stop the processing
8
+ */
9
+ export function reduceBackspaceDown(this: void, actions: __se__EventActions, ports: __se__EventPorts, ctx: __se__EventKeydownCtx): boolean;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @this {void}
3
+ * @description Delete key down rule
4
+ * @param {__se__EventActions} actions - Action list
5
+ * @param {__se__EventPorts} ports - Ports for interacting with editor
6
+ * @param {__se__EventKeydownCtx} ctx - Context object
7
+ * @returns {boolean} Return false to stop the processing
8
+ */
9
+ export function reduceDeleteDown(this: void, actions: __se__EventActions, ports: __se__EventPorts, ctx: __se__EventKeydownCtx): boolean;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @this {void}
3
+ * @description Enter key down rule
4
+ * @param {__se__EventActions} actions - Action list
5
+ * @param {__se__EventPorts} ports - Ports for interacting with editor
6
+ * @param {__se__EventKeydownCtx} ctx - Context object
7
+ * @returns {boolean} Return false to stop the processing
8
+ */
9
+ export function reduceEnterDown(this: void, actions: __se__EventActions, ports: __se__EventPorts, ctx: __se__EventKeydownCtx): boolean;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @this {void}
3
+ * @description Tab key down rule
4
+ * @param {__se__EventActions} actions - Action list
5
+ * @param {__se__EventPorts} _ports - Ports for interacting with editor
6
+ * @param {__se__EventKeydownCtx} ctx - Context object
7
+ * @returns {boolean} Return false to stop the processing
8
+ */
9
+ export function reduceTabDown(this: void, actions: __se__EventActions, _ports: __se__EventPorts, ctx: __se__EventKeydownCtx): boolean;
@@ -8,45 +8,35 @@
8
8
  * @param {Set} reverseKeys Reverse key array
9
9
  */
10
10
  export function CreateShortcuts(command: string, button: Element | null, values: Array<string>, keyMap: Map<string, any>, rc: any[], reverseKeys: Set<any>): void;
11
+ /**
12
+ * @typedef {Object} InitOptionsReturnType
13
+ * @property {BaseOptionsMap_constructor} o - Processed base options (Map containing {@link AllBaseOptions_constructor} keys)
14
+ * @property {Object<string, string>} i - Icon set
15
+ * @property {Object<string, string>} l - Language pack
16
+ * @property {string|null} v - Initial editor value
17
+ * @property {Array<string[]|string>} buttons - Toolbar button list (arrays for groups, strings for single buttons)
18
+ * @property {Array<string[]|string>|null} subButtons - Sub-toolbar button list
19
+ * @property {Element|null} statusbarContainer - Container element for status bar (if specified)
20
+ * @property {Map<string|null, FrameOptionsMap_constructor>} frameMap - Map of frame-specific options (frame key => {@link FrameOptionsMap})
21
+ */
11
22
  /**
12
23
  * @description Initialize options
13
- * @param {EditorInitOptions} options Configuration options for the editor.
14
- * @param {Array<{target: Element, key: *, options: EditorFrameOptions}>} editorTargets Target textarea
24
+ * @param {EditorInitOptions_constructor} options Configuration options for the editor.
25
+ * @param {Array<{target: Element, key: *, options: EditorFrameOptions_constructor}>} editorTargets Target textarea
15
26
  * @param {Object<string, *>} plugins Plugins object
16
- * @returns {{o: Map<string, *>, i: Object<string, string>, l: Object<string, string>, v: string, buttons: Array<string[]|string>, subButtons: Array<string[]|string>, statusbarContainer: Element|null, frameMap: Map<*, *>}}
17
- * - o: options
18
- * - i: icons
19
- * - l: lang
20
- * - v: value
21
- * - buttons: Toolbar button list
22
- * - subButtons: Sub-Toolbar button list
23
- * - statusbarContainer: statusbar container
24
- * - frameMap: converted options map
27
+ * @returns {InitOptionsReturnType} Initialized options and configuration
25
28
  */
26
29
  export function InitOptions(
27
- options: EditorInitOptions,
30
+ options: EditorInitOptions_constructor,
28
31
  editorTargets: Array<{
29
32
  target: Element;
30
33
  key: any;
31
- options: EditorFrameOptions;
34
+ options: EditorFrameOptions_constructor;
32
35
  }>,
33
36
  plugins: {
34
37
  [x: string]: any;
35
38
  }
36
- ): {
37
- o: Map<string, any>;
38
- i: {
39
- [x: string]: string;
40
- };
41
- l: {
42
- [x: string]: string;
43
- };
44
- v: string;
45
- buttons: Array<string[] | string>;
46
- subButtons: Array<string[] | string>;
47
- statusbarContainer: Element | null;
48
- frameMap: Map<any, any>;
49
- };
39
+ ): InitOptionsReturnType;
50
40
  /**
51
41
  * @description Create a context object for the editor frame.
52
42
  * @param {Map<string, *>} targetOptions - editor.frameOptions
@@ -118,27 +108,163 @@ export function CreateToolBar(
118
108
  }>;
119
109
  };
120
110
  export default Constructor;
121
- export type EditorFrameOptions = import('../config/options').EditorFrameOptions;
122
- export type EditorInitOptions = import('../config/options').EditorInitOptions;
111
+ export type EditorFrameOptions_constructor = import('../config/options').EditorFrameOptions;
112
+ export type EditorInitOptions_constructor = import('../config/options').EditorInitOptions;
113
+ export type AllBaseOptions_constructor = import('../config/options').AllBaseOptions;
114
+ export type BaseOptionsMap_constructor = import('../config/options').BaseOptionsMap;
115
+ export type FrameOptionsMap_constructor = import('../config/options').FrameOptionsMap;
116
+ export type ConstructorReturnType = {
117
+ /**
118
+ * - Editor context object
119
+ */
120
+ context: __se__Context;
121
+ /**
122
+ * - Carrier wrapper element
123
+ */
124
+ carrierWrapper: HTMLElement;
125
+ /**
126
+ * - Processed editor options (Map)
127
+ */
128
+ options: __se__BaseOptions;
129
+ /**
130
+ * - Loaded plugins
131
+ */
132
+ plugins: {
133
+ [x: string]: any;
134
+ };
135
+ /**
136
+ * - Icon set
137
+ */
138
+ icons: {
139
+ [x: string]: string;
140
+ };
141
+ /**
142
+ * - Language pack
143
+ */
144
+ lang: {
145
+ [x: string]: string;
146
+ };
147
+ /**
148
+ * - Initial editor value
149
+ */
150
+ value: string | null;
151
+ /**
152
+ * - Root frame ID
153
+ */
154
+ rootId: string | null;
155
+ /**
156
+ * - Array of frame keys
157
+ */
158
+ rootKeys: Array<string | null>;
159
+ /**
160
+ * - Map of frame contexts
161
+ */
162
+ frameRoots: Map<string | null, ReturnType<typeof CreateFrameContext>>;
163
+ /**
164
+ * - Plugin toolbar buttons
165
+ */
166
+ pluginCallButtons: {
167
+ [x: string]: HTMLElement[];
168
+ };
169
+ /**
170
+ * - Responsive toolbar buttons
171
+ */
172
+ responsiveButtons: Array<HTMLElement>;
173
+ /**
174
+ * - Sub-toolbar plugin buttons
175
+ */
176
+ pluginCallButtons_sub:
177
+ | {
178
+ [x: string]: Array<HTMLElement>;
179
+ }
180
+ | [];
181
+ /**
182
+ * - Sub-toolbar responsive buttons
183
+ */
184
+ responsiveButtons_sub: Array<HTMLElement>;
185
+ };
186
+ export type InitOptionsReturnType = {
187
+ /**
188
+ * - Processed base options (Map containing {@link AllBaseOptions_constructor} keys)
189
+ */
190
+ o: BaseOptionsMap_constructor;
191
+ /**
192
+ * - Icon set
193
+ */
194
+ i: {
195
+ [x: string]: string;
196
+ };
197
+ /**
198
+ * - Language pack
199
+ */
200
+ l: {
201
+ [x: string]: string;
202
+ };
203
+ /**
204
+ * - Initial editor value
205
+ */
206
+ v: string | null;
207
+ /**
208
+ * - Toolbar button list (arrays for groups, strings for single buttons)
209
+ */
210
+ buttons: Array<string[] | string>;
211
+ /**
212
+ * - Sub-toolbar button list
213
+ */
214
+ subButtons: Array<string[] | string> | null;
215
+ /**
216
+ * - Container element for status bar (if specified)
217
+ */
218
+ statusbarContainer: Element | null;
219
+ /**
220
+ * - Map of frame-specific options (frame key => {@link FrameOptionsMap})
221
+ */
222
+ frameMap: Map<string | null, FrameOptionsMap_constructor>;
223
+ };
224
+ /**
225
+ * @typedef {import('../config/options').EditorFrameOptions} EditorFrameOptions_constructor
226
+ */
123
227
  /**
124
- * @typedef {import('../config/options').EditorFrameOptions} EditorFrameOptions
228
+ * @typedef {import('../config/options').EditorInitOptions} EditorInitOptions_constructor
125
229
  */
126
230
  /**
127
- * @typedef {import('../config/options').EditorInitOptions} EditorInitOptions
231
+ * @typedef {import('../config/options').AllBaseOptions} AllBaseOptions_constructor
232
+ */
233
+ /**
234
+ * @typedef {import('../config/options').BaseOptionsMap} BaseOptionsMap_constructor
235
+ */
236
+ /**
237
+ * @typedef {import('../config/options').FrameOptionsMap} FrameOptionsMap_constructor
238
+ */
239
+ /**
240
+ * @typedef {Object} ConstructorReturnType
241
+ * @property {__se__Context} context - Editor context object
242
+ * @property {HTMLElement} carrierWrapper - Carrier wrapper element
243
+ * @property {__se__BaseOptions} options - Processed editor options (Map)
244
+ * @property {Object<string, *>} plugins - Loaded plugins
245
+ * @property {Object<string, string>} icons - Icon set
246
+ * @property {Object<string, string>} lang - Language pack
247
+ * @property {string|null} value - Initial editor value
248
+ * @property {string|null} rootId - Root frame ID
249
+ * @property {Array<string|null>} rootKeys - Array of frame keys
250
+ * @property {Map<string|null, ReturnType<import('../config/frameContext').CreateFrameContext>>} frameRoots - Map of frame contexts
251
+ * @property {Object<string, Array<HTMLElement>>} pluginCallButtons - Plugin toolbar buttons
252
+ * @property {Array<HTMLElement>} responsiveButtons - Responsive toolbar buttons
253
+ * @property {Object<string, Array<HTMLElement>>|[]} pluginCallButtons_sub - Sub-toolbar plugin buttons
254
+ * @property {Array<HTMLElement>} responsiveButtons_sub - Sub-toolbar responsive buttons
128
255
  */
129
256
  /**
130
257
  * @description Creates a new SunEditor instance with specified options.
131
- * @param {Array<{target: Element, key: *, options: EditorFrameOptions}>} editorTargets - Target element or multi-root object.
132
- * @param {EditorInitOptions} options - Configuration options for the editor.
133
- * @returns {Object<string, *>} - SunEditor instance with context, options, and DOM elements.
258
+ * @param {Array<{target: Element, key: *, options: EditorFrameOptions_constructor}>} editorTargets - Target element or multi-root object.
259
+ * @param {EditorInitOptions_constructor} options - Configuration options for the editor.
260
+ * @returns {ConstructorReturnType} - SunEditor instance with context, options, and DOM elements.
134
261
  */
135
262
  declare function Constructor(
136
263
  editorTargets: Array<{
137
264
  target: Element;
138
265
  key: any;
139
- options: EditorFrameOptions;
266
+ options: EditorFrameOptions_constructor;
140
267
  }>,
141
- options: EditorInitOptions
142
- ): {
143
- [x: string]: any;
144
- };
268
+ options: EditorInitOptions_constructor
269
+ ): ConstructorReturnType;
270
+ import { CreateFrameContext } from '../config/frameContext';
@@ -24,6 +24,10 @@ declare class ClassInjector {
24
24
  format: __se__EditorCore['format'];
25
25
  /** @description HTML class instance @type {__se__EditorCore['html']} */
26
26
  html: __se__EditorCore['html'];
27
+ /** @description Inline format class instance @type {__se__EditorCore['inline']} */
28
+ inline: __se__EditorCore['inline'];
29
+ /** @description List format class instance @type {__se__EditorCore['listFormat']} */
30
+ listFormat: __se__EditorCore['listFormat'];
27
31
  /** @description Menu class instance @type {__se__EditorCore['menu']} */
28
32
  menu: __se__EditorCore['menu'];
29
33
  /** @description NodeTransform class instance @type {__se__EditorCore['nodeTransform']} */
@@ -58,6 +58,10 @@ declare class EditorInjector {
58
58
  format: import('./_classes').default['format'];
59
59
  /** @type {import('./_classes').default['html']} */
60
60
  html: import('./_classes').default['html'];
61
+ /** @type {import('./_classes').default['inline']} */
62
+ inline: import('./_classes').default['inline'];
63
+ /** @type {import('./_classes').default['listFormat']} */
64
+ listFormat: import('./_classes').default['listFormat'];
61
65
  /** @type {import('./_classes').default['menu']} */
62
66
  menu: import('./_classes').default['menu'];
63
67
  /** @type {import('./_classes').default['nodeTransform']} */
@@ -151,19 +151,16 @@ export function spanToStyleNode(
151
151
  */
152
152
  export function addUrlQuery(url: string, query: string): string;
153
153
  /**
154
- * @typedef {Object} OptionStyleResult
155
- * @property {string} top - Styles applied to the top container (e.g. width, z-index, etc).
156
- * @property {string} frame - Styles applied to the iframe container (e.g. height, min-height).
157
- * @property {string} editor - Styles applied to the editable content area.
154
+ * @typedef {import('../core/config/options').OptionStyleResult} OptionStyleResult_converter
158
155
  */
159
156
  /**
160
157
  * @description Converts options-related styles and returns them for each frame.
161
158
  * @param {Map<string, *>} fo editor.frameOptions
162
159
  * @param {string} cssText Style string
163
- * @returns {OptionStyleResult}
160
+ * @returns {OptionStyleResult_converter}
164
161
  * @private
165
162
  */
166
- export function _setDefaultOptionStyle(fo: Map<string, any>, cssText: string): OptionStyleResult;
163
+ export function _setDefaultOptionStyle(fo: Map<string, any>, cssText: string): OptionStyleResult_converter;
167
164
  /**
168
165
  * @description Set default style tag of the iframe
169
166
  * @param {Array<string>} linkNames link names array of CSS files
@@ -177,20 +174,7 @@ export function _setIframeStyleLinks(linkNames: Array<string>): string;
177
174
  */
178
175
  export function _setAutoHeightStyle(frameHeight: string): string;
179
176
  export default converter;
180
- export type OptionStyleResult = {
181
- /**
182
- * - Styles applied to the top container (e.g. width, z-index, etc).
183
- */
184
- top: string;
185
- /**
186
- * - Styles applied to the iframe container (e.g. height, min-height).
187
- */
188
- frame: string;
189
- /**
190
- * - Styles applied to the editable content area.
191
- */
192
- editor: string;
193
- };
177
+ export type OptionStyleResult_converter = import('../core/config/options').OptionStyleResult;
194
178
  declare namespace converter {
195
179
  export { htmlToJson };
196
180
  export { jsonToHtml };
@@ -1,9 +1,94 @@
1
+ export const domQuery: {
2
+ getPositionIndex: typeof import('./domQuery').getPositionIndex;
3
+ getNodePath: typeof import('./domQuery').getNodePath;
4
+ getNodeFromPath: typeof import('./domQuery').getNodeFromPath;
5
+ getChildNode: typeof import('./domQuery').getChildNode;
6
+ getListChildren: typeof import('./domQuery').getListChildren;
7
+ getListChildNodes: typeof import('./domQuery').getListChildNodes;
8
+ getNodeDepth: typeof import('./domQuery').getNodeDepth;
9
+ sortNodeByDepth: typeof import('./domQuery').sortNodeByDepth;
10
+ compareElements: typeof import('./domQuery').compareElements;
11
+ getParentElement: typeof import('./domQuery').getParentElement;
12
+ getParentElements: typeof import('./domQuery').getParentElements;
13
+ getCommandTarget: typeof import('./domQuery').getCommandTarget;
14
+ getEventTarget: typeof import('./domQuery').getEventTarget;
15
+ getEdgeChild: typeof import('./domQuery').getEdgeChild;
16
+ getEdgeChildNodes: typeof import('./domQuery').getEdgeChildNodes;
17
+ getPreviousDeepestNode: typeof import('./domQuery').getPreviousDeepestNode;
18
+ getNextDeepestNode: typeof import('./domQuery').getNextDeepestNode;
19
+ findTextIndexOnLine: typeof import('./domQuery').findTextIndexOnLine;
20
+ findTabEndIndex: typeof import('./domQuery').findTabEndIndex;
21
+ findVisualLastCell: typeof import('./domQuery').findVisualLastCell;
22
+ getScrollParents: typeof import('./domQuery').getScrollParents;
23
+ getIframeDocument: typeof import('./domQuery').getIframeDocument;
24
+ };
25
+ export const domCheck: {
26
+ isZeroWidth: typeof import('./domCheck').isZeroWidth;
27
+ isEdgePoint: typeof import('./domCheck').isEdgePoint;
28
+ isText: typeof import('./domCheck').isText;
29
+ isElement: typeof import('./domCheck').isElement;
30
+ isInputElement: typeof import('./domCheck').isInputElement;
31
+ isButtonElement: typeof import('./domCheck').isButtonElement;
32
+ isList: typeof import('./domCheck').isList;
33
+ isListCell: typeof import('./domCheck').isListCell;
34
+ isTable: typeof import('./domCheck').isTable;
35
+ isTableElements: typeof import('./domCheck').isTableElements;
36
+ isTableCell: typeof import('./domCheck').isTableCell;
37
+ isTableRow: typeof import('./domCheck').isTableRow;
38
+ isBreak: typeof import('./domCheck').isBreak;
39
+ isAnchor: typeof import('./domCheck').isAnchor;
40
+ isMedia: typeof import('./domCheck').isMedia;
41
+ isIFrame: typeof import('./domCheck').isIFrame;
42
+ isFigure: typeof import('./domCheck').isFigure;
43
+ isContentLess: typeof import('./domCheck').isContentLess;
44
+ isEmptyLine: typeof import('./domCheck').isEmptyLine;
45
+ isComponentContainer: typeof import('./domCheck').isComponentContainer;
46
+ isWysiwygFrame: typeof import('./domCheck').isWysiwygFrame;
47
+ isNonEditable: typeof import('./domCheck').isNonEditable;
48
+ isSpanWithoutAttr: typeof import('./domCheck').isSpanWithoutAttr;
49
+ isSameAttributes: typeof import('./domCheck').isSameAttributes;
50
+ isExcludeFormat: typeof import('./domCheck').isExcludeFormat;
51
+ isUneditable: typeof import('./domCheck').isUneditable;
52
+ isImportantDisabled: typeof import('./domCheck').isImportantDisabled;
53
+ };
54
+ export const domUtils: {
55
+ clone: typeof import('./domUtils').clone;
56
+ createElement: typeof import('./domUtils').createElement;
57
+ createTextNode: typeof import('./domUtils').createTextNode;
58
+ getAttributesToString: typeof import('./domUtils').getAttributesToString;
59
+ arrayFilter: typeof import('./domUtils').arrayFilter;
60
+ arrayFind: typeof import('./domUtils').arrayFind;
61
+ arrayIncludes: typeof import('./domUtils').arrayIncludes;
62
+ getArrayIndex: typeof import('./domUtils').getArrayIndex;
63
+ nextIndex: typeof import('./domUtils').nextIndex;
64
+ prevIndex: typeof import('./domUtils').prevIndex;
65
+ copyTagAttributes: typeof import('./domUtils').copyTagAttributes;
66
+ copyFormatAttributes: typeof import('./domUtils').copyFormatAttributes;
67
+ removeItem: typeof import('./domUtils').removeItem;
68
+ changeElement: typeof import('./domUtils').changeElement;
69
+ changeTxt: typeof import('./domUtils').changeTxt;
70
+ setStyle: typeof import('./domUtils').setStyle;
71
+ getStyle: typeof import('./domUtils').getStyle;
72
+ setDisabled: typeof import('./domUtils').setDisabled;
73
+ hasClass: typeof import('./domUtils').hasClass;
74
+ addClass: typeof import('./domUtils').addClass;
75
+ removeClass: typeof import('./domUtils').removeClass;
76
+ toggleClass: typeof import('./domUtils').toggleClass;
77
+ flashClass: typeof import('./domUtils').flashClass;
78
+ getClientSize: typeof import('./domUtils').getClientSize;
79
+ getViewportSize: typeof import('./domUtils').getViewportSize;
80
+ applyInlineStylesAll: typeof import('./domUtils').applyInlineStylesAll;
81
+ waitForMediaLoad: typeof import('./domUtils').waitForMediaLoad;
82
+ getRootCssVar: typeof import('./domUtils').getRootCssVar;
83
+ setRootCssVar: typeof import('./domUtils').setRootCssVar;
84
+ createTooltipInner: typeof import('./domUtils').createTooltipInner;
85
+ };
1
86
  export default dom;
2
87
  declare namespace dom {
3
88
  export { query };
4
89
  export { check };
5
90
  export { utils };
6
91
  }
7
- import query from './domQuery';
8
92
  import check from './domCheck';
93
+ import query from './domQuery';
9
94
  import utils from './domUtils';
package/types/index.d.ts CHANGED
@@ -2,124 +2,14 @@
2
2
  * @file Automatically generated by barrelsby.
3
3
  */
4
4
 
5
- export * from './events';
6
- export * from './index';
7
- export * from './suneditor';
8
- export * from './assets/icons/defaultIcons';
9
- export * from './core/editor';
10
- export * from './core/base/eventManager';
11
- export * from './core/base/history';
12
- export * from './core/base/eventHandlers/handler_toolbar';
13
- export * from './core/base/eventHandlers/handler_ww_clipboard';
14
- export * from './core/base/eventHandlers/handler_ww_dragDrop';
15
- export * from './core/base/eventHandlers/handler_ww_key_input';
16
- export * from './core/base/eventHandlers/handler_ww_mouse';
17
- export * from './core/class/char';
18
- export * from './core/class/component';
19
- export * from './core/class/format';
20
- export * from './core/class/html';
21
- export * from './core/class/menu';
22
- export * from './core/class/nodeTransform';
23
- export * from './core/class/offset';
24
- export * from './core/class/selection';
25
- export * from './core/class/shortcuts';
26
- export * from './core/class/toolbar';
27
- export * from './core/class/ui';
28
- export * from './core/class/viewer';
29
- export * from './core/config/context';
30
- export * from './core/config/frameContext';
31
- export * from './core/config/options';
32
- export * from './core/section/actives';
33
- export * from './core/section/constructor';
34
- export * from './core/section/context';
35
- export * from './core/section/documentType';
36
- export * from './core/section/options';
37
- export * from './core/util/instanceCheck';
38
- export * from './editorInjector/_classes';
39
- export * from './editorInjector/_core';
40
- export * from './editorInjector/index';
41
- export * from './helper/clipboard';
42
- export * from './helper/converter';
43
- export * from './helper/env';
44
- export * from './helper/index';
45
- export * from './helper/keyCodeMap';
46
- export * from './helper/numbers';
47
- export * from './helper/unicode';
48
- export * from './helper/dom/domCheck';
49
- export * from './helper/dom/domQuery';
50
- export * from './helper/dom/domUtils';
51
- export * from './helper/dom/index';
52
- export * from './langs/_Lang';
53
- export * from './langs/ckb';
54
- export * from './langs/cs';
55
- export * from './langs/da';
56
- export * from './langs/de';
57
- export * from './langs/en';
58
- export * from './langs/es';
59
- export * from './langs/fa';
60
- export * from './langs/fr';
61
- export * from './langs/he';
62
- export * from './langs/hu';
63
- export * from './langs/index';
64
- export * from './langs/it';
65
- export * from './langs/ja';
66
- export * from './langs/km';
67
- export * from './langs/ko';
68
- export * from './langs/lv';
69
- export * from './langs/nl';
70
- export * from './langs/pl';
71
- export * from './langs/pt_br';
72
- export * from './langs/ro';
73
- export * from './langs/ru';
74
- export * from './langs/se';
75
- export * from './langs/tr';
76
- export * from './langs/uk';
77
- export * from './langs/ur';
78
- export * from './langs/zh_cn';
79
- export * from './modules/ApiManager';
80
- export * from './modules/Browser';
81
- export * from './modules/ColorPicker';
82
- export * from './modules/Controller';
83
- export * from './modules/Figure';
84
- export * from './modules/FileManager';
85
- export * from './modules/HueSlider';
86
- export * from './modules/Modal';
87
- export * from './modules/ModalAnchorEditor';
88
- export * from './modules/SelectMenu';
89
- export * from './modules/_DragHandle';
90
- export * from './modules/index';
91
- export * from './plugins/index';
92
- export * from './plugins/browser/audioGallery';
93
- export * from './plugins/browser/fileBrowser';
94
- export * from './plugins/browser/fileGallery';
95
- export * from './plugins/browser/imageGallery';
96
- export * from './plugins/browser/videoGallery';
97
- export * from './plugins/command/blockquote';
98
- export * from './plugins/command/exportPDF';
99
- export * from './plugins/command/fileUpload';
100
- export * from './plugins/command/list_bulleted';
101
- export * from './plugins/command/list_numbered';
102
- export * from './plugins/dropdown/align';
103
- export * from './plugins/dropdown/backgroundColor';
104
- export * from './plugins/dropdown/font';
105
- export * from './plugins/dropdown/fontColor';
106
- export * from './plugins/dropdown/formatBlock';
107
- export * from './plugins/dropdown/hr';
108
- export * from './plugins/dropdown/layout';
109
- export * from './plugins/dropdown/lineHeight';
110
- export * from './plugins/dropdown/list';
111
- export * from './plugins/dropdown/paragraphStyle';
112
- export * from './plugins/dropdown/table';
113
- export * from './plugins/dropdown/template';
114
- export * from './plugins/dropdown/textStyle';
115
- export * from './plugins/field/mention';
116
- export * from './plugins/input/fontSize';
117
- export * from './plugins/input/pageNavigator';
118
- export * from './plugins/modal/audio';
119
- export * from './plugins/modal/drawing';
120
- export * from './plugins/modal/embed';
121
- export * from './plugins/modal/image';
122
- export * from './plugins/modal/link';
123
- export * from './plugins/modal/math';
124
- export * from './plugins/modal/video';
125
- export * from './plugins/popup/anchor';
5
+ // Re-export default exports as named exports
6
+ export { default as helper } from './helper';
7
+ export { default as langs } from './langs';
8
+ export { default as modules } from './modules';
9
+ export { default as plugins } from './plugins';
10
+
11
+ // Export types
12
+ export type { SunEditorFrameOptionsType, SunEditorOptionsType } from './suneditor';
13
+
14
+ // Main default export
15
+ export { default } from './suneditor';