jodit 3.12.3 → 3.13.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 (513) hide show
  1. package/.idea/stylesheetLinters/stylelint.xml +6 -0
  2. package/.idea/workspace.xml +306 -288
  3. package/CHANGELOG.MD +82 -10
  4. package/README.md +107 -78
  5. package/build/jodit.css +112 -70
  6. package/build/jodit.es2018.css +107 -64
  7. package/build/jodit.es2018.en.css +107 -64
  8. package/build/jodit.es2018.en.js +1065 -892
  9. package/build/jodit.es2018.en.min.css +1 -1
  10. package/build/jodit.es2018.en.min.js +1 -1
  11. package/build/jodit.es2018.js +1101 -928
  12. package/build/jodit.es2018.min.css +1 -1
  13. package/build/jodit.es2018.min.js +1 -1
  14. package/build/jodit.js +4886 -2306
  15. package/build/jodit.min.css +2 -2
  16. package/build/jodit.min.js +1 -1
  17. package/index.html +1 -0
  18. package/package.json +35 -35
  19. package/src/config.ts +18 -0
  20. package/src/core/async/async.ts +2 -2
  21. package/src/core/component/README.md +2 -2
  22. package/src/core/component/component.ts +16 -6
  23. package/src/core/component/view-component.ts +1 -1
  24. package/src/core/constants.ts +45 -1
  25. package/src/core/create/create.ts +4 -4
  26. package/src/core/decorators/cache/cache.ts +2 -2
  27. package/src/core/decorators/component/component.ts +1 -1
  28. package/src/core/decorators/debounce/debounce.ts +4 -4
  29. package/src/core/decorators/hook/hook.ts +4 -4
  30. package/src/core/decorators/idle/idle.ts +3 -3
  31. package/src/core/decorators/persistent/persistent.ts +3 -3
  32. package/src/core/decorators/wait/wait.ts +3 -3
  33. package/src/core/decorators/watch/watch.ts +48 -45
  34. package/src/core/dom/README.md +2 -0
  35. package/src/core/dom/dom.ts +5 -5
  36. package/src/core/event-emitter/event-emitter.ts +5 -5
  37. package/src/core/event-emitter/index.ts +1 -1
  38. package/src/core/event-emitter/observable.ts +192 -0
  39. package/src/core/event-emitter/store.ts +1 -1
  40. package/src/core/global.ts +1 -1
  41. package/src/core/helpers/README.md +31 -1
  42. package/src/core/helpers/checker/is-equal.ts +1 -1
  43. package/src/core/helpers/checker/is-imp-interface.ts +2 -2
  44. package/src/core/helpers/checker/is-jodit-object.ts +1 -1
  45. package/src/core/helpers/checker/is-plain-object.ts +1 -1
  46. package/src/core/helpers/html/apply-styles.ts +2 -2
  47. package/src/core/helpers/html/clean-from-word.ts +3 -3
  48. package/src/core/helpers/html/nl2br.ts +1 -1
  49. package/src/core/helpers/html/strip-tags.ts +5 -5
  50. package/src/core/helpers/normalize/normalize-key-aliases.ts +3 -3
  51. package/src/core/helpers/normalize/normalize-node.ts +2 -2
  52. package/src/core/helpers/size/get-scroll-parent.ts +3 -3
  53. package/src/core/helpers/size/object-size.ts +1 -1
  54. package/src/core/helpers/size/offset.ts +1 -1
  55. package/src/core/helpers/size/position.ts +1 -1
  56. package/src/core/helpers/string/i18n.ts +10 -6
  57. package/src/core/helpers/string/stringify.ts +1 -1
  58. package/src/core/helpers/string/trim.ts +1 -1
  59. package/src/core/helpers/utils/append-script.ts +1 -1
  60. package/src/core/helpers/utils/assert.ts +25 -0
  61. package/src/core/helpers/utils/build-query.ts +1 -1
  62. package/src/core/helpers/utils/config-proto.ts +2 -2
  63. package/src/core/helpers/utils/css.ts +1 -1
  64. package/src/core/helpers/utils/data-bind.ts +2 -2
  65. package/src/core/helpers/utils/get-class-name.ts +1 -1
  66. package/src/core/helpers/utils/get.ts +1 -1
  67. package/src/core/helpers/utils/index.ts +1 -0
  68. package/src/core/helpers/utils/parse-query.ts +1 -1
  69. package/src/core/helpers/utils/selector.ts +8 -9
  70. package/src/core/helpers/utils/set.ts +1 -1
  71. package/src/core/helpers/utils/stack.ts +1 -1
  72. package/src/core/helpers/utils/utils.ts +1 -1
  73. package/src/core/plugin/README.md +13 -0
  74. package/src/core/plugin/plugin-system.ts +58 -17
  75. package/src/core/plugin/plugin.ts +3 -3
  76. package/src/core/request/ajax.ts +3 -3
  77. package/src/core/request/config.ts +3 -3
  78. package/src/core/request/response.ts +1 -1
  79. package/src/core/selection/select.ts +6 -6
  80. package/src/core/selection/style/api/element-has-same-style.ts +3 -3
  81. package/src/core/selection/style/api/extract.ts +3 -3
  82. package/src/core/selection/style/api/finite-state-machine.ts +1 -1
  83. package/src/core/selection/style/api/get-suit-child.ts +2 -2
  84. package/src/core/selection/style/api/get-suit-parent.ts +2 -2
  85. package/src/core/selection/style/api/is-inside-invisible-element.ts +1 -1
  86. package/src/core/selection/style/api/is-normal-node.ts +2 -2
  87. package/src/core/selection/style/api/is-suit-element.ts +3 -3
  88. package/src/core/selection/style/api/toggle/toggle-css.ts +6 -6
  89. package/src/core/selection/style/api/toggle/toggle-ordered-list.ts +2 -2
  90. package/src/core/selection/style/api/toggle-commit-styles.ts +1 -1
  91. package/src/core/selection/style/api/unwrap-children.ts +3 -3
  92. package/src/core/selection/style/api/wrap-and-commit-style.ts +3 -3
  93. package/src/core/selection/style/api/wrap-ordered-list.ts +2 -2
  94. package/src/core/selection/style/api/wrap-unwrapped-text.ts +2 -2
  95. package/src/core/selection/style/apply-style.ts +3 -3
  96. package/src/core/selection/style/commit-style.ts +2 -2
  97. package/src/core/storage/engines/local-storage-provider.ts +1 -5
  98. package/src/core/storage/engines/memory-storage-provider.ts +1 -1
  99. package/src/core/storage/storage.ts +1 -1
  100. package/src/core/traits/elms.ts +6 -7
  101. package/src/core/traits/mods.ts +11 -14
  102. package/src/core/ui/button/button/button.ts +8 -8
  103. package/src/core/ui/button/group/group.ts +6 -3
  104. package/src/core/ui/element.ts +12 -12
  105. package/src/core/ui/form/block/block.ts +4 -4
  106. package/src/core/ui/form/form.ts +4 -5
  107. package/src/core/ui/form/inputs/area/area.ts +3 -3
  108. package/src/core/ui/form/inputs/checkbox/checkbox.ts +5 -5
  109. package/src/core/ui/form/inputs/file/file.ts +4 -4
  110. package/src/core/ui/form/inputs/input/input.ts +8 -8
  111. package/src/core/ui/form/inputs/select/select.ts +8 -5
  112. package/src/core/ui/form/validators/input.ts +2 -2
  113. package/src/core/ui/form/validators/select.ts +2 -2
  114. package/src/core/ui/group/group.ts +8 -6
  115. package/src/core/ui/group/list.less +1 -1
  116. package/src/core/ui/group/list.ts +15 -11
  117. package/src/core/ui/group/separator.ts +3 -4
  118. package/src/core/ui/group/spacer.ts +3 -3
  119. package/src/core/ui/helpers/buttons.ts +2 -2
  120. package/src/core/ui/helpers/get-control-type.ts +3 -3
  121. package/src/core/ui/helpers/get-strong-control-types.ts +4 -4
  122. package/src/core/ui/icon.ts +2 -2
  123. package/src/core/ui/popup/popup.ts +7 -7
  124. package/src/core/ui/progress-bar/progress-bar.ts +2 -2
  125. package/src/core/view/view-with-toolbar.ts +5 -5
  126. package/src/core/view/view.ts +6 -6
  127. package/src/langs/README.md +124 -1
  128. package/src/langs/index.ts +1 -1
  129. package/src/modules/context-menu/context-menu.less +1 -1
  130. package/src/modules/context-menu/context-menu.ts +4 -4
  131. package/src/modules/dialog/alert.ts +3 -3
  132. package/src/modules/dialog/confirm.ts +3 -3
  133. package/src/modules/dialog/dialog.less +5 -0
  134. package/src/modules/dialog/dialog.ts +49 -32
  135. package/src/modules/dialog/prompt.ts +3 -3
  136. package/src/modules/file-browser/builders/context-menu.ts +22 -14
  137. package/src/modules/file-browser/builders/elements-map.ts +31 -0
  138. package/src/modules/file-browser/builders/item.ts +2 -2
  139. package/src/modules/file-browser/config.ts +5 -5
  140. package/src/modules/file-browser/data-provider.ts +5 -5
  141. package/src/modules/file-browser/factories.ts +1 -1
  142. package/src/modules/file-browser/fetch/delete-file.ts +27 -0
  143. package/src/modules/file-browser/fetch/load-items.ts +32 -0
  144. package/src/modules/file-browser/fetch/load-tree.ts +49 -0
  145. package/src/modules/file-browser/file-browser.ts +59 -120
  146. package/src/modules/file-browser/listeners/native-listeners.ts +14 -14
  147. package/src/modules/file-browser/listeners/self-listeners.ts +23 -18
  148. package/src/modules/file-browser/listeners/state-listeners.ts +17 -12
  149. package/src/modules/file-browser/styles/file-browser.less +24 -18
  150. package/src/modules/file-browser/ui/files/files.less +5 -0
  151. package/src/modules/file-browser/ui/files/files.ts +1 -1
  152. package/src/modules/file-browser/ui/tree/tree.less +16 -6
  153. package/src/modules/file-browser/ui/tree/tree.ts +1 -1
  154. package/src/modules/image-editor/image-editor.ts +9 -52
  155. package/src/modules/image-editor/templates/form.ts +4 -4
  156. package/src/modules/observer/command.ts +1 -1
  157. package/src/modules/observer/observer.ts +5 -5
  158. package/src/modules/observer/snapshot.ts +3 -3
  159. package/src/modules/observer/stack.ts +1 -1
  160. package/src/modules/status-bar/status-bar.ts +7 -7
  161. package/src/modules/table/table.ts +8 -8
  162. package/src/modules/toolbar/button/button.less +1 -1
  163. package/src/modules/toolbar/button/button.ts +57 -15
  164. package/src/modules/toolbar/button/content.less +1 -1
  165. package/src/modules/toolbar/button/content.ts +5 -5
  166. package/src/modules/toolbar/collection/collection.less +1 -1
  167. package/src/modules/toolbar/collection/collection.ts +5 -31
  168. package/src/modules/toolbar/collection/editor-collection.ts +5 -9
  169. package/src/modules/toolbar/factory.ts +2 -2
  170. package/src/modules/uploader/uploader.ts +9 -9
  171. package/src/modules/widget/color-picker/color-picker.ts +4 -4
  172. package/src/modules/widget/file-selector/file-selector.ts +4 -4
  173. package/src/modules/widget/tabs/tabs.ts +3 -3
  174. package/src/plugins/about/about.ts +5 -5
  175. package/src/plugins/add-new-line/add-new-line.ts +5 -5
  176. package/src/plugins/bold/bold.ts +3 -3
  177. package/src/plugins/class-span/class-span.ts +5 -5
  178. package/src/plugins/clipboard/clipboard.ts +4 -4
  179. package/src/plugins/clipboard/config.ts +29 -5
  180. package/src/plugins/clipboard/copy-format.ts +4 -4
  181. package/src/plugins/clipboard/drag-and-drop-element.ts +6 -6
  182. package/src/plugins/clipboard/drag-and-drop.ts +7 -7
  183. package/src/plugins/clipboard/paste/CHANGELOG.md +17 -0
  184. package/src/plugins/clipboard/paste/README.md +8 -0
  185. package/src/plugins/clipboard/paste/helpers.ts +5 -5
  186. package/src/plugins/clipboard/paste/paste.ts +24 -20
  187. package/src/plugins/clipboard/paste-storage/paste-storage.ts +6 -6
  188. package/src/plugins/color/color.ts +5 -5
  189. package/src/plugins/error-messages/error-messages.ts +5 -5
  190. package/src/plugins/fix/clean-html.ts +10 -10
  191. package/src/plugins/fix/wrap-text-nodes.ts +5 -5
  192. package/src/plugins/focus/focus.ts +4 -4
  193. package/src/plugins/font/font.ts +5 -5
  194. package/src/plugins/format-block/CHANGELOG.md +16 -0
  195. package/src/plugins/format-block/README.md +40 -0
  196. package/src/plugins/format-block/format-block.ts +8 -5
  197. package/src/plugins/fullsize/fullsize.ts +5 -5
  198. package/src/plugins/iframe/iframe.ts +6 -6
  199. package/src/plugins/image/helpers.ts +1 -1
  200. package/src/plugins/image/image-processor.ts +2 -2
  201. package/src/plugins/image/image-properties/image-properties.ts +12 -9
  202. package/src/plugins/image/image-properties/templates/form.ts +1 -1
  203. package/src/plugins/image/image-properties/templates/main-tab.ts +1 -1
  204. package/src/plugins/image/image-properties/templates/position-tab.ts +1 -1
  205. package/src/plugins/image/image.ts +5 -5
  206. package/src/plugins/indent/indent.ts +6 -6
  207. package/src/plugins/inline-popup/config/config.ts +3 -3
  208. package/src/plugins/inline-popup/config/items/a.ts +1 -1
  209. package/src/plugins/inline-popup/config/items/cells.ts +1 -1
  210. package/src/plugins/inline-popup/config/items/iframe.ts +1 -1
  211. package/src/plugins/inline-popup/config/items/img.ts +1 -1
  212. package/src/plugins/inline-popup/inline-popup.ts +6 -6
  213. package/src/plugins/insert/hr.ts +3 -3
  214. package/src/plugins/justify/justify.ts +4 -4
  215. package/src/plugins/keyboard/backspace/backspace.ts +6 -6
  216. package/src/plugins/keyboard/backspace/cases/check-join-neighbors.ts +3 -3
  217. package/src/plugins/keyboard/backspace/cases/check-join-two-lists.ts +1 -1
  218. package/src/plugins/keyboard/backspace/cases/check-not-collapsed.ts +1 -1
  219. package/src/plugins/keyboard/backspace/cases/check-remove-char.ts +9 -6
  220. package/src/plugins/keyboard/backspace/cases/check-remove-content-not-editable.ts +4 -4
  221. package/src/plugins/keyboard/backspace/cases/check-remove-empty-neighbor.ts +3 -3
  222. package/src/plugins/keyboard/backspace/cases/check-remove-empty-parent.ts +5 -5
  223. package/src/plugins/keyboard/backspace/cases/check-remove-unbreakable-element.ts +1 -1
  224. package/src/plugins/keyboard/backspace/cases/check-table-cell.ts +1 -1
  225. package/src/plugins/keyboard/backspace/cases/check-unwrap-first-list-item.ts +3 -3
  226. package/src/plugins/keyboard/backspace/config.ts +2 -2
  227. package/src/plugins/keyboard/enter.ts +6 -6
  228. package/src/plugins/keyboard/helpers.ts +5 -5
  229. package/src/plugins/keyboard/hotkeys.ts +6 -6
  230. package/src/plugins/keyboard/key-arrow-outside.ts +5 -5
  231. package/src/plugins/limit/limit.ts +7 -7
  232. package/src/plugins/link/link.ts +7 -7
  233. package/src/plugins/link/template.ts +3 -3
  234. package/src/plugins/media/file.ts +4 -4
  235. package/src/plugins/media/media.ts +6 -6
  236. package/src/plugins/media/video/config.ts +6 -6
  237. package/src/plugins/media/video/index.ts +1 -1
  238. package/src/plugins/mobile/mobile.ts +9 -9
  239. package/src/plugins/ordered-list/ordered-list.ts +6 -6
  240. package/src/plugins/placeholder/placeholder.ts +9 -9
  241. package/src/plugins/powered-by-jodit/powered-by-jodit.ts +2 -2
  242. package/src/plugins/print/preview.ts +4 -4
  243. package/src/plugins/print/print.ts +6 -6
  244. package/src/plugins/redo-undo/redo-undo.ts +4 -4
  245. package/src/plugins/resizer/resizer.ts +18 -16
  246. package/src/plugins/search/search.ts +11 -11
  247. package/src/plugins/select/select.ts +6 -6
  248. package/src/plugins/size/config.ts +2 -2
  249. package/src/plugins/size/resize-handler.ts +5 -5
  250. package/src/plugins/size/size.ts +4 -4
  251. package/src/plugins/source/config.ts +5 -5
  252. package/src/plugins/source/editor/engines/ace.ts +1 -1
  253. package/src/plugins/source/editor/engines/area.ts +1 -1
  254. package/src/plugins/source/editor/engines/custom.ts +1 -1
  255. package/src/plugins/source/editor/factory.ts +2 -2
  256. package/src/plugins/source/editor/sourceEditor.ts +1 -1
  257. package/src/plugins/source/source.ts +8 -8
  258. package/src/plugins/stat/stat.ts +6 -6
  259. package/src/plugins/sticky/sticky.ts +6 -6
  260. package/src/plugins/symbols/config.ts +4 -4
  261. package/src/plugins/symbols/symbols.ts +3 -3
  262. package/src/plugins/table/config.ts +5 -5
  263. package/src/plugins/table/resize-cells.ts +4 -4
  264. package/src/plugins/table/select-cells.ts +5 -5
  265. package/src/plugins/table/table-keyboard-navigation.ts +3 -3
  266. package/src/plugins/table/table.ts +1 -1
  267. package/src/plugins/tooltip/tooltip.ts +6 -6
  268. package/src/plugins/xpath/xpath.ts +10 -10
  269. package/src/polyfills.ts +9 -1
  270. package/src/styles/form.less +1 -1
  271. package/src/styles/icons/README.md +151 -1
  272. package/src/types/file-browser.d.ts +1 -10
  273. package/src/types/jodit.d.ts +1 -1
  274. package/src/types/observer.d.ts +1 -2
  275. package/src/types/traits.d.ts +10 -5
  276. package/src/types/types.d.ts +39 -0
  277. package/src/types/ui.d.ts +8 -17
  278. package/tsconfig.json +8 -2
  279. package/types/config.d.ts +16 -0
  280. package/types/core/async/async.d.ts +1 -1
  281. package/types/core/component/component.d.ts +1 -1
  282. package/types/core/component/view-component.d.ts +1 -1
  283. package/types/core/constants.d.ts +42 -1
  284. package/types/core/create/create.d.ts +1 -1
  285. package/types/core/decorators/debounce/debounce.d.ts +1 -1
  286. package/types/core/decorators/hook/hook.d.ts +2 -2
  287. package/types/core/decorators/idle/idle.d.ts +1 -1
  288. package/types/core/decorators/persistent/persistent.d.ts +1 -1
  289. package/types/core/decorators/wait/wait.d.ts +1 -1
  290. package/types/core/decorators/watch/watch.d.ts +1 -1
  291. package/types/core/dom/dom.d.ts +1 -1
  292. package/types/core/event-emitter/event-emitter.d.ts +1 -1
  293. package/types/core/event-emitter/index.d.ts +1 -1
  294. package/types/core/event-emitter/observable.d.ts +45 -0
  295. package/types/core/event-emitter/store.d.ts +1 -1
  296. package/types/core/global.d.ts +1 -1
  297. package/types/core/helpers/checker/is-imp-interface.d.ts +1 -1
  298. package/types/core/helpers/checker/is-jodit-object.d.ts +1 -1
  299. package/types/core/helpers/checker/is-plain-object.d.ts +1 -1
  300. package/types/core/helpers/size/get-scroll-parent.d.ts +1 -1
  301. package/types/core/helpers/size/object-size.d.ts +1 -1
  302. package/types/core/helpers/size/offset.d.ts +1 -1
  303. package/types/core/helpers/size/position.d.ts +1 -1
  304. package/types/core/helpers/string/i18n.d.ts +2 -2
  305. package/types/core/helpers/utils/append-script.d.ts +1 -1
  306. package/types/core/helpers/utils/assert.d.ts +8 -0
  307. package/types/core/helpers/utils/build-query.d.ts +1 -1
  308. package/types/core/helpers/utils/config-proto.d.ts +1 -1
  309. package/types/core/helpers/utils/css.d.ts +1 -1
  310. package/types/core/helpers/utils/data-bind.d.ts +1 -1
  311. package/types/core/helpers/utils/get-class-name.d.ts +1 -1
  312. package/types/core/helpers/utils/get.d.ts +1 -1
  313. package/types/core/helpers/utils/index.d.ts +1 -0
  314. package/types/core/helpers/utils/parse-query.d.ts +1 -1
  315. package/types/core/helpers/utils/selector.d.ts +1 -1
  316. package/types/core/helpers/utils/set.d.ts +1 -1
  317. package/types/core/helpers/utils/stack.d.ts +1 -1
  318. package/types/core/helpers/utils/utils.d.ts +2 -2
  319. package/types/core/plugin/plugin-system.d.ts +3 -2
  320. package/types/core/plugin/plugin.d.ts +1 -1
  321. package/types/core/request/ajax.d.ts +1 -1
  322. package/types/core/request/config.d.ts +2 -2
  323. package/types/core/request/response.d.ts +1 -1
  324. package/types/core/selection/select.d.ts +1 -1
  325. package/types/core/selection/style/api/element-has-same-style.d.ts +1 -1
  326. package/types/core/selection/style/api/extract.d.ts +1 -1
  327. package/types/core/selection/style/api/finite-state-machine.d.ts +1 -1
  328. package/types/core/selection/style/api/get-suit-child.d.ts +1 -1
  329. package/types/core/selection/style/api/get-suit-parent.d.ts +1 -1
  330. package/types/core/selection/style/api/is-normal-node.d.ts +1 -1
  331. package/types/core/selection/style/api/is-suit-element.d.ts +2 -2
  332. package/types/core/selection/style/api/toggle/toggle-css.d.ts +2 -2
  333. package/types/core/selection/style/api/toggle/toggle-ordered-list.d.ts +1 -1
  334. package/types/core/selection/style/api/wrap-and-commit-style.d.ts +1 -1
  335. package/types/core/selection/style/api/wrap-ordered-list.d.ts +1 -1
  336. package/types/core/selection/style/api/wrap-unwrapped-text.d.ts +1 -1
  337. package/types/core/selection/style/apply-style.d.ts +1 -1
  338. package/types/core/selection/style/commit-style.d.ts +1 -1
  339. package/types/core/storage/engines/local-storage-provider.d.ts +1 -1
  340. package/types/core/storage/engines/memory-storage-provider.d.ts +1 -1
  341. package/types/core/storage/storage.d.ts +1 -1
  342. package/types/core/traits/elms.d.ts +3 -3
  343. package/types/core/traits/mods.d.ts +6 -6
  344. package/types/core/ui/button/button/button.d.ts +2 -2
  345. package/types/core/ui/button/group/group.d.ts +1 -1
  346. package/types/core/ui/element.d.ts +7 -7
  347. package/types/core/ui/form/block/block.d.ts +2 -2
  348. package/types/core/ui/form/form.d.ts +2 -2
  349. package/types/core/ui/form/inputs/area/area.d.ts +2 -2
  350. package/types/core/ui/form/inputs/checkbox/checkbox.d.ts +2 -2
  351. package/types/core/ui/form/inputs/file/file.d.ts +2 -2
  352. package/types/core/ui/form/inputs/input/input.d.ts +2 -2
  353. package/types/core/ui/form/inputs/select/select.d.ts +2 -2
  354. package/types/core/ui/form/validators/input.d.ts +1 -1
  355. package/types/core/ui/form/validators/select.d.ts +2 -2
  356. package/types/core/ui/group/group.d.ts +2 -2
  357. package/types/core/ui/group/list.d.ts +2 -2
  358. package/types/core/ui/group/separator.d.ts +1 -2
  359. package/types/core/ui/group/spacer.d.ts +1 -1
  360. package/types/core/ui/helpers/buttons.d.ts +1 -1
  361. package/types/core/ui/helpers/get-control-type.d.ts +1 -1
  362. package/types/core/ui/helpers/get-strong-control-types.d.ts +1 -1
  363. package/types/core/ui/icon.d.ts +1 -1
  364. package/types/core/ui/popup/popup.d.ts +2 -2
  365. package/types/core/ui/progress-bar/progress-bar.d.ts +1 -1
  366. package/types/core/view/view-with-toolbar.d.ts +1 -1
  367. package/types/core/view/view.d.ts +4 -4
  368. package/types/langs/index.d.ts +1 -1
  369. package/types/modules/context-menu/context-menu.d.ts +2 -2
  370. package/types/modules/dialog/confirm.d.ts +1 -1
  371. package/types/modules/dialog/dialog.d.ts +3 -3
  372. package/types/modules/dialog/prompt.d.ts +1 -1
  373. package/types/modules/file-browser/builders/context-menu.d.ts +1 -1
  374. package/types/modules/file-browser/builders/elements-map.d.ts +18 -0
  375. package/types/modules/file-browser/builders/item.d.ts +1 -1
  376. package/types/modules/file-browser/config.d.ts +2 -2
  377. package/types/modules/file-browser/data-provider.d.ts +1 -1
  378. package/types/modules/file-browser/factories.d.ts +1 -1
  379. package/types/modules/file-browser/fetch/delete-file.d.ts +13 -0
  380. package/types/modules/file-browser/fetch/load-items.d.ts +13 -0
  381. package/types/modules/file-browser/fetch/load-tree.d.ts +13 -0
  382. package/types/modules/file-browser/file-browser.d.ts +5 -12
  383. package/types/modules/file-browser/listeners/native-listeners.d.ts +1 -1
  384. package/types/modules/file-browser/listeners/self-listeners.d.ts +1 -1
  385. package/types/modules/file-browser/listeners/state-listeners.d.ts +1 -1
  386. package/types/modules/file-browser/ui/files/files.d.ts +1 -1
  387. package/types/modules/file-browser/ui/tree/tree.d.ts +1 -1
  388. package/types/modules/image-editor/image-editor.d.ts +4 -6
  389. package/types/modules/image-editor/templates/form.d.ts +1 -1
  390. package/types/modules/observer/command.d.ts +1 -1
  391. package/types/modules/observer/observer.d.ts +3 -3
  392. package/types/modules/observer/snapshot.d.ts +2 -2
  393. package/types/modules/observer/stack.d.ts +1 -1
  394. package/types/modules/status-bar/status-bar.d.ts +5 -5
  395. package/types/modules/table/table.d.ts +3 -3
  396. package/types/modules/toolbar/button/button.d.ts +13 -5
  397. package/types/modules/toolbar/button/content.d.ts +2 -2
  398. package/types/modules/toolbar/collection/collection.d.ts +3 -3
  399. package/types/modules/toolbar/collection/editor-collection.d.ts +1 -1
  400. package/types/modules/toolbar/factory.d.ts +1 -1
  401. package/types/modules/uploader/uploader.d.ts +3 -3
  402. package/types/modules/widget/color-picker/color-picker.d.ts +1 -1
  403. package/types/modules/widget/file-selector/file-selector.d.ts +1 -1
  404. package/types/modules/widget/tabs/tabs.d.ts +2 -2
  405. package/types/plugins/about/about.d.ts +1 -1
  406. package/types/plugins/add-new-line/add-new-line.d.ts +3 -3
  407. package/types/plugins/bold/bold.d.ts +1 -1
  408. package/types/plugins/class-span/class-span.d.ts +2 -2
  409. package/types/plugins/clipboard/clipboard.d.ts +2 -2
  410. package/types/plugins/clipboard/config.d.ts +22 -2
  411. package/types/plugins/clipboard/copy-format.d.ts +1 -1
  412. package/types/plugins/clipboard/drag-and-drop-element.d.ts +1 -1
  413. package/types/plugins/clipboard/drag-and-drop.d.ts +1 -1
  414. package/types/plugins/clipboard/paste/helpers.d.ts +2 -2
  415. package/types/plugins/clipboard/paste/paste.d.ts +6 -10
  416. package/types/plugins/clipboard/paste-storage/paste-storage.d.ts +1 -1
  417. package/types/plugins/color/color.d.ts +1 -1
  418. package/types/plugins/error-messages/error-messages.d.ts +2 -2
  419. package/types/plugins/fix/clean-html.d.ts +3 -3
  420. package/types/plugins/fix/wrap-text-nodes.d.ts +2 -2
  421. package/types/plugins/focus/focus.d.ts +2 -2
  422. package/types/plugins/font/font.d.ts +2 -2
  423. package/types/plugins/format-block/format-block.d.ts +3 -1
  424. package/types/plugins/fullsize/fullsize.d.ts +2 -2
  425. package/types/plugins/iframe/iframe.d.ts +2 -2
  426. package/types/plugins/image/image-processor.d.ts +1 -1
  427. package/types/plugins/image/image-properties/image-properties.d.ts +2 -2
  428. package/types/plugins/image/image-properties/templates/form.d.ts +1 -1
  429. package/types/plugins/image/image-properties/templates/main-tab.d.ts +1 -1
  430. package/types/plugins/image/image-properties/templates/position-tab.d.ts +1 -1
  431. package/types/plugins/image/image.d.ts +1 -1
  432. package/types/plugins/indent/indent.d.ts +2 -2
  433. package/types/plugins/inline-popup/config/config.d.ts +2 -2
  434. package/types/plugins/inline-popup/inline-popup.d.ts +2 -2
  435. package/types/plugins/insert/hr.d.ts +1 -1
  436. package/types/plugins/justify/justify.d.ts +1 -1
  437. package/types/plugins/keyboard/backspace/backspace.d.ts +2 -2
  438. package/types/plugins/keyboard/backspace/cases/check-join-neighbors.d.ts +1 -1
  439. package/types/plugins/keyboard/backspace/cases/check-join-two-lists.d.ts +1 -1
  440. package/types/plugins/keyboard/backspace/cases/check-not-collapsed.d.ts +1 -1
  441. package/types/plugins/keyboard/backspace/cases/check-remove-char.d.ts +2 -2
  442. package/types/plugins/keyboard/backspace/cases/check-remove-content-not-editable.d.ts +1 -1
  443. package/types/plugins/keyboard/backspace/cases/check-remove-empty-neighbor.d.ts +1 -1
  444. package/types/plugins/keyboard/backspace/cases/check-remove-empty-parent.d.ts +1 -1
  445. package/types/plugins/keyboard/backspace/cases/check-remove-unbreakable-element.d.ts +1 -1
  446. package/types/plugins/keyboard/backspace/cases/check-table-cell.d.ts +1 -1
  447. package/types/plugins/keyboard/backspace/cases/check-unwrap-first-list-item.d.ts +1 -1
  448. package/types/plugins/keyboard/backspace/config.d.ts +1 -1
  449. package/types/plugins/keyboard/enter.d.ts +2 -2
  450. package/types/plugins/keyboard/helpers.d.ts +1 -1
  451. package/types/plugins/keyboard/hotkeys.d.ts +3 -3
  452. package/types/plugins/keyboard/key-arrow-outside.d.ts +2 -2
  453. package/types/plugins/limit/limit.d.ts +3 -3
  454. package/types/plugins/link/link.d.ts +3 -3
  455. package/types/plugins/link/template.d.ts +1 -1
  456. package/types/plugins/media/file.d.ts +1 -1
  457. package/types/plugins/media/media.d.ts +2 -2
  458. package/types/plugins/media/video/index.d.ts +1 -1
  459. package/types/plugins/mobile/mobile.d.ts +2 -2
  460. package/types/plugins/ordered-list/ordered-list.d.ts +2 -2
  461. package/types/plugins/placeholder/placeholder.d.ts +3 -3
  462. package/types/plugins/powered-by-jodit/powered-by-jodit.d.ts +2 -2
  463. package/types/plugins/print/preview.d.ts +1 -1
  464. package/types/plugins/print/print.d.ts +1 -1
  465. package/types/plugins/redo-undo/redo-undo.d.ts +2 -2
  466. package/types/plugins/resizer/resizer.d.ts +4 -4
  467. package/types/plugins/search/search.d.ts +3 -3
  468. package/types/plugins/select/select.d.ts +2 -2
  469. package/types/plugins/size/config.d.ts +1 -1
  470. package/types/plugins/size/resize-handler.d.ts +2 -2
  471. package/types/plugins/size/size.d.ts +2 -2
  472. package/types/plugins/source/config.d.ts +2 -2
  473. package/types/plugins/source/editor/engines/ace.d.ts +1 -1
  474. package/types/plugins/source/editor/engines/area.d.ts +1 -1
  475. package/types/plugins/source/editor/factory.d.ts +1 -1
  476. package/types/plugins/source/editor/sourceEditor.d.ts +1 -1
  477. package/types/plugins/source/source.d.ts +2 -2
  478. package/types/plugins/stat/stat.d.ts +2 -2
  479. package/types/plugins/sticky/sticky.d.ts +2 -2
  480. package/types/plugins/symbols/config.d.ts +1 -1
  481. package/types/plugins/symbols/symbols.d.ts +1 -1
  482. package/types/plugins/table/resize-cells.d.ts +1 -1
  483. package/types/plugins/table/select-cells.d.ts +2 -2
  484. package/types/plugins/table/table-keyboard-navigation.d.ts +1 -1
  485. package/types/plugins/table/table.d.ts +1 -1
  486. package/types/plugins/tooltip/tooltip.d.ts +2 -2
  487. package/types/plugins/xpath/xpath.d.ts +3 -3
  488. package/types/types/{types/ajax.d.ts → ajax.d.ts} +0 -0
  489. package/types/types/{types/async.d.ts → async.d.ts} +0 -0
  490. package/types/types/{types/context.d.ts → context.d.ts} +0 -0
  491. package/types/types/{types/core.ts → core.ts} +0 -0
  492. package/types/types/{types/create.d.ts → create.d.ts} +0 -0
  493. package/types/types/{types/dialog.d.ts → dialog.d.ts} +0 -0
  494. package/types/types/{types/events.d.ts → events.d.ts} +0 -0
  495. package/types/types/{types/file-browser.d.ts → file-browser.d.ts} +1 -10
  496. package/types/types/{types/form.d.ts → form.d.ts} +0 -0
  497. package/types/types/{types/index.d.ts → index.d.ts} +0 -0
  498. package/types/types/{types/jodit.d.ts → jodit.d.ts} +1 -1
  499. package/types/types/{types/observer.d.ts → observer.d.ts} +1 -2
  500. package/types/types/{types/plugin.d.ts → plugin.d.ts} +0 -0
  501. package/types/types/{types/popup.d.ts → popup.d.ts} +0 -0
  502. package/types/types/{types/select.d.ts → select.d.ts} +0 -0
  503. package/types/types/{types/source.d.ts → source.d.ts} +0 -0
  504. package/types/types/{types/storage.ts → storage.ts} +0 -0
  505. package/types/types/{types/style.d.ts → style.d.ts} +0 -0
  506. package/types/types/{types/toolbar.d.ts → toolbar.d.ts} +0 -0
  507. package/types/types/{types/traits.d.ts → traits.d.ts} +10 -5
  508. package/types/types/{types/types.d.ts → types.d.ts} +39 -0
  509. package/types/types/{types/ui.d.ts → ui.d.ts} +8 -17
  510. package/types/types/{types/uploader.d.ts → uploader.d.ts} +0 -0
  511. package/types/types/{types/view.d.ts → view.d.ts} +0 -0
  512. package/src/core/event-emitter/observe-object.ts +0 -157
  513. package/types/core/event-emitter/observe-object.d.ts +0 -24
