jodit-pro 4.1.13 → 4.1.21

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 (308) hide show
  1. package/es2015/jodit.css +87 -31
  2. package/es2015/jodit.fat.min.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +1378 -546
  5. package/es2015/jodit.min.css +1 -1
  6. package/es2015/jodit.min.js +2 -2
  7. package/es2015/plugins/autocomplete/autocomplete.js +1 -1
  8. package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
  9. package/es2015/plugins/backup/backup.css +1 -1
  10. package/es2015/plugins/backup/backup.js +1 -1
  11. package/es2015/plugins/backup/backup.min.js +1 -1
  12. package/es2015/plugins/button-generator/button-generator.css +1 -1
  13. package/es2015/plugins/button-generator/button-generator.js +1 -1
  14. package/es2015/plugins/button-generator/button-generator.min.js +1 -1
  15. package/es2015/plugins/change-case/change-case.js +1 -1
  16. package/es2015/plugins/change-case/change-case.min.js +1 -1
  17. package/es2015/plugins/color-picker/color-picker.css +1 -1
  18. package/es2015/plugins/color-picker/color-picker.js +1 -1
  19. package/es2015/plugins/color-picker/color-picker.min.js +1 -1
  20. package/es2015/plugins/emoji/emoji.css +1 -1
  21. package/es2015/plugins/emoji/emoji.js +1 -1
  22. package/es2015/plugins/emoji/emoji.min.js +1 -1
  23. package/es2015/plugins/export-docs/export-docs.js +1 -1
  24. package/es2015/plugins/export-docs/export-docs.min.js +1 -1
  25. package/es2015/plugins/finder/finder.css +6 -7
  26. package/es2015/plugins/finder/finder.js +1 -1
  27. package/es2015/plugins/finder/finder.min.css +1 -1
  28. package/es2015/plugins/finder/finder.min.js +1 -1
  29. package/es2015/plugins/google-maps/google-maps.css +1 -1
  30. package/es2015/plugins/google-maps/google-maps.js +1 -1
  31. package/es2015/plugins/google-maps/google-maps.min.js +1 -1
  32. package/es2015/plugins/google-search/google-search.js +1 -1
  33. package/es2015/plugins/google-search/google-search.min.js +1 -1
  34. package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
  35. package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
  36. package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
  37. package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
  38. package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
  39. package/es2015/plugins/keyboard/keyboard.css +1 -1
  40. package/es2015/plugins/keyboard/keyboard.js +1 -1
  41. package/es2015/plugins/keyboard/keyboard.min.js +1 -1
  42. package/es2015/plugins/mobile-view/mobile-view.js +1 -1
  43. package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
  44. package/es2015/plugins/page-break/page-break.js +1 -1
  45. package/es2015/plugins/page-break/page-break.min.js +1 -1
  46. package/es2015/plugins/paste-code/paste-code.css +1 -1
  47. package/es2015/plugins/paste-code/paste-code.js +1 -1
  48. package/es2015/plugins/paste-code/paste-code.min.js +1 -1
  49. package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
  50. package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
  51. package/es2015/plugins/show-blocks/show-blocks.js +1 -1
  52. package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
  53. package/es2015/plugins/todo-list/todo-list.css +1 -1
  54. package/es2015/plugins/todo-list/todo-list.js +1 -1
  55. package/es2015/plugins/todo-list/todo-list.min.js +1 -1
  56. package/es2015/plugins/translate/translate.css +1 -1
  57. package/es2015/plugins/translate/translate.js +1 -1
  58. package/es2015/plugins/translate/translate.min.js +1 -1
  59. package/es2015/plugins/tune-block/tune-block.css +1 -1
  60. package/es2015/plugins/tune-block/tune-block.js +1 -1
  61. package/es2015/plugins/tune-block/tune-block.min.js +1 -1
  62. package/es2018/jodit.css +87 -31
  63. package/es2018/jodit.fat.min.css +1 -1
  64. package/es2018/jodit.fat.min.js +2 -2
  65. package/es2018/jodit.js +1364 -546
  66. package/es2018/jodit.min.css +1 -1
  67. package/es2018/jodit.min.js +2 -2
  68. package/es2018/plugins/autocomplete/autocomplete.js +1 -1
  69. package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
  70. package/es2018/plugins/backup/backup.css +1 -1
  71. package/es2018/plugins/backup/backup.js +1 -1
  72. package/es2018/plugins/backup/backup.min.js +1 -1
  73. package/es2018/plugins/button-generator/button-generator.css +1 -1
  74. package/es2018/plugins/button-generator/button-generator.js +1 -1
  75. package/es2018/plugins/button-generator/button-generator.min.js +1 -1
  76. package/es2018/plugins/change-case/change-case.js +1 -1
  77. package/es2018/plugins/change-case/change-case.min.js +1 -1
  78. package/es2018/plugins/color-picker/color-picker.css +1 -1
  79. package/es2018/plugins/color-picker/color-picker.js +1 -1
  80. package/es2018/plugins/color-picker/color-picker.min.js +1 -1
  81. package/es2018/plugins/emoji/emoji.css +1 -1
  82. package/es2018/plugins/emoji/emoji.js +1 -1
  83. package/es2018/plugins/emoji/emoji.min.js +1 -1
  84. package/es2018/plugins/export-docs/export-docs.js +1 -1
  85. package/es2018/plugins/export-docs/export-docs.min.js +1 -1
  86. package/es2018/plugins/finder/finder.css +6 -7
  87. package/es2018/plugins/finder/finder.js +1 -1
  88. package/es2018/plugins/finder/finder.min.css +1 -1
  89. package/es2018/plugins/finder/finder.min.js +1 -1
  90. package/es2018/plugins/google-maps/google-maps.css +1 -1
  91. package/es2018/plugins/google-maps/google-maps.js +1 -1
  92. package/es2018/plugins/google-maps/google-maps.min.js +1 -1
  93. package/es2018/plugins/google-search/google-search.js +1 -1
  94. package/es2018/plugins/google-search/google-search.min.js +1 -1
  95. package/es2018/plugins/highlight-signature/highlight-signature.js +1 -1
  96. package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
  97. package/es2018/plugins/iframe-editor/iframe-editor.css +1 -1
  98. package/es2018/plugins/iframe-editor/iframe-editor.js +1 -1
  99. package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
  100. package/es2018/plugins/keyboard/keyboard.css +1 -1
  101. package/es2018/plugins/keyboard/keyboard.js +1 -1
  102. package/es2018/plugins/keyboard/keyboard.min.js +1 -1
  103. package/es2018/plugins/mobile-view/mobile-view.js +1 -1
  104. package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
  105. package/es2018/plugins/page-break/page-break.js +1 -1
  106. package/es2018/plugins/page-break/page-break.min.js +1 -1
  107. package/es2018/plugins/paste-code/paste-code.css +1 -1
  108. package/es2018/plugins/paste-code/paste-code.js +1 -1
  109. package/es2018/plugins/paste-code/paste-code.min.js +1 -1
  110. package/es2018/plugins/paste-from-word/paste-from-word.js +1 -1
  111. package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
  112. package/es2018/plugins/show-blocks/show-blocks.js +1 -1
  113. package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
  114. package/es2018/plugins/todo-list/todo-list.css +1 -1
  115. package/es2018/plugins/todo-list/todo-list.js +1 -1
  116. package/es2018/plugins/todo-list/todo-list.min.js +1 -1
  117. package/es2018/plugins/translate/translate.css +1 -1
  118. package/es2018/plugins/translate/translate.js +1 -1
  119. package/es2018/plugins/translate/translate.min.js +1 -1
  120. package/es2018/plugins/tune-block/tune-block.css +1 -1
  121. package/es2018/plugins/tune-block/tune-block.js +1 -1
  122. package/es2018/plugins/tune-block/tune-block.min.js +1 -1
  123. package/es2021/jodit.css +87 -31
  124. package/es2021/jodit.fat.min.css +1 -1
  125. package/es2021/jodit.fat.min.js +2 -2
  126. package/es2021/jodit.js +1361 -546
  127. package/es2021/jodit.min.css +1 -1
  128. package/es2021/jodit.min.js +2 -2
  129. package/es2021/plugins/autocomplete/autocomplete.js +1 -1
  130. package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
  131. package/es2021/plugins/backup/backup.css +1 -1
  132. package/es2021/plugins/backup/backup.js +1 -1
  133. package/es2021/plugins/backup/backup.min.js +1 -1
  134. package/es2021/plugins/button-generator/button-generator.css +1 -1
  135. package/es2021/plugins/button-generator/button-generator.js +1 -1
  136. package/es2021/plugins/button-generator/button-generator.min.js +1 -1
  137. package/es2021/plugins/change-case/change-case.js +1 -1
  138. package/es2021/plugins/change-case/change-case.min.js +1 -1
  139. package/es2021/plugins/color-picker/color-picker.css +1 -1
  140. package/es2021/plugins/color-picker/color-picker.js +1 -1
  141. package/es2021/plugins/color-picker/color-picker.min.js +1 -1
  142. package/es2021/plugins/emoji/emoji.css +1 -1
  143. package/es2021/plugins/emoji/emoji.js +1 -1
  144. package/es2021/plugins/emoji/emoji.min.js +1 -1
  145. package/es2021/plugins/export-docs/export-docs.js +1 -1
  146. package/es2021/plugins/export-docs/export-docs.min.js +1 -1
  147. package/es2021/plugins/finder/finder.css +6 -7
  148. package/es2021/plugins/finder/finder.js +1 -1
  149. package/es2021/plugins/finder/finder.min.css +1 -1
  150. package/es2021/plugins/finder/finder.min.js +1 -1
  151. package/es2021/plugins/google-maps/google-maps.css +1 -1
  152. package/es2021/plugins/google-maps/google-maps.js +1 -1
  153. package/es2021/plugins/google-maps/google-maps.min.js +1 -1
  154. package/es2021/plugins/google-search/google-search.js +1 -1
  155. package/es2021/plugins/google-search/google-search.min.js +1 -1
  156. package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
  157. package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
  158. package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
  159. package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
  160. package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
  161. package/es2021/plugins/keyboard/keyboard.css +1 -1
  162. package/es2021/plugins/keyboard/keyboard.js +1 -1
  163. package/es2021/plugins/keyboard/keyboard.min.js +1 -1
  164. package/es2021/plugins/mobile-view/mobile-view.js +1 -1
  165. package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
  166. package/es2021/plugins/page-break/page-break.js +1 -1
  167. package/es2021/plugins/page-break/page-break.min.js +1 -1
  168. package/es2021/plugins/paste-code/paste-code.css +1 -1
  169. package/es2021/plugins/paste-code/paste-code.js +1 -1
  170. package/es2021/plugins/paste-code/paste-code.min.js +1 -1
  171. package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
  172. package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
  173. package/es2021/plugins/show-blocks/show-blocks.js +1 -1
  174. package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
  175. package/es2021/plugins/todo-list/todo-list.css +1 -1
  176. package/es2021/plugins/todo-list/todo-list.js +1 -1
  177. package/es2021/plugins/todo-list/todo-list.min.js +1 -1
  178. package/es2021/plugins/translate/translate.css +1 -1
  179. package/es2021/plugins/translate/translate.js +1 -1
  180. package/es2021/plugins/translate/translate.min.js +1 -1
  181. package/es2021/plugins/tune-block/tune-block.css +1 -1
  182. package/es2021/plugins/tune-block/tune-block.js +1 -1
  183. package/es2021/plugins/tune-block/tune-block.min.js +1 -1
  184. package/es2021.en/jodit.css +87 -31
  185. package/es2021.en/jodit.fat.min.css +1 -1
  186. package/es2021.en/jodit.fat.min.js +2 -2
  187. package/es2021.en/jodit.js +1361 -546
  188. package/es2021.en/jodit.min.css +1 -1
  189. package/es2021.en/jodit.min.js +2 -2
  190. package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
  191. package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
  192. package/es2021.en/plugins/backup/backup.css +1 -1
  193. package/es2021.en/plugins/backup/backup.js +1 -1
  194. package/es2021.en/plugins/backup/backup.min.js +1 -1
  195. package/es2021.en/plugins/button-generator/button-generator.css +1 -1
  196. package/es2021.en/plugins/button-generator/button-generator.js +1 -1
  197. package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
  198. package/es2021.en/plugins/change-case/change-case.js +1 -1
  199. package/es2021.en/plugins/change-case/change-case.min.js +1 -1
  200. package/es2021.en/plugins/color-picker/color-picker.css +1 -1
  201. package/es2021.en/plugins/color-picker/color-picker.js +1 -1
  202. package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
  203. package/es2021.en/plugins/emoji/emoji.css +1 -1
  204. package/es2021.en/plugins/emoji/emoji.js +1 -1
  205. package/es2021.en/plugins/emoji/emoji.min.js +1 -1
  206. package/es2021.en/plugins/export-docs/export-docs.js +1 -1
  207. package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
  208. package/es2021.en/plugins/finder/finder.css +6 -7
  209. package/es2021.en/plugins/finder/finder.js +1 -1
  210. package/es2021.en/plugins/finder/finder.min.css +1 -1
  211. package/es2021.en/plugins/finder/finder.min.js +1 -1
  212. package/es2021.en/plugins/google-maps/google-maps.css +1 -1
  213. package/es2021.en/plugins/google-maps/google-maps.js +1 -1
  214. package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
  215. package/es2021.en/plugins/google-search/google-search.js +1 -1
  216. package/es2021.en/plugins/google-search/google-search.min.js +1 -1
  217. package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
  218. package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
  219. package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
  220. package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
  221. package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
  222. package/es2021.en/plugins/keyboard/keyboard.css +1 -1
  223. package/es2021.en/plugins/keyboard/keyboard.js +1 -1
  224. package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
  225. package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
  226. package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
  227. package/es2021.en/plugins/page-break/page-break.js +1 -1
  228. package/es2021.en/plugins/page-break/page-break.min.js +1 -1
  229. package/es2021.en/plugins/paste-code/paste-code.css +1 -1
  230. package/es2021.en/plugins/paste-code/paste-code.js +1 -1
  231. package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
  232. package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
  233. package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
  234. package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
  235. package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
  236. package/es2021.en/plugins/todo-list/todo-list.css +1 -1
  237. package/es2021.en/plugins/todo-list/todo-list.js +1 -1
  238. package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
  239. package/es2021.en/plugins/translate/translate.css +1 -1
  240. package/es2021.en/plugins/translate/translate.js +1 -1
  241. package/es2021.en/plugins/translate/translate.min.js +1 -1
  242. package/es2021.en/plugins/tune-block/tune-block.css +1 -1
  243. package/es2021.en/plugins/tune-block/tune-block.js +1 -1
  244. package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
  245. package/es5/jodit.css +131 -35
  246. package/es5/jodit.fat.min.css +1 -1
  247. package/es5/jodit.fat.min.js +2 -2
  248. package/es5/jodit.js +1410 -482
  249. package/es5/jodit.min.css +3 -3
  250. package/es5/jodit.min.js +2 -2
  251. package/es5/plugins/autocomplete/autocomplete.js +1 -1
  252. package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
  253. package/es5/plugins/backup/backup.css +1 -1
  254. package/es5/plugins/backup/backup.js +1 -1
  255. package/es5/plugins/backup/backup.min.js +1 -1
  256. package/es5/plugins/button-generator/button-generator.css +1 -1
  257. package/es5/plugins/button-generator/button-generator.js +1 -1
  258. package/es5/plugins/button-generator/button-generator.min.js +1 -1
  259. package/es5/plugins/change-case/change-case.js +1 -1
  260. package/es5/plugins/change-case/change-case.min.js +1 -1
  261. package/es5/plugins/color-picker/color-picker.css +1 -1
  262. package/es5/plugins/color-picker/color-picker.js +1 -1
  263. package/es5/plugins/color-picker/color-picker.min.js +1 -1
  264. package/es5/plugins/emoji/emoji.css +1 -1
  265. package/es5/plugins/emoji/emoji.js +1 -1
  266. package/es5/plugins/emoji/emoji.min.js +1 -1
  267. package/es5/plugins/export-docs/export-docs.js +1 -1
  268. package/es5/plugins/export-docs/export-docs.min.js +1 -1
  269. package/es5/plugins/finder/finder.css +6 -7
  270. package/es5/plugins/finder/finder.js +1 -1
  271. package/es5/plugins/finder/finder.min.css +1 -1
  272. package/es5/plugins/finder/finder.min.js +1 -1
  273. package/es5/plugins/google-maps/google-maps.css +1 -1
  274. package/es5/plugins/google-maps/google-maps.js +1 -1
  275. package/es5/plugins/google-maps/google-maps.min.js +1 -1
  276. package/es5/plugins/google-search/google-search.js +1 -1
  277. package/es5/plugins/google-search/google-search.min.js +1 -1
  278. package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
  279. package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
  280. package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
  281. package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
  282. package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
  283. package/es5/plugins/keyboard/keyboard.css +1 -1
  284. package/es5/plugins/keyboard/keyboard.js +1 -1
  285. package/es5/plugins/keyboard/keyboard.min.js +1 -1
  286. package/es5/plugins/mobile-view/mobile-view.js +1 -1
  287. package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
  288. package/es5/plugins/page-break/page-break.js +1 -1
  289. package/es5/plugins/page-break/page-break.min.js +1 -1
  290. package/es5/plugins/paste-code/paste-code.css +1 -1
  291. package/es5/plugins/paste-code/paste-code.js +1 -1
  292. package/es5/plugins/paste-code/paste-code.min.js +1 -1
  293. package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
  294. package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
  295. package/es5/plugins/show-blocks/show-blocks.js +1 -1
  296. package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
  297. package/es5/plugins/todo-list/todo-list.css +1 -1
  298. package/es5/plugins/todo-list/todo-list.js +1 -1
  299. package/es5/plugins/todo-list/todo-list.min.js +1 -1
  300. package/es5/plugins/translate/translate.css +1 -1
  301. package/es5/plugins/translate/translate.js +1 -1
  302. package/es5/plugins/translate/translate.min.js +1 -1
  303. package/es5/plugins/tune-block/tune-block.css +1 -1
  304. package/es5/plugins/tune-block/tune-block.js +1 -1
  305. package/es5/plugins/tune-block/tune-block.min.js +1 -1
  306. package/esm/plugins/finder/browser.d.ts +1 -1
  307. package/package.json +1 -1
  308. package/types/plugins/finder/browser.d.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valeriy <chupurnov@gmail.com>
