suneditor 3.0.0-alpha.9 → 3.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +170 -22
- package/{LICENSE.txt → LICENSE} +9 -9
- package/README.md +168 -30
- package/dist/suneditor.min.css +1 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +47 -21
- package/src/assets/design/color.css +121 -0
- package/src/assets/design/index.css +3 -0
- package/src/assets/design/size.css +35 -0
- package/src/assets/design/typography.css +37 -0
- package/src/assets/icons/defaultIcons.js +232 -0
- package/src/assets/suneditor-contents.css +181 -46
- package/src/assets/suneditor.css +1403 -650
- package/src/core/base/eventHandlers/handler_toolbar.js +35 -14
- package/src/core/base/eventHandlers/handler_ww_clipboard.js +23 -4
- package/src/core/base/eventHandlers/handler_ww_dragDrop.js +49 -10
- package/src/core/base/eventHandlers/handler_ww_key_input.js +422 -224
- package/src/core/base/eventHandlers/handler_ww_mouse.js +83 -36
- package/src/core/base/eventManager.js +520 -179
- package/src/core/base/history.js +95 -41
- package/src/core/class/char.js +26 -11
- package/src/core/class/component.js +345 -137
- package/src/core/class/format.js +683 -519
- package/src/core/class/html.js +485 -305
- package/src/core/class/menu.js +133 -47
- package/src/core/class/nodeTransform.js +90 -71
- package/src/core/class/offset.js +408 -92
- package/src/core/class/selection.js +216 -106
- package/src/core/class/shortcuts.js +68 -8
- package/src/core/class/toolbar.js +106 -116
- package/src/core/class/ui.js +422 -0
- package/src/core/class/viewer.js +178 -74
- package/src/core/editor.js +496 -389
- package/src/core/section/actives.js +123 -27
- package/src/core/section/constructor.js +615 -206
- package/src/core/section/context.js +28 -23
- package/src/core/section/documentType.js +561 -0
- package/src/editorInjector/_classes.js +19 -5
- package/src/editorInjector/_core.js +71 -7
- package/src/editorInjector/index.js +63 -1
- package/src/events.js +622 -0
- package/src/helper/clipboard.js +59 -0
- package/src/helper/converter.js +202 -26
- package/src/helper/dom/domCheck.js +304 -0
- package/src/helper/dom/domQuery.js +669 -0
- package/src/helper/dom/domUtils.js +557 -0
- package/src/helper/dom/index.js +12 -0
- package/src/helper/env.js +46 -56
- package/src/helper/index.js +10 -4
- package/src/helper/keyCodeMap.js +183 -0
- package/src/helper/numbers.js +12 -8
- package/src/helper/unicode.js +9 -5
- package/src/langs/ckb.js +74 -4
- package/src/langs/cs.js +72 -2
- package/src/langs/da.js +73 -3
- package/src/langs/de.js +73 -4
- package/src/langs/en.js +23 -3
- package/src/langs/es.js +73 -4
- package/src/langs/fa.js +75 -3
- package/src/langs/fr.js +73 -3
- package/src/langs/he.js +73 -4
- package/src/langs/hu.js +230 -0
- package/src/langs/index.js +7 -3
- package/src/langs/it.js +70 -1
- package/src/langs/ja.js +72 -4
- package/src/langs/km.js +230 -0
- package/src/langs/ko.js +22 -2
- package/src/langs/lv.js +74 -5
- package/src/langs/nl.js +73 -4
- package/src/langs/pl.js +73 -4
- package/src/langs/pt_br.js +70 -1
- package/src/langs/ro.js +74 -5
- package/src/langs/ru.js +73 -4
- package/src/langs/se.js +73 -4
- package/src/langs/tr.js +73 -1
- package/src/langs/{ua.js → uk.js} +75 -6
- package/src/langs/ur.js +77 -8
- package/src/langs/zh_cn.js +74 -5
- package/src/modules/ApiManager.js +77 -54
- package/src/modules/Browser.js +667 -0
- package/src/modules/ColorPicker.js +162 -102
- package/src/modules/Controller.js +273 -142
- package/src/modules/Figure.js +925 -484
- package/src/modules/FileManager.js +121 -69
- package/src/modules/HueSlider.js +113 -61
- package/src/modules/Modal.js +291 -122
- package/src/modules/ModalAnchorEditor.js +383 -234
- package/src/modules/SelectMenu.js +270 -168
- package/src/modules/_DragHandle.js +2 -1
- package/src/modules/index.js +3 -3
- package/src/plugins/browser/audioGallery.js +83 -0
- package/src/plugins/browser/fileBrowser.js +103 -0
- package/src/plugins/browser/fileGallery.js +83 -0
- package/src/plugins/browser/imageGallery.js +81 -0
- package/src/plugins/browser/videoGallery.js +103 -0
- package/src/plugins/command/blockquote.js +40 -27
- package/src/plugins/command/exportPDF.js +134 -0
- package/src/plugins/command/fileUpload.js +229 -162
- package/src/plugins/command/list_bulleted.js +83 -47
- package/src/plugins/command/list_numbered.js +83 -47
- package/src/plugins/dropdown/align.js +66 -54
- package/src/plugins/dropdown/backgroundColor.js +63 -49
- package/src/plugins/dropdown/font.js +71 -47
- package/src/plugins/dropdown/fontColor.js +63 -48
- package/src/plugins/dropdown/formatBlock.js +70 -33
- package/src/plugins/dropdown/hr.js +92 -51
- package/src/plugins/dropdown/layout.js +37 -26
- package/src/plugins/dropdown/lineHeight.js +54 -38
- package/src/plugins/dropdown/list.js +60 -45
- package/src/plugins/dropdown/paragraphStyle.js +51 -30
- package/src/plugins/dropdown/table.js +2003 -813
- package/src/plugins/dropdown/template.js +38 -26
- package/src/plugins/dropdown/textStyle.js +43 -31
- package/src/plugins/field/mention.js +147 -86
- package/src/plugins/index.js +32 -6
- package/src/plugins/input/fontSize.js +161 -108
- package/src/plugins/input/pageNavigator.js +70 -0
- package/src/plugins/modal/audio.js +358 -173
- package/src/plugins/modal/drawing.js +531 -0
- package/src/plugins/modal/embed.js +886 -0
- package/src/plugins/modal/image.js +674 -362
- package/src/plugins/modal/link.js +100 -71
- package/src/plugins/modal/math.js +367 -167
- package/src/plugins/modal/video.js +691 -335
- package/src/plugins/popup/anchor.js +222 -0
- package/src/suneditor.js +50 -13
- package/src/themes/dark.css +122 -0
- package/src/typedef.js +130 -0
- package/types/assets/icons/defaultIcons.d.ts +153 -0
- package/types/core/base/eventHandlers/handler_toolbar.d.ts +41 -0
- package/types/core/base/eventHandlers/handler_ww_clipboard.d.ts +40 -0
- package/types/core/base/eventHandlers/handler_ww_dragDrop.d.ts +35 -0
- package/types/core/base/eventHandlers/handler_ww_key_input.d.ts +45 -0
- package/types/core/base/eventHandlers/handler_ww_mouse.d.ts +39 -0
- package/types/core/base/eventManager.d.ts +385 -0
- package/types/core/base/history.d.ts +81 -0
- package/types/core/class/char.d.ts +60 -0
- package/types/core/class/component.d.ts +212 -0
- package/types/core/class/format.d.ts +616 -0
- package/types/core/class/html.d.ts +422 -0
- package/types/core/class/menu.d.ts +126 -0
- package/types/core/class/nodeTransform.d.ts +93 -0
- package/types/core/class/offset.d.ts +522 -0
- package/types/core/class/selection.d.ts +188 -0
- package/types/core/class/shortcuts.d.ts +142 -0
- package/types/core/class/toolbar.d.ts +189 -0
- package/types/core/class/ui.d.ts +164 -0
- package/types/core/class/viewer.d.ts +140 -0
- package/types/core/editor.d.ts +610 -0
- package/types/core/section/actives.d.ts +46 -0
- package/types/core/section/constructor.d.ts +777 -0
- package/types/core/section/context.d.ts +45 -0
- package/types/core/section/documentType.d.ts +178 -0
- package/types/editorInjector/_classes.d.ts +41 -0
- package/types/editorInjector/_core.d.ts +92 -0
- package/types/editorInjector/index.d.ts +71 -0
- package/types/events.d.ts +273 -0
- package/types/helper/clipboard.d.ts +12 -0
- package/types/helper/converter.d.ts +197 -0
- package/types/helper/dom/domCheck.d.ts +189 -0
- package/types/helper/dom/domQuery.d.ts +223 -0
- package/types/helper/dom/domUtils.d.ts +226 -0
- package/types/helper/dom/index.d.ts +9 -0
- package/types/helper/env.d.ts +132 -0
- package/types/helper/index.d.ts +174 -0
- package/types/helper/keyCodeMap.d.ts +110 -0
- package/types/helper/numbers.d.ts +46 -0
- package/types/helper/unicode.d.ts +28 -0
- package/types/index.d.ts +120 -0
- package/{typings/Lang.d.ts → types/langs/_Lang.d.ts} +173 -103
- package/types/langs/ckb.d.ts +3 -0
- package/types/langs/cs.d.ts +3 -0
- package/types/langs/da.d.ts +3 -0
- package/types/langs/de.d.ts +3 -0
- package/types/langs/en.d.ts +3 -0
- package/types/langs/es.d.ts +3 -0
- package/types/langs/fa.d.ts +3 -0
- package/types/langs/fr.d.ts +3 -0
- package/types/langs/he.d.ts +3 -0
- package/types/langs/hu.d.ts +3 -0
- package/types/langs/index.d.ts +54 -0
- package/types/langs/it.d.ts +3 -0
- package/types/langs/ja.d.ts +3 -0
- package/types/langs/km.d.ts +3 -0
- package/types/langs/ko.d.ts +3 -0
- package/types/langs/lv.d.ts +3 -0
- package/types/langs/nl.d.ts +3 -0
- package/types/langs/pl.d.ts +3 -0
- package/types/langs/pt_br.d.ts +3 -0
- package/types/langs/ro.d.ts +3 -0
- package/types/langs/ru.d.ts +3 -0
- package/types/langs/se.d.ts +3 -0
- package/types/langs/tr.d.ts +3 -0
- package/types/langs/uk.d.ts +3 -0
- package/types/langs/ur.d.ts +3 -0
- package/types/langs/zh_cn.d.ts +3 -0
- package/types/modules/ApiManager.d.ts +125 -0
- package/types/modules/Browser.d.ts +326 -0
- package/types/modules/ColorPicker.d.ts +131 -0
- package/types/modules/Controller.d.ts +251 -0
- package/types/modules/Figure.d.ts +517 -0
- package/types/modules/FileManager.d.ts +202 -0
- package/types/modules/HueSlider.d.ts +136 -0
- package/types/modules/Modal.d.ts +111 -0
- package/types/modules/ModalAnchorEditor.d.ts +236 -0
- package/types/modules/SelectMenu.d.ts +194 -0
- package/types/modules/_DragHandle.d.ts +7 -0
- package/types/modules/index.d.ts +26 -0
- package/types/plugins/browser/audioGallery.d.ts +55 -0
- package/types/plugins/browser/fileBrowser.d.ts +64 -0
- package/types/plugins/browser/fileGallery.d.ts +55 -0
- package/types/plugins/browser/imageGallery.d.ts +51 -0
- package/types/plugins/browser/videoGallery.d.ts +57 -0
- package/types/plugins/command/blockquote.d.ts +28 -0
- package/types/plugins/command/exportPDF.d.ts +46 -0
- package/types/plugins/command/fileUpload.d.ts +156 -0
- package/types/plugins/command/list_bulleted.d.ts +46 -0
- package/types/plugins/command/list_numbered.d.ts +46 -0
- package/types/plugins/dropdown/align.d.ts +60 -0
- package/types/plugins/dropdown/backgroundColor.d.ts +63 -0
- package/types/plugins/dropdown/font.d.ts +54 -0
- package/types/plugins/dropdown/fontColor.d.ts +63 -0
- package/types/plugins/dropdown/formatBlock.d.ts +54 -0
- package/types/plugins/dropdown/hr.d.ts +71 -0
- package/types/plugins/dropdown/layout.d.ts +40 -0
- package/types/plugins/dropdown/lineHeight.d.ts +50 -0
- package/types/plugins/dropdown/list.d.ts +39 -0
- package/types/plugins/dropdown/paragraphStyle.d.ts +54 -0
- package/types/plugins/dropdown/table.d.ts +627 -0
- package/types/plugins/dropdown/template.d.ts +40 -0
- package/types/plugins/dropdown/textStyle.d.ts +41 -0
- package/types/plugins/field/mention.d.ts +102 -0
- package/types/plugins/index.d.ts +107 -0
- package/types/plugins/input/fontSize.d.ts +170 -0
- package/types/plugins/input/pageNavigator.d.ts +28 -0
- package/types/plugins/modal/audio.d.ts +269 -0
- package/types/plugins/modal/drawing.d.ts +246 -0
- package/types/plugins/modal/embed.d.ts +387 -0
- package/types/plugins/modal/image.d.ts +451 -0
- package/types/plugins/modal/link.d.ts +128 -0
- package/types/plugins/modal/math.d.ts +193 -0
- package/types/plugins/modal/video.d.ts +485 -0
- package/types/plugins/popup/anchor.d.ts +56 -0
- package/types/suneditor.d.ts +51 -0
- package/types/typedef.d.ts +233 -0
- package/.eslintignore +0 -7
- package/.eslintrc.json +0 -64
- package/src/assets/icons/_default.js +0 -194
- package/src/core/base/events.js +0 -320
- package/src/core/class/notice.js +0 -42
- package/src/helper/domUtils.js +0 -1177
- package/src/modules/FileBrowser.js +0 -271
- package/src/plugins/command/exportPdf.js +0 -168
- package/src/plugins/fileBrowser/imageGallery.js +0 -81
- package/src/themes/test.css +0 -61
- package/typings/CommandPlugin.d.ts +0 -8
- package/typings/DialogPlugin.d.ts +0 -20
- package/typings/FileBrowserPlugin.d.ts +0 -30
- package/typings/Module.d.ts +0 -15
- package/typings/Plugin.d.ts +0 -42
- package/typings/SubmenuPlugin.d.ts +0 -8
- package/typings/_classes.d.ts +0 -17
- package/typings/_colorPicker.d.ts +0 -60
- package/typings/_core.d.ts +0 -55
- package/typings/align.d.ts +0 -5
- package/typings/audio.d.ts +0 -5
- package/typings/backgroundColor.d.ts +0 -5
- package/typings/blockquote.d.ts +0 -5
- package/typings/char.d.ts +0 -39
- package/typings/component.d.ts +0 -38
- package/typings/context.d.ts +0 -39
- package/typings/converter.d.ts +0 -33
- package/typings/dialog.d.ts +0 -28
- package/typings/domUtils.d.ts +0 -361
- package/typings/editor.d.ts +0 -7
- package/typings/editor.ts +0 -542
- package/typings/env.d.ts +0 -70
- package/typings/eventManager.d.ts +0 -37
- package/typings/events.d.ts +0 -262
- package/typings/fileBrowser.d.ts +0 -42
- package/typings/fileManager.d.ts +0 -67
- package/typings/font.d.ts +0 -5
- package/typings/fontColor.d.ts +0 -5
- package/typings/fontSize.d.ts +0 -5
- package/typings/format.d.ts +0 -191
- package/typings/formatBlock.d.ts +0 -5
- package/typings/history.d.ts +0 -48
- package/typings/horizontalRule.d.ts +0 -5
- package/typings/image.d.ts +0 -5
- package/typings/imageGallery.d.ts +0 -5
- package/typings/index.d.ts +0 -21
- package/typings/index.modules.d.ts +0 -11
- package/typings/index.plugins.d.ts +0 -58
- package/typings/lineHeight.d.ts +0 -5
- package/typings/link.d.ts +0 -5
- package/typings/list.d.ts +0 -5
- package/typings/math.d.ts +0 -5
- package/typings/mediaContainer.d.ts +0 -25
- package/typings/mention.d.ts +0 -5
- package/typings/node.d.ts +0 -57
- package/typings/notice.d.ts +0 -16
- package/typings/numbers.d.ts +0 -29
- package/typings/offset.d.ts +0 -24
- package/typings/options.d.ts +0 -589
- package/typings/paragraphStyle.d.ts +0 -5
- package/typings/resizing.d.ts +0 -141
- package/typings/selection.d.ts +0 -94
- package/typings/shortcuts.d.ts +0 -13
- package/typings/suneditor.d.ts +0 -9
- package/typings/table.d.ts +0 -5
- package/typings/template.d.ts +0 -5
- package/typings/textStyle.d.ts +0 -5
- package/typings/toolbar.d.ts +0 -32
- package/typings/unicode.d.ts +0 -25
- package/typings/video.d.ts +0 -5
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
export default EventManager;
|
|
2
|
+
export type EventManagerThis = Omit<EventManager & Partial<__se__EditorInjector>, 'eventManager'>;
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {Omit<EventManager & Partial<__se__EditorInjector>, 'eventManager'>} EventManagerThis
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @constructor
|
|
8
|
+
* @this {EventManagerThis}
|
|
9
|
+
* @description Event manager, editor's all event management class
|
|
10
|
+
* @param {__se__EditorCore} editor - The root editor instance
|
|
11
|
+
* @property {__se__EditorCore} editor - The root editor instance
|
|
12
|
+
*/
|
|
13
|
+
declare function EventManager(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, editor: __se__EditorCore): void;
|
|
14
|
+
declare class EventManager {
|
|
15
|
+
/**
|
|
16
|
+
* @typedef {Omit<EventManager & Partial<__se__EditorInjector>, 'eventManager'>} EventManagerThis
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* @constructor
|
|
20
|
+
* @this {EventManagerThis}
|
|
21
|
+
* @description Event manager, editor's all event management class
|
|
22
|
+
* @param {__se__EditorCore} editor - The root editor instance
|
|
23
|
+
* @property {__se__EditorCore} editor - The root editor instance
|
|
24
|
+
*/
|
|
25
|
+
constructor(editor: __se__EditorCore);
|
|
26
|
+
/**
|
|
27
|
+
* @description Old browsers: When there is no 'e.isComposing' in the keyup event
|
|
28
|
+
* @type {boolean}
|
|
29
|
+
*/
|
|
30
|
+
isComposing: boolean;
|
|
31
|
+
/** @type {Array<*>} */
|
|
32
|
+
_events: Array<any>;
|
|
33
|
+
/** @type {RegExp} */
|
|
34
|
+
_onButtonsCheck: RegExp;
|
|
35
|
+
/** @type {boolean} */
|
|
36
|
+
_onShortcutKey: boolean;
|
|
37
|
+
/** @type {number} */
|
|
38
|
+
_balloonDelay: number;
|
|
39
|
+
/** @type {ResizeObserver} */
|
|
40
|
+
_wwFrameObserver: ResizeObserver;
|
|
41
|
+
/** @type {ResizeObserver} */
|
|
42
|
+
_toolbarObserver: ResizeObserver;
|
|
43
|
+
/** @type {Element|null} */
|
|
44
|
+
_lineBreakComp: Element | null;
|
|
45
|
+
/** @type {Object<string, *>|null} */
|
|
46
|
+
_formatAttrsTemp: {
|
|
47
|
+
[x: string]: any;
|
|
48
|
+
} | null;
|
|
49
|
+
/** @type {number} */
|
|
50
|
+
_resizeClientY: number;
|
|
51
|
+
/** @type {__se__GlobalEventInfo|null} */
|
|
52
|
+
__resize_editor: __se__GlobalEventInfo | null;
|
|
53
|
+
/** @type {__se__GlobalEventInfo|null} */
|
|
54
|
+
__close_move: __se__GlobalEventInfo | null;
|
|
55
|
+
/** @type {__se__GlobalEventInfo|null} */
|
|
56
|
+
__geckoActiveEvent: __se__GlobalEventInfo | null;
|
|
57
|
+
/** @type {Array<Element>} */
|
|
58
|
+
__scrollparents: Array<Element>;
|
|
59
|
+
/** @type {Array<Node>} */
|
|
60
|
+
__cacheStyleNodes: Array<Node>;
|
|
61
|
+
/** @type {__se__GlobalEventInfo|null} */
|
|
62
|
+
__selectionSyncEvent: __se__GlobalEventInfo | null;
|
|
63
|
+
/** @type {boolean} */
|
|
64
|
+
_inputFocus: boolean;
|
|
65
|
+
/** @type {Object<string, *>|null} */
|
|
66
|
+
__inputPlugin: {
|
|
67
|
+
[x: string]: any;
|
|
68
|
+
} | null;
|
|
69
|
+
/** @type {?__se__EventInfo=} */
|
|
70
|
+
__inputBlurEvent: (__se__EventInfo | null) | undefined;
|
|
71
|
+
/** @type {?__se__EventInfo=} */
|
|
72
|
+
__inputKeyEvent: (__se__EventInfo | null) | undefined;
|
|
73
|
+
/** @type {HTMLInputElement} */
|
|
74
|
+
__focusTemp: HTMLInputElement;
|
|
75
|
+
/** @type {number|void} */
|
|
76
|
+
__retainTimer: number | void;
|
|
77
|
+
/** @type {Element} */
|
|
78
|
+
__eventDoc: Element;
|
|
79
|
+
/** @type {string} */
|
|
80
|
+
__secopy: string;
|
|
81
|
+
/**
|
|
82
|
+
* @this {EventManagerThis}
|
|
83
|
+
* @description Register for an event.
|
|
84
|
+
* - Only events registered with this method are unregistered or re-registered when methods such as 'setOptions', 'destroy' are called.
|
|
85
|
+
* @param {*} target Target element
|
|
86
|
+
* @param {string} type Event type
|
|
87
|
+
* @param {(...args: *) => *} listener Event handler
|
|
88
|
+
* @param {boolean|AddEventListenerOptions=} useCapture Event useCapture option
|
|
89
|
+
* @return {__se__EventInfo|null} Registered event information
|
|
90
|
+
*/
|
|
91
|
+
addEvent(
|
|
92
|
+
this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>,
|
|
93
|
+
target: any,
|
|
94
|
+
type: string,
|
|
95
|
+
listener: (...args: any) => any,
|
|
96
|
+
useCapture?: (boolean | AddEventListenerOptions) | undefined
|
|
97
|
+
): __se__EventInfo | null;
|
|
98
|
+
/**
|
|
99
|
+
* @this {EventManagerThis}
|
|
100
|
+
* @description Remove event
|
|
101
|
+
* @param {__se__EventInfo} params event info = this.addEvent()
|
|
102
|
+
* @returns {undefined|null} Success: null, Not found: undefined
|
|
103
|
+
*/
|
|
104
|
+
removeEvent(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, params: __se__EventInfo): undefined | null;
|
|
105
|
+
/**
|
|
106
|
+
* @this {EventManagerThis}
|
|
107
|
+
* @description Add an event to document.
|
|
108
|
+
* - When created as an Iframe, the same event is added to the document in the Iframe.
|
|
109
|
+
* @param {string} type Event type
|
|
110
|
+
* @param {(...args: *) => *} listener Event listener
|
|
111
|
+
* @param {boolean|AddEventListenerOptions=} useCapture Use event capture
|
|
112
|
+
* @return {__se__GlobalEventInfo} Registered event information
|
|
113
|
+
*/
|
|
114
|
+
addGlobalEvent(
|
|
115
|
+
this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>,
|
|
116
|
+
type: string,
|
|
117
|
+
listener: (...args: any) => any,
|
|
118
|
+
useCapture?: (boolean | AddEventListenerOptions) | undefined
|
|
119
|
+
): __se__GlobalEventInfo;
|
|
120
|
+
/**
|
|
121
|
+
* @this {EventManagerThis}
|
|
122
|
+
* @description Remove events from document.
|
|
123
|
+
* - When created as an Iframe, the event of the document inside the Iframe is also removed.
|
|
124
|
+
* @param {string|__se__GlobalEventInfo} type Event type or (Event info = this.addGlobalEvent())
|
|
125
|
+
* @param {(...args: *) => *=} listener Event listener
|
|
126
|
+
* @param {boolean|AddEventListenerOptions=} useCapture Use event capture
|
|
127
|
+
* @returns {undefined|null} Success: null, Not found: undefined
|
|
128
|
+
*/
|
|
129
|
+
removeGlobalEvent(
|
|
130
|
+
this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>,
|
|
131
|
+
type: string | __se__GlobalEventInfo,
|
|
132
|
+
listener?: ((...args: any) => any) | undefined,
|
|
133
|
+
useCapture?: (boolean | AddEventListenerOptions) | undefined
|
|
134
|
+
): undefined | null;
|
|
135
|
+
/**
|
|
136
|
+
* @this {EventManagerThis}
|
|
137
|
+
* @description Activates the corresponding button with the tags information of the current cursor position,
|
|
138
|
+
* - such as 'bold', 'underline', etc., and executes the 'active' method of the plugins.
|
|
139
|
+
* @param {?Node=} selectionNode selectionNode
|
|
140
|
+
* @returns {Node|undefined} selectionNode
|
|
141
|
+
*/
|
|
142
|
+
applyTagEffect(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, selectionNode?: (Node | null) | undefined): Node | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* @private
|
|
145
|
+
* @this {EventManagerThis}
|
|
146
|
+
* @description Gives an active effect when the mouse down event is blocked. (Used when "env.isGecko" is true)
|
|
147
|
+
* @param {Node} target Target element
|
|
148
|
+
* @private
|
|
149
|
+
*/
|
|
150
|
+
_injectActiveEvent(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, target: Node): void;
|
|
151
|
+
/**
|
|
152
|
+
* @private
|
|
153
|
+
* @this {EventManagerThis}
|
|
154
|
+
* @description remove class, display text.
|
|
155
|
+
* @param {Array<string>} ignoredList Igonred button list
|
|
156
|
+
* @private
|
|
157
|
+
*/
|
|
158
|
+
_setKeyEffect(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, ignoredList: Array<string>): void;
|
|
159
|
+
/**
|
|
160
|
+
* @private
|
|
161
|
+
* @this {EventManagerThis}
|
|
162
|
+
* @description Show toolbar-balloon with delay.
|
|
163
|
+
*/
|
|
164
|
+
_showToolbarBalloonDelay(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>): void;
|
|
165
|
+
/**
|
|
166
|
+
* @private
|
|
167
|
+
* @this {EventManagerThis}
|
|
168
|
+
* @description Show or hide the toolbar-balloon.
|
|
169
|
+
*/
|
|
170
|
+
_toggleToolbarBalloon(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>): void;
|
|
171
|
+
/**
|
|
172
|
+
* @private
|
|
173
|
+
* @this {EventManagerThis}
|
|
174
|
+
* @description Hide the toolbar.
|
|
175
|
+
*/
|
|
176
|
+
_hideToolbar(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>): void;
|
|
177
|
+
/**
|
|
178
|
+
* @private
|
|
179
|
+
* @this {EventManagerThis}
|
|
180
|
+
* @description Hide the Sub-Toolbar.
|
|
181
|
+
*/
|
|
182
|
+
_hideToolbar_sub(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>): void;
|
|
183
|
+
/**
|
|
184
|
+
* @private
|
|
185
|
+
* @this {EventManagerThis}
|
|
186
|
+
* @description Checks if a node is a non-focusable element(.data-se-non-focus). (e.g. fileUpload.component > span)
|
|
187
|
+
* @param {Node} node Node to check
|
|
188
|
+
* @returns {boolean} True if the node is non-focusable, otherwise false
|
|
189
|
+
*/
|
|
190
|
+
_isNonFocusNode(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, node: Node): boolean;
|
|
191
|
+
/**
|
|
192
|
+
* @private
|
|
193
|
+
* @this {EventManagerThis}
|
|
194
|
+
* @description Determines if the "range" is within an uneditable node.
|
|
195
|
+
* @param {Range} range The range object
|
|
196
|
+
* @param {boolean} isFront Whether to check the start or end of the range
|
|
197
|
+
* @returns {Node|null} The uneditable node if found, otherwise null
|
|
198
|
+
*/
|
|
199
|
+
_isUneditableNode(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, range: Range, isFront: boolean): Node | null;
|
|
200
|
+
/**
|
|
201
|
+
* @private
|
|
202
|
+
* @this {EventManagerThis}
|
|
203
|
+
* @description Retrieves the sibling node of a selected node if it is uneditable.
|
|
204
|
+
* - Used only in `_isUneditableNode`.
|
|
205
|
+
* @param {Node} selectNode The selected node
|
|
206
|
+
* @param {string} siblingKey The key to access the sibling (`previousSibling` or `nextSibling`)
|
|
207
|
+
* @param {Node} container The parent container node
|
|
208
|
+
* @returns {Node|null} The sibling node if found, otherwise null
|
|
209
|
+
*/
|
|
210
|
+
_isUneditableNode_getSibling(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, selectNode: Node, siblingKey: string, container: Node): Node | null;
|
|
211
|
+
/**
|
|
212
|
+
* @private
|
|
213
|
+
* @this {EventManagerThis}
|
|
214
|
+
* @description Deletes specific elements such as tables in "Firefox" and media elements (image, video, audio) in "Chrome".
|
|
215
|
+
* - Handles deletion logic based on selection range and node types.
|
|
216
|
+
* @returns {boolean} Returns `true` if an element was deleted and focus was adjusted, otherwise `false`.
|
|
217
|
+
*/
|
|
218
|
+
_hardDelete(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>): boolean;
|
|
219
|
+
/**
|
|
220
|
+
* @private
|
|
221
|
+
* @this {EventManagerThis}
|
|
222
|
+
* @description If there is no default format, add a line and move 'selection'.
|
|
223
|
+
* @param {string|null} formatName Format tag name (default: 'P')
|
|
224
|
+
*/
|
|
225
|
+
_setDefaultLine(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, formatName: string | null): any;
|
|
226
|
+
/**
|
|
227
|
+
* @private
|
|
228
|
+
* @this {EventManagerThis}
|
|
229
|
+
* @description Handles data transfer actions for paste and drop events.
|
|
230
|
+
* - It processes clipboard data, triggers relevant events, and inserts cleaned data into the editor.
|
|
231
|
+
* @param {"paste"|"drop"} type The type of event
|
|
232
|
+
* @param {Event} e The original event object
|
|
233
|
+
* @param {DataTransfer} clipboardData The clipboard data object
|
|
234
|
+
* @param {__se__FrameContext} frameContext The frame context
|
|
235
|
+
* @returns {Promise<boolean>} Resolves to `false` if processing is complete, otherwise allows default behavior
|
|
236
|
+
*/
|
|
237
|
+
_dataTransferAction(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, type: 'paste' | 'drop', e: Event, clipboardData: DataTransfer, frameContext: __se__FrameContext): Promise<boolean>;
|
|
238
|
+
/**
|
|
239
|
+
* @private
|
|
240
|
+
* @this {EventManagerThis}
|
|
241
|
+
* @description Processes clipboard data for paste and drop events, handling text and HTML cleanup.
|
|
242
|
+
* - Supports specific handling for content from Microsoft Office applications.
|
|
243
|
+
* @param {"paste"|"drop"} type The type of event
|
|
244
|
+
* @param {Event} e The original event object
|
|
245
|
+
* @param {DataTransfer} clipboardData The clipboard data object
|
|
246
|
+
* @param {__se__FrameContext} frameContext The frame context
|
|
247
|
+
* @returns {Promise<boolean>} Resolves to `false` if processing is complete, otherwise allows default behavior
|
|
248
|
+
*/
|
|
249
|
+
_setClipboardData(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, type: 'paste' | 'drop', e: Event, clipboardData: DataTransfer, frameContext: __se__FrameContext): Promise<boolean>;
|
|
250
|
+
/**
|
|
251
|
+
* @private
|
|
252
|
+
* @this {EventManagerThis}
|
|
253
|
+
* @description Registers common UI events such as toolbar and menu interactions.
|
|
254
|
+
* - Adds event listeners for various UI elements, sets up observers, and configures window events.
|
|
255
|
+
*/
|
|
256
|
+
_addCommonEvents(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>): void;
|
|
257
|
+
/**
|
|
258
|
+
* @private
|
|
259
|
+
* @this {EventManagerThis}
|
|
260
|
+
* @description Registers event listeners for the editor's frame, including text input, selection, and UI interactions.
|
|
261
|
+
* - Handles events inside an iframe or within the standard wysiwyg editor.
|
|
262
|
+
* @param {__se__FrameContext} fc The frame context object
|
|
263
|
+
*/
|
|
264
|
+
_addFrameEvents(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, fc: __se__FrameContext): void;
|
|
265
|
+
/**
|
|
266
|
+
* @private
|
|
267
|
+
* @this {EventManagerThis}
|
|
268
|
+
* @description Adds event listeners for resizing the status bar if resizing is enabled.
|
|
269
|
+
* - If resizing is not enabled, applies a non-resizable class.
|
|
270
|
+
* @param {__se__FrameContext} fc The frame context object
|
|
271
|
+
* @param {__se__FrameOptions} fo The frame options object
|
|
272
|
+
*/
|
|
273
|
+
__addStatusbarEvent(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, fc: __se__FrameContext, fo: __se__FrameOptions): void;
|
|
274
|
+
/**
|
|
275
|
+
* @private
|
|
276
|
+
* @this {EventManagerThis}
|
|
277
|
+
* @description Removes all registered event listeners from the editor.
|
|
278
|
+
* - Disconnects observers and clears stored event references.
|
|
279
|
+
*/
|
|
280
|
+
_removeAllEvents(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>): void;
|
|
281
|
+
/**
|
|
282
|
+
* @private
|
|
283
|
+
* @this {EventManagerThis}
|
|
284
|
+
* @description Adjusts the position of the editor's toolbar, controllers, and other floating elements based on scroll position.
|
|
285
|
+
* - Ensures UI elements maintain their intended relative positions when scrolling.
|
|
286
|
+
* @param {Element} eventWysiwyg The wysiwyg event object containing scroll data
|
|
287
|
+
*/
|
|
288
|
+
_moveContainer(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, eventWysiwyg: Element): void;
|
|
289
|
+
/**
|
|
290
|
+
* @private
|
|
291
|
+
* @this {EventManagerThis}
|
|
292
|
+
* @description Handles the scrolling of the editor container.
|
|
293
|
+
* - Repositions open controllers if necessary.
|
|
294
|
+
*/
|
|
295
|
+
_scrollContainer(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>): void;
|
|
296
|
+
/**
|
|
297
|
+
* @private
|
|
298
|
+
* @this {EventManagerThis}
|
|
299
|
+
* @description Repositions the currently open controllers within the editor.
|
|
300
|
+
* - Ensures elements are displayed in their correct positions after scrolling.
|
|
301
|
+
* @param {Array<object>} cont List of controllers to reposition
|
|
302
|
+
*/
|
|
303
|
+
__rePositionController(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, cont: Array<object>): void;
|
|
304
|
+
/**
|
|
305
|
+
* @private
|
|
306
|
+
* @this {EventManagerThis}
|
|
307
|
+
* @description Resets the frame status, adjusting toolbar and UI elements based on the current state.
|
|
308
|
+
* - Handles inline editor adjustments, fullscreen mode, and responsive toolbar updates.
|
|
309
|
+
*/
|
|
310
|
+
_resetFrameStatus(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>): void;
|
|
311
|
+
/**
|
|
312
|
+
* @private
|
|
313
|
+
* @this {EventManagerThis}
|
|
314
|
+
* @description Synchronizes the selection state by resetting it on mouseup.
|
|
315
|
+
* - Ensures selection updates correctly across different interactions.
|
|
316
|
+
*/
|
|
317
|
+
_setSelectionSync(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>): void;
|
|
318
|
+
/**
|
|
319
|
+
* @private
|
|
320
|
+
* @this {EventManagerThis}
|
|
321
|
+
* @description Retains the style nodes for formatting consistency when applying styles.
|
|
322
|
+
* - Preserves nested styling by cloning and restructuring the style nodes.
|
|
323
|
+
* @param {HTMLElement} formatEl The format element where styles should be retained
|
|
324
|
+
* @param {Array<Node>} _styleNodes The list of style nodes to retain
|
|
325
|
+
*/
|
|
326
|
+
_retainStyleNodes(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, formatEl: HTMLElement, _styleNodes: Array<Node>): void;
|
|
327
|
+
/**
|
|
328
|
+
* @private
|
|
329
|
+
* @this {EventManagerThis}
|
|
330
|
+
* @description Clears retained style nodes by replacing content with a single line break.
|
|
331
|
+
* - Resets the selection to the start of the cleared element.
|
|
332
|
+
* @param {HTMLElement} formatEl The format element where styles should be cleared
|
|
333
|
+
*/
|
|
334
|
+
_clearRetainStyleNodes(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, formatEl: HTMLElement): void;
|
|
335
|
+
/**
|
|
336
|
+
* @private
|
|
337
|
+
* @this {EventManagerThis}
|
|
338
|
+
* @description Calls a registered plugin event and executes associated handlers.
|
|
339
|
+
* - If any handler returns `false`, the event propagation stops.
|
|
340
|
+
* @param {string} name The name of the plugin event
|
|
341
|
+
* @param {{ frameContext: __se__FrameContext, event: Event, data?: string, line?: Node, range?: Range, file?: File, doc?: Document }} e The event object passed to the plugin event handler
|
|
342
|
+
* @returns {boolean|undefined} Returns `false` if any handler stops the event, otherwise `undefined`
|
|
343
|
+
*/
|
|
344
|
+
_callPluginEvent(
|
|
345
|
+
this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>,
|
|
346
|
+
name: string,
|
|
347
|
+
e: {
|
|
348
|
+
frameContext: __se__FrameContext;
|
|
349
|
+
event: Event;
|
|
350
|
+
data?: string;
|
|
351
|
+
line?: Node;
|
|
352
|
+
range?: Range;
|
|
353
|
+
file?: File;
|
|
354
|
+
doc?: Document;
|
|
355
|
+
}
|
|
356
|
+
): boolean | undefined;
|
|
357
|
+
/**
|
|
358
|
+
* @private
|
|
359
|
+
* @this {EventManagerThis}
|
|
360
|
+
* @description Handles the selection of a component when hovering over it.
|
|
361
|
+
* - If the target is a component, it ensures that the component is selected properly.
|
|
362
|
+
* @param {Element} target The element being hovered over
|
|
363
|
+
*/
|
|
364
|
+
_overComponentSelect(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, target: Element): void;
|
|
365
|
+
/**
|
|
366
|
+
* @private
|
|
367
|
+
* @this {EventManagerThis}
|
|
368
|
+
* @description Removes input event listeners and resets input-related properties.
|
|
369
|
+
*/
|
|
370
|
+
__removeInput(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>): void;
|
|
371
|
+
/**
|
|
372
|
+
* @private
|
|
373
|
+
* @this {EventManagerThis}
|
|
374
|
+
* @description Prevents the default behavior of the Enter key and refocuses the editor.
|
|
375
|
+
* @param {Event} e The keyboard event
|
|
376
|
+
*/
|
|
377
|
+
__enterPrevent(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, e: Event): void;
|
|
378
|
+
/**
|
|
379
|
+
* @private
|
|
380
|
+
* @description Scrolls the editor view to the caret position after pressing Enter. (Ignored on mobile devices)
|
|
381
|
+
* @this {EventManagerThis}
|
|
382
|
+
* @param {*} range Range object
|
|
383
|
+
*/
|
|
384
|
+
__enterScrollTo(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, range: any): void;
|
|
385
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description History stack closure
|
|
3
|
+
* @param {__se__EditorCore} editor - The root editor instance
|
|
4
|
+
*/
|
|
5
|
+
export default function History(editor: __se__EditorCore): {
|
|
6
|
+
/**
|
|
7
|
+
* @description Saving the current status to the history object stack
|
|
8
|
+
* - If "delay" is true, it will be saved after (options.get('historyStackDelayTime') || 400) milliseconds.
|
|
9
|
+
* - If the function is called again with the "delay" argument true before it is saved, the delay time is renewed.
|
|
10
|
+
* - You can specify the delay time by sending a number.
|
|
11
|
+
* @param {boolean|number} delay If true, add stack without delay time.
|
|
12
|
+
* @param {*=} [rootKey] The key of the root frame to save history for.
|
|
13
|
+
*/
|
|
14
|
+
push(delay: boolean | number, rootKey?: any | undefined): void;
|
|
15
|
+
/**
|
|
16
|
+
* @description Immediately saves the current state to the history stack if a delayed save is pending.
|
|
17
|
+
* @param {*} rootKey The key of the root frame.
|
|
18
|
+
* @param {Range} range The selection range object.
|
|
19
|
+
*/
|
|
20
|
+
check(rootKey: any, range: Range): void;
|
|
21
|
+
/**
|
|
22
|
+
* @description Undo function that restores the previous state from the history stack.
|
|
23
|
+
*/
|
|
24
|
+
undo(): void;
|
|
25
|
+
/**
|
|
26
|
+
* @description Redo function that re-applies a previously undone state from the history stack.
|
|
27
|
+
*/
|
|
28
|
+
redo(): void;
|
|
29
|
+
/**
|
|
30
|
+
* @description Overwrites the current state in the history stack with the latest content.
|
|
31
|
+
* @param {string=} [rootKey] The key of the root frame to overwrite.
|
|
32
|
+
*/
|
|
33
|
+
overwrite(rootKey?: string | undefined): void;
|
|
34
|
+
/**
|
|
35
|
+
* @description Pauses the history stack, preventing new entries from being added for up to 5 seconds.
|
|
36
|
+
*/
|
|
37
|
+
pause(): void;
|
|
38
|
+
/**
|
|
39
|
+
* @description Resumes history tracking by allowing new entries to be added to the stack.
|
|
40
|
+
*/
|
|
41
|
+
resume(): void;
|
|
42
|
+
/**
|
|
43
|
+
* @description Resets the history stack and disables related UI buttons.
|
|
44
|
+
*/
|
|
45
|
+
reset(): void;
|
|
46
|
+
/**
|
|
47
|
+
* @description Updates the state of history-related buttons (undo, redo, save) based on the current history stack.
|
|
48
|
+
* @param {*} rootKey The key of the root frame.
|
|
49
|
+
* @param {number} [index] The index of the current history state.
|
|
50
|
+
*/
|
|
51
|
+
resetButtons(rootKey: any, index?: number): void;
|
|
52
|
+
/**
|
|
53
|
+
* @description Returns the root stack containing the history of each frame.
|
|
54
|
+
* @returns {{content: string, s: {path: number|number[], offset: number|number[]}, e: {path: number|number[], offset: number|number[]}, frame: HTMLElement}} The root stack object.
|
|
55
|
+
* - content: content html string
|
|
56
|
+
* - s: depth info of the "start" range
|
|
57
|
+
* - e: depth info of the "end" range
|
|
58
|
+
* - frame: wysiwyg editable element.
|
|
59
|
+
*/
|
|
60
|
+
getRootStack(): {
|
|
61
|
+
content: string;
|
|
62
|
+
s: {
|
|
63
|
+
path: number | number[];
|
|
64
|
+
offset: number | number[];
|
|
65
|
+
};
|
|
66
|
+
e: {
|
|
67
|
+
path: number | number[];
|
|
68
|
+
offset: number | number[];
|
|
69
|
+
};
|
|
70
|
+
frame: HTMLElement;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* @description Resets the delay time for saving history.
|
|
74
|
+
* @param {number} ms The new delay time in milliseconds.
|
|
75
|
+
*/
|
|
76
|
+
resetDelayTime(ms: number): void;
|
|
77
|
+
/**
|
|
78
|
+
* @description Clears the entire history stack and cancels any pending save operations.
|
|
79
|
+
*/
|
|
80
|
+
destroy(): void;
|
|
81
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export default Char;
|
|
2
|
+
export type CharThis = Omit<Char & Partial<__se__EditorInjector>, 'char'>;
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {Omit<Char & Partial<__se__EditorInjector>, 'char'>} CharThis
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @constructor
|
|
8
|
+
* @this {CharThis}
|
|
9
|
+
* @description character count, character limit, etc. management class
|
|
10
|
+
* @param {__se__EditorCore} editor - The root editor instance
|
|
11
|
+
*/
|
|
12
|
+
declare function Char(this: Omit<Char & Partial<import('../../editorInjector').default>, 'char'>, editor: __se__EditorCore): void;
|
|
13
|
+
declare class Char {
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {Omit<Char & Partial<__se__EditorInjector>, 'char'>} CharThis
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* @constructor
|
|
19
|
+
* @this {CharThis}
|
|
20
|
+
* @description character count, character limit, etc. management class
|
|
21
|
+
* @param {__se__EditorCore} editor - The root editor instance
|
|
22
|
+
*/
|
|
23
|
+
constructor(editor: __se__EditorCore);
|
|
24
|
+
/**
|
|
25
|
+
* @this {CharThis}
|
|
26
|
+
* @description Returns false if char count is greater than "frameOptions.get('charCounter_max')" when "html" is added to the current editor.
|
|
27
|
+
* @param {Node|string} html Element node or String.
|
|
28
|
+
* @returns {boolean}
|
|
29
|
+
*/
|
|
30
|
+
check(this: Omit<Char & Partial<import('../../editorInjector').default>, 'char'>, html: Node | string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* @this {CharThis}
|
|
33
|
+
* @description Get the [content]'s number of characters or binary data size. (frameOptions.get('charCounter_type'))
|
|
34
|
+
* - If [content] is undefined, get the current editor's number of characters or binary data size.
|
|
35
|
+
* @param {string=} content Content to count. (defalut: this.editor.frameContext.get('wysiwyg'))
|
|
36
|
+
* @returns {number}
|
|
37
|
+
*/
|
|
38
|
+
getLength(this: Omit<Char & Partial<import('../../editorInjector').default>, 'char'>, content?: string | undefined): number;
|
|
39
|
+
/**
|
|
40
|
+
* @this {CharThis}
|
|
41
|
+
* @descriptionGets Get the length in bytes of a string.
|
|
42
|
+
* @param {string} text String text
|
|
43
|
+
* @returns {number}
|
|
44
|
+
*/
|
|
45
|
+
getByteLength(this: Omit<Char & Partial<import('../../editorInjector').default>, 'char'>, text: string): number;
|
|
46
|
+
/**
|
|
47
|
+
* @this {CharThis}
|
|
48
|
+
* @description Set the char count to charCounter element textContent.
|
|
49
|
+
*/
|
|
50
|
+
display(this: Omit<Char & Partial<import('../../editorInjector').default>, 'char'>): void;
|
|
51
|
+
/**
|
|
52
|
+
* @this {CharThis}
|
|
53
|
+
* @description Returns false if char count is greater than "frameOptions.get('charCounter_max')" when "inputText" is added to the current editor.
|
|
54
|
+
* - If the current number of characters is greater than "charCounter_max", the excess characters are removed.
|
|
55
|
+
* And call the char.display()
|
|
56
|
+
* @param {string} inputText Text added.
|
|
57
|
+
* @returns {boolean}
|
|
58
|
+
*/
|
|
59
|
+
test(this: Omit<Char & Partial<import('../../editorInjector').default>, 'char'>, inputText: string, _fromInputEvent: any): boolean;
|
|
60
|
+
}
|