@@ -17,8 +17,9 @@ import type {
17
17
  PluginInstance,
18
18
  PluginType,
19
19
  CanPromise,
20
- CanUndef
21
- } from '../../types';
20
+ CanUndef,
21
+ Nullable
22
+ } from 'jodit/types';
22
23
 
23
24
  import {
24
25
  isInitable,
@@ -31,7 +32,7 @@ import {
31
32
  kebabCase,
32
33
  callPromise,
33
34
  isArray
34
- } from '../helpers';
35
+ } from 'jodit/core/helpers';
35
36
 
36
37
  /**
37
38
  * Jodit plugin system
@@ -50,27 +51,37 @@ export class PluginSystem implements IPluginSystem {
50
51
  return kebabCase(name).toLowerCase();
51
52
  }
52
53
 
53
- private items = new Map<string, PluginType>();
54
+ private _items = new Map<string, PluginType>();
55
+
56
+ private items(filter: Nullable<string[]>): Array<[string, PluginType]> {
57
+ const results: Array<[string, PluginType]> = [];
58
+
59
+ this._items.forEach((plugin, name) => {
60
+ results.push([name, plugin]);
61
+ });
62
+
63
+ return results.filter(([name]) => !filter || filter.includes(name));
64
+ }
54
65
 
55
66
  /**
56
67
  * Add plugin in store
57
68
  */