4
- * Version: v4.1.13
4
+ * Version: v4.1.21
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -826,6 +826,28 @@ class Config {
826
826
  : null);
827
827
  /**
828
828
  * Shadow root if Jodit was created in it
829
+ *
830
+ * ```html
831
+ * <div id="editor"></div>
832
+ * ```
833
+ *
834
+ * ```js
835
+ * const app = document.getElementById('editor');
836
+ * app.attachShadow({ mode: 'open' });
837
+ * const root = app.shadowRoot;
838
+ *
839
+ * root.innerHTML = `
840
+ * <link rel="stylesheet" href="./build/jodit.css"/>
841
+ * <h1>Jodit example in Shadow DOM</h1>
842
+ * <div id="edit"></div>
843
+ * `;
844
+ *
845
+ * const editor = Jodit.make(root.getElementById('edit'), {
846
+ * globalFullSize: false,
847
+ * shadowRoot: root
848
+ * });
849
+ * editor.value = '<p>start</p>';
850
+ * ```
829
851
  */
830
852
  this.shadowRoot = null;
831
853
  /**
@@ -1576,6 +1598,7 @@ Config.prototype.controls = {};
1576
1598
  /* harmony export */ });
1577
1599
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67259);
1578
1600
  /* harmony import */ var jodit_core_helpers_async__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(98761);
1601
+ /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(54306);
1579
1602
  /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(41959);
1580
1603
  /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(72558);
1581
1604
  /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(47903);
@@ -1584,7 +1607,7 @@ Config.prototype.controls = {};
1584
1607
  /* harmony import */ var jodit_core_helpers_checker_is_void__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(74197);
1585
1608
  /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28712);
1586
1609
  /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1__);
1587
- /* harmony import */ var jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(30126);
1610
+ /* harmony import */ var jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(30126);
1588
1611
  /*!
1589
1612
  * Jodit Editor (https://xdsoft.net/jodit/)
1590
1613
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -1600,6 +1623,7 @@ Config.prototype.controls = {};
1600
1623
 
1601
1624
 
1602
1625
 
1626
+
1603
1627
  class Async {
1604
1628
  constructor() {
1605
1629
  this.timers = new Map();
@@ -1719,6 +1743,11 @@ class Async {
1719
1743
  ? (...args) => {
1720
1744
  const promise = this.promise(res => {
1721
1745
  promises.push(res);
1746
+ }).catch((e) => {
1747
+ if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .isAbortError */ .z)(e)) {
1748
+ return null;
1749
+ }
1750
+ throw e;
1722
1751
  });
1723
1752
  onFire(...args);
1724
1753
  return promise;
@@ -1790,7 +1819,7 @@ class Async {
1790
1819
  promise(executor) {
1791
1820
  let rejectCallback = () => { };
1792
1821
  const promise = new Promise((resolve, reject) => {
1793
- rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .abort */ .h)());
1822
+ rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__/* .abort */ .h)('Abort async'));
1794
1823
  this.promisesRejections.add(rejectCallback);
1795
1824
  executor(resolve, reject);
1796
1825
  });
@@ -2275,7 +2304,7 @@ __webpack_require__.r(__webpack_exports__);
2275
2304
  * Released under MIT see LICENSE.txt in the project root for license information.
2276
2305
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
2277
2306
  */
2278
- const APP_VERSION = "4.1.13";
2307
+ const APP_VERSION = "4.1.21";
2279
2308
  // prettier-ignore
2280
2309
  const ES = "es2021";
2281
2310
  const IS_ES_MODERN = true;
@@ -7284,8 +7313,8 @@ function position(elm, jodit, recurse = false) {
7284
7313
  return {
7285
7314
  left: Math.round(xPos),
7286
7315
  top: Math.round(yPos),
7287
- width: Math.round(elm.offsetWidth),
7288
- height: Math.round(elm.offsetHeight)
7316
+ width: Math.round(elm.offsetWidth ?? rect.width),
7317
+ height: Math.round(elm.offsetHeight ?? rect.height)
7289
7318
  };
7290
7319
  }
7291
7320
 
