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.
Files changed (276) hide show
  1. package/.github/workflows/tests.yml +23 -0
  2. package/.idea/dictionaries/v_chupurnov.xml +1 -0
  3. package/.idea/workspace.xml +333 -1469
  4. package/CHANGELOG.MD +151 -25
  5. package/README.md +3 -3
  6. package/build/jodit.css +280 -258
  7. package/build/jodit.es2018.css +231 -213
  8. package/build/jodit.es2018.en.css +231 -213
  9. package/build/jodit.es2018.en.js +9981 -9818
  10. package/build/jodit.es2018.en.min.css +1 -1
  11. package/build/jodit.es2018.en.min.js +1 -10
  12. package/build/jodit.es2018.js +14124 -13961
  13. package/build/jodit.es2018.min.css +1 -1
  14. package/build/jodit.es2018.min.js +1 -10
  15. package/build/jodit.js +11285 -11049
  16. package/build/jodit.min.css +2 -2
  17. package/build/jodit.min.js +1 -10
  18. package/package.json +34 -33
  19. package/src/config.ts +8 -14
  20. package/src/core/async.ts +7 -18
  21. package/src/core/component/view-component.ts +0 -1
  22. package/src/core/constants.ts +7 -5
  23. package/src/core/create.ts +8 -27
  24. package/src/core/decorators/debounce.ts +0 -8
  25. package/src/core/decorators/hook.ts +0 -1
  26. package/src/core/decorators/nonenumerable.ts +1 -2
  27. package/src/core/decorators/persistent.ts +0 -3
  28. package/src/core/decorators/spy.ts +0 -1
  29. package/src/core/decorators/wait.ts +0 -1
  30. package/src/core/dom.ts +161 -205
  31. package/src/core/events/{events-native.ts → event-emitter.ts} +66 -35
  32. package/src/core/events/index.ts +1 -1
  33. package/src/core/events/observe-object.ts +0 -2
  34. package/src/core/global.ts +12 -8
  35. package/src/core/helpers/append-script.ts +0 -8
  36. package/src/core/helpers/array/as-array.ts +2 -5
  37. package/src/core/helpers/array/split-array.ts +0 -1
  38. package/src/core/helpers/array/to-array.ts +1 -0
  39. package/src/core/helpers/async/set-timeout.ts +0 -7
  40. package/src/core/helpers/browser.ts +0 -1
  41. package/src/core/helpers/checker/has-browser-color-picker.ts +0 -3
  42. package/src/core/helpers/checker/is-array.ts +0 -1
  43. package/src/core/helpers/checker/is-equal.ts +0 -3
  44. package/src/core/helpers/checker/is-function.ts +0 -2
  45. package/src/core/helpers/checker/is-html-from-word.ts +0 -3
  46. package/src/core/helpers/checker/is-html.ts +0 -1
  47. package/src/core/helpers/checker/is-number.ts +0 -1
  48. package/src/core/helpers/checker/is-numeric.ts +0 -2
  49. package/src/core/helpers/checker/is-plain-object.ts +0 -1
  50. package/src/core/helpers/checker/is-string.ts +0 -1
  51. package/src/core/helpers/checker/is-url.ts +0 -4
  52. package/src/core/helpers/color/color-to-hex.ts +2 -2
  53. package/src/core/helpers/config-proto.ts +0 -3
  54. package/src/core/helpers/convert-media-url-to-video-embed.ts +1 -6
  55. package/src/core/helpers/ctrl-key.ts +1 -3
  56. package/src/core/helpers/data-bind.ts +2 -8
  57. package/src/core/helpers/default-language.ts +0 -3
  58. package/src/core/helpers/each.ts +12 -0
  59. package/src/core/helpers/html/htmlspecialchars.ts +0 -4
  60. package/src/core/helpers/html/nl2br.ts +0 -1
  61. package/src/core/helpers/human-size-to-bytes.ts +1 -4
  62. package/src/core/helpers/normalize/normalize-color.ts +2 -3
  63. package/src/core/helpers/normalize/normalize-key-aliases.ts +0 -2
  64. package/src/core/helpers/normalize/normalize-path.ts +0 -2
  65. package/src/core/helpers/normalize/normalize-size.ts +0 -3
  66. package/src/core/helpers/selector.ts +0 -8
  67. package/src/core/helpers/size/get-content-width.ts +0 -2
  68. package/src/core/helpers/size/offset.ts +1 -7
  69. package/src/core/helpers/size/position.ts +0 -4
  70. package/src/core/helpers/string/camel-case.ts +1 -2
  71. package/src/core/helpers/string/i18n.ts +0 -7
  72. package/src/core/helpers/string/kebab-case.ts +7 -5
  73. package/src/core/helpers/string/stringify.ts +0 -3
  74. package/src/core/helpers/string/trim.ts +0 -2
  75. package/src/core/helpers/string/ucfirst.ts +2 -5
  76. package/src/core/helpers/type.ts +0 -1
  77. package/src/core/helpers/utils/get.ts +0 -2
  78. package/src/core/helpers/utils/mark-deprecated.ts +0 -4
  79. package/src/core/helpers/utils/set.ts +0 -2
  80. package/src/core/helpers/utils/utils.ts +52 -15
  81. package/src/core/plugin-system.ts +0 -31
  82. package/src/core/request/ajax.ts +212 -0
  83. package/src/core/request/config.ts +37 -0
  84. package/{types/types/core.js → src/core/request/index.ts} +3 -3
  85. package/src/core/request/response.ts +39 -0
  86. package/src/core/selection/select.ts +74 -40
  87. package/src/core/selection/style/api/element-has-same-style.ts +13 -0
  88. package/src/core/selection/style/api/get-suit-parent.ts +1 -1
  89. package/src/core/selection/style/api/is-normal-node.ts +1 -2
  90. package/src/core/selection/style/api/is-suit-element.ts +24 -4
  91. package/src/core/selection/style/api/toggle-styles.ts +0 -2
  92. package/src/core/selection/style/api/unwrap-children.ts +45 -16
  93. package/src/core/selection/style/api/wrap-unwrapped-text.ts +28 -23
  94. package/src/core/selection/style/apply-style.ts +19 -9
  95. package/src/core/traits/elms.ts +1 -0
  96. package/src/core/traits/mods.ts +1 -3
  97. package/src/core/ui/button/button/button.less +7 -3
  98. package/src/core/ui/button/button/button.ts +1 -1
  99. package/src/core/ui/button/group/group.less +5 -5
  100. package/src/core/ui/element.ts +0 -4
  101. package/src/core/ui/form/inputs/file/file.less +4 -4
  102. package/src/core/ui/form/validators/input.ts +0 -2
  103. package/src/core/ui/form/validators/select.ts +0 -1
  104. package/src/core/ui/helpers/get-control-type.ts +3 -3
  105. package/src/core/ui/icon.ts +0 -10
  106. package/src/core/ui/list/group.less +1 -1
  107. package/src/core/ui/list/group.ts +1 -6
  108. package/src/core/ui/list/list.ts +0 -3
  109. package/src/core/ui/popup/popup.ts +0 -11
  110. package/src/core/ui/progress-bar/progress-bar.less +8 -8
  111. package/src/core/view/view-with-toolbar.ts +0 -5
  112. package/src/core/view/view.ts +5 -21
  113. package/src/jodit.ts +14 -70
  114. package/src/modules/context-menu/context-menu.ts +4 -7
  115. package/src/modules/dialog/alert.ts +0 -6
  116. package/src/modules/dialog/confirm.ts +1 -1
  117. package/src/modules/dialog/dialog.ts +22 -47
  118. package/src/modules/file-browser/README.MD +1 -1
  119. package/src/modules/file-browser/data-provider.ts +22 -42
  120. package/src/modules/file-browser/file-browser.ts +3 -0
  121. package/src/modules/image-editor/image-editor.less +51 -46
  122. package/src/modules/index.ts +1 -1
  123. package/src/modules/status-bar/status-bar.less +12 -12
  124. package/src/modules/table.ts +122 -106
  125. package/src/modules/toolbar/button/button.less +5 -6
  126. package/src/modules/toolbar/button/button.ts +1 -1
  127. package/src/modules/toolbar/button/content.less +2 -2
  128. package/src/modules/uploader/uploader.ts +4 -3
  129. package/src/modules/widget/color-picker/color-picker.less +7 -6
  130. package/src/modules/widget/tabs/tabs.less +3 -3
  131. package/src/plugins/about/about.less +1 -1
  132. package/src/plugins/add-new-line/add-new-line.less +14 -15
  133. package/src/plugins/add-new-line/add-new-line.ts +1 -1
  134. package/src/plugins/clipboard/paste-storage/paste-storage.less +10 -11
  135. package/src/plugins/fix/clean-html.ts +39 -18
  136. package/src/plugins/fix/wrap-text-nodes.ts +1 -2
  137. package/src/plugins/fullsize/fullsize.less +5 -5
  138. package/src/plugins/image/image-properties/image-properties.less +11 -7
  139. package/src/plugins/image/image-properties/image-properties.ts +11 -8
  140. package/src/plugins/indent.ts +25 -18
  141. package/src/plugins/placeholder/placeholder.less +4 -4
  142. package/src/plugins/resizer/resizer.less +28 -23
  143. package/src/plugins/search/search.less +25 -25
  144. package/src/plugins/size/resize-handler.ts +1 -1
  145. package/src/plugins/size/size.ts +1 -3
  146. package/src/plugins/source/source.less +15 -15
  147. package/src/plugins/source/source.ts +1 -1
  148. package/src/plugins/table/select-cells.ts +23 -5
  149. package/src/plugins/xpath/xpath.less +3 -3
  150. package/src/styles/form.less +19 -14
  151. package/src/styles/modules/button-group.less +2 -2
  152. package/src/styles/modules/icon.less +9 -8
  153. package/src/types/ajax.d.ts +43 -6
  154. package/src/types/async.d.ts +5 -4
  155. package/src/types/events.d.ts +25 -10
  156. package/src/types/view.d.ts +2 -2
  157. package/tsconfig.json +1 -1
  158. package/types/config.d.ts +8 -14
  159. package/types/core/async.d.ts +3 -16
  160. package/types/core/component/view-component.d.ts +0 -1
  161. package/types/core/constants.d.ts +6 -5
  162. package/types/core/create.d.ts +0 -4
  163. package/types/core/decorators/debounce.d.ts +0 -8
  164. package/types/core/decorators/hook.d.ts +0 -1
  165. package/types/core/decorators/nonenumerable.d.ts +1 -2
  166. package/types/core/decorators/persistent.d.ts +0 -3
  167. package/types/core/decorators/wait.d.ts +0 -1
  168. package/types/core/dom.d.ts +47 -128
  169. package/types/core/events/{events-native.d.ts → event-emitter.d.ts} +26 -20
  170. package/types/core/events/index.d.ts +1 -1
  171. package/types/core/events/observe-object.d.ts +0 -2
  172. package/types/core/global.d.ts +2 -6
  173. package/types/core/helpers/append-script.d.ts +0 -8
  174. package/types/core/helpers/array/as-array.d.ts +3 -0
  175. package/types/core/helpers/array/split-array.d.ts +0 -1
  176. package/types/core/helpers/async/set-timeout.d.ts +0 -7
  177. package/types/core/helpers/browser.d.ts +0 -1
  178. package/types/core/helpers/checker/has-browser-color-picker.d.ts +0 -3
  179. package/types/core/helpers/checker/is-array.d.ts +0 -1
  180. package/types/core/helpers/checker/is-equal.d.ts +0 -3
  181. package/types/core/helpers/checker/is-function.d.ts +0 -2
  182. package/types/core/helpers/checker/is-html-from-word.d.ts +0 -3
  183. package/types/core/helpers/checker/is-html.d.ts +0 -1
  184. package/types/core/helpers/checker/is-number.d.ts +0 -1
  185. package/types/core/helpers/checker/is-numeric.d.ts +0 -2
  186. package/types/core/helpers/checker/is-plain-object.d.ts +0 -1
  187. package/types/core/helpers/checker/is-string.d.ts +0 -1
  188. package/types/core/helpers/checker/is-url.d.ts +0 -4
  189. package/types/core/helpers/color/color-to-hex.d.ts +2 -2
  190. package/types/core/helpers/config-proto.d.ts +0 -3
  191. package/types/core/helpers/convert-media-url-to-video-embed.d.ts +1 -6
  192. package/types/core/helpers/ctrl-key.d.ts +1 -3
  193. package/types/core/helpers/data-bind.d.ts +0 -6
  194. package/types/core/helpers/default-language.d.ts +0 -3
  195. package/types/core/helpers/each.d.ts +9 -0
  196. package/types/core/helpers/html/htmlspecialchars.d.ts +0 -4
  197. package/types/core/helpers/html/nl2br.d.ts +0 -1
  198. package/types/core/helpers/human-size-to-bytes.d.ts +1 -4
  199. package/types/core/helpers/normalize/normalize-color.d.ts +2 -3
  200. package/types/core/helpers/normalize/normalize-key-aliases.d.ts +0 -2
  201. package/types/core/helpers/normalize/normalize-path.d.ts +0 -2
  202. package/types/core/helpers/normalize/normalize-size.d.ts +0 -3
  203. package/types/core/helpers/selector.d.ts +0 -8
  204. package/types/core/helpers/size/get-content-width.d.ts +0 -2
  205. package/types/core/helpers/size/offset.d.ts +1 -7
  206. package/types/core/helpers/string/camel-case.d.ts +1 -2
  207. package/types/core/helpers/string/i18n.d.ts +0 -7
  208. package/types/core/helpers/string/kebab-case.d.ts +1 -5
  209. package/types/core/helpers/string/stringify.d.ts +0 -3
  210. package/types/core/helpers/string/trim.d.ts +0 -2
  211. package/types/core/helpers/string/ucfirst.d.ts +1 -4
  212. package/types/core/helpers/type.d.ts +0 -1
  213. package/types/core/helpers/utils/get.d.ts +0 -2
  214. package/types/core/helpers/utils/mark-deprecated.d.ts +0 -4
  215. package/types/core/helpers/utils/set.d.ts +0 -2
  216. package/types/core/helpers/utils/utils.d.ts +15 -18
  217. package/types/core/plugin-system.d.ts +0 -31
  218. package/types/core/request/ajax.d.ts +26 -0
  219. package/types/core/request/config.d.ts +14 -0
  220. package/{src/types/core.js → types/core/request/index.d.ts} +2 -3
  221. package/types/core/request/response.d.ts +16 -0
  222. package/types/core/selection/select.d.ts +8 -9
  223. package/types/core/selection/style/api/element-has-same-style.d.ts +4 -0
  224. package/types/core/selection/style/api/is-suit-element.d.ts +1 -0
  225. package/types/core/selection/style/api/toggle-styles.d.ts +0 -2
  226. package/types/core/selection/style/api/wrap-unwrapped-text.d.ts +2 -2
  227. package/types/core/traits/mods.d.ts +1 -3
  228. package/types/core/ui/element.d.ts +0 -4
  229. package/types/core/ui/form/validators/input.d.ts +0 -2
  230. package/types/core/ui/form/validators/select.d.ts +0 -1
  231. package/types/core/ui/helpers/get-control-type.d.ts +0 -2
  232. package/types/core/ui/icon.d.ts +0 -10
  233. package/types/core/ui/list/group.d.ts +1 -6
  234. package/types/core/ui/list/list.d.ts +0 -3
  235. package/types/core/ui/popup/popup.d.ts +0 -11
  236. package/types/core/view/view-with-toolbar.d.ts +0 -5
  237. package/types/core/view/view.d.ts +4 -20
  238. package/types/jodit.d.ts +2 -46
  239. package/types/modules/context-menu/context-menu.d.ts +3 -6
  240. package/types/modules/dialog/alert.d.ts +0 -6
  241. package/types/modules/dialog/confirm.d.ts +1 -1
  242. package/types/modules/dialog/dialog.d.ts +9 -28
  243. package/types/modules/file-browser/data-provider.d.ts +1 -1
  244. package/types/modules/index.d.ts +1 -1
  245. package/types/modules/table.d.ts +1 -1
  246. package/types/plugins/fix/clean-html.d.ts +4 -0
  247. package/types/plugins/size/resize-handler.d.ts +1 -1
  248. package/types/plugins/source/source.d.ts +1 -1
  249. package/types/types/ajax.d.ts +43 -6
  250. package/types/types/async.d.ts +5 -4
  251. package/types/types/events.d.ts +25 -10
  252. package/types/types/view.d.ts +2 -2
  253. package/.editorconfig +0 -15
  254. package/.eslintignore +0 -3
  255. package/.eslintrc.js +0 -109
  256. package/.prettierrc.json +0 -9
  257. package/.stylelintrc.json +0 -16
  258. package/app.css +0 -112
  259. package/composer.json +0 -12
  260. package/src/core/ajax.ts +0 -296
  261. package/src/types/core.d.ts +0 -7
  262. package/src/types/core.js.map +0 -1
  263. package/src/types/storage.d.ts +0 -13
  264. package/src/types/storage.js +0 -8
  265. package/src/types/storage.js.map +0 -1
  266. package/src/utils/create-entries.js +0 -57
  267. package/src/utils/css-variables-prefixes.js +0 -12
  268. package/src/utils/lang-loader.js +0 -57
  269. package/src/utils/lang-translater.js +0 -142
  270. package/src/utils/plugin-loader.js +0 -14
  271. package/src/utils/post-build.js +0 -28
  272. package/src/utils/svg-loader.js +0 -20
  273. package/types/core/ajax.d.ts +0 -59
  274. package/types/types/core.js.map +0 -1
  275. package/types/types/storage.js +0 -8
  276. package/types/types/storage.js.map +0 -1