58
69
  add(name: string, plugin: PluginType): void {
59
- this.items.set(this.normalizeName(name), plugin);
70
+ this._items.set(this.normalizeName(name), plugin);
60
71
  }
61
72
 
62
73
  /**
63
74
  * Get plugin from store
64
75
  */
65
76
  get(name: string): PluginType | void {
66
- return this.items.get(this.normalizeName(name));
77
+ return this._items.get(this.normalizeName(name));
67
78
  }
68
79
 
69
80
  /**
70
81
  * Remove plugin from store
71
82
  */
72
83
  remove(name: string): void {
73
- this.items.delete(this.normalizeName(name));
84
+ this._items.delete(this.normalizeName(name));
74
85
  }
75
86
 
76
87
  /**
@@ -87,7 +98,7 @@ export class PluginSystem implements IPluginSystem {
87
98
  promiseList: IDictionary<PluginInstance | undefined> = {},
88
99
  plugins: PluginInstance[] = [],
89
100
  pluginsMap: IDictionary<PluginInstance> = {},
90
- makeAndInit = (plugin: PluginType, name: string) => {
101
+ makeAndInit = ([name, plugin]: [string, PluginType]) => {
91
102
  if (
92
103
  disableList.includes(name) ||
93
104
  doneList.includes(name) ||
@@ -110,10 +121,18 @@ export class PluginSystem implements IPluginSystem {
110
121
 
111
122
  const instance = PluginSystem.makePluginInstance(jodit, plugin);
112
123
 
113
- this.initOrWait(jodit, name, instance, doneList, promiseList);
114
-
115
- plugins.push(instance);
116
- pluginsMap[name] = instance;
124
+ if (instance) {
125
+ this.initOrWait(
126
+ jodit,
127
+ name,
128
+ instance,
129
+ doneList,
130
+ promiseList
131
+ );
132
+
133
+ plugins.push(instance);
134
+ pluginsMap[name] = instance;
135
+ }
117
136
  };
118
137
 
119
138
  const resultLoadExtras = this.loadExtras(jodit, extrasList);
@@ -123,7 +142,13 @@ export class PluginSystem implements IPluginSystem {
123
142
  return;
124
143
  }
125
144
 
126
- this.items.forEach(makeAndInit);
145
+ this.items(
146
+ jodit.o.safeMode
147
+ ? jodit.o.safePluginsList.concat(
148
+ extrasList.map(s => s.name)
149
+ )
150
+ : null
151
+ ).forEach(makeAndInit);
127
152
 
128
153
  this.addListenerOnBeforeDestruct(jodit, plugins);
129
154
 
@@ -150,8 +175,17 @@ export class PluginSystem implements IPluginSystem {
150
175
  static makePluginInstance(
151
176
  jodit: IJodit,
152
177
  plugin: PluginType
153
- ): PluginInstance {
154
- return isFunction(plugin) ? new plugin(jodit) : plugin;
178
+ ): Nullable<PluginInstance> {
179
+ try {
180
+ return isFunction(plugin) ? new plugin(jodit) : plugin;
181
+ } catch (e) {
182
+ console.error(e);
183
+ if (!isProd) {
184
+ throw e;
185
+ }
186
+ }
187
+
188
+ return null;
155
189
  }
156
190
 
157
191
  /**
@@ -172,7 +206,14 @@ export class PluginSystem implements IPluginSystem {
172
206
  !req?.length ||
173
207
  req.every(name => doneList.includes(name))
174
208
  ) {
175
- plugin.init(jodit);
209
+ try {
210
+ plugin.init(jodit);
211
+ } catch (e) {
212
+ console.error(e);
213
+ if (!isProd) {
214
+ throw e;
215
+ }
216
+ }
176
217
  doneList.push(name);
177
218
  } else {
178
219
  promiseList[name] = plugin;
@@ -291,7 +332,7 @@ export class PluginSystem implements IPluginSystem {
291
332
  if (extrasList && extrasList.length) {
292
333
  try {
293
334
  const needLoadExtras = extrasList.filter(
294
- extra => !this.items.has(this.normalizeName(extra.name))
335
+ extra => !this._items.has(this.normalizeName(extra.name))
295
336
  );
296
337
 
297
338
  if (needLoadExtras.length) {
@@ -10,10 +10,10 @@
10
10
  * @module plugin
11
11
  */