@@ -9318,9 +9347,9 @@ const getXPathByElement = (element, root) => {
9318
9347
  * Find all `ref` or `data-ref` elements inside HTMLElement
9319
9348
  */
9320
9349
  const refs = (root) => {
9321
- // if (Component.isInstanceOf<UIElement>(root, UIElement)) {
9322
- // root = root.container;
9323
- // }
9350
+ if ('container' in root) {
9351
+ root = root.container;
9352
+ }
9324
9353
  return $$('[ref],[data-ref]', root).reduce((def, child) => {
9325
9354
  const key = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(child, '-ref');
9326
9355
  if (key && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__/* .isString */ .K)(key)) {
@@ -13843,7 +13872,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13843
13872
  view.o.showTooltip &&
13844
13873
  !view.o.useNativeTooltip) {
13845
13874
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, () => {
13846
- // TODO Move it inside __open method. Now it is here becous testcase failed with capturing
13875
+ // TODO Move it inside __open method. Now it is here because testcase failed with capturing
13847
13876
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
13848
13877
  view.e.on(view.container, 'mouseenter.tooltip', this.__onMouseEnter, {
13849
13878
  capture: true
@@ -13859,6 +13888,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13859
13888
  const view = this.j;
13860
13889
  view.e
13861
13890
  .on(view.ow, 'scroll.tooltip', this.__hide)
13891
+ .on(view.ow, 'joditCloseDialog', this.__hide)
13862
13892
  .on(view.container, 'mouseleave.tooltip', this.__hide)
13863
13893
  .on([
13864
13894
  'escape.tooltip',
@@ -15868,7 +15898,7 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_7__/* .UI
15868
15898
  }
15869
15899
  let pe = this.parentElement;
15870
15900
  while (pe) {
15871
- if (checkView(j)) {
15901
+ if (checkView(pe.j)) {
15872
15902
  return;
15873
15903
  }
15874
15904
  if (pe.container.style.zIndex) {
@@ -18430,6 +18460,7 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
18430
18460
  * Fired when dialog box is started moving
18431
18461
  */
18432
18462
  this.e.fire(this, 'startMove');
18463
+ this.e.fire('closeAllPopups');
18433
18464
  }
18434
18465
  }
18435
18466
  onMouseMove(e) {
@@ -19757,6 +19788,9 @@ let DataProvider = class DataProvider {
19757
19788
  this.o.permissions.data.source = source;
19758
19789
  if (this.o.permissions.url) {
19759
19790
  return this.get('permissions').then(resp => {
19791
+ if (this.parent.isInDestruct) {
19792
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.abort)();
19793
+ }
19760
19794
  let process = this.o.permissions.process;
19761
19795
  if (!process) {
19762
19796
  process = this.o.ajax.process;
@@ -20370,10 +20404,17 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
20370
20404
  this.__updateToolbarButtons();
20371
20405
  this._dialog.open(this.browser, header);
20372
20406
  this.e.fire('sort.filebrowser', this.state.sortBy);
20373
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this).then(resolve, reject);
20407
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this)
20408
+ .then(resolve, reject)
20409
+ .finally(() => {
20410
+ if (this.isInDestruct) {
20411
+ return;
20412
+ }
20413
+ this?.e?.fire('fileBrowserReady.filebrowser');
20414
+ });
20374
20415
  })
20375
20416
  .catch((e) => {
20376
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
20417
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(e) && !jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
20377
20418
  throw e;
20378
20419
  }
20379
20420
  });
@@ -22239,11 +22280,12 @@ const act = (el, className = 'jodti-image-editor_active') => el ? className : ''
22239
22280
  const form = (editor, o) => {
22240
22281
  const i = editor.i18n.bind(editor);
22241
22282
  const switcher = (label, ref, active = true) => `<div class="jodit-form__group">
22242
- <label>${i(label)}</label>
22243
-
22244
- <label class='jodit-switcher'>
22245
- <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
22246
- <span class="jodit-switcher__slider"></span>
22283
+ <label class="jodit-switcher-wrapper">
22284
+ <span class='jodit-switcher'>
22285
+ <input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
22286
+ <span class="jodit-switcher__slider"></span>
22287
+ </span>
22288
+ <span>${i(label)}</span>
22247
22289
  </label>
22248
22290
  </div>`;
22249
22291
  return editor.create.fromHTML(`<form class="${jie} jodit-properties">
@@ -25307,11 +25349,13 @@ const TabsWidget = (jodit, tabs, state) => {
25307
25349
  return;
25308
25350
  }
25309
25351
  buttonList.forEach(b => {
25352
+ b.state.variant = 'initial';
25310
25353
  b.state.activated = false;
25311
25354
  });
25312
25355
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(a => {
25313
25356
  a.classList.remove('jodit-tab_active');
25314
25357
  });
25358
+ nameToTab[tab].button.state.variant = 'outline';
25315
25359
  nameToTab[tab].button.state.activated = true;
25316
25360
  nameToTab[tab].tab.classList.add('jodit-tab_active');
25317
25361
  };
@@ -25340,7 +25384,7 @@ const TabsWidget = (jodit, tabs, state) => {
25340
25384
  content.call(jodit);
25341
25385
  }
25342
25386
  if (state) {
25343
- state.__activeTab = name;
25387
+ state.activeTab = name;
25344
25388
  }
25345
25389
  return false;
25346
25390
  });
@@ -25356,20 +25400,20 @@ const TabsWidget = (jodit, tabs, state) => {
25356
25400
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(a => {
25357
25401
  a.style.width = (100 / tabCount).toFixed(10) + '%';
25358
25402
  });
25359
- const tab = !state || !state.__activeTab || !nameToTab[state.__activeTab]
25403
+ const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
25360
25404
  ? firstTab
25361
- : state.__activeTab;
25405
+ : state.activeTab;
25362
25406
  setActive(tab);
25363
25407
  if (state) {
25364
- let __activeTab = state.__activeTab;
25365
- Object.defineProperty(state, '__activeTab', {
25408
+ let activeTab = state.activeTab;
25409
+ Object.defineProperty(state, 'activeTab', {
25366
25410
  configurable: true,
25367
25411
  enumerable: false,
25368
25412
  get() {
25369
- return __activeTab;
25413
+ return activeTab;
25370
25414
  },
25371
25415
  set(value) {
25372
- __activeTab = value;
25416
+ activeTab = value;
25373
25417
  setActive(value);
25374
25418
  }
25375
25419
  });
@@ -25784,7 +25828,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/
25784
25828
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
25785
25829
  }
25786
25830
  /** @override */
25787
- afterInit(jodit) { }
25831
+ afterInit() { }
25788
25832
  onGenerateAiAssistantForm(prompt) {
25789
25833
  this.__dialog.open(this.__container, 'AI Assistant');
25790
25834
  this.__container.setPrompt(prompt);
@@ -31196,9 +31240,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
31196
31240
  * Released under MIT see LICENSE.txt in the project root for license information.
31197
31241
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31198
31242
  */
31199
- /**
31200
- * @module plugins/image-properties
31201
- */
31202
31243
 
31203
31244
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31204
31245
  dialogWidth: 600,
@@ -31228,18 +31269,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31228
31269
 
31229
31270
  "use strict";
31230
31271
  /* unused harmony export imageProperties */
31231
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31635);
31272
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(31635);
31232
31273
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53557);
31233
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51431);
31234
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9596);
31235
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(64962);
31236
- /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35102);
31237
- /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(60485);
31238
- /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(21391);
31239
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(61115);
31240
- /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98231);
31241
- /* harmony import */ var _templates_main_tab__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(9118);
31242
- /* harmony import */ var _templates_position_tab__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(85480);
31274
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23545);
31275
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51431);
31276
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9596);
31277
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(67141);
31278
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(64962);
31279
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(61115);
31280
+ /* harmony import */ var _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91675);
31281
+ /* harmony import */ var _utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(77137);
31282
+ /* harmony import */ var _utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(91852);
31283
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(61566);
31284
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(48570);
31243
31285
  /*!
31244
31286
  * Jodit Editor (https://xdsoft.net/jodit/)
31245
31287
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -31271,55 +31313,93 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.image = {
31271
31313
  * });
31272
31314
  * ```
31273
31315
  */
31274
- const normalSizeToString = (value) => {
31275
- value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(value);
31276
- return /^[0-9]+$/.test(value) ? value + 'px' : value;
31277
- };
31278
- const normalSizeFromString = (value) => {
31279
- return /^[-+]?[0-9.]+px$/.test(value.toString())
31280
- ? parseFloat(value.toString())
31281
- : value;
31282
- };
31283
31316
  /**
31284
31317
  * Show dialog with image's options
31285
31318
  */
31286
- class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin {
31319
+ class imageProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k {
31287
31320
  constructor() {
31288
31321
  super(...arguments);
31289
31322
  this.state = {
31290
31323
  image: new Image(),
31324
+ sourceImage: new Image(),
31291
31325
  get ratio() {
31292
- return this.image.naturalWidth / this.image.naturalHeight || 1;
31326
+ const { naturalWidth, naturalHeight } = this.image;
31327
+ return naturalWidth / naturalHeight || 1;
31293
31328
  },
31294
31329
  sizeIsLocked: true,
31295
- marginIsLocked: true
31330
+ marginIsLocked: true,
31331
+ values: {
31332
+ style: '',
31333
+ imageSrc: '',
31334
+ borderRadius: 0,
31335
+ imageTitle: '',
31336
+ imageAlt: '',
31337
+ imageLink: '',
31338
+ imageLinkOpenInNewTab: false,
31339
+ imageWidth: 0,
31340
+ imageHeight: 0,
31341
+ marginTop: 0,
31342
+ marginRight: 0,
31343
+ marginBottom: 0,
31344
+ marginLeft: 0,
31345
+ classes: '',
31346
+ id: '',
31347
+ align: ''
31348
+ }
31296
31349
  };
31297
31350
  this.activeTabState = {
31298
- __activeTab: 'Image'
31351
+ activeTab: 'Image'
31299
31352
  };
31300
31353
  }
31301
- onChangeMarginIsLocked() {
31302
- if (!this.form) {
31303
- return;
31304
- }
31305
- const { marginRight, marginBottom, marginLeft, lockMargin } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31306
- [marginRight, marginBottom, marginLeft].forEach(elm => {
31307
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'disabled', this.state.marginIsLocked || null);
31354
+ get form() {
31355
+ return new _ui_ui_image_form__WEBPACK_IMPORTED_MODULE_7__/* .UIImagePropertiesForm */ .l(this.j, this.state, this.activeTabState, {
31356
+ openImageEditor: () => (0,_utils_open_image_editor__WEBPACK_IMPORTED_MODULE_8__/* .openImageEditorDialog */ .v)(this.j, this.state),
31357
+ openImagePopup: target => (0,_utils_open_image_popup__WEBPACK_IMPORTED_MODULE_9__/* .openImagePopup */ .q)(this.j, this.dialog, this.state, target)
31308
31358
  });
31309
- lockMargin.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.marginIsLocked ? 'lock' : 'unlock');
31310
31359
  }
31311
- onChangeSizeIsLocked() {
31312
- if (!this.form) {
31313
- return;
31314
- }
31315
- const { lockSize, imageWidth } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31316
- lockSize.innerHTML = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Icon.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31317
- lockSize.classList.remove('jodit-properties__lock');
31318
- lockSize.classList.remove('jodit-properties__unlock');
31319
- lockSize.classList.add(this.state.sizeIsLocked
31320
- ? 'jodit-properties__lock'
31321
- : 'jodit-properties__unlock');
31322
- this.j.e.fire(imageWidth, 'change');
31360
+ /**
31361
+ * Dialog for form
31362
+ */
31363
+ get dialog() {
31364
+ const { j } = this;
31365
+ const dialog = j.dlg({
31366
+ minWidth: Math.min(400, screen.width),
31367
+ minHeight: 590,
31368
+ buttons: ['fullsize', 'dialog.close']
31369
+ });
31370
+ const buttons = this.__buttons;
31371
+ buttons.check.onAction(() => {
31372
+ (0,_writers__WEBPACK_IMPORTED_MODULE_11__/* .applyValuesToImage */ .j)(j, this.state, this.state.sourceImage);
31373
+ j.synchronizeValues();
31374
+ dialog.close();
31375
+ });
31376
+ buttons.remove.onAction(() => {
31377
+ j.s.removeNode(this.state.sourceImage);
31378
+ dialog.close();
31379
+ });
31380
+ buttons.cancel.onAction(() => {
31381
+ dialog.close();
31382
+ });
31383
+ dialog.setHeader(j.i18n('Image properties'));
31384
+ dialog.setContent(this.form);
31385
+ dialog.setFooter([[buttons.cancel, buttons.remove], buttons.check]);
31386
+ j.e.on(dialog, 'afterClose', () => {
31387
+ if (this.state.image.parentNode &&
31388
+ j.o.image.selectImageAfterClose) {
31389
+ j.s.select(this.state.sourceImage);
31390
+ }
31391
+ });
31392
+ dialog.setSize(j.o.image.dialogWidth);
31393
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markOwner)(j, dialog.container);
31394
+ return dialog;
31395
+ }
31396
+ get __buttons() {
31397
+ const { j } = this;
31398
+ return {
31399
+ check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'ok', 'Apply', 'primary'),
31400
+ remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'bin', 'Delete'),
31401
+ cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__/* .Button */ .$n)(j, 'cancel', 'Cancel')
31402
+ };
31323
31403
  }
31324
31404
  /**
31325
31405
  * Open dialog editing image properties
@@ -31336,358 +31416,28 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31336
31416
  * ```
31337
31417
  */
31338
31418
  open() {
31339
- this.makeForm();
31340
- this.activeTabState.__activeTab = 'Image';
31341
- this.j.e.fire('hidePopup');
31342
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.markOwner)(this.j, this.dialog.container);
31343
- this.state.marginIsLocked = true;
31344
- this.state.sizeIsLocked = true;
31345
- this.onChangeMarginIsLocked();
31346
- this.onChangeSizeIsLocked();
31347
- this.updateValues();
31419
+ this.activeTabState.activeTab = 'Image';
31420
+ this.__lock();
31348
31421
  this.dialog.open().setModal(true).setPosition();
31349
- return false;
31350
- }
31351
- /**
31352
- * Create form for edit image properties
31353
- */
31354
- makeForm() {
31355
- if (this.dialog) {
31356
- return;
31357
- }
31358
- this.dialog = this.j.dlg({
31359
- minWidth: Math.min(400, screen.width),
31360
- minHeight: 590,
31361
- buttons: ['fullsize', 'dialog.close']
31362
- });
31363
- const editor = this.j, opt = editor.o, i18n = editor.i18n.bind(editor), buttons = {
31364
- check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'ok', 'Apply', 'primary'),
31365
- remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(editor, 'bin', 'Delete')
31366
- };
31367
- editor.e.on(this.dialog, 'afterClose', () => {
31368
- if (this.state.image.parentNode &&
31369
- opt.image.selectImageAfterClose) {
31370
- editor.s.select(this.state.image);
31371
- }
31372
- });
31373
- buttons.remove.onAction(() => {
31374
- editor.s.removeNode(this.state.image);
31375
- this.dialog.close();
31376
- });
31377
- const { dialog } = this;
31378
- dialog.setHeader(i18n('Image properties'));
31379
- const mainForm = (0,_templates_form__WEBPACK_IMPORTED_MODULE_8__/* .form */ .Z)(editor);
31380
- this.form = mainForm;
31381
- dialog.setContent(mainForm);
31382
- const { tabsBox } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31383
- if (tabsBox) {
31384
- tabsBox.appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .TabsWidget */ .Zg)(editor, [
31385
- { name: 'Image', content: (0,_templates_main_tab__WEBPACK_IMPORTED_MODULE_9__/* .mainTab */ .J)(editor) },
31386
- { name: 'Advanced', content: (0,_templates_position_tab__WEBPACK_IMPORTED_MODULE_10__/* .positionTab */ .b)(editor) }
31387
- ], this.activeTabState));
31388
- }
31389
- buttons.check.onAction(this.onApply);
31390
- const { changeImage, editImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31391
- editor.e.on(changeImage, 'click', this.openImagePopup);
31392
- if (opt.image.useImageEditor) {
31393
- editor.e.on(editImage, 'click', this.openImageEditor);
31394
- }
31395
- const { lockSize, lockMargin, imageWidth, imageHeight } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(mainForm);
31396
- if (lockSize) {
31397
- editor.e.on(lockSize, 'click', () => {
31398
- this.state.sizeIsLocked = !this.state.sizeIsLocked;
31399
- });
31400
- }
31401
- editor.e.on(lockMargin, 'click', (e) => {
31402
- this.state.marginIsLocked = !this.state.marginIsLocked;
31403
- e.preventDefault();
31404
- });
31405
- const changeSizes = (event) => {
31406
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
31407
- return;
31408
- }
31409
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31410
- if (event.target === imageWidth) {
31411
- imageHeight.value = Math.round(w / this.state.ratio).toString();
31412
- }
31413
- else {
31414
- imageWidth.value = Math.round(h * this.state.ratio).toString();
31415
- }
31416
- };
31417
- editor.e.on([imageWidth, imageHeight], 'change keydown mousedown paste', (event) => {
31418
- if (!this.state.sizeIsLocked) {
31419
- return;
31420
- }
31421
- editor.async.setTimeout(changeSizes.bind(this, event), {
31422
- timeout: editor.defaultTimeout,
31423
- label: 'image-properties-changeSize'
31424
- });
31425
- });
31426
- dialog.setFooter([buttons.remove, buttons.check]);
31427
- dialog.setSize(this.j.o.image.dialogWidth);
31428
- }
31429
- /**
31430
- * Set input values from image
31431
- */
31432
- updateValues() {
31433
- const opt = this.j.o;
31434
- const { image } = this.state;
31435
- const { marginTop, marginRight, marginBottom, marginLeft, lockMargin, imageSrc, id, classes, align, style, imageTitle, imageAlt, borderRadius, imageLink, imageWidth, imageHeight, imageLinkOpenInNewTab, imageViewSrc, lockSize } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31436
- const updateLock = () => {
31437
- lockMargin.checked = this.state.marginIsLocked;
31438
- lockSize.checked = this.state.sizeIsLocked;
31439
- }, updateAlign = () => {
31440
- if (image.style.cssFloat &&
31441
- ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
31442
- align.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float');
31443
- }
31444
- else {
31445
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'display') === 'block' &&
31446
- image.style.marginLeft === 'auto' &&
31447
- image.style.marginRight === 'auto') {
31448
- align.value = 'center';
31449
- }
31450
- }
31451
- }, updateBorderRadius = () => {
31452
- borderRadius.value = (parseInt(image.style.borderRadius || '0', 10) || '0').toString();
31453
- }, updateId = () => {
31454
- id.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id') || '';
31455
- }, updateStyle = () => {
31456
- style.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style') || '';
31457
- }, updateClasses = () => {
31458
- classes.value = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
31459
- }, updateMargins = () => {
31460
- if (!opt.image.editMargins) {
31461
- return;
31462
- }
31463
- let equal = true, wasEmptyField = false;
31464
- [marginTop, marginRight, marginBottom, marginLeft].forEach(elm => {
31465
- const id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'data-ref') || '';
31466
- let value = image.style.getPropertyValue((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.kebabCase)(id));
31467
- if (!value) {
31468
- wasEmptyField = true;
31469
- elm.value = '';
31470
- return;
31471
- }
31472
- if (/^[0-9]+(px)?$/.test(value)) {
31473
- value = parseInt(value, 10);
31474
- }
31475
- elm.value = value.toString() || '';
31476
- if ((wasEmptyField && elm.value) ||
31477
- (equal &&
31478
- id !== 'marginTop' &&
31479
- elm.value !== marginTop.value)) {
31480
- equal = false;
31481
- }
31482
- });
31483
- this.state.marginIsLocked = equal;
31484
- }, updateSizes = () => {
31485
- const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ||
31486
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'width', true) ||
31487
- false, height = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ||
31488
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'height', true) ||
31489
- false;
31490
- imageWidth.value =
31491
- width !== false
31492
- ? normalSizeFromString(width).toString()
31493
- : image.offsetWidth.toString();
31494
- imageHeight.value =
31495
- height !== false
31496
- ? normalSizeFromString(height).toString()
31497
- : image.offsetHeight.toString();
31498
- this.state.sizeIsLocked = (() => {
31499
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageWidth.value) ||
31500
- !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isNumeric)(imageHeight.value)) {
31501
- return false;
31502
- }
31503
- const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31504
- return Math.abs(w - h * this.state.ratio) < 1;
31505
- })();
31506
- }, updateText = () => {
31507
- imageTitle.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title') || '';
31508
- imageAlt.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt') || '';
31509
- const a = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
31510
- if (a) {
31511
- imageLink.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'href') || '';
31512
- imageLinkOpenInNewTab.checked =
31513
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(a, 'target') === '_blank';
31514
- }
31515
- else {
31516
- imageLink.value = '';
31517
- imageLinkOpenInNewTab.checked = false;
31518
- }
31519
- }, updateSrc = () => {
31520
- imageSrc.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '';
31521
- if (imageViewSrc) {
31522
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(imageViewSrc, 'src', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src') || '');
31523
- }
31524
- };
31525
- updateLock();
31526
- updateSrc();
31527
- updateText();
31528
- updateSizes();
31529
- updateMargins();
31530
- updateClasses();
31531
- updateId();
31532
- updateBorderRadius();
31533
- updateAlign();
31534
- updateStyle();
31535
- }
31536
- /**
31537
- * Apply form's values to image
31538
- */
31539
- onApply() {
31540
- const { style, imageSrc, borderRadius, imageTitle, imageAlt, imageLink, imageWidth, imageHeight, marginTop, marginRight, marginBottom, marginLeft, imageLinkOpenInNewTab, align, classes, id } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31541
- const opt = this.j.o;
31542
- const { image } = this.state;
31543
- // styles
31544
- if (opt.image.editStyle) {
31545
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'style', style.value || null);
31546
- }
31547
- // Src
31548
- if (imageSrc.value) {
31549
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'src', imageSrc.value);
31550
- }
31551
- else {
31552
- jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(image);
31553
- this.dialog.close();
31554
- return;
31555
- }
31556
- // Border radius
31557
- if (borderRadius.value !== '0' && /^[0-9]+$/.test(borderRadius.value)) {
31558
- image.style.borderRadius = borderRadius.value + 'px';
31559
- }
31560
- else {
31561
- image.style.borderRadius = '';
31562
- }
31563
- // Title
31564
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'title', imageTitle.value || null);
31565
- // Alt
31566
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'alt', imageAlt.value || null);
31567
- // Link
31568
- let link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(image, 'a', this.j.editor);
31569
- if (imageLink.value) {
31570
- if (!link) {
31571
- link = jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.wrap(image, 'a', this.j.createInside);
31572
- }
31573
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'href', imageLink.value);
31574
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'target', imageLinkOpenInNewTab.checked ? '_blank' : null);
31575
- }
31576
- else {
31577
- if (link && link.parentNode) {
31578
- link.parentNode.replaceChild(image, link);
31579
- }
31580
- }
31581
- // Size
31582
- if (imageWidth.value !== image.offsetWidth.toString() ||
31583
- imageHeight.value !== image.offsetHeight.toString()) {
31584
- const updatedtWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageWidth.value)
31585
- ? normalSizeToString(imageWidth.value)
31586
- : null;
31587
- const updatedHeight = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trim)(imageHeight.value)
31588
- ? normalSizeToString(imageHeight.value)
31589
- : null;
31590
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, {
31591
- width: updatedtWidth,
31592
- height: updatedHeight
31593
- });
31594
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'width') ? updatedtWidth : null);
31595
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'height') ? updatedHeight : null);
31596
- }
31597
- const margins = [marginTop, marginRight, marginBottom, marginLeft];
31598
- if (opt.image.editMargins) {
31599
- if (!this.state.marginIsLocked) {
31600
- margins.forEach((margin) => {
31601
- const side = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(margin, 'data-ref') || '';
31602
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, side, normalSizeToString(margin.value));
31603
- });
31604
- }
31605
- else {
31606
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'margin', normalSizeToString(marginTop.value));
31607
- }
31608
- }
31609
- if (opt.image.editClass) {
31610
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'class', classes.value || null);
31611
- }
31612
- if (opt.image.editId) {
31613
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(image, 'id', id.value || null);
31614
- }
31615
- if (opt.image.editAlign) {
31616
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(image, align.value);
31617
- }
31618
- this.j.synchronizeValues();
31619
- this.dialog.close();
31620
- }
31621
- /**
31622
- * Open image editor dialog
31623
- */
31624
- openImageEditor() {
31625
- const url = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src') || '', a = this.j.c.element('a'), loadExternal = () => {
31626
- if (a.host !== location.host) {
31627
- this.j.confirm('You can only edit your own images. Download this image on the host?', yes => {
31628
- if (yes && this.j.uploader) {
31629
- this.j.uploader.uploadRemoteImage(a.href.toString(), resp => {
31630
- this.j.alert('The image has been successfully uploaded to the host!', () => {
31631
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isString)(resp.newfilename)) {
31632
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', resp.baseurl +
31633
- resp.newfilename);
31634
- this.updateValues();
31635
- }
31636
- });
31637
- }, error => {
31638
- this.j.alert('There was an error loading %s', error.message);
31639
- });
31640
- }
31641
- });
31642
- return;
31422
+ this.async
31423
+ .promise((resolve, reject) => (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(this.j, this.state).then(resolve, reject))
31424
+ .catch((e) => {
31425
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbortError)(e)) {
31426
+ this.dialog.message.error(e.message);
31643
31427
  }
31644
- };
31645
- a.href = url;
31646
- this.j.filebrowser.dataProvider
31647
- .getPathByUrl(a.href.toString())
31648
- .then(resp => {
31649
- jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_5__/* .openImageEditor */ .B.call(this.j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
31650
- const timestamp = new Date().getTime();
31651
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', url +
31652
- (url.indexOf('?') !== -1 ? '' : '?') +
31653
- '&_tmp=' +
31654
- timestamp.toString());
31655
- this.updateValues();
31656
- }, error => {
31657
- this.j.alert(error.message);
31658
- });
31659
31428
  })
