suneditor 3.0.0-beta.3 → 3.0.0-beta.30
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 +8 -8
- package/README.md +44 -49
- package/dist/suneditor.min.css +1 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +95 -53
- package/src/assets/design/color.css +2 -2
- package/src/assets/design/size.css +2 -0
- package/src/assets/icons/defaultIcons.js +16 -1
- package/src/assets/suneditor-contents.css +9 -8
- package/src/assets/suneditor.css +29 -26
- package/src/core/{section → base}/actives.js +20 -12
- package/src/core/base/history.js +4 -4
- package/src/core/class/char.js +10 -10
- package/src/core/class/component.js +146 -57
- package/src/core/class/format.js +94 -2458
- package/src/core/class/html.js +187 -129
- package/src/core/class/inline.js +1853 -0
- package/src/core/class/listFormat.js +582 -0
- package/src/core/class/menu.js +14 -3
- package/src/core/class/nodeTransform.js +9 -14
- package/src/core/class/offset.js +162 -197
- package/src/core/class/selection.js +137 -34
- package/src/core/class/toolbar.js +73 -52
- package/src/core/class/ui.js +11 -11
- package/src/core/class/viewer.js +56 -55
- package/src/core/config/context.js +122 -0
- package/src/core/config/frameContext.js +204 -0
- package/src/core/config/options.js +639 -0
- package/src/core/editor.js +181 -108
- package/src/core/event/actions/index.js +229 -0
- package/src/core/event/effects/common.registry.js +60 -0
- package/src/core/event/effects/keydown.registry.js +551 -0
- package/src/core/event/effects/ruleHelpers.js +145 -0
- package/src/core/{base → event}/eventManager.js +119 -201
- package/src/core/event/executor.js +21 -0
- package/src/core/{base/eventHandlers → event/handlers}/handler_toolbar.js +4 -4
- package/src/core/{base/eventHandlers → event/handlers}/handler_ww_dragDrop.js +2 -2
- package/src/core/event/handlers/handler_ww_input.js +77 -0
- package/src/core/event/handlers/handler_ww_key.js +228 -0
- package/src/core/{base/eventHandlers → event/handlers}/handler_ww_mouse.js +3 -3
- package/src/core/event/ports.js +211 -0
- package/src/core/event/reducers/keydown.reducer.js +89 -0
- package/src/core/event/rules/keydown.rule.arrow.js +54 -0
- package/src/core/event/rules/keydown.rule.backspace.js +202 -0
- package/src/core/event/rules/keydown.rule.delete.js +126 -0
- package/src/core/event/rules/keydown.rule.enter.js +144 -0
- package/src/core/event/rules/keydown.rule.tab.js +29 -0
- package/src/core/section/constructor.js +79 -388
- package/src/core/section/documentType.js +47 -26
- package/src/core/util/instanceCheck.js +59 -0
- package/src/editorInjector/_classes.js +4 -0
- package/src/editorInjector/_core.js +17 -7
- package/src/editorInjector/index.js +10 -2
- package/src/events.js +6 -0
- package/src/helper/clipboard.js +24 -10
- package/src/helper/converter.js +17 -12
- package/src/helper/dom/domCheck.js +22 -3
- package/src/helper/dom/domQuery.js +91 -45
- package/src/helper/dom/domUtils.js +93 -19
- package/src/helper/dom/index.js +4 -0
- package/src/helper/env.js +11 -7
- package/src/helper/keyCodeMap.js +4 -3
- package/src/langs/ckb.js +1 -1
- package/src/langs/cs.js +1 -1
- package/src/langs/da.js +1 -1
- package/src/langs/de.js +1 -1
- package/src/langs/en.js +1 -1
- package/src/langs/es.js +1 -1
- package/src/langs/fa.js +1 -1
- package/src/langs/fr.js +1 -1
- package/src/langs/he.js +1 -1
- package/src/langs/hu.js +1 -1
- package/src/langs/it.js +1 -1
- package/src/langs/ja.js +1 -1
- package/src/langs/km.js +1 -1
- package/src/langs/ko.js +1 -1
- package/src/langs/lv.js +1 -1
- package/src/langs/nl.js +1 -1
- package/src/langs/pl.js +1 -1
- package/src/langs/pt_br.js +10 -10
- package/src/langs/ro.js +1 -1
- package/src/langs/ru.js +1 -1
- package/src/langs/se.js +1 -1
- package/src/langs/tr.js +1 -1
- package/src/langs/uk.js +1 -1
- package/src/langs/ur.js +1 -1
- package/src/langs/zh_cn.js +1 -1
- package/src/modules/ApiManager.js +25 -18
- package/src/modules/Browser.js +52 -61
- package/src/modules/ColorPicker.js +37 -38
- package/src/modules/Controller.js +85 -79
- package/src/modules/Figure.js +275 -187
- package/src/modules/FileManager.js +86 -92
- package/src/modules/HueSlider.js +67 -35
- package/src/modules/Modal.js +84 -77
- package/src/modules/ModalAnchorEditor.js +62 -79
- package/src/modules/SelectMenu.js +89 -86
- package/src/plugins/browser/audioGallery.js +9 -5
- package/src/plugins/browser/fileBrowser.js +10 -6
- package/src/plugins/browser/fileGallery.js +9 -5
- package/src/plugins/browser/imageGallery.js +9 -5
- package/src/plugins/browser/videoGallery.js +11 -6
- package/src/plugins/command/blockquote.js +1 -0
- package/src/plugins/command/exportPDF.js +11 -8
- package/src/plugins/command/fileUpload.js +41 -29
- package/src/plugins/command/list_bulleted.js +2 -1
- package/src/plugins/command/list_numbered.js +2 -1
- package/src/plugins/dropdown/align.js +8 -2
- package/src/plugins/dropdown/backgroundColor.js +19 -11
- package/src/plugins/dropdown/font.js +15 -9
- package/src/plugins/dropdown/fontColor.js +19 -11
- package/src/plugins/dropdown/formatBlock.js +7 -2
- package/src/plugins/dropdown/hr.js +7 -3
- package/src/plugins/dropdown/layout.js +6 -2
- package/src/plugins/dropdown/lineHeight.js +8 -3
- package/src/plugins/dropdown/list.js +2 -1
- package/src/plugins/dropdown/paragraphStyle.js +15 -11
- package/src/plugins/dropdown/{table.js → table/index.js} +514 -362
- package/src/plugins/dropdown/template.js +6 -2
- package/src/plugins/dropdown/textStyle.js +7 -3
- package/src/plugins/field/mention.js +33 -27
- package/src/plugins/input/fontSize.js +44 -37
- package/src/plugins/input/pageNavigator.js +3 -2
- package/src/plugins/modal/audio.js +90 -85
- package/src/plugins/modal/drawing.js +58 -66
- package/src/plugins/modal/embed.js +193 -180
- package/src/plugins/modal/image.js +441 -439
- package/src/plugins/modal/link.js +31 -8
- package/src/plugins/modal/math.js +23 -22
- package/src/plugins/modal/video.js +233 -230
- package/src/plugins/popup/anchor.js +24 -18
- package/src/suneditor.js +69 -24
- package/src/typedef.js +42 -19
- package/types/assets/icons/defaultIcons.d.ts +8 -0
- package/types/core/class/char.d.ts +1 -1
- package/types/core/class/component.d.ts +29 -7
- package/types/core/class/format.d.ts +4 -354
- package/types/core/class/html.d.ts +13 -4
- package/types/core/class/inline.d.ts +263 -0
- package/types/core/class/listFormat.d.ts +135 -0
- package/types/core/class/menu.d.ts +10 -2
- 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 +24 -11
- package/types/core/class/ui.d.ts +1 -1
- package/types/core/class/viewer.d.ts +1 -1
- package/types/core/config/context.d.ts +157 -0
- package/types/core/config/frameContext.d.ts +367 -0
- package/types/core/config/options.d.ts +1119 -0
- package/types/core/editor.d.ts +101 -66
- package/types/core/event/actions/index.d.ts +47 -0
- package/types/core/event/effects/common.registry.d.ts +50 -0
- package/types/core/event/effects/keydown.registry.d.ts +73 -0
- package/types/core/event/effects/ruleHelpers.d.ts +31 -0
- package/types/core/{base → event}/eventManager.d.ts +15 -46
- package/types/core/event/executor.d.ts +6 -0
- package/types/core/event/handlers/handler_ww_input.d.ts +41 -0
- package/types/core/{base/eventHandlers/handler_ww_key_input.d.ts → event/handlers/handler_ww_key.d.ts} +4 -6
- package/types/core/event/ports.d.ts +255 -0
- package/types/core/event/reducers/keydown.reducer.d.ts +75 -0
- package/types/core/event/rules/keydown.rule.arrow.d.ts +8 -0
- package/types/core/event/rules/keydown.rule.backspace.d.ts +9 -0
- package/types/core/event/rules/keydown.rule.delete.d.ts +9 -0
- package/types/core/event/rules/keydown.rule.enter.d.ts +9 -0
- package/types/core/event/rules/keydown.rule.tab.d.ts +9 -0
- package/types/core/section/constructor.d.ts +101 -631
- package/types/core/section/documentType.d.ts +14 -4
- package/types/core/util/instanceCheck.d.ts +50 -0
- package/types/editorInjector/_classes.d.ts +4 -0
- package/types/editorInjector/_core.d.ts +17 -7
- package/types/editorInjector/index.d.ts +10 -2
- package/types/events.d.ts +1 -0
- package/types/helper/clipboard.d.ts +2 -2
- package/types/helper/converter.d.ts +6 -9
- package/types/helper/dom/domCheck.d.ts +7 -0
- package/types/helper/dom/domQuery.d.ts +19 -8
- package/types/helper/dom/domUtils.d.ts +24 -2
- package/types/helper/dom/index.d.ts +86 -1
- package/types/helper/env.d.ts +6 -1
- package/types/helper/index.d.ts +7 -1
- package/types/helper/keyCodeMap.d.ts +3 -3
- package/types/index.d.ts +23 -117
- package/types/langs/index.d.ts +2 -2
- package/types/modules/ApiManager.d.ts +1 -8
- package/types/modules/Browser.d.ts +4 -62
- package/types/modules/ColorPicker.d.ts +4 -21
- package/types/modules/Controller.d.ts +8 -64
- package/types/modules/Figure.d.ts +54 -50
- package/types/modules/FileManager.d.ts +1 -13
- package/types/modules/HueSlider.d.ts +13 -3
- package/types/modules/Modal.d.ts +0 -43
- package/types/modules/ModalAnchorEditor.d.ts +0 -73
- package/types/modules/SelectMenu.d.ts +0 -85
- package/types/modules/index.d.ts +3 -3
- package/types/plugins/browser/audioGallery.d.ts +29 -18
- package/types/plugins/browser/fileBrowser.d.ts +38 -27
- package/types/plugins/browser/fileGallery.d.ts +29 -18
- package/types/plugins/browser/imageGallery.d.ts +24 -16
- package/types/plugins/browser/videoGallery.d.ts +29 -18
- package/types/plugins/command/blockquote.d.ts +1 -0
- package/types/plugins/command/exportPDF.d.ts +18 -18
- package/types/plugins/command/fileUpload.d.ts +65 -45
- 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 +13 -8
- package/types/plugins/dropdown/backgroundColor.d.ts +30 -19
- package/types/plugins/dropdown/font.d.ts +13 -12
- package/types/plugins/dropdown/fontColor.d.ts +30 -19
- package/types/plugins/dropdown/formatBlock.d.ts +13 -8
- package/types/plugins/dropdown/hr.d.ts +15 -11
- package/types/plugins/dropdown/layout.d.ts +15 -11
- package/types/plugins/dropdown/lineHeight.d.ts +16 -11
- package/types/plugins/dropdown/list.d.ts +1 -0
- package/types/plugins/dropdown/paragraphStyle.d.ts +31 -27
- package/types/plugins/dropdown/table/index.d.ts +582 -0
- package/types/plugins/dropdown/table.d.ts +41 -86
- package/types/plugins/dropdown/template.d.ts +15 -11
- package/types/plugins/dropdown/textStyle.d.ts +19 -11
- package/types/plugins/field/mention.d.ts +58 -56
- package/types/plugins/index.d.ts +38 -38
- package/types/plugins/input/fontSize.d.ts +46 -50
- package/types/plugins/modal/audio.d.ts +26 -56
- package/types/plugins/modal/drawing.d.ts +0 -85
- package/types/plugins/modal/embed.d.ts +15 -79
- package/types/plugins/modal/image.d.ts +24 -136
- package/types/plugins/modal/link.d.ts +34 -15
- package/types/plugins/modal/math.d.ts +0 -16
- package/types/plugins/modal/video.d.ts +17 -86
- package/types/plugins/popup/anchor.d.ts +1 -8
- package/types/suneditor.d.ts +70 -19
- package/types/typedef.d.ts +60 -46
- package/src/core/base/eventHandlers/handler_ww_key_input.js +0 -1200
- package/src/core/section/context.js +0 -102
- package/types/core/section/context.d.ts +0 -45
- package/types/langs/_Lang.d.ts +0 -194
- /package/src/core/{base/eventHandlers → event/handlers}/handler_ww_clipboard.js +0 -0
- /package/types/core/{section → base}/actives.d.ts +0 -0
- /package/types/core/{base/eventHandlers → event/handlers}/handler_toolbar.d.ts +0 -0
- /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_clipboard.d.ts +0 -0
- /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_dragDrop.d.ts +0 -0
- /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_mouse.d.ts +0 -0
|
@@ -44,6 +44,18 @@ export type HueSliderParams = {
|
|
|
44
44
|
*/
|
|
45
45
|
controllerOptions?: ControllerParams_hueSlider;
|
|
46
46
|
};
|
|
47
|
+
export function CreateSliderCtx(): {
|
|
48
|
+
slider: HTMLElement;
|
|
49
|
+
offscreenCanvas: HTMLCanvasElement;
|
|
50
|
+
offscreenCtx: CanvasRenderingContext2D;
|
|
51
|
+
wheel: HTMLCanvasElement;
|
|
52
|
+
wheelCtx: CanvasRenderingContext2D;
|
|
53
|
+
wheelPointer: HTMLElement;
|
|
54
|
+
gradientBar: HTMLCanvasElement;
|
|
55
|
+
gradientPointer: HTMLElement;
|
|
56
|
+
fanalColorHex: HTMLElement;
|
|
57
|
+
fanalColorBackground: HTMLElement;
|
|
58
|
+
};
|
|
47
59
|
/**
|
|
48
60
|
* @typedef {import('../modules/Controller').ControllerParams} ControllerParams_hueSlider
|
|
49
61
|
*/
|
|
@@ -100,9 +112,6 @@ declare class HueSlider {
|
|
|
100
112
|
};
|
|
101
113
|
isOpen: boolean;
|
|
102
114
|
controlle: any;
|
|
103
|
-
__globalMouseDown: any;
|
|
104
|
-
__globalMouseMove: any;
|
|
105
|
-
__globalMouseUp: any;
|
|
106
115
|
controller: Controller;
|
|
107
116
|
/**
|
|
108
117
|
* @description Get the current color information.
|
|
@@ -132,5 +141,6 @@ declare class HueSlider {
|
|
|
132
141
|
* @description Initialize the hue slider information.
|
|
133
142
|
*/
|
|
134
143
|
init(): void;
|
|
144
|
+
#private;
|
|
135
145
|
}
|
|
136
146
|
import Controller from './Controller';
|
package/types/modules/Modal.d.ts
CHANGED
|
@@ -53,26 +53,6 @@ declare class Modal extends CoreInjector {
|
|
|
53
53
|
isUpdate: boolean;
|
|
54
54
|
/** @type {HTMLInputElement} */
|
|
55
55
|
focusElement: HTMLInputElement;
|
|
56
|
-
/** @type {HTMLElement} */
|
|
57
|
-
_modalArea: HTMLElement;
|
|
58
|
-
/** @type {HTMLElement} */
|
|
59
|
-
_modalInner: HTMLElement;
|
|
60
|
-
_closeListener: any[];
|
|
61
|
-
_bindClose: any;
|
|
62
|
-
_onClickEvent: any;
|
|
63
|
-
_closeSignal: boolean;
|
|
64
|
-
/** @type {HTMLElement} */
|
|
65
|
-
_resizeBody: HTMLElement;
|
|
66
|
-
_currentHandle: HTMLElement;
|
|
67
|
-
__resizeDir: string;
|
|
68
|
-
__offetTop: number;
|
|
69
|
-
__offetLeft: number;
|
|
70
|
-
__globalEventHandlers: {
|
|
71
|
-
mousemove: any;
|
|
72
|
-
mouseup: any;
|
|
73
|
-
};
|
|
74
|
-
_bindClose_mousemove: any;
|
|
75
|
-
_bindClose_mouseup: any;
|
|
76
56
|
/**
|
|
77
57
|
* @description Open a modal plugin
|
|
78
58
|
* - The plugin's "init" method is called.
|
|
@@ -83,29 +63,6 @@ declare class Modal extends CoreInjector {
|
|
|
83
63
|
* - The plugin's "init" and "off" method is called.
|
|
84
64
|
*/
|
|
85
65
|
close(): void;
|
|
86
|
-
/**
|
|
87
|
-
* @private
|
|
88
|
-
* @description Fixes the current controller's display state when the modal is opened or closed.
|
|
89
|
-
* @param {boolean} fixed - Whether to fix or unfix the controller.
|
|
90
|
-
*/
|
|
91
|
-
private _fixCurrentController;
|
|
92
|
-
/**
|
|
93
|
-
* @private
|
|
94
|
-
* @description Saves the current offset position of the modal for resizing calculations.
|
|
95
|
-
* @returns {__se__Class_OffsetGlobalInfo} The offset position of the modal.
|
|
96
|
-
*/
|
|
97
|
-
private _saveOffset;
|
|
98
|
-
/**
|
|
99
|
-
* @private
|
|
100
|
-
* @description Adds global event listeners for resizing the modal.
|
|
101
|
-
* @param {string} dir - The direction in which resizing is occurring.
|
|
102
|
-
*/
|
|
103
|
-
private __addGlobalEvent;
|
|
104
|
-
/**
|
|
105
|
-
* @private
|
|
106
|
-
* @description Removes global event listeners related to modal resizing.
|
|
107
|
-
*/
|
|
108
|
-
private __removeGlobalEvent;
|
|
109
66
|
#private;
|
|
110
67
|
}
|
|
111
68
|
import CoreInjector from '../editorInjector/_core';
|
|
@@ -110,7 +110,6 @@ declare class ModalAnchorEditor extends EditorInjector {
|
|
|
110
110
|
fileManager: FileManager;
|
|
111
111
|
kink: any;
|
|
112
112
|
inst: any;
|
|
113
|
-
modalForm: HTMLElement;
|
|
114
113
|
host: string;
|
|
115
114
|
/** @type {HTMLInputElement} */
|
|
116
115
|
urlInput: HTMLInputElement;
|
|
@@ -133,14 +132,10 @@ declare class ModalAnchorEditor extends EditorInjector {
|
|
|
133
132
|
currentRel: any[];
|
|
134
133
|
currentTarget: HTMLAnchorElement;
|
|
135
134
|
linkValue: string;
|
|
136
|
-
_change: boolean;
|
|
137
|
-
_isRel: boolean;
|
|
138
135
|
/** @type {HTMLButtonElement} */
|
|
139
136
|
relButton: HTMLButtonElement;
|
|
140
137
|
/** @type {HTMLElement} */
|
|
141
138
|
relPreview: HTMLElement;
|
|
142
|
-
selectMenu_rel: SelectMenu;
|
|
143
|
-
selectMenu_bookmark: SelectMenu;
|
|
144
139
|
/**
|
|
145
140
|
* @description Initialize.
|
|
146
141
|
* - Sets the current anchor element to be edited.
|
|
@@ -162,75 +157,7 @@ declare class ModalAnchorEditor extends EditorInjector {
|
|
|
162
157
|
* @description Resets the ModalAnchorEditor to its initial state.
|
|
163
158
|
*/
|
|
164
159
|
init(): void;
|
|
165
|
-
/**
|
|
166
|
-
* @private
|
|
167
|
-
* @description Updates the anchor element with new attributes.
|
|
168
|
-
* @param {HTMLAnchorElement} anchor - The anchor (`<a>`) element to update.
|
|
169
|
-
* @param {string} url - The URL for the anchor's `href` attribute.
|
|
170
|
-
* @param {string} displayText - The text to be displayed inside the anchor.
|
|
171
|
-
* @param {string} title - The tooltip text (title attribute).
|
|
172
|
-
* @param {boolean} notText - If `true`, the anchor will not contain text content.
|
|
173
|
-
*/
|
|
174
|
-
private _updateAnchor;
|
|
175
|
-
/**
|
|
176
|
-
* @private
|
|
177
|
-
* @description Checks if the given path is an internal bookmark.
|
|
178
|
-
* @param {string} path - The URL or anchor link.
|
|
179
|
-
* @returns {boolean} - `true` if the path is an internal bookmark, otherwise `false`.
|
|
180
|
-
*/
|
|
181
|
-
private _selfPathBookmark;
|
|
182
|
-
/**
|
|
183
|
-
* @private
|
|
184
|
-
* @description Updates the `rel` attribute list in the modal and preview.
|
|
185
|
-
* @param {string} relAttr - The `rel` attribute string to set.
|
|
186
|
-
*/
|
|
187
|
-
private _setRel;
|
|
188
|
-
/**
|
|
189
|
-
* @private
|
|
190
|
-
* @description Generates a list of bookmark headers within the editor.
|
|
191
|
-
* @param {string} urlValue - The current URL input value.
|
|
192
|
-
*/
|
|
193
|
-
private _createBookmarkList;
|
|
194
|
-
/**
|
|
195
|
-
* @private
|
|
196
|
-
* @description Updates the preview of the anchor link.
|
|
197
|
-
* @param {string} value - The current URL value.
|
|
198
|
-
*/
|
|
199
|
-
private _setLinkPreview;
|
|
200
|
-
/**
|
|
201
|
-
* @private
|
|
202
|
-
* @description Merges the given `rel` attribute value with the current list.
|
|
203
|
-
* @param {string} relAttr - The `rel` attribute to merge.
|
|
204
|
-
* @returns {string} - The updated `rel` attribute string.
|
|
205
|
-
*/
|
|
206
|
-
private _relMerge;
|
|
207
|
-
/**
|
|
208
|
-
* @private
|
|
209
|
-
* @description Removes the specified `rel` attribute from the current list.
|
|
210
|
-
* @param {string} relAttr - The `rel` attribute to remove.
|
|
211
|
-
* @returns {string} - The updated `rel` attribute string.
|
|
212
|
-
*/
|
|
213
|
-
private _relDelete;
|
|
214
|
-
/**
|
|
215
|
-
* @private
|
|
216
|
-
* @description Registers a newly uploaded file and sets its URL in the modal form.
|
|
217
|
-
* @param {Object<string, *>} response - The response object from the file upload request.
|
|
218
|
-
*/
|
|
219
|
-
private _register;
|
|
220
|
-
/**
|
|
221
|
-
* @private
|
|
222
|
-
* @description Handles file upload errors.
|
|
223
|
-
* @param {Object<string, *>} response - The error response object.
|
|
224
|
-
* @returns {Promise<void>}
|
|
225
|
-
*/
|
|
226
|
-
private _error;
|
|
227
|
-
/**
|
|
228
|
-
* @description Handles the callback after a file upload completes.
|
|
229
|
-
* @param {XMLHttpRequest} xmlHttp - The XMLHttpRequest object containing the response.
|
|
230
|
-
*/
|
|
231
|
-
_uploadCallBack(xmlHttp: XMLHttpRequest): void;
|
|
232
160
|
#private;
|
|
233
161
|
}
|
|
234
162
|
import EditorInjector from '../editorInjector';
|
|
235
163
|
import FileManager from './FileManager';
|
|
236
|
-
import SelectMenu from './SelectMenu';
|
|
@@ -58,37 +58,10 @@ declare class SelectMenu extends CoreInjector {
|
|
|
58
58
|
checkList: boolean;
|
|
59
59
|
position: string;
|
|
60
60
|
subPosition: string;
|
|
61
|
-
_dirPosition: string;
|
|
62
|
-
_dirSubPosition: string;
|
|
63
|
-
_textDirDiff: boolean;
|
|
64
61
|
splitNum: number;
|
|
65
62
|
horizontal: boolean;
|
|
66
63
|
openMethod: () => void;
|
|
67
64
|
closeMethod: () => void;
|
|
68
|
-
_refer: HTMLElement;
|
|
69
|
-
_keydownTarget: Window | HTMLInputElement;
|
|
70
|
-
_selectMethod: (command: string) => void;
|
|
71
|
-
_bindClose_key: any;
|
|
72
|
-
_bindClose_mousedown: any;
|
|
73
|
-
_bindClose_click: any;
|
|
74
|
-
_closeSignal: boolean;
|
|
75
|
-
__events: {
|
|
76
|
-
mousedown: any;
|
|
77
|
-
mousemove: any;
|
|
78
|
-
click: any;
|
|
79
|
-
keydown: any;
|
|
80
|
-
};
|
|
81
|
-
__eventHandlers: {
|
|
82
|
-
mousedown: any;
|
|
83
|
-
mousemove: any;
|
|
84
|
-
click: any;
|
|
85
|
-
keydown: any;
|
|
86
|
-
};
|
|
87
|
-
__globalEventHandlers: {
|
|
88
|
-
keydown: any;
|
|
89
|
-
mousedown: any;
|
|
90
|
-
click: any;
|
|
91
|
-
};
|
|
92
65
|
/**
|
|
93
66
|
* @description Creates the select menu items.
|
|
94
67
|
* @param {Array<string>|__se__NodeCollection} items - Command list of selectable items.
|
|
@@ -130,65 +103,7 @@ declare class SelectMenu extends CoreInjector {
|
|
|
130
103
|
* @param {number} index Item index
|
|
131
104
|
*/
|
|
132
105
|
setItem(index: number): void;
|
|
133
|
-
/**
|
|
134
|
-
* @private
|
|
135
|
-
* @description Appends a formatted list of items to the menu.
|
|
136
|
-
* @param {string} html - The HTML string representing the menu items.
|
|
137
|
-
*/
|
|
138
|
-
private _createFormat;
|
|
139
|
-
/**
|
|
140
|
-
* @private
|
|
141
|
-
* @description Resets the menu state and removes event listeners.
|
|
142
|
-
*/
|
|
143
|
-
private _init;
|
|
144
106
|
_onItem: Element;
|
|
145
|
-
/**
|
|
146
|
-
* @private
|
|
147
|
-
* @description Moves the selection up or down by a specified number of items.
|
|
148
|
-
* @param {number} num - The number of items to move (negative for up, positive for down).
|
|
149
|
-
*/
|
|
150
|
-
private _moveItem;
|
|
151
|
-
/**
|
|
152
|
-
* @private
|
|
153
|
-
* @description Highlights and selects an item by index.
|
|
154
|
-
* @param {number} selectIndex - The index of the item to select.
|
|
155
|
-
*/
|
|
156
|
-
private _selectItem;
|
|
157
|
-
/**
|
|
158
|
-
* @private
|
|
159
|
-
* @description Sets the position of the select menu relative to the reference element.
|
|
160
|
-
* @param {string} position Menu position ("left"|"right") | ("top"|"bottom")
|
|
161
|
-
* @param {string} subPosition Sub position ("middle"|"top"|"bottom") | ("center"|"left"|"right")
|
|
162
|
-
* @param {string} [onItemQuerySelector] - A query selector string to highlight a specific item.
|
|
163
|
-
* @param {boolean} [_re=false] - Whether this is a retry after adjusting the position.
|
|
164
|
-
*/
|
|
165
|
-
private _setPosition;
|
|
166
|
-
/**
|
|
167
|
-
* @private
|
|
168
|
-
* @description Selects an item and triggers the callback function.
|
|
169
|
-
* @param {number} index - The index of the item to select.
|
|
170
|
-
*/
|
|
171
|
-
private _select;
|
|
172
|
-
/**
|
|
173
|
-
* @private
|
|
174
|
-
* @description Adds event listeners for menu interactions.
|
|
175
|
-
*/
|
|
176
|
-
private __addEvents;
|
|
177
|
-
/**
|
|
178
|
-
* @private
|
|
179
|
-
* @description Removes event listeners for menu interactions.
|
|
180
|
-
*/
|
|
181
|
-
private __removeEvents;
|
|
182
|
-
/**
|
|
183
|
-
* @private
|
|
184
|
-
* @description Adds global event listeners for closing the menu.
|
|
185
|
-
*/
|
|
186
|
-
private __addGlobalEvent;
|
|
187
|
-
/**
|
|
188
|
-
* @private
|
|
189
|
-
* @description Removes global event listeners for closing the menu.
|
|
190
|
-
*/
|
|
191
|
-
private __removeGlobalEvent;
|
|
192
107
|
#private;
|
|
193
108
|
}
|
|
194
109
|
import CoreInjector from '../editorInjector/_core';
|
package/types/modules/index.d.ts
CHANGED
|
@@ -14,13 +14,13 @@ declare namespace _default {
|
|
|
14
14
|
export default _default;
|
|
15
15
|
import _DragHandle from './_DragHandle';
|
|
16
16
|
import ApiManager from './ApiManager';
|
|
17
|
+
import Browser from './Browser';
|
|
17
18
|
import ColorPicker from './ColorPicker';
|
|
18
19
|
import Controller from './Controller';
|
|
19
|
-
import
|
|
20
|
+
import Figure from './Figure';
|
|
20
21
|
import FileManager from './FileManager';
|
|
21
22
|
import HueSlider from './HueSlider';
|
|
22
|
-
import Figure from './Figure';
|
|
23
23
|
import Modal from './Modal';
|
|
24
24
|
import ModalAnchorEditor from './ModalAnchorEditor';
|
|
25
25
|
import SelectMenu from './SelectMenu';
|
|
26
|
-
export { _DragHandle, ApiManager, ColorPicker, Controller,
|
|
26
|
+
export { _DragHandle, ApiManager, Browser, ColorPicker, Controller, Figure, FileManager, HueSlider, Modal, ModalAnchorEditor, SelectMenu };
|
|
@@ -1,8 +1,35 @@
|
|
|
1
1
|
export default AudioGallery;
|
|
2
2
|
export type BrowserFile_audioGallery = import('../../modules/Browser').BrowserFile;
|
|
3
|
+
export type AudioGalleryPluginOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* - Direct data without server calls
|
|
6
|
+
*/
|
|
7
|
+
data?: Array<BrowserFile_audioGallery>;
|
|
8
|
+
/**
|
|
9
|
+
* - Server request URL
|
|
10
|
+
*/
|
|
11
|
+
url?: string;
|
|
12
|
+
/**
|
|
13
|
+
* - Server request headers
|
|
14
|
+
*/
|
|
15
|
+
headers?: {
|
|
16
|
+
[x: string]: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* - Default thumbnail
|
|
20
|
+
*/
|
|
21
|
+
thumbnail?: string | ((item: BrowserFile_audioGallery) => string);
|
|
22
|
+
};
|
|
3
23
|
/**
|
|
4
24
|
* @typedef {import('../../modules/Browser').BrowserFile} BrowserFile_audioGallery
|
|
5
25
|
*/
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {Object} AudioGalleryPluginOptions
|
|
28
|
+
* @property {Array<BrowserFile_audioGallery>} [data] - Direct data without server calls
|
|
29
|
+
* @property {string} [url] - Server request URL
|
|
30
|
+
* @property {Object<string, string>} [headers] - Server request headers
|
|
31
|
+
* @property {string|((item: BrowserFile_audioGallery) => string)} [thumbnail] - Default thumbnail
|
|
32
|
+
*/
|
|
6
33
|
/**
|
|
7
34
|
* @class
|
|
8
35
|
* @extends EditorInjector
|
|
@@ -15,25 +42,9 @@ declare class AudioGallery extends EditorInjector {
|
|
|
15
42
|
/**
|
|
16
43
|
* @constructor
|
|
17
44
|
* @param {__se__EditorCore} editor - The root editor instance
|
|
18
|
-
* @param {
|
|
19
|
-
* @param {Array<*>=} pluginOptions.data - direct data without server calls
|
|
20
|
-
* @param {string} pluginOptions.url - server request url
|
|
21
|
-
* @param {Object<string, string>=} pluginOptions.headers - server request headers
|
|
22
|
-
* @param {string|((item: BrowserFile_audioGallery) => string)} pluginOptions.thumbnail - default thumbnail
|
|
45
|
+
* @param {AudioGalleryPluginOptions} pluginOptions
|
|
23
46
|
*/
|
|
24
|
-
constructor(
|
|
25
|
-
editor: __se__EditorCore,
|
|
26
|
-
pluginOptions: {
|
|
27
|
-
data?: Array<any> | undefined;
|
|
28
|
-
url: string;
|
|
29
|
-
headers?:
|
|
30
|
-
| {
|
|
31
|
-
[x: string]: string;
|
|
32
|
-
}
|
|
33
|
-
| undefined;
|
|
34
|
-
thumbnail: string | ((item: BrowserFile_audioGallery) => string);
|
|
35
|
-
}
|
|
36
|
-
);
|
|
47
|
+
constructor(editor: __se__EditorCore, pluginOptions: AudioGalleryPluginOptions);
|
|
37
48
|
title: any;
|
|
38
49
|
icon: string;
|
|
39
50
|
onSelectfunction: (targe: Node) => any;
|
|
@@ -1,8 +1,44 @@
|
|
|
1
1
|
export default FileBrowser;
|
|
2
2
|
export type BrowserFile_fileBrowser = import('../../modules/Browser').BrowserFile;
|
|
3
|
+
export type FileBrowserPluginOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* - Direct data without server calls
|
|
6
|
+
*/
|
|
7
|
+
data?:
|
|
8
|
+
| {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
}
|
|
11
|
+
| Array<any>;
|
|
12
|
+
/**
|
|
13
|
+
* - Server request URL
|
|
14
|
+
*/
|
|
15
|
+
url?: string;
|
|
16
|
+
/**
|
|
17
|
+
* - Server request headers
|
|
18
|
+
*/
|
|
19
|
+
headers?: {
|
|
20
|
+
[x: string]: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* - Default thumbnail
|
|
24
|
+
*/
|
|
25
|
+
thumbnail?: string | ((item: BrowserFile_fileBrowser) => string);
|
|
26
|
+
/**
|
|
27
|
+
* - Additional tag names
|
|
28
|
+
*/
|
|
29
|
+
props?: Array<string>;
|
|
30
|
+
};
|
|
3
31
|
/**
|
|
4
32
|
* @typedef {import('../../modules/Browser').BrowserFile} BrowserFile_fileBrowser
|
|
5
33
|
*/
|
|
34
|
+
/**
|
|
35
|
+
* @typedef {Object} FileBrowserPluginOptions
|
|
36
|
+
* @property {Object<string, *>|Array<*>} [data] - Direct data without server calls
|
|
37
|
+
* @property {string} [url] - Server request URL
|
|
38
|
+
* @property {Object<string, string>} [headers] - Server request headers
|
|
39
|
+
* @property {string|((item: BrowserFile_fileBrowser) => string)} [thumbnail] - Default thumbnail
|
|
40
|
+
* @property {Array<string>} [props] - Additional tag names
|
|
41
|
+
*/
|
|
6
42
|
/**
|
|
7
43
|
* @class
|
|
8
44
|
* @extends EditorInjector
|
|
@@ -15,34 +51,9 @@ declare class FileBrowser extends EditorInjector {
|
|
|
15
51
|
/**
|
|
16
52
|
* @constructor
|
|
17
53
|
* @param {__se__EditorCore} editor - The root editor instance
|
|
18
|
-
* @param {
|
|
19
|
-
* @param {Object<string, *>|Array<*>=} pluginOptions.data - direct data without server calls
|
|
20
|
-
* @param {string} pluginOptions.url - server request url
|
|
21
|
-
* @param {Object<string, string>=} pluginOptions.headers - server request headers
|
|
22
|
-
* @param {string|((item: BrowserFile_fileBrowser) => string)} pluginOptions.thumbnail - default thumbnail
|
|
23
|
-
* @param {Array<string>} pluginOptions.props - additional tag names
|
|
54
|
+
* @param {FileBrowserPluginOptions} pluginOptions
|
|
24
55
|
*/
|
|
25
|
-
constructor(
|
|
26
|
-
editor: __se__EditorCore,
|
|
27
|
-
pluginOptions: {
|
|
28
|
-
data?:
|
|
29
|
-
| (
|
|
30
|
-
| {
|
|
31
|
-
[x: string]: any;
|
|
32
|
-
}
|
|
33
|
-
| Array<any>
|
|
34
|
-
)
|
|
35
|
-
| undefined;
|
|
36
|
-
url: string;
|
|
37
|
-
headers?:
|
|
38
|
-
| {
|
|
39
|
-
[x: string]: string;
|
|
40
|
-
}
|
|
41
|
-
| undefined;
|
|
42
|
-
thumbnail: string | ((item: BrowserFile_fileBrowser) => string);
|
|
43
|
-
props: Array<string>;
|
|
44
|
-
}
|
|
45
|
-
);
|
|
56
|
+
constructor(editor: __se__EditorCore, pluginOptions: FileBrowserPluginOptions);
|
|
46
57
|
title: any;
|
|
47
58
|
icon: string;
|
|
48
59
|
onSelectfunction: (targe: Node) => any;
|
|
@@ -1,8 +1,35 @@
|
|
|
1
1
|
export default FileGallery;
|
|
2
2
|
export type BrowserFile_fileGallery = import('../../modules/Browser').BrowserFile;
|
|
3
|
+
export type FileGalleryPluginOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* - Direct data without server calls
|
|
6
|
+
*/
|
|
7
|
+
data?: Array<BrowserFile_fileGallery>;
|
|
8
|
+
/**
|
|
9
|
+
* - Server request URL
|
|
10
|
+
*/
|
|
11
|
+
url?: string;
|
|
12
|
+
/**
|
|
13
|
+
* - Server request headers
|
|
14
|
+
*/
|
|
15
|
+
headers?: {
|
|
16
|
+
[x: string]: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* - Default thumbnail
|
|
20
|
+
*/
|
|
21
|
+
thumbnail?: string | ((item: BrowserFile_fileGallery) => string);
|
|
22
|
+
};
|
|
3
23
|
/**
|
|
4
24
|
* @typedef {import('../../modules/Browser').BrowserFile} BrowserFile_fileGallery
|
|
5
25
|
*/
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {Object} FileGalleryPluginOptions
|
|
28
|
+
* @property {Array<BrowserFile_fileGallery>} [data] - Direct data without server calls
|
|
29
|
+
* @property {string} [url] - Server request URL
|
|
30
|
+
* @property {Object<string, string>} [headers] - Server request headers
|
|
31
|
+
* @property {string|((item: BrowserFile_fileGallery) => string)} [thumbnail] - Default thumbnail
|
|
32
|
+
*/
|
|
6
33
|
/**
|
|
7
34
|
* @class
|
|
8
35
|
* @extends EditorInjector
|
|
@@ -15,25 +42,9 @@ declare class FileGallery extends EditorInjector {
|
|
|
15
42
|
/**
|
|
16
43
|
* @constructor
|
|
17
44
|
* @param {__se__EditorCore} editor - The root editor instance
|
|
18
|
-
* @param {
|
|
19
|
-
* @param {Array<*>=} pluginOptions.data - direct data without server calls
|
|
20
|
-
* @param {string} pluginOptions.url - server request url
|
|
21
|
-
* @param {Object<string, string>=} pluginOptions.headers - server request headers
|
|
22
|
-
* @param {string|((item: BrowserFile_fileGallery) => string)} pluginOptions.thumbnail - default thumbnail
|
|
45
|
+
* @param {FileGalleryPluginOptions} pluginOptions
|
|
23
46
|
*/
|
|
24
|
-
constructor(
|
|
25
|
-
editor: __se__EditorCore,
|
|
26
|
-
pluginOptions: {
|
|
27
|
-
data?: Array<any> | undefined;
|
|
28
|
-
url: string;
|
|
29
|
-
headers?:
|
|
30
|
-
| {
|
|
31
|
-
[x: string]: string;
|
|
32
|
-
}
|
|
33
|
-
| undefined;
|
|
34
|
-
thumbnail: string | ((item: BrowserFile_fileGallery) => string);
|
|
35
|
-
}
|
|
36
|
-
);
|
|
47
|
+
constructor(editor: __se__EditorCore, pluginOptions: FileGalleryPluginOptions);
|
|
37
48
|
title: any;
|
|
38
49
|
icon: string;
|
|
39
50
|
onSelectfunction: (targe: Node) => any;
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
export default ImageGallery;
|
|
2
|
+
export type ImageGalleryPluginOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* - Direct data without server calls
|
|
5
|
+
*/
|
|
6
|
+
data?: Array<any>;
|
|
7
|
+
/**
|
|
8
|
+
* - Server request URL
|
|
9
|
+
*/
|
|
10
|
+
url?: string;
|
|
11
|
+
/**
|
|
12
|
+
* - Server request headers
|
|
13
|
+
*/
|
|
14
|
+
headers?: {
|
|
15
|
+
[x: string]: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* @typedef ImageGalleryPluginOptions
|
|
20
|
+
* @property {Array<*>} [data] - Direct data without server calls
|
|
21
|
+
* @property {string} [url] - Server request URL
|
|
22
|
+
* @property {Object<string, string>} [headers] - Server request headers
|
|
23
|
+
*/
|
|
2
24
|
/**
|
|
3
25
|
* @class
|
|
4
26
|
* @extends EditorInjector
|
|
@@ -11,23 +33,9 @@ declare class ImageGallery extends EditorInjector {
|
|
|
11
33
|
/**
|
|
12
34
|
* @constructor
|
|
13
35
|
* @param {__se__EditorCore} editor - The root editor instance
|
|
14
|
-
* @param {
|
|
15
|
-
* @param {Array<*>=} pluginOptions.data - direct data without server calls
|
|
16
|
-
* @param {string=} pluginOptions.url - server request url
|
|
17
|
-
* @param {Object<string, string>=} pluginOptions.headers - server request headers
|
|
36
|
+
* @param {ImageGalleryPluginOptions} pluginOptions
|
|
18
37
|
*/
|
|
19
|
-
constructor(
|
|
20
|
-
editor: __se__EditorCore,
|
|
21
|
-
pluginOptions: {
|
|
22
|
-
data?: Array<any> | undefined;
|
|
23
|
-
url?: string | undefined;
|
|
24
|
-
headers?:
|
|
25
|
-
| {
|
|
26
|
-
[x: string]: string;
|
|
27
|
-
}
|
|
28
|
-
| undefined;
|
|
29
|
-
}
|
|
30
|
-
);
|
|
38
|
+
constructor(editor: __se__EditorCore, pluginOptions: ImageGalleryPluginOptions);
|
|
31
39
|
title: any;
|
|
32
40
|
icon: string;
|
|
33
41
|
onSelectfunction: (targe: Node) => any;
|
|
@@ -1,8 +1,35 @@
|
|
|
1
1
|
export default VideoGallery;
|
|
2
2
|
export type BrowserFile_videoGallery = import('../../modules/Browser').BrowserFile;
|
|
3
|
+
export type VideoGalleryPluginOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* - Direct data without server calls
|
|
6
|
+
*/
|
|
7
|
+
data?: Array<BrowserFile_videoGallery>;
|
|
8
|
+
/**
|
|
9
|
+
* - Server request URL
|
|
10
|
+
*/
|
|
11
|
+
url?: string;
|
|
12
|
+
/**
|
|
13
|
+
* - Server request headers
|
|
14
|
+
*/
|
|
15
|
+
headers?: {
|
|
16
|
+
[x: string]: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* - Default thumbnail
|
|
20
|
+
*/
|
|
21
|
+
thumbnail?: string | ((item: BrowserFile_videoGallery) => string);
|
|
22
|
+
};
|
|
3
23
|
/**
|
|
4
24
|
* @typedef {import('../../modules/Browser').BrowserFile} BrowserFile_videoGallery
|
|
5
25
|
*/
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {Object} VideoGalleryPluginOptions
|
|
28
|
+
* @property {Array<BrowserFile_videoGallery>} [data] - Direct data without server calls
|
|
29
|
+
* @property {string} [url] - Server request URL
|
|
30
|
+
* @property {Object<string, string>} [headers] - Server request headers
|
|
31
|
+
* @property {string|((item: BrowserFile_videoGallery) => string)} [thumbnail] - Default thumbnail
|
|
32
|
+
*/
|
|
6
33
|
/**
|
|
7
34
|
* @class
|
|
8
35
|
* @extends EditorInjector
|
|
@@ -15,25 +42,9 @@ declare class VideoGallery extends EditorInjector {
|
|
|
15
42
|
/**
|
|
16
43
|
* @constructor
|
|
17
44
|
* @param {__se__EditorCore} editor - The root editor instance
|
|
18
|
-
* @param {
|
|
19
|
-
* @param {Array<*>=} pluginOptions.data - direct data without server calls
|
|
20
|
-
* @param {string=} pluginOptions.url - server request url
|
|
21
|
-
* @param {Object<string, string>=} pluginOptions.headers - server request headers
|
|
22
|
-
* @param {string|((item: BrowserFile_videoGallery) => string)} pluginOptions.thumbnail - default thumbnail
|
|
45
|
+
* @param {VideoGalleryPluginOptions} pluginOptions
|
|
23
46
|
*/
|
|
24
|
-
constructor(
|
|
25
|
-
editor: __se__EditorCore,
|
|
26
|
-
pluginOptions: {
|
|
27
|
-
data?: Array<any> | undefined;
|
|
28
|
-
url?: string | undefined;
|
|
29
|
-
headers?:
|
|
30
|
-
| {
|
|
31
|
-
[x: string]: string;
|
|
32
|
-
}
|
|
33
|
-
| undefined;
|
|
34
|
-
thumbnail: string | ((item: BrowserFile_videoGallery) => string);
|
|
35
|
-
}
|
|
36
|
-
);
|
|
47
|
+
constructor(editor: __se__EditorCore, pluginOptions: VideoGalleryPluginOptions);
|
|
37
48
|
title: any;
|
|
38
49
|
icon: string;
|
|
39
50
|
onSelectfunction: (targe: Node) => any;
|
|
@@ -16,6 +16,7 @@ declare class Blockquote extends EditorInjector {
|
|
|
16
16
|
* @param {?HTMLElement=} element - Node element where the cursor is currently located
|
|
17
17
|
* @param {?HTMLElement=} target - The plugin's toolbar button element
|
|
18
18
|
* @returns {boolean} - Whether the plugin is active
|
|
19
|
+
* - If it returns "undefined", it will no longer be called in this scope.
|
|
19
20
|
*/
|
|
20
21
|
active(element?: (HTMLElement | null) | undefined, target?: (HTMLElement | null) | undefined): boolean;
|
|
21
22
|
/**
|