12
12
 
13
- import type { IJodit, IPlugin, IViewBased } from '../../types';
13
+ import type { IJodit, IPlugin, IViewBased } from 'jodit/types';
14
14
  import { ViewComponent, STATUSES } from '../component';
15
- import { autobind } from '../decorators';
16
- import { isJoditObject } from '../helpers';
15
+ import { autobind } from 'jodit/core/decorators';
16
+ import { isJoditObject } from 'jodit/core/helpers';
17
17
 
18
18
  export abstract class Plugin<T extends IViewBased = IJodit>
19
19
  extends ViewComponent<T>
@@ -18,9 +18,9 @@ import type {
18
18
  IAjax,
19
19
  RejectablePromise,
20
20
  IResponse
21
- } from '../../types';
21
+ } from 'jodit/types';
22
22
 
23
- import { Config } from '../../config';
23
+ import { Config } from 'jodit/config';
24
24
 
25
25
  import {
26
26
  error,
@@ -30,7 +30,7 @@ import {
30
30
  isString,
31
31
  isFunction,
32
32
  ConfigProto
33
- } from '../helpers';
33
+ } from 'jodit/core/helpers';
34
34
  import { Response } from './response';
35
35
 
36
36
  import './config';
@@ -8,10 +8,10 @@
8
8
  * @module request