31660
- .catch(error => {
31661
- this.j.alert(error.message, loadExternal);
31662
- });
31429
+ .finally(() => this.__unlock());
31430
+ return false;
31663
31431
  }
31664
- /**
31665
- * Open popup with filebrowser/uploader buttons for image
31666
- */
31667
- openImagePopup(event) {
31668
- const popup = new jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Popup(this.j), { changeImage } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.refs)(this.form);
31669
- popup.setZIndex(this.dialog.getZIndex() + 1);
31670
- popup
31671
- .setContent((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_6__/* .FileSelectorWidget */ .kG)(this.j, {
31672
- upload: (data) => {
31673
- if (data.files && data.files.length) {
31674
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.baseurl + data.files[0]);
31675
- }
31676
- this.updateValues();
31677
- popup.close();
31678
- },
31679
- filebrowser: (data) => {
31680
- if (data &&
31681
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isArray)(data.files) &&
31682
- data.files.length) {
31683
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.attr)(this.state.image, 'src', data.files[0]);
31684
- popup.close();
31685
- this.updateValues();
31686
- }
31687
- }
31688
- }, this.state.image, popup.close))
31689
- .open(() => (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.position)(changeImage));
31690
- event.stopPropagation();
31432
+ __lock() {
31433
+ this.dialog.lock();
31434
+ this.form.setMod('lock', true);
31435
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = true));
31436
+ }
31437
+ __unlock() {
31438
+ this.dialog.unlock();
31439
+ this.form.setMod('lock', false);
31440
+ Object.values(this.__buttons).forEach(b => (b.state.disabled = false));
31691
31441
  }
31692
31442
  /** @override **/
31693
31443
  afterInit(editor) {
@@ -31698,7 +31448,7 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31698
31448
  .off(editor.editor, '.imageproperties')
31699
31449
  .on(editor.editor, 'dblclick.imageproperties', (e) => {
31700
31450
  const image = e.target;
31701
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(image, 'img')) {
31451
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(image, 'img')) {
31702
31452
  return;
31703
31453
  }
31704
31454
  if (editor.o.image.openOnDblClick) {
@@ -31706,7 +31456,8 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31706
31456
  false) {
31707
31457
  return;
31708
31458
  }
31709
- self.state.image = image;
31459
+ self.state.sourceImage = image;
31460
+ self.state.image = image.cloneNode(true);
31710
31461
  if (!editor.o.readonly) {
31711
31462
  e.stopImmediatePropagation();
31712
31463
  e.preventDefault();
@@ -31720,206 +31471,1252 @@ class imageProperties extends jodit_modules__WEBPACK_IMPORTED_MODULE_4__.Plugin
31720
31471
  });
31721
31472
  })
31722
31473
  .on('openImageProperties.imageproperties', (image) => {
31723
- this.state.image = image;
31474
+ self.state.sourceImage = image;
31475
+ this.state.image = image.cloneNode(true);
31724
31476
  this.open();
31725
31477
  });
31726
31478
  }
31479
+ async onStateValuesImageSrcChange() {
31480
+ const { image, values } = this.state;
31481
+ if (!image.src) {
31482
+ return;
31483
+ }
31484
+ try {
31485
+ this.__lock();
31486
+ await image.decode();
31487
+ if (this.state.sizeIsLocked && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isNumeric)(values.imageWidth)) {
31488
+ const w = parseFloat(values.imageWidth.toString());
31489
+ values.imageHeight = Math.round(w / this.state.ratio);
31490
+ }
31491
+ this.j.e.fire('updateImageProperties.imageproperties', image);
31492
+ }
31493
+ catch (e) {
31494
+ this.j.alert(e.message);
31495
+ }
31496
+ finally {
31497
+ this.__unlock();
31498
+ }
31499
+ }
31727
31500
  /** @override */
31728
31501
  beforeDestruct(editor) {
31729
- this.dialog && this.dialog.destruct();
31502
+ Object.values((0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, '__buttons') ?? {}).forEach(b => b.destruct());
31503
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'dialog')?.destruct();
31504
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cached)(this, 'form')?.destruct();
31730
31505
  editor.e.off(editor.editor, '.imageproperties').off('.imageproperties');
31731
31506
  }
31732
31507
  }
31733
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31734
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.marginIsLocked')
31735
- ], imageProperties.prototype, "onChangeMarginIsLocked", null);
31736
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31737
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31738
- ], imageProperties.prototype, "onChangeSizeIsLocked", null);
31739
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31740
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31741
- ], imageProperties.prototype, "onApply", null);
31742
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31743
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31744
- ], imageProperties.prototype, "openImageEditor", null);
31745
- (0,tslib__WEBPACK_IMPORTED_MODULE_11__/* .__decorate */ .Cg)([
31746
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
31747
- ], imageProperties.prototype, "openImagePopup", null);
31748
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
31508
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31509
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31510
+ ], imageProperties.prototype, "form", null);
31511
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31512
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31513
+ ], imageProperties.prototype, "dialog", null);
31514
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31515
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.cache
31516
+ ], imageProperties.prototype, "__buttons", null);
31517
+ (0,tslib__WEBPACK_IMPORTED_MODULE_12__/* .__decorate */ .Cg)([
31518
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.image')
31519
+ ], imageProperties.prototype, "onStateValuesImageSrcChange", null);
31520
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('imageProperties', imageProperties);
31749
31521
 
31750
31522
 
31751
31523
  /***/ }),
31752
31524
 
31753
- /***/ 98231:
31525
+ /***/ 81091:
31754
31526
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31755
31527
 
31756
31528
  "use strict";
31757
31529
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31758
- /* harmony export */ Z: function() { return /* binding */ form; }
31530
+ /* harmony export */ g: function() { return /* binding */ readAlign; }
31759
31531
  /* harmony export */ });