@@ -5,9 +5,6 @@
5
5
  */
6
6
  /**
7
7
  * Check two element are equal
8
- *
9
- * @param a
10
- * @param b
11
8
  */
12
9
  export declare function isEqual(a: unknown, b: unknown): boolean;
13
10
  export declare function isFastEqual(a: unknown, b: unknown): boolean;
@@ -5,7 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Check value is Function
8
- *
9
- * @param value
10
8
  */
11
9
  export declare function isFunction(value: unknown): value is Function;
@@ -5,8 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Detect if string is HTML from MS Word or Excel
8
- *
9
- * @param {string} data
10
- * @return {boolean}
11
8
  */
12
9
  export declare function isHtmlFromWord(data: string): boolean;
@@ -5,6 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Check if a string is html or not
8
- ** @param str
9
8
  */
10
9
  export declare const isHTML: (str: unknown) => str is string;
@@ -5,6 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Check value is a number
8
- * @param value
9
8
  */
10
9
  export declare function isNumber(value: unknown): value is number;
@@ -5,7 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Check value has numeric format
8
- *
9
- * @param value
10
8
  */
11
9
  export declare function isNumeric(value: number | string): boolean;
@@ -6,6 +6,5 @@
6
6
  import type { IDictionary } from '../../../types';
7
7
  /**
8
8
  * Check if element is simple plaint object
9
- * @param obj
10
9
  */
