suneditor 3.0.0-beta.7 → 3.0.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/suneditor.min.js +1 -1
  2. package/package.json +3 -3
  3. package/src/core/base/eventManager.js +9 -1
  4. package/src/core/section/constructor.js +20 -11
  5. package/src/helper/converter.js +9 -9
  6. package/src/helper/dom/domUtils.js +16 -1
  7. package/src/modules/ColorPicker.js +12 -10
  8. package/src/modules/Figure.js +2 -2
  9. package/src/plugins/command/blockquote.js +1 -0
  10. package/src/plugins/command/list_bulleted.js +1 -0
  11. package/src/plugins/command/list_numbered.js +1 -0
  12. package/src/plugins/dropdown/align.js +2 -0
  13. package/src/plugins/dropdown/backgroundColor.js +9 -5
  14. package/src/plugins/dropdown/font.js +6 -2
  15. package/src/plugins/dropdown/fontColor.js +9 -5
  16. package/src/plugins/dropdown/formatBlock.js +1 -0
  17. package/src/plugins/dropdown/lineHeight.js +2 -1
  18. package/src/plugins/dropdown/list.js +1 -0
  19. package/src/plugins/dropdown/table.js +39 -5
  20. package/src/plugins/input/fontSize.js +6 -2
  21. package/src/plugins/modal/link.js +1 -0
  22. package/types/core/section/constructor.d.ts +12 -6
  23. package/types/helper/dom/domUtils.d.ts +8 -0
  24. package/types/helper/index.d.ts +1 -0
  25. package/types/modules/ColorPicker.d.ts +5 -1
  26. package/types/plugins/command/blockquote.d.ts +1 -0
  27. package/types/plugins/command/list_bulleted.d.ts +1 -0
  28. package/types/plugins/command/list_numbered.d.ts +1 -0
  29. package/types/plugins/dropdown/align.d.ts +1 -0
  30. package/types/plugins/dropdown/backgroundColor.d.ts +1 -0
  31. package/types/plugins/dropdown/font.d.ts +1 -0
  32. package/types/plugins/dropdown/fontColor.d.ts +1 -0
  33. package/types/plugins/dropdown/formatBlock.d.ts +1 -0
  34. package/types/plugins/dropdown/lineHeight.d.ts +1 -0
  35. package/types/plugins/dropdown/list.d.ts +1 -0
  36. package/types/plugins/input/fontSize.d.ts +1 -0
  37. package/types/plugins/modal/link.d.ts +1 -0