31760
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80004);
31532
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4401);
31533
+ /*!
31534
+ * Jodit Editor (https://xdsoft.net/jodit/)
31535
+ * Released under MIT see LICENSE.txt in the project root for license information.
31536
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31537
+ */
31538
+
31539
+ /** @private */
31540
+ function readAlign(image, values) {
31541
+ // Align
31542
+ if (image.style.cssFloat &&
31543
+ ['left', 'right'].indexOf(image.style.cssFloat.toLowerCase()) !== -1) {
31544
+ values.align = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'float');
31545
+ }
31546
+ else {
31547
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_0__/* .css */ .A)(image, 'display') === 'block' &&
31548
+ image.style.marginLeft === 'auto' &&
31549
+ image.style.marginRight === 'auto') {
31550
+ values.align = 'center';
31551
+ }
31552
+ else {
31553
+ values.align = '';
31554
+ }
31555
+ }
31556
+ }
31557
+
31558
+
31559
+ /***/ }),
31560
+
31561
+ /***/ 61566:
31562
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31563
+
31564
+ "use strict";
31565
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31566
+ /* harmony export */ U: function() { return /* binding */ readValuesFromImage; }
31567
+ /* harmony export */ });
31568
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97099);
31569
+ /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81091);
31570
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33756);
31571
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51462);
31572
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60225);
31573
+ /*!
31574
+ * Jodit Editor (https://xdsoft.net/jodit/)
31575
+ * Released under MIT see LICENSE.txt in the project root for license information.
31576
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31577
+ */
31578
+
31579
+
31580
+
31581
+
31582
+
31583
+ /**
31584
+ * Read values from image and set it to state
31585
+ * @private
31586
+ */
31587
+ async function readValuesFromImage(j, state) {
31588
+ const { sourceImage: image, values } = state;
31589
+ (0,_align__WEBPACK_IMPORTED_MODULE_3__/* .readAlign */ .g)(image, values);
31590
+ // Border radius
31591
+ values.borderRadius = parseInt(image.style.borderRadius || '0', 10) || 0;
31592
+ // Id
31593
+ values.id = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'id') || '';
31594
+ // Title
31595
+ values.imageTitle = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'title') || '';
31596
+ // Alt
31597
+ values.imageAlt = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'alt') || '';
31598
+ // Style
31599
+ values.style = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'style') || '';
31600
+ // Classes
31601
+ values.classes = ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'class') || '').replace(/jodit_focused_image[\s]*/, '');
31602
+ // Margins
31603
+ (0,_margin__WEBPACK_IMPORTED_MODULE_4__/* .readMargins */ .E)(image, values, state);
31604
+ // Link
31605
+ (0,_link__WEBPACK_IMPORTED_MODULE_1__/* .readLink */ .X)(state, j, values);
31606
+ // Src
31607
+ values.imageSrc = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'src') || '';
31608
+ // Image size
31609
+ return (0,_size__WEBPACK_IMPORTED_MODULE_2__/* .readSizes */ .P)(image, values, state);
31610
+ }
31611
+
31612
+
31613
+ /***/ }),
31614
+
31615
+ /***/ 33756:
31616
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31617
+
31618
+ "use strict";
31619
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31620
+ /* harmony export */ X: function() { return /* binding */ readLink; }
31621
+ /* harmony export */ });
31622
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23545);
31623
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97099);
31761
31624
  /*!
31762
31625
  * Jodit Editor (https://xdsoft.net/jodit/)
31763
31626
  * Released under MIT see LICENSE.txt in the project root for license information.
31764
31627
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31765
31628
  */
31766
31629
 
31767
- function form(editor) {
31768
- const { showPreview, editSize } = editor.o.image, gi = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.get.bind(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I);
31769
- return editor.c.fromHTML(`<form class="jodit-properties">
31630
+
31631
+ /** @private */
31632
+ function readLink(state, j, values) {
31633
+ const a = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(state.sourceImage, 'a', j.editor);
31634
+ if (a) {
31635
+ values.imageLink = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'href') || '';
31636
+ values.imageLinkOpenInNewTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(a, 'target') === '_blank';
31637
+ }
31638
+ else {
31639
+ values.imageLink = '';
31640
+ values.imageLinkOpenInNewTab = false;
31641
+ }
31642
+ }
31643
+
31644
+
31645
+ /***/ }),
31646
+
31647
+ /***/ 51462:
31648
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31649
+
31650
+ "use strict";
31651
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31652
+ /* harmony export */ E: function() { return /* binding */ readMargins; }
31653
+ /* harmony export */ });
31654
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18014);
31655
+ /*!
31656
+ * Jodit Editor (https://xdsoft.net/jodit/)
31657
+ * Released under MIT see LICENSE.txt in the project root for license information.
31658
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31659
+ */
31660
+
31661
+ /** @private */
31662
+ function readMargins(image, values, state) {
31663
+ // Margins
31664
+ let equal = true, wasEmptyField = false;
31665
+ ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'].forEach(id => {
31666
+ let value = image.style.getPropertyValue((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_0__/* .kebabCase */ .k)(id));
31667
+ if (!value) {
31668
+ wasEmptyField = true;
31669
+ values[id] = 0;
31670
+ return;
31671
+ }
31672
+ if (/^[0-9]+(px)?$/.test(value)) {
31673
+ value = parseInt(value, 10);
31674
+ }
31675
+ values[id] = value;
31676
+ if ((wasEmptyField && values[id]) ||
31677
+ (equal && id !== 'marginTop' && values[id] !== values.marginTop)) {
31678
+ equal = false;
31679
+ }
31680
+ });
31681
+ state.marginIsLocked = equal;
31682
+ }
31683
+
31684
+
31685
+ /***/ }),
31686
+
31687
+ /***/ 60225:
31688
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31689
+
31690
+ "use strict";
31691
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31692
+ /* harmony export */ P: function() { return /* binding */ readSizes; }
31693
+ /* harmony export */ });
31694
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59372);
31695
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97099);
31696
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4401);
31697
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10926);
31698
+ /*!
31699
+ * Jodit Editor (https://xdsoft.net/jodit/)
31700
+ * Released under MIT see LICENSE.txt in the project root for license information.
31701
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31702
+ */
31703
+
31704
+
31705
+
31706
+
31707
+ /** @private */
31708
+ async function readSizes(image, values, state) {
31709
+ await image.decode();
31710
+ const width = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, 'width', true) || false;
31711
+ const height = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height') || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, 'height', true) || false;
31712
+ values.imageWidth =
31713
+ width !== false
31714
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(width)
31715
+ : image.offsetWidth || image.naturalWidth;
31716
+ values.imageHeight =
31717
+ height !== false
31718
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeFromString */ .G)(height)
31719
+ : image.offsetHeight || image.naturalHeight;
31720
+ const { imageWidth, imageHeight } = values;
31721
+ const w = parseFloat(imageWidth.toString());
31722
+ if (!(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__/* .isNumeric */ .k)(imageWidth) || !(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_3__/* .isNumeric */ .k)(imageHeight)) {
31723
+ state.sizeIsLocked = false;
31724
+ return;
31725
+ }
31726
+ if (height === false) {
31727
+ values.imageHeight = Math.round(w / state.ratio);
31728
+ state.sizeIsLocked = true;
31729
+ return;
31730
+ }
31731
+ const h = parseFloat(imageHeight.toString());
31732
+ state.sizeIsLocked = Math.abs(w - h * state.ratio) < 1;
31733
+ }
31734
+
31735
+
31736
+ /***/ }),
31737
+
31738
+ /***/ 91675:
31739
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31740
+
31741
+ "use strict";
31742
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31743
+ /* harmony export */ l: function() { return /* binding */ UIImagePropertiesForm; }
31744
+ /* harmony export */ });
31745
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
31746
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53557);
31747
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(12222);
31748
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9596);
31749
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1530);
31750
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80004);
31751
+ /* harmony import */ var jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21391);
31752
+ /* harmony import */ var _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(26282);
31753
+ /* harmony import */ var _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26180);
31754
+ /*!
31755
+ * Jodit Editor (https://xdsoft.net/jodit/)
31756
+ * Released under MIT see LICENSE.txt in the project root for license information.
31757
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31758
+ */
31759
+
31760
+
31761
+
31762
+
31763
+
31764
+
31765
+
31766
+
31767
+
31768
+
31769
+ /** @private */
31770
+ let UIImagePropertiesForm = class UIImagePropertiesForm extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_2__/* .UIGroup */ .U {
31771
+ className() {
31772
+ return 'UIImagePropertiesForm';
31773
+ }
31774
+ appendChildToContainer() { }
31775
+ getElm(elementName) {
31776
+ const selfElm = super.getElm(elementName);
31777
+ if (selfElm) {
31778
+ return selfElm;
31779
+ }
31780
+ for (const child of this.elements) {
31781
+ const elm = child.getElm(elementName);
31782
+ if (elm) {
31783
+ return elm;
31784
+ }
31785
+ }
31786
+ return null;
31787
+ }
31788
+ constructor(jodit, state, activeTabState, handlers) {
31789
+ super(jodit);
31790
+ this.state = state;
31791
+ this.handlers = handlers;
31792
+ this.__mainTab = new _ui_image_main_tab__WEBPACK_IMPORTED_MODULE_5__/* .UIImageMainTab */ .k(this.jodit, this.state, this.handlers);
31793
+ this.__positionTab = new _ui_image_position_tab__WEBPACK_IMPORTED_MODULE_6__/* .UIImagePositionTab */ ._(this.jodit, this.state, this.handlers);
31794
+ this.getElm('tabsBox').appendChild((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_4__/* .TabsWidget */ .Zg)(jodit, [
31795
+ { name: 'Image', content: this.__mainTab },
31796
+ { name: 'Advanced', content: this.__positionTab }
31797
+ ], activeTabState));
31798
+ this.setMod('lock-size', this.state.sizeIsLocked);
31799
+ this.append(this.__mainTab).append(this.__positionTab);
31800
+ }
31801
+ render() {
31802
+ return `<form>
31770
31803
  <div class="jodit-grid jodit-grid_xs-column">
31771
31804
  <div class="jodit_col-lg-2-5 jodit_col-xs-5-5">
31772
- <div class="jodit-properties_view_box">
31773
- <div style="${!showPreview ? 'display:none' : ''}" class="jodit-properties_image_view">
31774
- <img data-ref="imageViewSrc" src="" alt=""/>
31805
+ <div class="&__view-box">
31806
+ <div class="&__imageView">
31807
+ <img class="&__imageViewSrc" src="" alt=""/>
31775
31808
  </div>
31776
- <div style="${!editSize ? 'display:none' : ''}" class="jodit-form__group jodit-properties_image_sizes">
31777
- <input data-ref="imageWidth" type="text" class="jodit-input"/>
31778
- <a data-ref="lockSize" class="jodit-properties__lock">${gi('lock')}</a>
31779
- <input data-ref="imageHeight" type="text" class="imageHeight jodit-input"/>
31809
+ <div class="jodit-form__group &__imageSizes">
31810
+ <input type="text" class="jodit-input &__imageWidth"/>
31811
+ <a class="&__lockSize">${jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get('lock')}</a>
31812
+ <input type="text" class="&__imageHeight jodit-input"/>
31780
31813
  </div>
31781
31814
  </div>
31782
31815
  </div>
31783
- <div data-ref="tabsBox" class="jodit_col-lg-3-5 jodit_col-xs-5-5"></div>
31816
+ <div class="jodit_col-lg-3-5 jodit_col-xs-5-5 &__tabsBox"></div>
31784
31817
  </div>
31785
- </form>`);
31786
- }
31818
+ </form>`;
31819
+ }
31820
+ onChangeSizeIsLocked() {
31821
+ const lockSize = this.getElm('lockSize');
31822
+ const imageWidth = this.getElm('imageWidth');
31823
+ lockSize.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
31824
+ this.setMod('lock-size', this.state.sizeIsLocked);
31825
+ this.j.e.fire(imageWidth, 'change');
31826
+ }
31827
+ onLockSizeClick() {
31828
+ this.state.sizeIsLocked = !this.state.sizeIsLocked;
31829
+ }
31830
+ onStateValuesSizeChange() {
31831
+ const imageWidth = this.getElm('imageWidth');
31832
+ const imageHeight = this.getElm('imageHeight');
31833
+ if (imageWidth !== this.j.od.activeElement) {
31834
+ imageWidth.value = this.state.values.imageWidth.toString();
31835
+ }
31836
+ if (imageHeight !== this.j.od.activeElement) {
31837
+ imageHeight.value = this.state.values.imageHeight.toString();
31838
+ }
31839
+ }
31840
+ onImageWidthChange(e) {
31841
+ const imageWidth = this.getElm('imageWidth');
31842
+ const imageHeight = this.getElm('imageHeight');
31843
+ if (!this.state.sizeIsLocked ||
31844
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageWidth.value) ||
31845
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(imageHeight.value)) {
31846
+ this.state.values.imageWidth = imageWidth.value;
31847
+ this.state.values.imageHeight = imageHeight.value;
31848
+ return;
31849
+ }
31850
+ const w = parseFloat(imageWidth.value), h = parseFloat(imageHeight.value);
31851
+ if (e.target === imageWidth) {
31852
+ this.state.values.imageWidth = w;
31853
+ this.state.values.imageHeight = Math.round(w / this.state.ratio);
31854
+ }
31855
+ else {
31856
+ this.state.values.imageWidth = Math.round(h * this.state.ratio);
31857
+ this.state.values.imageHeight = h;
31858
+ }
31859
+ }
31860
+ onStateValuesImageSrcChange() {
31861
+ const { imageSrc } = this.state.values;
31862
+ if (!imageSrc) {
31863
+ return;
31864
+ }
31865
+ const imageViewSrc = this.getElm('imageViewSrc');
31866
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(imageViewSrc, 'src', imageSrc);
31867
+ const image = new Image();
31868
+ image.src = imageSrc;
31869
+ this.state.image = image;
31870
+ }
31871
+ hideFieldByOptions() {
31872
+ const opt = this.j.o.image;
31873
+ [
31874
+ ['editSize', 'imageSizes'],
31875
+ ['showPreview', 'imageView']
31876
+ ].forEach(([optKey, elmKey]) => {
31877
+ const elm = this.getElm(elmKey);
31878
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(elm, 'display', opt[optKey] ? null : 'none');
31879
+ });
31880
+ }
31881
+ };
31882
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31883
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31884
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.sizeIsLocked')
31885
+ ], UIImagePropertiesForm.prototype, "onChangeSizeIsLocked", null);
31886
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31887
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('lockSize:click')
31888
+ ], UIImagePropertiesForm.prototype, "onLockSizeClick", null);
31889
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31890
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31891
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)(['state.values.imageWidth', 'state.values.imageHeight'])
31892
+ ], UIImagePropertiesForm.prototype, "onStateValuesSizeChange", null);
31893
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31894
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([
31895
+ 'imageWidth:change',
31896
+ 'imageHeight:change',
31897
+ 'imageWidth:keydown',
31898
+ 'imageHeight:keydown',
31899
+ 'imageWidth:mousedown',
31900
+ 'imageHeight:mousedown',
31901
+ 'imageWidth:paste',
31902
+ 'imageHeight:paste'
31903
+ ]),
31904
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)()
31905
+ ], UIImagePropertiesForm.prototype, "onImageWidthChange", null);
31906
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31907
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready'),
31908
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)('state.values.imageSrc')
31909
+ ], UIImagePropertiesForm.prototype, "onStateValuesImageSrcChange", null);
31910
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31911
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready')
31912
+ ], UIImagePropertiesForm.prototype, "hideFieldByOptions", null);
31913
+ UIImagePropertiesForm = (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
31914
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_8__/* .component */ .s
31915
+ ], UIImagePropertiesForm);
31916
+
31787
31917
 
