jodit 3.8.5 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/tests.yml +23 -0
- package/.idea/dictionaries/v_chupurnov.xml +1 -0
- package/.idea/workspace.xml +333 -1469
- package/CHANGELOG.MD +151 -25
- package/README.md +3 -3
- 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 +9981 -9818
- package/build/jodit.es2018.en.min.css +1 -1
- package/build/jodit.es2018.en.min.js +1 -10
- package/build/jodit.es2018.js +14124 -13961
- package/build/jodit.es2018.min.css +1 -1
- package/build/jodit.es2018.min.js +1 -10
- package/build/jodit.js +11285 -11049
- package/build/jodit.min.css +2 -2
- package/build/jodit.min.js +1 -10
- package/package.json +34 -33
- package/src/config.ts +8 -14
- package/src/core/async.ts +7 -18
- package/src/core/component/view-component.ts +0 -1
- package/src/core/constants.ts +7 -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 +161 -205
- package/src/core/events/{events-native.ts → event-emitter.ts} +66 -35
- package/src/core/events/index.ts +1 -1
- package/src/core/events/observe-object.ts +0 -2
- package/src/core/global.ts +12 -8
- 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/array/to-array.ts +1 -0
- 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 +2 -8
- 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 +52 -15
- package/src/core/plugin-system.ts +0 -31
- package/src/core/request/ajax.ts +212 -0
- package/src/core/request/config.ts +37 -0
- package/{types/types/core.js → src/core/request/index.ts} +3 -3
- package/src/core/request/response.ts +39 -0
- package/src/core/selection/select.ts +74 -40
- package/src/core/selection/style/api/element-has-same-style.ts +13 -0
- package/src/core/selection/style/api/get-suit-parent.ts +1 -1
- package/src/core/selection/style/api/is-normal-node.ts +1 -2
- package/src/core/selection/style/api/is-suit-element.ts +24 -4
- package/src/core/selection/style/api/toggle-styles.ts +0 -2
- package/src/core/selection/style/api/unwrap-children.ts +45 -16
- package/src/core/selection/style/api/wrap-unwrapped-text.ts +28 -23
- package/src/core/selection/style/apply-style.ts +19 -9
- package/src/core/traits/elms.ts +1 -0
- 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 +3 -3
- 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 +5 -21
- package/src/jodit.ts +14 -70
- package/src/modules/context-menu/context-menu.ts +4 -7
- package/src/modules/dialog/alert.ts +0 -6
- package/src/modules/dialog/confirm.ts +1 -1
- package/src/modules/dialog/dialog.ts +22 -47
- package/src/modules/file-browser/README.MD +1 -1
- package/src/modules/file-browser/data-provider.ts +22 -42
- package/src/modules/file-browser/file-browser.ts +3 -0
- package/src/modules/image-editor/image-editor.less +51 -46
- package/src/modules/index.ts +1 -1
- package/src/modules/status-bar/status-bar.less +12 -12
- package/src/modules/table.ts +122 -106
- 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/uploader/uploader.ts +4 -3
- 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 +39 -18
- 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/indent.ts +25 -18
- 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/size/resize-handler.ts +1 -1
- package/src/plugins/size/size.ts +1 -3
- package/src/plugins/source/source.less +15 -15
- package/src/plugins/source/source.ts +1 -1
- package/src/plugins/table/select-cells.ts +23 -5
- 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 +43 -6
- package/src/types/async.d.ts +5 -4
- package/src/types/events.d.ts +25 -10
- package/src/types/view.d.ts +2 -2
- package/tsconfig.json +1 -1
- package/types/config.d.ts +8 -14
- package/types/core/async.d.ts +3 -16
- package/types/core/component/view-component.d.ts +0 -1
- package/types/core/constants.d.ts +6 -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 +47 -128
- package/types/core/events/{events-native.d.ts → event-emitter.d.ts} +26 -20
- package/types/core/events/index.d.ts +1 -1
- package/types/core/events/observe-object.d.ts +0 -2
- package/types/core/global.d.ts +2 -6
- 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 +15 -18
- package/types/core/plugin-system.d.ts +0 -31
- package/types/core/request/ajax.d.ts +26 -0
- package/types/core/request/config.d.ts +14 -0
- package/{src/types/core.js → types/core/request/index.d.ts} +2 -3
- package/types/core/request/response.d.ts +16 -0
- package/types/core/selection/select.d.ts +8 -9
- package/types/core/selection/style/api/element-has-same-style.d.ts +4 -0
- package/types/core/selection/style/api/is-suit-element.d.ts +1 -0
- package/types/core/selection/style/api/toggle-styles.d.ts +0 -2
- package/types/core/selection/style/api/wrap-unwrapped-text.d.ts +2 -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 +4 -20
- 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 -28
- package/types/modules/file-browser/data-provider.d.ts +1 -1
- package/types/modules/index.d.ts +1 -1
- package/types/modules/table.d.ts +1 -1
- package/types/plugins/fix/clean-html.d.ts +4 -0
- package/types/plugins/size/resize-handler.d.ts +1 -1
- package/types/plugins/source/source.d.ts +1 -1
- package/types/types/ajax.d.ts +43 -6
- package/types/types/async.d.ts +5 -4
- package/types/types/events.d.ts +25 -10
- package/types/types/view.d.ts +2 -2
- package/.editorconfig +0 -15
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -109
- package/.prettierrc.json +0 -9
- package/.stylelintrc.json +0 -16
- package/app.css +0 -112
- package/composer.json +0 -12
- package/src/core/ajax.ts +0 -296
- package/src/types/core.d.ts +0 -7
- package/src/types/core.js.map +0 -1
- package/src/types/storage.d.ts +0 -13
- package/src/types/storage.js +0 -8
- package/src/types/storage.js.map +0 -1
- package/src/utils/create-entries.js +0 -57
- package/src/utils/css-variables-prefixes.js +0 -12
- package/src/utils/lang-loader.js +0 -57
- package/src/utils/lang-translater.js +0 -142
- package/src/utils/plugin-loader.js +0 -14
- package/src/utils/post-build.js +0 -28
- package/src/utils/svg-loader.js +0 -20
- package/types/core/ajax.d.ts +0 -59
- package/types/types/core.js.map +0 -1
- package/types/types/storage.js +0 -8
- package/types/types/storage.js.map +0 -1
|
@@ -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();
|
|
@@ -17,24 +15,28 @@ import type { CanPromise, IControlType, IViewBased, Nullable, IJodit, Rejectable
|
|
|
17
15
|
*/
|
|
18
16
|
export declare function call<T extends any[], R>(func: (...args: T) => R, ...args: T): R;
|
|
19
17
|
/**
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
* Get attribute
|
|
19
|
+
*/
|
|
20
|
+
export declare function attr(elm: Element, key: string): null | string;
|
|
21
|
+
/**
|
|
22
|
+
* Remove attribute
|
|
23
|
+
*/
|
|
24
|
+
export declare function attr(elm: Element, key: string, value: null): null | string;
|
|
25
|
+
/**
|
|
26
|
+
* Set attribute
|
|
27
|
+
*/
|
|
28
|
+
export declare function attr(elm: Element, key: string, value: string | number | boolean | undefined | null): null;
|
|
29
|
+
/**
|
|
30
|
+
* Set or remove several attributes
|
|
27
31
|
*/
|
|
28
|
-
export declare function attr(elm: Element
|
|
32
|
+
export declare function attr(elm: Element, attributes: IDictionary<string | number | boolean | null>): null;
|
|
29
33
|
/**
|
|
30
34
|
* Mark element for debugging
|
|
31
|
-
* @param elm
|
|
32
35
|
*/
|
|
33
36
|
export declare function markOwner(jodit: IViewBased, elm: HTMLElement): void;
|
|
34
37
|
export declare function callPromise(condition: CanPromise<unknown>, callback: () => CanPromise<any>): CanPromise<void>;
|
|
35
38
|
/**
|
|
36
39
|
* Reset Vanila JS native function
|
|
37
|
-
* @param key
|
|
38
40
|
* @example
|
|
39
41
|
* ```js
|
|
40
42
|
* reset('Array.from')(Set([1,2,3])) // [1, 2, 3]
|
|
@@ -43,16 +45,11 @@ export declare function callPromise(condition: CanPromise<unknown>, callback: ()
|
|
|
43
45
|
export declare const reset: <T extends Function>(key: string) => Nullable<T>;
|
|
44
46
|
/**
|
|
45
47
|
* Allow load image in promise
|
|
46
|
-
* @param src
|
|
47
|
-
* @param jodit
|
|
48
48
|
*/
|
|
49
49
|
export declare const loadImage: (src: string, jodit: IViewBased) => RejectablePromise<HTMLImageElement>;
|
|
50
50
|
export declare const keys: (obj: object, own?: boolean) => string[];
|
|
51
51
|
/**
|
|
52
52
|
* Memorize last user chose
|
|
53
|
-
* @param editor
|
|
54
|
-
* @param _
|
|
55
|
-
* @param control
|
|
56
53
|
*/
|
|
57
54
|
export declare const memorizeExec: <T extends IJodit = IJodit>(editor: T, _: unknown, { control }: {
|
|
58
55
|
control: IControlType<T, import("../../../types").IToolbarButton>;
|
|
@@ -21,75 +21,44 @@ export declare class PluginSystem implements IPluginSystem {
|
|
|
21
21
|
private items;
|
|
22
22
|
/**
|
|
23
23
|
* Add plugin in store
|
|
24
|
-
*
|
|
25
|
-
* @param name
|
|
26
|
-
* @param plugin
|
|
27
24
|
*/
|
|
28
25
|
add(name: string, plugin: PluginType): void;
|
|
29
26
|
/**
|
|
30
27
|
* Get plugin from store
|
|
31
|
-
* @param name
|
|
32
28
|
*/
|
|
33
29
|
get(name: string): PluginType | void;
|
|
34
30
|
/**
|
|
35
31
|
* Remove plugin from store
|
|
36
|
-
* @param name
|
|
37
32
|
*/
|
|
38
33
|
remove(name: string): void;
|
|
39
34
|
/**
|
|
40
35
|
* Public method for async init all plugins
|
|
41
|
-
* @param jodit
|
|
42
36
|
*/
|
|
43
37
|
init(jodit: IJodit): CanPromise<void>;
|
|
44
38
|
/**
|
|
45
39
|
* Plugin type has disabled requires
|
|
46
|
-
* @param disableList
|
|
47
|
-
* @param requires
|
|
48
40
|
*/
|
|
49
41
|
private hasDisabledRequires;
|
|
50
42
|
/**
|
|
51
43
|
* Create instance of plugin
|
|
52
|
-
*
|
|
53
|
-
* @param jodit
|
|
54
|
-
* @param plugin
|
|
55
44
|
*/
|
|
56
45
|
static makePluginInstance(jodit: IJodit, plugin: PluginType): PluginInstance;
|
|
57
46
|
/**
|
|
58
47
|
* Init plugin if it has not dependencies in another case wait requires plugins will be init
|
|
59
|
-
*
|
|
60
|
-
* @param jodit
|
|
61
|
-
* @param pluginName
|
|
62
|
-
* @param instance
|
|
63
|
-
* @param doneList
|
|
64
|
-
* @param promiseList
|
|
65
48
|
*/
|
|
66
49
|
private initOrWait;
|
|
67
50
|
/**
|
|
68
51
|
* Destroy all plugins before - Jodit will be destroyed
|
|
69
|
-
*
|
|
70
|
-
* @param jodit
|
|
71
|
-
* @param plugins
|
|
72
52
|
*/
|
|
73
53
|
private addListenerOnBeforeDestruct;
|
|
74
54
|
/**
|
|
75
55
|
* Download plugins
|
|
76
|
-
*
|
|
77
|
-
* @param jodit
|
|
78
|
-
* @param pluginList
|
|
79
56
|
*/
|
|
80
57
|
private load;
|
|
81
|
-
/**
|
|
82
|
-
* @param jodit
|
|
83
|
-
* @param pluginName
|
|
84
|
-
*/
|
|
85
58
|
private static loadStyle;
|
|
86
59
|
private static styles;
|
|
87
60
|
/**
|
|
88
61
|
* Call full url to the script or style file
|
|
89
|
-
*
|
|
90
|
-
* @param jodit
|
|
91
|
-
* @param name
|
|
92
|
-
* @param js
|
|
93
62
|
*/
|
|
94
63
|
private static getFullUrl;
|
|
95
64
|
private loadExtras;
|
|
@@ -0,0 +1,26 @@
|
|
|
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-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
import type { IRequest, IViewBased, AjaxOptions, IAjax, RejectablePromise, IResponse } from '../../types';
|
|
7
|
+
import './config';
|
|
8
|
+
export declare class Ajax<T extends object = any> implements IAjax<T> {
|
|
9
|
+
readonly jodit: IViewBased;
|
|
10
|
+
static log: IRequest[];
|
|
11
|
+
private readonly xhr;
|
|
12
|
+
private __buildParams;
|
|
13
|
+
options: AjaxOptions;
|
|
14
|
+
get o(): this['options'];
|
|
15
|
+
/**
|
|
16
|
+
* Alias for this.jodit
|
|
17
|
+
*/
|
|
18
|
+
get j(): this['jodit'];
|
|
19
|
+
abort(): Ajax;
|
|
20
|
+
private resolved;
|
|
21
|
+
private activated;
|
|
22
|
+
send(): RejectablePromise<IResponse<T>>;
|
|
23
|
+
prepareRequest(): IRequest;
|
|
24
|
+
constructor(jodit: IViewBased, options: Partial<AjaxOptions>);
|
|
25
|
+
destruct(): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
import type { AjaxOptions } from '../../types';
|
|
7
|
+
declare module '../../config' {
|
|
8
|
+
interface Config {
|
|
9
|
+
/**
|
|
10
|
+
* A set of key/value pairs that configure the Ajax request. All settings are optional
|
|
11
|
+
*/
|
|
12
|
+
defaultAjaxOptions: AjaxOptions;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*!
|
|
3
2
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
4
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
5
4
|
* Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export * from './ajax';
|
|
7
|
+
export * from './response';
|
|
@@ -0,0 +1,16 @@
|
|
|
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-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
import type { IRequest, IResponse } from '../../types';
|
|
7
|
+
export declare class Response<T> implements IResponse<T> {
|
|
8
|
+
readonly status: number;
|
|
9
|
+
readonly statusText: string;
|
|
10
|
+
readonly request: IRequest;
|
|
11
|
+
get url(): string;
|
|
12
|
+
private readonly body;
|
|
13
|
+
constructor(request: IRequest, status: number, statusText: string, body: string);
|
|
14
|
+
json(): Promise<T>;
|
|
15
|
+
text(): Promise<string>;
|
|
16
|
+
}
|