11
10
  export declare function isPlainObject<T>(obj: any | IDictionary<T>): obj is IDictionary<T>;
@@ -5,6 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Check value is String
8
- * @param value
9
8
  */
10
9
  export declare function isString(value: unknown): value is string;
@@ -5,9 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Check if a string is a url
8
- *
9
- * @method isURL
10
- * @param {string} str
11
- * @return {boolean}
12
8
  */
13
9
  export declare function isURL(str: string): boolean;
@@ -6,8 +6,8 @@
6
6
  /**
7
7
  * Converts rgba text representation of color in hex
8
8
  *
9
- * @param {string} color - string like rgba(red, green, blue, alpha) or rgb(red, green, blue)
10
- * @return {string | NaN} hex color view, NaN - for transparent color
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
- * Javascript url pattern converter replace youtube/vimeo url in embed code.
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;
@@ -5,8 +5,6 @@
5
5
  */
6
6
  /**
7
7
  * CTRL pressed
8
- *
9
- * @param {KeyboardEvent} e Event
10
- * @return {boolean} true ctrl key was pressed
8
+ * @returns true ctrl key was pressed
11
9
  */
12
10
  export declare const ctrlKey: (e: MouseEvent | KeyboardEvent) => boolean;
@@ -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,8 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Try define user language
8
- *
9
- * @param language
10
- * @param defaultLanguage
11
8
  */