31788
31918
 
31789
31919
  /***/ }),
31790
31920
 
31791
- /***/ 9118:
31921
+ /***/ 26282:
31792
31922
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31793
31923
 
31794
31924
  "use strict";
31795
31925
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31796
- /* harmony export */ J: function() { return /* binding */ mainTab; }
31926
+ /* harmony export */ k: function() { return /* binding */ UIImageMainTab; }
31797
31927
  /* harmony export */ });
31798
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80004);
31928
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
31929
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12222);
31930
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27582);
31931
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24014);
31932
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9596);
31933
+ /* harmony import */ var jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1530);
31799
31934
  /*!
31800
31935
  * Jodit Editor (https://xdsoft.net/jodit/)
31801
31936
  * Released under MIT see LICENSE.txt in the project root for license information.
31802
31937
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31803
31938
  */
31804
31939
 
31805
- function mainTab(editor) {
31806
- const opt = editor.o, i18n = editor.i18n.bind(editor), gi = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.get.bind(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I), hasFbUrl = opt.filebrowser.ajax.url || opt.uploader.url, hasEditor = opt.image.useImageEditor;
31807
- return editor.c.fromHTML(`<div style="${!opt.image.editSrc ? 'display:none' : ''}" class="jodit-form__group">
31808
- <label>${i18n('Src')}</label>
31940
+
31941
+
31942
+
31943
+
31944
+
31945
+ /** @private */
31946
+ let UIImageMainTab = class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UIGroup */ .U {
31947
+ className() {
31948
+ return 'UIImageMainTab';
31949
+ }
31950
+ appendChildToContainer() {
31951
+ // Do nothing
31952
+ }
31953
+ constructor(view, state, handlers) {
31954
+ super(view);
31955
+ this.state = state;
31956
+ this.handlers = handlers;
31957
+ }
31958
+ render() {
31959
+ return `<div class="jodit-form__group &__editSrc">
31960
+ <label>~Src~</label>
31809
31961
  <div class="jodit-input_group">
31810
- <input data-ref="imageSrc" class="jodit-input" type="text"/>
31811
- <div
31812
- class="jodit-input_group-buttons"
31813
- style="${hasFbUrl ? '' : 'display: none'}"
31814
- >
31815
- <a
31816
- data-ref="changeImage"
31817
- class="jodit-button"
31818
- >${gi('image')}</a>
31819
- <a
31820
- data-ref="editImage"
31821
- class="jodit-button"
31822
- style="${hasEditor ? '' : 'display: none'}"
31823
- >${gi('crop')}</a>
31962
+ <input class="jodit-input &__imageSrc" type="text"/>
31963
+ <div class="jodit-input_group-buttons &__fixImage">
31964
+ <a class="jodit-button &__changeImage">*image*</a>
31965
+ <a class="jodit-button &__editImage">*crop*</a>
31824
31966
  </div>
31825
31967
  </div>
31826
31968
  </div>
31827
- <div style="${!opt.image.editTitle ? 'display:none' : ''}" class="jodit-form__group">
31828
- <label>${i18n('Title')}</label>
31829
- <input data-ref="imageTitle" type="text" class="jodit-input"/>
31969
+ <div class="jodit-form__group &__editTitle">
31970
+ <label>~Title~</label>
31971
+ <input type="text" class="jodit-input &__imageTitle"/>
31830
31972
  </div>
31831
- <div style="${!opt.image.editAlt ? 'display:none' : ''}" class="jodit-form__group">
31832
- <label>${i18n('Alternative')}</label>
31833
- <input data-ref="imageAlt" type="text" class="jodit-input"/>
31973
+ <div class="jodit-form__group &__editAlt">
31974
+ <label>~Alternative~</label>
31975
+ <input type="text" class="jodit-input &__imageAlt"/>
31834
31976
  </div>
31835
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31836
- <label>${i18n('Link')}</label>
31837
- <input data-ref="imageLink" type="text" class="jodit-input"/>
31977
+ <div class="jodit-form__group &__editLink">
31978
+ <label>~Link~</label>
31979
+ <input type="text" class="jodit-input &__imageLink"/>
31838
31980
  </div>
31839
- <div style="${!opt.image.editLink ? 'display:none' : ''}" class="jodit-form__group">
31981
+ <div class="jodit-form__group &__editLinkTarget">
31840
31982
  <label class="jodit_vertical_middle">
31841
- <input data-ref="imageLinkOpenInNewTab" type="checkbox" class="jodit-checkbox"/>
31842
- <span>${i18n('Open link in new tab')}</span>
31983
+ <input type="checkbox" class="jodit-checkbox &__imageLinkOpenInNewTab"/>
31984
+ <span>~Open link in new tab~</span>
31843
31985
  </label>
31844
- </div>`);
31845
- }
31986
+ </div>`;
31987
+ }
31988
+ async onStateImageSrcChange() {
31989
+ const imageSrc = this.getElm('imageSrc');
31990
+ imageSrc.value = this.state.values.imageSrc;
31991
+ }
31992
+ onImageSrcChange() {
31993
+ this.state.values.imageSrc = this.getElm('imageSrc').value;
31994
+ }
31995
+ /**
31996
+ * Open image editor
31997
+ */
31998
+ onEditImageClick(e) {
31999
+ this.handlers.openImageEditor();
32000
+ e.stopPropagation();
32001
+ }
32002
+ /**
32003
+ * Open popup with filebrowser/uploader buttons for image
32004
+ */
32005
+ onChangeImageClick(e) {
32006
+ this.handlers.openImagePopup(this.getElm('changeImage'));
32007
+ e.stopPropagation();
32008
+ }
32009
+ onStateTitleChange() {
32010
+ const title = this.getElm('imageTitle');
32011
+ title.value = this.state.values.imageTitle;
32012
+ }
32013
+ onTitleChange() {
32014
+ this.state.values.imageTitle = this.getElm('imageTitle').value;
32015
+ }
32016
+ onStateAltChange() {
32017
+ const alt = this.getElm('imageAlt');
32018
+ alt.value = this.state.values.imageAlt;
32019
+ }
32020
+ onAltChange() {
32021
+ this.state.values.imageAlt = this.getElm('imageAlt').value;
32022
+ }
32023
+ onStateImageLinkChange() {
32024
+ const imageLink = this.getElm('imageLink');
32025
+ imageLink.value = this.state.values.imageLink;
32026
+ }
32027
+ onImageLinkChange() {
32028
+ this.state.values.imageLink = this.getElm('imageLink').value;
32029
+ }
32030
+ onStateImageLinkOpenInNewTabChange() {
32031
+ const imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab');
32032
+ imageLinkOpenInNewTab.checked = this.state.values.imageLinkOpenInNewTab;
32033
+ }
32034
+ onImageLinkOpenInNewTabChange() {
32035
+ this.state.values.imageLinkOpenInNewTab = this.getElm('imageLinkOpenInNewTab').checked;
32036
+ }
32037
+ hideFieldByOptions() {
32038
+ const o = this.j.o;
32039
+ const opt = o.image;
32040
+ [
32041
+ ['editSrc', 'editSrc'],
32042
+ ['editTitle', 'editTitle'],
32043
+ ['editAlt', 'editAlt'],
32044
+ ['editLink', 'editLink'],
32045
+ ['editLink', 'editLinkTarget'],
32046
+ ['useImageEditor', 'editImage']
32047
+ ].forEach(([optKey, elmKey]) => {
32048
+ const elm = this.getElm(elmKey);
32049
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
32050
+ });
32051
+ const changeImage = this.getElm('changeImage');
32052
+ const needShowChangeImage = Boolean(o.filebrowser.ajax.url || o.uploader.url);
32053
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(changeImage, 'display', needShowChangeImage ? null : 'none');
32054
+ const editImage = this.getElm('editImage');
32055
+ const needShowEditImage = Boolean(o.filebrowser.ajax.url) && opt.useImageEditor;
32056
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(editImage, 'display', needShowEditImage ? null : 'none');
32057
+ const fixImage = this.getElm('fixImage');
32058
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(fixImage, 'display', needShowChangeImage || needShowEditImage ? null : 'none');
32059
+ }
32060
+ };
32061
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32062
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageSrc')
32063
+ ], UIImageMainTab.prototype, "onStateImageSrcChange", null);
32064
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32065
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageSrc:change')
32066
+ ], UIImageMainTab.prototype, "onImageSrcChange", null);
32067
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32068
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('editImage:click')
32069
+ ], UIImageMainTab.prototype, "onEditImageClick", null);
32070
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32071
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('changeImage:click')
32072
+ ], UIImageMainTab.prototype, "onChangeImageClick", null);
32073
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32074
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageTitle')
32075
+ ], UIImageMainTab.prototype, "onStateTitleChange", null);
32076
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32077
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageTitle:change')
32078
+ ], UIImageMainTab.prototype, "onTitleChange", null);
32079
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32080
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageAlt')
32081
+ ], UIImageMainTab.prototype, "onStateAltChange", null);
32082
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32083
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageAlt:change')
32084
+ ], UIImageMainTab.prototype, "onAltChange", null);
32085
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32086
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLink')
32087
+ ], UIImageMainTab.prototype, "onStateImageLinkChange", null);
32088
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32089
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLink:change')
32090
+ ], UIImageMainTab.prototype, "onImageLinkChange", null);
32091
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32092
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.imageLinkOpenInNewTab')
32093
+ ], UIImageMainTab.prototype, "onStateImageLinkOpenInNewTabChange", null);
32094
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32095
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('imageLinkOpenInNewTab:change')
32096
+ ], UIImageMainTab.prototype, "onImageLinkOpenInNewTabChange", null);
32097
+ (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32098
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
32099
+ ], UIImageMainTab.prototype, "hideFieldByOptions", null);
32100
+ UIImageMainTab = (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
32101
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__/* .component */ .s
32102
+ ], UIImageMainTab);
32103
+
31846
32104
 
31847
32105
 
31848
32106
  /***/ }),
31849
32107
 
31850
- /***/ 85480:
32108
+ /***/ 26180:
31851
32109
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
31852
32110
 
31853
32111
  "use strict";
31854
32112
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31855
- /* harmony export */ b: function() { return /* binding */ positionTab; }
32113
+ /* harmony export */ _: function() { return /* binding */ UIImagePositionTab; }
31856
32114
  /* harmony export */ });
31857
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80004);
32115
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
32116
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(12222);
32117
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27582);
32118
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24014);
32119
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9596);
32120
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(26986);
32121
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97099);
32122
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65685);
32123
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80004);
32124
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(10926);
31858
32125
  /*!
31859
32126
  * Jodit Editor (https://xdsoft.net/jodit/)
31860
32127
  * Released under MIT see LICENSE.txt in the project root for license information.
31861
32128
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
31862
32129
  */
31863
32130
 