@@ -83,8 +83,11 @@ declare class ColorPicker extends CoreInjector {
83
83
  * @description Displays or resets the currently selected color at color list.
84
84
  * @param {Node|string} nodeOrColor Current Selected node
85
85
  * @param {Node} target target
86
+ * @param {?((current: Node) => boolean)=} stopCondition - A function used to stop traversing parent nodes while finding the color.
87
+ * - When this function returns true, the traversal ends at that node.
88
+ * - e.g., `(node) => this.format.isLine(node)` stops at line-level elements like <p>, <div>.
86
89
  */
87
- init(nodeOrColor: Node | string, target: Node): void;
90
+ init(nodeOrColor: Node | string, target: Node, stopCondition?: (((current: Node) => boolean) | null) | undefined): void;
88
91
  /**
89
92
  * @description Store color values
90
93
  * @param {string} hexColorStr Hax color value
@@ -104,6 +107,7 @@ declare class ColorPicker extends CoreInjector {
104
107
  * @private
105
108
  * @description Gets color value at color property of node
106
109
  * @param {Node} node Selected node
110
+ * @param {(current: Node) => boolean} stopCondition - A function used to stop traversing parent nodes while finding the color.
107
111
  * @returns {string}
108
112
  */
109
113
  private _getColorInNode;
@@ -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
  /**
@@ -17,6 +17,7 @@ declare class List_bulleted extends EditorInjector {
17
17
  * @param {?HTMLElement=} element - Node element where the cursor is currently located
18
18
  * @param {?HTMLElement=} target - The plugin's toolbar button element
19
19
  * @returns {boolean} - Whether the plugin is active
20
+ * - If it returns "undefined", it will no longer be called in this scope.
20
21
  */
21
22
  active(element?: (HTMLElement | null) | undefined, target?: (HTMLElement | null) | undefined): boolean;
22
23
  /**
@@ -17,6 +17,7 @@ declare class List_numbered extends EditorInjector {
17
17
  * @param {?HTMLElement=} element - Node element where the cursor is currently located
18
18
  * @param {?HTMLElement=} target - The plugin's toolbar button element
19
19
  * @returns {boolean} - Whether the plugin is active
20
+ * - If it returns "undefined", it will no longer be called in this scope.
20
21
  */
21
22
  active(element?: (HTMLElement | null) | undefined, target?: (HTMLElement | null) | undefined): boolean;
22
23
  /**
@@ -35,6 +35,7 @@ declare class Align extends EditorInjector {
35
35
  * @param {?HTMLElement=} element - Node element where the cursor is currently located
36
36
  * @param {?HTMLElement=} target - The plugin's toolbar button element
37
37
  * @returns {boolean} - Whether the plugin is active
38
+ * - If it returns "undefined", it will no longer be called in this scope.
38
39
  */
39
40
  active(element?: (HTMLElement | null) | undefined, target?: (HTMLElement | null) | undefined): boolean;
40
41
  /**
@@ -38,6 +38,7 @@ declare class BackgroundColor extends EditorInjector {
38
38
  * @param {?HTMLElement=} element - Node element where the cursor is currently located
39
39
  * @param {?HTMLElement=} target - The plugin's toolbar button element
40
40
  * @returns {boolean} - Whether the plugin is active
41
+ * - If it returns "undefined", it will no longer be called in this scope.
41
42
  */
42
43
  active(element?: (HTMLElement | null) | undefined, target?: (HTMLElement | null) | undefined): boolean;
43
44
  /**
@@ -34,6 +34,7 @@ declare class Font extends EditorInjector {
34
34
  * @param {?HTMLElement=} element - Node element where the cursor is currently located
35
35
  * @param {?HTMLElement=} target - The plugin's toolbar button element
36
36
  * @returns {boolean} - Whether the plugin is active
37
+ * - If it returns "undefined", it will no longer be called in this scope.
37
38
  */
38
39
  active(element?: (HTMLElement | null) | undefined, target?: (HTMLElement | null) | undefined): boolean;
39
40
  /**
@@ -38,6 +38,7 @@ declare class FontColor extends EditorInjector {
38
38
  * @param {?HTMLElement=} element - Node element where the cursor is currently located
39
39
  * @param {?HTMLElement=} target - The plugin's toolbar button element
40
40
  * @returns {boolean} - Whether the plugin is active
41
+ * - If it returns "undefined", it will no longer be called in this scope.
41
42
  */
42
43
  active(element?: (HTMLElement | null) | undefined, target?: (HTMLElement | null) | undefined): boolean;
43
44
  /**
@@ -29,6 +29,7 @@ declare class FormatBlock extends EditorInjector {
29
29
  * @param {?HTMLElement=} element - Node element where the cursor is currently located
30
30
  * @param {?HTMLElement=} target - The plugin's toolbar button element
31
31
  * @returns {boolean} - Whether the plugin is active
32
+ * - If it returns "undefined", it will no longer be called in this scope.
32
33
  */
33
34
  active(element?: (HTMLElement | null) | undefined, target?: (HTMLElement | null) | undefined): boolean;
34
35
  /**
@@ -32,6 +32,7 @@ declare class LineHeight extends EditorInjector {
32
32
  * @param {?HTMLElement=} element - Node element where the cursor is currently located
33
33
  * @param {?HTMLElement=} target - The plugin's toolbar button element
34
34
  * @returns {boolean} - Whether the plugin is active
35
+ * - If it returns "undefined", it will no longer be called in this scope.
35
36
  */
36
37
  active(element?: (HTMLElement | null) | undefined, target?: (HTMLElement | null) | undefined): boolean;
37
38
  /**
@@ -20,6 +20,7 @@ declare class List extends EditorInjector {
20
20
  * @param {?HTMLElement=} element - Node element where the cursor is currently located
21
21
  * @param {?HTMLElement=} target - The plugin's toolbar button element
22
22
  * @returns {boolean} - Whether the plugin is active
23
+ * - If it returns "undefined", it will no longer be called in this scope.
23
24
  */
24
25
  active(element?: (HTMLElement | null) | undefined, target?: (HTMLElement | null) | undefined): boolean;
25
26
  /**
@@ -114,6 +114,7 @@ declare class FontSize extends EditorInjector {
114
114
  * @param {?HTMLElement=} element - Node element where the cursor is currently located
115
115
  * @param {?HTMLElement=} target - The plugin's toolbar button element
116
116
  * @returns {boolean} - Whether the plugin is active
117
+ * - If it returns "undefined", it will no longer be called in this scope.
117
118
  */
118
119
  active(element?: (HTMLElement | null) | undefined, target?: (HTMLElement | null) | undefined): boolean;
119
120
  /**
@@ -86,6 +86,7 @@ declare class Link extends EditorInjector {
86
86
  * @description Executes the method that is called whenever the cursor position changes.
87
87
  * @param {?HTMLElement=} element - Node element where the cursor is currently located
88
88
  * @returns {boolean} - Whether the plugin is active
89
+ * - If it returns "undefined", it will no longer be called in this scope.
89
90
  */
90
91
  active(element?: (HTMLElement | null) | undefined): boolean;
91
92
  /**