12
9
  export declare const defaultLanguage: (language?: string | undefined, defaultLanguage?: string) => string;
@@ -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,5 @@
5
5
  */
6
6
  /**
7
7
  * Convert special characters to HTML entities
8
- *
9
- * @method htmlspecialchars
10
- * @param {string} html
11
- * @return {string}
12
8
  */
13
9
  export declare function htmlspecialchars(html: string): string;
@@ -5,6 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Inserts HTML line breaks before all newlines in a string
8
- * @param html
9
8
  */
10
9
  export declare function nl2br(html: string): string;
@@ -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
- * @method normalizeColor
10
- * @param {string} colorInput - string like rgba(red, green, blue, alpha) or rgb(red, green, blue) or #fff or #ffffff
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;
@@ -5,7 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Normalize keys to some standard name
8
- *
9
- * @param keys
10
8
  */
11
9
  export declare function normalizeKeyAliases(keys: string): string;
@@ -5,7 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Replaces back slashes and correctly concatenates several parts of the path.
8
- * @param path
9
- * @see Test helpers
10
8
  */
11
9
  export declare const normalizePath: (...path: string[]) => string;
@@ -5,8 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Normalize value to CSS meters
8
- * @method normalizeSize
9
- * @param {string|int} value Input string
10
- * @return {string}
11
8
  */