31864
- function positionTab(editor) {
31865
- const opt = editor.o, i18n = editor.i18n.bind(editor), gi = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.get.bind(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I);
31866
- const classInput = [];
31867
- if (opt.image.availableClasses.length > 0) {
31868
- classInput.push('<select data-ref="classes" class="jodit-input jodit-select">');
31869
- opt.image.availableClasses.forEach(item => {
31870
- if (typeof item === 'string') {
31871
- classInput.push(`<option value="${item}">${item}</option>`);
31872
- }
31873
- else {
31874
- classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
31875
- }
31876
- });
31877
- classInput.push('</select>');
32131
+
32132
+
32133
+
32134
+
32135
+
32136
+
32137
+
32138
+
32139
+
32140
+ /** @private */
32141
+ let UIImagePositionTab = class UIImagePositionTab extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_4__/* .UIElement */ .D {
32142
+ className() {
32143
+ return 'UIImagePositionTab';
31878
32144
  }
31879
- else {
31880
- classInput.push('<input data-ref="classes" type="text" class="jodit-input"/>');
32145
+ constructor(jodit, state, handlers) {
32146
+ super(jodit, {
32147
+ availableClasses: jodit.o.image.availableClasses
32148
+ });
32149
+ this.state = state;
32150
+ this.handlers = handlers;
31881
32151
  }
31882
- return editor.c.fromHTML(`<div style="${!opt.image.editMargins ? 'display:none' : ''}" class="jodit-form__group">
31883
- <label>${i18n('Margins')}</label>
32152
+ render({ availableClasses }) {
32153
+ return `<div class="jodit-form__group &__editMargins">
32154
+ <label>~Margins~</label>
31884
32155
  <div class="jodit-grid jodit_vertical_middle">
31885
- <input class="jodit_col-lg-1-5 jodit-input" data-ref="marginTop" type="text" placeholder="${i18n('top')}"/>
31886
- <a style="text-align: center;" data-ref="lockMargin" class="jodit-properties__lock jodit_col-lg-1-5">${gi('lock')}</a>
31887
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginRight" type="text" placeholder="${i18n('right')}"/>
31888
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginBottom" type="text" placeholder="${i18n('bottom')}"/>
31889
- <input disabled="true" class="jodit_col-lg-1-5 jodit-input" data-ref="marginLeft" type="text" placeholder="${i18n('left')}"/>
32156
+ <input class="jodit_col-lg-1-5 jodit-input &__marginTop" type="text" placeholder="~top~"/>
32157
+ <a style="text-align: center;" class="jodit-properties__lock jodit_col-lg-1-5 &__lockMargin">*lock*</a>
32158
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginRight" type="text" placeholder="~right~"/>
32159
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginBottom" type="text" placeholder="~bottom~"/>
32160
+ <input disabled="disabled" class="jodit_col-lg-1-5 jodit-input &__marginLeft" type="text" placeholder="~left~"/>
31890
32161
  </div>
31891
32162
  </div>
31892
- <div
31893
- style="${!opt.image.editAlign ? 'display:none' : ''}"
31894
- class="jodit-form__group"
31895
- >
31896
- <label>${i18n('Align')}</label>
31897
- <select data-ref="align" class="jodit-select">
31898
- <option value="">${i18n('--Not Set--')}</option>
31899
- <option value="left">${i18n('Left')}</option>
31900
- <option value="center">${i18n('Center')}</option>
31901
- <option value="right">${i18n('Right')}</option>
32163
+ <div class="jodit-form__group &__editAlign">
32164
+ <label>~Align~</label>
32165
+ <select class="jodit-select &__align">
32166
+ <option value="">~--Not Set--~</option>
32167
+ <option value="left">~Left~</option>
32168
+ <option value="center">~Center~</option>
32169
+ <option value="right">~Right~</option>
31902
32170
  </select>
31903
32171
  </div>
31904
- <div style="${!opt.image.editStyle ? 'display:none' : ''}" class="jodit-form__group">
31905
- <label>${i18n('Styles')}</label>
31906
- <input data-ref="style" type="text" class="jodit-input"/>
32172
+ <div class="jodit-form__group &__editStyle">
32173
+ <label>~Styles~</label>
32174
+ <input type="text" class="jodit-input &__style"/>
31907
32175
  </div>
31908
- <div style="${!opt.image.editClass ? 'display:none' : ''}" class="jodit-form__group">
31909
- <label>${i18n('Classes')}</label>
31910
- ${classInput.join('')}
32176
+ <div class="jodit-form__group &__editClass">
32177
+ <label>~Classes~</label>
32178
+ ${(() => {
32179
+ const classInput = [];
32180
+ if (availableClasses && availableClasses.length > 0) {
32181
+ classInput.push('<select class="jodit-input jodit-select &__classes">');
32182
+ availableClasses.forEach(item => {
32183
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .K)(item)) {
32184
+ classInput.push(`<option value="${item}">${item}</option>`);
32185
+ }
32186
+ else {
32187
+ classInput.push(`<option value="${item[0]}">${item[1]}</option>`);
32188
+ }
32189
+ });
32190
+ classInput.push('</select>');
32191
+ }
32192
+ else {
32193
+ classInput.push('<input type="text" class="jodit-input &__classes"/>');
32194
+ }
32195
+ return classInput.join('');
32196
+ })()}
31911
32197
  </div>
31912
- <div style="${!opt.image.editId ? 'display:none' : ''}" class="jodit-form__group">
32198
+ <div class="jodit-form__group &__editId">
31913
32199
  <label>Id</label>
31914
- <input data-ref="id" type="text" class="jodit-input"/>
32200
+ <input type="text" class="jodit-input &__id"/>
31915
32201
  </div>
31916
32202
  <div
31917
- style="${!opt.image.editBorderRadius ? 'display:none' : ''}"
31918
- class="jodit-form__group"
32203
+ class="jodit-form__group &__editBorderRadius"
31919
32204
  >
31920
- <label>${i18n('Border radius')}</label>
31921
- <input data-ref="borderRadius" type="number" class="jodit-input"/>
31922
- </div>`);
32205
+ <label>~Border radius~</label>
32206
+ <input type="number" class="jodit-input &__borderRadius"/>
32207
+ </div>`;
32208
+ }
32209
+ onStateAlignChange() {
32210
+ const align = this.getElm('align');
32211
+ align.value = this.state.values.align;
32212
+ }
32213
+ onChangeAlign() {
32214
+ const align = this.getElm('align');
32215
+ this.state.values.align = align.value;
32216
+ }
32217
+ onStateValuesBorderRadiusChange() {
32218
+ const borderRadius = this.getElm('borderRadius');
32219
+ borderRadius.value = this.state.values.borderRadius.toString();
32220
+ }
32221
+ onChangeBorderRadius() {
32222
+ const borderRadius = this.getElm('borderRadius');
32223
+ this.state.values.borderRadius = parseFloat(borderRadius.value);
32224
+ }
32225
+ onStateValuesIdChange() {
32226
+ const id = this.getElm('id');
32227
+ id.value = this.state.values.id;
32228
+ }
32229
+ onChangeId() {
32230
+ const id = this.getElm('id');
32231
+ this.state.values.id = id.value;
32232
+ }
32233
+ onStateValuesStyleChange() {
32234
+ const style = this.getElm('style');
32235
+ style.value = this.state.values.style;
32236
+ }
32237
+ onChangeStyle() {
32238
+ const style = this.getElm('style');
32239
+ this.state.values.style = style.value;
32240
+ }
32241
+ onStateValuesClassesChange() {
32242
+ const classes = this.getElm('classes');
32243
+ classes.value = this.state.values.classes;
32244
+ }
32245
+ onChangClasses() {
32246
+ const classes = this.getElm('classes');
32247
+ this.state.values.classes = classes.value;
32248
+ }
32249
+ onLockMarginClick(e) {
32250
+ this.state.marginIsLocked = !this.state.marginIsLocked;
32251
+ e.preventDefault();
32252
+ }
32253
+ onChangeMarginIsLocked() {
32254
+ const marginBottom = this.getElm('marginBottom');
32255
+ const marginRight = this.getElm('marginRight');
32256
+ const marginLeft = this.getElm('marginLeft');
32257
+ const lockMargin = this.getElm('lockMargin');
32258
+ [marginRight, marginBottom, marginLeft].forEach(elm => {
32259
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__/* .attr */ .C)(elm, 'disabled', this.state.marginIsLocked || null);
32260
+ });
32261
+ lockMargin.innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__/* .Icon */ .I.get(this.state.marginIsLocked ? 'lock' : 'unlock');
32262
+ if (this.state.marginIsLocked) {
32263
+ const marginTop = this.state.values.marginTop;
32264
+ this.state.values.marginRight = marginTop;
32265
+ this.state.values.marginBottom = marginTop;
32266
+ this.state.values.marginLeft = marginTop;
32267
+ }
32268
+ }
32269
+ onStateValuesMarginChange() {
32270
+ const marginTop = this.getElm('marginTop');
32271
+ const marginRight = this.getElm('marginRight');
32272
+ const marginBottom = this.getElm('marginBottom');
32273
+ const marginLeft = this.getElm('marginLeft');
32274
+ marginTop.value = this.state.values.marginTop.toString();
32275
+ marginRight.value = this.state.values.marginRight.toString();
32276
+ marginBottom.value = this.state.values.marginBottom.toString();
32277
+ marginLeft.value = this.state.values.marginLeft.toString();
32278
+ }
32279
+ onChangeMargin() {
32280
+ const marginTop = this.getElm('marginTop');
32281
+ const marginRight = this.getElm('marginRight');
32282
+ const marginBottom = this.getElm('marginBottom');
32283
+ const marginLeft = this.getElm('marginLeft');
32284
+ this.state.values.marginTop = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginTop.value);
32285
+ if (this.state.marginIsLocked) {
32286
+ this.state.values.marginRight = this.state.values.marginTop;
32287
+ this.state.values.marginBottom = this.state.values.marginTop;
32288
+ this.state.values.marginLeft = this.state.values.marginTop;
32289
+ }
32290
+ else {
32291
+ this.state.values.marginRight = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginRight.value);
32292
+ this.state.values.marginBottom = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginBottom.value);
32293
+ this.state.values.marginLeft = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_6__/* .normalSizeFromString */ .G)(marginLeft.value);
32294
+ }
32295
+ }
32296
+ hideFieldByOptions() {
32297
+ const opt = this.j.o.image;
32298
+ [
32299
+ ['editMargins', 'editMargins'],
32300
+ ['editAlign', 'editAlign'],
32301
+ ['editStyle', 'editStyle'],
32302
+ ['editClass', 'editClass'],
32303
+ ['editId', 'editId'],
32304
+ ['editBorderRadius', 'editBorderRadius']
32305
+ ].forEach(([optKey, elmKey]) => {
32306
+ const elm = this.getElm(elmKey);
32307
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display', opt[optKey] ? null : 'none');
32308
+ });
32309
+ }
32310
+ };
32311
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32312
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32313
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.align')
32314
+ ], UIImagePositionTab.prototype, "onStateAlignChange", null);
32315
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32316
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('align:change')
32317
+ ], UIImagePositionTab.prototype, "onChangeAlign", null);
32318
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32319
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32320
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.borderRadius')
32321
+ ], UIImagePositionTab.prototype, "onStateValuesBorderRadiusChange", null);
32322
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32323
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('borderRadius:change')
32324
+ ], UIImagePositionTab.prototype, "onChangeBorderRadius", null);
32325
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32326
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32327
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.id')
32328
+ ], UIImagePositionTab.prototype, "onStateValuesIdChange", null);
32329
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32330
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('id:change')
32331
+ ], UIImagePositionTab.prototype, "onChangeId", null);
32332
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32333
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32334
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.style')
32335
+ ], UIImagePositionTab.prototype, "onStateValuesStyleChange", null);
32336
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32337
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('style:change')
32338
+ ], UIImagePositionTab.prototype, "onChangeStyle", null);
32339
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32340
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32341
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.values.classes')
32342
+ ], UIImagePositionTab.prototype, "onStateValuesClassesChange", null);
32343
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32344
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('classes:change')
32345
+ ], UIImagePositionTab.prototype, "onChangClasses", null);
32346
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32347
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('lockMargin:click')
32348
+ ], UIImagePositionTab.prototype, "onLockMarginClick", null);
32349
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32350
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32351
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)('state.marginIsLocked')
32352
+ ], UIImagePositionTab.prototype, "onChangeMarginIsLocked", null);
32353
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32354
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready'),
32355
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32356
+ 'state.values.marginTop',
32357
+ 'state.values.marginRight',
32358
+ 'state.values.marginBottom',
32359
+ 'state.values.marginLeft'
32360
+ ])
32361
+ ], UIImagePositionTab.prototype, "onStateValuesMarginChange", null);
32362
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32363
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)([
32364
+ 'marginTop:change',
32365
+ 'marginRight:change',
32366
+ 'marginBottom:change',
32367
+ 'marginLeft:change'
32368
+ ])
32369
+ ], UIImagePositionTab.prototype, "onChangeMargin", null);
32370
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32371
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_0__/* .hook */ .A)('ready')
32372
+ ], UIImagePositionTab.prototype, "hideFieldByOptions", null);
32373
+ UIImagePositionTab = (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
32374
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_9__/* .component */ .s
32375
+ ], UIImagePositionTab);
32376
+
32377
+
32378
+
32379
+ /***/ }),
32380
+
32381
+ /***/ 77137:
32382
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32383
+
32384
+ "use strict";
32385
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32386
+ /* harmony export */ v: function() { return /* binding */ openImageEditorDialog; }
32387
+ /* harmony export */ });
32388
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26986);
32389
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97099);
32390
+ /* harmony import */ var jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60485);
32391
+ /*!
32392
+ * Jodit Editor (https://xdsoft.net/jodit/)
32393
+ * Released under MIT see LICENSE.txt in the project root for license information.
32394
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32395
+ */
32396
+
32397
+
32398
+
32399
+ /**
32400
+ * Open image editor dialog
32401
+ * @private
32402
+ */
32403
+ function openImageEditorDialog(j, state) {
32404
+ const url = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(state.image, 'src') || '', a = j.c.element('a'), loadExternal = () => {
32405
+ if (a.host !== location.host) {
32406
+ j.confirm('You can only edit your own images. Download this image on the host?', yes => {
32407
+ if (yes && j.uploader) {
32408
+ j.uploader.uploadRemoteImage(a.href.toString(), resp => {
32409
+ j.alert('The image has been successfully uploaded to the host!', () => {
32410
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .K)(resp.newfilename)) {
32411
+ state.values.imageSrc =
32412
+ resp.baseurl +
32413
+ resp.newfilename;
32414
+ }
32415
+ });
32416
+ }, error => {
32417
+ j.alert('There was an error loading %s', error.message);
32418
+ });
32419
+ }
32420
+ });
32421
+ return;
32422
+ }
32423
+ };
32424
+ a.href = url;
32425
+ j.filebrowser.dataProvider
32426
+ .getPathByUrl(a.href.toString())
32427
+ .then(resp => {
32428
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_1__/* .openImageEditor */ .B.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
32429
+ const timestamp = new Date().getTime();
32430
+ state.values.imageSrc =
32431
+ url +
32432
+ (url.indexOf('?') !== -1 ? '' : '?') +
32433
+ '&_tmp=' +
32434
+ timestamp.toString();
32435
+ }, error => {
32436
+ j.alert(error.message);
32437
+ });
32438
+ })
32439
+ .catch(error => {
32440
+ j.alert(error.message, loadExternal);
32441
+ });
32442
+ }
32443
+
32444
+
32445
+ /***/ }),
32446
+
32447
+ /***/ 91852:
32448
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32449
+
32450
+ "use strict";
32451
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32452
+ /* harmony export */ q: function() { return /* binding */ openImagePopup; }
32453
+ /* harmony export */ });
32454
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55010);
32455
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43977);
32456
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34138);
32457
+ /* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31784);
32458
+ /*!
32459
+ * Jodit Editor (https://xdsoft.net/jodit/)
32460
+ * Released under MIT see LICENSE.txt in the project root for license information.
32461
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32462
+ */
32463
+
32464
+
32465
+
32466
+
32467
+ /** @private */
32468
+ function openImagePopup(j, dialog, state, button) {
32469
+ const popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_0__/* .Popup */ .z(dialog);
32470
+ const closePopup = () => {
32471
+ popup.close();
32472
+ popup.destruct();
32473
+ };
32474
+ popup
32475
+ .setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__/* .FileSelectorWidget */ .k)(j, {
32476
+ upload: (data) => {
32477
+ if (data.files && data.files.length) {
32478
+ state.values.imageSrc =
32479
+ data.baseurl + data.files[0];
32480
+ }
32481
+ closePopup();
32482
+ },
32483
+ filebrowser: async (data) => {
32484
+ if (data && (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_2__/* .isArray */ .c)(data.files) && data.files.length) {
32485
+ state.values.imageSrc = data.files[0];
32486
+ closePopup();
32487
+ }
32488
+ }
32489
+ }, state.image, closePopup))
32490
+ .open(() => (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_3__/* .position */ .G)(button));
32491
+ }
32492
+
32493
+
32494
+ /***/ }),
32495
+
32496
+ /***/ 10926:
32497
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32498
+
32499
+ "use strict";
32500
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32501
+ /* harmony export */ G: function() { return /* binding */ normalSizeFromString; },
32502
+ /* harmony export */ n: function() { return /* binding */ normalSizeToString; }
32503
+ /* harmony export */ });
32504
+ /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72558);
32505
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22718);
32506
+ /*!
32507
+ * Jodit Editor (https://xdsoft.net/jodit/)
32508
+ * Released under MIT see LICENSE.txt in the project root for license information.
32509
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32510
+ */
32511
+
32512
+
32513
+ /** @private */
32514
+ const normalSizeFromString = (value) => {
32515
+ return /^[-+]?[0-9.]+(px)?$/.test(value.toString())
32516
+ ? parseFloat(value.toString())
32517
+ : value;
32518
+ };
32519
+ /** @private */
32520
+ const normalSizeToString = (value) => {
32521
+ if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_1__/* .isNumber */ .E)(value)) {
32522
+ return value ? value + 'px' : value.toString();
32523
+ }
32524
+ value = (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_0__/* .trim */ .Bq)(value);
32525
+ return /^[0-9]+$/.test(value) ? value + 'px' : value;
32526
+ };
32527
+
32528
+
32529
+ /***/ }),
32530
+
32531
+ /***/ 48570:
32532
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32533
+
32534
+ "use strict";
32535
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32536
+ /* harmony export */ j: function() { return /* binding */ applyValuesToImage; }
32537
+ /* harmony export */ });
32538
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23545);
32539
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71122);
32540
+ /* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9144);
32541
+ /* harmony import */ var _margin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82714);
32542
+ /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26277);
32543
+ /*!
32544
+ * Jodit Editor (https://xdsoft.net/jodit/)
32545
+ * Released under MIT see LICENSE.txt in the project root for license information.
32546
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32547
+ */
32548
+
32549
+
32550
+
32551
+
32552
+
32553
+ /**
32554
+ * Apply form's values to image
32555
+ * @private
32556
+ */
32557
+ function applyValuesToImage(j, state, image) {
32558
+ const { style, imageSrc, borderRadius, imageTitle, imageAlt, imageLink, imageWidth, imageHeight, marginTop, marginRight, marginBottom, marginLeft, imageLinkOpenInNewTab, align, classes, id } = state.values;
32559
+ const opt = j.o;
32560
+ // styles
32561
+ if (opt.image.editStyle) {
32562
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'style', style || null);
32563
+ }
32564
+ // Src
32565
+ if (imageSrc) {
32566
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'src', imageSrc);
32567
+ }
32568
+ else {
32569
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(image);
32570
+ return;
32571
+ }
32572
+ // Border radius
32573
+ image.style.borderRadius = borderRadius ? borderRadius + 'px' : '';
32574
+ // Title
32575
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'title', imageTitle || null);
32576
+ // Alt
32577
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'alt', imageAlt || null);
32578
+ // Link
32579
+ (0,_link__WEBPACK_IMPORTED_MODULE_2__/* .applyLink */ .j)(j, image, imageLink, imageLinkOpenInNewTab);
32580
+ // Size
32581
+ (0,_size__WEBPACK_IMPORTED_MODULE_4__/* .applySize */ .q)(image, imageWidth, imageHeight, state.sizeIsLocked);
32582
+ // Margin
32583
+ if (j.o.image.editMargins) {
32584
+ (0,_margin__WEBPACK_IMPORTED_MODULE_3__/* .applyMargin */ .N)(j, marginTop, marginRight, marginBottom, marginLeft, image, state.marginIsLocked);
32585
+ }
32586
+ if (opt.image.editClass) {
32587
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'class', classes || null);
32588
+ }
32589
+ if (opt.image.editId) {
32590
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
32591
+ }
32592
+ if (opt.image.editAlign) {
32593
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align);
32594
+ }
32595
+ }
32596
+
32597
+
32598
+ /***/ }),
32599
+
32600
+ /***/ 9144:
32601
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32602
+
32603
+ "use strict";
32604
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32605
+ /* harmony export */ j: function() { return /* binding */ applyLink; }
32606
+ /* harmony export */ });
32607
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23545);
32608
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97099);
32609
+ /*!
32610
+ * Jodit Editor (https://xdsoft.net/jodit/)
32611
+ * Released under MIT see LICENSE.txt in the project root for license information.
32612
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32613
+ */
32614
+
32615
+
32616
+ /** @private */
32617
+ function applyLink(j, image, imageLink, imageLinkOpenInNewTab) {
32618
+ // Link
32619
+ let link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(image, 'a', j.editor);
32620
+ if (imageLink) {
32621
+ if (!link) {
32622
+ link = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.wrap(image, 'a', j.createInside);
32623
+ }
32624
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'href', imageLink);
32625
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__/* .attr */ .C)(link, 'target', imageLinkOpenInNewTab ? '_blank' : null);
32626
+ }
32627
+ else {
32628
+ if (link && link.parentNode) {
32629
+ link.parentNode.replaceChild(image, link);
32630
+ }
32631
+ }
32632
+ }
32633
+
32634
+
32635
+ /***/ }),
32636
+
32637
+ /***/ 82714:
32638
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32639
+
32640
+ "use strict";
32641
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32642
+ /* harmony export */ N: function() { return /* binding */ applyMargin; }
32643
+ /* harmony export */ });
32644
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4401);
32645
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10926);
32646
+ /*!
32647
+ * Jodit Editor (https://xdsoft.net/jodit/)
32648
+ * Released under MIT see LICENSE.txt in the project root for license information.
32649
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32650
+ */
32651
+
32652
+
32653
+ /** @private */
32654
+ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image, marginIsLocked) {
32655
+ const margins = [marginTop, marginRight, marginBottom, marginLeft];
32656
+ const applyMargin = (key, value) => {
32657
+ const oldValue = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key);
32658
+ const v = (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__/* .normalSizeToString */ .n)(value);
32659
+ if (oldValue.toString() !== v.toString()) {
32660
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_1__/* .css */ .A)(image, key, v);
32661
+ }
32662
+ };
32663
+ if (!marginIsLocked) {
32664
+ const sides = [
32665
+ 'margin-top',
32666
+ 'margin-right',
32667
+ 'margin-bottom',
32668
+ 'margin-left'
32669
+ ];
32670
+ margins.forEach((margin, index) => {
32671
+ const side = sides[index];
32672
+ applyMargin(side, margin);
32673
+ });
32674
+ }
32675
+ else {
32676
+ applyMargin('margin', marginTop);
32677
+ }
32678
+ }
32679
+
32680
+
32681
+ /***/ }),
32682
+
32683
+ /***/ 26277:
32684
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
32685
+
32686
+ "use strict";
32687
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32688
+ /* harmony export */ q: function() { return /* binding */ applySize; }
32689
+ /* harmony export */ });
32690
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97099);
32691
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4401);
32692
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10926);
32693
+ /*!
32694
+ * Jodit Editor (https://xdsoft.net/jodit/)
32695
+ * Released under MIT see LICENSE.txt in the project root for license information.
32696
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
32697
+ */
32698
+
32699
+
32700
+
32701
+ /** @private */
32702
+ function applySize(image, imageWidth, imageHeight, sizeIsLocked) {
32703
+ // Size
32704
+ if (imageWidth !== image.offsetWidth ||
32705
+ imageHeight !== image.offsetHeight) {
32706
+ const updatedWidth = imageWidth ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageWidth) : null;
32707
+ let updatedHeight = imageHeight
32708
+ ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .normalSizeToString */ .n)(imageHeight)
32709
+ : null;
32710
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__/* .css */ .A)(image, {
32711
+ width: updatedWidth,
32712
+ height: updatedWidth && sizeIsLocked ? null : updatedHeight
32713
+ });
32714
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width', (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') ? updatedWidth : null);
32715
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'width') || sizeIsLocked) {
32716
+ updatedHeight = null;
32717
+ }
32718
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(image, 'height', updatedHeight);
32719
+ }
31923
32720
  }