9
9
  */
10
10
 
11
- import type { AjaxOptions } from '../../types';
12
- import { Config } from '../../config';
11
+ import type { AjaxOptions } from 'jodit/types';
12
+ import { Config } from 'jodit/config';
13
13
 
14
- declare module '../../config' {
14
+ declare module 'jodit/config' {
15
15
  interface Config {
16
16
  /**
17
17
  * A set of key/value pairs that configure the Ajax request. All settings are optional
@@ -8,7 +8,7 @@
8
8
  * @module request
9
9
  */
10
10
 
11
- import type { IRequest, IResponse } from '../../types';
11
+ import type { IRequest, IResponse } from 'jodit/types';
12
12
 
13
13
  export class Response<T> implements IResponse<T> {
14
14
  readonly status: number;
@@ -19,17 +19,17 @@ import type {
19
19
  IStyle,
20
20
  MarkerInfo,
21
21
  Nullable
22
- } from '../../types';
22
+ } from 'jodit/types';
23
23
 
24
- import * as consts from '../constants';
24
+ import * as consts from 'jodit/core/constants';
25
25
 
26
26
  import {
27
27
  INSEPARABLE_TAGS,
28
28
  INVISIBLE_SPACE,
29
29
  INVISIBLE_SPACE_REG_EXP_END as INV_END,
30
30
  INVISIBLE_SPACE_REG_EXP_START as INV_START
31
- } from '../constants';
32
- import { Dom } from '../dom';
31
+ } from 'jodit/core/constants';
32
+ import { Dom } from 'jodit/core/dom';
33
33
 
34
34
  import {
35
35
  attr,
@@ -41,9 +41,9 @@ import {
41
41
  call,
42
42
  toArray,
43
43
  getScrollParent
44
- } from '../helpers';
44
+ } from 'jodit/core/helpers';
45
45
  import { CommitStyle } from './style/commit-style';
46
- import { autobind } from '../decorators';
46
+ import { autobind } from 'jodit/core/decorators';
47
47
 
48
48
  export class Select implements ISelect {
49
49
  constructor(readonly jodit: IJodit) {
@@ -4,9 +4,9 @@
4
4
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
 
7
- import type { IStyle } from '../../../../types';
8
- import { css, isVoid, normalizeCssValue } from '../../../helpers';
9
- import { Dom } from '../../../dom';
7
+ import type { IStyle } from 'jodit/types';
8
+ import { css, isVoid, normalizeCssValue } from 'jodit/core/helpers';
9
+ import { Dom } from 'jodit/core/dom';
10
10
 
11
11
  /**
12
12
  * Element has the same styles as in the commit
@@ -4,10 +4,10 @@
4
4
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
 
7
- import type { IJodit } from '../../../../types';
7
+ import type { IJodit } from 'jodit/types';
8
8
  import { Select } from '../../select';
9
- import { call, trim } from '../../../helpers';
10
- import { Dom } from '../../../dom';
9
+ import { call, trim } from 'jodit/core/helpers';
10
+ import { Dom } from 'jodit/core/dom';
11
11
 
12
12
  /**
13
13
  * If the selection area is inside an element that matches the commit (suitable relative),
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
 
7
- import type { CanUndef, IDictionary } from '../../../../types';
7
+ import type { CanUndef, IDictionary } from 'jodit/types';
8
8
 
9
9
  /**
10
10
  * A state machine implementation for applying styles.
@@ -4,9 +4,9 @@
4
4
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
 
7
- import type { Nullable } from '../../../../types';
7
+ import type { Nullable } from 'jodit/types';
8
8
  import type { CommitStyle } from '../commit-style';
9
- import { Dom } from '../../../dom';
9
+ import { Dom } from 'jodit/core/dom';
10
10
  import { isNormalNode } from './is-normal-node';
11
11
  import { isSuitElement } from './is-suit-element';
12
12
 
@@ -4,9 +4,9 @@
4
4
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
 
7
- import type { Nullable } from '../../../../types';
7
+ import type { Nullable } from 'jodit/types';
8
8
  import type { CommitStyle } from '../commit-style';
9
- import { Dom } from '../../../dom';
9
+ import { Dom } from 'jodit/core/dom';
10
10
  import { isNormalNode } from './is-normal-node';
11
11
  import { isSuitElement } from './is-suit-element';
12
12
 
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
 
7
- import { Dom } from '../../../dom';
7
+ import { Dom } from 'jodit/core/dom';
8
8
 
9
9
  /**
10
10
  * Check if FONT inside STYLE or SCRIPT element
@@ -4,8 +4,8 @@
4
4
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
 
7
- import type { Nullable } from '../../../../types';
8
- import { Dom } from '../../../dom';
7
+ import type { Nullable } from 'jodit/types';
8
+ import { Dom } from 'jodit/core/dom';
9
9
 
10
10
  /**
11
11
  * Is normal usual element
@@ -3,14 +3,14 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- import type { Nullable } from '../../../../types';
6
+ import type { Nullable } from 'jodit/types';
7
7
  import type { CommitStyle } from '../commit-style';
8
8
  import { isNormalNode } from './is-normal-node';
9
9
  import {
10
10
  elementHasSameStyle,
11
11
  elementHasSameStyleKeys
12
12
  } from './element-has-same-style';
13
- import { Dom } from '../../../dom';
13
+ import { Dom } from 'jodit/core/dom';
14
14
 
15
15
  /**
16
16
  * Checks if an item is suitable for applying a commit. The element suits us if it
@@ -54,7 +54,7 @@ export function isSuitElement(
54
54
  }
55
55
 
56
56
  /**
57
- * Внутри родительского элемента есть блок с теми же стилями
57
+ * Inside the parent element there is a block with the same styles
58
58
  * @example
59
59
  * For selection:
60
60
  * ```html
@@ -4,8 +4,8 @@
4
4
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
 
7
- import type { CommitMode, IJodit } from '../../../../../types';
8
- import type { CommitStyle } from '../../commit-style';
7
+ import type { CommitMode, IJodit } from 'jodit/types';
8
+ import type { CommitStyle } from 'jodit/core/selection/style/commit-style';
9
9
  import {
10
10
  attr,
11
11
  css,
@@ -13,10 +13,10 @@ import {
13
13
  kebabCase,
14
14
  normalizeCssValue,
15
15
  size
16
- } from '../../../../helpers';
17
- import { Dom } from '../../../../dom';
18
- import { CHANGE, UNSET, UNWRAP } from '../../commit-style';
19
- import { getContainer } from '../../../../global';
16
+ } from 'jodit/core/helpers';
17
+ import { Dom } from 'jodit/core/dom';
18
+ import { CHANGE, UNSET, UNWRAP } from 'jodit/core/selection/style/commit-style';
19
+ import { getContainer } from 'jodit/core/global';
20
20
 
21
21
  /**
22
22
  * Toggles css and classname
@@ -4,9 +4,9 @@
4
4
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
 
7
- import type { IJodit, CommitMode } from '../../../../../types';
7
+ import type { IJodit, CommitMode } from 'jodit/types';
8
8
  import type { CommitStyle } from '../../commit-style';
9
- import { Dom } from '../../../../dom';
9
+ import { Dom } from 'jodit/core/dom';
10
10
  import { extractSelectedPart } from '../extract';
11
11
  import { CHANGE, INITIAL, REPLACE } from '../../commit-style';
12
12
  import { toggleCSS } from './toggle-css';
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import type { CommitStyle } from '../commit-style';
8
- import { Dom } from '../../../dom';
8
+ import { Dom } from 'jodit/core/dom';
9
9
 
10
10
  /**
11
11
  * Add or remove styles to element
@@ -5,10 +5,10 @@
5
5
  */
6
6
 
7
7
  import type { CommitStyle } from '../commit-style';
8
- import { Dom } from '../../../dom';
8
+ import type { IDictionary } from 'jodit/types';
9
+ import { Dom } from 'jodit/core/dom';
9
10
  import { isSameStyleChild, isSuitElement } from './is-suit-element';
10
- import { attr, css } from '../../../helpers';
11
- import type { IDictionary } from '../../../../types';
11
+ import { attr, css } from 'jodit/core/helpers';
12
12
 
13
13
  /**
14
14
  * Unwrap all suit elements inside
@@ -4,11 +4,11 @@
4
4
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
 
7
- import type { IJodit } from '../../../../types';
7
+ import type { IJodit } from 'jodit/types';
8
8
  import type { CommitStyle } from '../commit-style';
9
- import { Dom } from '../../../dom';
9
+ import { Dom } from 'jodit/core/dom';
10
10
  import { wrapUnwrappedText } from './wrap-unwrapped-text';
11
- import { attr } from '../../../helpers';
11
+ import { attr } from 'jodit/core/helpers';
12
12
  import { wrapOrderedList } from './wrap-ordered-list';
13
13
 
14
14
  /**
@@ -4,8 +4,8 @@
4
4
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
 
7
- import type { IJodit } from '../../../../types';
8
- import { Dom } from '../../../dom';
7
+ import type { IJodit } from 'jodit/types';
8
+ import { Dom } from 'jodit/core/dom';
9
9
  import type { CommitStyle } from '../commit-style';
10
10
 
11
11
  /**
@@ -4,9 +4,9 @@
4
4
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
 
7
- import type { IJodit, Nullable } from '../../../../types';
7
+ import type { IJodit, Nullable } from 'jodit/types';
8
8
  import type { CommitStyle } from '../commit-style';
9
- import { Dom } from '../../../dom';
9
+ import { Dom } from 'jodit/core/dom';
10
10
 
11
11
  /**
12
12
  * Wrap text or inline elements inside Block element
@@ -8,9 +8,9 @@
8
8
  * @module selection
9
9
  */
10
10
 
11
- import type { IJodit, Nullable, CanUndef, CommitMode } from '../../../types';
11
+ import type { IJodit, Nullable, CanUndef, CommitMode } from 'jodit/types';
12
12
  import type { CommitStyle } from './commit-style';
13
- import { normalizeNode } from '../../helpers';
13
+ import { normalizeNode } from 'jodit/core/helpers';
14
14
  import {
15
15
  getSuitParent,
16
16
  getSuitChild,
@@ -19,7 +19,7 @@ import {
19
19
  unwrapChildren
20
20
  } from './api';
21
21
  import { CHANGE, INITIAL, REPLACE, UNWRAP, WRAP } from './commit-style';
22
- import { Dom } from '../../dom';
22
+ import { Dom } from 'jodit/core/dom';
23
23
  import {
24
24
  toggleOrderedList,
25
25
  wrapAndCommitStyle,
@@ -8,8 +8,8 @@
8
8
  * @module selection
9
9
  */
10
10
 
11
- import type { HTMLTagNames, IJodit, IStyleOptions } from '../../../types';
12
- import { IS_BLOCK } from '../../constants';
11
+ import type { HTMLTagNames, IJodit, IStyleOptions } from 'jodit/types';
12
+ import { IS_BLOCK } from 'jodit/core/constants';
13
13
  import { ApplyStyle } from './apply-style';
14
14
 
15
15
  export const WRAP = 'wrap';
@@ -8,11 +8,7 @@
8
8
  * @module storage/local
9
9
  */
10
10
 
11
- import type {
12
- BooleanFunction,
13
- IStorage,
14
- StorageValueType
15
- } from '../../../types';
11
+ import type { BooleanFunction, IStorage, StorageValueType } from 'jodit/types';
16
12
 
17
13
  /**
18
14
  * Check if user disable local storages/cookie etc.
@@ -8,7 +8,7 @@
8
8
  * @module storage/memory
9
9
  */
10
10
 
11
- import type { IStorage, StorageValueType } from '../../../types';
11
+ import type { IStorage, StorageValueType } from 'jodit/types';
12
12
 
13
13
  export class MemoryStorageProvider<T = StorageValueType>
14
14
  implements IStorage<T>
@@ -10,7 +10,7 @@
10
10
  * @module storage
11
11
  */
12
12
 
13
- import type { IStorage, StorageValueType } from '../../types';
13
+ import type { IStorage, StorageValueType } from 'jodit/types';
14
14
  import { camelCase } from '../helpers/';
15
15
  import {
16
16
  canUsePersistentStorage,
@@ -8,11 +8,11 @@
8
8
  * @module traits
9
9
  */
10
10
 
11
- import type { IComponent, IContainer, IElms } from '../../types';
12
- import { toArray } from '../helpers/array/to-array';
11
+ import type { IComponent, IContainer, IElms, Nullable } from 'jodit/types';
12
+ import { toArray } from 'jodit/core/helpers/array/to-array';
13
13
 
14
14
  export abstract class Elms implements IElms {
15
- abstract getElm(elementName: string): HTMLElement;
15
+ abstract getElm(elementName: string): Nullable<HTMLElement>;
16
16
 
17
17
  abstract getElms(elementName: string): HTMLElement[];
18
18
 
@@ -22,11 +22,10 @@ export abstract class Elms implements IElms {
22
22
  static getElm(
23
23
  this: IComponent & IContainer,
24
24
  elementName: string
25
- ): HTMLElement {
26
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
27
- return this.container.querySelector<HTMLElement>(
25
+ ): Nullable<HTMLElement> {
26
+ return this.container.querySelector(
28
27
  `.${this.getFullElName(elementName)}`
29
- )!;
28
+ ) as Nullable<HTMLElement>;
30
29
  }
31
30
 
32
31
  /**
@@ -8,27 +8,27 @@
8
8
  * @module traits
9
9
  */
10
10
 
11
- import type { IComponent, IContainer, IDictionary, IMods } from '../../types';
12
- import { toArray } from '../helpers/array/to-array';
11
+ import type { IComponent, IContainer, IMods, ModType } from 'jodit/types';
12
+ import { toArray } from 'jodit/core/helpers/array/to-array';
13
+ import { isVoid } from 'jodit/core/helpers/checker/is-void';
13
14
 
14
15
  export abstract class Mods implements IMods {
15
- abstract mods: IDictionary<string | boolean | null>;
16
+ abstract mods: IMods['mods'];
16
17
  abstract componentName: string;
17
18
  abstract container: HTMLElement;
18
19
 
19
- abstract setMod(name: string, value: string | boolean | null): this;
20
-
21
- abstract getMod(name: string): string | boolean | null;
20
+ abstract setMod(name: string, value: ModType): this;
21
+ abstract getMod(name: string): ModType;
22
22
 
23
23
  /**
24
24
  * Set/remove BEM class modification
25
25
  *
26
26
  * @param value - if null, mod will be removed
27
27
  */
28
- static setMod(
29
- this: IComponent & IContainer & Mods,
28
+ static setMod<T extends IComponent & IContainer & Mods>(
29
+ this: T,
30
30
  name: string,
31
- value: string | boolean | null,
31
+ value: ModType,
32
32
  container?: HTMLElement
33
33
  ): void {
34
34
  name = name.toLowerCase();
@@ -46,7 +46,7 @@ export abstract class Mods implements IMods {
46
46
  }
47
47
  });
48
48
 
49
- value != null &&
49
+ !isVoid(value) &&
50
50
  value !== '' &&
51
51
  cl.add(`${mod}_${value.toString().toLowerCase()}`);
52
52
 
@@ -56,10 +56,7 @@ export abstract class Mods implements IMods {
56
56
  /**
57
57
  * Get BEM class modification value
58
58
  */
59
- static getMod(
60
- this: IComponent & IContainer & Mods,
61
- name: string
62
- ): string | boolean | null {
59
+ static getMod(this: IComponent & IContainer & Mods, name: string): ModType {
63
60
  return this.mods[name] ?? null;
64
61
  }
65
62
  }
@@ -16,14 +16,14 @@ import type {
16
16
  IUIButtonStatePartial,
17
17
  IViewBased,
18
18
  ButtonVariant
19
- } from '../../../../types';
20
- import { UIElement } from '../../element';
21
- import { Dom } from '../../../dom';
22
- import { attr, isString, isFunction } from '../../../helpers';
23
- import { Icon } from '../../icon';
24
- import { UIList } from '../../group';
25
- import { autobind, component, watch } from '../../../decorators';
26
- import { STATUSES } from '../../../component';
19
+ } from 'jodit/types';
20
+ import { UIElement } from 'jodit/core/ui';
21
+ import { Dom } from 'jodit/core/dom';
22
+ import { attr, isString, isFunction } from 'jodit/core/helpers';
23
+ import { Icon } from 'jodit/core/ui';
24
+ import { UIList } from 'jodit/core/ui';
25
+ import { autobind, component, watch } from 'jodit/core/decorators';
26
+ import { STATUSES } from 'jodit/core/component';
27
27
 
28
28
  export const UIButtonState = (): IUIButtonState => ({
29
29
  size: 'middle',