12
9
  export declare const normalizeSize: (value: string | number) => string;
@@ -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,7 +5,5 @@
5
5
  */
6
6
  /**
7
7
  *
8
- * @param element
9
- * @param win
10
8
  */
11
9
  export declare const getContentWidth: (element: HTMLElement, win: Window) => number;
@@ -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) => camelCase
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;
@@ -5,9 +5,6 @@
5
5
  */
6
6
  /**
7
7
  * Safe stringify circular object
8
- *
9
- * @param value
10
- * @param options
11
8
  */
12
9
  export declare function stringify(value: unknown, options?: {
13
10
  excludeKeys?: 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;
@@ -5,8 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Make a string's first character uppercase
8
- *
9
- * @param {string} value input string
10
- * @return {string}
11
8
  */
12
- export declare const ucfirst: (value: string) => string;
9
+ export declare function ucfirst(value: string): string;
@@ -5,6 +5,5 @@
5
5
  */
6
6
  /**
7
7
  * Helper for create Error object
8
- * @param message
9
8
  */
10
9
  export declare function error(message: string): Error;
@@ -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>;
@@ -10,9 +10,5 @@
10
10
  export declare const cns: Console;
11
11
  /**
12
12
  * Mark function as deprecated
13
- *
14
- * @param method
15
- * @param names
16
- * @param ctx
17
13
  */
18
14
  export declare function markDeprecated(method: Function, names?: string[], ctx?: any): (...args: any[]) => void;
@@ -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
- * Alias for `elm.getAttribute` but if set second argument `-{key}`
21
- * it will also check `data-{key}` attribute
22
- * if set `value` it is alias for setAttribute with same logic
23
- *
24
- * @param elm
25
- * @param key
26
- * @param [value]
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 | null, key: string, value?: string | number | boolean | null): null | string;
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
- Object.defineProperty(exports, "__esModule", { value: true });
8
- //# sourceMappingURL=core.js.map
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
+ }