suneditor 3.0.0-beta.2 → 3.0.0-beta.20
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.
- package/CONTRIBUTING.md +186 -184
- package/LICENSE +21 -21
- package/README.md +157 -180
- package/dist/suneditor.min.css +1 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +126 -123
- package/src/assets/design/color.css +131 -121
- package/src/assets/design/index.css +3 -3
- package/src/assets/design/size.css +37 -35
- package/src/assets/design/typography.css +37 -37
- package/src/assets/icons/defaultIcons.js +247 -232
- package/src/assets/suneditor-contents.css +779 -778
- package/src/assets/suneditor.css +43 -35
- package/src/core/base/eventHandlers/handler_toolbar.js +135 -135
- package/src/core/base/eventHandlers/handler_ww_clipboard.js +56 -56
- package/src/core/base/eventHandlers/handler_ww_dragDrop.js +115 -113
- package/src/core/base/eventHandlers/handler_ww_key_input.js +1200 -1200
- package/src/core/base/eventHandlers/handler_ww_mouse.js +194 -194
- package/src/core/base/eventManager.js +1550 -1484
- package/src/core/base/history.js +355 -355
- package/src/core/class/char.js +163 -162
- package/src/core/class/component.js +856 -842
- package/src/core/class/format.js +3433 -3422
- package/src/core/class/html.js +1927 -1890
- package/src/core/class/menu.js +357 -346
- package/src/core/class/nodeTransform.js +424 -424
- package/src/core/class/offset.js +858 -891
- package/src/core/class/selection.js +710 -620
- package/src/core/class/shortcuts.js +98 -98
- package/src/core/class/toolbar.js +438 -430
- package/src/core/class/ui.js +424 -422
- package/src/core/class/viewer.js +750 -750
- package/src/core/editor.js +1810 -1708
- package/src/core/section/actives.js +268 -241
- package/src/core/section/constructor.js +1348 -1661
- package/src/core/section/context.js +102 -102
- package/src/core/section/documentType.js +582 -561
- package/src/core/section/options.js +367 -0
- package/src/core/util/instanceCheck.js +59 -0
- package/src/editorInjector/_classes.js +36 -36
- package/src/editorInjector/_core.js +92 -92
- package/src/editorInjector/index.js +75 -75
- package/src/events.js +634 -622
- package/src/helper/clipboard.js +59 -59
- package/src/helper/converter.js +586 -564
- package/src/helper/dom/domCheck.js +304 -304
- package/src/helper/dom/domQuery.js +677 -669
- package/src/helper/dom/domUtils.js +618 -557
- package/src/helper/dom/index.js +12 -12
- package/src/helper/env.js +249 -240
- package/src/helper/index.js +25 -25
- package/src/helper/keyCodeMap.js +183 -183
- package/src/helper/numbers.js +72 -72
- package/src/helper/unicode.js +47 -47
- package/src/langs/ckb.js +231 -231
- package/src/langs/cs.js +231 -231
- package/src/langs/da.js +231 -231
- package/src/langs/de.js +231 -231
- package/src/langs/en.js +230 -230
- package/src/langs/es.js +231 -231
- package/src/langs/fa.js +231 -231
- package/src/langs/fr.js +231 -231
- package/src/langs/he.js +231 -231
- package/src/langs/hu.js +230 -230
- package/src/langs/index.js +28 -28
- package/src/langs/it.js +231 -231
- package/src/langs/ja.js +230 -230
- package/src/langs/km.js +230 -230
- package/src/langs/ko.js +230 -230
- package/src/langs/lv.js +231 -231
- package/src/langs/nl.js +231 -231
- package/src/langs/pl.js +231 -231
- package/src/langs/pt_br.js +231 -231
- package/src/langs/ro.js +231 -231
- package/src/langs/ru.js +231 -231
- package/src/langs/se.js +231 -231
- package/src/langs/tr.js +231 -231
- package/src/langs/uk.js +231 -231
- package/src/langs/ur.js +231 -231
- package/src/langs/zh_cn.js +231 -231
- package/src/modules/ApiManager.js +191 -191
- package/src/modules/Browser.js +669 -667
- package/src/modules/ColorPicker.js +364 -362
- package/src/modules/Controller.js +474 -454
- package/src/modules/Figure.js +1620 -1617
- package/src/modules/FileManager.js +359 -359
- package/src/modules/HueSlider.js +577 -565
- package/src/modules/Modal.js +346 -346
- package/src/modules/ModalAnchorEditor.js +643 -643
- package/src/modules/SelectMenu.js +549 -549
- package/src/modules/_DragHandle.js +17 -17
- package/src/modules/index.js +14 -14
- package/src/plugins/browser/audioGallery.js +83 -83
- package/src/plugins/browser/fileBrowser.js +103 -103
- package/src/plugins/browser/fileGallery.js +83 -83
- package/src/plugins/browser/imageGallery.js +81 -81
- package/src/plugins/browser/videoGallery.js +103 -103
- package/src/plugins/command/blockquote.js +61 -60
- package/src/plugins/command/exportPDF.js +134 -134
- package/src/plugins/command/fileUpload.js +456 -456
- package/src/plugins/command/list_bulleted.js +149 -148
- package/src/plugins/command/list_numbered.js +152 -151
- package/src/plugins/dropdown/align.js +157 -155
- package/src/plugins/dropdown/backgroundColor.js +108 -104
- package/src/plugins/dropdown/font.js +141 -137
- package/src/plugins/dropdown/fontColor.js +109 -105
- package/src/plugins/dropdown/formatBlock.js +170 -178
- package/src/plugins/dropdown/hr.js +152 -152
- package/src/plugins/dropdown/layout.js +83 -83
- package/src/plugins/dropdown/lineHeight.js +131 -130
- package/src/plugins/dropdown/list.js +123 -122
- package/src/plugins/dropdown/paragraphStyle.js +138 -138
- package/src/plugins/dropdown/table.js +4110 -4000
- package/src/plugins/dropdown/template.js +83 -83
- package/src/plugins/dropdown/textStyle.js +149 -149
- package/src/plugins/field/mention.js +242 -242
- package/src/plugins/index.js +120 -120
- package/src/plugins/input/fontSize.js +414 -410
- package/src/plugins/input/pageNavigator.js +71 -70
- package/src/plugins/modal/audio.js +677 -677
- package/src/plugins/modal/drawing.js +537 -531
- package/src/plugins/modal/embed.js +886 -886
- package/src/plugins/modal/image.js +1377 -1376
- package/src/plugins/modal/link.js +248 -240
- package/src/plugins/modal/math.js +563 -563
- package/src/plugins/modal/video.js +1226 -1226
- package/src/plugins/popup/anchor.js +224 -222
- package/src/suneditor.js +114 -107
- package/src/themes/dark.css +132 -122
- package/src/typedef.js +132 -130
- package/types/assets/icons/defaultIcons.d.ts +8 -0
- package/types/core/base/eventManager.d.ts +29 -4
- package/types/core/class/char.d.ts +2 -1
- package/types/core/class/component.d.ts +1 -2
- package/types/core/class/format.d.ts +8 -1
- package/types/core/class/html.d.ts +8 -0
- package/types/core/class/menu.d.ts +8 -0
- package/types/core/class/offset.d.ts +24 -26
- package/types/core/class/selection.d.ts +2 -0
- package/types/core/class/toolbar.d.ts +6 -0
- package/types/core/class/ui.d.ts +1 -1
- package/types/core/editor.d.ts +34 -12
- package/types/core/section/constructor.d.ts +5 -638
- package/types/core/section/documentType.d.ts +12 -2
- package/types/core/section/options.d.ts +740 -0
- package/types/core/util/instanceCheck.d.ts +50 -0
- package/types/editorInjector/_core.d.ts +5 -5
- package/types/editorInjector/index.d.ts +2 -2
- package/types/events.d.ts +2 -0
- package/types/helper/converter.d.ts +9 -0
- package/types/helper/dom/domQuery.d.ts +5 -5
- package/types/helper/dom/domUtils.d.ts +8 -0
- package/types/helper/env.d.ts +6 -1
- package/types/helper/index.d.ts +4 -1
- package/types/index.d.ts +122 -120
- package/types/langs/_Lang.d.ts +194 -194
- package/types/modules/ColorPicker.d.ts +5 -1
- package/types/modules/Controller.d.ts +8 -4
- package/types/modules/Figure.d.ts +2 -1
- package/types/modules/HueSlider.d.ts +4 -1
- package/types/modules/SelectMenu.d.ts +1 -1
- package/types/plugins/command/blockquote.d.ts +1 -0
- package/types/plugins/command/list_bulleted.d.ts +1 -0
- package/types/plugins/command/list_numbered.d.ts +1 -0
- package/types/plugins/dropdown/align.d.ts +1 -0
- package/types/plugins/dropdown/backgroundColor.d.ts +1 -0
- package/types/plugins/dropdown/font.d.ts +1 -0
- package/types/plugins/dropdown/fontColor.d.ts +1 -0
- package/types/plugins/dropdown/formatBlock.d.ts +3 -2
- package/types/plugins/dropdown/lineHeight.d.ts +1 -0
- package/types/plugins/dropdown/list.d.ts +1 -0
- package/types/plugins/dropdown/table.d.ts +6 -0
- package/types/plugins/input/fontSize.d.ts +1 -0
- package/types/plugins/modal/drawing.d.ts +4 -0
- package/types/plugins/modal/link.d.ts +32 -15
- package/types/suneditor.d.ts +13 -9
- package/types/typedef.d.ts +8 -0
package/src/typedef.js
CHANGED
|
@@ -1,130 +1,132 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Global Type Declarations for SunEditor Custom Types
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// --------------------------------------------------------- [Node] ---------------------------------------------------------------------------------------------------
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {Array<Node>|HTMLCollection|NodeList} __se__NodeCollection
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// --------------------------------------------------------- [Editor] ---------------------------------------------------------------------------------------------------
|
|
11
|
-
/**
|
|
12
|
-
* @typedef {import('./core/editor').default} __se__EditorCore
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @typedef {import('./editorInjector').default} __se__EditorInjector
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @typedef {import('./editorInjector/_core').default} __se__CoreInjector
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @typedef {Object} __se__ComponentInfo
|
|
25
|
-
* @property {HTMLElement} target - The target element associated with the component.
|
|
26
|
-
* @property {string} pluginName - The name of the plugin related to the component.
|
|
27
|
-
* @property {Object<string, *>} options - Options related to the component.
|
|
28
|
-
* @property {HTMLElement} container - The main container element for the component.
|
|
29
|
-
* @property {?HTMLElement} cover - The cover element, if applicable.
|
|
30
|
-
* @property {?HTMLElement} inlineCover - The inline cover element, if applicable.
|
|
31
|
-
* @property {?HTMLElement} caption - The caption element, if applicable.
|
|
32
|
-
* @property {boolean} isFile - Whether the component is a file-related component.
|
|
33
|
-
* @property {?HTMLElement} launcher - The element that triggered the component, if applicable.
|
|
34
|
-
* @property {boolean} isInputType - Whether the component is an input component (e.g., table).
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @typedef {Object} __se__EditorStatus
|
|
39
|
-
* @property {boolean} hasFocus Boolean value of whether the editor has focus
|
|
40
|
-
* @property {number} tabSize Indent size of tab (4)
|
|
41
|
-
* @property {number} indentSize Indent size (25)px
|
|
42
|
-
* @property {number} codeIndentSize Indent size of Code view mode (2)
|
|
43
|
-
* @property {Array<string>} currentNodes An element array of the current cursor's node structure
|
|
44
|
-
* @property {Array<string>} currentNodesMap An element name array of the current cursor's node structure
|
|
45
|
-
* @property {
|
|
46
|
-
* @property {number}
|
|
47
|
-
* @property {
|
|
48
|
-
* @property {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
* @
|
|
56
|
-
* @property {
|
|
57
|
-
* @property {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
* @
|
|
64
|
-
* @property {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
* @
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
* @
|
|
78
|
-
* @property {
|
|
79
|
-
* @property {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
* @
|
|
86
|
-
* @property {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
* @
|
|
93
|
-
* @property {
|
|
94
|
-
* @property {
|
|
95
|
-
* @property {
|
|
96
|
-
* @property {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
* @
|
|
103
|
-
* @property {
|
|
104
|
-
* @property {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
* @
|
|
111
|
-
* @property {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Global Type Declarations for SunEditor Custom Types
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// --------------------------------------------------------- [Node] ---------------------------------------------------------------------------------------------------
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Array<Node>|HTMLCollection|NodeList} __se__NodeCollection
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// --------------------------------------------------------- [Editor] ---------------------------------------------------------------------------------------------------
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {import('./core/editor').default} __se__EditorCore
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @typedef {import('./editorInjector').default} __se__EditorInjector
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {import('./editorInjector/_core').default} __se__CoreInjector
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @typedef {Object} __se__ComponentInfo
|
|
25
|
+
* @property {HTMLElement} target - The target element associated with the component.
|
|
26
|
+
* @property {string} pluginName - The name of the plugin related to the component.
|
|
27
|
+
* @property {Object<string, *>} options - Options related to the component.
|
|
28
|
+
* @property {HTMLElement} container - The main container element for the component.
|
|
29
|
+
* @property {?HTMLElement} cover - The cover element, if applicable.
|
|
30
|
+
* @property {?HTMLElement} inlineCover - The inline cover element, if applicable.
|
|
31
|
+
* @property {?HTMLElement} caption - The caption element, if applicable.
|
|
32
|
+
* @property {boolean} isFile - Whether the component is a file-related component.
|
|
33
|
+
* @property {?HTMLElement} launcher - The element that triggered the component, if applicable.
|
|
34
|
+
* @property {boolean} isInputType - Whether the component is an input component (e.g., table).
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @typedef {Object} __se__EditorStatus
|
|
39
|
+
* @property {boolean} hasFocus Boolean value of whether the editor has focus
|
|
40
|
+
* @property {number} tabSize Indent size of tab (4)
|
|
41
|
+
* @property {number} indentSize Indent size (25)px
|
|
42
|
+
* @property {number} codeIndentSize Indent size of Code view mode (2)
|
|
43
|
+
* @property {Array<string>} currentNodes An element array of the current cursor's node structure
|
|
44
|
+
* @property {Array<string>} currentNodesMap An element name array of the current cursor's node structure
|
|
45
|
+
* @property {number} currentViewportHeight Current visual viewport height size
|
|
46
|
+
* @property {number} initViewportHeight Height of the initial visual viewport height size
|
|
47
|
+
* @property {boolean} onSelected Boolean value of whether component is selected
|
|
48
|
+
* @property {number} rootKey Current root key
|
|
49
|
+
* @property {Range} _range Current range object
|
|
50
|
+
* @property {boolean} _onMousedown Mouse down event status
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
// --------------------------------------------------------- [Event] ---------------------------------------------------------------------------------------------------
|
|
54
|
+
/**
|
|
55
|
+
* @typedef {Object} __se__EventInfo
|
|
56
|
+
* @property {*} target Target element
|
|
57
|
+
* @property {string} type Event type
|
|
58
|
+
* @property {(...args: *) => *} listener Event listener
|
|
59
|
+
* @property {boolean|AddEventListenerOptions=} useCapture Event useCapture option
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @typedef {Object} __se__GlobalEventInfo
|
|
64
|
+
* @property {string} type Event type
|
|
65
|
+
* @property {(...args: *) => *} listener Event listener
|
|
66
|
+
* @property {boolean|AddEventListenerOptions=} useCapture Use event capture
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
// --------------------------------------------------------- [Plugin Event] ---------------------------------------------------------------------------------------------------
|
|
70
|
+
/**
|
|
71
|
+
* @typedef {Object} __se__PluginMouseEventInfo
|
|
72
|
+
* @property {__se__FrameContext} frameContext Frame context
|
|
73
|
+
* @property {MouseEvent} event Event object
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @typedef {Object} __se__PluginKeyEventInfo
|
|
78
|
+
* @property {__se__FrameContext} frameContext Frame context
|
|
79
|
+
* @property {KeyboardEvent} event Event object
|
|
80
|
+
* @property {Range} range range object
|
|
81
|
+
* @property {HTMLElement} line Current line element
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @typedef {Object} __se__PluginToolbarInputChangeEventInfo
|
|
86
|
+
* @property {HTMLElement} target Input element
|
|
87
|
+
* @property {Event} event Event object
|
|
88
|
+
* @property {string} value Input value
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @typedef {Object} __se__PluginShortcutInfo Information of the "shortcut" plugin
|
|
93
|
+
* @property {Range} range - Range object
|
|
94
|
+
* @property {HTMLElement} line - The line element of the current range
|
|
95
|
+
* @property {import('./core/class/shortcuts').ShortcutInfo} info - Information of the shortcut
|
|
96
|
+
* @property {KeyboardEvent} event - Key event object
|
|
97
|
+
* @property {string} keyCode - KeyBoardEvent.code
|
|
98
|
+
* @property {__se__EditorCore} editor - The root editor instance
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @typedef {Object} __se__PluginPasteParams
|
|
103
|
+
* @property {__se__FrameContext} frameContext Frame context
|
|
104
|
+
* @property {ClipboardEvent} event Clipboard event object
|
|
105
|
+
* @property {string} data Format cleaned paste data (HTML string)
|
|
106
|
+
* @property {Document} doc DomParser data (new DOMParser().parseFromString(data, 'text/html');)
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @typedef {Object} __se__PluginCopyComponentParams
|
|
111
|
+
* @property {ClipboardEvent} event Clipboard event object
|
|
112
|
+
* @property {HTMLElement} cloneContainer Cloned component container
|
|
113
|
+
* @property {__se__ComponentInfo} info Component information
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
// --------------------------------------------------------- [Context] ---------------------------------------------------------------------------------------------------
|
|
117
|
+
/**
|
|
118
|
+
* @typedef {Map<string, *>} __se__FrameOptions
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @typedef {Map<string, *>} __se__FrameContext
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @typedef {Map<string, *>} __se__Context
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
// --------------------------------------------------------- [core.class] ---------------------------------------------------------------------------------------------------
|
|
130
|
+
/**
|
|
131
|
+
* @typedef {import('./core/class/offset').OffsetGlobalInfo} __se__Class_OffsetGlobalInfo
|
|
132
|
+
*/
|
|
@@ -41,6 +41,7 @@ declare namespace _default {
|
|
|
41
41
|
export let background_color: string;
|
|
42
42
|
export let list_bulleted: string;
|
|
43
43
|
export let list_numbered: string;
|
|
44
|
+
export let list_checked: string;
|
|
44
45
|
export let table: string;
|
|
45
46
|
export let table_header: string;
|
|
46
47
|
export let table_properties: string;
|
|
@@ -134,6 +135,13 @@ declare namespace _default {
|
|
|
134
135
|
export let side_menu_item: string;
|
|
135
136
|
export let side_menu_folder_plus: string;
|
|
136
137
|
export let alert_outline: string;
|
|
138
|
+
export let more_media: string;
|
|
139
|
+
export let more_gallery: string;
|
|
140
|
+
export let more_folder: string;
|
|
141
|
+
export let more_list: string;
|
|
142
|
+
export let more_file: string;
|
|
143
|
+
export let more_view: string;
|
|
144
|
+
export let more_page: string;
|
|
137
145
|
export let more_text: string;
|
|
138
146
|
export let more_paragraph: string;
|
|
139
147
|
export let more_plus: string;
|
|
@@ -28,6 +28,11 @@ declare class EventManager {
|
|
|
28
28
|
* @type {boolean}
|
|
29
29
|
*/
|
|
30
30
|
isComposing: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* @description An array of parent containers that can be scrolled (in descending order)
|
|
33
|
+
* @type {Array<Element>}
|
|
34
|
+
*/
|
|
35
|
+
scrollparents: Array<Element>;
|
|
31
36
|
/** @type {Array<*>} */
|
|
32
37
|
_events: Array<any>;
|
|
33
38
|
/** @type {RegExp} */
|
|
@@ -54,8 +59,6 @@ declare class EventManager {
|
|
|
54
59
|
__close_move: __se__GlobalEventInfo | null;
|
|
55
60
|
/** @type {__se__GlobalEventInfo|null} */
|
|
56
61
|
__geckoActiveEvent: __se__GlobalEventInfo | null;
|
|
57
|
-
/** @type {Array<Element>} */
|
|
58
|
-
__scrollparents: Array<Element>;
|
|
59
62
|
/** @type {Array<Node>} */
|
|
60
63
|
__cacheStyleNodes: Array<Node>;
|
|
61
64
|
/** @type {__se__GlobalEventInfo|null} */
|
|
@@ -283,9 +286,9 @@ declare class EventManager {
|
|
|
283
286
|
* @this {EventManagerThis}
|
|
284
287
|
* @description Adjusts the position of the editor's toolbar, controllers, and other floating elements based on scroll position.
|
|
285
288
|
* - Ensures UI elements maintain their intended relative positions when scrolling.
|
|
286
|
-
* @param {
|
|
289
|
+
* @param {*} eventWysiwyg The wysiwyg event object containing scroll data (Window or element)
|
|
287
290
|
*/
|
|
288
|
-
_moveContainer(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, eventWysiwyg:
|
|
291
|
+
_moveContainer(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, eventWysiwyg: any): void;
|
|
289
292
|
/**
|
|
290
293
|
* @private
|
|
291
294
|
* @this {EventManagerThis}
|
|
@@ -382,4 +385,26 @@ declare class EventManager {
|
|
|
382
385
|
* @param {*} range Range object
|
|
383
386
|
*/
|
|
384
387
|
__enterScrollTo(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, range: any): void;
|
|
388
|
+
/**
|
|
389
|
+
* @private
|
|
390
|
+
* @description Focus Event Postprocessing
|
|
391
|
+
* @this {EventManagerThis}
|
|
392
|
+
* @param {__se__FrameContext} frameContext - frame context object
|
|
393
|
+
* @param {Event} event - Event object
|
|
394
|
+
*/
|
|
395
|
+
__postFocusEvent(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, frameContext: __se__FrameContext, event: Event): void;
|
|
396
|
+
/**
|
|
397
|
+
* @private
|
|
398
|
+
* @description Blur Event Postprocessing
|
|
399
|
+
* @this {EventManagerThis}
|
|
400
|
+
* @param {__se__FrameContext} frameContext - frame context object
|
|
401
|
+
* @param {Event} event - Event object
|
|
402
|
+
*/
|
|
403
|
+
__postBlurEvent(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, frameContext: __se__FrameContext, event: Event): void;
|
|
404
|
+
/**
|
|
405
|
+
* @private
|
|
406
|
+
* @description Records the current viewport size.
|
|
407
|
+
* @this {EventManagerThis}
|
|
408
|
+
*/
|
|
409
|
+
__setViewportSize(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>): void;
|
|
385
410
|
}
|
|
@@ -46,8 +46,9 @@ declare class Char {
|
|
|
46
46
|
/**
|
|
47
47
|
* @this {CharThis}
|
|
48
48
|
* @description Set the char count to charCounter element textContent.
|
|
49
|
+
* @param {?__se__FrameContext=} fc Frame context
|
|
49
50
|
*/
|
|
50
|
-
display(this: Omit<Char & Partial<import('../../editorInjector').default>, 'char'
|
|
51
|
+
display(this: Omit<Char & Partial<import('../../editorInjector').default>, 'char'>, fc?: (__se__FrameContext | null) | undefined): void;
|
|
51
52
|
/**
|
|
52
53
|
* @this {CharThis}
|
|
53
54
|
* @description Returns false if char count is greater than "frameOptions.get('charCounter_max')" when "inputText" is added to the current editor.
|
|
@@ -63,10 +63,9 @@ declare class Component {
|
|
|
63
63
|
_bindClose_keydown: __se__GlobalEventInfo | void;
|
|
64
64
|
/** @type {__se__GlobalEventInfo|void} */
|
|
65
65
|
_bindClose_mousedown: __se__GlobalEventInfo | void;
|
|
66
|
-
/** @type {__se__GlobalEventInfo|void} */
|
|
67
|
-
_bindClose_touchstart: __se__GlobalEventInfo | void;
|
|
68
66
|
/** @type {boolean} */
|
|
69
67
|
__selectionSelected: boolean;
|
|
68
|
+
__prevent: boolean;
|
|
70
69
|
/**
|
|
71
70
|
* @this {ComponentThis}
|
|
72
71
|
* @description Inserts an element and returns it. (Used for elements: table, hr, image, video)
|
|
@@ -49,7 +49,7 @@ declare class Format {
|
|
|
49
49
|
_formatClosureBlockCheck: any;
|
|
50
50
|
_formatClosureBrLineCheck: any;
|
|
51
51
|
_textStyleTagsCheck: RegExp;
|
|
52
|
-
_brLineBreak:
|
|
52
|
+
_brLineBreak: boolean;
|
|
53
53
|
/**
|
|
54
54
|
* @this {FormatThis}
|
|
55
55
|
* @description Replace the line tag of the current selection.
|
|
@@ -613,4 +613,11 @@ declare class Format {
|
|
|
613
613
|
* @param {Array|null} styleArray Refer style array
|
|
614
614
|
*/
|
|
615
615
|
_sn_resetCommonListCell(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, el: Node, styleArray: any[] | null): boolean;
|
|
616
|
+
/**
|
|
617
|
+
* @private
|
|
618
|
+
* @this {FormatThis}
|
|
619
|
+
* @description Reset the line break format.
|
|
620
|
+
* @param {"line"|"br"} breakFormat options.get('defaultLineBreakFormat')
|
|
621
|
+
*/
|
|
622
|
+
__resetBrLineBreak(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, breakFormat: 'line' | 'br'): void;
|
|
616
623
|
}
|
|
@@ -419,4 +419,12 @@ declare class HTML {
|
|
|
419
419
|
* @returns {Node} The cleaned node with redundant styles removed.
|
|
420
420
|
*/
|
|
421
421
|
_dupleCheck(this: Omit<HTML & Partial<import('../../editorInjector').default>, 'html'>, oNode: Node, parentNode: Node): Node;
|
|
422
|
+
/**
|
|
423
|
+
* @private
|
|
424
|
+
* @this {HTMLThis}
|
|
425
|
+
* @description Reset autoStyleify options.
|
|
426
|
+
* @param {Array.<string>} autoStyleify Styles applied automatically on text input.
|
|
427
|
+
* - ex ["bold", "underline", "italic", "strike"]
|
|
428
|
+
*/
|
|
429
|
+
__resetAutoStyleify(this: Omit<HTML & Partial<import('../../editorInjector').default>, 'html'>, autoStyleify: Array<string>): void;
|
|
422
430
|
}
|
|
@@ -96,6 +96,14 @@ declare class Menu {
|
|
|
96
96
|
* @param {HTMLElement} menu Menu element
|
|
97
97
|
*/
|
|
98
98
|
_setMenuPosition(this: Omit<Menu & Partial<import('../../editorInjector').default>, 'menu'>, element: Node, menu: HTMLElement): void;
|
|
99
|
+
/**
|
|
100
|
+
* @private
|
|
101
|
+
* @this {MenuThis}
|
|
102
|
+
* @description Reset the menu position.
|
|
103
|
+
* @param {Node} element Button element
|
|
104
|
+
* @param {HTMLElement} menu Menu element
|
|
105
|
+
*/
|
|
106
|
+
_resetMenuPosition(this: Omit<Menu & Partial<import('../../editorInjector').default>, 'menu'>, element: Node, menu: HTMLElement): void;
|
|
99
107
|
/**
|
|
100
108
|
* @private
|
|
101
109
|
* @this {MenuThis}
|
|
@@ -75,21 +75,21 @@ export type OffsetGlobalInfo = {
|
|
|
75
75
|
*/
|
|
76
76
|
left: number;
|
|
77
77
|
/**
|
|
78
|
-
* - The
|
|
78
|
+
* - The top position within the current viewport, without taking scrolling into account.
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
fixedTop: number;
|
|
81
81
|
/**
|
|
82
|
-
* - The
|
|
82
|
+
* - The left position within the current viewport, without taking scrolling into account.
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
fixedLeft: number;
|
|
85
85
|
/**
|
|
86
|
-
* - The
|
|
86
|
+
* - The total width of the element, including its content, padding, and border.
|
|
87
87
|
*/
|
|
88
|
-
|
|
88
|
+
width: number;
|
|
89
89
|
/**
|
|
90
|
-
* - The
|
|
90
|
+
* - The total height of the element, including its content, padding, and border.
|
|
91
91
|
*/
|
|
92
|
-
|
|
92
|
+
height: number;
|
|
93
93
|
};
|
|
94
94
|
export type OffsetGlobalScrollInfo = {
|
|
95
95
|
/**
|
|
@@ -205,10 +205,10 @@ export type OffsetWWScrollInfo = {
|
|
|
205
205
|
* @typedef {Object} OffsetGlobalInfo
|
|
206
206
|
* @property {number} top - The top position of the element relative to the entire document.
|
|
207
207
|
* @property {number} left - The left position of the element relative to the entire document.
|
|
208
|
+
* @property {number} fixedTop - The top position within the current viewport, without taking scrolling into account.
|
|
209
|
+
* @property {number} fixedLeft - The left position within the current viewport, without taking scrolling into account.
|
|
208
210
|
* @property {number} width - The total width of the element, including its content, padding, and border.
|
|
209
211
|
* @property {number} height - The total height of the element, including its content, padding, and border.
|
|
210
|
-
* @property {number} scrollTop - The amount of vertical scrolling applied to the element.
|
|
211
|
-
* @property {number} scrollLeft - The amount of horizontal scrolling applied to the element.
|
|
212
212
|
*/
|
|
213
213
|
/**
|
|
214
214
|
* @typedef {Object} OffsetGlobalScrollInfo
|
|
@@ -274,10 +274,10 @@ declare class Offset {
|
|
|
274
274
|
* @typedef {Object} OffsetGlobalInfo
|
|
275
275
|
* @property {number} top - The top position of the element relative to the entire document.
|
|
276
276
|
* @property {number} left - The left position of the element relative to the entire document.
|
|
277
|
+
* @property {number} fixedTop - The top position within the current viewport, without taking scrolling into account.
|
|
278
|
+
* @property {number} fixedLeft - The left position within the current viewport, without taking scrolling into account.
|
|
277
279
|
* @property {number} width - The total width of the element, including its content, padding, and border.
|
|
278
280
|
* @property {number} height - The total height of the element, including its content, padding, and border.
|
|
279
|
-
* @property {number} scrollTop - The amount of vertical scrolling applied to the element.
|
|
280
|
-
* @property {number} scrollLeft - The amount of horizontal scrolling applied to the element.
|
|
281
281
|
*/
|
|
282
282
|
/**
|
|
283
283
|
* @typedef {Object} OffsetGlobalScrollInfo
|
|
@@ -312,10 +312,6 @@ declare class Offset {
|
|
|
312
312
|
* @param {__se__EditorCore} editor - The root editor instance
|
|
313
313
|
*/
|
|
314
314
|
constructor(editor: __se__EditorCore);
|
|
315
|
-
_scrollEvent: any;
|
|
316
|
-
_elTop: number;
|
|
317
|
-
_scrollY: number;
|
|
318
|
-
_isFixed: boolean;
|
|
319
315
|
/**
|
|
320
316
|
* @this {OffsetThis}
|
|
321
317
|
* @description Gets the position just outside the argument's internal editor (wysiwygFrame).
|
|
@@ -333,6 +329,7 @@ declare class Offset {
|
|
|
333
329
|
/**
|
|
334
330
|
* @this {OffsetThis}
|
|
335
331
|
* @description Returns the position of the argument relative to the global document.
|
|
332
|
+
* This is a refactored version using getBoundingClientRect for better performance and accuracy.
|
|
336
333
|
* @param {?Node=} node Target element.
|
|
337
334
|
* @returns {OffsetGlobalInfo} Global position and scroll values.
|
|
338
335
|
*/
|
|
@@ -357,9 +354,8 @@ declare class Offset {
|
|
|
357
354
|
* @param {HTMLElement} e_container Element's root container
|
|
358
355
|
* @param {HTMLElement} target Target element to position against
|
|
359
356
|
* @param {HTMLElement} t_container Target's root container
|
|
360
|
-
* @param {boolean} _reload Whether to reload position
|
|
361
357
|
*/
|
|
362
|
-
setRelPosition(this: Omit<Offset & Partial<import('../../editorInjector').default>, 'offset'>, element: HTMLElement, e_container: HTMLElement, target: HTMLElement, t_container: HTMLElement
|
|
358
|
+
setRelPosition(this: Omit<Offset & Partial<import('../../editorInjector').default>, 'offset'>, element: HTMLElement, e_container: HTMLElement, target: HTMLElement, t_container: HTMLElement): void;
|
|
363
359
|
/**
|
|
364
360
|
* @this {OffsetThis}
|
|
365
361
|
* @description Sets the absolute position of an element
|
|
@@ -370,6 +366,7 @@ declare class Offset {
|
|
|
370
366
|
* @param {{left:number, top:number}} [params.addOffset={left:0, top:0}] Additional offset
|
|
371
367
|
* @param {"bottom"|"top"} [params.position="bottom"] Position ('bottom'|'top')
|
|
372
368
|
* @param {*} params.inst Instance object of caller
|
|
369
|
+
* @param {HTMLElement} [params.sibling] The sibling controller element
|
|
373
370
|
* @returns {{position: "top" | "bottom"} | undefined} Success -> {position: current position}
|
|
374
371
|
*/
|
|
375
372
|
setAbsPosition(
|
|
@@ -384,6 +381,7 @@ declare class Offset {
|
|
|
384
381
|
};
|
|
385
382
|
position?: 'bottom' | 'top';
|
|
386
383
|
inst: any;
|
|
384
|
+
sibling?: HTMLElement;
|
|
387
385
|
}
|
|
388
386
|
):
|
|
389
387
|
| {
|
|
@@ -459,7 +457,12 @@ declare class Offset {
|
|
|
459
457
|
* @param {RectsInfo} targetRect Target rect object
|
|
460
458
|
* @param {boolean} isTargetAbs Is target absolute position
|
|
461
459
|
* @param {OffsetWWScrollInfo} wwScroll WYSIWYG scroll info
|
|
462
|
-
* @returns {{rmt:number, rmb:number, rt:number
|
|
460
|
+
* @returns {{rmt:number, rmb:number, rt:number, tMargin:number, bMargin:number}} Margin values
|
|
461
|
+
* - rmt: top margin to frame
|
|
462
|
+
* - rmb: bottom margin to frame
|
|
463
|
+
* - rt: Toolbar height offset adjustment
|
|
464
|
+
* - tMargin: top margin
|
|
465
|
+
* - bMargin: bottom margin
|
|
463
466
|
*/
|
|
464
467
|
_getVMargin(
|
|
465
468
|
this: Omit<Offset & Partial<import('../../editorInjector').default>, 'offset'>,
|
|
@@ -477,6 +480,8 @@ declare class Offset {
|
|
|
477
480
|
rmt: number;
|
|
478
481
|
rmb: number;
|
|
479
482
|
rt: number;
|
|
483
|
+
tMargin: number;
|
|
484
|
+
bMargin: number;
|
|
480
485
|
};
|
|
481
486
|
/**
|
|
482
487
|
* @private
|
|
@@ -512,11 +517,4 @@ declare class Offset {
|
|
|
512
517
|
bottom: number;
|
|
513
518
|
rects: RectsInfo;
|
|
514
519
|
};
|
|
515
|
-
/**
|
|
516
|
-
* @private
|
|
517
|
-
* @this {OffsetThis}
|
|
518
|
-
* @description Removes the global scroll event listener from the editor.
|
|
519
|
-
* - Resets related scroll tracking properties.
|
|
520
|
-
*/
|
|
521
|
-
__removeGlobalEvent(this: Omit<Offset & Partial<import('../../editorInjector').default>, 'offset'>): void;
|
|
522
520
|
}
|
|
@@ -33,6 +33,8 @@ declare class Selection_ {
|
|
|
33
33
|
/** @type {HTMLElement|Text} */
|
|
34
34
|
selectionNode: HTMLElement | Text;
|
|
35
35
|
__iframeFocus: boolean;
|
|
36
|
+
__hasScrollParents: boolean;
|
|
37
|
+
_scrollMargin: number;
|
|
36
38
|
/**
|
|
37
39
|
* @this {SelectionThis}
|
|
38
40
|
* @description Get window selection obejct
|
|
@@ -120,6 +120,12 @@ declare class Toolbar {
|
|
|
120
120
|
* @param {Array} buttonList Button list
|
|
121
121
|
*/
|
|
122
122
|
setButtons(this: Omit<Toolbar & Partial<import('../../editorInjector').default>, 'toolbar' | 'subToolbar'>, buttonList: any[]): void;
|
|
123
|
+
/**
|
|
124
|
+
* @private
|
|
125
|
+
* @this {ToolbarThis}
|
|
126
|
+
* @description Reset the common buttons info.
|
|
127
|
+
*/
|
|
128
|
+
_resetButtonInfo(this: Omit<Toolbar & Partial<import('../../editorInjector').default>, 'toolbar' | 'subToolbar'>): void;
|
|
123
129
|
/**
|
|
124
130
|
* @private
|
|
125
131
|
* @this {ToolbarThis}
|
package/types/core/class/ui.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ declare class UI {
|
|
|
38
38
|
_toastToggle: number;
|
|
39
39
|
/**
|
|
40
40
|
* @this {UIThis}
|
|
41
|
-
* @description
|
|
41
|
+
* @description set editor frame styles.
|
|
42
42
|
* - Define the style of the edit area
|
|
43
43
|
* - It can also be defined with the "setOptions" method, but the "setEditorStyle" method does not render the editor again.
|
|
44
44
|
* @param {string} style Style string
|