jodit 4.0.0-beta.84 → 4.0.0-beta.85
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/CHANGELOG.md +41 -0
- package/README.md +4 -4
- package/es2015/jodit.css +320 -41
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +2470 -2258
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +2 -2
- package/es2015/plugins/debug/debug.js +4 -4
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +37 -36
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.css +320 -41
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +2469 -2255
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.js +4 -4
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.js +37 -36
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +320 -41
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +2459 -2253
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +2 -2
- package/es2021/plugins/debug/debug.js +4 -4
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +37 -36
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +320 -41
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +2459 -2253
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +2 -2
- package/es2021.en/plugins/debug/debug.js +4 -4
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +37 -36
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +400 -103
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +2530 -2312
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.js +4 -4
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +38 -36
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/esm/core/component/component.d.ts +2 -2
- package/esm/core/constants.js +2 -2
- package/esm/core/dom/dom.js +2 -2
- package/esm/core/helpers/checker/is-marker.d.ts +3 -0
- package/esm/core/helpers/normalize/normalize-size.d.ts +1 -1
- package/esm/core/helpers/normalize/normalize-size.js +2 -2
- package/esm/core/helpers/string/trim.d.ts +1 -0
- package/esm/core/helpers/string/trim.js +5 -0
- package/esm/core/helpers/utils/attr.d.ts +3 -0
- package/esm/core/helpers/utils/css.js +1 -0
- package/esm/core/plugin/interface.d.ts +3 -0
- package/esm/core/selection/style/api/has-same-style.d.ts +1 -1
- package/esm/core/selection/style/api/has-same-style.js +7 -4
- package/esm/core/selection/style/api/is-suit-element.d.ts +7 -2
- package/esm/core/selection/style/api/is-suit-element.js +21 -10
- package/esm/core/selection/style/transactions.d.ts +3 -0
- package/esm/core/selection/style/transactions.js +3 -3
- package/esm/core/storage/engines/local-storage-provider.d.ts +1 -1
- package/esm/core/storage/engines/memory-storage-provider.d.ts +1 -1
- package/esm/core/ui/button/tooltip/tooltip.d.ts +2 -2
- package/esm/core/ui/button/tooltip/tooltip.js +2 -2
- package/esm/core/ui/element.d.ts +1 -1
- package/esm/core/ui/form/block/block.d.ts +1 -1
- package/esm/core/ui/form/block/block.js +1 -1
- package/esm/core/ui/group/group.d.ts +0 -1
- package/esm/core/ui/group/group.js +0 -2
- package/esm/core/ui/group/list.d.ts +1 -0
- package/esm/core/ui/group/list.js +14 -2
- package/esm/core/ui/helpers/get-control-type.js +9 -2
- package/esm/core/ui/popup/popup.d.ts +12 -12
- package/esm/core/ui/popup/popup.js +46 -40
- package/esm/modules/file-browser/config.js +1 -1
- package/esm/modules/image-editor/config.d.ts +3 -0
- package/esm/modules/toolbar/button/button.d.ts +5 -5
- package/esm/modules/toolbar/button/button.js +25 -24
- package/esm/modules/toolbar/button/content.js +1 -1
- package/esm/modules/toolbar/button/index.d.ts +1 -0
- package/esm/modules/toolbar/button/index.js +1 -0
- package/esm/modules/toolbar/button/select/select.d.ts +15 -0
- package/esm/modules/toolbar/button/select/select.js +47 -0
- package/esm/modules/toolbar/collection/collection.d.ts +1 -0
- package/esm/modules/toolbar/collection/collection.js +4 -1
- package/esm/modules/toolbar/factory.d.ts +1 -0
- package/esm/modules/toolbar/factory.js +4 -0
- package/esm/plugins/bold/bold.js +1 -6
- package/esm/plugins/bold/interface.d.ts +3 -0
- package/esm/plugins/class-span/class-span.js +7 -7
- package/esm/plugins/color/config.js +2 -2
- package/esm/plugins/delete/interface.d.ts +3 -0
- package/esm/plugins/enter/interface.d.ts +3 -0
- package/esm/plugins/file/file.js +1 -1
- package/esm/plugins/font/config.js +63 -51
- package/esm/plugins/font/font.js +1 -1
- package/esm/plugins/format-block/config.d.ts +6 -0
- package/esm/plugins/format-block/config.js +52 -0
- package/esm/plugins/format-block/format-block.d.ts +1 -0
- package/esm/plugins/format-block/format-block.js +1 -68
- package/esm/plugins/fullsize/config.js +1 -1
- package/esm/plugins/iframe/iframe.js +11 -9
- package/esm/plugins/image/image.js +1 -1
- package/esm/plugins/image-processor/config.js +3 -0
- package/esm/plugins/inline-popup/config/items/cells.js +1 -1
- package/esm/plugins/justify/justify.js +8 -7
- package/esm/plugins/link/config.js +1 -1
- package/esm/plugins/mobile/config.js +3 -3
- package/esm/plugins/search/interface.d.ts +3 -0
- package/esm/plugins/select-cells/select-cells.d.ts +2 -0
- package/esm/plugins/symbols/config.js +1 -1
- package/esm/plugins/table/config.js +2 -1
- package/esm/plugins/video/config.js +1 -1
- package/esm/types/messages.d.ts +8 -0
- package/esm/types/popup.d.ts +3 -3
- package/esm/types/toolbar.d.ts +12 -8
- package/esm/typings.d.ts +0 -1
- package/package.json +1 -1
- package/types/core/component/component.d.ts +2 -2
- package/types/core/helpers/checker/is-marker.d.ts +3 -0
- package/types/core/helpers/normalize/normalize-size.d.ts +1 -1
- package/types/core/helpers/string/trim.d.ts +1 -0
- package/types/core/helpers/utils/attr.d.ts +3 -0
- package/types/core/plugin/interface.d.ts +3 -0
- package/types/core/selection/style/api/has-same-style.d.ts +1 -1
- package/types/core/selection/style/api/is-suit-element.d.ts +7 -2
- package/types/core/selection/style/transactions.d.ts +3 -0
- package/types/core/storage/engines/local-storage-provider.d.ts +1 -1
- package/types/core/storage/engines/memory-storage-provider.d.ts +1 -1
- package/types/core/ui/button/tooltip/tooltip.d.ts +2 -2
- package/types/core/ui/element.d.ts +1 -1
- package/types/core/ui/form/block/block.d.ts +1 -1
- package/types/core/ui/group/group.d.ts +0 -1
- package/types/core/ui/group/list.d.ts +1 -0
- package/types/core/ui/popup/popup.d.ts +12 -12
- package/types/modules/image-editor/config.d.ts +3 -0
- package/types/modules/toolbar/button/button.d.ts +5 -5
- package/types/modules/toolbar/button/index.d.ts +1 -0
- package/types/modules/toolbar/button/select/select.d.ts +15 -0
- package/types/modules/toolbar/collection/collection.d.ts +1 -0
- package/types/modules/toolbar/factory.d.ts +1 -0
- package/types/plugins/bold/interface.d.ts +3 -0
- package/types/plugins/delete/interface.d.ts +3 -0
- package/types/plugins/enter/interface.d.ts +3 -0
- package/types/plugins/format-block/config.d.ts +6 -0
- package/types/plugins/format-block/format-block.d.ts +1 -0
- package/types/plugins/search/interface.d.ts +3 -0
- package/types/plugins/select-cells/select-cells.d.ts +2 -0
- package/types/types/messages.d.ts +8 -0
- package/types/types/popup.d.ts +3 -3
- package/types/types/toolbar.d.ts +12 -8
- package/types/typings.d.ts +0 -1
package/esm/types/popup.d.ts
CHANGED
|
@@ -10,9 +10,9 @@ import type { IBound, IDestructible } from "./types";
|
|
|
10
10
|
import type { IUIElement } from "./ui";
|
|
11
11
|
export type PopupStrategy = 'leftBottom' | 'rightBottom' | 'leftTop' | 'rightTop';
|
|
12
12
|
export interface IPopup extends IUIElement, IDestructible {
|
|
13
|
-
container: HTMLElement;
|
|
14
|
-
isOpened: boolean;
|
|
15
|
-
strategy: PopupStrategy;
|
|
13
|
+
readonly container: HTMLElement;
|
|
14
|
+
readonly isOpened: boolean;
|
|
15
|
+
readonly strategy: PopupStrategy;
|
|
16
16
|
viewBound: () => IBound;
|
|
17
17
|
open(getBound: () => IBound, keepPosition?: boolean, parentContainer?: HTMLElement): this;
|
|
18
18
|
setContent(content: IUIElement | HTMLElement | string): this;
|
package/esm/types/toolbar.d.ts
CHANGED
|
@@ -15,11 +15,12 @@ import type { IMods } from "./traits";
|
|
|
15
15
|
interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser, B = IToolbarButton> {
|
|
16
16
|
name?: string;
|
|
17
17
|
text?: string;
|
|
18
|
+
textTemplate?: (jodit: T, value: string) => string;
|
|
18
19
|
mode?: Modes;
|
|
19
20
|
hotkeys?: string | string[];
|
|
20
21
|
data?: IDictionary;
|
|
21
|
-
update?: (button: B, editor: T) => void;
|
|
22
22
|
isInput?: boolean;
|
|
23
|
+
component?: 'button' | 'select';
|
|
23
24
|
/**
|
|
24
25
|
* You can use it function for control - active/not active button
|
|
25
26
|
*
|
|
@@ -44,9 +45,10 @@ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser
|
|
|
44
45
|
* })
|
|
45
46
|
* ```
|
|
46
47
|
*/
|
|
47
|
-
isActive?: (editor: T,
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
isActive?: (editor: T, button: B) => boolean;
|
|
49
|
+
update?: (editor: T, button: B) => void;
|
|
50
|
+
isChildActive?: (editor: T, button: B) => boolean; // for list
|
|
51
|
+
getContent?: (editor: T, button: B) => string | HTMLElement;
|
|
50
52
|
/**
|
|
51
53
|
* You can use it function for control - disable/enable button
|
|
52
54
|
*
|
|
@@ -71,8 +73,8 @@ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser
|
|
|
71
73
|
* })
|
|
72
74
|
* ```
|
|
73
75
|
*/
|
|
74
|
-
isDisabled?: (editor: T,
|
|
75
|
-
isChildDisabled?: (editor: T,
|
|
76
|
+
isDisabled?: (editor: T, button: B) => boolean;
|
|
77
|
+
isChildDisabled?: (editor: T, button: B) => boolean;
|
|
76
78
|
/**
|
|
77
79
|
* Drop-down list. A hash or array. You must specify the command which will be submitted for the hash key
|
|
78
80
|
* (or array value) (see .[[IJodit.execCommand]] or define 'exec' function. See example
|
|
@@ -104,7 +106,7 @@ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser
|
|
|
104
106
|
* });
|
|
105
107
|
* ```
|
|
106
108
|
*/
|
|
107
|
-
list?: IDictionary<string | number> | string[] | number[]
|
|
109
|
+
list?: IDictionary<string | number> | string[] | number[];
|
|
108
110
|
/**
|
|
109
111
|
* The command executes when the button is pressed. Allowed all
|
|
110
112
|
* @see https://developer.mozilla.org/ru/docs/Web/API/Document/execCommand#commands
|
|
@@ -214,8 +216,9 @@ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser
|
|
|
214
216
|
* });
|
|
215
217
|
* ```
|
|
216
218
|
*/
|
|
217
|
-
popup?: (jodit: T, current: Nullable<Node>,
|
|
219
|
+
popup?: (jodit: T, current: Nullable<Node>, close: () => void, button: B) => string | HTMLElement | IUIElement | false;
|
|
218
220
|
defaultValue?: string | string[];
|
|
221
|
+
value?: (jodit: T, button: B) => string | undefined;
|
|
219
222
|
mods?: IMods['mods'];
|
|
220
223
|
}
|
|
221
224
|
interface IControlListItem {
|
|
@@ -224,6 +227,7 @@ interface IControlListItem {
|
|
|
224
227
|
}
|
|
225
228
|
interface IControlTypeStrong extends IControlType {
|
|
226
229
|
name: NonNullable<IControlType['name']>;
|
|
230
|
+
list?: IDictionary<string | number>;
|
|
227
231
|
}
|
|
228
232
|
interface IControlTypeContent extends IControlTypeStrong {
|
|
229
233
|
getContent: NonNullable<IControlTypeStrong['getContent']>;
|
package/esm/typings.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -86,7 +86,7 @@ export declare abstract class Component implements IComponent {
|
|
|
86
86
|
*/
|
|
87
87
|
bindDestruct(component: IComponent): this;
|
|
88
88
|
abstract className(): string;
|
|
89
|
-
|
|
89
|
+
constructor();
|
|
90
90
|
/**
|
|
91
91
|
* Destruct component method
|
|
92
92
|
*/
|
|
@@ -117,5 +117,5 @@ export declare abstract class Component implements IComponent {
|
|
|
117
117
|
* @param callback - a function that will be called when the status is `status`
|
|
118
118
|
*/
|
|
119
119
|
hookStatus(status: ComponentStatus, callback: (component: this) => void): void;
|
|
120
|
-
static isInstanceOf<T extends
|
|
120
|
+
static isInstanceOf<T extends Component>(c: unknown | Component, constructorFunc: Function): c is T;
|
|
121
121
|
}
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module helpers/checker
|
|
8
|
+
*/
|
|
6
9
|
import type { Nullable } from "jodit/esm/types";
|
|
7
10
|
/**
|
|
8
11
|
* Define element is selection helper
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module helpers/utils
|
|
8
|
+
*/
|
|
6
9
|
import type { IDictionary } from "jodit/esm/types";
|
|
7
10
|
/**
|
|
8
11
|
* Get attribute
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugin
|
|
8
|
+
*/
|
|
6
9
|
declare module 'jodit/types/events' {
|
|
7
10
|
interface IEventEmitter {
|
|
8
11
|
/**
|
|
@@ -10,6 +10,6 @@ import type { IStyle } from "jodit/esm/types";
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function hasSameStyle(elm: Node, rules: IStyle): boolean;
|
|
12
12
|
/**
|
|
13
|
-
* Element has the similar styles
|
|
13
|
+
* Element has the similar styles keys
|
|
14
14
|
*/
|
|
15
15
|
export declare function hasSameStyleKeys(elm: Node, rules: IStyle): boolean;
|
|
@@ -12,10 +12,14 @@ import type { Nullable, ICommitStyle } from "jodit/esm/types";
|
|
|
12
12
|
* @param commitStyle - style commit
|
|
13
13
|
* @param elm - checked item
|
|
14
14
|
* @param strict - strict mode - false - the default tag is suitable for us if it is also in the commit
|
|
15
|
+
* @param strictStyle - strict style mode - true - the element has the same style keys as in the commit, but not their values
|
|
15
16
|
* @private
|
|
16
17
|
*/
|
|
17
|
-
export declare function isSuitElement(commitStyle: ICommitStyle, elm: Nullable<Node>, strict: boolean): elm is HTMLElement;
|
|
18
|
-
|
|
18
|
+
export declare function isSuitElement(commitStyle: ICommitStyle, elm: Nullable<Node>, strict: boolean, strictStyle?: boolean): elm is HTMLElement;
|
|
19
|
+
/**
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
export declare function suitableClosest(commitStyle: ICommitStyle, element: HTMLElement, root: HTMLElement): Nullable<HTMLElement>;
|
|
19
23
|
/**
|
|
20
24
|
* Inside the parent element there is a block with the same styles
|
|
21
25
|
* @example
|
|
@@ -24,5 +28,6 @@ export declare function findSuitClosest(commitStyle: ICommitStyle, element: HTML
|
|
|
24
28
|
* <p>|test<strong>test</strong>|</p>
|
|
25
29
|
* ```
|
|
26
30
|
* Apply `{element:'strong'}`
|
|
31
|
+
* @private
|
|
27
32
|
*/
|
|
28
33
|
export declare function isSameStyleChild(commitStyle: ICommitStyle, elm: Nullable<Node>): elm is HTMLElement;
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module selection
|
|
8
|
+
*/
|
|
6
9
|
import type { IJodit, IDictionary, CommitMode, ICommitStyle } from "jodit/esm/types";
|
|
7
10
|
export declare const states: {
|
|
8
11
|
readonly START: "START";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* @module storage
|
|
7
|
+
* @module storage
|
|
8
8
|
*/
|
|
9
9
|
import type { IStorage, StorageValueType } from "jodit/esm/types";
|
|
10
10
|
export declare class MemoryStorageProvider<T = StorageValueType> implements IStorage<T> {
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* [[include:
|
|
7
|
+
* [[include:core/ui/button/tooltip/README.md]]
|
|
8
8
|
* @packageDocumentation
|
|
9
|
-
* @module
|
|
9
|
+
* @module ui/button
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import type { IViewBased } from "jodit/esm/types";
|
|
@@ -25,7 +25,7 @@ export declare abstract class UIElement<T extends IViewBased = IViewBased> exten
|
|
|
25
25
|
/**
|
|
26
26
|
* Find match parent
|
|
27
27
|
*/
|
|
28
|
-
closest<T extends
|
|
28
|
+
closest<T extends UIElement | typeof UIElement>(type: UIElement | Function): Nullable<T extends typeof UIElement ? InstanceType<T> : T>;
|
|
29
29
|
/**
|
|
30
30
|
* Find closest UIElement in DOM
|
|
31
31
|
*/
|
|
@@ -14,7 +14,6 @@ import type { IDictionary } from "jodit/esm/types";
|
|
|
14
14
|
import { UIElement } from "jodit/esm/core/ui/element";
|
|
15
15
|
export declare class UIGroup<T extends IViewBased = IViewBased> extends UIElement<T> implements IUIGroup {
|
|
16
16
|
readonly options?: IDictionary | undefined;
|
|
17
|
-
/** @override */
|
|
18
17
|
className(): string;
|
|
19
18
|
/**
|
|
20
19
|
* Synchronize mods to all children
|
|
@@ -31,6 +31,7 @@ export declare class UIList<T extends IViewBased = IViewBased> extends UIGroup<T
|
|
|
31
31
|
protected removeButtons: string[];
|
|
32
32
|
setRemoveButtons(removeButtons?: string[]): this;
|
|
33
33
|
build(items: ButtonsOption, target?: Nullable<HTMLElement>): IUIList;
|
|
34
|
+
protected makeSelect(control: IControlTypeStrong, target: Nullable<HTMLElement>): IUIButton;
|
|
34
35
|
/**
|
|
35
36
|
* Create button instance
|
|
36
37
|
*/
|
|
@@ -10,18 +10,17 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import type { IBound, IPopup, IUIElement, IViewBased, PopupStrategy } from "jodit/esm/types";
|
|
13
|
-
import {
|
|
13
|
+
import { UIGroup } from "jodit/esm/core/ui/group/group";
|
|
14
14
|
type getBoundFunc = () => IBound;
|
|
15
|
-
export declare class Popup extends
|
|
15
|
+
export declare class Popup extends UIGroup implements IPopup {
|
|
16
16
|
readonly smart: boolean;
|
|
17
|
-
/** @override */
|
|
18
17
|
className(): string;
|
|
19
18
|
isOpened: boolean;
|
|
20
19
|
strategy: PopupStrategy;
|
|
20
|
+
protected appendChildToContainer(childContainer: HTMLElement): void;
|
|
21
21
|
viewBound: () => IBound;
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
/** @override */
|
|
22
|
+
private __targetBound;
|
|
23
|
+
private __childrenPopups;
|
|
25
24
|
updateParentElement(target: IUIElement): this;
|
|
26
25
|
/**
|
|
27
26
|
* Set popup content
|
|
@@ -31,7 +30,7 @@ export declare class Popup extends UIElement implements IPopup {
|
|
|
31
30
|
* Open popup near with some bound
|
|
32
31
|
*/
|
|
33
32
|
open(getBound: getBoundFunc, keepPosition?: boolean, parentContainer?: HTMLElement): this;
|
|
34
|
-
private
|
|
33
|
+
private __calculateZIndex;
|
|
35
34
|
/**
|
|
36
35
|
* Calculate static bound for point
|
|
37
36
|
*/
|
|
@@ -40,11 +39,11 @@ export declare class Popup extends UIElement implements IPopup {
|
|
|
40
39
|
* Update container position
|
|
41
40
|
*/
|
|
42
41
|
updatePosition(): this;
|
|
43
|
-
|
|
42
|
+
private __throttleUpdatePosition;
|
|
44
43
|
/**
|
|
45
44
|
* Calculate start point
|
|
46
45
|
*/
|
|
47
|
-
private
|
|
46
|
+
private __calculatePosition;
|
|
48
47
|
/**
|
|
49
48
|
* Check if one box is inside second
|
|
50
49
|
*/
|
|
@@ -56,15 +55,16 @@ export declare class Popup extends UIElement implements IPopup {
|
|
|
56
55
|
/**
|
|
57
56
|
* Close popup if click was in outside
|
|
58
57
|
*/
|
|
59
|
-
private
|
|
58
|
+
private __closeOnOutsideClick;
|
|
60
59
|
isOwnClick(e: MouseEvent): boolean;
|
|
61
|
-
private
|
|
62
|
-
private
|
|
60
|
+
private __addGlobalListeners;
|
|
61
|
+
private __removeGlobalListeners;
|
|
63
62
|
/**
|
|
64
63
|
* Set ZIndex
|
|
65
64
|
*/
|
|
66
65
|
setZIndex(index: number | string): void;
|
|
67
66
|
constructor(jodit: IViewBased, smart?: boolean);
|
|
67
|
+
render(): string;
|
|
68
68
|
/** @override **/
|
|
69
69
|
destruct(): any;
|
|
70
70
|
}
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module modules/image-editor
|
|
8
|
+
*/
|
|
6
9
|
import type { ImageEditorOptions } from "jodit/esm/types";
|
|
7
10
|
declare module 'jodit/config' {
|
|
8
11
|
interface Config {
|
|
@@ -42,11 +42,11 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
|
|
|
42
42
|
/**
|
|
43
43
|
* Calculates whether the button is active
|
|
44
44
|
*/
|
|
45
|
-
private
|
|
45
|
+
private __calculateActivatedStatus;
|
|
46
46
|
/**
|
|
47
47
|
* Calculates whether an element is blocked for the user
|
|
48
48
|
*/
|
|
49
|
-
private
|
|
49
|
+
private __calculateDisabledStatus;
|
|
50
50
|
/** @override */
|
|
51
51
|
protected onChangeActivated(): void;
|
|
52
52
|
/** @override */
|
|
@@ -63,7 +63,7 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
|
|
|
63
63
|
/**
|
|
64
64
|
* Init constant data from control
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
protected __initFromControl(): void;
|
|
67
67
|
/**
|
|
68
68
|
* Click on trigger button
|
|
69
69
|
*/
|
|
@@ -72,10 +72,10 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
|
|
|
72
72
|
/**
|
|
73
73
|
* Create and open popup list
|
|
74
74
|
*/
|
|
75
|
-
private
|
|
75
|
+
private __openControlList;
|
|
76
76
|
protected onOutsideClick(e: MouseEvent): void;
|
|
77
77
|
private openPopup;
|
|
78
|
-
private
|
|
78
|
+
private __closePopup;
|
|
79
79
|
/**
|
|
80
80
|
* Click handler
|
|
81
81
|
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module modules/toolbar/button
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { IViewBased } from "jodit/esm/types";
|
|
11
|
+
import { ToolbarButton } from "../button";
|
|
12
|
+
export declare class ToolbarSelect<T extends IViewBased = IViewBased> extends ToolbarButton<T> {
|
|
13
|
+
className(): string;
|
|
14
|
+
update(): void;
|
|
15
|
+
}
|
|
@@ -20,6 +20,7 @@ export declare class ToolbarCollection<T extends IViewWithToolbar = IViewWithToo
|
|
|
20
20
|
*/
|
|
21
21
|
get firstButton(): Nullable<IToolbarButton>;
|
|
22
22
|
protected makeButton(control: IControlTypeStrong, target?: Nullable<HTMLElement>): IUIButton;
|
|
23
|
+
protected makeSelect(control: IControlTypeStrong, target?: Nullable<HTMLElement>): IUIButton;
|
|
23
24
|
/**
|
|
24
25
|
* Button should be active
|
|
25
26
|
*/
|
|
@@ -17,3 +17,4 @@ export declare function makeCollection(jodit: IViewBased, parentElement?: IUIEle
|
|
|
17
17
|
* Button factory
|
|
18
18
|
*/
|
|
19
19
|
export declare function makeButton(jodit: IViewBased, control: IControlTypeStrong, target?: Nullable<HTMLElement>): IToolbarButton;
|
|
20
|
+
export declare function makeSelect(view: IViewBased, control: IControlTypeStrong, target?: Nullable<HTMLElement>): IToolbarButton;
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/bold
|
|
8
|
+
*/
|
|
6
9
|
declare module 'jodit/types/jodit' {
|
|
7
10
|
interface IJodit {
|
|
8
11
|
/**
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/delete
|
|
8
|
+
*/
|
|
6
9
|
declare module 'jodit/types/jodit' {
|
|
7
10
|
interface IJodit {
|
|
8
11
|
/**
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/enter
|
|
8
|
+
*/
|
|
6
9
|
declare module 'jodit/types/events' {
|
|
7
10
|
interface IEventEmitter {
|
|
8
11
|
/**
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/search
|
|
8
|
+
*/
|
|
6
9
|
declare module 'jodit/types/events' {
|
|
7
10
|
interface IEventEmitter {
|
|
8
11
|
/**
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module types
|
|
8
|
+
*/
|
|
1
9
|
import type { IDestructible } from "./types";
|
|
2
10
|
export type MessageVariant = 'info' | 'error' | 'success';
|
|
3
11
|
export interface IMessages extends IDestructible {
|
package/types/types/popup.d.ts
CHANGED
|
@@ -10,9 +10,9 @@ import type { IBound, IDestructible } from "./types";
|
|
|
10
10
|
import type { IUIElement } from "./ui";
|
|
11
11
|
export type PopupStrategy = 'leftBottom' | 'rightBottom' | 'leftTop' | 'rightTop';
|
|
12
12
|
export interface IPopup extends IUIElement, IDestructible {
|
|
13
|
-
container: HTMLElement;
|
|
14
|
-
isOpened: boolean;
|
|
15
|
-
strategy: PopupStrategy;
|
|
13
|
+
readonly container: HTMLElement;
|
|
14
|
+
readonly isOpened: boolean;
|
|
15
|
+
readonly strategy: PopupStrategy;
|
|
16
16
|
viewBound: () => IBound;
|
|
17
17
|
open(getBound: () => IBound, keepPosition?: boolean, parentContainer?: HTMLElement): this;
|
|
18
18
|
setContent(content: IUIElement | HTMLElement | string): this;
|
package/types/types/toolbar.d.ts
CHANGED
|
@@ -15,11 +15,12 @@ import type { IMods } from "./traits";
|
|
|
15
15
|
interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser, B = IToolbarButton> {
|
|
16
16
|
name?: string;
|
|
17
17
|
text?: string;
|
|
18
|
+
textTemplate?: (jodit: T, value: string) => string;
|
|
18
19
|
mode?: Modes;
|
|
19
20
|
hotkeys?: string | string[];
|
|
20
21
|
data?: IDictionary;
|
|
21
|
-
update?: (button: B, editor: T) => void;
|
|
22
22
|
isInput?: boolean;
|
|
23
|
+
component?: 'button' | 'select';
|
|
23
24
|
/**
|
|
24
25
|
* You can use it function for control - active/not active button
|
|
25
26
|
*
|
|
@@ -44,9 +45,10 @@ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser
|
|
|
44
45
|
* })
|
|
45
46
|
* ```
|
|
46
47
|
*/
|
|
47
|
-
isActive?: (editor: T,
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
isActive?: (editor: T, button: B) => boolean;
|
|
49
|
+
update?: (editor: T, button: B) => void;
|
|
50
|
+
isChildActive?: (editor: T, button: B) => boolean; // for list
|
|
51
|
+
getContent?: (editor: T, button: B) => string | HTMLElement;
|
|
50
52
|
/**
|
|
51
53
|
* You can use it function for control - disable/enable button
|
|
52
54
|
*
|
|
@@ -71,8 +73,8 @@ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser
|
|
|
71
73
|
* })
|
|
72
74
|
* ```
|
|
73
75
|
*/
|
|
74
|
-
isDisabled?: (editor: T,
|
|
75
|
-
isChildDisabled?: (editor: T,
|
|
76
|
+
isDisabled?: (editor: T, button: B) => boolean;
|
|
77
|
+
isChildDisabled?: (editor: T, button: B) => boolean;
|
|
76
78
|
/**
|
|
77
79
|
* Drop-down list. A hash or array. You must specify the command which will be submitted for the hash key
|
|
78
80
|
* (or array value) (see .[[IJodit.execCommand]] or define 'exec' function. See example
|
|
@@ -104,7 +106,7 @@ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser
|
|
|
104
106
|
* });
|
|
105
107
|
* ```
|
|
106
108
|
*/
|
|
107
|
-
list?: IDictionary<string | number> | string[] | number[]
|
|
109
|
+
list?: IDictionary<string | number> | string[] | number[];
|
|
108
110
|
/**
|
|
109
111
|
* The command executes when the button is pressed. Allowed all
|
|
110
112
|
* @see https://developer.mozilla.org/ru/docs/Web/API/Document/execCommand#commands
|
|
@@ -214,8 +216,9 @@ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser
|
|
|
214
216
|
* });
|
|
215
217
|
* ```
|
|
216
218
|
*/
|
|
217
|
-
popup?: (jodit: T, current: Nullable<Node>,
|
|
219
|
+
popup?: (jodit: T, current: Nullable<Node>, close: () => void, button: B) => string | HTMLElement | IUIElement | false;
|
|
218
220
|
defaultValue?: string | string[];
|
|
221
|
+
value?: (jodit: T, button: B) => string | undefined;
|
|
219
222
|
mods?: IMods['mods'];
|
|
220
223
|
}
|
|
221
224
|
interface IControlListItem {
|
|
@@ -224,6 +227,7 @@ interface IControlListItem {
|
|
|
224
227
|
}
|
|
225
228
|
interface IControlTypeStrong extends IControlType {
|
|
226
229
|
name: NonNullable<IControlType['name']>;
|
|
230
|
+
list?: IDictionary<string | number>;
|
|
227
231
|
}
|
|
228
232
|
interface IControlTypeContent extends IControlTypeStrong {
|
|
229
233
|
getContent: NonNullable<IControlTypeStrong['getContent']>;
|