jodit 3.8.4 → 3.8.8
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/.idea/workspace.xml +165 -1308
- package/{.stylelintrc.json → .stylelintrc} +2 -1
- package/CHANGELOG.MD +54 -14
- package/build/jodit.css +280 -258
- package/build/jodit.es2018.css +231 -213
- package/build/jodit.es2018.en.css +231 -213
- package/build/jodit.es2018.en.js +9453 -9409
- package/build/jodit.es2018.en.min.css +1 -1
- package/build/jodit.es2018.en.min.js +1 -10
- package/build/jodit.es2018.js +13482 -13438
- package/build/jodit.es2018.min.css +1 -1
- package/build/jodit.es2018.min.js +1 -10
- package/build/jodit.js +9064 -9013
- package/build/jodit.min.css +2 -2
- package/build/jodit.min.js +1 -10
- package/build-system/index.js +78 -0
- package/{src/utils → build-system/loaders}/css-variables-prefixes.js +0 -0
- package/{src/utils → build-system/loaders}/lang-loader.js +0 -0
- package/build-system/loaders/style.js +31 -0
- package/{src/utils → build-system/loaders}/svg-loader.js +1 -0
- package/build-system/minimizer/css.js +20 -0
- package/build-system/minimizer/index.js +7 -0
- package/build-system/minimizer/js.js +41 -0
- package/{src/utils/plugin-loader.js → build-system/plugins/banner.js} +7 -6
- package/build-system/plugins/define.js +22 -0
- package/build-system/plugins/extract-css.js +14 -0
- package/build-system/plugins/index.js +31 -0
- package/build-system/plugins/post-build.js +52 -0
- package/build-system/rules/css.js +12 -0
- package/build-system/rules/extra-typescript.js +22 -0
- package/build-system/rules/index.js +17 -0
- package/build-system/rules/internal-typescript.js +23 -0
- package/build-system/rules/langs.js +20 -0
- package/build-system/rules/svg.js +19 -0
- package/build-system/utils/filename.js +17 -0
- package/{src → build-system}/utils/post-build.js +0 -0
- package/build-system/variables.js +53 -0
- package/package.json +34 -33
- package/src/config.ts +8 -14
- package/src/core/ajax.ts +16 -46
- package/src/core/async.ts +6 -17
- package/src/core/component/view-component.ts +0 -1
- package/src/core/constants.ts +5 -5
- package/src/core/create.ts +8 -27
- package/src/core/decorators/debounce.ts +0 -8
- package/src/core/decorators/hook.ts +0 -1
- package/src/core/decorators/nonenumerable.ts +1 -2
- package/src/core/decorators/persistent.ts +0 -3
- package/src/core/decorators/spy.ts +0 -1
- package/src/core/decorators/wait.ts +0 -1
- package/src/core/dom.ts +56 -114
- package/src/core/events/events-native.ts +52 -26
- package/src/core/events/observe-object.ts +0 -2
- package/src/core/global.ts +10 -6
- package/src/core/helpers/append-script.ts +0 -8
- package/src/core/helpers/array/as-array.ts +2 -5
- package/src/core/helpers/array/split-array.ts +0 -1
- package/src/core/helpers/async/set-timeout.ts +0 -7
- package/src/core/helpers/browser.ts +0 -1
- package/src/core/helpers/checker/has-browser-color-picker.ts +0 -3
- package/src/core/helpers/checker/is-array.ts +0 -1
- package/src/core/helpers/checker/is-equal.ts +0 -3
- package/src/core/helpers/checker/is-function.ts +0 -2
- package/src/core/helpers/checker/is-html-from-word.ts +0 -3
- package/src/core/helpers/checker/is-html.ts +0 -1
- package/src/core/helpers/checker/is-number.ts +0 -1
- package/src/core/helpers/checker/is-numeric.ts +0 -2
- package/src/core/helpers/checker/is-plain-object.ts +0 -1
- package/src/core/helpers/checker/is-string.ts +0 -1
- package/src/core/helpers/checker/is-url.ts +0 -4
- package/src/core/helpers/color/color-to-hex.ts +2 -2
- package/src/core/helpers/config-proto.ts +0 -3
- package/src/core/helpers/convert-media-url-to-video-embed.ts +1 -6
- package/src/core/helpers/ctrl-key.ts +1 -3
- package/src/core/helpers/data-bind.ts +0 -6
- package/src/core/helpers/default-language.ts +0 -3
- package/src/core/helpers/each.ts +12 -0
- package/src/core/helpers/html/htmlspecialchars.ts +0 -4
- package/src/core/helpers/html/nl2br.ts +0 -1
- package/src/core/helpers/human-size-to-bytes.ts +1 -4
- package/src/core/helpers/normalize/normalize-color.ts +2 -3
- package/src/core/helpers/normalize/normalize-key-aliases.ts +0 -2
- package/src/core/helpers/normalize/normalize-path.ts +0 -2
- package/src/core/helpers/normalize/normalize-size.ts +0 -3
- package/src/core/helpers/selector.ts +0 -8
- package/src/core/helpers/size/get-content-width.ts +0 -2
- package/src/core/helpers/size/offset.ts +1 -7
- package/src/core/helpers/size/position.ts +0 -4
- package/src/core/helpers/string/camel-case.ts +1 -2
- package/src/core/helpers/string/i18n.ts +0 -7
- package/src/core/helpers/string/kebab-case.ts +7 -5
- package/src/core/helpers/string/stringify.ts +0 -3
- package/src/core/helpers/string/trim.ts +0 -2
- package/src/core/helpers/string/ucfirst.ts +2 -5
- package/src/core/helpers/type.ts +0 -1
- package/src/core/helpers/utils/get.ts +0 -2
- package/src/core/helpers/utils/mark-deprecated.ts +0 -4
- package/src/core/helpers/utils/set.ts +0 -2
- package/src/core/helpers/utils/utils.ts +35 -14
- package/src/core/plugin-system.ts +0 -31
- package/src/core/selection/select.ts +15 -13
- package/src/core/selection/style/api/is-normal-node.ts +1 -2
- package/src/core/selection/style/api/toggle-styles.ts +0 -2
- package/src/core/selection/style/apply-style.ts +6 -2
- package/src/core/traits/mods.ts +1 -3
- package/src/core/ui/button/button/button.less +7 -3
- package/src/core/ui/button/button/button.ts +1 -1
- package/src/core/ui/button/group/group.less +5 -5
- package/src/core/ui/element.ts +0 -4
- package/src/core/ui/form/inputs/file/file.less +4 -4
- package/src/core/ui/form/validators/input.ts +0 -2
- package/src/core/ui/form/validators/select.ts +0 -1
- package/src/core/ui/helpers/get-control-type.ts +0 -2
- package/src/core/ui/icon.ts +0 -10
- package/src/core/ui/list/group.less +1 -1
- package/src/core/ui/list/group.ts +1 -6
- package/src/core/ui/list/list.ts +0 -3
- package/src/core/ui/popup/popup.ts +0 -11
- package/src/core/ui/progress-bar/progress-bar.less +8 -8
- package/src/core/view/view-with-toolbar.ts +0 -5
- package/src/core/view/view.ts +2 -18
- package/src/index.ts +1 -1
- package/src/jodit.ts +14 -70
- package/src/modules/context-menu/context-menu.ts +3 -6
- package/src/modules/dialog/alert.ts +0 -6
- package/src/modules/dialog/confirm.ts +1 -1
- package/src/modules/dialog/dialog.ts +22 -55
- package/src/modules/dialog/prompt.ts +3 -5
- package/src/modules/image-editor/image-editor.less +51 -46
- package/src/modules/status-bar/status-bar.less +12 -12
- package/src/modules/status-bar/status-bar.ts +0 -3
- package/src/modules/table.ts +17 -6
- package/src/modules/toolbar/button/button.less +5 -6
- package/src/modules/toolbar/button/button.ts +1 -1
- package/src/modules/toolbar/button/content.less +2 -2
- package/src/modules/widget/color-picker/color-picker.less +7 -6
- package/src/modules/widget/tabs/tabs.less +3 -3
- package/src/plugins/about/about.less +1 -1
- package/src/plugins/add-new-line/add-new-line.less +14 -15
- package/src/plugins/add-new-line/add-new-line.ts +1 -1
- package/src/plugins/clipboard/paste-storage/paste-storage.less +10 -11
- package/src/plugins/fix/clean-html.ts +2 -2
- package/src/plugins/fix/wrap-text-nodes.ts +1 -2
- package/src/plugins/fullsize/fullsize.less +5 -5
- package/src/plugins/image/image-properties/image-properties.less +11 -7
- package/src/plugins/image/image-properties/image-properties.ts +11 -8
- package/src/plugins/placeholder/placeholder.less +4 -4
- package/src/plugins/resizer/resizer.less +28 -23
- package/src/plugins/search/search.less +25 -25
- package/src/plugins/source/source.less +15 -15
- package/src/plugins/xpath/xpath.less +3 -3
- package/src/styles/form.less +19 -14
- package/src/styles/modules/button-group.less +2 -2
- package/src/styles/modules/icon.less +9 -8
- package/src/types/ajax.d.ts +28 -0
- package/src/types/async.d.ts +4 -3
- package/src/types/events.d.ts +15 -0
- package/tsconfig.json +1 -1
- package/types/config.d.ts +8 -14
- package/types/core/ajax.d.ts +6 -29
- package/types/core/async.d.ts +2 -15
- package/types/core/component/view-component.d.ts +0 -1
- package/types/core/constants.d.ts +5 -5
- package/types/core/create.d.ts +0 -4
- package/types/core/decorators/debounce.d.ts +0 -8
- package/types/core/decorators/hook.d.ts +0 -1
- package/types/core/decorators/nonenumerable.d.ts +1 -2
- package/types/core/decorators/persistent.d.ts +0 -3
- package/types/core/decorators/wait.d.ts +0 -1
- package/types/core/dom.d.ts +25 -112
- package/types/core/events/events-native.d.ts +18 -17
- package/types/core/events/observe-object.d.ts +0 -2
- package/types/core/global.d.ts +0 -4
- package/types/core/helpers/append-script.d.ts +0 -8
- package/types/core/helpers/array/as-array.d.ts +3 -0
- package/types/core/helpers/array/split-array.d.ts +0 -1
- package/types/core/helpers/async/set-timeout.d.ts +0 -7
- package/types/core/helpers/browser.d.ts +0 -1
- package/types/core/helpers/checker/has-browser-color-picker.d.ts +0 -3
- package/types/core/helpers/checker/is-array.d.ts +0 -1
- package/types/core/helpers/checker/is-equal.d.ts +0 -3
- package/types/core/helpers/checker/is-function.d.ts +0 -2
- package/types/core/helpers/checker/is-html-from-word.d.ts +0 -3
- package/types/core/helpers/checker/is-html.d.ts +0 -1
- package/types/core/helpers/checker/is-number.d.ts +0 -1
- package/types/core/helpers/checker/is-numeric.d.ts +0 -2
- package/types/core/helpers/checker/is-plain-object.d.ts +0 -1
- package/types/core/helpers/checker/is-string.d.ts +0 -1
- package/types/core/helpers/checker/is-url.d.ts +0 -4
- package/types/core/helpers/color/color-to-hex.d.ts +2 -2
- package/types/core/helpers/config-proto.d.ts +0 -3
- package/types/core/helpers/convert-media-url-to-video-embed.d.ts +1 -6
- package/types/core/helpers/ctrl-key.d.ts +1 -3
- package/types/core/helpers/data-bind.d.ts +0 -6
- package/types/core/helpers/default-language.d.ts +0 -3
- package/types/core/helpers/each.d.ts +9 -0
- package/types/core/helpers/html/htmlspecialchars.d.ts +0 -4
- package/types/core/helpers/html/nl2br.d.ts +0 -1
- package/types/core/helpers/human-size-to-bytes.d.ts +1 -4
- package/types/core/helpers/normalize/normalize-color.d.ts +2 -3
- package/types/core/helpers/normalize/normalize-key-aliases.d.ts +0 -2
- package/types/core/helpers/normalize/normalize-path.d.ts +0 -2
- package/types/core/helpers/normalize/normalize-size.d.ts +0 -3
- package/types/core/helpers/selector.d.ts +0 -8
- package/types/core/helpers/size/get-content-width.d.ts +0 -2
- package/types/core/helpers/size/offset.d.ts +1 -7
- package/types/core/helpers/string/camel-case.d.ts +1 -2
- package/types/core/helpers/string/i18n.d.ts +0 -7
- package/types/core/helpers/string/kebab-case.d.ts +1 -5
- package/types/core/helpers/string/stringify.d.ts +0 -3
- package/types/core/helpers/string/trim.d.ts +0 -2
- package/types/core/helpers/string/ucfirst.d.ts +1 -4
- package/types/core/helpers/type.d.ts +0 -1
- package/types/core/helpers/utils/get.d.ts +0 -2
- package/types/core/helpers/utils/mark-deprecated.d.ts +0 -4
- package/types/core/helpers/utils/set.d.ts +0 -2
- package/types/core/helpers/utils/utils.d.ts +4 -15
- package/types/core/plugin-system.d.ts +0 -31
- package/types/core/selection/select.d.ts +8 -9
- package/types/core/selection/style/api/toggle-styles.d.ts +0 -2
- package/types/core/traits/mods.d.ts +1 -3
- package/types/core/ui/element.d.ts +0 -4
- package/types/core/ui/form/validators/input.d.ts +0 -2
- package/types/core/ui/form/validators/select.d.ts +0 -1
- package/types/core/ui/helpers/get-control-type.d.ts +0 -2
- package/types/core/ui/icon.d.ts +0 -10
- package/types/core/ui/list/group.d.ts +1 -6
- package/types/core/ui/list/list.d.ts +0 -3
- package/types/core/ui/popup/popup.d.ts +0 -11
- package/types/core/view/view-with-toolbar.d.ts +0 -5
- package/types/core/view/view.d.ts +2 -18
- package/types/index.d.ts +1 -1
- package/types/jodit.d.ts +2 -46
- package/types/modules/context-menu/context-menu.d.ts +3 -6
- package/types/modules/dialog/alert.d.ts +0 -6
- package/types/modules/dialog/confirm.d.ts +1 -1
- package/types/modules/dialog/dialog.d.ts +9 -29
- package/types/modules/dialog/prompt.d.ts +3 -5
- package/types/modules/status-bar/status-bar.d.ts +0 -3
- package/types/modules/table.d.ts +1 -1
- package/types/types/ajax.d.ts +28 -0
- package/types/types/async.d.ts +4 -3
- package/types/types/events.d.ts +15 -0
- package/src/utils/create-entries.js +0 -57
- package/src/utils/lang-translater.js +0 -142
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { CallbackFunction, IEventsNative } from '../../types';
|
|
10
10
|
export declare class EventsNative implements IEventsNative {
|
|
11
|
+
private mutedEvents;
|
|
12
|
+
mute(event?: string): this;
|
|
13
|
+
isMuted(event?: string): boolean;
|
|
14
|
+
unmute(event?: string): this;
|
|
11
15
|
readonly __key: string;
|
|
12
16
|
private doc;
|
|
13
17
|
private eachEvent;
|
|
@@ -34,11 +38,11 @@ export declare class EventsNative implements IEventsNative {
|
|
|
34
38
|
/**
|
|
35
39
|
* Sets the handler for the specified event ( Event List ) for a given element .
|
|
36
40
|
*
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
41
|
+
* @param subjectOrEvents - The object for which toWYSIWYG set an event handler
|
|
42
|
+
* @param eventsOrCallback - List of events , separated by a space or comma
|
|
43
|
+
* @param handlerOrSelector - The event handler
|
|
44
|
+
* @param selector - Selector for capturing
|
|
45
|
+
* @param onTop - Set handler in first
|
|
42
46
|
*
|
|
43
47
|
* @example
|
|
44
48
|
* ```javascript
|
|
@@ -62,10 +66,10 @@ export declare class EventsNative implements IEventsNative {
|
|
|
62
66
|
/**
|
|
63
67
|
* Disable all handlers specified event ( Event List ) for a given element. Either a specific event handler.
|
|
64
68
|
*
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
69
|
+
* @param subjectOrEvents - The object which is disabled handlers
|
|
70
|
+
* @param eventsOrCallback - List of events, separated by a space or comma , which is necessary
|
|
67
71
|
* toWYSIWYG disable the handlers for a given object
|
|
68
|
-
* @param
|
|
72
|
+
* @param handler - Specific event handler toWYSIWYG be removed
|
|
69
73
|
*
|
|
70
74
|
* @example
|
|
71
75
|
* ```javascript
|
|
@@ -94,9 +98,6 @@ export declare class EventsNative implements IEventsNative {
|
|
|
94
98
|
off(subject: object, events?: string, handler?: CallbackFunction): this;
|
|
95
99
|
/**
|
|
96
100
|
* Stop execute all another listeners for this event
|
|
97
|
-
*
|
|
98
|
-
* @param subjectOrEvents
|
|
99
|
-
* @param eventsList
|
|
100
101
|
*/
|
|
101
102
|
stopPropagation(events: string): void;
|
|
102
103
|
stopPropagation(subject: object, eventsList: string): void;
|
|
@@ -106,10 +107,10 @@ export declare class EventsNative implements IEventsNative {
|
|
|
106
107
|
/**
|
|
107
108
|
* Sets the handler for the specified event (Event List) for a given element .
|
|
108
109
|
*
|
|
109
|
-
* @param
|
|
110
|
-
* @param
|
|
111
|
-
* @param
|
|
112
|
-
* @
|
|
110
|
+
* @param subjectOrEvents - The object which is caused by certain events
|
|
111
|
+
* @param eventsList - List of events , separated by a space or comma
|
|
112
|
+
* @param args - Options for the event handler
|
|
113
|
+
* @returns `false` if one of the handlers return `false`
|
|
113
114
|
* @example
|
|
114
115
|
* ```javascript
|
|
115
116
|
* var dialog = new Jodit.modules.Dialog();
|
|
@@ -119,13 +120,13 @@ export declare class EventsNative implements IEventsNative {
|
|
|
119
120
|
* dialog.open('Hello world!!!');
|
|
120
121
|
* ```
|
|
121
122
|
* or you can trigger native browser listener
|
|
122
|
-
*
|
|
123
|
+
* ```javascript
|
|
123
124
|
* var events = new Jodit.modules.EventsNative();
|
|
124
125
|
* events.on(document.body, 'click',function (event) {
|
|
125
126
|
* alert('click on ' + event.target.id );
|
|
126
127
|
* });
|
|
127
128
|
* events.fire(document.body.querySelector('div'), 'click');
|
|
128
|
-
*
|
|
129
|
+
* ```
|
|
129
130
|
*
|
|
130
131
|
*/
|
|
131
132
|
fire(subjectOrEvents: string, ...args: any[]): any;
|
package/types/core/global.d.ts
CHANGED
|
@@ -17,10 +17,6 @@ export declare const lang: IDictionary<IDictionary<string>>;
|
|
|
17
17
|
export declare const extendLang: (langs: IDictionary) => void;
|
|
18
18
|
/**
|
|
19
19
|
* Create unique box(HTMLCotainer) and remove it after destroy
|
|
20
|
-
*
|
|
21
|
-
* @param jodit
|
|
22
|
-
* @param name
|
|
23
|
-
* @param [tag]
|
|
24
20
|
*/
|
|
25
21
|
export declare function getContainer<T extends HTMLTagNames = HTMLTagNames>(jodit: IViewBased | IViewComponent, classFunc: Function, tag?: T, createInsideEditor?: boolean): HTMLElementTagNameMap[T];
|
|
26
22
|
/**
|
|
@@ -11,11 +11,6 @@ export interface CallbackAndElement {
|
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Append script in document and call callback function after download
|
|
14
|
-
*
|
|
15
|
-
* @param url
|
|
16
|
-
* @param callback
|
|
17
|
-
* @param className
|
|
18
|
-
* @param doc
|
|
19
14
|
*/
|
|
20
15
|
export declare const appendScript: (jodit: IViewBased, url: string, callback: (this: HTMLElement, e?: Event | undefined) => any) => CallbackAndElement;
|
|
21
16
|
/**
|
|
@@ -24,9 +19,6 @@ export declare const appendScript: (jodit: IViewBased, url: string, callback: (t
|
|
|
24
19
|
export declare const appendScriptAsync: Loader;
|
|
25
20
|
/**
|
|
26
21
|
* Download CSS style script
|
|
27
|
-
*
|
|
28
|
-
* @param url
|
|
29
|
-
* @param doc
|
|
30
22
|
*/
|
|
31
23
|
export declare const appendStyleAsync: Loader;
|
|
32
24
|
export declare const loadNext: (jodit: IViewBased, urls: string[], i?: number) => Promise<void>;
|
|
@@ -5,16 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* Create async callback if set timeout value - else call function immediately
|
|
8
|
-
*
|
|
9
|
-
* @param callback
|
|
10
|
-
* @param timeout
|
|
11
|
-
* @param a1
|
|
12
|
-
* @param a2
|
|
13
|
-
* @param a3
|
|
14
8
|
*/
|
|
15
9
|
export declare function setTimeout<T = any>(callback: (...args: T[]) => void, timeout: number, ...args: T[]): number;
|
|
16
10
|
/**
|
|
17
11
|
* Clear timeout
|
|
18
|
-
* @param timer
|
|
19
12
|
*/
|
|
20
13
|
export declare function clearTimeout(timer: number): void;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Converts rgba text representation of color in hex
|
|
8
8
|
*
|
|
9
|
-
* @param
|
|
10
|
-
* @
|
|
9
|
+
* @param color - string like rgba(red, green, blue, alpha) or rgb(red, green, blue)
|
|
10
|
+
* @returns hex color view, NaN - for transparent color
|
|
11
11
|
* @example
|
|
12
12
|
* ```javascript
|
|
13
13
|
* var p = document.createElement('p');
|
|
@@ -33,9 +33,6 @@ import type { IDictionary } from '../../types';
|
|
|
33
33
|
* console.log(options.d.g); // 8
|
|
34
34
|
*
|
|
35
35
|
* ```
|
|
36
|
-
* @param options
|
|
37
|
-
* @param proto
|
|
38
|
-
* @param level
|
|
39
36
|
*/
|
|
40
37
|
export declare function ConfigProto(options: IDictionary, proto: IDictionary, deep?: number): IDictionary;
|
|
41
38
|
export declare function ConfigFlatten(obj: IDictionary): IDictionary;
|
|
@@ -4,11 +4,6 @@
|
|
|
4
4
|
* Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @param {string} url
|
|
10
|
-
* @param {int} [width=400]
|
|
11
|
-
* @param {int} [height=345]
|
|
12
|
-
* return {string} embed code
|
|
7
|
+
* Javascript url pattern converter replace youtube/vimeo url in embed code.
|
|
13
8
|
*/
|
|
14
9
|
export declare const convertMediaUrlToVideoEmbed: (url: string, width?: number, height?: number) => string;
|
|
@@ -4,10 +4,4 @@
|
|
|
4
4
|
* Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
import type { IViewComponent } from '../../types';
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @param elm
|
|
10
|
-
* @param key
|
|
11
|
-
* @param value
|
|
12
|
-
*/
|
|
13
7
|
export declare const dataBind: <T = any>(elm: IViewComponent | Node | object, key: string, value?: T | undefined) => T;
|
|
@@ -5,7 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { IDictionary } from '../../types';
|
|
7
7
|
declare type eachCallback<T, N> = (this: T, key: N, value: T) => boolean | void;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use Object.keys
|
|
10
|
+
*/
|
|
8
11
|
export declare function each<T>(obj: T[], callback: eachCallback<T, number>): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use Object.keys
|
|
14
|
+
*/
|
|
9
15
|
export declare function each<T>(obj: IDictionary<T>, callback: eachCallback<T, string>): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Use Object.keys
|
|
18
|
+
*/
|
|
10
19
|
export declare function each<T>(obj: T[] | IDictionary<T>, callback: eachCallback<T, number | string>): boolean;
|
|
11
20
|
export {};
|
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* Converts from human readable file size (kb,mb,gb,tb) to bytes
|
|
8
|
-
*
|
|
9
|
-
* @method humanSizeToBytes
|
|
10
|
-
* @param {string|int} human readable file size. Example 1gb or 11.2mb
|
|
11
|
-
* @return {int}
|
|
8
|
+
* @param human - readable file size. Example 1gb or 11.2mb
|
|
12
9
|
*/
|
|
13
10
|
export declare const humanSizeToBytes: (human: string) => number;
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Convert rgba and short HEX color to Full text color. #fff to #FFFFFF
|
|
8
8
|
*
|
|
9
|
-
* @
|
|
10
|
-
* @
|
|
11
|
-
* @return {string|boolean} HEX color, false - for transparent color
|
|
9
|
+
* @param colorInput - string like rgba(red, green, blue, alpha) or rgb(red, green, blue) or #fff or #ffffff
|
|
10
|
+
* @returns HEX color, false - for transparent color
|
|
12
11
|
*/
|
|
13
12
|
export declare const normalizeColor: (colorInput: string) => string | false;
|
|
@@ -23,25 +23,17 @@ export declare function $$<K extends HTMLTagNames>(selector: K, root: HTMLElemen
|
|
|
23
23
|
export declare function $$<T extends HTMLElement>(selector: string, root: HTMLElement | HTMLDocument): T[];
|
|
24
24
|
/**
|
|
25
25
|
* Calculate XPath selector
|
|
26
|
-
*
|
|
27
|
-
* @param element
|
|
28
|
-
* @param root
|
|
29
26
|
*/
|
|
30
27
|
export declare const getXPathByElement: (element: HTMLElement, root: HTMLElement) => string;
|
|
31
28
|
/**
|
|
32
29
|
* Find all `ref` or `data-ref` elements inside HTMLElement
|
|
33
|
-
* @param root
|
|
34
30
|
*/
|
|
35
31
|
export declare const refs: <T extends HTMLElement>(root: HTMLElement | UIElement) => IDictionary<T>;
|
|
36
32
|
/**
|
|
37
33
|
* Calculate full CSS selector
|
|
38
|
-
* @param el
|
|
39
34
|
*/
|
|
40
35
|
export declare const cssPath: (el: Element) => Nullable<string>;
|
|
41
36
|
/**
|
|
42
37
|
* Try to find element by selector
|
|
43
|
-
*
|
|
44
|
-
* @param element
|
|
45
|
-
* @param od
|
|
46
38
|
*/
|
|
47
39
|
export declare function resolveElement(element: string | HTMLElement, od: ShadowRoot | Document): HTMLElement;
|
|
@@ -5,13 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* Calc relative offset by start editor field
|
|
8
|
-
*
|
|
9
|
-
* @method offset
|
|
10
|
-
* @param {HTMLElement} elm
|
|
11
|
-
* @param {Jodit} jodit
|
|
12
|
-
* @param {Document} doc
|
|
13
|
-
* @param {boolean} recurse
|
|
14
|
-
* @return {{top: number, left: number}} returns an object containing the properties top and left.
|
|
8
|
+
* @returns returns an object containing the properties top and left.
|
|
15
9
|
*/
|
|
16
10
|
import type { IBound, IViewBased } from '../../../types';
|
|
17
11
|
export declare const offset: (elm: HTMLElement | Range, jodit: IViewBased, doc: Document, recurse?: boolean) => IBound;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* Convert (kebab-case or snake_case)
|
|
8
|
-
* @param key
|
|
7
|
+
* Convert (kebab-case or snake_case) to camelCase
|
|
9
8
|
*/
|
|
10
9
|
export declare const camelCase: (key: string) => string;
|
|
@@ -6,17 +6,10 @@
|
|
|
6
6
|
import type { ILanguageOptions } from '../../../types';
|
|
7
7
|
/**
|
|
8
8
|
* Simple variant sprintf function
|
|
9
|
-
*
|
|
10
|
-
* @param str
|
|
11
|
-
* @param args
|
|
12
9
|
*/
|
|
13
10
|
export declare const sprintf: (str: string, args?: (string | number)[] | undefined) => string;
|
|
14
11
|
/**
|
|
15
12
|
* Internationalization method. Uses Jodit.lang object
|
|
16
|
-
*
|
|
17
|
-
* @param {string} key Some text
|
|
18
|
-
* @param {string[]} params Some text
|
|
19
|
-
* @return {string}
|
|
20
13
|
* @example
|
|
21
14
|
* ```javascript
|
|
22
15
|
* var editor = new Jodit("#redactor", {
|
|
@@ -3,9 +3,5 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param key
|
|
9
|
-
* @return {string}
|
|
10
|
-
*/
|
|
11
6
|
export declare const kebabCase: (key: string) => string;
|
|
7
|
+
export declare const CamelCaseToKebabCase: (key: string) => string;
|
|
@@ -6,11 +6,9 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* It clears the line of all auxiliary invisible characters , from the spaces and line breaks , tabs
|
|
8
8
|
* from the beginning and end of the line
|
|
9
|
-
* @param value input string
|
|
10
9
|
*/
|
|
11
10
|
export declare function trim(value: string): string;
|
|
12
11
|
/**
|
|
13
12
|
* Trim only invisible chars
|
|
14
|
-
* @param value
|
|
15
13
|
*/
|
|
16
14
|
export declare function trimInv(value: string): string;
|
|
@@ -22,7 +22,5 @@ import type { IDictionary, Nullable } from '../../../types';
|
|
|
22
22
|
* console.log(Jodit.modules.Helpers.get('a.b.c.d.e', obj) === false); // true
|
|
23
23
|
* console.log(Jodit.modules.Helpers.get('a.b.a.d.e', obj) === null); // false
|
|
24
24
|
* ```
|
|
25
|
-
* @param chain
|
|
26
|
-
* @param obj
|
|
27
25
|
*/
|
|
28
26
|
export declare function get<T>(chain: string, obj: IDictionary): Nullable<T>;
|
|
@@ -16,7 +16,5 @@ import type { IDictionary } from '../../../types';
|
|
|
16
16
|
* Jodit.modules.Helpers.set('a.0.e', 1, b);
|
|
17
17
|
* console.log(b);// {a: [{e: 1}]}
|
|
18
18
|
* ```
|
|
19
|
-
* @param chain
|
|
20
|
-
* @param obj
|
|
21
19
|
*/
|
|
22
20
|
export declare function set<T>(chain: string, value: unknown, obj: IDictionary): void;
|
|
@@ -3,12 +3,10 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
import type { CanPromise, IControlType, IViewBased, Nullable, IJodit, RejectablePromise } from '../../../types';
|
|
6
|
+
import type { CanPromise, IControlType, IDictionary, IViewBased, Nullable, IJodit, RejectablePromise } from '../../../types';
|
|
7
7
|
/**
|
|
8
8
|
* Call function with parameters
|
|
9
9
|
*
|
|
10
|
-
* @param func
|
|
11
|
-
* @param args
|
|
12
10
|
* @example
|
|
13
11
|
* ```js
|
|
14
12
|
* const f = Math.random();
|
|
@@ -20,21 +18,17 @@ export declare function call<T extends any[], R>(func: (...args: T) => R, ...arg
|
|
|
20
18
|
* Alias for `elm.getAttribute` but if set second argument `-{key}`
|
|
21
19
|
* it will also check `data-{key}` attribute
|
|
22
20
|
* if set `value` it is alias for setAttribute with same logic
|
|
23
|
-
*
|
|
24
|
-
* @param elm
|
|
25
|
-
* @param key
|
|
26
|
-
* @param [value]
|
|
27
21
|
*/
|
|
28
|
-
export declare function attr(elm: Element
|
|
22
|
+
export declare function attr(elm: Element, key: string): null | string;
|
|
23
|
+
export declare function attr(elm: Element, key: string, value: string | number | boolean | null | undefined): null;
|
|
24
|
+
export declare function attr(elm: Element, attributes: IDictionary<string | number | boolean | null>): null;
|
|
29
25
|
/**
|
|
30
26
|
* Mark element for debugging
|
|
31
|
-
* @param elm
|
|
32
27
|
*/
|
|
33
28
|
export declare function markOwner(jodit: IViewBased, elm: HTMLElement): void;
|
|
34
29
|
export declare function callPromise(condition: CanPromise<unknown>, callback: () => CanPromise<any>): CanPromise<void>;
|
|
35
30
|
/**
|
|
36
31
|
* Reset Vanila JS native function
|
|
37
|
-
* @param key
|
|
38
32
|
* @example
|
|
39
33
|
* ```js
|
|
40
34
|
* reset('Array.from')(Set([1,2,3])) // [1, 2, 3]
|
|
@@ -43,16 +37,11 @@ export declare function callPromise(condition: CanPromise<unknown>, callback: ()
|
|
|
43
37
|
export declare const reset: <T extends Function>(key: string) => Nullable<T>;
|
|
44
38
|
/**
|
|
45
39
|
* Allow load image in promise
|
|
46
|
-
* @param src
|
|
47
|
-
* @param jodit
|
|
48
40
|
*/
|
|
49
41
|
export declare const loadImage: (src: string, jodit: IViewBased) => RejectablePromise<HTMLImageElement>;
|
|
50
42
|
export declare const keys: (obj: object, own?: boolean) => string[];
|
|
51
43
|
/**
|
|
52
44
|
* Memorize last user chose
|
|
53
|
-
* @param editor
|
|
54
|
-
* @param _
|
|
55
|
-
* @param control
|
|
56
45
|
*/
|
|
57
46
|
export declare const memorizeExec: <T extends IJodit = IJodit>(editor: T, _: unknown, { control }: {
|
|
58
47
|
control: IControlType<T, import("../../../types").IToolbarButton>;
|