31924
32721
 
31925
32722
 
@@ -37886,7 +38683,8 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('selec
37886
38683
  */
37887
38684
 
37888
38685
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .T.prototype.select = {
37889
- normalizeSelectionBeforeCutAndCopy: false
38686
+ normalizeSelectionBeforeCutAndCopy: false,
38687
+ normalizeTripleClick: true
37890
38688
  };
37891
38689
 
37892
38690
 
@@ -37962,7 +38760,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
37962
38760
  }
37963
38761
  }
37964
38762
  /**
37965
- * @event outsideClick(e) - when user clicked in the outside of editor
38763
+ * @event outsideClick(e) - when user clicked on the outside of editor
37966
38764
  */
37967
38765
  onOutsideClick(e) {
37968
38766
  const node = e.target;
@@ -37974,7 +38772,7 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
37974
38772
  this.j.e.fire('outsideClick', e);
37975
38773
  }
37976
38774
  }
37977
- beforeCommandCut(command) {
38775
+ beforeCommandCut() {
37978
38776
  const { s } = this.j;
37979
38777
  if (!s.isCollapsed()) {
37980
38778
  const current = s.current();
@@ -37983,13 +38781,27 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
37983
38781
  }
37984
38782
  }
37985
38783
  }
37986
- beforeCommandSelectall(command) {
38784
+ beforeCommandSelectAll() {
37987
38785
  const { s } = this.j;
37988
38786
  s.focus();
37989
38787
  s.select(this.j.editor, true);
37990
38788
  s.expandSelection();
37991
38789
  return false;
37992
38790
  }
38791
+ /**
38792
+ * Normalize selection after triple click
38793
+ */
38794
+ onTripleClickNormalizeSelection(e) {
38795
+ if (e.detail !== 3 || !this.j.o.select.normalizeTripleClick) {
38796
+ return;
38797
+ }
38798
+ const { s } = this.j;
38799
+ const { startContainer, startOffset } = s.range;
38800
+ if (startOffset === 0 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(startContainer)) {
38801
+ s.select(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.closest(startContainer, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isBlock, this.j.editor) ||
38802
+ startContainer, true);
38803
+ }
38804
+ }
37993
38805
  onCopyNormalizeSelectionBound(e) {
37994
38806
  const { s, editor, o } = this.j;
37995
38807
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -38015,7 +38827,10 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */
38015
38827
  ], select.prototype, "beforeCommandCut", null);
38016
38828
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38017
38829
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':beforeCommandSelectall'])
38018
- ], select.prototype, "beforeCommandSelectall", null);
38830
+ ], select.prototype, "beforeCommandSelectAll", null);
38831
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38832
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':click'])
38833
+ ], select.prototype, "onTripleClickNormalizeSelection", null);
38019
38834
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
38020
38835
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.watch)([':copy', ':cut'])
38021
38836
  ], select.prototype, "onCopyNormalizeSelectionBound", null);